@arcgis/core 5.0.0-next.57 → 5.0.0-next.58

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 (87) hide show
  1. package/applications/Components/arcadeFeatureUtils.d.ts +20 -1
  2. package/applications/Components/arcadeFeatureUtils.js +1 -1
  3. package/arcade.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/18ce7b1559a45d017c45.js +1 -0
  6. package/assets/esri/core/workers/chunks/3405a23973f9e701a4d6.js +1 -0
  7. package/assets/esri/core/workers/chunks/352c674730c7b7258ae3.js +1 -0
  8. package/assets/esri/core/workers/chunks/62752cd6821959cf6751.js +1 -0
  9. package/assets/esri/core/workers/chunks/72e3a48aa365542b0689.js +1 -0
  10. package/assets/esri/core/workers/chunks/a6b1e3ec30f6d641aea9.js +1 -0
  11. package/assets/esri/core/workers/chunks/{da2c41ac0f82f32013c1.js → a7aa87e2c4197ba595ef.js} +10 -10
  12. package/assets/esri/core/workers/chunks/{d76513a6260d9ec4ea25.js → bf82bb1cdd8b31e7f2aa.js} +1 -1
  13. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  14. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  15. package/assets/esri/themes/base/widgets/_FeatureTable.scss +24 -0
  16. package/assets/esri/themes/dark/main.css +1 -1
  17. package/assets/esri/themes/light/main.css +1 -1
  18. package/assets/esri/themes/light/view.css +1 -1
  19. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable.json +1 -1
  20. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_en.json +1 -1
  21. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_fr.json +1 -1
  22. package/config.js +1 -1
  23. package/core/workers/workerFactory.js +1 -1
  24. package/editing/sharedTemplates/executor/builders/offsetLine.js +1 -1
  25. package/editing/sharedTemplates/executor/builders/offsetPrimaryLine.js +1 -1
  26. package/editing/sharedTemplates/executor/builders/polygonBoundary.js +1 -1
  27. package/editing/sharedTemplates/executor/builders/polygonBoundaryTwoPoint.js +1 -1
  28. package/editing/sharedTemplates/executor/builders/polygonVertices.js +1 -1
  29. package/editing/sharedTemplates/executor/builders/support/builderUtils.js +1 -1
  30. package/editing/sharedTemplates/executor/builders/support/shapeUtils.js +1 -1
  31. package/editing/sharedTemplates/executor/support/createFeatureServiceEdit.js +1 -1
  32. package/editing/sharedTemplates/executor/support/createPresetServiceEdit.js +1 -1
  33. package/geometry/projection/projectBoundingSphere.js +1 -1
  34. package/geometry/support/curves/curveUtils.js +1 -1
  35. package/geometry/support/sphere.js +1 -1
  36. package/kernel.js +1 -1
  37. package/layers/KnowledgeGraphLayer.js +1 -1
  38. package/layers/LinkChartLayer.js +1 -1
  39. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  40. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  41. package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +1 -1
  42. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  43. package/layers/knowledgeGraph/layerUtils.js +1 -1
  44. package/package.json +2 -2
  45. package/support/revision.js +1 -1
  46. package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
  47. package/views/2d/engine/webgl/Painter.js +1 -1
  48. package/views/2d/engine/webgl/shaderGraph/GLSLShaderModule.js +1 -1
  49. package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
  50. package/views/2d/engine/webgl/shaderGraph/graph/GlslGraphWriter.js +1 -1
  51. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphContext.js +1 -1
  52. package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
  53. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  54. package/views/2d/layers/features/PipelineConnectionHandlers.js +1 -1
  55. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  56. package/views/3d/layers/I3SMeshView3D.js +1 -1
  57. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  58. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  59. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  60. package/views/3d/layers/i3s/I3SNode.js +1 -1
  61. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  62. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  63. package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
  64. package/views/3d/support/ElevationRange.js +1 -1
  65. package/views/3d/terrain/TerrainSurface.js +1 -1
  66. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js +1 -1
  67. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  68. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  69. package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
  70. package/widgets/FeatureTable/FeatureTableViewModel.d.ts +44 -3
  71. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  72. package/widgets/FeatureTable/FieldColumn.js +1 -1
  73. package/widgets/FeatureTable/Grid/EditorColumn.js +1 -1
  74. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  75. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  76. package/widgets/FeatureTable/VisibleElements.d.ts +2 -2
  77. package/widgets/FeatureTable/VisibleElements.js +1 -1
  78. package/widgets/FeatureTable/support/FeatureStore.d.ts +1 -0
  79. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  80. package/widgets/FeatureTable.d.ts +46 -5
  81. package/widgets/FeatureTable.js +1 -1
  82. package/assets/esri/core/workers/chunks/30184e39129d9c66ea54.js +0 -1
  83. package/assets/esri/core/workers/chunks/5340887a4a48bde3407a.js +0 -1
  84. package/assets/esri/core/workers/chunks/537de53ef1e9101468f5.js +0 -1
  85. package/assets/esri/core/workers/chunks/94f02082a006003ef5a9.js +0 -1
  86. package/assets/esri/core/workers/chunks/d3db7244fac7398cc700.js +0 -1
  87. package/assets/esri/core/workers/chunks/d94a2ad5a91de7086fbe.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8948],{6518:(e,t,i)=>{i.d(t,{F:()=>a});var n=i(44208),r=i(75503),s=i(19419);const o={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new r.wq(9,(0,n.A)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach((i,n)=>{e[t++]=n}),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter(e=>this._idByBounds.has(e))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,s.Ie)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,i){(function(e){o.minX=e[0],o.minY=e[1],o.maxX=e[2],o.maxY=e[3]})(t),e.search(o,i)}(this._index,e,e=>t(this._idByBounds.get(e)))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},8460:(e,t,i)=>{i.d(t,{$C:()=>y,Hh:()=>o,Tu:()=>c,Wg:()=>h,Xq:()=>f,i6:()=>g,pM:()=>u,vJ:()=>m});var n=i(2741);let r,s=null;function o(){return r||(r=i.e(3666).then(i.bind(i,3666)).then(e=>e.l).then(({default:e})=>e({locateFile:e=>(0,n.s)(`esri/libs/linkchartlayout/${e}`)})).then(e=>{!function(e){s=e}(e)}),r)}const a={right:0,left:1,top:2,bottom:3},l={none:0,"start-only":1,"start-and-end":2};function p(e){const t={timeDirection:"right",timeBannerUTCOffsetInMinutes:0,eventsTicksVisualization:"start-and-end",showDurationLineForNonZeroDurationEntityEvents:!0,durationLineWidth:5,entityPositionAtDurationRatio:1,showNonZeroDurationIntervalBounds:!1,separateTimeOverlaps:!0,separateTimelineOverlaps:!0,moveFirstBends:!0,secondBendRatio:.3,lineSeparationMultiplier:1,spaceSeparatedLinesEvenly:!1,useBezierCurves:!1,separatedLineShapeRatio:0,...e?.toJSON(),eventsTicksVisualization:e?.eventsTicksVisualization??"start-and-end"};return{...t,timeDirection:{value:a[t.timeDirection]??a.right},eventsTicksVisualization:{value:l[t.eventsTicksVisualization]??l["start-and-end"]}}}function d(e,t,i,n,r,o){const a=i.length,l=r.length,p=Float64Array.BYTES_PER_ELEMENT,d=Uint32Array.BYTES_PER_ELEMENT,u=Uint8Array.BYTES_PER_ELEMENT,c=16+a*(u+2*p)+l*(2*d),h=s._malloc(c);try{const u=h+16-h%16,c=u+a*p,y=c+a*p,m=y+l*d,f=m+l*d,g=()=>[s.HEAPF64.subarray(u>>3,(u>>3)+a),s.HEAPF64.subarray(c>>3,(c>>3)+a),s.HEAPU32.subarray(y>>2,(y>>2)+l),s.HEAPU32.subarray(m>>2,(m>>2)+l),s.HEAPU8.subarray(f,f+a)],[b,w,_,M,I]=g();b.set(i),w.set(n),_.set(r),M.set(o),I.set(t);const T=e(a,f,u,c,l,y,m);let C=null,v=null;if(0===T.value){const e=s.getLayoutLinksTypes(),t=s.getLayoutLinksVerticesEndIndices(),i=s.getLayoutLinksVertices(),n=s.countLayoutLinksVertices();!l||e&&t?n&&!i?T.value=1:(C={types:new Uint8Array(s.HEAPU8.subarray(e,e+l)),vertexEndIndex:new Uint32Array(s.HEAPU32.subarray(t>>2,(t>>2)+l)),vertices:new Float64Array(s.HEAPF64.subarray(i>>3,(i>>3)+2*n))},v=s.getAuxiliaryGraphicElements()):T.value=1}const[A,E,S,x,k]=g();return i.set(A),n.set(E),r.set(S),o.set(x),t.set(k),{status:T.value,links:C,graphics:v}}finally{s._free(h),s.cleanupLayout()}}var u,c,h,y,m,f,g,b;(b=u||(u={})).getMinIdealEdgeLength=function(){return s.getMinIdealEdgeLength()},b.apply=function(e,t,i,n,r,o,a=2,l=1,p=-1){return d((t,i,n,r,o,d,u)=>s.applyForceDirectedLayout(e,t,i,n,r,o,d,u,a,l,p),t,i,n,r,o)},function(e){e.apply=function(e,t,i,n,r,o,a=2,l=1,p=-1){return d((t,i,n,r,o,d,u)=>s.applyCommunityLayout(e,t,i,n,r,o,d,u,a,l,p),t,i,n,r,o)}}(c||(c={})),function(e){e.apply=function(e,t,i,n,r,o){return d((t,i,n,r,o,a,l)=>s.applySimpleLayout(e,t,i,n,r,o,a,l),t,i,n,r,o)}}(h||(h={})),function(e){e.apply=function(e,t,i,n,r,o){return d((t,i,n,r,o,a,l)=>s.applyHierarchicalLayout(e,t,i,n,r,o,a,l),t,i,n,r,o)}}(y||(y={})),function(e){e.apply=function(e,t,i,n,r,o){return d((t,i,n,r,o,a,l)=>s.applyRadialTreeLayout(e,t,i,n,r,o,a,l),t,i,n,r,o)}}(m||(m={})),function(e){e.apply=function(e,t,i,n,r,o){return d((t,i,n,r,o,a,l)=>s.applySmartTreeLayout(e,t,i,n,r,o,a,l),t,i,n,r,o)}}(f||(f={})),function(e){e.apply=function(e,t,i,n,r,o,a,l,u,c,h,y){return d((t,i,n,a,l,d,m)=>{if(r.length!==t)return{value:1};if(o.length!==t)return{value:1};if(u.length!==l)return{value:1};if(c.length!==l)return{value:1};const f=Float64Array.BYTES_PER_ELEMENT,g=16,b=s._malloc(g+t*f),w=s._malloc(g+t*f),_=s._malloc(g+l*f),M=s._malloc(g+l*f),I=b+g-b%g,T=w+g-w%g,C=_+g-_%g,v=M+g-M%g;try{return s.HEAPF64.subarray(I>>3,(I>>3)+t).set(r),s.HEAPF64.subarray(T>>3,(T>>3)+t).set(o),s.HEAPF64.subarray(C>>3,(C>>3)+l).set(u),s.HEAPF64.subarray(v>>3,(v>>3)+l).set(c),s.applyChronologicalLayout(e,t,i,n,a,I,T,l,d,m,C,v,h,p(y))}finally{s._free(b),s._free(w),s._free(_),s._free(M)}},t,i,n,a,l)}}(g||(g={}))},10407:(e,t,i)=>{i.d(t,{It:()=>h,LG:()=>o,OM:()=>p,Sm:()=>d,Y:()=>a,bK:()=>l,mm:()=>c,sQ:()=>u});var n=i(91218),r=i(16930),s=i(28735);function o(e,t){if(!a(e,t)){const i=e.typeKeywords;i?i.push(t):e.typeKeywords=[t]}}function a(e,t){return!!e.typeKeywords?.includes(t)}function l(e){return a(e,c.HOSTED_SERVICE)}function p(e,t){const i=e.typeKeywords;if(i){const e=i.indexOf(t);e>-1&&i.splice(e,1)}}function d(e,t,i){i?o(e,t):p(e,t)}async function u(e){const t=e.clone().normalize();let i;if(t.length>1)for(const e of t)i?e.width>i.width&&(i=e):i=e;else i=t[0];return async function(e){const t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return(0,s.ci)(e);const i=r.A.WGS84;return await(0,n.initializeProjection)(t,i),(0,n.project)(e,i)}(i)}const c={CHARTS:"Charts",DYNAMIC:"Dynamic",DEVELOPER_BASEMAP:"DeveloperBasemap",GROUP_LAYER_MAP:"Map",HOSTED_SERVICE:"Hosted Service",JSAPI:"ArcGIS API for JavaScript",LOCAL_SCENE:"ViewingMode-Local",METADATA:"Metadata",MULTI_LAYER:"Multilayer",ORIENTED_IMAGERY_LAYER:"OrientedImageryLayer",SINGLE_LAYER:"Singlelayer",SUBTYPE_GROUP_LAYER:"SubtypeGroupLayer",SUBTYPE_GROUP_TABLE:"SubtypeGroupTable",TABLE:"Table",TILED_IMAGERY:"Tiled Imagery"};function h(e){const{portal:t,isOrgItem:i,itemControl:n}=e,r=t.user?.privileges;let s=!r||r.includes("features:user:edit"),o=!!i&&!!r?.includes("features:user:fullEdit");const a="update"===n||"admin"===n;return a?o=s=!0:o&&(s=!0),{features:{edit:s,fullEdit:o},content:{updateItem:a}}}},15375:(e,t,i)=>{i.d(t,{BL:()=>l,Cz:()=>r,KQ:()=>s,M1:()=>a,T1:()=>o,dr:()=>n});const n="ESRI__ID",r="ESRI__OriginID",s="ESRI__DestID",o="ESRI__LayoutGeometry",a="ESRI__AggregationCount",l="LC.ESRI__IsSpatial"},23150:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(31635),r=i(91429),s=i(82799),o=i(54238);let a=class extends o.A{constructor(e){super(e),this.originId=null,this.destinationId=null,this.layoutGeometry=null}};(0,n.Cg)([(0,r.MZ)({type:String,json:{write:!0}})],a.prototype,"originId",void 0),(0,n.Cg)([(0,r.MZ)({type:String,json:{write:!0}})],a.prototype,"destinationId",void 0),(0,n.Cg)([(0,r.MZ)({type:s.A,json:{write:!0}})],a.prototype,"layoutGeometry",void 0),a=(0,n.Cg)([(0,r.$K)("esri.rest.knowledgeGraph.Relationship")],a)},24137:(e,t,i)=>{i.d(t,{P:()=>I});var n=i(31635),r=i(69622),s=i(49186),o=i(53966),a=i(91869),l=i(74887),p=i(39516),d=i(91429),u=i(5443),c=i(39829),h=i(91218),y=i(21325),m=i(15375);const f=(e,t)=>{if("column-reference"===e.type)return e.column===t.systemOidFieldName?"ID(n)":`n.${e.column}`;if("string"===e.type)return`'${e.value}'`;if("number"===e.type)return`${e.value}`;if("binary-expression"===e.type&&t.supportedSqlTypes.has(e.left.type)&&t.supportedSqlTypes.has(e.right.type)&&t.supportedSqlOperators.has(e.operator))return`${f(e.left,t)} ${e.operator} ${f(e.right,t)}`;if("binary-expression"===e.type&&"LIKE"===e.operator){let i="";if("function"===e.left.type&&"column-reference"===e.left.args.value[0].type)i+=`lower(n.${e.left.args.value[0].column})`;else{if("column-reference"!==e.left.type)return t.unsupportedOperationFound=!0,"";i+=`lower(n.${e.left.column})`}if(i+=" CONTAINS (","string"!==e.right.type)return t.unsupportedOperationFound=!0,"";{let t=e.right.value;t.startsWith("%")&&(t=t.slice(1)),t.endsWith("%")&&(t=t.slice(0,-1)),i+=`'${t.toLowerCase()}')`}return i}return t.unsupportedOperationFound=!0,""};var g=i(69860),b=i(30504),w=i(48441),_=i(42538),M=i(61956);let I=class extends r.A{constructor(e){super(e),this._processingCacheUpdatesLookup=new Map,this.knowledgeGraph=null,this.inclusionModeDefinition={generateAllSublayers:!0,namedTypeDefinitions:new Map},this.entityTypeNames=new Set,this.relationshipTypeNames=new Set,this.geographicLookup=new Map,this.sublayerCaches=new Map,this.nodeConnectionsLookup=new Map,this.relationshipConnectionsLookup=new Map,this.memberIdTypeLookup=new Map;const t=new Map;e.knowledgeGraph.dataModel.entityTypes?.forEach(i=>{i.name&&(t.set(i.name,"entity"),this._processingCacheUpdatesLookup.set(i.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.entityTypeNames.add(i.name),i.properties?.forEach(e=>{e.geometryType&&"esriGeometryNull"!==e.geometryType&&this.geographicLookup.set(i.name,{name:e.name??"",geometryType:e.geometryType})}))}),e.knowledgeGraph.dataModel.relationshipTypes?.forEach(i=>{i.name&&(t.set(i.name,"relationship"),this._processingCacheUpdatesLookup.set(i.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.relationshipTypeNames.add(i.name),i.properties?.forEach(e=>{e.geometryType&&"esriGeometryNull"!==e.geometryType&&this.geographicLookup.set(i.name,{name:e.name??"",geometryType:e.geometryType})}))}),e.inclusionModeDefinition?.namedTypeDefinitions.forEach((i,n)=>{if("entity"===t.get(n))this.entityTypeNames.add(n);else{if("relationship"!==t.get(n))return o.A.getLogger(this).warn(`A named type, ${n}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(n);this.relationshipTypeNames.add(n)}const r=new Map;i.members?.forEach(e=>{(0,a.tE)(this.memberIdTypeLookup,e.id,()=>new Set).add(n)}),this.sublayerCaches.set(n,r)})}addToLayer(e){e.forEach(({typeName:e,id:t})=>{if(!this.inclusionModeDefinition)throw new s.A("knowledge-graph:layer-data-manager","You cannot add to a layer's exclusion list if it was not created with an exclusion list originally");if(this.inclusionModeDefinition.namedTypeDefinitions.has(e)){if(this.inclusionModeDefinition.namedTypeDefinitions.has(e)){const i=this.inclusionModeDefinition.namedTypeDefinitions.get(e);i.members||(i.members=new Map),i.members.set(t,{id:t}),(0,a.tE)(this.memberIdTypeLookup,t,()=>new Set).add(e)}}else{const i=new Map;i.set(t,{id:t}),this.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:i}),(0,a.tE)(this.memberIdTypeLookup,t,()=>new Set).add(e)}})}getById(e){return g.A.getInstance().readFromStoreById(e)}async getData(e,t,i){if(t.objectType.name&&this.inclusionModeDefinition?.namedTypeDefinitions&&this.inclusionModeDefinition.namedTypeDefinitions.size>0&&!this.inclusionModeDefinition.namedTypeDefinitions.has(t.objectType.name))return[];let n;if(n=e||new M.A({where:"1=1",outFields:["*"]}),"link-chart"===t.parentCompositeLayer.type){const e=t.parentCompositeLayer,i=this._processingCacheUpdatesLookup.get(t.objectType.name??""),r=n.outFields;r&&1===r.length&&r[0]===m.dr&&"1=1"===n.where||await Promise.all(i??[]);const s=this.sublayerCaches.has(t.objectType.name??"")?Array.from(this.sublayerCaches.get(t.objectType.name)?.values()):[],o=[];return s.forEach(i=>{if(this.relationshipTypeNames.has(t.objectType.name)){i.geometry=e.relationshipLinkChartDiagramLookup.get(i.attributes[t.objectIdField]);const n=this.memberIdTypeLookup.get(i.attributes[m.Cz]),r=this.memberIdTypeLookup.get(i.attributes[m.KQ]),s=this._isEndEntitySpatial(n,i,m.Cz),o=this._isEndEntitySpatial(r,i,m.KQ);i.attributes[m.BL]=Number(s&&o)}else{i.geometry=e.entityLinkChartDiagramLookup.get(i.attributes[t.objectIdField]);const n=this.geographicLookup.get(t.objectType.name);n&&i.attributes[n.name]?i.attributes[m.BL]=1:i.attributes[m.BL]=0}i.attributes[m.T1]=i.geometry,o.push(i)}),o}return this.retrieveDataFromService(n,t,i)}async getConnectedRecordIds(e,t,i){const n=[];let r="";const s=this._getNamedTypeIdMapFromNodeIds(e);if(t&&0!==t?.length){for(const e of t)r=r+e+"|";r=r.slice(0,-1)}const o={},a=[];for(const[e,i]of s){const n=`${e}_ids`;o[n]=i,t&&0!==t?.length?a.push(`MATCH (n:${e}) WHERE id(n) IN $${n} WITH n MATCH (n)-[r:${r}]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`):a.push(`MATCH (n:${e}) WHERE id(n) IN $${n} WITH n MATCH (n)-[r]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`)}if(!a.length)return n;const l=a.join(" UNION "),p=(await(0,w.executeQueryStreaming)(this.knowledgeGraph,new _.A({openCypherQuery:l,bindParameters:o}),{signal:i?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await p.read();if(e)break;for(let e=0;e<t.length;e++){const i=t[e];n.push({id:i[0],typeName:i[1]}),n.push({id:i[2],typeName:i[3]})}}return n}async getRelationshipsBetweenNodes(e,t,i){const n=this._getNamedTypeIdMapFromNodeIds(e);if(0===n.size)return[];const r={relationshipExclusionIds:t,possibleConnectionEntityIds:e},s=[];for(const[e,t]of n.entries()){const i=`${e}_ids`;r[i]=t,s.push(`MATCH (n:${e}) WHERE id(n) IN $${i} WITH n MATCH (n)-[r]->(m) WHERE id(m) IN $possibleConnectionEntityIds AND NOT id(r) IN $relationshipExclusionIds RETURN id(r), type(r)`)}const o=s.join(" UNION "),a=[],l=(await(0,w.executeQueryStreaming)(this.knowledgeGraph,new _.A({openCypherQuery:o,bindParameters:r}),{signal:i?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await l.read();if(e)break;for(let e=0;e<t.length;e++){const i=t[e];a.push({id:i[0],typeName:i[1]})}}return a}async getRelationshipsFromNodes(e,t,i,n){const r=this._getNamedTypeIdMapFromNodeIds(e);if(0===r.size||0===t.length)return[];const s={relationshipExclusionIds:i,possibleConnectionEntityIds:t},o=[];for(const[e,t]of r.entries()){const i=`${e}_ids`;s[i]=t,o.push(`MATCH (n:${e}) WHERE id(n) IN $${i} WITH n MATCH (n)-[r]-(m) WHERE id(m) IN $possibleConnectionEntityIds AND NOT id(r) IN $relationshipExclusionIds RETURN id(r), type(r)`)}const a=o.join(" UNION "),l=new Map,p=(await(0,w.executeQueryStreaming)(this.knowledgeGraph,new _.A({openCypherQuery:a,bindParameters:s}),{signal:n?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await p.read();if(e)break;for(let e=0;e<t.length;e++){const i=t[e];let n=l.get(i[1]);n||(n=new Set,l.set(i[1],n)),n.add(i[0])}}const d=[];for(const[e,t]of l)for(const i of t)d.push({id:i,typeName:e});return d}async refreshCacheContent(e,t,i,n=!0,r){const o=g.A.getInstance(),p=[],d=new Map,u=new Map;this.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&u.set(e.name,e)}),this.knowledgeGraph.dataModel.relationshipTypes?.forEach(e=>{e.name&&u.set(e.name,e)}),e||this.inclusionModeDefinition?e?e.forEach(e=>{if(this.memberIdTypeLookup.has(e))for(const t of this.memberIdTypeLookup.get(e))d.has(t)?d.get(t)?.push(e):d.set(t,[e])}):this.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{e.useAllData?d.set(t,null):e.members&&e.members.forEach(e=>{d.has(t)&&null!==d.get(t)?d.get(t)?.push(e.id):d.set(t,[e.id])})}):(this.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&d.set(e.name,null)}),this.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&d.set(e.name,null)}));for(const[e,l]of d){const d=new Set(l),c=new Promise((p,c)=>{(async()=>{const p=new Set,c=[];let h,y="",f=!1;if(t||u.get(e)?.properties?.forEach(e=>{e.name&&p.add(e.name)}),i&&this.geographicLookup.has(e)){const t=this.geographicLookup.get(e)?.name;t&&p.add(t)}if(this.entityTypeNames.has(e))y=`MATCH (n:${e}) ${l?"WHERE id(n) IN $ids ":""}return ID(n)`,p.forEach(e=>{y+=`, n.${e}`,c.push(e)});else{if(!this.relationshipTypeNames.has(e))throw new s.A("knowledge-graph:layer-data-manager",`The graph type of ${e} could not be determined. Was this type set in the KG data model and inclusion definition?`);f=!0,y=`MATCH ()-[n:${e}]->() ${l?"WHERE id(n) IN $ids ":""}return ID(n), id(startNode(n)), id(endNode(n))`,p.forEach(e=>{y+=`, n.${e}`,c.push(e)})}h=new _.A(l?{openCypherQuery:y,bindParameters:{ids:l}}:{openCypherQuery:y});const g=(await(0,w.executeQueryStreaming)(this.knowledgeGraph,h,{signal:r?.signal})).resultRowsStream.getReader();for(;;){const{done:t,value:i}=await g.read();if(t)break;const r=[];for(let e=0;e<i.length;e++){const t=i[e];let n=0,s=0;const o={properties:{}};for(o.id=t[n],n++,s++,f&&(o.originId=t[n],n++,s++,o.destinationId=t[n],n++,s++,(0,a.tE)(this.nodeConnectionsLookup,o.originId,()=>new Set).add(o.id),(0,a.tE)(this.nodeConnectionsLookup,o.destinationId,()=>new Set).add(o.id),(0,a.tE)(this.relationshipConnectionsLookup,o.id,()=>[o.originId,o.destinationId]));n<t.length;n++)o.properties[c[n-s]]=t[n];d.delete(o.id),r.push(o)}const s=o.writeToStore(r,m.dr,this.geographicLookup.get(e)?.name);this.sublayerCaches.has(e)||this.sublayerCaches.set(e,new Map),n&&!this.inclusionModeDefinition?.namedTypeDefinitions.has(e)&&this.inclusionModeDefinition?.namedTypeDefinitions.set(e,{useAllData:!1,members:new Map}),n&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(e).members&&(this.inclusionModeDefinition.namedTypeDefinitions.get(e).members=new Map);const l=this.sublayerCaches.get(e);s.forEach(t=>{l?.set(t.attributes[m.dr],t),n&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(e).members.has(t.attributes[m.dr])&&(this.inclusionModeDefinition?.namedTypeDefinitions.get(e).members.set(t.attributes[m.dr],{id:t.attributes[m.dr]}),(0,a.tE)(this.memberIdTypeLookup,t.attributes[m.dr],()=>new Set).add(e))})}const b=this.inclusionModeDefinition?.namedTypeDefinitions.get(e);if(b)for(const e of d)b.members?.delete(e)})().then(()=>{p(null)}).catch(e=>{"AbortError"===e.name?p(null):c(e)})});p.push(c),this._processingCacheUpdatesLookup.get(e)?.push(c)}if(await Promise.all(p),r?.signal?.aborted)throw(0,l.NK)()}removeFromLayer(e){const t=new Set,i=new Set(e.map(e=>e.id));for(const i of e)t.add(i.typeName),1===this.memberIdTypeLookup.get(i.id)?.size?this.memberIdTypeLookup.delete(i.id):this.memberIdTypeLookup.get(i.id)?.delete(i.typeName),this.inclusionModeDefinition?.namedTypeDefinitions.forEach((e,t)=>{t===i.typeName&&e.members?.has(i.id)&&e.members.delete(i.id)});t.forEach(e=>{this.sublayerCaches.get(e)?.forEach((t,n)=>{i.has(n)&&this.sublayerCaches.get(e)?.delete(n)})})}async retrieveDataFromService(e,t,i){const n=g.A.getInstance(),r=new Set,o=[];let a,l="",d=[];const M="relationship"===t.graphType,I=this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData,T=t.parentCompositeLayer.sublayerIdsCache.get(t.objectType.name);let C=!I&&T?Array.from(T).sort():null;if(this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData)this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData&&null!=e.objectIds&&(C=e.objectIds);else if(null!=e.objectIds&&C&&C.length>0){const t=e.objectIds;e.objectIds=C.filter(e=>t.includes(e))}else if(null!=e.objectIds)C=e.objectIds;else{if(this.inclusionModeDefinition?.namedTypeDefinitions.has(t.objectType.name)&&(!this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members||this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members?.size<1))return e.objectIds=[],[];e.objectIds=C}if(null!=e.outFields){const i=e.outFields;i.includes("*")?t.fields.forEach(e=>{r.add(e.name)}):i.forEach(e=>{e!==m.dr&&e!==t.geometryFieldName&&r.add(e)})}if(null!=e.geometry){const i=e.geometry;let n;const d=t.parentCompositeLayer.dataManager.knowledgeGraph.serviceDefinition,m=d?.spatialReference,f=d?.serviceCapabilities?.geometryCapabilities;let g=f?.geometryMaxBoundingRectangleSizeX,w=f?.geometryMaxBoundingRectangleSizeY;if("point"===i.type){let e=i;e.spatialReference?.isWGS84||(await(0,h.initializeProjection)(e.spatialReference,y.KK),e=(0,h.project)(e,y.KK)),n=new u.A({spatialReference:y.KK,xmin:e.x-1e-4,ymin:e.y-1e-4,xmax:e.x+1e-4,ymax:e.y+1e-4})}else i?.extent?.spatialReference&&!i.spatialReference?.isWGS84?(await(0,h.initializeProjection)(i.extent.spatialReference,y.KK),n=(0,h.project)(i.extent,y.KK)):n=i.extent;if(g&&w&&m){if(4326!==m.wkid){const e=new u.A({spatialReference:m,xmax:g,ymax:w}),t=(0,h.project)(e,y.KK);g=t.xmax,w=t.ymax}if(n.xmax-n.xmin>g)throw new s.A("knowledge-graph:layer-data-manager",`Extent x bounds should be within ${g}° latitude, limit exceeded`);if(n.ymax-n.ymin>w)throw new s.A("knowledge-graph:layer-data-manager",`Extent y bounds should be within ${w}° longitude, limit exceeded`)}if(null!=e.where&&"1=1"!==e.where){const i=await(0,p.GP)(e.where.toUpperCase(),t.fieldsIndex);t.fields.forEach(e=>{i.fieldNames.includes(e.name)&&r.add(e.name)})}l=M?`Match ()-[n:${t.objectType.name}]->() WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n), id(startNode(r)), id(endNode(r))`:`Match (n:${t.objectType.name}) WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n)`,t.geometryFieldName&&r.add(t.geometryFieldName),r.forEach(e=>{l+=`, n.${e}`,o.push(e)}),a=new _.A({openCypherQuery:l,bindParameters:{param_filter_geom:new c.A({rings:(0,b.Wq)(n)})}})}else{let i="";if(null!=e.where&&"1=1"!==e.where){const n=await(0,p.GP)(e.where,t.fieldsIndex);t.fields.forEach(e=>{n.fieldNames.includes(e.name)&&r.add(e.name)});const s={systemOidFieldName:m.dr,supportedSqlTypes:new Set(["column-reference","string","number","binary-expression"]),supportedSqlOperators:new Set(["=","<","<=","<>",">",">=","AND","OR","LIKE"]),unsupportedOperationFound:!1};i=f(n.parseTree,s),s.unsupportedOperationFound&&(i="")}let n="";n=M?`Match ()-[n:${t.objectType.name}]->()`:`Match (n:${t.objectType.name})`;let s=!1;C&&(s=!0,n+=" WHERE ID(n) IN $ids"),i&&(n+=s?" AND":" WHERE",n+=` ${i}`),n+=" return ID(n)",M&&(n+=", id(startNode(n)), id(endNode(n))"),e.returnGeometry&&t.geometryFieldName&&r.add(t.geometryFieldName),r.forEach(e=>{n+=`, n.${e}`,o.push(e)}),a=new _.A(C?{openCypherQuery:n,bindParameters:{ids:C}}:{openCypherQuery:n})}const v=(await(0,w.executeQueryStreaming)(t.parentCompositeLayer.dataManager.knowledgeGraph,a,i)).resultRowsStream.getReader();for(;;){const{done:e,value:i}=await v.read();if(e)break;const r=[];for(let e=0;e<i.length;e++){const t=i[e];let n=0,s=0;const a={properties:{}};for(a.id=t[n],n++,s++,M&&(a.originId=t[n],n++,s++,a.destinationId=t[n],n++,s++);n<t.length;n++)a.properties[o[n-s]]=t[n];r.push(a)}d=d.concat(n.writeToStore(r,m.dr,t.parentCompositeLayer.dataManager.geographicLookup.get(t.objectType.name)?.name))}return d}_isEndEntitySpatial(e,t,i){for(const n of e??[])if(this.entityTypeNames.has(n)){const e=this.geographicLookup.get(n),r=e&&this.sublayerCaches.get(n)?.get(t.attributes[i]);if(e&&r?.attributes[e.name])return!0}return!1}_getNamedTypeIdMapFromNodeIds(e){const t=new Map;return e.forEach(e=>{if(this.memberIdTypeLookup.has(e))for(const i of this.memberIdTypeLookup.get(e)){if(!this.entityTypeNames.has(i))return;t.has(i)?t.get(i)?.push(e):t.set(i,[e])}}),t}};(0,n.Cg)([(0,d.MZ)()],I.prototype,"knowledgeGraph",void 0),(0,n.Cg)([(0,d.MZ)()],I.prototype,"inclusionModeDefinition",void 0),(0,n.Cg)([(0,d.MZ)()],I.prototype,"entityTypeNames",void 0),(0,n.Cg)([(0,d.MZ)()],I.prototype,"relationshipTypeNames",void 0),(0,n.Cg)([(0,d.MZ)()],I.prototype,"geographicLookup",void 0),(0,n.Cg)([(0,d.MZ)()],I.prototype,"sublayerCaches",void 0),(0,n.Cg)([(0,d.MZ)()],I.prototype,"nodeConnectionsLookup",void 0),(0,n.Cg)([(0,d.MZ)()],I.prototype,"relationshipConnectionsLookup",void 0),(0,n.Cg)([(0,d.MZ)()],I.prototype,"memberIdTypeLookup",void 0),I=(0,n.Cg)([(0,d.$K)("esri.layers.knowledgeGraph.KnowledgeGraphLayerDataManager")],I)},25927:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(31635),r=i(91429),s=i(86738),o=i(54238);let a=class extends o.A{constructor(e){super(e),this.layoutGeometry=null}};(0,n.Cg)([(0,r.MZ)({type:s.A,json:{write:!0}})],a.prototype,"layoutGeometry",void 0),a=(0,n.Cg)([(0,r.$K)("esri.rest.knowledgeGraph.Entity")],a)},30504:(e,t,i)=>{i.d(t,{k5:()=>p,aq:()=>l,Wq:()=>d}),i(52106);var n=i(49186),r=(i(86738),i(39829),i(82799),i(94194),i(69860),i(8460),i(66552));(0,r.O)()({none:"none",startAndEnd:"start-and-end",startOnly:"start-only"}),(0,r.O)()({absoluteValue:"absolute-value",multiplier:"multiplier"});const s=new Map([["basic-grid","basic-grid"],["geographic-organic-standard","geographic-organic-standard"],["hierarchical-bottom-to-top","hierarchical-bottom-to-top"],["hierarchical-top-to-bottom","hierarchical-bottom-to-top"],["organic-community","organic-community"],["organic-fusiform","organic-standard"],["organic-leaf-circle","organic-standard"],["organic-standard","organic-standard"],["radial-node-centric","radial-root-centric"],["radial-root-centric","radial-root-centric"],["tree-bottom-to-top","tree-left-to-right"],["tree-left-to-right","tree-left-to-right"],["tree-right-to-left","tree-left-to-right"],["tree-top-to-bottom","tree-left-to-right"],["chronological-mono-timeline","chronological-mono-timeline"],["chronological-multi-timeline","chronological-multi-timeline"]]);var o=i(48441),a=i(42538);async function l(e,t,i){const n=[],r=function(e,t){const i=new Map;if(t.dataModel?.relationshipTypes)for(const e of t.dataModel.relationshipTypes)e.name&&i.set(e.name,[]);for(const t of e)i.has(t.typeName)&&i.get(t.typeName)?.push(t.id);return i}(e,t),s={},l=[];for(const[e,t]of r){if(t.length<1)continue;const i=`${e}_ids`;s[i]=t,l.push(`MATCH (n)-[r:${e}]->(m) WHERE id(r) in $${i} RETURN id(n), labels(n)[0], id(m), labels(m)[0]`)}if(0===l.length)return[];const p=l.join(" UNION "),d=new a.A({openCypherQuery:p,bindParameters:s}),u=(await(0,o.executeQueryStreaming)(t,d,i?.requestOptions)).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await u.read();if(e)break;for(const e of t)n.push({id:e[0],typeName:e[1]}),n.push({id:e[2],typeName:e[3]})}return n}i(40863),i(94985),i(68249);const p=e=>s.get(e)??"radial-root-centric";function d(e){if(!e.spatialReference.isWGS84)throw new n.A("knowledge-graph:layer-support-utils","The utilsExtentToInBoundsRings function only supports WGS84 spatial references.");return e.clone().normalize().map(e=>[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]])}},37531:(e,t,i)=>{i.d(t,{dt:()=>c,GG:()=>g,UQ:()=>f,Sx:()=>d});var n=i(68197),r=i(60999),s=(i(44208),i(51850)),o=(i(76369),i(62046)),a=(i(2741),i(11254),i(66344));new Map([["dash",[4,3]],["dashdot",[4,3,1,3]],["dot",[1,3]],["longdash",[8,3]],["longdashdot",[8,3,1,3]],["longdashdotdot",[8,3,1,3,1,3]],["shortdash",[4,1]],["shortdashdot",[4,1,1,1]],["shortdashdotdot",[4,1,1,1,1,1]],["shortdot",[1,1]],["solid",[]]]),new a.q(1e3),new n.A([128,128,128]);var l=i(28975),p=i(33910);function d(e,t){if(!e)return null;let i=null;return(0,p.wk)(e)?i=function(e){const t=e.symbolLayers;if(!t)return null;let i=null;return t.forEach(e=>{"object"===e.type&&e.resource?.href||(i="water"===e.type?e.color:e.material?e.material.color:null)}),i?new n.A(i):null}(e):(0,p.$y)(e)&&(i="cim"===e.type?(0,o.Nk)(e):e.color?new n.A(e.color):null),i?u(i,t):null}function u(e,t){if(null==t||null==e)return e;const i=e.toRgba();return i[3]=i[3]*t,new n.A(i)}function c(e,t,i){e&&(t||null!=i)&&(t&&(t=new n.A(t)),(0,p.wk)(e)?function(e,t,i){const r=e.symbolLayers;if(!r)return;const s=(e,r=!1)=>{let s=t??e??null;return null!=i?.override&&(!s&&r&&(s=new n.A([255,255,255])),s&&(s.a=i.override)),u(s,i?.add)};r.forEach(e=>{if("water"===e.type)return void(e.color=u(e.color,i?.add));const t=null!=e.material?e.material.color:null,n=s(t,"icon"===e.type&&null!=e.resource?.href);null==e.material?e.material=new l.N({color:n}):e.material.color=n,"outline"in e&&e.outline?.color&&null!=i?.add&&(e.outline.color=u(e.outline.color,i.add)),"marker"in e&&null!=e.marker&&(e.marker.color=s(e.marker.color))})}(e,t,i):(0,p.$y)(e)&&function(e,t,i){t=t??e.color,null!=i?.override&&t&&(t.a=i.override),t&&(e.color=u(t,i?.add)),"outline"in e&&e.outline?.color&&(e.outline.color=u(e.outline.color,i?.add))}(e,t,i))}function h(e){for(const t of e)if("number"==typeof t)return t;return null}function y(e,t,i){for(let n=0;n<3;n++){const r=e[n];switch(r){case"symbol-value":{const e=i[n];return null!=e?e/t[n]:1}case"proportional":break;default:if(r&&t[n])return r/t[n]}}return null}function m(e,t,i,n){switch(e){case"proportional":return i*n;case"symbol-value":return null!=t?t:i;default:return e}}async function f(e,t){if(e&&t)return(0,p.wk)(e)?async function(e,t){const n=e.symbolLayers;n&&await(0,r.jJ)(n,async e=>async function(e,t){switch(e.type){case"extrude":!function(e,t){const i=t[2];"number"==typeof i&&(e.size=i)}(e,t);break;case"icon":case"line":case"text":!function(e,t){const i=h(t);null!=i&&(e.size=i)}(e,t);break;case"path":!function(e,t){const i=y(t,s.Un,[e.width,void 0,e.height]);null!=i&&(e.width=m(t[0],e.width,1,i),e.height=m(t[2],e.height,1,i))}(e,t);break;case"object":await async function(e,t){const{resourceSize:n,symbolSize:r}=await async function(e){const{computeObjectLayerResourceSize:t}=await i.e(5404).then(i.bind(i,95404)),n=await t(e,10),{width:r,height:s,depth:o}=e,a=[r,o,s];let l=1;for(let e=0;e<3;e++){const t=a[e];if(null!=t){l=t/n[e];break}}for(let e=0;e<3;e++)null==a[e]&&(a[e]=n[e]*l);return{resourceSize:n,symbolSize:a}}(e),s=y(t,n,r);null!=s&&(e.width=m(t[0],r[0],n[0],s),e.depth=m(t[1],r[1],n[1],s),e.height=m(t[2],r[2],n[2],s))}(e,t)}}(e,t))}(e,t):void((0,p.$y)(e)&&function(e,t){const i=h(t);if(null!=i)switch(e.type){case"simple-marker":e.size=i;break;case"picture-marker":{const t=e.width/e.height;t>1?(e.width=i,e.height=i*t):(e.width=i*t,e.height=i);break}case"simple-line":e.width=i;break;case"text":e.font.size=i}}(e,t))}function g(e,t,i){if(e&&null!=t)if((0,p.wk)(e)){const n=e.symbolLayers;n&&n.forEach(e=>{if("object"===e.type)switch(i){case"tilt":e.tilt=(e.tilt??0)+t;break;case"roll":e.roll=(e.roll??0)+t;break;default:e.heading=(e.heading??0)+t}"icon"===e.type&&(e.angle+=t)})}else if((0,p.$y)(e))switch(e.type){case"simple-marker":case"picture-marker":case"text":e.angle+=t;break;case"cim":(0,o.KU)(e,t,!0)}}},37730:(e,t,i)=>{i.d(t,{T:()=>r});var n=i(43334);const r={getObjectId:e=>e.objectId,getAttributes:e=>e.attributes,getAttribute:(e,t)=>e.attributes[t],cloneWithGeometry:(e,t)=>new n.Om(t,e.attributes,null,e.objectId),getGeometry:e=>e.geometry,getCentroid:(e,t)=>e.ensureCentroid(t)}},40662:(e,t,i)=>{i.d(t,{A:()=>o});var n=i(31635),r=i(91429),s=i(77901);let o=class extends s.A{constructor(e){super(e)}};o=(0,n.Cg)([(0,r.$K)("esri.rest.knowledgeGraph.ObjectValue")],o)},42095:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(31635),r=i(25482),s=i(91429),o=i(77901);let a=class extends r.o{constructor(e){super(e),this.path=[]}};(0,n.Cg)([(0,s.MZ)({type:[o.A],json:{write:!0}})],a.prototype,"path",void 0),a=(0,n.Cg)([(0,s.$K)("esri.rest.knowledgeGraph.Path")],a)},42538:(e,t,i)=>{i.d(t,{A:()=>l});var n=i(31635),r=i(91429),s=i(16930),o=i(69622);let a=class extends o.A{constructor(e){super(e),this.openCypherQuery=""}};(0,n.Cg)([(0,r.MZ)()],a.prototype,"openCypherQuery",void 0),a=(0,n.Cg)([(0,r.$K)("esri.rest.knowledgeGraph.GraphQuery")],a);let l=class extends a{constructor(e){super(e),this.bindParameters=null,this.bindGeometryQuantizationParameters=null,this.outputQuantizationParameters=null,this.outputSpatialReference=null,this.provenanceBehavior=null}};(0,n.Cg)([(0,r.MZ)()],l.prototype,"bindParameters",void 0),(0,n.Cg)([(0,r.MZ)()],l.prototype,"bindGeometryQuantizationParameters",void 0),(0,n.Cg)([(0,r.MZ)()],l.prototype,"outputQuantizationParameters",void 0),(0,n.Cg)([(0,r.MZ)({type:s.A})],l.prototype,"outputSpatialReference",void 0),(0,n.Cg)([(0,r.MZ)()],l.prototype,"provenanceBehavior",void 0),l=(0,n.Cg)([(0,r.$K)("esri.rest.knowledgeGraph.GraphQueryStreaming")],l)},54238:(e,t,i)=>{i.d(t,{A:()=>o});var n=i(31635),r=i(91429),s=i(77901);let o=class extends s.A{constructor(e){super(e),this.typeName=null,this.id=null}};(0,n.Cg)([(0,r.MZ)({type:String,json:{write:!0}})],o.prototype,"typeName",void 0),(0,n.Cg)([(0,r.MZ)({type:String,json:{write:!0}})],o.prototype,"id",void 0),o=(0,n.Cg)([(0,r.$K)("esri.rest.knowledgeGraph.GraphNamedObject")],o)},54898:(e,t,i)=>{i.d(t,{Gz:()=>H,O9:()=>Q,hZ:()=>z,CP:()=>W,dD:()=>Y,UT:()=>P,MY:()=>G,Td:()=>O,iW:()=>Z,e$:()=>$,N1:()=>U,qN:()=>F});var n=i(68197),r=i(92602),s=i(70333),o=i(49186),a=i(91869),l=i(74887),p=(i(85105),i(58769));i(39410),i(33421),i(21774),i(93885);const d=p.A;var u=i(965),c=i(91218),h=i(16930),y=i(17136),m=i(99352),f=i(15375),g=i(29005),b=i(46499),w=i(73913),_=i(77548),M=i(80812),I=i(10407),T=i(48441),C=i(25927),v=i(31635),A=i(69622),E=i(91429);let S=class extends A.A{constructor(e){super(e),this.entityAdds=void 0,this.entityUpdates=void 0,this.entityDeletes=void 0,this.relationshipAdds=void 0,this.relationshipUpdates=void 0,this.relationshipDeletes=void 0,this.options=void 0}};(0,v.Cg)([(0,E.MZ)()],S.prototype,"entityAdds",void 0),(0,v.Cg)([(0,E.MZ)()],S.prototype,"entityUpdates",void 0),(0,v.Cg)([(0,E.MZ)()],S.prototype,"entityDeletes",void 0),(0,v.Cg)([(0,E.MZ)()],S.prototype,"relationshipAdds",void 0),(0,v.Cg)([(0,E.MZ)()],S.prototype,"relationshipUpdates",void 0),(0,v.Cg)([(0,E.MZ)()],S.prototype,"relationshipDeletes",void 0),(0,v.Cg)([(0,E.MZ)()],S.prototype,"options",void 0),S=(0,v.Cg)([(0,E.$K)("esri.rest.knowledgeGraph.GraphApplyEdits")],S);var x=i(23150),k=i(54218),L=i(40863),N=i(68249);const R={initializeLayersFromClientData:async(e,t,i)=>{if(t||(t=[...e.layers,...e.tables].map(e=>e.graphTypeName)),0===t?.length)return;const n=new Map;for(const i of t)n.set(i,D(e,i));const r=await(0,T.fetchClientDataAtKeys)(e.dataManager.knowledgeGraph,Array.from(n.values()),{requestOptions:{signal:i?.signal}});for(const t of[...e.layers,...e.tables]){const i=t.objectType.name;if(null==i)continue;const n=r.get(D(e,i));if(n){const e=JSON.parse(n);null===e||"object"!=typeof e||e.hasOwnProperty("showLabels")||(e.showLabels=!1),t.read(e,{origin:"service"})}}},getInclusionDefinitionFromCypherResults:async(e,t,i)=>{const n=K(e.dataModel),r=(await(0,T.executeQueryStreaming)(e,t,i)).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await r.read();if(e)break;for(const e of t)for(const t of e)V(t,n)}return n},getInclusionDefinitionFromIdTypePairs:(e,t)=>{const i=K(e.dataModel);for(const{id:e,typeName:n}of t){const t=i.namedTypeDefinitions.get(n);if(!t)throw new o.A("WebLinkChart:data-model-desync","The provided id-type pairs contained a named type not reflected in the provided knowledge graph data model.");t.members?.set(e,{id:e})}return i},getUserKGSPrivileges:async(e,t,i)=>{let n=!0,o=!1,a=!1;if(!r.A.userPrivilegesApplied)return{edit:n,fullEdit:o,updateItem:a};const l=await(0,_.wI)(t,i);if(!l)return{edit:n,fullEdit:o,updateItem:a};const p=s.id?.getCredential(`${l}/sharing`,{...i,prompt:!1});if(!p)return{edit:n,fullEdit:o,updateItem:a};const d=new M.default({id:e,portal:{url:l}});return await d.load(i),({features:{edit:n,fullEdit:o},content:{updateItem:a}}=(0,I.It)(d)),{edit:n,fullEdit:o,updateItem:a}}},D=(e,t)=>"knowledge-graph"===e.type?`${t}/Map`:`${t}/LinkChart/LinkChartSubLayer`;async function F(e,t,i){return R.initializeLayersFromClientData(e,t,i)}const j=["#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"],B="#8f8f82";function O(e){return e<0||e>=j.length?new n.A(B):new n.A(j[e])}function P(e){const t=e.toArray();return new L.A({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 G(e){let t="ESRI__ID",i=4;for(const n of e)if(n.name){if("name"===n.name.toLowerCase()){t=n.name;break}n.name.toLowerCase().includes("name")?(t=n.name,i=2):"esriFieldTypeString"===n.fieldType&&i>3&&(t=n.name,i=3)}return t}function Z(e,t,i){const n={color:[80,80,80],haloColor:[255,255,255],haloSize:.7,font:{size:10,weight:"normal"}},r=new b.A({labelExpressionInfo:new w.A({expression:"ESRI__ID"===i?`${t}`:`$feature.${i}`}),labelPlacement:"above-center",symbol:new N.A(n)}),s=new b.A({labelExpressionInfo:new w.A({expression:`'${t}' + IIf($feature.ESRI__AggregationCount>1, ' (' + $feature.ESRI__AggregationCount + ')', '')`}),labelPlacement:"center-along",labelPosition:"parallel",repeatLabel:!1,symbol:new N.A({...n,yoffset:"12px"})});return"entity"===e?[r]:[s]}function $(e,t,i){const n={color:[255,255,255],haloColor:[0,0,0],haloSize:.7,font:{size:10,weight:"bold"}},r="ESRI__ID"===i?`${e}`:`$feature.${i}`;return"point"===t?[new b.A({labelExpressionInfo:new w.A({expression:r}),labelPlacement:"above-center",symbol:new N.A(n)})]:"polyline"===t?[new b.A({labelExpressionInfo:new w.A({expression:r}),labelPlacement:"center-along",repeatLabel:!0,symbol:new N.A(n)})]:"polygon"===t?[new b.A({labelExpressionInfo:new w.A({expression:r}),labelPlacement:"always-horizontal",symbol:new N.A(n)})]:null}async function U(e,t,i){return R.getUserKGSPrivileges(e,t,i).catch(e=>((0,l.QP)(e),{edit:!0,fullEdit:!1,updateItem:!1}))}const q={capabilities:[],allowGeometryUpdates:!1,serviceCapabilities:{geometryCapabilities:{supportsZValues:!1,supportsMValues:!1}}};function z(e){const{capabilities:t,allowGeometryUpdates:i,serviceCapabilities:{geometryCapabilities:{supportsZValues:n,supportsMValues:r}}}=e?.serviceDefinition||q,s=e?.dataModel.arcgisManaged?t:t.filter(e=>"Query"===e),o=new Set(s);return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:r,supportsTrueCurve:!1,supportsZ:n},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:o.has("Create"),supportsDelete:o.has("Delete"),supportsEditing:o.has("Editing"),supportsChangeTracking:!1,supportsQuery:o.has("Query"),supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:o.has("Update"),supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:m.F,queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:m.P,editing:{supportsGeometryUpdate:!!e?.dataModel.arcgisManaged&&i,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsTrueCurveUpdate:!1,supportsTrueCurveUpdateByTrueCurveClientsOnly:!0,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:o.has("Delete"),supportsUpdateByAnonymous:!1,supportsUpdateByOthers:o.has("Update"),supportsAsyncApplyEdits:!1,zDefault:void 0}}}async function Q(e,t){const i=new S,n=t.graphTypeName,r=t.graphType,s="knowledge-graph"===t.parentCompositeLayer.type?t.geometryFieldName:null,o=!!t.fieldsIndex.get(s)?.editable,l=e=>{const i={...e};for(const e of t.fields)e.editable||delete i[e.name];for(const t of Object.keys(e))t.includes("ESRI__")&&delete i[t];return i},p=async e=>{await(0,c.initializeProjection)(e.spatialReference,h.A.WGS84);const t=(0,c.project)(e,h.A.WGS84);return"point"===t.type?t.normalize():(await(0,y.el)(t))[0]};for(const t of e.addFeatures??[]){const e=l(t.attributes);(0,_.UC)(t.sourceLayer)&&t.sourceLayer.graphTypeName===n&&("entity"===r?(i.entityAdds||(i.entityAdds=[]),s&&t.geometry&&(e[s]=await p(t.geometry)),i.entityAdds.push(new C.A({properties:e,typeName:n}))):(i.relationshipAdds||(i.relationshipAdds=[]),i.relationshipAdds.push(new x.A({properties:e,typeName:n}))))}for(const t of e.updateFeatures??[]){const e=t.attributes[f.dr],a=l(t.attributes);(0,_.UC)(t.sourceLayer)&&t.sourceLayer.graphTypeName===n&&("entity"===r?(i.entityUpdates||(i.entityUpdates=[]),s&&o&&t.geometry&&(a[s]=await p(t.geometry)),i.entityUpdates.push(new C.A({id:e,properties:a,typeName:n}))):(i.relationshipUpdates||(i.relationshipUpdates=[]),i.relationshipUpdates.push(new x.A({id:e,properties:a,typeName:n}))))}const d=new Map;for(const t of e.deleteFeatures??[])if((0,k.DU)(t)){const e=t,i=(0,a.tE)(d,e.sourceLayer.graphTypeName,()=>({typeName:e.sourceLayer.graphTypeName,ids:[]}));e.sourceLayer.graphTypeName===n&&i.ids.push(e.attributes[f.dr])}else t.objectId&&"string"==typeof t.objectId&&(0,a.tE)(d,n,()=>({typeName:n,ids:[]})).ids.push(t.objectId);for(const e of d.values())e.ids.length>0&&("entity"===r?(i.entityDeletes||(i.entityDeletes=[]),i.entityDeletes.push({typeName:e.typeName,ids:e.ids})):(i.relationshipDeletes||(i.relationshipDeletes=[]),i.relationshipDeletes.push({typeName:e.typeName,ids:e.ids})));return i}function H(e,t){const i={addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]};for(const n of e.editResults)if(n.typeName===t){for(const e of n.adds)i.addFeatureResults.push({objectId:e.id,globalId:e.id});for(const e of n.updates)i.updateFeatureResults.push({objectId:e.id,globalId:e.id});for(const e of n.deletes)i.deleteFeatureResults.push({objectId:e.id,globalId:e.id})}return i}function Y(e){if(!e.objectType)return null;const t=[];for(const i of e.fields)!i.name.includes("ESRI__")&&i.editable&&"geometry"!==i.type&&t.push(new d({fieldName:i.name}));return new u.A({elements:t})}function W(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 g.A({name:e.graphTypeName,drawingTool:t,prototype:{}})]}function K(e){const t={namedTypeDefinitions:new Map,generateAllSublayers:!1},{entityTypes:i,relationshipTypes:n}=e,r=[...i,...n];for(const e of r)t.namedTypeDefinitions.set(e.name,{useAllData:!1,members:new Map});return t}function V(e,t){if(e&&"object"==typeof e)if(function(e){return!(!e||"object"!=typeof e||Array.isArray(e))&&"id"in e&&"typeName"in e}(e)){const i=t.namedTypeDefinitions.get(e.typeName);if(!i)throw new o.A("WebLinkChart:data-model-desync","The query result contained a named type not reflected in the provided knowledge graph data model.");i.members.set(e.id,{id:e.id})}else if(function(e){return!(!e||"object"!=typeof e||Array.isArray(e))&&e&&"path"in e&&Array.isArray(e.path)}(e))for(const i of e.path)V(i,t);else if(Array.isArray(e))for(const i of e)V(i,t);else if(function(e){return!(!e||"object"!=typeof e||Array.isArray(e)||"id"in e)&&"properties"in e&&"object"==typeof e.properties}(e))for(const i of Object.values(e.properties??{}))V(i,t)}},62046:(e,t,i)=>{i.d(t,{Fe:()=>d,KU:()=>y,Nk:()=>s});var n=i(68197),r=i(93397);function s(e){const t=[];return o((0,r.lW)(e),t),t.length?new n.A((0,r.e6)(t[0])):null}function o(e,t){if(!e)return;let i;i="CIMTextSymbol"===e.type?e.symbol:e;const n="CIMPolygonSymbol"===e.type;if(i?.symbolLayers)for(const e of i.symbolLayers)if(!(e.colorLocked||n&&((0,r.mA)(e)||(0,r.MM)(e)&&e.markerPlacement&&(0,r.zr)(e.markerPlacement))))switch(e.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":e.tintColor&&a(t,e.tintColor);break;case"CIMVectorMarker":e.markerGraphics?.forEach(e=>{o(e.symbol,t)});break;case"CIMSolidStroke":case"CIMSolidFill":a(t,e.color);break;case"CIMGradientFill":l(t,e);break;case"CIMHatchFill":o(e.lineSymbol,t)}}function a(e,t){for(const i of e)if(i.join(".")===t.join("."))return;e.push(t)}function l(e,t){const i=t.colorRamp?.type;switch(i){case"CIMMultipartColorRamp":t.colorRamp.colorRamps?.forEach(t=>{"CIMLinearContinuousColorRamp"===t.type&&p(e,t)});break;case"CIMLinearContinuousColorRamp":case"CIMPolarContinuousColorRamp":p(e,t.colorRamp)}}function p(e,t){t&&(t.fromColor&&a(e,t.fromColor),t.toColor&&a(e,t.toColor))}function d(e,t,i){t instanceof n.A||(t=new n.A(t));const s=(0,r.lW)(e);s&&u(s,t,i)}function u(e,t,i){if(!e)return;let n;n="CIMTextSymbol"===e.type?e.symbol:e;const s="CIMPolygonSymbol"===n?.type;if(n?.symbolLayers)for(const e of n.symbolLayers){if(e.colorLocked)continue;if(s)if(i){const{layersToColor:t}=i;if(((0,r.mA)(e)||(0,r.MM)(e)&&e.markerPlacement&&(0,r.zr)(e.markerPlacement))&&"fill"===t||(0,r.jn)(e)&&"outline"===t)continue}else if((0,r.mA)(e)||(0,r.MM)(e)&&e.markerPlacement&&(0,r.zr)(e.markerPlacement))continue;const n=t.toArray();switch(e.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":e.tintColor=n;break;case"CIMVectorMarker":e.markerGraphics?.forEach(e=>{u(e.symbol,t,i)});break;case"CIMSolidStroke":case"CIMSolidFill":e.color=n;break;case"CIMGradientFill":c(e,t);break;case"CIMHatchFill":u(e.lineSymbol,t,i)}}}function c(e,t){const i=e.colorRamp?.type;switch(i){case"CIMMultipartColorRamp":e.colorRamp.colorRamps?.forEach(e=>{"CIMLinearContinuousColorRamp"===e.type&&h(e,t)});break;case"CIMLinearContinuousColorRamp":case"CIMPolarContinuousColorRamp":h(e.colorRamp,t)}}function h(e,t){if(e&&(e.fromColor&&(e.fromColor=t.toArray()),e.toColor)){const i=t.clone();i.a=0,e.toColor=i.toArray()}}function y(e,t,i=!1){const n=(0,r.lW)(e);if(i&&(t=360-t),"CIMTextSymbol"!==n?.type){if("CIMPointSymbol"===n?.type&&n.symbolLayers){const e=t-(n.angle||0);for(const t of n.symbolLayers)if((0,r.MM)(t)){let i=t.rotation||0;t.rotateClockwise?i-=e:i+=e,t.rotation=i}n.angle=t}}else n.angle=t}},62796:(e,t,i)=>{i.d(t,{A:()=>me});var n=i(31635),r=i(37838),s=i(49186),o=i(4718),a=i(53966),l=i(25728),p=i(91429),d=(i(29953),i(965)),u=i(5443),c=i(86738),h=i(39829),y=i(82799),m=i(91218),f=i(16930),g=i(21325),b=i(50498),w=i(55156),_=i(60950),M=i(89808),I=i(99959);const T=Symbol("isKnowledgeGraphGraphicOriginSymbol");var C;class v extends I.A{get[(C=T,_.ym)](){return this.sublayer}get[w.e](){return this.sublayer}get[M.Q](){return this.sublayer}constructor(e,t){super(),this[C]=!0,this.type="knowledge-graph",this.layer=e,this.sublayer=t}get id(){return this.layer.id}}const A=Symbol("isLinkChartGraphicOriginSymbol");var E;class S extends I.A{get[(E=A,M.Q)](){return this.layer}constructor(e,t){super(),this[E]=!0,this.type="link-chart",this.layer=e,this.sublayer=t}get id(){return`${this.layer.id}:__${this.sublayer.id}__`}}var x=i(4146),k=i(83221),L=i(56390),N=i(64714),R=i(15375);const D=(0,i(17036).p)(),F=e=>{const t=e;let i=class extends t{constructor(){super(...arguments),this.fields=[],this.fieldsIndex=null}};return(0,n.Cg)([(0,p.MZ)(D.fields)],i.prototype,"fields",void 0),(0,n.Cg)([(0,p.MZ)(D.fieldsIndex)],i.prototype,"fieldsIndex",void 0),i=(0,n.Cg)([(0,p.$K)("esri.layers.knowledgeGraph.KnowledgeGraphSublayerBase")],i),i};var j=i(54898),B=i(63074),O=i(6455),P=i(87718),G=i(56658),Z=i(32756),$=i(54310),U=i(25036),q=i(82935),z=i(10873),Q=i(13213),H=i(29005),Y=i(20437),W=i(30524),K=i(46499),V=i(39383),X=i(96184),J=i(96576),ee=i(65494),te=i(41214),ie=i(48441),ne=i(22671),re=i(61956),se=i(30291),oe=i(88625),ae=i(37531),le=i(61322),pe=i(43937);function de(e){if(!e.json)return e;e.json.write=ue(e.json.write);const t=e.json.origins;if(!t)return e;let i;for(i in t){const e=t[i];e&&(e.write=ue(e.write))}return e}function ue(e){return"object"==typeof e&&e?(!1!==e.enabled&&(e.overridePolicy=function(e){const{target:t,writer:i,overridePolicy:n,...r}=e;return function(e,t){const i=he.call(this,e,t);return i.enabled?{...r,...i}:i}}(e)),e):!0===e?ce():e}function ce(){return{overridePolicy:he}}function he(e,t){const i=!!this.geometryType;let n={enabled:i};return i&&(n={...n,...ye.call(this,e,t)}),n}function ye(e,t){return{ignoreOrigin:this.originIdOf(t)>0}}let me=class extends(F((0,O.FJ)((0,G.J)((0,P.F)((0,B.dM)((0,Z.fY)((0,q.e)((0,U.j)((0,$.J)((0,l.P)(x.A))))))))))){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=R.dr,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 le.default(e.port1,{channel:e,client:{queryFeatures:(e,t={})=>{const i=re.A.fromJSON(e);return this.queryFeaturesJSON(i,t)}}}),[e.port2]})},this.type="knowledge-graph-sublayer",this.useViewTime=!0,this.visible=!0}get capabilities(){return this.parent?this.parent.sublayerCapabilities:(0,j.hZ)(null)}get isTable(){return"link-chart"!==this.parentCompositeLayer?.type&&null==this.geometryFieldName}get defaultPopupTemplate(){return this.createPopupTemplate()}get editingEnabled(){return this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get effectiveCapabilities(){const e=(0,o.o8)(this.capabilities),{operations:t,editing:i}=e;return this.userHasUpdateItemPrivileges&&(t.supportsAdd=t.supportsDelete=t.supportsEditing=t.supportsQuery=t.supportsUpdate=i.supportsDeleteByOthers=i.supportsGeometryUpdate=i.supportsUpdateByOthers=!0),this.userHasFullEditingPrivileges&&t.supportsEditing&&(t.supportsAdd=t.supportsDelete=t.supportsUpdate=i.supportsGeometryUpdate=!0),e}get effectiveEditingEnabled(){return this.userHasUpdateItemPrivileges||this.editingEnabled}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}get fields(){const e=[],t=new Map;for(const e of this.parent?.knowledgeGraph.dataModel.domains??[])t.set(e.name,e);return this.objectType?.properties?.forEach(i=>{const n="esriFieldTypeOID"===i.fieldType?"esriFieldTypeInteger":i.fieldType,r=Y.A.fromJSON({name:i.name,type:n,alias:i.alias,defaultValue:i.defaultValue,editable:i.editable,nullable:i.nullable,domain:i.domain&&t.has(i.domain)?t.get(i.domain).toJSON():void 0});e.push(r)}),e.push(Y.A.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1}),Y.A.fromJSON({name:R.M1,type:"esriFieldTypeInteger",alias:R.M1,editable:!1}),Y.A.fromJSON({name:R.BL,type:"esriFieldTypeInteger",alias:R.BL,editable:!1})),e}get formTemplate(){return this._isOverridden("formTemplate")?this._get("formTemplate"):(0,j.dD)(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?b.gy.fromJSON(t):null}get geometryFieldName(){if("link-chart"===this.parentCompositeLayer?.type)return R.T1;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 v(this.parent,this);case"link-chart":return new S(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,i=t?this.objectType?.properties?.[t]:null;return i?.hasM??!1}get hasZ(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,i=t?this.objectType?.properties?.[t]:null;return i?.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?(0,j.MY)(this.objectType.properties):"ESRI__ID";return"link-chart"===this.parentCompositeLayer.type?(0,j.iW)(this.graphType,this.graphTypeName,e):(0,j.e$)(this.graphTypeName,this.geometryType,e)}set renderer(e){(0,W.yp)(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),i=(0,j.Td)(t);if("link-chart"===this.parentCompositeLayer?.type){if("relationship"===this.graphType)return new J.A({type:"simple",symbol:(0,j.UT)(i)});const e=(0,ee.r)((0,N.F0)(b.gy.toJSON("point")).renderer);return(0,ae.dt)(e.symbol,i),e}const n=(0,ee.r)((0,N.F0)(b.gy.toJSON(this.geometryType)).renderer);return(0,ae.dt)(n.symbol,i),n}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??f.A.WGS84}get templates(){return this._isOverridden("templates")?this._get("templates"):(0,j.CP)(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"}get userHasEditingPrivileges(){return!this.parent||this.parent.userHasEditingPrivileges}get userHasFullEditingPrivileges(){return!!this.parent&&this.parent.userHasFullEditingPrivileges}get userHasUpdateItemPrivileges(){return!!this.parent&&this.parent.userHasUpdateItemPrivileges}createPopupTemplate(e){return(0,se.tn)(this,e)}createQuery(){return new re.A({where:"1=1",outFields:["*"]})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){return this.fields.find(t=>t.name===e)?.domain||null}async queryFeatures(e,t){await this.load();const{resolvedQuery:i,queryEngine:n}=await this._setupQueryObjects(e),r=this.graphicOrigin,s=ne.A.fromJSON(await n.executeQuery(i.toJSON(),t?.signal));return s.features.forEach(e=>{e.sourceLayer=this,e.origin=r}),s}async queryFeaturesJSON(e,t){await this.load();const{resolvedQuery:i,queryEngine:n}=await this._setupQueryObjects(e);return await n.executeQuery(i.toJSON(),t?.signal)}async queryFeatureCount(e,t){await this.load();const{resolvedQuery:i,queryEngine:n}=await this._setupQueryObjects(e);return n.executeQueryForCount(i.toJSON(),t?.signal)}async queryExtent(e={},t){await this.load();const i={...e,returnGeometry:!0},{resolvedQuery:n,queryEngine:r}=await this._setupQueryObjects(i),s=await r.executeQueryForExtent(n.toJSON(),t?.signal);let o;return o=null!=s.extent?.xmin&&null!=s.extent?.xmax&&null!=s.extent?.ymin&&null!=s.extent?.ymax?new u.A(s.extent):new u.A,{count:s.count,extent:o}}async queryObjectIds(e,t){await this.load();const i=re.A.from(e);let n;if("link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)n=this._cachedQueryEngine;else{const e=await this.parentCompositeLayer.dataManager.getData(i,this,t);n=this.loadQueryEngine(e)}return await n.executeQueryForIds(i.toJSON(),t?.signal)}async applyEdits(e){if(!this.parentCompositeLayer.dataManager.knowledgeGraph)throw new s.A("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(0,j.O9)(e,this);t.options={cascadeDelete:!0,cascadeProvenanceDelete:!!this.parent?.knowledgeGraph.serviceDefinition.supportsProvenance||void 0};const i=await(0,ie.executeApplyEdits)(this.parentCompositeLayer.dataManager.knowledgeGraph,t),n=(0,j.Gz)(i,this.graphTypeName),r={addedFeatures:n.addFeatureResults,updatedFeatures:n.updateFeatureResults,deletedFeatures:n.deleteFeatureResults,addedAttachments:n.addAttachmentResults,deletedAttachments:n.deleteAttachmentResults,updatedAttachments:n.updateAttachmentResults,exceededTransferLimit:!1,historicMoment:new Date,edits:void 0};return this.emit("edits",r),this.emit("apply-edits",{result:Promise.resolve(r)}),"link-chart"===this.parentCompositeLayer.type&&await this.parentCompositeLayer.refreshLinkChartCache([...r.addedFeatures.map(e=>e.globalId),...r.updatedFeatures.map(e=>e.globalId),...r.deletedFeatures.map(e=>e.globalId)]),n}loadQueryEngine(e){const t=new k.A({geometryType:b.gy.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),i=new L.do({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:b.gy.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 i.featureStore.addMany(e),i}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new re.A({where:"1=1",outFields:[R.dr]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}load(e){return this.addResolvingPromise(this.parent.load(e).then(()=>(0,W.sv)(this.timeInfo,this.fieldsIndex))),Promise.resolve(this)}async _setupQueryObjects(e,t){const i=re.A.from(e),n=i.geometry;if(n&&!n.spatialReference?.isWGS84&&(await(0,m.initializeProjection)(n.spatialReference,g.KK),i.geometry=(0,m.project)(n instanceof h.A||n instanceof y.A||n instanceof c.A?n:n.extent,g.KK)),"link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)return{resolvedQuery:i,queryEngine:this._cachedQueryEngine};const r=await this.parentCompositeLayer.dataManager.getData(i,this,t);return{resolvedQuery:i,queryEngine:this.loadQueryEngine(r)}}};(0,n.Cg)([(0,p.MZ)(de((0,o.o8)(B.sU)))],me.prototype,"blendMode",void 0),(0,n.Cg)([(0,p.MZ)({readOnly:!0})],me.prototype,"capabilities",null),(0,n.Cg)([(0,p.MZ)()],me.prototype,"isTable",null),(0,n.Cg)([(0,p.MZ)({json:{origins:{"web-scene":{write:!1}},write:ce()}})],me.prototype,"charts",void 0),(0,n.Cg)([(0,p.MZ)({readOnly:!0})],me.prototype,"defaultPopupTemplate",null),(0,n.Cg)([(0,p.MZ)({type:String,json:{origins:{service:{read:!1}},name:"layerDefinition.definitionExpression",write:{ignoreOrigin:!0}}})],me.prototype,"definitionExpression",void 0),(0,n.Cg)([(0,p.MZ)(de((0,o.o8)(O.Dp)))],me.prototype,"displayFilterEnabled",void 0),(0,n.Cg)([(0,p.MZ)(de((0,o.o8)(O.KV)))],me.prototype,"displayFilterInfo",void 0),(0,n.Cg)([(0,p.MZ)()],me.prototype,"editingEnabled",null),(0,n.Cg)([(0,p.MZ)(de((0,o.o8)(B.LF)))],me.prototype,"effect",void 0),(0,n.Cg)([(0,p.MZ)({readOnly:!0})],me.prototype,"effectiveCapabilities",null),(0,n.Cg)([(0,p.MZ)({readOnly:!0})],me.prototype,"effectiveEditingEnabled",null),(0,n.Cg)([(0,p.MZ)({type:oe.A})],me.prototype,"elevationInfo",void 0),(0,n.Cg)([(0,p.MZ)(de((0,o.o8)(P.Y)))],me.prototype,"featureEffect",void 0),(0,n.Cg)([(0,p.MZ)(de((0,o.o8)(Q.d)))],me.prototype,"featureReduction",null),(0,n.Cg)([(0,p.MZ)()],me.prototype,"fields",null),(0,n.Cg)([(0,p.MZ)({type:d.A})],me.prototype,"formTemplate",null),(0,n.Cg)([(0,p.MZ)()],me.prototype,"geometryType",null),(0,n.Cg)([(0,p.MZ)()],me.prototype,"geometryFieldName",null),(0,n.Cg)([(0,p.MZ)({readOnly:!0})],me.prototype,"graphicOrigin",null),(0,n.Cg)([(0,p.MZ)({type:["entity","relationship"],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],me.prototype,"graphType",void 0),(0,n.Cg)([(0,p.MZ)({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],me.prototype,"graphTypeName",null),(0,n.Cg)([(0,p.MZ)()],me.prototype,"hasM",null),(0,n.Cg)([(0,p.MZ)()],me.prototype,"hasZ",null),(0,n.Cg)([(0,p.MZ)({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],me.prototype,"id",void 0),(0,n.Cg)([(0,p.MZ)({type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",default:!1,write:{overridePolicy(){return{enabled:!!this.geometryType,alwaysWriteDefaults:!0,ignoreOrigin:!0}}}}})],me.prototype,"labelsVisible",void 0),(0,n.Cg)([(0,p.MZ)({type:[K.A],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:function(e,t,i){const n=[["ESRI__AGGREGATION_COUNT",R.M1],["ESRI__ORIGIN_ID",R.Cz],["ESRI__DESTINATION_ID",R.KQ],["ESRI__LAYOUT_GEOMETRY",R.T1]];try{for(const t of e)for(const[e,i]of n)t.labelExpression=t.labelExpression?.replaceAll(e,i),t.labelExpressionInfo?.expression&&(t.labelExpressionInfo.expression=t.labelExpressionInfo.expression.replaceAll(e,i))}catch(e){a.A.getLogger(this).warn("Error updating labelingInfo",e)}return(0,V.w)(e,t,i)},write:ce()}})],me.prototype,"labelingInfo",null),(0,n.Cg)([(0,p.MZ)({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}}})],me.prototype,"layerType",void 0),(0,n.Cg)([(0,p.MZ)(de((0,o.o8)(z.fV)))],me.prototype,"legendEnabled",void 0),(0,n.Cg)([(0,p.MZ)(de((0,o.o8)(z.hG)))],me.prototype,"maxScale",void 0),(0,n.Cg)([(0,p.MZ)(de((0,o.o8)(z.hn)))],me.prototype,"minScale",void 0),(0,n.Cg)([(0,p.MZ)()],me.prototype,"objectIdField",void 0),(0,n.Cg)([(0,p.MZ)()],me.prototype,"objectType",void 0),(0,n.Cg)([(0,p.MZ)(de((0,o.o8)(z.ke)))],me.prototype,"opacity",void 0),(0,n.Cg)([(0,p.MZ)(de((0,o.o8)(Z.ne)))],me.prototype,"orderBy",void 0),(0,n.Cg)([(0,p.MZ)({clonable:!1})],me.prototype,"parent",void 0),(0,n.Cg)([(0,p.MZ)()],me.prototype,"parentCompositeLayer",void 0),(0,n.Cg)([(0,p.MZ)(de((0,o.o8)(z.M6)))],me.prototype,"popupEnabled",void 0),(0,n.Cg)([(0,p.MZ)({type:r.A,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],me.prototype,"popupTemplate",void 0),(0,n.Cg)([(0,p.MZ)({type:Number,json:{write:{overridePolicy:ye}}})],me.prototype,"refreshInterval",void 0),(0,n.Cg)([(0,p.MZ)({types:te.Hg,json:{name:"layerDefinition.drawingInfo.renderer",write:ce()}})],me.prototype,"renderer",null),(0,n.Cg)([(0,p.MZ)()],me.prototype,"source",void 0),(0,n.Cg)([(0,p.MZ)()],me.prototype,"spatialReference",null),(0,n.Cg)([(0,p.MZ)({type:H.A})],me.prototype,"templates",null),(0,n.Cg)([(0,p.MZ)({type:X.A,json:{name:"layerDefinition.timeInfo",write:{overridePolicy:ye},origins:{"web-document":{name:"layerDefinition.timeInfo",read:!0,write:{overridePolicy:ye}},"portal-item":{name:"layerDefinition.timeInfo",read:!0,write:{overridePolicy:ye}}}}})],me.prototype,"timeInfo",null),(0,n.Cg)([(0,p.MZ)({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],me.prototype,"title",null),(0,n.Cg)([(0,pe.K)("title")],me.prototype,"writeTitle",null),(0,n.Cg)([(0,p.MZ)({json:{read:!1}})],me.prototype,"type",void 0),(0,n.Cg)([(0,p.MZ)(de((0,o.o8)(q.B)))],me.prototype,"useViewTime",void 0),(0,n.Cg)([(0,p.MZ)({readOnly:!0})],me.prototype,"userHasEditingPrivileges",null),(0,n.Cg)([(0,p.MZ)({readOnly:!0})],me.prototype,"userHasFullEditingPrivileges",null),(0,n.Cg)([(0,p.MZ)({readOnly:!0})],me.prototype,"userHasUpdateItemPrivileges",null),(0,n.Cg)([(0,p.MZ)({type:Boolean,json:{name:"visibility",write:ce()}})],me.prototype,"visible",void 0),me=(0,n.Cg)([(0,p.$K)("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],me)},64714:(e,t,i)=>{i.d(t,{F0:()=>a,Vx:()=>d,e2:()=>c,f:()=>h});var n=i(44208),r=i(4718),s=i(99352),o=i(93470);function a(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?o.Cb:"esriGeometryPolyline"===e?o.yM:o.WR}}}const l=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let p=1;function d(e,t){if((0,n.A)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let i=`this${u(t)} = null;`;for(const t in e)i+=`this${u(t)} = ${JSON.stringify(e[t])};`;const n=new Function(`\n return class AttributesClass$${p++} {\n constructor() {\n ${i};\n }\n }\n `)();return()=>new n}catch(i){return()=>({[t]:null,...e})}}function u(e){return l.test(e)?`.${e}`:`[${JSON.stringify(e)}]`}function c(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,r.o8)(e)}}]}function h(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:!1,supportsTrueCurve:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!0,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:s.F,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:s.P,editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsTrueCurveUpdate:t,supportsTrueCurveUpdateByTrueCurveClientsOnly:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}},67996:(e,t,i)=>{i.d(t,{cZ:()=>x,XW:()=>R,fe:()=>k});var n=i(11254),r=i(49186),s=i(91869),o=(i(90708),i(92722)),a=i(16930);class l{constructor(){this.version="",this.queryResult=new p}}class p{constructor(){this.featureResult=new d}}class d{constructor(){this.objectIdFieldName="",this.uniqueIdField=new u,this.globalIdFieldName="",this.geohashFieldName="",this.geometryProperties=new c,this.geometryType=null,this.spatialReference=new a.A,this.exceededTransferLimit=!1,this.hasZ=!1,this.hasM=!1,this.transform=new h,this.fields=[],this.fieldNameToAttributeIndexMap={},this.values=[],this.features=[],this.geometryFields=[]}}class u{constructor(){this.name="",this.isSystemMaintained=!1}}class c{constructor(){this.shapeAreaFieldName="",this.shapeLengthFieldName="",this.units=""}}class h{constructor(){this.quantizeOriginPosition="upperLeft",this.scale=new y,this.translate=new m}}class y{constructor(){this.xScale=0,this.yScale=0,this.mScale=0,this.zScale=0}}class m{constructor(){this.xTranslate=0,this.yTranslate=0,this.mTranslate=0,this.zTranslate=0}}class f{constructor(){this.name="",this.fieldType="esriFieldTypeString",this.alias="",this.sqlType="sqlTypeVarchar",this.domain="",this.defaultValue=""}}class g{constructor(){this.attributes=[],this.compressedGeometry=new b,this.centroid=new b,this.aggregateGeometries=[]}}class b{constructor(){this.geometryType=null,this.lengths=[],this.coords=[]}}const w=["ELEMENTUID","TYPENAME"];var _=i(45724),M=i(35448);const I={upperLeft:0,lowerLeft:1},T={sqlTypeBigInt:0,sqlTypeBinary:1,sqlTypeBit:2,sqlTypeChar:3,sqlTypeDate:4,sqlTypeDecimal:5,sqlTypeDouble:6,sqlTypeFloat:7,sqlTypeGeometry:8,sqlTypeGUID:9,sqlTypeInteger:10,sqlTypeLongNVarchar:11,sqlTypeLongVarbinary:12,sqlTypeLongVarchar:13,sqlTypeNChar:14,sqlTypeNVarChar:15,sqlTypeOther:16,sqlTypeReal:17,sqlTypeSmallInt:18,sqlTypeSqlXml:19,sqlTypeTime:20,sqlTypeTimestamp:21,sqlTypeTimestamp2:22,sqlTypeTinyInt:23,sqlTypeVarbinary:24,sqlTypeVarchar:25};var C=i(93637);function v(e){const t=new b;t.geometryType=(0,C.i7)(M.bV,e.geometry_type.value);const i=[],n=[];for(let t=0;t<e.lengths.length;t++)i.push(e.lengths[t]);for(let t=0;t<e.coords.length;t++)n.push(e.coords[t]);return t.lengths=i,t.coords=n,t}function A(e){const t=new f;return t.name=e.name,t.alias=e.alias,t.fieldType=(0,C.i7)(M.r5,e.field_type.value),t.sqlType=(0,C.i7)(T,e.sql_type.value),t.domain=e.domain,t.defaultValue=e.default_value,t}function E(e){const t=A(e);return t.geometryType=(0,C.i7)(M.bV,e.geometry_type.value),t}function S(e){const t=new h;t.quantizeOriginPosition=(0,C.i7)(I,e.quantizeOriginPosition.value);const i=t.scale,n=e.scale;i.xScale=n.xScale,i.yScale=n.yScale,i.mScale=n.mScale,i.zScale=n.zScale;const r=t.translate,s=e.translate;return r.xTranslate=s.xTranslate,r.yTranslate=s.yTranslate,r.mTranslate=s.mTranslate,r.zTranslate=s.zTranslate,t}async function x(e,t,i){t??=!1;const o={generateAllSublayers:t,namedTypeDefinitions:new Map};return await async function(e,t){const i=await(0,n.A)(e,{responseType:"array-buffer",signal:t?.signal}),s=await i.data;return async function(e){const t=new((await(0,_.I)()).MapOfObjectIdentifierSetsDecoder),i=t.decode(new Uint8Array(e)),n=new Map;if(0!==i.error_code)throw new r.A("knowledge-graph:layer-support-utils",i.error_message);const s=t.get_map_of_identifier_sets(),o=s.keys,a=o.size();for(let e=0;e<a;e++){const t=o.get(e),i=s.query_identifier_set(t),a=[];if(1===i.id_array_type.value){const e=i.get_globalid_array(),t=e.count();for(let i=0;i<t;i++)a.push(e.get_globalid_at(i))}else if(3===i.id_array_type.value){const e=i.get_identifier_array(),t=e.count();for(let i=0;i<t;i++)a.push(e.get_identifier_at(i).toString())}else if(2===i.id_array_type.value){const e=i.get_string_array(),t=e.count();for(let i=0;i<t;i++)a.push(e.get_string_at(i))}else{if(0!==i.id_array_type.value)throw new r.A("knowledge-graph:layer-support-utils","Tried to encode an unexpected ID Array type.");{const e=i.get_oid_array(),t=e.count();for(let i=0;i<t;i++)a.push(e.get_objectid_at(i).toString())}}n.set(t,a)}return t.delete(),n}(new Uint8Array(s))}(e,i).then(e=>{!function(e,t){for(const[i,n]of e){const e=(0,s.tE)(t.namedTypeDefinitions,i,()=>({useAllData:!1,members:new Map}));for(const t of n)e.members.has(t)||e.members.set(t,{id:t})}}(e,o)}),o}async function k(e){const t=await(0,_.I)(),i=new t.MapOfObjectIdentifierSets;!function(e,t,i){for(const[n,r]of i.namedTypeDefinitions){if(!r.members||r.useAllData)continue;const i=r.members.keys();let s=!1,o=!0;const a=new t.ObjectIdArray,l=new t.StringArray,p=new t.GlobalIdArray,d=new t.IdentifierArray,u=new t.ObjectIdentifierSet;for(const e of i)o&&(s=!isNaN(Number(e)),o=!1),s?a.add_objectid(Number(e)):(l.add_string(e),p.add_globalid(e)),d.add_identifier(e);u.set_oid_array(a),u.set_string_array(l),u.set_globalid_array(p),u.set_identifier_array(d),a.delete(),l.delete(),p.delete(),d.delete(),e.put_identifier_set(n,u),u.delete()}}(i,t,e);const n=new t.MapOfObjectIdentifierSetsEncoder;try{n.set_map_of_identifier_sets(i),n.encode();const e=n.get_encoding_result();if(0!==e.error.error_code)throw new r.A("knowledge-graph:layer-support-utils",e.error.error_message);const t=structuredClone(e.get_byte_buffer());return n.delete(),t}finally{i.delete()}}async function L(e,t){const i=await(0,n.A)(e,{responseType:"array-buffer",signal:t?.signal});return async function(e){const t=new((await(0,_.I)()).FeatureCollectionDecoder),i=t.decode(new Uint8Array(e));if(0!==i.error_code)throw new r.A("knowledge-graph:layer-support-utils",i.error_message);const n=function(e){const t=new l;t.version=e.version;const i=e.get_query_result();if(0!==i.results_type.value)throw new Error("Got a non-feature collection type");const n=i.get_feature_result(),r=t.queryResult.featureResult;r.objectIdFieldName=n.objectid_field_name,r.exceededTransferLimit=n.exceeded_transfer_limit,r.hasM=n.has_m,r.hasZ=n.has_z,r.geometryType=(0,C.i7)(M.bV,n.geometry_type.value),r.globalIdFieldName=n.globalid_field_name,r.geohashFieldName=n.geohash_field_name;const s=r.uniqueIdField,o=n.unique_id_field;s.name=o.name,s.isSystemMaintained=o.isSystemMaintained;const a=r.geometryProperties,p=n.geometry_properties;a.shapeAreaFieldName=p.shapeAreaFieldName,a.shapeLengthFieldName=p.shapeLengthFieldName,a.units=p.units;const d=r.spatialReference,u=n.spatial_reference;d.wkid=u.wkid,d.latestWkid=u.latestWkid,d.vcsWkid=u.vcsWkid,d.latestVcsWkid=u.latestVcsWkid,d.wkt=u.wkt,r.transform=S(n.transform);const c=r.fields,h=r.fieldNameToAttributeIndexMap,y=n.fields,m=y.size();for(let e=0;e<m;e++){const t=y.get(e),i=A(t);c.push(i),h[i.name]=e,t.delete()}y.delete();const f=r.values,b=n.values_count();for(let e=0;e<b;e++)f.push(n.get_value_at(e));const _=r.features,I=n.features,T=I.size();if(T>0)for(const e of w)if(void 0===h[e])throw new Error(`Feature collection missing required attribute: ${e}`);for(let e=0;e<T;e++){const t=new g,i=I.get(e),n=t.attributes,r=i.attributes_count();for(let e=0;e<r;e++)n.push(i.get_attribute_at(e));const s=i.get_compressed_geometry();s&&(t.compressedGeometry=v(s),t.centroid=v(i.get_centroid()));const o=t.aggregateGeometries,a=i.aggregate_geometries,l=a.size();for(let e=0;e<l;e++){const t=a.get(e),i=v(t);o.push(i),t.delete()}a.delete(),_.push(t),i.delete()}I.delete();const x=r.geometryFields,k=n.geometry_fields,L=k.size();for(let e=0;e<L;e++){const t=k.get(e),i=E(t);x.push(i),t.delete()}return k.delete(),t}(t.get_feature_collection());return t.delete(),n}(await i.data)}function N(e,t){if(!e?.queryResult?.featureResult)return t;const{hasZ:i,hasM:n}=e.queryResult.featureResult,r=e.queryResult.featureResult.fieldNameToAttributeIndexMap;for(const a of e.queryResult.featureResult.features){const e=a.attributes[r.TYPENAME],l=(0,s.tE)(t.namedTypeDefinitions,e,()=>({useAllData:!1,members:new Map})),p=a.attributes[r.ELEMENTUID];if(a.compressedGeometry?.coords?.length>0){let e=a.compressedGeometry.lengths;"esriGeometryPoint"===a.compressedGeometry.geometryType&&(e=[]),l.members.set(p,{id:p,linkChartLocation:new o.A(e,a.compressedGeometry.coords,i,n)})}else l.members.set(p,{id:p})}return t}const R={fetchAndConvertSerializedLinkChart:(e,t)=>async function(e,t){const i=[],n={generateAllSublayers:!1,namedTypeDefinitions:new Map};return e.entitiesUrl&&i.push(L(e.entitiesUrl,t).then(e=>{N(e,n)})),e.relationshipsUrl&&i.push(L(e.relationshipsUrl,t).then(e=>{N(e,n)})),await Promise.all(i),n}(e,t)}},69860:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(65864),r=i(90708),s=i(43334),o=i(15375);class a{constructor(){this._featureLookup=new Map}static getInstance(){return a.instance||(a.instance=new a),a.instance}static resetInstance(){a.instance&&(a.instance=null)}deleteFromStore(e){e.forEach(e=>{this._featureLookup.delete(e)})}readFromStoreByList(e){const t=[];return e.forEach(e=>{const i=this.readFromStoreById(e);i&&t.push(i)}),t}readFromStoreById(e){return this._featureLookup.get(e)??null}writeToStore(e,t,i){const a=[];return e.forEach(e=>{if(!e?.id)return;e.properties||(e.properties=[]);let l=null;i&&e.properties[i]&&(l=(0,r.Ux)(e.properties[i])),"originId"in e&&"destinationId"in e&&(e.properties[o.Cz]=e.originId,e.properties[o.KQ]=e.destinationId),e.properties[t]=e.id;let p=e.properties;if(e.id){const t=this._featureLookup.get(e.id);if(t?.attributes){p={...t.attributes,...p};const e=i&&p[i];null!=e&&(p[i]=(0,n.rS)(e)),l=l??t.geometry}}const d=new s.Om(l?.clone(),p,null,e.id);this._featureLookup.set(`${e.typeName?`${e.typeName}__${e.id}`:e.id}`,d),a.push(d)}),a}}},75503:(e,t,i)=>{i.d(t,{EC:()=>v,wq:()=>a});var n=i(4576),r=i(21818),s=(i(44208),i(15142)),o=i(11006);class a{constructor(e=9,t){this._compareMinX=c,this._compareMinY=h,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),M.prune(),I.prune(),T.prune(),C.prune()}all(e){l(this._data,e)}search(e,t){let i=this._data;const n=this._toBBox;if(w(e,i))for(M.clear();i;){for(let r=0,s=i.children.length;r<s;r++){const s=i.children[r],o=i.leaf?n(s):s;w(e,o)&&(i.leaf?t(s):b(e,o)?l(s,t):M.push(s))}i=M.pop()}}collides(e){let t=this._data;const i=this._toBBox;if(!w(e,t))return!1;for(M.clear();t;){for(let n=0,r=t.children.length;n<r;n++){const r=t.children[n],s=t.leaf?i(r):r;if(w(e,s)){if(t.leaf||b(e,s))return!0;M.push(r)}}t=M.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,i=e.length;t<i;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new E([]),this}remove(e){if(!e)return this;let t,i=this._data,s=null,o=0,a=!1;const l=this._toBBox(e);for(T.clear(),C.clear();i||T.length>0;){if(i||(i=T.pop(),s=T.data[T.length-1],o=C.pop()??0,a=!0),i.leaf&&(t=(0,n.qh)(i.children,(0,r.zI)(e),i.children.length,i.indexHint),-1!==t))return i.children.splice(t,1),T.push(i),this._condense(T),this;a||i.leaf||!b(i,l)?s?(o++,i=s.children[o],a=!1):i=null:(T.push(i),C.push(o),o=0,s=i,i=i.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_build(e,t,i,n){const r=i-t+1;let s=this._maxEntries;if(r<=s){const n=new E(e.slice(t,i+1));return p(n,this._toBBox),n}n||(n=Math.ceil(Math.log(r)/Math.log(s)),s=Math.ceil(r/s**(n-1)));const o=new S([]);o.height=n;const a=Math.ceil(r/s),l=a*Math.ceil(Math.sqrt(s));_(e,t,i,l,this._compareMinX);for(let r=t;r<=i;r+=l){const t=Math.min(r+l-1,i);_(e,r,t,a,this._compareMinY);for(let i=r;i<=t;i+=a){const r=Math.min(i+a-1,t);o.children.push(this._build(e,i,r,n-1))}}return p(o,this._toBBox),o}_insert(e,t,i){const n=this._toBBox,r=i?e:n(e);T.clear();const s=function(e,t,i,n){for(;n.push(t),!0!==t.leaf&&n.length-1!==i;){let i,n=1/0,r=1/0;for(let s=0,o=t.children.length;s<o;s++){const o=t.children[s],a=y(o),l=f(e,o)-a;l<r?(r=l,n=a<n?a:n,i=o):l===r&&a<n&&(n=a,i=o)}t=i||t.children[0]}return t}(r,this._data,t,T);for(s.children.push(e),u(s,r);t>=0&&T.data[t].children.length>this._maxEntries;)this._split(T,t),t--;!function(e,t,i){for(let n=i;n>=0;n--)u(t.data[n],e)}(r,T,t)}_split(e,t){const i=e.data[t],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);const s=this._chooseSplitIndex(i,r,n);if(!s)return;const o=i.children.splice(s,i.children.length-s),a=i.leaf?new E(o):new S(o);a.height=i.height,p(i,this._toBBox),p(a,this._toBBox),t?e.data[t-1].children.push(a):this._splitRoot(i,a)}_splitRoot(e,t){this._data=new S([e,t]),this._data.height=e.height+1,p(this._data,this._toBBox)}_chooseSplitIndex(e,t,i){let n,r,s;n=r=1/0;for(let o=t;o<=i-t;o++){const t=d(e,0,o,this._toBBox),a=d(e,o,i,this._toBBox),l=g(t,a),p=y(t)+y(a);l<n?(n=l,s=o,r=p<r?p:r):l===n&&p<r&&(r=p,s=o)}return s}_chooseSplitAxis(e,t,i){const n=e.leaf?this._compareMinX:c,r=e.leaf?this._compareMinY:h;this._allDistMargin(e,t,i,n)<this._allDistMargin(e,t,i,r)&&e.children.sort(n)}_allDistMargin(e,t,i,n){e.children.sort(n);const r=this._toBBox,s=d(e,0,t,r),o=d(e,i-t,i,r);let a=m(s)+m(o);for(let n=t;n<i-t;n++){const t=e.children[n];u(s,e.leaf?r(t):t),a+=m(s)}for(let n=i-t-1;n>=t;n--){const t=e.children[n];u(o,e.leaf?r(t):t),a+=m(o)}return a}_condense(e){for(let t=e.length-1;t>=0;t--){const i=e.data[t];if(0===i.children.length)if(t>0){const r=e.data[t-1],s=r.children;s.splice((0,n.qh)(s,i,s.length,r.indexHint),1)}else this.clear();else p(i,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function l(e,t){let i=e;for(I.clear();i;){if(!0===i.leaf)for(const e of i.children)t((0,r.zI)(e));else I.pushArray(i.children);i=I.pop()??null}}function p(e,t){d(e,0,e.children.length,t,e)}function d(e,t,i,n,r){r||(r=new E([])),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let s,o=t;o<i;o++)s=e.children[o],u(r,e.leaf?n(s):s);return r}function u(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function c(e,t){return e.minX-t.minX}function h(e,t){return e.minY-t.minY}function y(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function m(e){return e.maxX-e.minX+(e.maxY-e.minY)}function f(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function g(e,t){const i=Math.max(e.minX,t.minX),n=Math.max(e.minY,t.minY),r=Math.min(e.maxX,t.maxX),s=Math.min(e.maxY,t.maxY);return Math.max(0,r-i)*Math.max(0,s-n)}function b(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function w(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function _(e,t,i,n,r){const s=[t,i];for(;s.length;){const t=s.pop(),i=s.pop();if(t-i<=n)continue;const a=i+Math.ceil((t-i)/n/2)*n;(0,o.q)(e,a,i,t,r),s.push(i,a,a,t)}}const M=new s.A,I=new s.A,T=new s.A,C=new s.A({deallocator:void 0});class v{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class A extends v{constructor(){super(...arguments),this.height=1,this.indexHint=new n.vW}}class E extends A{constructor(e){super(),this.children=e,this.leaf=!0}}class S extends A{constructor(e){super(),this.children=e,this.leaf=!1}}},77901:(e,t,i)=>{i.d(t,{A:()=>o});var n=i(31635),r=i(25482),s=i(91429);let o=class extends r.o{constructor(e){super(e),this.properties=null}};(0,n.Cg)([(0,s.MZ)({json:{write:!0}})],o.prototype,"properties",void 0),o=(0,n.Cg)([(0,s.$K)("esri.rest.knowledgeGraph.GraphObject")],o)},83221:(e,t,i)=>{i.d(t,{A:()=>y});var n=i(4576),r=i(49186),s=i(65529),o=i(53966),a=i(70328),l=i(19419),p=i(90708),d=i(6518),u=i(51441),c=i(37730);const h=(0,a.vt)();class y{constructor(e){this.geometryInfo=e,this._boundsStore=new d.F,this._featuresById=new Map,this._usedMemory=0,this.events=new s.bk,this.featureAdapter=c.T}get usedMemory(){return this._usedMemory}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach(t=>{null!=t.geometry&&t.geometry.coords&&(e+=t.geometry.coords.length)}),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(null==this.fullBounds)return null;const[t,i,n,r]=this.fullBounds;return{xmin:t,ymin:i,xmax:n,ymax:r,spatialReference:(0,u.ag)(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}upsertMany(e){const t=e.map(e=>this._upsert(e));return this._emitChanged(),t.filter(n.Ru)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged(),this._usedMemory=0}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t){for(const i of e){const e=this._boundsStore.get(i.objectId);e&&t((0,a.Jt)(h,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach(t=>e(t))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,e=>{t(this._featuresById.get(e))})}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void o.A.getLogger("esri.layers.graphics.data.FeatureStore").error(new r.A("featurestore:invalid-feature","feature id is missing",{feature:e}));const i=this._featuresById.get(t);let n;if(i?(e.displayId=i.displayId,n=this._boundsStore.get(t),this._boundsStore.delete(t),this._usedMemory-=this.estimateFeatureUsedMemory?.(i)??0):null!=this.onFeatureAdd&&this.onFeatureAdd(e),!e.geometry?.coords?.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);n=(0,p.jQ)(null!=n?n:(0,l.vt)(),e.geometry),null!=n&&this._boundsStore.set(t,n),this._featuresById.set(t,e),this._usedMemory+=this.estimateFeatureUsedMemory?.(e)??0}_upsert(e){const t=e?.objectId;if(null==t)return o.A.getLogger("esri.layers.graphics.data.FeatureStore").error(new r.A("featurestore:invalid-feature","feature id is missing",{feature:e})),null;const i=this._featuresById.get(t);if(!i)return this._add(e),e;this._usedMemory-=this.estimateFeatureUsedMemory?.(i)??0;const{geometry:n,attributes:s}=e;for(const e in s)i.attributes[e]=s[e];return n&&(i.geometry=n,this._boundsStore.set(t,(0,p.jQ)((0,l.vt)(),n)??null)),this._usedMemory+=this.estimateFeatureUsedMemory?.(i)??0,i}_remove(e){null!=this.onFeatureRemove&&this.onFeatureRemove(e);const t=e.objectId;return this._boundsStore.delete(t),this._featuresById.delete(t),this._usedMemory-=this.estimateFeatureUsedMemory?.(e)??0,e}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1728],{71728:(e,t,a)=>{a.r(t),a.d(t,{default:()=>R});var i=a(31635),n=a(67996),s=a(7762),o=a(49186),r=a(53966),l=a(91869),h=a(25728),d=a(74887),c=a(36708),u=a(91429),p=a(35666),g=a(5443),y=a(86738),m=a(82799),f=a(12359),M=a(4146),w=a(90708),C=a(15375);const b={MULTIPLIER:"multiplier",ABSOLUTE:"absolute-value"};var L=a(24137),k=a(62796),T=a(54898),N=a(69860),v=a(30504),D=a(63074),x=a(16131),E=a(25036),A=a(10873),I=a(8460),_=a(48441);let S=class extends((0,x.q)((0,D.dM)((0,E.j)((0,h.P)(M.A))))){constructor(e){if(super(e),this.url=null,this.dataPreloadedInLocalCache=!1,this.initializationLinkChartConfig=null,this.membershipModified=!0,this._currentLinkChartConfig={layoutMode:"organic-standard"},this._graphTypeLookup=new Map,this.dataManager=null,this.knowledgeGraph=null,this.layers=new(s.A.ofType(k.A)),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map,this.linkChartExtent=new g.A({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="LinkChartLayer",this.sublayerIdsCache=new Map,this.tables=new(s.A.ofType(k.A)),this.type="link-chart",this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1,this.chronologicalAuxiliaryGraphics=null,this._originalInclusionList=e?.initializationInclusionModeDefinition,e?.dataPreloadedInLocalCache&&!e?.initializationInclusionModeDefinition)throw new o.A("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it");this.addHandles((0,c.wB)(()=>this.layers.concat(this.tables),(e,t)=>this._handleSublayersChange(e,t),c.OH))}normalizeCtorArgs(e){if(!e)return{};const{url:t,title:a,dataPreloadedInLocalCache:i,initializationLinkChartConfig:n}=e;return{url:t,title:a,dataPreloadedInLocalCache:i,initializationLinkChartConfig:n}}_initializeLayerProperties(e){if(!this.title&&this.url){const e=this.url.split("/");this.title=e[e.length-2]}const t=new Set;let a=[],i=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new o.A("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.inclusionModeDefinition?.generateAllSublayers?(a=e.knowledgeGraph.dataModel.entityTypes??[],i=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach((n,s)=>{const o=this._graphTypeLookup.get(s);if(!o)return r.A.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(s);"relationship"===o.type?t.has(s)||(t.add(s),i.push(o)):"entity"===o.type?t.has(s)||(t.add(s),a.push(o)):(r.A.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(s))}):(a=e.knowledgeGraph.dataModel.entityTypes??[],i=e.knowledgeGraph.dataModel.relationshipTypes??[]);const n=new L.P({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=a,this.memberRelationshipTypes=i,this.dataManager=n}load(e){const t=async()=>{const e=[],t=[];this.loadLayerAssumingLocalCache(),this._layersLoadedFromAuthoritativeItem()||await(0,T.qN)(this),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(e=>{e.useAllData=!1}),await this._initializeDiagram(),this.layers.forEach(a=>{t.push(a.refreshCachedQueryEngine()),e.push(new Promise(e=>{a.on("layerview-create",()=>{e(null)})}))}),this.tables.forEach(e=>{t.push(e.refreshCachedQueryEngine())}),await Promise.all(t)};return this.addResolvingPromise(new Promise(a=>{(0,_.fetchKnowledgeGraph)(this.url).then(async i=>{i.dataModel.entityTypes?.forEach(e=>{e.name&&this._graphTypeLookup.set(e.name,e)}),i.dataModel.relationshipTypes?.forEach(e=>{e.name&&this._graphTypeLookup.set(e.name,e)});const s=this.linkChart?.linkChartProperties;6===s?.originIdOf("entitiesUrl")&&(this.membershipModified=!1,this._originalInclusionList=await n.XW.fetchAndConvertSerializedLinkChart({entitiesUrl:s?.entitiesUrl,relationshipsUrl:s?.relationshipsUrl},{signal:e?.signal}),this._alignLayersDataModelAndInclusionDefinition(i.dataModel),this.initializationLinkChartConfig={layoutSettings:s?.layoutSettings??void 0,layoutMode:(0,v.k5)(s.layoutType)}),this._initializeLayerProperties({knowledgeGraph:i,inclusionModeDefinition:this._originalInclusionList}),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})}),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach(e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})}));const{edit:o,fullEdit:r,updateItem:h}=await(0,T.N1)(i.serviceDefinition.serviceItemId,this.url,e);if(this._set("userHasEditingPrivileges",o),this._set("userHasFullEditingPrivileges",r),this._set("userHasUpdateItemPrivileges",h),this.dataPreloadedInLocalCache){const e=N.A.getInstance();for(const[t,a]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions??[])for(const i of a.members?.values()??[]){const a=e.readFromStoreById(`${t}__${i.id}`);a&&(0,l.tE)(this.dataManager.sublayerCaches,t,()=>new Map).set(i.id,a)}await t()}else{const a="geographic-organic-standard"===this.initializationLinkChartConfig?.layoutMode;this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,a,!0).then(async()=>{(0,d.Te)(e),await t()}))}a(null)})})),Promise.resolve(this)}set initializationInclusionModeDefinition(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("initializationInclusionModeDefinition",e):r.A.getLogger(this).error("#initializationInclusionModeDefinition","initializationInclusionModeDefinition cannot be changed after the layer is loaded.")}get linkChart(){return this.parent}get sublayerCapabilities(){return(0,T.hZ)(this.knowledgeGraph)}async addRecords(e,t){let a=[];t?.cascadeAddRelationshipEndNodes&&this.dataManager.knowledgeGraph.dataModel&&(a=await(0,v.aq)(e,this.dataManager.knowledgeGraph));const i=e.concat(a).filter(e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id));i.length>0&&(this.membershipModified=!0),await this._handleNewRecords(i,t)}async createSublayerForNamedType(e){await this.load();const t=this._graphTypeLookup.get(e);if(!t)throw new o.A("knowledge-graph:missing-type","The specified type does not exist in the knowledge graph.");if(this.dataManager.sublayerCaches.has(e))throw new o.A("knowledge-graph:duplicate-type","The specified type already exists as a sublayer.");this.dataManager.sublayerCaches.set(e,new Map),(0,l.tE)(this.sublayerIdsCache,e,()=>new Set);const a=this._createSublayer(t);return"entity"===t.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.set(e,{useAllData:!1,members:new Map}),a.geometryType?this.layers.push(a):this.tables.push(a),await(0,T.qN)(this,[e]),this._refreshNamedTypes(),a}async removeRecords(e,{cascadeRemoveRelationships:t=!0,recalculateLayout:a=!1,overrideMembershipCheck:i=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1,overrideMembershipCheck:!1}){let n=[];for(const t of e)(i||!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(t.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(t.typeName)?.members?.has(t.id))&&n.push(t);if(t){const e=new Set,t=[];for(const t of n)if(this.dataManager.nodeConnectionsLookup.has(t.id))for(const a of this.dataManager.nodeConnectionsLookup.get(t.id))e.add(a);for(const a of e)if(this.dataManager.memberIdTypeLookup.has(a))for(const e of this.dataManager.memberIdTypeLookup.get(a))this.dataManager.relationshipTypeNames.has(e)&&t.push({id:a,typeName:e});n=n.concat(t)}this.dataManager.removeFromLayer(n);for(const e of n)this.sublayerIdsCache.get(e.typeName)?.delete(e.id),this.dataManager.relationshipTypeNames.has(e.typeName)?this.relationshipLinkChartDiagramLookup.delete(e.id):this.entityLinkChartDiagramLookup.delete(e.id);const s=a?void 0:this.getCurrentNodeLocations();await this._calculateLayoutWithSublayerTimeInfo(this._currentLinkChartConfig.layoutMode,{layoutSettings:this._currentLinkChartConfig.layoutSettings,lockedNodeLocations:s}),n.length>0&&(this.membershipModified=!0);const o=[];return this.layers.forEach(e=>{o.push(e.refreshCachedQueryEngine())}),await Promise.all(o),this._refreshNamedTypes(),n}async expand(e,t){let a=[];try{const i=await this.dataManager.getConnectedRecordIds(e,t?.relationshipTypeNames,t);a=i.filter(e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id)),await this._handleNewRecords(a,t),i.length>0&&(this.membershipModified=!0),(0,d.Te)(t?.signal)}catch(e){throw(0,d.zf)(e)&&a.length>0&&await this.removeRecords(a,{overrideMembershipCheck:!0}),e}return{records:a}}loadLayerAssumingLocalCache(){const e=[...this.memberRelationshipTypes,...this.memberEntityTypes];this.layers.length||0===this.originIdOf("tables")?0===this.originIdOf("layers")?this._createSublayers(e,this.layers,e=>!!e.geometryType):this._updateSublayers(e,this.layers):this.layers=new s.A,this.tables.length||0===this.originIdOf("layers")?0===this.originIdOf("tables")?this._createSublayers(e,this.tables,e=>!e.geometryType):this._updateSublayers(e,this.tables):this.tables=new s.A,this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{const a=(0,l.tE)(this.sublayerIdsCache,t,()=>new Set);e.members?.forEach(({id:e,linkChartLocation:i})=>{if(a.add(e),i){const a="coords"in i&&"lengths"in i?i:(0,w.Ux)(i);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(e,a):this.entityLinkChartDiagramLookup.set(e,a)}})})}async calculateLinkChartLayout(e="organic-standard",t){const a=[],i=[],n=[];this.dataManager.sublayerCaches.forEach((e,t)=>{this.dataManager.entityTypeNames.has(t)?e.forEach(e=>{a.push({typeName:t,feature:e})}):this.dataManager.relationshipTypeNames.has(t)&&e.forEach(e=>{i.push({typeName:t,feature:e})})}),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map;const s=new Map,h=new Map,c=new Map,u=new Map,p=new Uint8Array(a.length),M=new Float64Array(a.length),b=new Float64Array(a.length),L=new Float64Array(a.length),k=new Float64Array(a.length),T=new Uint32Array(i.length),N=new Uint32Array(i.length),v=new Float64Array(i.length),D=new Float64Array(i.length),x=[];let E=!1;const A=new g.A({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let _,S="organic-standard",R=0,z=0;const P=I.i6.apply;switch(S="geographic-organic-standard"===e?"organic-standard":e,S){case"organic-standard":_=I.pM.apply;break;case"organic-community":_=I.Tu.apply;break;case"hierarchical-bottom-to-top":_=I.$C.apply;break;case"radial-root-centric":_=I.vJ.apply;break;case"tree-left-to-right":_=I.Xq.apply;break;default:_=I.Wg.apply}let O=!1;a.forEach(({typeName:a,feature:i})=>{if("chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e&&t?.lockedNodeLocations?.has(i.attributes[C.dr])){"geographic-organic-standard"===e&&this.dataManager.geographicLookup.has(a)?p[R]=2:p[R]=0;const n=t.lockedNodeLocations.get(i.attributes[C.dr]);M[R]=n.x,b[R]=n.y}else if("geographic-organic-standard"===e&&this.dataManager.geographicLookup.has(a)){p[R]=2;let e=null;const t=i.attributes[this.dataManager.geographicLookup.get(a).name],n=this.dataManager.geographicLookup.get(a)?.geometryType;switch(n){case"esriGeometryPoint":M[R]=t?.x,b[R]=t?.y;break;case"esriGeometryPolygon":{const a=(0,f.Ve)(t);e=a?y.A.fromJSON(a):null,null!=e?.x&&null!=e?.y?(M[R]=e.x,b[R]=e.y):p[R]=1;break}case"esriGeometryPolyline":case"esriGeometryMultipoint":e=t?.extent?.center,null!=e?.x&&null!=e?.y?(M[R]=e.x,b[R]=e.y):p[R]=1;break;default:p[R]=1}(null==M[R]||null==b[R]||Number.isNaN(M[R])||Number.isNaN(b[R]))&&(p[R]=1,M[R]=0,b[R]=0)}else if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){!O&&t?.lockedNodeLocations?.has(i.attributes[C.dr])&&(O=!0);const e=t?.timeInfoByTypeName?.get(a),n=e?.startField,s=n&&e?.startField?i.attributes[n]:null;L[R]=s?new Date(s).getTime():NaN;const o=e?.endField,r=o&&e?.endField?i.attributes[o]:null;k[R]=r?new Date(r).getTime():NaN,M[R]=0,b[R]=0,p[R]=1}else p[R]=1,M[R]=0,b[R]=0;u.set(i.attributes[C.dr],R),x[R]={feature:i,typeName:a},R++}),O&&r.A.getLogger(this).warn("Locked node locations are not supported for chronological layout at this time. Requested node locations were ignored");let Z=!1;const F=new Map;i.forEach(a=>{const i=a.feature.attributes[C.Cz],s=a.feature.attributes[C.KQ],o=u.get(i),r=u.get(s),l=t?.timeInfoByTypeName?.get(a.typeName),h=t?.timeInfoByTypeName?l?.startField:null,d=h?a.feature.attributes[h]:null,c=l?.endField,p=c?a.feature.attributes[c]:null;if(void 0!==o&&void 0!==r){let t=i+"-"+s;"chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e||(t=t+"-"+d+"-"+p);const l=F.get(t),h=l?.has(a.typeName);h||(T[z]=o,N[z]=r,"chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e||(v[z]=d?new Date(d).getTime():NaN,D[z]=p?new Date(p).getTime():NaN),void 0===l?F.set(t,new Map([[a.typeName,z]])):l.set(a.typeName,z),z++),n.push(a)}else Z=!0,this.relationshipLinkChartDiagramLookup.set(i,null)}),Z&&r.A.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null");const G=this._validateOrganicLayoutSettings(e,t?.layoutSettings?.organicLayoutSettings),U=this._convertValidatedOrganicSettingsToCalculationSettings(G);await(0,I.Hh)();let B=1,H=null;if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){let a;({status:B,links:H,graphics:a}=P(()=>t?.signal?.aborted??!1,p,M,b,L,k,T.subarray(0,z),N.subarray(0,z),v.subarray(0,z),D.subarray(0,z),"chronological-multi-timeline"===e,t?.layoutSettings?.chronologicalLayoutSettings)),0===B&&(this.chronologicalAuxiliaryGraphics=a)}else({status:B,links:H}=_(()=>t?.signal?.aborted??!1,p,M,b,T.subarray(0,z),N.subarray(0,z),U.computationBudgetTime,U.idealEdgeLengthMultiplier,U.repulsionRadiusMultiplier));if((0,d.Te)(t?.signal),1===B)throw new o.A("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");if(2===B)throw(0,d.NK)();for(let e=0;e<x.length;e++){if(b[e]>84.9999?b[e]=84.9999:b[e]<-84.9999&&(b[e]=-84.9999),M[e]>179.9999?M[e]=179.9999:M[e]<-179.9999&&(M[e]=-179.9999),x[e].feature.attributes[C.T1]=new y.A(M[e],b[e]),s.has(x[e].typeName)){const t=s.get(x[e].typeName);t?.set(x[e].feature.attributes[C.dr],x[e].feature)}else{const t=new Map;t.set(x[e].feature.attributes[C.dr],x[e].feature),s.set(x[e].typeName,t)}c.set(x[e].feature.attributes[C.dr],x[e].feature);const t=(0,w.Ux)(x[e].feature.attributes[C.T1]);this.entityLinkChartDiagramLookup.set(x[e].feature.attributes[C.dr],x[e].feature.attributes[C.T1]?t:null);const a=(0,l.tE)(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,x[e].typeName,()=>({useAllData:!1,members:new Map}));(0,l.tE)(a.members,x[e].feature.attributes[C.dr],()=>({id:x[e].feature.attributes[C.dr],linkChartLocation:void 0})).linkChartLocation=x[e].feature.attributes[C.T1];const{x:i,y:n}=x[e].feature.attributes[C.T1];if(E)A.xmin=Math.min(A.xmin,i),A.xmax=Math.max(A.xmax,i),A.ymin=Math.min(A.ymin,n),A.ymax=Math.max(A.ymax,n);else{const e=1e-7;A.xmin=i-e,A.xmax=i+e,A.ymin=n-e,A.ymax=n+e,E=!0}}if(this.linkChartExtent.xmin=A.xmin,this.linkChartExtent.xmax=A.xmax,this.linkChartExtent.ymin=A.ymin,this.linkChartExtent.ymax=A.ymax,!H)throw new o.A("knowledge-graph:layout-failed","Attempting to retrieve link geometry from diagram engine failed");const j=new Map,Q=new Map,q=new Map,K=new Set;for(let a=0;a<n.length;a++){const i=[],s=n[a],o=s.feature.attributes[C.Cz],d=s.feature.attributes[C.KQ];let p=o+"-"+d;if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){const e=t?.timeInfoByTypeName?.get(s.typeName),a=t?.timeInfoByTypeName?e?.startField:null,i=a?s.feature.attributes[a]:null,n=e?.endField;p+="-"+i+"-"+(n?s.feature.attributes[n]:null)}const g=F.get(p).get(s.typeName),y=0===g?0:H?.vertexEndIndex[g-1];if(!K.has(g)){if(K.add(g),2===H.types[g]){const e=[H.vertices[2*y],H.vertices[2*y+1]],t=[H.vertices[2*(y+1)],H.vertices[2*(y+1)+1]],a=[.5*(e[0]+t[0]),.5*(e[1]+t[1])],n=[a[0]-e[0],a[1]-e[1]],s=[a[0]+n[1],a[1]-n[0]],o=[a[0]-n[1],a[1]+n[0]];i.push(e),i.push(s),i.push(t),i.push(o),i.push(e)}else{if(0!==H.types[g]){r.A.getLogger(this).warn("A relationship generated an unsupported link geometry type. It will not be rendered");continue}for(let e=y;e<H.vertexEndIndex[g];e++)i.push([H.vertices[2*e],H.vertices[2*e+1]])}if("chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e){const e=x[u.get(o)]?.feature.attributes[C.T1],t=x[u.get(d)]?.feature.attributes[C.T1];i[0][0]===e.x&&i[0][1]===e.y||(i[0]=[e.x,e.y]),i[i.length-1][0]===t.x&&i[i.length-1][1]===t.y||(i[i.length-1]=[t.x,t.y])}for(let e=1;e<i.length-1;e++)i[e][1]>85.5?i[e][1]=85.5:i[e][1]<-85.5&&(i[e][1]=-85.5),i[e][0]>179.9999?i[e][0]=179.9999:i[e][0]<-179.9999&&(i[e][0]=-179.9999);j.has(p)?j.get(p).push(i):j.set(p,[i])}const f=j.get(p);Q.has(p)||(Q.set(p,new Map),q.set(p,new Map));const M=Q.get(p),b=q.get(p);M.has(s.typeName)||(M.set(s.typeName,f.shift()),b.set(s.typeName,0));const L=M.get(s.typeName);b.set(s.typeName,b.get(s.typeName)+1);const k=new m.A({paths:[L]});if(s.feature.attributes[C.T1]=k,h.has(s.typeName)){const e=h.get(s.typeName);e?.set(s.feature.attributes[C.dr],s.feature)}else{const e=new Map;e.set(s.feature.attributes[C.dr],s.feature),h.set(s.typeName,e)}c.set(s.feature.attributes[C.dr],s.feature);const T=(0,w.Ux)(s.feature.attributes[C.T1]);this.relationshipLinkChartDiagramLookup.set(s.feature.attributes[C.dr],s.feature.attributes[C.T1]?T:null);const N=(0,l.tE)(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,s.typeName,()=>({useAllData:!1,members:new Map}));(0,l.tE)(N.members,s.feature.attributes[C.dr],()=>({id:s.feature.attributes[C.dr],linkChartLocation:void 0})).linkChartLocation=T}for(const e of n)e.feature.attributes[C.M1]=q.get(e.feature.attributes[C.Cz]+"-"+e.feature.attributes[C.KQ])?.get(e.typeName)??null;return this._currentLinkChartConfig={layoutMode:e,layoutSettings:t?.layoutSettings?.clone()},{nodes:s,links:h,idMap:c}}async applyNewLinkChartLayout(e="organic-standard",t){const a=[];await this._calculateLayoutWithSublayerTimeInfo(e,t),this.layers.forEach(e=>{a.push(e.refreshCachedQueryEngine())}),this.membershipModified=!0,await Promise.all(a),this._refreshNamedTypes()}getCurrentNodeLocations(){const e=new Map;for(const[t,a]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.entries()??[])this.dataManager.relationshipTypeNames.has(t)||a?.members?.forEach(t=>{const a=t.linkChartLocation;let i;const n=t.id;a&&(i="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]},e.set(n,new y.A({x:i.x,y:i.y})))});return e}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach(e=>{t.push(e.refreshCachedQueryEngine())}),await Promise.all(t),this._refreshNamedTypes()}async connectBetweenEntities(e,t){if(!e.length)return{records:[]};let a=[];try{let i=[];for(const e of this.dataManager.relationshipTypeNames){const t=this.sublayerIdsCache.get(e);t&&(i=i.concat(Array.from(t.keys())))}a=await this.dataManager.getRelationshipsBetweenNodes(e,i,t),await this._handleNewRecords(a,t),(0,d.Te)(t)}catch(e){throw(0,d.zf)(e)&&this.removeRecords(a),e}return{records:a}}async connectFromEntities(e,t){if(!e.length)return{records:[]};let a=[];try{let i=[];for(const e of this.dataManager.relationshipTypeNames){const t=this.sublayerIdsCache.get(e);t&&(i=i.concat(Array.from(t.keys())))}let n=[];for(const e of this.dataManager.entityTypeNames){const t=this.sublayerIdsCache.get(e);t&&(n=n.concat(Array.from(t)))}a=await this.dataManager.getRelationshipsFromNodes(e,n,i,t),await this._handleNewRecords(a,t),a.length>0&&(this.membershipModified=!0),(0,d.Te)(t)}catch(e){throw(0,d.zf)(e)&&this.removeRecords(a),e}return{records:a}}getCurrentLayout(){return this._currentLinkChartConfig.layoutMode}async _calculateLayoutWithSublayerTimeInfo(e="organic-standard",t){const a=new Map;this.layers.forEach(e=>{a.set(e.objectType.name,e.timeInfo)}),await this.calculateLinkChartLayout(e,{timeInfoByTypeName:a,...t}),this.linkChart?.handleChronologicalOverlay()}async _handleNewRecords(e,t){const a=new Set,i=[],n=this.layers.concat(this.tables);for(const t of e)this._graphTypeLookup.has(t.typeName)&&(!1===n.some(e=>e.objectType.name===t.typeName)&&(this.dataManager.sublayerCaches.set(t.typeName,new Map),a.add(t.typeName)),(0,l.tE)(this.sublayerIdsCache,t.typeName,()=>new Set).add(t.id),i.push(t));this.dataManager.addToLayer(i);for(const e of a){const t=this._graphTypeLookup.get(e);if(t){const a=this._createSublayer(t);"entity"===t.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),a.geometryType?this.layers.push(a):this.tables.push(a)}}await(0,T.qN)(this,Array.from(a),t),await this.dataManager.refreshCacheContent(e.map(e=>e.id),void 0,void 0,void 0,t);const s={layoutSettings:this._currentLinkChartConfig.layoutSettings,lockedNodeLocations:new Map};for(const[e,t]of this.entityLinkChartDiagramLookup.entries())t&&s.lockedNodeLocations.set(e,new y.A(t.coords[0],t.coords[1]));await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,s)}_createSublayers(e,t,a){e.forEach(e=>{const i=this._createSublayer(e);a(i)&&t.push(i),this._updateSublayerCaches(e)})}_updateSublayers(e,t){t.forEach(t=>{t.parentCompositeLayer=this;const a=e.find(e=>e.type===t.graphType&&e.name===t.graphTypeName);a&&(t.objectType=a,t.read({title:a.name},{origin:"service"}),this._updateSublayerCaches(a))})}_updateSublayerCaches({name:e}){if(!e)return;const t=this.dataManager.sublayerCaches;t.has(e)||t.set(e,new Map)}_layersLoadedFromAuthoritativeItem(){const e=this.originIdOf("layers");return e>=3&&e<7}async _initializeDiagram(){this.initializationLinkChartConfig?this.initializationLinkChartConfig.doNotRecalculateLayout?(this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{e?.members?.forEach(e=>{const a=e.linkChartLocation;let i;const n=e.id;if(!a)return;i="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]};const s=(0,w.Ux)(i);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(n,s):this.entityLinkChartDiagramLookup.set(n,s),this.linkChartExtent.xmin>i.x&&(this.linkChartExtent.xmin=i.x),this.linkChartExtent.xmax<i.x&&(this.linkChartExtent.xmax=i.x),this.linkChartExtent.ymin>i.y&&(this.linkChartExtent.ymin=i.y),this.linkChartExtent.ymax<i.y&&(this.linkChartExtent.ymax=i.y)})}),this.memberRelationshipTypes.forEach(e=>{e.name&&this.dataManager.sublayerCaches.get(e.name)?.forEach(e=>{const t=this.relationshipLinkChartDiagramLookup.get(e.attributes[C.Cz]),a=this.relationshipLinkChartDiagramLookup.get(e.attributes[C.KQ]);if(t&&a){const i=(0,w.Ux)(new m.A({paths:[[[t.coords[0],t.coords[1]],[a.coords[0],a.coords[1]]]]}));this.relationshipLinkChartDiagramLookup.set(e.attributes[C.dr],i)}else this.relationshipLinkChartDiagramLookup.set(e.attributes[C.dr],null)})})):await this._calculateLayoutWithSublayerTimeInfo(this.initializationLinkChartConfig.layoutMode,{lockedNodeLocations:this.getCurrentNodeLocations(),...this.initializationLinkChartConfig}):await this._calculateLayoutWithSublayerTimeInfo("organic-standard",{lockedNodeLocations:this.getCurrentNodeLocations()})}_refreshNamedTypes(){for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}_validateOrganicLayoutSettings(e,t){const a=e=>"number"==typeof e&&!isNaN(e),i=e=>a(e)&&e>=0,n={};if(!new Set(["organic-standard","organic-community","geographic-organic-standard","chronological-multi-timeline","chronological-mono-timeline"]).has(e)||!t)return n;const{computationBudgetTime:s,autoRepulsionRadius:o,repulsionRadiusMultiplier:l,absoluteIdealEdgeLength:h,multiplicativeIdealEdgeLength:d,idealEdgeLengthType:c}=t;return(e=>a(e)&&e>=1)(s)?n.computationBudgetTime=s:s&&r.A.getLogger(this).warn("Invalid layout computationBudgetTime setting, will revert to default setting"),n.autoRepulsionRadius=o,!o&&(e=>a(e)&&e>=1)(l)?n.repulsionRadiusMultiplier=l:o||(n.autoRepulsionRadius=!0,r.A.getLogger(this).warn("Invalid layout repulsionRadiusMultiplier setting, will revert to default setting")),"geographic-organic-standard"===e&&((e=>Object.values(b).includes(e))(c)?n.idealEdgeLengthType=c:void 0!==c&&r.A.getLogger(this).warn('Invalid layout idealEdgeLengthType setting, will revert to "multiplier" setting'),"absolute-value"===c&&i(h)?n.absoluteIdealEdgeLength=h:"absolute-value"===c&&void 0!==h?r.A.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting"):"multiplier"===c&&i(d)?n.multiplicativeIdealEdgeLength=d:"multiplier"===c&&void 0!==d&&r.A.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting")),n}_convertValidatedOrganicSettingsToCalculationSettings(e){let t=e.idealEdgeLengthType===b.ABSOLUTE?e.absoluteIdealEdgeLength:e.multiplicativeIdealEdgeLength;return e.idealEdgeLengthType===b.ABSOLUTE&&(void 0===t?t=-1:t*=-1),{computationBudgetTime:e.computationBudgetTime??void 0,repulsionRadiusMultiplier:e.repulsionRadiusMultiplier&&!e.autoRepulsionRadius?e.repulsionRadiusMultiplier:void 0,idealEdgeLengthMultiplier:t}}_createSublayer(e){return new k.A({objectType:e,parentCompositeLayer:this,graphType:e.type})}_handleSublayersChange(e,t){t&&(t.forEach(e=>{e.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(e=>{e.parent=this}),this.addHandles([e.on("after-add",({item:e})=>{e.parent=this}),e.on("after-remove",({item:e})=>{e.parent=null})],"sublayers-owner"))}_alignLayersDataModelAndInclusionDefinition(e){const t=new Set((e.entityTypes??[]).map(e=>e.name).concat((e.relationshipTypes??[]).map(e=>e.name))),a=new Set((e.entityTypes??[]).map(e=>e.name)),i=new Set((e.relationshipTypes??[]).map(e=>e.name));if(this.layers){for(const e of this.layers)!e.graphType&&t.has(e.graphTypeName)&&(e.graphType=a.has(e.graphTypeName)?"entity":"relationship");const e=this.layers.filter(e=>t.has(e.graphTypeName)&&("entity"===e.graphType?a.has(e.graphTypeName):i.has(e.graphTypeName)));this.setAtOrigin("layers",e,(0,p.OL)(this.originIdOf("layers")))}else this.layers=new s.A;if(this.layers&&this._originalInclusionList){const e=new Set(this._originalInclusionList.namedTypeDefinitions.keys()),t=this.tables?.map(e=>e.graphTypeName)??[],a=this.layers.map(e=>e.graphTypeName).concat(t);for(const t of a)e.has(t)||this._originalInclusionList.namedTypeDefinitions.set(t,{useAllData:!1,members:new Map});const i=[];for(const e of this._originalInclusionList.namedTypeDefinitions.keys())a.includes(e)||(r.A.getLogger(this).warn(`A named type, ${e}, was in the serialized feature collection but did not have a sublayer config in the item, so will be removed`),i.push(e));for(const e of i)this._originalInclusionList.namedTypeDefinitions.delete(e)}}};(0,i.Cg)([(0,u.MZ)(A.OZ)],S.prototype,"url",void 0),(0,i.Cg)([(0,u.MZ)()],S.prototype,"dataPreloadedInLocalCache",void 0),(0,i.Cg)([(0,u.MZ)()],S.prototype,"initializationLinkChartConfig",void 0),(0,i.Cg)([(0,u.MZ)()],S.prototype,"membershipModified",void 0),(0,i.Cg)([(0,u.MZ)()],S.prototype,"dataManager",void 0),(0,i.Cg)([(0,u.MZ)()],S.prototype,"initializationInclusionModeDefinition",null),(0,i.Cg)([(0,u.MZ)()],S.prototype,"knowledgeGraph",void 0),(0,i.Cg)([(0,u.MZ)({type:s.A.ofType(k.A),json:{write:{ignoreOrigin:!0}}})],S.prototype,"layers",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],S.prototype,"linkChart",null),(0,i.Cg)([(0,u.MZ)()],S.prototype,"entityLinkChartDiagramLookup",void 0),(0,i.Cg)([(0,u.MZ)()],S.prototype,"relationshipLinkChartDiagramLookup",void 0),(0,i.Cg)([(0,u.MZ)()],S.prototype,"linkChartExtent",void 0),(0,i.Cg)([(0,u.MZ)()],S.prototype,"memberEntityTypes",void 0),(0,i.Cg)([(0,u.MZ)()],S.prototype,"memberRelationshipTypes",void 0),(0,i.Cg)([(0,u.MZ)({type:["LinkChartLayer"]})],S.prototype,"operationalLayerType",void 0),(0,i.Cg)([(0,u.MZ)()],S.prototype,"sublayerCapabilities",null),(0,i.Cg)([(0,u.MZ)()],S.prototype,"sublayerIdsCache",void 0),(0,i.Cg)([(0,u.MZ)({type:s.A.ofType(k.A),json:{write:{ignoreOrigin:!0}}})],S.prototype,"tables",void 0),(0,i.Cg)([(0,u.MZ)({json:{read:!1}})],S.prototype,"type",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],S.prototype,"userHasEditingPrivileges",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],S.prototype,"userHasFullEditingPrivileges",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],S.prototype,"userHasUpdateItemPrivileges",void 0),(0,i.Cg)([(0,u.MZ)({json:{read:!1}})],S.prototype,"chronologicalAuxiliaryGraphics",void 0),S=(0,i.Cg)([(0,u.$K)("esri.layers.LinkChartLayer")],S);const R=S}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[784],{9093:(t,e,n)=>{function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function o(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]}n.d(e,{o8:()=>o,vt:()=>r,zK:()=>i});const i=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:i,clone:o,create:r,fromValues:function(t,e,n,r,o,i,s,a,c,u,h,d,l,f,m,p){return[t,e,n,r,o,i,s,a,c,u,h,d,l,f,m,p]}},Symbol.toStringTag,{value:"Module"}))},27921:(t,e,n)=>{n.d(e,{$Q:()=>T,C:()=>u,Cr:()=>f,LV:()=>c,O_:()=>l,Qj:()=>h,T7:()=>x,Tj:()=>O,Ui:()=>y,_I:()=>A,fA:()=>d,gv:()=>w,lU:()=>m,mN:()=>E,mP:()=>v,mR:()=>j,vE:()=>P,vt:()=>a});var r=n(34727),o=n(38954),i=n(51850),s=(n(87317),n(44280),n(32114));function a(t=N){return[t[0],t[1],t[2],t[3]]}function c(t=N[0],e=N[1],n=N[2],r=N[3]){return d(t,e,n,r,s.Km.get())}function u(t,e){return d(e[0],e[1],e[2],e[3],t)}function h(t){return t}function d(t,e,n,r,o=a()){return o[0]=t,o[1]=e,o[2]=n,o[3]=r,o}function l(t,e,n){const r=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],o=Math.abs(r-1)>1e-5&&r>1e-12?1/Math.sqrt(r):1;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=-(n[0]*t[0]+n[1]*t[1]+n[2]*t[2]),n}function f(t,e,n,r=a()){const o=n[0]-e[0],i=n[1]-e[1],s=n[2]-e[2],c=t[0]-e[0],u=t[1]-e[1],h=t[2]-e[2],d=i*h-s*u,l=s*c-o*h,f=o*u-i*c,m=d*d+l*l+f*f,p=Math.abs(m-1)>1e-5&&m>1e-12?1/Math.sqrt(m):1;return r[0]=d*p,r[1]=l*p,r[2]=f*p,r[3]=-(r[0]*t[0]+r[1]*t[1]+r[2]*t[2]),r}function m(t,e,n,r=0,i=Math.floor(n*(1/3)),s=Math.floor(n*(2/3))){if(n<3)return!1;e(b,r);let a=i,c=!1;for(;a<n-1&&!c;)e(_,a),a++,c=!(0,o.m)(b,_);if(!c)return!1;for(a=Math.max(a,s),c=!1;a<n&&!c;)e(g,a),a++,(0,o.e)(M,b,_),(0,o.n)(M,M),(0,o.e)(S,_,g),(0,o.n)(S,S),c=!(0,o.m)(b,g)&&!(0,o.m)(_,g)&&Math.abs((0,o.g)(M,S))<p;return c?(f(b,_,g,t),!0):(0!==r||1!==i||2!==s)&&m(t,e,n,0,1,2)}n(32728);const p=.99619469809,b=(0,i.vt)(),_=(0,i.vt)(),g=(0,i.vt)(),M=(0,i.vt)(),S=(0,i.vt)();function v(t,e,n){return e!==t&&u(t,e),t[3]=-(0,o.g)(t,n),t}function j(t,e,n,r){return(0,o.f)(g,e,t),l(n,g,r)}function y(t,e,n){return null!=e&&z(P(t,e.origin,e.direction,D,n))}function x(t,e,n){return z(P(t,e.origin,e.vector,0,n))}function w(t,e,n){return z(P(t,e.origin,e.vector,1,n))}function O(t,e){return E(t,e)>=0}function T(t,e){const n=(0,o.g)(t,e.ray.direction),r=-E(t,e.ray.origin);if(r<0&&n>=0)return!1;if(n>-1e-6&&n<1e-6)return r>0;if((r<0||n<0)&&!(r<0&&n<0))return!0;const i=r/n;return n>0?i<e.c1&&(e.c1=i):i>e.c0&&(e.c0=i),e.c0<=e.c1}function A(t,e,n){const r=(0,o.j)(s.rq.get(),t,-t[3]),i=function(t,e,n){const r=(0,o.j)(s.rq.get(),t,(0,o.g)(t,e));return(0,o.e)(n,e,r),n}(t,(0,o.e)(s.rq.get(),e,r),s.rq.get());return(0,o.i)(n,i,r),n}function E(t,e){return(0,o.g)(t,e)+t[3]}function z(t){return 0===t||1===t}function P(t,e,n,i,s){const a=(0,o.g)(t,n),c=E(t,e);if(0===a)return c>=0?2:3;let u=-c/a;return 1&i&&(u=(0,r.qE)(u,0,1)),!(4&i)&&u<0||!(8&i)&&u>1?c>=0?2:3:((0,o.i)(s,e,(0,o.j)(s,n,u)),c>=0?0:1)}const N=[0,0,1,0],D=8},29242:(t,e,n)=>{function r(){return[1,0,0,0,1,0,0,0,1]}function o(t,e,n,r,o,i,s,a,c){return[t,e,n,r,o,i,s,a,c]}n.d(e,{fA:()=>o,vt:()=>r,zK:()=>i});const i=[1,0,0,0,1,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:i,clone:function(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},create:r,fromValues:o},Symbol.toStringTag,{value:"Module"}))},31635:(t,e,n)=>{function r(t,e,n,r){var o,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,n,s):o(e,n))||s);return i>3&&s&&Object.defineProperty(e,n,s),s}function o(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var r,o;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose],n&&(o=r)}if("function"!=typeof r)throw new TypeError("Object not disposable.");o&&(r=function(){try{o.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:r,async:n})}else n&&t.stack.push({async:!0});return e}n.d(e,{Cg:()=>r,hk:()=>s,mS:()=>o}),Object.create,Object.create;var i="function"==typeof SuppressedError?SuppressedError:function(t,e,n){var r=new Error(n);return r.name="SuppressedError",r.error=t,r.suppressed=e,r};function s(t){function e(e){t.error=t.hasError?new i(e,t.error,"An error was suppressed during disposal."):e,t.hasError=!0}var n,r=0;return function o(){for(;n=t.stack.pop();)try{if(!n.async&&1===r)return r=0,t.stack.push(n),Promise.resolve().then(o);if(n.dispose){var i=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(i).then(o,function(t){return e(t),o()})}else r|=1}catch(t){e(t)}if(1===r)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}()}},32114:(t,e,n)=>{n.d(e,{Rc:()=>f,J8:()=>m,rq:()=>d,Km:()=>l}),n(44208);var r=n(26390),o=n(29242),i=n(9093),s=n(82534),a=n(48163),c=n(51850),u=n(91829);class h{constructor(t){this._create=t,this._items=new Array,this._itemsPtr=0}get(){return 0===this._itemsPtr&&(0,r.d)(()=>this._reset()),this._itemsPtr>=this._items.length&&this._items.push(this._create()),this._items[this._itemsPtr++]}_reset(){const t=2*this._itemsPtr;this._items.length>t&&(this._items.length=t),this._itemsPtr=0}static createVec2f64(){return new h(a.vt)}static createVec3f64(){return new h(c.vt)}static createVec4f64(){return new h(u.vt)}static createMat3f64(){return new h(o.vt)}static createMat4f64(){return new h(i.vt)}static createQuatf64(){return new h(s.vt)}get test(){}}h.createVec2f64();const d=h.createVec3f64(),l=h.createVec4f64(),f=(h.createMat3f64(),h.createMat4f64()),m=h.createQuatf64()},32728:(t,e,n)=>{n.d(e,{nu:()=>s,wp:()=>i}),n(34727);var r=n(38954),o=n(51850);function i(t,e){const n=Math.sqrt(e[0]*e[0]+e[4]*e[4]+e[8]*e[8]),o=Math.sqrt(e[1]*e[1]+e[5]*e[5]+e[9]*e[9]),i=Math.sqrt(e[2]*e[2]+e[6]*e[6]+e[10]*e[10]);return(0,r.h)(t,n,o,i),t}function s(t,e,n,i=(0,o.vt)()){const s=(0,r.b)(t),u=(0,r.b)(e),h=(0,r.g)(t,e)/(s*u);if(h<.9999999999999999){const o=Math.acos(h),d=((1-n)*s+n*u)/Math.sin(o),l=d/s*Math.sin((1-n)*o),f=d/u*Math.sin(n*o);return(0,r.j)(a,t,l),(0,r.j)(c,e,f),(0,r.i)(i,a,c)}return(0,r.l)(i,t,e,n)}(0,o.vt)(),(0,o.vt)(),(0,o.vt)();const a=(0,o.vt)(),c=(0,o.vt)()},44280:(t,e,n)=>{n.d(e,{EJ:()=>c,g7:()=>a,gr:()=>s});var r=n(34727),o=n(38954),i=n(51850);function s(t,e){return(0,o.g)(t,e)/(0,o.b)(t)}function a(t,e){const n=(0,o.g)(t,e)/((0,o.b)(t)*(0,o.b)(e));return-(0,r.XM)(n)}function c(t,e,n){(0,o.n)(u,t),(0,o.n)(h,e);const i=(0,o.g)(u,h),s=(0,r.XM)(i),a=(0,o.f)(u,u,h);return(0,o.g)(a,n)<0?2*Math.PI-s:s}const u=(0,i.vt)(),h=(0,i.vt)()},70491:(t,e,n)=>{n.r(e),n.d(e,{default:()=>X});var r=n(31635),o=n(74887),i=n(24326),s=n(91429),a=n(38954),c=n(51850),u=n(11964),h=n(94008),d=n(93687),l=n(15142),f=n(82919),m=n(71351),p=n(620);class b{get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}constructor(t,e){this.objectToBoundingSphere=t,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new _,this._objectCount=0,e&&(void 0!==e.maximumObjectsPerNode&&(this._maximumObjectsPerNode=e.maximumObjectsPerNode),void 0!==e.maximumDepth&&(this._maximumDepth=e.maximumDepth))}destroy(){this._degenerateObjects.clear(),_.clearPool(),D[0]=null,F.prune(),J.prune()}add(t){const e=Array.from(t);this._grow(e);const n=_.acquire();for(const t of e)++this._objectCount,this._isDegenerate(t)?this._degenerateObjects.add(t):(n.init(this._root),this._add(t,n));_.release(n)}remove(t,e=null){this._objectCount-=t.length;const n=_.acquire();for(const r of t){const t=e??this.objectToBoundingSphere(r);E(t.radius)?(n.init(this._root),S(r,t,n)):this._degenerateObjects.delete(r)}_.release(n),this._shrink()}update(t,e){if(!E(e.radius)&&this._isDegenerate(t))return;const n=function(t){return D[0]=t,D}(t);this.remove(n,e),this.add(n)}forEachAlongRay(t,e,n){const r=(0,m.LV)(t,e);g(this._root,t=>{if(!function(t,e){return w(e.bounds.center,2*-e.halfSize,R),w(e.bounds.center,2*e.halfSize,B),(0,p.O_)(t.origin,t.direction,R,B)}(r,t))return!1;const e=t.node;return e.terminals.forAll(t=>{this._intersectsObject(r,t)&&n(t)}),null!==e.residents&&e.residents.forAll(t=>{this._intersectsObject(r,t)&&n(t)}),!0})}forEachAlongRayWithVerticalOffset(t,e,n,r){const o=(0,m.LV)(t,e);g(this._root,t=>{if(!function(t,e,n){return w(e.bounds.center,2*-e.halfSize,R),w(e.bounds.center,2*e.halfSize,B),n.applyToMinMax(R,B),(0,p.O_)(t.origin,t.direction,R,B)}(o,t,r))return!1;const e=t.node;return e.terminals.forAll(t=>{this._intersectsObjectWithOffset(o,t,r)&&n(t)}),null!==e.residents&&e.residents.forAll(t=>{this._intersectsObjectWithOffset(o,t,r)&&n(t)}),!0})}forEach(t){g(this._root,e=>{const n=e.node;return n.terminals.forAll(t),null!==n.residents&&n.residents.forAll(t),!0}),this._degenerateObjects.forEach(t)}forEachDegenerateObject(t){this._degenerateObjects.forEach(t)}findClosest(t,e,n,r=()=>!0,o=1/0){let i=1/0,s=1/0,c=null;const u=T(t,e),h=a=>{if(--o,!r(a))return;const u=this.objectToBoundingSphere(a);if(!(0,f.m7)(n,u))return;const h=A(t,e,u.center),d=h-u.radius,l=h+u.radius;d<i&&(i=d,s=l,c=a)};return M(this._root,r=>{if(o<=0||!(0,f.m7)(n,r.bounds))return!1;if((0,a.j)(q,u,r.halfSize),(0,a.i)(q,q,r.bounds.center),A(t,e,q)>s)return!1;const i=r.node;return i.terminals.forAll(t=>h(t)),null!==i.residents&&i.residents.forAll(t=>h(t)),!0},t,e),c}forEachInDepthRange(t,e,n,r,o,i,s){let c=-1/0,u=1/0;const h={setRange:t=>{1===n?(c=Math.max(c,t.near),u=Math.min(u,t.far)):(c=Math.max(c,-t.far),u=Math.min(u,-t.near))}};h.setRange(r);const d=A(e,n,t),l=T(e,n),m=T(e,-n),p=t=>{if(!s(t))return;const r=this.objectToBoundingSphere(t),a=A(e,n,r.center)-d,l=a-r.radius,m=a+r.radius;l>u||m<c||!(0,f.m7)(i,r)||o(t,h)};M(this._root,t=>{if(!(0,f.m7)(i,t.bounds))return!1;if((0,a.j)(q,l,t.halfSize),(0,a.i)(q,q,t.bounds.center),A(e,n,q)-d>u)return!1;if((0,a.j)(q,m,t.halfSize),(0,a.i)(q,q,t.bounds.center),A(e,n,q)-d<c)return!1;const r=t.node;return r.terminals.forAll(t=>p(t)),null!==r.residents&&r.residents.forAll(t=>p(t)),!0},e,n)}forEachNode(t){g(this._root,e=>t(e.node,e.bounds,e.halfSize,e.depth))}forEachNeighbor(t,e){const n=e.radius,r=e.center,o=e=>{const o=this.objectToBoundingSphere(e),i=o.radius,s=n+i;return!((0,a.s)(o.center,r)-s*s<=0)||t(e)};let i=!0;const s=t=>{i&&(i=o(t))};g(this._root,t=>{const e=t.bounds.radius,o=n+e;if((0,a.s)(t.bounds.center,r)-o*o>0)return!1;const c=t.node;return c.terminals.forAll(s),i&&null!==c.residents&&c.residents.forAll(s),i}),i&&this.forEachDegenerateObject(s)}_intersectsObject(t,e){const n=this.objectToBoundingSphere(e);return!(n.radius>0)||n.intersectRay(t)}_intersectsObjectWithOffset(t,e,n){const r=this.objectToBoundingSphere(e);return!(r.radius>0)||n.applyToBoundingSphere(r).intersectRay(t)}_add(t,e){e.advanceTo(this.objectToBoundingSphere(t))?e.node.terminals.push(t):(e.node.residents.push(t),e.node.residents.length>this._maximumObjectsPerNode&&e.depth<this._maximumDepth&&this._split(e))}_split(t){const e=t.node.residents;t.node.residents=null;for(let n=0;n<e.length;n++){const r=_.acquire().init(t);this._add(e.at(n),r),_.release(r)}}_grow(t){if(O(t,t=>this.objectToBoundingSphere(t),I),E(I.radius)&&!this._fitsInsideTree(I))if(j(this._root.node))this._root.bounds.copyFrom(I),this._root.halfSize=1.25*this._root.bounds.radius,this._root.updateBoundsRadiusFromHalfSize();else{const t=this._rootBoundsForRootAsSubNode(I);this._placingRootViolatesMaxDepth(t)?this._rebuildTree(I,t):this._growRootAsSubNode(t),_.release(t)}}_rebuildTree(t,e){V.center=e.bounds.center,V.radius=e.halfSize,O([t,V],t=>t,L);const n=_.acquire().init(this._root);this._root.initFrom(null,L,L.radius),this._root.increaseHalfSize(1.25),g(n,t=>(this.add(t.node.terminals.data),null!==t.node.residents&&this.add(t.node.residents.data),!0)),_.release(n)}_placingRootViolatesMaxDepth(t){const e=Math.log(t.halfSize/this._root.halfSize)*Math.LOG2E;let n=0;return g(this._root,t=>(n=Math.max(n,t.depth),n+e<=this._maximumDepth)),n+e>this._maximumDepth}_rootBoundsForRootAsSubNode(t){const e=t.radius,n=t.center;let r=-1/0;const o=this._root.bounds.center,i=this._root.halfSize;for(let t=0;t<3;t++){const s=o[t]-i-(n[t]-e),a=n[t]+e-(o[t]+i),c=Math.max(0,Math.ceil(s/(2*i))),u=Math.max(0,Math.ceil(a/(2*i)))+1,h=2**Math.ceil(Math.log(c+u)*Math.LOG2E);r=Math.max(r,h),k[t].min=c,k[t].max=u}for(let t=0;t<3;t++){let e=k[t].min,n=k[t].max;const s=(r-(e+n))/2;e+=Math.ceil(s),n+=Math.floor(s);const a=o[t]-i-e*i*2;C.center[t]=a+(n+e)*i}const s=r*i;return C.radius=s*N,_.acquire().initFrom(null,C,s,0)}_growRootAsSubNode(t){const e=this._root.node;I.center=this._root.bounds.center,I.radius=this._root.halfSize,this._root.init(t),t.advanceTo(I,null,!0),t.node.children=e.children,t.node.residents=e.residents,t.node.terminals=e.terminals}_shrink(){for(;;){const t=this._findShrinkIndex();if(-1===t)break;this._root.advance(t),this._root.depth=0}}_findShrinkIndex(){if(0!==this._root.node.terminals.length||this._root.isLeaf())return-1;let t=null;const e=this._root.node.children;let n=0,r=0;for(;r<e.length&&null==t;)n=r++,t=e[n];for(;r<e.length;)if(e[r++])return-1;return n}_isDegenerate(t){return!E(this.objectToBoundingSphere(t).radius)}_fitsInsideTree(t){const e=this._root.bounds,n=this._root.halfSize;return t.radius<=n&&t.center[0]>=e.center[0]-n&&t.center[0]<=e.center[0]+n&&t.center[1]>=e.center[1]-n&&t.center[1]<=e.center[1]+n&&t.center[2]>=e.center[2]-n&&t.center[2]<=e.center[2]+n}toJSON(){const{maximumDepth:t,maximumObjectsPerNode:e,_objectCount:n}=this,r=this._nodeToJSON(this._root.node);return{maximumDepth:t,maximumObjectsPerNode:e,objectCount:n,root:{bounds:this._root.bounds,halfSize:this._root.halfSize,depth:this._root.depth,node:r}}}_nodeToJSON(t){const e=t.children.map(t=>t?this._nodeToJSON(t):null),n=t.residents?.map(t=>this.objectToBoundingSphere(t)),r=t.terminals?.map(t=>this.objectToBoundingSphere(t));return{children:e,residents:n,terminals:r}}static fromJSON(t){const e=new b(t=>t,{maximumDepth:t.maximumDepth,maximumObjectsPerNode:t.maximumObjectsPerNode});return e._objectCount=t.objectCount,e._root.initFrom(t.root.node,t.root.bounds,t.root.halfSize,t.root.depth),e}}class _{constructor(){this.bounds=new h.iy,this.halfSize=0,this.initFrom(null,null,0,0)}init(t){return this.initFrom(t.node,t.bounds,t.halfSize,t.depth)}initFrom(t,e,n,r=this.depth){return this.node=null!=t?t:_.createEmptyNode(),e&&this.bounds.copyFrom(e),this.halfSize=n,this.depth=r,this}increaseHalfSize(t){this.halfSize*=t,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds.radius=this.halfSize*N}advance(t){let e=this.node.children[t];e||(e=_.createEmptyNode(),this.node.children[t]=e),this.node=e,this.halfSize/=2,this.depth++;const n=z[t];return this.bounds.center[0]+=n[0]*this.halfSize,this.bounds.center[1]+=n[1]*this.halfSize,this.bounds.center[2]+=n[2]*this.halfSize,this.updateBoundsRadiusFromHalfSize(),this}advanceTo(t,e,n=!1){for(;;){if(this.isTerminalFor(t))return e?.(this,-1),!0;if(this.isLeaf()){if(!n)return e?.(this,-1),!1;this.node.residents=null}const r=this._childIndex(t);e?.(this,r),this.advance(r)}}isLeaf(){return null!=this.node.residents}isTerminalFor(t){return t.radius>this.halfSize/2}_childIndex(t){const e=this.bounds.center;return(e[0]<t.center[0]?1:0)+(e[1]<t.center[1]?2:0)+(e[2]<t.center[2]?4:0)}static createEmptyNode(){return{children:[null,null,null,null,null,null,null,null],terminals:new l.A({shrink:!0}),residents:new l.A({shrink:!0})}}static{this._pool=new d.A(()=>new _)}static acquire(){return _._pool.acquire()}static release(t){_._pool.release(t)}static clearPool(){_._pool.prune()}}function g(t,e){let n=_.acquire().init(t);const r=[n];for(;0!==r.length;){if(n=r.pop(),e(n)&&!n.isLeaf())for(let t=0;t<n.node.children.length;t++)n.node.children[t]&&r.push(_.acquire().init(n).advance(t));_.release(n)}}function M(t,e,n,r=1){let o=_.acquire().init(t);const i=[o];for(function(t,e,n){if(!J.length)for(let t=0;t<8;++t)J.push({index:0,distance:0});for(let n=0;n<8;++n){const r=z[n];J.data[n].index=n,J.data[n].distance=A(t,e,r)}J.sort((t,e)=>t.distance-e.distance);for(let t=0;t<8;++t)n[t]=J.data[t].index}(n,r,H);0!==i.length;){if(o=i.pop(),e(o)&&!o.isLeaf())for(let t=7;t>=0;--t){const e=H[t];o.node.children[e]&&i.push(_.acquire().init(o).advance(e))}_.release(o)}}function S(t,e,n){F.clear();const r=n.advanceTo(e,(t,e)=>{F.push(t.node),F.push(e)})?n.node.terminals:n.node.residents;if(r.removeUnordered(t),0===r.length)for(let t=F.length-2;t>=0&&v(F.data[t],F.data[t+1]);t-=2);}function v(t,e){return e>=0&&(t.children[e]=null),!!j(t)&&(null===t.residents&&(t.residents=new l.A({shrink:!0})),!0)}function j(t){if(0!==t.terminals.length)return!1;if(null!==t.residents)return 0===t.residents.length;for(let e=0;e<t.children.length;e++)if(t.children[e])return!1;return!0}function y(t,e){t[0]=Math.min(t[0],e.center[0]-e.radius),t[1]=Math.min(t[1],e.center[1]-e.radius),t[2]=Math.min(t[2],e.center[2]-e.radius)}function x(t,e){t[0]=Math.max(t[0],e.center[0]+e.radius),t[1]=Math.max(t[1],e.center[1]+e.radius),t[2]=Math.max(t[2],e.center[2]+e.radius)}function w(t,e,n){n[0]=t[0]+e,n[1]=t[1]+e,n[2]=t[2]+e}function O(t,e,n){R[0]=1/0,R[1]=1/0,R[2]=1/0,B[0]=-1/0,B[1]=-1/0,B[2]=-1/0;for(const n of t){const t=e(n);E(t.radius)&&(y(R,t),x(B,t))}(0,a.l)(n.center,R,B,.5),n.radius=Math.max(B[0]-R[0],B[1]-R[1],B[2]-R[2])/2}function T(t,e){let n,r=1/0;for(let o=0;o<8;++o){const i=A(t,e,P[o]);i<r&&(r=i,n=P[o])}return n}function A(t,e,n){return e*(t[0]*n[0]+t[1]*n[1]+t[2]*n[2])}function E(t){return!isNaN(t)&&t!==-1/0&&t!==1/0&&t>0}const z=[(0,c.fA)(-1,-1,-1),(0,c.fA)(1,-1,-1),(0,c.fA)(-1,1,-1),(0,c.fA)(1,1,-1),(0,c.fA)(-1,-1,1),(0,c.fA)(1,-1,1),(0,c.fA)(-1,1,1),(0,c.fA)(1,1,1)],P=[(0,c.fA)(-1,-1,-1),(0,c.fA)(-1,-1,1),(0,c.fA)(-1,1,-1),(0,c.fA)(-1,1,1),(0,c.fA)(1,-1,-1),(0,c.fA)(1,-1,1),(0,c.fA)(1,1,-1),(0,c.fA)(1,1,1)],N=Math.sqrt(3),D=[null],C=new h.iy,q=(0,c.vt)(),R=(0,c.vt)(),B=(0,c.vt)(),F=new l.A,I=new h.iy,V=new h.iy,L=new h.iy,k=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],J=new l.A,H=[0,0,0,0,0,0,0,0];var K=n(431);function Q(t,e,n){const r=new h.iy;return(0,a.j)(r.center,t,.5),(0,a.c)(r.center,r.center,e,.5),r.radius=(0,a.D)(r.center,t),(0,a.i)(r.center,r.center,n),r}class W{constructor(t,e,n){this.objectId=t,this.target=e,this.distance=n}}class Y extends W{constructor(t,e,n){super(t,e,n),this.type="vertex"}}class G extends W{constructor(t,e,n,r,o){super(t,e,n),this.start=r,this.end=o,this.type="edge"}}let U=class{constructor(){this._idToComponent=new Map,this._components=new b(t=>t.bounds),this._edges=new b(t=>t.bounds),this._tmpLineSegment=(0,u.vt)(),this._tmpP1=(0,c.vt)(),this._tmpP2=(0,c.vt)(),this._tmpP3=(0,c.vt)(),this.remoteClient=null}async fetchCandidates(t,e){await Promise.resolve(),(0,o.Te)(e);const n=t;n.mbs=new h.iy(t.mbsJSON),await this._ensureEdgeLocations(n,e);const r=[];return this._edges.forEachNeighbor(t=>(this._addCandidates(n,t,r),r.length<1e3),n.mbs),{result:{candidates:r}}}async _ensureEdgeLocations(t,e){const n=[];if(this._components.forEachNeighbor(t=>{if(null==t.info){const{id:e,uid:r}=t;n.push({id:e,uid:r})}return!0},t.mbs),!n.length)return;const r={components:n},o=await this.remoteClient.invoke("fetchAllEdgeLocations",r,e??{});for(const t of o.components)this._setFetchEdgeLocations(t)}async add(t){const e=new Z(t.id,new h.iy(t.bounds));return this._idToComponent.set(e.id,e),this._components.add([e]),{result:{}}}async remove(t){const e=this._idToComponent.get(t.id);if(e){const t=[];this._edges.forEachNeighbor(n=>(n.component===e&&t.push(n),!0),e.bounds),this._edges.remove(t),this._components.remove([e]),this._idToComponent.delete(e.id)}return{result:{}}}_setFetchEdgeLocations(t){const e=this._idToComponent.get(t.id);if(null==e||t.uid!==e.uid)return;const n=K.HY.createView(t.locations),r=new Array(n.count),o=(0,c.vt)(),i=(0,c.vt)();for(let s=0;s<n.count;s++){n.position0.getVec(s,o),n.position1.getVec(s,i);const a=Q(o,i,t.origin),c=new tt(e,s,a);r[s]=c}this._edges.add(r);const{objectIds:s,origin:a}=t;e.info={locations:n,objectIds:s,origin:a}}_addCandidates(t,e,n){const{info:r}=e.component,{origin:o,objectIds:i}=r,s=r.locations,c=s.position0.getVec(e.index,this._tmpP1),u=s.position1.getVec(e.index,this._tmpP2);(0,a.i)(c,c,o),(0,a.i)(u,u,o);const h=i[s.componentIndex.get(e.index)];this._addEdgeCandidate(t,h,c,u,n),$(t,h,c,n),$(t,h,u,n)}_addEdgeCandidate(t,e,n,r,o){if(!t.returnEdge)return;const i=t.mbs.center,s=(0,u.Cr)(n,r,this._tmpLineSegment),h=(0,u._I)(s,i,this._tmpP3);t.mbs.contains(h)&&o.push(new G(e,(0,c.o8)(h),(0,a.D)(i,h),(0,c.o8)(n),(0,c.o8)(r)))}};U=(0,r.Cg)([(0,s.$K)("esri.views.interactive.snapping.featureSources.sceneLayerSource.SceneLayerSnappingSourceWorker")],U);const X=U;function $(t,e,n,r){t.returnVertex&&t.mbs.contains(n)&&r.push(new Y(e,(0,c.o8)(n),(0,a.D)(t.mbs.center,n)))}class Z{constructor(t,e){this.id=t,this.bounds=e,this.info=null,this.uid=(0,i.c)()}}class tt{constructor(t,e,n){this.component=t,this.index=e,this.bounds=n}}},77690:(t,e,n)=>{n.d(e,{B8:()=>a,Ge:()=>f,I0:()=>l,KC:()=>c,a4:()=>u,hZ:()=>i,hs:()=>d,lw:()=>h,mg:()=>s,z0:()=>o});var r=n(34304);function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function i(t,e,n,r,o,i,s,a,c,u){return t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=i,t[5]=s,t[6]=a,t[7]=c,t[8]=u,t}function s(t,e){if(t===e){const n=e[1],r=e[2],o=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=o}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function a(t,e){const n=e[0],r=e[1],o=e[2],i=e[3],s=e[4],a=e[5],c=e[6],u=e[7],h=e[8],d=h*s-a*u,l=-h*i+a*c,f=u*i-s*c;let m=n*d+r*l+o*f;return m?(m=1/m,t[0]=d*m,t[1]=(-h*r+o*u)*m,t[2]=(a*r-o*s)*m,t[3]=l*m,t[4]=(h*n-o*c)*m,t[5]=(-a*n+o*i)*m,t[6]=f*m,t[7]=(-u*n+r*c)*m,t[8]=(s*n-r*i)*m,t):null}function c(t,e){const n=e[0],r=e[1],o=e[2],i=e[3],s=e[4],a=e[5],c=e[6],u=e[7],h=e[8];return t[0]=s*h-a*u,t[1]=o*u-r*h,t[2]=r*a-o*s,t[3]=a*c-i*h,t[4]=n*h-o*c,t[5]=o*i-n*a,t[6]=i*u-s*c,t[7]=r*c-n*u,t[8]=n*s-r*i,t}function u(t){const e=t[0],n=t[1],r=t[2],o=t[3],i=t[4],s=t[5],a=t[6],c=t[7],u=t[8];return e*(u*i-s*c)+n*(-u*o+s*a)+r*(c*o-i*a)}function h(t,e,n){const r=e[0],o=e[1],i=e[2],s=e[3],a=e[4],c=e[5],u=e[6],h=e[7],d=e[8],l=n[0],f=n[1],m=n[2],p=n[3],b=n[4],_=n[5],g=n[6],M=n[7],S=n[8];return t[0]=l*r+f*s+m*u,t[1]=l*o+f*a+m*h,t[2]=l*i+f*c+m*d,t[3]=p*r+b*s+_*u,t[4]=p*o+b*a+_*h,t[5]=p*i+b*c+_*d,t[6]=g*r+M*s+S*u,t[7]=g*o+M*a+S*h,t[8]=g*i+M*c+S*d,t}function d(t,e,n){const r=n[0],o=n[1],i=n[2];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=o*e[3],t[4]=o*e[4],t[5]=o*e[5],t[6]=i*e[6],t[7]=i*e[7],t[8]=i*e[8],t}function l(t,e){const n=e[0],r=e[1],o=e[2],i=e[3],s=n+n,a=r+r,c=o+o,u=n*s,h=r*s,d=r*a,l=o*s,f=o*a,m=o*c,p=i*s,b=i*a,_=i*c;return t[0]=1-d-m,t[3]=h-_,t[6]=l+b,t[1]=h+_,t[4]=1-u-m,t[7]=f-p,t[2]=l-b,t[5]=f+p,t[8]=1-u-d,t}function f(t,e){const n=e[0],r=e[1],o=e[2],i=e[3],s=e[4],a=e[5],c=e[6],u=e[7],h=e[8],d=e[9],l=e[10],f=e[11],m=e[12],p=e[13],b=e[14],_=e[15],g=n*a-r*s,M=n*c-o*s,S=n*u-i*s,v=r*c-o*a,j=r*u-i*a,y=o*u-i*c,x=h*p-d*m,w=h*b-l*m,O=h*_-f*m,T=d*b-l*p,A=d*_-f*p,E=l*_-f*b;let z=g*E-M*A+S*T+v*O-j*w+y*x;return z?(z=1/z,t[0]=(a*E-c*A+u*T)*z,t[1]=(c*O-s*E-u*w)*z,t[2]=(s*A-a*O+u*x)*z,t[3]=(o*A-r*E-i*T)*z,t[4]=(n*E-o*O+i*w)*z,t[5]=(r*O-n*A-i*x)*z,t[6]=(p*y-b*j+_*v)*z,t[7]=(b*S-m*y-_*M)*z,t[8]=(m*j-p*S+_*g)*z,t):null}function m(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}const p=h,b=m;Object.freeze(Object.defineProperty({__proto__:null,add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t},adjoint:c,copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},determinant:u,equals:function(t,e){const n=t[0],o=t[1],i=t[2],s=t[3],a=t[4],c=t[5],u=t[6],h=t[7],d=t[8],l=e[0],f=e[1],m=e[2],p=e[3],b=e[4],_=e[5],g=e[6],M=e[7],S=e[8],v=(0,r.FD)();return Math.abs(n-l)<=v*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(o-f)<=v*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(i-m)<=v*Math.max(1,Math.abs(i),Math.abs(m))&&Math.abs(s-p)<=v*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(a-b)<=v*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(c-_)<=v*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(u-g)<=v*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(h-M)<=v*Math.max(1,Math.abs(h),Math.abs(M))&&Math.abs(d-S)<=v*Math.max(1,Math.abs(d),Math.abs(S))},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},frob:function(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+t[6]**2+t[7]**2+t[8]**2)},fromMat2d:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},fromMat4:o,fromQuat:l,fromRotation:function(t,e){const n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromTranslation:function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},invert:a,isOrthoNormal:function(t){const e=(0,r.FD)(),n=t[0],o=t[1],i=t[2],s=t[3],a=t[4],c=t[5],u=t[6],h=t[7],d=t[8];return Math.abs(1-(n*n+s*s+u*u))<=e&&Math.abs(1-(o*o+a*a+h*h))<=e&&Math.abs(1-(i*i+c*c+d*d))<=e},mul:p,multiply:h,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t},normalFromMat4:f,normalFromMat4Legacy:function(t,e){const n=e[0],r=e[1],o=e[2],i=e[4],s=e[5],a=e[6],c=e[8],u=e[9],h=e[10],d=h*s-a*u,l=-h*i+a*c,f=u*i-s*c,m=n*d+r*l+o*f;if(!m)return null;const p=1/m;return t[0]=d*p,t[1]=(-h*r+o*u)*p,t[2]=(a*r-o*s)*p,t[3]=l*p,t[4]=(h*n-o*c)*p,t[5]=(-a*n+o*i)*p,t[6]=f*p,t[7]=(-u*n+r*c)*p,t[8]=(s*n-r*i)*p,t},projection:function(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},rotate:function(t,e,n){const r=e[0],o=e[1],i=e[2],s=e[3],a=e[4],c=e[5],u=e[6],h=e[7],d=e[8],l=Math.sin(n),f=Math.cos(n);return t[0]=f*r+l*s,t[1]=f*o+l*a,t[2]=f*i+l*c,t[3]=f*s-l*r,t[4]=f*a-l*o,t[5]=f*c-l*i,t[6]=u,t[7]=h,t[8]=d,t},scale:d,scaleByVec2:function(t,e,n){const r=n[0],o=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=o*e[3],t[4]=o*e[4],t[5]=o*e[5],t},set:i,str:function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},sub:b,subtract:m,translate:function(t,e,n){const r=e[0],o=e[1],i=e[2],s=e[3],a=e[4],c=e[5],u=e[6],h=e[7],d=e[8],l=n[0],f=n[1];return t[0]=r,t[1]=o,t[2]=i,t[3]=s,t[4]=a,t[5]=c,t[6]=l*r+f*s+u,t[7]=l*o+f*a+h,t[8]=l*i+f*c+d,t},transpose:s},Symbol.toStringTag,{value:"Module"}))},82534:(t,e,n)=>{function r(){return[0,0,0,1]}function o(t){return[t[0],t[1],t[2],t[3]]}n.d(e,{o8:()=>o,vt:()=>r,zK:()=>i});const i=[0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:i,clone:o,create:r,fromValues:function(t,e,n,r){return[t,e,n,r]}},Symbol.toStringTag,{value:"Module"}))},91869:(t,e,n)=>{function r(t,e){for(const n of t.values())if(e(n))return!0;return!1}function o(t,e,n){const r=t.get(e);if(void 0!==r)return r;const o=n();return t.set(e,o),o}function i(t){const e=new Map;return n=>(e.has(n)||e.set(n,t(n)),e.get(n))}n.d(e,{Bj:()=>i,Bs:()=>r,tE:()=>o})}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8692],{8303:(e,t,i)=>{i.d(t,{A:()=>T});var a=i(31635),s=i(92602),r=i(70333),n=i(11254),o=i(60999),l=i(49186),d=i(53966),h=i(97768),p=i(74887),u=i(84952),y=i(91429),c=i(77548),g=i(20655),f=i(80812),m=i(41318),w=i(10407),M=i(36005),b=i(43937);const T=e=>{const t=e;let T=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,h.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}get portalItem(){return this._get("portalItem")}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,i){if(t.itemId)return new f.default({id:t.itemId,portal:i?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:a}=await i.e(1204).then(i.bind(i,41204));return(0,p.Te)(t),await a({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw(0,p.zf)(e)||d.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch(e=>((0,p.QP)(e),!0)))}async setUserPrivileges(e,t){if(!s.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:i,fullEdit:a},content:{updateItem:s}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",i),this._set("userHasFullEditingPrivileges",a),this._set("userHasUpdateItemPrivileges",s)}catch(e){(0,p.QP)(e)}}async _fetchUserPrivileges(e,t){let i=this.portalItem;if(!e||!i||!i.loaded||i.sourceUrl)return this._fetchFallbackUserPrivileges(t);const a=!r.id?.findCredential(this.url),s=e===i.id;if(s&&i.portal.user)return this._getUserPrivileges(i,a);let n,o;if(s)n=i.portal.url;else try{n=await(0,c.wI)(this.url,t)}catch(e){(0,p.QP)(e)}if(!n||!(0,u.b8)(n,i.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;o=await(r.id?.getCredential(`${n}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,p.QP)(e)}const l=!0,d=!1,h=!1;if(!o)return{features:{edit:l,fullEdit:d},content:{updateItem:h}};try{if(s?await i.reload():(i=new f.default({id:e,portal:{url:n}}),await i.load(t)),i.portal.user)return this._getUserPrivileges(i,a)}catch(e){(0,p.QP)(e)}return{features:{edit:l,fullEdit:d},content:{updateItem:h}}}_getUserPrivileges(e,t){const i=(0,w.It)(e);return t&&(i.features.edit=!0),i}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,p.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?r.id?.findCredential(this.url):null;if(!t)return!0;const i=v.credential===t?v.user:await this._fetchEditingUser(e);return v.credential=t,v.user=i,null==i?.privileges||i.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const i=r.id?.findServerInfo(this.url??"");if(!i?.owningSystemUrl)return null;const a=`${i.owningSystemUrl}/sharing/rest`,s=g.A.getDefault();if(s&&s.loaded&&(0,u.S8)(s.restUrl)===(0,u.S8)(a))return s.user;const l=`${a}/community/self`,d=null!=e?e.signal:null,h=await(0,o.Ke)((0,n.A)(l,{authMode:"no-prompt",query:{f:"json"},signal:d}));return h.ok?m.A.fromJSON(h.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const i=t?.portal,a=this.portalItem?.id&&(this.portalItem.portal||g.A.getDefault());return i&&a&&!(0,u.ut)(a.restUrl,i.restUrl)?(t.messages&&t.messages.push(new l.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,a.Cg)([(0,y.MZ)({type:f.default})],T.prototype,"portalItem",null),(0,a.Cg)([(0,M.w)("web-document","portalItem",["itemId"])],T.prototype,"readPortalItem",null),(0,a.Cg)([(0,b.K)("web-document","portalItem",{itemId:{type:String}})],T.prototype,"writePortalItem",null),(0,a.Cg)([(0,y.MZ)({clonable:!1})],T.prototype,"resourceReferences",void 0),(0,a.Cg)([(0,y.MZ)({type:Boolean,readOnly:!0})],T.prototype,"userHasEditingPrivileges",void 0),(0,a.Cg)([(0,y.MZ)({type:Boolean,readOnly:!0})],T.prototype,"userHasFullEditingPrivileges",void 0),(0,a.Cg)([(0,y.MZ)({type:Boolean,readOnly:!0})],T.prototype,"userHasUpdateItemPrivileges",void 0),T=(0,a.Cg)([(0,y.$K)("esri.layers.mixins.PortalLayer")],T),T},v={credential:null,user:null}},18768:(e,t,i)=>{i.d(t,{b:()=>o});var a=i(31635),s=i(53966),r=i(91429),n=i(60694);const o=e=>{const t=e;let i=class extends t{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,n.qg)(this.url);if(e?.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,n.Jf)(e,s.A.getLogger(this)))}};return(0,a.Cg)([(0,r.MZ)()],i.prototype,"title",null),(0,a.Cg)([(0,r.MZ)({type:String})],i.prototype,"url",null),i=(0,a.Cg)([(0,r.$K)("esri.layers.mixins.ArcGISService")],i),i}},28692:(e,t,i)=>{i.r(t),i.d(t,{default:()=>N});var a=i(31635),s=i(67996),r=i(7762),n=i(49186),o=i(53966),l=i(91869),d=i(25728),h=i(74887),p=i(36708),u=i(84952),y=i(13069),c=i(91429),g=i(35666),f=i(4146),m=i(24137),w=i(62796),M=i(54898),b=i(18768),T=i(63074),v=i(69208),_=i(16131),D=i(8303),I=i(54310),A=i(25036),C=i(10873),S=i(48441),L=i(97159),P=i(36005),k=i(43937);let E=class extends((0,T.dM)((0,A.j)((0,I.J)((0,b.b)((0,_.q)((0,D.A)((0,d.P)((0,v.d)(f.A))))))))){constructor(e){super(e),this._graphTypeLookup=new Map,this._namedTypesModified=!1,this.dataManager=null,this.definitionSetMap=null,this.knowledgeGraph=null,this.layers=new(r.A.ofType(w.A)),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="KnowledgeGraphLayer",this.sublayerIdsCache=new Map,this.tables=new(r.A.ofType(w.A)),this.type="knowledge-graph",this.url=null,this.addHandles((0,p.wB)(()=>this.layers.concat(this.tables),(e,t)=>this._handleSublayersChange(e,t),p.OH))}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){try{await this.loadFromPortal({supportedTypes:["Knowledge Graph Layer"]},e)}catch(e){(0,h.QP)(e)}await this._fetchMetadata(e),await this._initializeLayerProperties(e),this.loadLayerAssumingLocalCache(),this._layersLoadedFromAuthoritativeItem()||await(0,M.qN)(this)}async _fetchMetadata(e){if(!this.url)throw new n.A("knowledge-graph:missing-url","KnowledgeGraphLayer must be created with a url");const t=await(0,S.fetchKnowledgeGraph)(this.url);this.knowledgeGraph=t;const{edit:i,fullEdit:a,updateItem:s}=await(0,M.N1)(t.serviceDefinition.serviceItemId,this.url,e);this._set("userHasEditingPrivileges",i),this._set("userHasFullEditingPrivileges",a),this._set("userHasUpdateItemPrivileges",s),this._forEachGraphType(e=>{e.name&&this._graphTypeLookup.set(e.name,e)})}async _initializeLayerProperties(e){7===this.originIdOf("inclusionModeDefinition")?this._validateInclusionModeDefinition():await this._initializeInclusionModeDefinition(e),this._setMemberTypes(),this.dataManager=new m.P({knowledgeGraph:this.knowledgeGraph,inclusionModeDefinition:this.inclusionModeDefinition})}async _initializeInclusionModeDefinition(e){const t=this.definitionSetMap?await(0,s.cZ)(this.definitionSetMap,!0,e?.signal?{signal:e.signal}:void 0):{generateAllSublayers:!0,namedTypeDefinitions:new Map};[...this.layers.toArray(),...this.tables.toArray()].forEach(e=>{const i=this._graphTypeLookup.get(e.graphTypeName);i&&!t.namedTypeDefinitions.has(i.name)&&t.namedTypeDefinitions.set(i.name,{useAllData:!0})}),this.setAtOrigin("inclusionModeDefinition",t,(0,g.OL)(this.originIdOf("definitionSetMap")))}_validateInclusionModeDefinition(){const{inclusionModeDefinition:e}=this;if(!e)return;const{namedTypeDefinitions:t}=e;if(t?.size>0)t.forEach((e,i)=>{const a=this._graphTypeLookup.get(i);if(!a)return o.A.getLogger(this).warn(`A named type, ${i}, was in the inclusion list that wasn't in the data model and will be removed`),void t.delete(i);"relationship"!==a.type&&"entity"!==a.type&&(o.A.getLogger(this).warn(`A named type, ${i}, was in the inclusion list that wasn't properly modeled and will be removed`),t.delete(i))});else if(!e.generateAllSublayers)throw new n.A("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined")}_setMemberTypes(){let e=[],t=[];const{inclusionModeDefinition:i}=this,a=i?.namedTypeDefinitions;!i||i.generateAllSublayers?(e=this.knowledgeGraph.dataModel?.entityTypes??[],t=this.knowledgeGraph.dataModel?.relationshipTypes??[]):a&&a.size>0&&a.forEach((i,a)=>{const s=this._graphTypeLookup.get(a);switch(s?.type){case"relationship":t.push(s);break;case"entity":e.push(s)}}),this.memberEntityTypes=e,this.memberRelationshipTypes=t}_forEachGraphType(e){[...this.knowledgeGraph.dataModel?.entityTypes??[],...this.knowledgeGraph.dataModel?.relationshipTypes??[]].forEach(t=>{e(t)})}_refreshNamedTypes(){this._namedTypesModified=!0;for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}async _handleNewRecords(e){const t=new Set,i=[];for(const a of e)this._graphTypeLookup.has(a.typeName)&&(!1===this.layers.concat(this.tables).some(e=>e.objectType.name===a.typeName)&&(this.dataManager.sublayerCaches.set(a.typeName,new Map),t.add(a.typeName)),(0,l.tE)(this.sublayerIdsCache,a.typeName,()=>new Set).add(a.id),i.push(a));this.dataManager.addToLayer(i);for(const e of t){const t=this._graphTypeLookup.get(e);t&&(this._addSublayer(t),"entity"===t.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e))}await(0,M.qN)(this,Array.from(t)),this._refreshNamedTypes()}_createSublayers(e,t,i){e.forEach(e=>{const a=this._createSublayer(e);i(a)&&t.push(a),this._updateSublayerCaches(e)})}_addSublayer(e){const t=this._createSublayer(e);return t.geometryType?this.layers.push(t):this.tables.push(t),t}_createSublayer(e){return new w.A({objectType:e,parentCompositeLayer:this,graphType:e.type})}_updateSublayers(e,t){t.forEach(t=>{t.parentCompositeLayer=this;const i=e.find(e=>e.type===t.graphType&&e.name===t.graphTypeName);i&&(t.objectType=i,this._updateSublayerCaches(i))})}_updateSublayerCaches({name:e}){if(!e)return;const t=this.dataManager.sublayerCaches;t.has(e)||t.set(e,new Map)}_saveUrlAsNewResource(e,t,i,a){e[t]="<pending>",i.pendingOperations.push(async function(e){const t=await(0,s.fe)(e);return new Blob([t],{type:"application/x-protobuf"})}(this.inclusionModeDefinition).then(s=>{const r=function(e){const t=`definitionSetMap-${(0,y.lk)()}.dat`,i=(0,u.fj)("knowledgeGraphLayer",t);return e.resourceFromPath(i)}(a);e[t]=r.itemRelativeUrl,i.toAdd.push({resource:r,content:{type:"blob",blob:s},compress:!1,finish:e=>{this.definitionSetMap=e.url}})}))}_displaysAllRecords(e){for(const[,{useAllData:t}]of e.namedTypeDefinitions)if(!t)return!1;return!0}_handleSublayersChange(e,t){t&&(t.forEach(e=>{e.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(e=>{e.parent=this}),this.addHandles([e.on("after-add",({item:e})=>{e.parent=this}),e.on("after-remove",({item:e})=>{e.parent=null})],"sublayers-owner"))}_layersLoadedFromAuthoritativeItem(){const e=this.originIdOf("layers");return e>=3&&e<7}readDefinitionSetMap(e,t,i){return(0,L.f)(e,i)}writeDefinitionSetMap(e,t,i,a){const s=a?.portalItem,r=a?.resources,n=(0,g.aB)(a?.origin);if(!s||!r||null==n)return void(e&&(t[i]=(0,L.t)(e,a)));const{inclusionModeDefinition:o}=this;if(!o||this._displaysAllRecords(o))return void(this.definitionSetMap=null);const l=this.originIdOf("inclusionModeDefinition");if(7===l||this._namedTypesModified||n<l)this._saveUrlAsNewResource(t,i,r,s);else if(n===l&&e){const n=(0,L.t)(e,a);(0,u.oP)(n)?this._saveUrlAsNewResource(t,i,r,s):t[i]=n}}set inclusionModeDefinition(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("inclusionModeDefinition",e):o.A.getLogger(this).error("#inclusionModeDefinition","inclusionModeDefinition cannot be changed after the layer is loaded.")}get sublayerCapabilities(){return(0,M.hZ)(this.knowledgeGraph)}loadLayerAssumingLocalCache(){const e=[...this.memberEntityTypes,...this.memberRelationshipTypes];this.layers.length||0===this.originIdOf("tables")?0===this.originIdOf("layers")?this._createSublayers(e,this.layers,e=>!!e.geometryType):this._updateSublayers(e,this.layers):this.layers=new r.A,this.tables.length||0===this.originIdOf("layers")?0===this.originIdOf("tables")?this._createSublayers(e,this.tables,e=>!e.geometryType):this._updateSublayers(e,this.tables):this.tables=new r.A,this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{const i=(0,l.tE)(this.sublayerIdsCache,t,()=>new Set);e.members?.forEach(e=>{i.add(e.id)})})}async addRecords(e){await this.load(),await this._handleNewRecords(e)}async createSublayerForNamedType(e){await this.load();const t=this._graphTypeLookup.get(e);if(!t)throw new n.A("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");if(this.dataManager.sublayerCaches.has(e))throw new n.A("knowledge-graph:duplicate-type","The specified type already exists as a sublayer.");this.dataManager.sublayerCaches.set(e,new Map),(0,l.tE)(this.sublayerIdsCache,e,()=>new Set);const i=this._addSublayer(t);return"entity"===t.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),this.dataManager.inclusionModeDefinition&&this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!0}),await(0,M.qN)(this,[e]),this._refreshNamedTypes(),i}convertSublayerToDynamicData(e){if(!this.dataManager.inclusionModeDefinition)throw new n.A("knowledge-graph:fully-dynamic-membership","This Knowledge Graph Layer already uses fully dynamic membership, individual sublayers cannot be converted");if(!this._graphTypeLookup.get(e))throw new n.A("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");if(!this.dataManager.sublayerCaches.has(e))throw new n.A("knowledge-graph:duplicate-type","The specified type does not exist as a sublayer.");const t=this.dataManager.inclusionModeDefinition.namedTypeDefinitions.get(e);t?.useAllData?o.A.getLogger(this).warn("This Knowledge Graph Layer already uses dynamic membership for the sublayer - no conversion was made"):(this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!0}),this.sublayerIdsCache.delete(e),this._refreshNamedTypes())}convertSublayerToExplicitMembership(e){if(!this.dataManager.inclusionModeDefinition)throw new n.A("knowledge-graph:fully-dynamic-membership","This Knowledge Graph Layer already uses fully dynamic membership, individual sublayers cannot be converted");if(!this._graphTypeLookup.get(e))throw new n.A("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");const t=this.dataManager.inclusionModeDefinition.namedTypeDefinitions.get(e);if(!t||t.useAllData){if(!this.dataManager.sublayerCaches.has(e))throw new n.A("knowledge-graph:duplicate-type","The specified type does not exist as a sublayer.");this.sublayerIdsCache.set(e,new Set),this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:new Map}),this._refreshNamedTypes()}else o.A.getLogger(this).warn("This Knowledge Graph Layer already uses explicit membership for the sublayer - no conversion was made")}convertToFullyDynamicData(){this.dataManager.inclusionModeDefinition||o.A.getLogger(this).warn("This Knowledge Graph Layer already uses fully dynamic membership - no conversion was made"),this.sublayerIdsCache.clear(),this.dataManager.inclusionModeDefinition=null,this._refreshNamedTypes()}convertToExplicitMembership(){this.dataManager.inclusionModeDefinition&&this.dataManager.inclusionModeDefinition.namedTypeDefinitions.size>0&&o.A.getLogger(this).warn("This Knowledge Graph Layer already uses explicit membership - no conversion was made"),this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map};for(const e of this.dataManager.sublayerCaches.keys())(0,l.tE)(this.sublayerIdsCache,e,()=>new Set),this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:new Map});this._refreshNamedTypes()}async removeRecords(e){await this.load();const t=[];for(const i of e)!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(i.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(i.typeName)?.members?.has(i.id)&&t.push(i);this.dataManager.removeFromLayer(t);for(const e of t)this.sublayerIdsCache.get(e.typeName)?.delete(e.id);return this._refreshNamedTypes(),t}};(0,a.Cg)([(0,c.MZ)()],E.prototype,"dataManager",void 0),(0,a.Cg)([(0,c.MZ)({json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],E.prototype,"definitionSetMap",void 0),(0,a.Cg)([(0,P.w)("definitionSetMap")],E.prototype,"readDefinitionSetMap",null),(0,a.Cg)([(0,k.K)("definitionSetMap")],E.prototype,"writeDefinitionSetMap",null),(0,a.Cg)([(0,c.MZ)()],E.prototype,"inclusionModeDefinition",null),(0,a.Cg)([(0,c.MZ)()],E.prototype,"knowledgeGraph",void 0),(0,a.Cg)([(0,c.MZ)({type:r.A.ofType(w.A),json:{write:{ignoreOrigin:!0}}})],E.prototype,"layers",void 0),(0,a.Cg)([(0,c.MZ)()],E.prototype,"memberEntityTypes",void 0),(0,a.Cg)([(0,c.MZ)()],E.prototype,"memberRelationshipTypes",void 0),(0,a.Cg)([(0,c.MZ)({type:["KnowledgeGraphLayer"]})],E.prototype,"operationalLayerType",void 0),(0,a.Cg)([(0,c.MZ)()],E.prototype,"sublayerCapabilities",null),(0,a.Cg)([(0,c.MZ)()],E.prototype,"sublayerIdsCache",void 0),(0,a.Cg)([(0,c.MZ)({type:r.A.ofType(w.A),json:{write:{ignoreOrigin:!0}}})],E.prototype,"tables",void 0),(0,a.Cg)([(0,c.MZ)({json:{read:!1}})],E.prototype,"type",void 0),(0,a.Cg)([(0,c.MZ)(C.OZ)],E.prototype,"url",void 0),E=(0,a.Cg)([(0,c.$K)("esri.layers.KnowledgeGraphLayer")],E);const N=E},69208:(e,t,i)=>{i.d(t,{d:()=>r});var a=i(31635),s=i(91429);const r=e=>{const t=e;let i=class extends t{constructor(){super(...arguments),this.customParameters=null}};return(0,a.Cg)([(0,s.MZ)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],i.prototype,"customParameters",void 0),i=(0,a.Cg)([(0,s.$K)("esri.layers.mixins.CustomParametersMixin")],i),i}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9953],{9775:(e,t,r)=>{r.d(t,{A:()=>o});var s=r(62788),n=r(95488);class o{constructor(e=e=>e.values().next().value){this._peeker=e,this._observable=new n.I,this._items=new Set}get length(){return(0,s.gc)(this._observable),this._items.size}clear(){0!==this.length&&(this._items.clear(),this._observable.notify())}last(){if(0===this.length)return;let e;for(e of this._items);return e}peek(){if(0!==this.length)return this._peeker(this._items)}push(e){this.contains(e)||(this._items.add(e),this._observable.notify())}contains(e){return(0,s.gc)(this._observable),this._items.has(e)}pop(){if(0===this.length)return;const e=this.peek();return this._items.delete(e),this._observable.notify(),e}popLast(){if(0===this.length)return;const e=this.last();return this._items.delete(e),this._observable.notify(),e}remove(e){this.contains(e)&&(this._items.delete(e),this._observable.notify())}filter(e){const t=this.length;return this._items.forEach(t=>{e(t)||this._items.delete(t)}),t!==this._items.size&&this._observable.notify(),this}*[Symbol.iterator](){(0,s.gc)(this._observable),yield*this._items}}},10382:(e,t,r)=>{r.d(t,{A:()=>c});var s=r(36563),n=(r(44208),r(74887)),o=r(9775),i=r(72457),a=r(52268),l=r(61322);class c{constructor(){this._inUseClients=new Array,this._clients=new Array,this._clientPromises=new Array,this._ongoingJobsQueue=new o.A,this._ongoingLowPriorityJobsQueue=new o.A}destroy(){this.close()}get closed(){return!this._clients?.length}open(e,t){return new Promise((r,s)=>{let o=!0;const i=e=>{(0,n.Te)(t.signal),o&&(o=!1,e())};this._clients.length=e.length,this._clientPromises.length=e.length,this._inUseClients.length=e.length;for(let o=0;o<e.length;++o){const a=e[o];(0,n.$X)(a)?this._clientPromises[o]=a.then(e=>(this._clients[o]=new l.default(e,t,this._ongoingJobsQueue,this._ongoingLowPriorityJobsQueue),i(r),this._clients[o]),()=>(i(s),null)):(this._clients[o]=new l.default(a,t,this._ongoingJobsQueue,this._ongoingLowPriorityJobsQueue),this._clientPromises[o]=Promise.resolve(this._clients[o]),i(r))}})}broadcast(e,t,r){const s=new Array(this._clientPromises.length);for(let n=0;n<this._clientPromises.length;++n){const o=this._clientPromises[n];s[n]=o.then(s=>s?.invoke(e,t,r))}return s}close(){let e;for(;e=this._ongoingJobsQueue.pop();)e.resolver.reject((0,n.NK)(`Worker closing, aborting job calling '${e.methodName}'`));for(;e=this._ongoingLowPriorityJobsQueue.pop();)e.resolver.reject((0,n.NK)(`Worker closing, aborting job calling '${e.methodName}'`));for(const e of this._clientPromises)e.then(e=>e?.close());this._clients.length=0,this._clientPromises.length=0,this._inUseClients.length=0,(0,i.h)(this)}invoke(e,t,r){return this.apply(e,[t],r)}apply(e,t,r){const s=(0,n.Tw)();(1===r?.jobPriority?this._ongoingLowPriorityJobsQueue:this._ongoingJobsQueue).push({methodName:e,data:t,invokeOptions:r,resolver:s});for(let e=0;e<this._clientPromises.length;e++){const t=this._clients[e];t?t.jobAdded():this._clientPromises[e].then(e=>e?.jobAdded())}return s.promise}createInvokeProxy(e){return(0,a.L)(this,e)}on(e,t){return Promise.all(this._clientPromises).then(()=>(0,s.vE)(this._clients.map(r=>r.on(e,t))))}openPorts(){return new Promise(e=>{const t=new Array(this._clientPromises.length);let r=t.length;for(let s=0;s<this._clientPromises.length;++s)this._clientPromises[s].then(n=>{n&&(t[s]=n.openPort()),0===--r&&e(t)})})}get test(){}}},18047:(e,t,r)=>{r.d(t,{Up:()=>l,ZV:()=>c,yx:()=>a});var s=r(73444);const n={ar:"ar-u-nu-latn",bs:"sr-Latn-CS",nn:"no-NN"};let o=new WeakMap,i={};function a(e={}){const t={};return null!=e.digitSeparator&&(t.useGrouping=e.digitSeparator),null!=e.places&&(t.minimumFractionDigits=t.maximumFractionDigits=e.places),t}function l(e){const{minimumFractionDigits:t,maximumFractionDigits:r,useGrouping:s}=e;return{minimumFractionDigits:t,maximumFractionDigits:r,useGrouping:"auto"===s?"auto":"always"===s}}function c(e,t){return Object.is(e,-0)&&(e=0),function(e){const t=e||i;if(!o.has(t)){const r=(0,s.lR)(),i=r&&n[r]||(0,s.QC)();o.set(t,new Intl.NumberFormat(i,e))}return o.get(t)}(t).format(e)}(0,s.Ml)(()=>{o=new WeakMap,i={}}),new Map},29953:(e,t,r)=>{r.d(t,{ho:()=>W});var s=r(49186),n=r(44208),o=r(74887),i=r(10382),a=r(72457),l=r(61322),c=r(53966),u=r(97768),h=r(11254),d=r(84952);const f={async request(e,t){const r=e.options,s=r.responseType;r.signal=t?.signal,r.responseType="native"===s||"native-request-init"===s?"native-request-init":s&&["blob","json","text"].includes(s)&&(0,d.sC)(e.url)?.after?s:"array-buffer";const n=await(0,h.A)(e.url,r),o={data:n.data,httpStatus:n.httpStatus,ssl:n.ssl};switch(n.requestOptions?.responseType){case"native-request-init":return delete o.data.signal,o;case"blob":o.data=await o.data.arrayBuffer();break;case"json":o.data=(new TextEncoder).encode(JSON.stringify(o.data)).buffer;break;case"text":o.data=(new TextEncoder).encode(o.data).buffer}return{result:o,transferList:[o.data]}}};var g=r(8341),m=r(2741),p=r(92602),b=r(79783),w=r(70333);r(87811);const y={};var k=r(26390);class _{constructor(){const e=document.createDocumentFragment();["addEventListener","dispatchEvent","removeEventListener"].forEach(t=>{this[t]=(...r)=>e[t](...r)})}}class v{constructor(){this._dispatcher=new _,this._workerPostMessage({type:g.Go.HANDSHAKE})}terminate(){}get onmessage(){return this._onmessageHandler}set onmessage(e){this._onmessageHandler&&this.removeEventListener("message",this._onmessageHandler),this._onmessageHandler=e,e&&this.addEventListener("message",e)}get onmessageerror(){return this._onmessageerrorHandler}set onmessageerror(e){this._onmessageerrorHandler&&this.removeEventListener("messageerror",this._onmessageerrorHandler),this._onmessageerrorHandler=e,e&&this.addEventListener("messageerror",e)}get onerror(){return this._onerrorHandler}set onerror(e){this._onerrorHandler&&this.removeEventListener("error",this._onerrorHandler),this._onerrorHandler=e,e&&this.addEventListener("error",e)}postMessage(e){(0,k.d)(()=>{this._workerMessageHandler(new MessageEvent("message",{data:e}))})}dispatchEvent(e){return this._dispatcher.dispatchEvent(e)}addEventListener(e,t,r){this._dispatcher.addEventListener(e,t,r)}removeEventListener(e,t,r){this._dispatcher.removeEventListener(e,t,r)}_workerPostMessage(e){(0,k.d)(()=>{this.dispatchEvent(new MessageEvent("message",{data:e}))})}async _workerMessageHandler(e){const t=(0,g.VI)(e);if(t&&t.type===g.Go.OPEN){const{modulePath:e,jobId:r}=t;let s=await l.default.loadWorker(e);s||(s=await import(e));const n=l.default.connect(s);this._workerPostMessage({type:g.Go.OPENED,jobId:r,data:n})}}}var A=r(18357);const P=()=>c.A.getLogger("esri.core.workers.workerFactory"),{HANDSHAKE:E}=g.Go;let L,N;const O="Failed to create Worker. Fallback to execute module in main thread";async function C(e){return new Promise(t=>{function r(n){const o=(0,g.VI)(n);o&&o.type===E&&(e.removeEventListener("message",r),e.removeEventListener("error",s),t(e))}function s(t){t.preventDefault(),e.removeEventListener("message",r),e.removeEventListener("error",s),P().warn("Failed to create Worker. Fallback to execute module in main thread",t),(e=new v).addEventListener("message",r),e.addEventListener("error",s)}e.addEventListener("message",r),e.addEventListener("error",s)})}let I=0;const{ABORT:j,INVOKE:M,OPEN:J,OPENED:S,RESPONSE:R}=g.Go;class x{static async create(e){const t=await async function(){if(!(0,n.A)("esri-workers"))return C(new v);if(!L&&!N)try{const e='"use strict";let globalId=0;const outgoing=new Map,configuration={CONFIGURATION};self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}self.invokeStaticMessage=(e,o,r)=>{const t=r&&r.signal,n=globalId++;let s=null;return new Promise((r,i)=>{if(t){if(t.aborted)return i(createAbortError());s=()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:5,jobId:n}),i(createAbortError()))},t.addEventListener("abort",s)}outgoing.set(n,{resolve:r,reject:i}),self.postMessage({type:4,jobId:n,methodName:e,abortable:null!=t,data:o})}).finally(()=>{t&&t.removeEventListener("abort",s)})};let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,fullVersion:r}=configuration.kernelInfo,{revision:t,fullVersion:n,version:s}=e.kernelInfo;esriConfig.assetsPath!==esriConfig.defaultAssetsPath&&o!==t&&console.warn(`Version mismatch detected between ArcGIS Maps SDK for JavaScript modules and assets. For more information visit https://esriurl.com/using-local-assets.\nModules version: ${r}\nAssets version: ${n??s}\nAssets path: ${esriConfig.assetsPath}`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case 1:let t;function n(e){const o=t.connect(e);self.postMessage({type:2,jobId:r,data:o},[o])}"function"==typeof define&&define.amd?require([workerPath],e=>{t=e.default||e,checkWorkerRevision(t),t.loadWorker(o.modulePath).then(e=>e||new Promise(e=>{require([o.modulePath],e)})).then(n)}):"System"in self&&"function"==typeof System.import?System.import(workerPath).then(e=>(t=e.default,checkWorkerRevision(t),t.loadWorker(o.modulePath))).then(e=>e||System.import(o.modulePath)).then(n):esriConfig.workers.useDynamicImport?import(workerPath).then(e=>{t=e.default||e,checkWorkerRevision(t),t.loadWorker(o.modulePath).then(e=>e||import(o.modulePath)).then(n)}):(self.RemoteClient||importScripts(workerPath),t=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(t),t.loadWorker(o.modulePath).then(n));break;case 3:if(outgoing.has(r)){const s=outgoing.get(r);outgoing.delete(r),o.error?s.reject(JSON.parse(o.error)):s.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});'.split("{CONFIGURATION}").join(function(){let e;if(null!=p.A.default){const t={...p.A};delete t.default,e=JSON.parse(JSON.stringify(t))}else e=JSON.parse(JSON.stringify(p.A));e.assetsPath=(0,d.s2)(e.assetsPath),e.defaultAssetsPath=e.defaultAssetsPath?(0,d.s2)(e.defaultAssetsPath):void 0,e.request.interceptors=[],e.log.interceptors=[],e.locale=(0,b.JK)(),e.has={"esri-csp-restrictions":(0,n.A)("esri-csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":(0,n.A)("esri-2d-update-debug"),"esri-2d-log-updating":(0,n.A)("esri-2d-log-updating"),"featurelayer-pbf":(0,n.A)("featurelayer-pbf"),"featurelayer-fast-triangulation-enabled":(0,n.A)("featurelayer-fast-triangulation-enabled"),"featurelayer-simplify-thresholds":(0,n.A)("featurelayer-simplify-thresholds"),"featurelayer-simplify-payload-size-factors":(0,n.A)("featurelayer-simplify-payload-size-factors"),"featurelayer-simplify-mobile-factor":(0,n.A)("featurelayer-simplify-mobile-factor"),"featurelayer-query-max-depth":(0,n.A)("featurelayer-query-max-depth"),"featurelayer-query-tile-max-features":(0,n.A)("featurelayer-query-tile-max-features"),"featurelayer-query-tile-concurrency":(0,n.A)("featurelayer-query-tile-concurrency"),"featurelayer-query-pausing-enabled":(0,n.A)("featurelayer-query-pausing-enabled"),"featurelayer-snapshot-concurrency":(0,n.A)("featurelayer-snapshot-concurrency"),"featurelayer-snapshot-enabled":(0,n.A)("featurelayer-snapshot-enabled"),"parquetlayer-full-query-feature-count":(0,n.A)("parquetlayer-full-query-feature-count"),"esri-atomics":(0,n.A)("esri-atomics"),"esri-shared-array-buffer":(0,n.A)("esri-shared-array-buffer"),"esri-tiles-debug":(0,n.A)("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":(0,n.A)("esri-workers-arraybuffer-transfer"),"feature-polyline-generalization-factor":(0,n.A)("feature-polyline-generalization-factor"),"host-webworker":1},e.workers.loaderUrl&&(e.workers.loaderUrl=(0,d.s2)(e.workers.loaderUrl)),e.workers.workerPath?e.workers.workerPath=(0,d.s2)(e.workers.workerPath):e.workers.workerPath=(0,d.s2)((0,m.s)("esri/core/workers/RemoteClient.js")),e.workers.useDynamicImport=(0,n.A)("esri-esbuild-build");const t=p.A.workers.loaderConfig,r=function(e){const t={async:e.async,isDebug:e.isDebug,locale:e.locale,baseUrl:e.baseUrl,has:{...e.has},map:{...e.map},packages:e.packages?.slice()||[],paths:{...y.paths,...e.paths}};return e.hasOwnProperty("async")||(t.async=!0),e.hasOwnProperty("isDebug")||(t.isDebug=!1),e.baseUrl||(t.baseUrl=y.baseUrl),t}({baseUrl:t?.baseUrl,locale:(0,b.JK)(),has:{"csp-restrictions":1,"dojo-test-sniff":0,"host-webworker":1,...t?.has},map:{...t?.map},paths:{...t?.paths},packages:t?.packages||[]}),s={buildDate:A.$,fullVersion:w.ol,revision:A.u};return JSON.stringify({esriConfig:e,loaderConfig:r,kernelInfo:s})}());L=URL.createObjectURL(new Blob([e],{type:"text/javascript"}))}catch(e){N=e||{}}let e;if(L)try{e=new Worker(L,{name:"esri-worker-"+I++})}catch(t){P().warn(O,N),e=new v}else P().warn(O,N),e=new v;return C(e)}();return new x(t,e)}constructor(e,t){this._outJobs=new Map,this._inJobs=new Map,this.worker=e,this.id=t,e.addEventListener("message",this._onMessage.bind(this)),e.addEventListener("error",e=>{e.preventDefault(),c.A.getLogger("esri.core.workers.WorkerOwner").error(e)})}terminate(){this.worker.terminate()}async open(e,t={}){const{signal:r}=t,s=(0,g.Jc)();return new Promise((t,n)=>{const i={resolve:t,reject:n,abortHandle:(0,o.NY)(r,()=>{this._outJobs.delete(s),this._post({type:j,jobId:s})})};this._outJobs.set(s,i),this._post({type:J,jobId:s,modulePath:e})})}_onMessage(e){const t=(0,g.VI)(e);if(t)switch(t.type){case S:this._onOpenedMessage(t);break;case R:this._onResponseMessage(t);break;case j:this._onAbortMessage(t);break;case M:this._onInvokeMessage(t)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,s=t.get(r);s&&(s.controller&&s.controller.abort(),t.delete(r))}_onInvokeMessage(e){const{methodName:t,jobId:r,data:s,abortable:n}=e,i=n?new AbortController:null,a=this._inJobs,l=f[t];let c;try{if("function"!=typeof l)throw new TypeError(`${t} is not a function`);c=l.call(null,s,{signal:i?i.signal:null})}catch(e){return void this._post({type:R,jobId:r,error:(0,g.mF)(e)})}(0,o.$X)(c)?(a.set(r,{controller:i,promise:c}),c.then(e=>{a.has(r)&&(a.delete(r),this._post({type:R,jobId:r},e))},e=>{a.has(r)&&(a.delete(r),e||(e={message:"Error encountered at method"+t}),(0,o.zf)(e)||this._post({type:R,jobId:r,error:(0,g.mF)(e||{message:`Error encountered at method ${t}`})}))})):this._post({type:R,jobId:r},c)}_onOpenedMessage(e){const{jobId:t,data:r}=e,s=this._outJobs.get(t);s&&(this._outJobs.delete(t),(0,u.xt)(s.abortHandle),s.resolve(r))}_onResponseMessage(e){const{jobId:t,error:r,data:n}=e,o=this._outJobs.get(t);o&&(this._outJobs.delete(t),(0,u.xt)(o.abortHandle),r?o.reject(s.A.fromJSON(JSON.parse(r))):o.resolve(n))}_post(e,t,r){return(0,g.u1)(this.worker,e,t,r)}}const q=(0,n.A)("host-browser")?Math.min(navigator.hardwareConcurrency-1,(0,n.A)("workers-pool-size")??8):0;let U=(0,n.A)("esri-mobile")?Math.min(q,3):q;U||(U=(0,n.A)("safari")&&(0,n.A)("mac")?7:2);let H=0;const D=[];async function $(e,t){const r=new i.A,{registryTarget:s,...n}=t;return await r.open(e,n),s&&(0,a.k)(s,r),r}async function W(e,t={}){if("string"!=typeof e)throw new s.A("workers:undefined-module","modulePath is missing");let r=t.strategy||"distributed";if((0,n.A)("host-webworker")&&!(0,n.A)("esri-workers")&&(r="local"),"local"===r){let r=await l.default.loadWorker(e);r||(r=await import(e)),(0,o.Te)(t.signal);const s=t.client||r;return $([l.default.connect(r,t.schedule)],{...t,client:s})}if(await async function(){if(T)return T;F=new AbortController;const e=[];for(let t=0;t<U;t++){const r=x.create(t).then(e=>(D[t]=e,e));e.push(r)}return T=Promise.all(e),T}(),(0,o.Te)(t.signal),"dedicated"===r){const r=H++%U;return $([await D[r].open(e,t)],t)}if(t.maxNumWorkers&&t.maxNumWorkers>0){const r=Math.min(t.maxNumWorkers,U);if(r<U){const s=new Array(r);for(let n=0;n<r;++n){const r=H++%U;s[n]=D[r].open(e,t)}return $(s,t)}}return $(D.map(r=>r.open(e,t)),t)}let F,T=null},72457:(e,t,r)=>{r.d(t,{h:()=>o,k:()=>n});const s=new FinalizationRegistry(e=>{e.close()});function n(e,t){s.register(e,t,t)}function o(e){s.unregister(e)}},79783:(e,t,r)=>{r.d(t,{ud:()=>k,JK:()=>_,oQ:()=>v,V2:()=>P});var s=r(2741),n=r(97770),o=r(73444),i=r(10838),a=r(18047),l=r(53966),c=r(93637),u=r(799);const h=()=>l.A.getLogger("esri.intl.substitute");function d(e,t){switch(t.type){case"date":return(0,n.Yq)(e,t.intlOptions);case"number":return(0,a.ZV)(e,t.intlOptions);default:return h().warn("missing format descriptor for key {key}"),g(e)}}function f(e,t){switch(t.toLowerCase()){case"dateformat":return(0,n.Yq)(e);case"numberformat":return(0,a.ZV)(e);default:return h().warn(`inline format is unsupported since 4.12: ${t}`),/^(dateformat|datestring)/i.test(t)?(0,n.Yq)(e):/^numberformat/i.test(t)?(0,a.ZV)(e):g(e)}}function g(e){switch(typeof e){case"string":return e;case"number":return(0,a.ZV)(e);case"boolean":return""+e;default:return e instanceof Date?(0,n.Yq)(e):""}}var m=r(11254),p=r(49186);async function b(e){if(null!=y.fetchBundleAsset)return y.fetchBundleAsset(e);const t=await(0,m.A)(e,{responseType:"text"});return JSON.parse(t.data)}class w{constructor({base:e="",pattern:t,location:r=new URL(window.location.href)}){let s;s="string"==typeof r?e=>new URL(e,new URL(r,window.location.href)).href:r instanceof URL?e=>new URL(e,r).href:r,this.pattern="string"==typeof t?new RegExp(`^${t}`):t,this.getAssetUrl=s,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)\\/)?(.*)$`)}fetchMessageBundle(e,t){return async function(e,t,r,s){const n=t.exec(r);if(!n)throw new p.A("esri-intl:invalid-bundle",`Bundle id "${r}" is not compatible with the pattern "${t}"`);const o=n[1]?`${n[1]}/`:"",a=n[2],l=(0,i.xO)(s),c=`${o}${a}.json`,u=l?`${o}${a}_${l}.json`:c;let h;try{h=await b(e(u))}catch(t){if(u===c)throw new p.A("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:t});try{h=await b(e(c))}catch(e){throw new p.A("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:e})}}return h}(this.getAssetUrl,this.matcher,e,t)}}const y={},k=i.ud,_=o.JK,v=o.oQ,A=i.ao,P=function(e,t,r={}){const{format:s={}}=r;return(0,u.HC)(e,e=>function(e,t,r){let s,n;const o=e.indexOf(":");if(-1===o?s=e.trim():(s=e.slice(0,o).trim(),n=e.slice(o+1).trim()),!s)return"";const i=(0,c.wc)(s,t);if(null==i)return"";const a=(n?r?.[n]:null)??r?.[s];return a?d(i,a):n?f(i,n):g(i)}(e,t,s))};var E;A((E={pattern:"esri/",location:s.s},new w(E)))}}]);