@arcgis/core 5.0.0-next.8 → 5.0.0-next.9

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 (123) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/02e7359162cf974b41b6.js +1 -0
  3. package/assets/esri/core/workers/chunks/0f735b0dec173142f3b6.js +2 -0
  4. package/assets/esri/core/workers/chunks/{a8f998b8ec8c56150479.js.LICENSE.txt → 0f735b0dec173142f3b6.js.LICENSE.txt} +1 -1
  5. package/assets/esri/core/workers/chunks/{b708792c84620b73c847.js → 21293b0c6405a10ec7b6.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{a876d6159ca120c1567e.js → 28d1f2cf6aae547615c3.js} +1 -1
  7. package/assets/esri/core/workers/chunks/292daac70bb828e4923f.js +1 -0
  8. package/assets/esri/core/workers/chunks/31b6406960261da21dd4.js +1 -0
  9. package/assets/esri/core/workers/chunks/31dbe07047dc61303d7d.js +1 -0
  10. package/assets/esri/core/workers/chunks/{59d3cac32ad6dad941dc.js → 35c9b24e4430bd6c2b6b.js} +1 -1
  11. package/assets/esri/core/workers/chunks/3a457e718a901a45902e.js.LICENSE.txt +1 -1
  12. package/assets/esri/core/workers/chunks/4fb5f1c671892001a4fd.js +1 -0
  13. package/assets/esri/core/workers/chunks/{d88f2fe680b8d5603ef8.js → 5350d50b47b6a4e0e169.js} +1 -1
  14. package/assets/esri/core/workers/chunks/58e59ead33368ce38c8f.js +1 -0
  15. package/assets/esri/core/workers/chunks/{aff8e40a641c6822af1d.js → 5db37547963857295273.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{3afb83f5de033dda89ec.js → 604777417722d4effe06.js} +1 -1
  17. package/assets/esri/core/workers/chunks/67f03d042455cd0f7009.js +1 -0
  18. package/assets/esri/core/workers/chunks/7565b382f6b3d2cb46a3.js +2 -0
  19. package/assets/esri/core/workers/chunks/{b96eb0ea506379182d62.js.LICENSE.txt → 7565b382f6b3d2cb46a3.js.LICENSE.txt} +1 -1
  20. package/assets/esri/core/workers/chunks/7d641f2f5edd95b9bc18.js +1 -0
  21. package/assets/esri/core/workers/chunks/812f2ccc01f44e3cfd41.js +1 -0
  22. package/assets/esri/core/workers/chunks/826fa0dfb63df77bfd95.js +1 -0
  23. package/assets/esri/core/workers/chunks/87921f3fa9001f5801ed.js +1 -0
  24. package/assets/esri/core/workers/chunks/{2a8dff8521e1e6a10cf6.js → 89b748e064ca90b4f76a.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{fef45bc59c71f88c60b5.js → 8d9d3797c6d62fdfff9d.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{e5a06ce0ef6a9a90e100.js → 9f21436016ff7a899e79.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{67d9cfe02613cb73ee37.js → 9ff8ee6ed6b98c03ae7e.js} +2 -2
  28. package/assets/esri/core/workers/chunks/{67d9cfe02613cb73ee37.js.LICENSE.txt → 9ff8ee6ed6b98c03ae7e.js.LICENSE.txt} +1 -1
  29. package/assets/esri/core/workers/chunks/aa78b69219d9a0ef1c54.js.LICENSE.txt +1 -1
  30. package/assets/esri/core/workers/chunks/b05208d56a724a8f1661.js +1 -0
  31. package/assets/esri/core/workers/chunks/{b0365cbc3d2a41969e3b.js → b7eb486354994dc70855.js} +1 -1
  32. package/assets/esri/core/workers/chunks/bc19a232076d98825eef.js +1 -0
  33. package/assets/esri/core/workers/chunks/c715fd32f814a0f14f40.js +1 -0
  34. package/assets/esri/core/workers/chunks/ce16489cf7eb0d78c741.js.LICENSE.txt +1 -1
  35. package/assets/esri/core/workers/chunks/cf971e7b1b98d9c502d3.js +1 -0
  36. package/assets/esri/core/workers/chunks/{20975513be0a3a1da286.js → d1ca7c3a32ce00ed8b81.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{b017bac40dc8328013e3.js → d391bfbaf0e790cd10d6.js} +2 -2
  38. package/assets/esri/core/workers/chunks/{b017bac40dc8328013e3.js.LICENSE.txt → d391bfbaf0e790cd10d6.js.LICENSE.txt} +1 -1
  39. package/assets/esri/core/workers/chunks/d6e0528eacee7ea4c1ce.js.LICENSE.txt +1 -1
  40. package/assets/esri/core/workers/chunks/db678a6e352275e507a9.js +1 -0
  41. package/assets/esri/core/workers/chunks/de2ebd9cc3d9e68d435b.js +1 -0
  42. package/assets/esri/core/workers/chunks/e599125e746c27de106e.js +1 -0
  43. package/assets/esri/core/workers/chunks/{05429f9d292a7a714309.js → ebcc94234d9d4be1941f.js} +1 -1
  44. package/assets/esri/core/workers/chunks/ee5f0fd5384caa11c986.js +1 -0
  45. package/assets/esri/core/workers/chunks/f651c05604eab83aef5f.js.LICENSE.txt +1 -1
  46. package/assets/esri/core/workers/chunks/f80f5dbf96c343ac4df6.js +1 -0
  47. package/assets/esri/core/workers/chunks/fccd931f95d81ecc57b2.js +1 -0
  48. package/assets/esri/themes/base/widgets/_NavigationToggle.scss +1 -1
  49. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +4 -4
  50. package/assets/esri/themes/base/widgets/_Widget.scss +1 -1
  51. package/assets/esri/themes/dark/main.css +1 -1
  52. package/assets/esri/themes/light/main.css +1 -1
  53. package/assets/esri/themes/light/view.css +1 -1
  54. package/config.js +1 -1
  55. package/form/FormTemplate.js +1 -1
  56. package/form/elements/Element.js +1 -1
  57. package/form/elements/FieldElement.js +1 -1
  58. package/form/elements/GroupElement.js +1 -1
  59. package/interfaces.d.ts +25 -23
  60. package/kernel.js +1 -1
  61. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  62. package/layers/knowledgeGraph/layerUtils.js +1 -1
  63. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  64. package/layers/support/RasterJobHandler.js +1 -1
  65. package/layers/support/RasterWorker.js +1 -1
  66. package/layers/support/rasterDatasets/pixelReader.js +1 -1
  67. package/layers/support/rasterFunctions/pixelTransformUtils.js +5 -0
  68. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  69. package/package.json +2 -2
  70. package/smartMapping/renderers/size.js +1 -1
  71. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  72. package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
  73. package/smartMapping/support/adapters/support/histogramUtils.js +1 -1
  74. package/smartMapping/support/adapters/support/utils.js +1 -1
  75. package/support/revision.js +1 -1
  76. package/symbols/support/utils.js +1 -1
  77. package/views/3d/GroundView3D.js +1 -1
  78. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  79. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  80. package/views/support/PromiseQueue.js +1 -1
  81. package/views/support/Scheduler.js +1 -1
  82. package/widgets/Editor/AddAssociationWorkflow.js +1 -1
  83. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  84. package/widgets/Editor/EditorViewModel.js +1 -1
  85. package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
  86. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  87. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  88. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  89. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  90. package/widgets/Editor/UpdateRecordWorkflowData.js +1 -1
  91. package/widgets/Editor/UpdateWorkflow.js +1 -1
  92. package/widgets/Editor/UpdateWorkflowData.js +1 -1
  93. package/widgets/Editor/support/SketchController.js +1 -1
  94. package/widgets/Editor/support/errors.js +5 -0
  95. package/widgets/Editor/workflowUtils.js +1 -1
  96. package/widgets/Editor.js +1 -1
  97. package/widgets/Legend/LegendViewModel.js +1 -1
  98. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  99. package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
  100. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  101. package/widgets/OrientedImageryViewer/services/DepthImageService.js +1 -1
  102. package/assets/esri/core/workers/chunks/06ba43843e9c4988049b.js +0 -1
  103. package/assets/esri/core/workers/chunks/1d15d1b20dc10fde6def.js +0 -1
  104. package/assets/esri/core/workers/chunks/28020063048e644f17a5.js +0 -1
  105. package/assets/esri/core/workers/chunks/36d067c8d03d7a894f5f.js +0 -1
  106. package/assets/esri/core/workers/chunks/38cc18fd93c18815ded0.js +0 -1
  107. package/assets/esri/core/workers/chunks/4eebd74ebc20579dade8.js +0 -1
  108. package/assets/esri/core/workers/chunks/5f402b3c00bc4afc77b2.js +0 -1
  109. package/assets/esri/core/workers/chunks/63a6f3e70d2b6ea57e40.js +0 -1
  110. package/assets/esri/core/workers/chunks/695cdef5057e5461078a.js +0 -1
  111. package/assets/esri/core/workers/chunks/6bb7dbc46787b8e34bd9.js +0 -1
  112. package/assets/esri/core/workers/chunks/6ee2f0f708494102a493.js +0 -1
  113. package/assets/esri/core/workers/chunks/78694ad8229347903f41.js +0 -1
  114. package/assets/esri/core/workers/chunks/90cbd627d4113db3b686.js +0 -1
  115. package/assets/esri/core/workers/chunks/a31635a6366347dcef0f.js +0 -1
  116. package/assets/esri/core/workers/chunks/a8f998b8ec8c56150479.js +0 -2
  117. package/assets/esri/core/workers/chunks/afc13d5b842275db7dbc.js +0 -1
  118. package/assets/esri/core/workers/chunks/b548910e820d731ffe8a.js +0 -1
  119. package/assets/esri/core/workers/chunks/b96eb0ea506379182d62.js +0 -2
  120. package/assets/esri/core/workers/chunks/c476643002387f60ea42.js +0 -1
  121. package/assets/esri/core/workers/chunks/ce98416437cc1a89d8ea.js +0 -1
  122. package/assets/esri/core/workers/chunks/e0bbfbe1ed39c82f1bd4.js +0 -1
  123. package/assets/esri/core/workers/chunks/ebf23b46db56aaa88841.js +0 -1
package/config.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.0.0-next.8";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
5
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.0.0-next.9";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{JSONSupport as t}from"../core/JSONSupport.js";import{clone as s}from"../core/lang.js";import{addMaybe as r,addMany as o}from"../core/SetUtils.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import{cast as n}from"../core/accessorSupport/decorators/cast.js";import{reader as l}from"../core/accessorSupport/decorators/reader.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import{writer as c}from"../core/accessorSupport/decorators/writer.js";import m from"./ExpressionInfo.js";import a from"./elements/GroupElement.js";import{ensureType as d,buildTypeMaps as f,fromJSON as u,toJSON as h,isTextElement as y,isGroupElement as j,isFieldElement as x}from"./support/formUtils.js";import{collectArcadeFieldNames as E,collectFields as w,extractSubstitutionTemplatesFromString as v,collectField as S}from"../layers/support/fieldUtils.js";var I;const b=f(a);let F=I=class extends t{constructor(e){super(e),this.description=null,this.elements=null,this.expressionInfos=null,this.preserveFieldValuesWhenHidden=!1,this.title=null}castElements(e){return d(e,b)}readElements(e,t){return u(t.formElements,b)}writeElements(e,t){t.formElements=h(e,b)}clone(){return new I({description:this.description,expressionInfos:s(this.expressionInfos),elements:s(this.elements),title:this.title,preserveFieldValuesWhenHidden:this.preserveFieldValuesWhenHidden})}async getFieldsUsed(e,t){const s=new Set,{description:r,elements:o,expressionInfos:i,title:n}=this;if(U(s,e,r),U(s,e,n),!o)return[];const l=k(o,i).map(t=>E(s,e,null,t));await Promise.all(l);for(const p of o)g(s,{fieldsIndex:e,relationships:t},p);return Array.from(s).sort()}};function g(e,t,s){const{fieldsIndex:r}=t;if(!r||r.fields.length!==e.size)switch(U(e,r,s.label),U(e,r,s.description),s.type){case"field":S(e,r,s.fieldName);break;case"group":s.elements.forEach(s=>g(e,t,s));break;case"relationship":if(t.relationships){const o=t.relationships.find(e=>e.id===s.relationshipId);o&&S(e,r,o.keyField)}w(e,r,s.orderByFields?.map(e=>e.field));break;case"text":U(e,r,s.text)}}function k(e,t){if(!t||0===t.length)return[];const s=H(e),r=[];for(const o of t)s.has(o.name)&&r.push(o.expression);return r}function H(e){const t=new Set;for(const s of e)if(r(t,s.visibilityExpression),!y(s))if(j(s))o(t,H(s.elements));else if(r(t,s.editableExpression),x(s)){const{requiredExpression:e,valueExpression:r}=s;o(t,[e,r])}return t}function U(e,t,s){w(e,t,v(s))}e([i({type:String,json:{write:!0}})],F.prototype,"description",void 0),e([i({json:{write:!0}})],F.prototype,"elements",void 0),e([n("elements")],F.prototype,"castElements",null),e([l("elements",["formElements"])],F.prototype,"readElements",null),e([c("elements")],F.prototype,"writeElements",null),e([i({type:[m],json:{write:!0}})],F.prototype,"expressionInfos",void 0),e([i({type:Boolean,json:{default:!1,write:!0}})],F.prototype,"preserveFieldValuesWhenHidden",void 0),e([i({type:String,json:{write:!0}})],F.prototype,"title",void 0),F=I=e([p("esri.form.FormTemplate")],F);const V=F;export{V as default};
5
+ import{__decorate as e}from"tslib";import{JSONSupport as t}from"../core/JSONSupport.js";import{clone as s}from"../core/lang.js";import{addMaybe as r,addMany as o}from"../core/SetUtils.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import{cast as n}from"../core/accessorSupport/decorators/cast.js";import{reader as l}from"../core/accessorSupport/decorators/reader.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import{writer as m}from"../core/accessorSupport/decorators/writer.js";import c from"./ExpressionInfo.js";import a from"./elements/GroupElement.js";import{ensureType as d,fromJSON as f,toJSON as u,isTextElement as h,isGroupElement as y,isFieldElement as j,buildTypeMaps as x}from"./support/formUtils.js";import{collectArcadeFieldNames as E,collectFields as w,extractSubstitutionTemplatesFromString as v,collectField as S}from"../layers/support/fieldUtils.js";var I;const b=x(a);let F=I=class extends t{constructor(e){super(e),this.description=null,this.elements=null,this.expressionInfos=null,this.preserveFieldValuesWhenHidden=!1,this.title=null}castElements(e){return d(e,b)}readElements(e,t){return f(t.formElements,b)}writeElements(e,t){t.formElements=u(e,b)}clone(){return new I({description:this.description,expressionInfos:s(this.expressionInfos),elements:s(this.elements),title:this.title,preserveFieldValuesWhenHidden:this.preserveFieldValuesWhenHidden})}async getFieldsUsed(e,t){const s=new Set,{description:r,elements:o,expressionInfos:i,title:n}=this;if(U(s,e,r),U(s,e,n),!o)return[];const l=k(o,i).map(t=>E(s,e,null,t));await Promise.all(l);for(const p of o)g(s,{fieldsIndex:e,relationships:t},p);return Array.from(s).sort()}};function g(e,t,s){const{fieldsIndex:r}=t;if(!r||r.fields.length!==e.size)switch(U(e,r,s.label),U(e,r,s.description),s.type){case"field":S(e,r,s.fieldName);break;case"group":s.elements.forEach(s=>g(e,t,s));break;case"relationship":if(t.relationships){const o=t.relationships.find(e=>e.id===s.relationshipId);o&&S(e,r,o.keyField)}w(e,r,s.orderByFields?.map(e=>e.field));break;case"text":U(e,r,s.text)}}function k(e,t){if(!t||0===t.length)return[];const s=H(e),r=[];for(const o of t)s.has(o.name)&&r.push(o.expression);return r}function H(e){const t=new Set;for(const s of e)if(r(t,s.visibilityExpression),!h(s))if(y(s))o(t,H(s.elements));else if(r(t,s.editableExpression),j(s)){const{requiredExpression:e,valueExpression:r}=s;o(t,[e,r])}return t}function U(e,t,s){w(e,t,v(s))}e([i({type:String,json:{write:!0}})],F.prototype,"description",void 0),e([i({json:{write:!0}})],F.prototype,"elements",void 0),e([n("elements")],F.prototype,"castElements",null),e([l("elements",["formElements"])],F.prototype,"readElements",null),e([m("elements")],F.prototype,"writeElements",null),e([i({type:[c],json:{write:!0}})],F.prototype,"expressionInfos",void 0),e([i({type:Boolean,json:{default:!1,write:!0}})],F.prototype,"preserveFieldValuesWhenHidden",void 0),e([i({type:String,json:{write:!0}})],F.prototype,"title",void 0),F=I=e([p("esri.form.FormTemplate")],F);export{F as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{JSONSupport as o}from"../../core/JSONSupport.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import{subclass as e}from"../../core/accessorSupport/decorators/subclass.js";let s=class extends o{constructor(t){super(t),this.description=null,this.label=null,this.type=null,this.visibilityExpression=null}};t([r({type:String,json:{write:!0}})],s.prototype,"description",void 0),t([r({type:String,json:{write:!0}})],s.prototype,"label",void 0),t([r()],s.prototype,"type",void 0),t([r({type:String,json:{write:!0}})],s.prototype,"visibilityExpression",void 0),s=t([e("esri.form.elements.Element")],s);const i=s;export{i as default};
5
+ import{__decorate as t}from"tslib";import{JSONSupport as o}from"../../core/JSONSupport.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import{subclass as e}from"../../core/accessorSupport/decorators/subclass.js";let s=class extends o{constructor(t){super(t),this.description=null,this.label=null,this.type=null,this.visibilityExpression=null}};t([r({type:String,json:{write:!0}})],s.prototype,"description",void 0),t([r({type:String,json:{write:!0}})],s.prototype,"label",void 0),t([r()],s.prototype,"type",void 0),t([r({type:String,json:{write:!0}})],s.prototype,"visibilityExpression",void 0),s=t([e("esri.form.elements.Element")],s);export{s as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import o from"./Element.js";import{types as s}from"./inputs.js";import{fromJSON as r,types as p}from"../../layers/support/domains.js";var n;let l=n=class extends o{constructor(e){super(e),this.domain=null,this.editable=null,this.editableExpression=null,this.fieldName=null,this.hint=null,this.input=null,this.requiredExpression=null,this.type="field",this.valueExpression=null}clone(){return new n({description:this.description,domain:this.domain,editable:this.editable,editableExpression:this.editableExpression,fieldName:this.fieldName,hint:this.hint,input:this.input,label:this.label,requiredExpression:this.requiredExpression,valueExpression:this.valueExpression,visibilityExpression:this.visibilityExpression})}};e([t({types:p,json:{read:{reader:r},write:!0}})],l.prototype,"domain",void 0),e([t({type:Boolean,json:{write:!0}})],l.prototype,"editable",void 0),e([t({type:String,json:{write:!0}})],l.prototype,"editableExpression",void 0),e([t({type:String,json:{write:!0}})],l.prototype,"fieldName",void 0),e([t({type:String,json:{write:!0}})],l.prototype,"hint",void 0),e([t({types:s,json:{read:{source:"inputType"},write:{target:"inputType"}}})],l.prototype,"input",void 0),e([t({type:String,json:{write:!0}})],l.prototype,"requiredExpression",void 0),e([t({type:String,json:{read:!1,write:!0}})],l.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],l.prototype,"valueExpression",void 0),l=n=e([i("esri.form.elements.FieldElement")],l);const d=l;export{d as default};
5
+ import{__decorate as e}from"tslib";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import o from"./Element.js";import{types as r}from"./inputs.js";import{fromJSON as s,types as p}from"../../layers/support/domains.js";var n;let l=n=class extends o{constructor(e){super(e),this.domain=null,this.editable=null,this.editableExpression=null,this.fieldName=null,this.hint=null,this.input=null,this.requiredExpression=null,this.type="field",this.valueExpression=null}clone(){return new n({description:this.description,domain:this.domain,editable:this.editable,editableExpression:this.editableExpression,fieldName:this.fieldName,hint:this.hint,input:this.input,label:this.label,requiredExpression:this.requiredExpression,valueExpression:this.valueExpression,visibilityExpression:this.visibilityExpression})}};e([t({types:p,json:{read:{reader:s},write:!0}})],l.prototype,"domain",void 0),e([t({type:Boolean,json:{write:!0}})],l.prototype,"editable",void 0),e([t({type:String,json:{write:!0}})],l.prototype,"editableExpression",void 0),e([t({type:String,json:{write:!0}})],l.prototype,"fieldName",void 0),e([t({type:String,json:{write:!0}})],l.prototype,"hint",void 0),e([t({types:r,json:{read:{source:"inputType"},write:{target:"inputType"}}})],l.prototype,"input",void 0),e([t({type:String,json:{write:!0}})],l.prototype,"requiredExpression",void 0),e([t({type:String,json:{read:!1,write:!0}})],l.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],l.prototype,"valueExpression",void 0),l=n=e([i("esri.form.elements.FieldElement")],l);export{l as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{clone as t}from"../../core/lang.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import{cast as o}from"../../core/accessorSupport/decorators/cast.js";import{reader as s}from"../../core/accessorSupport/decorators/reader.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import l from"./Element.js";import{ensureType as n,fromJSON as m,toJSON as a,buildTypeMaps as c}from"../support/formUtils.js";var d;let u=d=class extends l{constructor(e){super(e),this.elements=null,this.initialState="expanded",this.type="group"}castElements(e){return n(e,f,!1)}readElements(e,t){return m(t.formElements,f,!1)}writeElements(e,t){t.formElements=a(e,f,!1)}clone(){return new d({description:this.description,elements:t(this.elements),initialState:this.initialState,label:this.label,visibilityExpression:this.visibilityExpression})}};e([r({json:{write:!0}})],u.prototype,"elements",void 0),e([o("elements")],u.prototype,"castElements",null),e([s("elements",["formElements"])],u.prototype,"readElements",null),e([p("elements")],u.prototype,"writeElements",null),e([r({type:["collapsed","expanded"],json:{write:!0}})],u.prototype,"initialState",void 0),e([r({type:String,json:{read:!1,write:!0}})],u.prototype,"type",void 0),u=d=e([i("esri.form.elements.GroupElement")],u);const f=c(u),y=u;export{y as default};
5
+ import{__decorate as e}from"tslib";import{clone as t}from"../../core/lang.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import{cast as o}from"../../core/accessorSupport/decorators/cast.js";import{reader as s}from"../../core/accessorSupport/decorators/reader.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import l from"./Element.js";import{ensureType as n,buildTypeMaps as m,fromJSON as a,toJSON as c}from"../support/formUtils.js";var d;let u=d=class extends l{constructor(e){super(e),this.elements=null,this.initialState="expanded",this.type="group"}castElements(e){return n(e,f,!1)}readElements(e,t){return a(t.formElements,f,!1)}writeElements(e,t){t.formElements=c(e,f,!1)}clone(){return new d({description:this.description,elements:t(this.elements),initialState:this.initialState,label:this.label,visibilityExpression:this.visibilityExpression})}};e([r({json:{write:!0}})],u.prototype,"elements",void 0),e([o("elements")],u.prototype,"castElements",null),e([s("elements",["formElements"])],u.prototype,"readElements",null),e([p("elements")],u.prototype,"writeElements",null),e([r({type:["collapsed","expanded"],json:{write:!0}})],u.prototype,"initialState",void 0),e([r({type:String,json:{read:!1,write:!0}})],u.prototype,"type",void 0),u=d=e([i("esri.form.elements.GroupElement")],u);const f=m(u),y=u;export{y as default};
package/interfaces.d.ts CHANGED
@@ -2458,6 +2458,12 @@ declare namespace __esri {
2458
2458
  export interface imageryUtilsComputeStatisticsHistogramsParameters {
2459
2459
  geometry: Extent | Polygon | Polyline;
2460
2460
  pixelSize?: Point | nullish;
2461
+ histogramSize?: number;
2462
+ transformType?: "log" | "sqrt" | "inverse" | "box-cox";
2463
+ lambda?: number;
2464
+ shift?: number;
2465
+ valueAttributeFieldName?: string;
2466
+ bandIds?: number[];
2461
2467
  }
2462
2468
 
2463
2469
  export interface imageryUtilsCreatePixelFeatureSetCursorOptions {
@@ -20281,7 +20287,7 @@ declare namespace __esri {
20281
20287
  | (FeatureReductionSelectionProperties & { type: "selection" })
20282
20288
  | nullish);
20283
20289
  /**
20284
- * An array of field configuration objects that define the display properties of fields.
20290
+ * An array of {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FieldConfiguration.html FieldConfiguration} objects that control how fields are displayed in popups and other UI elements.
20285
20291
  *
20286
20292
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fieldConfigurations Read more...}
20287
20293
  */
@@ -20522,7 +20528,7 @@ declare namespace __esri {
20522
20528
  */
20523
20529
  getFieldAlias(fieldName: string): string | nullish;
20524
20530
  /**
20525
- * Returns the field configuration for the specified field.
20531
+ * Returns the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FieldConfiguration.html FieldConfigurations} for the specified field.
20526
20532
  *
20527
20533
  * @param fieldName The name of the field.
20528
20534
  *
@@ -20809,7 +20815,7 @@ declare namespace __esri {
20809
20815
  | (FeatureReductionSelectionProperties & { type: "selection" })
20810
20816
  | nullish;
20811
20817
  /**
20812
- * An array of field configuration objects that define the display properties of fields.
20818
+ * An array of {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FieldConfiguration.html FieldConfiguration} objects that control how fields are displayed in popups and other UI elements.
20813
20819
  *
20814
20820
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fieldConfigurations Read more...}
20815
20821
  */
@@ -36020,9 +36026,7 @@ declare namespace __esri {
36020
36026
 
36021
36027
  export class FieldConfiguration {
36022
36028
  /**
36023
- * The alias of the field.
36024
- *
36025
- * @default null
36029
+ * The alias (or display name) for the field.
36026
36030
  *
36027
36031
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FieldConfiguration.html#alias Read more...}
36028
36032
  */
@@ -36034,7 +36038,7 @@ declare namespace __esri {
36034
36038
  */
36035
36039
  name: string;
36036
36040
  /**
36037
- * More description to come.
36041
+ * The `FieldConfiguration` class defines how fields in a layer are displayed and formatted within widgets and UI components.
36038
36042
  *
36039
36043
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FieldConfiguration.html Read more...}
36040
36044
  */
@@ -36074,7 +36078,7 @@ declare namespace __esri {
36074
36078
 
36075
36079
  interface FieldConfigurationProperties {
36076
36080
  /**
36077
- * The alias of the field.
36081
+ * The alias (or display name) for the field.
36078
36082
  *
36079
36083
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FieldConfiguration.html#alias Read more...}
36080
36084
  */
@@ -37581,16 +37585,12 @@ declare namespace __esri {
37581
37585
  /**
37582
37586
  * The maximum number of decimal places to display.
37583
37587
  *
37584
- * @default 3
37585
- *
37586
37588
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-NumberFieldFormat.html#maximumFractionDigits Read more...}
37587
37589
  */
37588
37590
  maximumFractionDigits: number;
37589
37591
  /**
37590
37592
  * The minimum number of decimal places to display.
37591
37593
  *
37592
- * @default 0
37593
- *
37594
37594
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-NumberFieldFormat.html#minimumFractionDigits Read more...}
37595
37595
  */
37596
37596
  minimumFractionDigits: number;
@@ -37601,7 +37601,7 @@ declare namespace __esri {
37601
37601
  *
37602
37602
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-NumberFieldFormat.html#style Read more...}
37603
37603
  */
37604
- style: "decimal";
37604
+ readonly style: "decimal";
37605
37605
  /**
37606
37606
  * The type of field format.
37607
37607
  *
@@ -37617,7 +37617,7 @@ declare namespace __esri {
37617
37617
  */
37618
37618
  useGrouping: "always" | "auto" | "never";
37619
37619
  /**
37620
- * More description to come.
37620
+ * The `NumberFieldFormat` class defines the formatting options for numeric field {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#type types}.
37621
37621
  *
37622
37622
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-NumberFieldFormat.html Read more...}
37623
37623
  */
@@ -37659,12 +37659,6 @@ declare namespace __esri {
37659
37659
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-NumberFieldFormat.html#minimumFractionDigits Read more...}
37660
37660
  */
37661
37661
  minimumFractionDigits?: number;
37662
- /**
37663
- * The formatting style to use.
37664
- *
37665
- * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-NumberFieldFormat.html#style Read more...}
37666
- */
37667
- style?: "decimal";
37668
37662
  /**
37669
37663
  * Indicates whether to use grouping separators, such as thousands separators.
37670
37664
  *
@@ -116018,6 +116012,7 @@ declare namespace __esri {
116018
116012
  | "awaiting-feature-to-create"
116019
116013
  | "awaiting-feature-to-update"
116020
116014
  | "awaiting-update-feature-candidate"
116015
+ | "choosing-key-feature"
116021
116016
  | "creating-features"
116022
116017
  | "disabled"
116023
116018
  | "drawing-splitter-geometry"
@@ -116327,7 +116322,14 @@ declare namespace __esri {
116327
116322
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-MergeFeaturesWorkflow.html Read more...}
116328
116323
  */
116329
116324
  interface MergeFeaturesWorkflow {
116330
- readonly featureFormViewModel: FeatureFormViewModel;
116325
+ readonly formViewModel: FeatureFormViewModel;
116326
+ readonly layer: | GeoJSONLayer
116327
+ | FeatureLayer
116328
+ | OrientedImageryLayer
116329
+ | SceneLayer
116330
+ | SubtypeSublayer
116331
+ | KnowledgeGraphSublayer
116332
+ | nullish;
116331
116333
  readonly type: "merge-features";
116332
116334
  }
116333
116335
 
@@ -116363,9 +116365,9 @@ declare namespace __esri {
116363
116365
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html FeatureFormViewModel} used by the
116364
116366
  * workflow to manage the attributes of the resulting features.
116365
116367
  *
116366
- * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-SplitFeatureWorkflow.html#featureFormViewModel Read more...}
116368
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-SplitFeatureWorkflow.html#formViewModel Read more...}
116367
116369
  */
116368
- readonly featureFormViewModel: FeatureFormViewModel;
116370
+ readonly formViewModel: FeatureFormViewModel;
116369
116371
  /**
116370
116372
  * The layer to which the feature being split belongs.
116371
116373
  *
package/kernel.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.0";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.0.0-next.8",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
5
+ import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.0";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.0.0-next.9",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../PopupTemplate.js";import r from"../../core/Error.js";import{clone as i}from"../../core/lang.js";import o from"../../core/Logger.js";import{MultiOriginJSONMixin as n}from"../../core/MultiOriginJSONSupport.js";import"../../core/workers/workers.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import l from"../../geometry/Extent.js";import y from"../../geometry/Point.js";import u from"../../geometry/Polygon.js";import d from"../../geometry/Polyline.js";import{initializeProjection as h,project as m}from"../../geometry/projectionUtils.js";import c from"../../geometry/SpatialReference.js";import{wgs84 as g}from"../../geometry/support/spatialReferenceUtils.js";import{featureGeometryTypeKebabDictionary as f}from"../../geometry/support/typeUtils.js";import b from"../../graphic/KnowledgeGraphGraphicOrigin.js";import j from"../../graphic/LinkChartGraphicOrigin.js";import w from"../Layer.js";import T from"../graphics/data/FeatureStore.js";import{QueryEngine as v}from"../graphics/data/QueryEngine.js";import{createDrawingInfo as I}from"../graphics/sources/support/clientSideDefaults.js";import{systemOidFieldName as E,systemAggregationCountFieldName as O,systemIsSpatialFieldName as S,systemLayoutGeometryFieldName as x,systemOriginIdFieldName as N,systemDestinationIdFieldName as L}from"./constants.js";import{KnowledgeGraphSublayerBase as F}from"./KnowledgeGraphSublayerBase.js";import{createCapabilitiesFromKnowledgeGraph as _,getDisplayLabelProperty as R,getLinkChartDefaultLabelingInfo as C,getMapDefaultLabelingInfo as k,getKGSublayerSymbolColor as Q,getDefaultLCRelationshipSublayerSymbol as M,convertLayerEditsToGraphEdits as P,convertGraphEditsResultToFeatureEdits as G}from"./layerUtils.js";import{BlendLayer as D,blendModeProperty as J,effectProperty as q}from"../mixins/BlendLayer.js";import{DisplayFilteredLayer as U,displayFilterEnabledProperty as A,displayFilterInfoProperty as B}from"../mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as Z,featureEffectProperty as K}from"../mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as V}from"../mixins/FeatureReductionLayer.js";import{OrderedLayer as H,orderByProperty as W}from"../mixins/OrderedLayer.js";import{RefreshableLayer as Y}from"../mixins/RefreshableLayer.js";import{ScaleRangeLayer as z}from"../mixins/ScaleRangeLayer.js";import{TemporalLayer as X,useViewTimeProperty as $}from"../mixins/TemporalLayer.js";import{legendEnabled as ee,maxScale as te,minScale as re,opacity as ie,popupEnabled as oe}from"../support/commonProperties.js";import{featureReductionProperty as ne}from"../support/featureReductionUtils.js";import se from"../support/Field.js";import{fixRendererFields as ae,fixTimeInfoFields as pe}from"../support/fieldUtils.js";import le from"../support/LabelClass.js";import{reader as ye}from"../support/labelingInfo.js";import ue from"../support/TimeInfo.js";import de from"../../renderers/SimpleRenderer.js";import{fromJSON as he}from"../../renderers/support/jsonUtils.js";import{rendererTypes as me}from"../../renderers/support/typeUtils.js";import{executeApplyEdits as ce}from"../../rest/knowledgeGraphService.js";import ge from"../../rest/support/FeatureSet.js";import fe from"../../rest/support/Query.js";import{createPopupTemplate as be}from"../../support/popupUtils.js";import{applyColorToSymbol as je}from"../../symbols/support/utils.js";import we from"../../core/workers/RemoteClient.js";function Te(e){if(!e.json)return e;e.json.write=ve(e.json.write);const t=e.json.origins;if(!t)return e;let r;for(r in t){const e=t[r];e&&(e.write=ve(e.write))}return e}function ve(e){return"object"==typeof e&&e?(!1!==e.enabled&&(e.overridePolicy=Ie(e)),e):!0===e?Ee():e}function Ie(e){const{target:t,writer:r,overridePolicy:i,...o}=e;return function(e,t){const r=Oe.call(this,e,t);return r.enabled?{...o,...r}:r}}function Ee(){return{overridePolicy:Oe}}function Oe(e,t){const r=!!this.geometryType;let i={enabled:r};return r&&(i={...i,...Se.call(this,e,t)}),i}function Se(e,t){return{ignoreOrigin:this.originIdOf(t)>0}}let xe=class extends(F(U(V(Z(D(H(X(z(Y(n(w))))))))))){constructor(e){super(e),this.blendMode="normal",this.charts=null,this.definitionExpression=null,this.displayFilterEnabled=!0,this.displayFilterInfo=null,this.effect=null,this.elevationInfo=null,this.featureEffect=null,this.graphType=null,this.labelsVisible=!0,this.layerType=null,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.objectIdField=E,this.objectType=null,this.opacity=1,this.orderBy=null,this.parent=null,this.parentCompositeLayer=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.refreshInterval=0,this.source={openPorts:()=>this.load().then(()=>{const e=new MessageChannel;return new we(e.port1,{channel:e,client:{queryFeatures:(e,t={})=>{const r=fe.fromJSON(e);return this.queryFeaturesJSON(r,t)}}}),[e.port2]})},this.type="knowledge-graph-sublayer",this.useViewTime=!0,this.visible=!0}get capabilities(){return this.parent?this.parent.sublayerCapabilities:_(null)}get userHasUpdateItemPrivileges(){return!!this.parent?.userHasUpdateItemPrivileges}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.capabilities.operations.supportsEditing}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get isTable(){return"link-chart"!==this.parentCompositeLayer.type&&null==this.geometryFieldName}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}get fields(){const e=[];return this.objectType?.properties?.forEach(t=>{const r="esriFieldTypeOID"===t.fieldType?"esriFieldTypeInteger":t.fieldType;e.push(se.fromJSON({name:t.name,type:r,alias:t.alias,defaultValue:t.defaultValue,editable:t.editable,nullable:t.nullable}))}),e.push(se.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1}),se.fromJSON({name:O,type:"esriFieldTypeInteger",alias:O,editable:!1}),se.fromJSON({name:S,type:"esriFieldTypeInteger",alias:S,editable:!1})),e}get geometryType(){if("link-chart"===this.parentCompositeLayer?.type)return"relationship"===this.graphType?"polyline":"point";const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.geometryType;return t&&"esriGeometryNull"!==t?f.fromJSON(t):null}get geometryFieldName(){if("link-chart"===this.parentCompositeLayer?.type)return x;const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name);return e?.name??null}get graphicOrigin(){if(!this.parent)return null;switch(this.parent.type){case"knowledge-graph":return new b(this.parent,this);case"link-chart":return new j(this.parent,this)}}get graphTypeName(){return this.objectType?.name}set graphTypeName(e){this._set("graphTypeName",e)}get hasM(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasM??!1}get hasZ(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasZ??!1}set labelingInfo(e){this._set("labelingInfo",e)}get labelingInfo(){if(this._isOverridden("labelingInfo"))return this._get("labelingInfo");if(!this.objectType||!this.parentCompositeLayer||!this.graphTypeName)return null;const e=this.objectType.properties?R(this.objectType.properties):"ESRI__ID";return"link-chart"===this.parentCompositeLayer.type?C(this.graphType,this.graphTypeName,e):k(this.graphTypeName,this.geometryType,e)}set renderer(e){ae(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const e=this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel,t=[...e?.entityTypes??[],...e?.relationshipTypes??[]].map(e=>e.name).indexOf(this.graphTypeName),r=Q(t);if("link-chart"===this.parentCompositeLayer?.type){if("relationship"===this.graphType)return new de({type:"simple",symbol:M(r)});const e=he(I(f.toJSON("point")).renderer);return je(e.symbol,r),e}const i=he(I(f.toJSON(this.geometryType)).renderer);return je(i.symbol,r),i}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??c.WGS84}set timeInfo(e){this._set("timeInfo",e)}get title(){return this._isOverridden("title")?this._get("title"):this.graphTypeName}set title(e){this._set("title",e)}writeTitle(e,t){t.title=e??"Layer"}createPopupTemplate(e){return be(this,e)}createQuery(){return new fe({where:"1=1",outFields:["*"]})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){return null}async queryFeatures(e,t){await this.load();const{resolvedQuery:r,queryEngine:i}=await this._setupQueryObjects(e),o=this.graphicOrigin,n=ge.fromJSON(await i.executeQuery(r.toJSON(),t?.signal));return n.features.forEach(e=>{e.sourceLayer=this,e.origin=o}),n}async queryFeaturesJSON(e,t){await this.load();const{resolvedQuery:r,queryEngine:i}=await this._setupQueryObjects(e);return await i.executeQuery(r.toJSON(),t?.signal)}async queryFeatureCount(e,t){await this.load();const{resolvedQuery:r,queryEngine:i}=await this._setupQueryObjects(e);return i.executeQueryForCount(r.toJSON(),t?.signal)}async queryExtent(e={},t){await this.load();const r={...e,returnGeometry:!0},{resolvedQuery:i,queryEngine:o}=await this._setupQueryObjects(r),n=await o.executeQueryForExtent(i.toJSON(),t?.signal);let s;return s=null!=n.extent?.xmin&&null!=n.extent?.xmax&&null!=n.extent?.ymin&&null!=n.extent?.ymax?new l(n.extent):new l,{count:n.count,extent:s}}async queryObjectIds(e,t){await this.load();const r=fe.from(e);let i;if("link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)i=this._cachedQueryEngine;else{const e=await this.parentCompositeLayer.dataManager.getData(r,this,t);i=this.loadQueryEngine(e)}return await i.executeQueryForIds(r.toJSON(),t?.signal)}async applyEdits(e){if(!this.parentCompositeLayer.dataManager.knowledgeGraph)throw new r("knowledge-graph-sublayer:no-knowledge-graph","ApplyEdits cannot be executed because the parent does not have a Knowledge Graph model. This is usually caused by the layer not yet being loaded");const t=P(e,this);t.options={cascadeDelete:!0,cascadeProvenanceDelete:!!this.parent?.knowledgeGraph.serviceDefinition.supportsProvenance||void 0};const i=await ce(this.parentCompositeLayer.dataManager.knowledgeGraph,t),o=G(i,this.graphTypeName),n={addedFeatures:o.addFeatureResults,updatedFeatures:o.updateFeatureResults,deletedFeatures:o.deleteFeatureResults,addedAttachments:o.addAttachmentResults,deletedAttachments:o.deleteAttachmentResults,updatedAttachments:o.updateAttachmentResults,exceededTransferLimit:!1,historicMoment:new Date,edits:void 0};return this.emit("edits",n),this.emit("apply-edits",{result:Promise.resolve(n)}),o}loadQueryEngine(e){const t=new T({geometryType:f.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),r=new v({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:f.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,featureIdInfo:{type:"object-id",fieldName:this.objectIdField},spatialReference:this.spatialReference.toJSON(),timeInfo:this.timeInfo?.toJSON(),featureStore:t});return r.featureStore.addMany(e),r}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new fe({where:"1=1",outFields:[E]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}load(e){return this.addResolvingPromise(this.parent.load(e).then(()=>pe(this.timeInfo,this.fieldsIndex))),Promise.resolve(this)}async _setupQueryObjects(e,t){const r=fe.from(e),i=r.geometry;if(i&&!i.spatialReference?.isWGS84&&(await h(i.spatialReference,g),r.geometry=m(i instanceof u||i instanceof d||i instanceof y?i:i.extent,g)),"link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)return{resolvedQuery:r,queryEngine:this._cachedQueryEngine};const o=await this.parentCompositeLayer.dataManager.getData(r,this,t);return{resolvedQuery:r,queryEngine:this.loadQueryEngine(o)}}};function Ne(e,t,r){const i=[["ESRI__AGGREGATION_COUNT",O],["ESRI__ORIGIN_ID",N],["ESRI__DESTINATION_ID",L],["ESRI__LAYOUT_GEOMETRY",x]];try{for(const t of e)for(const[e,r]of i)t.labelExpression=t.labelExpression?.replaceAll(e,r),t.labelExpressionInfo?.expression&&(t.labelExpressionInfo.expression=t.labelExpressionInfo.expression.replaceAll(e,r))}catch(n){o.getLogger(this).warn("Error updating labelingInfo",n)}return ye(e,t,r)}e([s(Te(i(J)))],xe.prototype,"blendMode",void 0),e([s({readOnly:!0})],xe.prototype,"capabilities",null),e([s({readOnly:!0})],xe.prototype,"userHasUpdateItemPrivileges",null),e([s({type:Boolean})],xe.prototype,"editingEnabled",null),e([s()],xe.prototype,"isTable",null),e([s({json:{origins:{"web-scene":{write:!1}},write:Ee()}})],xe.prototype,"charts",void 0),e([s({readOnly:!0})],xe.prototype,"defaultPopupTemplate",null),e([s({type:String,json:{origins:{service:{read:!1}},name:"layerDefinition.definitionExpression",write:{ignoreOrigin:!0}}})],xe.prototype,"definitionExpression",void 0),e([s(Te(i(A)))],xe.prototype,"displayFilterEnabled",void 0),e([s(Te(i(B)))],xe.prototype,"displayFilterInfo",void 0),e([s(Te(i(q)))],xe.prototype,"effect",void 0),e([s()],xe.prototype,"elevationInfo",void 0),e([s(Te(i(K)))],xe.prototype,"featureEffect",void 0),e([s(Te(i(ne)))],xe.prototype,"featureReduction",null),e([s()],xe.prototype,"fields",null),e([s()],xe.prototype,"geometryType",null),e([s()],xe.prototype,"geometryFieldName",null),e([s({readOnly:!0})],xe.prototype,"graphicOrigin",null),e([s({type:["entity","relationship"],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],xe.prototype,"graphType",void 0),e([s({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],xe.prototype,"graphTypeName",null),e([s()],xe.prototype,"hasM",null),e([s()],xe.prototype,"hasZ",null),e([s({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],xe.prototype,"id",void 0),e([s({type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",default:!1,write:{overridePolicy(){return{enabled:!!this.geometryType,alwaysWriteDefaults:!0,ignoreOrigin:!0}}}}})],xe.prototype,"labelsVisible",void 0),e([s({type:[le],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:Ne,write:Ee()}})],xe.prototype,"labelingInfo",null),e([s({readOnly:!0,json:{read:!1,write:{writer(e,t){switch(this.parentCompositeLayer?.type){case"link-chart":t.layerType="LinkChartSubLayer";break;case"knowledge-graph":t.layerType=this.geometryType?"KnowledgeGraphSubLayer":"KnowledgeGraphSubTable"}},isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],xe.prototype,"layerType",void 0),e([s(Te(i(ee)))],xe.prototype,"legendEnabled",void 0),e([s(Te(i(te)))],xe.prototype,"maxScale",void 0),e([s(Te(i(re)))],xe.prototype,"minScale",void 0),e([s()],xe.prototype,"objectIdField",void 0),e([s()],xe.prototype,"objectType",void 0),e([s(Te(i(ie)))],xe.prototype,"opacity",void 0),e([s(Te(i(W)))],xe.prototype,"orderBy",void 0),e([s({clonable:!1})],xe.prototype,"parent",void 0),e([s()],xe.prototype,"parentCompositeLayer",void 0),e([s(Te(i(oe)))],xe.prototype,"popupEnabled",void 0),e([s({type:t,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],xe.prototype,"popupTemplate",void 0),e([s({type:Number,json:{write:{overridePolicy:Se}}})],xe.prototype,"refreshInterval",void 0),e([s({types:me,json:{name:"layerDefinition.drawingInfo.renderer",write:Ee()}})],xe.prototype,"renderer",null),e([s()],xe.prototype,"source",void 0),e([s()],xe.prototype,"spatialReference",null),e([s({type:ue,json:{name:"layerDefinition.timeInfo",write:{overridePolicy:Se},origins:{"web-document":{name:"layerDefinition.timeInfo",read:!0,write:{overridePolicy:Se}},"portal-item":{name:"layerDefinition.timeInfo",read:!0,write:{overridePolicy:Se}}}}})],xe.prototype,"timeInfo",null),e([s({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],xe.prototype,"title",null),e([p("title")],xe.prototype,"writeTitle",null),e([s({json:{read:!1}})],xe.prototype,"type",void 0),e([s(Te(i($)))],xe.prototype,"useViewTime",void 0),e([s({type:Boolean,json:{name:"visibility",write:Ee()}})],xe.prototype,"visible",void 0),xe=e([a("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],xe);export{xe as default};
5
+ import{__decorate as e}from"tslib";import t from"../../PopupTemplate.js";import r from"../../core/Error.js";import{clone as i}from"../../core/lang.js";import o from"../../core/Logger.js";import{MultiOriginJSONMixin as s}from"../../core/MultiOriginJSONSupport.js";import"../../core/workers/workers.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import l from"../../geometry/Extent.js";import y from"../../geometry/Point.js";import d from"../../geometry/Polygon.js";import u from"../../geometry/Polyline.js";import{initializeProjection as m,project as h}from"../../geometry/projectionUtils.js";import c from"../../geometry/SpatialReference.js";import{wgs84 as g}from"../../geometry/support/spatialReferenceUtils.js";import{featureGeometryTypeKebabDictionary as f}from"../../geometry/support/typeUtils.js";import b from"../../graphic/KnowledgeGraphGraphicOrigin.js";import j from"../../graphic/LinkChartGraphicOrigin.js";import w from"../Layer.js";import T from"../graphics/data/FeatureStore.js";import{QueryEngine as v}from"../graphics/data/QueryEngine.js";import{createDrawingInfo as I}from"../graphics/sources/support/clientSideDefaults.js";import{systemOidFieldName as O,systemAggregationCountFieldName as E,systemIsSpatialFieldName as S,systemLayoutGeometryFieldName as x,systemOriginIdFieldName as L,systemDestinationIdFieldName as N}from"./constants.js";import{KnowledgeGraphSublayerBase as _}from"./KnowledgeGraphSublayerBase.js";import{createCapabilitiesFromKnowledgeGraph as F,createDefaultKGSLFormTemplate as R,getDisplayLabelProperty as C,getLinkChartDefaultLabelingInfo as k,getMapDefaultLabelingInfo as Q,getKGSublayerSymbolColor as M,getDefaultLCRelationshipSublayerSymbol as P,createDefaultKGSLFeatureTemplates as G,convertLayerEditsToGraphEdits as D,convertGraphEditsResultToFeatureEdits as J}from"./layerUtils.js";import{BlendLayer as q,blendModeProperty as U,effectProperty as A}from"../mixins/BlendLayer.js";import{DisplayFilteredLayer as B,displayFilterEnabledProperty as Z,displayFilterInfoProperty as K}from"../mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as V,featureEffectProperty as H}from"../mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as W}from"../mixins/FeatureReductionLayer.js";import{OrderedLayer as Y,orderByProperty as z}from"../mixins/OrderedLayer.js";import{RefreshableLayer as X}from"../mixins/RefreshableLayer.js";import{ScaleRangeLayer as $}from"../mixins/ScaleRangeLayer.js";import{TemporalLayer as ee,useViewTimeProperty as te}from"../mixins/TemporalLayer.js";import{legendEnabled as re,maxScale as ie,minScale as oe,opacity as se,popupEnabled as ne}from"../support/commonProperties.js";import{featureReductionProperty as ae}from"../support/featureReductionUtils.js";import pe from"../support/Field.js";import{fixRendererFields as le,fixTimeInfoFields as ye}from"../support/fieldUtils.js";import de from"../support/LabelClass.js";import{reader as ue}from"../support/labelingInfo.js";import me from"../support/TimeInfo.js";import he from"../../renderers/SimpleRenderer.js";import{fromJSON as ce}from"../../renderers/support/jsonUtils.js";import{rendererTypes as ge}from"../../renderers/support/typeUtils.js";import{executeApplyEdits as fe}from"../../rest/knowledgeGraphService.js";import be from"../../rest/support/FeatureSet.js";import je from"../../rest/support/Query.js";import{createPopupTemplate as we}from"../../support/popupUtils.js";import{applyColorToSymbol as Te}from"../../symbols/support/utils.js";import ve from"../../core/workers/RemoteClient.js";function Ie(e){if(!e.json)return e;e.json.write=Oe(e.json.write);const t=e.json.origins;if(!t)return e;let r;for(r in t){const e=t[r];e&&(e.write=Oe(e.write))}return e}function Oe(e){return"object"==typeof e&&e?(!1!==e.enabled&&(e.overridePolicy=Ee(e)),e):!0===e?Se():e}function Ee(e){const{target:t,writer:r,overridePolicy:i,...o}=e;return function(e,t){const r=xe.call(this,e,t);return r.enabled?{...o,...r}:r}}function Se(){return{overridePolicy:xe}}function xe(e,t){const r=!!this.geometryType;let i={enabled:r};return r&&(i={...i,...Le.call(this,e,t)}),i}function Le(e,t){return{ignoreOrigin:this.originIdOf(t)>0}}let Ne=class extends(_(B(W(V(q(Y(ee($(X(s(w))))))))))){constructor(e){super(e),this.blendMode="normal",this.charts=null,this.definitionExpression=null,this.displayFilterEnabled=!0,this.displayFilterInfo=null,this.effect=null,this.elevationInfo=null,this.featureEffect=null,this.graphType=null,this.labelsVisible=!0,this.layerType=null,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.objectIdField=O,this.objectType=null,this.opacity=1,this.orderBy=null,this.parent=null,this.parentCompositeLayer=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.refreshInterval=0,this.source={openPorts:()=>this.load().then(()=>{const e=new MessageChannel;return new ve(e.port1,{channel:e,client:{queryFeatures:(e,t={})=>{const r=je.fromJSON(e);return this.queryFeaturesJSON(r,t)}}}),[e.port2]})},this.type="knowledge-graph-sublayer",this.useViewTime=!0,this.visible=!0}get capabilities(){return this.parent?this.parent.sublayerCapabilities:F(null)}get userHasUpdateItemPrivileges(){return!!this.parent?.userHasUpdateItemPrivileges}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.capabilities.operations.supportsEditing}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get isTable(){return"link-chart"!==this.parentCompositeLayer.type&&null==this.geometryFieldName}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}get fields(){const e=[];return this.objectType?.properties?.forEach(t=>{const r="esriFieldTypeOID"===t.fieldType?"esriFieldTypeInteger":t.fieldType;e.push(pe.fromJSON({name:t.name,type:r,alias:t.alias,defaultValue:t.defaultValue,editable:t.editable,nullable:t.nullable}))}),e.push(pe.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1}),pe.fromJSON({name:E,type:"esriFieldTypeInteger",alias:E,editable:!1}),pe.fromJSON({name:S,type:"esriFieldTypeInteger",alias:S,editable:!1})),e}get formTemplate(){return this._isOverridden("formTemplate")?this._get("formTemplate"):R(this)}set formTemplate(e){this._overrideIfSome("formTemplate",e)}get geometryType(){if("link-chart"===this.parentCompositeLayer?.type)return"relationship"===this.graphType?"polyline":"point";const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.geometryType;return t&&"esriGeometryNull"!==t?f.fromJSON(t):null}get geometryFieldName(){if("link-chart"===this.parentCompositeLayer?.type)return x;const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name);return e?.name??null}get graphicOrigin(){if(!this.parent)return null;switch(this.parent.type){case"knowledge-graph":return new b(this.parent,this);case"link-chart":return new j(this.parent,this)}}get graphTypeName(){return this.objectType?.name}set graphTypeName(e){this._set("graphTypeName",e)}get hasM(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasM??!1}get hasZ(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasZ??!1}set labelingInfo(e){this._set("labelingInfo",e)}get labelingInfo(){if(this._isOverridden("labelingInfo"))return this._get("labelingInfo");if(!this.objectType||!this.parentCompositeLayer||!this.graphTypeName)return null;const e=this.objectType.properties?C(this.objectType.properties):"ESRI__ID";return"link-chart"===this.parentCompositeLayer.type?k(this.graphType,this.graphTypeName,e):Q(this.graphTypeName,this.geometryType,e)}set renderer(e){le(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const e=this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel,t=[...e?.entityTypes??[],...e?.relationshipTypes??[]].map(e=>e.name).indexOf(this.graphTypeName),r=M(t);if("link-chart"===this.parentCompositeLayer?.type){if("relationship"===this.graphType)return new he({type:"simple",symbol:P(r)});const e=ce(I(f.toJSON("point")).renderer);return Te(e.symbol,r),e}const i=ce(I(f.toJSON(this.geometryType)).renderer);return Te(i.symbol,r),i}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??c.WGS84}get templates(){return this._isOverridden("templates")?this._get("templates"):G(this)}set templates(e){this._overrideIfSome("templates",e)}set timeInfo(e){this._set("timeInfo",e)}get title(){return this._isOverridden("title")?this._get("title"):this.graphTypeName}set title(e){this._set("title",e)}writeTitle(e,t){t.title=e??"Layer"}createPopupTemplate(e){return we(this,e)}createQuery(){return new je({where:"1=1",outFields:["*"]})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){return null}async queryFeatures(e,t){await this.load();const{resolvedQuery:r,queryEngine:i}=await this._setupQueryObjects(e),o=this.graphicOrigin,s=be.fromJSON(await i.executeQuery(r.toJSON(),t?.signal));return s.features.forEach(e=>{e.sourceLayer=this,e.origin=o}),s}async queryFeaturesJSON(e,t){await this.load();const{resolvedQuery:r,queryEngine:i}=await this._setupQueryObjects(e);return await i.executeQuery(r.toJSON(),t?.signal)}async queryFeatureCount(e,t){await this.load();const{resolvedQuery:r,queryEngine:i}=await this._setupQueryObjects(e);return i.executeQueryForCount(r.toJSON(),t?.signal)}async queryExtent(e={},t){await this.load();const r={...e,returnGeometry:!0},{resolvedQuery:i,queryEngine:o}=await this._setupQueryObjects(r),s=await o.executeQueryForExtent(i.toJSON(),t?.signal);let n;return n=null!=s.extent?.xmin&&null!=s.extent?.xmax&&null!=s.extent?.ymin&&null!=s.extent?.ymax?new l(s.extent):new l,{count:s.count,extent:n}}async queryObjectIds(e,t){await this.load();const r=je.from(e);let i;if("link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)i=this._cachedQueryEngine;else{const e=await this.parentCompositeLayer.dataManager.getData(r,this,t);i=this.loadQueryEngine(e)}return await i.executeQueryForIds(r.toJSON(),t?.signal)}async applyEdits(e){if(!this.parentCompositeLayer.dataManager.knowledgeGraph)throw new r("knowledge-graph-sublayer:no-knowledge-graph","ApplyEdits cannot be executed because the parent does not have a Knowledge Graph model. This is usually caused by the layer not yet being loaded");const t=await D(e,this);t.options={cascadeDelete:!0,cascadeProvenanceDelete:!!this.parent?.knowledgeGraph.serviceDefinition.supportsProvenance||void 0};const i=await fe(this.parentCompositeLayer.dataManager.knowledgeGraph,t),o=J(i,this.graphTypeName),s={addedFeatures:o.addFeatureResults,updatedFeatures:o.updateFeatureResults,deletedFeatures:o.deleteFeatureResults,addedAttachments:o.addAttachmentResults,deletedAttachments:o.deleteAttachmentResults,updatedAttachments:o.updateAttachmentResults,exceededTransferLimit:!1,historicMoment:new Date,edits:void 0};return this.emit("edits",s),this.emit("apply-edits",{result:Promise.resolve(s)}),"link-chart"===this.parentCompositeLayer.type&&await this.parentCompositeLayer.refreshLinkChartCache([...s.addedFeatures.map(e=>e.globalId),...s.updatedFeatures.map(e=>e.globalId),...s.deletedFeatures.map(e=>e.globalId)]),o}loadQueryEngine(e){const t=new T({geometryType:f.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),r=new v({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:f.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,featureIdInfo:{type:"object-id",fieldName:this.objectIdField},spatialReference:this.spatialReference.toJSON(),timeInfo:this.timeInfo?.toJSON(),featureStore:t});return r.featureStore.addMany(e),r}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new je({where:"1=1",outFields:[O]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}load(e){return this.addResolvingPromise(this.parent.load(e).then(()=>ye(this.timeInfo,this.fieldsIndex))),Promise.resolve(this)}async _setupQueryObjects(e,t){const r=je.from(e),i=r.geometry;if(i&&!i.spatialReference?.isWGS84&&(await m(i.spatialReference,g),r.geometry=h(i instanceof d||i instanceof u||i instanceof y?i:i.extent,g)),"link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)return{resolvedQuery:r,queryEngine:this._cachedQueryEngine};const o=await this.parentCompositeLayer.dataManager.getData(r,this,t);return{resolvedQuery:r,queryEngine:this.loadQueryEngine(o)}}};function _e(e,t,r){const i=[["ESRI__AGGREGATION_COUNT",E],["ESRI__ORIGIN_ID",L],["ESRI__DESTINATION_ID",N],["ESRI__LAYOUT_GEOMETRY",x]];try{for(const t of e)for(const[e,r]of i)t.labelExpression=t.labelExpression?.replaceAll(e,r),t.labelExpressionInfo?.expression&&(t.labelExpressionInfo.expression=t.labelExpressionInfo.expression.replaceAll(e,r))}catch(s){o.getLogger(this).warn("Error updating labelingInfo",s)}return ue(e,t,r)}e([n(Ie(i(U)))],Ne.prototype,"blendMode",void 0),e([n({readOnly:!0})],Ne.prototype,"capabilities",null),e([n({readOnly:!0})],Ne.prototype,"userHasUpdateItemPrivileges",null),e([n({type:Boolean})],Ne.prototype,"editingEnabled",null),e([n()],Ne.prototype,"isTable",null),e([n({json:{origins:{"web-scene":{write:!1}},write:Se()}})],Ne.prototype,"charts",void 0),e([n({readOnly:!0})],Ne.prototype,"defaultPopupTemplate",null),e([n({type:String,json:{origins:{service:{read:!1}},name:"layerDefinition.definitionExpression",write:{ignoreOrigin:!0}}})],Ne.prototype,"definitionExpression",void 0),e([n(Ie(i(Z)))],Ne.prototype,"displayFilterEnabled",void 0),e([n(Ie(i(K)))],Ne.prototype,"displayFilterInfo",void 0),e([n(Ie(i(A)))],Ne.prototype,"effect",void 0),e([n()],Ne.prototype,"elevationInfo",void 0),e([n(Ie(i(H)))],Ne.prototype,"featureEffect",void 0),e([n(Ie(i(ae)))],Ne.prototype,"featureReduction",null),e([n()],Ne.prototype,"fields",null),e([n()],Ne.prototype,"formTemplate",null),e([n()],Ne.prototype,"geometryType",null),e([n()],Ne.prototype,"geometryFieldName",null),e([n({readOnly:!0})],Ne.prototype,"graphicOrigin",null),e([n({type:["entity","relationship"],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],Ne.prototype,"graphType",void 0),e([n({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],Ne.prototype,"graphTypeName",null),e([n()],Ne.prototype,"hasM",null),e([n()],Ne.prototype,"hasZ",null),e([n({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],Ne.prototype,"id",void 0),e([n({type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",default:!1,write:{overridePolicy(){return{enabled:!!this.geometryType,alwaysWriteDefaults:!0,ignoreOrigin:!0}}}}})],Ne.prototype,"labelsVisible",void 0),e([n({type:[de],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:_e,write:Se()}})],Ne.prototype,"labelingInfo",null),e([n({readOnly:!0,json:{read:!1,write:{writer(e,t){switch(this.parentCompositeLayer?.type){case"link-chart":t.layerType="LinkChartSubLayer";break;case"knowledge-graph":t.layerType=this.geometryType?"KnowledgeGraphSubLayer":"KnowledgeGraphSubTable"}},isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],Ne.prototype,"layerType",void 0),e([n(Ie(i(re)))],Ne.prototype,"legendEnabled",void 0),e([n(Ie(i(ie)))],Ne.prototype,"maxScale",void 0),e([n(Ie(i(oe)))],Ne.prototype,"minScale",void 0),e([n()],Ne.prototype,"objectIdField",void 0),e([n()],Ne.prototype,"objectType",void 0),e([n(Ie(i(se)))],Ne.prototype,"opacity",void 0),e([n(Ie(i(z)))],Ne.prototype,"orderBy",void 0),e([n({clonable:!1})],Ne.prototype,"parent",void 0),e([n()],Ne.prototype,"parentCompositeLayer",void 0),e([n(Ie(i(ne)))],Ne.prototype,"popupEnabled",void 0),e([n({type:t,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],Ne.prototype,"popupTemplate",void 0),e([n({type:Number,json:{write:{overridePolicy:Le}}})],Ne.prototype,"refreshInterval",void 0),e([n({types:ge,json:{name:"layerDefinition.drawingInfo.renderer",write:Se()}})],Ne.prototype,"renderer",null),e([n()],Ne.prototype,"source",void 0),e([n()],Ne.prototype,"spatialReference",null),e([n()],Ne.prototype,"templates",null),e([n({type:me,json:{name:"layerDefinition.timeInfo",write:{overridePolicy:Le},origins:{"web-document":{name:"layerDefinition.timeInfo",read:!0,write:{overridePolicy:Le}},"portal-item":{name:"layerDefinition.timeInfo",read:!0,write:{overridePolicy:Le}}}}})],Ne.prototype,"timeInfo",null),e([n({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],Ne.prototype,"title",null),e([p("title")],Ne.prototype,"writeTitle",null),e([n({json:{read:!1}})],Ne.prototype,"type",void 0),e([n(Ie(i(te)))],Ne.prototype,"useViewTime",void 0),e([n({type:Boolean,json:{name:"visibility",write:Se()}})],Ne.prototype,"visible",void 0),Ne=e([a("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],Ne);export{Ne as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../Color.js";import{getOrCreateMapValue as t}from"../../core/MapUtils.js";import{queryBinsCapabilities as s,queryCapabilities as o}from"../graphics/data/QueryEngineCapabilities.js";import{systemOidFieldName as a}from"./constants.js";import r from"../support/LabelClass.js";import n from"../support/LabelExpressionInfo.js";import{fetchClientDataAtKeys as p}from"../../rest/knowledgeGraphService.js";import i from"../../rest/knowledgeGraph/Entity.js";import l from"../../rest/knowledgeGraph/GraphApplyEdits.js";import u from"../../rest/knowledgeGraph/Relationship.js";import{isGraphic as d}from"../../support/guards.js";import c from"../../symbols/CIMSymbol.js";import y from"../../symbols/TextSymbol.js";const m={initializeLayersFromClientData:async(e,t,s)=>{if(t||(t=[...e.layers,...e.tables].map(e=>e.graphTypeName)),0===t?.length)return;const o=new Map;for(const r of t)o.set(r,f(e,r));const a=await p(e.dataManager.knowledgeGraph,Array.from(o.values()),{requestOptions:{signal:s?.signal}});for(const r of[...e.layers,...e.tables]){const t=r.objectType.name;if(null==t)continue;const s=a.get(f(e,t));if(s){const e=JSON.parse(s);null===e||"object"!=typeof e||e.hasOwnProperty("showLabels")||(e.showLabels=!1),r.read(e,{origin:"service"})}}}},f=(e,t)=>"knowledge-graph"===e.type?`${t}/Map`:`${t}/LinkChart/LinkChartSubLayer`;async function b(e,t,s){return m.initializeLayersFromClientData(e,t,s)}const h=["#4a0932","#b31515","#18382e","#a64f1b","#102432","#8c213f","#ed9310","#2c6954","#144d59","#ffc730","#75351e","#454f4b","#78b1c2","#191921","#8f8f82","#9be0c0","#dbb658","#87b051","#11495c","#c43541","#9c5596","#44498b","#ad9d63","#86afb3","#5c98ca","#b0bfa2","#73241f","#b86b53","#d9d78c","#3e756d","#f260a1","#a0d17d","#c27c30","#eb82eb","#ffdf3c","#ffb259","#ab52b3","#3cccb4","#0095ba","#d92b30"],g="#8f8f82";function w(t){return t<0||t>=h.length?new e(g):new e(h[t])}function I(e){const t=e.toArray();return new c({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",enable:!0,style:"solid",width:.75,color:t},{type:"CIMVectorMarker",enable:!0,size:6,markerPlacement:{type:"CIMMarkerPlacementOnLine",angleToLine:!0,relativeTo:"LineMiddle"},frame:{xmin:-10,ymin:-5,xmax:0,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[-12,-3.47],[-12,3.6],[1.96,-.03],[-12,-3.47]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:t}]}}]}]}}})}function C(e){let t="ESRI__ID",s=4;for(const o of e)if(o.name){if("name"===o.name.toLowerCase()){t=o.name;break}o.name.toLowerCase().includes("name")?(t=o.name,s=2):"esriFieldTypeString"===o.fieldType&&s>3&&(t=o.name,s=3)}return t}function S(e,t,s){const o={color:[80,80,80],haloColor:[255,255,255],haloSize:.7,font:{size:10,weight:"normal"}},a=new r({labelExpressionInfo:new n({expression:"ESRI__ID"===s?`${t}`:`$feature.${s}`}),labelPlacement:"above-center",symbol:new y(o)}),p=new r({labelExpressionInfo:new n({expression:`'${t}' + IIf($feature.ESRI__AggregationCount>1, ' (' + $feature.ESRI__AggregationCount + ')', '')`}),labelPlacement:"center-along",labelPosition:"parallel",repeatLabel:!1,symbol:new y({...o,yoffset:"12px"})});return"entity"===e?[a]:[p]}function A(e,t,s){const o={color:[255,255,255],haloColor:[0,0,0],haloSize:.7,font:{size:10,weight:"bold"}},a="ESRI__ID"===s?`${e}`:`$feature.${s}`;return"point"===t?[new r({labelExpressionInfo:new n({expression:a}),labelPlacement:"above-center",symbol:new y(o)})]:"polyline"===t?[new r({labelExpressionInfo:new n({expression:a}),labelPlacement:"center-along",repeatLabel:!0,symbol:new y(o)})]:"polygon"===t?[new r({labelExpressionInfo:new n({expression:a}),labelPlacement:"always-horizontal",symbol:new y(o)})]:null}const M={capabilities:[],allowGeometryUpdates:!1,serviceCapabilities:{geometryCapabilities:{supportsZValues:!1,supportsMValues:!1}}};function L(e){const{capabilities:t,allowGeometryUpdates:a,serviceCapabilities:{geometryCapabilities:{supportsZValues:r,supportsMValues:n}}}=e?.serviceDefinition||M,p=e?.dataModel.arcgisManaged?t:t.filter(e=>"Query"===e),i=new Set(p);return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:n,supportsZ:r},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:i.has("Create"),supportsDelete:i.has("Delete"),supportsEditing:i.has("Editing"),supportsChangeTracking:!1,supportsQuery:i.has("Query"),supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:i.has("Update"),supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:o,queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:s,editing:{supportsGeometryUpdate:!!e?.dataModel.arcgisManaged&&a,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:i.has("Delete"),supportsUpdateByAnonymous:!1,supportsUpdateByOthers:i.has("Update"),supportsAsyncApplyEdits:!1,zDefault:void 0}}}function R(e,s){const o=new l,r=s.graphTypeName,n=s.graphType,p=e=>{const t={...e};for(const o of s.fields)o.editable||delete t[o.name];for(const s of Object.keys(e))s.includes("ESRI__")&&delete t[s];return t};for(const t of e.addFeatures??[]){const e=p(t.attributes);t.sourceLayer.graphTypeName===r&&("entity"===n?(o.entityAdds||(o.entityAdds=[]),o.entityAdds.push(new i({properties:e,typeName:r}))):(o.relationshipAdds||(o.relationshipAdds=[]),o.relationshipAdds.push(new u({properties:e,typeName:r}))))}for(const t of e.updateFeatures??[]){const e=t.attributes[a],s=p(t.attributes);t.sourceLayer.graphTypeName===r&&("entity"===n?(o.entityUpdates||(o.entityUpdates=[]),o.entityUpdates.push(new i({id:e,properties:s,typeName:r}))):(o.relationshipUpdates||(o.relationshipUpdates=[]),o.relationshipUpdates.push(new u({id:e,properties:s,typeName:r}))))}const c=new Map;for(const i of e.deleteFeatures??[])if(d(i)){const e=i,s=t(c,e.sourceLayer.graphTypeName,()=>({typeName:e.sourceLayer.graphTypeName,ids:[]}));e.sourceLayer.graphTypeName===r&&s.ids.push(e.attributes[a])}else if(i.objectId&&"string"==typeof i.objectId){t(c,r,()=>({typeName:r,ids:[]})).ids.push(i.objectId)}for(const t of c.values())t.ids.length>0&&("entity"===n?(o.entityDeletes||(o.entityDeletes=[]),o.entityDeletes.push({typeName:t.typeName,ids:t.ids})):(o.relationshipDeletes||(o.relationshipDeletes=[]),o.relationshipDeletes.push({typeName:t.typeName,ids:t.ids})));return o}function j(e,t){const s={addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]};for(const o of e.editResults)if(o.typeName===t){for(const e of o.adds)s.addFeatureResults.push({objectId:e.id,globalId:e.id});for(const e of o.updates)s.updateFeatureResults.push({objectId:e.id,globalId:e.id});for(const e of o.deletes)s.deleteFeatureResults.push({objectId:e.id,globalId:e.id})}return s}export{j as convertGraphEditsResultToFeatureEdits,R as convertLayerEditsToGraphEdits,L as createCapabilitiesFromKnowledgeGraph,g as fallbackKGSublayerSymbolHexColor,I as getDefaultLCRelationshipSublayerSymbol,C as getDisplayLabelProperty,w as getKGSublayerSymbolColor,S as getLinkChartDefaultLabelingInfo,A as getMapDefaultLabelingInfo,b as initializeLayersFromClientData,m as layerUtils};
5
+ import e from"../../Color.js";import{getOrCreateMapValue as t}from"../../core/MapUtils.js";import{FieldElement as s}from"../../form/elements.js";import o from"../../form/FormTemplate.js";import{initializeProjection as r,project as a}from"../../geometry/projectionUtils.js";import n from"../../geometry/SpatialReference.js";import{normalizeCentralMeridian as p}from"../../geometry/support/normalizeUtils.js";import{queryBinsCapabilities as i,queryCapabilities as l}from"../graphics/data/QueryEngineCapabilities.js";import{systemOidFieldName as u}from"./constants.js";import c from"../support/FeatureTemplate.js";import d from"../support/LabelClass.js";import y from"../support/LabelExpressionInfo.js";import{isKnowledgeGraphSublayer as m}from"../support/layerUtils.js";import{fetchClientDataAtKeys as f}from"../../rest/knowledgeGraphService.js";import b from"../../rest/knowledgeGraph/Entity.js";import h from"../../rest/knowledgeGraph/GraphApplyEdits.js";import g from"../../rest/knowledgeGraph/Relationship.js";import{isGraphic as w}from"../../support/guards.js";import I from"../../symbols/CIMSymbol.js";import C from"../../symbols/TextSymbol.js";const j={initializeLayersFromClientData:async(e,t,s)=>{if(t||(t=[...e.layers,...e.tables].map(e=>e.graphTypeName)),0===t?.length)return;const o=new Map;for(const a of t)o.set(a,S(e,a));const r=await f(e.dataManager.knowledgeGraph,Array.from(o.values()),{requestOptions:{signal:s?.signal}});for(const a of[...e.layers,...e.tables]){const t=a.objectType.name;if(null==t)continue;const s=r.get(S(e,t));if(s){const e=JSON.parse(s);null===e||"object"!=typeof e||e.hasOwnProperty("showLabels")||(e.showLabels=!1),a.read(e,{origin:"service"})}}}},S=(e,t)=>"knowledge-graph"===e.type?`${t}/Map`:`${t}/LinkChart/LinkChartSubLayer`;async function L(e,t,s){return j.initializeLayersFromClientData(e,t,s)}const A=["#4a0932","#b31515","#18382e","#a64f1b","#102432","#8c213f","#ed9310","#2c6954","#144d59","#ffc730","#75351e","#454f4b","#78b1c2","#191921","#8f8f82","#9be0c0","#dbb658","#87b051","#11495c","#c43541","#9c5596","#44498b","#ad9d63","#86afb3","#5c98ca","#b0bfa2","#73241f","#b86b53","#d9d78c","#3e756d","#f260a1","#a0d17d","#c27c30","#eb82eb","#ffdf3c","#ffb259","#ab52b3","#3cccb4","#0095ba","#d92b30"],M="#8f8f82";function R(t){return t<0||t>=A.length?new e(M):new e(A[t])}function T(e){const t=e.toArray();return new I({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",enable:!0,style:"solid",width:.75,color:t},{type:"CIMVectorMarker",enable:!0,size:6,markerPlacement:{type:"CIMMarkerPlacementOnLine",angleToLine:!0,relativeTo:"LineMiddle"},frame:{xmin:-10,ymin:-5,xmax:0,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[-12,-3.47],[-12,3.6],[1.96,-.03],[-12,-3.47]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:t}]}}]}]}}})}function k(e){let t="ESRI__ID",s=4;for(const o of e)if(o.name){if("name"===o.name.toLowerCase()){t=o.name;break}o.name.toLowerCase().includes("name")?(t=o.name,s=2):"esriFieldTypeString"===o.fieldType&&s>3&&(t=o.name,s=3)}return t}function N(e,t,s){const o={color:[80,80,80],haloColor:[255,255,255],haloSize:.7,font:{size:10,weight:"normal"}},r=new d({labelExpressionInfo:new y({expression:"ESRI__ID"===s?`${t}`:`$feature.${s}`}),labelPlacement:"above-center",symbol:new C(o)}),a=new d({labelExpressionInfo:new y({expression:`'${t}' + IIf($feature.ESRI__AggregationCount>1, ' (' + $feature.ESRI__AggregationCount + ')', '')`}),labelPlacement:"center-along",labelPosition:"parallel",repeatLabel:!1,symbol:new C({...o,yoffset:"12px"})});return"entity"===e?[r]:[a]}function E(e,t,s){const o={color:[255,255,255],haloColor:[0,0,0],haloSize:.7,font:{size:10,weight:"bold"}},r="ESRI__ID"===s?`${e}`:`$feature.${s}`;return"point"===t?[new d({labelExpressionInfo:new y({expression:r}),labelPlacement:"above-center",symbol:new C(o)})]:"polyline"===t?[new d({labelExpressionInfo:new y({expression:r}),labelPlacement:"center-along",repeatLabel:!0,symbol:new C(o)})]:"polygon"===t?[new d({labelExpressionInfo:new y({expression:r}),labelPlacement:"always-horizontal",symbol:new C(o)})]:null}const x={capabilities:[],allowGeometryUpdates:!1,serviceCapabilities:{geometryCapabilities:{supportsZValues:!1,supportsMValues:!1}}};function F(e){const{capabilities:t,allowGeometryUpdates:s,serviceCapabilities:{geometryCapabilities:{supportsZValues:o,supportsMValues:r}}}=e?.serviceDefinition||x,a=e?.dataModel.arcgisManaged?t:t.filter(e=>"Query"===e),n=new Set(a);return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:r,supportsZ:o},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:n.has("Create"),supportsDelete:n.has("Delete"),supportsEditing:n.has("Editing"),supportsChangeTracking:!1,supportsQuery:n.has("Query"),supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:n.has("Update"),supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:l,queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:i,editing:{supportsGeometryUpdate:!!e?.dataModel.arcgisManaged&&s,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:n.has("Delete"),supportsUpdateByAnonymous:!1,supportsUpdateByOthers:n.has("Update"),supportsAsyncApplyEdits:!1,zDefault:void 0}}}async function U(e,s){const o=new h,i=s.graphTypeName,l=s.graphType,c="knowledge-graph"===s.parentCompositeLayer.type?s.geometryFieldName:null,d=!!s.fieldsIndex.get(c)?.editable,y=e=>{const t={...e};for(const o of s.fields)o.editable||delete t[o.name];for(const s of Object.keys(e))s.includes("ESRI__")&&delete t[s];return t},f=async e=>{await r(e.spatialReference,n.WGS84);const t=a(e,n.WGS84);if("point"===t.type)return t.normalize();return(await p(t))[0]};for(const t of e.addFeatures??[]){const e=y(t.attributes);m(t.sourceLayer)&&t.sourceLayer.graphTypeName===i&&("entity"===l?(o.entityAdds||(o.entityAdds=[]),c&&t.geometry&&(e[c]=await f(t.geometry)),o.entityAdds.push(new b({properties:e,typeName:i}))):(o.relationshipAdds||(o.relationshipAdds=[]),o.relationshipAdds.push(new g({properties:e,typeName:i}))))}for(const t of e.updateFeatures??[]){const e=t.attributes[u],s=y(t.attributes);m(t.sourceLayer)&&t.sourceLayer.graphTypeName===i&&("entity"===l?(o.entityUpdates||(o.entityUpdates=[]),c&&d&&t.geometry&&(s[c]=await f(t.geometry)),o.entityUpdates.push(new b({id:e,properties:s,typeName:i}))):(o.relationshipUpdates||(o.relationshipUpdates=[]),o.relationshipUpdates.push(new g({id:e,properties:s,typeName:i}))))}const I=new Map;for(const r of e.deleteFeatures??[])if(w(r)){const e=r,s=t(I,e.sourceLayer.graphTypeName,()=>({typeName:e.sourceLayer.graphTypeName,ids:[]}));e.sourceLayer.graphTypeName===i&&s.ids.push(e.attributes[u])}else if(r.objectId&&"string"==typeof r.objectId){t(I,i,()=>({typeName:i,ids:[]})).ids.push(r.objectId)}for(const t of I.values())t.ids.length>0&&("entity"===l?(o.entityDeletes||(o.entityDeletes=[]),o.entityDeletes.push({typeName:t.typeName,ids:t.ids})):(o.relationshipDeletes||(o.relationshipDeletes=[]),o.relationshipDeletes.push({typeName:t.typeName,ids:t.ids})));return o}function D(e,t){const s={addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]};for(const o of e.editResults)if(o.typeName===t){for(const e of o.adds)s.addFeatureResults.push({objectId:e.id,globalId:e.id});for(const e of o.updates)s.updateFeatureResults.push({objectId:e.id,globalId:e.id});for(const e of o.deletes)s.deleteFeatureResults.push({objectId:e.id,globalId:e.id})}return s}function v(e){if(!e.objectType)return null;const t=[];for(const o of e.fields)!o.name.includes("ESRI__")&&o.editable&&"geometry"!==o.type&&t.push(new s({fieldName:o.name}));return new o({elements:t})}function G(e){if(!e.objectType)return null;let t=null;switch(e.geometryType){case"point":case"multipoint":t="point";break;case"polyline":t="line";break;case"polygon":t="polygon";break;default:t=null}return[new c({name:e.graphTypeName,drawingTool:t,prototype:{}})]}export{D as convertGraphEditsResultToFeatureEdits,U as convertLayerEditsToGraphEdits,F as createCapabilitiesFromKnowledgeGraph,G as createDefaultKGSLFeatureTemplates,v as createDefaultKGSLFormTemplate,M as fallbackKGSublayerSymbolHexColor,T as getDefaultLCRelationshipSublayerSymbol,k as getDisplayLabelProperty,R as getKGSublayerSymbolColor,N as getLinkChartDefaultLabelingInfo,E as getMapDefaultLabelingInfo,L as initializeLayersFromClientData,j as layerUtils};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{isArrayLike as e}from"../../../core/arrayUtils.js";import{deg2rad as t}from"../../../core/mathUtils.js";import{clone as a,zeros as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import i from"../../../geometry/Point.js";import{isElevationSource as n}from"../core/ElevationSourceDefinitions.js";import{rectifyMapPointPanoramic as o,rectifyMapPoint as c}from"./rectifyMapPoint.js";import{getWebMercatorScalingFactor as s,hasAngles as f,convertPixelToHeadingPitch as l,isElevationSampler as m,reducerFn as p,validatePixelsToTransform as h,validateRotationMatrix as u,computeFarplaneVertices as y,computeHFOVAndVFOV as d,vecToPoint as w,or as g,isUpdateElevationWithElevationSource as v,scaleAndAddWithFactor as x,computeNewReferenceCoordinates as M,projectiveTransform as R}from"./utils.js";import{worldToImage as A}from"./worldToImage.js";import{viewingLimit as P}from"../../../widgets/OrientedImageryViewer/constants.js";async function V(e,t,a){const{verticalFieldOfView:r,imageBoundaries:i,scalingFactor:n,farPlaneVertices:o,cameraLocation:c,pixelsToTransform:s,vecToPoint:f,pixelDepths:l}=S(e,t),m=new Array;return await j(s,o,i,f,t,m,c,n,r,a,l),Array.isArray(e)?m:m[0]}async function j(e,t,a,r,n,o,s,f,l,p,h){let u=n.averageElevation,y=0;for(const d of e){const e=L(t,a,d,r,n),w=h?.at(y);if("number"==typeof w){const t=F(e,s,f),a=w*f,r=[s[0]+t[0]*a,s[1]+t[1]*a,s[2]+t[2]*w];o.push(new i(r,n.cameraLocation.spatialReference));continue}if(y+=1,p&&g(m(p.elevationSample),v(p))){u=(await c(r(e),{x:d[0],y:d[1]},{...n,...p,farPlaneVertices:t.map(r)}))[2]}o.push(r(b(e,s,f,u,n.cameraPitch,l)))}}function F(e,t,a){const i=e[0]-t[0],n=e[1]-t[1],o=e[2]-t[2],c=Math.hypot(i,n)/a,s=Math.hypot(o,c)*a,f=r();return f[0]=i/s,f[1]=n/s,f[2]=o/s,f[2]=f[2]*a,f}function b(e,t,r,i,n,o){let c=a(e);const s=F(e,t,r);if(T(e[2],i,n,o)){const e=Math.abs((t[2]-i)/-s[2])*r;c=x(t,s,e,r)}else c[2]=i;return c}function T(e,t,a,r){return e<t||a+r/2<P}function L(e,t,a,r,i){let n=null;const o=9;let c,s=0,f=e,l=t;for(;s<=o;){const e=D(a,l,f,i);if(c=e.error,n=e.transformedPoint,g(c<=1,s===o))break;f=M(f,c,a,t),l=O(f,r,i),s++}return n}function O(e,t,a){return A(e.map(t),a).map(({x:e,y:t})=>[e,t,1])}function D(e,t,a,r){const{cameraLocation:n}=r,o=R(e,t,a),{x:c,y:s}=A(new i(o,n.spatialReference),r);return{transformedPoint:o,error:E(e,[c,s,1])}}function E(e,t){return Math.abs(e[0]-t[0])+Math.abs(e[1]-t[1])}function S(t,a){const r=e(t)||"items"in t?t:[t],{cameraLocation:n,rotationMatrix:o}=a;if(h(r,n),u(o),9!==o?.length)throw new Error("Rotation matrix is not provided or is not a valid 3x3 matrix");const c=s(n.y,n.spatialReference),f=y({...a,scalingFactor:c}),l=A(f.map(e=>new i(e,n.spatialReference)),a),{vfov:m}=d(a.horizontalFieldOfView,a.verticalFieldOfView,a.cameraRoll);return{cameraLocation:n.toArray(),imageBoundaries:l.map(({x:e,y:t})=>[e,t,1]),verticalFieldOfView:m,farPlaneVertices:f,scalingFactor:c,pixelsToTransform:r.map(e=>[e.x,e.y,1]),vecToPoint:w(n.spatialReference),pixelDepths:r.map(e=>B(e)?e.depth:void 0)}}function B(e){return"depth"in e&&"number"==typeof e.depth}async function H(e,a,r){const{cameraHeading:c,cameraLocation:h,farDistance:u,imageHeight:y,imageWidth:d,verticalFieldOfView:w}=a,g=s(h.y,h.spatialReference),v=u*g,x=new Array,[M,R,A]=h.toArray(),P=Array.isArray(e)?e:[e];for(const s of P){let e,P;const V=B(s),j=V?s.depth*g:v;if(f(s))e=s.heading,P=s.pitch;else{const t=l({x:s.x,y:s.y},d,y);e=t.heading,P=t.pitch}e=(e+c)%360;const F=[M+Math.sin(t(e))*Math.sin(t(P))*j,R+Math.cos(t(e))*Math.sin(t(P))*j,A+-Math.cos(t(P))*(V?s.depth:u)];if(V){x.push(new i(F,h.spatialReference));continue}let T=a.averageElevation;if(r&&(n(r)||m(r.elevationSample))){T=(await o(new i(F,h.spatialReference),{heading:e,pitch:P},{...a,...r,farPlaneVertices:p(u,u).map(([e,t])=>new i([h.x+e,h.y+t],h.spatialReference))}))[2]}x.push(new i(b(F,h.toArray(),g,T,P,w),h.spatialReference))}return Array.isArray(e)?x:x[0]}export{V as imageToWorld,H as imageToWorldPanoramic};
5
+ import{isArrayLike as e}from"../../../core/arrayUtils.js";import{deg2rad as t}from"../../../core/mathUtils.js";import{clone as a,zeros as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import i from"../../../geometry/Point.js";import{isElevationSource as n}from"../core/ElevationSourceDefinitions.js";import{rectifyMapPointPanoramic as o,rectifyMapPoint as c}from"./rectifyMapPoint.js";import{getWebMercatorScalingFactor as s,hasAngles as f,convertPixelToHeadingPitch as l,isElevationSampler as m,reducerFn as p,validatePixelsToTransform as h,validateRotationMatrix as u,computeFarplaneVertices as y,computeHFOVAndVFOV as d,vecToPoint as w,or as g,isUpdateElevationWithElevationSource as v,scaleAndAddWithFactor as x,computeNewReferenceCoordinates as M,projectiveTransform as R}from"./utils.js";import{worldToImage as A}from"./worldToImage.js";import{viewingLimit as P}from"../../../widgets/OrientedImageryViewer/constants.js";async function V(e,t,a){const{verticalFieldOfView:r,imageBoundaries:i,scalingFactor:n,farPlaneVertices:o,cameraLocation:c,pixelsToTransform:s,vecToPoint:f,pixelDepths:l}=S(e,t),m=new Array;return await j(s,o,i,f,t,m,c,n,r,a,l),Array.isArray(e)?m:m[0]}async function j(e,t,a,r,n,o,s,f,l,p,h){let u=n.averageElevation;const y=e.length;for(let d=0;d<y;d+=1){const y=e.at(d),w=L(t,a,y,r,n),x=h?.at(d);if("number"==typeof x){const e=F(w,s,f),t=x*f,a=[s[0]+e[0]*t,s[1]+e[1]*t,s[2]+e[2]*x];o.push(new i(a,n.cameraLocation.spatialReference));continue}if(p&&g(m(p.elevationSample),v(p))){u=(await c(r(w),{x:y[0],y:y[1]},{...n,...p,farPlaneVertices:t.map(r)}))[2]}o.push(r(b(w,s,f,u,n.cameraPitch,l)))}}function F(e,t,a){const i=e[0]-t[0],n=e[1]-t[1],o=e[2]-t[2],c=Math.hypot(i,n)/a,s=Math.hypot(o,c)*a,f=r();return f[0]=i/s,f[1]=n/s,f[2]=o/s,f[2]=f[2]*a,f}function b(e,t,r,i,n,o){let c=a(e);const s=F(e,t,r);if(T(e[2],i,n,o)){const e=Math.abs((t[2]-i)/-s[2])*r;c=x(t,s,e,r)}else c[2]=i;return c}function T(e,t,a,r){return e<t||a+r/2<P}function L(e,t,a,r,i){let n=null;const o=9;let c,s=0,f=e,l=t;for(;s<=o;){const e=D(a,l,f,i);if(c=e.error,n=e.transformedPoint,g(c<=1,s===o))break;f=M(f,c,a,t),l=O(f,r,i),s++}return n}function O(e,t,a){return A(e.map(t),a).map(({x:e,y:t})=>[e,t,1])}function D(e,t,a,r){const{cameraLocation:n}=r,o=R(e,t,a),{x:c,y:s}=A(new i(o,n.spatialReference),r);return{transformedPoint:o,error:E(e,[c,s,1])}}function E(e,t){return Math.abs(e[0]-t[0])+Math.abs(e[1]-t[1])}function S(t,a){const r=e(t)||"items"in t?t:[t],{cameraLocation:n,rotationMatrix:o}=a;if(h(r,n),u(o),9!==o?.length)throw new Error("Rotation matrix is not provided or is not a valid 3x3 matrix");const c=s(n.y,n.spatialReference),f=y({...a,scalingFactor:c}),l=A(f.map(e=>new i(e,n.spatialReference)),a),{vfov:m}=d(a.horizontalFieldOfView,a.verticalFieldOfView,a.cameraRoll);return{cameraLocation:n.toArray(),imageBoundaries:l.map(({x:e,y:t})=>[e,t,1]),verticalFieldOfView:m,farPlaneVertices:f,scalingFactor:c,pixelsToTransform:r.map(e=>[e.x,e.y,1]),vecToPoint:w(n.spatialReference),pixelDepths:r.map(e=>B(e)?e.depth:void 0)}}function B(e){return"depth"in e&&"number"==typeof e.depth}async function H(e,a,r){const{cameraHeading:c,cameraLocation:h,farDistance:u,imageHeight:y,imageWidth:d,verticalFieldOfView:w}=a,g=s(h.y,h.spatialReference),v=u*g,x=new Array,[M,R,A]=h.toArray(),P=Array.isArray(e)?e:[e];for(const s of P){let e,P;const V=B(s),j=V?s.depth*g:v;if(f(s))e=s.heading,P=s.pitch;else{const t=l({x:s.x,y:s.y},d,y);e=t.heading,P=t.pitch}e=(e+c)%360;const F=[M+Math.sin(t(e))*Math.sin(t(P))*j,R+Math.cos(t(e))*Math.sin(t(P))*j,A+-Math.cos(t(P))*(V?s.depth:u)];if(V){x.push(new i(F,h.spatialReference));continue}let T=a.averageElevation;if(r&&(n(r)||m(r.elevationSample))){T=(await o(new i(F,h.spatialReference),{heading:e,pitch:P},{...a,...r,farPlaneVertices:p(u,u).map(([e,t])=>new i([h.x+e,h.y+t],h.spatialReference))}))[2]}x.push(new i(b(F,h.toArray(),g,T,P,w),h.spatialReference))}return Array.isArray(e)?x:x[0]}export{V as imageToWorld,H as imageToWorldPanoramic};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Error.js";import{open as r}from"../../core/workers/workers.js";import o from"./PixelBlock.js";class t{constructor(){this._workerThread=null,this._destroyed=!1}async initialize(){const e=await r("RasterWorker");this._destroyed?e.close():this._workerThread=e}destroy(){this._destroyed=!0,this._workerThread&&(this._workerThread.close(),this._workerThread=null)}async convertVectorFieldData(r,t){if(!this._workerThread)throw new e("raster-jobhandler:no-connection","no available worker connection");const n=r.pixelBlock.getTransferableObject().pixelBlock,a=await this._workerThread.invoke("convertVectorFieldData",{pixelBlock:n,type:r.dataType},t);return a?new o(a):null}async convertPixelBlockToFeatures(r,o){if(!this._workerThread)throw new e("raster-jobhandler:no-connection","no available worker connection");const t=await this._workerThread.invoke("convertPixelBlockToFeatures",{pixelBlock:r.pixelBlock.toJSON(),extent:r.extent.toJSON(),fieldNames:r.fieldNames,skipFactor:r.skipFactor,pixelIdOffset:r.pixelIdOffset,imageRowSize:r.imageRowSize},o),n=r.extent.spatialReference?.toJSON();return t.forEach(e=>e.geometry.spatialReference=n),t}computeStatisticsHistograms(r,o){if(!this._workerThread)throw new e("raster-jobhandler:no-connection","no available worker connection");const{transferList:t,pixelBlock:n}=r.pixelBlock.getTransferableObject();return o?.transferPixelsToWorker&&(o={...o,transferList:t}),this._workerThread.invoke("computeStatisticsHistograms",{...r,pixelBlock:n},o)}async compositeBands(r,t){if(!this._workerThread)throw new e("raster-jobhandler:no-connection","no available worker connection");const n=r.pixelBlocks.map(e=>e?.getTransferableObject()),a={pixelBlocks:n.map(e=>e?.pixelBlock)};if(t?.transferPixelsToWorker){const e=n.flatMap(e=>e?.transferList).filter(e=>null!=e);t={...t,transferList:e}}const i=await this._workerThread.invoke("compositeBands",a,t);return i?o.fromJSON(i):null}async decode(r,t){if(!this._workerThread)throw new e("raster-jobhandler:no-connection","no available worker connection");const n=await this._workerThread.invoke("decode",r,{...t,transferList:[r.data]});return n?new o(n):null}async symbolize(r,t){if(!this._workerThread)throw new e("raster-jobhandler:no-connection","no available worker connection");const n=r.pixelBlock?.getTransferableObject().pixelBlock,a={extent:r.extent?.toJSON(),pixelBlock:n,simpleStretchParams:r.simpleStretchParams,bandIds:r.bandIds},i=await this._workerThread.invoke("symbolize",a,t);return i?new o(i):null}async highlightPixels(r,o){if(!this._workerThread)throw new e("raster-jobhandler:no-connection","no available worker connection");const t={pixelBlock:r.pixelBlock?.toJSON(),renderedPixelBlock:r.renderedPixelBlock?.toJSON(),highlightOptions:r.highlightOptions},n=await this._workerThread.invoke("highlightPixels",t,o);r.renderedPixelBlock.pixels=n.pixels,r.renderedPixelBlock.mask=n.mask,r.renderedPixelBlock.maskIsAlpha=n.maskIsAlpha}async updateSymbolizer(r,o){if(!this._workerThread)throw new e("raster-jobhandler:no-connection","no available worker connection");const t=r?.rendererJSON?.histograms;await Promise.all(this._workerThread.broadcast("updateSymbolizer",{symbolizerJSON:r.toJSON(),histograms:t},o))}async updateRasterFunction(r,o){if(!this._workerThread)throw new e("raster-jobhandler:no-connection","no available worker connection");await Promise.all(this._workerThread.broadcast("updateRasterFunction",{rasterFunctionJSON:r.toJSON()},o))}async process(r,t){if(!this._workerThread)throw new e("raster-jobhandler:no-connection","no available worker connection");const n=await this._workerThread.invoke("process",{extent:r.extent?.toJSON(),primaryPixelSizes:r.primaryPixelSizes?.map(e=>null!=e?e.toJSON():null),primaryPixelBlocks:r.primaryPixelBlocks.map(e=>e?.getTransferableObject().pixelBlock),primaryRasterIds:r.primaryRasterIds},t);return n?new o(n):null}async stretch(r,t){if(!this._workerThread)throw new e("raster-jobhandler:no-connection","no available worker connection");if(!r?.pixelBlock)return null;const n={srcPixelBlock:r.pixelBlock.getTransferableObject().pixelBlock,stretchParams:r.stretchParams},a=await this._workerThread.invoke("stretch",n,t);return a?new o(a):null}async split(r,t){if(!this._workerThread)throw new e("raster-jobhandler:no-connection","no available worker connection");if(!r?.pixelBlock)return null;const n={srcPixelBlock:r.pixelBlock.getTransferableObject().pixelBlock,tileSize:r.tileSize,maximumPyramidLevel:r.maximumPyramidLevel,useBilinear:r.useBilinear},a=await this._workerThread.invoke("split",n,t);return a&&a.forEach((e,r)=>{a.set(r,e?o.fromJSON(e):null)}),a}async clipTile(r,t){if(!this._workerThread)throw new e("raster-jobhandler:no-connection","no available worker connection");if(!r?.pixelBlock)return null;const n=r.pixelBlock.getTransferableObject().pixelBlock,a={...r,pixelBlock:n},i=await this._workerThread.invoke("clipTile",a,t);return i?o.fromJSON(i):null}async estimateStatisticsHistograms(r,o){if(!this._workerThread)throw new e("raster-jobhandler:no-connection","no available worker connection");if(!r?.pixelBlock)return null;const t={srcPixelBlock:r.pixelBlock.getTransferableObject().pixelBlock};return await this._workerThread.invoke("estimateStatisticsHistograms",t,o)}async mosaicAndTransform(r,t){if(!this._workerThread)throw new e("raster-jobhandler:no-connection","no available worker connection");if(!r?.srcPixelBlocks?.length)return{pixelBlock:null};const n=r.srcPixelBlocks.map(e=>e?.getTransferableObject()),a={...r,srcPixelBlocks:n.map(e=>e?.pixelBlock)};if(t?.transferPixelsToWorker){const e=n.flatMap(e=>e?.transferList).filter(e=>null!=e);t={...t,transferList:e}}const i=await this._workerThread.invoke("mosaicAndTransform",a,t);return{pixelBlock:i.pixelBlock?new o(i.pixelBlock):null,localNorthDirections:i.localNorthDirections}}async createFlowMesh(r,o){if(!this._workerThread)throw new e("raster-jobhandler:no-connection","no available worker connection");const t={buffer:r.flowData.data.buffer,maskBuffer:r.flowData.mask.buffer,width:r.flowData.width,height:r.flowData.height},{meshType:n,simulationSettings:a}=r,i=await this._workerThread.invoke("createFlowMesh",{meshType:n,flowData:t,simulationSettings:a},{...o,transferList:[t.buffer,t.maskBuffer]});return{vertexData:new Float32Array(i.vertexBuffer),indexData:new Uint32Array(i.indexBuffer)}}getProjectionOffsetGrid(r,o){if(!this._workerThread)throw new e("raster-jobhandler:no-connection","no available worker connection");const t=null!=r.datumTransformation?r.datumTransformation.steps.map(e=>({wkid:e.wkid,wkt:e.wkt,isInverse:e.isInverse})):null,n=null!=r.rasterTransform?r.rasterTransform.toJSON():null,a={projectedExtent:r.projectedExtent.toJSON(),srcBufferExtent:r.srcBufferExtent.toJSON(),pixelSize:r.pixelSize,hasWrapAround:r.hasWrapAround,spacing:r.spacing,datumTransformationSteps:t,rasterTransform:n,isAdaptive:r.isAdaptive,includeGCSGrid:r.includeGCSGrid};return this._workerThread.invoke("getProjectionOffsetGrid",a,o)}}export{t as default};
5
+ import e from"../../core/Error.js";import{open as r}from"../../core/workers/workers.js";import t from"./PixelBlock.js";class i{constructor(){this._workerThread=null,this._destroyed=!1}async initialize(){const e=await r("RasterWorker");this._destroyed?e.close():this._workerThread=e}destroy(){this._destroyed=!0,this._workerThread&&(this._workerThread.close(),this._workerThread=null)}async convertVectorFieldData(e,r){a(this._workerThread);const i=e.pixelBlock.getTransferableObject().pixelBlock,s=await this._workerThread.invoke("convertVectorFieldData",{pixelBlock:i,type:e.dataType},r);return s?new t(s):null}async convertPixelBlockToFeatures(e,r){a(this._workerThread);const t=await this._workerThread.invoke("convertPixelBlockToFeatures",{pixelBlock:e.pixelBlock.toJSON(),extent:e.extent.toJSON(),fieldNames:e.fieldNames,skipFactor:e.skipFactor,pixelIdOffset:e.pixelIdOffset,imageRowSize:e.imageRowSize},r),i=e.extent.spatialReference?.toJSON();return t.forEach(e=>e.geometry.spatialReference=i),t}computeStatisticsHistograms(e,r){a(this._workerThread);const{transferList:t,pixelBlock:i}=e.pixelBlock.getTransferableObject();return r?.transferPixelsToWorker&&(r={...r,transferList:t}),this._workerThread.invoke("computeStatisticsHistograms",{...e,pixelBlock:i},r)}async transformPixels(e,r){a(this._workerThread);const{transferList:i,pixelBlock:s}=e.pixelBlock.getTransferableObject();r?.transferPixelsToWorker&&(r={...r,transferList:i});const o=await this._workerThread.invoke("transformPixels",{...e,pixelBlock:s},r);return t.fromJSON(o)}async compositeBands(e,r){a(this._workerThread);const i=e.pixelBlocks.map(e=>e?.getTransferableObject()),s={pixelBlocks:i.map(e=>e?.pixelBlock)};if(r?.transferPixelsToWorker){const e=i.flatMap(e=>e?.transferList).filter(e=>null!=e);r={...r,transferList:e}}const o=await this._workerThread.invoke("compositeBands",s,r);return o?t.fromJSON(o):null}async decode(e,r){a(this._workerThread);const i=await this._workerThread.invoke("decode",e,{...r,transferList:[e.data]});return i?new t(i):null}async symbolize(e,r){a(this._workerThread);const i=e.pixelBlock?.getTransferableObject().pixelBlock,s={extent:e.extent?.toJSON(),pixelBlock:i,simpleStretchParams:e.simpleStretchParams,bandIds:e.bandIds},o=await this._workerThread.invoke("symbolize",s,r);return o?new t(o):null}async highlightPixels(e,r){a(this._workerThread);const t={pixelBlock:e.pixelBlock?.toJSON(),renderedPixelBlock:e.renderedPixelBlock?.toJSON(),highlightOptions:e.highlightOptions},i=await this._workerThread.invoke("highlightPixels",t,r);e.renderedPixelBlock.pixels=i.pixels,e.renderedPixelBlock.mask=i.mask,e.renderedPixelBlock.maskIsAlpha=i.maskIsAlpha}async updateSymbolizer(e,r){a(this._workerThread);const t=e?.rendererJSON?.histograms;await Promise.all(this._workerThread.broadcast("updateSymbolizer",{symbolizerJSON:e.toJSON(),histograms:t},r))}async updateRasterFunction(e,r){a(this._workerThread),await Promise.all(this._workerThread.broadcast("updateRasterFunction",{rasterFunctionJSON:e.toJSON()},r))}async process(e,r){a(this._workerThread);const i=await this._workerThread.invoke("process",{extent:e.extent?.toJSON(),primaryPixelSizes:e.primaryPixelSizes?.map(e=>null!=e?e.toJSON():null),primaryPixelBlocks:e.primaryPixelBlocks.map(e=>e?.getTransferableObject().pixelBlock),primaryRasterIds:e.primaryRasterIds},r);return i?new t(i):null}async stretch(e,r){if(a(this._workerThread),!e?.pixelBlock)return null;const i={srcPixelBlock:e.pixelBlock.getTransferableObject().pixelBlock,stretchParams:e.stretchParams},s=await this._workerThread.invoke("stretch",i,r);return s?new t(s):null}async split(e,r){if(a(this._workerThread),!e?.pixelBlock)return null;const i={srcPixelBlock:e.pixelBlock.getTransferableObject().pixelBlock,tileSize:e.tileSize,maximumPyramidLevel:e.maximumPyramidLevel,useBilinear:e.useBilinear},s=await this._workerThread.invoke("split",i,r);return s&&s.forEach((e,r)=>{s.set(r,e?t.fromJSON(e):null)}),s}async clipTile(e,r){if(a(this._workerThread),!e?.pixelBlock)return null;const i=e.pixelBlock.getTransferableObject().pixelBlock,s={...e,pixelBlock:i},o=await this._workerThread.invoke("clipTile",s,r);return o?t.fromJSON(o):null}async estimateStatisticsHistograms(e,r){if(a(this._workerThread),!e?.pixelBlock)return null;const t={srcPixelBlock:e.pixelBlock.getTransferableObject().pixelBlock};return await this._workerThread.invoke("estimateStatisticsHistograms",t,r)}async mosaicAndTransform(e,r){if(a(this._workerThread),!e?.srcPixelBlocks?.length)return{pixelBlock:null};const i=e.srcPixelBlocks.map(e=>e?.getTransferableObject()),s={...e,srcPixelBlocks:i.map(e=>e?.pixelBlock)};if(r?.transferPixelsToWorker){const e=i.flatMap(e=>e?.transferList).filter(e=>null!=e);r={...r,transferList:e}}const o=await this._workerThread.invoke("mosaicAndTransform",s,r);return{pixelBlock:o.pixelBlock?new t(o.pixelBlock):null,localNorthDirections:o.localNorthDirections}}async createFlowMesh(e,r){a(this._workerThread);const t={buffer:e.flowData.data.buffer,maskBuffer:e.flowData.mask.buffer,width:e.flowData.width,height:e.flowData.height},{meshType:i,simulationSettings:s}=e,o=await this._workerThread.invoke("createFlowMesh",{meshType:i,flowData:t,simulationSettings:s},{...r,transferList:[t.buffer,t.maskBuffer]});return{vertexData:new Float32Array(o.vertexBuffer),indexData:new Uint32Array(o.indexBuffer)}}getProjectionOffsetGrid(e,r){a(this._workerThread);const t=null!=e.datumTransformation?e.datumTransformation.steps.map(e=>({wkid:e.wkid,wkt:e.wkt,isInverse:e.isInverse})):null,i=null!=e.rasterTransform?e.rasterTransform.toJSON():null,s={projectedExtent:e.projectedExtent.toJSON(),srcBufferExtent:e.srcBufferExtent.toJSON(),pixelSize:e.pixelSize,hasWrapAround:e.hasWrapAround,spacing:e.spacing,datumTransformationSteps:t,rasterTransform:i,isAdaptive:e.isAdaptive,includeGCSGrid:e.includeGCSGrid};return this._workerThread.invoke("getProjectionOffsetGrid",s,r)}}function a(r){if(null==r)throw new e("raster-jobhandler:no-connection","no available worker connection")}export{i as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../geometry/Extent.js";import r from"../../geometry/Point.js";import t from"../../geometry/operators/support/GeographicTransformation.js";import s from"./PixelBlock.js";import{decode as o}from"./rasterFormats/RasterCodec.js";import{convertPixelBlockToFeatures as i,compositeBands as n,highlightPixels as l,split as a,clipTile as m,mosaic as c,approximateTransform as f,getLocalArithmeticNorthRotations as p}from"./rasterFunctions/pixelUtils.js";import{create as u}from"./rasterFunctions/rasterFunctionHelper.js";import{load as x,getProjectionOffsetGrid as S}from"./rasterFunctions/rasterProjectionHelper.js";import{computeStatisticsHistograms as d,estimateStatisticsHistograms as h}from"./rasterFunctions/stretchUtils.js";import{convertVectorFieldData as g,convertToLocalDirections as k}from"./rasterFunctions/vectorFieldUtils.js";import{readTransform as y}from"./rasterTransforms/utils.js";import O from"../../renderers/support/RasterSymbolizer.js";import{createFlowMesh as B}from"../../views/2d/engine/flow/dataUtils.js";function N(e){if(!e)return{result:null,transferList:[]};const{pixelBlock:r,transferList:t}=e.getTransferableObject();return{result:r,transferList:t}}class P{convertVectorFieldData(e){const r=s.fromJSON(e.pixelBlock),t=N(g(r,e.type));return Promise.resolve(t)}convertPixelBlockToFeatures(r){const t=i({pixelBlock:s.fromJSON(r.pixelBlock),extent:e.fromJSON(r.extent),fieldNames:r.fieldNames,skipFactor:r.skipFactor,skipSpatialReference:!0,pixelIdOffset:r.pixelIdOffset,imageRowSize:r.imageRowSize});return Promise.resolve(t)}computeStatisticsHistograms(e){const r=s.fromJSON(e.pixelBlock),t=d(r,{histogramSize:e.histogramSize,includeSkewnessKurtosis:e.includeSkewnessKurtosis});return Promise.resolve(t)}compositeBands(e){const r=e.pixelBlocks.map(e=>e&&s.fromJSON(e)),t=N(n(r));return Promise.resolve(t)}async decode(e){return N(await o(e.data,e.options))}symbolize(r){const t=r.pixelBlock?s.fromJSON(r.pixelBlock):null,o=r.extent?e.fromJSON(r.extent):null,i=N(this.symbolizer.symbolize({...r,pixelBlock:t,extent:o}));return Promise.resolve(i)}highlightPixels(e){const r=s.fromJSON(e.pixelBlock),t=s.fromJSON(e.renderedPixelBlock);return l(r,t,e.highlightOptions),Promise.resolve(t.toJSON())}async updateSymbolizer(e){this.symbolizer=O.fromJSON(e.symbolizerJSON),e.histograms&&"rasterStretch"===this.symbolizer?.rendererJSON.type&&(this.symbolizer.rendererJSON.histograms=e.histograms)}async updateRasterFunction(e){this.rasterFunction=u(e.rasterFunctionJSON)}async process(t){return N(this.rasterFunction.process({extent:e.fromJSON(t.extent),primaryPixelBlocks:t.primaryPixelBlocks.map(e=>null!=e?s.fromJSON(e):null),primaryPixelSizes:t.primaryPixelSizes?.map(e=>null!=e?r.fromJSON(e):null),primaryRasterIds:t.primaryRasterIds}))}stretch(e){const r=N(this.symbolizer.simpleStretch(s.fromJSON(e.srcPixelBlock),e.stretchParams));return Promise.resolve(r)}estimateStatisticsHistograms(e){const r=h(s.fromJSON(e.srcPixelBlock));return Promise.resolve(r)}split(e){const r=a(s.fromJSON(e.srcPixelBlock),e.tileSize,e.maximumPyramidLevel??0,!1===e.useBilinear),t=[];let o;return r&&(o=new Map,r.forEach((e,r)=>{if(e){const{pixelBlock:s,transferList:i}=e.getTransferableObject();o.set(r,s),i.forEach(e=>{t.includes(e)||t.push(e)})}})),Promise.resolve({result:o,transferList:t})}clipTile(e){const r=s.fromJSON(e.pixelBlock),t=N(m({...e,pixelBlock:r}));return Promise.resolve(t)}async mosaicAndTransform(e){const r=e.srcPixelBlocks.map(e=>e?new s(e):null),t=c(r,e.srcMosaicSize,{blockWidths:e.blockWidths,alignmentInfo:e.alignmentInfo,clipOffset:e.clipOffset,clipSize:e.clipSize});let o,i=t;e.coefs&&(i=f(t,e.destDimension,e.coefs,e.sampleSpacing,e.interpolation)),e.projectDirections&&e.gcsGrid&&(o=p(e.destDimension,e.gcsGrid),i=k(i,e.isUV?"vector-uv":"vector-magdir",o));const{result:n,transferList:l}=N(i);return{result:{pixelBlock:n,localNorthDirections:o},transferList:l}}async createFlowMesh(e,r){const t={data:new Float32Array(e.flowData.buffer),mask:new Uint8Array(e.flowData.maskBuffer),width:e.flowData.width,height:e.flowData.height},{vertexData:s,indexData:o}=await B(e.meshType,e.simulationSettings,t,r.signal);return{result:{vertexBuffer:s.buffer,indexBuffer:o.buffer},transferList:[s.buffer,o.buffer]}}async getProjectionOffsetGrid(r){const s=e.fromJSON(r.projectedExtent),o=e.fromJSON(r.srcBufferExtent);let i=null;r.datumTransformationSteps?.length&&(i=new t({steps:r.datumTransformationSteps})),await x();const n=r.rasterTransform?y(r.rasterTransform):null;return S({...r,projectedExtent:s,srcBufferExtent:o,datumTransformation:i,rasterTransform:n})}}export{P as default};
5
+ import e from"../../geometry/Extent.js";import r from"../../geometry/Point.js";import t from"../../geometry/operators/support/GeographicTransformation.js";import s from"./PixelBlock.js";import{decode as o}from"./rasterFormats/RasterCodec.js";import{transformPixels as i}from"./rasterFunctions/pixelTransformUtils.js";import{convertPixelBlockToFeatures as n,compositeBands as l,highlightPixels as a,split as m,clipTile as c,mosaic as f,approximateTransform as p,getLocalArithmeticNorthRotations as u}from"./rasterFunctions/pixelUtils.js";import{create as x}from"./rasterFunctions/rasterFunctionHelper.js";import{load as S,getProjectionOffsetGrid as d}from"./rasterFunctions/rasterProjectionHelper.js";import{computeStatisticsHistograms as h,estimateStatisticsHistograms as k}from"./rasterFunctions/stretchUtils.js";import{convertVectorFieldData as y,convertToLocalDirections as O}from"./rasterFunctions/vectorFieldUtils.js";import{readTransform as g}from"./rasterTransforms/utils.js";import B from"../../renderers/support/RasterSymbolizer.js";import{createFlowMesh as P}from"../../views/2d/engine/flow/dataUtils.js";function N(e){if(!e)return{result:null,transferList:[]};const{pixelBlock:r,transferList:t}=e.getTransferableObject();return{result:r,transferList:t}}class J{convertVectorFieldData(e){const r=s.fromJSON(e.pixelBlock),t=N(y(r,e.type));return Promise.resolve(t)}convertPixelBlockToFeatures(r){const t=n({pixelBlock:s.fromJSON(r.pixelBlock),extent:e.fromJSON(r.extent),fieldNames:r.fieldNames,skipFactor:r.skipFactor,skipSpatialReference:!0,pixelIdOffset:r.pixelIdOffset,imageRowSize:r.imageRowSize});return Promise.resolve(t)}transformPixels(e){const r=s.fromJSON(e.pixelBlock),t=i(r,e.transformType,e.transformParameters);return Promise.resolve(N(t))}computeStatisticsHistograms(e){const r=s.fromJSON(e.pixelBlock),t=h(r,{histogramSize:e.histogramSize,includeSkewnessKurtosis:e.includeSkewnessKurtosis});return Promise.resolve(t)}compositeBands(e){const r=e.pixelBlocks.map(e=>e&&s.fromJSON(e)),t=N(l(r));return Promise.resolve(t)}async decode(e){return N(await o(e.data,e.options))}symbolize(r){const t=r.pixelBlock?s.fromJSON(r.pixelBlock):null,o=r.extent?e.fromJSON(r.extent):null,i=N(this.symbolizer.symbolize({...r,pixelBlock:t,extent:o}));return Promise.resolve(i)}highlightPixels(e){const r=s.fromJSON(e.pixelBlock),t=s.fromJSON(e.renderedPixelBlock);return a(r,t,e.highlightOptions),Promise.resolve(t.toJSON())}async updateSymbolizer(e){this.symbolizer=B.fromJSON(e.symbolizerJSON),e.histograms&&"rasterStretch"===this.symbolizer?.rendererJSON.type&&(this.symbolizer.rendererJSON.histograms=e.histograms)}async updateRasterFunction(e){this.rasterFunction=x(e.rasterFunctionJSON)}async process(t){return N(this.rasterFunction.process({extent:e.fromJSON(t.extent),primaryPixelBlocks:t.primaryPixelBlocks.map(e=>null!=e?s.fromJSON(e):null),primaryPixelSizes:t.primaryPixelSizes?.map(e=>null!=e?r.fromJSON(e):null),primaryRasterIds:t.primaryRasterIds}))}stretch(e){const r=N(this.symbolizer.simpleStretch(s.fromJSON(e.srcPixelBlock),e.stretchParams));return Promise.resolve(r)}estimateStatisticsHistograms(e){const r=k(s.fromJSON(e.srcPixelBlock));return Promise.resolve(r)}split(e){const r=m(s.fromJSON(e.srcPixelBlock),e.tileSize,e.maximumPyramidLevel??0,!1===e.useBilinear),t=[];let o;return r&&(o=new Map,r.forEach((e,r)=>{if(e){const{pixelBlock:s,transferList:i}=e.getTransferableObject();o.set(r,s),i.forEach(e=>{t.includes(e)||t.push(e)})}})),Promise.resolve({result:o,transferList:t})}clipTile(e){const r=s.fromJSON(e.pixelBlock),t=N(c({...e,pixelBlock:r}));return Promise.resolve(t)}async mosaicAndTransform(e){const r=e.srcPixelBlocks.map(e=>e?new s(e):null),t=f(r,e.srcMosaicSize,{blockWidths:e.blockWidths,alignmentInfo:e.alignmentInfo,clipOffset:e.clipOffset,clipSize:e.clipSize});let o,i=t;e.coefs&&(i=p(t,e.destDimension,e.coefs,e.sampleSpacing,e.interpolation)),e.projectDirections&&e.gcsGrid&&(o=u(e.destDimension,e.gcsGrid),i=O(i,e.isUV?"vector-uv":"vector-magdir",o));const{result:n,transferList:l}=N(i);return{result:{pixelBlock:n,localNorthDirections:o},transferList:l}}async createFlowMesh(e,r){const t={data:new Float32Array(e.flowData.buffer),mask:new Uint8Array(e.flowData.maskBuffer),width:e.flowData.width,height:e.flowData.height},{vertexData:s,indexData:o}=await P(e.meshType,e.simulationSettings,t,r.signal);return{result:{vertexBuffer:s.buffer,indexBuffer:o.buffer},transferList:[s.buffer,o.buffer]}}async getProjectionOffsetGrid(r){const s=e.fromJSON(r.projectedExtent),o=e.fromJSON(r.srcBufferExtent);let i=null;r.datumTransformationSteps?.length&&(i=new t({steps:r.datumTransformationSteps})),await S();const n=r.rasterTransform?g(r.rasterTransform):null;return d({...r,projectedExtent:s,srcBufferExtent:o,datumTransformation:i,rasterTransform:n})}}export{J as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Error.js";import{throwIfAborted as t}from"../../../core/promiseUtils.js";import i from"../../../geometry/Extent.js";import n from"../../../geometry/Point.js";import o from"../Field.js";import r from"../PixelBlock.js";import{getByteCount as a}from"../rasterFormats/pixelRangeUtils.js";import{snapToRaster as s,clip as l}from"../rasterFunctions/clipUtils.js";import{mosaic as c,pixelIdFieldName as p,convertPixelBlockToFeatures as u,getValidPixels as f,countCategoricalPixels as m}from"../rasterFunctions/pixelUtils.js";import{load as x,projectPolygon as h}from"../rasterFunctions/rasterProjectionHelper.js";import{computeBoxStatistics as y,computeStatisticsHistograms as d}from"../rasterFunctions/stretchUtils.js";import{getBandNames as w}from"../../../renderers/support/rasterRendererHelper.js";import g from"../../../rest/support/ImageIdentifyParameters.js";const k=2**30,b=2048,B=2**20,S=20,j=100;async function R(e,t){return"imagery"===e.type?await e.generateRasterInfo(e.rasterFunction,t):e.raster.rasterInfo}function P(e){const t=[new o({name:p,alias:"Pixel ID",type:"oid"})],{pixelType:i}=e,n="f32"===i?"single":"f64"===i?"double":"integer";return w(e).forEach(e=>{t.push(new o({name:e,alias:e,type:n}))}),t.map(e=>e.toJSON())}async function F(t,i){if(t.spatialReference.equals(i))return t;if("polyline"===t.type){const n=(await import("../../../geometry/operators/projectOperator.js")).execute(t,i);if(null==n)throw new e("read-pixels","failed to project the geometry into the layer's spatial reference");return n}if("extent"===t.type||t.rings[0].length<S){const e=(await import("../../../geometry/operators/lengthOperator.js")).execute(t,{unit:"meters"})/j;t=(await import("../../../geometry/operators/densifyOperator.js")).execute(t,e,{unit:"meters"}),await x(),t=h(t,i)}return t}async function M(e,t,i=!1){const{spatialReference:o}=e,r=t?.geometry,a=await F(r??e.extent,o),l="extent"===a.type?a:a.extent,c=null==r||"extent"===r.type&&r.spatialReference.equals(o)?void 0:a,p=new n({x:e.pixelSize.x,y:e.pixelSize.y,spatialReference:o}),u=!!t?.autoResample,f=u?p:t?.pixelSize??p;let{extent:m,width:x,height:h}=s(e,l,f);if(!u)return{extent:m,clipGeometry:c,width:x,height:h,pixelSize:f};const y=e.storageInfo?.pyramidScalingFactor??2;let{x:d,y:w}=f;const g=t?.maxPixelCount??B;for(;x*h>g&&(!i||Math.max(x,h)>1024);)d*=y,w*=y,x/=y,h/=y;return x=Math.round(x),h=Math.round(h),{extent:m,clipGeometry:c,width:x,height:h,pixelSize:new n({x:d,y:w,spatialReference:o})}}async function*I(e,n,o=!1,r){const{extent:a,clipGeometry:s,width:c,height:p}=n,u=a.width/c,f=a.height/p,m=Math.ceil(c/b),x=Math.ceil(p/b),h=u*b,y=f*b,{xmin:d,xmax:w,ymin:g,ymax:k}=a,B=x*m,S={bandIds:n.bandIds?.length?n.bandIds:void 0,interpolation:"nearest",...r};for(let j=0;j<x;j++)for(let n=0;n<m;n++){t(S);const r=new i({xmin:d+n*h,xmax:o?Math.min(w,d+(n+1)*h):d+(n+1)*h,ymax:k-j*y,ymin:o?Math.max(g,k-(j+1)*y):k-(j+1)*y,spatialReference:a.spatialReference}),c={row:j,col:n},p=j*m+n+1;if(s&&!r.intersects(s)){yield{extent:r,pixelBlock:null,id:c,total:B,current:p};continue}const x=o?Math.round(r.width/u):b,R=o?Math.round(r.height/f):b;let{pixelBlock:P}=await e.fetchPixels(r,x,R,S).catch(()=>({pixelBlock:void 0}));P&&s&&(P=await l(P,r,s)),yield{extent:r,pixelBlock:P,id:c,total:B,current:p}}}async function*T(e,i,n){const o=await R(e,n),r=P(o),a={...i,geometry:i?.geometry??o.extent},s=I(e,await M(o,a),!0,n),l=o.width;for await(const c of s){if(!c.pixelBlock){yield{...c};continue}const a=L(e),{pixelBlock:s}=c,{statistics:p,histograms:u}=await W({pixelBlock:s,rasterJobHandler:a},n),f=c;f.statistics=p,f.histograms=u;const m=c.id.row*o.width*b+c.id.col*b;t(n),f.featureSet=await K({pixelBlock:s,extent:c.extent,fields:r,skipFactor:i?.skipFactor??1,rasterJobHandler:a,pixelIdOffset:m,imageRowSize:l},n),t(n),yield f}}function v(t,i,n){const o=a(i),{width:r,height:s}=t;if(r*s*o>k)throw new e("fetch-pixels","failed to fetch pixels as pixel byte count exceeds the 1GB limit");if(n&&r*s>n)throw new e("fetch-pixels",`failed to fetch pixels as pixel count exceeds the ${n} limit`)}async function z(t,i,n){if(!i.geometry)throw new e("fetch-pixels","geometry is required to fetch pixel feature set");const o=await R(t),r=await M(o,i,!0);v(r,o.pixelType);const{extent:a,pixelSize:s}=r,l=Math.round(o.extent.width/s.x),c=P(o),p={fields:c,features:[]},u=p.features,{maxPixelCount:f}=i,m=!!i.autoResample&&null!=f&&r.width*r.height>f,x=m?1:i.skipFactor??1,h=r.width<=b||r.height<=b,y=I(t,r,1===x||h,n);for await(const e of y){if(!e.pixelBlock)continue;const i=L(t),r=Math.floor((o.extent.ymax-e.extent.ymax)/s.y)*l+Math.floor((e.extent.xmin-o.extent.xmin)/s.x),a=await K({pixelBlock:e.pixelBlock,extent:e.extent,fields:c,skipFactor:x,rasterJobHandler:i,pixelIdOffset:r,imageRowSize:l},n);if(a?.features?.length){const{features:e}=a,t=e.length;for(let i=0;i<t;i++){const t=e.pop();u.push(t)}}}if(m&&f){const e=f/(i.skipFactor??1)**2;if(u.length>e){const t=u.length/e,i=[...u],n=u.length-1;u.length=0;for(let o=0,r=0;o<e-1;o++){r+=t;const e=Math.round(r);e<n&&u.push(i[e])}}}return{extent:a,featureSet:p,pixelSize:s}}async function H(e,t,i){const{geometry:n}=t;if("multipoint"===n.type)return O(e,n,i);if("polyline"===n.type)return q(e,n,i);const o=await _(e,{geometry:n},i);if(!o)return null;return y(o)}async function O(e,t,i){const n=await R(e,i),o=t.points.map((e,i)=>t.getPoint(i)).map(t=>C(e,t,i)),a=(await Promise.all(o)).filter(e=>null!=e);if(a.length<=1)return J(a[0]);const s=a[0].map((e,t)=>a.map(e=>e[t]));return y(new r({pixels:s,pixelType:n.pixelType}))}async function C(e,t,i){if("imagery"===e.type){const n=await e.identify(new g({geometry:t,returnCatalogItems:!1}),i).catch(()=>null);return null==n?.value||n.value.includes("NoData")?null:n.value.replaceAll(", "," ").split(" ").map(e=>Number(e))}const n=await e.identify(t,i).catch(()=>null);return n?.value}function J(e){return e?.map(e=>({min:e,max:e,avg:e,median:e,quartile1:e,quartile3:e}))}async function q(e,t,i){const n=await G(e,{geometry:t},i),o=await R(e,i),{bandCount:a,pixelType:s}=o,l=new Array(a).fill(0).map(()=>r.createEmptyBand(s,n.length));let c=0;for(let r=0;r<n.length;r++){const e=n[r];if(null!=e.value){c++;for(let t=0;t<a;t++)l[t][r]=e.value[t]}}c!==n.length&&l.forEach((e,t)=>{l[t]=e.subarray(0,c)});return y(new r({pixels:l,pixelType:s}))}async function E(t,i,n){const o=await R(t,n);if(!o.attributeTable||!o.pixelType.startsWith("u"))return null;const r=o.attributeTable.clone(),a=r.fields.find(e=>"value"===e.name.toLowerCase()),s=r.fields.find(e=>"count"===e.name.toLowerCase());if(!a||!s)throw new e("compute-attribute-table","Value or count field not found in attribute table");const l=2**Number(o.pixelType.slice(1)),c=new Uint32Array(l),{geometry:p}=i;return await D(t,p,(e,t)=>m(e,c),n),r.features.forEach(e=>{const t=e.attributes[a.name];e.attributes[s.name]=c[t]}),r}async function N(e,t,i){const{geometry:n}=t;if("point"===n.type)return C(e,n,i);if("multipoint"===n.type){const t=n.points.map((e,t)=>n.getPoint(t)).map(t=>C(e,t,i)),o=(await Promise.all(t)).filter(e=>null!=e);if(0===o.length)return null;return U(o).map(e=>e/o.length)}const o=await D(e,n,(e,t)=>A(e),i),r=o?.filter(e=>e.count>0);if(!r?.length)return null;const a=U(r.map(e=>e.bandSum)),s=r.map(e=>e.count).reduce((e,t)=>e+t);return a.map(e=>e/s)}function U(e){return e.reduce((e,t)=>e.map((e,i)=>e+t[i]))}function A(e){const{width:t,height:i,pixels:n,mask:o}=e,r=new Array(n.length).fill(0);let a=0;for(let s=0;s<i;s++)for(let e=0;e<t;e++){const i=s*t+e;if(!o||o[i]){for(let e=0;e<n.length;e++)r[e]+=n[e][i];a++}}return{bandSum:r,count:a}}async function G(e,t,i){const n=await D(e,t.geometry,f,i);return n?.flat()??[]}async function D(i,n,o,r){const a=i.spatialReference;if("polyline"===n.type&&!n.spatialReference.equals(a)){const t=(await import("../../../geometry/operators/projectOperator.js")).execute(n,a);if(null==t)throw new e("read-pixels","failed to fetch pixels");n=t}const s="polyline"===n.type?n.extent:n,c=await F(s,a),p="polyline"===n.type?n:c,u=await R(i,r),f={geometry:c,autoResample:!1},m=[],x=I(i,await M(u,f),!0,r);for await(const e of x){if(!e.pixelBlock)continue;const{extent:i}=e,n=o(await l(e.pixelBlock,i,p),i);m.push(n),t(r)}return m}async function W(e,t){const{rasterJobHandler:i}=e,{pixelBlock:n}=e,{statistics:o,histograms:r}=i?await i.computeStatisticsHistograms({pixelBlock:n},t):d(n);return{statistics:o,histograms:r}}async function K(e,t){const{extent:i,fields:n,skipFactor:o,rasterJobHandler:r,pixelIdOffset:a,imageRowSize:s}=e,{pixelBlock:l}=e,c=n.map(({name:e})=>e),p=r?await r.convertPixelBlockToFeatures({pixelBlock:l,extent:i,fieldNames:c,skipFactor:o,pixelIdOffset:a,imageRowSize:s},t):u({pixelBlock:l,extent:i,fieldNames:c,skipFactor:o,pixelIdOffset:a,imageRowSize:s});return p?{fields:n,features:p}:void 0}function L(e){return"_rasterJobHandler"in e?e._rasterJobHandler:null}async function _(e,t,i){const n=await R(e);t={...t,maxPixelCount:t.maxPixelCount??2**28};const o=await M(n,t);v(o,n.pixelType,t.maxPixelCount);const r=[],a=I(e,o,!1,i);for await(const c of a)r.push(c.pixelBlock);if(!r.some(e=>null!=e))return null;const{width:s,height:l}=o,p=Math.ceil(s/b),u=Math.ceil(l/b),f={width:p*b,height:u*b};let m;const x=L(e);if(x){const e=await x.mosaicAndTransform({srcPixelBlocks:r,srcMosaicSize:f,destDimension:f},{...i,transferPixelsToWorker:!0});m=e?.pixelBlock}else m=c(r,f);return m}async function V(t,i,n){if(!i.geometry)throw new e("compute-statistics-histograms","geometry is required to fetch pixel feature set");const o=await _(t,i,n);if(!o)throw new e("compute-statistics-histograms","failed to get intersecting pixels");const r=L(t);return r?await r.computeStatisticsHistograms({pixelBlock:o,includeSkewnessKurtosis:!0},{...n,transferPixelsToWorker:!0}):d(o,{includeSkewnessKurtosis:!0})}export{H as computeBoxStatistics,E as computeRasterAttributeTable,V as computeStatisticsHistograms,T as createPixelFeatureSetCursor,_ as fetchLargePixelBlock,z as fetchPixelFeatureSet,N as identifyAveragePixelValue,G as readIntersectingPixels};
5
+ import e from"../../../core/Error.js";import{throwIfAborted as t}from"../../../core/promiseUtils.js";import i from"../../../geometry/Extent.js";import n from"../../../geometry/Point.js";import a from"../Field.js";import r from"../PixelBlock.js";import{getByteCount as o}from"../rasterFormats/pixelRangeUtils.js";import{snapToRaster as s,clip as l}from"../rasterFunctions/clipUtils.js";import{transformPixels as c}from"../rasterFunctions/pixelTransformUtils.js";import{mapPixelValueToAttribute as p,pixelIdFieldName as u,convertPixelBlockToFeatures as f,getValidPixels as m,mosaic as x,countCategoricalPixels as h}from"../rasterFunctions/pixelUtils.js";import{load as d,projectPolygon as y}from"../rasterFunctions/rasterProjectionHelper.js";import{computeBoxStatistics as w,computeStatisticsHistograms as g}from"../rasterFunctions/stretchUtils.js";import{getBandNames as k}from"../../../renderers/support/rasterRendererHelper.js";import b from"../../../rest/support/ImageIdentifyParameters.js";const B=2**30,S=2048,P=2**20,j=20,I=100;async function R(e,t){return"imagery"===e.type?await e.generateRasterInfo(e.rasterFunction,t):e.raster.rasterInfo}function F(e){const t=[new a({name:u,alias:"Pixel ID",type:"oid"})],{pixelType:i}=e,n="f32"===i?"single":"f64"===i?"double":"integer";return k(e).forEach(e=>{t.push(new a({name:e,alias:e,type:n}))}),t.map(e=>e.toJSON())}async function T(t,i){if(t.spatialReference.equals(i))return t;if("polyline"===t.type){const n=(await import("../../../geometry/operators/projectOperator.js")).execute(t,i);if(null==n)throw new e("read-pixels","failed to project the geometry into the layer's spatial reference");return n}if("extent"===t.type||t.rings[0].length<j){const e=(await import("../../../geometry/operators/lengthOperator.js")).execute(t,{unit:"meters"})/I;t=(await import("../../../geometry/operators/densifyOperator.js")).execute(t,e,{unit:"meters"}),await d(),t=y(t,i)}return t}async function v(e,t,i=!1){const{spatialReference:a}=e,r=t?.geometry,o=await T(r??e.extent,a),l="extent"===o.type?o:o.extent,c=null==r||"extent"===r.type&&r.spatialReference.equals(a)?void 0:o,p=new n({x:e.pixelSize.x,y:e.pixelSize.y,spatialReference:a}),u=!!t?.autoResample,f=u?p:t?.pixelSize??p;let{extent:m,width:x,height:h}=s(e,l,f);if(!u)return{extent:m,clipGeometry:c,width:x,height:h,pixelSize:f};const d=e.storageInfo?.pyramidScalingFactor??2;let{x:y,y:w}=f;const g=t?.maxPixelCount??P;for(;x*h>g&&(!i||Math.max(x,h)>1024);)y*=d,w*=d,x/=d,h/=d;return x=Math.round(x),h=Math.round(h),{extent:m,clipGeometry:c,width:x,height:h,pixelSize:new n({x:y,y:w,spatialReference:a})}}async function*z(e,n,a=!1,r){const{extent:o,clipGeometry:s,width:c,height:p}=n,u=o.width/c,f=o.height/p,m=Math.ceil(c/S),x=Math.ceil(p/S),h=u*S,d=f*S,{xmin:y,xmax:w,ymin:g,ymax:k}=o,b=x*m,B={bandIds:n.bandIds?.length?n.bandIds:void 0,interpolation:"nearest",...r};for(let P=0;P<x;P++)for(let n=0;n<m;n++){t(B);const r=new i({xmin:y+n*h,xmax:a?Math.min(w,y+(n+1)*h):y+(n+1)*h,ymax:k-P*d,ymin:a?Math.max(g,k-(P+1)*d):k-(P+1)*d,spatialReference:o.spatialReference}),c={row:P,col:n},p=P*m+n+1;if(s&&!r.intersects(s)){yield{extent:r,pixelBlock:null,id:c,total:b,current:p};continue}const x=a?Math.round(r.width/u):S,j=a?Math.round(r.height/f):S;let{pixelBlock:I}=await e.fetchPixels(r,x,j,B).catch(()=>({pixelBlock:void 0}));I&&s&&(I=await l(I,r,s)),yield{extent:r,pixelBlock:I,id:c,total:b,current:p}}}async function*M(e,i,n){const a=await R(e,n),r=F(a),o={...i,geometry:i?.geometry??a.extent},s=z(e,await v(a,o),!0,n),l=a.width;for await(const c of s){if(!c.pixelBlock){yield{...c};continue}const o=V(e),{pixelBlock:s}=c,{statistics:p,histograms:u}=await K({pixelBlock:s,rasterJobHandler:o},n),f=c;f.statistics=p,f.histograms=u;const m=c.id.row*a.width*S+c.id.col*S;t(n),f.featureSet=await _({pixelBlock:s,extent:c.extent,fields:r,skipFactor:i?.skipFactor??1,rasterJobHandler:o,pixelIdOffset:m,imageRowSize:l},n),t(n),yield f}}function H(t,i,n){const a=o(i),{width:r,height:s}=t;if(r*s*a>B)throw new e("fetch-pixels","failed to fetch pixels as pixel byte count exceeds the 1GB limit");if(n&&r*s>n)throw new e("fetch-pixels",`failed to fetch pixels as pixel count exceeds the ${n} limit`)}async function C(t,i,n){if(!i.geometry)throw new e("fetch-pixels","geometry is required to fetch pixel feature set");const a=await R(t),r=await v(a,i,!0);H(r,a.pixelType);const{extent:o,pixelSize:s}=r,l=Math.round(a.extent.width/s.x),c=F(a),p={fields:c,features:[]},u=p.features,{maxPixelCount:f}=i,m=!!i.autoResample&&null!=f&&r.width*r.height>f,x=m?1:i.skipFactor??1,h=r.width<=S||r.height<=S,d=z(t,r,1===x||h,n);for await(const e of d){if(!e.pixelBlock)continue;const i=V(t),r=Math.floor((a.extent.ymax-e.extent.ymax)/s.y)*l+Math.floor((e.extent.xmin-a.extent.xmin)/s.x),o=await _({pixelBlock:e.pixelBlock,extent:e.extent,fields:c,skipFactor:x,rasterJobHandler:i,pixelIdOffset:r,imageRowSize:l},n);if(o?.features?.length){const{features:e}=o,t=e.length;for(let i=0;i<t;i++){const t=e.pop();u.push(t)}}}if(m&&f){const e=f/(i.skipFactor??1)**2;if(u.length>e){const t=u.length/e,i=[...u],n=u.length-1;u.length=0;for(let a=0,r=0;a<e-1;a++){r+=t;const e=Math.round(r);e<n&&u.push(i[e])}}}return{extent:o,featureSet:p,pixelSize:s}}async function O(e,t,i){const{geometry:n}=t;if("multipoint"===n.type)return J(e,n,i);if("polyline"===n.type)return U(e,n,i);const a=await $(e,{geometry:n},i);if(!a)return null;return w(a)}async function J(e,t,i){const n=await R(e,i),a=t.points.map((e,i)=>t.getPoint(i)).map(t=>q(e,t,i)),o=(await Promise.all(a)).filter(e=>null!=e);if(o.length<=1)return N(o[0]);const s=o[0].map((e,t)=>o.map(e=>e[t]));return w(new r({pixels:s,pixelType:n.pixelType}))}async function q(e,t,i){if("imagery"===e.type){const n=await e.identify(new b({geometry:t,returnCatalogItems:!1}),i).catch(()=>null);return null==n?.value||n.value.includes("NoData")?null:n.value.replaceAll(", "," ").split(" ").map(e=>Number(e))}const n=await e.identify(t,i).catch(()=>null);return n?.value}function N(e){return e?.map(e=>({min:e,max:e,avg:e,median:e,quartile1:e,quartile3:e}))}async function U(e,t,i){const n=await D(e,{geometry:t},i),a=await R(e,i),{bandCount:o,pixelType:s}=a,l=new Array(o).fill(0).map(()=>r.createEmptyBand(s,n.length));let c=0;for(let r=0;r<n.length;r++){const e=n[r];if(null!=e.value){c++;for(let t=0;t<o;t++)l[t][r]=e.value[t]}}c!==n.length&&l.forEach((e,t)=>{l[t]=e.subarray(0,c)});return w(new r({pixels:l,pixelType:s}))}async function A(t,i,n){const a=await R(t,n);if(!a.attributeTable||!a.pixelType.startsWith("u"))return null;const r=a.attributeTable.clone(),o=r.fields.find(e=>"value"===e.name.toLowerCase()),s=r.fields.find(e=>"count"===e.name.toLowerCase());if(!o||!s)throw new e("compute-attribute-table","Value or count field not found in attribute table");const l=2**Number(a.pixelType.slice(1)),c=new Uint32Array(l),{geometry:p}=i;return await L(t,p,(e,t)=>h(e,c),n),r.features.forEach(e=>{const t=e.attributes[o.name];e.attributes[s.name]=c[t]}),r}async function E(e,t,i){const{geometry:n}=t;if("point"===n.type)return q(e,n,i);if("multipoint"===n.type){const t=n.points.map((e,t)=>n.getPoint(t)).map(t=>q(e,t,i)),a=(await Promise.all(t)).filter(e=>null!=e);if(0===a.length)return null;return G(a).map(e=>e/a.length)}const a=await L(e,n,(e,t)=>W(e),i),r=a?.filter(e=>e.count>0);if(!r?.length)return null;const o=G(r.map(e=>e.bandSum)),s=r.map(e=>e.count).reduce((e,t)=>e+t);return o.map(e=>e/s)}function G(e){return e.reduce((e,t)=>e.map((e,i)=>e+t[i]))}function W(e){const{width:t,height:i,pixels:n,mask:a}=e,r=new Array(n.length).fill(0);let o=0;for(let s=0;s<i;s++)for(let e=0;e<t;e++){const i=s*t+e;if(!a||a[i]){for(let e=0;e<n.length;e++)r[e]+=n[e][i];o++}}return{bandSum:r,count:o}}async function D(e,t,i){const n=await L(e,t.geometry,m,i);return n?.flat()??[]}async function L(i,n,a,r){const o=i.spatialReference;if("polyline"===n.type&&!n.spatialReference.equals(o)){const t=(await import("../../../geometry/operators/projectOperator.js")).execute(n,o);if(null==t)throw new e("read-pixels","failed to fetch pixels");n=t}const s="polyline"===n.type?n.extent:n,c=await T(s,o),p="polyline"===n.type?n:c,u=await R(i,r),f={geometry:c,autoResample:!1},m=[],x=z(i,await v(u,f),!0,r);for await(const e of x){if(!e.pixelBlock)continue;const{extent:i}=e,n=a(await l(e.pixelBlock,i,p),i);m.push(n),t(r)}return m}async function K(e,t){const{rasterJobHandler:i}=e,{pixelBlock:n}=e,{statistics:a,histograms:r}=i?await i.computeStatisticsHistograms({pixelBlock:n},t):g(n);return{statistics:a,histograms:r}}async function _(e,t){const{extent:i,fields:n,skipFactor:a,rasterJobHandler:r,pixelIdOffset:o,imageRowSize:s}=e,{pixelBlock:l}=e,c=n.map(({name:e})=>e),p=r?await r.convertPixelBlockToFeatures({pixelBlock:l,extent:i,fieldNames:c,skipFactor:a,pixelIdOffset:o,imageRowSize:s},t):f({pixelBlock:l,extent:i,fieldNames:c,skipFactor:a,pixelIdOffset:o,imageRowSize:s});return p?{fields:n,features:p}:void 0}function V(e){return"_rasterJobHandler"in e?e._rasterJobHandler:null}async function $(e,t,i){const n=await R(e);t={...t,maxPixelCount:t.maxPixelCount??2**28};const a=await v(n,t);a.bandIds=t.bandIds?.length?t.bandIds:void 0,H(a,n.pixelType,t.maxPixelCount);const{width:r,height:o}=a;if(r<=S&&o<=S){const t=a.bandIds?.length?a.bandIds:void 0,{pixelBlock:n}=await e.fetchPixels(a.extent,r,o,{bandIds:t,interpolation:"nearest",...i});return n}const s=[],l=z(e,a,!1,i);for await(const x of l)s.push(x.pixelBlock);if(!s.some(e=>null!=e))return null;const c=Math.ceil(r/S),p=Math.ceil(o/S),u={width:c*S,height:p*S};let f;const m=V(e);if(m){const e=await m.mosaicAndTransform({srcPixelBlocks:s,srcMosaicSize:u,destDimension:u},{...i,transferPixelsToWorker:!0});f=e?.pixelBlock}else f=x(s,u);return f}async function Q(t,i,n){if(!i.geometry)throw new e("compute-statistics-histograms","geometry is required to fetch pixel feature set");let a=await $(t,i,n);if(!a)throw new e("compute-statistics-histograms","failed to get intersecting pixels");const{valueAttributeFieldName:r}=i;if(r&&"value"!==r.toLowerCase()){const e=await R(t,n);a=p(a,e,r)}const o=V(t),{transformType:s}=i;if(s){const e={lambda:i.lambda,shift:i.shift};a=o?await o.transformPixels({pixelBlock:a,transformType:s,transformParameters:e},{...n,transferPixelsToWorker:!0}):c(a,s,e)}const l=i.histogramSize??void 0;return o?await o.computeStatisticsHistograms({pixelBlock:a,histogramSize:l,includeSkewnessKurtosis:!0},{...n,transferPixelsToWorker:!0}):g(a,{histogramSize:l,includeSkewnessKurtosis:!0})}export{O as computeBoxStatistics,A as computeRasterAttributeTable,Q as computeStatisticsHistograms,M as createPixelFeatureSetCursor,C as fetchPixelFeatureSet,E as identifyAveragePixelValue,D as readIntersectingPixels};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import"../../../core/has.js";import t from"../PixelBlock.js";import{getPixelValueRange as e}from"../rasterFormats/pixelRangeUtils.js";import{matchAnyMask as n}from"./pixelUtils.js";function r(e,n,r){const a=e.length,s=t.createEmptyBand(r,a);for(let t=0;t<a;t++)if(n[t]){const r=e[t];r<=0?n[t]=0:s[t]=Math.log(r)}return s}function a(n,r,a,s){const i=n.length,o=t.createEmptyBand(a,i),[l,c]=e(a),m=s?.lambda??0,f=s?.shift??0,h=0===m;for(let t=0;t<i;t++)if(r[t]){const e=n[t];if(e<=0)r[t]=0;else if(h)o[t]=Math.log(e+f);else{const n=((e+f)**m-1)/m;o[t]=Math.max(l,Math.min(n,c))}}return o}function s(e,n,r){const a=e.length,s=t.createEmptyBand(r,a);for(let t=0;t<a;t++)if(n[t]){const r=e[t];r<0?n[t]=0:s[t]=Math.sqrt(r)}return s}function i(n,r,a){const s=n.length,i=t.createEmptyBand(a,s),[o,l]=e(a);for(let t=0;t<s;t++)if(!r||r[t]){const e=1/n[t];i[t]=i[t]=Math.max(o,Math.min(e,l))}return i}function o(e,o,l){const{width:c,height:m,pixels:f}=e;let h=[];h=e.bandMasks?e.bandMasks.map(t=>new Uint8Array(t)):f.map(()=>e.mask?new Uint8Array(e.mask):new Uint8Array(c*m).fill(255));const p="f32",u=f.map((t,e)=>{switch(o){case"log":return r(t,h[e],p);case"sqrt":return s(t,h[e],p);case"inverse":return i(t,h[e],p);case"box-cox":return a(t,h[e],p,l);default:return t}}),d="inverse"===o,g=d?e.mask:1===h.length?h[0]:n(h),x=d?e.bandMasks:1===h.length?void 0:h;return new t({width:c,height:m,pixelType:p,bandMasks:x,mask:g,pixels:u})}export{o as transformPixels};