@arcgis/core 4.33.0-next.20250305 → 4.33.0-next.20250307
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/arcade/arcadeAsyncRuntime.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/featureSetUtils.js +1 -1
- package/arcade/featureset/actions/GroupBy.js +1 -1
- package/arcade/featureset/actions/OrderBy.js +1 -1
- package/arcade/functions/aiServices.js +5 -0
- package/arcade/functions/date.js +1 -1
- package/arcade/functions/feature.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/functions/featuresetstring.js +1 -1
- package/arcade/functions/fieldStats.js +1 -1
- package/arcade/functions/geometry.js +1 -1
- package/arcade/functions/maths.js +1 -1
- package/arcade/functions/string.js +1 -1
- package/arcade/languageUtils.js +1 -1
- package/arcade/treeAnalysis.js +1 -1
- package/arcade.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/028e2e0fa6971aaaaae8.js +1 -0
- package/assets/esri/core/workers/chunks/0576b035c1654a43ad5c.js +1 -0
- package/assets/esri/core/workers/chunks/081699532b183db1e7c2.js +1 -0
- package/assets/esri/core/workers/chunks/087a09b4c41abef6b516.js +1 -0
- package/assets/esri/core/workers/chunks/{7ec2f531217718e76469.js → 0b4e63e705db09dbe171.js} +1 -1
- package/assets/esri/core/workers/chunks/0c9e933b392616460e62.js +1 -0
- package/assets/esri/core/workers/chunks/{c3d23c45db427a29d596.js → 0f4a2bdf5bb2f4303b7f.js} +1 -1
- package/assets/esri/core/workers/chunks/{f995a74bd9b58c069c07.js → 10631680abe7607616ca.js} +1 -1
- package/assets/esri/core/workers/chunks/{567aa24d7e99e0b5a6cb.js → 1263391920fbb8926ced.js} +1 -1
- package/assets/esri/core/workers/chunks/186387a561364a11e574.js +1 -0
- package/assets/esri/core/workers/chunks/1cc7bbd0f4a8cf06050a.js +1 -0
- package/assets/esri/core/workers/chunks/1d0473dd43c88ab5776d.js +1 -0
- package/assets/esri/core/workers/chunks/{ef46613c3aa363dc1cfc.js → 285e573aa6f3acf70b32.js} +1 -1
- package/assets/esri/core/workers/chunks/2bb508701ad8ccc3d6ab.js +1 -0
- package/assets/esri/core/workers/chunks/36fe6b8228e622407ec2.js +1 -0
- package/assets/esri/core/workers/chunks/37a3533f004bf2e888da.js +1 -0
- package/assets/esri/core/workers/chunks/3be465c653236d6d8c1f.js +1 -0
- package/assets/esri/core/workers/chunks/3e4204502f6e09483c60.js +1 -0
- package/assets/esri/core/workers/chunks/3e9cd82325c473ddbf1f.js +1 -0
- package/assets/esri/core/workers/chunks/{370ab4b33fb7292bb3b8.js → 424e2058228e5f6a183d.js} +1 -1
- package/assets/esri/core/workers/chunks/4496ef270c700078df0c.js +1 -0
- package/assets/esri/core/workers/chunks/458f4c6c8820c1f62f69.js +1 -0
- package/assets/esri/core/workers/chunks/49c346d2fb8538990f45.js +1 -0
- package/assets/esri/core/workers/chunks/4bb65ef7b3a02ebe416e.js +1 -0
- package/assets/esri/core/workers/chunks/4c765464288b6d096d08.js +1 -0
- package/assets/esri/core/workers/chunks/4eb1a2433f675bde12ad.js +1 -0
- package/assets/esri/core/workers/chunks/4ffdff269aae8c293cb4.js +1 -0
- package/assets/esri/core/workers/chunks/55f7b1de8882569861c0.js +1 -0
- package/assets/esri/core/workers/chunks/564cc81c232c97646833.js +1 -0
- package/assets/esri/core/workers/chunks/5a6f7360183693f8490d.js +1 -0
- package/assets/esri/core/workers/chunks/5f8028928ae8e5d27dda.js +1 -0
- package/assets/esri/core/workers/chunks/{c03e6e35082beaec02a6.js → 5fa5bfc70512994f5ec1.js} +1 -1
- package/assets/esri/core/workers/chunks/605eddec7aac891ed141.js +1 -0
- package/assets/esri/core/workers/chunks/66cba22c09f595bba3bf.js +1 -0
- package/assets/esri/core/workers/chunks/6cb5ce0a6bb85c624a21.js +1 -0
- package/assets/esri/core/workers/chunks/{bf9b45604249520b596a.js → 74c01de62ccaed0666e0.js} +1 -1
- package/assets/esri/core/workers/chunks/7a4413a188a8f1affb2f.js +1 -0
- package/assets/esri/core/workers/chunks/{b66e8a48ce7098ca43d5.js → 7c3cd6aefd16fcc1a7fd.js} +1 -1
- package/assets/esri/core/workers/chunks/7e0e9ca84490a0c67197.js +1 -0
- package/assets/esri/core/workers/chunks/{3315de71eb8791189c05.js → 835fa4484c58d9b31c78.js} +1 -1
- package/assets/esri/core/workers/chunks/88a7780b1c689afff8bd.js +1 -0
- package/assets/esri/core/workers/chunks/8d636075e5aa053940fc.js +1 -0
- package/assets/esri/core/workers/chunks/{7ca33e03a2fd217b9443.js → 9dfdd8e91897d166d888.js} +1 -1
- package/assets/esri/core/workers/chunks/{790f86ddf57be50e0dd5.js → 9ef509e0853ad41f7690.js} +1 -1
- package/assets/esri/core/workers/chunks/a2377969f76640f1d6fe.js +1 -0
- package/assets/esri/core/workers/chunks/aa3a45e8228216c1739b.js +1 -0
- package/assets/esri/core/workers/chunks/b2289c18c02c868a2939.js +1 -0
- package/assets/esri/core/workers/chunks/b5f44cf03c4e5cc07bc4.js +1 -0
- package/assets/esri/core/workers/chunks/b948fe33b4d650eea796.js +1 -0
- package/assets/esri/core/workers/chunks/bdeac9196f28aff93e68.js +1 -0
- package/assets/esri/core/workers/chunks/c591527543fd75a917d4.js +1 -0
- package/assets/esri/core/workers/chunks/{ca4af35af02e3804042e.js → c6580fdcdc33153008b0.js} +1 -1
- package/assets/esri/core/workers/chunks/{fe8ee1938d196a70d809.js → ca0572fe5614005acceb.js} +1 -1
- package/assets/esri/core/workers/chunks/{67c1e2c17ea3ca27248c.js → cbbbaccc0d3683e1c0fe.js} +1 -1
- package/assets/esri/core/workers/chunks/ccc6f6f7052985bebdab.js +1 -0
- package/assets/esri/core/workers/chunks/d72d993b36daf6ec2a10.js +1 -0
- package/assets/esri/core/workers/chunks/eb9d2bb8b44a93347274.js +1 -0
- package/assets/esri/core/workers/chunks/f809cbfb744adb4fad29.js +1 -0
- package/assets/esri/core/workers/chunks/fa011ad649c05201e92a.js +1 -0
- package/assets/esri/core/workers/chunks/fa7ddf3c89cdb8052b26.js +1 -0
- package/assets/esri/core/workers/chunks/fdc9bd8f309af610fa62.js +1 -0
- package/assets/esri/libs/parquet/pkg/arcgis_parquet_bg.wasm +0 -0
- package/assets/esri/themes/base/widgets/_ElevationProfile.scss +2 -2
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/LineMarker.glsl.js +2 -2
- package/chunks/aiServices.js +5 -0
- package/chunks/array.js +1 -1
- package/chunks/languageUtils.js +1 -1
- package/copyright.txt +38 -0
- package/editing/sharedTemplates/executor/createTemplateExecutor.js +1 -1
- package/interfaces.d.ts +11 -3
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/graphics/data/AttributesBuilder.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/data/queryValidationUtils.js +1 -1
- package/layers/graphics/editingSupport.js +1 -1
- package/layers/support/TitleCreator.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/labelFormatUtils.js +1 -1
- package/libs/parquet/parquet.js +1 -1
- package/package.json +1 -1
- package/renderers/ClassBreaksRenderer.js +1 -1
- package/renderers/DictionaryRenderer.js +1 -1
- package/renderers/UniqueValueRenderer.js +1 -1
- package/renderers/support/DictionaryControlString.js +5 -0
- package/renderers/support/DictionaryLoader.js +1 -1
- package/renderers/support/DictionaryScriptEvaluator.js +5 -0
- package/rest/featureService/FeatureService.js +1 -1
- package/rest/print.js +1 -1
- package/rest/support/TranslateContent.js +5 -0
- package/rest/support/TranslateParameters.js +5 -0
- package/rest/support/TranslateResult.js +5 -0
- package/rest/translate.js +5 -0
- package/rest/utils.js +1 -1
- package/smartMapping/statistics/support/attributeDensity.js +1 -1
- package/smartMapping/statistics/support/utils.js +1 -1
- package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
- package/smartMapping/support/utils.js +1 -1
- package/support/ArcadeExpression.js +5 -0
- package/support/loadArcade.js +5 -0
- package/support/revision.js +1 -1
- package/symbols/cim/OverrideHelper.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/utils.js +1 -1
- package/symbols/support/symbolUtils.js +1 -1
- package/views/2d/arcade/callExpressionWithCursor.js +1 -1
- package/views/2d/arcade/callExpressionWithFeature.js +1 -1
- package/views/2d/engine/webgl/mesh/factories/ResourceProxy.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterInputEvaluator.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js +1 -1
- package/views/2d/engine/webgl/util/DictionaryMatcher.js +1 -1
- package/views/2d/engine/webgl/util/MatcherContext.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/processor/AAggregateStrategy.js +1 -1
- package/views/2d/layers/features/processor/AProcessorStrategy.js +1 -1
- package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
- package/views/2d/layers/features/schema/processor/MatcherSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
- package/views/2d/layers/features/sources/FeatureSource.js +1 -1
- package/views/2d/layers/features/sources/strategies/StreamLoadStrategy.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/features/support/ComputedAttributeStorage.js +1 -1
- package/views/2d/layers/features/support/ComputedExpression.js +1 -1
- package/views/2d/layers/features/support/DictionaryTemplate.js +5 -0
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/environment/Precipitation.js +1 -1
- package/views/3d/layers/DynamicLayerView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/RouteLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/featureExpressionInfoUtils.js +1 -1
- package/views/3d/layers/graphics/queryForSymbologySnapping.js +1 -1
- package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/layers/FeatureLayerView.js +1 -1
- package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
- package/views/overlay/CrosshairOverlayItem.js +1 -1
- package/views/support/projectionUtils.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflowData.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/Edits.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/components/PendingFeatureList.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/Editor/support/dependencySort.js +5 -0
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
- package/widgets/Feature/FeatureRelationship.js +1 -1
- package/widgets/Feature/support/featureUtils.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm/RelationshipInput.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
- package/widgets/Popup.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/assets/esri/core/workers/chunks/0121702bc9a1f3a85f1f.js +0 -1
- package/assets/esri/core/workers/chunks/05b7c739115be0490583.js +0 -1
- package/assets/esri/core/workers/chunks/0ce1bfcdcccb679569f8.js +0 -1
- package/assets/esri/core/workers/chunks/1007c1a908b6e503e0db.js +0 -1
- package/assets/esri/core/workers/chunks/1439f1d84e21e6295e3f.js +0 -1
- package/assets/esri/core/workers/chunks/1912d25f8007685c7aee.js +0 -1
- package/assets/esri/core/workers/chunks/1bd58eaac6f4906bbdae.js +0 -1
- package/assets/esri/core/workers/chunks/2c091edee3601f345f5f.js +0 -1
- package/assets/esri/core/workers/chunks/2e40f2527345ad85d800.js +0 -1
- package/assets/esri/core/workers/chunks/30f271bbc34f66cbfc23.js +0 -1
- package/assets/esri/core/workers/chunks/36b406131cd864567033.js +0 -1
- package/assets/esri/core/workers/chunks/4395b7263a299a8020d4.js +0 -1
- package/assets/esri/core/workers/chunks/4c15de6b2b8eefd76b61.js +0 -1
- package/assets/esri/core/workers/chunks/4c596cb20baaae5166de.js +0 -1
- package/assets/esri/core/workers/chunks/4d16b1e50caad0da7838.js +0 -1
- package/assets/esri/core/workers/chunks/5802406d0a239a27a9a3.js +0 -1
- package/assets/esri/core/workers/chunks/5c86df2a5e16877ba614.js +0 -1
- package/assets/esri/core/workers/chunks/62c9171a58160ea099f8.js +0 -1
- package/assets/esri/core/workers/chunks/6a4731b47629604a9ca0.js +0 -1
- package/assets/esri/core/workers/chunks/81c507c0d901448835f4.js +0 -1
- package/assets/esri/core/workers/chunks/8278d9263e9b7e3bf2d1.js +0 -1
- package/assets/esri/core/workers/chunks/8926f672397620591740.js +0 -1
- package/assets/esri/core/workers/chunks/8b057b5a606ac3669a78.js +0 -1
- package/assets/esri/core/workers/chunks/8bf623f560b1ed440004.js +0 -1
- package/assets/esri/core/workers/chunks/924176d9ab2e070248a8.js +0 -1
- package/assets/esri/core/workers/chunks/988efc508c33ca341e49.js +0 -1
- package/assets/esri/core/workers/chunks/98cbfc72430a378a9451.js +0 -1
- package/assets/esri/core/workers/chunks/9fde9309cb64f1a9301c.js +0 -1
- package/assets/esri/core/workers/chunks/a901c445d36f1a9e7df8.js +0 -1
- package/assets/esri/core/workers/chunks/ab525991f71240d68471.js +0 -1
- package/assets/esri/core/workers/chunks/af27a3f646a4404d3b8d.js +0 -1
- package/assets/esri/core/workers/chunks/b464b7800a2ddd92b9a7.js +0 -1
- package/assets/esri/core/workers/chunks/c15c3fec95f365580902.js +0 -1
- package/assets/esri/core/workers/chunks/c1e343cdf85da40ac10e.js +0 -1
- package/assets/esri/core/workers/chunks/c3806be4a760735e6082.js +0 -1
- package/assets/esri/core/workers/chunks/c3dc8d1958ddc71e1129.js +0 -1
- package/assets/esri/core/workers/chunks/c7b0f58550e63ce6ad5b.js +0 -1
- package/assets/esri/core/workers/chunks/ccf8a423eee7ef4ffe4c.js +0 -1
- package/assets/esri/core/workers/chunks/d24321b1eeabe9ec553c.js +0 -1
- package/assets/esri/core/workers/chunks/dd913cb7cf3bb172b34c.js +0 -1
- package/assets/esri/core/workers/chunks/e3e049311bced533c853.js +0 -1
- package/assets/esri/core/workers/chunks/e3e5a215dcd531b1196f.js +0 -1
- package/assets/esri/core/workers/chunks/f31986ea5cadfade8344.js +0 -1
- package/assets/esri/core/workers/chunks/f350aefc5e348ebad1da.js +0 -1
- package/support/arcadeOnDemand.js +0 -5
- package/views/3d/layers/support/projectExtentUtils.js +0 -5
package/widgets/Print.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import t from"../core/Collection.js";import{JSONMap as i}from"../core/jsonMap.js";import{watch as a,whenOnce as l}from"../core/reactiveUtils.js";import{unitName as o}from"../core/unitFormatUtils.js";import{addProxy as n,hasSameOrigin as s}from"../core/urlUtils.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import{ensureInteger as c}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import d from"../geometry/SpatialReference.js";import{isValid as m}from"../geometry/support/spatialReferenceUtils.js";import{reArcGISOnlineDomain as u}from"../portal/support/urlUtils.js";import{getToken as h}from"../rest/utils.js";import{formatJsonMap as b}from"../rest/support/fileFormat.js";import _ from"./Widget.js";import v from"./Print/FileLink.js";import g from"./Print/PrintViewModel.js";import{loadCalciteComponents as f}from"./support/componentsUtils.js";import{globalCss as y}from"./support/globalCss.js";import{Heading as w}from"./support/Heading.js";import{legacyIcon as T}from"./support/legacyIcon.js";import{isRTL as x,isActivationKey as k}from"./support/widgetUtils.js";import{messageBundle as C}from"./support/decorators/messageBundle.js";import{tsx as S,tsxFragment as I}from"./support/jsxFactory.js";import{formatNumber as O}from"../intl/number.js";const $=t.ofType(v),E="map-only";var L;!function(e){e.layout="layoutTab",e.mapOnly="mapOnlyTab",e.export="exportTab"}(L||(L={}));const F="esri-print",M=`${F}__advanced-options-button`,P={base:F,headerTitle:`${F}__header-title`,layoutTabList:`${F}__layout-tab-list`,layoutTab:`${F}__layout-tab`,layoutSection:`${F}__layout-section`,mapOnlySection:`${F}__map-only-section`,panelItemsCentered:`${F}__panel-items--centered`,loader:`${F}__loader`,advancedOptionsButton:M,advancedOptionsButtonContainer:`${M}-container`,advancedOptionsButtonTitle:`${M}-title`,advancedOptionsButtonIconOpened:`${M}-icon--opened`,advancedOptionsButtonIconClosed:`${M}-icon--closed`,advancedOptionsButtonIconClosed_RTL:`${M}-icon--closed-rtl`,swapButton:`${F}__swap-button`,printButton:`${F}__export-button`,printButtonSection:`${F}__export-button-section`,printButtonSectionDivider:`${F}__export-button-section--divider`,templateSelectContainer:`${F}__template-select-container`,templateSelectBlock:`${F}__template-select-block`,templateSelectIcon:`${F}__template-select-icon`,templateSelectError:`${F}__template-select-error`,templateSelectArrow:`${F}__template-select-arrow`,formSectionContainer:`${F}__form-section-container`,formCheckboxLabel:`${F}__form-checkbox-label`,advancedOptionsSection:`${F}__advanced-options-section`,advancedOptionsContainer:`${F}__advanced-options-container`,browseTemplateButtonContainer:`${F}__browse-template-button-container`,browseTemplateButtonContainerFilter:`${F}__browse-template-button-container-filter`,exportedFilesContainer:`${F}__export-panel-container`,exportedFilesTitle:`${F}__export-title`,exportedFile:`${F}__exported-file`,exportedFileLink:`${F}__exported-file-link`,exportedFileLinkTitle:`${F}__exported-file-link-title`,exportedFileLinkDescription:`${F}__exported-file-link-description`,exportedFilesEmpty:`${F}__exported-files-empty`,printWidgetContainer:`${F}__container`,content:`${F}__content`,panelContainer:`${F}__panel-container`,scaleInfoContainer:`${F}__scale-info-container`,scaleInputContainer:`${F}__scale-input-container`,scaleInput:`${F}__scale-input`,sizeContainer:`${F}__size-container`,panelError:`${F}__panel--error`,exportedFileError:`${F}__exported-file--error`,exportedFileLoader:`${F}__exported-file--loader`,exportSection:`${F}__export-section`,exportSectionCentered:`${F}__export-section--centered`,templateButtonContainer:`${F}__template-button-container`,templateDoneButton:`${F}__template-done-button`,templateSelectFlowItemContainer:`${F}__template-select-flow-item-container`,templateSelectFlowItemContent:`${F}__template-select-flow-item-content`,templateSelectFlowItemListHeading:`${F}__template-select-flow-item-list-heading`,srLabel:`${F}__sr-label`,invalidWkidText:`${F}__invalid-wkid-text`};function A(e,t,i,a){const l=i/t,o=a/t;return{width:Math.round(e*l),height:Math.round(e*o)}}function B(e){return!isNaN(e)&&e>0}function N(e){return e?.toLowerCase()===E}function R(e){const{state:t,extension:i}=e;switch(t){case"pending":return"spinner";case"error":return"exclamation-mark-circle";default:return i?.toLowerCase()?.includes("pdf")?"file-pdf":"file"}}const D=new i({inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"}),j=new Map([["a3-landscape","a3-landscape"],["a3-portrait","a3-portrait"],["a4-landscape","a4-landscape"],["a4-portrait","a4-portrait"],["letter-ansi-a-landscape","ansi-a-landscape"],["letter-ansi-a-portrait","ansi-a-portrait"],["tabloid-ansi-b-landscape","ansi-b-landscape"],["tabloid-ansi-b-portrait","ansi-b-portrait"]]);let V=class extends _{constructor(e,t){super(e,t),this._activeTabFocusRequested=!1,this._awaitingServerResponse=!1,this._exportedFileNameMap={},this._selectedTab=L.layout,this._pendingExportScroll=!1,this._rootNode=null,this._selectedTemplate=null,this._formats=[],this._showTemplates=!1,this._isValidSpatialReference=!0,this.allowedFormatsForSaving=null,this.browseTemplateButtonOnClick=null,this.exportedLinks=new $,this.headerVisible=!0,this.headingLevel=3,this.includeOrganizationTemplates=!0,this.messagesCommon=null,this.messagesUnits=null,this.saveExportEnabled=!1,this.saveExportHidden=!0,this.saveAsButtonCallback=null,this.viewModel=new g,this._onInput=e=>{this._selectedTab===L.layout?this.templateOptions.title=e.currentTarget.value:this._selectedTab===L.mapOnly&&(this.templateOptions.fileName=e.currentTarget.value)},this._handleLinkClick=e=>{const t=e.currentTarget["data-item"];if(!t||"ready"!==t.state||!t.url)return;const i=h(this.viewModel.effectivePrintServiceUrl),a=t.url,l=document.createElement("a");if(l.target="_blank",l.href=a,l.rel="noreferrer",l.download=t.formattedName??"",!i)return l.click(),void e.stopPropagation();e.preventDefault();const o=new URL(a);o.searchParams.set("token",i),l.href=o.href,l.click(),l.href=a},this._focusOnTabChange=this._focusOnTabChange.bind(this)}initialize(){this.addHandles([a((()=>[this.templateOptions.format,this.viewModel.templatesInfo?.format]),(()=>{const{templatesInfo:e}=this.viewModel;if(!e)return;if(this._formats.length!==e.format.choiceList.length){const t=b.apiValues;this._formats=e.format.choiceList.map((e=>{const i=t.find((t=>new RegExp(`\\b${t}\\b`,"i").test(e)))??e;return{value:i,label:e===i?e.toUpperCase():e}})).sort(((e,t)=>e.label.localeCompare(t.label)))}const t=this._formats.some((({value:e})=>new RegExp(`\\b${e}\\b`,"i").test(this.templateOptions.format)));if(!e.format.defaultValue||t);else{const t=this._formats.find((({value:t})=>new RegExp(`\\b${t}\\b`,"i").test(e.format.defaultValue)))?.value;t&&(this.templateOptions.format=t)}})),a((()=>[this.templateOptions.id,this.viewModel.loaded]),(async()=>{const{layout:e}=this.templateOptions;this._selectedTab=N(e)?L.mapOnly:L.layout,this._selectedTab===L.layout&&this.viewModel.loaded&&(this._selectedTemplate=this.viewModel.getLayoutTemplateById(this.templateOptions.id))})),a((()=>this.templateOptions.dpi),(e=>{e<=0&&(this.templateOptions.dpi=1)})),a((()=>this.viewModel.view?.scale),(e=>{!e||this.templateOptions.scaleEnabled&&this.templateOptions.scale||(this.templateOptions.scale=e)}))]);for(const{name:a,extension:l}of this.exportedLinks)a&&l&&this._updateExportedFileNameMap(`${a}${l}`);const{height:e,width:t}=this.templateOptions;this.templateOptions.width=t||800,this.templateOptions.height=e||1100;const i=setTimeout((()=>{this._awaitingServerResponse=!0,this.scheduleRender()}),500);this.viewModel.load().then((()=>{clearTimeout(i),this._awaitingServerResponse=!1}))}loadDependencies(){return f({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),link:()=>import("@esri/calcite-components/dist/components/calcite-link")})}destroy(){this.viewModel.destroy()}get allowedFormats(){return this.viewModel.allowedFormats}set allowedFormats(e){this.viewModel.allowedFormats=e}get allowedLayouts(){return this.viewModel.allowedLayouts}set allowedLayouts(e){this.viewModel.allowedLayouts=e}get error(){return this.viewModel.error}get extraParameters(){return this.viewModel.extraParameters}set extraParameters(e){this.viewModel.extraParameters=e}get icon(){return"print"}set icon(e){this._overrideIfSome("icon",e)}get includeDefaultTemplates(){return this.viewModel.includeDefaultTemplates}set includeDefaultTemplates(e){this.viewModel.includeDefaultTemplates=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get outSpatialReference(){return this.viewModel.outSpatialReference}set outSpatialReference(e){this.viewModel.outSpatialReference=e}get portal(){return this.viewModel.portal}set portal(e){this.viewModel.portal=e}get showPrintAreaEnabled(){return this.viewModel.showPrintAreaEnabled}set showPrintAreaEnabled(e){this.viewModel.showPrintAreaEnabled=e}get printServiceUrl(){return this.viewModel.printServiceUrl}set printServiceUrl(e){this.viewModel.printServiceUrl=e}get templateCustomTextElements(){return this.viewModel.templateCustomTextElements}set templateCustomTextElements(e){this.viewModel.templateCustomTextElements=e}get templateOptions(){return this.viewModel.templateOptions}set templateOptions(e){this.viewModel.templateOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const{messages:e,templateOptions:t,viewModel:i,view:a}=this,{attributionEnabled:l,author:o,copyright:n,dpi:s,format:r,height:p,layout:u,layoutItem:h,legendEnabled:b,northArrowEnabled:_,scaleBarEnabled:v,scaleEnabled:g,scale:f,width:k}=t,C="ready"!==i.state||this._awaitingServerResponse||!(u||h),I=this._renderTitleOrFileNameSection(),O=S("div",{class:P.formSectionContainer},S("calcite-label",null,e.fileFormatTitle,S("calcite-combobox",{clearDisabled:!0,label:e.formatDefaultOption,maxItems:6,placeholder:e.formatDefaultOption,selectionMode:"single-persist",onCalciteComboboxChange:({currentTarget:e})=>{this.templateOptions.format=e.selectedItems[0]?.value??"pdf"}},this._formats.map((({value:e,label:t},i)=>S("calcite-combobox-item",{key:`file-format-${i}`,selected:e===this.templateOptions.format,textLabel:t,value:e})))))),$=S("calcite-label",{layout:"inline"},S("calcite-switch",{checked:this.showPrintAreaEnabled,onCalciteSwitchChange:e=>{this.showPrintAreaEnabled=!!e.currentTarget.checked}}),e.printPreview),E=S("div",null,S("div",{class:P.formSectionContainer},S("calcite-label",null,e.template,S("calcite-block",{class:P.templateSelectContainer,collapsible:!1,description:this._getPageSizeLabel(this._selectedTemplate),heading:this._getTemplateLabel(this._selectedTemplate,!0),key:"template-select-block",loading:"loading"===this._selectedTemplate?.state,onclick:()=>this._showTemplates=!0,onkeydown:e=>{"Enter"!==e.key&&" "!==e.key||(this._showTemplates=!0)},tabIndex:0},S("calcite-icon",{class:P.templateSelectIcon,icon:(this._selectedTemplate?.layout?j.get(this._selectedTemplate.layout):null)||"custom-print",key:"template-select-icon",scale:"l",slot:"content-start"}),"error"===this._selectedTemplate?.state?S("calcite-icon",{class:P.templateSelectError,icon:"exclamation-mark-circle",key:"template-select-error",scale:"s",slot:"actions-end"}):null,S("calcite-icon",{class:P.templateSelectArrow,icon:x()?"chevron-left":"chevron-right",key:"template-select-arrow",scale:"s",slot:"actions-end"})))),$),F=S("div",{class:P.formSectionContainer},S("calcite-label",null,e.dpi,S("calcite-input-number",{bind:this,"data-input-name":"dpi",min:1,value:`${s}`,onCalciteInputNumberInput:this._handleDPIChange}))),M=S("div",{class:P.formSectionContainer},S("calcite-label",null,S("div",{class:P.srLabel},e.outSpatialReference,S("calcite-link",{href:"https://developers.arcgis.com/rest/services-reference/enterprise/using-spatial-references/",target:"_blank"},"(WKID)")),S("calcite-input-number",{bind:this,"data-input-name":"outSpatialReference",integer:!0,numberButtonType:"none",value:i.outSpatialReference?.wkid?.toString()??"",onCalciteInputNumberInput:({currentTarget:e})=>{const t=c(e.value);i.outSpatialReference=Number.isNaN(t)||null==t?null:new d({wkid:t}),this._isValidSpatialReference=!i.outSpatialReference||m(i.outSpatialReference)}}),this._isValidSpatialReference?null:S("div",{class:P.invalidWkidText,key:`out-sr-${i.outSpatialReference?.wkid}`},e.invalidWkid))),A=S("div",{class:this.classes(P.scaleInfoContainer,P.formSectionContainer)},S("calcite-label",{layout:"inline"},S("calcite-checkbox",{bind:this,checked:g,"data-option-name":"scaleEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.scale),S("div",{class:P.scaleInputContainer},S("calcite-input-number",{"aria-label":e.scaleLabel,"aria-valuenow":`${f}`,bind:this,class:P.scaleInput,"data-input-name":"scale",disabled:!g,value:`${f}`,onCalciteInputNumberInput:this._updateNumberInputValue}),S("calcite-button",{appearance:"outline","aria-label":e.reset,bind:this,disabled:!g,iconStart:"refresh",kind:"neutral",onclick:this._resetToCurrentScale}))),B=S("div",{"aria-labelledby":`${this.id}__advancedOptionsForLayout`,class:P.advancedOptionsContainer,key:"advanced-section-for-layout"},A,this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasAuthorText??1?S("div",{class:P.formSectionContainer,key:"author-info"},S("calcite-label",null,e.author,S("calcite-input",{bind:this,"data-input-name":"author",value:o??"",onCalciteInputInput:this._updateInputValue}))):null,this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasCopyrightText??1?S("div",{class:P.formSectionContainer,key:"copyright-text"},S("calcite-label",null,e.copyright,S("calcite-input",{bind:this,"data-input-name":"copyright",value:n??"",onCalciteInputInput:this._updateInputValue}))):null,F,M,this._renderCustomTextElementSection(),this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasLegend??1?S("div",{class:P.formSectionContainer,key:"legend-info"},S("calcite-label",{layout:"inline"},S("calcite-checkbox",{bind:this,checked:!!b,"data-option-name":"legendEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.legend)):null,this._selectedTemplate?.mapSurroundInfoOptions?.northArrow.length?S("div",{class:P.formSectionContainer,key:"north-arrow"},S("calcite-label",{layout:"inline"},S("calcite-checkbox",{bind:this,checked:!!_,"data-option-name":"northArrowEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.northArrow)):null,this._selectedTemplate?.mapSurroundInfoOptions?.scaleBar.length?S("div",{class:P.formSectionContainer,key:"scale-bar"},S("calcite-label",{layout:"inline"},S("calcite-checkbox",{bind:this,checked:!!v,"data-option-name":"scaleBarEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.scaleBar)):null),N=S("div",{"aria-labelledby":`${this.id}__advancedOptionsForMapOnly`,class:P.advancedOptionsContainer},A,F,M,S("div",{class:P.formSectionContainer},S("calcite-label",{layout:"inline"},S("calcite-checkbox",{bind:this,checked:l,"data-option-name":"attributionEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.attribution)),this._renderCustomTextElementSection()),R=this.exportedLinks.toArray(),D=this._renderExportedLinkItems(R),V={[P.exportSectionCentered]:!R.length},U=this._selectedTab===L.layout?S("section",{"aria-labelledby":`${this.id}__layoutTab`,class:P.layoutSection,id:`${this.id}__layoutContent`,key:"esri-print__layoutContent",role:"tabpanel"},S("div",{class:P.panelContainer},this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasTitleText??1?I:null,E,this._selectedTab===L.layout?O:null,S("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(P.panelContainer,P.advancedOptionsSection),collapsible:!0,disabled:!(u||h?.id),heading:e.advancedOptions,id:"advancedOptionsForLayout",key:"advanced-options-for-layout"},B))):this._selectedTab===L.mapOnly?S("section",{"aria-labelledby":`${this.id}__mapOnlyTab`,class:P.mapOnlySection,id:`${this.id}__mapOnlyContent`,key:"esri-print__mapOnlyContent",role:"tabpanel"},S("div",{class:P.panelContainer},I,O,S("div",null,S("div",{class:this.classes(P.sizeContainer,P.formSectionContainer)},S("calcite-label",null,e.width,S("calcite-input-number",{bind:this,"data-input-name":"width",value:`${k}`,onCalciteInputNumberInput:this._updateNumberInputValue})),S("calcite-label",null,e.height,S("calcite-input-number",{bind:this,"data-input-name":"height",value:`${p}`,onCalciteInputNumberInput:this._updateNumberInputValue})),S("button",{"aria-label":e.swap,bind:this,class:this.classes(y.widgetButton,P.swapButton,T.swap),onclick:this._switchInput,type:"button"})),$),S("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(P.panelContainer,P.advancedOptionsSection),collapsible:!0,heading:e.advancedOptions,id:"advancedOptionsForMapOnly",key:"advanced-options-for-map-only"},N))):S("section",{"aria-labelledby":`${this.id}__exportTab`,class:this.classes(P.exportSection,V),id:`${this.id}__exportContent`,key:"esri-print__exportContent",role:"tabpanel"},S("div",{class:P.panelContainer},S("div",{afterUpdate:this._scrollExportIntoView,bind:this,class:P.exportedFilesContainer},0===R.length?S("div",{class:P.exportedFilesEmpty},S("calcite-icon",{icon:"file",scale:"l"}),S("div",null,S(w,{class:P.exportedFilesTitle,level:this.headingLevel},e.noExportedFiles),S("div",null,e.exportHint))):D))),H="2d"!==a?.type,z=S("div",{class:P.panelError},a?H?e.sceneViewError:e.serviceError:e.noViewError),W=R.some((({state:e})=>"pending"===e)),q=S("div",{class:P.content,key:"panel"},S("div",null,S("ul",{bind:this,class:P.layoutTabList,onclick:this._toggleLayoutPanel,onkeydown:this._handleLayoutPanelKeyDown,role:"tablist"},S("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${this._selectedTab===L.layout}`,class:P.layoutTab,"data-tab-id":L.layout,id:`${this.id}__layoutTab`,role:"tab",tabIndex:0},e.layoutTab),S("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${this._selectedTab===L.mapOnly}`,class:P.layoutTab,"data-tab-id":L.mapOnly,id:`${this.id}__mapOnlyTab`,role:"tab",tabIndex:0},e.mapOnlyTab),S("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${this._selectedTab===L.export}`,class:P.layoutTab,"data-tab-id":L.export,id:`${this.id}__exportedFilesTab`,role:"tab",tabIndex:0},W?S("calcite-loader",{inline:!0,label:"loading",scale:"s"}):null,e.exportsTab)),U),this._selectedTab!==L.export?S("div",{class:this.classes(P.printButtonSection,!this.saveExportHidden&&this.portal?P.printButtonSectionDivider:null),key:"export-button-section"},!this.saveExportHidden&&this.portal?S("calcite-label",{layout:"inline"},S("calcite-checkbox",{bind:this,checked:this.saveExportEnabled,onCalciteCheckboxChange:e=>{this.saveExportEnabled=!!e.currentTarget.checked}}),e.saveExportToMyContent):null,S("calcite-button",{"aria-label":e.exportDescription,bind:this,class:this.classes(P.printButton),disabled:C||!(u||h?.id)&&!r,onclick:this._handlePrintMap,scale:"l",width:"full"},e.export)):null),K=S("calcite-flow",{key:"root-flow"},S("calcite-flow-item",{bind:this,key:"root-flow-item",selected:!this._showTemplates},S("div",{class:P.printWidgetContainer},this.headerVisible?S("header",{class:P.headerTitle},e.export):null,this.error||H||!a?z:q)),this._renderChooseTemplateFlowItem()),G="initializing"===i.state,J=G?this._renderLoader():K,Q={[P.panelItemsCentered]:G};return S("div",{bind:this,class:this.classes(P.base,y.widget,y.panel,Q)},J)}_getPageSizeLabel(e){if(!e)return;const t=e.layoutTemplateInfo;if(!t)return;const i=D.fromJSON(t.pageUnits.toLowerCase());return`${O(t.pageSize[0])} × ${O(t.pageSize[1])} ${o(this.messagesUnits,i,"abbr")}`}_getTemplateLabel(e,t=!1){if(!e)return t?this.messages.selectTemplate:this.messages.untitled;const{label:i,layout:a,layoutItem:l,type:o}=e;if("print-service-template"===o&&this.messages[a])return this.messages[a];const n=i??a??l?.id;return n?.replaceAll("_"," ")??this.messages.untitled}_getPortalTemplates(){const{portalTemplateIds:e}=this.viewModel;return this.includeDefaultTemplates&&this.includeOrganizationTemplates?this.viewModel.defaultTemplates.toArray().filter((({layout:t,layoutItem:i})=>!N(t)&&!!i?.id&&e.includes(i.id))):[]}_getDefaultTemplates(){const{portalTemplateIds:e}=this.viewModel;return this.includeDefaultTemplates?this.viewModel.defaultTemplates.toArray().filter((({layout:t,layoutItem:i})=>!(N(t)||i?.id&&e.includes(i.id)))):[]}_getPrintServiceTemplates(){return this.includeDefaultTemplates&&this._getDefaultTemplates().length?[]:this.viewModel.printServiceTemplates.toArray().filter((({layout:e})=>!N(e)))}_renderLayoutTemplates(e,t=!1,i=!1){return t&&e.sort(((e,t)=>(e.label??"")>(t.label??"")?1:-1)),e.map((e=>S("calcite-list-item",{description:this._getPageSizeLabel(e),key:`template-${e.id}-${e.id===this.templateOptions.id}`,label:this._getTemplateLabel(e),selected:e.id===this.templateOptions.id,title:e.description??"",value:e},S("calcite-icon",{icon:(e.layout?j.get(e.layout):null)||"custom-print",slot:"content-start"}),"loading"===e.state?S("calcite-loader",{inline:!0,key:`template-loader-${e.id}`,label:"loading",scale:"s",slot:"content-end"}):null,"error"===e?.state?S("calcite-icon",{class:P.templateSelectError,icon:"exclamation-mark-circle",key:`template-error-${e.id}`,scale:"s",slot:"content-end"}):null,i?S("calcite-action",{icon:"trash",onclick:()=>this.viewModel.removePortalTemplate(e),slot:"actions-end",text:"delete"}):null)))}_renderChooseTemplateFlowItem(){if(!this._showTemplates)return null;const{messages:e}=this,t=u.test(this.portal?.url),i=this.viewModel.browseTemplates.toArray(),a=this._getPortalTemplates(),l=this._getDefaultTemplates(),o=this._getPrintServiceTemplates(),n=i.length+a.length+l.length+o.length>15,s=this.browseTemplateButtonOnClick?S("calcite-button",{appearance:"outline",class:n?P.browseTemplateButtonContainerFilter:P.browseTemplateButtonContainer,iconStart:"folder",key:"browse-template-button",onclick:this.browseTemplateButtonOnClick,slot:n?"filter-actions-end":"default"},n?null:e.browseTemplates):null;return S("calcite-flow-item",{bind:this,closable:!1,heading:e.chooseTemplate,key:"template-flow-item",selected:this._showTemplates,onCalciteFlowItemBack:e=>{e.preventDefault(),this._showTemplates=!1}},S("div",{class:P.templateSelectFlowItemContainer},S("div",{class:P.templateSelectFlowItemContent},n?null:s,S("calcite-list",{filterEnabled:n,filterProps:["label"],key:"template-list",label:e.templateList,selectionMode:"single-persist",onCalciteListChange:({currentTarget:e})=>this.viewModel.applyTemplate(e.selectedItems[0]?.value)},n?s:null,i.length?S("div",{key:"my-templates"},S("div",{class:P.templateSelectFlowItemListHeading},e.myTemplates,t?S("calcite-chip",{appearance:"outline",kind:"neutral",label:e.beta,scale:"s"},e.beta):null),this._renderLayoutTemplates(i,!0,!0)):null,a.length?S("div",{key:"org-templates"},S("div",{class:P.templateSelectFlowItemListHeading},e.organizationTemplates,t?S("calcite-chip",{appearance:"outline",kind:"neutral",label:e.beta,scale:"s"},e.beta):null),this._renderLayoutTemplates(a)):null,i.length||a.length?l.length?S("div",{key:"default-templates"},S("div",{class:P.templateSelectFlowItemListHeading},e.defaultTemplates),this._renderLayoutTemplates(l,!0)):null:this._renderLayoutTemplates(l,!0),i.length||a.length?o.length?S("div",{key:"service-templates"},S("div",{class:P.templateSelectFlowItemListHeading},e.defaultTemplates),this._renderLayoutTemplates(o)):null:this._renderLayoutTemplates(o))),S("div",{class:P.templateButtonContainer},S("calcite-button",{class:P.templateDoneButton,onclick:()=>this._showTemplates=!1},this.messagesCommon.done))))}_renderCustomTextElementSection(){const{customTextElements:e}=this.templateOptions;return e?S("div",{class:P.formSectionContainer,key:"custom-text-elements"},e.map(((e,t)=>{const[i,a]=Object.entries(e)[0];return"date"===i?null:S("calcite-label",{key:`custom-text-elements-${i}-${t}`},i,S("calcite-input",{bind:this,"data-input-custom":!0,"data-input-name":i,value:a??"",onCalciteInputInput:this._updateInputValue}))}))):null}_renderTitleOrFileNameSection(){const{title:e,fileName:t,titlePlaceHolder:i,fileNamePlaceHolder:a}=this.messages,l=this._selectedTab===L.layout?e:t,o=this._selectedTab===L.layout?i:a,n=this._selectedTab===L.layout?this.templateOptions.title:this.templateOptions.fileName;return S("div",{class:P.formSectionContainer,key:l},S("calcite-label",null,l,S("calcite-input",{placeholder:o,value:n??"",onCalciteInputInput:this._onInput})))}_focusOnTabChange(e){if(!this._activeTabFocusRequested)return;const t=e.getAttribute("data-tab-id");("layoutTab"===t&&this._selectedTab===L.layout||"mapOnlyTab"===t&&this._selectedTab===L.mapOnly||"exportTab"===t&&this._selectedTab===L.export)&&(e.focus(),this._activeTabFocusRequested=!1)}_renderLoader(){const e={[P.loader]:this._awaitingServerResponse};return S("div",{class:this.classes(e),key:"loader"})}_updateExportedFileNameMap(e){void 0!==this._exportedFileNameMap[e]?this._exportedFileNameMap[e]++:this._exportedFileNameMap[e]=0}_createFileLink(e,t){const i=t||this.messages.untitled,a=e.format.toLowerCase(),l=a.includes("png")?"png":a,o=i+l;return this._updateExportedFileNameMap(o),new v({name:i,extension:l,count:this._exportedFileNameMap[o]})}_resetToCurrentScale(){this.templateOptions.scale=this.viewModel.view?.scale}_updateCustomTextElementValue(e,t,i){e.find((e=>{const[i]=Object.entries(e)[0];return i===t}))[t]=i}_updateInputValue(e){const t=e.currentTarget,i=t.getAttribute("data-input-name"),a=!!t["data-input-custom"],{templateOptions:l}=this;a?this._updateCustomTextElementValue(l.customTextElements,i,t.value):l[i]=t.value}_updateNumberInputValue(e){const t=e.currentTarget,i=t.getAttribute("data-input-name"),{templateOptions:a}=this,l=Number(t.value);if(B(l))a[i]=l;else{const e=a[i];t.value=`${e}`}}_handleDPIChange(e){const{templateOptions:t}=this,i=t.dpi;this._updateNumberInputValue(e);const a=t.dpi,{height:l,width:o}=A(a,i,t.width,t.height);t.height=l,t.width=o}_handlePrintMap(){this._pendingExportScroll=!0;const{templateOptions:e,saveExportEnabled:t}=this,i=this.viewModel.toPrintTemplate(e),a=this._selectedTab===L.layout?i.layoutOptions?.titleText:e.fileName,l=this._createFileLink(i,a);this.exportedLinks.add(l),this.emit("submit",{link:l,saveExportEnabled:t}),this._selectedTab=L.export,this.viewModel.print(i).then((e=>{l.set({url:e&&e.url,state:"ready"})})).catch((e=>{l.set({error:e,state:"error"})})).then((()=>{this.emit("complete",{link:l,saveExportEnabled:t}),this.scheduleRender()}))}_switchInput(){[this.templateOptions.width,this.templateOptions.height]=[this.templateOptions.height,this.templateOptions.width]}_scrollExportIntoView(){if(!this._pendingExportScroll)return;this._pendingExportScroll=!1;const e=this._rootNode;if(!e)return;const{clientHeight:t,scrollHeight:i}=e,a=i-t;a>0&&(e.scrollTop=a)}_toggleInputValue(e){const t=e.target,i=t.getAttribute("data-option-name");this.templateOptions[i]=t.checked,"scaleEnabled"===i&&this._resetToCurrentScale()}_renderExportedLinkItemPopover(e){const t=this.messages,i=e.formattedName??"",{state:a}=e,o=this.saveAsButtonCallback&&"error"!==a&&this._isFormatAllowedForSaving(e.extension);return"pending"!==a&&o?S("calcite-popover",{autoClose:!0,key:`${i}-popover`,label:"Popover",offsetDistance:1,overlayPositioning:"fixed",pointerDisabled:!0,referenceElement:`${i}-popover-button`,scale:"s"},S("calcite-list",{label:""},e.portalItem?S("calcite-list-item",{label:t.openItem,onCalciteListItemSelect:()=>{const t=e.portalItem;if(!t||!t.itemPageUrl)return;const i=document.createElement("a");i.target="_blank",i.href=t.itemPageUrl,i.rel="noreferrer",i.click()}},S("calcite-icon",{icon:"launch2",key:`${i}-launch-icon`,scale:"s",slot:"content-start"})):S("calcite-list-item",{label:t.saveAs,onCalciteListItemSelect:async()=>{this.saveAsButtonCallback&&(l((()=>e.portalItem)).then((e=>{e.itemPageUrl&&this.scheduleRender()})),await this.saveAsButtonCallback(e))}},S("calcite-icon",{icon:"save",key:`${i}-save-icon`,scale:"s",slot:"content-start"})),S("calcite-list-item",{label:this.messagesCommon.delete,onCalciteListItemSelect:()=>this.exportedLinks.remove(e)},S("calcite-icon",{icon:"trash",key:`${i}-delete-icon`,scale:"s",slot:"content-start"})))):null}_renderExportedLinkItemContent(e,t){const i=this.messages,{url:a,state:l}=e,o=e.formattedName??"";let r=a||null;r&&(r=n(r));const c=s(r,location.href);return S("div",{class:P.exportedFile,"data-item":e,onclick:this._handleLinkClick,slot:"content"},S("div",null,S("div",{class:P.exportedFileLinkTitle},o),S("div",{class:P.exportedFileLinkDescription},"pending"===l?i.generatingExport:t||(c?i.ready:i.linkReady))),"ready"===l?S("calcite-icon",{"aria-label":`${o}. ${i.linkReady}`,icon:c?"download-to":"launch",key:`${o}-end-icon`,scale:"s",slot:"content-end"}):null)}_renderExportedLinkItemIcon(e){const t=e.formattedName??"";return"pending"===e.state?S("calcite-loader",{class:P.exportedFileLoader,inline:!0,key:`${t}-loader`,label:this.messages.generatingExport,scale:"m",slot:"content-start"}):S("calcite-icon",{icon:R(e),key:`${t}-start-icon`,scale:"s",slot:"content-start"})}_renderExportedLinkItemAction(e,t){const{state:i}=e,a=e.formattedName??"",l=this.saveAsButtonCallback&&"error"!==i&&this._isFormatAllowedForSaving(e.extension);return"pending"!==i?S("calcite-action",{"aria-label":`${t}`,icon:l?"ellipsis":"x",id:l?`${a}-popover-button`:void 0,key:l?`${a}-saveAs-action`:`${a}-action`,onclick:l?void 0:()=>{this.exportedLinks.remove(e)},slot:"actions-end",text:`${t}`}):null}_renderExportedLinkItem(e){const t=this.messages,{error:i,state:a}=e,l=e.formattedName??"";let o;switch(a){case"pending":o=t.pending;break;case"ready":o=t.ready;break;case"error":o=t.errorMessage}const n="error"===a?"print-task:cim-symbol-unsupported"===i?.name?t.exportWebMapCIMError:t.exportWebMapError:"";return S(I,null,S("calcite-list-item",{"aria-label":o,key:l,title:n},this._renderExportedLinkItemContent(e,n),this._renderExportedLinkItemIcon(e),this._renderExportedLinkItemAction(e,n)),this._renderExportedLinkItemPopover(e))}_renderExportedLinkItems(e){return S("calcite-list",{filterEnabled:e?.length>10,label:this.messages.exportedLinksList},e.map(this._renderExportedLinkItem.bind(this)))}_isFormatAllowedForSaving(e){return!this.allowedFormatsForSaving||"all"===this.allowedFormatsForSaving||!(!e||!this.allowedFormatsForSaving.includes(e))}_toggleLayoutPanel(e){const t=e.target;this._toggleTab(t.getAttribute("data-tab-id"))}_toggleTab(e,t=!0){if(this._selectedTab=e,this._selectedTab===L.mapOnly)this.templateOptions.reset(),this.templateOptions.layout=E;else if(this._selectedTab===L.layout){const e=this._selectedTemplate??this.viewModel.defaultTemplate;e?this.viewModel.applyTemplate(e):this.templateOptions.reset()}t&&(this._activeTabFocusRequested=!0)}_handleLayoutPanelKeyDown(e){const{key:t}=e,i=e.target.getAttribute("data-tab-id");if(k(t))return this._toggleTab(i),e.preventDefault(),void e.stopPropagation();if("ArrowLeft"===t||"ArrowRight"===t){switch(i){case L.layout:this._toggleTab("ArrowLeft"===t?L.export:L.mapOnly);break;case L.mapOnly:this._toggleTab("ArrowLeft"===t?L.layout:L.export);break;case L.export:this._toggleTab("ArrowLeft"===t?L.mapOnly:L.layout)}e.preventDefault(),e.stopPropagation()}}};e([r()],V.prototype,"_showTemplates",void 0),e([r()],V.prototype,"_isValidSpatialReference",void 0),e([r()],V.prototype,"allowedFormats",null),e([r()],V.prototype,"allowedFormatsForSaving",void 0),e([r()],V.prototype,"allowedLayouts",null),e([r()],V.prototype,"browseTemplateButtonOnClick",void 0),e([r()],V.prototype,"error",null),e([r({type:$})],V.prototype,"exportedLinks",void 0),e([r()],V.prototype,"extraParameters",null),e([r()],V.prototype,"headerVisible",void 0),e([r()],V.prototype,"headingLevel",void 0),e([r()],V.prototype,"icon",null),e([r()],V.prototype,"includeDefaultTemplates",null),e([r()],V.prototype,"includeOrganizationTemplates",void 0),e([r()],V.prototype,"label",null),e([r(),C("esri/widgets/Print/t9n/Print")],V.prototype,"messages",void 0),e([r(),C("esri/t9n/common")],V.prototype,"messagesCommon",void 0),e([r(),C("esri/core/t9n/Units")],V.prototype,"messagesUnits",void 0),e([r({type:d})],V.prototype,"outSpatialReference",null),e([r()],V.prototype,"portal",null),e([r()],V.prototype,"saveExportEnabled",void 0),e([r()],V.prototype,"saveExportHidden",void 0),e([r()],V.prototype,"showPrintAreaEnabled",null),e([r()],V.prototype,"printServiceUrl",null),e([r()],V.prototype,"saveAsButtonCallback",void 0),e([r()],V.prototype,"templateCustomTextElements",null),e([r()],V.prototype,"templateOptions",null),e([r()],V.prototype,"view",null),e([r({type:g})],V.prototype,"viewModel",void 0),V=e([p("esri.widgets.Print")],V);const U=V;export{U as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import t from"../core/Collection.js";import{JSONMap as i}from"../core/jsonMap.js";import{watch as a,whenOnce as l}from"../core/reactiveUtils.js";import{unitName as o}from"../core/unitFormatUtils.js";import{addProxy as n,hasSameOrigin as s}from"../core/urlUtils.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import{ensureInteger as c}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import d from"../geometry/SpatialReference.js";import{isValid as m}from"../geometry/support/spatialReferenceUtils.js";import{reArcGISOnlineDomain as u}from"../portal/support/urlUtils.js";import{findToken as h}from"../rest/utils.js";import{formatJsonMap as b}from"../rest/support/fileFormat.js";import _ from"./Widget.js";import v from"./Print/FileLink.js";import g from"./Print/PrintViewModel.js";import{loadCalciteComponents as f}from"./support/componentsUtils.js";import{globalCss as y}from"./support/globalCss.js";import{Heading as w}from"./support/Heading.js";import{legacyIcon as T}from"./support/legacyIcon.js";import{isRTL as x,isActivationKey as k}from"./support/widgetUtils.js";import{messageBundle as C}from"./support/decorators/messageBundle.js";import{tsx as S,tsxFragment as I}from"./support/jsxFactory.js";import{formatNumber as O}from"../intl/number.js";const $=t.ofType(v),E="map-only";var L;!function(e){e.layout="layoutTab",e.mapOnly="mapOnlyTab",e.export="exportTab"}(L||(L={}));const F="esri-print",M=`${F}__advanced-options-button`,P={base:F,headerTitle:`${F}__header-title`,layoutTabList:`${F}__layout-tab-list`,layoutTab:`${F}__layout-tab`,layoutSection:`${F}__layout-section`,mapOnlySection:`${F}__map-only-section`,panelItemsCentered:`${F}__panel-items--centered`,loader:`${F}__loader`,advancedOptionsButton:M,advancedOptionsButtonContainer:`${M}-container`,advancedOptionsButtonTitle:`${M}-title`,advancedOptionsButtonIconOpened:`${M}-icon--opened`,advancedOptionsButtonIconClosed:`${M}-icon--closed`,advancedOptionsButtonIconClosed_RTL:`${M}-icon--closed-rtl`,swapButton:`${F}__swap-button`,printButton:`${F}__export-button`,printButtonSection:`${F}__export-button-section`,printButtonSectionDivider:`${F}__export-button-section--divider`,templateSelectContainer:`${F}__template-select-container`,templateSelectBlock:`${F}__template-select-block`,templateSelectIcon:`${F}__template-select-icon`,templateSelectError:`${F}__template-select-error`,templateSelectArrow:`${F}__template-select-arrow`,formSectionContainer:`${F}__form-section-container`,formCheckboxLabel:`${F}__form-checkbox-label`,advancedOptionsSection:`${F}__advanced-options-section`,advancedOptionsContainer:`${F}__advanced-options-container`,browseTemplateButtonContainer:`${F}__browse-template-button-container`,browseTemplateButtonContainerFilter:`${F}__browse-template-button-container-filter`,exportedFilesContainer:`${F}__export-panel-container`,exportedFilesTitle:`${F}__export-title`,exportedFile:`${F}__exported-file`,exportedFileLink:`${F}__exported-file-link`,exportedFileLinkTitle:`${F}__exported-file-link-title`,exportedFileLinkDescription:`${F}__exported-file-link-description`,exportedFilesEmpty:`${F}__exported-files-empty`,printWidgetContainer:`${F}__container`,content:`${F}__content`,panelContainer:`${F}__panel-container`,scaleInfoContainer:`${F}__scale-info-container`,scaleInputContainer:`${F}__scale-input-container`,scaleInput:`${F}__scale-input`,sizeContainer:`${F}__size-container`,panelError:`${F}__panel--error`,exportedFileError:`${F}__exported-file--error`,exportedFileLoader:`${F}__exported-file--loader`,exportSection:`${F}__export-section`,exportSectionCentered:`${F}__export-section--centered`,templateButtonContainer:`${F}__template-button-container`,templateDoneButton:`${F}__template-done-button`,templateSelectFlowItemContainer:`${F}__template-select-flow-item-container`,templateSelectFlowItemContent:`${F}__template-select-flow-item-content`,templateSelectFlowItemListHeading:`${F}__template-select-flow-item-list-heading`,srLabel:`${F}__sr-label`,invalidWkidText:`${F}__invalid-wkid-text`};function A(e,t,i,a){const l=i/t,o=a/t;return{width:Math.round(e*l),height:Math.round(e*o)}}function B(e){return!isNaN(e)&&e>0}function N(e){return e?.toLowerCase()===E}function R(e){const{state:t,extension:i}=e;switch(t){case"pending":return"spinner";case"error":return"exclamation-mark-circle";default:return i?.toLowerCase()?.includes("pdf")?"file-pdf":"file"}}const D=new i({inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"}),j=new Map([["a3-landscape","a3-landscape"],["a3-portrait","a3-portrait"],["a4-landscape","a4-landscape"],["a4-portrait","a4-portrait"],["letter-ansi-a-landscape","ansi-a-landscape"],["letter-ansi-a-portrait","ansi-a-portrait"],["tabloid-ansi-b-landscape","ansi-b-landscape"],["tabloid-ansi-b-portrait","ansi-b-portrait"]]);let V=class extends _{constructor(e,t){super(e,t),this._activeTabFocusRequested=!1,this._awaitingServerResponse=!1,this._exportedFileNameMap={},this._selectedTab=L.layout,this._pendingExportScroll=!1,this._rootNode=null,this._selectedTemplate=null,this._formats=[],this._showTemplates=!1,this._isValidSpatialReference=!0,this.allowedFormatsForSaving=null,this.browseTemplateButtonOnClick=null,this.exportedLinks=new $,this.headerVisible=!0,this.headingLevel=3,this.includeOrganizationTemplates=!0,this.messagesCommon=null,this.messagesUnits=null,this.saveExportEnabled=!1,this.saveExportHidden=!0,this.saveAsButtonCallback=null,this.viewModel=new g,this._onInput=e=>{this._selectedTab===L.layout?this.templateOptions.title=e.currentTarget.value:this._selectedTab===L.mapOnly&&(this.templateOptions.fileName=e.currentTarget.value)},this._handleLinkClick=e=>{const t=e.currentTarget["data-item"];if(!t||"ready"!==t.state||!t.url)return;const i=h(this.viewModel.effectivePrintServiceUrl),a=t.url,l=document.createElement("a");if(l.target="_blank",l.href=a,l.rel="noreferrer",l.download=t.formattedName??"",!i)return l.click(),void e.stopPropagation();e.preventDefault();const o=new URL(a);o.searchParams.set("token",i),l.href=o.href,l.click(),l.href=a},this._focusOnTabChange=this._focusOnTabChange.bind(this)}initialize(){this.addHandles([a((()=>[this.templateOptions.format,this.viewModel.templatesInfo?.format]),(()=>{const{templatesInfo:e}=this.viewModel;if(!e)return;if(this._formats.length!==e.format.choiceList.length){const t=b.apiValues;this._formats=e.format.choiceList.map((e=>{const i=t.find((t=>new RegExp(`\\b${t}\\b`,"i").test(e)))??e;return{value:i,label:e===i?e.toUpperCase():e}})).sort(((e,t)=>e.label.localeCompare(t.label)))}const t=this._formats.some((({value:e})=>new RegExp(`\\b${e}\\b`,"i").test(this.templateOptions.format)));if(!e.format.defaultValue||t);else{const t=this._formats.find((({value:t})=>new RegExp(`\\b${t}\\b`,"i").test(e.format.defaultValue)))?.value;t&&(this.templateOptions.format=t)}})),a((()=>[this.templateOptions.id,this.viewModel.loaded]),(async()=>{const{layout:e}=this.templateOptions;this._selectedTab=N(e)?L.mapOnly:L.layout,this._selectedTab===L.layout&&this.viewModel.loaded&&(this._selectedTemplate=this.viewModel.getLayoutTemplateById(this.templateOptions.id))})),a((()=>this.templateOptions.dpi),(e=>{e<=0&&(this.templateOptions.dpi=1)})),a((()=>this.viewModel.view?.scale),(e=>{!e||this.templateOptions.scaleEnabled&&this.templateOptions.scale||(this.templateOptions.scale=e)}))]);for(const{name:a,extension:l}of this.exportedLinks)a&&l&&this._updateExportedFileNameMap(`${a}${l}`);const{height:e,width:t}=this.templateOptions;this.templateOptions.width=t||800,this.templateOptions.height=e||1100;const i=setTimeout((()=>{this._awaitingServerResponse=!0,this.scheduleRender()}),500);this.viewModel.load().then((()=>{clearTimeout(i),this._awaitingServerResponse=!1}))}loadDependencies(){return f({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),link:()=>import("@esri/calcite-components/dist/components/calcite-link")})}destroy(){this.viewModel.destroy()}get allowedFormats(){return this.viewModel.allowedFormats}set allowedFormats(e){this.viewModel.allowedFormats=e}get allowedLayouts(){return this.viewModel.allowedLayouts}set allowedLayouts(e){this.viewModel.allowedLayouts=e}get error(){return this.viewModel.error}get extraParameters(){return this.viewModel.extraParameters}set extraParameters(e){this.viewModel.extraParameters=e}get icon(){return"print"}set icon(e){this._overrideIfSome("icon",e)}get includeDefaultTemplates(){return this.viewModel.includeDefaultTemplates}set includeDefaultTemplates(e){this.viewModel.includeDefaultTemplates=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get outSpatialReference(){return this.viewModel.outSpatialReference}set outSpatialReference(e){this.viewModel.outSpatialReference=e}get portal(){return this.viewModel.portal}set portal(e){this.viewModel.portal=e}get showPrintAreaEnabled(){return this.viewModel.showPrintAreaEnabled}set showPrintAreaEnabled(e){this.viewModel.showPrintAreaEnabled=e}get printServiceUrl(){return this.viewModel.printServiceUrl}set printServiceUrl(e){this.viewModel.printServiceUrl=e}get templateCustomTextElements(){return this.viewModel.templateCustomTextElements}set templateCustomTextElements(e){this.viewModel.templateCustomTextElements=e}get templateOptions(){return this.viewModel.templateOptions}set templateOptions(e){this.viewModel.templateOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const{messages:e,templateOptions:t,viewModel:i,view:a}=this,{attributionEnabled:l,author:o,copyright:n,dpi:s,format:r,height:p,layout:u,layoutItem:h,legendEnabled:b,northArrowEnabled:_,scaleBarEnabled:v,scaleEnabled:g,scale:f,width:k}=t,C="ready"!==i.state||this._awaitingServerResponse||!(u||h),I=this._renderTitleOrFileNameSection(),O=S("div",{class:P.formSectionContainer},S("calcite-label",null,e.fileFormatTitle,S("calcite-combobox",{clearDisabled:!0,label:e.formatDefaultOption,maxItems:6,placeholder:e.formatDefaultOption,selectionMode:"single-persist",onCalciteComboboxChange:({currentTarget:e})=>{this.templateOptions.format=e.selectedItems[0]?.value??"pdf"}},this._formats.map((({value:e,label:t},i)=>S("calcite-combobox-item",{key:`file-format-${i}`,selected:e===this.templateOptions.format,textLabel:t,value:e})))))),$=S("calcite-label",{layout:"inline"},S("calcite-switch",{checked:this.showPrintAreaEnabled,onCalciteSwitchChange:e=>{this.showPrintAreaEnabled=!!e.currentTarget.checked}}),e.printPreview),E=S("div",null,S("div",{class:P.formSectionContainer},S("calcite-label",null,e.template,S("calcite-block",{class:P.templateSelectContainer,collapsible:!1,description:this._getPageSizeLabel(this._selectedTemplate),heading:this._getTemplateLabel(this._selectedTemplate,!0),key:"template-select-block",loading:"loading"===this._selectedTemplate?.state,onclick:()=>this._showTemplates=!0,onkeydown:e=>{"Enter"!==e.key&&" "!==e.key||(this._showTemplates=!0)},tabIndex:0},S("calcite-icon",{class:P.templateSelectIcon,icon:(this._selectedTemplate?.layout?j.get(this._selectedTemplate.layout):null)||"custom-print",key:"template-select-icon",scale:"l",slot:"content-start"}),"error"===this._selectedTemplate?.state?S("calcite-icon",{class:P.templateSelectError,icon:"exclamation-mark-circle",key:"template-select-error",scale:"s",slot:"actions-end"}):null,S("calcite-icon",{class:P.templateSelectArrow,icon:x()?"chevron-left":"chevron-right",key:"template-select-arrow",scale:"s",slot:"actions-end"})))),$),F=S("div",{class:P.formSectionContainer},S("calcite-label",null,e.dpi,S("calcite-input-number",{bind:this,"data-input-name":"dpi",min:1,value:`${s}`,onCalciteInputNumberInput:this._handleDPIChange}))),M=S("div",{class:P.formSectionContainer},S("calcite-label",null,S("div",{class:P.srLabel},e.outSpatialReference,S("calcite-link",{href:"https://developers.arcgis.com/rest/services-reference/enterprise/using-spatial-references/",target:"_blank"},"(WKID)")),S("calcite-input-number",{bind:this,"data-input-name":"outSpatialReference",integer:!0,numberButtonType:"none",value:i.outSpatialReference?.wkid?.toString()??"",onCalciteInputNumberInput:({currentTarget:e})=>{const t=c(e.value);i.outSpatialReference=Number.isNaN(t)||null==t?null:new d({wkid:t}),this._isValidSpatialReference=!i.outSpatialReference||m(i.outSpatialReference)}}),this._isValidSpatialReference?null:S("div",{class:P.invalidWkidText,key:`out-sr-${i.outSpatialReference?.wkid}`},e.invalidWkid))),A=S("div",{class:this.classes(P.scaleInfoContainer,P.formSectionContainer)},S("calcite-label",{layout:"inline"},S("calcite-checkbox",{bind:this,checked:g,"data-option-name":"scaleEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.scale),S("div",{class:P.scaleInputContainer},S("calcite-input-number",{"aria-label":e.scaleLabel,"aria-valuenow":`${f}`,bind:this,class:P.scaleInput,"data-input-name":"scale",disabled:!g,value:`${f}`,onCalciteInputNumberInput:this._updateNumberInputValue}),S("calcite-button",{appearance:"outline","aria-label":e.reset,bind:this,disabled:!g,iconStart:"refresh",kind:"neutral",onclick:this._resetToCurrentScale}))),B=S("div",{"aria-labelledby":`${this.id}__advancedOptionsForLayout`,class:P.advancedOptionsContainer,key:"advanced-section-for-layout"},A,this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasAuthorText??1?S("div",{class:P.formSectionContainer,key:"author-info"},S("calcite-label",null,e.author,S("calcite-input",{bind:this,"data-input-name":"author",value:o??"",onCalciteInputInput:this._updateInputValue}))):null,this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasCopyrightText??1?S("div",{class:P.formSectionContainer,key:"copyright-text"},S("calcite-label",null,e.copyright,S("calcite-input",{bind:this,"data-input-name":"copyright",value:n??"",onCalciteInputInput:this._updateInputValue}))):null,F,M,this._renderCustomTextElementSection(),this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasLegend??1?S("div",{class:P.formSectionContainer,key:"legend-info"},S("calcite-label",{layout:"inline"},S("calcite-checkbox",{bind:this,checked:!!b,"data-option-name":"legendEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.legend)):null,this._selectedTemplate?.mapSurroundInfoOptions?.northArrow.length?S("div",{class:P.formSectionContainer,key:"north-arrow"},S("calcite-label",{layout:"inline"},S("calcite-checkbox",{bind:this,checked:!!_,"data-option-name":"northArrowEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.northArrow)):null,this._selectedTemplate?.mapSurroundInfoOptions?.scaleBar.length?S("div",{class:P.formSectionContainer,key:"scale-bar"},S("calcite-label",{layout:"inline"},S("calcite-checkbox",{bind:this,checked:!!v,"data-option-name":"scaleBarEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.scaleBar)):null),N=S("div",{"aria-labelledby":`${this.id}__advancedOptionsForMapOnly`,class:P.advancedOptionsContainer},A,F,M,S("div",{class:P.formSectionContainer},S("calcite-label",{layout:"inline"},S("calcite-checkbox",{bind:this,checked:l,"data-option-name":"attributionEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.attribution)),this._renderCustomTextElementSection()),R=this.exportedLinks.toArray(),D=this._renderExportedLinkItems(R),V={[P.exportSectionCentered]:!R.length},U=this._selectedTab===L.layout?S("section",{"aria-labelledby":`${this.id}__layoutTab`,class:P.layoutSection,id:`${this.id}__layoutContent`,key:"esri-print__layoutContent",role:"tabpanel"},S("div",{class:P.panelContainer},this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasTitleText??1?I:null,E,this._selectedTab===L.layout?O:null,S("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(P.panelContainer,P.advancedOptionsSection),collapsible:!0,disabled:!(u||h?.id),heading:e.advancedOptions,id:"advancedOptionsForLayout",key:"advanced-options-for-layout"},B))):this._selectedTab===L.mapOnly?S("section",{"aria-labelledby":`${this.id}__mapOnlyTab`,class:P.mapOnlySection,id:`${this.id}__mapOnlyContent`,key:"esri-print__mapOnlyContent",role:"tabpanel"},S("div",{class:P.panelContainer},I,O,S("div",null,S("div",{class:this.classes(P.sizeContainer,P.formSectionContainer)},S("calcite-label",null,e.width,S("calcite-input-number",{bind:this,"data-input-name":"width",value:`${k}`,onCalciteInputNumberInput:this._updateNumberInputValue})),S("calcite-label",null,e.height,S("calcite-input-number",{bind:this,"data-input-name":"height",value:`${p}`,onCalciteInputNumberInput:this._updateNumberInputValue})),S("button",{"aria-label":e.swap,bind:this,class:this.classes(y.widgetButton,P.swapButton,T.swap),onclick:this._switchInput,type:"button"})),$),S("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(P.panelContainer,P.advancedOptionsSection),collapsible:!0,heading:e.advancedOptions,id:"advancedOptionsForMapOnly",key:"advanced-options-for-map-only"},N))):S("section",{"aria-labelledby":`${this.id}__exportTab`,class:this.classes(P.exportSection,V),id:`${this.id}__exportContent`,key:"esri-print__exportContent",role:"tabpanel"},S("div",{class:P.panelContainer},S("div",{afterUpdate:this._scrollExportIntoView,bind:this,class:P.exportedFilesContainer},0===R.length?S("div",{class:P.exportedFilesEmpty},S("calcite-icon",{icon:"file",scale:"l"}),S("div",null,S(w,{class:P.exportedFilesTitle,level:this.headingLevel},e.noExportedFiles),S("div",null,e.exportHint))):D))),H="2d"!==a?.type,z=S("div",{class:P.panelError},a?H?e.sceneViewError:e.serviceError:e.noViewError),W=R.some((({state:e})=>"pending"===e)),q=S("div",{class:P.content,key:"panel"},S("div",null,S("ul",{bind:this,class:P.layoutTabList,onclick:this._toggleLayoutPanel,onkeydown:this._handleLayoutPanelKeyDown,role:"tablist"},S("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${this._selectedTab===L.layout}`,class:P.layoutTab,"data-tab-id":L.layout,id:`${this.id}__layoutTab`,role:"tab",tabIndex:0},e.layoutTab),S("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${this._selectedTab===L.mapOnly}`,class:P.layoutTab,"data-tab-id":L.mapOnly,id:`${this.id}__mapOnlyTab`,role:"tab",tabIndex:0},e.mapOnlyTab),S("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${this._selectedTab===L.export}`,class:P.layoutTab,"data-tab-id":L.export,id:`${this.id}__exportedFilesTab`,role:"tab",tabIndex:0},W?S("calcite-loader",{inline:!0,label:"loading",scale:"s"}):null,e.exportsTab)),U),this._selectedTab!==L.export?S("div",{class:this.classes(P.printButtonSection,!this.saveExportHidden&&this.portal?P.printButtonSectionDivider:null),key:"export-button-section"},!this.saveExportHidden&&this.portal?S("calcite-label",{layout:"inline"},S("calcite-checkbox",{bind:this,checked:this.saveExportEnabled,onCalciteCheckboxChange:e=>{this.saveExportEnabled=!!e.currentTarget.checked}}),e.saveExportToMyContent):null,S("calcite-button",{"aria-label":e.exportDescription,bind:this,class:this.classes(P.printButton),disabled:C||!(u||h?.id)&&!r,onclick:this._handlePrintMap,scale:"l",width:"full"},e.export)):null),K=S("calcite-flow",{key:"root-flow"},S("calcite-flow-item",{bind:this,key:"root-flow-item",selected:!this._showTemplates},S("div",{class:P.printWidgetContainer},this.headerVisible?S("header",{class:P.headerTitle},e.export):null,this.error||H||!a?z:q)),this._renderChooseTemplateFlowItem()),G="initializing"===i.state,J=G?this._renderLoader():K,Q={[P.panelItemsCentered]:G};return S("div",{bind:this,class:this.classes(P.base,y.widget,y.panel,Q)},J)}_getPageSizeLabel(e){if(!e)return;const t=e.layoutTemplateInfo;if(!t)return;const i=D.fromJSON(t.pageUnits.toLowerCase());return`${O(t.pageSize[0])} × ${O(t.pageSize[1])} ${o(this.messagesUnits,i,"abbr")}`}_getTemplateLabel(e,t=!1){if(!e)return t?this.messages.selectTemplate:this.messages.untitled;const{label:i,layout:a,layoutItem:l,type:o}=e;if("print-service-template"===o&&this.messages[a])return this.messages[a];const n=i??a??l?.id;return n?.replaceAll("_"," ")??this.messages.untitled}_getPortalTemplates(){const{portalTemplateIds:e}=this.viewModel;return this.includeDefaultTemplates&&this.includeOrganizationTemplates?this.viewModel.defaultTemplates.toArray().filter((({layout:t,layoutItem:i})=>!N(t)&&!!i?.id&&e.includes(i.id))):[]}_getDefaultTemplates(){const{portalTemplateIds:e}=this.viewModel;return this.includeDefaultTemplates?this.viewModel.defaultTemplates.toArray().filter((({layout:t,layoutItem:i})=>!(N(t)||i?.id&&e.includes(i.id)))):[]}_getPrintServiceTemplates(){return this.includeDefaultTemplates&&this._getDefaultTemplates().length?[]:this.viewModel.printServiceTemplates.toArray().filter((({layout:e})=>!N(e)))}_renderLayoutTemplates(e,t=!1,i=!1){return t&&e.sort(((e,t)=>(e.label??"")>(t.label??"")?1:-1)),e.map((e=>S("calcite-list-item",{description:this._getPageSizeLabel(e),key:`template-${e.id}-${e.id===this.templateOptions.id}`,label:this._getTemplateLabel(e),selected:e.id===this.templateOptions.id,title:e.description??"",value:e},S("calcite-icon",{icon:(e.layout?j.get(e.layout):null)||"custom-print",slot:"content-start"}),"loading"===e.state?S("calcite-loader",{inline:!0,key:`template-loader-${e.id}`,label:"loading",scale:"s",slot:"content-end"}):null,"error"===e?.state?S("calcite-icon",{class:P.templateSelectError,icon:"exclamation-mark-circle",key:`template-error-${e.id}`,scale:"s",slot:"content-end"}):null,i?S("calcite-action",{icon:"trash",onclick:()=>this.viewModel.removePortalTemplate(e),slot:"actions-end",text:"delete"}):null)))}_renderChooseTemplateFlowItem(){if(!this._showTemplates)return null;const{messages:e}=this,t=u.test(this.portal?.url),i=this.viewModel.browseTemplates.toArray(),a=this._getPortalTemplates(),l=this._getDefaultTemplates(),o=this._getPrintServiceTemplates(),n=i.length+a.length+l.length+o.length>15,s=this.browseTemplateButtonOnClick?S("calcite-button",{appearance:"outline",class:n?P.browseTemplateButtonContainerFilter:P.browseTemplateButtonContainer,iconStart:"folder",key:"browse-template-button",onclick:this.browseTemplateButtonOnClick,slot:n?"filter-actions-end":"default"},n?null:e.browseTemplates):null;return S("calcite-flow-item",{bind:this,closable:!1,heading:e.chooseTemplate,key:"template-flow-item",selected:this._showTemplates,onCalciteFlowItemBack:e=>{e.preventDefault(),this._showTemplates=!1}},S("div",{class:P.templateSelectFlowItemContainer},S("div",{class:P.templateSelectFlowItemContent},n?null:s,S("calcite-list",{filterEnabled:n,filterProps:["label"],key:"template-list",label:e.templateList,selectionMode:"single-persist",onCalciteListChange:({currentTarget:e})=>this.viewModel.applyTemplate(e.selectedItems[0]?.value)},n?s:null,i.length?S("div",{key:"my-templates"},S("div",{class:P.templateSelectFlowItemListHeading},e.myTemplates,t?S("calcite-chip",{appearance:"outline",kind:"neutral",label:e.beta,scale:"s"},e.beta):null),this._renderLayoutTemplates(i,!0,!0)):null,a.length?S("div",{key:"org-templates"},S("div",{class:P.templateSelectFlowItemListHeading},e.organizationTemplates,t?S("calcite-chip",{appearance:"outline",kind:"neutral",label:e.beta,scale:"s"},e.beta):null),this._renderLayoutTemplates(a)):null,i.length||a.length?l.length?S("div",{key:"default-templates"},S("div",{class:P.templateSelectFlowItemListHeading},e.defaultTemplates),this._renderLayoutTemplates(l,!0)):null:this._renderLayoutTemplates(l,!0),i.length||a.length?o.length?S("div",{key:"service-templates"},S("div",{class:P.templateSelectFlowItemListHeading},e.defaultTemplates),this._renderLayoutTemplates(o)):null:this._renderLayoutTemplates(o))),S("div",{class:P.templateButtonContainer},S("calcite-button",{class:P.templateDoneButton,onclick:()=>this._showTemplates=!1},this.messagesCommon.done))))}_renderCustomTextElementSection(){const{customTextElements:e}=this.templateOptions;return e?S("div",{class:P.formSectionContainer,key:"custom-text-elements"},e.map(((e,t)=>{const[i,a]=Object.entries(e)[0];return"date"===i?null:S("calcite-label",{key:`custom-text-elements-${i}-${t}`},i,S("calcite-input",{bind:this,"data-input-custom":!0,"data-input-name":i,value:a??"",onCalciteInputInput:this._updateInputValue}))}))):null}_renderTitleOrFileNameSection(){const{title:e,fileName:t,titlePlaceHolder:i,fileNamePlaceHolder:a}=this.messages,l=this._selectedTab===L.layout?e:t,o=this._selectedTab===L.layout?i:a,n=this._selectedTab===L.layout?this.templateOptions.title:this.templateOptions.fileName;return S("div",{class:P.formSectionContainer,key:l},S("calcite-label",null,l,S("calcite-input",{placeholder:o,value:n??"",onCalciteInputInput:this._onInput})))}_focusOnTabChange(e){if(!this._activeTabFocusRequested)return;const t=e.getAttribute("data-tab-id");("layoutTab"===t&&this._selectedTab===L.layout||"mapOnlyTab"===t&&this._selectedTab===L.mapOnly||"exportTab"===t&&this._selectedTab===L.export)&&(e.focus(),this._activeTabFocusRequested=!1)}_renderLoader(){const e={[P.loader]:this._awaitingServerResponse};return S("div",{class:this.classes(e),key:"loader"})}_updateExportedFileNameMap(e){void 0!==this._exportedFileNameMap[e]?this._exportedFileNameMap[e]++:this._exportedFileNameMap[e]=0}_createFileLink(e,t){const i=t||this.messages.untitled,a=e.format.toLowerCase(),l=a.includes("png")?"png":a,o=i+l;return this._updateExportedFileNameMap(o),new v({name:i,extension:l,count:this._exportedFileNameMap[o]})}_resetToCurrentScale(){this.templateOptions.scale=this.viewModel.view?.scale}_updateCustomTextElementValue(e,t,i){e.find((e=>{const[i]=Object.entries(e)[0];return i===t}))[t]=i}_updateInputValue(e){const t=e.currentTarget,i=t.getAttribute("data-input-name"),a=!!t["data-input-custom"],{templateOptions:l}=this;a?this._updateCustomTextElementValue(l.customTextElements,i,t.value):l[i]=t.value}_updateNumberInputValue(e){const t=e.currentTarget,i=t.getAttribute("data-input-name"),{templateOptions:a}=this,l=Number(t.value);if(B(l))a[i]=l;else{const e=a[i];t.value=`${e}`}}_handleDPIChange(e){const{templateOptions:t}=this,i=t.dpi;this._updateNumberInputValue(e);const a=t.dpi,{height:l,width:o}=A(a,i,t.width,t.height);t.height=l,t.width=o}_handlePrintMap(){this._pendingExportScroll=!0;const{templateOptions:e,saveExportEnabled:t}=this,i=this.viewModel.toPrintTemplate(e),a=this._selectedTab===L.layout?i.layoutOptions?.titleText:e.fileName,l=this._createFileLink(i,a);this.exportedLinks.add(l),this.emit("submit",{link:l,saveExportEnabled:t}),this._selectedTab=L.export,this.viewModel.print(i).then((e=>{l.set({url:e&&e.url,state:"ready"})})).catch((e=>{l.set({error:e,state:"error"})})).then((()=>{this.emit("complete",{link:l,saveExportEnabled:t}),this.scheduleRender()}))}_switchInput(){[this.templateOptions.width,this.templateOptions.height]=[this.templateOptions.height,this.templateOptions.width]}_scrollExportIntoView(){if(!this._pendingExportScroll)return;this._pendingExportScroll=!1;const e=this._rootNode;if(!e)return;const{clientHeight:t,scrollHeight:i}=e,a=i-t;a>0&&(e.scrollTop=a)}_toggleInputValue(e){const t=e.target,i=t.getAttribute("data-option-name");this.templateOptions[i]=t.checked,"scaleEnabled"===i&&this._resetToCurrentScale()}_renderExportedLinkItemPopover(e){const t=this.messages,i=e.formattedName??"",{state:a}=e,o=this.saveAsButtonCallback&&"error"!==a&&this._isFormatAllowedForSaving(e.extension);return"pending"!==a&&o?S("calcite-popover",{autoClose:!0,key:`${i}-popover`,label:"Popover",offsetDistance:1,overlayPositioning:"fixed",pointerDisabled:!0,referenceElement:`${i}-popover-button`,scale:"s"},S("calcite-list",{label:""},e.portalItem?S("calcite-list-item",{label:t.openItem,onCalciteListItemSelect:()=>{const t=e.portalItem;if(!t||!t.itemPageUrl)return;const i=document.createElement("a");i.target="_blank",i.href=t.itemPageUrl,i.rel="noreferrer",i.click()}},S("calcite-icon",{icon:"launch2",key:`${i}-launch-icon`,scale:"s",slot:"content-start"})):S("calcite-list-item",{label:t.saveAs,onCalciteListItemSelect:async()=>{this.saveAsButtonCallback&&(l((()=>e.portalItem)).then((e=>{e.itemPageUrl&&this.scheduleRender()})),await this.saveAsButtonCallback(e))}},S("calcite-icon",{icon:"save",key:`${i}-save-icon`,scale:"s",slot:"content-start"})),S("calcite-list-item",{label:this.messagesCommon.delete,onCalciteListItemSelect:()=>this.exportedLinks.remove(e)},S("calcite-icon",{icon:"trash",key:`${i}-delete-icon`,scale:"s",slot:"content-start"})))):null}_renderExportedLinkItemContent(e,t){const i=this.messages,{url:a,state:l}=e,o=e.formattedName??"";let r=a||null;r&&(r=n(r));const c=s(r,location.href);return S("div",{class:P.exportedFile,"data-item":e,onclick:this._handleLinkClick,slot:"content"},S("div",null,S("div",{class:P.exportedFileLinkTitle},o),S("div",{class:P.exportedFileLinkDescription},"pending"===l?i.generatingExport:t||(c?i.ready:i.linkReady))),"ready"===l?S("calcite-icon",{"aria-label":`${o}. ${i.linkReady}`,icon:c?"download-to":"launch",key:`${o}-end-icon`,scale:"s",slot:"content-end"}):null)}_renderExportedLinkItemIcon(e){const t=e.formattedName??"";return"pending"===e.state?S("calcite-loader",{class:P.exportedFileLoader,inline:!0,key:`${t}-loader`,label:this.messages.generatingExport,scale:"m",slot:"content-start"}):S("calcite-icon",{icon:R(e),key:`${t}-start-icon`,scale:"s",slot:"content-start"})}_renderExportedLinkItemAction(e,t){const{state:i}=e,a=e.formattedName??"",l=this.saveAsButtonCallback&&"error"!==i&&this._isFormatAllowedForSaving(e.extension);return"pending"!==i?S("calcite-action",{"aria-label":`${t}`,icon:l?"ellipsis":"x",id:l?`${a}-popover-button`:void 0,key:l?`${a}-saveAs-action`:`${a}-action`,onclick:l?void 0:()=>{this.exportedLinks.remove(e)},slot:"actions-end",text:`${t}`}):null}_renderExportedLinkItem(e){const t=this.messages,{error:i,state:a}=e,l=e.formattedName??"";let o;switch(a){case"pending":o=t.pending;break;case"ready":o=t.ready;break;case"error":o=t.errorMessage}const n="error"===a?"print-task:cim-symbol-unsupported"===i?.name?t.exportWebMapCIMError:t.exportWebMapError:"";return S(I,null,S("calcite-list-item",{"aria-label":o,key:l,title:n},this._renderExportedLinkItemContent(e,n),this._renderExportedLinkItemIcon(e),this._renderExportedLinkItemAction(e,n)),this._renderExportedLinkItemPopover(e))}_renderExportedLinkItems(e){return S("calcite-list",{filterEnabled:e?.length>10,label:this.messages.exportedLinksList},e.map(this._renderExportedLinkItem.bind(this)))}_isFormatAllowedForSaving(e){return!this.allowedFormatsForSaving||"all"===this.allowedFormatsForSaving||!(!e||!this.allowedFormatsForSaving.includes(e))}_toggleLayoutPanel(e){const t=e.target;this._toggleTab(t.getAttribute("data-tab-id"))}_toggleTab(e,t=!0){if(this._selectedTab=e,this._selectedTab===L.mapOnly)this.templateOptions.reset(),this.templateOptions.layout=E;else if(this._selectedTab===L.layout){const e=this._selectedTemplate??this.viewModel.defaultTemplate;e?this.viewModel.applyTemplate(e):this.templateOptions.reset()}t&&(this._activeTabFocusRequested=!0)}_handleLayoutPanelKeyDown(e){const{key:t}=e,i=e.target.getAttribute("data-tab-id");if(k(t))return this._toggleTab(i),e.preventDefault(),void e.stopPropagation();if("ArrowLeft"===t||"ArrowRight"===t){switch(i){case L.layout:this._toggleTab("ArrowLeft"===t?L.export:L.mapOnly);break;case L.mapOnly:this._toggleTab("ArrowLeft"===t?L.layout:L.export);break;case L.export:this._toggleTab("ArrowLeft"===t?L.mapOnly:L.layout)}e.preventDefault(),e.stopPropagation()}}};e([r()],V.prototype,"_showTemplates",void 0),e([r()],V.prototype,"_isValidSpatialReference",void 0),e([r()],V.prototype,"allowedFormats",null),e([r()],V.prototype,"allowedFormatsForSaving",void 0),e([r()],V.prototype,"allowedLayouts",null),e([r()],V.prototype,"browseTemplateButtonOnClick",void 0),e([r()],V.prototype,"error",null),e([r({type:$})],V.prototype,"exportedLinks",void 0),e([r()],V.prototype,"extraParameters",null),e([r()],V.prototype,"headerVisible",void 0),e([r()],V.prototype,"headingLevel",void 0),e([r()],V.prototype,"icon",null),e([r()],V.prototype,"includeDefaultTemplates",null),e([r()],V.prototype,"includeOrganizationTemplates",void 0),e([r()],V.prototype,"label",null),e([r(),C("esri/widgets/Print/t9n/Print")],V.prototype,"messages",void 0),e([r(),C("esri/t9n/common")],V.prototype,"messagesCommon",void 0),e([r(),C("esri/core/t9n/Units")],V.prototype,"messagesUnits",void 0),e([r({type:d})],V.prototype,"outSpatialReference",null),e([r()],V.prototype,"portal",null),e([r()],V.prototype,"saveExportEnabled",void 0),e([r()],V.prototype,"saveExportHidden",void 0),e([r()],V.prototype,"showPrintAreaEnabled",null),e([r()],V.prototype,"printServiceUrl",null),e([r()],V.prototype,"saveAsButtonCallback",void 0),e([r()],V.prototype,"templateCustomTextElements",null),e([r()],V.prototype,"templateOptions",null),e([r()],V.prototype,"view",null),e([r({type:g})],V.prototype,"viewModel",void 0),V=e([p("esri.widgets.Print")],V);const U=V;export{U as default};
|
package/widgets/Sketch.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{isSome as t}from"../core/arrayUtils.js";import{handlesGroup as o}from"../core/handleUtils.js";import i from"../core/Logger.js";import{removeMaybe as s,destroyMaybe as l}from"../core/maybe.js";import{ignoreAbortErrors as r}from"../core/promiseUtils.js";import{watch as n,syncAndInitial as a,when as c}from"../core/reactiveUtils.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import u from"../views/interactive/sketch/SketchValueOptions.js";import h from"./Widget.js";import v from"./Sketch/SketchViewModel.js";import{VisibleElements as m}from"./Sketch/VisibleElements.js";import{LayoutPriority as g}from"./Sketch/support/sketchUtils.js";import f from"./Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js";import{loadCalciteComponents as _}from"./support/componentsUtils.js";import y from"./support/SelectionToolbar.js";import b from"./support/SketchTooltipControls.js";import w from"./support/SnappingControls.js";import"./support/widgetUtils.js";import{messageBundle as T}from"./support/decorators/messageBundle.js";import{vmEvent as M}from"./support/decorators/vmEvent.js";import{tsx as C}from"./support/jsxFactory.js";import O from"./support/SketchTooltipControls/VisibleElements.js";import{substitute as k}from"../intl/substitute.js";const S="esri-sketch",P={base:S,vertical:`${S}--vertical`,docked:`${S}-bar`,floating:`${S}-pad`,chipHorizontal:`${S}__selection-count-chip--horizontal`,chipVertical:`${S}__selection-count-chip--vertical`,chipVerticalSmall:`${S}__selection-count-chip--vertical--s`,popoverWrapper:`${S}__popover-wrapper`},I={point:"pin",polyline:"line",polygon:"polygon",rectangle:"rectangle",circle:"circle",multipoint:"pins",mesh:"i3-d-building",freehandPolygon:"freehand-area",freehandPolyline:"freehand"};let R=class extends h{constructor(e,t){super(e,t),this._activeCustomToolOptions=null,this._selectionToolbar=null,this._viewModelHandlesGroup=null,this.availableCreateTools=["point","polyline","polygon","rectangle","circle"],this.customToolOptions=null,this.customActions=null,this.toolbarKind="floating",this.contextualToolLocation="separate",this.groupCollapsePriorities=null,this.messages=null,this.messagesCommon=null,this.visibleElements=new m,this._defaultViewModel=null,this._calcitePopoverReferenceElement=null,this._relativeLocation="top",this._popoverOpen=!1,this._activateCreateTool=this._activateCreateTool.bind(this),this.viewModel=e?.viewModel||(this._defaultViewModel=new v({creationMode:e?.creationMode??"continuous"}))}initialize(){const{layer:e,view:t}=this,i=new y({view:"2d"===t?.type?t:null,sources:e?[e]:null,scale:this.scale});this.addHandles([n((()=>this.viewModel),(e=>{this._viewModelHandlesGroup=s(this._viewModelHandlesGroup),e&&(this._viewModelHandlesGroup=o([e.on("create",(()=>this.scheduleRender())),e.on("update",(()=>this.scheduleRender())),e.on("delete",(e=>this.emit("delete",e))),e.on("undo",(()=>this.scheduleRender())),e.on("redo",(()=>this.scheduleRender())),n((()=>e.layer),(e=>{this._selectionToolbar&&(this._selectionToolbar.sources=e?[e]:null)})),n((()=>e.view),(e=>{this._selectionToolbar&&(this._selectionToolbar.view="2d"===e?.type?e:null)})),n((()=>e.state),(()=>this.notifyChange("state")))]))}),a),c((()=>i.activeToolInfo),(()=>this.viewModel.cancel())),i.on("complete",(e=>this._onSelectionOperationComplete(e))),n((()=>{const{selectionTools:e}=this.visibleElements;return{lassoTool:!!e?.["lasso-selection"],rectangleTool:!!e?.["rectangle-selection"]}}),(e=>{Object.assign(i.visibleElements,e)}),a)]),this._selectionToolbar=i}loadDependencies(){return _({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover")})}destroy(){this._selectionToolbar?.destroy(),this._viewModelHandlesGroup=s(this._viewModelHandlesGroup)}get activeTool(){const e=this._selectionToolbar?.activeToolInfo;if(e)switch(e.toolName){case"lasso":return"lasso-selection";case"rectangle":return"rectangle-selection";case"default":return"custom-selection"}const t=this._effectiveAvailableCreateTools,{activeTool:o,activeCreateToolDrawMode:i}=this.viewModel;return"polygon"===o&&"freehand"===i&&t?.includes("freehandPolygon")?"freehandPolygon":"polyline"===o&&"freehand"===i&&t?.includes("freehandPolyline")?"freehandPolyline":this.viewModel.activeTool}get activeTooltip(){return this.viewModel.activeTooltip}get createGraphic(){return this.viewModel.createGraphic}get creationMode(){return this.viewModel.creationMode}set creationMode(e){this.viewModel.creationMode=e}get defaultCreateOptions(){return this.viewModel.defaultCreateOptions}set defaultCreateOptions(e){this.viewModel.defaultCreateOptions=e}get defaultUpdateOptions(){return this.viewModel.defaultUpdateOptions}set defaultUpdateOptions(e){this.viewModel.defaultUpdateOptions=e}get icon(){return"pencil"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get labelOptions(){return this.viewModel.labelOptions}set labelOptions(e){this.viewModel.labelOptions=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}set layout(e){this._set("layout",e),this._selectionToolbar&&(this._selectionToolbar.layout=e)}set scale(e){this._set("scale",e),this._selectionToolbar&&(this._selectionToolbar.scale=e)}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(e){this.viewModel.snappingOptions=e}get state(){return this._selectionToolbar?.activeToolInfo?"active":this.viewModel.state}get tooltipOptions(){return this.viewModel.tooltipOptions}set tooltipOptions(e){this.viewModel.tooltipOptions=e}get updateGraphics(){return this.viewModel.updateGraphics}get valueOptions(){return this.viewModel.valueOptions}set valueOptions(e){this.viewModel.valueOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}set viewModel(e){const t=this._get("viewModel");e!==t&&(t&&t===this._defaultViewModel&&l(t),this._set("viewModel",e))}get _effectiveAvailableCreateTools(){const{availableCreateTools:e,view:t,visibleElements:o}=this,i=e?.filter((e=>!!o.createTools?.[e]));return"3d"===t?.type?i?.filter((e=>"multipoint"!==e)):i}create(e,t,o){const i=o?.createOptions??t;return this._activeCustomToolOptions=o,r(this.viewModel.create(e,i))}update(e,t){return r(this.viewModel.update(e,t))}complete(){this.viewModel.complete()}cancel(){this._selectionToolbar?.cancel(),this.viewModel.cancel(),this._activeCustomToolOptions=null}undo(){this.viewModel.undo(),this.view?.focus()}redo(){this.viewModel.redo(),this.view?.focus()}delete(){this.viewModel.delete()}duplicate(){return this.viewModel.duplicate()}dismissFloatingElements(){this._popoverOpen=!1}render(){const{toolbarKind:e,layout:t,scale:o}=this,i=this.customActions?.filter((e=>"selection-toolbar"===e.position));return C("div",null,C("div",{classes:{[P.base]:!0,[P.floating]:"floating"===e,[P.docked]:"docked"===e,[P.vertical]:"vertical"===t}},C(f,{barStyle:e,layout:t,scale:o},this._renderSelectionSetItemGroupInline(),C("div",{"group-kind":"split-button",key:"selection-split-button",priority:this.groupCollapsePriorities?.get("selectionTools")??g.Low},this._renderDefaultSelectionButton(),this._selectionToolbar?.render(),i?.map((e=>this._renderToolbarItem(e)))),this._renderCreateToolActionGroup(),this._renderUndoRedoMenuItemGroup(),this._renderSettingsMenuItemGroup()),this._renderSelectionSetToolbar(),this._renderSettingsMenuPopover()))}_renderSettingsMenuPopover(){const{messagesCommon:e,snappingOptions:t,view:o,viewModel:i,visibleElements:s}=this;if(!this._calcitePopoverReferenceElement)return;const l={directionModePicker:s.directionModePicker,labelsToggle:s.labelsToggle,tooltipsToggle:s.tooltipsToggle},r="horizontal"===this.layout?"top"===this._relativeLocation?"bottom-end":"top-end":"right-end";return C("calcite-popover",{closable:!0,focusTrapDisabled:!0,heading:e.settings,label:e.settings,open:this._popoverOpen,overlayPositioning:"fixed",placement:r,referenceElement:this._calcitePopoverReferenceElement,scale:this.scale,onCalcitePopoverBeforeClose:()=>this._popoverOpen=!1,onCalcitePopoverBeforeOpen:e=>this._remeasurePopoverSizes(e.currentTarget),onCalcitePopoverClose:()=>this._refocusOnView()},C("div",{class:P.popoverWrapper},Object.values(l).includes(!0)?C(b,{sketchOptions:i.sketchOptions,viewType:o?.type,visibleElements:new O(l)}):void 0,s.snappingControls&&o&&t?C(w,{snappingManager:this.viewModel.snappingManager,snappingOptions:t,view:o,visibleElements:s.snappingControlsElements}):void 0))}_renderSelectionSetToolbar(){if("separate"!==this.contextualToolLocation)return;const e=this._renderSelectionSetItemGroup();return e?.length?C(f,{barStyle:this.toolbarKind,layout:this.layout,scale:this.scale},e):void 0}_renderSelectionSetItemGroupInline(){return"separate"===this.contextualToolLocation?[]:this._renderSelectionSetItemGroup()}_renderUndoRedoMenuItemGroup(){return C("div",{"group-kind":"split-button",key:"undo-redo-menu",priority:this.groupCollapsePriorities?.get("undoRedo")??g.Medium,slot:"actions-end"},this._renderUndoButton(),this._renderRedoButton())}_renderSettingsMenuItemGroup(){const e=[],o=[];this.customActions?.forEach((t=>{"settings-before"===t.position?o.push(t):"settings-after"===t.position&&e.push(t)}));const i=[...o.map((e=>this._renderToolbarItem(e))),this._renderSettingsMenuButton(),...e.map((e=>this._renderToolbarItem(e)))].filter(t);if(i.length)return C("div",{"allow-collapse":!1,"group-kind":"overflow-group",key:"settings-menu",priority:this.groupCollapsePriorities?.get("settings")??g.Max,slot:"actions-end"},i)}_renderSelectionSetItemGroup(){if(!this.updateGraphics.length)return[];const e="inline-end"===this.contextualToolLocation?"actions-end":void 0,t=this.customActions?.filter((e=>"before-selection-set"===e.position)),o=this.customActions?.filter((e=>"after-selection-set"===e.position)),i=this.groupCollapsePriorities?.get("selectionSet")??g.High;return[C("div",{"group-kind":"measured-content",key:"selection-count-chip-group",priority:i,slot:e},this._renderFeatureCountChip()),C("div",{"allow-collapse":!1,"group-kind":"overflow-group",key:"selection-set-tool-group",priority:i,slot:e},t?.map((e=>this._renderToolbarItem(e))),this._renderDuplicateButton(),this._renderDeleteButton(),o?.map((e=>this._renderToolbarItem(e))))]}_renderDefaultSelectionButton(){if(!this.viewModel.updateOnGraphicClick)return[];const{messages:e,state:t}=this;return this._renderToolbarItem({id:"pointer-select",text:e.selectFeature,icon:"cursor",onclick:this._activateDefaultSelectTool,active:"ready"===t})}_renderCreateToolActionGroup(){const e=this._effectiveAvailableCreateTools?.flatMap((e=>this._renderBuiltInCreateToolItem(e)))??[],t=this.customToolOptions?.flatMap((e=>this._renderCustomToolItem(e)))??[];return C("div",{"group-kind":"overflow-group",key:"create-tools-group",priority:this.groupCollapsePriorities?.get("createTools")??g.High},e,t)}_renderBuiltInCreateToolItem(e){return this._renderToolbarItem({id:`${e}-button`,text:this.messages.draw[e],icon:I[e],onclick:()=>this._activateCreateTool(e),active:this.activeTool===e&&!this._activeCustomToolOptions})}_renderCustomToolItem(e){const{toolKey:t}=e;return this._renderToolbarItem({id:`custom-${e.toolKey}`,text:e.label,icon:e.icon,onclick:()=>this._activateCreateTool(e.toolName,null,e),active:this._activeCustomToolOptions?.toolKey===t})}_renderUndoButton(){return this.visibleElements.undoRedoMenu?this._renderToolbarItem({id:"undo-button",text:this.messages.undo,icon:"undo",disabled:!this.viewModel.canUndo(),onclick:this.undo,flipRTL:!0}):[]}_renderRedoButton(){return this.visibleElements.undoRedoMenu?this._renderToolbarItem({id:"redo-button",text:this.messages.redo,icon:"redo",disabled:!this.viewModel.canRedo(),onclick:this.redo,flipRTL:!0}):[]}_renderSettingsMenuButton(){return this.visibleElements.settingsMenu?this._renderToolbarItem({id:"settings-menu-action",text:this.messagesCommon.settings,icon:"gear",active:this._popoverOpen,onclick:()=>this._popoverOpen=!this._popoverOpen,afterCreate:e=>this._calcitePopoverReferenceElement=e,afterUpdate:e=>this._calcitePopoverReferenceElement=e,afterRemoved:()=>this._calcitePopoverReferenceElement=null}):[]}_renderFeatureCountChip(){if(!this.visibleElements.selectionCountLabel)return[];const{layout:e,messages:t,scale:o,id:i,updateGraphics:{length:s}}=this,l=k(t.selectedCount,{count:s}),r="s"===o?99:999,n=s>r?k(t.selectedCountTruncated,{truncated:r}):s,a="s"===o&&"vertical"===e,c=a?`${i}-selection-chip-small`:`${i}-selection-chip`;return[a?C("span",{classes:{[P.chipVertical]:!0,[P.chipVerticalSmall]:"s"===this.scale},id:c,tabIndex:0,title:l},n):C("calcite-chip",{appearance:"outline",class:"horizontal"===e?P.chipHorizontal:P.chipVertical,id:c,kind:"brand",label:l,scale:"l"===o?"m":"s",tabIndex:0,title:"vertical"===e?l:void 0},"vertical"===e?n:l)]}_renderDuplicateButton(){if(!this.visibleElements.duplicateButton)return[];const{messages:e}=this;return this._renderToolbarItem({id:"duplicate",text:this.updateGraphics.length>1?e.duplicateFeatures:e.duplicateFeature,icon:"copy",onclick:this._onDuplicateSelect})}_renderDeleteButton(){if(!this.visibleElements.deleteButton)return[];const{messages:e}=this,t=this.updateGraphics.length>1?e.deleteFeatures:e.deleteFeature;return this._renderToolbarItem({id:"delete",text:t,icon:"trash",onclick:this.delete})}_renderToolbarItem({id:e,text:t,icon:o,disabled:i,onclick:s,active:l,flipRTL:r,afterCreate:n,afterUpdate:a,afterRemoved:c}){const p=`${this.id}-${e}`;return[C("calcite-action",{active:l,afterCreate:n,afterRemoved:c,afterUpdate:a,bind:this,"data-testid":e,disabled:i||"disabled"===this.state,icon:o,iconFlipRtl:r??!1,id:p,key:e,onclick:s,scale:this.scale,text:t,title:t})]}_remeasurePopoverSizes(e){try{const t=e.parentElement,o=this?.view?.container?.getBoundingClientRect(),i=t?.style;if(!(t&&o&&i&&this.view?.container?.contains(t)))return;const s=this._calcitePopoverReferenceElement;if(!s)return;const{bottom:l,top:r}=s.getBoundingClientRect();if("horizontal"===this.layout){const e=l<o.height/2;e!==("top"===this._relativeLocation)&&(this._relativeLocation=e?"top":"bottom"),e?(i?.setProperty("--sketch-view-height-offset",l-o.top+"px"),i?.setProperty("--sketch-view-margin-offset","30px")):(i?.setProperty("--sketch-view-height-offset",o.bottom-r+"px"),i?.setProperty("--sketch-view-margin-offset","15px"))}else"vertical"===this.layout&&(i.setProperty("--sketch-view-height-offset","15px"),i.setProperty("--sketch-view-margin-offset","15px"));const n=e.shadowRoot?.querySelector("div.header")?.getBoundingClientRect().height;i.setProperty("--sketch-popover-header-offset",`${n}px`)}catch(t){i.getLogger(this.declaredClass).warnOnce("Sketch failed to lay out settings menu.",t)}}_activateCreateTool(e,t,o){const i=this._activeCustomToolOptions;if(o||i){if(o?.toolKey===i?.toolKey)return void this.cancel()}else if(this.activeTool===e)return void this.cancel();this._selectionToolbar?.cancel(),this.create(e,t,o)}_onDuplicateSelect(){const e=this.duplicate(),t=this.viewModel.activeTool;"transform"!==t&&"reshape"!==t||this.update(e,{tool:t})}_onSelectionOperationComplete(e){const{viewModel:{defaultUpdateOptions:t}}=this,{selection:o}=e;if(!e.aborted&&o.length){const e=t.tool,i=o.length>1&&"reshape"===e?"transform":e;this.update(o,{...t,tool:i})}this.notifyChange("state")}_activateDefaultSelectTool(){this.cancel(),this.view?.focus()}_refocusOnView(){this.activeTool&&this.view?.focus()}};e([p()],R.prototype,"_activeCustomToolOptions",void 0),e([p()],R.prototype,"activeTool",null),e([p({readOnly:!0})],R.prototype,"activeTooltip",null),e([p({cast:e=>{if(!e?.length)return null;const t=new Set(["point","polyline","polygon","rectangle","circle","multipoint","freehandPolyline","freehandPolygon","mesh"]);return e.filter((e=>t.has(e)))}})],R.prototype,"availableCreateTools",void 0),e([p({readOnly:!0})],R.prototype,"createGraphic",null),e([p()],R.prototype,"creationMode",null),e([p()],R.prototype,"customToolOptions",void 0),e([p()],R.prototype,"customActions",void 0),e([p()],R.prototype,"defaultCreateOptions",null),e([p()],R.prototype,"defaultUpdateOptions",null),e([p()],R.prototype,"icon",null),e([p()],R.prototype,"label",null),e([p()],R.prototype,"labelOptions",null),e([p()],R.prototype,"layer",null),e([p({type:["horizontal","vertical"],value:"horizontal"})],R.prototype,"layout",null),e([p({value:"m"})],R.prototype,"scale",null),e([p()],R.prototype,"toolbarKind",void 0),e([p()],R.prototype,"contextualToolLocation",void 0),e([p()],R.prototype,"groupCollapsePriorities",void 0),e([p(),T("esri/widgets/Sketch/t9n/Sketch")],R.prototype,"messages",void 0),e([p(),T("esri/t9n/common")],R.prototype,"messagesCommon",void 0),e([p()],R.prototype,"snappingOptions",null),e([p()],R.prototype,"state",null),e([p()],R.prototype,"tooltipOptions",null),e([p({readOnly:!0})],R.prototype,"updateGraphics",null),e([p({type:u,nonNullable:!0})],R.prototype,"valueOptions",null),e([p()],R.prototype,"view",null),e([p({type:v}),M(["create","update","undo","redo"])],R.prototype,"viewModel",null),e([p({type:m,nonNullable:!0})],R.prototype,"visibleElements",void 0),e([p()],R.prototype,"_effectiveAvailableCreateTools",null),e([p()],R.prototype,"_defaultViewModel",void 0),e([p()],R.prototype,"_calcitePopoverReferenceElement",void 0),e([p()],R.prototype,"_relativeLocation",void 0),e([p()],R.prototype,"_popoverOpen",void 0),R=e([d("esri.widgets.Sketch")],R);const j=R;export{j as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{isSome as t}from"../core/arrayUtils.js";import{handlesGroup as o}from"../core/handleUtils.js";import i from"../core/Logger.js";import{removeMaybe as s,destroyMaybe as l}from"../core/maybe.js";import{ignoreAbortErrors as r}from"../core/promiseUtils.js";import{watch as n,syncAndInitial as a,when as c}from"../core/reactiveUtils.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import u from"../views/interactive/sketch/SketchValueOptions.js";import h from"./Widget.js";import v from"./Sketch/SketchViewModel.js";import{VisibleElements as m}from"./Sketch/VisibleElements.js";import{LayoutPriority as g}from"./Sketch/support/sketchUtils.js";import f from"./Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js";import{loadCalciteComponents as _}from"./support/componentsUtils.js";import y from"./support/SelectionToolbar.js";import b from"./support/SketchTooltipControls.js";import w from"./support/SnappingControls.js";import"./support/widgetUtils.js";import{messageBundle as T}from"./support/decorators/messageBundle.js";import{vmEvent as M}from"./support/decorators/vmEvent.js";import{tsx as C}from"./support/jsxFactory.js";import O from"./support/SketchTooltipControls/VisibleElements.js";import{substitute as k}from"../intl/substitute.js";const S="esri-sketch",P={base:S,vertical:`${S}--vertical`,docked:`${S}-bar`,floating:`${S}-pad`,chipHorizontal:`${S}__selection-count-chip--horizontal`,chipVertical:`${S}__selection-count-chip--vertical`,chipVerticalSmall:`${S}__selection-count-chip--vertical--s`,popoverWrapper:`${S}__popover-wrapper`},I={point:"pin",polyline:"line",polygon:"polygon",rectangle:"rectangle",circle:"circle",multipoint:"pins",mesh:"i3d-building",freehandPolygon:"freehand-area",freehandPolyline:"freehand"};let R=class extends h{constructor(e,t){super(e,t),this._activeCustomToolOptions=null,this._selectionToolbar=null,this._viewModelHandlesGroup=null,this.availableCreateTools=["point","polyline","polygon","rectangle","circle"],this.customToolOptions=null,this.customActions=null,this.toolbarKind="floating",this.contextualToolLocation="separate",this.groupCollapsePriorities=null,this.messages=null,this.messagesCommon=null,this.visibleElements=new m,this._defaultViewModel=null,this._calcitePopoverReferenceElement=null,this._relativeLocation="top",this._popoverOpen=!1,this._activateCreateTool=this._activateCreateTool.bind(this),this.viewModel=e?.viewModel||(this._defaultViewModel=new v({creationMode:e?.creationMode??"continuous"}))}initialize(){const{layer:e,view:t}=this,i=new y({view:"2d"===t?.type?t:null,sources:e?[e]:null,scale:this.scale});this.addHandles([n((()=>this.viewModel),(e=>{this._viewModelHandlesGroup=s(this._viewModelHandlesGroup),e&&(this._viewModelHandlesGroup=o([e.on("create",(()=>this.scheduleRender())),e.on("update",(()=>this.scheduleRender())),e.on("delete",(e=>this.emit("delete",e))),e.on("undo",(()=>this.scheduleRender())),e.on("redo",(()=>this.scheduleRender())),n((()=>e.layer),(e=>{this._selectionToolbar&&(this._selectionToolbar.sources=e?[e]:null)})),n((()=>e.view),(e=>{this._selectionToolbar&&(this._selectionToolbar.view="2d"===e?.type?e:null)})),n((()=>e.state),(()=>this.notifyChange("state")))]))}),a),c((()=>i.activeToolInfo),(()=>this.viewModel.cancel())),i.on("complete",(e=>this._onSelectionOperationComplete(e))),n((()=>{const{selectionTools:e}=this.visibleElements;return{lassoTool:!!e?.["lasso-selection"],rectangleTool:!!e?.["rectangle-selection"]}}),(e=>{Object.assign(i.visibleElements,e)}),a)]),this._selectionToolbar=i}loadDependencies(){return _({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover")})}destroy(){this._selectionToolbar?.destroy(),this._viewModelHandlesGroup=s(this._viewModelHandlesGroup)}get activeTool(){const e=this._selectionToolbar?.activeToolInfo;if(e)switch(e.toolName){case"lasso":return"lasso-selection";case"rectangle":return"rectangle-selection";case"default":return"custom-selection"}const t=this._effectiveAvailableCreateTools,{activeTool:o,activeCreateToolDrawMode:i}=this.viewModel;return"polygon"===o&&"freehand"===i&&t?.includes("freehandPolygon")?"freehandPolygon":"polyline"===o&&"freehand"===i&&t?.includes("freehandPolyline")?"freehandPolyline":this.viewModel.activeTool}get activeTooltip(){return this.viewModel.activeTooltip}get createGraphic(){return this.viewModel.createGraphic}get creationMode(){return this.viewModel.creationMode}set creationMode(e){this.viewModel.creationMode=e}get defaultCreateOptions(){return this.viewModel.defaultCreateOptions}set defaultCreateOptions(e){this.viewModel.defaultCreateOptions=e}get defaultUpdateOptions(){return this.viewModel.defaultUpdateOptions}set defaultUpdateOptions(e){this.viewModel.defaultUpdateOptions=e}get icon(){return"pencil"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get labelOptions(){return this.viewModel.labelOptions}set labelOptions(e){this.viewModel.labelOptions=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}set layout(e){this._set("layout",e),this._selectionToolbar&&(this._selectionToolbar.layout=e)}set scale(e){this._set("scale",e),this._selectionToolbar&&(this._selectionToolbar.scale=e)}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(e){this.viewModel.snappingOptions=e}get state(){return this._selectionToolbar?.activeToolInfo?"active":this.viewModel.state}get tooltipOptions(){return this.viewModel.tooltipOptions}set tooltipOptions(e){this.viewModel.tooltipOptions=e}get updateGraphics(){return this.viewModel.updateGraphics}get valueOptions(){return this.viewModel.valueOptions}set valueOptions(e){this.viewModel.valueOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}set viewModel(e){const t=this._get("viewModel");e!==t&&(t&&t===this._defaultViewModel&&l(t),this._set("viewModel",e))}get _effectiveAvailableCreateTools(){const{availableCreateTools:e,view:t,visibleElements:o}=this,i=e?.filter((e=>!!o.createTools?.[e]));return"3d"===t?.type?i?.filter((e=>"multipoint"!==e)):i}create(e,t,o){const i=o?.createOptions??t;return this._activeCustomToolOptions=o,r(this.viewModel.create(e,i))}update(e,t){return r(this.viewModel.update(e,t))}complete(){this.viewModel.complete()}cancel(){this._selectionToolbar?.cancel(),this.viewModel.cancel(),this._activeCustomToolOptions=null}undo(){this.viewModel.undo(),this.view?.focus()}redo(){this.viewModel.redo(),this.view?.focus()}delete(){this.viewModel.delete()}duplicate(){return this.viewModel.duplicate()}dismissFloatingElements(){this._popoverOpen=!1}render(){const{toolbarKind:e,layout:t,scale:o}=this,i=this.customActions?.filter((e=>"selection-toolbar"===e.position));return C("div",null,C("div",{classes:{[P.base]:!0,[P.floating]:"floating"===e,[P.docked]:"docked"===e,[P.vertical]:"vertical"===t}},C(f,{barStyle:e,layout:t,scale:o},this._renderSelectionSetItemGroupInline(),C("div",{"group-kind":"split-button",key:"selection-split-button",priority:this.groupCollapsePriorities?.get("selectionTools")??g.Low},this._renderDefaultSelectionButton(),this._selectionToolbar?.render(),i?.map((e=>this._renderToolbarItem(e)))),this._renderCreateToolActionGroup(),this._renderUndoRedoMenuItemGroup(),this._renderSettingsMenuItemGroup()),this._renderSelectionSetToolbar(),this._renderSettingsMenuPopover()))}_renderSettingsMenuPopover(){const{messagesCommon:e,snappingOptions:t,view:o,viewModel:i,visibleElements:s}=this;if(!this._calcitePopoverReferenceElement)return;const l={directionModePicker:s.directionModePicker,labelsToggle:s.labelsToggle,tooltipsToggle:s.tooltipsToggle},r="horizontal"===this.layout?"top"===this._relativeLocation?"bottom-end":"top-end":"right-end";return C("calcite-popover",{closable:!0,focusTrapDisabled:!0,heading:e.settings,label:e.settings,open:this._popoverOpen,overlayPositioning:"fixed",placement:r,referenceElement:this._calcitePopoverReferenceElement,scale:this.scale,onCalcitePopoverBeforeClose:()=>this._popoverOpen=!1,onCalcitePopoverBeforeOpen:e=>this._remeasurePopoverSizes(e.currentTarget),onCalcitePopoverClose:()=>this._refocusOnView()},C("div",{class:P.popoverWrapper},Object.values(l).includes(!0)?C(b,{sketchOptions:i.sketchOptions,viewType:o?.type,visibleElements:new O(l)}):void 0,s.snappingControls&&o&&t?C(w,{snappingManager:this.viewModel.snappingManager,snappingOptions:t,view:o,visibleElements:s.snappingControlsElements}):void 0))}_renderSelectionSetToolbar(){if("separate"!==this.contextualToolLocation)return;const e=this._renderSelectionSetItemGroup();return e?.length?C(f,{barStyle:this.toolbarKind,layout:this.layout,scale:this.scale},e):void 0}_renderSelectionSetItemGroupInline(){return"separate"===this.contextualToolLocation?[]:this._renderSelectionSetItemGroup()}_renderUndoRedoMenuItemGroup(){return C("div",{"group-kind":"split-button",key:"undo-redo-menu",priority:this.groupCollapsePriorities?.get("undoRedo")??g.Medium,slot:"actions-end"},this._renderUndoButton(),this._renderRedoButton())}_renderSettingsMenuItemGroup(){const e=[],o=[];this.customActions?.forEach((t=>{"settings-before"===t.position?o.push(t):"settings-after"===t.position&&e.push(t)}));const i=[...o.map((e=>this._renderToolbarItem(e))),this._renderSettingsMenuButton(),...e.map((e=>this._renderToolbarItem(e)))].filter(t);if(i.length)return C("div",{"allow-collapse":!1,"group-kind":"overflow-group",key:"settings-menu",priority:this.groupCollapsePriorities?.get("settings")??g.Max,slot:"actions-end"},i)}_renderSelectionSetItemGroup(){if(!this.updateGraphics.length)return[];const e="inline-end"===this.contextualToolLocation?"actions-end":void 0,t=this.customActions?.filter((e=>"before-selection-set"===e.position)),o=this.customActions?.filter((e=>"after-selection-set"===e.position)),i=this.groupCollapsePriorities?.get("selectionSet")??g.High;return[C("div",{"group-kind":"measured-content",key:"selection-count-chip-group",priority:i,slot:e},this._renderFeatureCountChip()),C("div",{"allow-collapse":!1,"group-kind":"overflow-group",key:"selection-set-tool-group",priority:i,slot:e},t?.map((e=>this._renderToolbarItem(e))),this._renderDuplicateButton(),this._renderDeleteButton(),o?.map((e=>this._renderToolbarItem(e))))]}_renderDefaultSelectionButton(){if(!this.viewModel.updateOnGraphicClick)return[];const{messages:e,state:t}=this;return this._renderToolbarItem({id:"pointer-select",text:e.selectFeature,icon:"cursor",onclick:this._activateDefaultSelectTool,active:"ready"===t})}_renderCreateToolActionGroup(){const e=this._effectiveAvailableCreateTools?.flatMap((e=>this._renderBuiltInCreateToolItem(e)))??[],t=this.customToolOptions?.flatMap((e=>this._renderCustomToolItem(e)))??[];return C("div",{"group-kind":"overflow-group",key:"create-tools-group",priority:this.groupCollapsePriorities?.get("createTools")??g.High},e,t)}_renderBuiltInCreateToolItem(e){return this._renderToolbarItem({id:`${e}-button`,text:this.messages.draw[e],icon:I[e],onclick:()=>this._activateCreateTool(e),active:this.activeTool===e&&!this._activeCustomToolOptions})}_renderCustomToolItem(e){const{toolKey:t}=e;return this._renderToolbarItem({id:`custom-${e.toolKey}`,text:e.label,icon:e.icon,onclick:()=>this._activateCreateTool(e.toolName,null,e),active:this._activeCustomToolOptions?.toolKey===t})}_renderUndoButton(){return this.visibleElements.undoRedoMenu?this._renderToolbarItem({id:"undo-button",text:this.messages.undo,icon:"undo",disabled:!this.viewModel.canUndo(),onclick:this.undo,flipRTL:!0}):[]}_renderRedoButton(){return this.visibleElements.undoRedoMenu?this._renderToolbarItem({id:"redo-button",text:this.messages.redo,icon:"redo",disabled:!this.viewModel.canRedo(),onclick:this.redo,flipRTL:!0}):[]}_renderSettingsMenuButton(){return this.visibleElements.settingsMenu?this._renderToolbarItem({id:"settings-menu-action",text:this.messagesCommon.settings,icon:"gear",active:this._popoverOpen,onclick:()=>this._popoverOpen=!this._popoverOpen,afterCreate:e=>this._calcitePopoverReferenceElement=e,afterUpdate:e=>this._calcitePopoverReferenceElement=e,afterRemoved:()=>this._calcitePopoverReferenceElement=null}):[]}_renderFeatureCountChip(){if(!this.visibleElements.selectionCountLabel)return[];const{layout:e,messages:t,scale:o,id:i,updateGraphics:{length:s}}=this,l=k(t.selectedCount,{count:s}),r="s"===o?99:999,n=s>r?k(t.selectedCountTruncated,{truncated:r}):s,a="s"===o&&"vertical"===e,c=a?`${i}-selection-chip-small`:`${i}-selection-chip`;return[a?C("span",{classes:{[P.chipVertical]:!0,[P.chipVerticalSmall]:"s"===this.scale},id:c,tabIndex:0,title:l},n):C("calcite-chip",{appearance:"outline",class:"horizontal"===e?P.chipHorizontal:P.chipVertical,id:c,kind:"brand",label:l,scale:"l"===o?"m":"s",tabIndex:0,title:"vertical"===e?l:void 0},"vertical"===e?n:l)]}_renderDuplicateButton(){if(!this.visibleElements.duplicateButton)return[];const{messages:e}=this;return this._renderToolbarItem({id:"duplicate",text:this.updateGraphics.length>1?e.duplicateFeatures:e.duplicateFeature,icon:"copy",onclick:this._onDuplicateSelect})}_renderDeleteButton(){if(!this.visibleElements.deleteButton)return[];const{messages:e}=this,t=this.updateGraphics.length>1?e.deleteFeatures:e.deleteFeature;return this._renderToolbarItem({id:"delete",text:t,icon:"trash",onclick:this.delete})}_renderToolbarItem({id:e,text:t,icon:o,disabled:i,onclick:s,active:l,flipRTL:r,afterCreate:n,afterUpdate:a,afterRemoved:c}){const p=`${this.id}-${e}`;return[C("calcite-action",{active:l,afterCreate:n,afterRemoved:c,afterUpdate:a,bind:this,"data-testid":e,disabled:i||"disabled"===this.state,icon:o,iconFlipRtl:r??!1,id:p,key:e,onclick:s,scale:this.scale,text:t,title:t})]}_remeasurePopoverSizes(e){try{const t=e.parentElement,o=this?.view?.container?.getBoundingClientRect(),i=t?.style;if(!(t&&o&&i&&this.view?.container?.contains(t)))return;const s=this._calcitePopoverReferenceElement;if(!s)return;const{bottom:l,top:r}=s.getBoundingClientRect();if("horizontal"===this.layout){const e=l<o.height/2;e!==("top"===this._relativeLocation)&&(this._relativeLocation=e?"top":"bottom"),e?(i?.setProperty("--sketch-view-height-offset",l-o.top+"px"),i?.setProperty("--sketch-view-margin-offset","30px")):(i?.setProperty("--sketch-view-height-offset",o.bottom-r+"px"),i?.setProperty("--sketch-view-margin-offset","15px"))}else"vertical"===this.layout&&(i.setProperty("--sketch-view-height-offset","15px"),i.setProperty("--sketch-view-margin-offset","15px"));const n=e.shadowRoot?.querySelector("div.header")?.getBoundingClientRect().height;i.setProperty("--sketch-popover-header-offset",`${n}px`)}catch(t){i.getLogger(this.declaredClass).warnOnce("Sketch failed to lay out settings menu.",t)}}_activateCreateTool(e,t,o){const i=this._activeCustomToolOptions;if(o||i){if(o?.toolKey===i?.toolKey)return void this.cancel()}else if(this.activeTool===e)return void this.cancel();this._selectionToolbar?.cancel(),this.create(e,t,o)}_onDuplicateSelect(){const e=this.duplicate(),t=this.viewModel.activeTool;"transform"!==t&&"reshape"!==t||this.update(e,{tool:t})}_onSelectionOperationComplete(e){const{viewModel:{defaultUpdateOptions:t}}=this,{selection:o}=e;if(!e.aborted&&o.length){const e=t.tool,i=o.length>1&&"reshape"===e?"transform":e;this.update(o,{...t,tool:i})}this.notifyChange("state")}_activateDefaultSelectTool(){this.cancel(),this.view?.focus()}_refocusOnView(){this.activeTool&&this.view?.focus()}};e([p()],R.prototype,"_activeCustomToolOptions",void 0),e([p()],R.prototype,"activeTool",null),e([p({readOnly:!0})],R.prototype,"activeTooltip",null),e([p({cast:e=>{if(!e?.length)return null;const t=new Set(["point","polyline","polygon","rectangle","circle","multipoint","freehandPolyline","freehandPolygon","mesh"]);return e.filter((e=>t.has(e)))}})],R.prototype,"availableCreateTools",void 0),e([p({readOnly:!0})],R.prototype,"createGraphic",null),e([p()],R.prototype,"creationMode",null),e([p()],R.prototype,"customToolOptions",void 0),e([p()],R.prototype,"customActions",void 0),e([p()],R.prototype,"defaultCreateOptions",null),e([p()],R.prototype,"defaultUpdateOptions",null),e([p()],R.prototype,"icon",null),e([p()],R.prototype,"label",null),e([p()],R.prototype,"labelOptions",null),e([p()],R.prototype,"layer",null),e([p({type:["horizontal","vertical"],value:"horizontal"})],R.prototype,"layout",null),e([p({value:"m"})],R.prototype,"scale",null),e([p()],R.prototype,"toolbarKind",void 0),e([p()],R.prototype,"contextualToolLocation",void 0),e([p()],R.prototype,"groupCollapsePriorities",void 0),e([p(),T("esri/widgets/Sketch/t9n/Sketch")],R.prototype,"messages",void 0),e([p(),T("esri/t9n/common")],R.prototype,"messagesCommon",void 0),e([p()],R.prototype,"snappingOptions",null),e([p()],R.prototype,"state",null),e([p()],R.prototype,"tooltipOptions",null),e([p({readOnly:!0})],R.prototype,"updateGraphics",null),e([p({type:u,nonNullable:!0})],R.prototype,"valueOptions",null),e([p()],R.prototype,"view",null),e([p({type:v}),M(["create","update","undo","redo"])],R.prototype,"viewModel",null),e([p({type:m,nonNullable:!0})],R.prototype,"visibleElements",void 0),e([p()],R.prototype,"_effectiveAvailableCreateTools",null),e([p()],R.prototype,"_defaultViewModel",void 0),e([p()],R.prototype,"_calcitePopoverReferenceElement",void 0),e([p()],R.prototype,"_relativeLocation",void 0),e([p()],R.prototype,"_popoverOpen",void 0),R=e([d("esri.widgets.Sketch")],R);const j=R;export{j as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2833,3186,4601,4755,6928,7136,9340],{2272:(e,t,r)=>{r.d(t,{Dl:()=>s,jV:()=>i,lF:()=>l}),r(92602),r(70333);var n=r(4718),o=r(84952);function i(e,t){return t?{...t,query:{...e??{},...t.query}}:{query:e}}function s(e){return"string"==typeof e?(0,o.An)(e):(0,n.o8)(e)}function l(e,t,r){const n={};for(const o in e){if("declaredClass"===o)continue;const i=e[o];if(null!=i&&"function"!=typeof i)if(Array.isArray(i))n[o]=i.map((e=>l(e)));else if("object"==typeof i)if(i.toJSON){const e=i.toJSON(r?.[o]);n[o]=t?e:JSON.stringify(e)}else n[o]=t?i:JSON.stringify(i);else n[o]=i}return n}r(926)},13069:(e,t,r)=>{r.d(t,{AG:()=>l,lk:()=>o,vD:()=>s,yS:()=>i});const n="randomUUID"in crypto;function o(){if(n)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function i(){return`{${o().toUpperCase()}}`}function s(){return`{${o()}}`}function l(e){const t=e.toUpperCase();return"{"!==e[0]?`{${t}}`:t}},17136:(e,t,r)=>{r.d(t,{O7:()=>M,el:()=>v});var n=r(92602),o=r(49186),i=r(53966),s=r(39829),l=r(82799),a=r(80754),p=r(21325),u=r(28735),c=r(78888),y=r(65864),f=r(2272),d=r(84952),h=r(92300);const m=()=>i.A.getLogger("esri.geometry.support.normalizeUtils");function g(e){return"polygon"===e[0].type}function w(e){return"polyline"===e[0].type}function _(e,t,r){if(t){const t=function(e,t){if(!(e instanceof l.A||e instanceof s.A)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw m().error(e),new o.A(e)}const r=(0,a.r8)(e),n=[];for(const e of r){const r=[];n.push(r),r.push([e[0][0],e[0][1]]);for(let n=0;n<e.length-1;n++){const o=e[n][0],i=e[n][1],s=e[n+1][0],l=e[n+1][1],a=Math.sqrt((s-o)*(s-o)+(l-i)*(l-i)),p=(l-i)/a,u=(s-o)/a,c=a/t;if(c>1){for(let e=1;e<=c-1;e++){const n=e*t,s=u*n+o,l=p*n+i;r.push([s,l])}const e=(a+Math.floor(c-1)*t)/2,n=u*e+o,s=p*e+i;r.push([n,s])}r.push([s,l])}}return function(e){return"polygon"===e.type}(e)?new s.A({rings:n,spatialReference:e.spatialReference}):new l.A({paths:n,spatialReference:e.spatialReference})}(e,1e6);e=(0,u.ci)(t,!0)}return r&&(e=(0,a.kS)(e,r)),e}function x(e,t,r){if(Array.isArray(e)){const n=e[0];if(n>t){const r=(0,a.kd)(n,t);e[0]=n+r*(-2*t)}else if(n<r){const t=(0,a.kd)(n,r);e[0]=n+t*(-2*r)}}else{const n=e.x;if(n>t){const r=(0,a.kd)(n,t);e=e.clone().offset(r*(-2*t),0)}else if(n<r){const t=(0,a.kd)(n,r);e=e.clone().offset(t*(-2*r),0)}}return e}function b(e,t){let r=-1;for(let n=0;n<t.cutIndexes.length;n++){const o=t.cutIndexes[n],i=t.geometries[n],s=(0,a.r8)(i);for(let e=0;e<s.length;e++){const t=s[e];t.some((r=>{if(r[0]<180)return!0;{let r=0;for(let e=0;e<t.length;e++){const n=t[e][0];r=n>r?n:r}r=Number(r.toFixed(9));const n=-360*(0,a.kd)(r,180);for(let r=0;r<t.length;r++){const t=i.getPoint(e,r);i.setPoint(e,r,t.clone().offset(n,0))}return!0}}))}if(o===r){if(g(e))for(const t of(0,a.r8)(i))e[o]=e[o].addRing(t);else if(w(e))for(const t of(0,a.r8)(i))e[o]=e[o].addPath(t)}else r=o,e[o]=i}return e}async function v(e,t,r){if(!Array.isArray(e))return v([e],t);t&&"string"!=typeof t&&m().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const o="string"==typeof t?t:t?.url??n.A.geometryServiceUrl;let i,g,w,M,S,A,T,O,N=0;const I=[],Z=[];for(const t of e)if(null!=t)if(i||(i=t.spatialReference,g=(0,p.Vp)(i),w=i.isWebMercator,A=w?102100:4326,M=a.j7[A].maxX,S=a.j7[A].minX,T=a.j7[A].plus180Line,O=a.j7[A].minus180Line),g)if("mesh"===t.type)Z.push(t);else if("point"===t.type)Z.push(x(t.clone(),M,S));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>x(e,M,S))),Z.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,g);Z.push(e.rings?new s.A(e):e)}else if(t.extent){const e=t.extent,r=(0,a.kd)(e.xmin,S)*(2*M);let n=0===r?t.clone():(0,a.kS)(t.clone(),r);e.offset(r,0);let{xmin:o,xmax:i}=e;o=Number(o.toFixed(9)),i=Number(i.toFixed(9)),e.intersects(T)&&i!==M?(N=i>N?i:N,n=_(n,w),I.push(n),Z.push("cut")):e.intersects(O)&&o!==S?(N=i*(2*M)>N?i*(2*M):N,n=_(n,w,360),I.push(n),Z.push("cut")):Z.push(n)}else Z.push(t.clone());else Z.push(t);else Z.push(t);let R=(0,a.kd)(N,M),F=-90;const j=R,L=new l.A;for(;R>0;){const e=360*R-180;L.addPath([[e,F],[e,-1*F]]),F*=-1,R--}if(I.length>0&&j>0){const t=b(I,await async function(e,t,r,n){const o=(0,f.Dl)(e),i=t[0].spatialReference,s={...n,responseType:"json",query:{...o.query,f:"json",sr:(0,p.YX)(i),target:JSON.stringify({geometryType:(0,y.$B)(t[0]),geometries:t}),cutter:JSON.stringify(r)}},l=await(0,c.A)(o.path+"/cut",s),{cutIndexes:a,geometries:u=[]}=l.data;return{cutIndexes:a,geometries:u.map((e=>{const t=(0,y.rS)(e);return t.spatialReference=i,t}))}}(o,I,L,r)),n=[],i=[];for(let r=0;r<Z.length;r++){const o=Z[r];if("cut"!==o)i.push(o);else{const o=t.shift(),s=e[r];null!=s&&"polygon"===s.type&&s.rings&&s.rings.length>1&&o.rings.length>=s.rings.length?(n.push(o),i.push("simplify")):i.push(w?(0,u.Gh)(o):o)}}if(!n.length)return i;const s=await async function(e,t,r){const n="string"==typeof e?(0,d.An)(e):e,o=t[0].spatialReference,i=(0,y.$B)(t[0]),s={...r,query:{...n.query,f:"json",sr:(0,p.YX)(o),geometries:JSON.stringify((0,h.X)(t))}},{data:l}=await(0,c.A)(n.path+"/simplify",s);return(0,h.V)(l.geometries,i,o)}(o,n,r),l=[];for(let e=0;e<i.length;e++){const t=i[e];"simplify"!==t?l.push(t):l.push(w?(0,u.Gh)(s.shift()):s.shift())}return l}const E=[];for(let e=0;e<Z.length;e++){const t=Z[e];if("cut"!==t)E.push(t);else{const e=I.shift();E.push(!0===w?(0,u.Gh)(e):e)}}return E}function M(e,t,r){const n=(0,p.Vp)(r);if(null==n)return e;const[o,i]=n.valid,s=2*i;let l=0,a=0;t>i?l=Math.ceil(Math.abs(t-i)/s):t<o&&(l=-Math.ceil(Math.abs(t-o)/s)),e>i?a=Math.ceil(Math.abs(e-i)/s):e<o&&(a=-Math.ceil(Math.abs(e-o)/s));let u=e+(l-a)*s;const c=u-t;return c>i?u-=s:c<o&&(u+=s),u}},17311:(e,t,r)=>{r.d(t,{A:()=>y});var n=r(90237),o=r(69622),i=r(60999),s=r(5503),l=r(10107),a=(r(44208),r(53966),r(87811),r(40608)),p=r(30524),u=r(71386);let c=class extends o.A{constructor(e){super(e),this._featureUtils=null,this.effectivePopupTemplate=null}get _arcadeTask(){return this.expressionsUsedInTitle.length>0?this._get("_arcadeTask")||(0,i.UT)((()=>(0,u.lw)())):null}get featureUtilsPromise(){return this._get("featureUtilsPromise")??r.e(9926).then(r.bind(r,29926)).then((e=>this._featureUtils=e))}get calculatedExpressions(){const e=new s.A;if(!this.expressionsUsedInTitle.length)return e;if(!this._arcadeTask?.value){for(const t of this.expressionsUsedInTitle??[])e.push({name:t.name,invalid:!0});return e}for(const t of this.expressionsUsedInTitle)try{const r=this._arcadeTask.value.arcade.parseScript(t.expression,["$layer","$map","$datastore"]);if(r.isAsync){e.push({name:t.name,invalid:!0});break}e.push({name:t.name,syntax:r,invalid:!1,func:this._arcadeTask.value.arcade.compileScript(r,{vars:{$feature:"any"}})})}catch{e.push({name:t.name,invalid:!0});break}return e}get expressionsUsedInTitle(){let e=this.effectivePopupTemplate?.title??"";return"string"!=typeof e?[]:(e=e.toLowerCase(),this.effectivePopupTemplate?.expressionInfos?.filter((t=>e.includes(`{expression/${t.name.toLowerCase()}}`)))??[])}get fieldInfoMap(){return this._featureUtils?this._createFieldInfoMap(this._featureUtils.getAllFieldInfos(this.effectivePopupTemplate)):null}get hasBadExpressions(){return this.calculatedExpressions.some((e=>!0===e.invalid))}get requiredFields(){const e=new Set;if(this._arcadeTask?.value&&!this.hasBadExpressions)for(const t of this.calculatedExpressions?.toArray()??[])try{const r=this._arcadeTask.value.arcade.extractFieldLiterals(t.syntax);for(const t of r){const r=t.split("."),n=this.fieldsIndex.get(r.at(-1)??"");n&&e.add(n.name)}}catch{}const t=this._extractFieldNames(this.workingTitle);for(const r of t){const t=this.fieldsIndex.get(r);t&&e.add(t.name)}return e}get titleFromDisplayField(){let e="";return this.displayField&&(e=this.fieldsIndex.get(this.displayField)?.name??""),e||(e=this.fieldsIndex.get(this.objectIdField)?.name??""),e?`{${e}}`:""}get workingTitle(){const e=this.effectivePopupTemplate?this.effectivePopupTemplate.title:"";return""===e||null==e||this.hasBadExpressions||"string"!=typeof e?this.titleFromDisplayField:e}async getTitle(e,t,r){try{const{attributes:n}=t,o=r?.timeZone??"system",[{substituteFieldsInLinksAndAttributes:i}]=await Promise.all([this.featureUtilsPromise,this._arcadeTask?.promise]);if(r.fetchMissingFields&&(t=await this._checkAndReQueryGraphic(e,t)),this.workingTitle&&this.fieldInfoMap){const r=this._createFormattedAttributes(e,t,o).global;return i({attributes:n,expressionAttributes:null,fieldInfoMap:this.fieldInfoMap,globalAttributes:r,layer:e,text:this.workingTitle})}return""}catch{}return""}async _checkAndReQueryGraphic(e,t){const r=t.getObjectId();if(null==r)return t;if(!(0,p.Kl)(this.requiredFields,t)){const t=e.createQuery();t.where="1=1",t.outFields=[...this.requiredFields],t.objectIds=[r];const n=await e.queryFeatures(t);if(1===n?.features.length)return n.features[0]}return t}_createFieldInfoMap(e){const t=new Map;if(!e)return t;for(const r of e){if(!r.fieldName)continue;const e=this.fieldsIndex.get(r.fieldName),n=e?.name??r.fieldName;r.fieldName=n,t.set(n.toLowerCase(),r)}return t}_createFormattedAttributes(e,t,r="system"){const n=this.effectivePopupTemplate?.fieldInfos??[],o={};if(!this._featureUtils)return{};if(!this.hasBadExpressions&&this.calculatedExpressions.length>0&&this._arcadeTask?.value){const r=this._arcadeTask.value.Feature.createFromGraphicLikeObject(t.geometry,t.attributes,e,null);for(const e of this.calculatedExpressions)try{o[`expression/${e.name}`]=e.func({vars:{$feature:r}})}catch{}}const i={...t.attributes,...o};return{global:this._featureUtils.formatAttributes({fieldInfos:n,attributes:i,graphic:t,timeZone:r,layer:e,fieldInfoMap:this.fieldInfoMap}),content:[]}}_extractFieldNames(e){return(0,p.nw)(e).filter((e=>!(0===e.indexOf("relationships/")||0===e.indexOf("expression/"))))}};(0,n._)([(0,l.MZ)({readOnly:!0})],c.prototype,"_arcadeTask",null),(0,n._)([(0,l.MZ)()],c.prototype,"_featureUtils",void 0),(0,n._)([(0,l.MZ)({readOnly:!0})],c.prototype,"featureUtilsPromise",null),(0,n._)([(0,l.MZ)({readOnly:!0})],c.prototype,"calculatedExpressions",null),(0,n._)([(0,l.MZ)()],c.prototype,"displayField",void 0),(0,n._)([(0,l.MZ)()],c.prototype,"effectivePopupTemplate",void 0),(0,n._)([(0,l.MZ)()],c.prototype,"expressionsUsedInTitle",null),(0,n._)([(0,l.MZ)()],c.prototype,"fieldsIndex",void 0),(0,n._)([(0,l.MZ)()],c.prototype,"fieldInfoMap",null),(0,n._)([(0,l.MZ)()],c.prototype,"fields",void 0),(0,n._)([(0,l.MZ)()],c.prototype,"objectIdField",void 0),(0,n._)([(0,l.MZ)()],c.prototype,"requiredFields",null),c=(0,n._)([(0,a.$)("esri.layers.support.TitleCreator")],c);const y=c},22671:(e,t,r)=>{r.d(t,{A:()=>_});var n,o=r(90237),i=r(52106),s=r(66552),l=r(25482),a=r(4718),p=r(10107),u=(r(44208),r(53966),r(36005)),c=r(40608),y=r(43937),f=r(16930),d=r(65864),h=r(50498),m=r(20437);const g=new s.J({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let w=n=class extends l.A{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){return this.readFeaturesWithClass(e,t,i.A)}writeGeometryType(e,t,r,n){if(e)return void g.write(e,t,r,n);const{features:o}=this;if(o)for(const e of o)if(null!=e?.geometry)return void g.write(e.geometry.type,t,r,n)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,n=(0,d.rS)(e);return n&&!r&&t.spatialReference&&(n.spatialReference=f.A.fromJSON(t.spatialReference)),n}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new n(this.cloneProperties())}cloneProperties(){return(0,a.o8)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const n=t.features[r];if(n.geometry){const t=e?.[r];n.geometry=t?.toJSON()||n.geometry}}return t}quantize(e){const{scale:[t,r],translate:[n,o]}=e,i=this.features,s=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-n)/t)),(e=>Math.round((o-e)/r)));for(let e=0,t=i.length;e<t;e++)s?.(i[e].geometry)||(i.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[n,o],scale:[i,s]}=r;let l=null,a=null;if(this.hasZ&&null!=r?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=r;l=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=r;a=r=>null==r?r:r*t+e}const p=this._getHydrationFunction(e,(e=>e*i+n),(e=>o-e*s),l,a);for(const{geometry:e}of t)null!=e&&p&&p(e);return this.transform=null,this}readFeaturesWithClass(e,t,r){const n=f.A.fromJSON(t.spatialReference),o=[];for(let t=0;t<e.length;t++){const i=e[t],s=r.fromJSON(i),l=i.geometry?.spatialReference;null==s.geometry||l||(s.geometry.spatialReference=n);const a=i.aggregateGeometries,p=s.aggregateGeometries;if(a&&null!=p)for(const e in p){const t=p[e],r=a[e],o=r?.spatialReference;null==t||o||(t.spatialReference=n)}o.push(s)}return o}_quantizePoints(e,t,r){let n,o;const i=[];for(let s=0,l=e.length;s<l;s++){const l=e[s];if(s>0){const e=t(l[0]),s=r(l[1]);e===n&&s===o||(i.push([e-n,s-o]),n=e,o=s)}else n=t(l[0]),o=r(l[1]),i.push([n,o])}return i.length>0?i:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const n=(0,d.Bi)(e)?e.rings:e.paths,o=[];for(let e=0,i=n.length;e<i;e++){const i=n[e],s=this._quantizePoints(i,t,r);s&&o.push(s)}return o.length>0?((0,d.Bi)(e)?e.rings=o:e.paths=o,e):null}:"multipoint"===e?e=>{const n=this._quantizePoints(e.points,t,r);return n&&n.length>0?(e.points=n,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r,n,o){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),n&&(e.z=n(e.z))}:"polyline"===e||"polygon"===e?e=>{const i=(0,d.Bi)(e)?e.rings:e.paths;let s,l;for(let e=0,n=i.length;e<n;e++){const n=i[e];for(let e=0,o=n.length;e<o;e++){const o=n[e];e>0?(s+=o[0],l+=o[1]):(s=o[0],l=o[1]),o[0]=t(s),o[1]=r(l)}}if(n&&o)for(let e=0,t=i.length;e<t;e++){const t=i[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=n(r[2]),r[3]=o(r[3])}}else if(n)for(let e=0,t=i.length;e<t;e++){const t=i[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=n(r[2])}}else if(o)for(let e=0,t=i.length;e<t;e++){const t=i[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=o(r[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax),n&&null!=e.zmax&&null!=e.zmin&&(e.zmax=n(e.zmax),e.zmin=n(e.zmin)),o&&null!=e.mmax&&null!=e.mmin&&(e.mmax=o(e.mmax),e.mmin=o(e.mmin))}:"multipoint"===e?e=>{const i=e.points;let s,l;for(let e=0,n=i.length;e<n;e++){const n=i[e];e>0?(s+=n[0],l+=n[1]):(s=n[0],l=n[1]),n[0]=t(s),n[1]=r(l)}if(n&&o)for(let e=0,t=i.length;e<t;e++){const t=i[e];t[2]=n(t[2]),t[3]=o(t[3])}else if(n)for(let e=0,t=i.length;e<t;e++){const t=i[e];t[2]=n(t[2])}else if(o)for(let e=0,t=i.length;e<t;e++){const t=i[e];t[2]=o(t[2])}}:null}};(0,o._)([(0,p.MZ)({type:String,json:{write:!0}})],w.prototype,"displayFieldName",void 0),(0,o._)([(0,p.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"exceededTransferLimit",void 0),(0,o._)([(0,p.MZ)({type:[i.A],json:{write:!0}})],w.prototype,"features",void 0),(0,o._)([(0,u.w)("features")],w.prototype,"readFeatures",null),(0,o._)([(0,p.MZ)({type:[m.A],json:{write:!0}})],w.prototype,"fields",void 0),(0,o._)([(0,p.MZ)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:g.read}}})],w.prototype,"geometryType",void 0),(0,o._)([(0,y.K)("geometryType")],w.prototype,"writeGeometryType",null),(0,o._)([(0,p.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"hasM",void 0),(0,o._)([(0,p.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"hasZ",void 0),(0,o._)([(0,p.MZ)({types:h.yR,json:{write:!0}})],w.prototype,"queryGeometry",void 0),(0,o._)([(0,u.w)("queryGeometry")],w.prototype,"readQueryGeometry",null),(0,o._)([(0,p.MZ)({type:f.A,json:{write:!0}})],w.prototype,"spatialReference",void 0),(0,o._)([(0,y.K)("spatialReference")],w.prototype,"writeSpatialReference",null),(0,o._)([(0,p.MZ)({json:{write:!0}})],w.prototype,"transform",void 0),w=n=(0,o._)([(0,c.$)("esri.rest.support.FeatureSet")],w),w.prototype.toJSON.isDefaultToJSON=!0;const _=w},32730:(e,t,r)=>{r.d(t,{BI:()=>m,D3:()=>d,XJ:()=>h,lc:()=>f,mX:()=>w,rU:()=>g,tH:()=>M});var n=r(799);const o="__begin__",i="__end__",s=new RegExp(o,"ig"),l=new RegExp(i,"ig"),a=new RegExp("^"+o,"i"),p=new RegExp(i+"$","i"),u='"',c=u+" + ",y=" + "+u;function f(e){return e.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function d(e){return e.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function h(e){const t={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(t.expression=e.labelExpressionInfo.value,t.type="conventional"):e.labelExpressionInfo.expression&&(t.expression=e.labelExpressionInfo.expression,t.type="arcade"):null!=e.labelExpression&&(t.expression=f(e.labelExpression),t.type="conventional"),t}function m(e){const t=h(e);switch(t.type){case"conventional":return w(t.expression);case"arcade":return t.expression}return null}function g(e){const t=h(e);switch(t.type){case"conventional":return function(e){const t=e?.match(_);return t?.[1].trim()||null}(t.expression);case"arcade":return M(t.expression)}return null}function w(e){let t;return e?(t=(0,n.HC)(e,(e=>o+'$feature["'+e+'"]'+i)),t=a.test(t)?t.replace(a,""):u+t,t=p.test(t)?t.replace(p,""):t+u,t=t.replaceAll(s,c).replaceAll(l,y)):t='""',t}const _=/^\s*\{([^}]+)\}\s*$/i,x=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,b=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,v=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function M(e){if(!e)return null;let t=x.exec(e)||b.exec(e);return t?t[1]||t[3]:(t=v.exec(e),t?t[2]:null)}},32756:(e,t,r)=>{r.d(t,{Rr:()=>a,fY:()=>u,ne:()=>p});var n=r(90237),o=r(93637),i=r(10107),s=(r(44208),r(53966),r(87811),r(40608)),l=r(91880);function a(e,t,r){if(!e)return null;const n=e.find((e=>!!e.field));if(!n)return null;const o=new l.A;return o.read(n,r),[o]}const p={type:[l.A],json:{origins:{"web-scene":{write:!1,read:!1}},name:"layerDefinition.orderBy",read:{reader:a},write:{writer:function(e,t,r,n){const i=e.find((e=>!!e.field));i&&(0,o.sM)(r,[i.toJSON()],t)}}}},u=e=>{let t=class extends e{constructor(){super(...arguments),this.orderBy=null}};return(0,n._)([(0,i.MZ)(p)],t.prototype,"orderBy",void 0),t=(0,n._)([(0,s.$)("esri.layers.mixins.OrderedLayer")],t),t}},33032:(e,t,r)=>{r.d(t,{H:()=>o,L:()=>n});const n=1;function o(e,t){let r=0;for(const n of t){const t=n.attributes?.[e];"number"==typeof t&&isFinite(t)&&(r=Math.max(r,t))}return r}},33143:(e,t,r)=>{r.d(t,{A:()=>f});var n=r(90237),o=r(69540),i=r(25482),s=r(10107),l=(r(44208),r(53966),r(87811),r(36005)),a=r(40608),p=r(43937),u=r(80451),c=r(29005);let y=class extends(o.A.ClonableMixin(i.A)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const r of Object.keys(e))t[r]=(0,u.rS)(e[r]);return t}writeDomains(e,t){const r={};for(const t of Object.keys(e))e[t]&&(r[t]=e[t]?.toJSON());t.domains=r}};(0,n._)([(0,s.MZ)({json:{write:!0}})],y.prototype,"id",void 0),(0,n._)([(0,s.MZ)({json:{write:!0}})],y.prototype,"name",void 0),(0,n._)([(0,s.MZ)({json:{write:!0}})],y.prototype,"domains",void 0),(0,n._)([(0,l.w)("domains")],y.prototype,"readDomains",null),(0,n._)([(0,p.K)("domains")],y.prototype,"writeDomains",null),(0,n._)([(0,s.MZ)({type:[c.A],json:{write:!0}})],y.prototype,"templates",void 0),y=(0,n._)([(0,a.$)("esri.layers.support.FeatureType")],y);const f=y},39516:(e,t,r)=>{let n;async function o(){return null==n&&(n=r.e(4123).then(r.bind(r,44123)).then((e=>new e.WhereClauseCache(500,500)))),n}async function i(e,t){const r=await o(),n=r.get(e,t);if(null==n)throw r.getError(e,t);return n}function s(e,t){return e||=null,t||=null,"1=1"===e?t??e:"1=1"===t?e??t:e&&t?`(${e}) AND (${t})`:e??t}function l(e,t){return e||=null,t||=null,"1=1"===e||"1=1"===t||e===t?"1=1"===e?e:t:e&&t?`(${e}) OR (${t})`:e??t}r.d(t,{GP:()=>i,IW:()=>l,mA:()=>s})},41366:(e,t,r)=>{r.d(t,{K:()=>y,Q:()=>p});var n=r(90237),o=r(66552),i=r(53966),s=r(10107),l=(r(44208),r(87811),r(93223)),a=r(40608);const p=(0,o.O)()({naturalLog:"natural-log",squareRoot:"square-root",percentOfTotal:"percent-of-total",log:"log",field:"field"}),u="percent-of-total",c="field",y=e=>{let t=class extends e{constructor(){super(...arguments),this.normalizationField=null,this.normalizationMaxValue=null,this.normalizationMinValue=null,this.normalizationTotal=null}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,r=null!=this.normalizationTotal;return t||r?(e=t&&c||r&&u||null,t&&r&&i.A.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==c&&e!==u||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}};return(0,n._)([(0,s.MZ)({type:String,json:{name:"parameters.normalizationField",write:!0}})],t.prototype,"normalizationField",void 0),(0,n._)([(0,s.MZ)({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],t.prototype,"normalizationMaxValue",void 0),(0,n._)([(0,s.MZ)({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],t.prototype,"normalizationMinValue",void 0),(0,n._)([(0,s.MZ)({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],t.prototype,"normalizationTotal",void 0),(0,n._)([(0,l.e)(p,{name:"parameters.normalizationType"})],t.prototype,"normalizationType",null),t=(0,n._)([(0,a.$)("esri.rest.support.NormalizationBinParametersMixin")],t),t}},41560:(e,t,r)=>{r.d(t,{Ch:()=>s,mW:()=>i});var n=r(34727),o=r(39516);function i(e,t){return{...t,filterMode:e.mode}}function s(e,t,r){const i=function(e){if("manual"===p(e))return null;const t=[Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY];for(const{minScale:r,maxScale:n}of e.filters)t[0]=Math.max(t[0],u(r)),t[1]=Math.min(t[1],c(n));return t}(e);if(i&&((0,n.gg)(t,i[0])||(0,n.ZH)(r,i[1])))return"";const s=Array.from(l(e,t,r)),a=function(e,t,r){if(0===e.length)return!0;const o=u(e.at(0)?.minScale),i=c(e.at(-1)?.maxScale);if((0,n.ZH)(o,t)||(0,n.gg)(i,r))return!0;for(let t=0;t<e.length-1;t++){const r=e[t],o=e[t+1];if((0,n.ZH)(u(o.minScale),c(r.maxScale)))return!0}return!1}(s,t,r)?"1=1":s.map((e=>e.where||"1=1")).reduce(((e,t)=>(0,o.IW)(e,t)),"");return a&&"1=1"!==a?a:""}function*l(e,t,r){if("manual"===p(e)){const t=e.filters.find((t=>t.id===e.activeFilterId));t&&(yield t)}else{"object"==typeof t&&(t=t.scale);for(const n of e.filters)a(n.minScale,n.maxScale,t,r)&&(yield n)}}function a(e,t,r,o){return e=u(e),r=u(r),t=c(t),!(!(0,n.Sp)(r,e)&&(o??r)>e||(0,n.Hx)(t,r)||void 0!==o&&(0,n.Sp)(o,e))}function p(e){return"mode"in e?e.mode:e.filterMode}function u(e){return e||Number.POSITIVE_INFINITY}function c(e){return e||0}},58501:(e,t,r)=>{r.d(t,{q:()=>o});var n=r(62815);function o(e,t,r){if(!r?.features||!r.hasZ)return;const o=(0,n.N)(r.geometryType,t,e.outSpatialReference);if(null!=o)for(const e of r.features)o(e.geometry)}},80754:(e,t,r)=>{r.d(t,{j7:()=>s,kS:()=>a,kd:()=>l,r8:()=>p});var n=r(82799),o=r(16930),i=r(65864);const s={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new n.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:o.A.WebMercator}),minus180Line:new n.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:o.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new n.A({paths:[[[180,-180],[180,180]]],spatialReference:o.A.WGS84}),minus180Line:new n.A({paths:[[[-180,-180],[-180,180]]],spatialReference:o.A.WGS84})}};function l(e,t){return Math.ceil((e-t)/(2*t))}function a(e,t){const r=p(e);for(const e of r)for(const r of e)r[0]+=t;return e}function p(e){return(0,i.Bi)(e)?e.rings:e.paths}},91880:(e,t,r)=>{r.d(t,{A:()=>c});var n,o=r(90237),i=r(66552),s=r(25482),l=r(10107),a=(r(44208),r(53966),r(87811),r(40608));const p=new i.J({asc:"ascending",desc:"descending"});let u=class extends s.A{static{n=this}constructor(e){super(e),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new n({field:this.field,valueExpression:this.valueExpression,order:this.order})}};(0,o._)([(0,l.MZ)({type:String,json:{write:!0}})],u.prototype,"field",void 0),(0,o._)([(0,l.MZ)({type:String,json:{write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],u.prototype,"valueExpression",void 0),(0,o._)([(0,l.MZ)({type:p.apiValues,json:{type:p.jsonValues,read:p.read,write:p.write}})],u.prototype,"order",void 0),u=n=(0,o._)([(0,a.$)("esri.layers.support.OrderByInfo")],u);const c=u},92300:(e,t,r)=>{r.d(t,{V:()=>i,X:()=>o});var n=r(65864);function o(e){return{geometryType:(0,n.$B)(e[0]),geometries:e.map((e=>e.toJSON()))}}function i(e,t,r){const o=(0,n.xD)(t);return e.map((e=>{const t=o.fromJSON(e);return t.spatialReference=r,t}))}},92935:(e,t,r)=>{var n;r.d(t,{X:()=>n}),function(e){e[e.SAVE=0]="SAVE",e[e.SAVE_AS=1]="SAVE_AS"}(n||(n={}))},94194:(e,t,r)=>{r.d(t,{A:()=>x});var n=r(90237),o=r(10107),i=(r(44208),r(53966),r(87811),r(40608)),s=r(5503),l=r(62885);let a=class extends s.A{constructor(e){super(e),this.addHandles([this.on("before-add",(e=>{null==e.item&&e.preventDefault()})),this.on("after-add",(e=>this._own(e.item))),this.on("after-remove",(e=>this._release(e.item)))])}get owner(){return this._get("owner")}set owner(e){e!==this._get("owner")&&(this._releaseAll(),this._set("owner",e),this._ownAll())}_ownAll(){for(const e of this.items)this._own(e)}_releaseAll(){for(const e of this.items)this._release(e)}_createNewInstance(e){return this.itemType?new(s.A.ofType(this.itemType.Type))(e):new s.A(e)}};(0,n._)([(0,o.MZ)()],a.prototype,"owner",null),a=(0,n._)([(0,i.$)("esri.core.support.OwningCollection")],a);var p=r(4146),u=r(63074),c=r(25036),y=r(52106),f=r(56507),d=(r(49186),r(7695));let h=class extends a{_own(e){e.layer&&"remove"in e.layer&&e.layer!==this.owner&&e.layer.remove(e),e.layer=this.owner}_release(e){e.layer===this.owner&&(e.layer=null)}};(0,n._)([(0,d.u)({Type:y.A,ensureType:(0,f.dp)(y.A)})],h.prototype,"itemType",void 0),h=(0,n._)([(0,i.$)("esri.support.GraphicsCollection")],h);var m=r(88625);let g=class extends((0,u.dM)((0,c.j)(p.A))){constructor(e){super(e),this.elevationInfo=null,this.graphics=new h,this.screenSizePerspectiveEnabled=!0,this.type="graphics",this.internal=!1}destroy(){this.removeAll(),this.graphics.destroy()}add(e){return this.graphics.add(e),this}addMany(e){return this.graphics.addMany(e),this}removeAll(){return this.graphics.removeAll(),this}remove(e){this.graphics.remove(e)}removeMany(e){this.graphics.removeMany(e)}on(e,t){return super.on(e,t)}graphicChanged(e){this.emit("graphic-update",e)}};var w,_;(0,n._)([(0,o.MZ)({type:m.A})],g.prototype,"elevationInfo",void 0),(0,n._)([(0,o.MZ)((w=h,_="graphics",{type:w,cast:l.H,set(e){const t=(0,l.V)(e,this._get(_),w);t.owner=this,this._set(_,t)}}))],g.prototype,"graphics",void 0),(0,n._)([(0,o.MZ)({type:["show","hide"]})],g.prototype,"listMode",void 0),(0,n._)([(0,o.MZ)()],g.prototype,"screenSizePerspectiveEnabled",void 0),(0,n._)([(0,o.MZ)({readOnly:!0})],g.prototype,"type",void 0),(0,n._)([(0,o.MZ)({constructOnly:!0})],g.prototype,"internal",void 0),g=(0,n._)([(0,i.$)("esri.layers.GraphicsLayer")],g);const x=g},96953:(e,t,r)=>{r.r(t),r.d(t,{default:()=>G});var n=r(90237),o=r(52106),i=r(5503),s=r(49186),l=r(4718),a=r(92071),p=r(93637),u=r(67076),c=r(10107),y=(r(44208),r(53966),r(36005)),f=r(40608),d=r(43937),h=r(5443),m=r(57251),g=r(16930),w=r(19419),_=r(17136),x=r(21325),b=r(13600),v=r(94194),M=r(4146),S=r(33032),A=r(63074),T=r(16131),O=r(8303),N=r(25036),I=r(20437),Z=r(94985),R=r(31593),F=r(53930),j=r(68249);function L(e){return"markup"===e.featureCollectionType||e.layers.some((e=>null!=e.layerDefinition.visibilityField||!E(e)))}function E({layerDefinition:e,featureSet:t}){const r=e.geometryType??t.geometryType;return $.find((t=>r===t.geometryTypeJSON&&e.drawingInfo?.renderer?.symbol?.type===t.identifyingSymbol.type))}function J(){return new h.A({xmin:-180,ymin:-90,xmax:180,ymax:90})}const C=new I.A({name:"OBJECTID",alias:"OBJECTID",type:"oid",nullable:!1,editable:!1}),P=new I.A({name:"title",alias:"Title",type:"string",nullable:!0,editable:!0,length:255});let z=class extends v.A{constructor(e){super(e),this.visibilityMode="inherited"}initialize(){for(const e of this.graphics)e.sourceLayer=this.layer;this.graphics.on("after-add",(e=>{e.item.sourceLayer=this.layer})),this.graphics.on("after-remove",(e=>{e.item.sourceLayer=null}))}get fullExtent(){const e=this.layer?.spatialReference,t=this.fullBounds;return e?null==t?(0,m.projectOrLoad)(J(),e).geometry:(0,w.w1)(t,e):null}get fullBounds(){const e=this.layer?.spatialReference;if(!e)return null;const t=(0,w.Ie)();return this.graphics.forEach((r=>{const n=null!=r.geometry?(0,m.projectOrLoad)(r.geometry,e).geometry:null;null!=n&&(0,w.fT)(t,"point"===n.type?n:n.extent,t)})),(0,w.aI)(t,w.qv)?null:t}get sublayers(){return this.graphics}};(0,n._)([(0,c.MZ)({readOnly:!0})],z.prototype,"fullExtent",null),(0,n._)([(0,c.MZ)({readOnly:!0})],z.prototype,"fullBounds",null),(0,n._)([(0,c.MZ)({readOnly:!0})],z.prototype,"sublayers",null),(0,n._)([(0,c.MZ)()],z.prototype,"layer",void 0),(0,n._)([(0,c.MZ)()],z.prototype,"layerId",void 0),(0,n._)([(0,c.MZ)({readOnly:!0})],z.prototype,"visibilityMode",void 0),z=(0,n._)([(0,f.$)("esri.layers.MapNotesLayer.MapNotesSublayer")],z);const $=[{geometryType:"polygon",geometryTypeJSON:"esriGeometryPolygon",id:"polygonLayer",layerId:0,title:"Polygons",identifyingSymbol:(new Z.A).toJSON()},{geometryType:"polyline",geometryTypeJSON:"esriGeometryPolyline",id:"polylineLayer",layerId:1,title:"Polylines",identifyingSymbol:(new R.A).toJSON()},{geometryType:"multipoint",geometryTypeJSON:"esriGeometryMultipoint",id:"multipointLayer",layerId:2,title:"Multipoints",identifyingSymbol:(new F.A).toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"pointLayer",layerId:3,title:"Points",identifyingSymbol:(new F.A).toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"textLayer",layerId:4,title:"Text",identifyingSymbol:(new j.A).toJSON()}];let k=class extends((0,A.dM)((0,N.j)((0,T.q)((0,O.A)((0,a.P)(M.A)))))){constructor(e){super(e),this.capabilities={operations:{supportsMapNotesEditing:!0}},this.featureCollections=null,this.featureCollectionJSON=null,this.featureCollectionType="notes",this.legendEnabled=!1,this.listMode="hide-children",this.minScale=0,this.maxScale=0,this.spatialReference=g.A.WGS84,this.sublayers=new i.A($.map((e=>new z({id:e.id,layerId:e.layerId,title:e.title,layer:this})))),this.title="Map Notes",this.type="map-notes",this.visibilityMode="inherited"}readCapabilities(e,t,r){return{operations:{supportsMapNotesEditing:!L(t)&&"portal-item"!==r?.origin}}}readFeatureCollections(e,t,r){if(!L(t))return null;const n=t.layers.map((e=>{const t=new b.default;return t.read(e,r),t}));return new i.A({items:n})}readLegacyfeatureCollectionJSON(e,t){return L(t)?(0,l.o8)(t.featureCollection):null}get fullExtent(){const e=this.spatialReference,t=(0,w.Ie)();return null!=this.sublayers?this.sublayers.forEach((({fullBounds:e})=>null!=e?(0,w.fT)(t,e,t):t),t):this.featureCollectionJSON?.layers.some((e=>e.layerDefinition.extent))&&this.featureCollectionJSON.layers.forEach((r=>{const n=(0,m.projectOrLoad)(r.layerDefinition.extent,e).geometry;null!=n&&(0,w.fT)(t,n,t)})),(0,w.aI)(t,w.qv)?(0,m.projectOrLoad)(J(),e).geometry:(0,w.w1)(t,e)}readMinScale(e,t){for(const e of t.layers)if(null!=e.layerDefinition.minScale)return e.layerDefinition.minScale;return 0}readMaxScale(e,t){for(const e of t.layers)if(null!=e.layerDefinition.maxScale)return e.layerDefinition.maxScale;return 0}get multipointLayer(){return this._findSublayer("multipointLayer")}get pointLayer(){return this._findSublayer("pointLayer")}get polygonLayer(){return this._findSublayer("polygonLayer")}get polylineLayer(){return this._findSublayer("polylineLayer")}readSpatialReference(e,t){return t.layers.length?g.A.fromJSON(t.layers[0].layerDefinition.spatialReference):g.A.WGS84}readSublayers(e,t,r){if(L(t))return null;const n=[];let s=t.layers.reduce(((e,t)=>Math.max(e,t.layerDefinition.id??-1)),-1)+1;for(const e of t.layers){const{layerDefinition:t,featureSet:r}=e,i=t.id??s++,l=E(e);if(null!=l){const e=new z({id:l.id,title:t.name,layerId:i,layer:this,graphics:r.features.map((({geometry:e,symbol:t,attributes:r,popupInfo:n})=>o.A.fromJSON({attributes:r,geometry:e,symbol:t,popupTemplate:n})))});n.push(e)}}return new i.A(n)}writeSublayers(e,t,r,n){const{minScale:o,maxScale:i}=this;if(null==e)return;const l=e.some((e=>e.graphics.length>0));if(!this.capabilities.operations.supportsMapNotesEditing)return void(l&&n?.messages?.push(new s.A("map-notes-layer:editing-not-supported","New map notes cannot be added to this layer")));const a=[];let u=this.spatialReference.toJSON();e:for(const t of e)for(const e of t.graphics)if(null!=e.geometry){u=e.geometry.spatialReference.toJSON();break e}for(const t of $){const r=e.find((e=>t.id===e.id));this._writeMapNoteSublayer(a,r,t,o,i,u,n)}(0,p.sM)("featureCollection.layers",a,t)}get textLayer(){return this._findSublayer("textLayer")}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},e)),Promise.resolve(this)}read(e,t){"featureCollection"in e&&(e=(0,l.o8)(e),Object.assign(e,e.featureCollection)),super.read(e,t)}async beforeSave(){if(null==this.sublayers)return;let e=null;const t=[];for(const r of this.sublayers)for(const n of r.graphics)if(null!=n.geometry){const r=n.geometry;e?(0,x.aI)(r.spatialReference,e)||((0,m.canProjectWithoutEngine)(r.spatialReference,e)||(0,m.isLoaded)()||await(0,m.load)(),n.geometry=(0,m.project)(r,e)):e=r.spatialReference,t.push(n)}const r=await(0,_.el)(t.map((e=>e.geometry)));t.forEach(((e,t)=>e.geometry=r[t]))}_findSublayer(e){return null==this.sublayers?null:this.sublayers?.find((t=>t.id===e))??null}_writeMapNoteSublayer(e,t,r,n,o,i,s){const a=[];if(null!=t){for(const e of t.graphics)this._writeMapNote(a,e,r.geometryType,s);this._normalizeObjectIds(a,C),e.push({layerDefinition:{name:t.title,drawingInfo:{renderer:{type:"simple",symbol:(0,l.o8)(r.identifyingSymbol)}},id:t.layerId,geometryType:r.geometryTypeJSON,minScale:n,maxScale:o,objectIdField:"OBJECTID",fields:[C.toJSON(),P.toJSON()],spatialReference:i},featureSet:{features:a,geometryType:r.geometryTypeJSON}})}}_writeMapNote(e,t,r,n){if(null==t)return;const{geometry:o,symbol:i,popupTemplate:s}=t;if(null==o)return;if(o.type!==r)return void n?.messages?.push(new u.A("map-notes-layer:invalid-geometry-type",`Geometry "${o.type}" cannot be saved in "${r}" layer`,{graphic:t}));if(null==i)return void n?.messages?.push(new u.A("map-notes-layer:no-symbol","Skipping map notes with no symbol",{graphic:t}));const l={attributes:{...t.attributes},geometry:o.toJSON(),symbol:i.toJSON()};null!=s&&(l.popupInfo=s.toJSON()),e.push(l)}_normalizeObjectIds(e,t){const r=t.name;let n=(0,S.H)(r,e)+1;const o=new Set;for(const t of e){t.attributes||(t.attributes={});const{attributes:e}=t;(null==e[r]||o.has(e[r]))&&(e[r]=n++),o.add(e[r])}}};(0,n._)([(0,c.MZ)({readOnly:!0})],k.prototype,"capabilities",void 0),(0,n._)([(0,y.w)(["portal-item","web-map"],"capabilities",["layers"])],k.prototype,"readCapabilities",null),(0,n._)([(0,c.MZ)({readOnly:!0})],k.prototype,"featureCollections",void 0),(0,n._)([(0,y.w)(["web-map","portal-item"],"featureCollections",["layers"])],k.prototype,"readFeatureCollections",null),(0,n._)([(0,c.MZ)({readOnly:!0,json:{origins:{"web-map":{write:{enabled:!0,target:"featureCollection"}}}}})],k.prototype,"featureCollectionJSON",void 0),(0,n._)([(0,y.w)(["web-map","portal-item"],"featureCollectionJSON",["featureCollection"])],k.prototype,"readLegacyfeatureCollectionJSON",null),(0,n._)([(0,c.MZ)({readOnly:!0,json:{read:!0,write:{enabled:!0,ignoreOrigin:!0}}})],k.prototype,"featureCollectionType",void 0),(0,n._)([(0,c.MZ)({readOnly:!0})],k.prototype,"fullExtent",null),(0,n._)([(0,c.MZ)({readOnly:!0,json:{origins:{"web-map":{write:{target:"featureCollection.showLegend",overridePolicy(){return{enabled:null!=this.featureCollectionJSON}}}}}}})],k.prototype,"legendEnabled",void 0),(0,n._)([(0,c.MZ)({type:["show","hide","hide-children"]})],k.prototype,"listMode",void 0),(0,n._)([(0,c.MZ)({type:Number,nonNullable:!0,json:{write:!1}})],k.prototype,"minScale",void 0),(0,n._)([(0,y.w)(["web-map","portal-item"],"minScale",["layers"])],k.prototype,"readMinScale",null),(0,n._)([(0,c.MZ)({type:Number,nonNullable:!0,json:{write:!1}})],k.prototype,"maxScale",void 0),(0,n._)([(0,y.w)(["web-map","portal-item"],"maxScale",["layers"])],k.prototype,"readMaxScale",null),(0,n._)([(0,c.MZ)({readOnly:!0})],k.prototype,"multipointLayer",null),(0,n._)([(0,c.MZ)({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],k.prototype,"operationalLayerType",void 0),(0,n._)([(0,c.MZ)({readOnly:!0})],k.prototype,"pointLayer",null),(0,n._)([(0,c.MZ)({readOnly:!0})],k.prototype,"polygonLayer",null),(0,n._)([(0,c.MZ)({readOnly:!0})],k.prototype,"polylineLayer",null),(0,n._)([(0,c.MZ)({type:g.A})],k.prototype,"spatialReference",void 0),(0,n._)([(0,y.w)(["web-map","portal-item"],"spatialReference",["layers"])],k.prototype,"readSpatialReference",null),(0,n._)([(0,c.MZ)({readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],k.prototype,"sublayers",void 0),(0,n._)([(0,y.w)("web-map","sublayers",["layers"])],k.prototype,"readSublayers",null),(0,n._)([(0,d.K)("web-map","sublayers")],k.prototype,"writeSublayers",null),(0,n._)([(0,c.MZ)({readOnly:!0})],k.prototype,"textLayer",null),(0,n._)([(0,c.MZ)()],k.prototype,"title",void 0),(0,n._)([(0,c.MZ)({readOnly:!0,json:{read:!1}})],k.prototype,"type",void 0),k=(0,n._)([(0,f.$)("esri.layers.MapNotesLayer")],k);const G=k}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4307],{28132:(e,t,r)=>{r.d(t,{A:()=>P});var i=r(90237),s=r(69622),o=r(49186),a=r(44208),n=r(74887),l=r(84952),u=r(10107),p=(r(53966),r(87811),r(40608)),y=r(21325),d=r(20557),c=r(27733),h=r(2272),f=r(20615),m=r(5443),b=r(80893),g=r(61956),_=r(78286),S=r(99199),w=r(97768),v=r(62815),I=r(90708);function x(e,t){return t}function A(e,t,r,i){switch(r){case 0:return F(e,t+i,0);case 1:return"lowerLeft"===e.originPosition?F(e,t+i,1):function({translate:e,scale:t},r,i){return e[i]-r*t[i]}(e,t+i,1)}}function M(e,t,r,i){return 2===r?F(e,t,2):A(e,t,r,i)}function E(e,t,r,i){return 2===r?0===t?0:F(e,t,3):A(e,t,r,i)}function O(e,t,r,i){return 3===r?0===t?0:F(e,t,3):M(e,t,r,i)}function F({translate:e,scale:t},r,i){return e[i]+r*t[i]}class T{constructor(e){this._options=e,this.geometryTypes=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=x,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._mValueOffset=null,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return{fields:[],features:[]}}finishFeatureResult(e){if(this._options.applyTransform&&(e.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!e.hasZ)return;const t=(0,v.N)(e.geometryType,this._options.sourceSpatialReference,e.spatialReference);if(null!=t)for(const r of e.features)t(r.geometry)}createSpatialReference(){return{}}addField(e,t){const r=e.fields;(0,w.Lw)(r),r.push(t);const i=r.map((e=>e.name));this._attributesConstructor=function(){for(const e of i)this[e]=null}}addFeature(e,t){e.features.push(t)}prepareFeatures(e){switch(this._transform=e.transform,this._options.applyTransform&&e.transform&&(this._applyTransform=this._deriveApplyTransform(e)),this._mValueOffset=null,this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&(this._mValueOffset=this._vertexDimension,this._vertexDimension++),e.geometryType){case"esriGeometryPoint":this.addCoordinate=(e,t,r)=>this.addCoordinatePoint(e,t,r),this.createGeometry=e=>this.createPointGeometry(e);break;case"esriGeometryPolygon":this.addCoordinate=(e,t,r)=>this._addCoordinatePolygon(e,t,r),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"esriGeometryPolyline":this.addCoordinate=(e,t,r)=>this._addCoordinatePolyline(e,t,r),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"esriGeometryMultipoint":this.addCoordinate=(e,t,r)=>this._addCoordinateMultipoint(e,t,r),this.createGeometry=e=>this._createMultipointGeometry(e)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,{attributes:new this._attributesConstructor}}allocateCoordinates(){}addLength(e,t,r){0===this._lengths.length&&(this._toAddInCurrentPath=t),this._lengths.push(t)}addQueryGeometry(e,t){const{queryGeometry:r,queryGeometryType:i}=t,s=this._transform?(0,I.Ch)(r.clone(),r,!1,!1,this._transform):r.clone(),o=(0,I.zv)(s,i,!1,!1);e.queryGeometryType=i,e.queryGeometry={...o}}createPointGeometry(e){const t={x:0,y:0,spatialReference:e.spatialReference};return e.hasZ&&(t.z=0),e.hasM&&(t.m=0),t}addCoordinatePoint(e,t,r){const i=this._transform;switch(t=this._applyTransform(i,t,r,0),r){case 0:e.x=t;break;case 1:e.y=t;break;case 2:"z"in e?e.z=t:e.m=t;break;case 3:e.m=t}}_transformPathLikeValue(e,t){let r=0;t<=1&&(r=this._previousCoordinate[t],this._previousCoordinate[t]+=e);const i=this._transform;return null!==this._mValueOffset&&0===e&&t>0&&!(t%this._mValueOffset)?0:this._applyTransform(i,e,t,r)}_addCoordinatePolyline(e,t,r){this._dehydratedAddPointsCoordinate(e.paths,t,r)}_addCoordinatePolygon(e,t,r){this._dehydratedAddPointsCoordinate(e.rings,t,r)}_addCoordinateMultipoint(e,t,r){0===r&&e.points.push([]);const i=this._transformPathLikeValue(t,r);e.points[e.points.length-1].push(i)}_createPolygonGeometry(e){return{rings:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createPolylineGeometry(e){return{paths:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createMultipointGeometry(e){return{points:[],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_dehydratedAddPointsCoordinate(e,t,r){0===r&&0==this._toAddInCurrentPath--&&(e.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const i=this._transformPathLikeValue(t,r),s=e[e.length-1];0===r&&(this._coordinateBufferPtr=0,this._coordinateBuffer=new Array(this._vertexDimension),s.push(this._coordinateBuffer)),this._coordinateBuffer[this._coordinateBufferPtr++]=i}_deriveApplyTransform(e){const{hasZ:t,hasM:r}=e;return t&&r?O:t?M:r?E:A}}var D=r(22671);let C=class extends s.A{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.queryAttachmentsSupported=!1,this.sourceSpatialReference=null,this.url=null}get parsedUrl(){return(0,l.An)(this.url)}async execute(e,t){const r=await this.executeJSON(e,t);return this.featureSetFromJSON(e,r,t)}async executeJSON(e,t){const r=this._normalizeQuery(e),i=null!=e.outStatistics?.[0],s=(0,a.A)("featurelayer-pbf-statistics"),o=(!i||s)&&!0!==e.returnTrueCurves;let n;if(this.pbfSupported&&o)try{n=await async function(e,t,r){const i=(0,h.Dl)(e),s={...r},o=g.A.from(t),a=!o.quantizationParameters,{data:n}=await(0,b.IJ)(i,o,new T({sourceSpatialReference:o.sourceSpatialReference,applyTransform:a}),s);return n}(this.url,r,t)}catch(e){if("query:parsing-pbf"!==e.name)throw e;this.pbfSupported=!1}return this.pbfSupported&&o||(n=await(0,S.e)(this.url,r,t)),this._normalizeFields(n.fields),n}async featureSetFromJSON(e,t,i){if(!this._queryIs3DObjectFormat(e)||null==this.infoFor3D||!t.features)return D.A.fromJSON(t);const{meshFeatureSetFromJSON:s}=await(0,n.qr)(Promise.all([r.e(690),r.e(3030),r.e(36),r.e(5754)]).then(r.bind(r,40050)),i);return s(e,this.infoFor3D,t)}executeForCount(e,t){return(0,f.I)(this.url,this._normalizeQuery(e),t)}executeForExtent(e,t){return async function(e,t,r){const i=(0,h.Dl)(e),s=await(0,b.Jf)(i,g.A.from(t),{...r}),o=s.data.extent;return!o||isNaN(o.xmin)||isNaN(o.ymin)||isNaN(o.xmax)||isNaN(o.ymax)?{count:s.data.count,extent:null}:{count:s.data.count,extent:m.A.fromJSON(o)}}(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return(0,_.V)(this.url,this._normalizeQuery(e),t)}async executeRelationshipQuery(e,t){const[{default:i},{executeRelationshipQuery:s}]=await(0,n.qr)(Promise.all([Promise.resolve().then(r.bind(r,26591)),r.e(5257).then(r.bind(r,15257))]),t);return e=i.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),s(this.url,e,t)}async executeRelationshipQueryForCount(e,t){const[{default:i},{executeRelationshipQueryForCount:s}]=await(0,n.qr)(Promise.all([Promise.resolve().then(r.bind(r,26591)),r.e(5257).then(r.bind(r,15257))]),t);return e=i.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),s(this.url,e,t)}async executeAttachmentQuery(e,t){const{executeAttachmentQuery:i,fetchAttachments:s,processAttachmentQueryResult:o}=await(0,n.qr)(r.e(9239).then(r.bind(r,9239)),t),a=(0,h.Dl)(this.url);return o(a,await(this.queryAttachmentsSupported?i(a,e,t):s(a,e,t)))}async executeAttributeBinsQuery(e,t){const{executeAttributeBinsQuery:i}=await(0,n.qr)(Promise.all([r.e(4575),r.e(3103)]).then(r.bind(r,33103)),t);return i(this.parsedUrl,e,t)}async executeTopFeaturesQuery(e,t){const{executeTopFeaturesQuery:i}=await(0,n.qr)(r.e(1273).then(r.bind(r,11273)),t);return i(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){const{executeForTopIds:i}=await(0,n.qr)(r.e(1277).then(r.bind(r,21277)),t);return i(this.parsedUrl,e,t)}async executeForTopExtents(e,t){const{executeForTopExtents:i}=await(0,n.qr)(r.e(8018).then(r.bind(r,8018)),t);return i(this.parsedUrl,e,t)}async executeForTopCount(e,t){const{executeForTopCount:i}=await(0,n.qr)(r.e(980).then(r.bind(r,10980)),t);return i(this.parsedUrl,e,t)}_normalizeQuery(e){let t=g.A.from(e);t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource?c.L.from(e.dynamicDataSource):this.dynamicDataSource);const{infoFor3D:r}=this;if(null!=r&&this._queryIs3DObjectFormat(e)){if(t=t===e?t.clone():t,t.formatOf3DObjects=(0,d.Hz)(r),!t.formatOf3DObjects)throw new o.A("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(t.outSpatialReference&&!(0,y.aI)(t.outSpatialReference,this.sourceSpatialReference))throw new o.A("query:unsupported-out-spatial-reference","3D object feature services do not support projection of geometries");if(null==t.outFields||!t.outFields.includes("*")){t=t===e?t.clone():t,null==t.outFields&&(t.outFields=[]);const{originX:i,originY:s,originZ:o,translationX:a,translationY:n,translationZ:l,scaleX:u,scaleY:p,scaleZ:y,rotationX:d,rotationY:c,rotationZ:h,rotationDeg:f}=r.transformFieldRoles;t.outFields.push(i,s,o,a,n,l,u,p,y,d,c,h,f)}}return t}_normalizeFields(e){if(null!=this.fieldsIndex&&null!=e)for(const t of e){const e=this.fieldsIndex.get(t.name);e&&Object.assign(t,e.toJSON())}}_queryIs3DObjectFormat(e){return null!=this.infoFor3D&&!0===e.returnGeometry&&"xyFootprint"!==e.multipatchOption&&!e.outStatistics}};(0,i._)([(0,u.MZ)({type:c.L})],C.prototype,"dynamicDataSource",void 0),(0,i._)([(0,u.MZ)()],C.prototype,"fieldsIndex",void 0),(0,i._)([(0,u.MZ)()],C.prototype,"gdbVersion",void 0),(0,i._)([(0,u.MZ)()],C.prototype,"infoFor3D",void 0),(0,i._)([(0,u.MZ)({readOnly:!0})],C.prototype,"parsedUrl",null),(0,i._)([(0,u.MZ)()],C.prototype,"pbfSupported",void 0),(0,i._)([(0,u.MZ)()],C.prototype,"queryAttachmentsSupported",void 0),(0,i._)([(0,u.MZ)()],C.prototype,"sourceSpatialReference",void 0),(0,i._)([(0,u.MZ)({type:String})],C.prototype,"url",void 0),C=(0,i._)([(0,p.$)("esri.layers.graphics.sources.support.QueryTask")],C);const P=C},32730:(e,t,r)=>{r.d(t,{BI:()=>m,D3:()=>h,XJ:()=>f,lc:()=>c,mX:()=>g,rU:()=>b,tH:()=>I});var i=r(799);const s="__begin__",o="__end__",a=new RegExp(s,"ig"),n=new RegExp(o,"ig"),l=new RegExp("^"+s,"i"),u=new RegExp(o+"$","i"),p='"',y=p+" + ",d=" + "+p;function c(e){return e.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function h(e){return e.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function f(e){const t={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(t.expression=e.labelExpressionInfo.value,t.type="conventional"):e.labelExpressionInfo.expression&&(t.expression=e.labelExpressionInfo.expression,t.type="arcade"):null!=e.labelExpression&&(t.expression=c(e.labelExpression),t.type="conventional"),t}function m(e){const t=f(e);switch(t.type){case"conventional":return g(t.expression);case"arcade":return t.expression}return null}function b(e){const t=f(e);switch(t.type){case"conventional":return function(e){const t=e?.match(_);return t?.[1].trim()||null}(t.expression);case"arcade":return I(t.expression)}return null}function g(e){let t;return e?(t=(0,i.HC)(e,(e=>s+'$feature["'+e+'"]'+o)),t=l.test(t)?t.replace(l,""):p+t,t=u.test(t)?t.replace(u,""):t+p,t=t.replaceAll(a,y).replaceAll(n,d)):t='""',t}const _=/^\s*\{([^}]+)\}\s*$/i,S=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,w=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,v=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function I(e){if(!e)return null;let t=S.exec(e)||w.exec(e);return t?t[1]||t[3]:(t=v.exec(e),t?t[2]:null)}},32756:(e,t,r)=>{r.d(t,{Rr:()=>l,fY:()=>p,ne:()=>u});var i=r(90237),s=r(93637),o=r(10107),a=(r(44208),r(53966),r(87811),r(40608)),n=r(91880);function l(e,t,r){if(!e)return null;const i=e.find((e=>!!e.field));if(!i)return null;const s=new n.A;return s.read(i,r),[s]}const u={type:[n.A],json:{origins:{"web-scene":{write:!1,read:!1}},name:"layerDefinition.orderBy",read:{reader:l},write:{writer:function(e,t,r,i){const o=e.find((e=>!!e.field));o&&(0,s.sM)(r,[o.toJSON()],t)}}}},p=e=>{let t=class extends e{constructor(){super(...arguments),this.orderBy=null}};return(0,i._)([(0,o.MZ)(u)],t.prototype,"orderBy",void 0),t=(0,i._)([(0,a.$)("esri.layers.mixins.OrderedLayer")],t),t}},33143:(e,t,r)=>{r.d(t,{A:()=>c});var i=r(90237),s=r(69540),o=r(25482),a=r(10107),n=(r(44208),r(53966),r(87811),r(36005)),l=r(40608),u=r(43937),p=r(80451),y=r(29005);let d=class extends(s.A.ClonableMixin(o.A)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const r of Object.keys(e))t[r]=(0,p.rS)(e[r]);return t}writeDomains(e,t){const r={};for(const t of Object.keys(e))e[t]&&(r[t]=e[t]?.toJSON());t.domains=r}};(0,i._)([(0,a.MZ)({json:{write:!0}})],d.prototype,"id",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],d.prototype,"name",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],d.prototype,"domains",void 0),(0,i._)([(0,n.w)("domains")],d.prototype,"readDomains",null),(0,i._)([(0,u.K)("domains")],d.prototype,"writeDomains",null),(0,i._)([(0,a.MZ)({type:[y.A],json:{write:!0}})],d.prototype,"templates",void 0),d=(0,i._)([(0,l.$)("esri.layers.support.FeatureType")],d);const c=d},33446:(e,t,r)=>{r.d(t,{C:()=>a,m:()=>o});var i=r(49186),s=r(74887);async function o(e,t,r){let o;try{o=await createImageBitmap(e)}catch(e){throw new i.A("request:server",`Unable to load ${t}`,{url:t,error:e})}return(0,s.Te)(r),o}async function a(e,t,r,o,a){let n;try{n=await createImageBitmap(e)}catch(e){throw new i.A("request:server",`Unable to load tile ${t}/${r}/${o}`,{error:e,level:t,row:r,col:o})}return(0,s.Te)(a),n}},38961:(e,t,r)=>{r.d(t,{A:()=>p});var i=r(90237),s=r(5503),o=r(36708),a=r(10107),n=r(40608),l=r(80559);let u=class extends s.A{constructor(e){super(e),this.getCollections=null}initialize(){this.addHandles((0,l.fm)((()=>this._refresh()),o.OH))}destroy(){this.getCollections=null}_refresh(){const e=null!=this.getCollections?this.getCollections():null;if(null==e)return void this.removeAll();let t=0;for(const r of e)null!=r&&(t=this._processCollection(t,r));this.splice(t,this.length)}_createNewInstance(e){return new s.A(e)}_processCollection(e,t){if(!t)return e;const r=this.itemFilterFunction??(e=>!!e);for(const i of t)if(i){if(r(i)){const t=this.indexOf(i,e);t>=0?t!==e&&this.reorder(i,e):this.add(i,e),++e}if(this.getChildrenFunction){const t=this.getChildrenFunction(i);if(Array.isArray(t))for(const r of t)e=this._processCollection(e,r);else e=this._processCollection(e,t)}}return e}};(0,i._)([(0,a.MZ)()],u.prototype,"getCollections",void 0),(0,i._)([(0,a.MZ)()],u.prototype,"getChildrenFunction",void 0),(0,i._)([(0,a.MZ)()],u.prototype,"itemFilterFunction",void 0),u=(0,i._)([(0,n.$)("esri.core.CollectionFlattener")],u);const p=u},39516:(e,t,r)=>{let i;async function s(){return null==i&&(i=r.e(4123).then(r.bind(r,44123)).then((e=>new e.WhereClauseCache(500,500)))),i}async function o(e,t){const r=await s(),i=r.get(e,t);if(null==i)throw r.getError(e,t);return i}function a(e,t){return e||=null,t||=null,"1=1"===e?t??e:"1=1"===t?e??t:e&&t?`(${e}) AND (${t})`:e??t}function n(e,t){return e||=null,t||=null,"1=1"===e||"1=1"===t||e===t?"1=1"===e?e:t:e&&t?`(${e}) OR (${t})`:e??t}r.d(t,{GP:()=>o,IW:()=>n,mA:()=>a})},41366:(e,t,r)=>{r.d(t,{K:()=>d,Q:()=>u});var i=r(90237),s=r(66552),o=r(53966),a=r(10107),n=(r(44208),r(87811),r(93223)),l=r(40608);const u=(0,s.O)()({naturalLog:"natural-log",squareRoot:"square-root",percentOfTotal:"percent-of-total",log:"log",field:"field"}),p="percent-of-total",y="field",d=e=>{let t=class extends e{constructor(){super(...arguments),this.normalizationField=null,this.normalizationMaxValue=null,this.normalizationMinValue=null,this.normalizationTotal=null}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,r=null!=this.normalizationTotal;return t||r?(e=t&&y||r&&p||null,t&&r&&o.A.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==y&&e!==p||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}};return(0,i._)([(0,a.MZ)({type:String,json:{name:"parameters.normalizationField",write:!0}})],t.prototype,"normalizationField",void 0),(0,i._)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],t.prototype,"normalizationMaxValue",void 0),(0,i._)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],t.prototype,"normalizationMinValue",void 0),(0,i._)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],t.prototype,"normalizationTotal",void 0),(0,i._)([(0,n.e)(u,{name:"parameters.normalizationType"})],t.prototype,"normalizationType",null),t=(0,i._)([(0,l.$)("esri.rest.support.NormalizationBinParametersMixin")],t),t}},58501:(e,t,r)=>{r.d(t,{q:()=>s});var i=r(62815);function s(e,t,r){if(!r?.features||!r.hasZ)return;const s=(0,i.N)(r.geometryType,t,e.outSpatialReference);if(null!=s)for(const e of r.features)s(e.geometry)}},60410:(e,t,r)=>{r.d(t,{A:()=>se});var i,s=r(90237),o=r(13874),a=r(78888),n=r(5503),l=r(49186),u=r(44208),p=r(4902),y=r(4718),d=r(92474),c=r(53966),h=r(92071),f=r(39516),m=r(84952),b=r(10107),g=r(79901),_=r(36005),S=r(40608),w=r(43937),v=r(56507),I=r(35666),x=r(88620),A=r(5443),M=r(16930),E=r(50498),O=r(28132),F=r(32756),T=r(15426),D=r(33143),C=r(20437),P=r(95466),L=r(30524),R=r(46499),Z=r(39383),V=r(37352),q=r(91880),j=r(45067),G=r(22453),N=r(27733),B=r(49053),k=r(13112),z=r(2272),Q=r(54546),$=r(61956),J=r(30291),U=r(33910);function K(e){return"esriSMS"===e?.type}function H(e,t,r){const i=this.originIdOf(t)>=(0,I.aB)(r.origin);return{ignoreOrigin:!0,allowNull:i,enabled:!!r&&"map-image"===r.layer?.type&&(r.writeSublayerStructure||i)}}function X(e,t,r){return{enabled:!!r&&"tile"===r.layer?.type&&(r.origin&&this.originIdOf(t)>=(0,I.aB)(r.origin)||this._isOverridden(t))}}function W(e,t,r){return{ignoreOrigin:!0,enabled:r&&r.writeSublayerStructure||!1}}function Y(e,t,r){return{ignoreOrigin:!0,enabled:!!r?.writeSublayerStructure&&this.originIdOf(t)>I.Gr.SERVICE}}function ee(e,t,r){return{ignoreOrigin:!0,enabled:!!r&&(r.writeSublayerStructure||this.originIdOf(t)>=(0,I.aB)(r.origin))}}let te=0;const re=new Set(["layer","parent","loaded","loadStatus","loadError","loadWarnings"]);let ie=class extends((0,h.P)(p.A.IdentifiableMixin(d.A))){static{i=this}constructor(e){super(e),this.capabilities=void 0,this.maxScaleRange={minScale:0,maxScale:0},this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.isTable=!1,this.legendEnabled=!0,this.objectIdField=null,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.relationships=null,this.sourceJSON=null,this.spatialReference=null,this.title=null,this.typeIdField=null,this.type="sublayer",this.types=null,this._lastParsedUrl=null}async load(e){return this.addResolvingPromise((async()=>{const{layer:t,url:r}=this;if(!t&&!r)throw new l.A("sublayer:missing-layer","Sublayer can't be loaded without being part of a layer",{sublayer:this});const i=t?await t.fetchSublayerInfo(this,e):(await(0,a.A)(r,{responseType:"json",query:{f:"json"},...e})).data;i&&(this.sourceJSON=i,this.read({layerDefinition:i},{origin:"service",layer:t,url:(0,z.Dl)(r)}))})()),this}readCapabilities(e,t){t=t.layerDefinition||t;const{attachment:r,operations:{supportsQuery:i,supportsQueryAttachments:s},query:{supportsFormatPBF:o,supportsOrderBy:a,supportsPagination:n},data:{supportsAttachment:l},queryRelated:u}=(0,G.S)(t,this.url);return{attachment:{supportsOrderByFields:r?.supportsOrderByFields??!1,supportsResize:r?.supportsResize??!1},exportMap:{supportsModification:!!t.canModifyLayer},operations:{supportsQuery:i,supportsQueryAttachments:s},data:{supportsAttachment:l},query:{supportsFormatPBF:o,supportsOrderBy:a,supportsPagination:n},queryRelated:u}}get defaultPopupTemplate(){return this.createPopupTemplate()}set definitionExpression(e){this._setAndNotifyLayer("definitionExpression",e)}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}readMaxScaleRange(e,t){return{minScale:(t=t.layerDefinition||t).minScale??0,maxScale:t.maxScale??0}}get fieldsIndex(){return new P.A(this.fields||[])}set floorInfo(e){this._setAndNotifyLayer("floorInfo",e)}readGlobalIdFieldFromService(e,t){if((t=t.layerDefinition||t).globalIdField)return t.globalIdField;if(t.fields)for(const e of t.fields)if("esriFieldTypeGlobalID"===e.type)return e.name}get id(){return this._get("id")??te++}set id(e){this._get("id")!==e&&(!1!==this.layer?.capabilities?.exportMap?.supportsDynamicLayers?this._set("id",e):this._logLockedError("id","capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"))}readIsTable(e,t){return"Table"===t.type}set labelingInfo(e){this._setAndNotifyLayer("labelingInfo",e)}writeLabelingInfo(e,t,r,i){e&&e.length&&(t.layerDefinition={drawingInfo:{labelingInfo:e.map((e=>e.write({},i)))}})}set labelsVisible(e){this._setAndNotifyLayer("labelsVisible",e)}set layer(e){this._set("layer",e),this.sublayers?.forEach((t=>t.layer=e))}set listMode(e){this._set("listMode",e)}set minScale(e){this._setAndNotifyLayer("minScale",e)}readMinScale(e,t){return t.minScale||t.layerDefinition?.minScale||0}set maxScale(e){this._setAndNotifyLayer("maxScale",e)}readMaxScale(e,t){return t.maxScale||t.layerDefinition?.maxScale||0}readObjectIdFieldFromService(e,t){if((t=t.layerDefinition||t).objectIdField)return t.objectIdField;const r=t.fields?.find((e=>"esriFieldTypeOID"===e.type));return r?.name}set opacity(e){this._setAndNotifyLayer("opacity",e)}readOpacity(e,t){const{layerDefinition:r}=t;return 1-.01*(r?.transparency??r?.drawingInfo?.transparency??0)}writeOpacity(e,t,r,i){t.layerDefinition={drawingInfo:{transparency:100-100*e}}}set orderBy(e){this._setAndNotifyLayer("orderBy",e)}writeParent(e,t){this.parent&&this.parent!==this.layer?t.parentLayerId=(0,v.Vr)(this.parent.id):t.parentLayerId=-1}get queryTask(){if(!this.layer)return null;const{capabilities:e,fieldsIndex:t,layer:r,url:i}=this,{spatialReference:s}=r,o="gdbVersion"in r?r.gdbVersion:void 0,a=(0,u.A)("featurelayer-pbf")&&e?.query.supportsFormatPBF;return new O.A({fieldsIndex:t,gdbVersion:o,pbfSupported:a,queryAttachmentsSupported:e?.operations?.supportsQueryAttachments??!1,sourceSpatialReference:s,url:i})}set renderer(e){if((0,L.yp)(e,this.fieldsIndex),e)for(const t of e.symbols)if((0,U.wk)(t)){c.A.getLogger(this).warn("Sublayer renderer should use 2D symbols");break}this._setAndNotifyLayer("renderer",e)}get source(){return this._get("source")||new B.f({mapLayerId:this.id})}set source(e){this._setAndNotifyLayer("source",e)}set sublayers(e){this._handleSublayersChange(e,this._get("sublayers")),this._set("sublayers",e)}castSublayers(e){return(0,v.dp)(n.A.ofType(i),e)}writeSublayers(e,t,r){this.sublayers?.length&&(t[r]=this.sublayers.map((e=>e.id)).toArray().reverse())}readTitle(e,t){return t.layerDefinition?.name??t.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const e=t.fields.find((e=>e.name.toLowerCase()===r));e&&(r=e.name)}return r}get url(){const e=this.layer?.parsedUrl??this._lastParsedUrl,t=this.source;if(!e)return null;if(this._lastParsedUrl=e,"map-layer"===t?.type)return`${e.path}/${t.mapLayerId}`;const r={layer:JSON.stringify({source:this.source})};return`${e.path}/dynamicLayer?${(0,m.x0)(r)}`}set url(e){this._overrideIfSome("url",e)}set visible(e){this._setAndNotifyLayer("visible",e)}writeVisible(e,t,r,i){t[r]=this.getAtOrigin("defaultVisibility","service")||e}clone(){const{store:e}=(0,x.oY)(this),t=new i;return(0,x.oY)(t).store=e.clone(re),this.commitProperty("url"),t._lastParsedUrl=this._lastParsedUrl,t}createPopupTemplate(e){return(0,J.tn)(this,e)}createQuery(){return new $.A({returnGeometry:!0,where:this.definitionExpression||"1=1"})}async createFeatureLayer(){if(this.hasOwnProperty("sublayers"))return null;const e=(await Promise.all([r.e(9953),r.e(3029),r.e(8506),r.e(3600),r.e(3186)]).then(r.bind(r,13600))).default,{layer:t,url:i}=this;let s;if(i&&this.originIdOf("url")>I.Gr.SERVICE)s=new e({url:i});else{if(!t?.parsedUrl)throw new l.A("createFeatureLayer:missing-information","Cannot create a FeatureLayer without a url or a parent layer");{const r=t.parsedUrl;s=new e({url:r.path}),r&&this.source&&("map-layer"===this.source.type?s.layerId=this.source.mapLayerId:s.dynamicDataSource=this.source)}}return null!=t?.refreshInterval&&(s.refreshInterval=t.refreshInterval),this.definitionExpression&&(s.definitionExpression=this.definitionExpression),this.floorInfo&&(s.floorInfo=(0,y.o8)(this.floorInfo)),this.originIdOf("labelingInfo")>I.Gr.SERVICE&&(s.labelingInfo=(0,y.o8)(this.labelingInfo)),this.originIdOf("labelsVisible")>I.Gr.DEFAULTS&&(s.labelsVisible=this.labelsVisible),this.originIdOf("legendEnabled")>I.Gr.DEFAULTS&&(s.legendEnabled=this.legendEnabled),this.originIdOf("visible")>I.Gr.DEFAULTS&&(s.visible=this.visible),this.originIdOf("minScale")>I.Gr.DEFAULTS&&(s.minScale=this.minScale),this.originIdOf("maxScale")>I.Gr.DEFAULTS&&(s.maxScale=this.maxScale),this.originIdOf("opacity")>I.Gr.DEFAULTS&&(s.opacity=this.opacity),this.originIdOf("popupTemplate")>I.Gr.DEFAULTS&&(s.popupTemplate=(0,y.o8)(this.popupTemplate)),this.originIdOf("renderer")>I.Gr.SERVICE&&(s.renderer=(0,y.o8)(this.renderer)),"data-layer"===this.source?.type&&(s.dynamicDataSource=this.source.clone()),this.originIdOf("title")>I.Gr.DEFAULTS&&(s.title=this.title),"map-image"===t?.type&&t.originIdOf("customParameters")>I.Gr.DEFAULTS&&(s.customParameters=t.customParameters),"tile"===t?.type&&t.originIdOf("customParameters")>I.Gr.DEFAULTS&&(s.customParameters=t.customParameters),s}getField(e){return this.fieldsIndex.get(e)}getFeatureType(e){return(0,T.xd)(this.types,this.typeIdField,e)}getFieldDomain(e,t){const r=t?.feature,i=this.getFeatureType(r);if(i){const t=i.domains&&i.domains[e];if(t&&"inherited"!==t.type)return t}return this._getLayerDomain(e)}async queryAttachments(e,t){await this.load(),e=Q.A.from(e);const r=this.capabilities;if(!r?.data?.supportsAttachment)throw new l.A("queryAttachments:not-supported","this layer doesn't support attachments");const{attachmentTypes:i,objectIds:s,globalIds:o,num:a,size:n,start:u,where:p}=e;if(!r?.operations?.supportsQueryAttachments&&(i?.length>0||o?.length>0||n?.length>0||a||u||p))throw new l.A("queryAttachments:option-not-supported","when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e);if(!(s?.length||o?.length||p))throw new l.A("queryAttachments:invalid-query","'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);return!r?.attachment?.supportsOrderByFields&&e.orderByFields?.length&&((e=e.clone()).orderByFields=null),this.queryTask.executeAttachmentQuery(e,t)}async queryFeatureCount(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new l.A("queryFeatureCount:not-supported","this layer doesn't support queries.");if(!this.url)throw new l.A("queryFeatureCount:not-supported","this layer has no url.");const r=this.layer?.apiKey;return await this.queryTask.executeForCount(e,{...t,query:{...this.layer?.customParameters,token:r}})}async queryFeatures(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new l.A("queryFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new l.A("queryFeatures:not-supported","this layer has no url.");const r=await this.queryTask.execute(e,{...t,query:{...this.layer?.customParameters,token:this.layer?.apiKey}});if(r?.features)for(const e of r.features)e.sourceLayer=this;return r}async queryObjectIds(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new l.A("queryObjectIds:not-supported","this layer doesn't support queries.");if(!this.url)throw new l.A("queryObjectIds:not-supported","this layer has no url.");const r=this.layer?.apiKey;return await this.queryTask.executeForIds(e,{...t,query:{...this.layer?.customParameters,token:r}})}async queryRelatedFeatures(e,t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new l.A("queryRelatedFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new l.A("queryRelatedFeatures:not-supported","this layer has no url.");const r=this.layer?.apiKey;return await this.queryTask.executeRelationshipQuery(e,{...t,query:{...this.layer?.customParameters,token:r}})}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new l.A("queryRelatedFeaturesCount:not-supported","this layer doesn't support queries.");if(!this.capabilities.queryRelated.supportsCount)throw new l.A("queryRelatedFeaturesCount:not-supported","this layer doesn't support query related counts.");if(!this.url)throw new l.A("queryRelatedFeaturesCount:not-supported","this layer has no url.");const r=this.layer?.apiKey;return await this.queryTask.executeRelationshipQueryForCount(e,{...t,query:{...this.layer?.customParameters,token:r}})}toExportImageJSON(e){const t={id:this.id,source:this.source?.toJSON()||{mapLayerId:this.id,type:"mapLayer"}},r=(0,f.mA)(e,this.definitionExpression);null!=r&&(t.definitionExpression=r);const i=["renderer","labelingInfo","opacity","labelsVisible"].reduce(((e,t)=>(e[t]=this.originIdOf(t),e)),{}),s=Object.keys(i).some((e=>i[e]>I.Gr.SERVICE));if(s){const e=t.drawingInfo={};if(i.renderer>I.Gr.SERVICE&&(e.renderer=this.renderer?this.renderer.toJSON():null),i.labelsVisible>I.Gr.SERVICE&&(e.showLabels=this.labelsVisible),this.labelsVisible&&i.labelingInfo>I.Gr.SERVICE)if(this.labelingInfo){!this.loaded&&this.labelingInfo?.some((e=>!e.labelPlacement))&&c.A.getLogger(this).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`,{sublayer:this});let t=this.labelingInfo;null!=this.geometryType&&(t=(0,Z.z)(this.labelingInfo,E.gy.toJSON(this.geometryType))),e.showLabels=!0,e.labelingInfo=t.filter((e=>e.labelPlacement)).map((e=>e.toJSON({origin:"service",layer:this.layer})))}else e.showLabels=!1;i.opacity>I.Gr.SERVICE&&(e.transparency=100-100*this.opacity),this._assignDefaultSymbolColors(e.renderer)}return(this.layer?.capabilities?.exportMap?.supportsSublayerOrderBy??!1)&&this.originIdOf("orderBy")>I.Gr.SERVICE&&(t.orderBy=this.orderBy?.map((e=>e.toJSON()))??null),t}_assignDefaultSymbolColors(e){this._forEachSimpleMarkerSymbols(e,(e=>{e.color||"esriSMSX"!==e.style&&"esriSMSCross"!==e.style||(e.outline?.color?e.color=e.outline.color:e.color=[0,0,0,0])}))}_forEachSimpleMarkerSymbols(e,t){if(e){const r=("uniqueValueInfos"in e?e.uniqueValueInfos:"classBreakInfos"in e?e.classBreakInfos:null)??[];for(const e of r)K(e.symbol)&&t(e.symbol);"symbol"in e&&K(e.symbol)&&t(e.symbol),"defaultSymbol"in e&&K(e.defaultSymbol)&&t(e.defaultSymbol)}}_setAndNotifyLayer(e,t){const r=this.layer,i=this._get(e);let s,o;switch(e){case"definitionExpression":case"floorInfo":s="supportsSublayerDefinitionExpression";break;case"minScale":case"maxScale":case"visible":s="supportsSublayerVisibility";break;case"labelingInfo":case"labelsVisible":case"opacity":case"renderer":case"source":s="supportsDynamicLayers",o="supportsModification";break;case"orderBy":s="supportsSublayerOrderBy",o="supportsModification"}const a=(0,x.oY)(this).getDefaultOrigin();if("service"!==a){if(s&&!1===this.layer?.capabilities?.exportMap?.[s])return void this._logLockedError(e,`capability not available 'layer.capabilities.exportMap.${s}'`);if(o&&!1===this.capabilities?.exportMap[o])return void this._logLockedError(e,`capability not available 'capabilities.exportMap.${o}'`)}"source"!==e||"not-loaded"===this.loadStatus?(this._set(e,t),"service"!==a&&i!==t&&r&&r.emit&&r.emit("sublayer-update",{propertyName:e,target:this})):this._logLockedError(e,"'source' can't be changed after calling sublayer.load()")}_handleSublayersChange(e,t){t&&(t.forEach((e=>{e.parent=null,e.layer=null})),this.removeAllHandles()),e&&(e.forEach((e=>{e.parent=this,e.layer=this.layer})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this,e.layer=this.layer})),e.on("after-remove",(({item:e})=>{e.parent=null,e.layer=null})),e.on("before-changes",(e=>{(this.layer?.capabilities?.exportMap?.supportsSublayersChanges??1)||(c.A.getLogger(this).error(new l.A("sublayer:sublayers-non-modifiable","Sublayer can't be added, moved, or removed from the layer's sublayers",{sublayer:this,layer:this.layer})),e.preventDefault())}))]))}_logLockedError(e,t){const{layer:r,declaredClass:i}=this;c.A.getLogger(i).error(new l.A("sublayer:locked",`Property '${String(e)}' can't be changed on Sublayer from the layer '${r?.id}'`,{reason:t,sublayer:this,layer:r}))}_getLayerDomain(e){return this.fieldsIndex.get(e)?.domain??null}static{this.test={isMapImageLayerOverridePolicy:e=>e===Y||e===W||e===H,isTileImageLayerOverridePolicy:e=>e===X}}};(0,s._)([(0,b.MZ)({readOnly:!0})],ie.prototype,"capabilities",void 0),(0,s._)([(0,_.w)("service","capabilities",["layerDefinition.canModifyLayer","layerDefinition.capabilities"])],ie.prototype,"readCapabilities",null),(0,s._)([(0,b.MZ)()],ie.prototype,"defaultPopupTemplate",null),(0,s._)([(0,b.MZ)({type:String,value:null,json:{name:"layerDefinition.definitionExpression",write:{allowNull:!0,overridePolicy:H}}})],ie.prototype,"definitionExpression",null),(0,s._)([(0,b.MZ)({readOnly:!0})],ie.prototype,"effectiveScaleRange",null),(0,s._)([(0,_.w)("service","maxScaleRange",["minScale","maxScale"])],ie.prototype,"readMaxScaleRange",null),(0,s._)([(0,b.MZ)({type:[C.A],json:{origins:{service:{read:{source:"layerDefinition.fields"}}}}})],ie.prototype,"fields",void 0),(0,s._)([(0,b.MZ)({readOnly:!0})],ie.prototype,"fieldsIndex",null),(0,s._)([(0,b.MZ)({type:V.A,value:null,json:{name:"layerDefinition.floorInfo",read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo",overridePolicy:H},origins:{"web-scene":{read:!1,write:!1}}}})],ie.prototype,"floorInfo",null),(0,s._)([(0,b.MZ)({type:A.A,json:{read:{source:"layerDefinition.extent"}}})],ie.prototype,"fullExtent",void 0),(0,s._)([(0,b.MZ)({type:E.gy.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:E.gy.read}}}}})],ie.prototype,"geometryType",void 0),(0,s._)([(0,b.MZ)({type:String})],ie.prototype,"globalIdField",void 0),(0,s._)([(0,_.w)("service","globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],ie.prototype,"readGlobalIdFieldFromService",null),(0,s._)([(0,b.MZ)({type:v.jz,json:{write:{ignoreOrigin:!0}}})],ie.prototype,"id",null),(0,s._)([(0,b.MZ)({readOnly:!0})],ie.prototype,"isTable",void 0),(0,s._)([(0,_.w)("service","isTable",["type"])],ie.prototype,"readIsTable",null),(0,s._)([(0,b.MZ)({value:null,type:[R.A],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo"},write:{target:"layerDefinition.drawingInfo.labelingInfo",overridePolicy:Y}}})],ie.prototype,"labelingInfo",null),(0,s._)([(0,w.K)("labelingInfo")],ie.prototype,"writeLabelingInfo",null),(0,s._)([(0,b.MZ)({type:Boolean,value:!0,json:{read:{source:"layerDefinition.drawingInfo.showLabels"},write:{target:"layerDefinition.drawingInfo.showLabels",overridePolicy:W}}})],ie.prototype,"labelsVisible",null),(0,s._)([(0,b.MZ)({value:null})],ie.prototype,"layer",null),(0,s._)([(0,b.MZ)({type:String,json:{write:{overridePolicy:X}}})],ie.prototype,"layerItemId",void 0),(0,s._)([(0,b.MZ)({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend",overridePolicy:ee}}})],ie.prototype,"legendEnabled",void 0),(0,s._)([(0,b.MZ)({type:["show","hide","hide-children"],value:"show",json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],ie.prototype,"listMode",null),(0,s._)([(0,b.MZ)({type:Number,value:0,json:{write:{overridePolicy:W}}})],ie.prototype,"minScale",null),(0,s._)([(0,_.w)("minScale",["minScale","layerDefinition.minScale"])],ie.prototype,"readMinScale",null),(0,s._)([(0,b.MZ)({type:Number,value:0,json:{write:{overridePolicy:W}}})],ie.prototype,"maxScale",null),(0,s._)([(0,_.w)("maxScale",["maxScale","layerDefinition.maxScale"])],ie.prototype,"readMaxScale",null),(0,s._)([(0,b.MZ)()],ie.prototype,"objectIdField",void 0),(0,s._)([(0,_.w)("service","objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],ie.prototype,"readObjectIdFieldFromService",null),(0,s._)([(0,b.MZ)({type:Number,value:1,json:{write:{target:"layerDefinition.drawingInfo.transparency",overridePolicy:W}}})],ie.prototype,"opacity",null),(0,s._)([(0,_.w)("opacity",["layerDefinition.drawingInfo.transparency","layerDefinition.transparency"])],ie.prototype,"readOpacity",null),(0,s._)([(0,w.K)("opacity")],ie.prototype,"writeOpacity",null),(0,s._)([(0,b.MZ)({value:null,type:[q.A],json:{name:"layerDefinition.orderBy",read:{reader:F.Rr}}})],ie.prototype,"orderBy",null),(0,s._)([(0,b.MZ)({json:{type:v.jz,write:{target:"parentLayerId",writerEnsuresNonNull:!0,overridePolicy:W}}})],ie.prototype,"parent",void 0),(0,s._)([(0,w.K)("parent")],ie.prototype,"writeParent",null),(0,s._)([(0,b.MZ)({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy:ee,writer(e,t,r){t[r]=!e}}}})],ie.prototype,"popupEnabled",void 0),(0,s._)([(0,b.MZ)({type:o.A,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy:ee}}})],ie.prototype,"popupTemplate",void 0),(0,s._)([(0,b.MZ)({readOnly:!0})],ie.prototype,"queryTask",null),(0,s._)([(0,b.MZ)({type:[j.A],readOnly:!0,json:{origins:{service:{read:{source:"layerDefinition.relationships"}}}}})],ie.prototype,"relationships",void 0),(0,s._)([(0,b.MZ)({types:k.Hg,value:null,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:Y},origins:{"web-scene":{types:k.XJ,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:Y}}}}})],ie.prototype,"renderer",null),(0,s._)([(0,b.MZ)({types:{key:"type",base:null,typeMap:{"data-layer":N.L,"map-layer":B.f}},cast(e){if(e){if("mapLayerId"in e)return(0,v.PZ)(B.f,e);if("dataSource"in e)return(0,v.PZ)(N.L,e)}return e},json:{name:"layerDefinition.source",write:{overridePolicy:W}}})],ie.prototype,"source",null),(0,s._)([(0,b.MZ)()],ie.prototype,"sourceJSON",void 0),(0,s._)([(0,b.MZ)({type:M.A,json:{origins:{service:{read:{source:"layerDefinition.extent.spatialReference"}}}}})],ie.prototype,"spatialReference",void 0),(0,s._)([(0,b.MZ)({value:null,json:{type:[v.jz],write:{target:"subLayerIds",allowNull:!0,overridePolicy:W}}})],ie.prototype,"sublayers",null),(0,s._)([(0,g.w)("sublayers")],ie.prototype,"castSublayers",null),(0,s._)([(0,w.K)("sublayers")],ie.prototype,"writeSublayers",null),(0,s._)([(0,b.MZ)({type:String,json:{name:"name",write:{overridePolicy:ee}}})],ie.prototype,"title",void 0),(0,s._)([(0,_.w)("service","title",["name","layerDefinition.name"])],ie.prototype,"readTitle",null),(0,s._)([(0,b.MZ)({type:String})],ie.prototype,"typeIdField",void 0),(0,s._)([(0,b.MZ)({json:{read:!1},readOnly:!0,value:"sublayer"})],ie.prototype,"type",void 0),(0,s._)([(0,_.w)("typeIdField",["layerDefinition.typeIdField"])],ie.prototype,"readTypeIdField",null),(0,s._)([(0,b.MZ)({type:[D.A],json:{origins:{service:{read:{source:"layerDefinition.types"}}}}})],ie.prototype,"types",void 0),(0,s._)([(0,b.MZ)({type:String,json:{name:"layerUrl",write:{overridePolicy:X}}})],ie.prototype,"url",null),(0,s._)([(0,b.MZ)({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"},write:{target:"defaultVisibility",overridePolicy:W}}})],ie.prototype,"visible",null),(0,s._)([(0,w.K)("visible")],ie.prototype,"writeVisible",null),ie=i=(0,s._)([(0,S.$)("esri.layers.support.Sublayer")],ie);const se=ie},63389:(e,t,r)=>{r.d(t,{Sk:()=>o,Zx:()=>s,_X:()=>n});var i=r(35666);function s(e,t,r){const i=t.flatten((({sublayers:e})=>e)).length;return i!==e.length||!!e.some((e=>e.originIdOf("minScale")>r||e.originIdOf("maxScale")>r||e.originIdOf("renderer")>r||e.originIdOf("labelingInfo")>r||e.originIdOf("opacity")>r||e.originIdOf("labelsVisible")>r||e.originIdOf("source")>r))||!a(e,t)}function o(e,t,r){return!!e.some((e=>{const t=e.source,s=!t||"map-layer"===t.type&&t.mapLayerId===e.id&&(null==t.gdbVersion||t.gdbVersion===r);e.commitProperty("renderer"),e.commitProperty("labelingInfo"),e.commitProperty("opacity"),e.commitProperty("labelsVisible"),e.commitProperty("orderBy");const o=e.layer?.capabilities?.exportMap?.supportsSublayerOrderBy??!1;return!s||e.originIdOf("renderer")>i.Gr.SERVICE||e.originIdOf("labelingInfo")>i.Gr.SERVICE||e.originIdOf("opacity")>i.Gr.SERVICE||e.originIdOf("labelsVisible")>i.Gr.SERVICE||o&&e.originIdOf("orderBy")>i.Gr.SERVICE}))||!a(e,t)}function a(e,t){if(!e?.length||null==t)return!0;const r=t.slice().reverse().flatten((({sublayers:e})=>e&&e.toArray().reverse())).map((e=>e.id)).toArray();if(e.length>r.length)return!1;let i=0;const s=r.length;for(const{id:t}of e){for(;i<s&&r[i]!==t;)i++;if(i>=s)return!1}return!0}function n(e){return!!e&&e.some((e=>null!=e.minScale||null!=e.layerDefinition?.minScale))}},81583:(e,t,r)=>{r.d(t,{L:()=>n,g:()=>a});var i=r(60999),s=r(5503),o=r(92474);async function a(e,t){return await e.load(),n(e,t)}async function n(e,t){const r=[],a=(...e)=>{for(const t of e)null!=t&&(Array.isArray(t)?a(...t):s.A.isCollection(t)?t.forEach((e=>a(e))):o.A.isLoadable(t)&&r.push(t))};t(a);let n=null;if(await(0,i.Tj)(r,(async e=>{const t=await(0,i.Ke)(function(e){return"loadAll"in e&&"function"==typeof e.loadAll}(e)?e.loadAll():e.load());!1!==t.ok||n||(n=t)})),n)throw n.error;return e}},91880:(e,t,r)=>{r.d(t,{A:()=>y});var i,s=r(90237),o=r(66552),a=r(25482),n=r(10107),l=(r(44208),r(53966),r(87811),r(40608));const u=new o.J({asc:"ascending",desc:"descending"});let p=class extends a.A{static{i=this}constructor(e){super(e),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new i({field:this.field,valueExpression:this.valueExpression,order:this.order})}};(0,s._)([(0,n.MZ)({type:String,json:{write:!0}})],p.prototype,"field",void 0),(0,s._)([(0,n.MZ)({type:String,json:{write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],p.prototype,"valueExpression",void 0),(0,s._)([(0,n.MZ)({type:u.apiValues,json:{type:u.jsonValues,read:u.read,write:u.write}})],p.prototype,"order",void 0),p=i=(0,s._)([(0,l.$)("esri.layers.support.OrderByInfo")],p);const y=p},91921:(e,t,r)=>{r.d(t,{I:()=>b});var i=r(90237),s=r(5503),o=r(38961),a=r(49186),n=r(53966),l=r(36708),u=r(10107),p=(r(44208),r(87811),r(88620)),y=r(40608),d=r(35666),c=r(60410),h=r(63389);const f=s.A.ofType(c.A);function m(e,t){e&&e.forEach((e=>{t(e),e.sublayers&&e.sublayers.length&&m(e.sublayers,t)}))}const b=e=>{let t=class extends e{constructor(...e){super(...e),this.allSublayers=new o.A({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.sublayersSourceJSON={[d.Gr.SERVICE]:{},[d.Gr.PORTAL_ITEM]:{},[d.Gr.WEB_SCENE]:{},[d.Gr.WEB_MAP]:{},[d.Gr.LINK_CHART]:{}},this.subtables=null,this.addHandles([(0,l.wB)((()=>this.sublayers),((e,t)=>this._handleSublayersChange(e,t)),l.OH),(0,l.wB)((()=>this.subtables),((e,t)=>this._handleSublayersChange(e,t)),l.OH)])}destroy(){this.allSublayers.destroy()}readSublayers(e,t){if(!t||!e)return;const{sublayersSourceJSON:r}=this,i=(0,d.aB)(t.origin);if(i<d.Gr.SERVICE)return;if(r[i]={context:t,visibleLayers:e.visibleLayers||r[i].visibleLayers,layers:e.layers||r[i].layers},i>d.Gr.SERVICE)return;this._set("serviceSublayers",this.createSublayersForOrigin("service").sublayers);const{sublayers:s,origin:o}=this.createSublayersForOrigin("web-document"),a=(0,p.oY)(this);a.setDefaultOrigin(o),this._set("sublayers",new f(s)),a.setDefaultOrigin("user")}findSublayerById(e){return this.allSublayers.find((t=>t.id===e))}createServiceSublayers(){return this.createSublayersForOrigin("service").sublayers}createSublayersForOrigin(e){const t=(0,d.aB)("web-document"===e?"web-map":e);let r=d.Gr.SERVICE,i=this.sublayersSourceJSON[d.Gr.SERVICE].layers,s=this.sublayersSourceJSON[d.Gr.SERVICE].context,o=null;const a=[d.Gr.PORTAL_ITEM,d.Gr.WEB_SCENE,d.Gr.WEB_MAP].filter((e=>e<=t));for(const e of a){const t=this.sublayersSourceJSON[e];(0,h._X)(t.layers)&&(r=e,i=t.layers,s=t.context,t.visibleLayers&&(o={visibleLayers:t.visibleLayers,context:t.context}))}const n=[d.Gr.PORTAL_ITEM,d.Gr.WEB_SCENE,d.Gr.WEB_MAP].filter((e=>e>r&&e<=t));let l=null;for(const e of n){const{layers:t,visibleLayers:r,context:i}=this.sublayersSourceJSON[e];t&&(l={layers:t,context:i}),r&&(o={visibleLayers:r,context:i})}const u=function(e,t){const r=[],i={};return e?(e.forEach((e=>{const s=new c.A;if(s.read(e,t),i[s.id]=s,null!=e.parentLayerId&&-1!==e.parentLayerId){const t=i[e.parentLayerId];t.sublayers||(t.sublayers=[]),t.sublayers.unshift(s)}else r.unshift(s)})),r):r}(i,s),p=new Map,y=new Set;if(l)for(const e of l.layers)p.set(e.id,e);if(o?.visibleLayers)for(const e of o.visibleLayers)y.add(e);return m(u,(e=>{l&&e.read(p.get(e.id),l.context),o&&e.read({defaultVisibility:y.has(e.id)},o.context)})),{origin:(0,d.OL)(r),sublayers:new f({items:u})}}read(e,t){super.read(e,t),this.readSublayers(e,t)}_handleSublayersChange(e,t){t&&(t.forEach((e=>{e.parent=null,e.layer=null})),this.removeHandles("sublayers-owner")),e&&(e.forEach((e=>{e.parent=this,e.layer=this})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this,e.layer=this})),e.on("after-remove",(({item:e})=>{e.parent=null,e.layer=null}))],"sublayers-owner"),"tile"===this.type&&this.addHandles(e.on("before-changes",(e=>{n.A.getLogger("esri.layers.TileLayer").error(new a.A("tilelayer:sublayers-non-modifiable","ISublayer can't be added, moved, or removed from the layer's sublayers",{layer:this})),e.preventDefault()})),"sublayers-owner"))}};return(0,i._)([(0,u.MZ)({readOnly:!0})],t.prototype,"allSublayers",void 0),(0,i._)([(0,u.MZ)({readOnly:!0,type:s.A.ofType(c.A)})],t.prototype,"serviceSublayers",void 0),(0,i._)([(0,u.MZ)({value:null,type:f,json:{read:!1,write:{allowNull:!0,ignoreOrigin:!0}}})],t.prototype,"sublayers",void 0),(0,i._)([(0,u.MZ)({readOnly:!0})],t.prototype,"sublayersSourceJSON",void 0),(0,i._)([(0,u.MZ)({type:f,json:{read:{source:"tables"}}})],t.prototype,"subtables",void 0),t=(0,i._)([(0,y.$)("esri.layers.mixins.SublayersOwner")],t),t}},98534:(e,t,r)=>{r.d(t,{V:()=>g});var i=r(90237),s=r(78888),o=r(91869),a=r(74887),n=r(84952),l=r(46140),u=r(10107),p=(r(44208),r(53966),r(87811),r(36005)),y=r(40608),d=r(35666),c=r(5443),h=r(16930),f=r(60694),m=r(10873),b=r(10407);const g=e=>{let t=class extends e{constructor(){super(...arguments),this.capabilities=void 0,this.copyright=null,this.fullExtent=null,this.legendEnabled=!0,this.spatialReference=null,this.version=void 0,this._allLayersAndTablesMap=null}readCapabilities(e,t){const r=t.capabilities&&t.capabilities.split(",").map((e=>e.toLowerCase().trim()));if(!r)return{operations:{supportsExportMap:!1,supportsExportTiles:!1,supportsIdentify:!1,supportsQuery:!1,supportsTileMap:!1},exportMap:null,exportTiles:null};const i=this.type,s="tile"!==i&&!!t.supportsDynamicLayers,o=r.includes("query"),a=r.includes("map"),n=!!t.exportTilesAllowed,u=r.includes("tilemap"),p=r.includes("data"),y="tile"!==i&&(!t.tileInfo||s),d="tile"!==i&&(!t.tileInfo||s),c="tile"!==i,h="tile"!==i&&s&&t.currentVersion>=11.1,f=t.cimVersion?l.R.parse(t.cimVersion):null,m=f?.greaterEqual(1,4)??!1,b=f?.greaterEqual(2,0)??!1;return{operations:{supportsExportMap:a,supportsExportTiles:n,supportsIdentify:o,supportsQuery:p,supportsTileMap:u},exportMap:a?{supportsArcadeExpressionForLabeling:m,supportsCIMSymbols:b,supportsDynamicLayers:s,supportsSublayerOrderBy:h,supportsSublayerDefinitionExpression:d,supportsSublayerVisibility:y,supportsSublayersChanges:c}:null,exportTiles:n?{maxExportTilesCount:+t.maxExportTilesCount}:null}}readVersion(e,t){let r=t.currentVersion;return r||(r=t.hasOwnProperty("capabilities")||t.hasOwnProperty("tables")?10:t.hasOwnProperty("supportedImageFormatTypes")?9.31:9.3),r}async fetchRelatedService(e){const t=this.portalItem;if(!t||!(0,b.bK)(t))return null;this._relatedFeatureServicePromise||(this._relatedFeatureServicePromise=t.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},e).then((e=>e.find((e=>"Feature Service"===e.type))??null),(()=>null)));const r=await this._relatedFeatureServicePromise;return(0,a.Te)(e),r?{itemId:r.id,url:r.url}:null}async fetchSublayerInfo(e,t){const{source:r}=e;if(this?.portalItem&&"tile"===this.type&&"map-layer"===r?.type&&(0,b.bK)(this.portalItem)&&e.originIdOf("url")<d.Gr.SERVICE){const i=await this.fetchRelatedService(t);i&&(e.url=(0,n.fj)(i.url,r.mapLayerId.toString()),e.layerItemId=i.itemId)}const{url:i}=e;let o;if("data-layer"===r.type)o=(await(0,s.A)(i,{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey},...t})).data;else if(i&&e.originIdOf("url")>d.Gr.SERVICE)try{const e=await this._fetchAllLayersAndTablesFromService(i),t=(0,f.qg)(i)?.sublayer??r.mapLayerId;o=e.get(t)}catch{}else{let i=e.id;"map-layer"===r?.type&&(i=r.mapLayerId);try{o=(await this.fetchAllLayersAndTables(t)).get(i)}catch{}}return o}async fetchAllLayersAndTables(e){return this._fetchAllLayersAndTablesFromService(this.parsedUrl?.path,e)}async _fetchAllLayersAndTablesFromService(e,t){await this.load(t),this._allLayersAndTablesMap||=new Map;const r=(0,f.qg)(e),i=(0,o.tE)(this._allLayersAndTablesMap,r?.url.path,(()=>(0,s.A)((0,n.fj)(r?.url.path,"/layers"),{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey}}).then((e=>{const t=new Map,{layers:r,tables:i}=e.data,s=[...r??[],...i??[]];for(const e of s)t.set(e.id,e);return{result:t}}),(e=>({error:e}))))),l=await i;if((0,a.Te)(t),"result"in l)return l.result;throw l.error}};return(0,i._)([(0,u.MZ)({readOnly:!0})],t.prototype,"capabilities",void 0),(0,i._)([(0,p.w)("service","capabilities",["capabilities","exportTilesAllowed","maxExportTilesCount","supportsDynamicLayers","tileInfo"])],t.prototype,"readCapabilities",null),(0,i._)([(0,u.MZ)({json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),(0,i._)([(0,u.MZ)({type:c.A})],t.prototype,"fullExtent",void 0),(0,i._)([(0,u.MZ)(m.id)],t.prototype,"id",void 0),(0,i._)([(0,u.MZ)({type:Boolean,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend"}}})],t.prototype,"legendEnabled",void 0),(0,i._)([(0,u.MZ)(m.M6)],t.prototype,"popupEnabled",void 0),(0,i._)([(0,u.MZ)({type:h.A})],t.prototype,"spatialReference",void 0),(0,i._)([(0,u.MZ)({readOnly:!0})],t.prototype,"version",void 0),(0,i._)([(0,p.w)("service","version",["currentVersion","capabilities","tables","supportedImageFormatTypes"])],t.prototype,"readVersion",null),t=(0,i._)([(0,y.$)("esri.layers.mixins.ArcGISMapService")],t),t}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5613],{4513:(e,a,t)=>{t.d(a,{S:()=>r});const r={BingMapsLayer:async()=>(await Promise.all([t.e(6131),t.e(8219),t.e(1319)]).then(t.bind(t,17029))).default,BuildingSceneLayer:async()=>(await Promise.all([t.e(6131),t.e(8219),t.e(8948),t.e(2106),t.e(5721),t.e(13),t.e(5055),t.e(3112),t.e(1956),t.e(9953),t.e(4796),t.e(3029),t.e(4111),t.e(8506),t.e(3600),t.e(690),t.e(2944),t.e(958),t.e(4654),t.e(6298),t.e(7675)]).then(t.bind(t,88303))).default,CSVLayer:async()=>(await Promise.all([t.e(6131),t.e(8219),t.e(8948),t.e(2106),t.e(5721),t.e(13),t.e(5055),t.e(3112),t.e(1956),t.e(9953),t.e(4796),t.e(3029),t.e(4111),t.e(8506),t.e(3600),t.e(4190)]).then(t.bind(t,72256))).default,CatalogLayer:async()=>(await Promise.all([t.e(6131),t.e(8219),t.e(8948),t.e(2106),t.e(5721),t.e(13),t.e(5055),t.e(3112),t.e(1956),t.e(4796),t.e(4111),t.e(8506),t.e(364),t.e(8628),t.e(2593),t.e(5023)]).then(t.bind(t,79003))).default,DimensionLayer:async()=>(await Promise.all([t.e(6131),t.e(3813)]).then(t.bind(t,71493))).default,ElevationLayer:async()=>(await Promise.all([t.e(6131),t.e(9953),t.e(9186),t.e(3816)]).then(t.bind(t,68611))).default,FeatureLayer:async()=>(await Promise.all([t.e(6131),t.e(8219),t.e(8948),t.e(2106),t.e(5721),t.e(13),t.e(5055),t.e(3112),t.e(1956),t.e(9953),t.e(4796),t.e(3029),t.e(4111),t.e(8506),t.e(3600),t.e(4601)]).then(t.bind(t,13600))).default,GeoJSONLayer:async()=>(await Promise.all([t.e(6131),t.e(8219),t.e(8948),t.e(2106),t.e(5721),t.e(13),t.e(5055),t.e(3112),t.e(1956),t.e(9953),t.e(4796),t.e(3029),t.e(8445)]).then(t.bind(t,17625))).default,GeoRSSLayer:async()=>(await Promise.all([t.e(6131),t.e(8219),t.e(4995)]).then(t.bind(t,63201))).default,GroupLayer:async()=>(await Promise.all([t.e(6131),t.e(2165),t.e(8256)]).then(t.bind(t,85989))).default,ImageryLayer:async()=>(await Promise.all([t.e(6131),t.e(8219),t.e(8948),t.e(2106),t.e(5721),t.e(13),t.e(5055),t.e(1956),t.e(9953),t.e(364),t.e(984),t.e(2439),t.e(272)]).then(t.bind(t,58434))).default,ImageryTileLayer:async()=>(await Promise.all([t.e(6131),t.e(8219),t.e(8948),t.e(2106),t.e(5721),t.e(13),t.e(5055),t.e(9953),t.e(984),t.e(6049),t.e(2439),t.e(7677),t.e(5943)]).then(t.bind(t,35943))).default,IntegratedMesh3DTilesLayer:async()=>(await Promise.all([t.e(6131),t.e(6126)]).then(t.bind(t,61528))).default,IntegratedMeshLayer:async()=>(await Promise.all([t.e(6131),t.e(6298),t.e(9655)]).then(t.bind(t,84453))).default,KMLLayer:async()=>(await Promise.all([t.e(6131),t.e(8219),t.e(8948),t.e(2106),t.e(5721),t.e(13),t.e(5055),t.e(3112),t.e(8072)]).then(t.bind(t,79465))).default,KnowledgeGraphLayer:async()=>(await Promise.all([t.e(6131),t.e(8219),t.e(8948),t.e(2106),t.e(5721),t.e(13),t.e(5055),t.e(3112),t.e(1956),t.e(9953),t.e(4796),t.e(3029),t.e(7339),t.e(8613),t.e(5202),t.e(8692)]).then(t.bind(t,28692))).default,LineOfSightLayer:async()=>(await Promise.all([t.e(6131),t.e(690),t.e(1056),t.e(9695)]).then(t.bind(t,49695))).default,LinkChartLayer:async()=>(await Promise.all([t.e(6131),t.e(8219),t.e(8948),t.e(2106),t.e(5721),t.e(13),t.e(5055),t.e(3112),t.e(1956),t.e(9953),t.e(4796),t.e(3029),t.e(7339),t.e(8613),t.e(5202),t.e(1728)]).then(t.bind(t,71728))).default,MapImageLayer:async()=>(await Promise.all([t.e(6131),t.e(8219),t.e(8948),t.e(2106),t.e(5721),t.e(13),t.e(5055),t.e(3112),t.e(1956),t.e(4796),t.e(4111),t.e(364),t.e(4307),t.e(7656),t.e(6928)]).then(t.bind(t,7656))).default,MapNotesLayer:async()=>(await Promise.all([t.e(6131),t.e(8219),t.e(8948),t.e(2106),t.e(5721),t.e(13),t.e(5055),t.e(3112),t.e(1956),t.e(9953),t.e(4796),t.e(3029),t.e(4111),t.e(8506),t.e(3600),t.e(2833)]).then(t.bind(t,96953))).default,MediaLayer:async()=>(await Promise.all([t.e(6131),t.e(2763)]).then(t.bind(t,19647))).default,OGCFeatureLayer:async()=>(await Promise.all([t.e(6131),t.e(8219),t.e(8948),t.e(2106),t.e(5721),t.e(13),t.e(5055),t.e(3112),t.e(1956),t.e(4796),t.e(3029),t.e(377),t.e(4934)]).then(t.bind(t,87152))).default,OpenStreetMapLayer:async()=>(await Promise.all([t.e(6131),t.e(8219),t.e(5920),t.e(349)]).then(t.bind(t,40349))).default,OrientedImageryLayer:async()=>(await Promise.all([t.e(6131),t.e(8219),t.e(8948),t.e(2106),t.e(5721),t.e(13),t.e(5055),t.e(3112),t.e(1956),t.e(9953),t.e(4796),t.e(3029),t.e(4111),t.e(8506),t.e(3600),t.e(4521)]).then(t.bind(t,97927))).default,PointCloudLayer:async()=>(await Promise.all([t.e(6131),t.e(8948),t.e(7984),t.e(6742)]).then(t.bind(t,76742))).default,RouteLayer:async()=>(await Promise.all([t.e(6131),t.e(8948),t.e(2106),t.e(5721),t.e(13),t.e(5055),t.e(3112),t.e(3037)]).then(t.bind(t,80284))).default,SceneLayer:async()=>(await Promise.all([t.e(6131),t.e(8948),t.e(2106),t.e(5721),t.e(13),t.e(5055),t.e(3112),t.e(1956),t.e(4796),t.e(690),t.e(2944),t.e(958),t.e(4654),t.e(6298),t.e(4110)]).then(t.bind(t,13899))).default,StreamLayer:async()=>(await Promise.all([t.e(6131),t.e(8219),t.e(8948),t.e(2106),t.e(5721),t.e(13),t.e(5055),t.e(3112),t.e(1956),t.e(4796),t.e(3029),t.e(59)]).then(t.bind(t,60683))).default,SubtypeGroupLayer:async()=>(await Promise.all([t.e(6131),t.e(8219),t.e(8948),t.e(2106),t.e(5721),t.e(13),t.e(5055),t.e(1956),t.e(4796),t.e(4111),t.e(8506),t.e(1162)]).then(t.bind(t,59929))).default,TileLayer:async()=>(await Promise.all([t.e(6131),t.e(8219),t.e(8948),t.e(2106),t.e(5721),t.e(13),t.e(5055),t.e(3112),t.e(1956),t.e(4796),t.e(4111),t.e(364),t.e(9186),t.e(4307),t.e(8535)]).then(t.bind(t,71756))).default,UnknownLayer:async()=>(await t.e(146).then(t.bind(t,146))).default,UnsupportedLayer:async()=>(await t.e(5165).then(t.bind(t,45165))).default,VectorTileLayer:async()=>(await Promise.all([t.e(6131),t.e(8219),t.e(9186),t.e(9949),t.e(5013),t.e(4060)]).then(t.bind(t,48757))).default,VideoLayer:async()=>(await Promise.all([t.e(3930),t.e(3920)]).then(t.bind(t,1689))).default,ViewshedLayer:async()=>(await Promise.all([t.e(6131),t.e(690),t.e(1056),t.e(4269)]).then(t.bind(t,96650))).default,VoxelLayer:async()=>(await Promise.all([t.e(6131),t.e(8948),t.e(6183)]).then(t.bind(t,16183))).default,WCSLayer:async()=>(await Promise.all([t.e(6131),t.e(8219),t.e(8948),t.e(2106),t.e(5721),t.e(13),t.e(5055),t.e(9953),t.e(984),t.e(6049),t.e(2439),t.e(7677),t.e(9547)]).then(t.bind(t,19547))).default,WFSLayer:async()=>(await Promise.all([t.e(6131),t.e(8219),t.e(8948),t.e(2106),t.e(5721),t.e(13),t.e(5055),t.e(3112),t.e(1956),t.e(9953),t.e(4796),t.e(3029),t.e(4296)]).then(t.bind(t,16350))).default,WMSLayer:async()=>(await Promise.all([t.e(6131),t.e(8219),t.e(8948),t.e(2106),t.e(5721),t.e(1904)]).then(t.bind(t,51904))).default,WMTSLayer:async()=>(await Promise.all([t.e(6131),t.e(8219),t.e(5920),t.e(309)]).then(t.bind(t,20309))).default,WebTileLayer:async()=>(await Promise.all([t.e(6131),t.e(8219),t.e(5920)]).then(t.bind(t,47314))).default}},22429:(e,a,t)=>{t.d(a,{v:()=>n});var r=t(24183);class n{constructor(){this._serviceMetadatas=new Map,this._itemDatas=new Map}async fetchServiceMetadata(e,a){const t=this._serviceMetadatas.get(e);if(t)return t;const n=await(0,r.V)(e,a);return this._serviceMetadatas.set(e,n),n}async fetchItemData(e){const{id:a}=e;if(!a)return null;const{_itemDatas:t}=this;if(t.has(a))return t.get(a);const r=await e.fetchData();return t.set(a,r),r}async fetchCustomParameters(e,a){const t=await this.fetchItemData(e);return t&&"object"==typeof t&&(a?a(t):t.customParameters)||null}}},23154:(e,a,t)=>{t.d(a,{K:()=>d,Q:()=>s});var r=t(24183);const n=new Set(["Catalog Layer","Feature Layer","Oriented Imagery Layer"]);async function s(e,a){const{loadContext:t,...n}=a||{},s=t?await t.fetchServiceMetadata(e,n):await(0,r.V)(e,n);y(s),c(s);const i={serviceJSON:s};if((s.currentVersion??0)<10.5)return i;const l=`${e}/layers`,u=t?await t.fetchServiceMetadata(l,n):await(0,r.V)(l,n);return y(u),c(u),i.layersJSON={layers:u.layers,tables:u.tables},i}function i(e){const{type:a}=e;return!!a&&n.has(a)}function l(e){return"Table"===e.type}function c(e){e.layers=e.layers?.filter(i),e.tables=e.tables?.filter(l)}function u(e){e.type||="Feature Layer"}function o(e){e.type||="Table"}function y(e){e.layers?.forEach(u),e.tables?.forEach(o)}function d(e){switch(e){case"Feature Layer":case"Table":return"FeatureLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Catalog Layer":return"CatalogLayer"}return"FeatureLayer"}},24183:(e,a,t)=>{t.d(a,{V:()=>n});var r=t(78888);async function n(e,a){const{data:t}=await(0,r.A)(e,{responseType:"json",query:{f:"json",...a?.customParameters,token:a?.apiKey}});return t}},45613:(e,a,t)=>{t.d(a,{fromItem:()=>d,n:()=>f});var r=t(49186),n=t(92009),s=t(23154),i=t(22429),l=t(83531),c=t(4513),u=t(80812),o=t(66964),y=t(10407);async function d(e){let{portalItem:a}=e;!a||a instanceof u.default||(a=new u.default(a));const t=await async function(e){await e.load();const a=new i.v;return async function(e){const a=e.className,t=c.S[a];return{constructor:await t(),properties:e.properties}}(await f(e,a))}(a);return new(0,t.constructor)({portalItem:a,...t.properties})}async function f(e,a){switch(e.type){case"3DTiles Service":return e.typeKeywords.includes("3DObject")?{className:"UnsupportedLayer"}:{className:"IntegratedMesh3DTilesLayer"};case"CSV":return{className:"CSVLayer"};case"Feature Collection":return async function(e){await e.load();const a=(0,y.Y)(e,"Map Notes"),t=(0,y.Y)(e,"Markup");if(a||t)return{className:"MapNotesLayer"};if((0,y.Y)(e,"Route Layer"))return{className:"RouteLayer"};const r=await e.fetchData();return 1===(0,o.XH)(r)?{className:"FeatureLayer"}:{className:"GroupLayer"}}(e);case"Feature Service":return async function(e,a){const t=await m(e,a);if("object"==typeof t){const{sourceJSON:e,className:a}=t,r={sourceJSON:e};return null!=t.id&&(r.layerId=t.id),{className:a||"FeatureLayer",properties:r}}return{className:"GroupLayer"}}(e,a);case"Feed":case"Stream Service":return{className:"StreamLayer"};case"GeoJson":return{className:"GeoJSONLayer"};case"Group Layer":return{className:"GroupLayer"};case"Image Service":return async function(e,a){await e.load();const t=e.typeKeywords?.map((e=>e.toLowerCase()))??[];if(t.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(t.includes("tiled imagery"))return{className:"ImageryTileLayer"};const r=await a.fetchItemData(e),n=r?.layerType;if("ArcGISTiledImageServiceLayer"===n)return{className:"ImageryTileLayer"};if("ArcGISImageServiceLayer"===n)return{className:"ImageryLayer"};const s=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)}),i=s.cacheType?.toLowerCase(),l=s.capabilities?.toLowerCase().includes("tilesonly"),c=s.tileInfo?.format?.toLowerCase()??"",u=null==i&&["jpg","jpeg","png","png8","png24","png32","mixed"].includes(c);return"map"===i||u||l?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}(e,a);case"KML":return{className:"KMLLayer"};case"Knowledge Graph Layer":return{className:"KnowledgeGraphLayer"};case"Map Service":return async function(e,a){return await async function(e,a){const{tileInfo:t}=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)});return t}(e,a)?{className:"TileLayer"}:{className:"MapImageLayer"}}(e,a);case"Media Layer":return{className:"MediaLayer"};case"Scene Service":return async function(e,a){const t=await m(e,a,(async()=>{try{if(!e.url)return[];const{serverUrl:t}=await(0,n.L)(e.url,{sceneLayerItem:e}),r=await a.fetchServiceMetadata(t);return r?.tables??[]}catch{return[]}}));if("object"==typeof t){const r={};let n;if(null!=t.id?(r.layerId=t.id,n=`${e.url}/layers/${t.id}`):n=e.url,e.typeKeywords?.length)for(const a of Object.keys(l.XX))if(e.typeKeywords.includes(a))return{className:l.XX[a]};const s=await a.fetchServiceMetadata(n,{customParameters:await a.fetchCustomParameters(e,(e=>(0,o.pJ)(e)?.customParameters))});return{className:l.XX[s?.layerType]||"SceneLayer",properties:r}}if(!1===t){const t=await a.fetchServiceMetadata(e.url);if("Voxel"===t?.layerType)return{className:"VoxelLayer"}}return{className:"GroupLayer"}}(e,a);case"Vector Tile Service":return{className:"VectorTileLayer"};case"WCS":return{className:"WCSLayer"};case"WFS":return{className:"WFSLayer"};case"WMS":return{className:"WMSLayer"};case"WMTS":return{className:"WMTSLayer"};default:throw new r.A("portal:unknown-item-type","Unknown item type '${type}'",{type:e.type})}}async function m(e,a,t){const{url:r,type:n}=e,i="Feature Service"===n;if(!r)return{};if(/\/\d+$/.test(r)){if(i){const t=await a.fetchServiceMetadata(r,{customParameters:await a.fetchCustomParameters(e,(e=>(0,o.pJ)(e)?.customParameters))});return{id:t.id,className:(0,s.K)(t.type),sourceJSON:t}}return{}}await e.load();let l=await a.fetchItemData(e);if(i){const e=await(0,o.bO)(l,r,a),t=w(e);if("object"==typeof t){const a=(0,o.rc)(e,t.id);t.className=(0,o.K8)(a?.layerType)}return t}if("Scene Service"===n&&(l=await(0,o.nu)(e,l,a)),(0,o.XH)(l)>0)return w(l);const c=await a.fetchServiceMetadata(r);return t&&(c.tables=await t()),w(c)}function w(e){return 1===(0,o.XH)(e)&&{id:(0,o.pJ)(e)?.id}}},66964:(e,a,t)=>{t.d(a,{Ju:()=>u,K8:()=>d,XH:()=>o,_r:()=>s,bO:()=>i,l:()=>y,nu:()=>f,pJ:()=>l,rc:()=>c});var r=t(92009),n=t(23154);function s(e){const a={id:e.id,name:e.name},t=(0,n.K)(e.type);return"FeatureLayer"!==t&&(a.layerType=t),a}async function i(e,a,t){if(null==e?.layers||null==e?.tables){const r=await t.fetchServiceMetadata(a,{customParameters:l(e)?.customParameters});(e=e||{}).layers=e.layers||r?.layers?.map(s),e.tables=e.tables||r?.tables?.map(s)}return e}function l(e){if(!e)return null;const{layers:a,tables:t}=e;return a?.length?a[0]:t?.length?t[0]:null}function c(e,a){return null==a?null:[...e.layers||[],...e.tables||[]].find((e=>e.id===a))}function u(e,a){return[...e.layers||[],...e.tables||[]].filter((({layerType:e})=>e?a.includes(e):a.includes("ArcGISFeatureLayer")))}function o(e){return(e?.layers?.length??0)+(e?.tables?.length??0)}function y(e){switch(e){case"catalog":return["CatalogLayer"];case"feature":return["ArcGISFeatureLayer"];case"oriented-imagery":return["OrientedImageryLayer"];case"subtype-group":return["SubtypeGroupLayer","SubtypeGroupTable"]}return null}function d(e){switch(e){case"CatalogLayer":return"CatalogLayer";case"OrientedImageryLayer":return"OrientedImageryLayer";case"SubtypeGroupLayer":case"SubtypeGroupTable":return"SubtypeGroupLayer"}return"FeatureLayer"}async function f(e,a,t){if(!e?.url)return a??{};if(a??={},!a.layers){const r=await t.fetchServiceMetadata(e.url);a.layers=r.layers?.map(s)}const{serverUrl:n,portalItem:i}=await(0,r.L)(e.url,{sceneLayerItem:e,customParameters:l(a)?.customParameters}).catch((()=>({serverUrl:null,portalItem:null})));if(null==n)return a.tables=[],a;if(!a.tables&&i){const e=await i.fetchData().catch((()=>null));if(e?.tables)a.tables=e.tables.map(s);else{const r=await t.fetchServiceMetadata(n,{customParameters:l(e)?.customParameters}).catch((()=>null));a.tables=r?.tables?.map(s)}}if(a.tables)for(const e of a.tables)e.url=`${n}/${e.id}`;return a}},92009:(e,a,t)=>{t.d(a,{L:()=>o});var r=t(70333),n=t(78888),s=t(49186),i=t(74887),l=t(60694),c=t(20655),u=t(80812);async function o(e,a){const t=(0,l.qg)(e);if(!t)throw new s.A("invalid-url","Invalid scene service url");const o={...a,sceneServerUrl:t.url.path,layerId:t.sublayer??void 0};if(o.sceneLayerItem??=await async function(e){const a=(await y(e)).serviceItemId;if(!a)return null;const t=new u.default({id:a,apiKey:e.apiKey}),s=await async function(e){const a=r.id?.findServerInfo(e.sceneServerUrl);if(a?.owningSystemUrl)return a.owningSystemUrl;const t=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const a=(await(0,n.A)(t,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(a)return a}catch(e){(0,i.QP)(e)}return null}(e);null!=s&&(t.portal=new c.A({url:s}));try{return await t.load({signal:e.signal})}catch(e){return(0,i.QP)(e),null}}(o),null==o.sceneLayerItem)return d(o.sceneServerUrl.replace("/SceneServer","/FeatureServer"),o);const f=await async function({sceneLayerItem:e,signal:a}){if(!e)return null;try{const t=(await e.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},{signal:a})).find((e=>"Feature Service"===e.type))||null;if(!t)return null;const r=new u.default({portal:t.portal,id:t.id});return await r.load(),r}catch(e){return(0,i.QP)(e),null}}(o);if(!f?.url)throw new s.A("related-service-not-found","Could not find feature service through portal item relationship");o.featureServiceItem=f;const m=await d(f.url,o);return m.portalItem=f,m}async function y(e){if(e.rootDocument)return e.rootDocument;const a={query:{f:"json",...e.customParameters,token:e.apiKey},responseType:"json",signal:e.signal};try{const t=await(0,n.A)(e.sceneServerUrl,a);e.rootDocument=t.data}catch{e.rootDocument={}}return e.rootDocument}async function d(e,a){const t=(0,l.qg)(e);if(!t)throw new s.A("invalid-feature-service-url","Invalid feature service url");const r=t.url.path,i=a.layerId;if(null==i)return{serverUrl:r};const c=y(a),u=a.featureServiceItem?await a.featureServiceItem.fetchData("json"):null,o=(u?.layers?.[0]||u?.tables?.[0])?.customParameters,d=e=>{const t={query:{f:"json",...o},responseType:"json",authMode:e,signal:a.signal};return(0,n.A)(r,t)},f=d("anonymous").catch((()=>d("no-prompt"))),[m,w]=await Promise.all([f,c]),p=w?.layers,h=m.data&&m.data.layers;if(!Array.isArray(h))throw new Error("expected layers array");if(Array.isArray(p)){for(let e=0;e<Math.min(p.length,h.length);e++)if(p[e].id===i)return{serverUrl:r,layerId:h[e].id}}else if(null!=i&&i<h.length)return{serverUrl:r,layerId:h[i].id};throw new Error("could not find matching associated sublayer")}}}]);
|