@arcgis/core 5.2.0-next.104 → 5.2.0-next.106

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.
Files changed (78) hide show
  1. package/WebScene.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/0630e650abdfea1792e4.js +1 -0
  4. package/assets/esri/core/workers/chunks/{9a084a12afd6f0bbabce.js → 082069f80eee0407b828.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{ec5542d6ecc0622f7705.js → 1ec01fd6330d011c76d6.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{4b0e3f83a5f2d3b0478a.js → 20a9d39673d95ed401cc.js} +1 -1
  7. package/assets/esri/core/workers/chunks/24673aac70d6c949b6fa.js +1 -0
  8. package/assets/esri/core/workers/chunks/{bba3eb07a2a0065759f9.js → 25bb07d3c32b16a08813.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{ffca0b2333e760b66d3a.js → 262052dfaec3af8a58b9.js} +1 -1
  10. package/assets/esri/core/workers/chunks/33e583166ab3943ecf0e.js +1 -0
  11. package/assets/esri/core/workers/chunks/{98414a10f6de21107a03.js → 3dc5b97408b54daa9a8d.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{2350f1eb70819cc06bb6.js → 4c00a46bf0345f99a9bb.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{2165493d36c85b7c9a04.js → 5c8f423812a23c02c1fd.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{c2d19bb097d074a1ef21.js → 753d1ff177ecee8e2377.js} +1 -1
  15. package/assets/esri/core/workers/chunks/777fc163530448eea13e.js +1 -0
  16. package/assets/esri/core/workers/chunks/{09a40fd0e462144c4640.js → 842f993fa60b410cb613.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{6cf881f793fd0ec93981.js → 8c521caf050a486b6548.js} +1 -1
  18. package/assets/esri/core/workers/chunks/91e545745706111f5f62.js +1 -0
  19. package/assets/esri/core/workers/chunks/{c582441200ee1cdf51a7.js → 925a0b29d3ed7165b8dd.js} +1 -1
  20. package/assets/esri/core/workers/chunks/b013b70e40dfb6ce013e.js +1 -0
  21. package/assets/esri/core/workers/chunks/{34e04b24942da2b9b87c.js → b56c5883a5468b18b122.js} +1 -1
  22. package/assets/esri/core/workers/chunks/c7b762bae945f383c723.js +1 -0
  23. package/assets/esri/core/workers/chunks/d0eb609a214d85d21ed5.js +1 -0
  24. package/assets/esri/core/workers/chunks/d9b63cf111035b05cd2e.js +1 -0
  25. package/assets/esri/core/workers/chunks/{23c4ec0bcbc83179013e.js → dc1b38f490142f7273ef.js} +1 -1
  26. package/assets/esri/core/workers/chunks/f05622413cadfd14553e.js +1 -0
  27. package/assets/esri/core/workers/chunks/{c91905b5808b8049f96d.js → f3a547f179fe7e655af9.js} +10 -9
  28. package/chunks/GlobalIllumination.glsl.js +4 -4
  29. package/config.js +1 -1
  30. package/kernel.js +1 -1
  31. package/layers/AnnotationFeatureLayer.d.ts +22 -0
  32. package/layers/AnnotationFeatureLayer.js +1 -1
  33. package/layers/DimensionFeatureLayer.js +1 -1
  34. package/layers/list/Item.d.ts +11 -28
  35. package/layers/list/Item.js +1 -1
  36. package/layers/list/LayerItemCollection.js +1 -1
  37. package/layers/list/types.d.ts +30 -0
  38. package/layers/save/featureLayerUtils.js +1 -1
  39. package/layers/support/AnnotationFeatureSublayer.d.ts +24 -3
  40. package/layers/support/AnnotationFeatureSublayer.js +1 -1
  41. package/layers/support/layerUtils.js +1 -1
  42. package/layers/support/layersMapping.js +1 -1
  43. package/layers/support/telemetryDisplayUtils.js +2 -0
  44. package/package.json +5 -5
  45. package/support/revision.js +1 -1
  46. package/symbols/TextSymbol3DLayer.js +1 -1
  47. package/symbols/cim/TextRasterizer.js +1 -1
  48. package/symbols/cim/richTextUtils.js +1 -1
  49. package/symbols/support/Symbol3DTextBorder.js +2 -0
  50. package/views/2d/engine/webgl/GlyphWorker.js +1 -1
  51. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  52. package/views/2d/layers/MediaLayerView2D.js +1 -1
  53. package/views/2d/layers/support/annodime/DimensionInfo.js +1 -1
  54. package/views/2d/layers/support/annodime/MatcherGeometryOverride.js +1 -1
  55. package/views/2d/layers/support/annodime/dimensionUtils.js +1 -1
  56. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  57. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  58. package/views/3d/support/QualityProfile.js +1 -1
  59. package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js +7 -6
  60. package/views/3d/webgl-engine/lib/BufferGeometry.js +1 -1
  61. package/views/3d/webgl-engine/lib/BufferGeometryBaseInstance.js +2 -0
  62. package/views/3d/webgl-engine/lib/BufferObject3D.js +1 -1
  63. package/views/3d/webgl-engine/lib/Buffers.js +2 -0
  64. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  65. package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
  66. package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
  67. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
  68. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  69. package/assets/esri/core/workers/chunks/0d69a18146722f792b5b.js +0 -1
  70. package/assets/esri/core/workers/chunks/3a8f6010a9f06a2457ae.js +0 -1
  71. package/assets/esri/core/workers/chunks/546213fb53fa921a3928.js +0 -1
  72. package/assets/esri/core/workers/chunks/5ed56ade84a0bea4a0c8.js +0 -1
  73. package/assets/esri/core/workers/chunks/93375f5f5bb754eca35f.js +0 -1
  74. package/assets/esri/core/workers/chunks/9e514a58b1165e273202.js +0 -1
  75. package/assets/esri/core/workers/chunks/a191ddb3b59ec1a7d818.js +0 -1
  76. package/assets/esri/core/workers/chunks/b24e1c901f7fda2a62ca.js +0 -1
  77. package/assets/esri/core/workers/chunks/da77257b517119578088.js +0 -1
  78. package/assets/esri/core/workers/chunks/fbbc5f551115787363d2.js +0 -1
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__addDisposableResource as e,__disposeResources as r,__decorate as t}from"tslib";import i from"../PopupTemplate.js";import s from"../request.js";import{ClonableMixin as o}from"../core/Clonable.js";import a from"../core/Error.js";import{disposable as n,makeHandle as l}from"../core/handleUtils.js";import{MultiOriginJSONSupportMixin as p}from"../core/MultiOriginJSONSupport.js";import{debounce as u,throwIfAbortError as d,whenOrAbort as c,onAbort as m}from"../core/promiseUtils.js";import{property as y,subclass as h}from"../core/accessorSupport/decorators.js";import f from"../geometry/SpatialReference.js";import E from"../graphic/DimensionFeatureGraphicOrigin.js";import v from"./Layer.js";import{APIKeyMixin as T}from"./mixins/APIKeyMixin.js";import{ArcGISService as S}from"./mixins/ArcGISService.js";import{BlendLayer as g}from"./mixins/BlendLayer.js";import{CustomParametersMixin as I}from"./mixins/CustomParametersMixin.js";import{DataElementMixin as j}from"./mixins/DataElementMixin.js";import{FeatureLayerBase as L}from"./mixins/FeatureLayerBase.js";import{OperationalLayer as b}from"./mixins/OperationalLayer.js";import{PortalLayer as D}from"./mixins/PortalLayer.js";import{RefreshableLayer as O}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as w}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as P}from"./mixins/TemporalLayer.js";import{parse as F,cleanTitle as M,titleFromUrlAndName as x}from"./support/arcgisLayerUrl.js";import{barrierWeight as N,id as G,popupEnabled as A}from"./support/commonProperties.js";import{ensureLayerCredential as X,createQuery as Y,getFieldDomain as U,hasDataChanged as q}from"./support/featureLayerUtils.js";import{defineFieldProperties as C}from"./support/fieldProperties.js";import{fixTimeInfoFields as R}from"./support/fieldUtils.js";import{serviceSupportsSpatialReference as _}from"./support/versionUtils.js";import H from"../rest/support/Query.js";import{createPopupTemplate as B}from"../support/popupUtils.js";import{reader as Q}from"../core/accessorSupport/decorators/reader.js";const J="dimension-feature-layer",$=C();let k=class extends(j(L(g(P(w(O(S(b(D(p(I(T(o(v)))))))))))))){constructor(e){super(e),this.barrierWeight="high",this.fields=null,this.fieldsIndex=null,this.graphicOrigin=new E(this),this.operationalLayerType="ArcGISDimensionLayer",this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.referenceScale=0,this.source=null,this.styleCollection=null,this.sublayerTitleMode="item-title",this.supportedSourceTypes=new Set(["Dimension Layer"]),this.symbolFields=["STYLEID","BEGINX","BEGINY","ENDX","ENDY","DIMDISPLAY","EXTDISPLAY","MARKERDISPLAY","DIMX","DIMY","TEXTX","TEXTY","DIMLENGTH","DIMTYPE","EXTANGLE","TEXTANGLE","USECUSTOMLENGTH","CUSTOMLENGTH "],this.type="dimension-feature",this._debouncedSaveOperations=u(async(e,r,t)=>{const{save:i,saveAs:s}=await(import("./save/featureLayerUtils.js"));switch(e){case 0:return i(this,r);case 1:return s(this,t,r)}})}destroy(){this.source?.destroy()}load(e){const r=e?.signal,t=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(d).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(r);null!=e&&(this.layerId=e)}if(!this.url)throw new a(`${J}:missing-url`,"DimensionFeatureLayer must be created with a url");return Promise.all([this.loadDataElement(e).then(()=>{if(!this.styleCollection)throw new a(`${J}:missing-style-collection`,"Invalid service with no style collection")}),this.initLayerProperties(await this.createGraphicsSource(r))])}).then(()=>X(this,"load",e));return this.addResolvingPromise(t),Promise.resolve(this)}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get effectiveEditingEnabled(){return!1}get defaultPopupTemplate(){return this.createPopupTemplate()}readTitleFromService(e,r){const{url:t}=this,i=r.name||F(t)?.title;switch(this.sublayerTitleMode){case"item-title":if(t)return x(t,i);break;case"item-title-and-service-name":{let e=this.portalItem?.title;if(e&&e!==i)return e=M(e),i?`${e} - ${M(i)}`:e;break}}return i?M(i):void 0}readTitleFromPortalItem(e){return"item-title"===this.sublayerTitleMode?e:void 0}createPopupTemplate(e){return B(this,e)}async createGraphicsSource(t){const i={stack:[],error:void 0,hasError:!1};try{const{default:r}=await c(import("./graphics/sources/FeatureLayerSource.js"),t),s=new r({layer:this,supportedSourceTypes:this.supportedSourceTypes});e(i,n(m(t,()=>s.cancelLoad())??l()),!1);return await s.load({signal:t}),s}catch(s){i.error=s,i.hasError=!0}finally{r(i)}}createQuery(){const e=Y(this);return e.where=this.definitionExpression||"1=1",e}getFieldDomain(e,r){return U(this,e,r,this.getField(e)?.domain??null)}async queryFeatures(e,r){const t=await this.load(),i=await t.source.queryFeatures(H.from(e)??t.createQuery(),r),s=this.graphicOrigin;if(i?.features)for(const o of i.features)o.layer=o.sourceLayer=t,o.origin=s;return i}async queryObjectIds(e,r){const t=await this.load();return t.source.queryObjectIds(H.from(e)??t.createQuery(),r)}async queryFeatureCount(e,r){const t=await this.load();return t.source.queryFeatureCount(H.from(e)??t.createQuery(),r)}async queryExtent(e,r){const t=await this.load();return t.source.queryExtent(H.from(e)??t.createQuery(),r)}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,r){return this._debouncedSaveOperations(1,r,e)}serviceSupportsSpatialReference(e){return this.loaded&&_(this,e)}async initLayerProperties(e){this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),R(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return q(this)}_verifySource(){if(this.version&&this.version<10.8)throw new a(J+":unsupported-version","The feature service must be version 10.8 or above.");const e=["DIMLENGTH","BEGINX","BEGINY","ENDX","ENDY","DIMX","DIMY","TEXTX","TEXTY","DIMTYPE","EXTANGLE","STYLEID","USECUSTOMLENGTH","CUSTOMLENGTH","DIMDISPLAY","EXTDISPLAY","MARKERDISPLAY","TEXTANGLE"],r=e.filter(e=>!this.fieldsIndex.has(e));if(r.length)throw new a(J+":missing-fields","There are missing fields to operate properly",{requiredFields:e,missingFields:r})}_fetchFirstValidLayerId(e){return s(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const r=e.data;if(!r)return;this.applyPreferredHost(r);const t=[...r.layers||[],...r.tables||[]];return t.find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id})}};t([y({type:f,json:{origins:{service:{read:{source:"sourceSpatialReference"}}}}})],k.prototype,"attributeSpatialReference",void 0),t([y(N)],k.prototype,"barrierWeight",void 0),t([y({nonNullable:!0,json:{name:"enableEditing",write:!0}})],k.prototype,"editingEnabled",null),t([y({readOnly:!0})],k.prototype,"effectiveEditingEnabled",null),t([y({...$.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],k.prototype,"fields",void 0),t([y($.fieldsIndex)],k.prototype,"fieldsIndex",void 0),t([y({readOnly:!0,clonable:!1})],k.prototype,"graphicOrigin",void 0),t([y(G)],k.prototype,"id",void 0),t([y({type:["ArcGISDimensionLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0,isRequired:!0}}}}})],k.prototype,"operationalLayerType",void 0),t([y($.outFields)],k.prototype,"outFields",void 0),t([y(A)],k.prototype,"popupEnabled",void 0),t([y({type:i,json:{name:"popupInfo",write:!0}})],k.prototype,"popupTemplate",void 0),t([y({readOnly:!0})],k.prototype,"defaultPopupTemplate",null),t([y({readOnly:!0})],k.prototype,"referenceScale",void 0),t([y({clonable:!1,readOnly:!0})],k.prototype,"source",void 0),t([y()],k.prototype,"styleCollection",void 0),t([y({type:String})],k.prototype,"sublayerTitleMode",void 0),t([y({readOnly:!0})],k.prototype,"symbolFields",void 0),t([Q("service","title",["name"])],k.prototype,"readTitleFromService",null),t([Q("portal-item","title")],k.prototype,"readTitleFromPortalItem",null),t([y({json:{read:!1},value:"dimension-feature",readOnly:!0})],k.prototype,"type",void 0),k=t([h("esri.layers.DimensionFeatureLayer")],k);const K=k;export{K as default};
2
+ import{__addDisposableResource as e,__disposeResources as r,__decorate as t}from"tslib";import i from"../PopupTemplate.js";import o from"../request.js";import{ClonableMixin as s}from"../core/Clonable.js";import a from"../core/Error.js";import{disposable as n,makeHandle as l}from"../core/handleUtils.js";import{MultiOriginJSONSupportMixin as p}from"../core/MultiOriginJSONSupport.js";import{debounce as u,throwIfAbortError as d,whenOrAbort as m,onAbort as c}from"../core/promiseUtils.js";import{property as y,subclass as h}from"../core/accessorSupport/decorators.js";import f from"../geometry/SpatialReference.js";import v from"../graphic/DimensionFeatureGraphicOrigin.js";import E from"./Layer.js";import{APIKeyMixin as T}from"./mixins/APIKeyMixin.js";import{ArcGISService as g}from"./mixins/ArcGISService.js";import{BlendLayer as S}from"./mixins/BlendLayer.js";import{CustomParametersMixin as I}from"./mixins/CustomParametersMixin.js";import{DataElementMixin as j}from"./mixins/DataElementMixin.js";import{FeatureLayerBase as L}from"./mixins/FeatureLayerBase.js";import{OperationalLayer as b}from"./mixins/OperationalLayer.js";import{PortalLayer as D}from"./mixins/PortalLayer.js";import{RefreshableLayer as w}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as O}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as P}from"./mixins/TemporalLayer.js";import{parse as F,cleanTitle as M,titleFromUrlAndName as x}from"./support/arcgisLayerUrl.js";import{barrierWeight as N,id as G,popupEnabled as A}from"./support/commonProperties.js";import{ensureLayerCredential as X,createQuery as Y,getFieldDomain as U,hasDataChanged as q}from"./support/featureLayerUtils.js";import{defineFieldProperties as C}from"./support/fieldProperties.js";import{fixTimeInfoFields as R}from"./support/fieldUtils.js";import{serviceSupportsSpatialReference as _}from"./support/versionUtils.js";import H from"../rest/support/Query.js";import{createPopupTemplate as B}from"../support/popupUtils.js";import{reader as Q}from"../core/accessorSupport/decorators/reader.js";const J="dimension-feature-layer",$=C();let k=class extends(j(L(S(P(O(w(g(b(D(p(I(T(s(E)))))))))))))){constructor(e){super(e),this.barrierWeight="high",this.fields=null,this.fieldsIndex=null,this.graphicOrigin=new v(this),this.operationalLayerType="ArcGISDimensionLayer",this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.referenceScale=0,this.source=null,this.styleCollection=null,this.sublayerTitleMode="item-title",this.supportedSourceTypes=new Set(["Dimension Layer"]),this.symbolFields=["STYLEID","BEGINX","BEGINY","ENDX","ENDY","DIMDISPLAY","EXTDISPLAY","MARKERDISPLAY","DIMX","DIMY","TEXTX","TEXTY","DIMLENGTH","DIMTYPE","EXTANGLE","TEXTANGLE","USECUSTOMLENGTH","CUSTOMLENGTH "],this.type="dimension-feature",this._debouncedSaveOperations=u(async(e,r,t)=>{const{save:i,saveAs:o}=await(import("./save/featureLayerUtils.js"));switch(e){case 0:return i(this,r);case 1:return o(this,t,r)}})}destroy(){this.source?.destroy()}load(e){const r=e?.signal,t=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(d).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(r);null!=e&&(this.layerId=e)}if(!this.url)throw new a(`${J}:missing-url`,"DimensionFeatureLayer must be created with a url");return Promise.all([this.loadDataElement(e).then(()=>{if(!this.styleCollection)throw new a(`${J}:missing-style-collection`,"Invalid service with no style collection")}),this.initLayerProperties(await this.createGraphicsSource(r))])}).then(()=>X(this,"load",e));return this.addResolvingPromise(t),Promise.resolve(this)}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get effectiveEditingEnabled(){return!1}get defaultPopupTemplate(){return this.createPopupTemplate()}readTitleFromService(e,r){const{url:t}=this,i=r.name||F(t)?.title;switch(this.sublayerTitleMode){case"item-title":if(t)return x(t,i);break;case"item-title-and-service-name":{let e=this.portalItem?.title;if(e&&e!==i)return e=M(e),i?`${e} - ${M(i)}`:e;break}}return i?M(i):void 0}readTitleFromPortalItem(e){return"item-title"===this.sublayerTitleMode?e:void 0}createPopupTemplate(e){return B(this,e)}async createGraphicsSource(t){const i={stack:[],error:void 0,hasError:!1};try{const{default:r}=await m(import("./graphics/sources/FeatureLayerSource.js"),t),o=new r({layer:this,supportedSourceTypes:this.supportedSourceTypes});e(i,n(c(t,()=>o.cancelLoad())??l()),!1);return await o.load({signal:t}),o}catch(o){i.error=o,i.hasError=!0}finally{r(i)}}createQuery(){const e=Y(this);return e.where=this.definitionExpression||"1=1",e}getFieldDomain(e,r){return U(this,e,r,this.getField(e)?.domain??null)}async queryFeatures(e,r){const t=await this.load(),i=await t.source.queryFeatures(H.from(e)??t.createQuery(),r),o=this.graphicOrigin;if(i?.features)for(const s of i.features)s.layer=s.sourceLayer=t,s.origin=o;return i}async queryObjectIds(e,r){const t=await this.load();return t.source.queryObjectIds(H.from(e)??t.createQuery(),r)}async queryFeatureCount(e,r){const t=await this.load();return t.source.queryFeatureCount(H.from(e)??t.createQuery(),r)}async queryExtent(e,r){const t=await this.load();return t.source.queryExtent(H.from(e)??t.createQuery(),r)}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,r){return this._debouncedSaveOperations(1,r,e)}serviceSupportsSpatialReference(e){return this.loaded&&_(this,e)}async initLayerProperties(e){this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),R(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return q(this)}_verifySource(){if(this.version&&this.version<10.8)throw new a(J+":unsupported-version","The feature service must be version 10.8 or above.");const e=["DIMLENGTH","BEGINX","BEGINY","ENDX","ENDY","DIMX","DIMY","TEXTX","TEXTY","DIMTYPE","EXTANGLE","STYLEID","USECUSTOMLENGTH","CUSTOMLENGTH","DIMDISPLAY","EXTDISPLAY","MARKERDISPLAY","TEXTANGLE"],r=e.filter(e=>!this.fieldsIndex.has(e));if(r.length)throw new a(J+":missing-fields","There are missing fields to operate properly",{requiredFields:e,missingFields:r})}_fetchFirstValidLayerId(e){return o(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const r=e.data;if(!r)return;this.applyPreferredHost(r);const t=[...r.layers||[],...r.tables||[]];return t.find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id})}};t([y({type:f,json:{origins:{service:{read:{source:"sourceSpatialReference"}}}}})],k.prototype,"attributeSpatialReference",void 0),t([y(N)],k.prototype,"barrierWeight",void 0),t([y({nonNullable:!0,json:{name:"enableEditing",write:!0}})],k.prototype,"editingEnabled",null),t([y({readOnly:!0})],k.prototype,"effectiveEditingEnabled",null),t([y({...$.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],k.prototype,"fields",void 0),t([y($.fieldsIndex)],k.prototype,"fieldsIndex",void 0),t([y({readOnly:!0,clonable:!1})],k.prototype,"graphicOrigin",void 0),t([y(G)],k.prototype,"id",void 0),t([y({type:["show","hide"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],k.prototype,"listMode",void 0),t([y({type:["ArcGISDimensionLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0,isRequired:!0}}}}})],k.prototype,"operationalLayerType",void 0),t([y($.outFields)],k.prototype,"outFields",void 0),t([y(A)],k.prototype,"popupEnabled",void 0),t([y({type:i,json:{name:"popupInfo",write:!0}})],k.prototype,"popupTemplate",void 0),t([y({readOnly:!0})],k.prototype,"defaultPopupTemplate",null),t([y({readOnly:!0})],k.prototype,"referenceScale",void 0),t([y({clonable:!1,readOnly:!0})],k.prototype,"source",void 0),t([y()],k.prototype,"styleCollection",void 0),t([y({type:String})],k.prototype,"sublayerTitleMode",void 0),t([y({readOnly:!0})],k.prototype,"symbolFields",void 0),t([Q("service","title",["name"])],k.prototype,"readTitleFromService",null),t([Q("portal-item","title")],k.prototype,"readTitleFromPortalItem",null),t([y({json:{read:!1},value:"dimension-feature",readOnly:!0})],k.prototype,"type",void 0),k=t([h("esri.layers.DimensionFeatureLayer")],k);const K=k;export{K as default};
@@ -6,10 +6,9 @@ import type SubtypeGroupLayer from "../SubtypeGroupLayer.js";
6
6
  import type ItemPanel from "./ItemPanel.js";
7
7
  import type Sublayer from "../support/Sublayer.js";
8
8
  import type SubtypeSublayer from "../support/SubtypeSublayer.js";
9
- import type TrackPartInfo from "../support/TrackPartInfo.js";
10
9
  import type LayerView from "../../views/layers/LayerView.js";
11
10
  import type { IdentifiableMixin, IdentifiableMixinProperties } from "../../core/Identifiable.js";
12
- import type { Action, State } from "./types.js";
11
+ import type { Action, ItemContent, State } from "./types.js";
13
12
  import type { MapViewOrSceneView } from "../../views/MapViewOrSceneView.js";
14
13
  import type { StreamLayerViewConnectionStatus } from "../../views/layers/StreamLayerView.js";
15
14
  import type { ActionToggleProperties } from "../../support/actions/ActionToggle.js";
@@ -17,10 +16,10 @@ import type { ActionButtonProperties } from "../../support/actions/ActionButton.
17
16
  import type { ReadonlyArrayOrCollection } from "../../core/Collection.js";
18
17
  import type { ItemPanelProperties } from "./ItemPanel.js";
19
18
 
20
- export interface ItemProperties extends IdentifiableMixinProperties, Partial<Pick<Item, "actionsExpanded" | "actionsOpen" | "checkPublishStatusEnabled" | "childrenSortable" | "expanded" | "hidden" | "layer" | "listModeDisabled" | "open" | "parent" | "sortable" | "trackInfoType" | "view" | "visible">> {
19
+ export interface ItemProperties extends IdentifiableMixinProperties, Partial<Pick<Item, "actionsExpanded" | "actionsOpen" | "checkPublishStatusEnabled" | "childrenSortable" | "content" | "expanded" | "hidden" | "layer" | "listModeDisabled" | "open" | "parent" | "sortable" | "view" | "visible">> {
21
20
  /** A nested 2-dimensional collection of actions that could be triggered on the item. */
22
21
  actionsSections?: ReadonlyArrayOrCollection<ReadonlyArrayOrCollection<((ActionButtonProperties & { type: "button" }) | (ActionToggleProperties & { type: "toggle" }))>>;
23
- /** The child layer and track info items belonging to this item. */
22
+ /** The child layer, track info, and telemetry display items belonging to this item. */
24
23
  children?: ReadonlyArrayOrCollection<ItemProperties>;
25
24
  /**
26
25
  * Additional panel state associated with this list item.
@@ -64,14 +63,6 @@ export interface ConnectedLayerView extends LayerView {
64
63
  connectionStatus: StreamLayerViewConnectionStatus;
65
64
  }
66
65
 
67
- /**
68
- * Identifies a displayable part of [TrackInfo](https://developers.arcgis.com/javascript/latest/references/core/layers/support/TrackInfo/).
69
- *
70
- * @beta
71
- * @since 5.2
72
- */
73
- export type TrackInfoType = "latestObservations" | "previousObservations" | "trackLines";
74
-
75
66
  /**
76
67
  * Defines how the visibility of child layers is managed within a list item.
77
68
  *
@@ -115,7 +106,7 @@ export default class Item extends ItemSuperclass {
115
106
  * @since 5.2
116
107
  */
117
108
  accessor checkPublishStatusEnabled: boolean;
118
- /** The child layer and track info items belonging to this item. */
109
+ /** The child layer, track info, and telemetry display items belonging to this item. */
119
110
  get children(): Collection<Item>;
120
111
  set children(value: ReadonlyArrayOrCollection<ItemProperties>);
121
112
  /**
@@ -136,6 +127,13 @@ export default class Item extends ItemSuperclass {
136
127
  * @since 5.2
137
128
  */
138
129
  get connectionStatus(): ConnectedLayerView["connectionStatus"] | null | undefined;
130
+ /**
131
+ * The content represented by this item.
132
+ *
133
+ * @beta
134
+ * @since 5.2
135
+ */
136
+ accessor content: ItemContent;
139
137
  /** The Error object returned if an error occurred. */
140
138
  get error(): EsriError | null | undefined;
141
139
  /**
@@ -221,21 +219,6 @@ export default class Item extends ItemSuperclass {
221
219
  /** The title of the layer. */
222
220
  get title(): string;
223
221
  set title(value: string | null | undefined);
224
- /**
225
- * The track info part represented by this item, or `null` when this item represents a layer.
226
- *
227
- * @beta
228
- * @since 5.2
229
- */
230
- accessor trackInfoType: TrackInfoType | null;
231
- /**
232
- * The track part represented by this item.
233
- *
234
- * @internal
235
- * @beta
236
- * @since 5.2
237
- */
238
- get trackPart(): TrackPartInfo | null;
239
222
  /**
240
223
  * Value is `true` when the layer is updating; for example, if it is in the process of fetching data.
241
224
  *
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import e from"../../core/Accessor.js";import{isSome as i}from"../../core/arrayUtils.js";import r from"../../core/Collection.js";import{IdentifiableMixin as s}from"../../core/Identifiable.js";import{watch as n,initial as l}from"../../core/reactiveUtils.js";import{property as o,cast as a,subclass as h}from"../../core/accessorSupport/decorators.js";import{ensureType as d}from"../../core/accessorSupport/ensureType.js";import{get as p}from"../../core/accessorSupport/get.js";import c from"./ItemPanel.js";import{isLayerOutsideScaleRange as y,findLayerVisibilityMode as u,findLayerListMode as b,canDisplayLayer as f,getNormalizedChildLayerProperty as m}from"./support/layerListUtils.js";import{trackInfoPartPropertyNames as v}from"../support/trackInfoUtils.js";import g from"../../support/actions/ActionBase.js";import I from"../../support/actions/ActionButton.js";import k from"../../support/actions/ActionToggle.js";var C;const _=r.ofType({key:"type",defaultKeyValue:"button",base:g,typeMap:{button:I,toggle:k}}),w=r.ofType(_);function T(t){return"csv"===t?.type||"feature"===t?.type||"geojson"===t?.type||"ogc-feature"===t?.type||"stream"===t?.type}const S="layer",P="child-list-mode",M="hide";let x=C=class extends(s(e)){constructor(t){super(t),this.actionsSections=new w,this.actionsExpanded=!1,this.checkPublishStatusEnabled=!1,this.children=new(r.ofType(C)),this.childrenSortable=!0,this.hidden=!1,this.layer=null,this.listItemCreatedFunction=null,this.listModeDisabled=!1,this.expanded=!1,this.parent=null,this.trackInfoType=null,this.view=null}initialize(){if(this.addHandles([n(()=>[this.layer,this.layer?.listMode,this.listModeDisabled],()=>this._watchLayerProperties(this.layer),l),n(()=>this.checkPublishStatusEnabled,t=>this._updateChildrenPublishing(t),l),n(()=>this.view,t=>this._updateChildrenView(t),l),n(()=>this.panel,t=>this._setItemOnPanel(t),l),n(()=>{const t=this.layer,e=T(t)?t.trackInfo:null;return[t,e,e?.enabled]},()=>this._compileTrackInfoChildren(),l)]),"function"==typeof this.listItemCreatedFunction){const t={item:this};this.listItemCreatedFunction.call(null,t)}}destroy(){this.panel?.destroy(),this.children.destroyAll(),this.view=null}get actionsOpen(){return this.actionsExpanded}set actionsOpen(t){this.actionsExpanded=t}get connectionStatus(){const{layerView:t,publishing:e}=this;if(!e&&t&&"connectionStatus"in t)return t.connectionStatus}get error(){return this.layer?.loadError}get incompatible(){const{layerView:t}=this;return!(!t||!("spatialReferenceSupported"in t))&&!t.spatialReferenceSupported}get layerView(){const{layer:t,view:e}=this;if(!t||!e||"sublayer"===t.type)return null;const i="subtype-sublayer"===t.type?t.parent:t;return e.allLayerViews.find(t=>t.layer===i)??null}get open(){return this.expanded}set open(t){this.expanded=t}set panel(t){const e=this._get("panel");t!==e&&t&&e?.destroy(),this._set("panel",t)}castPanel(t){return this.expanded&&!t.hasOwnProperty("open")&&(t.open=!0),d(c,t)}get sortable(){return!this.trackInfoType&&"knowledge-graph-sublayer"!==this.layer?.type&&this._get("sortable")}set sortable(t){this._set("sortable",t)}get state(){return!this.layer||this.hidden||this.incompatible?"disabled":this.updating?"loading":"ready"}get title(){if(this.trackInfoType)return this._get("title")||"";const t=p(this,"layer.layer");return(!t||t&&p(this,"layer.layer.loaded"))&&p(this,"layer.title")||p(this,"layer.attributes.title")||""}set title(t){this._override("title",t)}get trackPart(){const{layer:t,trackInfoType:e}=this;return e&&T(t)?t.trackInfo?.[e]??null:null}get publishing(){const{layer:t,checkPublishStatusEnabled:e}=this;return!!(e&&t&&"publishingInfo"in t&&"publishing"===t.publishingInfo?.status)}get updating(){const{layerView:t,connectionStatus:e,layer:i,publishing:r}=this;return!r&&!e&&(t?t.updating:"loading"===i?.loadStatus||!1)}get visible(){return this.trackInfoType?this.trackPart?.visible??!1:!!this.layer?.visible}set visible(t){if(this.trackInfoType){const e=this.trackPart;return void(e&&(e.visible=t))}const e=this.layer;e&&(e.visible=t)}get visibleAtCurrentScale(){return this.layerView?.visibleAtCurrentScale??!y(this.layer,this.view?.scale)}get visibleAtCurrentTimeExtent(){return this.layerView?.visibleAtCurrentTimeExtent??!0}get visibilityMode(){return u(this.layer)}clone(){return new C({actionsExpanded:this.actionsExpanded,actionsSections:this.actionsSections.clone(),checkPublishStatusEnabled:this.checkPublishStatusEnabled,children:this.children.clone(),childrenSortable:this.childrenSortable,expanded:this.expanded,hidden:this.hidden,layer:this.layer,listItemCreatedFunction:this.listItemCreatedFunction,listModeDisabled:this.listModeDisabled,panel:this.panel,parent:this.parent,sortable:this.sortable,title:this.title,trackInfoType:this.trackInfoType,view:this.view,visible:this.visible})}toggleVisibility(t){if(!this.layer)return!1;const e=t??!this.visible;return this.visible=e,this.visible}_setItemOnPanel(t){t&&(t.listItem=this)}_compileTrackInfoChildren(){const t=this.layer,e=this.children.filter(t=>!!t.trackInfoType);if(!this.trackInfoType&&T(t)&&t.trackInfo?.enabled){e.some(e=>e.layer!==t)&&this.children.destroyMany(e.toArray());for(const e of v)this.children.some(t=>t.trackInfoType===e)||this.children.add(new C({layer:t,listItemCreatedFunction:this.listItemCreatedFunction,parent:this,trackInfoType:e}))}else this.children.destroyMany(e.toArray())}_updateChildrenPublishing(t){this.children?.forEach(e=>e.checkPublishStatusEnabled=t)}_updateChildrenView(t){const e=this.children;e&&e.forEach(e=>e.view=t)}_createChildren(t){const{listModeDisabled:e,children:i}=this,r=t.filter(t=>!i.some(e=>!e.trackInfoType&&e.layer===t));i.addMany(this._createChildItems(r,e).toArray())}_destroyChildren(t){const{children:e}=this,i=e.filter(e=>!e.trackInfoType&&!!e.layer&&!t.includes(e.layer));e.destroyMany(i.toArray())}_sortChildren(t){this.children.sort((e,i)=>e.trackInfoType||i.trackInfoType?e.trackInfoType?i.trackInfoType?v.indexOf(e.trackInfoType)-v.indexOf(i.trackInfoType):1:-1:t.indexOf(i.layer)-t.indexOf(e.layer))}_destroyLayerChildren(){this.removeHandles(P),this.children.destroyMany(this.children.filter(t=>!t.trackInfoType).toArray())}_watchChildLayerListMode(t){this.removeHandles(P),this.listModeDisabled||this.addHandles(t.toArray().map(e=>n(()=>e.listMode,()=>this._compileChildren(t))),P)}_compileChildren(t){const e=this.listModeDisabled?t:t?.filter(t=>b(t)!==M);t?.length?(this._createChildren(e),this._destroyChildren(e),this._sortChildren(e),this._watchChildLayerListMode(t)):this._destroyLayerChildren()}_watchSublayerChanges(t){t&&this.addHandles(t.on("change",()=>this._compileChildren(t)),S)}_initializeChildLayers(t){this._compileChildren(t),this._watchSublayerChanges(t)}_createChildItems(t,e){return t.reverse().map(t=>e||f(t)?new C({layer:t,checkPublishStatusEnabled:this.checkPublishStatusEnabled,listItemCreatedFunction:this.listItemCreatedFunction,listModeDisabled:this.listModeDisabled,parent:this,view:this.view}):null).filter(i)}_watchLayerProperties(t){if(this.removeHandles(S),this.removeHandles(P),!t||this.trackInfoType)return;if("hide-children"===(!this.listModeDisabled&&b(t)))return void this._destroyLayerChildren();const e=m(t);e&&this.addHandles(n(()=>t[e],i=>{const r=i;t.hasOwnProperty(e)&&r&&this._initializeChildLayers(r)},l),S)}};t([o({type:w})],x.prototype,"actionsSections",void 0),t([o()],x.prototype,"actionsExpanded",void 0),t([o()],x.prototype,"actionsOpen",null),t([o()],x.prototype,"checkPublishStatusEnabled",void 0),t([o({type:r.ofType(C)})],x.prototype,"children",void 0),t([o()],x.prototype,"childrenSortable",void 0),t([o({readOnly:!0})],x.prototype,"connectionStatus",null),t([o({readOnly:!0})],x.prototype,"error",null),t([o()],x.prototype,"hidden",void 0),t([o({readOnly:!0})],x.prototype,"incompatible",null),t([o()],x.prototype,"layer",void 0),t([o({readOnly:!0})],x.prototype,"layerView",null),t([o()],x.prototype,"listItemCreatedFunction",void 0),t([o({nonNullable:!0})],x.prototype,"listModeDisabled",void 0),t([o()],x.prototype,"expanded",void 0),t([o()],x.prototype,"open",null),t([o({type:c})],x.prototype,"panel",null),t([a("panel")],x.prototype,"castPanel",null),t([o()],x.prototype,"parent",void 0),t([o({value:!0})],x.prototype,"sortable",null),t([o({readOnly:!0})],x.prototype,"state",null),t([o()],x.prototype,"title",null),t([o()],x.prototype,"trackInfoType",void 0),t([o({readOnly:!0})],x.prototype,"trackPart",null),t([o({readOnly:!0})],x.prototype,"publishing",null),t([o({readOnly:!0})],x.prototype,"updating",null),t([o()],x.prototype,"view",void 0),t([o()],x.prototype,"visible",null),t([o({readOnly:!0})],x.prototype,"visibleAtCurrentScale",null),t([o({readOnly:!0})],x.prototype,"visibleAtCurrentTimeExtent",null),t([o({readOnly:!0})],x.prototype,"visibilityMode",null),x=C=t([h("esri.layers.list.Item")],x);const O=x;export{O as default};
2
+ import{__decorate as t}from"tslib";import e from"../../core/Accessor.js";import{isSome as i}from"../../core/arrayUtils.js";import n from"../../core/Collection.js";import{IdentifiableMixin as r}from"../../core/Identifiable.js";import{watch as s,initial as l}from"../../core/reactiveUtils.js";import{property as o,cast as a,subclass as h}from"../../core/accessorSupport/decorators.js";import{ensureType as d}from"../../core/accessorSupport/ensureType.js";import{get as p}from"../../core/accessorSupport/get.js";import c from"./ItemPanel.js";import{isLayerOutsideScaleRange as y,findLayerVisibilityMode as u,findLayerListMode as m,canDisplayLayer as b,getNormalizedChildLayerProperty as f}from"./support/layerListUtils.js";import{telemetryDisplayPropertyNames as v}from"../support/telemetryDisplayUtils.js";import{trackInfoPartPropertyNames as g}from"../support/trackInfoUtils.js";import C from"../../support/actions/ActionBase.js";import _ from"../../support/actions/ActionButton.js";import w from"../../support/actions/ActionToggle.js";var S;const k=n.ofType({key:"type",defaultKeyValue:"button",base:C,typeMap:{button:_,toggle:w}}),I=n.ofType(k);function M(t){return"csv"===t?.type||"feature"===t?.type||"geojson"===t?.type||"ogc-feature"===t?.type||"stream"===t?.type}function x(t){return"video"===t?.type}const O="layer",P="child-list-mode",E="hide";let D=S=class extends(r(e)){constructor(t){super(t),this.actionsSections=new I,this.actionsExpanded=!1,this.checkPublishStatusEnabled=!1,this.children=new(n.ofType(S)),this.childrenSortable=!0,this.content={type:"layer"},this.hidden=!1,this.layer=null,this.listItemCreatedFunction=null,this.listModeDisabled=!1,this.expanded=!1,this.parent=null,this.view=null}initialize(){if(this.addHandles([s(()=>[this.layer,this.layer?.listMode,this.listModeDisabled],()=>this._watchLayerProperties(this.layer),l),s(()=>this.checkPublishStatusEnabled,t=>this._updateChildrenPublishing(t),l),s(()=>this.view,t=>this._updateChildrenView(t),l),s(()=>this.panel,t=>this._setItemOnPanel(t),l),s(()=>{const t=this.layer,e=M(t)?t.trackInfo:null;return[t,e,e?.enabled]},()=>this._compileTrackInfoChildren(),l),s(()=>{const t=this.layer;return[t,x(t)?t.telemetryDisplay:null]},()=>this._compileTelemetryDisplayChildren(),l)]),"function"==typeof this.listItemCreatedFunction){const t={item:this};this.listItemCreatedFunction.call(null,t)}}destroy(){this.panel?.destroy(),this.children.destroyAll(),this.view=null}get actionsOpen(){return this.actionsExpanded}set actionsOpen(t){this.actionsExpanded=t}get connectionStatus(){const{layerView:t,publishing:e}=this;if(!e&&t&&"connectionStatus"in t)return t.connectionStatus}get error(){return this.layer?.loadError}get incompatible(){const{layerView:t}=this;return!(!t||!("spatialReferenceSupported"in t))&&!t.spatialReferenceSupported}get layerView(){const{layer:t,view:e}=this;if(!t||!e||"sublayer"===t.type)return null;const i="subtype-sublayer"===t.type?t.parent:t;return e.allLayerViews.find(t=>t.layer===i)??null}get open(){return this.expanded}set open(t){this.expanded=t}set panel(t){const e=this._get("panel");t!==e&&t&&e?.destroy(),this._set("panel",t)}castPanel(t){return this.expanded&&!t.hasOwnProperty("open")&&(t.open=!0),d(c,t)}get sortable(){return"layer"===this.content.type&&"knowledge-graph-sublayer"!==this.layer?.type&&this._get("sortable")}set sortable(t){this._set("sortable",t)}get state(){return!this.layer||this.hidden||this.incompatible?"disabled":this.updating?"loading":"ready"}get title(){if("layer"!==this.content.type)return this._get("title")||"";const t=p(this,"layer.layer");return(!t||t&&p(this,"layer.layer.loaded"))&&p(this,"layer.title")||p(this,"layer.attributes.title")||""}set title(t){this._override("title",t)}get publishing(){const{layer:t,checkPublishStatusEnabled:e}=this;return!!(e&&t&&"publishingInfo"in t&&"publishing"===t.publishingInfo?.status)}get updating(){const{layerView:t,connectionStatus:e,layer:i,publishing:n}=this;return!n&&!e&&(t?t.updating:"loading"===i?.loadStatus||!1)}get visible(){const{content:t,layer:e}=this;return"track-info"===t.type?this._getTrackPart(t.name)?.visible??!1:"telemetry-display"===t.type?!(!x(e)||!e.telemetryDisplay)&&e.telemetryDisplay[t.name]:!!e?.visible}set visible(t){const{content:e,layer:i}=this;if("track-info"===e.type){const i=this._getTrackPart(e.name);return void(i&&(i.visible=t))}"telemetry-display"!==e.type?i&&(i.visible=t):x(i)&&i.telemetryDisplay&&(i.telemetryDisplay[e.name]=t)}get visibleAtCurrentScale(){return this.layerView?.visibleAtCurrentScale??!y(this.layer,this.view?.scale)}get visibleAtCurrentTimeExtent(){return this.layerView?.visibleAtCurrentTimeExtent??!0}get visibilityMode(){return u(this.layer)}clone(){return new S({actionsExpanded:this.actionsExpanded,actionsSections:this.actionsSections.clone(),checkPublishStatusEnabled:this.checkPublishStatusEnabled,children:this.children.clone(),childrenSortable:this.childrenSortable,content:{...this.content},expanded:this.expanded,hidden:this.hidden,layer:this.layer,listItemCreatedFunction:this.listItemCreatedFunction,listModeDisabled:this.listModeDisabled,panel:this.panel,parent:this.parent,sortable:this.sortable,title:this.title,view:this.view,visible:this.visible})}toggleVisibility(t){if(!this.layer)return!1;const e=t??!this.visible;return this.visible=e,this.visible}_getTrackPart(t){const{layer:e}=this;return M(e)?e.trackInfo?.[t]??null:null}_setItemOnPanel(t){t&&(t.listItem=this)}_compileTrackInfoChildren(){const t=this.layer,e=this.children.filter(t=>"track-info"===t.content.type);if("layer"===this.content.type&&M(t)&&t.trackInfo?.enabled){e.some(e=>e.layer!==t)&&this.children.destroyMany(e.toArray());for(const e of g)this.children.some(t=>"track-info"===t.content.type&&t.content.name===e)||this.children.add(new S({content:{type:"track-info",name:e},layer:t,listItemCreatedFunction:this.listItemCreatedFunction,parent:this}))}else this.children.destroyMany(e.toArray())}_compileTelemetryDisplayChildren(){const t=this.layer,e=this.children.filter(t=>"telemetry-display"===t.content.type);if("layer"===this.content.type&&x(t)&&t.telemetryDisplay){e.some(e=>e.layer!==t)&&this.children.destroyMany(e.toArray());for(const e of v)this.children.some(t=>"telemetry-display"===t.content.type&&t.content.name===e)||this.children.add(new S({content:{type:"telemetry-display",name:e},layer:t,listItemCreatedFunction:this.listItemCreatedFunction,parent:this}))}else this.children.destroyMany(e.toArray())}_updateChildrenPublishing(t){this.children?.forEach(e=>e.checkPublishStatusEnabled=t)}_updateChildrenView(t){const e=this.children;e&&e.forEach(e=>e.view=t)}_createChildren(t){const{listModeDisabled:e,children:i}=this,n=t.filter(t=>!i.some(e=>"layer"===e.content.type&&e.layer===t));i.addMany(this._createChildItems(n,e).toArray())}_destroyChildren(t){const{children:e}=this,i=e.filter(e=>"layer"===e.content.type&&!!e.layer&&!t.includes(e.layer));e.destroyMany(i.toArray())}_sortChildren(t){this.children.sort((e,i)=>{const n="layer"!==e.content.type,r="layer"!==i.content.type;return n||r?n?r?"track-info"===e.content.type&&"track-info"===i.content.type?g.indexOf(e.content.name)-g.indexOf(i.content.name):"telemetry-display"===e.content.type&&"telemetry-display"===i.content.type?v.indexOf(e.content.name)-v.indexOf(i.content.name):"track-info"===e.content.type?-1:1:1:-1:t.indexOf(i.layer)-t.indexOf(e.layer)})}_destroyLayerChildren(){this.removeHandles(P),this.children.destroyMany(this.children.filter(t=>"layer"===t.content.type).toArray())}_watchChildLayerListMode(t){this.removeHandles(P),this.listModeDisabled||this.addHandles(t.toArray().map(e=>s(()=>e.listMode,()=>this._compileChildren(t))),P)}_compileChildren(t){const e=this.listModeDisabled?t:t?.filter(t=>m(t)!==E);t?.length?(this._createChildren(e),this._destroyChildren(e),this._sortChildren(e),this._watchChildLayerListMode(t)):this._destroyLayerChildren()}_watchSublayerChanges(t){t&&this.addHandles(t.on("change",()=>this._compileChildren(t)),O)}_initializeChildLayers(t){this._compileChildren(t),this._watchSublayerChanges(t)}_createChildItems(t,e){return t.reverse().map(t=>e||b(t)?new S({layer:t,checkPublishStatusEnabled:this.checkPublishStatusEnabled,listItemCreatedFunction:this.listItemCreatedFunction,listModeDisabled:this.listModeDisabled,parent:this,view:this.view}):null).filter(i)}_watchLayerProperties(t){if(this.removeHandles(O),this.removeHandles(P),!t||"layer"!==this.content.type)return;if("hide-children"===(!this.listModeDisabled&&m(t)))return void this._destroyLayerChildren();const e=f(t);e&&this.addHandles(s(()=>t[e],i=>{const n=i;t.hasOwnProperty(e)&&n&&this._initializeChildLayers(n)},l),O)}};t([o({type:I})],D.prototype,"actionsSections",void 0),t([o()],D.prototype,"actionsExpanded",void 0),t([o()],D.prototype,"actionsOpen",null),t([o()],D.prototype,"checkPublishStatusEnabled",void 0),t([o({type:n.ofType(S)})],D.prototype,"children",void 0),t([o()],D.prototype,"childrenSortable",void 0),t([o({nonNullable:!0})],D.prototype,"content",void 0),t([o({readOnly:!0})],D.prototype,"connectionStatus",null),t([o({readOnly:!0})],D.prototype,"error",null),t([o()],D.prototype,"hidden",void 0),t([o({readOnly:!0})],D.prototype,"incompatible",null),t([o()],D.prototype,"layer",void 0),t([o({readOnly:!0})],D.prototype,"layerView",null),t([o()],D.prototype,"listItemCreatedFunction",void 0),t([o({nonNullable:!0})],D.prototype,"listModeDisabled",void 0),t([o()],D.prototype,"expanded",void 0),t([o()],D.prototype,"open",null),t([o({type:c})],D.prototype,"panel",null),t([a("panel")],D.prototype,"castPanel",null),t([o()],D.prototype,"parent",void 0),t([o({value:!0})],D.prototype,"sortable",null),t([o({readOnly:!0})],D.prototype,"state",null),t([o()],D.prototype,"title",null),t([o({readOnly:!0})],D.prototype,"publishing",null),t([o({readOnly:!0})],D.prototype,"updating",null),t([o()],D.prototype,"view",void 0),t([o()],D.prototype,"visible",null),t([o({readOnly:!0})],D.prototype,"visibleAtCurrentScale",null),t([o({readOnly:!0})],D.prototype,"visibleAtCurrentTimeExtent",null),t([o({readOnly:!0})],D.prototype,"visibilityMode",null),D=S=t([h("esri.layers.list.Item")],D);const A=D;export{A as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../core/Collection.js";import{EventedAccessor as s}from"../../core/Evented.js";import{watch as i,initial as a}from"../../core/reactiveUtils.js";import{property as r,subclass as l}from"../../core/accessorSupport/decorators.js";import o from"./Item.js";import{getItemLayers as n,findLayerListMode as d}from"./support/layerListUtils.js";import{isLinkChartView as h}from"../../linkChart/guards.js";const m={view:"view",viewLayers:"view-layers",mapLayers:"map-layers",layerViews:"layer-views",layerListMode:"layer-list-mode"},c="hide",p=t.ofType(o);let y=class extends s{constructor(e){super(e),this.checkPublishStatusEnabled=!1,this.listItemCreatedFunction=null,this.listModeDisabled=!1,this.operationalItems=new p,this.view=null}initialize(){this.addHandles([i(()=>!0===this.view?.ready,()=>this._viewHandles(),a),i(()=>[this.listItemCreatedFunction,this.checkPublishStatusEnabled,this.listModeDisabled],()=>this._recompileList()),i(()=>h(this.view)?this.view.inGeographicLayout:null,()=>this._compileList())],m.view)}destroy(){this._removeAllItems(),this.view=null}get state(){const{view:e}=this;return e?.ready?"ready":e?"loading":"disabled"}get totalItems(){return this.operationalItems.flatten(e=>e.children).length}triggerAction(e,t){e&&!e.disabled&&this.emit("trigger-action",{action:e,item:t})}moveItem(e,t,s,i){const a=e?.layer;if(!a||e.trackInfoType||"subtype-sublayer"===a.type||"sublayer"===a.type)return;const r=this.view?.map?.layers,l=t?n(t):r,o=s?n(s):r;if(!l||!o)return;const{operationalItems:d}=this,h=t?.children||d,m=s?.children||d,c=o.length-i;e.parent=s||null,h.remove(e),l.remove(a),m.includes(e)||m.add(e,c),o.includes(a)||o.add(a,c),this._compileList()}_createLayerViewHandles(e){this.removeHandles(m.layerViews),this._compileList(),e&&this.addHandles(e.on("change",()=>this._compileList()),m.layerViews)}_createMapLayerHandles(e){this.removeHandles(m.mapLayers),this._compileList(),e&&this.addHandles(e.on("change",()=>this._compileList()),m.mapLayers)}_createItem(e){const{view:t,listItemCreatedFunction:s,checkPublishStatusEnabled:i,listModeDisabled:a}=this;return new o({checkPublishStatusEnabled:i,listModeDisabled:a,layer:e,listItemCreatedFunction:s,view:t})}_removeAllItems(){this.operationalItems.destroyAll()}_getViewableLayers(e){return e?this.listModeDisabled?e:e.filter(e=>d(e)!==c):void 0}_watchLayersListMode(e){this.removeHandles(m.layerListMode),e&&!this.listModeDisabled&&this.addHandles(i(()=>e.filter(e=>"listMode"in e).map(e=>e.listMode).toArray(),()=>this._compileList()),m.layerListMode)}_compileList(){const e=this.view?.map?.layers,t=h(this.view)&&!this.view.inGeographicLayout?e?.filter(({type:e})=>"link-chart"===e):e;this._watchLayersListMode(t);const s=this._getViewableLayers(t);s?.length?(this._createNewItems(s),this._removeItems(s),this._sortItems(s)):this._removeAllItems()}_createNewItems(e){const{operationalItems:t}=this;e.forEach(e=>{t.some(t=>t.layer===e)||t.add(this._createItem(e))})}_removeItems(e){const{operationalItems:t}=this,s=[];t.forEach(t=>{t&&e&&e.includes(t.layer)||s.push(t)}),t.destroyMany(s)}_sortItems(e){const{operationalItems:t}=this;t.sort((t,s)=>{const i=e.indexOf(t.layer),a=e.indexOf(s.layer);return i>a?-1:i<a?1:0})}_recompileList(){this._removeAllItems(),this._compileList()}_viewHandles(){const{view:e}=this;this.removeHandles([m.mapLayers,m.layerViews,m.viewLayers]),e?.ready?this.addHandles([i(()=>this.view?.map?.allLayers,e=>this._createMapLayerHandles(e),a),i(()=>this.view?.allLayerViews,e=>this._createLayerViewHandles(e),a)],m.viewLayers):this._removeAllItems()}};e([r()],y.prototype,"checkPublishStatusEnabled",void 0),e([r()],y.prototype,"listItemCreatedFunction",void 0),e([r({nonNullable:!0})],y.prototype,"listModeDisabled",void 0),e([r({type:p})],y.prototype,"operationalItems",void 0),e([r({readOnly:!0})],y.prototype,"state",null),e([r()],y.prototype,"totalItems",null),e([r()],y.prototype,"view",void 0),y=e([l("esri.layers.list.LayerItemCollection")],y);const v=y;export{v as default};
2
+ import{__decorate as e}from"tslib";import t from"../../core/Collection.js";import{EventedAccessor as s}from"../../core/Evented.js";import{watch as i,initial as a}from"../../core/reactiveUtils.js";import{property as r,subclass as l}from"../../core/accessorSupport/decorators.js";import o from"./Item.js";import{getItemLayers as n,findLayerListMode as d}from"./support/layerListUtils.js";import{isLinkChartView as h}from"../../linkChart/guards.js";const m={view:"view",viewLayers:"view-layers",mapLayers:"map-layers",layerViews:"layer-views",layerListMode:"layer-list-mode"},c="hide",p=t.ofType(o);let y=class extends s{constructor(e){super(e),this.checkPublishStatusEnabled=!1,this.listItemCreatedFunction=null,this.listModeDisabled=!1,this.operationalItems=new p,this.view=null}initialize(){this.addHandles([i(()=>!0===this.view?.ready,()=>this._viewHandles(),a),i(()=>[this.listItemCreatedFunction,this.checkPublishStatusEnabled,this.listModeDisabled],()=>this._recompileList()),i(()=>h(this.view)?this.view.inGeographicLayout:null,()=>this._compileList())],m.view)}destroy(){this._removeAllItems(),this.view=null}get state(){const{view:e}=this;return e?.ready?"ready":e?"loading":"disabled"}get totalItems(){return this.operationalItems.flatten(e=>e.children).length}triggerAction(e,t){e&&!e.disabled&&this.emit("trigger-action",{action:e,item:t})}moveItem(e,t,s,i){const a=e?.layer;if(!a||"layer"!==e.content.type||"subtype-sublayer"===a.type||"sublayer"===a.type)return;const r=this.view?.map?.layers,l=t?n(t):r,o=s?n(s):r;if(!l||!o)return;const{operationalItems:d}=this,h=t?.children||d,m=s?.children||d,c=o.length-i;e.parent=s||null,h.remove(e),l.remove(a),m.includes(e)||m.add(e,c),o.includes(a)||o.add(a,c),this._compileList()}_createLayerViewHandles(e){this.removeHandles(m.layerViews),this._compileList(),e&&this.addHandles(e.on("change",()=>this._compileList()),m.layerViews)}_createMapLayerHandles(e){this.removeHandles(m.mapLayers),this._compileList(),e&&this.addHandles(e.on("change",()=>this._compileList()),m.mapLayers)}_createItem(e){const{view:t,listItemCreatedFunction:s,checkPublishStatusEnabled:i,listModeDisabled:a}=this;return new o({checkPublishStatusEnabled:i,listModeDisabled:a,layer:e,listItemCreatedFunction:s,view:t})}_removeAllItems(){this.operationalItems.destroyAll()}_getViewableLayers(e){return e?this.listModeDisabled?e:e.filter(e=>d(e)!==c):void 0}_watchLayersListMode(e){this.removeHandles(m.layerListMode),e&&!this.listModeDisabled&&this.addHandles(i(()=>e.filter(e=>"listMode"in e).map(e=>e.listMode).toArray(),()=>this._compileList()),m.layerListMode)}_compileList(){const e=this.view?.map?.layers,t=h(this.view)&&!this.view.inGeographicLayout?e?.filter(({type:e})=>"link-chart"===e):e;this._watchLayersListMode(t);const s=this._getViewableLayers(t);s?.length?(this._createNewItems(s),this._removeItems(s),this._sortItems(s)):this._removeAllItems()}_createNewItems(e){const{operationalItems:t}=this;e.forEach(e=>{t.some(t=>t.layer===e)||t.add(this._createItem(e))})}_removeItems(e){const{operationalItems:t}=this,s=[];t.forEach(t=>{t&&e&&e.includes(t.layer)||s.push(t)}),t.destroyMany(s)}_sortItems(e){const{operationalItems:t}=this;t.sort((t,s)=>{const i=e.indexOf(t.layer),a=e.indexOf(s.layer);return i>a?-1:i<a?1:0})}_recompileList(){this._removeAllItems(),this._compileList()}_viewHandles(){const{view:e}=this;this.removeHandles([m.mapLayers,m.layerViews,m.viewLayers]),e?.ready?this.addHandles([i(()=>this.view?.map?.allLayers,e=>this._createMapLayerHandles(e),a),i(()=>this.view?.allLayerViews,e=>this._createLayerViewHandles(e),a)],m.viewLayers):this._removeAllItems()}};e([r()],y.prototype,"checkPublishStatusEnabled",void 0),e([r()],y.prototype,"listItemCreatedFunction",void 0),e([r({nonNullable:!0})],y.prototype,"listModeDisabled",void 0),e([r({type:p})],y.prototype,"operationalItems",void 0),e([r({readOnly:!0})],y.prototype,"state",null),e([r()],y.prototype,"totalItems",null),e([r()],y.prototype,"view",void 0),y=e([l("esri.layers.list.LayerItemCollection")],y);const v=y;export{v as default};
@@ -2,6 +2,36 @@ import type Item from "./Item.js";
2
2
  import type ActionButton from "../../support/actions/ActionButton.js";
3
3
  import type ActionToggle from "../../support/actions/ActionToggle.js";
4
4
 
5
+ /**
6
+ * Identifies a displayable part of [TrackInfo](https://developers.arcgis.com/javascript/latest/references/core/layers/support/TrackInfo/).
7
+ *
8
+ * @beta
9
+ * @since 5.2
10
+ */
11
+ export type TrackInfoType = "latestObservations" | "previousObservations" | "trackLines";
12
+
13
+ /**
14
+ * Identifies a displayable telemetry element of [VideoLayer.telemetryDisplay](https://developers.arcgis.com/javascript/latest/references/core/layers/VideoLayer/#telemetryDisplay).
15
+ *
16
+ * @beta
17
+ * @since 5.2
18
+ */
19
+ export type TelemetryDisplayType = "frame" | "frameCenter" | "frameOutline" | "lineOfSight" | "sensorLocation" | "sensorPath" | "sensorTrail";
20
+
21
+ /**
22
+ * Identifies the content represented by a [Item](https://developers.arcgis.com/javascript/latest/references/core/layers/list/Item/).
23
+ *
24
+ * @beta
25
+ * @since 5.2
26
+ */
27
+ export type ItemContent = { type: "layer"; } | {
28
+ type: "track-info";
29
+ name: TrackInfoType;
30
+ } | {
31
+ type: "telemetry-display";
32
+ name: TelemetryDisplayType;
33
+ };
34
+
5
35
  /**
6
36
  * Specifies the style of the visibility toggle displayed by list UIs.
7
37
  *
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{isSome as e,equals as r,difference as a}from"../../core/arrayUtils.js";import t from"../../core/Error.js";import{updateOrigins as n}from"../../core/accessorSupport/originUtils.js";import{saveAs as o,save as s,getLayerJSON as l,getPortalItem as i,addItem as u,ensureLayerConfig as c,ensureItemConfig as y,setCommonItemProperties as f,validateItemType as p,createErrorMessage as m}from"./utils.js";import{parse as d}from"../support/arcgisLayerUrl.js";import{fetchFeatureServiceWithAllResources as h,getFeatureServiceItemLayerType as b,getLayerModuleTypeStrict as T}from"../support/fetchService.js";import w from"../../portal/Portal.js";import L from"../../portal/PortalItem.js";import{createForItemWrite as v}from"../../portal/support/jsonContext.js";import{getWGS84ExtentForItem as I,toggleTypeKeyword as S,typeKeyword as P,removeTypeKeyword as g,hasTypeKeyword as A}from"../../portal/support/portalItemUtils.js";const E="Feature Service",O="feature-layer-utils",N=`${O}-save`,x=`${O}-save-as`,j=`${O}-saveall`,R=`${O}-saveall-as`;function $(e){const r=e?.type;return("feature"===r||"subtype-group"===r||"oriented-imagery"===r||"dimension-feature"===r)&&"feature-layer"===e?.source?.type}function F(e){return{isValid:$(e)&&(!("dynamicDataSource"in e)||!e.dynamicDataSource),errorMessage:"Feature layer should be a layer or table in a map or feature service"}}function U(e,r){const a=v(e,"portal-item");return r?.isTable&&(a.layerContainerType="tables"),a}function C(e){const r=U(e),a=U(e);return a.layerContainerType="tables",{forLayers:r,forTables:a}}function G(e){const r=[],a=[];for(const{layer:t,layerJSON:n}of e)_(t)?a.push(n):r.push(n);return{layers:r,tables:a}}function _(e,r){return e.isTable}function D(e){return G([e])}async function k(e,r){return/\/\d+\/?$/.test(e.url)?D(r[0]):J(r,e)}async function J(e,r){if(e.reverse(),!r)return G(e);const a=await Y(r,e);for(const t of e)X(t.layer,t.layerJSON,a);return K(a,e),a}async function Y(e,r){let a,t=await e.fetchData("json");if(!M(t)||A(e,P.HOSTED_SERVICE))a=!0;else{if(ee(t))return t;a=!1}t??={},B(t);const{layer:{url:n,customParameters:o,apiKey:s}}=r[0];return await V(t,{url:n??"",customParameters:o,apiKey:s},r.map(e=>e.layer.layerId),a),t}function M(e){return!!(e&&Array.isArray(e.layers)&&Array.isArray(e.tables))}function B(e){e.layers??=[],e.tables??=[]}function K(e,r){const a=[],t=[];for(const{layer:n}of r){const{isTable:e,layerId:r}=n;e?t.push(r):a.push(r)}z(e.layers,a),z(e.tables,t)}function z(e,a){if(e.length<2)return;const t=[];for(const{id:r}of e)t.push(r);r(t.sort(H),a.slice().sort(H))&&e.sort((e,r)=>{const t=a.indexOf(e.id),n=a.indexOf(r.id);return t<n?-1:t>n?1:0})}function H(e,r){return e<r?-1:e>r?1:0}async function V(e,r,a,t){const{url:n,customParameters:o,apiKey:s}=r,{serviceJSON:l,layersJSON:i}=await h(n,{customParameters:o,apiKey:s});if(!t)return void re(e,l);const u=W(e.layers,l.layers,a),c=W(e.tables,l.tables,a);e.layers=u.itemResources,e.tables=c.itemResources,re(e,l);const y=[...u.added,...c.added],f=i?[...i.layers,...i.tables]:[];await q(e,y,n,f)}function W(e,r,t){const n=a(e,r,(e,r)=>e.id===r.id);e=e.filter(e=>!n.removed.some(r=>r.id===e.id));const o=n.added;for(const{id:a}of o)e.push({id:a});return{itemResources:e,added:o.filter(({id:e})=>!t.includes(e))}}async function q(e,r,a,t){const n=await Q(r),o=[];for(const{id:s,type:l}of r){const e=n.get(l);e&&o.push(new e({url:a,layerId:s,sourceJSON:t.find(({id:e})=>e===s)}))}await Promise.allSettled(o.map(e=>e.load()));for(const s of o){const{layerId:r,loaded:a}=s;if(!a||!("defaultPopupTemplate"in s)||!s.defaultPopupTemplate)continue;const t={id:r,popupInfo:s.defaultPopupTemplate.toJSON()};X(s,"ArcGISFeatureLayer"===s.operationalLayerType?t:{...t,layerType:s.operationalLayerType},e)}}async function Q(e){const r=new Set,a=[];for(const{type:o}of e){const e=T(o);if(e&&!r.has(o))switch(r.add(o),e){case"AnnotationFeatureLayer":a.push(import("../AnnotationFeatureLayer.js").then(e=>e.default));break;case"CatalogLayer":a.push(import("../CatalogLayer.js").then(e=>e.default));break;case"DimensionFeatureLayer":a.push(import("../DimensionFeatureLayer.js").then(e=>e.default));break;case"FeatureLayer":a.push(import("../FeatureLayer.js").then(e=>e.default));break;case"OrientedImageryLayer":a.push(import("../OrientedImageryLayer.js").then(e=>e.default))}}const t=await Promise.all(a),n=new Map;return Array.from(r).forEach((e,r)=>{n.set(e,t[r])}),n}function X(e,r,a){e.isTable?Z(a.tables,r):Z(a.layers,r)}function Z(e,r){const a=e.findIndex(({id:e})=>e===r.id);-1===a?e.push(r):e[a]=r}function ee(e){return[...e.layers,...e.tables].every(e=>"layerType"in e&&!!e.layerType)}function re(e,r){const a=e.layers??[],t=e.tables??[],n=[...r.layers??[],...r.tables??[]];for(const o of[...a,...t]){const{id:e}=o;if("layerType"in o&&o.layerType)continue;const r=n.find(({id:r})=>r===e);if(!r)continue;const a=b(r.type,t.includes(o));a&&ae(o,a)&&te(a)&&(o.layerType=a)}}function ae(e,r){return"ArcGISFeatureLayer"!==r&&"Table"!==r}function te(e){return"ArcGISFeatureLayer"!==e&&"Table"!==e}function ne(e,r){if(!e.length)throw new t(`${r}:missing-parameters`,"'layers' array should contain at least one feature layer")}function oe(e,r){const a=e.map(e=>e.portalItem.id);if(new Set(a).size>1)throw new t(`${r}:invalid-parameters`,"All layers in the 'layers' array should be loaded from the same portal item")}function se(e,r){const a=e.map(e=>e.layerId);if(new Set(a).size!==a.length)throw new t(`${r}:invalid-parameters`,"'layers' array should contain only one instance each of layer or table in a feature service")}async function le(e){ne(e,j),await Promise.all(e.map(e=>e.load()));for(const r of e)c(r,j,F),y({layer:r,itemType:E,errorNamePrefix:j});oe(e,j),se(e,j)}function ie(e){if(!("layerType"in e))return!!e.charts?.length;switch(e.layerType){case"CatalogLayer":return!!e.footprintLayer?.charts?.length;case"OrientedImageryLayer":return!!e.charts?.length;case"SubtypeGroupLayer":return!!e.layers.some(e=>!!e.charts?.length);case"SubtypeGroupTable":return!!e.tables.some(e=>!!e.charts?.length)}return!1}function ue(e,r){let a=0,t=0,n=0,o=0,s=0,l=0,i=0;for(const u of[...r.layers,...r.tables])if(ie(u)&&i++,"layerType"in u)switch(u.layerType){case"CatalogLayer":a++;break;case"OrientedImageryLayer":t++;break;case"ParcelLayer":s++;break;case"SubtypeGroupLayer":n++;break;case"SubtypeGroupTable":o++;break;case"UtilityNetworkLayer":l++}S(e,P.CATALOG_LAYER,a>0),S(e,P.ORIENTED_IMAGERY_LAYER,t>0),S(e,P.PARCEL_FABRIC,s>0),S(e,P.SUBTYPE_GROUP_LAYER,n>0),S(e,P.SUBTYPE_GROUP_TABLE,o>0),S(e,P.UTILITY_NETWORK,l>0),S(e,P.CHARTS,i>0)}function ce(e,r,a){g(r,P.METADATA),S(r,P.MULTI_LAYER,e.length>1),S(r,P.SINGLE_LAYER,1===e.length),S(r,P.TABLE,a.tables.length>0&&0===a.layers.length),ue(r,a)}function ye(e,r,a){ue(r,a)}async function fe(e,r,a){const{url:t,layerId:n,title:o,fullExtent:s,isTable:l}=e,i=d(t);r.url=("FeatureServer"===i?.serverType?t:`${t}/${n}`)??null,r.title||=o,r.extent=null,l||null==s||(r.extent=await I(s)),ce([e],r,a)}function pe(e,r,a){for(const l of e){const r=l.parsedUrl.path,n=d(r),o=n?.url.path;if(!o)throw new t(`${a}:invalid-parameters`,m(l,`has unsupported url pattern: ${r}`),{layer:l});const s=n?.serverType;if("FeatureServer"!==s&&"MapServer"!==s)throw new t(`${a}:invalid-parameters`,m(l,`has unsupported server type: ${s}`),{layer:l});if("MapServer"===s&&e.length>1)throw new t(`${a}:invalid-parameters`,"Only one layer or table in a map service can be saved")}const n=d(e[0].parsedUrl.path),o=n?.url.path,s=e.every(e=>{const r=d(e.parsedUrl.path);return r?.url.path===o});if(!s)throw new t(`${a}:invalid-parameters`,"'layers' array should only contain layers or tables that belong to the same feature service");if(r){const e=d(r.url),n=e?.url.path;if(n!==o)throw new t(`${a}:invalid-parameters`,"'sourcePortalItem.url' and 'layers' should belong to the same service")}}async function me(e,r){const a=r?L.from(r):null;a&&(a.portal??=w.getDefault()),ne(e,R),await Promise.all([...e.map(e=>e.load()),a?.load()]),a&&p({item:a,itemType:E,errorNamePrefix:R});for(const t of e)c(t,R,F);return pe(e,a,R),se(e,R),a}function de(e,r){ue(e,r),f(e)}async function he(r,a,t){let n=0;for(const{isTable:e}of r)e||n++;const o=r[0].parsedUrl.path,s=d(o);if(a.url="FeatureServer"===s?.serverType?s.url.path:o,a.title||=s.title,a.extent=null,n>0){const t=r.map(e=>e.fullExtent).filter(e).reduce((e,r)=>e.clone().union(r));t&&(a.extent=await I(t))}ce(r,a,t),f(a)}async function be(e,r){return s({layer:e,itemType:E,validateLayer:F,createJSONContext:r=>U(r,e),createItemData:(e,r)=>k(r,[e]),errorNamePrefix:N,setItemProperties:ye},r)}async function Te(e,r){await le(e);const a=e[0].portalItem,t=C(a),o=await Promise.all(e.map(e=>l(e,e.isTable?t.forTables:t.forLayers,r))),s=await k(a,e.map((e,r)=>({layer:e,layerJSON:o[r]})));return de(a,s),await a.update({data:s}),await Promise.all(e.slice(1).map(e=>e.portalItem.reload())),n(t.forLayers),n(t.forTables),a.clone()}async function we(e,r,a){return o({layer:e,itemType:E,validateLayer:F,createJSONContext:r=>U(r,e),createItemData:(e,r)=>Promise.resolve(D(e)),errorNamePrefix:x,newItem:r,setItemProperties:fe},a)}async function Le(e,r,a){const t=await me(e,a?.sourcePortalItem),o=i({itemType:E,errorNamePrefix:R,newItem:r}),s=C(o),c=await Promise.all(e.map(e=>l(e,e.isTable?s.forTables:s.forLayers,a))),y=await J(e.map((e,r)=>({layer:e,layerJSON:c[r]})),t);await he(e,o,y),await u(o,y,a);for(const n of e)n.portalItem=o.clone();return n(s.forLayers),n(s.forTables),o}export{be as save,Te as saveAll,Le as saveAllAs,we as saveAs};
2
+ import{isSome as e,equals as r,difference as a}from"../../core/arrayUtils.js";import t from"../../core/Error.js";import{updateOrigins as n}from"../../core/accessorSupport/originUtils.js";import{saveAs as o,save as s,getLayerJSON as l,getPortalItem as i,addItem as u,ensureLayerConfig as c,ensureItemConfig as y,setCommonItemProperties as f,validateItemType as p,createErrorMessage as m}from"./utils.js";import{parse as d}from"../support/arcgisLayerUrl.js";import{fetchFeatureServiceWithAllResources as h,getFeatureServiceItemLayerType as b,getLayerModuleTypeStrict as T}from"../support/fetchService.js";import w from"../../portal/Portal.js";import L from"../../portal/PortalItem.js";import{createForItemWrite as v}from"../../portal/support/jsonContext.js";import{getWGS84ExtentForItem as I,toggleTypeKeyword as S,typeKeyword as P,removeTypeKeyword as g,hasTypeKeyword as A}from"../../portal/support/portalItemUtils.js";const E="Feature Service",O="feature-layer-utils",N=`${O}-save`,x=`${O}-save-as`,j=`${O}-saveall`,R=`${O}-saveall-as`;function $(e){const r=e?.type;return("feature"===r||"subtype-group"===r||"oriented-imagery"===r||"dimension-feature"===r||"annotation-feature"===r)&&"feature-layer"===e?.source?.type}function F(e){return{isValid:$(e)&&(!("dynamicDataSource"in e)||!e.dynamicDataSource),errorMessage:"Feature layer should be a layer or table in a map or feature service"}}function U(e,r){const a=v(e,"portal-item");return r?.isTable&&(a.layerContainerType="tables"),a}function C(e){const r=U(e),a=U(e);return a.layerContainerType="tables",{forLayers:r,forTables:a}}function G(e){const r=[],a=[];for(const{layer:t,layerJSON:n}of e)_(t)?a.push(n):r.push(n);return{layers:r,tables:a}}function _(e,r){return e.isTable}function D(e){return G([e])}async function k(e,r){return/\/\d+\/?$/.test(e.url)?D(r[0]):J(r,e)}async function J(e,r){if(e.reverse(),!r)return G(e);const a=await Y(r,e);for(const t of e)X(t.layer,t.layerJSON,a);return K(a,e),a}async function Y(e,r){let a,t=await e.fetchData("json");if(!M(t)||A(e,P.HOSTED_SERVICE))a=!0;else{if(ee(t))return t;a=!1}t??={},B(t);const{layer:{url:n,customParameters:o,apiKey:s}}=r[0];return await V(t,{url:n??"",customParameters:o,apiKey:s},r.map(e=>e.layer.layerId),a),t}function M(e){return!!(e&&Array.isArray(e.layers)&&Array.isArray(e.tables))}function B(e){e.layers??=[],e.tables??=[]}function K(e,r){const a=[],t=[];for(const{layer:n}of r){const{isTable:e,layerId:r}=n;e?t.push(r):a.push(r)}z(e.layers,a),z(e.tables,t)}function z(e,a){if(e.length<2)return;const t=[];for(const{id:r}of e)t.push(r);r(t.sort(H),a.slice().sort(H))&&e.sort((e,r)=>{const t=a.indexOf(e.id),n=a.indexOf(r.id);return t<n?-1:t>n?1:0})}function H(e,r){return e<r?-1:e>r?1:0}async function V(e,r,a,t){const{url:n,customParameters:o,apiKey:s}=r,{serviceJSON:l,layersJSON:i}=await h(n,{customParameters:o,apiKey:s});if(!t)return void re(e,l);const u=W(e.layers,l.layers,a),c=W(e.tables,l.tables,a);e.layers=u.itemResources,e.tables=c.itemResources,re(e,l);const y=[...u.added,...c.added],f=i?[...i.layers,...i.tables]:[];await q(e,y,n,f)}function W(e,r,t){const n=a(e,r,(e,r)=>e.id===r.id);e=e.filter(e=>!n.removed.some(r=>r.id===e.id));const o=n.added;for(const{id:a}of o)e.push({id:a});return{itemResources:e,added:o.filter(({id:e})=>!t.includes(e))}}async function q(e,r,a,t){const n=await Q(r),o=[];for(const{id:s,type:l}of r){const e=n.get(l);e&&o.push(new e({url:a,layerId:s,sourceJSON:t.find(({id:e})=>e===s)}))}await Promise.allSettled(o.map(e=>e.load()));for(const s of o){const{layerId:r,loaded:a}=s;if(!a||!("defaultPopupTemplate"in s)||!s.defaultPopupTemplate)continue;const t={id:r,popupInfo:s.defaultPopupTemplate.toJSON()};X(s,"ArcGISFeatureLayer"===s.operationalLayerType?t:{...t,layerType:s.operationalLayerType},e)}}async function Q(e){const r=new Set,a=[];for(const{type:o}of e){const e=T(o);if(e&&!r.has(o))switch(r.add(o),e){case"AnnotationFeatureLayer":a.push(import("../AnnotationFeatureLayer.js").then(e=>e.default));break;case"CatalogLayer":a.push(import("../CatalogLayer.js").then(e=>e.default));break;case"DimensionFeatureLayer":a.push(import("../DimensionFeatureLayer.js").then(e=>e.default));break;case"FeatureLayer":a.push(import("../FeatureLayer.js").then(e=>e.default));break;case"OrientedImageryLayer":a.push(import("../OrientedImageryLayer.js").then(e=>e.default))}}const t=await Promise.all(a),n=new Map;return Array.from(r).forEach((e,r)=>{n.set(e,t[r])}),n}function X(e,r,a){e.isTable?Z(a.tables,r):Z(a.layers,r)}function Z(e,r){const a=e.findIndex(({id:e})=>e===r.id);-1===a?e.push(r):e[a]=r}function ee(e){return[...e.layers,...e.tables].every(e=>"layerType"in e&&!!e.layerType)}function re(e,r){const a=e.layers??[],t=e.tables??[],n=[...r.layers??[],...r.tables??[]];for(const o of[...a,...t]){const{id:e}=o;if("layerType"in o&&o.layerType)continue;const r=n.find(({id:r})=>r===e);if(!r)continue;const a=b(r.type,t.includes(o));a&&ae(o,a)&&te(a)&&(o.layerType=a)}}function ae(e,r){return"ArcGISFeatureLayer"!==r&&"Table"!==r}function te(e){return"ArcGISFeatureLayer"!==e&&"Table"!==e}function ne(e,r){if(!e.length)throw new t(`${r}:missing-parameters`,"'layers' array should contain at least one feature layer")}function oe(e,r){const a=e.map(e=>e.portalItem.id);if(new Set(a).size>1)throw new t(`${r}:invalid-parameters`,"All layers in the 'layers' array should be loaded from the same portal item")}function se(e,r){const a=e.map(e=>e.layerId);if(new Set(a).size!==a.length)throw new t(`${r}:invalid-parameters`,"'layers' array should contain only one instance each of layer or table in a feature service")}async function le(e){ne(e,j),await Promise.all(e.map(e=>e.load()));for(const r of e)c(r,j,F),y({layer:r,itemType:E,errorNamePrefix:j});oe(e,j),se(e,j)}function ie(e){if(!("layerType"in e))return!!e.charts?.length;switch(e.layerType){case"CatalogLayer":return!!e.footprintLayer?.charts?.length;case"OrientedImageryLayer":return!!e.charts?.length;case"SubtypeGroupLayer":return!!e.layers.some(e=>!!e.charts?.length);case"SubtypeGroupTable":return!!e.tables.some(e=>!!e.charts?.length)}return!1}function ue(e,r){let a=0,t=0,n=0,o=0,s=0,l=0,i=0;for(const u of[...r.layers,...r.tables])if(ie(u)&&i++,"layerType"in u)switch(u.layerType){case"CatalogLayer":a++;break;case"OrientedImageryLayer":t++;break;case"ParcelLayer":s++;break;case"SubtypeGroupLayer":n++;break;case"SubtypeGroupTable":o++;break;case"UtilityNetworkLayer":l++}S(e,P.CATALOG_LAYER,a>0),S(e,P.ORIENTED_IMAGERY_LAYER,t>0),S(e,P.PARCEL_FABRIC,s>0),S(e,P.SUBTYPE_GROUP_LAYER,n>0),S(e,P.SUBTYPE_GROUP_TABLE,o>0),S(e,P.UTILITY_NETWORK,l>0),S(e,P.CHARTS,i>0)}function ce(e,r,a){g(r,P.METADATA),S(r,P.MULTI_LAYER,e.length>1),S(r,P.SINGLE_LAYER,1===e.length),S(r,P.TABLE,a.tables.length>0&&0===a.layers.length),ue(r,a)}function ye(e,r,a){ue(r,a)}async function fe(e,r,a){const{url:t,layerId:n,title:o,fullExtent:s,isTable:l}=e,i=d(t);r.url=("FeatureServer"===i?.serverType?t:`${t}/${n}`)??null,r.title||=o,r.extent=null,l||null==s||(r.extent=await I(s)),ce([e],r,a)}function pe(e,r,a){for(const l of e){const r=l.parsedUrl.path,n=d(r),o=n?.url.path;if(!o)throw new t(`${a}:invalid-parameters`,m(l,`has unsupported url pattern: ${r}`),{layer:l});const s=n?.serverType;if("FeatureServer"!==s&&"MapServer"!==s)throw new t(`${a}:invalid-parameters`,m(l,`has unsupported server type: ${s}`),{layer:l});if("MapServer"===s&&e.length>1)throw new t(`${a}:invalid-parameters`,"Only one layer or table in a map service can be saved")}const n=d(e[0].parsedUrl.path),o=n?.url.path,s=e.every(e=>{const r=d(e.parsedUrl.path);return r?.url.path===o});if(!s)throw new t(`${a}:invalid-parameters`,"'layers' array should only contain layers or tables that belong to the same feature service");if(r){const e=d(r.url),n=e?.url.path;if(n!==o)throw new t(`${a}:invalid-parameters`,"'sourcePortalItem.url' and 'layers' should belong to the same service")}}async function me(e,r){const a=r?L.from(r):null;a&&(a.portal??=w.getDefault()),ne(e,R),await Promise.all([...e.map(e=>e.load()),a?.load()]),a&&p({item:a,itemType:E,errorNamePrefix:R});for(const t of e)c(t,R,F);return pe(e,a,R),se(e,R),a}function de(e,r){ue(e,r),f(e)}async function he(r,a,t){let n=0;for(const{isTable:e}of r)e||n++;const o=r[0].parsedUrl.path,s=d(o);if(a.url="FeatureServer"===s?.serverType?s.url.path:o,a.title||=s.title,a.extent=null,n>0){const t=r.map(e=>e.fullExtent).filter(e).reduce((e,r)=>e.clone().union(r));t&&(a.extent=await I(t))}ce(r,a,t),f(a)}async function be(e,r){return s({layer:e,itemType:E,validateLayer:F,createJSONContext:r=>U(r,e),createItemData:(e,r)=>k(r,[e]),errorNamePrefix:N,setItemProperties:ye},r)}async function Te(e,r){await le(e);const a=e[0].portalItem,t=C(a),o=await Promise.all(e.map(e=>l(e,e.isTable?t.forTables:t.forLayers,r))),s=await k(a,e.map((e,r)=>({layer:e,layerJSON:o[r]})));return de(a,s),await a.update({data:s}),await Promise.all(e.slice(1).map(e=>e.portalItem.reload())),n(t.forLayers),n(t.forTables),a.clone()}async function we(e,r,a){return o({layer:e,itemType:E,validateLayer:F,createJSONContext:r=>U(r,e),createItemData:(e,r)=>Promise.resolve(D(e)),errorNamePrefix:x,newItem:r,setItemProperties:fe},a)}async function Le(e,r,a){const t=await me(e,a?.sourcePortalItem),o=i({itemType:E,errorNamePrefix:R,newItem:r}),s=C(o),c=await Promise.all(e.map(e=>l(e,e.isTable?s.forTables:s.forLayers,a))),y=await J(e.map((e,r)=>({layer:e,layerJSON:c[r]})),t);await he(e,o,y),await u(o,y,a);for(const n of e)n.portalItem=o.clone();return n(s.forLayers),n(s.forTables),o}export{be as save,Te as saveAll,Le as saveAllAs,we as saveAs};
@@ -1,9 +1,10 @@
1
1
  import type AnnotationFeatureLayer from "../AnnotationFeatureLayer.js";
2
2
  import type { ClonableMixin } from "../../core/Clonable.js";
3
3
  import type { IdentifiableMixin, IdentifiableMixinProperties } from "../../core/Identifiable.js";
4
+ import type { JSONSupportMixin } from "../../core/JSONSupport.js";
4
5
  import type { Loadable, LoadableMixinProperties } from "../../core/Loadable.js";
5
6
 
6
- export interface AnnotationFeatureSublayerProperties extends LoadableMixinProperties, IdentifiableMixinProperties, Partial<Pick<AnnotationFeatureSublayer, "parent" | "subtypeCode" | "visible">> {}
7
+ export interface AnnotationFeatureSublayerProperties extends LoadableMixinProperties, IdentifiableMixinProperties, Partial<Pick<AnnotationFeatureSublayer, "maxScale" | "minScale" | "parent" | "subtypeCode" | "title" | "visible">> {}
7
8
 
8
9
  /**
9
10
  * Represents a sublayer in a [AnnotationFeatureLayer (beta)](https://developers.arcgis.com/javascript/latest/references/core/layers/AnnotationFeatureLayer/). Each AnnotationFeatureSublayer
@@ -19,6 +20,26 @@ export interface AnnotationFeatureSublayerProperties extends LoadableMixinProper
19
20
  */
20
21
  export default class AnnotationFeatureSublayer extends AnnotationFeatureSublayerSuperclass {
21
22
  constructor(properties?: AnnotationFeatureSublayerProperties);
23
+ /**
24
+ * The maximum scale (most zoomed in) at which the layer is visible in the view.
25
+ * If the map is zoomed in beyond this scale, the layer will not be visible.
26
+ * A value of `0` means the layer does not have a maximum scale.
27
+ * The `maxScale` value should always be smaller than the [minScale](https://developers.arcgis.com/javascript/latest/references/core/layers/support/AnnotationFeatureSublayer/#minScale) value,
28
+ * and greater than or equal to the service specification.
29
+ *
30
+ * @default 0
31
+ */
32
+ accessor maxScale: number;
33
+ /**
34
+ * The minimum scale (most zoomed out) at which the layer is visible in the view.
35
+ * If the map is zoomed out beyond this scale, the layer will not be visible.
36
+ * A value of `0` means the layer does not have a minimum scale.
37
+ * The `minScale` value should always be larger than the [maxScale](https://developers.arcgis.com/javascript/latest/references/core/layers/support/AnnotationFeatureSublayer/#maxScale) value,
38
+ * and lesser than or equal to the service specification.
39
+ *
40
+ * @default 0
41
+ */
42
+ accessor minScale: number;
22
43
  /** The [AnnotationFeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/AnnotationFeatureLayer/) to which the sublayer belongs. */
23
44
  accessor parent: AnnotationFeatureLayer | null | undefined;
24
45
  /**
@@ -30,7 +51,7 @@ export default class AnnotationFeatureSublayer extends AnnotationFeatureSublayer
30
51
  * The title of the layer used to identify it in places such as the [layer list](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-layer-list/).
31
52
  * The title is set to the subtype description of the layer.
32
53
  */
33
- get title(): string | null | undefined;
54
+ accessor title: string | null | undefined;
34
55
  get type(): "annotation-feature-sublayer";
35
56
  /**
36
57
  * Indicates if the sublayer is visible in the [View](https://developers.arcgis.com/javascript/latest/references/core/views/View/). When `false`,
@@ -43,4 +64,4 @@ export default class AnnotationFeatureSublayer extends AnnotationFeatureSublayer
43
64
  */
44
65
  accessor visible: boolean;
45
66
  }
46
- declare const AnnotationFeatureSublayerSuperclass: typeof Loadable & typeof IdentifiableMixin & typeof ClonableMixin
67
+ declare const AnnotationFeatureSublayerSuperclass: typeof Loadable & typeof IdentifiableMixin & typeof ClonableMixin & typeof JSONSupportMixin
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{ClonableMixin as e}from"../../core/Clonable.js";import{IdentifiableMixin as o}from"../../core/Identifiable.js";import{Loadable as r}from"../../core/Loadable.js";import{property as i,subclass as p}from"../../core/accessorSupport/decorators.js";import a from"../../graphic/AnnotationFeatureGraphicOrigin.js";let n=class extends(e(o(r))){constructor(t){super(t),this.maxScale=0,this.minScale=0,this.parent=null,this.subtypeCode=null,this.type="annotation-feature-sublayer",this.visible=!0}get graphicOrigin(){return new a(this.parent,this)}get title(){return this.parent?.subtypes?.find(t=>t.code===this.subtypeCode)?.name??null}};t([i({readOnly:!0,clonable:!1})],n.prototype,"graphicOrigin",null),t([i()],n.prototype,"maxScale",void 0),t([i()],n.prototype,"minScale",void 0),t([i({clonable:!1})],n.prototype,"parent",void 0),t([i({type:Number})],n.prototype,"subtypeCode",void 0),t([i({readOnly:!0})],n.prototype,"title",null),t([i({readOnly:!0})],n.prototype,"type",void 0),t([i({type:Boolean})],n.prototype,"visible",void 0),n=t([p("esri.layers.support.AnnotationFeatureSublayer")],n);export{n as default};
2
+ import{__decorate as e}from"tslib";import{ClonableMixin as t}from"../../core/Clonable.js";import{IdentifiableMixin as o}from"../../core/Identifiable.js";import{JSONSupportMixin as r}from"../../core/JSONSupport.js";import{clone as i}from"../../core/lang.js";import{Loadable as n}from"../../core/Loadable.js";import{property as s,subclass as l}from"../../core/accessorSupport/decorators.js";import a from"../../graphic/AnnotationFeatureGraphicOrigin.js";import{maxScale as p,minScale as u}from"./commonProperties.js";let d=0,y=class extends(r(t(o(n)))){constructor(e){super(e),this.id=`${Date.now().toString(16)}-annotation-feature-sublayer-${d++}`,this.layerType="ArcGISAnnotationSubLayer",this.maxScale=0,this.minScale=0,this.parent=null,this.subtypeCode=null,this.type="annotation-feature-sublayer",this.visible=!0}get graphicOrigin(){return new a(this.parent,this)}get title(){return this._isOverridden("title")?this._get("title"):this.parent?.subtypes?.find(e=>e.code===this.subtypeCode)?.name??this.subtypeCode?.toString()??null}set title(e){this._override("title",e)}clone(){const e=super.clone();return this._isOverridden("title")&&(e.title=this.title),e}};e([s({readOnly:!0,clonable:!1})],y.prototype,"graphicOrigin",null),e([s({type:String,nonNullable:!0,clonable:!1,json:{write:{isRequired:!0}}})],y.prototype,"id",void 0),e([s({type:["ArcGISAnnotationSubLayer"],readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],y.prototype,"layerType",void 0),e([s((()=>{const e=i(p);return e.json??={},e.json.default=0,e})())],y.prototype,"maxScale",void 0),e([s((()=>{const e=i(u);return e.json??={},e.json.default=0,e})())],y.prototype,"minScale",void 0),e([s({clonable:!1})],y.prototype,"parent",void 0),e([s({type:Number,nonNullable:!0,json:{name:"subLayerId",write:{isRequired:!0}}})],y.prototype,"subtypeCode",void 0),e([s({type:String,nonNullable:!0,clonable:!1,json:{write:{isRequired:!0}}})],y.prototype,"title",null),e([s({readOnly:!0,json:{read:!1}})],y.prototype,"type",void 0),e([s({type:Boolean,nonNullable:!0,json:{default:!0,name:"visibility",write:!0}})],y.prototype,"visible",void 0),y=e([l("esri.layers.support.AnnotationFeatureSublayer")],y);export{y as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{id as e}from"../../kernel.js";import t from"../../request.js";import n from"../../core/Collection.js";import"../../core/urlUtils.js";import{isLayerFromCatalog as r}from"../catalog/catalogUtils.js";import{isBasemap as i}from"../../support/userTypeGuards/isBasemap.js";function u(e,t){return null!=e&&"object"==typeof e&&"type"in e&&e.type===t}function o(e){return w(e)||m(e)}function s(e){return u(e,"feature")}function a(e){return"gaussian-splat"===e?.type}function c(e){return u(e,"oriented-imagery")}function l(e){return u(e,"catalog-footprint")}function f(e){return u(e,"graphics")}function p(e){return u(e,"map-image")}function y(e){return u(e,"map-notes")&&"sublayers"in e}function g(e){return u(e,"knowledge-graph")&&"layers"in e}function d(e){return u(e,"knowledge-graph-sublayer")}function b(e){return u(e,"link-chart")&&"layers"in e}function m(e){return u(e,"scene")}function h(e){return u(e,"subtype-group")&&"sublayers"in e}function v(e){return"subtype-sublayer"===e?.type}function w(e){const t=e?.type;return"imagery-tile"===t||"tile"===t||"open-street-map"===t||"vector-tile"===t||"web-tile"===t||"wmts"===t}function j(e){const t=e?.type;return"base-tile"===t||"tile"===t||"elevation"===t||"imagery-tile"===t||"base-elevation"===t||"open-street-map"===t||"wcs"===t||"web-tile"===t||"wmts"===t||"vector-tile"===t}function L(e){return"group"===e?.type}function S(e){const t=e.parent;return L(t)&&t.tables.includes(e)}const E={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function k(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function C(e){return"integrated-mesh"===e.type||"integrated-mesh-3dtiles"===e.type}function x(e){return"integrated-mesh-3dtiles"===e.type}function R(e){const t=e?.type;return"integrated-mesh-3dtiles"===t||"gaussian-splat"===t}function T(e){return"voxel"===e?.type}function U(e){return"imagery-tile"===e?.type}function M(e,t){return i(e?.parent)&&e.parent[t].includes(e)}function O(e){return M(e,"baseLayers")}function P(e){return M(e,"referenceLayers")}function q(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function B(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t||"annotation-feature"===t||"dimension-feature"===t)&&"feature-layer"===e?.source?.type}function I(e){return"feature"===e?.type&&"feature-layer"===e.source?.type}function F(e){return null!=e&&"object"==typeof e&&"featureReduction"in e}function J(e){return l(e)||s(e)&&I(e)||c(e)||v(e)}function N(e){const t=e?.type;return"binning"===t||"cluster"===t}function A(e,t){if(!J(e))return;const n=t?.graphic,r="featureReduction"in e?e.featureReduction:null;if(n){if(n.isAggregate){const e=n.origin;return e&&("featureReductionProvider"in e&&r)?N(r)?r:null:void 0}return e}return t?.checkFeatureReduction&&r?N(r)?r:null:e}function D(e){const t=/[:;]/,n=[];let r=!1;if(e&&(e.forEach((e,i)=>{n.push([i,e]),!r&&t.test(e)&&(r=!0)}),n.length>0)){let e;if(r){const t={};n.forEach(e=>{t[e[0]]=e[1]}),e=JSON.stringify(t)}else{const t=[];n.forEach(e=>{t.push(e[0]+":"+e[1])}),e=t.join(";")}return e}return null}function G(e){if(!e)return;const t=[];return e.forEach((e,n)=>{t.push('"'+n+'":'+JSON.stringify(e))}),t.length?"{"+t.join(",")+"}":void 0}function V(e){if(e.activeLayer){const t=e.activeLayer.tileMatrixSet;if(t)return t;const n=e.activeLayer.tileMatrixSets;if(n)return n}return null}async function $(n,r){const i=e?.findServerInfo(n);if(null!=i?.currentVersion)return i.owningSystemUrl||null;const u=n.toLowerCase().indexOf("/rest/services");if(-1===u)return null;const o=`${n.slice(0,u)}/rest/info`,s=null!=r?r.signal:null,{data:a}=await t(o,{query:{f:"json"},responseType:"json",signal:s});return a?.owningSystemUrl||null}function z(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"dimension-feature":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"parquet":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}function H(e){return null!=e&&"object"==typeof e&&"isTable"in e&&!!e.isTable}function K(e){return z(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function Q(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":case"knowledge-graph-sublayer":return!0;default:return!1}}function W(e){return!!Q(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function X(e){if(!e)return[];return("subtypes"in e?e.subtypes:h(e.parent)?e.parent.subtypes:[])??[]}function Y(e){return("imagery"===e.type||"imagery-tile"===e.type)&&"flow"===e.renderer?.type}function Z(e){const t=new n;for(const n of e.allLayers.concat(e.allTables))r(n)||S(n)||"annotation-feature"===n.type||"dimension-feature"===n.type||("charts"in n&&t.push(n),"subtype-group"===n.type&&t.push(...n.sublayers));return t}function _(e,t){return null}function ee(e){return null}function te(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function ne(e,t){if(!t||!te(e))return;const n=_(e.url);n&&(e.url=n)}export{ne as applyPreferredHostToPortalItem,W as getEffectiveEditingEnabled,K as getEffectiveLayerCapabilities,A as getFieldConfigurationsContainer,Z as getLayersWithChartSupport,$ as getOwningPortalUrl,ee as getPreferredHost,_ as getPreferredUrl,X as getSubtypesFromLayer,V as getTileMaxtrixSetFromActiveLayer,R as is3DTilesLayer,O as isBaseLayer,o as isBasemap3DSupportedLayer,w as isBasemapSupportedTiledLayer,q as isFeatureCollectionLayer,s as isFeatureLayer,I as isFeatureServiceLayer,a as isGaussianSplatLayer,f as isGraphicsLayer,L as isGroupLayer,U as isImageryTileLayer,x as isIntegratedMesh3DTilesLayer,C as isIntegratedMeshLayer,g as isKnowledgeGraphLayer,d as isKnowledgeGraphSublayer,z as isLayerWithFeatureCapabilities,B as isLayerWithFeatureLayerSource,Y as isLayerWithFlowRenderer,b as isLinkChartLayer,p as isMapImageLayer,y as isMapNotesLayer,te as isPreferredUrlApplicable,P as isReferenceLayer,m as isSceneLayer,k as isSceneServiceLayer,h as isSubtypeGroupLayer,v as isSubtypeSublayer,H as isTable,j as isTiledLayer,T as isVoxelLayer,E as sceneServiceLayerTypeToClassName,D as serializeLayerDefinitions,G as serializeTimeOptions,F as supportsFeatureReduction,J as supportsFieldConfiguration};
2
+ import{id as e}from"../../kernel.js";import t from"../../request.js";import n from"../../core/Collection.js";import"../../core/urlUtils.js";import{isLayerFromCatalog as r}from"../catalog/catalogUtils.js";import{isBasemap as i}from"../../support/userTypeGuards/isBasemap.js";function u(e,t){return null!=e&&"object"==typeof e&&"type"in e&&e.type===t}function o(e){return w(e)||m(e)}function s(e){return u(e,"feature")}function a(e){return"gaussian-splat"===e?.type}function c(e){return u(e,"oriented-imagery")}function l(e){return u(e,"catalog-footprint")}function f(e){return u(e,"graphics")}function p(e){return u(e,"map-image")}function y(e){return u(e,"map-notes")&&"sublayers"in e}function g(e){return u(e,"knowledge-graph")&&"layers"in e}function d(e){return u(e,"knowledge-graph-sublayer")}function b(e){return u(e,"link-chart")&&"layers"in e}function m(e){return u(e,"scene")}function h(e){return u(e,"subtype-group")&&"sublayers"in e}function v(e){return"subtype-sublayer"===e?.type}function w(e){const t=e?.type;return"imagery-tile"===t||"tile"===t||"open-street-map"===t||"vector-tile"===t||"web-tile"===t||"wmts"===t}function j(e){const t=e?.type;return"base-tile"===t||"tile"===t||"elevation"===t||"imagery-tile"===t||"base-elevation"===t||"open-street-map"===t||"wcs"===t||"web-tile"===t||"wmts"===t||"vector-tile"===t}function L(e){return"group"===e?.type}function S(e){const t=e.parent;return L(t)&&t.tables.includes(e)}const E={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function k(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function C(e){return"integrated-mesh"===e.type||"integrated-mesh-3dtiles"===e.type}function x(e){return"integrated-mesh-3dtiles"===e.type}function R(e){const t=e?.type;return"integrated-mesh-3dtiles"===t||"gaussian-splat"===t}function T(e){return"voxel"===e?.type}function U(e){return"imagery-tile"===e?.type}function M(e,t){return i(e?.parent)&&e.parent[t].includes(e)}function O(e){return M(e,"baseLayers")}function P(e){return M(e,"referenceLayers")}function q(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function B(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t||"annotation-feature"===t||"dimension-feature"===t)&&"feature-layer"===e?.source?.type}function I(e){return"feature"===e?.type&&"feature-layer"===e.source?.type}function F(e){return null!=e&&"object"==typeof e&&"featureReduction"in e}function J(e){return l(e)||s(e)&&I(e)||c(e)||v(e)}function N(e){const t=e?.type;return"binning"===t||"cluster"===t}function A(e,t){if(!J(e))return;const n=t?.graphic,r="featureReduction"in e?e.featureReduction:null;if(n){if(n.isAggregate){const e=n.origin;return e&&("featureReductionProvider"in e&&r)?N(r)?r:null:void 0}return e}return t?.checkFeatureReduction&&r?N(r)?r:null:e}function D(e){const t=/[:;]/,n=[];let r=!1;if(e&&(e.forEach((e,i)=>{n.push([i,e]),!r&&t.test(e)&&(r=!0)}),n.length>0)){let e;if(r){const t={};n.forEach(e=>{t[e[0]]=e[1]}),e=JSON.stringify(t)}else{const t=[];n.forEach(e=>{t.push(e[0]+":"+e[1])}),e=t.join(";")}return e}return null}function G(e){if(!e)return;const t=[];return e.forEach((e,n)=>{t.push('"'+n+'":'+JSON.stringify(e))}),t.length?"{"+t.join(",")+"}":void 0}function V(e){if(e.activeLayer){const t=e.activeLayer.tileMatrixSet;if(t)return t;const n=e.activeLayer.tileMatrixSets;if(n)return n}return null}async function $(n,r){const i=e?.findServerInfo(n);if(null!=i?.currentVersion)return i.owningSystemUrl||null;const u=n.toLowerCase().indexOf("/rest/services");if(-1===u)return null;const o=`${n.slice(0,u)}/rest/info`,s=null!=r?r.signal:null,{data:a}=await t(o,{query:{f:"json"},responseType:"json",signal:s});return a?.owningSystemUrl||null}function z(e){if(!("capabilities"in e))return!1;switch(e.type){case"annotation-feature":case"catalog":case"catalog-footprint":case"csv":case"dimension-feature":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"parquet":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}function H(e){return null!=e&&"object"==typeof e&&"isTable"in e&&!!e.isTable}function K(e){return z(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function Q(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":case"knowledge-graph-sublayer":return!0;default:return!1}}function W(e){return!!Q(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function X(e){if(!e)return[];return("subtypes"in e?e.subtypes:h(e.parent)?e.parent.subtypes:[])??[]}function Y(e){return("imagery"===e.type||"imagery-tile"===e.type)&&"flow"===e.renderer?.type}function Z(e){const t=new n;for(const n of e.allLayers.concat(e.allTables))r(n)||S(n)||"annotation-feature"===n.type||"dimension-feature"===n.type||("charts"in n&&t.push(n),"subtype-group"===n.type&&t.push(...n.sublayers));return t}function _(e,t){return null}function ee(e){return null}function te(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function ne(e,t){if(!t||!te(e))return;const n=_(e.url);n&&(e.url=n)}export{ne as applyPreferredHostToPortalItem,W as getEffectiveEditingEnabled,K as getEffectiveLayerCapabilities,A as getFieldConfigurationsContainer,Z as getLayersWithChartSupport,$ as getOwningPortalUrl,ee as getPreferredHost,_ as getPreferredUrl,X as getSubtypesFromLayer,V as getTileMaxtrixSetFromActiveLayer,R as is3DTilesLayer,O as isBaseLayer,o as isBasemap3DSupportedLayer,w as isBasemapSupportedTiledLayer,q as isFeatureCollectionLayer,s as isFeatureLayer,I as isFeatureServiceLayer,a as isGaussianSplatLayer,f as isGraphicsLayer,L as isGroupLayer,U as isImageryTileLayer,x as isIntegratedMesh3DTilesLayer,C as isIntegratedMeshLayer,g as isKnowledgeGraphLayer,d as isKnowledgeGraphSublayer,z as isLayerWithFeatureCapabilities,B as isLayerWithFeatureLayerSource,Y as isLayerWithFlowRenderer,b as isLinkChartLayer,p as isMapImageLayer,y as isMapNotesLayer,te as isPreferredUrlApplicable,P as isReferenceLayer,m as isSceneLayer,k as isSceneServiceLayer,h as isSubtypeGroupLayer,v as isSubtypeSublayer,H as isTable,j as isTiledLayer,T as isVoxelLayer,E as sceneServiceLayerTypeToClassName,D as serializeLayerDefinitions,G as serializeTimeOptions,F as supportsFeatureReduction,J as supportsFieldConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import has from"../../core/has.js";const e={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WCS:"WCSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},r={ArcGISAnnotationLayer:"AnnotationFeatureLayer",ArcGISDimensionLayer:"DimensionFeatureLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",ArcGISVideoLayer:"VideoLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",GeoJSON:"GeoJSONLayer",GeoRSS:"GeoRSSLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",KnowledgeGraphLayer:"KnowledgeGraphLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",get ParquetLayer(){return has("parquetlayer-persistence-enabled")?"ParquetLayer":"UnsupportedLayer"},SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WCS:"WCSLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},a={ArcGISFeatureLayer:"FeatureLayer",SubtypeGroupTable:"SubtypeGroupLayer"},y={ArcGISImageServiceLayer:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WCS:"UnsupportedLayer",WMS:"UnsupportedLayer",WebTiledLayer:"WebTileLayer"},i={IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer"},L={ArcGISTiledElevationServiceLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},n={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BuildingSceneLayer:"BuildingSceneLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",GaussianSplatLayer:"GaussianSplatLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",Object3DTilesLayer:"UnsupportedLayer",IntegratedMeshLayer:"IntegratedMeshLayer",KML:"KMLLayer",LineOfSightLayer:"LineOfSightLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",PointCloudLayer:"PointCloudLayer",RasterDataLayer:"UnsupportedLayer",VectorTileLayer:"VectorTileLayer",ViewshedLayer:"ViewshedLayer",Voxel:"VoxelLayer",WCS:"WCSLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},t={ArcGISFeatureLayer:"FeatureLayer"},c={...r,LinkChartLayer:"LinkChartLayer"},s=e,S=a,l={ArcGISDimensionLayer:"DimensionFeatureLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",BuildingSceneLayer:"BuildingSceneLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",IntegratedMeshLayer:"IntegratedMeshLayer",MediaLayer:"MediaLayer",OrientedImageryLayer:"OrientedImageryLayer",PointCloudLayer:"PointCloudLayer",SubtypeGroupLayer:"SubtypeGroupLayer",WCS:"WCSLayer"},o=a;function u(l){switch(l.origin){case"web-scene":switch(l.layerContainerType){case"basemap-base-layers":return y;case"basemap-ground-layers":return i;case"ground":return L;case"tables":return t;default:return n}case"link-chart":switch(l.layerContainerType){case"basemap-base-layers":return s;case"tables":return S;default:return c}default:switch(l.layerContainerType){case"basemap-base-layers":return e;case"tables":return a;case"ground":case"basemap-ground-layers":return;default:return r}}}function p(e,r){if(!r)return"UnknownLayer";if("DefaultTileLayer"===r){let r="UnknownLayer";if("web-scene"===e.origin)switch(e.layerContainerType){case"operational-layers":case"basemap-base-layers":r="TileLayer";break;case"ground":r="ElevationLayer"}else switch(e.layerContainerType){case"basemap-base-layers":case"operational-layers":r="TileLayer"}return r}return u(e)?.[r]??"UnknownLayer"}function I(e){if("portal-item"===e.origin)switch(e.layerContainerType){case"basemap-base-layers":case"ground":case"basemap-ground-layers":return;case"tables":return o;default:return l}return u(e)}function d(e,r,a){if(!e?.origin)return!1;switch(e.origin){case"web-map":case"link-chart":if("operational-layers"===e.layerContainerType)if("ArcGISDimensionLayer"===r)if("dimension-feature"!==a)return!1;break;case"web-scene":if("operational-layers"===e.layerContainerType)if("ArcGISTiledElevationServiceLayer"===r)return!1;break;case"portal-item":if("ArcGISDimensionLayer"===r)if("dimension-feature"!==a)return!1}const y=I(e)?.[r];return null!=y&&"UnknownLayer"!==y&&"UnsupportedLayer"!==y}export{p as getLayerModuleForContextAndType,d as isLayerSupportedForWriteContext,u as layerTypeMapForReadContext};
2
+ import has from"../../core/has.js";const e={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WCS:"WCSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},r={ArcGISAnnotationLayer:"AnnotationFeatureLayer",ArcGISDimensionLayer:"DimensionFeatureLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",ArcGISVideoLayer:"VideoLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",GeoJSON:"GeoJSONLayer",GeoRSS:"GeoRSSLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",KnowledgeGraphLayer:"KnowledgeGraphLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",get ParquetLayer(){return has("parquetlayer-persistence-enabled")?"ParquetLayer":"UnsupportedLayer"},SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WCS:"WCSLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},a={ArcGISFeatureLayer:"FeatureLayer",SubtypeGroupTable:"SubtypeGroupLayer"},y={ArcGISImageServiceLayer:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WCS:"UnsupportedLayer",WMS:"UnsupportedLayer",WebTiledLayer:"WebTileLayer"},i={IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer"},L={ArcGISTiledElevationServiceLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},n={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BuildingSceneLayer:"BuildingSceneLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",GaussianSplatLayer:"GaussianSplatLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",Object3DTilesLayer:"UnsupportedLayer",IntegratedMeshLayer:"IntegratedMeshLayer",KML:"KMLLayer",LineOfSightLayer:"LineOfSightLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",PointCloudLayer:"PointCloudLayer",RasterDataLayer:"UnsupportedLayer",VectorTileLayer:"VectorTileLayer",ViewshedLayer:"ViewshedLayer",Voxel:"VoxelLayer",WCS:"WCSLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},t={ArcGISFeatureLayer:"FeatureLayer"},c={...r,LinkChartLayer:"LinkChartLayer"},s=e,S=a,o={ArcGISAnnotationLayer:"AnnotationFeatureLayer",ArcGISDimensionLayer:"DimensionFeatureLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",BuildingSceneLayer:"BuildingSceneLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",IntegratedMeshLayer:"IntegratedMeshLayer",MediaLayer:"MediaLayer",OrientedImageryLayer:"OrientedImageryLayer",PointCloudLayer:"PointCloudLayer",SubtypeGroupLayer:"SubtypeGroupLayer",WCS:"WCSLayer"},l=a;function u(o){switch(o.origin){case"web-scene":switch(o.layerContainerType){case"basemap-base-layers":return y;case"basemap-ground-layers":return i;case"ground":return L;case"tables":return t;default:return n}case"link-chart":switch(o.layerContainerType){case"basemap-base-layers":return s;case"tables":return S;default:return c}default:switch(o.layerContainerType){case"basemap-base-layers":return e;case"tables":return a;case"ground":case"basemap-ground-layers":return;default:return r}}}function p(e,r){if(!r)return"UnknownLayer";if("DefaultTileLayer"===r){let r="UnknownLayer";if("web-scene"===e.origin)switch(e.layerContainerType){case"operational-layers":case"basemap-base-layers":r="TileLayer";break;case"ground":r="ElevationLayer"}else switch(e.layerContainerType){case"basemap-base-layers":case"operational-layers":r="TileLayer"}return r}return u(e)?.[r]??"UnknownLayer"}function I(e){if("portal-item"===e.origin)switch(e.layerContainerType){case"basemap-base-layers":case"ground":case"basemap-ground-layers":return;case"tables":return l;default:return o}return u(e)}function d(e,r,a){if(!e?.origin)return!1;switch(e.origin){case"web-map":case"link-chart":if("operational-layers"===e.layerContainerType)if("ArcGISDimensionLayer"===r)if("dimension-feature"!==a)return!1;break;case"web-scene":if("operational-layers"===e.layerContainerType)if("ArcGISTiledElevationServiceLayer"===r)return!1;break;case"portal-item":if("ArcGISDimensionLayer"===r)if("dimension-feature"!==a)return!1}const y=I(e)?.[r];return null!=y&&"UnknownLayer"!==y&&"UnsupportedLayer"!==y}export{p as getLayerModuleForContextAndType,d as isLayerSupportedForWriteContext,u as layerTypeMapForReadContext};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ const e=["sensorLocation","lineOfSight","sensorPath","sensorTrail","frameCenter","frameOutline","frame"];export{e as telemetryDisplayPropertyNames};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.2.0-next.104",
3
+ "version": "5.2.0-next.106",
4
4
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
5
5
  "keywords": [
6
6
  "ArcGIS",
@@ -20,13 +20,13 @@
20
20
  "license": "SEE LICENSE IN LICENSE.md",
21
21
  "dependencies": {
22
22
  "@amcharts/amcharts5": "~5.20.5",
23
- "@arcgis/toolkit": "5.2.0-next.104",
23
+ "@arcgis/toolkit": "5.2.0-next.106",
24
24
  "@esri/arcgis-html-sanitizer": "~4.1.0",
25
25
  "@esri/calcite-components": "^5.2.0-next.65",
26
- "@vaadin/grid": "~25.2.9",
27
- "@zip.js/zip.js": "~2.11.2",
26
+ "@vaadin/grid": "~25.2.10",
27
+ "@zip.js/zip.js": "~2.13.1",
28
28
  "luxon": "~3.7.2",
29
- "marked": "~18.0.11",
29
+ "marked": "~18.0.12",
30
30
  "tslib": "^2.8.1"
31
31
  }
32
32
  }
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- const a="20260908",b="bd023a1a29fe0cb2608b236176f9956e86774a59";export{a as buildDate,b as revision};
2
+ const e="20260910",d="229e1aa21708dde4ff82deb4eeb8ac11bce6d4db";export{e as buildDate,d as revision};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{clone as e}from"../core/lang.js";import{property as o,subclass as i}from"../core/accessorSupport/decorators.js";import r from"./Font.js";import l from"./Symbol3DLayer.js";import{screenSizeProperty as n}from"./support/materialUtils.js";import s from"./support/OccludedVisibility.js";import{occludedVisibilityProperty as a}from"./support/occludedVisibilityUtils.js";import u from"./support/Symbol3DHalo.js";import p from"./support/Symbol3DMaterial.js";import c from"./support/Symbol3DTextBackground.js";import{horizontalAlignmentProperty as m,lineHeightProperty as h,verticalAlignmentProperty as d}from"./support/textUtils.js";import{writer as f}from"../core/accessorSupport/decorators/writer.js";import{enumeration as y}from"../core/accessorSupport/decorators/enumeration.js";var g;let b=class extends l{static{g=this}constructor(t){super(t),this._userSize=void 0,this.halo=null,this.horizontalAlignment="center",this.lineHeight=1,this.material=null,this.background=null,this.text=null,this.type="text",this.verticalAlignment="baseline",this.occludedVisibility=new s({mode:"adaptive"})}get font(){return this._get("font")||null}set font(t){null!=t&&null!=this._userSize&&(t.size=this._userSize),this._set("font",t)}writeFont(t,e,o,i){const r={...i,textSymbol3D:!0};e.font=t.write({},r),delete e.font.size}get size(){return null!=this._userSize?this._userSize:null!=this.font?.size?this.font.size:9}set size(t){this._userSize=Number(t),null!=this.font&&(this.font.size=this._userSize),this.notifyChange("size")}clone(){const t=new g({enabled:this.enabled,font:e(this.font),halo:e(this.halo),horizontalAlignment:this.horizontalAlignment,lineHeight:this.lineHeight,material:null!=this.material?this.material.clone():null,text:this.text,verticalAlignment:this.verticalAlignment,background:e(this.background),occludedVisibility:e(this.occludedVisibility)});return t._userSize=this._userSize,t}static fromTextSymbol(t){return new g({font:null!=t.font?t.font.clone():new r,halo:z(t.haloColor,t.haloSize),horizontalAlignment:t.horizontalAlignment,lineHeight:t.lineHeight,material:t.color?new p({color:t.color.clone()}):null,text:t.text,verticalAlignment:t.verticalAlignment,background:t.backgroundColor?new c({color:t.backgroundColor.clone()}):null,occludedVisibility:null})}};function z(t,o){return t&&null!=o&&o>0?new u({color:e(t),size:o}):null}t([o({type:r,json:{write:!0}})],b.prototype,"font",null),t([f("font")],b.prototype,"writeFont",null),t([o({type:u,json:{write:!0}})],b.prototype,"halo",void 0),t([o({...m,json:{default:"center",write:!0}})],b.prototype,"horizontalAlignment",void 0),t([o({...h,json:{default:1,write:!0}})],b.prototype,"lineHeight",void 0),t([o({type:p,json:{write:!0}})],b.prototype,"material",void 0),t([o({type:c,json:{write:!0}})],b.prototype,"background",void 0),t([o(n)],b.prototype,"size",null),t([o({type:String,json:{write:!0}})],b.prototype,"text",void 0),t([y({Text:"text"},{readOnly:!0})],b.prototype,"type",void 0),t([o({...d,json:{default:"baseline",write:!0}})],b.prototype,"verticalAlignment",void 0),t([o(a)],b.prototype,"occludedVisibility",void 0),b=g=t([i("esri.symbols.TextSymbol3DLayer")],b);export{b as default};
2
+ import{__decorate as t}from"tslib";import{clone as o}from"../core/lang.js";import{property as e,subclass as i}from"../core/accessorSupport/decorators.js";import r from"./Font.js";import l from"./Symbol3DLayer.js";import{screenSizeProperty as n}from"./support/materialUtils.js";import s from"./support/OccludedVisibility.js";import{occludedVisibilityProperty as u}from"./support/occludedVisibilityUtils.js";import p from"./support/Symbol3DHalo.js";import a from"./support/Symbol3DMaterial.js";import c from"./support/Symbol3DTextBackground.js";import m from"./support/Symbol3DTextBorder.js";import{horizontalAlignmentProperty as h,lineHeightProperty as d,verticalAlignmentProperty as y}from"./support/textUtils.js";import{writer as f}from"../core/accessorSupport/decorators/writer.js";import{enumeration as b}from"../core/accessorSupport/decorators/enumeration.js";var g;let z=class extends l{static{g=this}constructor(t){super(t),this._userSize=void 0,this.halo=null,this.horizontalAlignment="center",this.lineHeight=1,this.material=null,this.background=null,this.border=null,this.text=null,this.type="text",this.verticalAlignment="baseline",this.occludedVisibility=new s({mode:"adaptive"})}get font(){return this._get("font")||null}set font(t){null!=t&&null!=this._userSize&&(t.size=this._userSize),this._set("font",t)}writeFont(t,o,e,i){const r={...i,textSymbol3D:!0};o.font=t.write({},r),delete o.font.size}get size(){return null!=this._userSize?this._userSize:null!=this.font?.size?this.font.size:9}set size(t){this._userSize=Number(t),null!=this.font&&(this.font.size=this._userSize),this.notifyChange("size")}clone(){const t=new g({enabled:this.enabled,font:o(this.font),halo:o(this.halo),horizontalAlignment:this.horizontalAlignment,lineHeight:this.lineHeight,material:null!=this.material?this.material.clone():null,text:this.text,verticalAlignment:this.verticalAlignment,background:o(this.background),border:o(this.border),occludedVisibility:o(this.occludedVisibility)});return t._userSize=this._userSize,t}static fromTextSymbol(t){return new g({font:null!=t.font?t.font.clone():new r,halo:j(t.haloColor,t.haloSize),horizontalAlignment:t.horizontalAlignment,lineHeight:t.lineHeight,material:t.color?new a({color:t.color.clone()}):null,text:t.text,verticalAlignment:t.verticalAlignment,background:t.backgroundColor?new c({color:t.backgroundColor.clone()}):null,border:S(t.borderLineColor,t.borderLineSize),occludedVisibility:null})}};function j(t,e){return t&&null!=e&&e>0?new p({color:o(t),size:e}):null}function S(t,e){return null!=t&&null!=e&&e>0?new m({color:o(t),size:e}):null}t([e({type:r,json:{write:!0}})],z.prototype,"font",null),t([f("font")],z.prototype,"writeFont",null),t([e({type:p,json:{write:!0}})],z.prototype,"halo",void 0),t([e({...h,json:{default:"center",write:!0}})],z.prototype,"horizontalAlignment",void 0),t([e({...d,json:{default:1,write:!0}})],z.prototype,"lineHeight",void 0),t([e({type:a,json:{write:!0}})],z.prototype,"material",void 0),t([e({type:c,json:{write:!0}})],z.prototype,"background",void 0),t([e({type:m,json:{read:!1,write:!1}})],z.prototype,"border",void 0),t([e(n)],z.prototype,"size",null),t([e({type:String,json:{write:!0}})],z.prototype,"text",void 0),t([b({Text:"text"},{readOnly:!0})],z.prototype,"type",void 0),t([e({...y,json:{default:"baseline",write:!0}})],z.prototype,"verticalAlignment",void 0),t([e(u)],z.prototype,"occludedVisibility",void 0),z=g=t([i("esri.symbols.TextSymbol3DLayer")],z);export{z as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{pt2px as e}from"../../core/screenUtils.js";import{backgroundPadding as t}from"../support/textUtils.js";function i(e){return`rgb(${e.slice(0,3).toString()})`}function n(e){return`rgba(${e.slice(0,3).toString()},${e[3]})`}class r{constructor(e){e&&(this._textRasterizationCanvas=e)}rasterizeRichText(e,r){this._textRasterizationCanvas||(this._textRasterizationCanvas=document.createElement("canvas"));const h=this._textRasterizationCanvas,o=h.getContext("2d",{willReadFrequently:!0}),l=this._layoutRichTextRuns(o,e,r);this._parameters=r,this._lineHeight=Math.max(...l.map(e=>e.height),this._measureLineHeight(r));const{decoration:d,weight:c}=r.font;this._lineThroughWidthOffset=d&&"line-through"===d?.1*this._lineHeight:0;const _=null!=r.backgroundColor||null!=r.borderLine,g=_?t:0,u=Math.max(...l.map(e=>e.width),0)+2*g,f=l.reduce((e,t)=>e+t.height,0)+2*g;if(h.width=u+2*this._lineThroughWidthOffset,h.height=f,0===h.width||0===h.height)return h.width=h.height=1,{size:[0,0],image:new Uint32Array(0),sdf:!1,simplePattern:!1,anchorX:0,anchorY:0,canvas:h};this._renderedWidth=u,this._renderedHeight=f,this._renderedOutlineSize=(r.outline.size||0)*r.pixelRatio,this._renderedHaloSize=(r.halo.size||0)*r.pixelRatio,this._lineThroughWidthOffset*=r.pixelRatio;const m=(r.outline&&r.outline.color)??[0,0,0,0],p=r.color??[0,0,0,0],x=r.halo&&r.halo.color?r.halo.color:[0,0,0,0];this._fillStyle=n(p),this._outlineStyle=n(m),this._haloStyle=i(x);const z=this._renderedOutlineSize,S=this._renderedHaloSize;o.save(),o.clearRect(0,0,h.width,h.height);const R=g*r.pixelRatio,w=a("left",this._renderedWidth-2*R,S+z)+R,y=S+z+R;let b=this._lineThroughWidthOffset,v=0;if(_){o.save();const e=r.backgroundColor??[0,0,0,0],t=r.borderLine?.color??[0,0,0,0],i=2*(r.borderLine?.size??0);o.fillStyle=n(e),o.strokeStyle=n(t),o.lineWidth=i,o.fillRect(0,0,h.width,h.height),o.strokeRect(0,0,h.width,h.height),o.restore()}v+=y,b+=w,S>0&&this._renderRichTextOutline(o,l,b,v,r,this._renderedHaloSize+this._renderedOutlineSize),z>0&&this._renderRichTextOutline(o,l,b,v,r,this._renderedOutlineSize);for(const t of l){let e=b;"center"===r.horizontalAlignment?e+=(this._renderedWidth-2*R-t.width)/2:"right"===r.horizontalAlignment&&(e+=this._renderedWidth-2*R-t.width-S-z);let i=e;for(const r of t.segments)s(o,r.parameters,"left",r.characterSpacing),S>0&&(o.globalCompositeOperation="destination-out",o.fillStyle="rgb(0, 0, 0)",this._renderRichTextSegment(o,r,i,v,"fill"),o.globalCompositeOperation="source-over"),o.fillStyle=n(r.parameters.color??p),this._renderRichTextSegment(o,r,i,v,"fill"),i+=r.width;if(d&&"none"!==d){const i=this._renderedWidth;this._renderedWidth=t.width,o.textAlign="left",this._renderDecoration(o,e,v,d,c),this._renderedWidth=i}v+=t.height}o.restore();const W=this._renderedWidth+2*this._lineThroughWidthOffset,C=this._renderedHeight,T=o.getImageData(0,0,W,C),H=new Uint8Array(T.data);if(r.premultiplyColors){let e;for(let t=0;t<H.length;t+=4)e=H[t+3]/255,H[t]=H[t]*e,H[t+1]=H[t+1]*e,H[t+2]=H[t+2]*e}let O,k;switch(r.horizontalAlignment){case"left":O=-.5;break;case"right":O=.5;break;default:O=0}switch(r.verticalAlignment){case"bottom":k=-.5;break;case"top":k=.5;break;case"baseline":k=-1/6;break;default:k=0}return{size:[W,C],image:new Uint32Array(H.buffer),sdf:!1,simplePattern:!1,anchorX:O,anchorY:k,canvas:h}}rasterizeText(e,r){this._textRasterizationCanvas||(this._textRasterizationCanvas=document.createElement("canvas"));const h=this._textRasterizationCanvas,o=h.getContext("2d",{willReadFrequently:!0});s(o,r),this._parameters=r,this._textLines=e.split(/\r?\n/),this._lineHeight=this._computeLineHeight();const{decoration:l,weight:d}=r.font;this._lineThroughWidthOffset=l&&"line-through"===l?.1*this._lineHeight:0;const c=null!=r.backgroundColor||null!=r.borderLine,_=c?t:0,g=this._computeTextWidth(o,r)+2*_,u=this._lineHeight*this._textLines.length+2*_;if(h.width=g+2*this._lineThroughWidthOffset,h.height=u,0===h.width||0===h.height)return h.width=h.height=1,{size:[0,0],image:new Uint32Array(0),sdf:!1,simplePattern:!1,anchorX:0,anchorY:0,canvas:h};this._renderedLineHeight=Math.round(this._lineHeight),this._renderedOutlineSize=(r.outline.size||0)*r.pixelRatio,this._renderedHaloSize=(r.halo.size||0)*r.pixelRatio,this._renderedWidth=g,this._renderedHeight=u,this._lineThroughWidthOffset*=r.pixelRatio;const f=(r.outline&&r.outline.color)??[0,0,0,0],m=r.color??[0,0,0,0],p=r.halo&&r.halo.color?r.halo.color:[0,0,0,0];this._fillStyle=n(m),this._outlineStyle=n(f),this._haloStyle=i(p);const x=this._renderedLineHeight,z=this._renderedOutlineSize,S=this._renderedHaloSize;o.save(),o.clearRect(0,0,h.width,h.height),s(o,r);const R=_*r.pixelRatio,w=a(o.textAlign,this._renderedWidth-2*R,this._renderedHaloSize+this._renderedOutlineSize)+R,y=S+z+R,b=S>0;let v=this._lineThroughWidthOffset,W=0;if(c){o.save();const e=r.backgroundColor??[0,0,0,0],t=r.borderLine?.color??[0,0,0,0],i=2*(r.borderLine?.size??0);o.fillStyle=n(e),o.strokeStyle=n(t),o.lineWidth=i,o.fillRect(0,0,h.width,h.height),o.strokeRect(0,0,h.width,h.height),o.restore()}b&&this._renderHalo(o,w,y,v,W,r),z>0&&this._renderOutline(o,w,y,v,W,r),W+=y,v+=w;for(const t of this._textLines)b?(o.globalCompositeOperation="destination-out",o.fillStyle="rgb(0, 0, 0)",o.fillText(t,v,W),o.globalCompositeOperation="source-over",o.fillStyle=this._fillStyle,o.fillText(t,v,W)):(o.fillStyle=this._fillStyle,o.fillText(t,v,W)),l&&"none"!==l&&this._renderDecoration(o,v,W,l,d),W+=x;o.restore();const C=this._renderedWidth+2*this._lineThroughWidthOffset,T=this._renderedHeight,H=o.getImageData(0,0,C,T),O=new Uint8Array(H.data);if(r.premultiplyColors){let e;for(let t=0;t<O.length;t+=4)e=O[t+3]/255,O[t]=O[t]*e,O[t+1]=O[t+1]*e,O[t+2]=O[t+2]*e}let k,L;switch(r.horizontalAlignment){case"left":k=-.5;break;case"right":k=.5;break;default:k=0}switch(r.verticalAlignment){case"bottom":L=-.5;break;case"top":L=.5;break;case"baseline":L=-1/6;break;default:L=0}return{size:[C,T],image:new Uint32Array(O.buffer),sdf:!1,simplePattern:!1,anchorX:k,anchorY:L,canvas:h}}_renderHalo(e,t,i,n,r,h){const o=this._renderedWidth,a=this._renderedHeight;this._outlineRasterizationCanvas||(this._outlineRasterizationCanvas=document.createElement("canvas")),this._outlineRasterizationCanvas.width=o,this._outlineRasterizationCanvas.height=a;const l=this._outlineRasterizationCanvas,d=l.getContext("2d");d.clearRect(0,0,o,a),s(d,h);const{decoration:c,weight:_}=h.font;d.fillStyle=this._haloStyle,d.strokeStyle=this._haloStyle,d.lineJoin="round",this._renderOutlineNative(d,t,i,c,_,this._renderedHaloSize+this._renderedOutlineSize),e.globalAlpha=this._parameters.halo.color[3],e.drawImage(l,0,0,o,a,n,r,o,a),e.globalAlpha=1}_renderOutline(e,t,i,n,r,h){const o=this._renderedWidth,a=this._renderedHeight;this._outlineRasterizationCanvas||(this._outlineRasterizationCanvas=document.createElement("canvas")),this._outlineRasterizationCanvas.width=o,this._outlineRasterizationCanvas.height=a;const l=this._outlineRasterizationCanvas,d=l.getContext("2d");d.clearRect(0,0,o,a),s(d,h);const{decoration:c,weight:_}=h.font;d.fillStyle=this._outlineStyle,d.strokeStyle=this._outlineStyle,d.lineJoin="round",this._renderOutlineNative(d,t,i,c,_,this._renderedOutlineSize),e.globalAlpha=this._parameters.outline.color[3],e.drawImage(l,0,0,o,a,n,r,o,a),e.globalAlpha=1}_renderOutlineNative(e,t,i,n,r,s){const h=this._renderedLineHeight;for(const o of this._textLines){const a=2*s,l=5,d=.1;for(let s=0;s<l;s++){const h=(1-(l-1)*d+s*d)*a;e.lineWidth=h,e.strokeText(o,t,i),n&&"none"!==n&&this._renderDecoration(e,t,i,n,r,h)}i+=h}}computeTextSize(e,t){this._textRasterizationCanvas||(this._textRasterizationCanvas=document.createElement("canvas"));const i=this._textRasterizationCanvas,n=i.getContext("2d");s(n,t),this._parameters=t,this._textLines=e.split(/\r?\n/),this._lineHeight=this._computeLineHeight();const r=this._computeTextWidth(n,t),h=this._lineHeight*this._textLines.length;return i.width=r,i.height=h,[r*t.pixelRatio,h*t.pixelRatio]}computeRichTextSize(e,t){this._textRasterizationCanvas||(this._textRasterizationCanvas=document.createElement("canvas"));const i=this._textRasterizationCanvas.getContext("2d"),n=this._layoutRichTextRuns(i,e,t),r=Math.max(...n.map(e=>e.width),0),s=n.reduce((e,t)=>e+t.height,0);return[r*t.pixelRatio,s*t.pixelRatio]}_renderRichTextOutline(e,t,i,n,r,h){const o=this._renderedWidth,a=this._renderedHeight;this._outlineRasterizationCanvas||(this._outlineRasterizationCanvas=document.createElement("canvas")),this._outlineRasterizationCanvas.width=o,this._outlineRasterizationCanvas.height=a;const l=this._outlineRasterizationCanvas,d=l.getContext("2d");d.clearRect(0,0,o,a),d.fillStyle=h===this._renderedOutlineSize?this._outlineStyle:this._haloStyle,d.strokeStyle=d.fillStyle,d.lineJoin="round";let c=n;for(const _ of t){let e=i;"center"===r.horizontalAlignment?e+=(this._renderedWidth-_.width)/2:"right"===r.horizontalAlignment&&(e+=this._renderedWidth-_.width-this._renderedHaloSize-this._renderedOutlineSize);let t=e;for(const i of _.segments){s(d,i.parameters,"left",i.characterSpacing);const e=2*h,n=5,r=.1;for(let s=0;s<n;s++){const h=1-(n-1)*r+s*r;d.lineWidth=h*e,this._renderRichTextSegment(d,i,t,c,"stroke")}t+=i.width}if(r.font.decoration&&"none"!==r.font.decoration){const t=this._renderedWidth;this._renderedWidth=_.width,d.textAlign="left",this._renderDecoration(d,e,c,r.font.decoration,r.font.weight,2*h),this._renderedWidth=t}c+=_.height}h===this._renderedOutlineSize?e.globalAlpha=this._parameters.outline.color[3]:e.globalAlpha=this._parameters.halo.color[3],e.drawImage(l,0,0,o,a,this._lineThroughWidthOffset,0,o,a),e.globalAlpha=1}_layoutRichTextRuns(e,t,i){const n=[{segments:[],width:0,height:this._measureLineHeight(i)}];for(const r of t){const t=r.text.split(/\r?\n/),s=o(i,r);for(let h=0;h<t.length;h++){const o=t[h],a=n[n.length-1];if(o.length>0){const t=this._measureRichTextSegmentWidth(e,o,s,r.characterSpacing);a.segments.push({text:o,width:t,parameters:s,characterSpacing:r.characterSpacing}),a.width+=t,a.height=Math.max(a.height,this._measureLineHeight(s))}h<t.length-1&&n.push({segments:[],width:0,height:this._measureLineHeight(i)})}}return n}_measureTextWidthWithSpacing(e,t,i,n){const r=this._parameters,h=this._textLines;this._parameters=i,this._textLines=[t],s(e,i,"left",n);const o=this._computeTextWidth(e,i);return this._parameters=r,this._textLines=h,o}_measureRichTextSegmentWidth(e,t,i,n){return this._measureTextWidthWithSpacing(e,t,i,n)}_renderRichTextSegment(e,t,i,n,r){"fill"===r?e.fillText(t.text,i,n):e.strokeText(t.text,i,n)}_measureLineHeight(e){const t=this._parameters;this._parameters=e;const i=this._computeLineHeight();return this._parameters=t,i}_computeTextWidth(t,i){let n=0;for(const e of this._textLines)n=Math.max(n,t.measureText(e).width);const r=i.font;return("italic"===r.style||"oblique"===r.style||"string"==typeof r.weight&&("bold"===r.weight||"bolder"===r.weight)||"number"==typeof r.weight&&r.weight>600)&&(n+=.3*t.measureText("w").width),n+=2*e(this._parameters.halo.size),Math.round(n)}_computeLineHeightBase(){return 1.275*this._parameters.size}_computeLineHeight(){let t=this._computeLineHeightBase();const i=this._parameters.font.decoration;return i&&"underline"===i&&(t*=1.3),Math.round(t+2*e(this._parameters.halo.size))}_renderDecoration(e,t,i,n,r,s){let h=.9*this._lineHeight;const o="bold"===r?.06:"bolder"===r?.09:.04;switch(e.textAlign){case"center":t-=this._renderedWidth/2;break;case"right":t-=this._renderedWidth}const a=e.textBaseline;if("underline"===n)switch(h=.9*this._computeLineHeightBase(),a){case"top":i+=h;break;case"middle":i+=h/2}else if("line-through"===n)switch(a){case"top":i+=h/1.5;break;case"middle":i+=h/3}const l=s?1.5*s:Math.ceil(h*o);e.save(),e.beginPath(),e.strokeStyle=e.fillStyle,e.lineWidth=l,e.moveTo(t-this._lineThroughWidthOffset,i),e.lineTo(t+this._renderedWidth+2*this._lineThroughWidthOffset,i),e.stroke(),e.restore()}}function s(t,i,n,r=0){const s=Math.max(i.size,.5),o=i.font,a=`${o.style} ${o.weight} ${e(s).toFixed(1)}px ${o.family}, sans-serif`;t.font=a,t.textBaseline="top",h(t,r);let l=n??"left";if(!n)switch(i.horizontalAlignment){case"left":default:l="left";break;case"right":l="right";break;case"center":l="center"}t.textAlign=l}function h(e,t){e.letterSpacing=t>0?`${t}em`:"0px"}function o(e,t){return{...e,color:t.color??e.color,font:{...e.font,family:t.font.family??e.font.family,style:t.font.style??e.font.style,weight:t.font.weight??e.font.weight},size:t.fontSize}}function a(e,t,i){return"center"===e?.5*t:"right"===e?t-i:i}export{r as default};
2
+ import{pt2px as e}from"../../core/screenUtils.js";import{backgroundPadding as t}from"../support/textUtils.js";function i(e){return`rgb(${e.slice(0,3).toString()})`}function n(e){return`rgba(${e.slice(0,3).toString()},${e[3]})`}const r=2;function s(t){return"underline"===t?e(r):0}class h{constructor(e){e&&(this._textRasterizationCanvas=e)}rasterizeRichText(e,r){this._textRasterizationCanvas||(this._textRasterizationCanvas=document.createElement("canvas"));const s=this._textRasterizationCanvas,h=s.getContext("2d",{willReadFrequently:!0}),a=this._layoutRichTextRuns(h,e,r);this._parameters=r;const{decoration:l,weight:_}=r.font,g="underline"===l?"none":l,u=g===l?r:d(r,g);this._lineHeight=Math.max(...a.map(e=>e.height),this._measureLineHeight(u)),this._lineThroughWidthOffset="line-through"===g?.1*this._lineHeight:0;const f=null!=r.backgroundColor||null!=r.borderLine,m=f?t:0,p=Math.max(...a.map(e=>e.width),0)+2*m,x=a.reduce((e,t)=>e+t.height,0)+2*m;if(s.width=p+2*this._lineThroughWidthOffset,s.height=x,0===s.width||0===s.height)return s.width=s.height=1,{size:[0,0],image:new Uint32Array(0),sdf:!1,simplePattern:!1,anchorX:0,anchorY:0,canvas:s};this._renderedWidth=p,this._renderedHeight=x,this._renderedOutlineSize=(r.outline.size||0)*r.pixelRatio,this._renderedHaloSize=(r.halo.size||0)*r.pixelRatio,this._lineThroughWidthOffset*=r.pixelRatio;const z=(r.outline&&r.outline.color)??[0,0,0,0],w=r.color??[0,0,0,0],S=r.halo&&r.halo.color?r.halo.color:[0,0,0,0];this._fillStyle=n(w),this._outlineStyle=n(z),this._haloStyle=i(S);const R=this._renderedOutlineSize,y=this._renderedHaloSize;h.save(),h.clearRect(0,0,s.width,s.height);const W=m*r.pixelRatio,b=c("left",this._renderedWidth-2*W,y+R)+W,v=y+R+W;let C=this._lineThroughWidthOffset,T=0;if(f){h.save();const e=r.backgroundColor??[0,0,0,0],t=r.borderLine?.color??[0,0,0,0],i=2*(r.borderLine?.size??0);h.fillStyle=n(e),h.strokeStyle=n(t),h.lineWidth=i,h.fillRect(0,0,s.width,s.height),h.strokeRect(0,0,s.width,s.height),h.restore()}T+=v,C+=b,y>0&&this._renderRichTextOutline(h,a,C,T,r,this._renderedHaloSize+this._renderedOutlineSize),R>0&&this._renderRichTextOutline(h,a,C,T,r,this._renderedOutlineSize);for(const t of a){let e=C;"center"===r.horizontalAlignment?e+=(this._renderedWidth-2*W-t.width)/2:"right"===r.horizontalAlignment&&(e+=this._renderedWidth-2*W-t.width-y-R);let i=e;for(const r of t.segments)o(h,r.parameters,"left",r.characterSpacing),y>0&&(h.globalCompositeOperation="destination-out",h.fillStyle="rgb(0, 0, 0)",this._renderRichTextSegment(h,r,i,T,"fill"),h.globalCompositeOperation="source-over"),h.fillStyle=n(r.parameters.color??w),this._renderRichTextSegment(h,r,i,T,"fill"),i+=r.width;for(const n of t.segments){if("underline"!==n.decoration)continue;const t=this._renderedWidth;this._renderedWidth=n.width,h.textAlign="left",this._renderDecoration(h,e+n.x,T,n.decoration,n.parameters.font.weight,void 0,n.parameters),this._renderedWidth=t}if(g&&"none"!==g){const i=this._renderedWidth;this._renderedWidth=t.width,h.textAlign="left",this._renderDecoration(h,e,T,g,_),this._renderedWidth=i}T+=t.height}h.restore();const H=this._renderedWidth+2*this._lineThroughWidthOffset,O=this._renderedHeight,k=h.getImageData(0,0,H,O),L=new Uint8Array(k.data);if(r.premultiplyColors){let e;for(let t=0;t<L.length;t+=4)e=L[t+3]/255,L[t]=L[t]*e,L[t+1]=L[t+1]*e,L[t+2]=L[t+2]*e}let A,M;switch(r.horizontalAlignment){case"left":A=-.5;break;case"right":A=.5;break;default:A=0}switch(r.verticalAlignment){case"bottom":M=-.5;break;case"top":M=.5;break;case"baseline":M=-1/6;break;default:M=0}return{size:[H,O],image:new Uint32Array(L.buffer),sdf:!1,simplePattern:!1,anchorX:A,anchorY:M,canvas:s}}rasterizeText(e,r){this._textRasterizationCanvas||(this._textRasterizationCanvas=document.createElement("canvas"));const s=this._textRasterizationCanvas,h=s.getContext("2d",{willReadFrequently:!0});o(h,r),this._parameters=r,this._textLines=e.split(/\r?\n/),this._lineHeight=this._computeLineHeight();const{decoration:a,weight:l}=r.font;this._lineThroughWidthOffset=a&&"line-through"===a?.1*this._lineHeight:0;const d=null!=r.backgroundColor||null!=r.borderLine,_=d?t:0,g=this._computeTextWidth(h,r)+2*_,u=this._lineHeight*this._textLines.length+2*_;if(s.width=g+2*this._lineThroughWidthOffset,s.height=u,0===s.width||0===s.height)return s.width=s.height=1,{size:[0,0],image:new Uint32Array(0),sdf:!1,simplePattern:!1,anchorX:0,anchorY:0,canvas:s};this._renderedLineHeight=Math.round(this._lineHeight),this._renderedOutlineSize=(r.outline.size||0)*r.pixelRatio,this._renderedHaloSize=(r.halo.size||0)*r.pixelRatio,this._renderedWidth=g,this._renderedHeight=u,this._lineThroughWidthOffset*=r.pixelRatio;const f=(r.outline&&r.outline.color)??[0,0,0,0],m=r.color??[0,0,0,0],p=r.halo&&r.halo.color?r.halo.color:[0,0,0,0];this._fillStyle=n(m),this._outlineStyle=n(f),this._haloStyle=i(p);const x=this._renderedLineHeight,z=this._renderedOutlineSize,w=this._renderedHaloSize;h.save(),h.clearRect(0,0,s.width,s.height),o(h,r);const S=_*r.pixelRatio,R=c(h.textAlign,this._renderedWidth-2*S,this._renderedHaloSize+this._renderedOutlineSize)+S,y=w+z+S,W=w>0;let b=this._lineThroughWidthOffset,v=0;if(d){h.save();const e=r.backgroundColor??[0,0,0,0],t=r.borderLine?.color??[0,0,0,0],i=2*(r.borderLine?.size??0);h.fillStyle=n(e),h.strokeStyle=n(t),h.lineWidth=i,h.fillRect(0,0,s.width,s.height),h.strokeRect(0,0,s.width,s.height),h.restore()}W&&this._renderHalo(h,R,y,b,v,r),z>0&&this._renderOutline(h,R,y,b,v,r),v+=y,b+=R;for(const t of this._textLines)W?(h.globalCompositeOperation="destination-out",h.fillStyle="rgb(0, 0, 0)",h.fillText(t,b,v),h.globalCompositeOperation="source-over",h.fillStyle=this._fillStyle,h.fillText(t,b,v)):(h.fillStyle=this._fillStyle,h.fillText(t,b,v)),a&&"none"!==a&&this._renderDecoration(h,b,v,a,l),v+=x;h.restore();const C=this._renderedWidth+2*this._lineThroughWidthOffset,T=this._renderedHeight,H=h.getImageData(0,0,C,T),O=new Uint8Array(H.data);if(r.premultiplyColors){let e;for(let t=0;t<O.length;t+=4)e=O[t+3]/255,O[t]=O[t]*e,O[t+1]=O[t+1]*e,O[t+2]=O[t+2]*e}let k,L;switch(r.horizontalAlignment){case"left":k=-.5;break;case"right":k=.5;break;default:k=0}switch(r.verticalAlignment){case"bottom":L=-.5;break;case"top":L=.5;break;case"baseline":L=-1/6;break;default:L=0}return{size:[C,T],image:new Uint32Array(O.buffer),sdf:!1,simplePattern:!1,anchorX:k,anchorY:L,canvas:s}}_renderHalo(e,t,i,n,r,s){const h=this._renderedWidth,a=this._renderedHeight;this._outlineRasterizationCanvas||(this._outlineRasterizationCanvas=document.createElement("canvas")),this._outlineRasterizationCanvas.width=h,this._outlineRasterizationCanvas.height=a;const l=this._outlineRasterizationCanvas,d=l.getContext("2d");d.clearRect(0,0,h,a),o(d,s);const{decoration:c,weight:_}=s.font;d.fillStyle=this._haloStyle,d.strokeStyle=this._haloStyle,d.lineJoin="round",this._renderOutlineNative(d,t,i,c,_,this._renderedHaloSize+this._renderedOutlineSize),e.globalAlpha=this._parameters.halo.color[3],e.drawImage(l,0,0,h,a,n,r,h,a),e.globalAlpha=1}_renderOutline(e,t,i,n,r,s){const h=this._renderedWidth,a=this._renderedHeight;this._outlineRasterizationCanvas||(this._outlineRasterizationCanvas=document.createElement("canvas")),this._outlineRasterizationCanvas.width=h,this._outlineRasterizationCanvas.height=a;const l=this._outlineRasterizationCanvas,d=l.getContext("2d");d.clearRect(0,0,h,a),o(d,s);const{decoration:c,weight:_}=s.font;d.fillStyle=this._outlineStyle,d.strokeStyle=this._outlineStyle,d.lineJoin="round",this._renderOutlineNative(d,t,i,c,_,this._renderedOutlineSize),e.globalAlpha=this._parameters.outline.color[3],e.drawImage(l,0,0,h,a,n,r,h,a),e.globalAlpha=1}_renderOutlineNative(e,t,i,n,r,s){const h=this._renderedLineHeight;for(const o of this._textLines){const a=2*s,l=5,d=.1;for(let s=0;s<l;s++){const h=(1-(l-1)*d+s*d)*a;e.lineWidth=h,e.strokeText(o,t,i),n&&"none"!==n&&this._renderDecoration(e,t,i,n,r,h)}i+=h}}computeTextSize(e,t){this._textRasterizationCanvas||(this._textRasterizationCanvas=document.createElement("canvas"));const i=this._textRasterizationCanvas,n=i.getContext("2d");o(n,t),this._parameters=t,this._textLines=e.split(/\r?\n/),this._lineHeight=this._computeLineHeight();const r=this._computeTextWidth(n,t),s=this._lineHeight*this._textLines.length;return i.width=r,i.height=s,[r*t.pixelRatio,s*t.pixelRatio]}computeRichTextSize(e,t){this._textRasterizationCanvas||(this._textRasterizationCanvas=document.createElement("canvas"));const i=this._textRasterizationCanvas.getContext("2d"),n=this._layoutRichTextRuns(i,e,t),r=Math.max(...n.map(e=>e.width),0),s=n.reduce((e,t)=>e+t.height,0);return[r*t.pixelRatio,s*t.pixelRatio]}_renderRichTextOutline(e,t,i,n,r,s){const h=this._renderedWidth,a=this._renderedHeight;this._outlineRasterizationCanvas||(this._outlineRasterizationCanvas=document.createElement("canvas")),this._outlineRasterizationCanvas.width=h,this._outlineRasterizationCanvas.height=a;const l=this._outlineRasterizationCanvas,d=l.getContext("2d");d.clearRect(0,0,h,a),d.fillStyle=s===this._renderedOutlineSize?this._outlineStyle:this._haloStyle,d.strokeStyle=d.fillStyle,d.lineJoin="round";let c=n;for(const _ of t){let e=i;"center"===r.horizontalAlignment?e+=(this._renderedWidth-_.width)/2:"right"===r.horizontalAlignment&&(e+=this._renderedWidth-_.width-this._renderedHaloSize-this._renderedOutlineSize);let t=e;for(const i of _.segments){o(d,i.parameters,"left",i.characterSpacing);const e=2*s,n=5,r=.1;for(let s=0;s<n;s++){const h=1-(n-1)*r+s*r;d.lineWidth=h*e,this._renderRichTextSegment(d,i,t,c,"stroke")}t+=i.width}for(const i of _.segments){if("underline"!==i.decoration)continue;const t=this._renderedWidth;this._renderedWidth=i.width,d.textAlign="left",this._renderDecoration(d,e+i.x,c,i.decoration,i.parameters.font.weight,2*s,i.parameters),this._renderedWidth=t}const n="underline"===r.font.decoration?"none":r.font.decoration;if(n&&"none"!==n){const t=this._renderedWidth;this._renderedWidth=_.width,d.textAlign="left",this._renderDecoration(d,e,c,n,r.font.weight,2*s),this._renderedWidth=t}c+=_.height}s===this._renderedOutlineSize?e.globalAlpha=this._parameters.outline.color[3]:e.globalAlpha=this._parameters.halo.color[3],e.drawImage(l,0,0,h,a,this._lineThroughWidthOffset,0,h,a),e.globalAlpha=1}_layoutRichTextRuns(e,t,i){const n="underline"===i.font.decoration?d(i,"none"):i,r=[{segments:[],width:0,height:this._measureLineHeight(n)}];for(const s of t){const t=s.text.split(/\r?\n/),h=l(i,s);for(let i=0;i<t.length;i++){const o=t[i],a=r[r.length-1];if(o.length>0){const t=this._measureRichTextSegmentWidth(e,o,h,s.characterSpacing);a.segments.push({text:o,width:t,x:a.width,parameters:h,characterSpacing:s.characterSpacing,decoration:h.font.decoration}),a.width+=t,a.height=Math.max(a.height,this._measureLineHeight(h))}i<t.length-1&&r.push({segments:[],width:0,height:this._measureLineHeight(n)})}}return r}_measureTextWidthWithSpacing(e,t,i,n){const r=this._parameters,s=this._textLines;this._parameters=i,this._textLines=[t],o(e,i,"left",n);const h=this._computeTextWidth(e,i);return this._parameters=r,this._textLines=s,h}_measureRichTextSegmentWidth(e,t,i,n){return this._measureTextWidthWithSpacing(e,t,i,n)}_renderRichTextSegment(e,t,i,n,r){"fill"===r?e.fillText(t.text,i,n):e.strokeText(t.text,i,n)}_measureLineHeight(e){const t=this._parameters;this._parameters=e;const i=this._computeLineHeight();return this._parameters=t,i}_computeTextWidth(t,i){let n=0;for(const e of this._textLines)n=Math.max(n,t.measureText(e).width);const r=i.font;return("italic"===r.style||"oblique"===r.style||"string"==typeof r.weight&&("bold"===r.weight||"bolder"===r.weight)||"number"==typeof r.weight&&r.weight>600)&&(n+=.3*t.measureText("w").width),n+=2*e(this._parameters.halo.size),Math.round(n)}_computeLineHeightBase(e=this._parameters){return 1.275*e.size}_computeLineHeight(){let t=this._computeLineHeightBase();const i=this._parameters.font.decoration;return i&&"underline"===i&&(t*=1.3),Math.round(t+2*e(this._parameters.halo.size))}_renderDecoration(e,t,i,n,r,h,o=this._parameters){let a=.9*this._lineHeight;const l="bold"===r?.06:"bolder"===r?.09:.04;switch(e.textAlign){case"center":t-=this._renderedWidth/2;break;case"right":t-=this._renderedWidth}const d=e.textBaseline,c=s(n);if("underline"===n)switch(a=.9*this._computeLineHeightBase(o),d){case"top":i+=a+c;break;case"middle":i+=a/2+c}else if("line-through"===n)switch(d){case"top":i+=a/1.5;break;case"middle":i+=a/3}const _=h?1.5*h:Math.ceil(a*l);e.save(),e.beginPath(),e.strokeStyle=e.fillStyle,e.lineWidth=_,e.moveTo(t-this._lineThroughWidthOffset,i),e.lineTo(t+this._renderedWidth+2*this._lineThroughWidthOffset,i),e.stroke(),e.restore()}}function o(t,i,n,r=0){const s=Math.max(i.size,.5),h=i.font,o=`${h.style} ${h.weight} ${e(s).toFixed(1)}px ${h.family}, sans-serif`;t.font=o,t.textBaseline="top",a(t,r);let l=n??"left";if(!n)switch(i.horizontalAlignment){case"left":default:l="left";break;case"right":l="right";break;case"center":l="center"}t.textAlign=l}function a(e,t){e.letterSpacing=t>0?`${t}em`:"0px"}function l(e,t){return{...e,color:t.color??e.color,font:{...e.font,family:t.font.family??e.font.family,style:t.font.style??e.font.style,weight:t.font.weight??e.font.weight,decoration:t.font.decoration??e.font.decoration},size:t.fontSize}}function d(e,t){return{...e,font:{...e.font,decoration:t}}}function c(e,t,i){return"center"===e?.5*t:"right"===e?t-i:i}export{h as default};