@arcgis/core 5.2.0-next.62 → 5.2.0-next.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/WebDocument2D.d.ts +17 -1
- package/WebDocument2D.js +1 -1
- package/WebLinkChart.js +1 -1
- package/WebMap.js +1 -1
- package/WebScene.js +1 -1
- package/arcade/Feature.js +1 -1
- package/arcade/ImmutableArray.js +1 -1
- package/arcade/ImmutablePathArray.js +1 -1
- package/arcade/ImmutablePointArray.js +1 -1
- package/arcade/Pixel.js +1 -1
- package/arcade/Voxel.js +1 -1
- package/arcade/arcadeAsyncRuntime.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/arcadeRuntime.js +1 -1
- package/arcade/containerUtils.js +1 -1
- package/arcade/debug.js +1 -1
- package/arcade/deepClone.js +1 -1
- package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/arcade/functions/convertdirection.js +1 -1
- package/arcade/functions/date.js +1 -1
- package/arcade/functions/feature.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/functions/featuresetgeom.js +1 -1
- package/arcade/functions/featuresetstats.js +1 -1
- package/arcade/functions/featuresetstring.js +1 -1
- package/arcade/functions/fieldStats.js +1 -1
- package/arcade/functions/geomasync.js +1 -1
- package/arcade/functions/geometry.js +1 -1
- package/arcade/functions/geomsync.js +1 -1
- package/arcade/functions/knowledgegraph.js +1 -1
- package/arcade/functions/maths.js +1 -1
- package/arcade/functions/stats.js +1 -1
- package/arcade/functions/string.js +1 -1
- package/arcade/functions/track.js +1 -1
- package/arcade/geometry/functions.js +1 -1
- package/arcade/languageUtils.js +1 -1
- package/arcade.js +1 -1
- package/arcgisGlobal.d.ts +14 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{44e64186318728d1be51.js → 067b00498ae85f635f60.js} +1 -1
- package/assets/esri/core/workers/chunks/0977f4d77c36175c2895.js +1 -0
- package/assets/esri/core/workers/chunks/09c43bcb09aad02e83a9.js +1 -0
- package/assets/esri/core/workers/chunks/0b20f92bae2b4c40d299.js +1 -0
- package/assets/esri/core/workers/chunks/0c3c311400ee352187ea.js +1 -0
- package/assets/esri/core/workers/chunks/0c582abc8d25249eb530.js +1 -0
- package/assets/esri/core/workers/chunks/0d6776055e9b34c14151.js +1 -0
- package/assets/esri/core/workers/chunks/0d7d54e74b5639a0be6e.js +1 -0
- package/assets/esri/core/workers/chunks/0da5b27b070ab780f8b3.js +1 -0
- package/assets/esri/core/workers/chunks/0e6b6fcc55cc43ede1fc.js +1 -0
- package/assets/esri/core/workers/chunks/{bcb5017500d144b73908.js → 126f1f6b355723db6c4f.js} +1 -1
- package/assets/esri/core/workers/chunks/12a64eca4c571926d9d4.js +1 -0
- package/assets/esri/core/workers/chunks/{b2c0262c4a76b8a86200.js → 149284464115981694ff.js} +1 -1
- package/assets/esri/core/workers/chunks/1642fa1263d8f4a45101.js +1 -0
- package/assets/esri/core/workers/chunks/1840d74ebae777a0200b.js +1 -0
- package/assets/esri/core/workers/chunks/19bf6826e7d9a4d52035.js +1 -0
- package/assets/esri/core/workers/chunks/1bfbdec791e19f5a2534.js +1 -0
- package/assets/esri/core/workers/chunks/1d8280f63a6698e74f20.js +1 -0
- package/assets/esri/core/workers/chunks/{1b68b1b724ad30396723.js → 2426601b8cae7f06af4d.js} +1 -1
- package/assets/esri/core/workers/chunks/{a12803108c3b12808698.js → 242cad472fbc38b24dbc.js} +2 -2
- package/assets/esri/core/workers/chunks/25197ecb324d6f08e03e.js +1 -0
- package/assets/esri/core/workers/chunks/253c231b5a52f1d2d3a5.js +1 -0
- package/assets/esri/core/workers/chunks/25999b6f96ec305a7679.js +1 -0
- package/assets/esri/core/workers/chunks/259bdacfb7b0f866a8d0.js +1 -0
- package/assets/esri/core/workers/chunks/28565756f884d0851003.js +1 -0
- package/assets/esri/core/workers/chunks/2a5a165848413764381b.js +1 -0
- package/assets/esri/core/workers/chunks/2e7a5bb740281ef59199.js +1 -0
- package/assets/esri/core/workers/chunks/{285a5bd708f0fe1c620c.js → 2ea3ca68cfa4d34e8f3b.js} +1 -1
- package/assets/esri/core/workers/chunks/2f87a49bdd00f899d81d.js +1 -0
- package/assets/esri/core/workers/chunks/{37a95f097533bad1b338.js → 302d91b7c480c6c9304b.js} +1 -1
- package/assets/esri/core/workers/chunks/{3d6d2b42ba2ad7086d5d.js → 3b493e8043ec1a2a5d96.js} +1 -1
- package/assets/esri/core/workers/chunks/40e48b720d89cd067892.js +1 -0
- package/assets/esri/core/workers/chunks/{a833fc9250635eb4152f.js → 41f7f3615d3ecb87c59a.js} +1 -1
- package/assets/esri/core/workers/chunks/{17acbf40e7c1cb42d9bd.js → 44b1cdf28269b4fa8a39.js} +1 -1
- package/assets/esri/core/workers/chunks/44e8cd4b3dad777ab0c9.js +1 -0
- package/assets/esri/core/workers/chunks/{95b3b8fe45ef4ac6b277.js → 450bc48a7389607bce1e.js} +1 -1
- package/assets/esri/core/workers/chunks/465a050fd838ee8eddf3.js +1 -0
- package/assets/esri/core/workers/chunks/46d8a1d6f7341ad20749.js +1 -0
- package/assets/esri/core/workers/chunks/4710f21b138a2c9a0345.js +1 -0
- package/assets/esri/core/workers/chunks/48a0dfaabb9b4bce4191.js +1 -0
- package/assets/esri/core/workers/chunks/49a3888bf9e2481642ac.js +1 -0
- package/assets/esri/core/workers/chunks/{4ee900e5dbb130fa0c7b.js → 4a40b894ec89b0a4f9bf.js} +1 -1
- package/assets/esri/core/workers/chunks/{d847c3cb2043a983145b.js → 4addea2e35b0c845743e.js} +1 -1
- package/assets/esri/core/workers/chunks/{e0a4d0288abd334b0673.js → 4ae626868e14bedd7fc5.js} +1 -1
- package/assets/esri/core/workers/chunks/529ee4670940720e888b.js +1 -0
- package/assets/esri/core/workers/chunks/{a3c882fe7599dc0f4f27.js → 59d1708ae13c6e7e6e55.js} +1 -1
- package/assets/esri/core/workers/chunks/59dd83e5aee2908c7eca.js +1 -0
- package/assets/esri/core/workers/chunks/5dbd8ca7e7b8eb9a0bf7.js +1 -0
- package/assets/esri/core/workers/chunks/{b8bdacebd4d24ba90f3f.js → 5fde1234c5cccaee6763.js} +1 -1
- package/assets/esri/core/workers/chunks/60f9b37dd738d884c48d.js +1 -0
- package/assets/esri/core/workers/chunks/6123894e2ae9233cdf89.js +1 -0
- package/assets/esri/core/workers/chunks/62c8413f3bbc1378273d.js +1 -0
- package/assets/esri/core/workers/chunks/6501ee40bf25f9f75d02.js +1 -0
- package/assets/esri/core/workers/chunks/663cf8bff17c894cd5f8.js +1 -0
- package/assets/esri/core/workers/chunks/6b536d03b4bef408035b.js +1 -0
- package/assets/esri/core/workers/chunks/6c98a64d92c9bca78203.js +1 -0
- package/assets/esri/core/workers/chunks/6d1371b521c7f94fd77e.js +1 -0
- package/assets/esri/core/workers/chunks/6d5038d4351fe29e2718.js +1 -0
- package/assets/esri/core/workers/chunks/6f102c90908c9900cdaa.js +1 -0
- package/assets/esri/core/workers/chunks/6f39545710d1b35d922c.js +1 -0
- package/assets/esri/core/workers/chunks/7278fdf6bfcdffa10a7f.js +1 -0
- package/assets/esri/core/workers/chunks/72eb0ac55026a4f5d6a7.js +1 -0
- package/assets/esri/core/workers/chunks/73cb499d7d68c59ba34e.js +1 -0
- package/assets/esri/core/workers/chunks/{b8d788e110c212a879ab.js → 73f228d966b89c73c9e9.js} +1 -1
- package/assets/esri/core/workers/chunks/{e7402dfd683f82878360.js → 752343d92ed48e674351.js} +1 -1
- package/assets/esri/core/workers/chunks/7538a0fe0cec3156769e.js +1 -0
- package/assets/esri/core/workers/chunks/76bccc318d7cc33829a7.js +1 -0
- package/assets/esri/core/workers/chunks/771ead806efbe9c91fdc.js +1 -0
- package/assets/esri/core/workers/chunks/777eafdb86b26b35c803.js +1 -0
- package/assets/esri/core/workers/chunks/7821aeba3e414b318a75.js +1 -0
- package/assets/esri/core/workers/chunks/78b80da3bbc1b608fe83.js +1 -0
- package/assets/esri/core/workers/chunks/7b531feba4fd662575f9.js +1 -0
- package/assets/esri/core/workers/chunks/7c57354d026e27e056d4.js +1 -0
- package/assets/esri/core/workers/chunks/7d163d9d90393e491ee5.js +1 -0
- package/assets/esri/core/workers/chunks/7d4c65311064a5c2e0b1.js +1 -0
- package/assets/esri/core/workers/chunks/{0474af7687466d8befd2.js → 7e2794705b4e679fcb3f.js} +1 -1
- package/assets/esri/core/workers/chunks/7ebbb90d80600d9ba889.js +1 -0
- package/assets/esri/core/workers/chunks/7f125963555dc1ce63ad.js +1 -0
- package/assets/esri/core/workers/chunks/{763cbb6716e398436a6d.js → 7f6eee102871769fdf8f.js} +1 -1
- package/assets/esri/core/workers/chunks/805c97b875d3066fb8df.js +1 -0
- package/assets/esri/core/workers/chunks/8566449c39eba55147f5.js +1 -0
- package/assets/esri/core/workers/chunks/86ed75b7169b8ee43025.js +1 -0
- package/assets/esri/core/workers/chunks/{9482a6d7baa24bbf5693.js → 89132395eca329b9ab92.js} +1 -1
- package/assets/esri/core/workers/chunks/{28bc5e8e82f188b30eb9.js → 894343e415639df88243.js} +1 -1
- package/assets/esri/core/workers/chunks/8b4759cef5ae5e43253b.js +1 -0
- package/assets/esri/core/workers/chunks/8ba4175f5e9a24ffecf7.js +1 -0
- package/assets/esri/core/workers/chunks/8be707044d992ef5f1d8.js +1 -0
- package/assets/esri/core/workers/chunks/{bd862382f72ebd446b46.js → 8d2cac1952e817daaf1f.js} +1 -1
- package/assets/esri/core/workers/chunks/8e1d4867406753c5483c.js +1 -0
- package/assets/esri/core/workers/chunks/8e38c5e63aae42bdf5a4.js +29 -0
- package/assets/esri/core/workers/chunks/{02ab09285a5c4ca98066.js → 8f785b722b1a131bf370.js} +1 -1
- package/assets/esri/core/workers/chunks/8f9874f42f21a4cb3acd.js +1 -0
- package/assets/esri/core/workers/chunks/90f4b81c6034253b70d7.js +1 -0
- package/assets/esri/core/workers/chunks/917c11cb40a7742d7f98.js +1 -0
- package/assets/esri/core/workers/chunks/93ab247ff34694ac60eb.js +1 -0
- package/assets/esri/core/workers/chunks/{6e45d0db97ffa4509177.js → 94bf7f0da6ad3f7ea277.js} +1 -1
- package/assets/esri/core/workers/chunks/{580451761cadfe308919.js → 9954149def644c371894.js} +1 -1
- package/assets/esri/core/workers/chunks/9c57161ad48d8d546dc7.js +1 -0
- package/assets/esri/core/workers/chunks/{33bd9785bd0b6ccef21b.js → 9c5dff4f13102871786e.js} +1 -1
- package/assets/esri/core/workers/chunks/9d0bda096cdbd7e22f4b.js +1 -0
- package/assets/esri/core/workers/chunks/9dfb7d120195991e9672.js +1 -0
- package/assets/esri/core/workers/chunks/9ed5e6b06afea6c85330.js +1 -0
- package/assets/esri/core/workers/chunks/9f65cc6d9f7390bb1d5b.js +1 -0
- package/assets/esri/core/workers/chunks/{79b857bb301f9c4169d6.js → 9fee8441fbac9f723f77.js} +1 -1
- package/assets/esri/core/workers/chunks/a108f276659d5f25352c.js +1 -0
- package/assets/esri/core/workers/chunks/a2d8bc0efddd2e13b1ad.js +1 -0
- package/assets/esri/core/workers/chunks/{b32ede7805c7c6644e4c.js → a3bf8aa81ee398da5b52.js} +1 -1
- package/assets/esri/core/workers/chunks/{5b30231ae0a8f4b8435f.js → a504fa17d83facf1c01f.js} +1 -1
- package/assets/esri/core/workers/chunks/{538fe46dfd685a490e23.js → a7f42ada0aa69873a938.js} +1 -1
- package/assets/esri/core/workers/chunks/a97e0b9b057664911c14.js +1 -0
- package/assets/esri/core/workers/chunks/{cb58aff1ff186fa18345.js → a9f616f22042b0dce8b9.js} +1 -1
- package/assets/esri/core/workers/chunks/{128799741dd3c6fc69b9.js → ac4131121230cfc14f21.js} +1 -1
- package/assets/esri/core/workers/chunks/afd63c18ce4656271c8e.js +1 -0
- package/assets/esri/core/workers/chunks/{f04cb48fc73635d0572f.js → b059dabb1c732829487c.js} +1 -1
- package/assets/esri/core/workers/chunks/b13d2da33ec07e9d41ff.js +1 -0
- package/assets/esri/core/workers/chunks/b313464b987db8a3987a.js +1 -0
- package/assets/esri/core/workers/chunks/b318823aefcefad6fad5.js +1 -0
- package/assets/esri/core/workers/chunks/b378e504a5b1afc8d0ce.js +1 -0
- package/assets/esri/core/workers/chunks/{9fb87a7dba62b527c0ba.js → b3a1a93c6dc9247cb048.js} +1 -1
- package/assets/esri/core/workers/chunks/b5397dc03fa0bd654ba6.js +1 -0
- package/assets/esri/core/workers/chunks/b5b698008b8f3f4d5d61.js +1 -0
- package/assets/esri/core/workers/chunks/b7bcb31737b01d7736d0.js +1 -0
- package/assets/esri/core/workers/chunks/b9a1046ca2cd0cca5da5.js +1 -0
- package/assets/esri/core/workers/chunks/{cda04571d7623c17ada2.js → b9c7aa04861f545a559c.js} +1 -1
- package/assets/esri/core/workers/chunks/{7df795bc4fa1d433463b.js → ba030767cf935f967454.js} +1 -1
- package/assets/esri/core/workers/chunks/{53d165b4f30fd64e5d8a.js → bd311c85437743cf7d2f.js} +1 -1
- package/assets/esri/core/workers/chunks/bd88228f781a0399d8bd.js +1 -0
- package/assets/esri/core/workers/chunks/bfb626805405646a0419.js +1 -0
- package/assets/esri/core/workers/chunks/{61d3fcb419d6bf7e355e.js → c1e45e24f5ef719a714c.js} +18 -18
- package/assets/esri/core/workers/chunks/c203df41f9d2e4b80889.js +1 -0
- package/assets/esri/core/workers/chunks/{278409028bc5af45b507.js → c4c83b5129c279c3615b.js} +1 -1
- package/assets/esri/core/workers/chunks/c53b2be005721591e29b.js +1 -0
- package/assets/esri/core/workers/chunks/c6ef0636073e28350c91.js +1 -0
- package/assets/esri/core/workers/chunks/c7e391df714839484cd1.js +1 -0
- package/assets/esri/core/workers/chunks/{e287113777a94ded8de6.js → c82ab4f0908290e70ee9.js} +1 -1
- package/assets/esri/core/workers/chunks/cded485ad893a7dd2948.js +1 -0
- package/assets/esri/core/workers/chunks/{1cf8fb704c48ac3d3b15.js → cf360767310fb45660a8.js} +1 -1
- package/assets/esri/core/workers/chunks/{8f2fecd8a0a972d68590.js → cf8ce63711488f2e677c.js} +1 -1
- package/assets/esri/core/workers/chunks/d214ac457ac970479536.js +1 -0
- package/assets/esri/core/workers/chunks/d4058352db1e8255b52e.js +1 -0
- package/assets/esri/core/workers/chunks/d456520e4b119a2816b6.js +1 -0
- package/assets/esri/core/workers/chunks/d4d385d19e62ef1c286f.js +1 -0
- package/assets/esri/core/workers/chunks/d4f005dadba75422b401.js +1 -0
- package/assets/esri/core/workers/chunks/{52c4b4dabcb0d162be72.js → d5e15021928e95c11463.js} +1 -1
- package/assets/esri/core/workers/chunks/{fc639c730115e07a4a1a.js → d6500f6b2ff115d9eb09.js} +1 -1
- package/assets/esri/core/workers/chunks/e02f02040b63d9c2e654.js +1 -0
- package/assets/esri/core/workers/chunks/e08c64e4ae5a68eae2be.js +1 -0
- package/assets/esri/core/workers/chunks/e1492d2404c3ed82931e.js +1 -0
- package/assets/esri/core/workers/chunks/e2ddfc96ddba92302e0c.js +1 -0
- package/assets/esri/core/workers/chunks/e34ed3b818b2eb4116c5.js +1 -0
- package/assets/esri/core/workers/chunks/e7149d23615fee31ab7e.js +1 -0
- package/assets/esri/core/workers/chunks/ec774f5d6ea5c29536e5.js +1 -0
- package/assets/esri/core/workers/chunks/{35cbf00f0c37a86517af.js → ed1de8b7406269e217b9.js} +1 -1
- package/assets/esri/core/workers/chunks/ed4ac5568dc2815b066d.js +1 -0
- package/assets/esri/core/workers/chunks/ed71a4e353715db0a6e9.js +1 -0
- package/assets/esri/core/workers/chunks/{f4891345507df63cff3c.js → ef27bf1d7941ae265ca4.js} +3 -3
- package/assets/esri/core/workers/chunks/f029c12f1afee0e9b2a1.js +1 -0
- package/assets/esri/core/workers/chunks/{1e342d532925569daadb.js → f475672ff4c2ec9367c2.js} +1 -1
- package/assets/esri/core/workers/chunks/{cc414fd2e313d89d524d.js → f54eba484f40d5eeb590.js} +1 -1
- package/assets/esri/core/workers/chunks/f5c9659fc5d571d501c9.js +1 -0
- package/assets/esri/core/workers/chunks/f622b27ebdf1c918fd6d.js +1 -0
- package/assets/esri/core/workers/chunks/{dd95f50dac3f33cdb6d2.js → f6a13f07a5f7b781a9a8.js} +1 -1
- package/assets/esri/core/workers/chunks/{d849bdaf5bdfdc37531a.js → f6f7d885b4d6080e3f58.js} +1 -1
- package/assets/esri/core/workers/chunks/f8b8d3d2710c83acccf3.js +1 -0
- package/assets/esri/core/workers/chunks/f95870bb4d8e4e13e69e.js +1 -0
- package/assets/esri/core/workers/chunks/fa377112ef3b78f6ed18.js +1 -0
- package/assets/esri/core/workers/chunks/fa59f10ed0f182a2a7f3.js +1 -0
- package/assets/esri/core/workers/chunks/faa55265020591fd2224.js +1 -0
- package/assets/esri/core/workers/chunks/fc827f58db3194922056.js +1 -0
- package/chunks/VolumeMask.glsl.js +3 -0
- package/chunks/_commonjsHelpers.js +1 -1
- package/chunks/aiServices.js +1 -1
- package/chunks/array.js +1 -1
- package/chunks/languageUtils.js +1 -1
- package/chunks/persistableUrlUtils.js +1 -1
- package/config.js +1 -1
- package/core/Collection.d.ts +42 -6
- package/core/Collection.js +1 -1
- package/form/ExpressionInfo.d.ts +1 -1
- package/form/ExpressionInfo.js +1 -1
- package/form/elements/FieldElement.d.ts +3 -2
- package/form/elements/inputs/ComboBoxInput.d.ts +4 -15
- package/form/elements/inputs/ComboBoxInput.js +1 -1
- package/form/elements/inputs/DynamicChoiceInput.d.ts +31 -0
- package/form/elements/inputs/DynamicChoiceInput.js +2 -0
- package/form/elements/inputs/Input.d.ts +1 -1
- package/form/elements/inputs/RadioButtonsInput.d.ts +4 -15
- package/form/elements/inputs/RadioButtonsInput.js +1 -1
- package/form/elements/inputs/SingleChoiceInput.d.ts +18 -0
- package/form/elements/inputs/SingleChoiceInput.js +2 -0
- package/form/elements/inputs.d.ts +11 -2
- package/form/elements/inputs.js +1 -1
- package/geometry/SpatialReference.d.ts +1 -4
- package/geometry/support/normalizeUtils.d.ts +1 -1
- package/kernel.js +1 -1
- package/layers/BaseElevationLayer.js +1 -1
- package/layers/ElevationLayer.js +1 -1
- package/layers/ImageryTileLayer.d.ts +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/KnowledgeGraphLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/RouteLayer.d.ts +1 -1
- package/layers/StreamLayer.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/graphics/sources/connections/createConnection.js +1 -1
- package/layers/graphics/sources/parquet/ParquetFileStatistics.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/mixins/ArcGISImageService.d.ts +24 -24
- package/layers/mixins/SceneService.js +1 -1
- package/layers/mixins/TiledImagery.d.ts +1 -1
- package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
- package/layers/raster/datasets/BaseRaster.js +1 -1
- package/layers/save/groupLayerUtils.js +1 -1
- package/layers/save/mediaLayerUtils.js +1 -1
- package/layers/support/ElevationQueryTileCache.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/layers/video/types.d.ts +17 -1
- package/linkChart/LinkChartProperties.js +1 -1
- package/networks/support/CircuitExportJobInfo.d.ts +1 -1
- package/networks/support/CircuitVerifyJobInfo.d.ts +1 -1
- package/networks/support/TopologyValidationJobInfo.d.ts +1 -1
- package/networks/support/TraceJobInfo.d.ts +1 -1
- package/package.json +2 -2
- package/portal/jsonTypes.d.ts +1 -1
- package/portal/support/jsonContext.js +1 -1
- package/rest/closestFacility.d.ts +1 -1
- package/rest/find.d.ts +1 -1
- package/rest/geometryService.d.ts +21 -21
- package/rest/geoprocessor.d.ts +2 -2
- package/rest/identify.d.ts +1 -1
- package/rest/imageService.d.ts +19 -19
- package/rest/lastMileDelivery.d.ts +8 -8
- package/rest/locator.d.ts +4 -4
- package/rest/networkService.d.ts +1 -1
- package/rest/networks/queryAssociations.d.ts +1 -1
- package/rest/networks/synthesizeAssociationGeometries.d.ts +1 -1
- package/rest/networks/trace.d.ts +1 -1
- package/rest/networks/traverseAssociations.d.ts +1 -1
- package/rest/places.d.ts +3 -3
- package/rest/print.d.ts +1 -1
- package/rest/query.d.ts +11 -11
- package/rest/route.d.ts +1 -1
- package/rest/serviceArea.d.ts +1 -1
- package/rest/support/JobInfo.d.ts +5 -5
- package/rest/symbolService.d.ts +1 -1
- package/support/persistableUrlUtils.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/layers/features/sources/strategies/AFeatureLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/FeatureHybridTileLoadStrategy.js +1 -1
- package/views/3d/GroundView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightReshapeTool3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayerConstants.js +1 -1
- package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
- package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatHeaderTexture.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
- package/views/3d/support/hitTest.js +1 -1
- package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
- package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticBVH.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectFixedBVH.js +1 -1
- package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathEvaluate.glsl.js +49 -32
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexInfo.glsl.js +5 -5
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +23 -23
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMask.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillVisualization.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/Intersector.js +1 -1
- package/views/3d/webgl-engine/lib/IntersectorResult.js +1 -1
- package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
- package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
- package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/intersectWithPolygonOffset.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastMaskTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/{CutFillMask.glsl.js → VolumeMask.glsl.js} +1 -1
- package/views/3d/webgl-engine/shaders/VolumeMaskTechnique.js +2 -0
- package/views/draw/support/InteractiveHandle.js +1 -1
- package/views/draw/support/managers/SurfaceManager.js +1 -1
- package/views/interactive/Tooltip.d.ts +3 -3
- package/views/interactive/Tooltip.js +1 -1
- package/views/interactive/options/ElevationOptions.d.ts +20 -0
- package/views/interactive/options/ElevationOptions.js +2 -0
- package/views/interactive/options/LabelOptions.d.ts +74 -0
- package/views/interactive/options/LabelOptions.js +2 -0
- package/views/interactive/options/SnappingOptions.d.ts +157 -0
- package/views/interactive/options/SnappingOptions.js +2 -0
- package/views/interactive/options/TooltipOptions.d.ts +152 -0
- package/views/interactive/options/TooltipOptions.js +2 -0
- package/views/interactive/options/TooltipVisibleElements.d.ts +105 -0
- package/views/interactive/options/TooltipVisibleElements.js +2 -0
- package/views/interactive/options/ValueOptions.d.ts +63 -0
- package/views/interactive/options/ValueOptions.js +2 -0
- package/views/interactive/sketch/SketchLabelOptions.d.ts +7 -9
- package/views/interactive/sketch/SketchLabelOptions.js +1 -1
- package/views/interactive/sketch/SketchTooltipElevationOptions.js +1 -1
- package/views/interactive/sketch/SketchTooltipOptions.d.ts +8 -50
- package/views/interactive/sketch/SketchTooltipOptions.js +1 -1
- package/views/interactive/sketch/SketchTooltipVisibleElements.d.ts +10 -95
- package/views/interactive/sketch/SketchTooltipVisibleElements.js +1 -1
- package/views/interactive/sketch/SketchValueOptions.d.ts +7 -45
- package/views/interactive/sketch/SketchValueOptions.js +1 -1
- package/views/interactive/sketch/Units.d.ts +10 -29
- package/views/interactive/sketch/Units.js +1 -1
- package/views/interactive/snapping/SnappingOptions.d.ts +7 -78
- package/views/interactive/snapping/SnappingOptions.js +1 -1
- package/views/interactive/support/Units.d.ts +33 -0
- package/views/interactive/support/Units.js +2 -0
- package/views/interactive/support/types.d.ts +33 -0
- package/views/interactive/tooltip/types.d.ts +6 -2
- package/webdoc/support/resourceUtils.js +1 -1
- package/webdoc/support/types.d.ts +2 -0
- package/webdoc/support/utils.js +2 -0
- package/webdoc/support/webdocLoadUtils.js +1 -1
- package/webdoc/support/webdocSaveUtils.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/expressions/ArcadeExecutorProvider.js +1 -1
- package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
- package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/BatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
- package/widgets/BatchAttributeForm/rendered-content/RelationshipDetails.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/Grid/Column.d.ts +6 -0
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/support/SelectionList/FeatureItem.d.ts +116 -0
- package/widgets/support/SelectionList/GroupLayerItem.d.ts +94 -0
- package/widgets/support/SelectionList/ItemBase.d.ts +70 -0
- package/widgets/support/SelectionList/LayerItem.d.ts +140 -0
- package/widgets/support/SelectionList/LayerItem.js +1 -1
- package/widgets/support/SelectionList/SelectionListViewModel.d.ts +265 -0
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/widgets/support/SelectionList/types.d.ts +42 -0
- package/widgets/support/forms/formUtils.js +1 -1
- package/assets/esri/core/workers/chunks/003a87b16f8a4b476e14.js +0 -1
- package/assets/esri/core/workers/chunks/069b6d8bdb34ee88d437.js +0 -1
- package/assets/esri/core/workers/chunks/0790bf0eb276cd9166f6.js +0 -1
- package/assets/esri/core/workers/chunks/0a50efb07eee36237e21.js +0 -1
- package/assets/esri/core/workers/chunks/0ae0483b72f5e8d00d55.js +0 -1
- package/assets/esri/core/workers/chunks/0d1224693a62a26a0e72.js +0 -1
- package/assets/esri/core/workers/chunks/10b367563f894ceb9864.js +0 -1
- package/assets/esri/core/workers/chunks/11e00ca5ac1b004f4ecc.js +0 -1
- package/assets/esri/core/workers/chunks/129fdd1636e67997337c.js +0 -1
- package/assets/esri/core/workers/chunks/12e0c5b7cc5c3f9e6f0f.js +0 -1
- package/assets/esri/core/workers/chunks/13033178de9f637a2356.js +0 -1
- package/assets/esri/core/workers/chunks/13c893e448bedc5c1cef.js +0 -1
- package/assets/esri/core/workers/chunks/147a89553188cc6aabf4.js +0 -1
- package/assets/esri/core/workers/chunks/15c2d9bec0455fc363a9.js +0 -1
- package/assets/esri/core/workers/chunks/246cd372d4184233f48e.js +0 -1
- package/assets/esri/core/workers/chunks/268ab65afc3fce775ad2.js +0 -1
- package/assets/esri/core/workers/chunks/26a2d4b95cda0a41d980.js +0 -1
- package/assets/esri/core/workers/chunks/26f1fd3f2be5102aae1d.js +0 -1
- package/assets/esri/core/workers/chunks/279a9a38b04a21cdfd11.js +0 -1
- package/assets/esri/core/workers/chunks/3406a01dad6338e3c548.js +0 -1
- package/assets/esri/core/workers/chunks/34fbeeeeef4bd01672c6.js +0 -1
- package/assets/esri/core/workers/chunks/36781219ca9ba5d7fe52.js +0 -1
- package/assets/esri/core/workers/chunks/36999a2e383c8eb3c398.js +0 -1
- package/assets/esri/core/workers/chunks/36f8a912842181e1f0aa.js +0 -1
- package/assets/esri/core/workers/chunks/36fe6adf6517d8f80125.js +0 -1
- package/assets/esri/core/workers/chunks/3f1a7f8a9ead64bf0b7b.js +0 -1
- package/assets/esri/core/workers/chunks/403f08e0c1a9203f7fba.js +0 -1
- package/assets/esri/core/workers/chunks/461c2de938bf4c9b1442.js +0 -1
- package/assets/esri/core/workers/chunks/478540265c86436da05e.js +0 -1
- package/assets/esri/core/workers/chunks/479f486ec1797629ec70.js +0 -1
- package/assets/esri/core/workers/chunks/484b3e2a220c440ccbb4.js +0 -1
- package/assets/esri/core/workers/chunks/4a340836ddbc856993f2.js +0 -1
- package/assets/esri/core/workers/chunks/4f2170609742b51bd7b8.js +0 -1
- package/assets/esri/core/workers/chunks/4f59357f535f30a6b5cc.js +0 -1
- package/assets/esri/core/workers/chunks/5133083222588799493f.js +0 -1
- package/assets/esri/core/workers/chunks/52993a9dc0c56e9bda19.js +0 -1
- package/assets/esri/core/workers/chunks/57b07448da06d0302a46.js +0 -1
- package/assets/esri/core/workers/chunks/5a9ff50fdcc99ae28cce.js +0 -1
- package/assets/esri/core/workers/chunks/5dc17b76c6ecc24e7b9a.js +0 -1
- package/assets/esri/core/workers/chunks/5e35828216020f33e26b.js +0 -1
- package/assets/esri/core/workers/chunks/5eb6f37c74a217772eca.js +0 -1
- package/assets/esri/core/workers/chunks/5f0d6c853873a7f32527.js +0 -1
- package/assets/esri/core/workers/chunks/6121cd0264b6841a5bac.js +0 -1
- package/assets/esri/core/workers/chunks/6210fb6cd31844f23964.js +0 -1
- package/assets/esri/core/workers/chunks/638ed1297efdb24f4711.js +0 -1
- package/assets/esri/core/workers/chunks/64247e439ef3e1f712e9.js +0 -1
- package/assets/esri/core/workers/chunks/661a59133ae34f172174.js +0 -1
- package/assets/esri/core/workers/chunks/6823ba1688dfedba0107.js +0 -1
- package/assets/esri/core/workers/chunks/6c2b5087a9df65267f4e.js +0 -1
- package/assets/esri/core/workers/chunks/6d247ff53421d27628ce.js +0 -1
- package/assets/esri/core/workers/chunks/700c08dd2e734c15e621.js +0 -1
- package/assets/esri/core/workers/chunks/70452f6d63e9be8d03dd.js +0 -1
- package/assets/esri/core/workers/chunks/705d6b108fd121cea887.js +0 -1
- package/assets/esri/core/workers/chunks/733b2e181683d5fc7c95.js +0 -1
- package/assets/esri/core/workers/chunks/73aa1bfa6e1dc271c9d7.js +0 -1
- package/assets/esri/core/workers/chunks/7659391f952d134164cf.js +0 -1
- package/assets/esri/core/workers/chunks/7889f4a17cf249f2acc5.js +0 -1
- package/assets/esri/core/workers/chunks/7a2dcd57849048c6e00d.js +0 -1
- package/assets/esri/core/workers/chunks/7a2dfa42610fe8414ed7.js +0 -1
- package/assets/esri/core/workers/chunks/7ce52b850dd785bfa33f.js +0 -1
- package/assets/esri/core/workers/chunks/81accb1820e2735fa376.js +0 -1
- package/assets/esri/core/workers/chunks/8210fc9e072209e26fa9.js +0 -1
- package/assets/esri/core/workers/chunks/825eb845216762a1ed2f.js +0 -1
- package/assets/esri/core/workers/chunks/83991475aa54fd5aa008.js +0 -1
- package/assets/esri/core/workers/chunks/84fa102a93b2144c28fb.js +0 -1
- package/assets/esri/core/workers/chunks/85ce7673d42526a79fd2.js +0 -1
- package/assets/esri/core/workers/chunks/8722e2790272e90a1897.js +0 -1
- package/assets/esri/core/workers/chunks/88df19742edb0cdc3e67.js +0 -1
- package/assets/esri/core/workers/chunks/8977c85aecc7e08ab13c.js +0 -1
- package/assets/esri/core/workers/chunks/8a1970e68bc1e833cb7f.js +0 -1
- package/assets/esri/core/workers/chunks/8bb20ef549ec1c86b38e.js +0 -1
- package/assets/esri/core/workers/chunks/8bdca809dd88eab9e5d8.js +0 -29
- package/assets/esri/core/workers/chunks/8c5726c7ce40a92901e6.js +0 -1
- package/assets/esri/core/workers/chunks/8c5e65982c3f9295e844.js +0 -1
- package/assets/esri/core/workers/chunks/8ce649e55fefc8eca55c.js +0 -1
- package/assets/esri/core/workers/chunks/90ae80b797642bff0efa.js +0 -1
- package/assets/esri/core/workers/chunks/94e9cf8e729ec36de5be.js +0 -1
- package/assets/esri/core/workers/chunks/97c758f736f28c5dab84.js +0 -1
- package/assets/esri/core/workers/chunks/98b27cf8acbfa4259758.js +0 -1
- package/assets/esri/core/workers/chunks/9a6208ab670ad74e6f7d.js +0 -1
- package/assets/esri/core/workers/chunks/a10f63a08d976be058be.js +0 -1
- package/assets/esri/core/workers/chunks/a494abeb026d536d9fae.js +0 -1
- package/assets/esri/core/workers/chunks/a5f058567419ea70dff6.js +0 -1
- package/assets/esri/core/workers/chunks/a8ade34612e73862de6f.js +0 -1
- package/assets/esri/core/workers/chunks/a9d391071803b1e9e8a0.js +0 -1
- package/assets/esri/core/workers/chunks/aa3abc07de2921ef6ca1.js +0 -1
- package/assets/esri/core/workers/chunks/b03f09ee2224f0cc526a.js +0 -1
- package/assets/esri/core/workers/chunks/b3f1a442d6b7826e917f.js +0 -1
- package/assets/esri/core/workers/chunks/b5c7813495657f844171.js +0 -1
- package/assets/esri/core/workers/chunks/b7170816736769d3b7b0.js +0 -1
- package/assets/esri/core/workers/chunks/b819a9187426d0c146df.js +0 -1
- package/assets/esri/core/workers/chunks/b8e5d7aefddddbd0a10c.js +0 -1
- package/assets/esri/core/workers/chunks/b958f87f23f984131d09.js +0 -1
- package/assets/esri/core/workers/chunks/b9f40681af1fa00b5bbe.js +0 -1
- package/assets/esri/core/workers/chunks/c4c25db769a78e677e33.js +0 -1
- package/assets/esri/core/workers/chunks/c85ba0700eafdc8d6f9e.js +0 -1
- package/assets/esri/core/workers/chunks/ca118c42c0f609ca7912.js +0 -1
- package/assets/esri/core/workers/chunks/cb17cd8aaf77238c0236.js +0 -1
- package/assets/esri/core/workers/chunks/d03f427442bb0c287d05.js +0 -1
- package/assets/esri/core/workers/chunks/d08d3c6f21e6ba8268ca.js +0 -1
- package/assets/esri/core/workers/chunks/d37a72111dffc4c4db70.js +0 -1
- package/assets/esri/core/workers/chunks/d41ab2abcfacc87809b5.js +0 -1
- package/assets/esri/core/workers/chunks/d4ed094962a41d756c95.js +0 -1
- package/assets/esri/core/workers/chunks/d51c41c1944df0cbab3e.js +0 -1
- package/assets/esri/core/workers/chunks/dc24e80d061f7b063608.js +0 -1
- package/assets/esri/core/workers/chunks/df30053a10d4930924d5.js +0 -1
- package/assets/esri/core/workers/chunks/e3623e557ab463580fd2.js +0 -1
- package/assets/esri/core/workers/chunks/e5bb7ee670a3ba5ba3fe.js +0 -1
- package/assets/esri/core/workers/chunks/e5c75459de85a6dd2f14.js +0 -1
- package/assets/esri/core/workers/chunks/e798ca23f02a2dd65bd4.js +0 -1
- package/assets/esri/core/workers/chunks/f0225829f7d941914815.js +0 -1
- package/assets/esri/core/workers/chunks/f1299b4fc760ccca1518.js +0 -1
- package/assets/esri/core/workers/chunks/f65adaaa33d9f3b131f6.js +0 -1
- package/assets/esri/core/workers/chunks/f7fa932ade85cb2847b6.js +0 -1
- package/assets/esri/core/workers/chunks/f9b654f801cb416e9e17.js +0 -1
- package/assets/esri/core/workers/chunks/fb34d6d96c8c0d53fcf6.js +0 -1
- package/assets/esri/core/workers/chunks/fdec3a2e100688c42e41.js +0 -1
- package/assets/esri/core/workers/chunks/fefbde2c2e527bb716ee.js +0 -1
- package/chunks/CutFillMask.glsl.js +0 -3
- package/chunks/FocusAreaMask.glsl.js +0 -3
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMask.glsl.js +0 -2
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskTechnique.js +0 -2
- package/views/3d/webgl-engine/shaders/CutFillMaskTechnique.js +0 -2
- /package/assets/esri/core/workers/chunks/{a12803108c3b12808698.js.LICENSE.txt → 242cad472fbc38b24dbc.js.LICENSE.txt} +0 -0
package/WebDocument2D.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ import type { InitialViewPropertiesProperties } from "./webmap/InitialViewProper
|
|
|
21
21
|
import type { WidgetsProperties } from "./webdoc/Widgets.js";
|
|
22
22
|
import type { MapProperties as EsriMapProperties } from "./Map.js";
|
|
23
23
|
|
|
24
|
-
export interface WebDocument2DProperties extends EsriMapProperties, LoadableMixinProperties, Partial<Pick<WebDocument2D, "authoringApp" | "authoringAppVersion" | "thumbnailUrl">> {
|
|
24
|
+
export interface WebDocument2DProperties extends EsriMapProperties, LoadableMixinProperties, Partial<Pick<WebDocument2D, "authoringApp" | "authoringAppVersion" | "portalItemResourcePath" | "thumbnailUrl">> {
|
|
25
25
|
/** The applicationProperties contains the viewing properties of the WebMap. */
|
|
26
26
|
applicationProperties?: ApplicationPropertiesProperties | null;
|
|
27
27
|
/** An array of saved geographic extents that allow end users to quickly navigate to a particular area of interest. */
|
|
@@ -130,6 +130,14 @@ export default abstract class WebDocument2D extends WebDocument2DSuperclass {
|
|
|
130
130
|
/** The portal item from which the WebMap is loaded. */
|
|
131
131
|
get portalItem(): PortalItem | null | undefined;
|
|
132
132
|
set portalItem(value: PortalItemProperties | null | undefined);
|
|
133
|
+
/**
|
|
134
|
+
* Path of a resource (relative to {ITEM}/resources/) within the portal item specified by `portalItem`.
|
|
135
|
+
* This resource should contain a Web Map or Web Link Chart.
|
|
136
|
+
* Applicable only when `portalItem` is a "Knowledge Studio Project" item.
|
|
137
|
+
*
|
|
138
|
+
* @internal
|
|
139
|
+
*/
|
|
140
|
+
accessor portalItemResourcePath: string | null | undefined;
|
|
133
141
|
/**
|
|
134
142
|
* The URL to the thumbnail used for the webmap. The `thumbnailUrl` will default to
|
|
135
143
|
* the thumbnail URL from the portal item associated to the webmap. The thumbnail
|
|
@@ -197,6 +205,14 @@ export default abstract class WebDocument2D extends WebDocument2DSuperclass {
|
|
|
197
205
|
* @see [PortalItem.destroy()](https://developers.arcgis.com/javascript/latest/references/core/portal/PortalItem/#destroy)
|
|
198
206
|
*/
|
|
199
207
|
destroy(): void;
|
|
208
|
+
/**
|
|
209
|
+
* Returns paths of resources within [portalItem](https://developers.arcgis.com/javascript/latest/references/core/WebDocument2D/#portalItem) (relative to `{ITEM}/resources/`)
|
|
210
|
+
* that are referenced by layers in this [WebMap](https://developers.arcgis.com/javascript/latest/references/core/WebMap/) or [WebLinkChart](https://developers.arcgis.com/javascript/latest/references/core/WebLinkChart/).
|
|
211
|
+
*
|
|
212
|
+
* @internal
|
|
213
|
+
* @see [PortalItemResource.path](https://developers.arcgis.com/javascript/latest/references/core/portal/PortalItemResource/#path)
|
|
214
|
+
*/
|
|
215
|
+
getReferencedResourcePaths(): string[];
|
|
200
216
|
/**
|
|
201
217
|
* Triggers the loading of the WebMap instance.
|
|
202
218
|
*
|
package/WebDocument2D.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{version as t}from"./kernel.js";import r from"./Map.js";import i from"./Viewpoint.js";import{isSome as o}from"./core/arrayUtils.js";import s from"./core/Collection.js";import n from"./core/Error.js";import{LoadableMixin as a}from"./core/Loadable.js";import{loadAll as p}from"./core/loadAll.js";import l from"./core/Logger.js";import{destroyMaybe as u}from"./core/maybe.js";import{MultiOriginJSONSupportMixin as m}from"./core/MultiOriginJSONSupport.js";import{EsriPromiseMixin as h}from"./core/Promise.js";import{debounce as c}from"./core/promiseUtils.js";import{whenOnce as d}from"./core/reactiveUtils.js";import{addQueryParameter as g,isDataProtocol as f,dataComponents as b}from"./core/urlUtils.js";import y from"./core/Version.js";import{property as w,subclass as A}from"./core/accessorSupport/decorators.js";import{readLoadable as S}from"./core/accessorSupport/read.js";import _ from"./geometry/SpatialReference.js";import v from"./portal/PortalItem.js";import{typeKeyword as V}from"./portal/support/portalItemUtils.js";import j from"./support/MapFloorInfo.js";import I from"./time/TimeExtent.js";import U from"./webdoc/RangeInfo.js";import P from"./webdoc/Widgets.js";import{getNormalizedThumbnailData as O,getOptimalThumbnailSize as x}from"./webdoc/support/thumbnailUtils.js";import{loadFromSource as F}from"./webdoc/support/webdocLoadUtils.js";import{getLayerJSON as L}from"./webdoc/support/writeUtils.js";import R from"./webmap/ApplicationProperties.js";import k from"./webmap/Bookmark.js";import T from"./webmap/InitialViewProperties.js";import E from"./webmap/background/ColorBackground.js";import{writer as B}from"./core/accessorSupport/decorators/writer.js";import{reader as N}from"./core/accessorSupport/decorators/reader.js";const J=s.ofType(k),Z=new Map([["image/jpeg","jpeg"],["image/jpg","jpg"],["image/png","png"],["image/gif","gif"]]),M="ArcGIS Pro",C=V.JSAPI;let W=class extends(m(a(h(r)))){constructor(e){super(e),this._isAuthoringAppSetByUser=!1,this._isAuthoringAppVersionSetByUser=!1,this._thumbnailFilename=null,this._updateFromPromise=null,this.resourceReferences={portalItem:null,paths:[]},this.applicationProperties=null,this.bookmarks=new J,this.floorInfo=null,this.initialViewProperties=new T,this.portalItem=null,this.sourceVersion=null,this.widgets=null,this._debouncedSaveOperations=c(async(e,t,r)=>{const{save:i,saveAs:o}=await import("./webdoc/support/webdocSaveUtils.js");switch(e){case 0:return i(this.context,this,t);case 1:return o(this.context,this,r,t)}}),this.authoringApp=this.authoringAppVersion=null,this._isAuthoringAppSetByUser=this._isAuthoringAppVersionSetByUser=!1}destroy(){this.portalItem=u(this.portalItem)}initialize(){if(this.when().catch(e=>{l.getLogger(this).error("#load()","Failed to load web map",e)}),this.resourceInfo){let t;try{t=this._validateJSON(this.resourceInfo)}catch(e){return void this.addResolvingPromise(Promise.reject(e))}this.read(t)}}set authoringApp(e){this._isAuthoringAppSetByUser=!0,this._set("authoringApp",e)}writeAuthoringApp(e,t){e&&this._isAuthoringAppSetByUser?t.authoringApp=e:t.authoringApp=C}set authoringAppVersion(e){this._isAuthoringAppVersionSetByUser=!0,this._set("authoringAppVersion",e)}writeAuthoringAppVersion(e,r){e&&this._isAuthoringAppVersionSetByUser?r.authoringAppVersion=e:r.authoringAppVersion=t}readInitialViewProperties(e,t){const r=new T;t.background&&(r.background=E.fromJSON(t.background));const o=t.initialState?.timeExtent;o&&(r.timeExtent=I.fromArray(o));const s=t.initialState?.viewpoint;if(s){if(s.rotation){y.parse(t.version||"","webmap").lessThan(2,20)&&t.authoringApp===M&&(s.rotation*=-1)}r.viewpoint=i.fromJSON(s)}return t.mapRangeInfo&&(r.rangeInfo=U.fromJSON(t.mapRangeInfo)),t.spatialReference&&(r.spatialReference=_.fromJSON(t.spatialReference)),t.timeZone&&(r.timeZone=t.timeZone),r}writeInitialViewProperties(e,t,r,i){if(!e)return;e.background?.color&&(t.background=e.background.write({},i));const{timeExtent:o,viewpoint:s}=e;if(s||o){const e={};s&&(e.viewpoint=s.write({},i)),o&&(e.timeExtent=o.toArray()),t.initialState=e}e.rangeInfo&&(t.mapRangeInfo=e.rangeInfo.toJSON(i)),e.spatialReference&&(t.spatialReference=e.spatialReference.write({},i)),t.timeZone=e.timeZone}writeLayers(e,t,r,i){t[r]=this._writeLayers(e,i,"operational-layers")}get loaded(){return super.loaded}readSourceVersion(e,t){const[r,i]=t.version.split(".");return new y(parseInt(r,10),parseInt(i,10),"webmap")}writeSourceVersion(e,t,r){t[r]=`${this.context.currentVersion.major}.${this.context.currentVersion.minor}`}writeTables(e,t,r,i){const o=this._writeLayers(e,i,"tables");o.length&&(t[r]=o)}get thumbnailUrl(){return this.portalItem?.thumbnailUrl||null}set thumbnailUrl(e){e?(this._override("thumbnailUrl",e),this._thumbnailFilename=this._generateCustomThumbnailFilename(e)):this._clearThumbnailOverride()}get updatingFromView(){return!!this._updateFromPromise}load(e){return this.addResolvingPromise(F(this.context,this)),Promise.resolve(this)}loadAll(){return p(this,e=>{e(this.ground,this.basemap,this.layers,this.tables)})}read(e,t){t={...t,origin:this.context.origin};const r=this._getAuthoringPropsState();S(this,e,t=>super.read(e,t),t),this._restoreAuthoringPropsFromState(r)}write(e,t){if("loaded"!==this.loadStatus){const e=new n("webmap:not-loaded","Web map must be loaded before it can be serialized");throw l.getLogger(this).error("#toJSON()","Web map must be loaded before it can be serialized",this.loadError||this.loadStatus),e}return this._removeDanglingLayerRefs(),t={...t,origin:this.context.origin,restrictedWebMapWriting:!0,webmap:this},super.write(e,t)}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}async updateFrom(e,t){const r=this._updateFromInternal(e,t);this._updateFromPromise=r,await r;r===this._updateFromPromise&&(this._updateFromPromise=null)}getLayerJSONFromResourceInfo(e){const t=this.resourceInfo;return this._collectAllLayersJSON([...t?.baseMap?.baseMapLayers||[],...t?.operationalLayers||[],...this.basemap?.resourceInfo?.data?.baseMapLayers||[]]).find(t=>t.id===e.id)}async updateItemThumbnail(e){if(this.thumbnailUrl&&this._isOverridden("thumbnailUrl")){const t=await O(this.thumbnailUrl,this._thumbnailFilename,e);await(this.portalItem?.updateThumbnail(t)),this._clearThumbnailOverride()}}getThumbnailState(){let e=this.thumbnailUrl;return e&&(e=this._isOverridden("thumbnailUrl")?e:g(e,"w","8192")),{thumbnailUrl:e,filename:this._thumbnailFilename}}restoreThumbnailFromState(e){this.thumbnailUrl=e.thumbnailUrl,this._thumbnailFilename=e.filename}_collectAllLayersJSON(e){return e.reduce((e,t)=>(e.push(t),"GroupLayer"===t.layerType&&(e=e.concat(this._collectAllLayersJSON(t.layers||[]))),e),[])}_writeLayers(e,t,r){t={...t,layerContainerType:r};return e.map(e=>L(e,"tables"===r?null:this.getLayerJSONFromResourceInfo(e),t)).filter(o).toArray()}_validateJSON(e){const t=y.parse(e.version||"","webmap");return this.context.currentVersion.validate(t),e.version=`${t.major}.${t.minor}`,e}_removeDanglingLayerRefs(){const e=this.applicationProperties,t=e?.viewing?.search,r=e=>this.allLayers.some(t=>t.id===e);if(t?.layers&&(t.layers=t.layers.filter(e=>r(e.id))),t?.tables&&(t.tables=t.tables.filter(e=>this.tables.some(t=>t.id===e.id))),e){const t=e.editing?.locationTracking;t?.info&&!r(t.info.layerId)&&(e.editing=null)}const i="presentation"in this?this.presentation:null,o=i?.slides;o&&o.forEach(e=>{e.visibleLayers&&(e.visibleLayers=e.visibleLayers.filter(e=>r(e.id)))})}async _updateFromInternal(e,t){if(t??={},await d(()=>e.ready),this._updateInitialViewProperties(e,t),e.map===this)for(const r of e.allLayerViews)"visible"in r&&"visible"in r.layer&&r._isOverridden("visible")&&(r.layer.visible=r.visible),"featureEffect"in r&&"featureEffect"in r.layer&&r._isOverridden("featureEffect")&&(r.layer.featureEffect=r.featureEffect);await this._updateThumbnailUrl(e,t)}_updateInitialViewProperties(e,t){if(t.backgroundExcluded||(this.initialViewProperties.background=e.background?.clone()),this.initialViewProperties.spatialReference=e.spatialReference?.clone(),this.initialViewProperties.timeZone=e.timeZone,t.viewpointExcluded||(this.initialViewProperties.viewpoint=new i({rotation:e.rotation,scale:t.scalePreserved?e.scale:null,targetGeometry:this._getViewExtent(e)})),!t.widgetsExcluded)for(const r of e.registeredComponents)r.updateWebDocument(this)}_getViewExtent(e){const t=e.center.clone().normalize(),r=e.extent.clone(),i=r.width/2;return r.xmin=t.x-i,r.xmax=t.x+i,r}async _updateThumbnailUrl(e,t){if(t.thumbnailExcluded)return;const r=x(e,t.thumbnailSize),i=await e.takeScreenshot({format:"png",width:r.width,height:r.height});this._setAutoGeneratedThumbnail(i.dataUrl)}_setAutoGeneratedThumbnail(e){this.thumbnailUrl=e,this._thumbnailFilename=null}_clearThumbnailOverride(){this._clearOverride("thumbnailUrl"),this.clear("thumbnailUrl","user"),this._thumbnailFilename=null}_generateCustomThumbnailFilename(e){if(f(e)){const t=b(e),r=t?.mediaType,i=r&&Z.get(r.toLowerCase())||null,o=`thumbnail${Date.now()}`;return i?`${o}.${i}`:o}return null}_getAuthoringPropsState(){return{authoringApp:this.authoringApp,authoringAppVersion:this.authoringAppVersion,isAuthoringAppSetByUser:this._isAuthoringAppSetByUser,isAuthoringAppVersionSetByUser:this._isAuthoringAppVersionSetByUser}}_restoreAuthoringPropsFromState(e){e.isAuthoringAppSetByUser?this.authoringApp=e.authoringApp:this._isAuthoringAppSetByUser=!1,e.isAuthoringAppVersionSetByUser?this.authoringAppVersion=e.authoringAppVersion:this._isAuthoringAppVersionSetByUser=!1}};e([w()],W.prototype,"_updateFromPromise",void 0),e([w({type:R,json:{write:!0}})],W.prototype,"applicationProperties",void 0),e([w({type:String,json:{write:{allowNull:!0,ignoreOrigin:!0}}})],W.prototype,"authoringApp",null),e([B("authoringApp")],W.prototype,"writeAuthoringApp",null),e([w({type:String,json:{write:{allowNull:!0,ignoreOrigin:!0}}})],W.prototype,"authoringAppVersion",null),e([B("authoringAppVersion")],W.prototype,"writeAuthoringAppVersion",null),e([w({type:J,json:{write:{overridePolicy:e=>({enabled:!!(e&&e.length>0),ignoreOrigin:!0})}}})],W.prototype,"bookmarks",void 0),e([w({type:j,json:{name:"mapFloorInfo",write:!0}})],W.prototype,"floorInfo",void 0),e([w({type:T,nonNullable:!0,json:{read:{source:["background","initialState.timeExtent","initialState.viewpoint","mapRangeInfo","spatialReference","timeZone"]},write:{ignoreOrigin:!0,target:{background:{type:E},"initialState.timeExtent":{type:I},"initialState.viewpoint":{type:i},mapRangeInfo:{type:U},spatialReference:{type:_},"timeZone:":{type:String}}}}})],W.prototype,"initialViewProperties",void 0),e([N("initialViewProperties")],W.prototype,"readInitialViewProperties",null),e([B("initialViewProperties")],W.prototype,"writeInitialViewProperties",null),e([w({json:{read:!1,write:{target:"operationalLayers",ignoreOrigin:!0}}})],W.prototype,"layers",void 0),e([B("layers")],W.prototype,"writeLayers",null),e([w({type:v})],W.prototype,"portalItem",void 0),e([w()],W.prototype,"resourceInfo",void 0),e([w({readOnly:!0,type:y,json:{read:{source:"version"},write:{allowNull:!0,ignoreOrigin:!0,target:"version",isRequired:!0}}})],W.prototype,"sourceVersion",void 0),e([N("sourceVersion")],W.prototype,"readSourceVersion",null),e([B("sourceVersion")],W.prototype,"writeSourceVersion",null),e([w({json:{read:!1,write:{ignoreOrigin:!0}}})],W.prototype,"tables",void 0),e([B("tables")],W.prototype,"writeTables",null),e([w()],W.prototype,"thumbnailUrl",null),e([w()],W.prototype,"updatingFromView",null),e([w({type:P,json:{write:!0}})],W.prototype,"widgets",void 0),W=e([A("esri.WebDocument2D")],W);const $=W;export{$ as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{version as t}from"./kernel.js";import r from"./Map.js";import i from"./Viewpoint.js";import{isSome as o}from"./core/arrayUtils.js";import s from"./core/Collection.js";import n from"./core/Error.js";import{LoadableMixin as a}from"./core/Loadable.js";import{loadAll as p}from"./core/loadAll.js";import l from"./core/Logger.js";import{destroyMaybe as u}from"./core/maybe.js";import{MultiOriginJSONSupportMixin as m}from"./core/MultiOriginJSONSupport.js";import{EsriPromiseMixin as h}from"./core/Promise.js";import{debounce as c}from"./core/promiseUtils.js";import{whenOnce as d}from"./core/reactiveUtils.js";import{addQueryParameter as g,isDataProtocol as f,dataComponents as b}from"./core/urlUtils.js";import y from"./core/Version.js";import{property as w,subclass as A}from"./core/accessorSupport/decorators.js";import{readLoadable as S}from"./core/accessorSupport/read.js";import _ from"./geometry/SpatialReference.js";import v from"./portal/PortalItem.js";import{typeKeyword as V}from"./portal/support/portalItemUtils.js";import j from"./support/MapFloorInfo.js";import I from"./time/TimeExtent.js";import U from"./webdoc/RangeInfo.js";import P from"./webdoc/Widgets.js";import{getNormalizedThumbnailData as O,getOptimalThumbnailSize as R}from"./webdoc/support/thumbnailUtils.js";import{loadFromSource as x}from"./webdoc/support/webdocLoadUtils.js";import{getLayerJSON as F}from"./webdoc/support/writeUtils.js";import L from"./webmap/ApplicationProperties.js";import k from"./webmap/Bookmark.js";import T from"./webmap/InitialViewProperties.js";import E from"./webmap/background/ColorBackground.js";import{writer as B}from"./core/accessorSupport/decorators/writer.js";import{reader as N}from"./core/accessorSupport/decorators/reader.js";const J=s.ofType(k),Z=new Map([["image/jpeg","jpeg"],["image/jpg","jpg"],["image/png","png"],["image/gif","gif"]]),M="ArcGIS Pro",C=V.JSAPI;let W=class extends(m(a(h(r)))){constructor(e){super(e),this._isAuthoringAppSetByUser=!1,this._isAuthoringAppVersionSetByUser=!1,this._thumbnailFilename=null,this._updateFromPromise=null,this.resourceReferences={portalItem:null,paths:[]},this.applicationProperties=null,this.bookmarks=new J,this.floorInfo=null,this.initialViewProperties=new T,this.portalItem=null,this.portalItemResourcePath=null,this.sourceVersion=null,this.widgets=null,this._debouncedSaveOperations=c(async(e,t,r)=>{const{save:i,saveAs:o}=await import("./webdoc/support/webdocSaveUtils.js");switch(e){case 0:return i(this.context,this,t);case 1:return o(this.context,this,r,t)}}),this.authoringApp=this.authoringAppVersion=null,this._isAuthoringAppSetByUser=this._isAuthoringAppVersionSetByUser=!1}destroy(){this.portalItem=u(this.portalItem)}initialize(){if(this.when().catch(e=>{l.getLogger(this).error("#load()","Failed to load web map",e)}),this.resourceInfo){let t;try{t=this._validateJSON(this.resourceInfo)}catch(e){return void this.addResolvingPromise(Promise.reject(e))}this.read(t)}}set authoringApp(e){this._isAuthoringAppSetByUser=!0,this._set("authoringApp",e)}writeAuthoringApp(e,t){e&&this._isAuthoringAppSetByUser?t.authoringApp=e:t.authoringApp=C}set authoringAppVersion(e){this._isAuthoringAppVersionSetByUser=!0,this._set("authoringAppVersion",e)}writeAuthoringAppVersion(e,r){e&&this._isAuthoringAppVersionSetByUser?r.authoringAppVersion=e:r.authoringAppVersion=t}readInitialViewProperties(e,t){const r=new T;t.background&&(r.background=E.fromJSON(t.background));const o=t.initialState?.timeExtent;o&&(r.timeExtent=I.fromArray(o));const s=t.initialState?.viewpoint;if(s){if(s.rotation){y.parse(t.version||"","webmap").lessThan(2,20)&&t.authoringApp===M&&(s.rotation*=-1)}r.viewpoint=i.fromJSON(s)}return t.mapRangeInfo&&(r.rangeInfo=U.fromJSON(t.mapRangeInfo)),t.spatialReference&&(r.spatialReference=_.fromJSON(t.spatialReference)),t.timeZone&&(r.timeZone=t.timeZone),r}writeInitialViewProperties(e,t,r,i){if(!e)return;e.background?.color&&(t.background=e.background.write({},i));const{timeExtent:o,viewpoint:s}=e;if(s||o){const e={};s&&(e.viewpoint=s.write({},i)),o&&(e.timeExtent=o.toArray()),t.initialState=e}e.rangeInfo&&(t.mapRangeInfo=e.rangeInfo.toJSON(i)),e.spatialReference&&(t.spatialReference=e.spatialReference.write({},i)),t.timeZone=e.timeZone}writeLayers(e,t,r,i){t[r]=this._writeLayers(e,i,"operational-layers")}get loaded(){return super.loaded}readSourceVersion(e,t){const[r,i]=t.version.split(".");return new y(parseInt(r,10),parseInt(i,10),"webmap")}writeSourceVersion(e,t,r){t[r]=`${this.context.currentVersion.major}.${this.context.currentVersion.minor}`}writeTables(e,t,r,i){const o=this._writeLayers(e,i,"tables");o.length&&(t[r]=o)}get thumbnailUrl(){return this.portalItem?.thumbnailUrl||null}set thumbnailUrl(e){e?(this._override("thumbnailUrl",e),this._thumbnailFilename=this._generateCustomThumbnailFilename(e)):this._clearThumbnailOverride()}get updatingFromView(){return!!this._updateFromPromise}load(e){return this.addResolvingPromise(x(this.context,this)),Promise.resolve(this)}loadAll(){return p(this,e=>{e(this.ground,this.basemap,this.layers,this.tables)})}read(e,t){t={...t,origin:this.context.origin};const r=this._getAuthoringPropsState();S(this,e,t=>super.read(e,t),t),this._restoreAuthoringPropsFromState(r)}write(e,t){if("loaded"!==this.loadStatus){const e=new n("webmap:not-loaded","Web map must be loaded before it can be serialized");throw l.getLogger(this).error("#toJSON()","Web map must be loaded before it can be serialized",this.loadError||this.loadStatus),e}return this._removeDanglingLayerRefs(),t={...t,origin:this.context.origin,restrictedWebMapWriting:!0,webmap:this},super.write(e,t)}getReferencedResourcePaths(){return[...this.resourceReferences.paths]}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}async updateFrom(e,t){const r=this._updateFromInternal(e,t);this._updateFromPromise=r,await r;r===this._updateFromPromise&&(this._updateFromPromise=null)}getLayerJSONFromResourceInfo(e){const t=this.resourceInfo;return this._collectAllLayersJSON([...t?.baseMap?.baseMapLayers||[],...t?.operationalLayers||[],...this.basemap?.resourceInfo?.data?.baseMapLayers||[]]).find(t=>t.id===e.id)}async updateItemThumbnail(e){if(this.thumbnailUrl&&this._isOverridden("thumbnailUrl")){const t=await O(this.thumbnailUrl,this._thumbnailFilename,e);await(this.portalItem?.updateThumbnail(t)),this._clearThumbnailOverride()}}getThumbnailState(){let e=this.thumbnailUrl;return e&&(e=this._isOverridden("thumbnailUrl")?e:g(e,"w","8192")),{thumbnailUrl:e,filename:this._thumbnailFilename}}restoreThumbnailFromState(e){this.thumbnailUrl=e.thumbnailUrl,this._thumbnailFilename=e.filename}_collectAllLayersJSON(e){return e.reduce((e,t)=>(e.push(t),"GroupLayer"===t.layerType&&(e=e.concat(this._collectAllLayersJSON(t.layers||[]))),e),[])}_writeLayers(e,t,r){t={...t,layerContainerType:r};return e.map(e=>F(e,"tables"===r?null:this.getLayerJSONFromResourceInfo(e),t)).filter(o).toArray()}_validateJSON(e){const t=y.parse(e.version||"","webmap");return this.context.currentVersion.validate(t),e.version=`${t.major}.${t.minor}`,e}_removeDanglingLayerRefs(){const e=this.applicationProperties,t=e?.viewing?.search,r=e=>this.allLayers.some(t=>t.id===e);if(t?.layers&&(t.layers=t.layers.filter(e=>r(e.id))),t?.tables&&(t.tables=t.tables.filter(e=>this.tables.some(t=>t.id===e.id))),e){const t=e.editing?.locationTracking;t?.info&&!r(t.info.layerId)&&(e.editing=null)}const i="presentation"in this?this.presentation:null,o=i?.slides;o&&o.forEach(e=>{e.visibleLayers&&(e.visibleLayers=e.visibleLayers.filter(e=>r(e.id)))})}async _updateFromInternal(e,t){if(t??={},await d(()=>e.ready),this._updateInitialViewProperties(e,t),e.map===this)for(const r of e.allLayerViews)"visible"in r&&"visible"in r.layer&&r._isOverridden("visible")&&(r.layer.visible=r.visible),"featureEffect"in r&&"featureEffect"in r.layer&&r._isOverridden("featureEffect")&&(r.layer.featureEffect=r.featureEffect);await this._updateThumbnailUrl(e,t)}_updateInitialViewProperties(e,t){if(t.backgroundExcluded||(this.initialViewProperties.background=e.background?.clone()),this.initialViewProperties.spatialReference=e.spatialReference?.clone(),this.initialViewProperties.timeZone=e.timeZone,t.viewpointExcluded||(this.initialViewProperties.viewpoint=new i({rotation:e.rotation,scale:t.scalePreserved?e.scale:null,targetGeometry:this._getViewExtent(e)})),!t.widgetsExcluded)for(const r of e.registeredComponents)r.updateWebDocument(this)}_getViewExtent(e){const t=e.center.clone().normalize(),r=e.extent.clone(),i=r.width/2;return r.xmin=t.x-i,r.xmax=t.x+i,r}async _updateThumbnailUrl(e,t){if(t.thumbnailExcluded)return;const r=R(e,t.thumbnailSize),i=await e.takeScreenshot({format:"png",width:r.width,height:r.height});this._setAutoGeneratedThumbnail(i.dataUrl)}_setAutoGeneratedThumbnail(e){this.thumbnailUrl=e,this._thumbnailFilename=null}_clearThumbnailOverride(){this._clearOverride("thumbnailUrl"),this.clear("thumbnailUrl","user"),this._thumbnailFilename=null}_generateCustomThumbnailFilename(e){if(f(e)){const t=b(e),r=t?.mediaType,i=r&&Z.get(r.toLowerCase())||null,o=`thumbnail${Date.now()}`;return i?`${o}.${i}`:o}return null}_getAuthoringPropsState(){return{authoringApp:this.authoringApp,authoringAppVersion:this.authoringAppVersion,isAuthoringAppSetByUser:this._isAuthoringAppSetByUser,isAuthoringAppVersionSetByUser:this._isAuthoringAppVersionSetByUser}}_restoreAuthoringPropsFromState(e){e.isAuthoringAppSetByUser?this.authoringApp=e.authoringApp:this._isAuthoringAppSetByUser=!1,e.isAuthoringAppVersionSetByUser?this.authoringAppVersion=e.authoringAppVersion:this._isAuthoringAppVersionSetByUser=!1}};e([w()],W.prototype,"_updateFromPromise",void 0),e([w({type:L,json:{write:!0}})],W.prototype,"applicationProperties",void 0),e([w({type:String,json:{write:{allowNull:!0,ignoreOrigin:!0}}})],W.prototype,"authoringApp",null),e([B("authoringApp")],W.prototype,"writeAuthoringApp",null),e([w({type:String,json:{write:{allowNull:!0,ignoreOrigin:!0}}})],W.prototype,"authoringAppVersion",null),e([B("authoringAppVersion")],W.prototype,"writeAuthoringAppVersion",null),e([w({type:J,json:{write:{overridePolicy:e=>({enabled:!!(e&&e.length>0),ignoreOrigin:!0})}}})],W.prototype,"bookmarks",void 0),e([w({type:j,json:{name:"mapFloorInfo",write:!0}})],W.prototype,"floorInfo",void 0),e([w({type:T,nonNullable:!0,json:{read:{source:["background","initialState.timeExtent","initialState.viewpoint","mapRangeInfo","spatialReference","timeZone"]},write:{ignoreOrigin:!0,target:{background:{type:E},"initialState.timeExtent":{type:I},"initialState.viewpoint":{type:i},mapRangeInfo:{type:U},spatialReference:{type:_},"timeZone:":{type:String}}}}})],W.prototype,"initialViewProperties",void 0),e([N("initialViewProperties")],W.prototype,"readInitialViewProperties",null),e([B("initialViewProperties")],W.prototype,"writeInitialViewProperties",null),e([w({json:{read:!1,write:{target:"operationalLayers",ignoreOrigin:!0}}})],W.prototype,"layers",void 0),e([B("layers")],W.prototype,"writeLayers",null),e([w({type:v})],W.prototype,"portalItem",void 0),e([w()],W.prototype,"portalItemResourcePath",void 0),e([w()],W.prototype,"resourceInfo",void 0),e([w({readOnly:!0,type:y,json:{read:{source:"version"},write:{allowNull:!0,ignoreOrigin:!0,target:"version",isRequired:!0}}})],W.prototype,"sourceVersion",void 0),e([N("sourceVersion")],W.prototype,"readSourceVersion",null),e([B("sourceVersion")],W.prototype,"writeSourceVersion",null),e([w({json:{read:!1,write:{ignoreOrigin:!0}}})],W.prototype,"tables",void 0),e([B("tables")],W.prototype,"writeTables",null),e([w()],W.prototype,"thumbnailUrl",null),e([w()],W.prototype,"updatingFromView",null),e([w({type:P,json:{write:!0}})],W.prototype,"widgets",void 0),W=e([A("esri.WebDocument2D")],W);const $=W;export{$ as default};
|
package/WebLinkChart.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"./Basemap.js";import i from"./WebDocument2D.js";import{deprecated as a}from"./core/deprecate.js";import r from"./core/Error.js";import n from"./core/Logger.js";import o from"./core/Version.js";import{property as s,subclass as h}from"./core/accessorSupport/decorators.js";import l from"./layers/LinkChartLayer.js";import{getInclusionDefinitionFromCypherResults as y,getInclusionDefinitionFromIdTypePairs as c}from"./layers/knowledgeGraph/layerUtils.js";import{getDefaultChronologicalOverlayLayerId as p,getChronologicalOverlay as L}from"./layers/knowledgeGraph/supportUtils.js";import k from"./linkChart/LayoutSettings.js";import d from"./linkChart/LinkChartProperties.js";import u from"./linkChart/NonspatialDataDisplay.js";import C from"./linkChart/RootedLayoutSettings.js";import g from"./webmap/InitialViewProperties.js";import{currentVersion as m}from"./webmap/utils.js";var f;const w={currentVersion:m,createInitialViewProperties:()=>new g,parseVersion:o.parse,
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"./Basemap.js";import i from"./WebDocument2D.js";import{deprecated as a}from"./core/deprecate.js";import r from"./core/Error.js";import n from"./core/Logger.js";import o from"./core/Version.js";import{property as s,subclass as h}from"./core/accessorSupport/decorators.js";import l from"./layers/LinkChartLayer.js";import{getInclusionDefinitionFromCypherResults as y,getInclusionDefinitionFromIdTypePairs as c}from"./layers/knowledgeGraph/layerUtils.js";import{getDefaultChronologicalOverlayLayerId as p,getChronologicalOverlay as L}from"./layers/knowledgeGraph/supportUtils.js";import k from"./linkChart/LayoutSettings.js";import d from"./linkChart/LinkChartProperties.js";import u from"./linkChart/NonspatialDataDisplay.js";import C from"./linkChart/RootedLayoutSettings.js";import g from"./webmap/InitialViewProperties.js";import{currentVersion as m}from"./webmap/utils.js";var f;const w={currentVersion:m,createInitialViewProperties:()=>new g,parseVersion:o.parse,primaryItemType:"Web Link Chart",supportedItemTypes:new Set(["Web Link Chart","Knowledge Studio Project"]),name:"linkchart",origin:"link-chart"};let b=f=class extends i{constructor(t){super(t),this.mapType="webLinkChart",this.linkChartProperties=new d}get activeLinkChartLayer(){return this.layers.find(({type:t})=>"link-chart"===t)}get context(){return w}async applyLayout(t="organic-standard",i){if(await this.load(),!this.activeLinkChartLayer)throw new r("WebLinkChart:no-link-chart-layer","No link chart layer found");"geographic-organic-standard"!==t||this.basemap?.baseLayers?.length||(this.basemap=e.fromId("topo-vector"),await(this.basemap?.load())),this.linkChartProperties.layoutType=t;const o=i?.layoutSettings??this.linkChartProperties.layoutSettings??new k,s=o.rootedLayoutSettings?.rootEntities;s&&(o.rootedLayoutSettings||(o.rootedLayoutSettings=new C),o.rootedLayoutSettings.rootEntities=this._getRootEntitiesInInclusionDefinition(s)),this.linkChartProperties.layoutSettings=o;let{lockedNodeLocations:h,lockedEntityLocations:l,...y}=i??{};!l&&h?(a(n.getLogger(this),"WebLinkChart:applyLayout - WebLinkChartApplyLayoutOptions.lockedNodeLocations is deprecated.",{replacement:"Use WebLinkChartApplyLayoutOptions.lockedEntityLocations instead.",version:"5.0"}),l=h):l&&h&&a(n.getLogger(this),"WebLinkChart:applyLayout - both lockedNodeLocations (deprecated in 5.0) and lockedEntityLocations are defined. Use WebLinkChartApplyLayoutOptions.lockedEntityLocations only instead.",{replacement:"Use WebLinkChartApplyLayoutOptions.lockedEntityLocations instead.",version:"5.0"});const{rootEntityIds:c,...p}=y,L=this.linkChartProperties.layoutSettings?.rootedLayoutSettings?.rootEntities;!L&&c?a(n.getLogger(this),"WebLinkChart:applyLayout - WebLinkChartApplyLayoutOptions.rootEntityIds is deprecated.",{replacement:"Use WebLinkChartApplyLayoutOptions.layoutSettings.rootedLayoutSettings.rootEntities instead.",version:"5.1"}):L&&c&&a(n.getLogger(this),"WebLinkChart:applyLayout - both rootEntityIds (deprecated in 5.1) and layoutSettings.rootedLayoutSettings.rootEntities are defined. Use WebLinkChartApplyLayoutOptions.layoutSettings.rootedLayoutSettings.rootEntities only instead.",{replacement:"Use WebLinkChartApplyLayoutOptions.layoutSettings.rootedLayoutSettings.rootEntities instead.",version:"5.1"});const d={...p,...c?{rootEntityIds:c}:{},...l?{lockedEntityLocations:l}:{},layoutSettings:o};return this.activeLinkChartLayer.applyNewLinkChartLayout(t,d)}_getRootEntitiesInInclusionDefinition(t){const e=this.activeLinkChartLayer?.dataManager?.inclusionModeDefinition;return e?t.filter(({id:t,typeName:i})=>{const a=e.namedTypeDefinitions.get(i);return a&&(a.useAllData||a.members?.has(t))||!1}):t}changeNonspatialDataDisplay(t){if(!this.activeLinkChartLayer)throw new r("WebLinkChart:no-link-chart-layer","No link chart layer found");this.linkChartProperties.nonspatialDataDisplay||(this.linkChartProperties.nonspatialDataDisplay=new u),this.linkChartProperties.nonspatialDataDisplay.mode=t}async addRecords(t,e){if(await this.load(),!this.activeLinkChartLayer)throw new r("WebLinkChart:no-link-chart-layer","No link chart layer found");return this.activeLinkChartLayer.addRecords(t,e)}async createSublayerForNamedType(t){if(await this.load(),!this.activeLinkChartLayer)throw new r("WebLinkChart:no-link-chart-layer","No link chart layer found");return this.activeLinkChartLayer.createSublayerForNamedType(t)}async removeRecords(t){if(await this.load(),!this.activeLinkChartLayer)throw new r("WebLinkChart:no-link-chart-layer","No link chart layer found");return this.activeLinkChartLayer.removeRecords(t)}async expand(t,e){if(await this.load(),!this.activeLinkChartLayer)throw new r("WebLinkChart:no-link-chart-layer","No link chart layer found");const i=await this.activeLinkChartLayer.expand(t,e);return i?.records??[]}async refreshLinkChartData(t){if(await this.load(),!this.activeLinkChartLayer)throw new r("WebLinkChart:no-link-chart-layer","No link chart layer found");return this.activeLinkChartLayer.refreshLinkChartCache(t)}async connectBetweenEntities(t,e){if(await this.load(),!this.activeLinkChartLayer)throw new r("WebLinkChart:no-link-chart-layer","No link chart layer found");const i=await this.activeLinkChartLayer.connectBetweenEntities(t,e);return i?.records??[]}async connectFromEntities(t,e){if(await this.load(),!this.activeLinkChartLayer)throw new r("WebLinkChart:no-link-chart-layer","No link chart layer found");const i=await this.activeLinkChartLayer.connectFromEntities(t,e);return i?.records??[]}getMemberIdsByType(t){if(!this.activeLinkChartLayer)throw new r("WebLinkChart:no-link-chart-layer","No link chart layer found");return Array.from(this.activeLinkChartLayer?.dataManager.sublayerCaches.get(t)?.keys()??[])}get diagramNodesExtent(){if(!this.activeLinkChartLayer)throw new r("WebLinkChart:no-link-chart-layer","No link chart layer found");return this.activeLinkChartLayer.linkChartExtent}get entityCount(){if(!this.activeLinkChartLayer)throw new r("WebLinkChart:no-link-chart-layer","No link chart layer found");return this.activeLinkChartLayer.entityLinkChartDiagramLookup.size}get relationshipCount(){if(!this.activeLinkChartLayer)throw new r("WebLinkChart:no-link-chart-layer","No link chart layer found");return this.activeLinkChartLayer.relationshipLinkChartDiagramLookup.size}get knowledgeGraph(){if(!this.activeLinkChartLayer)throw new r("WebLinkChart:no-link-chart-layer","No link chart layer found");return this.activeLinkChartLayer?.knowledgeGraph}add(t,e){if(this.activeLinkChartLayer&&"type"in t&&"link-chart"===t.type)throw new r("linkchart:one-link-chart-layer","Web Link Charts can only have one Link Chart Layer, another cannot be added");if(super.add(t,e),"type"in t&&"link-chart"===t.type){const e=t.initializationLinkChartConfig?.layoutMode;e&&(this.linkChartProperties.layoutType=e);const i=t.initializationLinkChartConfig?.layoutSettings;i&&(this.linkChartProperties.layoutSettings=i)}}static fromJSON(t){if(t)return new f({resourceInfo:t});throw new r("linkchart:empty-resource","Expected a JSON resource but got nothing")}handleChronologicalOverlay(){if(!this.activeLinkChartLayer)return;const t=this.activeLinkChartLayer,e=this.findLayerById(p());if(e&&this.remove(e),"chronological-mono-timeline"===this.linkChartProperties.layoutType||"chronological-multi-timeline"===this.linkChartProperties.layoutType){const e=L(t);this.add(e,0)}}static async fromCypherQuery(t,e,i,a){const r=await y(t,e,a),n=new f,o=new l({url:t.url,initializationInclusionModeDefinition:r,initializationLinkChartConfig:i});return o.load({signal:a?.signal}).catch(()=>{}),n.add(o),n}static fromIdTypePairs(t,e,i,a){const r=c(t,e),n=new f,o=new l({url:t.url,initializationInclusionModeDefinition:r,initializationLinkChartConfig:i});return o.load({signal:a?.signal}).catch(()=>{}),n.add(o),n}};t([s({readOnly:!0})],b.prototype,"activeLinkChartLayer",null),t([s({json:{write:{ignoreOrigin:!0}}})],b.prototype,"mapType",void 0),t([s({type:d,nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],b.prototype,"linkChartProperties",void 0),t([s({readOnly:!0})],b.prototype,"diagramNodesExtent",null),t([s({readOnly:!0})],b.prototype,"entityCount",null),t([s({readOnly:!0})],b.prototype,"relationshipCount",null),t([s({readOnly:!0})],b.prototype,"knowledgeGraph",null),b=f=t([h("esri.WebLinkChart")],b);const v=b;export{v as default};
|
package/WebMap.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import o from"./WebDocument2D.js";import
|
|
2
|
+
import{__decorate as t}from"tslib";import o from"./WebDocument2D.js";import e from"./core/Collection.js";import r from"./core/Error.js";import{loadAll as i}from"./core/loadAll.js";import s from"./core/Version.js";import{property as p,subclass as n}from"./core/accessorSupport/decorators.js";import m from"./networks/UtilityNetwork.js";import a from"./webdoc/GeotriggersInfo.js";import l from"./webdoc/IPSInfo.js";import c from"./webmap/InitialViewProperties.js";import{currentVersion as f}from"./webmap/utils.js";const u={currentVersion:f,createInitialViewProperties:()=>new c,parseVersion:s.parse,primaryItemType:"Web Map",supportedItemTypes:new Set(["Web Map","Knowledge Studio Project"]),name:"webmap",origin:"web-map"},w=e.ofType(m);let y=class extends o{constructor(t){super(t),this.geotriggersInfo=null,this.ipsInfo=null,this.parcelFabric=null,this.presentation=null,this.utilityNetworks=null}destroy(){if(this.utilityNetworks){const t=this.utilityNetworks.removeAll();for(const o of t)o.destroy();this.utilityNetworks.destroy()}}get context(){return u}loadAll(){return i(this,t=>{t(this.ground,this.basemap,this.layers,this.tables,this.ipsInfo?.positioningService?.portalItem)})}static fromJSON(t){if(t)return new this({resourceInfo:t});throw new r("webmap:empty-resource","Expected a JSON resource but got nothing")}static{this.VERSION=f}};t([p({type:a,json:{write:!0}})],y.prototype,"geotriggersInfo",void 0),t([p({type:l,json:{write:!0,name:"mapIPSInfo"}})],y.prototype,"ipsInfo",void 0),t([p({json:{write:!0}})],y.prototype,"parcelFabric",void 0),t([p({json:{write:!0}})],y.prototype,"presentation",void 0),t([p({type:w,json:{read:!0,write:!0}})],y.prototype,"utilityNetworks",void 0),y=t([n("esri.WebMap")],y);const d=y;export{d as default};
|
package/WebScene.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{version as t}from"./kernel.js";import r from"./Map.js";import i from"./core/Collection.js";import o from"./core/Error.js";import{clone as s}from"./core/lang.js";import{LoadableMixin as a}from"./core/Loadable.js";import{loadAll as n}from"./core/loadAll.js";import l from"./core/Logger.js";import{destroyMaybe as p}from"./core/maybe.js";import{MultiOriginJSONSupportMixin as c,MultiOriginJSONSupport as d}from"./core/MultiOriginJSONSupport.js";import{EsriPromiseMixin as h}from"./core/Promise.js";import{debounce as u}from"./core/promiseUtils.js";import{on as m,watch as y}from"./core/reactiveUtils.js";import{urlToObject as w,addQueryParameter as f}from"./core/urlUtils.js";import g from"./core/Version.js";import b from"./core/Warning.js";import{property as v,subclass as _}from"./core/accessorSupport/decorators.js";import{updateOrigins as S}from"./core/accessorSupport/originUtils.js";import{readLoadable as A}from"./core/accessorSupport/read.js";import{isEarth as I}from"./geometry/ellipsoidUtils.js";import j from"./geometry/Extent.js";import L from"./geometry/HeightModelInfo.js";import{canProjectWithoutEngine as R}from"./geometry/projectionUtils.js";import P from"./geometry/SpatialReference.js";import{validateWebSceneError as U}from"./geometry/support/heightModelInfoUtils.js";import{fromJSON as O}from"./geometry/support/jsonUtils.js";import V from"./portal/Portal.js";import M from"./portal/PortalItem.js";import{createForItemWrite as E}from"./portal/support/jsonContext.js";import{toggleTypeKeyword as C,typeKeyword as T}from"./portal/support/portalItemUtils.js";import{hasDeveloperBasemapLayer as N}from"./support/basemapUtils.js";import{ensureType as x}from"./support/groundUtils.js";import F from"./support/MapFloorInfo.js";import{WebSceneTag as G}from"./support/tagSymbols.js";import{createSchemaValidationError as W}from"./support/webSceneUtils.js";import{isSpatialReferenceSupported as J}from"./views/support/spatialReferenceSupport.js";import k from"./webdoc/Widgets.js";import{updateItemWithResources as B,saveResources as $}from"./webdoc/support/resourceUtils.js";import{evaluateWriteErrors as q}from"./webdoc/support/saveUtils.js";import{getNormalizedThumbnailData as H,getOptimalThumbnailSize as D}from"./webdoc/support/thumbnailUtils.js";import{addLayerUnsupportedError as z}from"./webdoc/support/unsupportedErrors.js";import{isCopyAllowed as K,initializeNewItem as Q}from"./webdoc/support/webdocSaveUtils.js";import X from"./webscene/ApplicationProperties.js";import Y from"./webscene/Environment.js";import Z from"./webscene/InitialViewProperties.js";import ee from"./webscene/Presentation.js";import te from"./webscene/TransportationNetwork.js";import{alphaCutoff as re}from"./webscene/support/AlphaCutoff.js";import{getLoader as ie}from"./webscene/support/schemaValidatorLoader.js";import{supportsVisibleElevationLayersInSlides as oe,versionSupportsGround as se,generateWebSceneVersions as ae}from"./webscene/support/versionUtils.js";import{writer as ne}from"./core/accessorSupport/decorators/writer.js";import{reader as le}from"./core/accessorSupport/decorators/reader.js";var pe;const ce=new g(1,40,"webscene"),de="Web Scene";let he=class extends(a(h(c(r)))){static{pe=G}constructor(e){super(e),this[pe]=!0,this._layersIdGCTimeoutId=void 0,this._updateFromPromise=null,this._afterLoadHooks=[],this.applicationProperties=null,this.clippingArea=null,this.clippingEnabled=!1,this.floorInfo=null,this.heightModelInfo=void 0,this.sourceVersion=null,this.transportationNetworks=null,this.presentation=new ee,this.initialViewProperties=new Z,this.portalItem=null,this.resourceInfo=null,this.widgets=null,this._debouncedSaveOperations=u(async(e,t,r)=>{switch(e){case 0:return this._saveImpl(t);case 1:return this._saveAsImpl(r,t)}}),this._loadContext={origin:"web-scene",initiator:this,hooks:{onAfterLoad:e=>this._afterLoadHooks.push(e)}},this._resourceReferences={portalItem:null,paths:[]},this.authoringApp=null,this.authoringAppVersion=null,this._isAuthoringAppSetByUser=!1,this._isAuthoringAppVersionSetByUser=!1}initialize(){if(this.when().catch(e=>{l.getLogger(this).error("#load()","Failed to load web scene",e)}),this.resourceInfo){let t;try{t=this._validateJSON(this.resourceInfo)}catch(e){return void this.addResolvingPromise(Promise.reject(e))}this.read(t),this.addResolvingPromise(this._validateSpatialReference()),this.addResolvingPromise(this._validateHeightModelInfo())}this.addHandles(m(()=>this.allLayers,"change",()=>this._scheduleLayersIdGC()))}destroy(){this._unscheduleLayersIdGC(),this.presentation&&this.presentation.destroy(),this.portalItem=p(this.portalItem)}writeClippingArea(e,t){t.clippingArea||(t.clippingArea={}),t.clippingArea.geometry=e.toJSON()}readClippingEnabled(e,t){return!!t.clippingArea&&!!t.clippingArea.clip}writeClippingEnabled(e,t){this.clippingArea&&(t.clippingArea||(t.clippingArea={}),t.clippingArea.clip=e)}writeLayers(e,t,r,i){t[r]=this._layersToJSON(e,"operational-layers",i)}get loaded(){return super.loaded}readSourceVersion(e,t){const[r,i]=t.version.split(".");return new g(parseInt(r,10),parseInt(i,10))}writeSourceVersion(e,t,r){t[r]=`${ce.major}.${ce.minor}`}writeTables(e,t,r,i){const o=this._layersToJSON(e,"tables",i);o.length&&(t[r]=o)}get thumbnailUrl(){return this.portalItem?.thumbnailUrl??null}set thumbnailUrl(e){e?this._override("thumbnailUrl",e):(this._clearOverride("thumbnailUrl"),this.clear("thumbnailUrl","user"))}set authoringApp(e){this._isAuthoringAppSetByUser=!0,this._set("authoringApp",e)}writeAuthoringApp(e,t){e&&this._isAuthoringAppSetByUser?t.authoringApp=e:t.authoringApp="ArcGIS API for JavaScript"}set authoringAppVersion(e){this._isAuthoringAppVersionSetByUser=!0,this._set("authoringAppVersion",e)}writeAuthoringAppVersion(e,r){e&&this._isAuthoringAppVersionSetByUser?r.authoringAppVersion=e:r.authoringAppVersion=t}get ground(){return this._get("ground")}set ground(e){const t=x(e);null!=t&&this._set("ground",t)}writeGround(e,t,r,i){t[r]=e?e.write({},i):{transparency:0,layers:[]}}readInitialViewProperties(e,t,r){const{viewingMode:i,spatialReference:o}=t,s=new Z,a={...t.initialState};return void 0!==o&&(a.spatialReference=o),void 0!==i&&(a.viewingMode=i),s.read(a,r),s}get spatialReference(){return this.initialViewProperties?.spatialReference??P.WebMercator}get viewingMode(){return this.initialViewProperties?.viewingMode??"global"}load(e){const t=this.ground;return this.addResolvingPromise(this._loadFromSource().then(()=>{t&&t!==this.ground&&t.destroy(),this._validateFeatureLayerSymbolVisibility()})),Promise.resolve(this)}loadAll(){return n(this,e=>{const t=this.presentation&&this.presentation.slides;e(this.ground,this.basemap,this.layers,t&&t.map(e=>e.basemap),this.tables)})}read(e,t){t??=this._loadContext,t.origin="web-scene";const r=this._isAuthoringAppVersionSetByUser,i=this._isAuthoringAppSetByUser;if(A(this,e,t=>super.read(e,t),t),i||(this._isAuthoringAppSetByUser=!1),r||(this._isAuthoringAppVersionSetByUser=!1),e.baseMap&&Array.isArray(e.baseMap.elevationLayers)&&oe(this.sourceVersion)){const t=e.baseMap.elevationLayers.map(e=>({id:e.id})),r=this.presentation.slides,i=t.filter(e=>!r.some(t=>t.visibleLayers.some(t=>t.id===e.id)));r.forEach(e=>e.visibleLayers.addMany(i))}}_writeBasemapElevationLayers(e){const t=e.ground?.layers;!e.baseMap&&t?.length&&(e.baseMap={title:"Basemap",baseMapLayers:[]}),e.baseMap&&(e.baseMap.elevationLayers=s(t))}_layersToJSON(e,t,r){const i={...r,layerContainerType:t};return e.map(e=>this._verifyWritableLayer(e,r)?e.write({},i):null).filter(e=>!!e).toArray()}_verifyWritableLayer(e,t){return!!e.persistenceEnabled&&("write"in e||(z(t,e),!1))}write(e,t){if("loaded"!==this.loadStatus){const e=new o("webscene:not-loaded","Web scene must be loaded before it can be serialized");throw l.getLogger(this).error("#toJSON()","Web scene must be loaded before it can be serialized",this.loadError||this.loadStatus),e}this._runLayersIdGC();const r=!t?.messages;t={messages:[],...t,origin:"web-scene"};const i=super.write(e,t);if(r){const e=t.messages?.filter(e=>"web-document-write:property-required"===e.name)??[];if(e.length){const t=new o("web-document:property-required","One or more properties that are required in the webscene JSON are missing, see details for the specific errors",{errors:e});throw l.getLogger(this).error("#toJSON()","One or more properties that are required in the webscene JSON are missing",e),t}}return this._writeBasemapElevationLayers(i),i}async save(e){return this._debouncedSaveOperations(0,e)}async _saveImpl(e){if(!this.portalItem)throw new o("webscene:portal-item-not-set","Portal item to save to has not been set on the WebScene");if(this.portalItem?.type!==de)throw new o("webscene:portal-item-wrong-type",`Portal item needs to have type "${de}"`);const t=this._updateFromPromise;await this._ensureLoadBeforeSave();const r=this._enableVerifyItemRelativeUrls(E(this.portalItem,"web-scene",!0)),i=this.write({},r);return await Promise.all(r.resources.pendingOperations),await this._verifySave(i,r,0,e),this._updateTypeKeywords(this.portalItem),await B(this.portalItem,i,this._resourceReferences,r),S(r),t&&await t,await this._saveThumbnail(),this.portalItem}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}async _saveAsImpl(e,t){let r=M.from(e);if(!r)throw new o("webscene:portal-item-required","saveAs requires a portal item to save to");r.id&&(r=r.clone(),r.id=null);const i=r.portal||V.getDefault();await this._ensureLoadBeforeSave(),r.type=de,r.portal=i;const s=this._enableVerifyItemRelativeUrls(E(r,"web-scene",!0)),a=this.write({},s);await Promise.all(s.resources.pendingOperations),await this._verifySaveAs(a,s,t);const n=this.thumbnailUrl,l=!this._isOverridden("thumbnailUrl");this._updateTypeKeywords(r),await i.signIn();const p=this.portalItem,c={item:p,authenticated:!(!p?.id||!p.portal.user)},{copyAllowed:h,itemReloaded:u}=await K(c,i);if(c.authenticated||=u,!h)throw new o(`${s.name}:save-as-copy-not-allowed`,"Owner of this map does not allow others to save a copy");const m={...t,copyAllResources:!0},y=await Q(r,c,a,m);return y&&(this._resourceReferences.portalItem=r),await $(this._resourceReferences,s,{ignoreResourceCopyErrors:y}),this.portalItem=r,d.prototype.read.call(this,{version:a.version,authoringApp:a.authoringApp,authoringAppVersion:a.authoringAppVersion},{name:"web-scene",ignoreDefaults:!0,url:r.itemUrl?w(r.itemUrl):void 0}),S(s),n&&(this.thumbnailUrl=l?f(n,"w","8192"):n),s.portalItem=r,await this._saveThumbnail(p),r}async _saveThumbnail(e){if(this._isOverridden("thumbnailUrl")){const t=await H(this.thumbnailUrl,null,e);await(this.portalItem?.updateThumbnail(t)),this._clearOverride("thumbnailUrl"),this.clear("thumbnailUrl","user")}}async _verifySave(e,t,r,i){if(!I(this.spatialReference))throw new o("webscene:unsupported-spatial-reference","Webscenes using spatial reference systems from Mars or Moon can not be saved currently.");const{ignoreUnsupported:s,requiredPropertyChecksDisabled:a,strictSchemaValidationEnabled:n}=i||{};q(t,{errorName:"webscene:save"},{ignoreUnsupported:s,supplementalUnsupportedErrors:["scenemodification:unsupported"],requiredPropertyChecksDisabled:a});const p=ie();if(n&&p){const t=(await p()).validate(e);if(!t.length)return;const i=`webscene did not validate:\n${t.join("\n")}`;l.getLogger(this).error(`${1===r?"saveAs":"save"}(): ${i}`);const s=t.map(e=>new o("webscene:schema-validation",e));throw W(s)}}_verifySaveAs(e,t,r){return this._verifySave(e,t,1,r)}verifySaveAs(e){const t=this._enableVerifyItemRelativeUrls({origin:"web-scene",messages:[]}),r=this.write({},t);return this._verifySaveAs(r,t,e)}canNotSaveAs(){return!1}async updateFrom(e,t={}){const r=this._updateFrom(e,t);this._updateFromPromise=r,await r;this._updateFromPromise===r&&(this._updateFromPromise=null)}async _updateFrom(e,t={}){if(await e.whenReady(),!t.environmentExcluded&&e.environment&&(this.initialViewProperties.environment=Y.prototype.clone.apply(e.environment)),!t.viewpointExcluded&&e.viewpoint&&(this.initialViewProperties.viewpoint=e.viewpoint.clone()),this.initialViewProperties.spatialReference=e.spatialReference.clone(),this.initialViewProperties.viewingMode=e.viewingMode,this.initialViewProperties.timeExtent=e.timeExtent?.clone()??null,this.initialViewProperties.analyses.updateFrom(e),null!=e.clippingArea?e.clippingArea!==this.clippingArea&&(this.clippingArea=e.clippingArea.clone(),this.clippingEnabled=!0):this.clippingEnabled=!1,e.heightModelInfo&&(this.heightModelInfo=e.heightModelInfo.clone()),e.map===this)for(const r of e.allLayerViews){const e="visible";e in r&&e in r.layer&&r._isOverridden(e)&&(r.layer[e]=r[e])}if(!t.widgetsExcluded)for(const r of e.registeredComponents)r.updateWebDocument(this);(!1===t.thumbnailExcluded||null==t.thumbnailExcluded&&!t.viewpointExcluded)&&await this.updateThumbnail(e,{size:t.thumbnailSize})}async updateThumbnail(e,t){const r=D(e,t?.size),i=await e.takeScreenshot({format:"jpg",width:r.width,height:r.height,disableDecorations:!0});this.thumbnailUrl=i.dataUrl}async _loadFromSource(){this.resourceInfo?await this._loadFromJSON(this.resourceInfo):this.portalItem?.id?await this._loadFromItem(this.portalItem):await this._loadObjectsWithLayers(),await this._afterLoad()}async _afterLoad(){for(;this._afterLoadHooks.length;){const e=this._afterLoadHooks.slice();this._afterLoadHooks.length=0,await Promise.allSettled(e.map(e=>e(this._loadContext)))}}_readAndLoadFromJSON(e){const t=this._loadContext,r=this._validateJSON(e);return this.read(r,t),this._loadFromJSON(r)}_extractOperationalLayers(e){const t=[];if(!se(this.sourceVersion)&&e.baseMap&&Array.isArray(e.baseMap.elevationLayers))for(const o of e.baseMap.elevationLayers)t.push(o);const r=[],i=e=>(e.layers&&(e.layers=e.layers.filter(i)),"ArcGISTiledElevationServiceLayer"!==e.layerType||(se(this.sourceVersion)||r.push(e),!1));return{operationalLayers:e.operationalLayers?e.operationalLayers.filter(i):[],operationalElevationLayers:r,basemapElevationLayers:t}}async _loadFromJSON(e){const t=new i;await this._validateSpatialReference(),await this._validateHeightModelInfo();const{populateOperationalLayers:r}=await import("./layers/support/layersCreator.js"),{operationalLayers:o,operationalElevationLayers:s,basemapElevationLayers:a}=this._extractOperationalLayers(e),n=[],l={context:{...this._loadContext,layerContainerType:"operational-layers"}};if(this.portalItem&&(l.context.portal=this.portalItem.portal||V.getDefault()),a.length>0){const e={...l,context:{...l.context,layerContainerType:"ground"}};e.defaultLayerType="ArcGISTiledElevationServiceLayer",n.push(r(this.ground.layers,a,e))}if(s.length>0){const e={...l,context:{...l.context,layerContainerType:"ground"}};e.defaultLayerType="ArcGISTiledElevationServiceLayer",n.push(r(t,s,e))}o&&o.length>0&&n.push(r(this.layers,o,l)),e.tables?.length&&n.push(r(this.tables,e.tables,{...l,context:{...l.context,layerContainerType:"tables"},defaultLayerType:"ArcGISFeatureLayer"})),await Promise.allSettled(n),await this._loadObjectsWithLayers(),this.ground.layers.addMany(t.filter(e=>"base-elevation"===e.type||"elevation"===e.type))}async _ensureLoadBeforeSave(){await this.load(),await this._loadObjectsWithLayers();const e=[],t=[...this.allLayers.items];for(const{basemap:r}of this.presentation.slides.items)r&&(t.push(...r.baseLayers.items),t.push(...r.groundLayers.items),t.push(...r.referenceLayers.items));for(const r of t)if("beforeSave"in r&&"function"==typeof r.beforeSave){const t=r.beforeSave();t&&e.push(t)}await Promise.allSettled(e)}async _loadObjectsWithLayers(){const e=[];this.ground&&e.push(this.ground.load()),this.basemap&&e.push(this.basemap.load()),this.presentation.slides.forEach(t=>{t.basemap&&e.push(t.basemap.load())}),await Promise.allSettled(e)}async _loadFromItem(e){if(await e.load().catch(e=>{throw new o("webscene:load-portal-item","Failed to load portal item",{error:e})}),"Web Scene"!==e.type)throw new o("webscene:invalid-portal-item","Invalid portal item type '${type}', expected 'Web Scene'",{type:e.type});const t=await e.fetchData();this.resourceInfo=t;const r=this._loadContext;r.url=w(e.itemUrl),r.portal=e.portal||V.getDefault(),r.portalItem=e,r.readResourcePaths=[],await this._readAndLoadFromJSON(t),this._resourceReferences={portalItem:e,paths:r.readResourcePaths??[]}}_validateSpatialReference(){const e=this.initialViewProperties,t=this._sceneSpatialReference;let r;if("local"!==e.viewingMode){if(!J(t,1))return Promise.reject(new o("webscene:unsupported-spatial-reference","Unsupported spatial reference (${spatialReference.wkid}) in global mode, only Web Mercator, WGS84 GCS or CGCS2000 are supported",{spatialReference:t,viewingMode:e.viewingMode}));r=e=>!e||R(e,t)}else{if(!J(t,2))return Promise.reject(new o("webscene:unsupported-spatial-reference","Unsupported spatial reference (${spatialReference.wkid}) in local mode, only projected coordinate systems are supported",{spatialReference:t,viewingMode:e.viewingMode}));r=e=>!e||e.equals(t)}const i=e=>e?.camera?.position.spatialReference??e?.targetGeometry?.spatialReference,s=e.viewpoint,a=i(s);if(a&&!r(a))return Promise.reject(new o("webscene:incompatible-camera-spatial-reference","Camera spatial reference (${cameraSpatialReference.wkid}) is incompatible with the scene spatial reference (${sceneSpatialReference.wkid})",{cameraSpatialReference:a,sceneSpatialReference:t,viewingMode:e.viewingMode}));const n=this.presentation.slides.find(e=>!r(i(e.viewpoint)));if(n){const r=i(n.viewpoint);return Promise.reject(new o("webscene:incompatible-slide-spatial-reference","Slide spatial reference (${slideSpatialReference.wkid}) is incompatible with the scene spatial reference (${sceneSpatialReference.wkid})",{slideSpatialReference:r,sceneSpatialReference:t,viewingMode:e.viewingMode}))}return Promise.resolve()}_validateHeightModelInfo(){const e=this._sceneSpatialReference,t=U(this.heightModelInfo,e);return t?Promise.reject(t):Promise.resolve()}_validateFeatureLayerSymbolVisibility(){this.sourceVersion?.greaterEqual(1,35)||this.layers.forEach(e=>{"feature"===e.type&&e.addHandles(y(()=>e.loaded,()=>{"on-the-ground"===e.elevationInfo?.mode&&"simple"===e.renderer?.type&&"polygon-3d"===e.renderer.symbol?.type&&e.renderer.symbol.symbolLayers.some(t=>"fill"===t.type&&null!=t.material&&((!t.material.color||t.material.color.a*e.opacity<re)&&(e.loadWarnings.push(new b("feature-layer:invisible-draped-symbols","FeatureLayer has fully transparent symbols which will no longer render or highlight",{layer:e})),!0)))},{once:!0,sync:!0}))})}_validateJSON(e){const t=g.parse(e.version||"","webscene");return ce.validate(t),e.version=`${t.major}.${t.minor}`,1===t.major&&t.minor<=2&&(e.spatialReference=P.WebMercator.toJSON()),e}_updateTypeKeywords(e){C(e,T.LOCAL_SCENE,"local"===this.initialViewProperties.viewingMode),C(e,T.DEVELOPER_BASEMAP,N(this.basemap)||this.presentation.slides.some(({basemap:e})=>!!e&&N(e))),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((e,t,r)=>r.indexOf(e)===t))}get _sceneSpatialReference(){return this.initialViewProperties.spatialReference||P.WebMercator}get _verifyItemRelativeRootPath(){return this.portalItem?.itemUrl?w(this.portalItem.itemUrl).path:null}_enableVerifyItemRelativeUrls(e){const t=this._verifyItemRelativeRootPath;return t&&(e.verifyItemRelativeUrls={rootPath:t,writtenUrls:[]}),e}_unscheduleLayersIdGC(){this._layersIdGCTimeoutId&&(clearTimeout(this._layersIdGCTimeoutId),this._layersIdGCTimeoutId=0)}_scheduleLayersIdGC(){this._unscheduleLayersIdGC(),this._layersIdGCTimeoutId=setTimeout(()=>{this._layersIdGCTimeoutId=0,this._runLayersIdGC()},3e3)}_runLayersIdGC(){this._unscheduleLayersIdGC();const e=this.applicationProperties?.viewing?.search,t=e=>this.allLayers.some(t=>t.id===e&&t.persistenceEnabled);e?.layers&&(e.layers=e.layers.filter(e=>t(e.id)));const r=this.presentation&&this.presentation.slides;r&&r.forEach(e=>{e.visibleLayers&&(e.visibleLayers=e.visibleLayers.filter(e=>t(e.id)))})}static fromJSON(e){if(!e)throw new o("webscene:empty-resource","Expected a JSON resource but got nothing");return new this({resourceInfo:e})}static{this.version=`${ce.major}.${ce.minor}`}};e([v({type:X,json:{write:!0}})],he.prototype,"applicationProperties",void 0),e([v({type:j,json:{read:{source:"clippingArea.geometry",reader:O},write:{target:"clippingArea.geometry"}}})],he.prototype,"clippingArea",void 0),e([ne("clippingArea")],he.prototype,"writeClippingArea",null),e([v({type:Boolean,json:{write:{target:"clippingArea.clip"}}})],he.prototype,"clippingEnabled",void 0),e([le("clippingEnabled",["clippingArea"])],he.prototype,"readClippingEnabled",null),e([ne("clippingEnabled")],he.prototype,"writeClippingEnabled",null),e([v({type:F,json:{read:{source:"mapFloorInfo"},write:{target:"mapFloorInfo"}}})],he.prototype,"floorInfo",void 0),e([v({type:L,json:{write:!0}})],he.prototype,"heightModelInfo",void 0),e([v({json:{write:{target:"operationalLayers",ignoreOrigin:!0}}})],he.prototype,"layers",void 0),e([ne("layers")],he.prototype,"writeLayers",null),e([v({readOnly:!0,type:g,json:{type:ae(ce).map(e=>e.toString()),write:{ignoreOrigin:!0,target:"version",isRequired:!0,overridePolicy:()=>({enabled:!0,allowNull:!0,ignoreOrigin:!0})}}})],he.prototype,"sourceVersion",void 0),e([le("sourceVersion",["version"])],he.prototype,"readSourceVersion",null),e([ne("sourceVersion")],he.prototype,"writeSourceVersion",null),e([v({json:{read:!1,write:{enabled:!0,ignoreOrigin:!0}}})],he.prototype,"tables",void 0),e([ne("tables")],he.prototype,"writeTables",null),e([v()],he.prototype,"thumbnailUrl",null),e([v({type:String,json:{write:{writerEnsuresNonNull:!0,ignoreOrigin:!0}}})],he.prototype,"authoringApp",null),e([ne("authoringApp")],he.prototype,"writeAuthoringApp",null),e([v({type:String,json:{write:{writerEnsuresNonNull:!0,ignoreOrigin:!0}}})],he.prototype,"authoringAppVersion",null),e([ne("authoringAppVersion")],he.prototype,"writeAuthoringAppVersion",null),e([v({json:{write:{isRequired:!0,enabled:!0,overridePolicy:()=>({isRequired:!0,enabled:!0,allowNull:!0,ignoreOrigin:!0})}}})],he.prototype,"ground",null),e([ne("ground")],he.prototype,"writeGround",null),e([v({type:i.ofType(te),json:{write:!0}})],he.prototype,"transportationNetworks",void 0),e([v({type:ee,nonNullable:!0,json:{write:{ignoreOrigin:!0,writer:(e,t,r,i)=>{if(e.slides&&e.slides.length>0){const r={...i,isPresentation:!0};t.presentation=e.write({},r)}}}}})],he.prototype,"presentation",void 0),e([v({type:Z,nonNullable:!0,json:{write:{target:"initialState",isRequired:!0,ignoreOrigin:!0},default:()=>new Z({viewingMode:"global",spatialReference:P.WebMercator})}})],he.prototype,"initialViewProperties",void 0),e([le("initialViewProperties",["initialState","spatialReference","viewingMode"])],he.prototype,"readInitialViewProperties",null),e([v({type:P,json:{read:!1,write:{isRequired:!0,ignoreOrigin:!0}}})],he.prototype,"spatialReference",null),e([v({type:["local","global"],json:{read:!1,write:{isRequired:!0,ignoreOrigin:!0}}})],he.prototype,"viewingMode",null),e([v({type:M})],he.prototype,"portalItem",void 0),e([v()],he.prototype,"resourceInfo",void 0),e([v({type:k,json:{write:!0}})],he.prototype,"widgets",void 0),he=e([_("esri.WebScene")],he);const ue=he;export{ue as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{version as t}from"./kernel.js";import r from"./Map.js";import i from"./core/Collection.js";import o from"./core/Error.js";import{clone as s}from"./core/lang.js";import{LoadableMixin as a}from"./core/Loadable.js";import{loadAll as n}from"./core/loadAll.js";import l from"./core/Logger.js";import{destroyMaybe as p}from"./core/maybe.js";import{MultiOriginJSONSupportMixin as c,MultiOriginJSONSupport as d}from"./core/MultiOriginJSONSupport.js";import{EsriPromiseMixin as h}from"./core/Promise.js";import{debounce as u}from"./core/promiseUtils.js";import{on as m,watch as y}from"./core/reactiveUtils.js";import{urlToObject as w,addQueryParameter as f}from"./core/urlUtils.js";import g from"./core/Version.js";import b from"./core/Warning.js";import{property as v,subclass as _}from"./core/accessorSupport/decorators.js";import{updateOrigins as S}from"./core/accessorSupport/originUtils.js";import{readLoadable as A}from"./core/accessorSupport/read.js";import{isEarth as I}from"./geometry/ellipsoidUtils.js";import j from"./geometry/Extent.js";import L from"./geometry/HeightModelInfo.js";import{canProjectWithoutEngine as R}from"./geometry/projectionUtils.js";import P from"./geometry/SpatialReference.js";import{validateWebSceneError as U}from"./geometry/support/heightModelInfoUtils.js";import{fromJSON as O}from"./geometry/support/jsonUtils.js";import V from"./portal/Portal.js";import M from"./portal/PortalItem.js";import{createForItemWrite as E}from"./portal/support/jsonContext.js";import{toggleTypeKeyword as C,typeKeyword as T}from"./portal/support/portalItemUtils.js";import{hasDeveloperBasemapLayer as N}from"./support/basemapUtils.js";import{ensureType as x}from"./support/groundUtils.js";import F from"./support/MapFloorInfo.js";import{WebSceneTag as G}from"./support/tagSymbols.js";import{createSchemaValidationError as W}from"./support/webSceneUtils.js";import{isSpatialReferenceSupported as J}from"./views/support/spatialReferenceSupport.js";import k from"./webdoc/Widgets.js";import{updateItemWithResources as B,saveResources as $}from"./webdoc/support/resourceUtils.js";import{evaluateWriteErrors as q}from"./webdoc/support/saveUtils.js";import{getNormalizedThumbnailData as H,getOptimalThumbnailSize as D}from"./webdoc/support/thumbnailUtils.js";import{addLayerUnsupportedError as z}from"./webdoc/support/unsupportedErrors.js";import{isCopyAllowed as K,initializeNewItem as Q}from"./webdoc/support/webdocSaveUtils.js";import X from"./webscene/ApplicationProperties.js";import Y from"./webscene/Environment.js";import Z from"./webscene/InitialViewProperties.js";import ee from"./webscene/Presentation.js";import te from"./webscene/TransportationNetwork.js";import{alphaCutoff as re}from"./webscene/support/AlphaCutoff.js";import{getLoader as ie}from"./webscene/support/schemaValidatorLoader.js";import{supportsVisibleElevationLayersInSlides as oe,versionSupportsGround as se,generateWebSceneVersions as ae}from"./webscene/support/versionUtils.js";import{writer as ne}from"./core/accessorSupport/decorators/writer.js";import{reader as le}from"./core/accessorSupport/decorators/reader.js";var pe;const ce=new g(1,40,"webscene"),de="Web Scene";let he=class extends(a(h(c(r)))){static{pe=G}constructor(e){super(e),this[pe]=!0,this._layersIdGCTimeoutId=void 0,this._updateFromPromise=null,this._afterLoadHooks=[],this.applicationProperties=null,this.clippingArea=null,this.clippingEnabled=!1,this.floorInfo=null,this.heightModelInfo=void 0,this.sourceVersion=null,this.transportationNetworks=null,this.presentation=new ee,this.initialViewProperties=new Z,this.portalItem=null,this.resourceInfo=null,this.widgets=null,this._debouncedSaveOperations=u(async(e,t,r)=>{switch(e){case 0:return this._saveImpl(t);case 1:return this._saveAsImpl(r,t)}}),this._loadContext={origin:"web-scene",initiator:this,hooks:{onAfterLoad:e=>this._afterLoadHooks.push(e)}},this._resourceReferences={portalItem:null,paths:[]},this.authoringApp=null,this.authoringAppVersion=null,this._isAuthoringAppSetByUser=!1,this._isAuthoringAppVersionSetByUser=!1}initialize(){if(this.when().catch(e=>{l.getLogger(this).error("#load()","Failed to load web scene",e)}),this.resourceInfo){let t;try{t=this._validateJSON(this.resourceInfo)}catch(e){return void this.addResolvingPromise(Promise.reject(e))}this.read(t),this.addResolvingPromise(this._validateSpatialReference()),this.addResolvingPromise(this._validateHeightModelInfo())}this.addHandles(m(()=>this.allLayers,"change",()=>this._scheduleLayersIdGC()))}destroy(){this._unscheduleLayersIdGC(),this.presentation&&this.presentation.destroy(),this.portalItem=p(this.portalItem)}writeClippingArea(e,t){t.clippingArea||(t.clippingArea={}),t.clippingArea.geometry=e.toJSON()}readClippingEnabled(e,t){return!!t.clippingArea&&!!t.clippingArea.clip}writeClippingEnabled(e,t){this.clippingArea&&(t.clippingArea||(t.clippingArea={}),t.clippingArea.clip=e)}writeLayers(e,t,r,i){t[r]=this._layersToJSON(e,"operational-layers",i)}get loaded(){return super.loaded}readSourceVersion(e,t){const[r,i]=t.version.split(".");return new g(parseInt(r,10),parseInt(i,10))}writeSourceVersion(e,t,r){t[r]=`${ce.major}.${ce.minor}`}writeTables(e,t,r,i){const o=this._layersToJSON(e,"tables",i);o.length&&(t[r]=o)}get thumbnailUrl(){return this.portalItem?.thumbnailUrl??null}set thumbnailUrl(e){e?this._override("thumbnailUrl",e):(this._clearOverride("thumbnailUrl"),this.clear("thumbnailUrl","user"))}set authoringApp(e){this._isAuthoringAppSetByUser=!0,this._set("authoringApp",e)}writeAuthoringApp(e,t){e&&this._isAuthoringAppSetByUser?t.authoringApp=e:t.authoringApp="ArcGIS API for JavaScript"}set authoringAppVersion(e){this._isAuthoringAppVersionSetByUser=!0,this._set("authoringAppVersion",e)}writeAuthoringAppVersion(e,r){e&&this._isAuthoringAppVersionSetByUser?r.authoringAppVersion=e:r.authoringAppVersion=t}get ground(){return this._get("ground")}set ground(e){const t=x(e);null!=t&&this._set("ground",t)}writeGround(e,t,r,i){t[r]=e?e.write({},i):{transparency:0,layers:[]}}readInitialViewProperties(e,t,r){const{viewingMode:i,spatialReference:o}=t,s=new Z,a={...t.initialState};return void 0!==o&&(a.spatialReference=o),void 0!==i&&(a.viewingMode=i),s.read(a,r),s}get spatialReference(){return this.initialViewProperties?.spatialReference??P.WebMercator}get viewingMode(){return this.initialViewProperties?.viewingMode??"global"}load(e){const t=this.ground;return this.addResolvingPromise(this._loadFromSource().then(()=>{t&&t!==this.ground&&t.destroy(),this._validateFeatureLayerSymbolVisibility()})),Promise.resolve(this)}loadAll(){return n(this,e=>{const t=this.presentation&&this.presentation.slides;e(this.ground,this.basemap,this.layers,t&&t.map(e=>e.basemap),this.tables)})}read(e,t){t??=this._loadContext,t.origin="web-scene";const r=this._isAuthoringAppVersionSetByUser,i=this._isAuthoringAppSetByUser;if(A(this,e,t=>super.read(e,t),t),i||(this._isAuthoringAppSetByUser=!1),r||(this._isAuthoringAppVersionSetByUser=!1),e.baseMap&&Array.isArray(e.baseMap.elevationLayers)&&oe(this.sourceVersion)){const t=e.baseMap.elevationLayers.map(e=>({id:e.id})),r=this.presentation.slides,i=t.filter(e=>!r.some(t=>t.visibleLayers.some(t=>t.id===e.id)));r.forEach(e=>e.visibleLayers.addMany(i))}}_writeBasemapElevationLayers(e){const t=e.ground?.layers;!e.baseMap&&t?.length&&(e.baseMap={title:"Basemap",baseMapLayers:[]}),e.baseMap&&(e.baseMap.elevationLayers=s(t))}_layersToJSON(e,t,r){const i={...r,layerContainerType:t};return e.map(e=>this._verifyWritableLayer(e,r)?e.write({},i):null).filter(e=>!!e).toArray()}_verifyWritableLayer(e,t){return!!e.persistenceEnabled&&("write"in e||(z(t,e),!1))}write(e,t){if("loaded"!==this.loadStatus){const e=new o("webscene:not-loaded","Web scene must be loaded before it can be serialized");throw l.getLogger(this).error("#toJSON()","Web scene must be loaded before it can be serialized",this.loadError||this.loadStatus),e}this._runLayersIdGC();const r=!t?.messages;t={messages:[],...t,origin:"web-scene"};const i=super.write(e,t);if(r){const e=t.messages?.filter(e=>"web-document-write:property-required"===e.name)??[];if(e.length){const t=new o("web-document:property-required","One or more properties that are required in the webscene JSON are missing, see details for the specific errors",{errors:e});throw l.getLogger(this).error("#toJSON()","One or more properties that are required in the webscene JSON are missing",e),t}}return this._writeBasemapElevationLayers(i),i}async save(e){return this._debouncedSaveOperations(0,e)}async _saveImpl(e){if(!this.portalItem)throw new o("webscene:portal-item-not-set","Portal item to save to has not been set on the WebScene");if(this.portalItem?.type!==de)throw new o("webscene:portal-item-wrong-type",`Portal item needs to have type "${de}"`);const t=this._updateFromPromise;await this._ensureLoadBeforeSave();const r=this._enableVerifyItemRelativeUrls(E(this.portalItem,"web-scene",{withResources:!0})),i=this.write({},r);return await Promise.all(r.resources.pendingOperations),await this._verifySave(i,r,0,e),this._updateTypeKeywords(this.portalItem),await B(this.portalItem,i,this._resourceReferences,r),S(r),t&&await t,await this._saveThumbnail(),this.portalItem}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}async _saveAsImpl(e,t){let r=M.from(e);if(!r)throw new o("webscene:portal-item-required","saveAs requires a portal item to save to");r.id&&(r=r.clone(),r.id=null);const i=r.portal||V.getDefault();await this._ensureLoadBeforeSave(),r.type=de,r.portal=i;const s=this._enableVerifyItemRelativeUrls(E(r,"web-scene",{withResources:!0})),a=this.write({},s);await Promise.all(s.resources.pendingOperations),await this._verifySaveAs(a,s,t);const n=this.thumbnailUrl,l=!this._isOverridden("thumbnailUrl");this._updateTypeKeywords(r),await i.signIn();const p=this.portalItem,c={item:p,authenticated:!(!p?.id||!p.portal.user)},{copyAllowed:h,itemReloaded:u}=await K(c,i);if(c.authenticated||=u,!h)throw new o(`${s.name}:save-as-copy-not-allowed`,"Owner of this map does not allow others to save a copy");const m={...t,copyAllResources:!0},y=await Q(r,c,a,m);return y&&(this._resourceReferences.portalItem=r),await $(this._resourceReferences,s,{ignoreResourceCopyErrors:y}),this.portalItem=r,d.prototype.read.call(this,{version:a.version,authoringApp:a.authoringApp,authoringAppVersion:a.authoringAppVersion},{name:"web-scene",ignoreDefaults:!0,url:r.itemUrl?w(r.itemUrl):void 0}),S(s),n&&(this.thumbnailUrl=l?f(n,"w","8192"):n),s.portalItem=r,await this._saveThumbnail(p),r}async _saveThumbnail(e){if(this._isOverridden("thumbnailUrl")){const t=await H(this.thumbnailUrl,null,e);await(this.portalItem?.updateThumbnail(t)),this._clearOverride("thumbnailUrl"),this.clear("thumbnailUrl","user")}}async _verifySave(e,t,r,i){if(!I(this.spatialReference))throw new o("webscene:unsupported-spatial-reference","Webscenes using spatial reference systems from Mars or Moon can not be saved currently.");const{ignoreUnsupported:s,requiredPropertyChecksDisabled:a,strictSchemaValidationEnabled:n}=i||{};q(t,{errorName:"webscene:save"},{ignoreUnsupported:s,supplementalUnsupportedErrors:["scenemodification:unsupported"],requiredPropertyChecksDisabled:a});const p=ie();if(n&&p){const t=(await p()).validate(e);if(!t.length)return;const i=`webscene did not validate:\n${t.join("\n")}`;l.getLogger(this).error(`${1===r?"saveAs":"save"}(): ${i}`);const s=t.map(e=>new o("webscene:schema-validation",e));throw W(s)}}_verifySaveAs(e,t,r){return this._verifySave(e,t,1,r)}verifySaveAs(e){const t=this._enableVerifyItemRelativeUrls({origin:"web-scene",messages:[]}),r=this.write({},t);return this._verifySaveAs(r,t,e)}canNotSaveAs(){return!1}async updateFrom(e,t={}){const r=this._updateFrom(e,t);this._updateFromPromise=r,await r;this._updateFromPromise===r&&(this._updateFromPromise=null)}async _updateFrom(e,t={}){if(await e.whenReady(),!t.environmentExcluded&&e.environment&&(this.initialViewProperties.environment=Y.prototype.clone.apply(e.environment)),!t.viewpointExcluded&&e.viewpoint&&(this.initialViewProperties.viewpoint=e.viewpoint.clone()),this.initialViewProperties.spatialReference=e.spatialReference.clone(),this.initialViewProperties.viewingMode=e.viewingMode,this.initialViewProperties.timeExtent=e.timeExtent?.clone()??null,this.initialViewProperties.analyses.updateFrom(e),null!=e.clippingArea?e.clippingArea!==this.clippingArea&&(this.clippingArea=e.clippingArea.clone(),this.clippingEnabled=!0):this.clippingEnabled=!1,e.heightModelInfo&&(this.heightModelInfo=e.heightModelInfo.clone()),e.map===this)for(const r of e.allLayerViews){const e="visible";e in r&&e in r.layer&&r._isOverridden(e)&&(r.layer[e]=r[e])}if(!t.widgetsExcluded)for(const r of e.registeredComponents)r.updateWebDocument(this);(!1===t.thumbnailExcluded||null==t.thumbnailExcluded&&!t.viewpointExcluded)&&await this.updateThumbnail(e,{size:t.thumbnailSize})}async updateThumbnail(e,t){const r=D(e,t?.size),i=await e.takeScreenshot({format:"jpg",width:r.width,height:r.height,disableDecorations:!0});this.thumbnailUrl=i.dataUrl}async _loadFromSource(){this.resourceInfo?await this._loadFromJSON(this.resourceInfo):this.portalItem?.id?await this._loadFromItem(this.portalItem):await this._loadObjectsWithLayers(),await this._afterLoad()}async _afterLoad(){for(;this._afterLoadHooks.length;){const e=this._afterLoadHooks.slice();this._afterLoadHooks.length=0,await Promise.allSettled(e.map(e=>e(this._loadContext)))}}_readAndLoadFromJSON(e){const t=this._loadContext,r=this._validateJSON(e);return this.read(r,t),this._loadFromJSON(r)}_extractOperationalLayers(e){const t=[];if(!se(this.sourceVersion)&&e.baseMap&&Array.isArray(e.baseMap.elevationLayers))for(const o of e.baseMap.elevationLayers)t.push(o);const r=[],i=e=>(e.layers&&(e.layers=e.layers.filter(i)),"ArcGISTiledElevationServiceLayer"!==e.layerType||(se(this.sourceVersion)||r.push(e),!1));return{operationalLayers:e.operationalLayers?e.operationalLayers.filter(i):[],operationalElevationLayers:r,basemapElevationLayers:t}}async _loadFromJSON(e){const t=new i;await this._validateSpatialReference(),await this._validateHeightModelInfo();const{populateOperationalLayers:r}=await import("./layers/support/layersCreator.js"),{operationalLayers:o,operationalElevationLayers:s,basemapElevationLayers:a}=this._extractOperationalLayers(e),n=[],l={context:{...this._loadContext,layerContainerType:"operational-layers"}};if(this.portalItem&&(l.context.portal=this.portalItem.portal||V.getDefault()),a.length>0){const e={...l,context:{...l.context,layerContainerType:"ground"}};e.defaultLayerType="ArcGISTiledElevationServiceLayer",n.push(r(this.ground.layers,a,e))}if(s.length>0){const e={...l,context:{...l.context,layerContainerType:"ground"}};e.defaultLayerType="ArcGISTiledElevationServiceLayer",n.push(r(t,s,e))}o&&o.length>0&&n.push(r(this.layers,o,l)),e.tables?.length&&n.push(r(this.tables,e.tables,{...l,context:{...l.context,layerContainerType:"tables"},defaultLayerType:"ArcGISFeatureLayer"})),await Promise.allSettled(n),await this._loadObjectsWithLayers(),this.ground.layers.addMany(t.filter(e=>"base-elevation"===e.type||"elevation"===e.type))}async _ensureLoadBeforeSave(){await this.load(),await this._loadObjectsWithLayers();const e=[],t=[...this.allLayers.items];for(const{basemap:r}of this.presentation.slides.items)r&&(t.push(...r.baseLayers.items),t.push(...r.groundLayers.items),t.push(...r.referenceLayers.items));for(const r of t)if("beforeSave"in r&&"function"==typeof r.beforeSave){const t=r.beforeSave();t&&e.push(t)}await Promise.allSettled(e)}async _loadObjectsWithLayers(){const e=[];this.ground&&e.push(this.ground.load()),this.basemap&&e.push(this.basemap.load()),this.presentation.slides.forEach(t=>{t.basemap&&e.push(t.basemap.load())}),await Promise.allSettled(e)}async _loadFromItem(e){if(await e.load().catch(e=>{throw new o("webscene:load-portal-item","Failed to load portal item",{error:e})}),"Web Scene"!==e.type)throw new o("webscene:invalid-portal-item","Invalid portal item type '${type}', expected 'Web Scene'",{type:e.type});const t=await e.fetchData();this.resourceInfo=t;const r=this._loadContext;r.url=w(e.itemUrl),r.portal=e.portal||V.getDefault(),r.portalItem=e,r.readResourcePaths=[],await this._readAndLoadFromJSON(t),this._resourceReferences={portalItem:e,paths:r.readResourcePaths??[]}}_validateSpatialReference(){const e=this.initialViewProperties,t=this._sceneSpatialReference;let r;if("local"!==e.viewingMode){if(!J(t,1))return Promise.reject(new o("webscene:unsupported-spatial-reference","Unsupported spatial reference (${spatialReference.wkid}) in global mode, only Web Mercator, WGS84 GCS or CGCS2000 are supported",{spatialReference:t,viewingMode:e.viewingMode}));r=e=>!e||R(e,t)}else{if(!J(t,2))return Promise.reject(new o("webscene:unsupported-spatial-reference","Unsupported spatial reference (${spatialReference.wkid}) in local mode, only projected coordinate systems are supported",{spatialReference:t,viewingMode:e.viewingMode}));r=e=>!e||e.equals(t)}const i=e=>e?.camera?.position.spatialReference??e?.targetGeometry?.spatialReference,s=e.viewpoint,a=i(s);if(a&&!r(a))return Promise.reject(new o("webscene:incompatible-camera-spatial-reference","Camera spatial reference (${cameraSpatialReference.wkid}) is incompatible with the scene spatial reference (${sceneSpatialReference.wkid})",{cameraSpatialReference:a,sceneSpatialReference:t,viewingMode:e.viewingMode}));const n=this.presentation.slides.find(e=>!r(i(e.viewpoint)));if(n){const r=i(n.viewpoint);return Promise.reject(new o("webscene:incompatible-slide-spatial-reference","Slide spatial reference (${slideSpatialReference.wkid}) is incompatible with the scene spatial reference (${sceneSpatialReference.wkid})",{slideSpatialReference:r,sceneSpatialReference:t,viewingMode:e.viewingMode}))}return Promise.resolve()}_validateHeightModelInfo(){const e=this._sceneSpatialReference,t=U(this.heightModelInfo,e);return t?Promise.reject(t):Promise.resolve()}_validateFeatureLayerSymbolVisibility(){this.sourceVersion?.greaterEqual(1,35)||this.layers.forEach(e=>{"feature"===e.type&&e.addHandles(y(()=>e.loaded,()=>{"on-the-ground"===e.elevationInfo?.mode&&"simple"===e.renderer?.type&&"polygon-3d"===e.renderer.symbol?.type&&e.renderer.symbol.symbolLayers.some(t=>"fill"===t.type&&null!=t.material&&((!t.material.color||t.material.color.a*e.opacity<re)&&(e.loadWarnings.push(new b("feature-layer:invisible-draped-symbols","FeatureLayer has fully transparent symbols which will no longer render or highlight",{layer:e})),!0)))},{once:!0,sync:!0}))})}_validateJSON(e){const t=g.parse(e.version||"","webscene");return ce.validate(t),e.version=`${t.major}.${t.minor}`,1===t.major&&t.minor<=2&&(e.spatialReference=P.WebMercator.toJSON()),e}_updateTypeKeywords(e){C(e,T.LOCAL_SCENE,"local"===this.initialViewProperties.viewingMode),C(e,T.DEVELOPER_BASEMAP,N(this.basemap)||this.presentation.slides.some(({basemap:e})=>!!e&&N(e))),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((e,t,r)=>r.indexOf(e)===t))}get _sceneSpatialReference(){return this.initialViewProperties.spatialReference||P.WebMercator}get _verifyItemRelativeRootPath(){return this.portalItem?.itemUrl?w(this.portalItem.itemUrl).path:null}_enableVerifyItemRelativeUrls(e){const t=this._verifyItemRelativeRootPath;return t&&(e.verifyItemRelativeUrls={rootPath:t,writtenUrls:[]}),e}_unscheduleLayersIdGC(){this._layersIdGCTimeoutId&&(clearTimeout(this._layersIdGCTimeoutId),this._layersIdGCTimeoutId=0)}_scheduleLayersIdGC(){this._unscheduleLayersIdGC(),this._layersIdGCTimeoutId=setTimeout(()=>{this._layersIdGCTimeoutId=0,this._runLayersIdGC()},3e3)}_runLayersIdGC(){this._unscheduleLayersIdGC();const e=this.applicationProperties?.viewing?.search,t=e=>this.allLayers.some(t=>t.id===e&&t.persistenceEnabled);e?.layers&&(e.layers=e.layers.filter(e=>t(e.id)));const r=this.presentation&&this.presentation.slides;r&&r.forEach(e=>{e.visibleLayers&&(e.visibleLayers=e.visibleLayers.filter(e=>t(e.id)))})}static fromJSON(e){if(!e)throw new o("webscene:empty-resource","Expected a JSON resource but got nothing");return new this({resourceInfo:e})}static{this.version=`${ce.major}.${ce.minor}`}};e([v({type:X,json:{write:!0}})],he.prototype,"applicationProperties",void 0),e([v({type:j,json:{read:{source:"clippingArea.geometry",reader:O},write:{target:"clippingArea.geometry"}}})],he.prototype,"clippingArea",void 0),e([ne("clippingArea")],he.prototype,"writeClippingArea",null),e([v({type:Boolean,json:{write:{target:"clippingArea.clip"}}})],he.prototype,"clippingEnabled",void 0),e([le("clippingEnabled",["clippingArea"])],he.prototype,"readClippingEnabled",null),e([ne("clippingEnabled")],he.prototype,"writeClippingEnabled",null),e([v({type:F,json:{read:{source:"mapFloorInfo"},write:{target:"mapFloorInfo"}}})],he.prototype,"floorInfo",void 0),e([v({type:L,json:{write:!0}})],he.prototype,"heightModelInfo",void 0),e([v({json:{write:{target:"operationalLayers",ignoreOrigin:!0}}})],he.prototype,"layers",void 0),e([ne("layers")],he.prototype,"writeLayers",null),e([v({readOnly:!0,type:g,json:{type:ae(ce).map(e=>e.toString()),write:{ignoreOrigin:!0,target:"version",isRequired:!0,overridePolicy:()=>({enabled:!0,allowNull:!0,ignoreOrigin:!0})}}})],he.prototype,"sourceVersion",void 0),e([le("sourceVersion",["version"])],he.prototype,"readSourceVersion",null),e([ne("sourceVersion")],he.prototype,"writeSourceVersion",null),e([v({json:{read:!1,write:{enabled:!0,ignoreOrigin:!0}}})],he.prototype,"tables",void 0),e([ne("tables")],he.prototype,"writeTables",null),e([v()],he.prototype,"thumbnailUrl",null),e([v({type:String,json:{write:{writerEnsuresNonNull:!0,ignoreOrigin:!0}}})],he.prototype,"authoringApp",null),e([ne("authoringApp")],he.prototype,"writeAuthoringApp",null),e([v({type:String,json:{write:{writerEnsuresNonNull:!0,ignoreOrigin:!0}}})],he.prototype,"authoringAppVersion",null),e([ne("authoringAppVersion")],he.prototype,"writeAuthoringAppVersion",null),e([v({json:{write:{isRequired:!0,enabled:!0,overridePolicy:()=>({isRequired:!0,enabled:!0,allowNull:!0,ignoreOrigin:!0})}}})],he.prototype,"ground",null),e([ne("ground")],he.prototype,"writeGround",null),e([v({type:i.ofType(te),json:{write:!0}})],he.prototype,"transportationNetworks",void 0),e([v({type:ee,nonNullable:!0,json:{write:{ignoreOrigin:!0,writer:(e,t,r,i)=>{if(e.slides&&e.slides.length>0){const r={...i,isPresentation:!0};t.presentation=e.write({},r)}}}}})],he.prototype,"presentation",void 0),e([v({type:Z,nonNullable:!0,json:{write:{target:"initialState",isRequired:!0,ignoreOrigin:!0},default:()=>new Z({viewingMode:"global",spatialReference:P.WebMercator})}})],he.prototype,"initialViewProperties",void 0),e([le("initialViewProperties",["initialState","spatialReference","viewingMode"])],he.prototype,"readInitialViewProperties",null),e([v({type:P,json:{read:!1,write:{isRequired:!0,ignoreOrigin:!0}}})],he.prototype,"spatialReference",null),e([v({type:["local","global"],json:{read:!1,write:{isRequired:!0,ignoreOrigin:!0}}})],he.prototype,"viewingMode",null),e([v({type:M})],he.prototype,"portalItem",void 0),e([v()],he.prototype,"resourceInfo",void 0),e([v({type:k,json:{write:!0}})],he.prototype,"widgets",void 0),he=e([_("esri.WebScene")],he);const ue=he;export{ue as default};
|
package/arcade/Feature.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{ArcadeDate as e}from"./ArcadeDate.js";import{configureDeepClone as t}from"./deepClone.js";import
|
|
2
|
+
import{ArcadeDate as e}from"./ArcadeDate.js";import{configureDeepClone as t}from"./deepClone.js";import{ArcadeExecutionError as i}from"./executionError.js";import{k as s,c as r,t as a,b as n,a as l,e as o,q as d,r as u}from"../chunks/languageUtils.js";import{DateOnly as y}from"../core/sql/DateOnly.js";import{TimeOnly as c}from"../core/sql/TimeOnly.js";import f from"../geometry/Geometry.js";import{fromJSON as m}from"../geometry/support/jsonUtils.js";import h from"../layers/support/FieldsIndex.js";import{isString as p,isNumber as T,isBoolean as F,isDate as _}from"../support/guards.js";function b(e){switch(e.type){case"small-integer":case"esriFieldTypeSmallInteger":case"integer":case"esriFieldTypeInteger":case"single":case"esriFieldTypeSingle":case"double":case"esriFieldTypeDouble":case"big-integer":case"esriFieldTypeBigInteger":case"long":case"esriFieldTypeLong":case"oid":case"esriFieldTypeOID":return{name:e.name,type:"number"};case"global-id":case"esriFieldTypeGlobalID":case"guid":case"esriFieldTypeGUID":case"string":case"esriFieldTypeString":return{name:e.name,type:"text"};case"date":case"esriFieldTypeDate":case"timestamp-offset":case"esriFieldTypeTimestampOffset":return{name:e.name,type:"date"};case"date-only":case"esriFieldTypeDateOnly":return{name:e.name,type:"dateOnly"};case"time-only":case"esriFieldTypeTimeOnly":return{name:e.name,type:"time"};default:return null}}function g(t,i,s){if(null==t)return null;switch(i){case"time-only":return u(t)?t:c.fromReader(t.toString());case"date-only":return d(t)?t:y.fromReader(t.toString());case"timestamp-offset":return o(t)?t:e.fromReaderAsTimeStampOffset(t.toString());case"date":return o(t)?t:_(t)?e.dateJSAndZoneToArcadeDate(t,s):e.epochToArcadeDate(t,s);case"geometry":return null;default:return t}}class x{constructor(){this.arcadeDeclaredClass="esri.arcade.Feature",this._geometry=null,this.attributes=null,this._layer=null,this._fieldTypesFixed=!0,this.fieldsIndex=null,this.contextTimeZone=null,this.immutable=!0,this._fieldsToFixDataTypes=null,this.immutable=!0}static createFromGraphic(e,t){const i=new x;return i.contextTimeZone=t??null,i._geometry=null!=e.geometry?e.geometry:null,void 0===e.attributes||null===e.attributes?i.attributes={}:i.attributes=e.attributes,e._sourceLayer?(i._layer=e._sourceLayer,i._fieldTypesFixed=!1):e._layer?(i._layer=e._layer,i._fieldTypesFixed=!1):e.layer&&"fields"in e.layer?(i._layer=e.layer,i._fieldTypesFixed=!1):e.sourceLayer&&"fields"in e.sourceLayer&&(i._layer=e.sourceLayer,i._fieldTypesFixed=!1),i._layer&&!i._fieldTypesFixed&&(i.fieldsIndex=this.hydrateFieldsIndex(i._layer)),i}static createFromArcadeFeature(e){if(e instanceof x){const t=new x;return t._fieldTypesFixed=e._fieldTypesFixed,t.attributes=e.attributes,t._geometry=e._geometry,e._layer&&(t._layer=e._layer),t.fieldsIndex=e.fieldsIndex,t.contextTimeZone=e.contextTimeZone,t}const t={};for(const i of e.keys())t[i]=e.field(i);return x.createFromGraphicLikeObject(e.geometry(),t,e.fullSchema(),e.contextTimeZone)}static createFromGraphicLikeObject(e,t,i=null,s){const r=new x;return r.contextTimeZone=s??null,null===t&&(t={}),r.attributes=t,r._geometry=null!=e?e:null,r._layer=i,r._layer&&(r._fieldTypesFixed=!1,r.fieldsIndex=this.hydrateFieldsIndex(r._layer)),r}static hydrateFieldsIndex(e){return null===e?null:s(e)?e.getFieldsIndex():e.fieldsIndex?e.fieldsIndex:h.fromLayerJSON({datesInUnknownTimezone:e.datesInUnknownTimezone,fields:e.fields,timeInfo:e.timeInfo,editFieldsInfo:e.editFieldsInfo,dateFieldsTimeReference:e.dateFieldsTimeReference??{timeZone:"UTC",respectsDaylightSaving:!1}})}castToText(e=!1){!1===this._fieldTypesFixed&&this._fixFieldTypes();const t=r(this.attributes,{useNumbersForDates:e});return'{"geometry":'+(null===this.geometry()?"null":a(this.geometry()))+',"attributes":'+t+"}"}_fixFieldTypes(){if(this._fieldsToFixDataTypes&&this._fieldsToFixDataTypes?.length>0)return this._fixAllFields(this._fieldsToFixDataTypes),void(this._fieldTypesFixed=!0);const e=[],t=this._layer.fields;for(let i=0;i<(t?.length??0);i++){const s=t[i],{name:r,type:a}=s;switch(a){case"date":case"esriFieldTypeDate":e.push({field:r,dataType:"date"});break;case"date-only":case"esriFieldTypeDateOnly":e.push({field:r,dataType:"date-only"});break;case"time-only":case"esriFieldTypeTimeOnly":e.push({field:r,dataType:"time-only"});break;case"timestamp-offset":case"esriFieldTypeTimestampOffset":e.push({field:r,dataType:"timestamp-offset"});break;case"geometry":case"esriFieldTypeGeometry":e.push({field:r,dataType:"geometry"})}}this._fieldsToFixDataTypes=e,e.length>0&&this._fixAllFields(e),this._fieldTypesFixed=!0}isUnknownDateTimeField(e){return"unknown"===this.fieldsIndex?.getTimeZone(e)}_fixAllFields(e){this.attributes={...this.attributes};const t=this.contextTimeZone??"system";for(let i=0;i<e.length;i++){const s=e[i].field,r=e[i].dataType;let a=this.attributes[s];if(void 0===a){for(const e in this.attributes)if(e.toLowerCase()===s.toLowerCase()){a=this.attributes[e],this.attributes[e]=g(a,r,this.isUnknownDateTimeField(e)?"unknown":t);break}}else null!==a&&(this.attributes[s]=g(a,r,this.isUnknownDateTimeField(s)?"unknown":t))}}geometry(){return null===this._geometry||this._geometry instanceof f?this._geometry:this._geometry=m(this._geometry)}field(e){this._fieldTypesFixed||this._fixFieldTypes();const t=this.attributes[e];if(void 0!==t)return t;const s=e.toLowerCase();for(const i in this.attributes)if(i.toLowerCase()===s)return this.attributes[i];if(this._hasFieldDefinition(s))return null;throw new i("FieldNotFound",null,{key:e})}_hasFieldDefinition(e){if(null===this._layer)return!1;for(let t=0;t<this._layer.fields.length;t++){if(this._layer.fields[t].name.toLowerCase()===e)return!0}return!1}setField(t,s){if(this.immutable)throw new i("Immutable",null);if(s instanceof Date&&(s=this.isUnknownDateTimeField(t)?e.unknownDateJSToArcadeDate(s):e.dateJSToArcadeDate(s)),!1===n(s))throw new i("TypeNotAllowedInFeature",null);const r=t.toLowerCase();if(void 0===this.attributes[t]){for(const e in this.attributes)if(e.toLowerCase()===r)return void(this.attributes[e]=s);this.attributes[t]=s}else this.attributes[t]=s}hasField(e){const t=e.toLowerCase();if(void 0!==this.attributes[e])return!0;for(const i in this.attributes)if(i.toLowerCase()===t)return!0;return!!this._hasFieldDefinition(t)}keys(){const e=[],t=new Set;for(const i in this.attributes)e.push(i),t.add(i.toLowerCase());if(null!==this._layer)for(let i=0;i<this._layer.fields.length;i++){const s=this._layer.fields[i];t.has(s.name.toLowerCase())||e.push(s.name)}return e.sort((e,t)=>e.toLowerCase()<t.toLowerCase()?-1:1)}isEmpty(){for(const e in this.attributes)return!1;return!(null!=this._layer&&this._layer.fields.length>0)&&null==this.geometry()}static parseAttributesFromDictionary(e){const t={};for(const s in e.attributes){const r=e.attributes[s];if(!n(r))throw new i("InvalidParameter",null);t[s]=r}return t}static parseFromJson(e,t){const s=JSON.parse(e);if(null==s||"object"!=typeof s)throw new i("InvalidParameter",null);let r=null;"geometry"in s&&null!=s.geometry&&(r=m(s.geometry));const a=Object.create(null);if("attributes"in s&&null!=s.attributes)for(const[n,l]of Object.entries(s.attributes)){if(!(null==l||p(l)||T(l)||F(l)))throw new i("InvalidParameter",null);a[n]=l}return x.createFromGraphicLikeObject(r,a,null,t??null)}fullSchema(){return this._layer}gdbVersion(){if(null===this._layer)return"";const e=this._layer.gdbVersion;return void 0===e?"":""===e&&this._layer.capabilities?.isVersioned?"SDE.DEFAULT":e}castAsJson(){const e={attributes:{},geometry:this.geometry()?.toJSON()??null};for(const t in this.attributes){const i=this.attributes[t];void 0!==i&&(e.attributes[t]=l(i))}return e}async castAsJsonAsync(){return this.castAsJson()}}t(x);export{x as Feature,g as convertAttributeToArcadeValue,b as getArcadeVariableForField};
|
package/arcade/ImmutableArray.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
class t{
|
|
2
|
+
class t{static from(t){return new e(t)}length(){return this._elements.length}toArray(){return this.slice()}slice(t=0,e=this.length()){const s=[];for(let r=t;r<e;r++)s.push(this.get(r));return s}}class e extends t{constructor(t){super(),this._elements=t}get(t){return this._elements[t]}slice(t=0,e=this.length()){return this._elements.slice(Math.max(t,0),Math.min(e,this.length()))}equalityTest(t){return this===t}}export{t as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import t from"./ImmutableArray.js";import s from"./ImmutablePointArray.js";class
|
|
2
|
+
import t from"./ImmutableArray.js";import s from"./ImmutablePointArray.js";class e extends t{constructor(t,s,e,h,i){super(),this._elements=t,this._spRef=s,this._hasZ=e,this._hasM=h,this._cacheId=i,this._lazyPath=[]}get(t){if(void 0===this._lazyPath[t]){const e=this._elements[t];if(void 0===e)return;this._lazyPath[t]=new s(e,this._spRef,this._hasZ,this._hasM,this._cacheId,t)}return this._lazyPath[t]}equalityTest(t){return t===this||null!==t&&(t instanceof e!=!1&&t.getUniqueHash()===this.getUniqueHash())}getUniqueHash(){return this._cacheId.toString()}}export{e as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import t from"./ImmutableArray.js";import s from"../geometry/Point.js";class
|
|
2
|
+
import t from"./ImmutableArray.js";import s from"../geometry/Point.js";class h extends t{constructor(t,s,h,i,e,a){super(),this._elements=t,this._spRef=s,this._hasZ=h,this._hasM=i,this._cacheId=e,this._partId=a,this._lazyPt=[]}hasZ(){return this._hasZ}hasM(){return this._hasM}get(t){if(void 0===this._lazyPt[t]){const h=this._elements[t];if(void 0===h)return;const i=new s(h[0],h[1],this._spRef);this._hasZ&&(i.z=h[2]),this._hasM&&(i.m=this._hasZ?h[3]:h[2]),i.cache._arcadeCacheId=this._cacheId.toString()+"-"+this._partId.toString()+"-"+t.toString(),this._lazyPt[t]=i}return this._lazyPt[t]}equalityTest(t){return t===this||null!==t&&(t instanceof h!=!1&&t.getUniqueHash()===this.getUniqueHash())}getUniqueHash(){return this._cacheId.toString()+"-"+this._partId.toString()}}export{h as default};
|
package/arcade/Pixel.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{toSymbolId as r}from"./arcadeEnvironment.js";import{ArcadeExecutionError as e}from"./executionError.js";import{getArcadeVariableForField as t,convertAttributeToArcadeValue as s}from"./Feature.js";import i from"./ImmutableArray.js";import{b as a,c as
|
|
2
|
+
import{toSymbolId as r}from"./arcadeEnvironment.js";import{ArcadeExecutionError as e}from"./executionError.js";import{getArcadeVariableForField as t,convertAttributeToArcadeValue as s}from"./Feature.js";import i from"./ImmutableArray.js";import{b as a,c as o}from"../chunks/languageUtils.js";import n from"../core/Logger.js";import{getOrCreateMapValue as m}from"../core/MapUtils.js";import{isImageryGraphicOrigin as l}from"../graphic/isImageryGraphicOrigin.js";import{isImageryTileGraphicOrigin as p}from"../graphic/isImageryTileGraphicOrigin.js";import{isRasterPixelValueField as u}from"../layers/support/fieldUtils.js";import{rasterFieldPrefix as f}from"../layers/support/rasterFieldUtils.js";import{isDate as c}from"../support/guards.js";const g=()=>n.getLogger("esri.arcade.Pixel");function h(r){return r.rasterFields.filter(r=>r.name.startsWith(f))}class d{constructor(e,t,s){this._graphic=t,this._timeZone=s,this.arcadeDeclaredClass="esri.arcade.Pixel",this._values=new Map,this._fields=new Map(e.map(e=>[r(e.name),e]).sort((r,e)=>r[0]<e[0]?-1:1))}static fromImageryGraphic(r,t){if(!l(r.origin)&&!p(r.origin))throw new e("InvalidParameter",null);return new d(h(r.origin.layer),r,t)}static getDeclaredMembers(r){return h(r).map(r=>u(r.name)&&"string"===r.type?{name:r.name,type:"array",elementType:{type:"text"}}:t(r)).filter(r=>null!=r)}keys(){return Array.from(this._fields.values()).map(r=>r.name)}hasField(e){return this._fields.has(r(e))}field(t){const o=this._fields.get(r(t));if(null==o)throw new e("FieldNotFound",null,{key:t});return m(this._values,o.name,()=>{const r=this._graphic.getAttribute(o.name);return null==r?null:u(o.name)&&"string"==typeof r?i.from(r.split(/,\s*|\s+/)):c(r)||a(r)?s(r,o.type,this._timeZone??"system"):(g().warn(`Unsupported type for attribute: ${o.name}. Ignoring value.`),null)})}isEmpty(){return this._fields.size<=0}castToText(r=!1){const e={};for(const t of this._fields.values())e[t.name]=this.field(t.name);return o(e,{useNumbersForDates:r})}}export{d as Pixel};
|
package/arcade/Voxel.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{ArcadeDate as e}from"./ArcadeDate.js";import{ArcadeExecutionError as t}from"./executionError.js";import r from"./ImmutableArray.js";import{c as i}from"../chunks/languageUtils.js";import{isDate as s}from"../support/guards.js";const n="Voxel.Position",a="Voxel.LocalTime";function o(e){const i=e.getAttribute(n);if("string"!=typeof i)throw new t("InvalidParameter",null);const s=JSON.parse(i);if(!Array.isArray(s)||"number"!=typeof s[0]||"number"!=typeof s[1]||"number"!=typeof s[2])throw new t("InvalidParameter",null);return
|
|
2
|
+
import{ArcadeDate as e}from"./ArcadeDate.js";import{ArcadeExecutionError as t}from"./executionError.js";import r from"./ImmutableArray.js";import{c as i}from"../chunks/languageUtils.js";import{isDate as s}from"../support/guards.js";const n="Voxel.Position",a="Voxel.LocalTime";function o(e){const i=e.getAttribute(n);if("string"!=typeof i)throw new t("InvalidParameter",null);const s=JSON.parse(i);if(!Array.isArray(s)||"number"!=typeof s[0]||"number"!=typeof s[1]||"number"!=typeof s[2])throw new t("InvalidParameter",null);return r.from(s.slice(0,3))}function l(r,i){const n=r.getAttribute(a);if(null==n)return null;if(!s(n))throw new t("InvalidParameter",null);return e.dateJSAndZoneToArcadeDate(n,i)}class u{constructor(e,t){this._graphic=e,this._timeZone=t,this.arcadeDeclaredClass="esri.arcade.Voxel",this._layer=e.sourceLayer}static getDeclaredMembers(e){return e.fields.map(e=>{switch(e.name){case n:return{name:e.name,type:"array",elementType:{type:"number"}};case a:return{name:e.name,type:"date"};default:switch(e.type){case"string":return{name:e.name,type:"text"};case"double":return{name:e.name,type:"number"}}return null}}).filter(e=>null!=e)}getPosition(){return void 0!==this._position?this._position:this._position=o(this._graphic)}getLocalTime(){return void 0!==this._localTime?this._localTime:this._localTime=l(this._graphic,this._timeZone??"system")}keys(){return this._layer.fields.map(e=>e.name).sort((e,t)=>e.toLowerCase()<t.toLowerCase()?-1:1)}hasField(e){return this._layer.fieldsIndex.has(e)}field(e){const r=this._layer.fieldsIndex?.get(e)?.name;if(null==r)throw new t("FieldNotFound",null,{key:e});switch(r){case n:return this.getPosition();case a:return this.getLocalTime()}return this._graphic.attributes[r]??null}isEmpty(){return this._layer.fields.length<=0}castToText(e=!1){const t={...this._graphic.attributes};t[n]=this.getPosition(),a in t&&(t[a]=this.getLocalTime());for(const r of Object.keys(t))this._layer.fieldsIndex?.has(r)||delete t[r];return i(t,{useNumbersForDates:e})}}export{u as Voxel};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{toSymbolId as e,neverAbortedSignal as t}from"./arcadeEnvironment.js";import{ArcadeModule as n}from"./ArcadeModule.js";import{ArcadeModuleLoader as r}from"./ArcadeModuleLoader.js";import{collectDeclaredGlobalNames as o,resolveBreakpoints as a,flattenAccessChain as i,collectDeclaredLocalNames as s}from"./compilerUtils.js";import{getNestedOptionalValue as c,getGeometryKeys as l,tryGetMember as u,getMember as f,getGeometryMember as p}from"./containerUtils.js";import{wrapDebugValue as w,renderFunctionDebugName as d}from"./debug.js";import m from"./Dictionary.js";import{ArcadeExecutionError as h,ensureLocatableError as g}from"./executionError.js";import{Feature as b}from"./Feature.js";import{NativeFunction as y,ScopeMarshalledFunction as v,ArcadeFunction as x,wrapModuleScopedResponse as S}from"./FunctionWrapper.js";import{R as k,I as F,q as I,i as j,z as O,A as N,v as M,B as R,r as C,s as E,u as A,w as D,x as B,h as U,g as _,y as G,k as z,f as L}from"../chunks/languageUtils.js";import{addFunctionDeclaration as Z}from"./treeAnalysis.js";import{A as q}from"../chunks/aiServices.js";import{A as P}from"../chunks/array.js";import{registerFunctions as W}from"./functions/date.js";import{registerFunctions as T}from"./functions/feature.js";import{registerFunctions as V}from"./functions/geomasync.js";import{registerFunctions as K}from"./functions/geometry.js";import{registerFunctions as $}from"./functions/maths.js";import{registerFunctions as Y}from"./functions/stats.js";import{registerFunctions as H}from"./functions/string.js";import{registerFunctions as J}from"./functions/track.js";import Q from"../core/Logger.js";import X from"../geometry/SpatialReference.js";import{isGraphic as ee}from"../support/graphicInstanceUtils.js";import{isBoolean as te,isString as ne,isArray as re,isNumber as oe}from"../support/guards.js";const ae=()=>Q.getLogger("esri.arcade.arcadeAsyncRuntime"),ie=Symbol("debugInfo"),se=Symbol("uninitialized");function ce(e){if(e===se)throw new h("InvalidIdentifier",null)}function le(e){return ce(e),e}function ue(t,n){const r=e(n);if(null!==t.localScope){const e=t.localScope[r];if(void 0!==e)return{scope:t.localScope,id:r,var:e}}const o=t.globalScope[r];if(void 0!==o)return{scope:t.globalScope,id:r,var:o};throw new h("InvalidIdentifier",n)}function fe(t,n,r="InvalidIdentifier"){const o=e(n);if(null!==t.localScope){const e=t.localScope[o];if(void 0!==e)return ce(e),e.value}const a=t.globalScope[o];if(void 0!==a)return ce(a),a.value;throw new h(r,n)}const pe=function(){};async function we(e,t){const n=[];for(let r=0;r<t.arguments.length;r++)n.push(await Se(e,t.arguments[r]));return n}async function de(e,t,n){if(!0===t.preparsed)return n(e,null,t.arguments);return n(e,t,await we(e,t))}pe.prototype=Object.freeze(Object.create(null));class me extends x{constructor(e,t,n,r,o){super(),this.definition=e,this.context=t,this._params=n,this._locals=r,this._debugInfo=o}get debugName(){return this.definition.id.name}createFunction(e){return(...t)=>{const n=new pe;n[ie]=this._debugInfo;const r={spatialReference:this.context.spatialReference,console:this.context.console,lrucache:this.context.lrucache,timeZone:this.context.timeZone??null,exports:this.context.exports,libraryResolver:this.context.libraryResolver,interceptor:this.context.interceptor,services:this.context.services,abortSignal:this.context.abortSignal,localScope:n,depthCounter:{depth:e.depthCounter.depth+1},globalScope:this.context.globalScope,contextScopeDebugInfo:this.context.contextScopeDebugInfo,track:this.context.track};if(r.depthCounter.depth>64)throw new h("MaximumCallDepth",null);return he(r,this.definition.body,this._params,this._locals,t,null)}}call(e,t){return be(e,t,(n,r,o)=>{const a=new pe;a[ie]=this._debugInfo;const i={spatialReference:e.spatialReference,services:e.services,console:e.console,libraryResolver:e.libraryResolver,exports:e.exports,lrucache:e.lrucache,timeZone:e.timeZone??null,interceptor:e.interceptor,localScope:a,abortSignal:e.abortSignal,globalScope:e.globalScope,contextScopeDebugInfo:e.contextScopeDebugInfo,depthCounter:{depth:e.depthCounter.depth+1},track:e.track};if(i.depthCounter.depth>64)throw new h("MaximumCallDepth",t);return he(i,this.definition.body,this._params,this._locals,o,t)})}marshalledCall(e,t,n,r){return r(e,t,async(o,a,i)=>{const s=new pe;s[ie]=this._debugInfo;const c={spatialReference:e.spatialReference,services:e.services,globalScope:n.globalScope,contextScopeDebugInfo:n.contextScopeDebugInfo,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,console:e.console,abortSignal:e.abortSignal,lrucache:e.lrucache,timeZone:e.timeZone??null,interceptor:e.interceptor,localScope:s,track:e.track};return i=i.map(t=>!j(t)||t instanceof v?t:S(t,e,r)),S(await he(c,this.definition.body,this._params,this._locals,i,t),n,r)})}}async function he(e,t,n,r,o,a){if(n.length!==o.length)throw new h("WrongNumberOfParameters",a);if(null!=e.localScope){for(let t=0;t<n.length;t++)e.localScope[n[t]]={value:o[t]};for(const t of r)e.localScope[t]=se}const i=await ke(e,t);if(i instanceof k)return i.value;if(i===O)throw new h("UnexpectedToken",a);if(i===N)throw new h("UnexpectedToken",a);return i instanceof F?i.value:i}class ge extends n{constructor(e){super(),this.moduleGlobalContext=e}global(t){const n=e(t);if(!this.moduleGlobalContext.exports.has(n))throw new h("ModuleExportNotFound",null);const r=this.moduleGlobalContext.globalScope[n];if(ce(r),j(r.value)&&!(r.value instanceof v)){const e=new v;return e.fn=r.value,e.parameterEvaluator=de,e.context=this.moduleGlobalContext,this.moduleGlobalContext.globalScope[n]={value:e},e}return r.value}setGlobal(t,n){if(j(n))throw new h("AssignModuleFunction",null);const r=e(t);if(!this.moduleGlobalContext.exports.has(r))throw new h("ModuleExportNotFound",null);this.moduleGlobalContext.globalScope[r]={value:n}}hasGlobal(t){return this.moduleGlobalContext.exports.has(e(t))}static async load(e,n){const{globals:a,exports:i}=o(n),s=new wt;null!=e.contextScopeDebugInfo&&(s[ie]={declaredNames:a});for(const t of a.keys())t in s||(s[t]=se);const c=e.spatialReference??X.WebMercator,l={lrucache:e.lrucache,interceptor:e.interceptor,services:e.services,console:e.console??mt,abortSignal:e.abortSignal??t,timeZone:e.timeZone??null,spatialReference:c,track:null,depthCounter:{depth:1},libraryResolver:new r(e.libraryResolver._moduleSingletons,n.loadedModules),exports:i,localScope:null,globalScope:s,contextScopeDebugInfo:null!=e.contextScopeDebugInfo?{declaredNames:new Map}:null};return await ze(l,n),new ge(l)}}async function be(e,t,n){if(!0===t.preparsed)return n(e,null,t.arguments);return n(e,t,await we(e,t))}function ye(e,t,n){const r=new Map;if(t)for(const[o,a]of t.declaredNames){const t=e[o];r.set(a,null==t||t===se?null:w(t.value,n))}else for(const o of Object.getOwnPropertyNames(e)){const t=e[o];r.set(o,t===se?null:w(t.value,n))}return r}function ve(e){return e instanceof me?`ƒ ${e.debugName}(${e.definition.params.map(e=>e.name).join(", ")})`:d(e)}function xe(e,t){const n=e.services?.debugger;if(null==n)return;const r={renderFunction:ve,defaultTimeZone:e.timeZone??"system"};return n.pause(t,{profile:null!=e.contextScopeDebugInfo?ye(e.globalScope,e.contextScopeDebugInfo,r):new Map,globals:ye(e.globalScope,e.globalScope[ie],r),locals:null==e.localScope?null:ye(e.localScope,e.localScope[ie],r)})}async function Se(e,t){t.breakpoint&&await xe(e,t.breakpoint);try{switch(t.type){case"UpdateExpression":return await De(e,t);case"AssignmentExpression":return await Ue(e,t);case"TemplateLiteral":return await at(e,t);case"Identifier":return nt(e,t);case"MemberExpression":return await Ke(e,t);case"Literal":return t.value;case"CallExpression":return await rt(e,t);case"UnaryExpression":return await Qe(e,t);case"BinaryExpression":return await et(e,t);case"LogicalExpression":return await tt(e,t);case"ArrayExpression":return await Xe(e,t);case"ObjectExpression":return await Fe(e,t);case"MemberAccessChainExpression":return await Je(e,t);case"SafeMemberExpression":throw ae().error("SafeMemberExpression outside of MemberAccessChainExpression"),new h("Unrecognized",t);default:throw new h("Unrecognized",t)}}catch(n){throw g(n,t)}}async function ke(e,t){t.breakpoint&&await xe(e,t.breakpoint);try{switch(t.type){case"ImportDeclaration":return await Pe(e,t);case"ExportNamedDeclaration":return await We(e,t);case"VariableDeclaration":return await Te(e,t);case"BlockStatement":return await ze(e,t);case"FunctionDeclaration":return await qe(e,t);case"ReturnStatement":return await Ze(e,t);case"IfStatement":return await Ge(e,t);case"ExpressionStatement":return await _e(e,t);case"ForStatement":return await je(e,t);case"WhileStatement":return await Ie(e,t);case"ForInStatement":return await Ee(e,t);case"ForOfStatement":return await Ae(e,t);case"BreakStatement":return O;case"EmptyStatement":return M;case"ContinueStatement":return N;default:throw new h("Unrecognized",t)}}catch(n){throw g(n,t)}}async function Fe(e,t){const n=[];for(let i=0;i<t.properties.length;i++){const r=t.properties[i],o=await Se(e,r.value),a="Identifier"===r.key.type?r.key.name:await Se(e,r.key);n[i]={key:a,value:o}}const r=Object.create(null),o=new Map;for(let i=0;i<n.length;i++){const e=n[i];if(j(e.value))throw new h("NoFunctionInDictionary",t);if(!1===ne(e.key))throw new h("KeyMustBeString",t);let a=e.key.toString();const s=a.toLowerCase();o.has(s)?a=o.get(s):o.set(s,a),e.value===M?r[a]=null:r[a]=e.value}const a=new m(r);return a.immutable=!1,a}async function Ie(e,t){let n=await Se(e,t.test);if(!1===n)return M;if(!0!==n)throw new h("BooleanConditionRequired",t);for(;!0===n;){const r=await ke(e,t.body);if(r===O)break;if(r instanceof k)return r;if(n=await Se(e,t.test),!0!==n&&!1!==n)throw new h("BooleanConditionRequired",t)}return M}async function je(e,t){try{for(null!==t.init&&("VariableDeclaration"===t.init.type?await ke(e,t.init):await Se(e,t.init));;){if(null!==t.test){const n=await Se(e,t.test);if(!0===e.abortSignal?.aborted)throw new h("Cancelled",t);if(!1===n)break;if(!0!==n)throw new h("BooleanConditionRequired",t)}const n=await ke(e,t.body);if(n===O)break;if(n instanceof k)return n;null!==t.update&&await Se(e,t.update)}return M}catch(n){throw n}}async function Oe(e,t,n,r,o="i"){const a=n.length;for(let i=0;i<a;i++){if("k"===o){if(i>=n.length)throw new h("OutOfBounds",t);r.scope[r.id]={value:n[i]}}else r.scope[r.id]={value:i};const a=await ke(e,t.body);if(a===O)break;if(a instanceof k)return a}return M}async function Ne(e,t,n,r,o="i"){const a=n.length();for(let i=0;i<a;i++){r.scope[r.id]="k"===o?{value:n.get(i)}:{value:i};const a=await ke(e,t.body);if(a===O)break;if(a instanceof k)return a}return M}async function Me(e,t,n,r){e:for await(const o of await n.queryAll(e.abortSignal))for(const a of o){r.scope[r.id]={value:b.createFromGraphicLikeObject(a.geometry,a.attributes,n,e.timeZone)};const o=await ke(e,t.body);if(o===O)break e;if(o instanceof k)return o}return M}async function Re(e,t,n,r){for(const o of n.keys()){const a=n.field(o);r.scope[r.id]={value:m.containerEntry(o,a)};const i=await ke(e,t.body);if(i===O)break;if(i instanceof k)return i}return M}async function Ce(e,t,n,r){for(const o of l(n)){const a=p(n,o,t);r.scope[r.id]={value:m.containerEntry(o,a)};const i=await ke(e,t.body);if(i===O)break;if(i instanceof k)return i}return M}async function Ee(e,t){const n=await Se(e,t.right);"VariableDeclaration"===t.left.type&&await ke(e,t.left);const r=ue(e,"VariableDeclaration"===t.left.type?t.left.declarations[0].id:t.left);return re(n)||ne(n)?await Oe(e,t,n,r):_(n)?await Ne(e,t,n,r):n instanceof m||G(n)?await Oe(e,t,n.keys(),r,"k"):z(n)?await Me(e,t,n,r):L(n)?await Oe(e,t,l(n),r,"k"):M}async function Ae(e,t){const n=await Se(e,t.right);"VariableDeclaration"===t.left.type&&await ke(e,t.left);const r=ue(e,"VariableDeclaration"===t.left.type?t.left.declarations[0].id:t.left);return re(n)||ne(n)?await Oe(e,t,n,r,"k"):_(n)?await Ne(e,t,n,r,"k"):n instanceof m||G(n)?await Re(e,t,n,r):z(n)?await Me(e,t,n,r):L(n)?await Ce(e,t,n,r):M}async function De(e,t){const n=t.argument;if("CallExpression"===n.type)throw new h("NeverReach",t);if("MemberExpression"===n.type){const r=await Se(e,n.object);let o,a;if(!0===n.computed)o=await Se(e,n.property);else{if("Identifier"!==n.property.type)throw new h("Unrecognized",t);o=n.property.name}if(re(r)){if(!oe(o))throw new h("ArrayAccessMustBeNumber",t);if(o<0&&(o=r.length+o),o<0||o>=r.length)throw new h("OutOfBounds",t);a=C(r[o]),r[o]="++"===t.operator?a+1:a-1}else if(r instanceof m){if(!1===ne(o))throw new h("KeyAccessorMustBeString",t);if(!0!==r.hasField(o))throw new h("FieldNotFound",t,{key:o});a=C(r.field(o)),r.setField(o,"++"===t.operator?a+1:a-1)}else if(r instanceof ge){if(!1===ne(o))throw new h("ModuleAccessorMustBeString",t);if(!0!==r.hasGlobal(o))throw new h("ModuleExportNotFound",t);a=C(r.global(o)),r.setGlobal(o,"++"===t.operator?a+1:a-1)}else{if(!U(r))throw _(r)?new h("Immutable",t):new h("InvalidParameter",t);if(!1===ne(o))throw new h("KeyAccessorMustBeString",t);if(!0!==r.hasField(o))throw new h("FieldNotFound",t,{key:o});a=C(r.field(o)),r.setField(o,"++"===t.operator?a+1:a-1)}return!1===t.prefix?a:"++"===t.operator?a+1:a-1}const r=ue(e,n),o=C(le(r.var).value),a="++"===t.operator?o+1:o-1;return r.scope[r.id]={value:a},!1===t.prefix?o:"++"===t.operator?o+1:o-1}function Be(e,t,n,r){switch(t){case"=":return e===M?null:e;case"/=":return C(n)/C(e);case"*=":return C(n)*C(e);case"-=":return C(n)-C(e);case"+=":return ne(n)||ne(e)?E(n)+E(e):C(n)+C(e);case"%=":return C(n)%C(e);default:throw new h("UnsupportedOperator",r)}}async function Ue(e,t){const n=t.left;if("MemberExpression"===n.type){const r=await Se(e,n.object);let o;if(!0===n.computed)o=await Se(e,n.property);else{if("Identifier"!==n.property.type)throw new h("InvalidIdentifier",t);o=n.property.name}const a=await Se(e,t.right);if(re(r)){if(!oe(o))throw new h("ArrayAccessMustBeNumber",t);if(o<0&&(o=r.length+o),o<0||o>r.length)throw new h("OutOfBounds",t);if(o===r.length){if("="!==t.operator)throw new h("OutOfBounds",t);r[o]=Be(a,t.operator,r[o],t)}else r[o]=Be(a,t.operator,r[o],t)}else if(r instanceof m){if(!1===ne(o))throw new h("KeyAccessorMustBeString",t);if(!0===r.hasField(o))r.setField(o,Be(a,t.operator,r.field(o),t));else{if("="!==t.operator)throw new h("FieldNotFound",t,{key:o});r.setField(o,Be(a,t.operator,null,t))}}else if(r instanceof ge){if(!1===ne(o))throw new h("KeyAccessorMustBeString",t);if(!0!==r.hasGlobal(o))throw new h("ModuleExportNotFound",t);r.setGlobal(o,Be(a,t.operator,r.global(o),t))}else{if(!U(r))throw _(r)?new h("Immutable",t):new h("InvalidParameter",t);if(!1===ne(o))throw new h("KeyAccessorMustBeString",t);if(!0===r.hasField(o))r.setField(o,Be(a,t.operator,r.field(o),t));else{if("="!==t.operator)throw new h("FieldNotFound",t,{key:o});r.setField(o,Be(a,t.operator,null,t))}}return M}const r=ue(e,n),o=await Se(e,t.right);return r.scope[r.id]={value:Be(o,t.operator,"="!==t.operator?le(r.var).value:null,t)},M}async function _e(e,t){const n=await Se(e,t.expression);return n===M?M:new F(n)}async function Ge(e,t){const n=await Se(e,t.test);if(!0===n)return ke(e,t.consequent);if(!1===n)return null!==t.alternate?ke(e,t.alternate):M;throw new h("BooleanConditionRequired",t)}async function ze(e,t){return Le(e,t,0)}async function Le(e,t,n){if(n>=t.body.length)return M;const r=await ke(e,t.body[n]);return r instanceof k||r===O||r===N||n===t.body.length-1?r:Le(e,t,n+1)}async function Ze(e,t){if(null===t.argument)return new k(M);const n=await Se(e,t.argument);return new k(n)}async function qe(t,n){if(null!=t.localScope)throw ae().error("Function declarations are only valid in global scope."),new h("NeverReach",n);const r=e(n.id);if(!(r in t.globalScope))throw ae().error(`Function "${r}" not declared.`),new h("NeverReach",n);const o=s(n),a=n.params.map(t=>e(t)),i=Array.from(o.keys()).filter(e=>!a.includes(e));let c=null;return null!=t.contextScopeDebugInfo&&(c={declaredNames:new Map([...n.params.map(t=>[e(t),t.name]),...o])}),t.globalScope[r]={value:new me(n,t,a,i,c)},M}async function Pe(e,t){const n=ue(e,t.specifiers[0].local),r=e.libraryResolver;if(null==r)throw ae().error("Internal error: module loader not initialized"),new h("NeverReach",t);const o=r.loadLibrary(n.id);let a;return r._moduleSingletons?.has(o.uri)?a=r._moduleSingletons.get(o.uri):(a=await ge.load(e,o.syntax),r._moduleSingletons?.set(o.uri,a)),n.scope[n.id]={value:a},M}async function We(e,t){return await ke(e,t.declaration),M}async function Te(e,t){for(const n of t.declarations)await Ve(e,n);return M}async function Ve(e,t){t.breakpoint&&await xe(e,t.breakpoint);let n=null;n=null===t.init?null:await Se(e,t.init),n===M&&(n=null);const r=ue(e,t.id);r.scope[r.id]={value:n}}async function Ke(e,t){return $e(e,await Se(e,t.object),t)}async function $e(e,t,n){const r=n.computed?await Se(e,n.property):n.property.name;return f(t,r)}async function Ye(e,t,n){for(const r of n)switch(r.type){case"MemberExpression":t=await $e(e,t,r);break;case"CallExpression":t=await ot(e,t,r);break;default:throw new h("Unrecognized",r)}return t}async function He(e,t,n){const r=n.computed?await Se(e,n.property):n.property.name;return u(t,r)}async function Je(e,t){const n=i(t);let r=await Se(e,n.root);for(const o of n.sections){const t=await He(e,r,o.checked);if(null==t)return null;r=await Ye(e,t,o.unchecked)}return r}async function Qe(e,t){const n=await Se(e,t.argument);if(te(n)){if("!"===t.operator)return!n;if("-"===t.operator)return-1*C(n);if("+"===t.operator)return 1*C(n);if("~"===t.operator)return~C(n);throw new h("UnsupportUnaryOperator",t)}if("-"===t.operator)return-1*C(n);if("+"===t.operator)return 1*C(n);if("~"===t.operator)return~C(n);throw new h("UnsupportUnaryOperator",t)}async function Xe(e,t){const n=[];for(let r=0;r<t.elements.length;r++)n.push(await Se(e,t.elements[r]));for(let r=0;r<n.length;r++){if(j(n[r]))throw new h("NoFunctionInArray",t);n[r]===M&&(n[r]=null)}return n}async function et(e,t){const n=await Se(e,t.left),r=await Se(e,t.right);switch(t.operator){case"|":case"<<":case">>":case">>>":case"^":case"&":return B(C(n),C(r),t.operator);case"==":return D(n,r);case"!=":return!D(n,r);case"<":case">":case"<=":case">=":return A(n,r,t.operator);case"+":return ne(n)||ne(r)?E(n)+E(r):C(n)+C(r);case"-":return C(n)-C(r);case"*":return C(n)*C(r);case"/":return C(n)/C(r);case"%":return C(n)%C(r);default:throw t.operator,new h("UnsupportedOperator",t)}}async function tt(e,t){const n=await Se(e,t.left);if(!te(n))throw new h("LogicalExpressionOnlyBoolean",t);switch(t.operator){case"||":{if(!0===n)return n;const r=await Se(e,t.right);if(te(r))return r;throw new h("LogicExpressionOrAnd",t)}case"&&":{if(!1===n)return n;const r=await Se(e,t.right);if(te(r))return r;throw new h("LogicExpressionOrAnd",t)}default:throw t.operator,new h("LogicExpressionOrAnd",t)}}function nt(e,t){return fe(e,t)}async function rt(e,t){let n;if("Identifier"===t.callee.type){const r=t.callee;r.breakpoint&&await xe(e,r.breakpoint),n=fe(e,t.callee,"FunctionNotFound")}else n=await Se(e,t.callee);return ot(e,n,t)}async function ot(e,t,n){if(j(t))return t.call(e,n);throw new h("CallNonFunction",n)}async function at(e,t){let n="",r=0;for(const o of t.quasis)if(n+=o.value?o.value.cooked:"",!1===o.tail){if(t.expressions[r]){const o=await Se(e,t.expressions[r]);if(j(o))throw new h("NoFunctionInTemplateLiteral",t);n+=E(o)}r++}return n}async function it(e,t){R(null===t.arguments?[]:t.arguments,3,3,t);const n=await Se(e,t.arguments[0]);if(!1===te(n))throw new h("BooleanConditionRequired",t);return Se(e,n?t.arguments[1]:t.arguments[2])}async function st(e,t){R(null===t.arguments?[]:t.arguments,2,3,t);const n=await Se(e,t.arguments[0]);if(3===t.arguments.length){const r=await Se(e,t.arguments[1]),o=c(n,r);return null!=o&&""!==o?o:Se(e,t.arguments[2])}return null==n||""===n?Se(e,t.arguments[1]):n}async function ct(e,t){if(t.arguments.length<2)throw new h("WrongNumberOfParameters",t);if(2===t.arguments.length)return Se(e,t.arguments[1]);if((t.arguments.length-1)%2==0)throw new h("WrongNumberOfParameters",t);return lt(e,t,1,await Se(e,t.arguments[0]))}async function lt(e,t,n,r){const o=await Se(e,t.arguments[n]);if(D(o,r))return Se(e,t.arguments[n+1]);const a=t.arguments.length-n;return 1===a?Se(e,t.arguments[n]):2===a?null:3===a?Se(e,t.arguments[n+2]):lt(e,t,n+2,r)}async function ut(e,t){if(t.arguments.length<3)throw new h("WrongNumberOfParameters",t);if(t.arguments.length%2==0)throw new h("WrongNumberOfParameters",t);const n=await Se(e,t.arguments[0]);if(!1===te(n))throw new h("BooleanConditionRequired",t.arguments[0]);return ft(e,t,0,n)}async function ft(e,t,n,r){if(!0===r)return Se(e,t.arguments[n+1]);if(3===t.arguments.length-n)return Se(e,t.arguments[n+2]);const o=await Se(e,t.arguments[n+2]);if(!1===te(o))throw new h("ModuleExportNotFound",t.arguments[n+2]);return ft(e,t,n+2,o)}function pt(){const e=Object.create(null);W(e,de),H(e,de),T(e,de,nt),$(e,de),K(e,de),Y(e,de),J(e,de),V({functions:e,compiled:!1,signatures:null,evaluateIdentifier:null,mode:"async",standardFunction:de,standardFunctionAsync:be}),e.iif=it,e.defaultvalue=st,e.decode=ct,e.when=ut;const t=function(){this.textformatting={value:m.textFormatting()}};t.prototype=Object.create(null),t.prototype.infinity=Object.freeze({value:Number.POSITIVE_INFINITY}),t.prototype.nan=Object.freeze({value:Number.NaN}),t.prototype.pi=Object.freeze({value:Math.PI});for(const[n,r]of Object.entries(e))t.prototype[n]=Object.freeze({value:new y(r,n)});return t}const wt=pt();function dt(e){const t={mode:"async",compiled:!1,functions:Object.create(null),signatures:[],standardFunction:de,standardFunctionAsync:be,evaluateIdentifier:nt};for(let n=0;n<e.length;n++)e[n].registerFunctions(t);for(const[n,r]of Object.entries(t.functions))wt.prototype[n]=Object.freeze({value:new y(r,n)});for(let n=0;n<t.signatures.length;n++)Z(t.signatures[n],"async")}function mt(e){console.log(e)}function ht(n,i){const s=new Set(Object.keys(i?.vars||{}).map(t=>e(t))),c=new Set(Object.keys(i?.customfunctions||{}).map(t=>e(t))),{globals:l,exports:u}=o(n);let f=null;if(i?.breakpoints){for(const[e,t]of a(i.breakpoints,n))e.breakpoint=t;f={declaredNames:new Map(Object.keys(i?.vars||{}).map(t=>[e(t),t]).filter(([e])=>!l.has(e)))}}return async e=>{const o=e.spatialReference??X.WebMercator;let a=null;n.usesModules&&(a=new r(new Map,n.loadedModules));const i=new wt;null!=f&&(i[ie]={declaredNames:l});for(const t of c)null!=e.customfunctions&&t in e.customfunctions?i[t]={value:new y(e.customfunctions[t],t)}:i[t]=se;for(const t of s){if(null==e.vars||!(t in e.vars)){t in i||(i[t]=se);continue}const n=e.vars[t]??null;ee(n)?i[t]={value:b.createFromGraphic(n,e.timeZone??null)}:i[t]={value:n}}for(const t of l.keys())t in i||(i[t]=se);const p={lrucache:e.lrucache,interceptor:e.interceptor,services:e.services,console:e.console??mt,abortSignal:e.abortSignal??t,timeZone:e.timeZone??null,spatialReference:o,track:e.track,depthCounter:{depth:1},libraryResolver:a,exports:u,localScope:null,globalScope:i,contextScopeDebugInfo:f},w=await ze(p,n);if(w instanceof k||w instanceof F){const e=w.value;if(I(e))return null;if(j(e))throw new h("IllegalResult",null);return e}if(I(w))return null;if(w===O)throw new h("IllegalResult",null);if(w===N)throw new h("IllegalResult",null);throw new h("NeverReach",null)}}function gt(e,t){return ht(e,t)(t)}dt([P]),dt([q]);export{gt as executeScript,dt as extend,ht as prepareScript};
|
|
2
|
+
import{toSymbolId as e,neverAbortedSignal as t}from"./arcadeEnvironment.js";import{ArcadeModule as n}from"./ArcadeModule.js";import{ArcadeModuleLoader as r}from"./ArcadeModuleLoader.js";import{collectDeclaredGlobalNames as o,resolveBreakpoints as a,flattenAccessChain as i,collectDeclaredLocalNames as s}from"./compilerUtils.js";import{getNestedOptionalValue as c,getGeometryKeys as l,tryGetMember as u,getMember as f,getGeometryMember as p}from"./containerUtils.js";import{wrapDebugValue as w,renderFunctionDebugName as d}from"./debug.js";import m from"./Dictionary.js";import{ArcadeExecutionError as h,ensureLocatableError as g}from"./executionError.js";import{Feature as b}from"./Feature.js";import{NativeFunction as y,ScopeMarshalledFunction as v,ArcadeFunction as x,wrapModuleScopedResponse as S}from"./FunctionWrapper.js";import{R as k,I as F,u as I,i as j,C as O,D as N,x as M,E as R,v as C,w as E,y as A,z as D,A as B,h as U,g as _,B as G,k as z,f as L}from"../chunks/languageUtils.js";import{addFunctionDeclaration as Z}from"./treeAnalysis.js";import{A as P}from"../chunks/aiServices.js";import{A as q}from"../chunks/array.js";import{registerFunctions as W}from"./functions/date.js";import{registerFunctions as T}from"./functions/feature.js";import{registerFunctions as V}from"./functions/geomasync.js";import{registerFunctions as K}from"./functions/geometry.js";import{registerFunctions as $}from"./functions/maths.js";import{registerFunctions as Y}from"./functions/stats.js";import{registerFunctions as H}from"./functions/string.js";import{registerFunctions as J}from"./functions/track.js";import Q from"../core/Logger.js";import X from"../geometry/SpatialReference.js";import{isGraphic as ee}from"../support/graphicInstanceUtils.js";import{isBoolean as te,isString as ne,isArray as re,isNumber as oe}from"../support/guards.js";const ae=()=>Q.getLogger("esri.arcade.arcadeAsyncRuntime"),ie=Symbol("debugInfo"),se=Symbol("uninitialized");function ce(e){if(e===se)throw new h("InvalidIdentifier",null)}function le(e){return ce(e),e}function ue(t,n){const r=e(n);if(null!==t.localScope){const e=t.localScope[r];if(void 0!==e)return{scope:t.localScope,id:r,var:e}}const o=t.globalScope[r];if(void 0!==o)return{scope:t.globalScope,id:r,var:o};throw new h("InvalidIdentifier",n)}function fe(t,n,r="InvalidIdentifier"){const o=e(n);if(null!==t.localScope){const e=t.localScope[o];if(void 0!==e)return ce(e),e.value}const a=t.globalScope[o];if(void 0!==a)return ce(a),a.value;throw new h(r,n)}const pe=function(){};async function we(e,t){const n=[];for(let r=0;r<t.arguments.length;r++)n.push(await Se(e,t.arguments[r]));return n}async function de(e,t,n){if(!0===t.preparsed)return n(e,null,t.arguments);return n(e,t,await we(e,t))}pe.prototype=Object.freeze(Object.create(null));class me extends x{constructor(e,t,n,r,o){super(),this.definition=e,this.context=t,this._params=n,this._locals=r,this._debugInfo=o}get debugName(){return this.definition.id.name}createFunction(e){return(...t)=>{const n=new pe;n[ie]=this._debugInfo;const r={spatialReference:this.context.spatialReference,console:this.context.console,lrucache:this.context.lrucache,timeZone:this.context.timeZone??null,exports:this.context.exports,libraryResolver:this.context.libraryResolver,interceptor:this.context.interceptor,services:this.context.services,abortSignal:this.context.abortSignal,localScope:n,depthCounter:{depth:e.depthCounter.depth+1},globalScope:this.context.globalScope,contextScopeDebugInfo:this.context.contextScopeDebugInfo,track:this.context.track};if(r.depthCounter.depth>64)throw new h("MaximumCallDepth",null);return he(r,this.definition.body,this._params,this._locals,t,null)}}call(e,t){return be(e,t,(n,r,o)=>{const a=new pe;a[ie]=this._debugInfo;const i={spatialReference:e.spatialReference,services:e.services,console:e.console,libraryResolver:e.libraryResolver,exports:e.exports,lrucache:e.lrucache,timeZone:e.timeZone??null,interceptor:e.interceptor,localScope:a,abortSignal:e.abortSignal,globalScope:e.globalScope,contextScopeDebugInfo:e.contextScopeDebugInfo,depthCounter:{depth:e.depthCounter.depth+1},track:e.track};if(i.depthCounter.depth>64)throw new h("MaximumCallDepth",t);return he(i,this.definition.body,this._params,this._locals,o,t)})}marshalledCall(e,t,n,r){return r(e,t,async(o,a,i)=>{const s=new pe;s[ie]=this._debugInfo;const c={spatialReference:e.spatialReference,services:e.services,globalScope:n.globalScope,contextScopeDebugInfo:n.contextScopeDebugInfo,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,console:e.console,abortSignal:e.abortSignal,lrucache:e.lrucache,timeZone:e.timeZone??null,interceptor:e.interceptor,localScope:s,track:e.track};return i=i.map(t=>!j(t)||t instanceof v?t:S(t,e,r)),S(await he(c,this.definition.body,this._params,this._locals,i,t),n,r)})}}async function he(e,t,n,r,o,a){if(n.length!==o.length)throw new h("WrongNumberOfParameters",a);if(null!=e.localScope){for(let t=0;t<n.length;t++)e.localScope[n[t]]={value:o[t]};for(const t of r)e.localScope[t]=se}const i=await ke(e,t);if(i instanceof k)return i.value;if(i===O)throw new h("UnexpectedToken",a);if(i===N)throw new h("UnexpectedToken",a);return i instanceof F?i.value:i}class ge extends n{constructor(e){super(),this.moduleGlobalContext=e}global(t){const n=e(t);if(!this.moduleGlobalContext.exports.has(n))throw new h("ModuleExportNotFound",null);const r=this.moduleGlobalContext.globalScope[n];if(ce(r),j(r.value)&&!(r.value instanceof v)){const e=new v;return e.fn=r.value,e.parameterEvaluator=de,e.context=this.moduleGlobalContext,this.moduleGlobalContext.globalScope[n]={value:e},e}return r.value}setGlobal(t,n){if(j(n))throw new h("AssignModuleFunction",null);const r=e(t);if(!this.moduleGlobalContext.exports.has(r))throw new h("ModuleExportNotFound",null);this.moduleGlobalContext.globalScope[r]={value:n}}hasGlobal(t){return this.moduleGlobalContext.exports.has(e(t))}static async load(e,n){const{globals:a,exports:i}=o(n),s=new wt;null!=e.contextScopeDebugInfo&&(s[ie]={declaredNames:a});for(const t of a.keys())t in s||(s[t]=se);const c=e.spatialReference??X.WebMercator,l={lrucache:e.lrucache,interceptor:e.interceptor,services:e.services,console:e.console??mt,abortSignal:e.abortSignal??t,timeZone:e.timeZone??null,spatialReference:c,track:null,depthCounter:{depth:1},libraryResolver:new r(e.libraryResolver._moduleSingletons,n.loadedModules),exports:i,localScope:null,globalScope:s,contextScopeDebugInfo:null!=e.contextScopeDebugInfo?{declaredNames:new Map}:null};return await ze(l,n),new ge(l)}}async function be(e,t,n){if(!0===t.preparsed)return n(e,null,t.arguments);return n(e,t,await we(e,t))}function ye(e,t,n){const r=new Map;if(t)for(const[o,a]of t.declaredNames){const t=e[o];r.set(a,null==t||t===se?null:w(t.value,n))}else for(const o of Object.getOwnPropertyNames(e)){const t=e[o];r.set(o,t===se?null:w(t.value,n))}return r}function ve(e){return e instanceof me?`ƒ ${e.debugName}(${e.definition.params.map(e=>e.name).join(", ")})`:d(e)}function xe(e,t){const n=e.services?.debugger;if(null==n)return;const r={renderFunction:ve,defaultTimeZone:e.timeZone??"system"};return n.pause(t,{profile:null!=e.contextScopeDebugInfo?ye(e.globalScope,e.contextScopeDebugInfo,r):new Map,globals:ye(e.globalScope,e.globalScope[ie],r),locals:null==e.localScope?null:ye(e.localScope,e.localScope[ie],r)})}async function Se(e,t){t.breakpoint&&await xe(e,t.breakpoint);try{switch(t.type){case"UpdateExpression":return await De(e,t);case"AssignmentExpression":return await Ue(e,t);case"TemplateLiteral":return await at(e,t);case"Identifier":return nt(e,t);case"MemberExpression":return await Ke(e,t);case"Literal":return t.value;case"CallExpression":return await rt(e,t);case"UnaryExpression":return await Qe(e,t);case"BinaryExpression":return await et(e,t);case"LogicalExpression":return await tt(e,t);case"ArrayExpression":return await Xe(e,t);case"ObjectExpression":return await Fe(e,t);case"MemberAccessChainExpression":return await Je(e,t);case"SafeMemberExpression":throw ae().error("SafeMemberExpression outside of MemberAccessChainExpression"),new h("Unrecognized",t);default:throw new h("Unrecognized",t)}}catch(n){throw g(n,t)}}async function ke(e,t){t.breakpoint&&await xe(e,t.breakpoint);try{switch(t.type){case"ImportDeclaration":return await qe(e,t);case"ExportNamedDeclaration":return await We(e,t);case"VariableDeclaration":return await Te(e,t);case"BlockStatement":return await ze(e,t);case"FunctionDeclaration":return await Pe(e,t);case"ReturnStatement":return await Ze(e,t);case"IfStatement":return await Ge(e,t);case"ExpressionStatement":return await _e(e,t);case"ForStatement":return await je(e,t);case"WhileStatement":return await Ie(e,t);case"ForInStatement":return await Ee(e,t);case"ForOfStatement":return await Ae(e,t);case"BreakStatement":return O;case"EmptyStatement":return M;case"ContinueStatement":return N;default:throw new h("Unrecognized",t)}}catch(n){throw g(n,t)}}async function Fe(e,t){const n=[];for(let i=0;i<t.properties.length;i++){const r=t.properties[i],o=await Se(e,r.value),a="Identifier"===r.key.type?r.key.name:await Se(e,r.key);n[i]={key:a,value:o}}const r=Object.create(null),o=new Map;for(let i=0;i<n.length;i++){const e=n[i];if(j(e.value))throw new h("NoFunctionInDictionary",t);if(!1===ne(e.key))throw new h("KeyMustBeString",t);let a=e.key.toString();const s=a.toLowerCase();o.has(s)?a=o.get(s):o.set(s,a),e.value===M?r[a]=null:r[a]=e.value}const a=new m(r);return a.immutable=!1,a}async function Ie(e,t){let n=await Se(e,t.test);if(!1===n)return M;if(!0!==n)throw new h("BooleanConditionRequired",t);for(;!0===n;){const r=await ke(e,t.body);if(r===O)break;if(r instanceof k)return r;if(n=await Se(e,t.test),!0!==n&&!1!==n)throw new h("BooleanConditionRequired",t)}return M}async function je(e,t){try{for(null!==t.init&&("VariableDeclaration"===t.init.type?await ke(e,t.init):await Se(e,t.init));;){if(null!==t.test){const n=await Se(e,t.test);if(!0===e.abortSignal?.aborted)throw new h("Cancelled",t);if(!1===n)break;if(!0!==n)throw new h("BooleanConditionRequired",t)}const n=await ke(e,t.body);if(n===O)break;if(n instanceof k)return n;null!==t.update&&await Se(e,t.update)}return M}catch(n){throw n}}async function Oe(e,t,n,r,o="i"){const a=n.length;for(let i=0;i<a;i++){if("k"===o){if(i>=n.length)throw new h("OutOfBounds",t);r.scope[r.id]={value:n[i]}}else r.scope[r.id]={value:i};const a=await ke(e,t.body);if(a===O)break;if(a instanceof k)return a}return M}async function Ne(e,t,n,r,o="i"){const a=n.length();for(let i=0;i<a;i++){r.scope[r.id]="k"===o?{value:n.get(i)}:{value:i};const a=await ke(e,t.body);if(a===O)break;if(a instanceof k)return a}return M}async function Me(e,t,n,r){e:for await(const o of await n.queryAll(e.abortSignal))for(const a of o){r.scope[r.id]={value:b.createFromGraphicLikeObject(a.geometry,a.attributes,n,e.timeZone)};const o=await ke(e,t.body);if(o===O)break e;if(o instanceof k)return o}return M}async function Re(e,t,n,r){for(const o of n.keys()){const a=n.field(o);r.scope[r.id]={value:m.containerEntry(o,a)};const i=await ke(e,t.body);if(i===O)break;if(i instanceof k)return i}return M}async function Ce(e,t,n,r){for(const o of l(n)){const a=p(n,o,t);r.scope[r.id]={value:m.containerEntry(o,a)};const i=await ke(e,t.body);if(i===O)break;if(i instanceof k)return i}return M}async function Ee(e,t){const n=await Se(e,t.right);"VariableDeclaration"===t.left.type&&await ke(e,t.left);const r=ue(e,"VariableDeclaration"===t.left.type?t.left.declarations[0].id:t.left);return re(n)||ne(n)?await Oe(e,t,n,r):_(n)?await Ne(e,t,n,r):n instanceof m||G(n)?await Oe(e,t,n.keys(),r,"k"):z(n)?await Me(e,t,n,r):L(n)?await Oe(e,t,l(n),r,"k"):M}async function Ae(e,t){const n=await Se(e,t.right);"VariableDeclaration"===t.left.type&&await ke(e,t.left);const r=ue(e,"VariableDeclaration"===t.left.type?t.left.declarations[0].id:t.left);return re(n)||ne(n)?await Oe(e,t,n,r,"k"):_(n)?await Ne(e,t,n,r,"k"):n instanceof m||G(n)?await Re(e,t,n,r):z(n)?await Me(e,t,n,r):L(n)?await Ce(e,t,n,r):M}async function De(e,t){const n=t.argument;if("CallExpression"===n.type)throw new h("NeverReach",t);if("MemberExpression"===n.type){const r=await Se(e,n.object);let o,a;if(!0===n.computed)o=await Se(e,n.property);else{if("Identifier"!==n.property.type)throw new h("Unrecognized",t);o=n.property.name}if(re(r)){if(!oe(o))throw new h("ArrayAccessMustBeNumber",t);if(o<0&&(o=r.length+o),o<0||o>=r.length)throw new h("OutOfBounds",t);a=C(r[o]),r[o]="++"===t.operator?a+1:a-1}else if(r instanceof m){if(!1===ne(o))throw new h("KeyAccessorMustBeString",t);if(!0!==r.hasField(o))throw new h("FieldNotFound",t,{key:o});a=C(r.field(o)),r.setField(o,"++"===t.operator?a+1:a-1)}else if(r instanceof ge){if(!1===ne(o))throw new h("ModuleAccessorMustBeString",t);if(!0!==r.hasGlobal(o))throw new h("ModuleExportNotFound",t);a=C(r.global(o)),r.setGlobal(o,"++"===t.operator?a+1:a-1)}else{if(!U(r))throw _(r)?new h("Immutable",t):new h("InvalidParameter",t);if(!1===ne(o))throw new h("KeyAccessorMustBeString",t);if(!0!==r.hasField(o))throw new h("FieldNotFound",t,{key:o});a=C(r.field(o)),r.setField(o,"++"===t.operator?a+1:a-1)}return!1===t.prefix?a:"++"===t.operator?a+1:a-1}const r=ue(e,n),o=C(le(r.var).value),a="++"===t.operator?o+1:o-1;return r.scope[r.id]={value:a},!1===t.prefix?o:"++"===t.operator?o+1:o-1}function Be(e,t,n,r){switch(t){case"=":return e===M?null:e;case"/=":return C(n)/C(e);case"*=":return C(n)*C(e);case"-=":return C(n)-C(e);case"+=":return ne(n)||ne(e)?E(n)+E(e):C(n)+C(e);case"%=":return C(n)%C(e);default:throw new h("UnsupportedOperator",r)}}async function Ue(e,t){const n=t.left;if("MemberExpression"===n.type){const r=await Se(e,n.object);let o;if(!0===n.computed)o=await Se(e,n.property);else{if("Identifier"!==n.property.type)throw new h("InvalidIdentifier",t);o=n.property.name}const a=await Se(e,t.right);if(re(r)){if(!oe(o))throw new h("ArrayAccessMustBeNumber",t);if(o<0&&(o=r.length+o),o<0||o>r.length)throw new h("OutOfBounds",t);if(o===r.length){if("="!==t.operator)throw new h("OutOfBounds",t);r[o]=Be(a,t.operator,r[o],t)}else r[o]=Be(a,t.operator,r[o],t)}else if(r instanceof m){if(!1===ne(o))throw new h("KeyAccessorMustBeString",t);if(!0===r.hasField(o))r.setField(o,Be(a,t.operator,r.field(o),t));else{if("="!==t.operator)throw new h("FieldNotFound",t,{key:o});r.setField(o,Be(a,t.operator,null,t))}}else if(r instanceof ge){if(!1===ne(o))throw new h("KeyAccessorMustBeString",t);if(!0!==r.hasGlobal(o))throw new h("ModuleExportNotFound",t);r.setGlobal(o,Be(a,t.operator,r.global(o),t))}else{if(!U(r))throw _(r)?new h("Immutable",t):new h("InvalidParameter",t);if(!1===ne(o))throw new h("KeyAccessorMustBeString",t);if(!0===r.hasField(o))r.setField(o,Be(a,t.operator,r.field(o),t));else{if("="!==t.operator)throw new h("FieldNotFound",t,{key:o});r.setField(o,Be(a,t.operator,null,t))}}return M}const r=ue(e,n),o=await Se(e,t.right);return r.scope[r.id]={value:Be(o,t.operator,"="!==t.operator?le(r.var).value:null,t)},M}async function _e(e,t){const n=await Se(e,t.expression);return n===M?M:new F(n)}async function Ge(e,t){const n=await Se(e,t.test);if(!0===n)return ke(e,t.consequent);if(!1===n)return null!==t.alternate?ke(e,t.alternate):M;throw new h("BooleanConditionRequired",t)}async function ze(e,t){return Le(e,t,0)}async function Le(e,t,n){if(n>=t.body.length)return M;const r=await ke(e,t.body[n]);return r instanceof k||r===O||r===N||n===t.body.length-1?r:Le(e,t,n+1)}async function Ze(e,t){if(null===t.argument)return new k(M);const n=await Se(e,t.argument);return new k(n)}async function Pe(t,n){if(null!=t.localScope)throw ae().error("Function declarations are only valid in global scope."),new h("NeverReach",n);const r=e(n.id);if(!(r in t.globalScope))throw ae().error(`Function "${r}" not declared.`),new h("NeverReach",n);const o=s(n),a=n.params.map(t=>e(t)),i=Array.from(o.keys()).filter(e=>!a.includes(e));let c=null;return null!=t.contextScopeDebugInfo&&(c={declaredNames:new Map([...n.params.map(t=>[e(t),t.name]),...o])}),t.globalScope[r]={value:new me(n,t,a,i,c)},M}async function qe(e,t){const n=ue(e,t.specifiers[0].local),r=e.libraryResolver;if(null==r)throw ae().error("Internal error: module loader not initialized"),new h("NeverReach",t);const o=r.loadLibrary(n.id);let a;return r._moduleSingletons?.has(o.uri)?a=r._moduleSingletons.get(o.uri):(a=await ge.load(e,o.syntax),r._moduleSingletons?.set(o.uri,a)),n.scope[n.id]={value:a},M}async function We(e,t){return await ke(e,t.declaration),M}async function Te(e,t){for(const n of t.declarations)await Ve(e,n);return M}async function Ve(e,t){t.breakpoint&&await xe(e,t.breakpoint);let n=null;n=null===t.init?null:await Se(e,t.init),n===M&&(n=null);const r=ue(e,t.id);r.scope[r.id]={value:n}}async function Ke(e,t){return $e(e,await Se(e,t.object),t)}async function $e(e,t,n){const r=n.computed?await Se(e,n.property):n.property.name;return f(t,r)}async function Ye(e,t,n){for(const r of n)switch(r.type){case"MemberExpression":t=await $e(e,t,r);break;case"CallExpression":t=await ot(e,t,r);break;default:throw new h("Unrecognized",r)}return t}async function He(e,t,n){const r=n.computed?await Se(e,n.property):n.property.name;return u(t,r)}async function Je(e,t){const n=i(t);let r=await Se(e,n.root);for(const o of n.sections){const t=await He(e,r,o.checked);if(null==t)return null;r=await Ye(e,t,o.unchecked)}return r}async function Qe(e,t){const n=await Se(e,t.argument);if(te(n)){if("!"===t.operator)return!n;if("-"===t.operator)return-1*C(n);if("+"===t.operator)return 1*C(n);if("~"===t.operator)return~C(n);throw new h("UnsupportUnaryOperator",t)}if("-"===t.operator)return-1*C(n);if("+"===t.operator)return 1*C(n);if("~"===t.operator)return~C(n);throw new h("UnsupportUnaryOperator",t)}async function Xe(e,t){const n=[];for(let r=0;r<t.elements.length;r++)n.push(await Se(e,t.elements[r]));for(let r=0;r<n.length;r++){if(j(n[r]))throw new h("NoFunctionInArray",t);n[r]===M&&(n[r]=null)}return n}async function et(e,t){const n=await Se(e,t.left),r=await Se(e,t.right);switch(t.operator){case"|":case"<<":case">>":case">>>":case"^":case"&":return B(C(n),C(r),t.operator);case"==":return D(n,r);case"!=":return!D(n,r);case"<":case">":case"<=":case">=":return A(n,r,t.operator);case"+":return ne(n)||ne(r)?E(n)+E(r):C(n)+C(r);case"-":return C(n)-C(r);case"*":return C(n)*C(r);case"/":return C(n)/C(r);case"%":return C(n)%C(r);default:throw t.operator,new h("UnsupportedOperator",t)}}async function tt(e,t){const n=await Se(e,t.left);if(!te(n))throw new h("LogicalExpressionOnlyBoolean",t);switch(t.operator){case"||":{if(!0===n)return n;const r=await Se(e,t.right);if(te(r))return r;throw new h("LogicExpressionOrAnd",t)}case"&&":{if(!1===n)return n;const r=await Se(e,t.right);if(te(r))return r;throw new h("LogicExpressionOrAnd",t)}default:throw t.operator,new h("LogicExpressionOrAnd",t)}}function nt(e,t){return fe(e,t)}async function rt(e,t){let n;if("Identifier"===t.callee.type){const r=t.callee;r.breakpoint&&await xe(e,r.breakpoint),n=fe(e,t.callee,"FunctionNotFound")}else n=await Se(e,t.callee);return ot(e,n,t)}async function ot(e,t,n){if(j(t))return t.call(e,n);throw new h("CallNonFunction",n)}async function at(e,t){let n="",r=0;for(const o of t.quasis)if(n+=o.value?o.value.cooked:"",!1===o.tail){if(t.expressions[r]){const o=await Se(e,t.expressions[r]);if(j(o))throw new h("NoFunctionInTemplateLiteral",t);n+=E(o)}r++}return n}async function it(e,t){R(null===t.arguments?[]:t.arguments,3,3,t);const n=await Se(e,t.arguments[0]);if(!1===te(n))throw new h("BooleanConditionRequired",t);return Se(e,n?t.arguments[1]:t.arguments[2])}async function st(e,t){R(null===t.arguments?[]:t.arguments,2,3,t);const n=await Se(e,t.arguments[0]);if(3===t.arguments.length){const r=await Se(e,t.arguments[1]),o=c(n,r);return null!=o&&""!==o?o:Se(e,t.arguments[2])}return null==n||""===n?Se(e,t.arguments[1]):n}async function ct(e,t){if(t.arguments.length<2)throw new h("WrongNumberOfParameters",t);if(2===t.arguments.length)return Se(e,t.arguments[1]);if((t.arguments.length-1)%2==0)throw new h("WrongNumberOfParameters",t);return lt(e,t,1,await Se(e,t.arguments[0]))}async function lt(e,t,n,r){const o=await Se(e,t.arguments[n]);if(D(o,r))return Se(e,t.arguments[n+1]);const a=t.arguments.length-n;return 1===a?Se(e,t.arguments[n]):2===a?null:3===a?Se(e,t.arguments[n+2]):lt(e,t,n+2,r)}async function ut(e,t){if(t.arguments.length<3)throw new h("WrongNumberOfParameters",t);if(t.arguments.length%2==0)throw new h("WrongNumberOfParameters",t);const n=await Se(e,t.arguments[0]);if(!1===te(n))throw new h("BooleanConditionRequired",t.arguments[0]);return ft(e,t,0,n)}async function ft(e,t,n,r){if(!0===r)return Se(e,t.arguments[n+1]);if(3===t.arguments.length-n)return Se(e,t.arguments[n+2]);const o=await Se(e,t.arguments[n+2]);if(!1===te(o))throw new h("ModuleExportNotFound",t.arguments[n+2]);return ft(e,t,n+2,o)}function pt(){const e=Object.create(null);W(e,de),H(e,de),T(e,de,nt),$(e,de),K(e,de),Y(e,de),J(e,de),V({functions:e,compiled:!1,signatures:null,evaluateIdentifier:null,mode:"async",standardFunction:de,standardFunctionAsync:be}),e.iif=it,e.defaultvalue=st,e.decode=ct,e.when=ut;const t=function(){this.textformatting={value:m.textFormatting()}};t.prototype=Object.create(null),t.prototype.infinity=Object.freeze({value:Number.POSITIVE_INFINITY}),t.prototype.nan=Object.freeze({value:Number.NaN}),t.prototype.pi=Object.freeze({value:Math.PI});for(const[n,r]of Object.entries(e))t.prototype[n]=Object.freeze({value:new y(r,n)});return t}const wt=pt();function dt(e){const t={mode:"async",compiled:!1,functions:Object.create(null),signatures:[],standardFunction:de,standardFunctionAsync:be,evaluateIdentifier:nt};for(let n=0;n<e.length;n++)e[n].registerFunctions(t);for(const[n,r]of Object.entries(t.functions))wt.prototype[n]=Object.freeze({value:new y(r,n)});for(let n=0;n<t.signatures.length;n++)Z(t.signatures[n],"async")}function mt(e){console.log(e)}function ht(n,i){const s=new Set(Object.keys(i?.vars||{}).map(t=>e(t))),c=new Set(Object.keys(i?.customfunctions||{}).map(t=>e(t))),{globals:l,exports:u}=o(n);let f=null;if(i?.breakpoints){for(const[e,t]of a(i.breakpoints,n))e.breakpoint=t;f={declaredNames:new Map(Object.keys(i?.vars||{}).map(t=>[e(t),t]).filter(([e])=>!l.has(e)))}}return async e=>{const o=e.spatialReference??X.WebMercator;let a=null;n.usesModules&&(a=new r(new Map,n.loadedModules));const i=new wt;null!=f&&(i[ie]={declaredNames:l});for(const t of c)null!=e.customfunctions&&t in e.customfunctions?i[t]={value:new y(e.customfunctions[t],t)}:i[t]=se;for(const t of s){if(null==e.vars||!(t in e.vars)){t in i||(i[t]=se);continue}const n=e.vars[t]??null;ee(n)?i[t]={value:b.createFromGraphic(n,e.timeZone??null)}:i[t]={value:n}}for(const t of l.keys())t in i||(i[t]=se);const p={lrucache:e.lrucache,interceptor:e.interceptor,services:e.services,console:e.console??mt,abortSignal:e.abortSignal??t,timeZone:e.timeZone??null,spatialReference:o,track:e.track,depthCounter:{depth:1},libraryResolver:a,exports:u,localScope:null,globalScope:i,contextScopeDebugInfo:f},w=await ze(p,n);if(w instanceof k||w instanceof F){const e=w.value;if(I(e))return null;if(j(e))throw new h("IllegalResult",null);return e}if(I(w))return null;if(w===O)throw new h("IllegalResult",null);if(w===N)throw new h("IllegalResult",null);throw new h("NeverReach",null)}}function gt(e,t){return ht(e,t)(t)}dt([q]),dt([P]);export{gt as executeScript,dt as extend,ht as prepareScript};
|