@arcgis/core 5.2.0-next.69 → 5.2.0-next.70
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/Basemap.js +1 -1
- package/Ground.js +1 -1
- package/WebDocument2D.js +1 -1
- package/WebScene.js +1 -1
- package/applications/Components/analysisUtils.js +1 -1
- package/applications/Components/arcadeEditorUtils.js +1 -1
- package/applications/Components/testUtils.js +1 -1
- package/applications/Urban/meshUtils.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/functions/geomasync.js +1 -1
- package/arcade/functions/geomsync.js +1 -1
- package/arcade/functions/knowledgegraph.js +1 -1
- package/arcade/functions/track.js +1 -1
- package/arcade/geometry/operators.js +1 -1
- package/arcade/geometry/operatorsWorker.js +1 -1
- package/arcade/geometry/rotate.js +2 -0
- package/arcade/geometry/unitConversion.js +1 -1
- package/arcgisGlobal.d.ts +1 -0
- package/assets/components/assets/icon/loadConfiguration16.json +1 -0
- package/assets/components/assets/icon/loadConfiguration24.json +1 -0
- package/assets/components/assets/icon/loadConfiguration32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{bece22668622a9a6bfe2.js → 011281fe918c4f0aec5d.js} +1 -1
- package/assets/esri/core/workers/chunks/01c92e68fb17cf2d0e08.js +1 -0
- package/assets/esri/core/workers/chunks/02dd79beb13eff6be85e.js +1 -0
- package/assets/esri/core/workers/chunks/0623acb2bd14a61b65c9.js +29 -0
- package/assets/esri/core/workers/chunks/065e3353124fc5ac44ce.js +1 -0
- package/assets/esri/core/workers/chunks/06c9aac75a01d3af6d54.js +1 -0
- package/assets/esri/core/workers/chunks/073f1d5f89875c6aefb1.js +1 -0
- package/assets/esri/core/workers/chunks/{d583bcea4d1a21da9147.js → 0846855843f85661e974.js} +1 -1
- package/assets/esri/core/workers/chunks/{7a818499c1079906c2d7.js → 089f8c60e96d920a2cb2.js} +1 -1
- package/assets/esri/core/workers/chunks/09653bd2a31d293a10d9.js +2 -0
- package/assets/esri/core/workers/chunks/0ae0483b72f5e8d00d55.js +1 -0
- package/assets/esri/core/workers/chunks/0aedeb837399d3f92e4a.js +1 -0
- package/assets/esri/core/workers/chunks/0b18de5147d76b68896f.js +1 -0
- package/assets/esri/core/workers/chunks/{f5d809d30cbb56be852d.js → 0e333aced8b23aa49a0e.js} +1 -1
- package/assets/esri/core/workers/chunks/{dad39ddf0f8dfb0bef47.js → 0eaa8265a4cd64297545.js} +1 -1
- package/assets/esri/core/workers/chunks/{4e1b087453fc5e20e961.js → 118ccfa2d685764752ee.js} +1 -1
- package/assets/esri/core/workers/chunks/158d2ac0333d53556e33.js +1 -0
- package/assets/esri/core/workers/chunks/160b204cbf5bda2a29e9.js +1 -0
- package/assets/esri/core/workers/chunks/16cade1c2ddf44e336ee.js +1 -0
- package/assets/esri/core/workers/chunks/19233d0016e5b154c5ce.js +1 -0
- package/assets/esri/core/workers/chunks/19cb8963d5ec2246357b.js +1 -0
- package/assets/esri/core/workers/chunks/{0ae35b02dda9b9662560.js → 1ac8a7a129ba33e05a24.js} +1 -1
- package/assets/esri/core/workers/chunks/1b130af7d14eaae69d96.js +1 -0
- package/assets/esri/core/workers/chunks/1ca04ecf010e68863014.js +1 -0
- package/assets/esri/core/workers/chunks/1cc063aa2ddf44bbd515.js +1 -0
- package/assets/esri/core/workers/chunks/{c055c16379f5bb56e930.js → 1d92d53186debd52e753.js} +1 -1
- package/assets/esri/core/workers/chunks/{37a8cfec11057947b45f.js → 1dba93abe84d30f05d8d.js} +1 -1
- package/assets/esri/core/workers/chunks/1e0140556c2e3fa72545.js +1 -0
- package/assets/esri/core/workers/chunks/1e5cb72830c7f32f2961.js +1 -0
- package/assets/esri/core/workers/chunks/{510acf2e8781be9b0dba.js → 1f888f026b004447772c.js} +1 -1
- package/assets/esri/core/workers/chunks/2033e6d42453e4e67048.js +1 -0
- package/assets/esri/core/workers/chunks/24006cea112d657f053a.js +1 -0
- package/assets/esri/core/workers/chunks/{7b531feba4fd662575f9.js → 28924f31f5ba8ebdc60a.js} +1 -1
- package/assets/esri/core/workers/chunks/{893ffc38e1a43de5b63d.js → 28b09fe50b855a1d8a3f.js} +1 -1
- package/assets/esri/core/workers/chunks/{b9c7aa04861f545a559c.js → 2bcb7e43578124538c3c.js} +1 -1
- package/assets/esri/core/workers/chunks/2bdb9b5365869081c936.js +1 -0
- package/assets/esri/core/workers/chunks/{df89bf05c18f0c8e418b.js → 2cfe6f41865ffb3a4645.js} +1 -1
- package/assets/esri/core/workers/chunks/{63858dfcff1177e597e7.js → 2d1ae18a28491b00091d.js} +1 -1
- package/assets/esri/core/workers/chunks/2d3a18d56e2e5669c562.js +1 -0
- package/assets/esri/core/workers/chunks/2d45daacec0d5ed38782.js +1 -0
- package/assets/esri/core/workers/chunks/2f58e1f64df2da8259a2.js +1 -0
- package/assets/esri/core/workers/chunks/31669511cfddf116d991.js +1 -0
- package/assets/esri/core/workers/chunks/32f5112c848efec6c33b.js +1 -0
- package/assets/esri/core/workers/chunks/33e293836f5d28dc5d62.js +1 -0
- package/assets/esri/core/workers/chunks/{59a795eba31061dc357a.js → 359584a8fb5687a7d098.js} +1 -1
- package/assets/esri/core/workers/chunks/{9c5dff4f13102871786e.js → 36171c72a3c04b0d13ef.js} +1 -1
- package/assets/esri/core/workers/chunks/38660a8cc3623c854d88.js +1 -0
- package/assets/esri/core/workers/chunks/3978f00a03e97645b276.js +1 -0
- package/assets/esri/core/workers/chunks/3b14ed3184743df336a6.js +1 -0
- package/assets/esri/core/workers/chunks/{f82cd34a79c8aa58d40c.js → 3b3a8a6167f2e1eeb828.js} +2 -2
- package/assets/esri/core/workers/chunks/3d6b2d5ae647e140abaf.js +1 -0
- package/assets/esri/core/workers/chunks/3dc71e03a630dd50b28e.js +1 -0
- package/assets/esri/core/workers/chunks/3de6e54b6ed0feae1940.js +1 -0
- package/assets/esri/core/workers/chunks/3dff36f6de181d9dcdc5.js +1 -0
- package/assets/esri/core/workers/chunks/3fd022df127af32782ce.js +1 -0
- package/assets/esri/core/workers/chunks/40693ee558a1eb1e93f4.js +1 -0
- package/assets/esri/core/workers/chunks/4344ab1250a1c550bf8b.js +1 -0
- package/assets/esri/core/workers/chunks/4491dc227c28e2ab4f8e.js +1 -0
- package/assets/esri/core/workers/chunks/{909e88c27d80777b047c.js → 463747a822499dd933ef.js} +1 -1
- package/assets/esri/core/workers/chunks/4695cd6120f60b234d5c.js +1 -0
- package/assets/esri/core/workers/chunks/4823e77515f451628fad.js +1 -0
- package/assets/esri/core/workers/chunks/484b3e2a220c440ccbb4.js +1 -0
- package/assets/esri/core/workers/chunks/4c2794687aea172775a0.js +1 -0
- package/assets/esri/core/workers/chunks/{b5b698008b8f3f4d5d61.js → 4ce57dd39075e8fb357c.js} +1 -1
- package/assets/esri/core/workers/chunks/4da993c79b373b9d304e.js +2 -0
- package/assets/esri/core/workers/chunks/4da993c79b373b9d304e.js.LICENSE.txt +4 -0
- package/assets/esri/core/workers/chunks/4e129b9f5772a06e580c.js +1 -0
- package/assets/esri/core/workers/chunks/50e0dd74795978468625.js +1 -0
- package/assets/esri/core/workers/chunks/{0a98a13418f53082ca7a.js → 5459ba8fdeb2370bb52b.js} +1 -1
- package/assets/esri/core/workers/chunks/582a1d468089b9986416.js +1 -0
- package/assets/esri/core/workers/chunks/5e3d5347223f0111f40f.js +1 -0
- package/assets/esri/core/workers/chunks/{bfb626805405646a0419.js → 5eb29f0068f1c839d05e.js} +1 -1
- package/assets/esri/core/workers/chunks/5f201c77a09ae0df29d6.js +1 -0
- package/assets/esri/core/workers/chunks/{6d5038d4351fe29e2718.js → 5fb76575575fe8cfb1f0.js} +1 -1
- package/assets/esri/core/workers/chunks/6072c63a5da4366e9942.js +1 -0
- package/assets/esri/core/workers/chunks/6080e46fc79127500283.js +1 -0
- package/assets/esri/core/workers/chunks/623d5518bca227f643bd.js +1 -0
- package/assets/esri/core/workers/chunks/62811bca7ad2100c023c.js +1 -0
- package/assets/esri/core/workers/chunks/6357c7cac401aee9fe77.js +1 -0
- package/assets/esri/core/workers/chunks/{91c543443cd6768ad6ff.js → 6525c925bb91facb3575.js} +1 -1
- package/assets/esri/core/workers/chunks/67d3ff7fcefaa7d5d27f.js +1 -0
- package/assets/esri/core/workers/chunks/{b5571e93bc136dac8ee1.js → 67ebde34377f98d17cda.js} +1 -1
- package/assets/esri/core/workers/chunks/687cf21e027f49b44d22.js +1 -0
- package/assets/esri/core/workers/chunks/{6b0acd1a7dd74a7367e0.js → 694371f51c52a7a94da4.js} +1 -1
- package/assets/esri/core/workers/chunks/6a9002fcba11e2cf3f2e.js +1 -0
- package/assets/esri/core/workers/chunks/{f4e813ead56d963b16b8.js → 6b208bac120bcfecd9e4.js} +1 -1
- package/assets/esri/core/workers/chunks/6cd6d0cfd313f0475d98.js +1 -0
- package/assets/esri/core/workers/chunks/6f58cb9dffe8016397a2.js +1 -0
- package/assets/esri/core/workers/chunks/7260e63252fa5452dc22.js +1 -0
- package/assets/esri/core/workers/chunks/72dcd4bd1a28bf8605c5.js +1 -0
- package/assets/esri/core/workers/chunks/73f77f5a6907cb8d9a35.js +1 -0
- package/assets/esri/core/workers/chunks/77df0bb35d2688729479.js +1 -0
- package/assets/esri/core/workers/chunks/{09c43bcb09aad02e83a9.js → 7a143ca61c0a70306185.js} +1 -1
- package/assets/esri/core/workers/chunks/7ca9c908432b1afa0367.js +1 -0
- package/assets/esri/core/workers/chunks/{ec2e0b2e31fd53b81d0a.js → 7ddf9b2718dd047f15e6.js} +1 -1
- package/assets/esri/core/workers/chunks/7f208ef75ef2ce0d7cf9.js +1 -0
- package/assets/esri/core/workers/chunks/7f4a592bcf4ecb55949a.js +1 -0
- package/assets/esri/core/workers/chunks/7f91e45156bbe88f9a62.js +1 -0
- package/assets/esri/core/workers/chunks/864691186c449ca2c3db.js +1 -0
- package/assets/esri/core/workers/chunks/869d292a60747c93dc84.js +1 -0
- package/assets/esri/core/workers/chunks/{7e2794705b4e679fcb3f.js → 86a4057572755b403548.js} +1 -1
- package/assets/esri/core/workers/chunks/{99772ce7e628364434fa.js → 8c1bddc88cc5f4251021.js} +1 -1
- package/assets/esri/core/workers/chunks/8c76f31a363dd0c3354d.js +1 -0
- package/assets/esri/core/workers/chunks/8eecc6df6511c8830f5d.js +1 -0
- package/assets/esri/core/workers/chunks/{0da4816c11b45b4a6289.js → 8fea514aada1195c8f30.js} +1 -1
- package/assets/esri/core/workers/chunks/{7ebbb90d80600d9ba889.js → 913fb883455aeac8582b.js} +1 -1
- package/assets/esri/core/workers/chunks/927582ec15bff2acbb49.js +1 -0
- package/assets/esri/core/workers/chunks/{89132395eca329b9ab92.js → 9482a6d7baa24bbf5693.js} +1 -1
- package/assets/esri/core/workers/chunks/9684ab5e8254fdfcb7bb.js +1 -0
- package/assets/esri/core/workers/chunks/96d861265566854760cd.js +1 -0
- package/assets/esri/core/workers/chunks/98e6c1d035755a074d24.js +1 -0
- package/assets/esri/core/workers/chunks/9937920e7993814d0b2c.js +1 -0
- package/assets/esri/core/workers/chunks/{9d0bda096cdbd7e22f4b.js → 9bbff8237540409610b3.js} +1 -1
- package/assets/esri/core/workers/chunks/9dda9414104f585560a4.js +2 -0
- package/assets/esri/core/workers/chunks/{be291d920ebc68fde02b.js.LICENSE.txt → 9dda9414104f585560a4.js.LICENSE.txt} +0 -5
- package/assets/esri/core/workers/chunks/{1dc1bfb3425665f560e4.js → a486d99f9879f94151ba.js} +1 -1
- package/assets/esri/core/workers/chunks/{475c60ed8785d07911c6.js → a5c115fc53edb52ce1de.js} +1 -1
- package/assets/esri/core/workers/chunks/a62f1b8ed065b2a38f1a.js +1 -0
- package/assets/esri/core/workers/chunks/{830d1a7dee43422507ab.js → a739e617fc461014ad1f.js} +1 -1
- package/assets/esri/core/workers/chunks/aa21031c8f12ca438eaa.js +1 -0
- package/assets/esri/core/workers/chunks/ad27689b231e282b7620.js +1 -0
- package/assets/esri/core/workers/chunks/af6e8c961fd768fa7be3.js +1 -0
- package/assets/esri/core/workers/chunks/afeeb11b39e140303b5a.js +1 -0
- package/assets/esri/core/workers/chunks/b599b7dadce8b8bc88f6.js +1 -0
- package/assets/esri/core/workers/chunks/{873d8332e2149eb1b36a.js → b6c7b7b7f87dce5de811.js} +3 -3
- package/assets/esri/core/workers/chunks/b7d8817018b3d277c454.js +1 -0
- package/assets/esri/core/workers/chunks/{d90bc34d97bb21c29c40.js → b8cd81d8fcc78d272130.js} +1 -1
- package/assets/esri/core/workers/chunks/{450bc48a7389607bce1e.js → b984b808d383974ca3d8.js} +1 -1
- package/assets/esri/core/workers/chunks/b9953277d0cd4a01bdc6.js +1 -0
- package/assets/esri/core/workers/chunks/c02b3b8b71205f6ce290.js +1 -0
- package/assets/esri/core/workers/chunks/c03da138651ac53cadcb.js +2 -0
- package/assets/esri/core/workers/chunks/c21212c356f65244e34e.js +1 -0
- package/assets/esri/core/workers/chunks/{1fece9757de7c10d1e9f.js → c29df43817278f674707.js} +1 -1
- package/assets/esri/core/workers/chunks/{589b31cc5c663a288942.js → c6bf17b5ff6ec4b980a1.js} +1 -1
- package/assets/esri/core/workers/chunks/c715c585c42d8c2b86f5.js +1 -0
- package/assets/esri/core/workers/chunks/c7e9513f75b8ec205562.js +1 -0
- package/assets/esri/core/workers/chunks/c866b66ba72d96453899.js +1 -0
- package/assets/esri/core/workers/chunks/{5fde1234c5cccaee6763.js → c873383e7dae35dc1a61.js} +1 -1
- package/assets/esri/core/workers/chunks/c99dcc17fbd7acd2ad2e.js +1 -0
- package/assets/esri/core/workers/chunks/cae94d6805e0e8db3600.js +1 -0
- package/assets/esri/core/workers/chunks/cc5ec6e99aa09342c704.js +1 -0
- package/assets/esri/core/workers/chunks/cd4e5c948d1bfa9b9a2d.js +1 -0
- package/assets/esri/core/workers/chunks/{6501ee40bf25f9f75d02.js → ce481eeb27ea9c1782ae.js} +1 -1
- package/assets/esri/core/workers/chunks/{d214ac457ac970479536.js → cec1c87eb3749276ced4.js} +1 -1
- package/assets/esri/core/workers/chunks/cfe31b7d1c6c05fbd268.js +1 -0
- package/assets/esri/core/workers/chunks/d08f81d545930a79fb2e.js +1 -0
- package/assets/esri/core/workers/chunks/d0c1bc90e474f706211c.js +1 -0
- package/assets/esri/core/workers/chunks/d2faac81142586cf7509.js +1 -0
- package/assets/esri/core/workers/chunks/d607cf154218d20e4114.js +1 -0
- package/assets/esri/core/workers/chunks/{b94cd7eac5ff4a78dd5b.js → d7b6985984071e78c764.js} +1 -1
- package/assets/esri/core/workers/chunks/d901f8503a73277cfa58.js +1 -0
- package/assets/esri/core/workers/chunks/d93d0cb69f3a9a722510.js +1 -0
- package/assets/esri/core/workers/chunks/{9073b0f0ec93d6e243b9.js → da1c9257793c2817f40f.js} +1 -1
- package/assets/esri/core/workers/chunks/{94719ac469dadc4c05dc.js → dc0c3109b7558b4fe016.js} +1 -1
- package/assets/esri/core/workers/chunks/{dc7e4f7879debf557e46.js → de3d0973cff1e0858c52.js} +2 -2
- package/assets/esri/core/workers/chunks/{adce59e4111bae4225f7.js → e421dee5d8b030e79ffb.js} +1 -1
- package/assets/esri/core/workers/chunks/e602b91d8fdc36a92530.js +1 -0
- package/assets/esri/core/workers/chunks/{c13e55b9efb0b532f7ee.js → e61ab8ef30bbe788b9d7.js} +1 -1
- package/assets/esri/core/workers/chunks/e702abaeccef20b64a81.js +1 -0
- package/assets/esri/core/workers/chunks/{11a3aa43fb940c21f148.js → eb95464bd017fb839510.js} +1 -1
- package/assets/esri/core/workers/chunks/ebd619533be077059494.js +1 -0
- package/assets/esri/core/workers/chunks/ed564358cc7b3ee463a3.js +1 -0
- package/assets/esri/core/workers/chunks/ef2e0a014c982d9c7ca4.js +1 -0
- package/assets/esri/core/workers/chunks/f5cf338cecfc81f23128.js +1 -0
- package/assets/esri/core/workers/chunks/f6150b51a9430691a040.js +1 -0
- package/assets/esri/core/workers/chunks/{f4aed2b6e92bd0474069.js → f69329b85b362b349a8c.js} +1 -1
- package/assets/esri/core/workers/chunks/f721756a6c1593f96409.js +1 -0
- package/assets/esri/core/workers/chunks/fa19d5923276418096da.js +1 -0
- package/assets/esri/core/workers/chunks/fa5d27e47d47ff8fcb96.js +2 -0
- package/assets/esri/core/workers/chunks/fb12d3c63fcac8391e06.js +1 -0
- package/assets/esri/core/workers/chunks/fc9065d0cd6285fe0f0d.js +1 -0
- package/assets/esri/core/workers/chunks/{b526055794e64b0227ca.js → fd6107f95082e05f016a.js} +11 -11
- package/assets/esri/core/workers/chunks/fe10a95ebe1da2322af6.js +1 -0
- package/assets/esri/core/workers/chunks/fe71a0604f0928113419.js +1 -0
- package/assets/esri/core/workers/chunks/fec07a16b72cdcafc641.js +1 -0
- package/assets/esri/core/workers/chunks/fff23b2682590c4b21e3.js +1 -0
- package/assets/esri/layers/raster/formats/lerc-wasm.wasm +0 -0
- package/chunks/Bufferer-CclWhXVb.js +1 -1
- package/chunks/ColorMaterial.glsl.js +18 -5
- package/chunks/Component.glsl.js +42 -34
- package/chunks/Envelope.js +1 -1
- package/chunks/GeodeticDistanceCalculator-zRp89-dW.js +1 -1
- package/chunks/Geometry.js +1 -1
- package/chunks/GeometryCleaner-CIE8Wfmb.js +1 -1
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/OperatorAffineTransform.js +2 -0
- package/chunks/OperatorCentroid2D.js +2 -0
- package/chunks/OperatorCrosses.js +1 -1
- package/chunks/OperatorCut.js +1 -1
- package/chunks/OperatorGeneralize.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/OperatorGeodeticLength.js +1 -1
- package/chunks/OperatorGraphicBuffer.js +1 -1
- package/chunks/OperatorIntersects.js +1 -1
- package/chunks/OperatorMultiPartToSinglePart.js +1 -1
- package/chunks/OperatorOverlaps.js +1 -1
- package/chunks/OperatorProximityGeodesic.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorShapePreservingProject.js +1 -1
- package/chunks/OperatorSimplifyOGC.js +1 -1
- package/chunks/OperatorTouches.js +1 -1
- package/chunks/OperatorWithin.js +1 -1
- package/chunks/Point2D.js +1 -1
- package/chunks/SideCalculator2D-DX0718xq.js +1 -1
- package/chunks/SpatialReference.js +1 -1
- package/chunks/arcade.js +1 -1
- package/chunks/bundle.js +1 -1
- package/chunks/bundle2.js +1 -1
- package/chunks/centroidOperator.js +1 -1
- package/chunks/containsOperator.js +1 -1
- package/chunks/disjointOperator.js +1 -1
- package/chunks/equalsOperator.js +1 -1
- package/chunks/geodeticDistanceOperator.js +2 -0
- package/chunks/multiPartToSinglePartOperator.js +2 -0
- package/chunks/offsetOperator.js +2 -0
- package/config.js +1 -1
- package/core/imageUtils.js +1 -1
- package/core/workers/WorkerFallback.js +1 -1
- package/core/workers/registry.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/core/workers/workers.js +1 -1
- package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
- package/editing/sharedTemplates/executor/builders/support/offsetUtils.js +1 -1
- package/editing/sharedTemplates/executor/createTemplateExecutor.js +1 -1
- package/editing/sharedTemplates/templateLoader.js +1 -1
- package/geometry/libtess.js +1 -1
- package/geometry/operators/affineTransformOperator.js +1 -1
- package/geometry/operators/centroidOperator.js +1 -1
- package/geometry/operators/geodeticDistanceOperator.js +1 -1
- package/geometry/operators/gx/operatorAffineTransform.js +1 -1
- package/geometry/operators/gx/operatorAutoComplete.js +1 -1
- package/geometry/operators/gx/operatorBuffer.js +1 -1
- package/geometry/operators/gx/operatorConvexHull.js +1 -1
- package/geometry/operators/gx/operatorDifference.js +1 -1
- package/geometry/operators/gx/operatorIntersection.js +1 -1
- package/geometry/operators/gx/operatorLabelPoint.js +1 -1
- package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
- package/geometry/operators/gx/operatorLocateBetween.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/operators/gx/operatorSinglePartToMultiPart.js +1 -1
- package/geometry/operators/gx/operatorUnion.js +1 -1
- package/geometry/operators/json/containsOperator.js +1 -1
- package/geometry/operators/json/disjointOperator.js +1 -1
- package/geometry/operators/multiPartToSinglePartOperator.js +1 -1
- package/geometry/operators/offsetOperator.js +1 -1
- package/geometry/support/curves/densifyCurvedGeometry.js +1 -1
- package/geometry/support/meshUtils.js +1 -1
- package/interfaces.d.ts +3 -0
- package/kernel.js +1 -1
- package/layers/CSVLayer.js +1 -1
- package/layers/CatalogLayer.js +1 -1
- package/layers/ElevationLayer.js +1 -1
- package/layers/FeatureLayer.js +1 -1
- package/layers/GeoJSONLayer.js +1 -1
- package/layers/GroupLayer.js +1 -1
- package/layers/ImageryLayer.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/Layer.js +1 -1
- package/layers/MapImageLayer.js +1 -1
- package/layers/MediaLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/StreamLayer.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/WFSLayer.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/data/queryUtils.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/MemorySource.js +1 -1
- package/layers/graphics/sources/connections/GeoEventConnection.js +1 -1
- package/layers/graphics/sources/support/sourceUtils.js +1 -1
- package/layers/knowledgeGraph/cypherUtils.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/PortalLayer.js +1 -1
- package/layers/mixins/TiledImagery.js +1 -1
- package/layers/raster/datasets/FunctionRaster.js +1 -1
- package/layers/raster/datasets/pixelReader.js +1 -1
- package/layers/raster/functions/clipUtils.js +1 -1
- package/layers/raster/functions/rasterProjectionHelper.js +1 -1
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/arcgisLayers.js +1 -1
- package/layers/support/featureLayerUtils.js +1 -1
- package/layers/support/fromPortalItem.js +1 -1
- package/layers/support/layersLoader.js +1 -1
- package/layers/support/vectorTileLayerLoader.js +1 -1
- package/libs/basisu/BasisUEncoder.js +1 -1
- package/libs/basisu/BasisUTranscoder.js +1 -1
- package/libs/dracoMeshDecoder/dracoMeshDecoder.js +1 -1
- package/libs/dxtEncoder/DXTEncoder.js +1 -1
- package/libs/i3s/I3SModule.js +1 -1
- package/libs/parquet/loadParquetModule.js +1 -1
- package/libs/text/loadTextModule.js +1 -1
- package/networks/UtilityNetwork.js +1 -1
- package/networks/support/utils.js +1 -1
- package/package.json +3 -3
- package/popup/FeatureContentCollection.js +1 -1
- package/popup/Features.js +1 -1
- package/portal/Portal.js +1 -1
- package/portal/PortalItem.js +1 -1
- package/portal/PortalItemResource.js +1 -1
- package/portal/PortalUser.js +1 -1
- package/renderers/support/DictionaryLoader.js +1 -1
- package/request/process.js +1 -1
- package/request/queue.js +1 -1
- package/request.js +1 -1
- package/rest/geoprocessor/utils.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/knowledgeWasmAccess.js +1 -1
- package/rest/support/JobInfo.js +1 -1
- package/rest/utils.js +1 -1
- package/smartMapping/renderers/support/rendererUtils.js +1 -1
- package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
- package/support/revision.js +1 -1
- package/support/tests/serviceMockDependencies.js +1 -1
- package/support/zipUtils.js +1 -1
- package/symbols/WebStyleSymbol.js +1 -1
- package/symbols/cim/CIMOperators.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/defaultCIMValues.js +1 -1
- package/symbols/cim/effects/EffectCircularSector.js +2 -0
- package/symbols/cim/types.d.ts +42 -1
- package/symbols/cim/utils.js +1 -1
- package/symbols/support/symbolLayerUtils.js +1 -1
- package/symbols/support/symbolUtils.js +1 -1
- package/symbols/support/utils.js +1 -1
- package/undoredo/support/ServiceVersionInfo.js +1 -1
- package/versionManagement/VersionManagementService.js +1 -1
- package/views/2d/engine/Stage.js +1 -1
- package/views/2d/engine/vectorTiles/TileHandler.js +1 -1
- package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
- package/views/2d/engine/vectorTiles/TileParser.js +1 -1
- package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
- package/views/2d/engine/vectorTiles/WorkerTile.js +1 -1
- package/views/2d/engine/vectorTiles/WorkerTileHandler.js +1 -1
- package/views/2d/engine/vectorTiles/style/GeoJSONVectorTileSource.js +2 -0
- package/views/2d/engine/vectorTiles/style/GeoJSONVectorTileSourceWorker.js +2 -0
- package/views/2d/engine/vectorTiles/style/RemoteVectorTileSource.js +2 -0
- package/views/2d/engine/vectorTiles/style/StyleLayer.js +1 -1
- package/views/2d/engine/vectorTiles/style/VectorTilePbfWriter.js +2 -0
- package/views/2d/engine/vectorTiles/style/VectorTileSource.js +1 -1
- package/views/2d/engine/vectorTiles/style/encodeVectorTileFeatures.js +2 -0
- package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
- package/views/2d/engine/webgl/GlyphSDFCreator.js +1 -1
- package/views/2d/engine/webgl/GlyphSource.js +1 -1
- package/views/2d/engine/webgl/GlyphWorker.js +2 -0
- package/views/2d/engine/webgl/Painter.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/mesh/factories/ResourceProxy.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/RouteLayerView2D.js +1 -1
- package/views/2d/layers/VectorTileLayerView2D.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/schema/processor/MatcherSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderVectorTileFeatureCursor.js +2 -0
- package/views/2d/layers/support/MediaLayerInteraction.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedConfiguration.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedObserverManipulatedObject3D.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSnappingController.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/viewshedToolManipulatorUtils.js +1 -1
- package/views/3d/interactive/manipulatorUtils.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerWorker.js +1 -1
- package/views/3d/layers/VectorTileLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
- package/views/3d/layers/graphics/GraphicsDeconflictor.js +1 -1
- package/views/3d/layers/graphics/ObjectResourceCache.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/layers/i3s/I3SQueryEngine.js +1 -1
- package/views/3d/layers/support/FlowTileTree3DDebugger.js +1 -1
- package/views/3d/layers/support/TerrainTileTree3DDebugger.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/support/CombinedElevationProvider.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TransparencyMode.js +2 -0
- package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialInitParameters.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +7 -7
- package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechniqueConfiguration.js +1 -1
- package/views/PopupView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/View.js +1 -1
- package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
- package/views/draw/PointDrawAction.js +1 -1
- package/views/draw/PolygonDrawAction.js +1 -1
- package/views/draw/PolylineDrawAction.js +1 -1
- package/views/draw/SegmentDrawAction.js +1 -1
- package/views/draw/support/createSnappingVisualizer.js +1 -1
- package/views/interactive/snapping/SnappingManager.js +1 -1
- package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
- package/views/layers/HighlightableLayerView.d.ts +2 -0
- package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
- package/views/selection/SelectionOperation.js +1 -1
- package/views/support/GeometryWorker.js +1 -1
- package/views/support/GroundElevationSampler.js +1 -1
- package/webdoc/support/resourceUtils.js +1 -1
- package/webdoc/support/webdocLoadUtils.js +1 -1
- package/webdoc/support/webdocSaveUtils.js +1 -1
- package/webscene/Slide.js +1 -1
- package/webscene/spec-certification/api.js +1 -1
- package/webscene/spec-certification/spec.js +1 -1
- package/webscene/support/analysisUtils.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BatchAttributeForm/ValueChangeTransaction.js +1 -1
- package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
- package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/textElementTemplateUtils.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/legacy/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/legacy/UpdateWorkflow.js +1 -1
- package/widgets/Editor/modelUploadUtils.js +1 -1
- package/widgets/Editor/support/mergeFeaturesUtils.js +1 -1
- package/widgets/Editor/support/splitFeatureUtils.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/Feature/FeatureMedia.js +1 -1
- package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
- package/widgets/Feature/FeatureRelationship.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
- package/widgets/Feature.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm/support/textManipulationUtils.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/types.d.ts +78 -4
- package/widgets/FeatureTable/support/FeatureStore.d.ts +675 -0
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/FeatureTable/support/types.d.ts +28 -0
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
- package/widgets/LayerList/ListItemPanel.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Legend/support/colorRampUtils.js +1 -1
- package/widgets/Legend/support/sizeRampUtils.js +1 -1
- package/widgets/Legend/support/utils.js +1 -1
- package/widgets/Measurement.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/services/DepthImageService.js +1 -1
- package/widgets/OrientedImageryViewer/services/SuperimposeService.js +1 -1
- package/widgets/OrientedImageryViewer/support/NonPanoramicMedia.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/PanoramicVideoViewer.js +1 -1
- package/widgets/PanoramicViewer/support/PanoramicMedia.js +1 -1
- package/widgets/PanoramicViewer/support/importUtils.js +1 -1
- package/widgets/PanoramicViewer.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/Search/SearchViewModel.js +1 -1
- package/widgets/Search/support/layerSearchUtils.js +1 -1
- package/widgets/Search/support/locatorUtils.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/support/PluginManager.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/support/Selector2D/selectorUtils.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/widgets/support/symbolPreviewUtils.js +1 -1
- package/arcade/geometry/offset.js +0 -2
- package/assets/esri/core/workers/chunks/067b00498ae85f635f60.js +0 -1
- package/assets/esri/core/workers/chunks/0b20f92bae2b4c40d299.js +0 -1
- package/assets/esri/core/workers/chunks/0c582abc8d25249eb530.js +0 -1
- package/assets/esri/core/workers/chunks/0d6776055e9b34c14151.js +0 -1
- package/assets/esri/core/workers/chunks/0e6b6fcc55cc43ede1fc.js +0 -1
- package/assets/esri/core/workers/chunks/126f1f6b355723db6c4f.js +0 -1
- package/assets/esri/core/workers/chunks/149284464115981694ff.js +0 -1
- package/assets/esri/core/workers/chunks/181f330314c1989f642f.js +0 -1
- package/assets/esri/core/workers/chunks/1840d74ebae777a0200b.js +0 -1
- package/assets/esri/core/workers/chunks/1bfbdec791e19f5a2534.js +0 -1
- package/assets/esri/core/workers/chunks/1d38a710cf799cb0e5b3.js +0 -1
- package/assets/esri/core/workers/chunks/1d8280f63a6698e74f20.js +0 -1
- package/assets/esri/core/workers/chunks/1f48438b3055afeb710f.js +0 -1
- package/assets/esri/core/workers/chunks/25999b6f96ec305a7679.js +0 -1
- package/assets/esri/core/workers/chunks/28565756f884d0851003.js +0 -1
- package/assets/esri/core/workers/chunks/2a5a165848413764381b.js +0 -1
- package/assets/esri/core/workers/chunks/2e7a5bb740281ef59199.js +0 -1
- package/assets/esri/core/workers/chunks/2f87a49bdd00f899d81d.js +0 -1
- package/assets/esri/core/workers/chunks/302d91b7c480c6c9304b.js +0 -1
- package/assets/esri/core/workers/chunks/30c53a7e1ad5aa52f2f3.js +0 -1
- package/assets/esri/core/workers/chunks/3b493e8043ec1a2a5d96.js +0 -1
- package/assets/esri/core/workers/chunks/3ddd717ea12d9823eee2.js +0 -1
- package/assets/esri/core/workers/chunks/3f84ade6285560b692d1.js +0 -1
- package/assets/esri/core/workers/chunks/4129b27fcd4103cdc499.js +0 -1
- package/assets/esri/core/workers/chunks/41f7f3615d3ecb87c59a.js +0 -1
- package/assets/esri/core/workers/chunks/465a050fd838ee8eddf3.js +0 -1
- package/assets/esri/core/workers/chunks/46d8a1d6f7341ad20749.js +0 -1
- package/assets/esri/core/workers/chunks/48a0dfaabb9b4bce4191.js +0 -1
- package/assets/esri/core/workers/chunks/4addea2e35b0c845743e.js +0 -1
- package/assets/esri/core/workers/chunks/4ae626868e14bedd7fc5.js +0 -1
- package/assets/esri/core/workers/chunks/529ee4670940720e888b.js +0 -1
- package/assets/esri/core/workers/chunks/538bdf02c4dfb5ec72fe.js +0 -1
- package/assets/esri/core/workers/chunks/59d1708ae13c6e7e6e55.js +0 -1
- package/assets/esri/core/workers/chunks/5adf16c034a590b5e9f5.js +0 -1
- package/assets/esri/core/workers/chunks/5fb0e8f89b885e5e3742.js +0 -1
- package/assets/esri/core/workers/chunks/60f9b37dd738d884c48d.js +0 -1
- package/assets/esri/core/workers/chunks/62c8413f3bbc1378273d.js +0 -1
- package/assets/esri/core/workers/chunks/632ab11cdd4b0d9a5cc5.js +0 -1
- package/assets/esri/core/workers/chunks/663cf8bff17c894cd5f8.js +0 -1
- package/assets/esri/core/workers/chunks/6cc1120554bcb1b4899b.js +0 -1
- package/assets/esri/core/workers/chunks/6d1371b521c7f94fd77e.js +0 -1
- package/assets/esri/core/workers/chunks/6f102c90908c9900cdaa.js +0 -1
- package/assets/esri/core/workers/chunks/7278fdf6bfcdffa10a7f.js +0 -1
- package/assets/esri/core/workers/chunks/73cb499d7d68c59ba34e.js +0 -1
- package/assets/esri/core/workers/chunks/76bccc318d7cc33829a7.js +0 -1
- package/assets/esri/core/workers/chunks/777eafdb86b26b35c803.js +0 -1
- package/assets/esri/core/workers/chunks/7821aeba3e414b318a75.js +0 -1
- package/assets/esri/core/workers/chunks/7ac47a9ad244100bc3b1.js +0 -1
- package/assets/esri/core/workers/chunks/7b0ed52363704cfce129.js +0 -1
- package/assets/esri/core/workers/chunks/7c57354d026e27e056d4.js +0 -1
- package/assets/esri/core/workers/chunks/7dd672c25beb8813cc75.js +0 -2
- package/assets/esri/core/workers/chunks/7eb94fc75926bc739233.js +0 -1
- package/assets/esri/core/workers/chunks/7f125963555dc1ce63ad.js +0 -1
- package/assets/esri/core/workers/chunks/805c97b875d3066fb8df.js +0 -1
- package/assets/esri/core/workers/chunks/86ed75b7169b8ee43025.js +0 -1
- package/assets/esri/core/workers/chunks/88c3b60b403e2454b56e.js +0 -1
- package/assets/esri/core/workers/chunks/894343e415639df88243.js +0 -1
- package/assets/esri/core/workers/chunks/8b4759cef5ae5e43253b.js +0 -1
- package/assets/esri/core/workers/chunks/8ba4175f5e9a24ffecf7.js +0 -1
- package/assets/esri/core/workers/chunks/8e1d4867406753c5483c.js +0 -1
- package/assets/esri/core/workers/chunks/8e38c5e63aae42bdf5a4.js +0 -29
- package/assets/esri/core/workers/chunks/8f785b722b1a131bf370.js +0 -1
- package/assets/esri/core/workers/chunks/8f8db62f126e4a8c1bf7.js +0 -1
- package/assets/esri/core/workers/chunks/8f9874f42f21a4cb3acd.js +0 -1
- package/assets/esri/core/workers/chunks/90f4b81c6034253b70d7.js +0 -1
- package/assets/esri/core/workers/chunks/93ab247ff34694ac60eb.js +0 -1
- package/assets/esri/core/workers/chunks/9954149def644c371894.js +0 -1
- package/assets/esri/core/workers/chunks/9dfb7d120195991e9672.js +0 -1
- package/assets/esri/core/workers/chunks/9ed5e6b06afea6c85330.js +0 -1
- package/assets/esri/core/workers/chunks/a108f276659d5f25352c.js +0 -1
- package/assets/esri/core/workers/chunks/a504fa17d83facf1c01f.js +0 -1
- package/assets/esri/core/workers/chunks/a5fdb02b1714e93fa69e.js +0 -1
- package/assets/esri/core/workers/chunks/a9f616f22042b0dce8b9.js +0 -1
- package/assets/esri/core/workers/chunks/afd63c18ce4656271c8e.js +0 -1
- package/assets/esri/core/workers/chunks/b059dabb1c732829487c.js +0 -1
- package/assets/esri/core/workers/chunks/b318823aefcefad6fad5.js +0 -1
- package/assets/esri/core/workers/chunks/b378e504a5b1afc8d0ce.js +0 -1
- package/assets/esri/core/workers/chunks/b5397dc03fa0bd654ba6.js +0 -1
- package/assets/esri/core/workers/chunks/b7bcb31737b01d7736d0.js +0 -1
- package/assets/esri/core/workers/chunks/ba030767cf935f967454.js +0 -1
- package/assets/esri/core/workers/chunks/be291d920ebc68fde02b.js +0 -2
- package/assets/esri/core/workers/chunks/c10a0eebd935472d8fae.js +0 -1
- package/assets/esri/core/workers/chunks/c16e83e448a32d13048f.js +0 -1
- package/assets/esri/core/workers/chunks/c2db773201adca204f95.js +0 -1
- package/assets/esri/core/workers/chunks/c4c83b5129c279c3615b.js +0 -1
- package/assets/esri/core/workers/chunks/c7e391df714839484cd1.js +0 -1
- package/assets/esri/core/workers/chunks/cca095f0c623e037002d.js +0 -1
- package/assets/esri/core/workers/chunks/cded485ad893a7dd2948.js +0 -1
- package/assets/esri/core/workers/chunks/cf03d391d50a4c7aca4f.js +0 -1
- package/assets/esri/core/workers/chunks/cf8ce63711488f2e677c.js +0 -1
- package/assets/esri/core/workers/chunks/d198ecb1fe3690d6092f.js +0 -2
- package/assets/esri/core/workers/chunks/d2a51c797b2966cb95f3.js +0 -2
- package/assets/esri/core/workers/chunks/d303621c902330be5035.js +0 -1
- package/assets/esri/core/workers/chunks/d4d385d19e62ef1c286f.js +0 -1
- package/assets/esri/core/workers/chunks/d4f005dadba75422b401.js +0 -1
- package/assets/esri/core/workers/chunks/d5e15021928e95c11463.js +0 -1
- package/assets/esri/core/workers/chunks/d6500f6b2ff115d9eb09.js +0 -1
- package/assets/esri/core/workers/chunks/d9c78c2db04a06ee83ed.js +0 -1
- package/assets/esri/core/workers/chunks/dccb46c7dce68528c72b.js +0 -1
- package/assets/esri/core/workers/chunks/df174346a7e9b629a392.js +0 -1
- package/assets/esri/core/workers/chunks/e08c64e4ae5a68eae2be.js +0 -1
- package/assets/esri/core/workers/chunks/e1492d2404c3ed82931e.js +0 -1
- package/assets/esri/core/workers/chunks/e34ed3b818b2eb4116c5.js +0 -1
- package/assets/esri/core/workers/chunks/e7149d23615fee31ab7e.js +0 -1
- package/assets/esri/core/workers/chunks/ec774f5d6ea5c29536e5.js +0 -1
- package/assets/esri/core/workers/chunks/ed71a4e353715db0a6e9.js +0 -1
- package/assets/esri/core/workers/chunks/f029c12f1afee0e9b2a1.js +0 -1
- package/assets/esri/core/workers/chunks/f4eda59ec1e816ecc827.js +0 -1
- package/assets/esri/core/workers/chunks/f54eba484f40d5eeb590.js +0 -1
- package/assets/esri/core/workers/chunks/f622b27ebdf1c918fd6d.js +0 -1
- package/assets/esri/core/workers/chunks/f6a13f07a5f7b781a9a8.js +0 -1
- package/assets/esri/core/workers/chunks/f6f1122bed931f1d960b.js +0 -1
- package/assets/esri/core/workers/chunks/f8b8d3d2710c83acccf3.js +0 -1
- package/assets/esri/core/workers/chunks/f98bb3885bfc7f18f26c.js +0 -1
- package/assets/esri/core/workers/chunks/fc827f58db3194922056.js +0 -1
- package/chunks/ShadedColorMaterial.glsl.js +0 -13
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +0 -2
- package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +0 -2
- package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +0 -2
- package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechniqueConfiguration.js +0 -2
- /package/assets/esri/core/workers/chunks/{d198ecb1fe3690d6092f.js.LICENSE.txt → 09653bd2a31d293a10d9.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{f82cd34a79c8aa58d40c.js.LICENSE.txt → 3b3a8a6167f2e1eeb828.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{d2a51c797b2966cb95f3.js.LICENSE.txt → c03da138651ac53cadcb.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{7dd672c25beb8813cc75.js.LICENSE.txt → fa5d27e47d47ff8fcb96.js.LICENSE.txt} +0 -0
package/Basemap.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 r from"./config.js";import t from"./request.js";import s from"./core/Collection.js";import{referenceSetter as a}from"./core/collectionUtils.js";import{JSONSupportMixin as o}from"./core/JSONSupport.js";import{isClonable as i,clone as n}from"./core/lang.js";import{Loadable as l}from"./core/Loadable.js";import{loadAll as p}from"./core/loadAll.js";import y from"./core/Logger.js";import{destroyMaybe as d}from"./core/maybe.js";import{throwIfAborted as c}from"./core/promiseUtils.js";import{isProtocolRelative as u,urlToObject as h}from"./core/urlUtils.js";import{property as m,subclass as f}from"./core/accessorSupport/decorators.js";import g from"./geometry/SpatialReference.js";import L from"./portal/Portal.js";import b from"./portal/PortalItem.js";import{getBasemapTitle as w,esriBasemapDefinitions as I}from"./support/basemapDefinitions.js";import v from"./support/BasemapStyle.js";import{BasemapSymbol as S}from"./support/userTypeGuards/isBasemap.js";import{getLayerJSON as _}from"./webdoc/support/writeUtils.js";import{writer as j}from"./core/accessorSupport/decorators/writer.js";var U,$;let x=class extends(o(l)){static{U=S}static{$=this}constructor(e){super(e),this[U]=!0,this.id=null,this.portalItem=null,this.spatialReference=null,this.style=null,this.thumbnailUrl=null,this.title="Basemap",this.type="Basemap",this.id=Date.now().toString(16)+"-basemap-"+$.idCounter++,this.baseLayers=new s,this.referenceLayers=new s,this.groundLayers=new s;const r=e=>{const{parent:r}=e;r&&r!==this&&"remove"in r&&r.remove?.(e),e.parent=this,"elevation"!==e.type&&"integrated-mesh-3dtiles"!==e.type||y.getLogger(this).error(`Layer '${e.title}, id:${e.id}' of type '${e.type}' is not supported as a basemap layer and will therefore be ignored.`)},t=e=>{const{parent:r}=e;r&&r!==this&&"remove"in r&&r.remove?.(e),e.parent=this},a=e=>{const r=e.item;return r.parent===this?(y.getLogger(this).error(`Layer '${r.title}, id:${r.id}' of type '${r.type}' already a ground layer, second add will be ignored.`),void e.preventDefault()):"integrated-mesh-3dtiles"!==r.type?(y.getLogger(this).error(`Layer '${r.title}, id:${r.id}' of type '${r.type}' is not supported as a ground layer and will therefore be ignored.`),void e.preventDefault()):void 0},o=e=>{e.parent=null},i=e=>{e.parent===this&&(e.parent=null)};this.addHandles([this.baseLayers.on("after-add",e=>r(e.item)),this.baseLayers.on("after-remove",e=>o(e.item)),this.referenceLayers.on("after-add",e=>r(e.item)),this.referenceLayers.on("after-remove",e=>o(e.item)),this.groundLayers.on("before-add",a),this.groundLayers.on("after-add",e=>t(e.item)),this.groundLayers.on("after-remove",e=>i(e.item))])}static{this.idCounter=0}initialize(){this.when().catch(e=>{y.getLogger(this).error("#load()",`Failed to load basemap (title: '${this.title}', id: '${this.id}')`,e)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const e=this.baseLayers.toArray();for(const s of e)s.destroyed||s.destroy();const r=this.groundLayers.toArray();for(const s of r)s.destroyed||s.destroy();const t=this.referenceLayers.toArray();for(const s of t)s.destroyed||s.destroy();this.baseLayers.destroy(),this.groundLayers.destroy(),this.referenceLayers.destroy(),this.portalItem=d(this.portalItem)}removeChildLayer(e){for(const r of[this.baseLayers,this.referenceLayers,this.groundLayers])r.remove(e)}normalizeCtorArgs(e){return e&&"resourceInfo"in e&&(this._set("resourceInfo",e.resourceInfo),delete(e={...e}).resourceInfo),e}get baseLayers(){return this._get("baseLayers")}set baseLayers(e){this._set("baseLayers",a(e,this._get("baseLayers")))}_writeBaseLayers(e,r,t){const s=[];e?(t={...t,layerContainerType:"basemap-base-layers"},this.baseLayers.forEach(e=>{const r=_(e,t.webmap?t.webmap.getLayerJSONFromResourceInfo(e):null,t);null!=r&&s.push(r)}),this.referenceLayers.forEach(e=>{const r=_(e,t.webmap?t.webmap.getLayerJSONFromResourceInfo(e):null,t);null!=r&&("scene"!==e.type&&(r.isReference=!0),s.push(r))}),r.baseMapLayers=s):r.baseMapLayers=s}set groundLayers(e){this._set("groundLayers",a(e,this._get("groundLayers")))}_writeGroundLayers(e,r,t){const s=[];e&&(t={...t,layerContainerType:"basemap-ground-layers"},this.groundLayers.forEach(e=>{const r=_(e,t.webmap?t.webmap.getLayerJSONFromResourceInfo(e):null,t);null!=r&&s.push(r)}),s.length>0&&(r.groundLayers=s))}get loaded(){return super.loaded}get referenceLayers(){return this._get("referenceLayers")}set referenceLayers(e){this._set("referenceLayers",a(e,this._get("referenceLayers")))}writeTitle(e,r){r.title=e||"Basemap"}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return p(this,e=>{e(this.baseLayers,this.groundLayers,this.referenceLayers)})}clone(){const e={id:this.id,title:this.title,portalItem:this.portalItem,baseLayers:this.baseLayers.map(e=>i(e)?e.clone():e),groundLayers:this.groundLayers.map(e=>i(e)?e.clone():e),referenceLayers:this.referenceLayers.map(e=>i(e)?e.clone():e)};return this.loaded&&(e.loadStatus="loaded"),new $({resourceInfo:this.resourceInfo}).set(e)}read(e,r){this.resourceInfo||this._set("resourceInfo",{data:e,context:r}),super.read(e,r)}write(e,r){return e=e||{},r?.origin||(r={origin:"web-map",...r}),super.write(e,r),!this.loaded&&this.resourceInfo?.data.baseMapLayers&&(e.baseMapLayers=this.resourceInfo.data.baseMapLayers.map(e=>{const r=n(e);return r.url&&u(r.url)&&(r.url=`https:${r.url}`),r.templateUrl&&u(r.templateUrl)&&(r.templateUrl=`https:${r.templateUrl}`),r})),e}async _loadFromSource(e){const{resourceInfo:r,portalItem:t,style:s}=this;c(e);const a=[];if(r){const t=r.context?r.context.url:null;if(a.push(this._loadLayersFromJSON(r.data,t,e)),r.data.id&&!r.data.title){const e=r.data.id;a.push(w(e).then(e=>{e&&this.read({title:e},r.context)}))}}else t?a.push(this._loadFromItem(t,e)):s&&a.push(this._loadFromStylesService(s,e));await Promise.all(a)}async _loadLayersFromJSON(e,r,t){const s=this.resourceInfo?.context,a=this.portalItem?.portal||s?.portal||null,o=O[s?.origin||""]??"web-map",{populateOperationalLayers:i}=await
|
|
2
|
+
import{__decorate as e}from"tslib";import r from"./config.js";import t from"./request.js";import s from"./core/Collection.js";import{referenceSetter as a}from"./core/collectionUtils.js";import{JSONSupportMixin as o}from"./core/JSONSupport.js";import{isClonable as i,clone as n}from"./core/lang.js";import{Loadable as l}from"./core/Loadable.js";import{loadAll as p}from"./core/loadAll.js";import y from"./core/Logger.js";import{destroyMaybe as d}from"./core/maybe.js";import{throwIfAborted as c}from"./core/promiseUtils.js";import{isProtocolRelative as u,urlToObject as h}from"./core/urlUtils.js";import{property as m,subclass as f}from"./core/accessorSupport/decorators.js";import g from"./geometry/SpatialReference.js";import L from"./portal/Portal.js";import b from"./portal/PortalItem.js";import{getBasemapTitle as w,esriBasemapDefinitions as I}from"./support/basemapDefinitions.js";import v from"./support/BasemapStyle.js";import{BasemapSymbol as S}from"./support/userTypeGuards/isBasemap.js";import{getLayerJSON as _}from"./webdoc/support/writeUtils.js";import{writer as j}from"./core/accessorSupport/decorators/writer.js";var U,$;let x=class extends(o(l)){static{U=S}static{$=this}constructor(e){super(e),this[U]=!0,this.id=null,this.portalItem=null,this.spatialReference=null,this.style=null,this.thumbnailUrl=null,this.title="Basemap",this.type="Basemap",this.id=Date.now().toString(16)+"-basemap-"+$.idCounter++,this.baseLayers=new s,this.referenceLayers=new s,this.groundLayers=new s;const r=e=>{const{parent:r}=e;r&&r!==this&&"remove"in r&&r.remove?.(e),e.parent=this,"elevation"!==e.type&&"integrated-mesh-3dtiles"!==e.type||y.getLogger(this).error(`Layer '${e.title}, id:${e.id}' of type '${e.type}' is not supported as a basemap layer and will therefore be ignored.`)},t=e=>{const{parent:r}=e;r&&r!==this&&"remove"in r&&r.remove?.(e),e.parent=this},a=e=>{const r=e.item;return r.parent===this?(y.getLogger(this).error(`Layer '${r.title}, id:${r.id}' of type '${r.type}' already a ground layer, second add will be ignored.`),void e.preventDefault()):"integrated-mesh-3dtiles"!==r.type?(y.getLogger(this).error(`Layer '${r.title}, id:${r.id}' of type '${r.type}' is not supported as a ground layer and will therefore be ignored.`),void e.preventDefault()):void 0},o=e=>{e.parent=null},i=e=>{e.parent===this&&(e.parent=null)};this.addHandles([this.baseLayers.on("after-add",e=>r(e.item)),this.baseLayers.on("after-remove",e=>o(e.item)),this.referenceLayers.on("after-add",e=>r(e.item)),this.referenceLayers.on("after-remove",e=>o(e.item)),this.groundLayers.on("before-add",a),this.groundLayers.on("after-add",e=>t(e.item)),this.groundLayers.on("after-remove",e=>i(e.item))])}static{this.idCounter=0}initialize(){this.when().catch(e=>{y.getLogger(this).error("#load()",`Failed to load basemap (title: '${this.title}', id: '${this.id}')`,e)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const e=this.baseLayers.toArray();for(const s of e)s.destroyed||s.destroy();const r=this.groundLayers.toArray();for(const s of r)s.destroyed||s.destroy();const t=this.referenceLayers.toArray();for(const s of t)s.destroyed||s.destroy();this.baseLayers.destroy(),this.groundLayers.destroy(),this.referenceLayers.destroy(),this.portalItem=d(this.portalItem)}removeChildLayer(e){for(const r of[this.baseLayers,this.referenceLayers,this.groundLayers])r.remove(e)}normalizeCtorArgs(e){return e&&"resourceInfo"in e&&(this._set("resourceInfo",e.resourceInfo),delete(e={...e}).resourceInfo),e}get baseLayers(){return this._get("baseLayers")}set baseLayers(e){this._set("baseLayers",a(e,this._get("baseLayers")))}_writeBaseLayers(e,r,t){const s=[];e?(t={...t,layerContainerType:"basemap-base-layers"},this.baseLayers.forEach(e=>{const r=_(e,t.webmap?t.webmap.getLayerJSONFromResourceInfo(e):null,t);null!=r&&s.push(r)}),this.referenceLayers.forEach(e=>{const r=_(e,t.webmap?t.webmap.getLayerJSONFromResourceInfo(e):null,t);null!=r&&("scene"!==e.type&&(r.isReference=!0),s.push(r))}),r.baseMapLayers=s):r.baseMapLayers=s}set groundLayers(e){this._set("groundLayers",a(e,this._get("groundLayers")))}_writeGroundLayers(e,r,t){const s=[];e&&(t={...t,layerContainerType:"basemap-ground-layers"},this.groundLayers.forEach(e=>{const r=_(e,t.webmap?t.webmap.getLayerJSONFromResourceInfo(e):null,t);null!=r&&s.push(r)}),s.length>0&&(r.groundLayers=s))}get loaded(){return super.loaded}get referenceLayers(){return this._get("referenceLayers")}set referenceLayers(e){this._set("referenceLayers",a(e,this._get("referenceLayers")))}writeTitle(e,r){r.title=e||"Basemap"}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return p(this,e=>{e(this.baseLayers,this.groundLayers,this.referenceLayers)})}clone(){const e={id:this.id,title:this.title,portalItem:this.portalItem,baseLayers:this.baseLayers.map(e=>i(e)?e.clone():e),groundLayers:this.groundLayers.map(e=>i(e)?e.clone():e),referenceLayers:this.referenceLayers.map(e=>i(e)?e.clone():e)};return this.loaded&&(e.loadStatus="loaded"),new $({resourceInfo:this.resourceInfo}).set(e)}read(e,r){this.resourceInfo||this._set("resourceInfo",{data:e,context:r}),super.read(e,r)}write(e,r){return e=e||{},r?.origin||(r={origin:"web-map",...r}),super.write(e,r),!this.loaded&&this.resourceInfo?.data.baseMapLayers&&(e.baseMapLayers=this.resourceInfo.data.baseMapLayers.map(e=>{const r=n(e);return r.url&&u(r.url)&&(r.url=`https:${r.url}`),r.templateUrl&&u(r.templateUrl)&&(r.templateUrl=`https:${r.templateUrl}`),r})),e}async _loadFromSource(e){const{resourceInfo:r,portalItem:t,style:s}=this;c(e);const a=[];if(r){const t=r.context?r.context.url:null;if(a.push(this._loadLayersFromJSON(r.data,t,e)),r.data.id&&!r.data.title){const e=r.data.id;a.push(w(e).then(e=>{e&&this.read({title:e},r.context)}))}}else t?a.push(this._loadFromItem(t,e)):s&&a.push(this._loadFromStylesService(s,e));await Promise.all(a)}async _loadLayersFromJSON(e,r,t){const s=this.resourceInfo?.context,a=this.portalItem?.portal||s?.portal||null,o=O[s?.origin||""]??"web-map",{populateOperationalLayers:i}=await(import("./layers/support/layersCreator.js")),n=[];if(c(t),e.baseMapLayers&&Array.isArray(e.baseMapLayers)){const t={context:{...s,origin:o,url:r,portal:a,layerContainerType:"basemap-base-layers"},defaultLayerType:"DefaultTileLayer"},l=e=>"web-scene"===o&&"ArcGISSceneServiceLayer"===e.layerType||e.isReference,p=i(this.baseLayers,e.baseMapLayers.filter(e=>!l(e)),t);n.push(p);const y=i(this.referenceLayers,e.baseMapLayers.filter(l),t);n.push(y)}if(e.groundLayers&&Array.isArray(e.groundLayers)){const t={context:{...s,origin:o,url:r,portal:a,layerContainerType:"basemap-ground-layers"},defaultLayerType:"IntegratedMesh3DTilesLayer"},l=i(this.groundLayers,e.groundLayers,t);n.push(l)}await Promise.allSettled(n)}async _loadFromItem(e,r){const t=await e.load(r),s=await t.fetchData("json",r),a=h(e.itemUrl??"");return this._set("resourceInfo",{data:s.baseMap??{},context:{origin:M[e.type||""]??"web-map",portal:e.portal||L.getDefault(),url:a}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:s.spatialReference},this.resourceInfo.context),this.read({title:e.title,thumbnailUrl:e.thumbnailUrl},{origin:"portal-item",portal:e.portal||L.getDefault(),url:a}),this._loadLayersFromJSON(this.resourceInfo.data,a,r)}async _loadFromStylesService(e,s){const a=e.serviceUrl.endsWith("/webmaps")?e.serviceUrl.slice(0,-8):e.serviceUrl,o=`${a}/styles/${e.id}/self`,i=`${a}/webmaps/${e.id}`,n=e.apiKey??(r.sessions?.basemap?.enabled?void 0:r.apiKeys.basemapStyles),[l,p]=await Promise.all([(await t(o,{query:{token:n},signal:s?.signal})).data,(await t(i,{query:{language:e.languageParameter,places:e.places,worldview:e.worldview,token:n},signal:s?.signal})).data]);this.thumbnailUrl??=l.thumbnailUrl;const y=h(i);if(this._set("resourceInfo",{data:p.baseMap??{},context:{origin:"web-map",url:y}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:p.spatialReference},this.resourceInfo.context),await this._loadLayersFromJSON(this.resourceInfo.data,y,s),n)for(const r of[...this.baseLayers,...this.groundLayers,...this.referenceLayers])"apiKey"in r&&(r.apiKey=n)}static fromId(e){const r=I[e];return r?r.itemId?new $({portalItem:{id:r.itemId,portal:{url:"https://www.arcgis.com"}}}):$.fromJSON(r,r.is3d?{origin:"web-scene",portal:new L({url:"https://www.arcgis.com"})}:{origin:"web-map"}):null}};e([m({json:{read:!1,write:{ignoreOrigin:!0,target:"baseMapLayers",writer(e,r,t,s){this._writeBaseLayers(e,r,s)}},origins:{"web-scene":{write:{ignoreOrigin:!0,target:{baseMapLayers:{type:s}},writer(e,r,t,s){this._writeBaseLayers(e,r,s)}}}}}})],x.prototype,"baseLayers",null),e([m({json:{read:!1,write:{ignoreOrigin:!0,target:"groundLayers",writer(e,r,t,s){this._writeGroundLayers(e,r,s)}},origins:{"web-scene":{write:{ignoreOrigin:!0,target:{groundLayers:{type:s}},writer(e,r,t,s){this._writeGroundLayers(e,r,s)}}}}}})],x.prototype,"groundLayers",null),e([m({type:String,json:{origins:{"web-scene":{write:!0}}}})],x.prototype,"id",void 0),e([m({type:b})],x.prototype,"portalItem",void 0),e([m()],x.prototype,"referenceLayers",null),e([m({readOnly:!0})],x.prototype,"resourceInfo",void 0),e([m({type:g})],x.prototype,"spatialReference",void 0),e([m({type:v})],x.prototype,"style",void 0),e([m()],x.prototype,"thumbnailUrl",void 0),e([m({type:String,json:{origins:{"web-scene":{write:{isRequired:!0}}}}})],x.prototype,"title",void 0),e([j("title")],x.prototype,"writeTitle",null),x=$=e([f("esri.Basemap")],x);const M={"Web Scene":"web-scene","Web Map":"web-map","Link Chart":"link-chart"},O={"web-scene":"web-scene","web-map":"web-map","link-chart":"link-chart"},F=x;export{F as default};
|
package/Ground.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as r}from"tslib";import e from"./Color.js";import o from"./core/Collection.js";import t from"./core/CollectionFlattener.js";import{referenceSetter as s}from"./core/collectionUtils.js";import{typeCast as a}from"./core/compilerUtils.js";import{JSONSupportMixin as i}from"./core/JSONSupport.js";import{clone as n}from"./core/lang.js";import{Loadable as l}from"./core/Loadable.js";import{loadAll as p}from"./core/loadAll.js";import c from"./core/Logger.js";import{destroyMaybe as u}from"./core/maybe.js";import{isAbortError as y,throwIfAborted as d}from"./core/promiseUtils.js";import{property as m,subclass as h}from"./core/accessorSupport/decorators.js";import{Integer as f}from"./core/accessorSupport/ensureType.js";import g from"./ground/NavigationConstraint.js";import{GroundSymbol as v}from"./support/groundInstanceUtils.js";import{transparencyToOpacity as j,opacityToTransparency as w}from"./webdoc/support/opacityUtils.js";import{addLayerUnsupportedError as C}from"./webdoc/support/unsupportedErrors.js";import{writer as L}from"./core/accessorSupport/decorators/writer.js";var S,I;let b=I=class extends(i(l)){static{S=v}constructor(r){super(r),this[S]=!0,this.parent=null,this.opacity=1,this.surfaceColor=null,this.undergroundColor=new e("white"),this.navigationConstraint=null,this.layers=new o;const s=r=>{const{parent:e}=r;e&&e!==this&&"remove"in e&&e.remove?.(r),r.parent=this,"elevation"!==r.type&&"base-elevation"!==r.type&&c.getLogger(this).error(`Layer '${r.title}, id:${r.id}' of type '${r.type}' is not supported as a ground layer and will therefore be ignored. Only layers of type 'elevation' are supported.`)},a=r=>{r.parent=null};this.addHandles([this.layers.on("after-add",r=>s(r.item)),this.layers.on("after-remove",r=>a(r.item))]),this.allLayers=new t({getCollections:()=>[this.layers,this.parent?.basemap?.groundLayers]})}removeChildLayer(r){this.layers.remove(r)}initialize(){this.when().catch(r=>{y(r)||c.getLogger(this).error("#load()","Failed to load ground",r)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}get integratedMeshGround(){const r=this.parent?.basemap?.groundLayers.at(0);return r?.replacesTerrain?r:null}destroy(){const r=this.layers.removeAll();for(const e of r)u(e);this.layers.destroy()}normalizeCtorArgs(r){return r&&"resourceInfo"in r&&(this._set("resourceInfo",r.resourceInfo),delete(r={...r}).resourceInfo),r}get loaded(){return super.loaded}get layers(){return this._get("layers")}set layers(r){this._set("layers",s(r,this._get("layers")))}writeLayers(r,e,o,t){const s=[];r?(t={...t,layerContainerType:"ground"},r.forEach(r=>{if("write"in r){const e={};a(r)().write(e,t)&&s.push(e)}else C(t,r)}),e.layers=s):e.layers=s}load(r){return this.addResolvingPromise(this._loadFromSource(r)),Promise.resolve(this)}loadAll(){return p(this,r=>r(this.layers))}async queryElevation(r,e){await this.load({signal:e?.signal});const{queryAll:o}=await
|
|
2
|
+
import{__decorate as r}from"tslib";import e from"./Color.js";import o from"./core/Collection.js";import t from"./core/CollectionFlattener.js";import{referenceSetter as s}from"./core/collectionUtils.js";import{typeCast as a}from"./core/compilerUtils.js";import{JSONSupportMixin as i}from"./core/JSONSupport.js";import{clone as n}from"./core/lang.js";import{Loadable as l}from"./core/Loadable.js";import{loadAll as p}from"./core/loadAll.js";import c from"./core/Logger.js";import{destroyMaybe as u}from"./core/maybe.js";import{isAbortError as y,throwIfAborted as d}from"./core/promiseUtils.js";import{property as m,subclass as h}from"./core/accessorSupport/decorators.js";import{Integer as f}from"./core/accessorSupport/ensureType.js";import g from"./ground/NavigationConstraint.js";import{GroundSymbol as v}from"./support/groundInstanceUtils.js";import{transparencyToOpacity as j,opacityToTransparency as w}from"./webdoc/support/opacityUtils.js";import{addLayerUnsupportedError as C}from"./webdoc/support/unsupportedErrors.js";import{writer as L}from"./core/accessorSupport/decorators/writer.js";var S,I;let b=I=class extends(i(l)){static{S=v}constructor(r){super(r),this[S]=!0,this.parent=null,this.opacity=1,this.surfaceColor=null,this.undergroundColor=new e("white"),this.navigationConstraint=null,this.layers=new o;const s=r=>{const{parent:e}=r;e&&e!==this&&"remove"in e&&e.remove?.(r),r.parent=this,"elevation"!==r.type&&"base-elevation"!==r.type&&c.getLogger(this).error(`Layer '${r.title}, id:${r.id}' of type '${r.type}' is not supported as a ground layer and will therefore be ignored. Only layers of type 'elevation' are supported.`)},a=r=>{r.parent=null};this.addHandles([this.layers.on("after-add",r=>s(r.item)),this.layers.on("after-remove",r=>a(r.item))]),this.allLayers=new t({getCollections:()=>[this.layers,this.parent?.basemap?.groundLayers]})}removeChildLayer(r){this.layers.remove(r)}initialize(){this.when().catch(r=>{y(r)||c.getLogger(this).error("#load()","Failed to load ground",r)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}get integratedMeshGround(){const r=this.parent?.basemap?.groundLayers.at(0);return r?.replacesTerrain?r:null}destroy(){const r=this.layers.removeAll();for(const e of r)u(e);this.layers.destroy()}normalizeCtorArgs(r){return r&&"resourceInfo"in r&&(this._set("resourceInfo",r.resourceInfo),delete(r={...r}).resourceInfo),r}get loaded(){return super.loaded}get layers(){return this._get("layers")}set layers(r){this._set("layers",s(r,this._get("layers")))}writeLayers(r,e,o,t){const s=[];r?(t={...t,layerContainerType:"ground"},r.forEach(r=>{if("write"in r){const e={};a(r)().write(e,t)&&s.push(e)}else C(t,r)}),e.layers=s):e.layers=s}load(r){return this.addResolvingPromise(this._loadFromSource(r)),Promise.resolve(this)}loadAll(){return p(this,r=>r(this.layers))}async queryElevation(r,e){await this.load({signal:e?.signal});const{queryAll:o}=await(import("./layers/support/ElevationQuery.js"));d(e);const t=this.layers.filter(A).toArray();return this.parent?.basemap?.groundLayers&&this.parent?.basemap?.groundLayers.forEach(r=>{t.push(r)}),o(t,r,e)}async createElevationSampler(r,e){await this.load({signal:e?.signal});const{createSampler:o}=await(import("./layers/support/ElevationQuery.js"));d(e);return o(this.layers.filter(A).toArray(),r,e)}clone(){const r={opacity:this.opacity,surfaceColor:n(this.surfaceColor),undergroundColor:n(this.undergroundColor),navigationConstraint:n(this.navigationConstraint),layers:this.layers.slice()};return this.loaded&&(r.loadStatus="loaded"),new I({resourceInfo:this.resourceInfo}).set(r)}read(r,e){this.resourceInfo||this._set("resourceInfo",{data:r,context:e}),super.read(r,e)}_loadFromSource(r){const e=this.resourceInfo;return e?this._loadLayersFromJSON(e.data,e.context,r):Promise.resolve()}async _loadLayersFromJSON(r,e,o){const t=e?.origin||"web-scene",s=e?.portal||null,a=e?.url||null,{populateOperationalLayers:i}=await(import("./layers/support/layersCreator.js"));d(o);const n=[];if(r.layers&&Array.isArray(r.layers)){const e={context:{origin:t,url:a,portal:s,layerContainerType:"ground"},defaultLayerType:"ArcGISTiledElevationServiceLayer"};n.push(i(this.layers,r.layers,e))}await Promise.allSettled(n)}};function A(r){return r&&"createElevationSampler"in r}r([m()],b.prototype,"parent",void 0),r([m()],b.prototype,"integratedMeshGround",null),r([m({json:{read:!1,write:{isRequired:!0}}})],b.prototype,"layers",null),r([m()],b.prototype,"allLayers",void 0),r([L("layers")],b.prototype,"writeLayers",null),r([m({readOnly:!0})],b.prototype,"resourceInfo",void 0),r([m({type:Number,nonNullable:!0,range:{min:0,max:1},json:{type:f,read:{reader:j,source:"transparency"},write:{writer:(r,e)=>{e.transparency=w(r)},target:"transparency"}}})],b.prototype,"opacity",void 0),r([m({type:e,json:{type:[f],write:(r,e)=>{e.surfaceColor=r.toJSON().slice(0,3)}}})],b.prototype,"surfaceColor",void 0),r([m({type:e})],b.prototype,"undergroundColor",void 0),r([m({type:g,json:{write:!0}})],b.prototype,"navigationConstraint",void 0),b=I=r([h("esri.Ground")],b);const E=b;export{E as default};
|
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 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};
|
|
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/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",{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};
|
|
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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{throwIfAborted as e}from"../../core/promiseUtils.js";import{toUnit as i}from"../../core/quantity.js";import{setTestConfig as n}from"../../views/analysis/ElevationProfile/constants.js";import{geodeticDistanceThresholdMeters as r}from"../../views/support/measurementWorkerUtils.js";function o(e){return e.forceInteractive()}function s(e){return i(e,"meters").value>r}function t(e){return null!=e.measurementData?.measurements}function a(){return n()}async function l(i){const{ElevationProfileChart:n}=await
|
|
2
|
+
import{throwIfAborted as e}from"../../core/promiseUtils.js";import{toUnit as i}from"../../core/quantity.js";import{setTestConfig as n}from"../../views/analysis/ElevationProfile/constants.js";import{geodeticDistanceThresholdMeters as r}from"../../views/support/measurementWorkerUtils.js";function o(e){return e.forceInteractive()}function s(e){return i(e,"meters").value>r}function t(e){return null!=e.measurementData?.measurements}function a(){return n()}async function l(i){const{ElevationProfileChart:n}=await(import("../../views/analysis/ElevationProfile/ElevationProfileChart.js"));return e(i.signal),new n({analysisView:i.analysisView,container:i.container,messages:i.messages,onCursorPositionChange:i.onCursorPositionChange,onRangeChange:i.onRangeChange,uniformScaling:i.uniformScaling??!1,hideGridLines:i.hideGridLines??void 0,hideAxisLabels:i.hideAxisLabels??void 0,view:i.view})}export{l as createChart,o as forceInteractive,t as hasValidAreaResult,s as isAboveGeodesicDistanceThreshold,a as setElevationProfileTestConfig};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
async function t(t){const{Pixel:a}=await
|
|
2
|
+
async function t(t){const{Pixel:a}=await(import("../../support/arcadeUtils.js"));return await t.load(),a.getDeclaredMembers(t)}async function a(t){const{Voxel:a}=await(import("../../support/arcadeUtils.js"));return await t.load(),a.getDeclaredMembers(t)}export{t as getDeclaredPixelMembers,a as getDeclaredVoxelMembers};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../views/support/waitForResources.js";async function s(s){await e(s)}async function t(){const{getServiceMockDependencies:e}=await
|
|
2
|
+
import e from"../../views/support/waitForResources.js";async function s(s){await e(s)}async function t(){const{getServiceMockDependencies:e}=await(import("../../support/tests/serviceMockDependencies.js"));return e()}export{t as getServiceMockDependencies,s as waitUpdated};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{throwIfAborted as e}from"../../core/promiseUtils.js";async function t(t,r,o){const{convertMeshVertexSpace:s}=await
|
|
2
|
+
import{throwIfAborted as e}from"../../core/promiseUtils.js";async function t(t,r,o){const{convertMeshVertexSpace:s}=await(import("../../geometry/support/meshUtils/convertMeshVertexSpace.js"));return e(o),s(t,r,{...o,useEllipsoid:!0})}export{t as convertVertexSpaceEllipsoid};
|
package/arcade/arcadeCompiler.js
CHANGED
|
@@ -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,collectDeclaredLocalNames as a,flattenAccessChain as s}from"./compilerUtils.js";import{getNestedOptionalValue as l,tryGetMember as i,getMember as c,getGeometryMember as u,getGeometryKeys as m}from"./containerUtils.js";import p from"./Dictionary.js";import{ArcadeExecutionError as f,ArcadeCompilationError as d,ArcadeUncompilableError as g}from"./executionError.js";import{Feature as h}from"./Feature.js";import{NativeFunction as y,ArcadeFunction as w,ScopeMarshalledFunction as b,wrapModuleScopedResponse as $}from"./FunctionWrapper.js";import{s as v,u as S,i as x,h as I,g as F,v as C,w as M,x as O,y as k,z as j,A,f as E,l as N,B}from"../chunks/languageUtils.js";import{addFunctionDeclaration as _}from"./treeAnalysis.js";import{A as V}from"../chunks/aiServices.js";import{A as T}from"../chunks/array.js";import{registerFunctions as L}from"./functions/date.js";import{registerFunctions as R}from"./functions/feature.js";import{registerFunctions as U}from"./functions/geometry.js";import{registerFunctions as D}from"./functions/geomsync.js";import{registerFunctions as G}from"./functions/maths.js";import{registerFunctions as z}from"./functions/stats.js";import{registerFunctions as q}from"./functions/string.js";import{registerFunctions as P}from"./functions/track.js";import W from"../core/Logger.js";import{isPromiseLike as K}from"../core/promiseUtils.js";import{addMany as Z}from"../core/SetUtils.js";import J from"../geometry/SpatialReference.js";import{isGraphic as Y}from"../support/graphicInstanceUtils.js";import{isArray as H,isNumber as Q,isString as X,isBoolean as ee}from"../support/guards.js";const te=()=>W.getLogger("esri.arcade.arcadeCompiler");class ne{constructor(){this._symbolCounter=0,this.safeAccessTempVarId="_Tsat"}nextVarId(){return this._symbolCounter+=1,`_T${this._symbolCounter}`}nextTempVarId(){return this._symbolCounter+=1,`_Tvar${this._symbolCounter}`}nextLocalsSymbolMapId(){return this._symbolCounter+=1,`_Locals${this._symbolCounter}`}}function re(e,t){const n=e.localScope?.get(t);if(null!=n)return{scope:"local",name:t,var:n};const r=e.globalScope.get(t);return null!=r?{scope:"global",name:t,var:r}:e.standardGlobals.has(t)?{scope:"global",name:t,var:t}:null}function oe(t,n,r="InvalidIdentifier"){const o=re(t,e(n));if(null!=o)return o;throw new d(r,n)}function ae(t,n,r){const o=re(t,e(n));if(null==o)throw te().error(`Internal error: Symbol "${n.name}" not declared.`),new d("NeverReach",n);if(null!=r&&o.scope!==r)throw te().error(`Internal error: Expected to resolve "${n.name}" in the ${r} scope but is in the ${o.scope} scope.`),new d("NeverReach",n);return o}function se(t,n){const r=e(n),o=t.symbolMetadata;if(t.localStack.length>0){const e=t.localStack[t.localStack.length-1],n=o.locals.get(e._SymbolsMapId);if(null==n)return void te().error(`Internal error: no reflection metadata for ${e._SymbolsMapId}`);const a=n.get(r);if(null!=a)return ot.requireInitialized(e[a])}const a=o.globals.get(r);if(null!=a)return ot.requireInitialized(t.globalScope[a]);if(o.standardGlobals.has(r))return ot.requireInitialized(t.globalScope[r]);throw new f("InvalidIdentifier",null)}class le extends w{constructor(e,t){super(),this.paramCount=t,this.fn=e}get debugName(){return null}createFunction(e){return(...e)=>{if(e.length!==this.paramCount)throw new f("WrongNumberOfParameters",null);return this.fn(...e)}}call(e,t){return this.fn(...t.arguments)}marshalledCall(e,t,n,r){return r(e,t,(t,o,a)=>{a=a.map(t=>!x(t)||t instanceof b?t:$(t,e,r));const s=this.call(n,{arguments:a});return K(s)?s.then(e=>$(e,n,r)):s})}}function ie(e,t,n){try{return n(e,null,t.arguments)}catch(r){throw r}}function ce(e,t,n,r,a,s){const{globals:l,exports:i}=o(e),c=new Set(l.keys());Z(c,n);const u=new ne,m=[],p=new Map;for(const o of c)if(n.has(o)||t.has(o))p.set(o,o);else{const e=u.nextVarId();p.set(o,e),m.push(`gscope[${JSON.stringify(e)}] = ${nt};`)}const f=new Map,d=Object.create(null),g={isAsync:r,symbols:u,standardGlobals:t,globalScope:p,exports:i,localScope:null,allLocalSymbolMetadata:f,moduleFactory:s,moduleFactoryMap:d,libraryResolver:a};return{body:[...m,`var ${u.safeAccessTempVarId};`,"var lastStatement = lc.voidOperation;",Fe(g,e),"return lastStatement;"].join("\n"),symbolMetadata:{standardGlobals:t,exports:i,globals:p,locals:f},moduleFactoryMap:d}}function ue(e,t){switch(t.type){case"AssignmentExpression":return ve(e,t);case"UpdateExpression":return be(e,t);case"TemplateLiteral":return Re(e,t);case"Identifier":return Ge(e,t);case"MemberExpression":return Ee(e,t);case"Literal":return null===t.value||void 0===t.value?"null":JSON.stringify(t.value);case"CallExpression":return ze(e,t);case"UnaryExpression":return Te(e,t);case"BinaryExpression":return Ue(e,t);case"LogicalExpression":return De(e,t);case"ArrayExpression":return Le(e,t);case"ObjectExpression":return pe(e,t);case"MemberAccessChainExpression":return Ve(e,t);case"SafeMemberExpression":throw te().error("SafeMemberExpression outside of MemberAccessChainExpression"),new d("Unrecognized",t);default:throw new d("Unrecognized",t)}}function me(e,t){switch(t.type){case"EmptyStatement":return"lc.voidOperation";case"VariableDeclaration":return je(e,t);case"BlockStatement":return Fe(e,t);case"FunctionDeclaration":return ke(e,t);case"ImportDeclaration":return Me(e,t);case"ExportNamedDeclaration":return me(e,t.declaration);case"ReturnStatement":return Ce(e,t);case"IfStatement":return Ie(e,t);case"ExpressionStatement":return Se(e,t);case"BreakStatement":return"break";case"ContinueStatement":return"continue";case"ForStatement":return we(e,t);case"ForInStatement":return he(e,t);case"ForOfStatement":return ye(e,t);case"WhileStatement":return $e(e,t);default:throw new d("Unrecognized",t)}}function pe(e,t){let n="lang.dictionary([";for(let r=0;r<t.properties.length;r++){const o=t.properties[r];let a;a="Identifier"===o.key.type?"'"+o.key.name+"'":ue(e,o.key);r>0&&(n+=","),n+="lang.strCheck("+a+",'ObjectExpression'),lang.aCheck("+ue(e,o.value)+", 'ObjectExpression')"}return n+="])",n}function fe(e,t,n,r,o=(e,t)=>`${e} = ${t}`){const a=e.symbols.nextTempVarId(),s=e.symbols.nextTempVarId();return[`var ${a} = ${n};`,`for (var ${s} = 0; ${s} < ${a}; ${s}++) {`,` ${o(t,s)}`,` ${me(e,r)}`,"}","lastStatement = lc.voidOperation;"].join("\n")}function de(e,t,n,r,o=e=>e){const a=e.symbols.nextTempVarId(),s=e.symbols.nextTempVarId();return[`var ${a} = ${n};`,`for (var ${s} of ${a}) {`,` ${t} = ${o(s)};`,` ${me(e,r)}`,"}","lastStatement = lc.voidOperation;"].join("\n")}function ge(e,t,n,r){const o=e.symbols.nextTempVarId(),a=e.symbols.nextTempVarId(),s=e.symbols.nextTempVarId(),l=e.symbols.nextTempVarId();return[`var ${o} = yield ${n}.queryAll(runtimeCtx.abortSignal);`,`var ${a} = { done: false, value: [] };`,`for (var ${s} = 0; ${s} < ${a}.value.length || ((${s} = 0), !(${a} = yield ${o}.next()).done); ${s}++) {`,` if (${a}.value.length === 0) continue;`,` var ${l} = ${a}.value[${s}];`,` ${t} = lang.createFeature(${l}, ${n}, runtimeCtx);`,` ${me(e,r)}`,"}"].join("\n")}function he(e,t){const n=e.symbols.nextTempVarId();let r,o,a="var "+n+" = "+ue(e,t.right)+";\n";switch("VariableDeclaration"===t.left.type?(r=ae(e,t.left.declarations[0].id),a+=me(e,t.left)):r=oe(e,t.left),r.scope){case"local":o=`lscope['${r.var}']`;break;case"global":o=`gscope['${r.var}']`;break;default:throw r.scope,new d("NeverReach",t.left)}return a+="if ("+n+"===null) { lastStatement = lc.voidOperation; }\n ",a+="else if (lc.isArray("+n+") || lc.isString("+n+")) {\n",a+=fe(e,o,`${n}.length`,t.body),a+="}\n",a+="else if (lc.isImmutableArray("+n+")) {\n",a+=fe(e,o,`${n}.length()`,t.body),a+="}\n",a+="else if (( "+n+" instanceof lang.Dictionary) || lc.isDictionaryLike("+n+")) {\n",a+=de(e,o,`${n}.keys()`,t.body),a+="}\n",e.isAsync&&(a+="else if (lc.isFeatureSet("+n+")) {\n",a+=ge(e,o,n,t.body),a+="}\n"),a+=`else if (lc.isGeometry(${n})) {\n`,a+=de(e,o,`lang.getGeometryKeys(${n})`,t.body),a+="}\n",a+="else { lastStatement = lc.voidOperation; } \n",a}function ye(e,t){const n=e.symbols.nextTempVarId();let r,o,a="var "+n+" = "+ue(e,t.right)+";\n";switch("VariableDeclaration"===t.left.type?(r=ae(e,t.left.declarations[0].id),a+=me(e,t.left)):r=oe(e,t.left),r.scope){case"local":o=`lscope['${r.var}']`;break;case"global":o=`gscope['${r.var}']`;break;default:throw r.scope,new d("NeverReach",t.left)}return a+="if ("+n+"===null) { lastStatement = lc.voidOperation; }\n ",a+="else if (lc.isArray("+n+") || lc.isString("+n+")) {\n",a+=fe(e,o,`${n}.length`,t.body,(e,t)=>[`if (${t} >= ${n}.length) {`," lang.error('OutOfBounds');","}",`${e} = ${n}[${t}];`].join("\n")),a+="}\n",a+="else if (lc.isImmutableArray("+n+")) {\n",a+=fe(e,o,`${n}.length()`,t.body,(e,t)=>`${e} = ${n}.get(${t});`),a+="}\n",a+="else if (( "+n+" instanceof lang.Dictionary) || lc.isDictionaryLike("+n+")) {\n",a+=de(e,o,`${n}.keys()`,t.body,e=>`lang.entry(${e}, ${n}.field(${e}))`),a+="}\n",e.isAsync&&(a+="else if (lc.isFeatureSet("+n+")) {\n",a+=ge(e,o,n,t.body),a+="}\n"),a+=`else if (lc.isGeometry(${n})) {\n`,a+=de(e,o,`lang.getGeometryKeys(${n})`,t.body,e=>`lang.entry(${e}, lang.getGeometryMember(${n}, ${e}))`),a+="}\n",a+="else { lastStatement = lc.voidOperation; } \n",a}function we(e,t){let n="lastStatement = lc.voidOperation; \n";null!==t.init&&("VariableDeclaration"===t.init.type?n+=me(e,t.init):n+=ue(e,t.init)+"; ");const r=e.symbols.nextTempVarId(),o=e.symbols.nextTempVarId();return n+="var "+r+" = true; ",n+="\n do { ",null!==t.update&&(n+=" if ("+r+"===false) {\n "+ue(e,t.update)+" \n}\n "+r+"=false; \n"),null!==t.test&&(n+="var "+o+" = "+ue(e,t.test)+"; ",n+="if ("+o+"===false) { break; } else if ("+o+"!==true) { lang.error('BooleanConditionRequired'); }\n"),n+=me(e,t.body),null!==t.update&&(n+="\n "+ue(e,t.update)),n+="\n"+r+" = true; \n} while(true); lastStatement = lc.voidOperation; ",n}function be(e,t){if("CallExpression"===t.argument.type)throw new d("NeverReach",t);let n;if("MemberExpression"===t.argument.type){const r=ue(e,t.argument.object);return n=!0===t.argument.computed?ue(e,t.argument.property):"'"+t.argument.property.name+"'","lang.memberupdate("+r+","+n+",'"+t.operator+"',"+t.prefix+")"}const r=oe(e,t.argument);switch(Oe(r),r.scope){case"local":return`lang.update(lscope, '${r.var}', '${t.operator}', ${t.prefix})`;case"global":return`lang.update(gscope, '${r.var}', '${t.operator}', ${t.prefix})`;default:throw r.scope,new d("NeverReach",t.argument)}}function $e(e,t){let n="lastStatement = lc.voidOperation; \n";const r=e.symbols.nextTempVarId();return n+=`\n var ${r} = true;\n do {\n ${r} = ${ue(e,t.test)};\n if (${r}==false) {\n break;\n }\n if (${r}!==true) {\n lang.error('BooleanConditionRequired');\n }\n ${me(e,t.body)}\n }\n while (${r} !== false);\n lastStatement = lc.voidOperation;\n `,n}function ve(e,t){const n=ue(e,t.right);if("MemberExpression"===t.left.type){let r;const o=ue(e,t.left.object);return r=!0===t.left.computed?ue(e,t.left.property):"'"+t.left.property.name+"'","lang.assignmember("+o+","+r+",'"+t.operator+"',"+n+")"}const r=oe(e,t.left);switch(Oe(r),r.scope){case"local":return`lscope['${r.var}']=lang.assign(${n},'${t.operator}', ${"="===t.operator?"null":rt(`lscope['${r.var}']`)})`;case"global":return`gscope['${r.var}']=lang.assign(${n},'${t.operator}', ${"="===t.operator?"null":rt(`gscope['${r.var}']`)})`;default:throw r.scope,new d("NeverReach",t.left)}}function Se(e,t){return"AssignmentExpression"===t.expression.type?"lastStatement = lc.voidOperation; "+ue(e,t.expression)+"; \n ":"lastStatement = "+ue(e,t.expression)+"; "}function xe(e,t){return"BlockStatement"===t.type?me(e,t):"ReturnStatement"===t.type||"BreakStatement"===t.type||"ContinueStatement"===t.type?me(e,t)+"; ":"ExpressionStatement"===t.type?me(e,t):me(e,t)+"; "}function Ie(e,t){return`if (lang.mustBoolean(${ue(e,t.test)}) === true) {\n ${xe(e,t.consequent)}\n } `+(null!==t.alternate?"IfStatement"===t.alternate.type?" else "+Ie(e,t.alternate):` else {\n ${xe(e,t.alternate)}\n }\n`:" else {\n lastStatement = lc.voidOperation;\n }\n")}function Fe(e,t){let n="";for(let r=0;r<t.body.length;r++)"EmptyStatement"!==t.body[r].type&&("ReturnStatement"===t.body[r].type||"BreakStatement"===t.body[r].type||"ContinueStatement"===t.body[r].type?n+=me(e,t.body[r])+"; \n":n+=me(e,t.body[r])+" \n");return n}function Ce(e,t){if(null===t.argument)return"return lc.voidOperation";return"return "+ue(e,t.argument)}function Me(e,t){const n=ae(e,t.specifiers[0].local,"global"),r=e.libraryResolver?.loadLibrary(n.name),o=e.symbols.nextVarId();void 0===e.moduleFactory[r.uri]&&(e.moduleFactory[r.uri]=ct(r.syntax,e.moduleFactory,e.isAsync)),e.moduleFactoryMap[o]=r.uri;let a="";return a=e.isAsync?"(yield lang.loadModule('"+o+"', runtimeCtx) ); ":"lang.loadModule('"+o+"', runtimeCtx); ",Oe(n),`gscope['${n.var}']=${a}`}function Oe(e){if("global"===e.scope)switch(e.name){case"iif":case"when":case"defaultvalue":case"decode":throw new g}}function ke(t,n){const r=new Set(n.params.map(t=>e(t))),o=new Set(a(n).keys());Z(o,r);const s=t.symbols,l=new Map;for(const e of o)l.set(e,s.nextVarId());const i=s.nextLocalsSymbolMapId();t.allLocalSymbolMetadata.set(i,l);const c={...t,localScope:l},u=[`lscope._SymbolsMapId = ${JSON.stringify(i)};`];for(let e=0;e<n.params.length;e++){const t=ae(c,n.params[e],"local");Oe(t),u.push(`lscope['${t.var}'] = arguments[${e}];`)}for(const[e,a]of l)r.has(e)||u.push(`lscope['${a}'] = ${nt};`);const m=Fe(c,n.body),p=!0===t.isAsync?["return lang.__awaiter(this, void 0, void 0, function* () {",` ${m}`," return lastStatement;","});"]:[m,"return lastStatement;"],f=["new lang.UserDefinedCompiledFunction("," lang.functionDepthchecker("," function() {"," var lastStatement = lc.voidOperation;"," var lscope = runtimeCtx.localStack[runtimeCtx.localStack.length-1];",...u,...p," },"," runtimeCtx,"," ),",` ${n.params.length},`,")"].join("\n"),d=ae(t,n.id,"global");return Oe(d),`gscope['${d.var}']=${f}; lastStatement = lc.voidOperation;`}function je(e,t){const n=[];for(let r=0;r<t.declarations.length;r++)n.push(Ae(e,t.declarations[r]));return n.join("\n")+" \n lastStatement= lc.voidOperation; \n"}function Ae(e,t){const n=null===t.init?"null":ue(e,t.init),r=ae(e,t.id);switch(Oe(r),r.scope){case"local":return`lscope['${r.var}']=${n};`;case"global":return`gscope['${r.var}']=${n};`;default:throw r.scope,new d("NeverReach",t.id)}}function Ee(e,t){return Ne(e,ue(e,t.object),t)}function Ne(e,t,n){return`lang.member(${t}, ${n.computed?ue(e,n.property):`'${n.property.name}'`})`}function Be(e,t,n){for(const r of n)switch(r.type){case"MemberExpression":t=Ne(e,t,r);break;case"CallExpression":t=qe(e,t,r.arguments);break;default:throw new d("Unrecognized",r)}return t}function _e(e,t,n){return`lang.tryMember(${t}, ${n.computed?ue(e,n.property):`'${n.property.name}'`})`}function Ve(e,t){const n=s(t);let r="",o=ue(e,n.root);for(const a of n.sections)r+=`(${e.symbols.safeAccessTempVarId} = ${_e(e,o,a.checked)}) == null ? null : `,o=Be(e,e.symbols.safeAccessTempVarId,a.unchecked);return`(${r}${o})`}function Te(e,t){try{return"lang.unary("+ue(e,t.argument)+",'"+t.operator+"')"}catch(n){throw n}}function Le(e,t){try{const n=[];for(let r=0;r<t.elements.length;r++)"Literal"===t.elements[r].type?n.push(ue(e,t.elements[r])):n.push("lang.aCheck("+ue(e,t.elements[r])+",'ArrayExpression')");return"["+n.join(",")+"]"}catch(n){throw n}}function Re(e,t){try{const n=[];let r=0;for(const o of t.quasis)n.push(o.value?JSON.stringify(o.value.cooked):JSON.stringify("")),!1===o.tail&&(n.push(t.expressions[r]?"lang.castString(lang.aCheck("+ue(e,t.expressions[r])+", 'TemplateLiteral'))":""),r++);return"(["+n.join(",")+"]).join('')"}catch(n){throw n}}function Ue(e,t){try{return"lang.binary("+ue(e,t.left)+","+ue(e,t.right)+",'"+t.operator+"')"}catch(n){throw n}}function De(e,t){try{if("AssignmentExpression"===t.left.type||"UpdateExpression"===t.left.type)throw new d("LogicalExpressionOnlyBoolean",t);if("AssignmentExpression"===t.right.type||"UpdateExpression"===t.right.type)throw new d("LogicalExpressionOnlyBoolean",t);if("&&"===t.operator||"||"===t.operator)return"(lang.logicalCheck("+ue(e,t.left)+") "+t.operator+" lang.logicalCheck("+ue(e,t.right)+"))";throw new d("LogicExpressionOrAnd",null)}catch(n){throw n}}function Ge(e,t){const n=oe(e,t);switch(Oe(n),n.scope){case"local":return rt(`lscope['${n.var}']`);case"global":return rt(`gscope['${n.var}']`);default:throw n.scope,new d("NeverReach",t)}}function ze(e,t){if("Identifier"===t.callee.type){const n=oe(e,t.callee,"FunctionNotFound");if("global"===n.scope)switch(n.name){case"iif":return Pe(e,t);case"when":return Ke(e,t);case"defaultvalue":return We(e,t);case"decode":return Ze(e,t)}}return qe(e,ue(e,t.callee),t.arguments)}function qe(e,t,n){const r=`lang.callfunc(${t}, [${n.map(t=>ue(e,t)).join(", ")}], runtimeCtx)`;return e.isAsync?`(yield ${r})`:r}function Pe(e,t){try{if(3!==t.arguments.length)throw new d("WrongNumberOfParameters",t);const n=e.symbols.nextTempVarId();return`${e.isAsync?"(yield (function() { \n return lang.__awaiter(this, void 0, void 0, function* () {":"function() {"}\n var ${n} = ${ue(e,t.arguments[0])};\n\n if (${n} === true) {\n return ${ue(e,t.arguments[1])};\n }\n else if (${n} === false) {\n return ${ue(e,t.arguments[2])};\n }\n else {\n lang.error('ExecutionErrorCodes.BooleanConditionRequired');\n }\n ${e.isAsync?"})}()))":"}()"}`}catch(n){throw n}}function We(e,t){try{if(t.arguments.length<2||t.arguments.length>3)throw new d("WrongNumberOfParameters",t);const n=e.symbols.nextTempVarId(),r=e.symbols.nextTempVarId();return 3===t.arguments.length?`${e.isAsync?"(yield (function() { \n return lang.__awaiter(this, void 0, void 0, function* () {":"function() {"}\n var ${n} = ${ue(e,t.arguments[0])};\n var ${r} = ${ue(e,t.arguments[1])};\n ${n} = lang.getNestedOptionalValue(${n}, ${r});\n return ${n} != null && ${n} !== "" ? ${n} : ${ue(e,t.arguments[2])};\n ${e.isAsync?"})}()))":"}()"}`:`${e.isAsync?"(yield (function() { \n return lang.__awaiter(this, void 0, void 0, function* () {":"function() {"}\n var ${n} = ${ue(e,t.arguments[0])};\n if (${n} === null) {\n return ${ue(e,t.arguments[1])};\n }\n if (${n} === "") {\n return ${ue(e,t.arguments[1])};\n }\n if (${n} === undefined) {\n return ${ue(e,t.arguments[1])};\n }\n return ${n};\n ${e.isAsync?"})}()))":"}()"}`}catch(n){throw n}}function Ke(e,t){try{if(t.arguments.length<3)throw new d("WrongNumberOfParameters",t);if(t.arguments.length%2==0)throw new d("WrongNumberOfParameters",t);const n=e.symbols.nextTempVarId();let r="var ";for(let o=0;o<t.arguments.length-1;o+=2)r+=`${n} = lang.mustBoolean(${ue(e,t.arguments[o])});\n if (${n} === true ) {\n return ${ue(e,t.arguments[o+1])}\n }\n`;return`${e.isAsync?"(yield (function() { \n return lang.__awaiter(this, void 0, void 0, function* () {":"function() {"}\n ${r}\n return ${ue(e,t.arguments[t.arguments.length-1])}\n ${e.isAsync?"})}()))":"}()"}`}catch(n){throw n}}function Ze(e,t){try{if(t.arguments.length<2)throw new d("WrongNumberOfParameters",t);if(2===t.arguments.length)return`(${ue(e,t.arguments[1])})`;if((t.arguments.length-1)%2==0)throw new d("WrongNumberOfParameters",t);const n=e.symbols.nextTempVarId();let r;if(t.arguments.every((e,t)=>t%2==0||"Literal"===e.type)){r=`switch (${n}) {`;for(let n=1;n<t.arguments.length-1;n+=2){const o=t.arguments[n],a=t.arguments[n+1];null==o.value?r+="\n case null:\n case lc.voidOperation:\n ":r+=`\n case ${JSON.stringify(o.value)}:\n `,r+=`return ${ue(e,a)}`}r+="}"}else{const o=e.symbols.nextTempVarId();r="var ";for(let a=1;a<t.arguments.length-1;a+=2){const s=t.arguments[a],l=t.arguments[a+1];r+=`${o} = ${ue(e,s)};\n if (lang.binary(${o}, ${n}, "==") === true ) {\n return ${ue(e,l)}\n }\n `}}return`${e.isAsync?"(yield (function() { \n return lang.__awaiter(this, void 0, void 0, function* () {":"function() {"}\n var ${n} = ${ue(e,t.arguments[0])};\n ${r}\n return ${ue(e,t.arguments[t.arguments.length-1])}\n ${e.isAsync?"})}()))":"}()"}`}catch(n){throw n}}function Je(e,t){try{return ie(e,t,(e,t)=>{throw new f("Unrecognized",t)})}catch(n){throw n}}function Ye(e){const t=function(){this.textformatting=p.textFormatting()};t.prototype=Object.create(null),t.provided=new Set(["textformatting","infinity","nan","pi"]),t.prototype.infinity=Number.POSITIVE_INFINITY,t.prototype.nan=Number.NaN,t.prototype.pi=Math.PI;for(const[n,r]of Object.entries(e))t.prototype[n]=new y(r),t.provided.add(n);return t}function He(){const e=Object.create(null);L(e,ie),q(e,ie),R(e,ie,se),G(e,ie),U(e,ie),z(e,ie),P(e,ie),e.iif=Je,e.decode=Je,e.when=Je,e.defaultvalue=Je;const t=Ye(e);D(e,ie);return{ScopeSync:Ye(e),ScopeAsync:t}}const{ScopeSync:Qe,ScopeAsync:Xe}=He();function et(e,t){const n={mode:t,compiled:!0,functions:Object.create(null),signatures:[],standardFunction:ie,standardFunctionAsync:ie,evaluateIdentifier:se};for(const r of e)r.registerFunctions(n);if("sync"===t)for(const[r,o]of Object.entries(n.functions))Qe.prototype[r]=new y(o),Qe.provided.add(r);else for(const[r,o]of Object.entries(n.functions))Xe.prototype[r]=new y(o),Xe.provided.add(r);for(const r of n.signatures)_(r,t)}et([T],"sync"),et([T],"async"),et([V],"async");const tt=Symbol("uninitialized"),nt="lang.uninitialized";function rt(e){return`lang.requireInitialized(${e})`}const ot={uninitialized:tt,requireInitialized(e){if(e===tt)throw new f("InvalidIdentifier",null);return e},isNumber:e=>Q(e),isArray:e=>H(e),isImmutableArray:e=>F(e),isDictionaryLike:e=>B(e),isString:e=>X(e),isDictionary:e=>N(e),isGeometry:e=>E(e),getGeometryKeys:e=>m(e),getGeometryMember:(e,t)=>u(e,t,null),error(e){throw new f(e,null)},__awaiter(e,t,n,r){const o=r.apply(e,t||[]);let a=o.next();for(;!a.done&&!K(a.value);)a=o.next(a.value);return a.done?a.value:new Promise((e,t)=>{function n(r){for(;!r.done;){if(K(r.value))return void Promise.resolve(r.value).then(e=>{try{n(o.next(e))}catch(r){t(r)}},e=>{try{n(o.throw(e))}catch(r){t(r)}});try{r=o.next(r.value)}catch(a){return void t(a)}}e(r.value)}n(a)})},functionDepthchecker:(e,t)=>function(){if(t.depthCounter.depth++,t.localStack.push({}),t.depthCounter.depth>64)throw new f("MaximumCallDepth",null);const n=e.apply(this,arguments);return K(n)?n.then(e=>(t.depthCounter.depth--,t.localStack.length=t.localStack.length-1,e)):(t.depthCounter.depth--,t.localStack.length=t.localStack.length-1,n)},mustBoolean(e){if(!0===e||!1===e)return e;throw new f("BooleanConditionRequired",null)},castString:e=>M(e),aCheck(e,t){if(x(e)){if("ArrayExpression"===t)throw new f("NoFunctionInArray",null);if("ObjectExpression"===t)throw new f("NoFunctionInDictionary",null);throw new f("NoFunctionInTemplateLiteral",null)}return e===O?null:e},Dictionary:p,Feature:h,UserDefinedCompiledFunction:le,dictionary(e){const t=Object.create(null),n=new Map;for(let o=0;o<e.length;o+=2){if(x(e[o+1]))throw new f("NoFunctionInDictionary",null);if(!1===X(e[o]))throw new f("KeyMustBeString",null);let r=e[o].toString();const a=r.toLowerCase();n.has(a)?r=n.get(a):n.set(a,r),e[o+1]===O?t[r]=null:t[r]=e[o+1]}const r=new p(t);return r.immutable=!1,r},entry:(e,t)=>p.containerEntry(e,t),strCheck(e){if(!1===X(e))throw new f("KeyMustBeString",null);return e},unary(e,t){if(ee(e)){if("!"===t)return!e;if("-"===t)return-1*C(e);if("+"===t)return 1*C(e);if("~"===t)return~C(e);throw new f("UnsupportUnaryOperator",null)}if("-"===t)return-1*C(e);if("+"===t)return 1*C(e);if("~"===t)return~C(e);throw new f("UnsupportUnaryOperator",null)},logicalCheck(e){if(!1===ee(e))throw new f("LogicExpressionOrAnd",null);return e},logical(e,t,n){if(ee(e)&&ee(t))switch(n){case"||":return e||t;case"&&":return e&&t;default:throw new f("LogicExpressionOrAnd",null)}throw new f("LogicExpressionOrAnd",null)},binary(e,t,n){switch(n){case"|":case"<<":case">>":case">>>":case"^":case"&":return A(C(e),C(t),n);case"==":return j(e,t);case"!=":return!j(e,t);case"<":case">":case"<=":case">=":return k(e,t,n);case"+":return X(e)||X(t)?M(e)+M(t):C(e)+C(t);case"-":return C(e)-C(t);case"*":return C(e)*C(t);case"/":return C(e)/C(t);case"%":return C(e)%C(t);default:throw new f("UnsupportedOperator",null)}},assign(e,t,n){switch(t){case"=":return e===O?null:e;case"/=":return C(n)/C(e);case"*=":return C(n)*C(e);case"-=":return C(n)-C(e);case"+=":return X(n)||X(e)?M(n)+M(e):C(n)+C(e);case"%=":return C(n)%C(e);default:throw new f("UnsupportedOperator",null)}},update(e,t,n,r){const o=C(this.requireInitialized(e[t]));return e[t]="++"===n?o+1:o-1,!1===r?o:"++"===n?o+1:o-1},createFeature:(e,t,n)=>h.createFromGraphicLikeObject(e.geometry,e.attributes,t,n.timeZone),memberupdate(e,t,n,r){let o;if(H(e)){if(!Q(t))throw new f("ArrayAccessMustBeNumber",null);if(t<0&&(t=e.length+t),t<0||t>=e.length)throw new f("OutOfBounds",null);o=C(e[t]),e[t]="++"===n?o+1:o-1}else if(e instanceof p){if(!1===X(t))throw new f("KeyAccessorMustBeString",null);if(!0!==e.hasField(t))throw new f("FieldNotFound",null,{key:t});o=C(e.field(t)),e.setField(t,"++"===n?o+1:o-1)}else if(I(e)){if(!1===X(t))throw new f("KeyAccessorMustBeString",null);if(!0!==e.hasField(t))throw new f("FieldNotFound",null,{key:t});o=C(e.field(t)),e.setField(t,"++"===n?o+1:o-1)}else{if(F(e))throw new f("Immutable",null);if(!(e instanceof it))throw new f("InvalidIdentifier",null);if(!1===X(t))throw new f("ModuleAccessorMustBeString",null);if(!0!==e.hasGlobal(t))throw new f("ModuleExportNotFound",null);o=C(e.global(t)),e.setGlobal(t,"++"===n?o+1:o-1)}return!1===r?o:"++"===n?o+1:o-1},assignmember(e,t,n,r){if(H(e)){if(!Q(t))throw new f("ArrayAccessMustBeNumber",null);if(t<0&&(t=e.length+t),t<0||t>e.length)throw new f("OutOfBounds",null);if(t===e.length){if("="!==n)throw new f("OutOfBounds",null);e[t]=this.assign(r,n,e[t])}else e[t]=this.assign(r,n,e[t])}else if(e instanceof p){if(!1===X(t))throw new f("KeyAccessorMustBeString",null);if(!0===e.hasField(t))e.setField(t,this.assign(r,n,e.field(t)));else{if("="!==n)throw new f("FieldNotFound",null,{key:t});e.setField(t,this.assign(r,n,null))}}else if(I(e)){if(!1===X(t))throw new f("KeyAccessorMustBeString",null);if(!0===e.hasField(t))e.setField(t,this.assign(r,n,e.field(t)));else{if("="!==n)throw new f("FieldNotFound",null,{key:t});e.setField(t,this.assign(r,n,null))}}else{if(F(e))throw new f("Immutable",null);if(!(e instanceof it))throw new f("InvalidIdentifier",null);if(!1===X(t))throw new f("ModuleAccessorMustBeString",null);if(!e.hasGlobal(t))throw new f("ModuleExportNotFound",null);e.setGlobal(t,this.assign(r,n,e.global(t)))}},member:(e,t)=>c(e,t),tryMember:(e,t)=>i(e,t),callfunc(e,t,n){if(x(e))return e.call(n,{arguments:t,preparsed:!0});throw new f("CallNonFunction",null)},loadModule(e,t){const n=t.moduleFactoryMap[e];if(t.moduleSingletons[n])return t.moduleSingletons[n];const r=t.moduleFactory[n]({moduleSingletons:t.moduleSingletons,depthCounter:t.depthCounter,lrucache:t.lrucache,interceptor:t.interceptor,services:t.services,console:t.console,abortSignal:t.abortSignal,timeZone:t.timeZone??null,spatialReference:t.spatialReference});return t.moduleSingletons[n]=r,r},getNestedOptionalValue:(e,t)=>l(e,t)};function at(e){console.log(e)}function st(n,o,a=!1){let s=null;n.usesModules&&(s=new r(null,n.loadedModules));const l=Object.create(null),i=new Set(Object.keys(o?.vars||{}).map(t=>e(t))),c=new Set(Object.keys(o?.customfunctions||{}).map(t=>e(t))),u=ce(n,a?Xe.provided:Qe.provided,new Set([...i,...c]),a,s,l);let m;m=a?["var runtimeCtx = this.prepare(context, true);","var lc = this.lc;","var lang = this.lang;","var gscope = runtimeCtx.globalScope;","return lang.__awaiter(this, void 0, void 0, function* () {"," function mainBody() {"," return lang.__awaiter(this, void 0, void 0, function* () {",` ${u.body}`," });"," }"," return this.postProcess(yield mainBody());","});"].join("\n"):["var runtimeCtx = this.prepare(context, false);","var lc = this.lc;","var lang = this.lang;","var gscope = runtimeCtx.globalScope;","function mainBody() {",` ${u.body}`,"}","return this.postProcess(mainBody());"].join("\n");const{symbolMetadata:p,moduleFactoryMap:d}=u,g={lc:v,lang:ot,postProcess(e){if(S(e))return null;if(x(e))throw new f("IllegalResult",null);return e},prepare(e,n){const r=e.spatialReference??J.WebMercator,o=n?new Xe:new Qe;for(const t of c)null!=e.customfunctions&&t in e.customfunctions?o[t]=e.customfunctions[t]??null:o[t]=tt;for(const t of i){if(null==e.vars||!(t in e.vars)){t in o||(o[t]=tt);continue}const n=e.vars[t]??null;Y(n)?o[t]=h.createFromGraphic(n,e.timeZone??null):o[t]=n}return{lrucache:e.lrucache,interceptor:e.interceptor,services:e.services,console:e.console??at,abortSignal:e.abortSignal??t,timeZone:e.timeZone??null,spatialReference:r,track:e.track,globalScope:o,localStack:[],depthCounter:{depth:1},symbolMetadata:p,moduleFactory:l,moduleFactoryMap:d,moduleSingletons:Object.create(null)}}};return new Function("context",m).bind(g)}async function lt(){return et([await import("./functions/geomasync.js")],"async"),!0}class it extends n{constructor(e){super(),this.moduleContext=e}hasGlobal(t){const n=this.moduleContext.symbolMetadata.exports;return n.has(t)||n.has(e(t))}setGlobal(t,n){if(x(n))throw new f("AssignModuleFunction",null);const r=this.moduleContext.symbolMetadata.globals.get(e(t));if(null==r)throw new f("ModuleExportNotFound",null);this.moduleContext.globalScope[r]=n}global(t){const n=this.moduleContext.symbolMetadata.globals.get(e(t));if(null==n)throw new f("ModuleExportNotFound",null);const r=this.moduleContext.globalScope,o=ot.requireInitialized(r[n]);if(x(o)&&!(o instanceof b)){const e=new b;return e.fn=o,e.parameterEvaluator=ie,e.context=this.moduleContext,r[n]=e,e}return o}}function ct(e,n,o){const a=new r(null,e.loadedModules),s=ce(e,o?Xe.provided:Qe.provided,new Set,o,a,n);let l;l=o?["var runtimeCtx = this.prepare(context, true);","var lc = this.lc;","var lang = this.lang;","var gscope = runtimeCtx.globalScope;","return lang.__awaiter(this, void 0, void 0, function* () {"," function mainBody() {"," return lang.__awaiter(this, void 0, void 0, function* () {",` ${s.body}`," });"," }"," yield mainBody();"," return this.prepareModule(runtimeCtx);","});"].join("\n"):["var runtimeCtx = this.prepare(context, false);","var lc = this.lc;","var lang = this.lang;","var gscope = runtimeCtx.globalScope;","function mainBody() {",` ${s.body}`,"}","mainBody();","return this.prepareModule(runtimeCtx);"].join("\n");const{symbolMetadata:i,moduleFactoryMap:c}=s,u={lc:v,lang:ot,prepareModule:e=>new it(e),prepare(e,r){const o=e.spatialReference??J.WebMercator,a=r?new Xe:new Qe;return{lrucache:e.lrucache,interceptor:e.interceptor,services:e.services,console:e.console??at,abortSignal:e.abortSignal??t,timeZone:e.timeZone??null,spatialReference:o,track:null,globalScope:a,localStack:[],depthCounter:e.depthCounter,symbolMetadata:i,moduleFactory:n,moduleFactoryMap:c,moduleSingletons:e.moduleSingletons}}};return new Function("context",l).bind(u)}export{le as UserDefinedCompiledFunction,st as compileScript,lt as enableAsyncSupport,et as extend};
|
|
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,collectDeclaredLocalNames as a,flattenAccessChain as s}from"./compilerUtils.js";import{getNestedOptionalValue as l,tryGetMember as i,getMember as c,getGeometryMember as u,getGeometryKeys as m}from"./containerUtils.js";import p from"./Dictionary.js";import{ArcadeExecutionError as f,ArcadeCompilationError as d,ArcadeUncompilableError as g}from"./executionError.js";import{Feature as h}from"./Feature.js";import{NativeFunction as y,ArcadeFunction as w,ScopeMarshalledFunction as b,wrapModuleScopedResponse as $}from"./FunctionWrapper.js";import{s as v,u as S,i as x,h as I,g as F,v as C,w as M,x as O,y as k,z as j,A,f as E,l as N,B}from"../chunks/languageUtils.js";import{addFunctionDeclaration as _}from"./treeAnalysis.js";import{A as V}from"../chunks/aiServices.js";import{A as T}from"../chunks/array.js";import{registerFunctions as L}from"./functions/date.js";import{registerFunctions as R}from"./functions/feature.js";import{registerFunctions as U}from"./functions/geometry.js";import{registerFunctions as D}from"./functions/geomsync.js";import{registerFunctions as G}from"./functions/maths.js";import{registerFunctions as z}from"./functions/stats.js";import{registerFunctions as q}from"./functions/string.js";import{registerFunctions as P}from"./functions/track.js";import W from"../core/Logger.js";import{isPromiseLike as K}from"../core/promiseUtils.js";import{addMany as Z}from"../core/SetUtils.js";import J from"../geometry/SpatialReference.js";import{isGraphic as Y}from"../support/graphicInstanceUtils.js";import{isArray as H,isNumber as Q,isString as X,isBoolean as ee}from"../support/guards.js";const te=()=>W.getLogger("esri.arcade.arcadeCompiler");class ne{constructor(){this._symbolCounter=0,this.safeAccessTempVarId="_Tsat"}nextVarId(){return this._symbolCounter+=1,`_T${this._symbolCounter}`}nextTempVarId(){return this._symbolCounter+=1,`_Tvar${this._symbolCounter}`}nextLocalsSymbolMapId(){return this._symbolCounter+=1,`_Locals${this._symbolCounter}`}}function re(e,t){const n=e.localScope?.get(t);if(null!=n)return{scope:"local",name:t,var:n};const r=e.globalScope.get(t);return null!=r?{scope:"global",name:t,var:r}:e.standardGlobals.has(t)?{scope:"global",name:t,var:t}:null}function oe(t,n,r="InvalidIdentifier"){const o=re(t,e(n));if(null!=o)return o;throw new d(r,n)}function ae(t,n,r){const o=re(t,e(n));if(null==o)throw te().error(`Internal error: Symbol "${n.name}" not declared.`),new d("NeverReach",n);if(null!=r&&o.scope!==r)throw te().error(`Internal error: Expected to resolve "${n.name}" in the ${r} scope but is in the ${o.scope} scope.`),new d("NeverReach",n);return o}function se(t,n){const r=e(n),o=t.symbolMetadata;if(t.localStack.length>0){const e=t.localStack[t.localStack.length-1],n=o.locals.get(e._SymbolsMapId);if(null==n)return void te().error(`Internal error: no reflection metadata for ${e._SymbolsMapId}`);const a=n.get(r);if(null!=a)return ot.requireInitialized(e[a])}const a=o.globals.get(r);if(null!=a)return ot.requireInitialized(t.globalScope[a]);if(o.standardGlobals.has(r))return ot.requireInitialized(t.globalScope[r]);throw new f("InvalidIdentifier",null)}class le extends w{constructor(e,t){super(),this.paramCount=t,this.fn=e}get debugName(){return null}createFunction(e){return(...e)=>{if(e.length!==this.paramCount)throw new f("WrongNumberOfParameters",null);return this.fn(...e)}}call(e,t){return this.fn(...t.arguments)}marshalledCall(e,t,n,r){return r(e,t,(t,o,a)=>{a=a.map(t=>!x(t)||t instanceof b?t:$(t,e,r));const s=this.call(n,{arguments:a});return K(s)?s.then(e=>$(e,n,r)):s})}}function ie(e,t,n){try{return n(e,null,t.arguments)}catch(r){throw r}}function ce(e,t,n,r,a,s){const{globals:l,exports:i}=o(e),c=new Set(l.keys());Z(c,n);const u=new ne,m=[],p=new Map;for(const o of c)if(n.has(o)||t.has(o))p.set(o,o);else{const e=u.nextVarId();p.set(o,e),m.push(`gscope[${JSON.stringify(e)}] = ${nt};`)}const f=new Map,d=Object.create(null),g={isAsync:r,symbols:u,standardGlobals:t,globalScope:p,exports:i,localScope:null,allLocalSymbolMetadata:f,moduleFactory:s,moduleFactoryMap:d,libraryResolver:a};return{body:[...m,`var ${u.safeAccessTempVarId};`,"var lastStatement = lc.voidOperation;",Fe(g,e),"return lastStatement;"].join("\n"),symbolMetadata:{standardGlobals:t,exports:i,globals:p,locals:f},moduleFactoryMap:d}}function ue(e,t){switch(t.type){case"AssignmentExpression":return ve(e,t);case"UpdateExpression":return be(e,t);case"TemplateLiteral":return Re(e,t);case"Identifier":return Ge(e,t);case"MemberExpression":return Ee(e,t);case"Literal":return null===t.value||void 0===t.value?"null":JSON.stringify(t.value);case"CallExpression":return ze(e,t);case"UnaryExpression":return Te(e,t);case"BinaryExpression":return Ue(e,t);case"LogicalExpression":return De(e,t);case"ArrayExpression":return Le(e,t);case"ObjectExpression":return pe(e,t);case"MemberAccessChainExpression":return Ve(e,t);case"SafeMemberExpression":throw te().error("SafeMemberExpression outside of MemberAccessChainExpression"),new d("Unrecognized",t);default:throw new d("Unrecognized",t)}}function me(e,t){switch(t.type){case"EmptyStatement":return"lc.voidOperation";case"VariableDeclaration":return je(e,t);case"BlockStatement":return Fe(e,t);case"FunctionDeclaration":return ke(e,t);case"ImportDeclaration":return Me(e,t);case"ExportNamedDeclaration":return me(e,t.declaration);case"ReturnStatement":return Ce(e,t);case"IfStatement":return Ie(e,t);case"ExpressionStatement":return Se(e,t);case"BreakStatement":return"break";case"ContinueStatement":return"continue";case"ForStatement":return we(e,t);case"ForInStatement":return he(e,t);case"ForOfStatement":return ye(e,t);case"WhileStatement":return $e(e,t);default:throw new d("Unrecognized",t)}}function pe(e,t){let n="lang.dictionary([";for(let r=0;r<t.properties.length;r++){const o=t.properties[r];let a;a="Identifier"===o.key.type?"'"+o.key.name+"'":ue(e,o.key);r>0&&(n+=","),n+="lang.strCheck("+a+",'ObjectExpression'),lang.aCheck("+ue(e,o.value)+", 'ObjectExpression')"}return n+="])",n}function fe(e,t,n,r,o=(e,t)=>`${e} = ${t}`){const a=e.symbols.nextTempVarId(),s=e.symbols.nextTempVarId();return[`var ${a} = ${n};`,`for (var ${s} = 0; ${s} < ${a}; ${s}++) {`,` ${o(t,s)}`,` ${me(e,r)}`,"}","lastStatement = lc.voidOperation;"].join("\n")}function de(e,t,n,r,o=e=>e){const a=e.symbols.nextTempVarId(),s=e.symbols.nextTempVarId();return[`var ${a} = ${n};`,`for (var ${s} of ${a}) {`,` ${t} = ${o(s)};`,` ${me(e,r)}`,"}","lastStatement = lc.voidOperation;"].join("\n")}function ge(e,t,n,r){const o=e.symbols.nextTempVarId(),a=e.symbols.nextTempVarId(),s=e.symbols.nextTempVarId(),l=e.symbols.nextTempVarId();return[`var ${o} = yield ${n}.queryAll(runtimeCtx.abortSignal);`,`var ${a} = { done: false, value: [] };`,`for (var ${s} = 0; ${s} < ${a}.value.length || ((${s} = 0), !(${a} = yield ${o}.next()).done); ${s}++) {`,` if (${a}.value.length === 0) continue;`,` var ${l} = ${a}.value[${s}];`,` ${t} = lang.createFeature(${l}, ${n}, runtimeCtx);`,` ${me(e,r)}`,"}"].join("\n")}function he(e,t){const n=e.symbols.nextTempVarId();let r,o,a="var "+n+" = "+ue(e,t.right)+";\n";switch("VariableDeclaration"===t.left.type?(r=ae(e,t.left.declarations[0].id),a+=me(e,t.left)):r=oe(e,t.left),r.scope){case"local":o=`lscope['${r.var}']`;break;case"global":o=`gscope['${r.var}']`;break;default:throw r.scope,new d("NeverReach",t.left)}return a+="if ("+n+"===null) { lastStatement = lc.voidOperation; }\n ",a+="else if (lc.isArray("+n+") || lc.isString("+n+")) {\n",a+=fe(e,o,`${n}.length`,t.body),a+="}\n",a+="else if (lc.isImmutableArray("+n+")) {\n",a+=fe(e,o,`${n}.length()`,t.body),a+="}\n",a+="else if (( "+n+" instanceof lang.Dictionary) || lc.isDictionaryLike("+n+")) {\n",a+=de(e,o,`${n}.keys()`,t.body),a+="}\n",e.isAsync&&(a+="else if (lc.isFeatureSet("+n+")) {\n",a+=ge(e,o,n,t.body),a+="}\n"),a+=`else if (lc.isGeometry(${n})) {\n`,a+=de(e,o,`lang.getGeometryKeys(${n})`,t.body),a+="}\n",a+="else { lastStatement = lc.voidOperation; } \n",a}function ye(e,t){const n=e.symbols.nextTempVarId();let r,o,a="var "+n+" = "+ue(e,t.right)+";\n";switch("VariableDeclaration"===t.left.type?(r=ae(e,t.left.declarations[0].id),a+=me(e,t.left)):r=oe(e,t.left),r.scope){case"local":o=`lscope['${r.var}']`;break;case"global":o=`gscope['${r.var}']`;break;default:throw r.scope,new d("NeverReach",t.left)}return a+="if ("+n+"===null) { lastStatement = lc.voidOperation; }\n ",a+="else if (lc.isArray("+n+") || lc.isString("+n+")) {\n",a+=fe(e,o,`${n}.length`,t.body,(e,t)=>[`if (${t} >= ${n}.length) {`," lang.error('OutOfBounds');","}",`${e} = ${n}[${t}];`].join("\n")),a+="}\n",a+="else if (lc.isImmutableArray("+n+")) {\n",a+=fe(e,o,`${n}.length()`,t.body,(e,t)=>`${e} = ${n}.get(${t});`),a+="}\n",a+="else if (( "+n+" instanceof lang.Dictionary) || lc.isDictionaryLike("+n+")) {\n",a+=de(e,o,`${n}.keys()`,t.body,e=>`lang.entry(${e}, ${n}.field(${e}))`),a+="}\n",e.isAsync&&(a+="else if (lc.isFeatureSet("+n+")) {\n",a+=ge(e,o,n,t.body),a+="}\n"),a+=`else if (lc.isGeometry(${n})) {\n`,a+=de(e,o,`lang.getGeometryKeys(${n})`,t.body,e=>`lang.entry(${e}, lang.getGeometryMember(${n}, ${e}))`),a+="}\n",a+="else { lastStatement = lc.voidOperation; } \n",a}function we(e,t){let n="lastStatement = lc.voidOperation; \n";null!==t.init&&("VariableDeclaration"===t.init.type?n+=me(e,t.init):n+=ue(e,t.init)+"; ");const r=e.symbols.nextTempVarId(),o=e.symbols.nextTempVarId();return n+="var "+r+" = true; ",n+="\n do { ",null!==t.update&&(n+=" if ("+r+"===false) {\n "+ue(e,t.update)+" \n}\n "+r+"=false; \n"),null!==t.test&&(n+="var "+o+" = "+ue(e,t.test)+"; ",n+="if ("+o+"===false) { break; } else if ("+o+"!==true) { lang.error('BooleanConditionRequired'); }\n"),n+=me(e,t.body),null!==t.update&&(n+="\n "+ue(e,t.update)),n+="\n"+r+" = true; \n} while(true); lastStatement = lc.voidOperation; ",n}function be(e,t){if("CallExpression"===t.argument.type)throw new d("NeverReach",t);let n;if("MemberExpression"===t.argument.type){const r=ue(e,t.argument.object);return n=!0===t.argument.computed?ue(e,t.argument.property):"'"+t.argument.property.name+"'","lang.memberupdate("+r+","+n+",'"+t.operator+"',"+t.prefix+")"}const r=oe(e,t.argument);switch(Oe(r),r.scope){case"local":return`lang.update(lscope, '${r.var}', '${t.operator}', ${t.prefix})`;case"global":return`lang.update(gscope, '${r.var}', '${t.operator}', ${t.prefix})`;default:throw r.scope,new d("NeverReach",t.argument)}}function $e(e,t){let n="lastStatement = lc.voidOperation; \n";const r=e.symbols.nextTempVarId();return n+=`\n var ${r} = true;\n do {\n ${r} = ${ue(e,t.test)};\n if (${r}==false) {\n break;\n }\n if (${r}!==true) {\n lang.error('BooleanConditionRequired');\n }\n ${me(e,t.body)}\n }\n while (${r} !== false);\n lastStatement = lc.voidOperation;\n `,n}function ve(e,t){const n=ue(e,t.right);if("MemberExpression"===t.left.type){let r;const o=ue(e,t.left.object);return r=!0===t.left.computed?ue(e,t.left.property):"'"+t.left.property.name+"'","lang.assignmember("+o+","+r+",'"+t.operator+"',"+n+")"}const r=oe(e,t.left);switch(Oe(r),r.scope){case"local":return`lscope['${r.var}']=lang.assign(${n},'${t.operator}', ${"="===t.operator?"null":rt(`lscope['${r.var}']`)})`;case"global":return`gscope['${r.var}']=lang.assign(${n},'${t.operator}', ${"="===t.operator?"null":rt(`gscope['${r.var}']`)})`;default:throw r.scope,new d("NeverReach",t.left)}}function Se(e,t){return"AssignmentExpression"===t.expression.type?"lastStatement = lc.voidOperation; "+ue(e,t.expression)+"; \n ":"lastStatement = "+ue(e,t.expression)+"; "}function xe(e,t){return"BlockStatement"===t.type?me(e,t):"ReturnStatement"===t.type||"BreakStatement"===t.type||"ContinueStatement"===t.type?me(e,t)+"; ":"ExpressionStatement"===t.type?me(e,t):me(e,t)+"; "}function Ie(e,t){return`if (lang.mustBoolean(${ue(e,t.test)}) === true) {\n ${xe(e,t.consequent)}\n } `+(null!==t.alternate?"IfStatement"===t.alternate.type?" else "+Ie(e,t.alternate):` else {\n ${xe(e,t.alternate)}\n }\n`:" else {\n lastStatement = lc.voidOperation;\n }\n")}function Fe(e,t){let n="";for(let r=0;r<t.body.length;r++)"EmptyStatement"!==t.body[r].type&&("ReturnStatement"===t.body[r].type||"BreakStatement"===t.body[r].type||"ContinueStatement"===t.body[r].type?n+=me(e,t.body[r])+"; \n":n+=me(e,t.body[r])+" \n");return n}function Ce(e,t){if(null===t.argument)return"return lc.voidOperation";return"return "+ue(e,t.argument)}function Me(e,t){const n=ae(e,t.specifiers[0].local,"global"),r=e.libraryResolver?.loadLibrary(n.name),o=e.symbols.nextVarId();void 0===e.moduleFactory[r.uri]&&(e.moduleFactory[r.uri]=ct(r.syntax,e.moduleFactory,e.isAsync)),e.moduleFactoryMap[o]=r.uri;let a="";return a=e.isAsync?"(yield lang.loadModule('"+o+"', runtimeCtx) ); ":"lang.loadModule('"+o+"', runtimeCtx); ",Oe(n),`gscope['${n.var}']=${a}`}function Oe(e){if("global"===e.scope)switch(e.name){case"iif":case"when":case"defaultvalue":case"decode":throw new g}}function ke(t,n){const r=new Set(n.params.map(t=>e(t))),o=new Set(a(n).keys());Z(o,r);const s=t.symbols,l=new Map;for(const e of o)l.set(e,s.nextVarId());const i=s.nextLocalsSymbolMapId();t.allLocalSymbolMetadata.set(i,l);const c={...t,localScope:l},u=[`lscope._SymbolsMapId = ${JSON.stringify(i)};`];for(let e=0;e<n.params.length;e++){const t=ae(c,n.params[e],"local");Oe(t),u.push(`lscope['${t.var}'] = arguments[${e}];`)}for(const[e,a]of l)r.has(e)||u.push(`lscope['${a}'] = ${nt};`);const m=Fe(c,n.body),p=!0===t.isAsync?["return lang.__awaiter(this, void 0, void 0, function* () {",` ${m}`," return lastStatement;","});"]:[m,"return lastStatement;"],f=["new lang.UserDefinedCompiledFunction("," lang.functionDepthchecker("," function() {"," var lastStatement = lc.voidOperation;"," var lscope = runtimeCtx.localStack[runtimeCtx.localStack.length-1];",...u,...p," },"," runtimeCtx,"," ),",` ${n.params.length},`,")"].join("\n"),d=ae(t,n.id,"global");return Oe(d),`gscope['${d.var}']=${f}; lastStatement = lc.voidOperation;`}function je(e,t){const n=[];for(let r=0;r<t.declarations.length;r++)n.push(Ae(e,t.declarations[r]));return n.join("\n")+" \n lastStatement= lc.voidOperation; \n"}function Ae(e,t){const n=null===t.init?"null":ue(e,t.init),r=ae(e,t.id);switch(Oe(r),r.scope){case"local":return`lscope['${r.var}']=${n};`;case"global":return`gscope['${r.var}']=${n};`;default:throw r.scope,new d("NeverReach",t.id)}}function Ee(e,t){return Ne(e,ue(e,t.object),t)}function Ne(e,t,n){return`lang.member(${t}, ${n.computed?ue(e,n.property):`'${n.property.name}'`})`}function Be(e,t,n){for(const r of n)switch(r.type){case"MemberExpression":t=Ne(e,t,r);break;case"CallExpression":t=qe(e,t,r.arguments);break;default:throw new d("Unrecognized",r)}return t}function _e(e,t,n){return`lang.tryMember(${t}, ${n.computed?ue(e,n.property):`'${n.property.name}'`})`}function Ve(e,t){const n=s(t);let r="",o=ue(e,n.root);for(const a of n.sections)r+=`(${e.symbols.safeAccessTempVarId} = ${_e(e,o,a.checked)}) == null ? null : `,o=Be(e,e.symbols.safeAccessTempVarId,a.unchecked);return`(${r}${o})`}function Te(e,t){try{return"lang.unary("+ue(e,t.argument)+",'"+t.operator+"')"}catch(n){throw n}}function Le(e,t){try{const n=[];for(let r=0;r<t.elements.length;r++)"Literal"===t.elements[r].type?n.push(ue(e,t.elements[r])):n.push("lang.aCheck("+ue(e,t.elements[r])+",'ArrayExpression')");return"["+n.join(",")+"]"}catch(n){throw n}}function Re(e,t){try{const n=[];let r=0;for(const o of t.quasis)n.push(o.value?JSON.stringify(o.value.cooked):JSON.stringify("")),!1===o.tail&&(n.push(t.expressions[r]?"lang.castString(lang.aCheck("+ue(e,t.expressions[r])+", 'TemplateLiteral'))":""),r++);return"(["+n.join(",")+"]).join('')"}catch(n){throw n}}function Ue(e,t){try{return"lang.binary("+ue(e,t.left)+","+ue(e,t.right)+",'"+t.operator+"')"}catch(n){throw n}}function De(e,t){try{if("AssignmentExpression"===t.left.type||"UpdateExpression"===t.left.type)throw new d("LogicalExpressionOnlyBoolean",t);if("AssignmentExpression"===t.right.type||"UpdateExpression"===t.right.type)throw new d("LogicalExpressionOnlyBoolean",t);if("&&"===t.operator||"||"===t.operator)return"(lang.logicalCheck("+ue(e,t.left)+") "+t.operator+" lang.logicalCheck("+ue(e,t.right)+"))";throw new d("LogicExpressionOrAnd",null)}catch(n){throw n}}function Ge(e,t){const n=oe(e,t);switch(Oe(n),n.scope){case"local":return rt(`lscope['${n.var}']`);case"global":return rt(`gscope['${n.var}']`);default:throw n.scope,new d("NeverReach",t)}}function ze(e,t){if("Identifier"===t.callee.type){const n=oe(e,t.callee,"FunctionNotFound");if("global"===n.scope)switch(n.name){case"iif":return Pe(e,t);case"when":return Ke(e,t);case"defaultvalue":return We(e,t);case"decode":return Ze(e,t)}}return qe(e,ue(e,t.callee),t.arguments)}function qe(e,t,n){const r=`lang.callfunc(${t}, [${n.map(t=>ue(e,t)).join(", ")}], runtimeCtx)`;return e.isAsync?`(yield ${r})`:r}function Pe(e,t){try{if(3!==t.arguments.length)throw new d("WrongNumberOfParameters",t);const n=e.symbols.nextTempVarId();return`${e.isAsync?"(yield (function() { \n return lang.__awaiter(this, void 0, void 0, function* () {":"function() {"}\n var ${n} = ${ue(e,t.arguments[0])};\n\n if (${n} === true) {\n return ${ue(e,t.arguments[1])};\n }\n else if (${n} === false) {\n return ${ue(e,t.arguments[2])};\n }\n else {\n lang.error('ExecutionErrorCodes.BooleanConditionRequired');\n }\n ${e.isAsync?"})}()))":"}()"}`}catch(n){throw n}}function We(e,t){try{if(t.arguments.length<2||t.arguments.length>3)throw new d("WrongNumberOfParameters",t);const n=e.symbols.nextTempVarId(),r=e.symbols.nextTempVarId();return 3===t.arguments.length?`${e.isAsync?"(yield (function() { \n return lang.__awaiter(this, void 0, void 0, function* () {":"function() {"}\n var ${n} = ${ue(e,t.arguments[0])};\n var ${r} = ${ue(e,t.arguments[1])};\n ${n} = lang.getNestedOptionalValue(${n}, ${r});\n return ${n} != null && ${n} !== "" ? ${n} : ${ue(e,t.arguments[2])};\n ${e.isAsync?"})}()))":"}()"}`:`${e.isAsync?"(yield (function() { \n return lang.__awaiter(this, void 0, void 0, function* () {":"function() {"}\n var ${n} = ${ue(e,t.arguments[0])};\n if (${n} === null) {\n return ${ue(e,t.arguments[1])};\n }\n if (${n} === "") {\n return ${ue(e,t.arguments[1])};\n }\n if (${n} === undefined) {\n return ${ue(e,t.arguments[1])};\n }\n return ${n};\n ${e.isAsync?"})}()))":"}()"}`}catch(n){throw n}}function Ke(e,t){try{if(t.arguments.length<3)throw new d("WrongNumberOfParameters",t);if(t.arguments.length%2==0)throw new d("WrongNumberOfParameters",t);const n=e.symbols.nextTempVarId();let r="var ";for(let o=0;o<t.arguments.length-1;o+=2)r+=`${n} = lang.mustBoolean(${ue(e,t.arguments[o])});\n if (${n} === true ) {\n return ${ue(e,t.arguments[o+1])}\n }\n`;return`${e.isAsync?"(yield (function() { \n return lang.__awaiter(this, void 0, void 0, function* () {":"function() {"}\n ${r}\n return ${ue(e,t.arguments[t.arguments.length-1])}\n ${e.isAsync?"})}()))":"}()"}`}catch(n){throw n}}function Ze(e,t){try{if(t.arguments.length<2)throw new d("WrongNumberOfParameters",t);if(2===t.arguments.length)return`(${ue(e,t.arguments[1])})`;if((t.arguments.length-1)%2==0)throw new d("WrongNumberOfParameters",t);const n=e.symbols.nextTempVarId();let r;if(t.arguments.every((e,t)=>t%2==0||"Literal"===e.type)){r=`switch (${n}) {`;for(let n=1;n<t.arguments.length-1;n+=2){const o=t.arguments[n],a=t.arguments[n+1];null==o.value?r+="\n case null:\n case lc.voidOperation:\n ":r+=`\n case ${JSON.stringify(o.value)}:\n `,r+=`return ${ue(e,a)}`}r+="}"}else{const o=e.symbols.nextTempVarId();r="var ";for(let a=1;a<t.arguments.length-1;a+=2){const s=t.arguments[a],l=t.arguments[a+1];r+=`${o} = ${ue(e,s)};\n if (lang.binary(${o}, ${n}, "==") === true ) {\n return ${ue(e,l)}\n }\n `}}return`${e.isAsync?"(yield (function() { \n return lang.__awaiter(this, void 0, void 0, function* () {":"function() {"}\n var ${n} = ${ue(e,t.arguments[0])};\n ${r}\n return ${ue(e,t.arguments[t.arguments.length-1])}\n ${e.isAsync?"})}()))":"}()"}`}catch(n){throw n}}function Je(e,t){try{return ie(e,t,(e,t)=>{throw new f("Unrecognized",t)})}catch(n){throw n}}function Ye(e){const t=function(){this.textformatting=p.textFormatting()};t.prototype=Object.create(null),t.provided=new Set(["textformatting","infinity","nan","pi"]),t.prototype.infinity=Number.POSITIVE_INFINITY,t.prototype.nan=Number.NaN,t.prototype.pi=Math.PI;for(const[n,r]of Object.entries(e))t.prototype[n]=new y(r),t.provided.add(n);return t}function He(){const e=Object.create(null);L(e,ie),q(e,ie),R(e,ie,se),G(e,ie),U(e,ie),z(e,ie),P(e,ie),e.iif=Je,e.decode=Je,e.when=Je,e.defaultvalue=Je;const t=Ye(e);D(e,ie);return{ScopeSync:Ye(e),ScopeAsync:t}}const{ScopeSync:Qe,ScopeAsync:Xe}=He();function et(e,t){const n={mode:t,compiled:!0,functions:Object.create(null),signatures:[],standardFunction:ie,standardFunctionAsync:ie,evaluateIdentifier:se};for(const r of e)r.registerFunctions(n);if("sync"===t)for(const[r,o]of Object.entries(n.functions))Qe.prototype[r]=new y(o),Qe.provided.add(r);else for(const[r,o]of Object.entries(n.functions))Xe.prototype[r]=new y(o),Xe.provided.add(r);for(const r of n.signatures)_(r,t)}et([T],"sync"),et([T],"async"),et([V],"async");const tt=Symbol("uninitialized"),nt="lang.uninitialized";function rt(e){return`lang.requireInitialized(${e})`}const ot={uninitialized:tt,requireInitialized(e){if(e===tt)throw new f("InvalidIdentifier",null);return e},isNumber:e=>Q(e),isArray:e=>H(e),isImmutableArray:e=>F(e),isDictionaryLike:e=>B(e),isString:e=>X(e),isDictionary:e=>N(e),isGeometry:e=>E(e),getGeometryKeys:e=>m(e),getGeometryMember:(e,t)=>u(e,t,null),error(e){throw new f(e,null)},__awaiter(e,t,n,r){const o=r.apply(e,t||[]);let a=o.next();for(;!a.done&&!K(a.value);)a=o.next(a.value);return a.done?a.value:new Promise((e,t)=>{function n(r){for(;!r.done;){if(K(r.value))return void Promise.resolve(r.value).then(e=>{try{n(o.next(e))}catch(r){t(r)}},e=>{try{n(o.throw(e))}catch(r){t(r)}});try{r=o.next(r.value)}catch(a){return void t(a)}}e(r.value)}n(a)})},functionDepthchecker:(e,t)=>function(){if(t.depthCounter.depth++,t.localStack.push({}),t.depthCounter.depth>64)throw new f("MaximumCallDepth",null);const n=e.apply(this,arguments);return K(n)?n.then(e=>(t.depthCounter.depth--,t.localStack.length=t.localStack.length-1,e)):(t.depthCounter.depth--,t.localStack.length=t.localStack.length-1,n)},mustBoolean(e){if(!0===e||!1===e)return e;throw new f("BooleanConditionRequired",null)},castString:e=>M(e),aCheck(e,t){if(x(e)){if("ArrayExpression"===t)throw new f("NoFunctionInArray",null);if("ObjectExpression"===t)throw new f("NoFunctionInDictionary",null);throw new f("NoFunctionInTemplateLiteral",null)}return e===O?null:e},Dictionary:p,Feature:h,UserDefinedCompiledFunction:le,dictionary(e){const t=Object.create(null),n=new Map;for(let o=0;o<e.length;o+=2){if(x(e[o+1]))throw new f("NoFunctionInDictionary",null);if(!1===X(e[o]))throw new f("KeyMustBeString",null);let r=e[o].toString();const a=r.toLowerCase();n.has(a)?r=n.get(a):n.set(a,r),e[o+1]===O?t[r]=null:t[r]=e[o+1]}const r=new p(t);return r.immutable=!1,r},entry:(e,t)=>p.containerEntry(e,t),strCheck(e){if(!1===X(e))throw new f("KeyMustBeString",null);return e},unary(e,t){if(ee(e)){if("!"===t)return!e;if("-"===t)return-1*C(e);if("+"===t)return 1*C(e);if("~"===t)return~C(e);throw new f("UnsupportUnaryOperator",null)}if("-"===t)return-1*C(e);if("+"===t)return 1*C(e);if("~"===t)return~C(e);throw new f("UnsupportUnaryOperator",null)},logicalCheck(e){if(!1===ee(e))throw new f("LogicExpressionOrAnd",null);return e},logical(e,t,n){if(ee(e)&&ee(t))switch(n){case"||":return e||t;case"&&":return e&&t;default:throw new f("LogicExpressionOrAnd",null)}throw new f("LogicExpressionOrAnd",null)},binary(e,t,n){switch(n){case"|":case"<<":case">>":case">>>":case"^":case"&":return A(C(e),C(t),n);case"==":return j(e,t);case"!=":return!j(e,t);case"<":case">":case"<=":case">=":return k(e,t,n);case"+":return X(e)||X(t)?M(e)+M(t):C(e)+C(t);case"-":return C(e)-C(t);case"*":return C(e)*C(t);case"/":return C(e)/C(t);case"%":return C(e)%C(t);default:throw new f("UnsupportedOperator",null)}},assign(e,t,n){switch(t){case"=":return e===O?null:e;case"/=":return C(n)/C(e);case"*=":return C(n)*C(e);case"-=":return C(n)-C(e);case"+=":return X(n)||X(e)?M(n)+M(e):C(n)+C(e);case"%=":return C(n)%C(e);default:throw new f("UnsupportedOperator",null)}},update(e,t,n,r){const o=C(this.requireInitialized(e[t]));return e[t]="++"===n?o+1:o-1,!1===r?o:"++"===n?o+1:o-1},createFeature:(e,t,n)=>h.createFromGraphicLikeObject(e.geometry,e.attributes,t,n.timeZone),memberupdate(e,t,n,r){let o;if(H(e)){if(!Q(t))throw new f("ArrayAccessMustBeNumber",null);if(t<0&&(t=e.length+t),t<0||t>=e.length)throw new f("OutOfBounds",null);o=C(e[t]),e[t]="++"===n?o+1:o-1}else if(e instanceof p){if(!1===X(t))throw new f("KeyAccessorMustBeString",null);if(!0!==e.hasField(t))throw new f("FieldNotFound",null,{key:t});o=C(e.field(t)),e.setField(t,"++"===n?o+1:o-1)}else if(I(e)){if(!1===X(t))throw new f("KeyAccessorMustBeString",null);if(!0!==e.hasField(t))throw new f("FieldNotFound",null,{key:t});o=C(e.field(t)),e.setField(t,"++"===n?o+1:o-1)}else{if(F(e))throw new f("Immutable",null);if(!(e instanceof it))throw new f("InvalidIdentifier",null);if(!1===X(t))throw new f("ModuleAccessorMustBeString",null);if(!0!==e.hasGlobal(t))throw new f("ModuleExportNotFound",null);o=C(e.global(t)),e.setGlobal(t,"++"===n?o+1:o-1)}return!1===r?o:"++"===n?o+1:o-1},assignmember(e,t,n,r){if(H(e)){if(!Q(t))throw new f("ArrayAccessMustBeNumber",null);if(t<0&&(t=e.length+t),t<0||t>e.length)throw new f("OutOfBounds",null);if(t===e.length){if("="!==n)throw new f("OutOfBounds",null);e[t]=this.assign(r,n,e[t])}else e[t]=this.assign(r,n,e[t])}else if(e instanceof p){if(!1===X(t))throw new f("KeyAccessorMustBeString",null);if(!0===e.hasField(t))e.setField(t,this.assign(r,n,e.field(t)));else{if("="!==n)throw new f("FieldNotFound",null,{key:t});e.setField(t,this.assign(r,n,null))}}else if(I(e)){if(!1===X(t))throw new f("KeyAccessorMustBeString",null);if(!0===e.hasField(t))e.setField(t,this.assign(r,n,e.field(t)));else{if("="!==n)throw new f("FieldNotFound",null,{key:t});e.setField(t,this.assign(r,n,null))}}else{if(F(e))throw new f("Immutable",null);if(!(e instanceof it))throw new f("InvalidIdentifier",null);if(!1===X(t))throw new f("ModuleAccessorMustBeString",null);if(!e.hasGlobal(t))throw new f("ModuleExportNotFound",null);e.setGlobal(t,this.assign(r,n,e.global(t)))}},member:(e,t)=>c(e,t),tryMember:(e,t)=>i(e,t),callfunc(e,t,n){if(x(e))return e.call(n,{arguments:t,preparsed:!0});throw new f("CallNonFunction",null)},loadModule(e,t){const n=t.moduleFactoryMap[e];if(t.moduleSingletons[n])return t.moduleSingletons[n];const r=t.moduleFactory[n]({moduleSingletons:t.moduleSingletons,depthCounter:t.depthCounter,lrucache:t.lrucache,interceptor:t.interceptor,services:t.services,console:t.console,abortSignal:t.abortSignal,timeZone:t.timeZone??null,spatialReference:t.spatialReference});return t.moduleSingletons[n]=r,r},getNestedOptionalValue:(e,t)=>l(e,t)};function at(e){console.log(e)}function st(n,o,a=!1){let s=null;n.usesModules&&(s=new r(null,n.loadedModules));const l=Object.create(null),i=new Set(Object.keys(o?.vars||{}).map(t=>e(t))),c=new Set(Object.keys(o?.customfunctions||{}).map(t=>e(t))),u=ce(n,a?Xe.provided:Qe.provided,new Set([...i,...c]),a,s,l);let m;m=a?["var runtimeCtx = this.prepare(context, true);","var lc = this.lc;","var lang = this.lang;","var gscope = runtimeCtx.globalScope;","return lang.__awaiter(this, void 0, void 0, function* () {"," function mainBody() {"," return lang.__awaiter(this, void 0, void 0, function* () {",` ${u.body}`," });"," }"," return this.postProcess(yield mainBody());","});"].join("\n"):["var runtimeCtx = this.prepare(context, false);","var lc = this.lc;","var lang = this.lang;","var gscope = runtimeCtx.globalScope;","function mainBody() {",` ${u.body}`,"}","return this.postProcess(mainBody());"].join("\n");const{symbolMetadata:p,moduleFactoryMap:d}=u,g={lc:v,lang:ot,postProcess(e){if(S(e))return null;if(x(e))throw new f("IllegalResult",null);return e},prepare(e,n){const r=e.spatialReference??J.WebMercator,o=n?new Xe:new Qe;for(const t of c)null!=e.customfunctions&&t in e.customfunctions?o[t]=e.customfunctions[t]??null:o[t]=tt;for(const t of i){if(null==e.vars||!(t in e.vars)){t in o||(o[t]=tt);continue}const n=e.vars[t]??null;Y(n)?o[t]=h.createFromGraphic(n,e.timeZone??null):o[t]=n}return{lrucache:e.lrucache,interceptor:e.interceptor,services:e.services,console:e.console??at,abortSignal:e.abortSignal??t,timeZone:e.timeZone??null,spatialReference:r,track:e.track,globalScope:o,localStack:[],depthCounter:{depth:1},symbolMetadata:p,moduleFactory:l,moduleFactoryMap:d,moduleSingletons:Object.create(null)}}};return new Function("context",m).bind(g)}async function lt(){return et([await(import("./functions/geomasync.js"))],"async"),!0}class it extends n{constructor(e){super(),this.moduleContext=e}hasGlobal(t){const n=this.moduleContext.symbolMetadata.exports;return n.has(t)||n.has(e(t))}setGlobal(t,n){if(x(n))throw new f("AssignModuleFunction",null);const r=this.moduleContext.symbolMetadata.globals.get(e(t));if(null==r)throw new f("ModuleExportNotFound",null);this.moduleContext.globalScope[r]=n}global(t){const n=this.moduleContext.symbolMetadata.globals.get(e(t));if(null==n)throw new f("ModuleExportNotFound",null);const r=this.moduleContext.globalScope,o=ot.requireInitialized(r[n]);if(x(o)&&!(o instanceof b)){const e=new b;return e.fn=o,e.parameterEvaluator=ie,e.context=this.moduleContext,r[n]=e,e}return o}}function ct(e,n,o){const a=new r(null,e.loadedModules),s=ce(e,o?Xe.provided:Qe.provided,new Set,o,a,n);let l;l=o?["var runtimeCtx = this.prepare(context, true);","var lc = this.lc;","var lang = this.lang;","var gscope = runtimeCtx.globalScope;","return lang.__awaiter(this, void 0, void 0, function* () {"," function mainBody() {"," return lang.__awaiter(this, void 0, void 0, function* () {",` ${s.body}`," });"," }"," yield mainBody();"," return this.prepareModule(runtimeCtx);","});"].join("\n"):["var runtimeCtx = this.prepare(context, false);","var lc = this.lc;","var lang = this.lang;","var gscope = runtimeCtx.globalScope;","function mainBody() {",` ${s.body}`,"}","mainBody();","return this.prepareModule(runtimeCtx);"].join("\n");const{symbolMetadata:i,moduleFactoryMap:c}=s,u={lc:v,lang:ot,prepareModule:e=>new it(e),prepare(e,r){const o=e.spatialReference??J.WebMercator,a=r?new Xe:new Qe;return{lrucache:e.lrucache,interceptor:e.interceptor,services:e.services,console:e.console??at,abortSignal:e.abortSignal??t,timeZone:e.timeZone??null,spatialReference:o,track:null,globalScope:a,localStack:[],depthCounter:e.depthCounter,symbolMetadata:i,moduleFactory:n,moduleFactoryMap:c,moduleSingletons:e.moduleSingletons}}};return new Function("context",l).bind(u)}export{le as UserDefinedCompiledFunction,st as compileScript,lt as enableAsyncSupport,et as extend};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import n from"../ArcadePortal.js";import{convertJsonValueToImmutableArcadeValue as t}from"../containerUtils.js";import e from"../Dictionary.js";import{ArcadeExecutionError as r}from"../executionError.js";import{cloneGeometry as a}from"../kernel.js";import{H as i,E as o,e as s,r as u,q as c,w as l,g as f,J as d,k as w,K as m,f as y,L as h,M as p,v as g,N,O as S}from"../../chunks/languageUtils.js";import{getPortal as O}from"../portalUtils.js";import{commonRelationsCheck as J,toCurveType as P,planarLength3D as v,toOffsetJoinType as I,toCentroidAlgorithm as A,measureToCoordinateFunc as F,pointToCoordinateFunc as R,distanceToCoordinateFunc as j}from"../geometry/functions.js";import{invokeRemoteGeometryOp as b}from"../geometry/operatorsWorkerConnection.js";import{equals as x}from"../../core/arrayUtils.js";import L from"../../geometry/Extent.js";import U from"../../geometry/Geometry.js";import C from"../../geometry/Multipoint.js";import M from"../../geometry/Point.js";import _ from"../../geometry/Polygon.js";import k from"../../geometry/Polyline.js";import{fromJSON as E}from"../../geometry/support/jsonUtils.js";import{lookupUser as Z}from"../../portal/support/utils.js";import{isArray as q}from"../../support/guards.js";function D(n){if(null==n)return n;switch(typeof n){case"string":case"number":return n;default:throw new r("InvalidParameter",null)}}function z(z){"async"===z.mode&&(z.functions.disjoint=function(n,t){return z.standardFunctionAsync(n,t,(n,e,r)=>(r=i(r),J(r,t),null===r[0]||null===r[1]||b("disjoint",[r[0].toJSON(),r[1].toJSON()])))},z.functions.intersects=function(n,t){return z.standardFunctionAsync(n,t,(n,e,r)=>(r=i(r),J(r,t),null!==r[0]&&null!==r[1]&&b("intersects",[r[0].toJSON(),r[1].toJSON()])))},z.functions.touches=function(n,t){return z.standardFunctionAsync(n,t,(n,e,r)=>(r=i(r),J(r,t),null!==r[0]&&null!==r[1]&&b("touches",[r[0].toJSON(),r[1].toJSON()])))},z.functions.crosses=function(n,t){return z.standardFunctionAsync(n,t,(n,e,r)=>(r=i(r),J(r,t),null!==r[0]&&null!==r[1]&&b("crosses",[r[0].toJSON(),r[1].toJSON()])))},z.functions.within=function(n,t){return z.standardFunctionAsync(n,t,(n,e,r)=>(r=i(r),J(r,t),null!==r[0]&&null!==r[1]&&b("within",[r[0].toJSON(),r[1].toJSON()])))},z.functions.contains=function(n,t){return z.standardFunctionAsync(n,t,(n,e,r)=>(r=i(r),J(r,t),null!==r[0]&&null!==r[1]&&b("contains",[r[0].toJSON(),r[1].toJSON()])))},z.functions.overlaps=function(n,t){return z.standardFunctionAsync(n,t,(n,e,r)=>(r=i(r),J(r,t),null!==r[0]&&null!==r[1]&&b("overlaps",[r[0].toJSON(),r[1].toJSON()])))},z.functions.equals=function(n,t){return z.standardFunctionAsync(n,t,(n,e,r)=>(o(r,2,2,t),r[0]===r[1]||(r[0]instanceof U&&r[1]instanceof U?b("equals",[r[0].toJSON(),r[1].toJSON()]):(s(r[0])&&s(r[1])||!!(u(r[0])&&u(r[1])||c(r[0])&&c(r[1])))&&r[0].equals(r[1]))))},z.functions.relate=function(n,t){return z.standardFunctionAsync(n,t,(n,e,a)=>{if(a=i(a),o(a,3,3,t),a[0]instanceof U&&a[1]instanceof U)return b("relate",[a[0].toJSON(),a[1].toJSON(),l(a[2])]);if(a[0]instanceof U&&null===a[1])return!1;if(a[1]instanceof U&&null===a[0])return!1;if(null===a[0]&&null===a[1])return!1;throw new r("InvalidParameter",t)})},z.functions.intersection=function(n,t){return z.standardFunctionAsync(n,t,async(n,e,r)=>(r=i(r),J(r,t),null===r[0]||null===r[1]?null:E(await b("intersection",[r[0].toJSON(),r[1].toJSON()]))))},z.functions.union=function(n,t){return z.standardFunctionAsync(n,t,async(e,o,s)=>{if(0===(s=i(s)).length)throw new r("WrongNumberOfParameters",t);const u=[];if(1===s.length)if(q(s[0])){for(const n of i(s[0]))if(null!==n){if(!(n instanceof U))throw new r("InvalidParameter",t);u.push(n.toJSON())}}else{if(!f(s[0])){if(s[0]instanceof U)return d(a(s[0]),n.spatialReference);if(null===s[0])return null;throw new r("InvalidParameter",t)}for(const n of i(s[0].toArray()))if(null!==n){if(!(n instanceof U))throw new r("InvalidParameter",t);u.push(n.toJSON())}}else for(const n of s)if(null!==n){if(!(n instanceof U))throw new r("InvalidParameter",t);u.push(n.toJSON())}return 0===u.length?null:E(await b("union",[u]))})},z.functions.difference=function(n,t){return z.standardFunctionAsync(n,t,async(n,e,r)=>(r=i(r),J(r,t),null===r[0]?null:null===r[1]?a(r[0]):E(await b("difference",[r[0].toJSON(),r[1].toJSON()]))))},z.functions.symmetricdifference=function(n,t){return z.standardFunctionAsync(n,t,async(n,e,r)=>(r=i(r),J(r,t),null===r[0]&&null===r[1]?null:null===r[0]?a(r[1]):null===r[1]?a(r[0]):E(await b("symmetricDifference",[r[0].toJSON(),r[1].toJSON()]))))},z.functions.clip=function(n,t){return z.standardFunctionAsync(n,t,async(n,e,a)=>{if(a=i(a),o(a,2,2,t),!(a[1]instanceof L)&&null!==a[1])throw new r("InvalidParameter",t);if(null===a[0])return null;if(!(a[0]instanceof U))throw new r("InvalidParameter",t);return null===a[1]?null:E(await b("clip",[a[0].toJSON(),a[1].toJSON()]))})},z.functions.cut=function(n,t){return z.standardFunctionAsync(n,t,async(n,e,s)=>{if(s=i(s),o(s,2,2,t),!(s[1]instanceof k)&&null!==s[1])throw new r("InvalidParameter",t);if(null===s[0])return[];if(!(s[0]instanceof U))throw new r("InvalidParameter",t);return null===s[1]?[a(s[0])]:(await b("cut",[s[0].toJSON(),s[1].toJSON()])).map(n=>E(n))})},z.functions.area=function(n,t){return z.standardFunctionAsync(n,t,async(e,a,s)=>{if(o(s,1,2,t),s=i(s),w(s[0])){const e=await s[0].sumArea(D(s[1]),null,n.abortSignal);if(n.abortSignal.aborted)throw new r("Cancelled",t);return e}let u=s[0];if((q(u)||f(u))&&(u=m(s[0],n.spatialReference)),null===u)return 0;if(!(u instanceof U))throw new r("InvalidParameter",t);return b("area",[u.toJSON(),D(s[1])])})},z.functions.areageodetic=function(n,t){return z.standardFunctionAsync(n,t,async(e,a,s)=>{o(s,1,3,t);let u=(s=i(s))[0];(q(u)||f(u))&&(u=m(u,n.spatialReference));const c=D(s[1]),l=P(s[2]);if(w(u)){const e=await u.sumArea(c,l,n.abortSignal);if(n.abortSignal.aborted)throw new r("Cancelled",t);return e}if(null==u)return 0;if(!y(u))throw new r("InvalidParameter",t);return b("geodeticArea",[u.toJSON(),c,l])})},z.functions.length=function(n,t){return z.standardFunctionAsync(n,t,async(e,a,s)=>{if(o(s,1,2,t),s=i(s),w(s[0])){const e=await s[0].sumLength(D(s[1]),null,n.abortSignal);if(n.abortSignal.aborted)throw new r("Cancelled",t);return e}let u=s[0];if((q(s[0])||f(s[0]))&&(u=h(s[0],n.spatialReference)),null===u)return 0;if(!(u instanceof U))throw new r("InvalidParameter",t);return b("length",[u.toJSON(),D(s[1])])})},z.functions.length3d=function(n,t){return z.standardFunctionAsync(n,t,async(e,a,s)=>{if(o(s,1,2,t),null===(s=i(s))[0])return 0;let u=s[0];if((q(s[0])||f(s[0]))&&(u=h(s[0],n.spatialReference)),null===u)return 0;if(!(u instanceof U))throw new r("InvalidParameter",t);if(!0===u.hasZ){const{convertFromSpatialReferenceUnit:n,toLengthUnit:t}=await import("../geometry/unitConversion.js"),e=v(u);return n(u.spatialReference,t(s[1]),e)}return b("length",[u.toJSON(),D(s[1])])})},z.functions.lengthgeodetic=function(n,t){return z.standardFunctionAsync(n,t,async(e,a,s)=>{o(s,1,3,t);let u=(s=i(s))[0];(q(s[0])||f(s[0]))&&(u=h(s[0],n.spatialReference));const c=D(s[1]),l=P(s[2]);if(w(u)){const e=await u.sumLength(c,l,n.abortSignal);if(n.abortSignal.aborted)throw new r("Cancelled",t);return e}if(null===u)return 0;if(!y(u))throw new r("InvalidParameter",t);return b("geodeticLength",[u.toJSON(),c,l])})},z.functions.distance=function(n,t){return z.standardFunctionAsync(n,t,async(e,a,s)=>{s=i(s),o(s,2,3,t);let u=s[0];if((q(s[0])||f(s[0]))&&(u=p(s[0],n.spatialReference)),!(u instanceof U))throw new r("InvalidParameter",t);let c=s[1];if((q(s[1])||f(s[1]))&&(c=p(s[1],n.spatialReference)),!(c instanceof U))throw new r("InvalidParameter",t);return b("distance",[u.toJSON(),c.toJSON(),D(s[2])])})},z.functions.distancegeodetic=function(n,t){return z.standardFunctionAsync(n,t,async(n,e,a)=>{a=i(a),o(a,2,4,t);const s=a[0];if(!(s instanceof M))throw new r("InvalidParameter",t);const u=a[1];if(!(u instanceof M))throw new r("InvalidParameter",t);const c=new k({paths:[],spatialReference:s.spatialReference});return c.addPath([s,u]),b("geodeticLength",[c.toJSON(),D(a[2]),P(a[3])])})},z.functions.densify=function(n,t){return z.standardFunctionAsync(n,t,async(n,e,a)=>{if(a=i(a),o(a,2,3,t),null===a[0])return null;if(!(a[0]instanceof U))throw new r("InvalidParameter",t);const s=g(a[1]);if(isNaN(s))throw new r("InvalidParameter",t);if(s<=0)throw new r("InvalidParameter",t);switch(a[0].type){case"polygon":case"polyline":case"extent":return E(await b("densify",[a[0].toJSON(),s,D(a[2])]));default:return a[0]}})},z.functions.densifygeodetic=function(n,t){return z.standardFunctionAsync(n,t,async(n,e,a)=>{a=i(a),o(a,2,4,t);const s=a[0];if(null==s)return null;if(!y(s))throw new r("InvalidParameter",t);const u=g(a[1]);if(isNaN(u))throw new r("InvalidParameter",t);if(u<=0)throw new r("InvalidParameter",t);const c=D(a[2]),l=P(a[3]);switch(s.type){case"polygon":case"polyline":case"extent":return E(await b("geodeticDensify",[s.toJSON(),u,c,l]));default:return s}})},z.functions.generalize=function(n,t){return z.standardFunctionAsync(n,t,async(n,e,a)=>{if(a=i(a),o(a,2,4,t),null===a[0])return null;if(!(a[0]instanceof U))throw new r("InvalidParameter",t);const s=g(a[1]);if(isNaN(s))throw new r("InvalidParameter",t);const u=N(S(a[2],!0));return E(await b("generalize",[a[0].toJSON(),s,D(a[3]),{removeDegenerateParts:u}]))})},z.functions.buffer=function(n,t){return z.standardFunctionAsync(n,t,async(n,e,s)=>{if(s=i(s),o(s,2,3,t),null===s[0])return null;if(!(s[0]instanceof U))throw new r("InvalidParameter",t);const u=g(s[1]);if(isNaN(u))throw new r("InvalidParameter",t);return 0===u?a(s[0]):E(await b("buffer",[s[0].toJSON(),u,D(s[2])]))})},z.functions.buffergeodetic=function(n,t){return z.standardFunctionAsync(n,t,async(n,e,s)=>{s=i(s),o(s,2,4,t);const u=s[0];if(null==u)return null;if(!y(u))throw new r("InvalidParameter",t);const c=g(s[1]);if(isNaN(c))throw new r("InvalidParameter",t);if(0===c)return a(u);const l=D(s[2]),f=P(s[3]);return E(await b("geodesicBuffer",[u.toJSON(),c,l,f]))})},z.functions.offset=function(n,t){return z.standardFunctionAsync(n,t,async(n,e,a)=>{a=i(a),o(a,2,6,t);const s=a[0];if(null===s)return null;if(!(s instanceof _||s instanceof k))throw new r("InvalidParameter",t);const u=g(a[1]);if(isNaN(u))throw new r("InvalidParameter",t);const c=a[2],l=I(a[3]),f=g(S(a[4],10));if(isNaN(f))throw new r("InvalidParameter",t);const d=g(S(a[5],0));if(isNaN(d))throw new r("InvalidParameter",t);return E(await b("offset",[s.toJSON(),u,D(c),l,f,d]))})},z.functions.rotate=function(n,t){return z.standardFunctionAsync(n,t,async(n,e,a)=>{if(a=i(a),o(a,2,3,t),null===a[0])return null;if(!(a[0]instanceof U))throw new r("InvalidParameter",t);const s=a[0]instanceof L?_.fromExtent(a[0]):a[0],u=g(a[1]);if(isNaN(u))throw new r("InvalidParameter",t);const c=S(a[2],null);if(null===c){const n="point"===s.type?s:s.extent?.center;return E(await b("rotate",[s.toJSON(),u,n?.x,n?.y]))}if(c instanceof M)return E(await b("rotate",[s.toJSON(),u,c.x,c.y]));throw new r("InvalidParameter",t)})},z.functions.centroid=function(n,t){return z.standardFunctionAsync(n,t,async(e,a,s)=>{if(s=i(s),o(s,1,2,t),null===s[0])return null;const u=A(s[1]);let c=s[0];if((q(s[0])||f(s[0]))&&(c="geometric"===u?p(s[0],n.spatialReference):m(s[0],n.spatialReference),null===c))return null;if(!(c instanceof U))throw new r("InvalidParameter",t);return E("geometric"===u?await b("centroid",[c.toJSON()]):await b("labelPoint",[c.toJSON()]))})},z.functions.measuretocoordinate=function(n,t){return z.standardFunctionAsync(n,t,F)},z.functions.pointtocoordinate=function(n,t){return z.standardFunctionAsync(n,t,R)},z.functions.distancetocoordinate=function(n,t){return z.standardFunctionAsync(n,t,j)},z.functions.multiparttosinglepart=function(n,t){return z.standardFunctionAsync(n,t,async(e,s,u)=>{if(u=i(u),o(u,1,1,t),null===u[0])return null;if(!(u[0]instanceof U))throw new r("InvalidParameter",t);if(u[0]instanceof M)return[d(a(u[0]),n.spatialReference)];if(u[0]instanceof L)return[d(a(u[0]),n.spatialReference)];const c=E(await b("simplify",[u[0].toJSON()]));if(c instanceof _){const n=[],t=[];for(let e=0;e<c.rings.length;e++)if(c.isClockwise(c.rings[e])){const t=E({rings:[c.rings[e]],hasZ:!0===c.hasZ,hasM:!0===c.hasM,spatialReference:c.spatialReference.toJSON()});n.push(t)}else t.push({ring:c.rings[e],pt:c.getPoint(e,0)});for(let e=0;e<t.length;e++)for(let r=0;r<n.length;r++)if(n[r].contains(t[e].pt)){n[r].addRing(t[e].ring);break}return n}if(c instanceof k){const n=[];for(let t=0;t<c.paths.length;t++){const e=E({paths:[c.paths[t]],hasZ:!0===c.hasZ,hasM:!0===c.hasM,spatialReference:c.spatialReference.toJSON()});n.push(e)}return n}if(u[0]instanceof C){const t=[],e=d(a(u[0]),n.spatialReference);for(let n=0;n<e.points.length;n++)t.push(e.getPoint(n));return t}return null})},z.functions.isselfintersecting=function(n,t){return z.standardFunctionAsync(n,t,async(n,t,e)=>{o(e,1,1,t);let r=(e=i(e))[0];if((q(e[0])||f(e[0]))&&(r=h(e[0],n.spatialReference)),r instanceof C){const n=r.points;for(let t=0;t<n.length;t++)for(let e=t+1;e<n.length;e++)if(x(n[t],n[e]))return!0;return!1}return(r instanceof k||r instanceof _)&&await b("isSelfIntersecting",[r.toJSON()])})},z.functions.issimple=function(n,t){return z.standardFunctionAsync(n,t,(n,e,a)=>{if(a=i(a),o(a,1,1,t),null===a[0])return!0;if(!(a[0]instanceof U))throw new r("InvalidParameter",t);return b("isSimple",[a[0].toJSON()])})},z.functions.simplify=function(n,t){return z.standardFunctionAsync(n,t,async(n,e,a)=>{if(a=i(a),o(a,1,1,t),null===a[0])return null;if(!(a[0]instanceof U))throw new r("InvalidParameter",t);return E(await b("simplify",[a[0].toJSON()]))})},z.functions.convexhull=function(n,t){return z.standardFunctionAsync(n,t,async(n,e,a)=>{if(a=i(a),o(a,1,1,t),null===a[0])return null;if(!(a[0]instanceof U))throw new r("InvalidParameter",t);return E(await b("convexHull",[a[0].toJSON()]))})},z.functions.getuser=function(e,a){return z.standardFunctionAsync(e,a,async(i,s,u)=>{o(u,0,2,a);let c=S(u[1],""),f=!0===c;if(c=!0===c||!1===c?"":l(c),0===u.length||u[0]instanceof n){const n=O(e,u.length>0?u[0]:null),r=await Z(n,c,f);return null!=r?t(JSON.parse(JSON.stringify(r))):null}let d=null;if(w(u[0])&&(d=u[0]),d){if(f=!1,c)return null;await d.load();const r=await d.getOwningSystemUrl();if(!r){if(!c){const n=await d.getIdentityUser();return null!=n?t({username:n}):null}return null}const a=O(e,new n(r)),i=await Z(a,c,f);return null!=i?t(JSON.parse(JSON.stringify(i))):null}throw new r("InvalidParameter",a)})},z.functions.nearestcoordinate=function(n,t){return z.standardFunctionAsync(n,t,async(n,a,s)=>{if(s=i(s),o(s,2,2,t),!(s[0]instanceof U||null===s[0]))throw new r("InvalidParameter",t);if(!(s[1]instanceof M||null===s[1]))throw new r("InvalidParameter",t);if(null===s[0]||null===s[1])return null;const u=s[0]instanceof L?_.fromExtent(s[0]):s[0],c=await b("getNearestCoordinate",[u.toJSON(),s[1].toJSON(),{calculateLeftRightSide:!0}]);return null===c?null:e.createMutable({__proto__:null,coordinate:E(c.coordinate),distance:c.distance,sideOfLine:0===c.distance?"straddle":c.isRightSide?"right":"left"})})},z.functions.nearestvertex=function(n,t){return z.standardFunctionAsync(n,t,async(n,a,s)=>{if(s=i(s),o(s,2,2,t),!(s[0]instanceof U||null===s[0]))throw new r("InvalidParameter",t);if(!(s[1]instanceof M||null===s[1]))throw new r("InvalidParameter",t);if(null===s[0]||null===s[1])return null;const u=s[0]instanceof L?_.fromExtent(s[0]):s[0],c=await b("getNearestVertex",[u.toJSON(),s[1].toJSON()]);return null==c?null:e.createMutable({__proto__:null,coordinate:E(c.coordinate),distance:c.distance,sideOfLine:c.sideOfLine})})})}export{z as registerFunctions};
|
|
2
|
+
import n from"../ArcadePortal.js";import{convertJsonValueToImmutableArcadeValue as t}from"../containerUtils.js";import e from"../Dictionary.js";import{ArcadeExecutionError as r}from"../executionError.js";import{cloneGeometry as a}from"../kernel.js";import{H as i,E as o,e as s,r as u,q as c,w as l,g as f,J as d,k as w,K as m,f as y,L as h,M as N,v as S,N as g,O as p}from"../../chunks/languageUtils.js";import{getPortal as O}from"../portalUtils.js";import{commonRelationsCheck as J,toCurveType as v,planarLength3D as P,toOffsetJoinType as I,toCentroidAlgorithm as A,measureToCoordinateFunc as F,pointToCoordinateFunc as j,distanceToCoordinateFunc as b}from"../geometry/functions.js";import{invokeRemoteGeometryOp as R}from"../geometry/operatorsWorkerConnection.js";import{equals as x}from"../../core/arrayUtils.js";import L from"../../geometry/Extent.js";import U from"../../geometry/Geometry.js";import _ from"../../geometry/Multipoint.js";import C from"../../geometry/Point.js";import D from"../../geometry/Polygon.js";import E from"../../geometry/Polyline.js";import{fromJSON as k}from"../../geometry/support/jsonUtils.js";import{lookupUser as q}from"../../portal/support/utils.js";import{isArray as M}from"../../support/guards.js";function z(n){if(null==n)return n;switch(typeof n){case"string":case"number":return n;default:throw new r("InvalidParameter",null)}}function H(H){"async"===H.mode&&(H.functions.disjoint=function(n,t){return H.standardFunctionAsync(n,t,(n,e,r)=>(r=i(r),J(r,t),null===r[0]||null===r[1]||R("disjoint",[r[0].toJSON(),r[1].toJSON()])))},H.functions.intersects=function(n,t){return H.standardFunctionAsync(n,t,(n,e,r)=>(r=i(r),J(r,t),null!==r[0]&&null!==r[1]&&R("intersects",[r[0].toJSON(),r[1].toJSON()])))},H.functions.touches=function(n,t){return H.standardFunctionAsync(n,t,(n,e,r)=>(r=i(r),J(r,t),null!==r[0]&&null!==r[1]&&R("touches",[r[0].toJSON(),r[1].toJSON()])))},H.functions.crosses=function(n,t){return H.standardFunctionAsync(n,t,(n,e,r)=>(r=i(r),J(r,t),null!==r[0]&&null!==r[1]&&R("crosses",[r[0].toJSON(),r[1].toJSON()])))},H.functions.within=function(n,t){return H.standardFunctionAsync(n,t,(n,e,r)=>(r=i(r),J(r,t),null!==r[0]&&null!==r[1]&&R("within",[r[0].toJSON(),r[1].toJSON()])))},H.functions.contains=function(n,t){return H.standardFunctionAsync(n,t,(n,e,r)=>(r=i(r),J(r,t),null!==r[0]&&null!==r[1]&&R("contains",[r[0].toJSON(),r[1].toJSON()])))},H.functions.overlaps=function(n,t){return H.standardFunctionAsync(n,t,(n,e,r)=>(r=i(r),J(r,t),null!==r[0]&&null!==r[1]&&R("overlaps",[r[0].toJSON(),r[1].toJSON()])))},H.functions.equals=function(n,t){return H.standardFunctionAsync(n,t,(n,e,r)=>(o(r,2,2,t),r[0]===r[1]||(r[0]instanceof U&&r[1]instanceof U?R("equals",[r[0].toJSON(),r[1].toJSON()]):(s(r[0])&&s(r[1])||!!(u(r[0])&&u(r[1])||c(r[0])&&c(r[1])))&&r[0].equals(r[1]))))},H.functions.relate=function(n,t){return H.standardFunctionAsync(n,t,(n,e,a)=>{if(a=i(a),o(a,3,3,t),a[0]instanceof U&&a[1]instanceof U)return R("relate",[a[0].toJSON(),a[1].toJSON(),l(a[2])]);if(a[0]instanceof U&&null===a[1])return!1;if(a[1]instanceof U&&null===a[0])return!1;if(null===a[0]&&null===a[1])return!1;throw new r("InvalidParameter",t)})},H.functions.intersection=function(n,t){return H.standardFunctionAsync(n,t,async(n,e,r)=>(r=i(r),J(r,t),null===r[0]||null===r[1]?null:k(await R("intersection",[r[0].toJSON(),r[1].toJSON()]))))},H.functions.union=function(n,t){return H.standardFunctionAsync(n,t,async(e,o,s)=>{if(0===(s=i(s)).length)throw new r("WrongNumberOfParameters",t);const u=[];if(1===s.length)if(M(s[0])){for(const n of i(s[0]))if(null!==n){if(!(n instanceof U))throw new r("InvalidParameter",t);u.push(n.toJSON())}}else{if(!f(s[0])){if(s[0]instanceof U)return d(a(s[0]),n.spatialReference);if(null===s[0])return null;throw new r("InvalidParameter",t)}for(const n of i(s[0].toArray()))if(null!==n){if(!(n instanceof U))throw new r("InvalidParameter",t);u.push(n.toJSON())}}else for(const n of s)if(null!==n){if(!(n instanceof U))throw new r("InvalidParameter",t);u.push(n.toJSON())}return 0===u.length?null:k(await R("union",[u]))})},H.functions.difference=function(n,t){return H.standardFunctionAsync(n,t,async(n,e,r)=>(r=i(r),J(r,t),null===r[0]?null:null===r[1]?a(r[0]):k(await R("difference",[r[0].toJSON(),r[1].toJSON()]))))},H.functions.symmetricdifference=function(n,t){return H.standardFunctionAsync(n,t,async(n,e,r)=>(r=i(r),J(r,t),null===r[0]&&null===r[1]?null:null===r[0]?a(r[1]):null===r[1]?a(r[0]):k(await R("symmetricDifference",[r[0].toJSON(),r[1].toJSON()]))))},H.functions.clip=function(n,t){return H.standardFunctionAsync(n,t,async(n,e,a)=>{if(a=i(a),o(a,2,2,t),!(a[1]instanceof L)&&null!==a[1])throw new r("InvalidParameter",t);if(null===a[0])return null;if(!(a[0]instanceof U))throw new r("InvalidParameter",t);return null===a[1]?null:k(await R("clip",[a[0].toJSON(),a[1].toJSON()]))})},H.functions.cut=function(n,t){return H.standardFunctionAsync(n,t,async(n,e,s)=>{if(s=i(s),o(s,2,2,t),!(s[1]instanceof E)&&null!==s[1])throw new r("InvalidParameter",t);if(null===s[0])return[];if(!(s[0]instanceof U))throw new r("InvalidParameter",t);return null===s[1]?[a(s[0])]:(await R("cut",[s[0].toJSON(),s[1].toJSON()])).map(n=>k(n))})},H.functions.area=function(n,t){return H.standardFunctionAsync(n,t,async(e,a,s)=>{if(o(s,1,2,t),s=i(s),w(s[0])){const e=await s[0].sumArea(z(s[1]),null,n.abortSignal);if(n.abortSignal.aborted)throw new r("Cancelled",t);return e}let u=s[0];if((M(u)||f(u))&&(u=m(s[0],n.spatialReference)),null===u)return 0;if(!(u instanceof U))throw new r("InvalidParameter",t);return R("area",[u.toJSON(),z(s[1])])})},H.functions.areageodetic=function(n,t){return H.standardFunctionAsync(n,t,async(e,a,s)=>{o(s,1,3,t);let u=(s=i(s))[0];(M(u)||f(u))&&(u=m(u,n.spatialReference));const c=z(s[1]),l=v(s[2]);if(w(u)){const e=await u.sumArea(c,l,n.abortSignal);if(n.abortSignal.aborted)throw new r("Cancelled",t);return e}if(null==u)return 0;if(!y(u))throw new r("InvalidParameter",t);return R("geodeticArea",[u.toJSON(),c,l])})},H.functions.length=function(n,t){return H.standardFunctionAsync(n,t,async(e,a,s)=>{if(o(s,1,2,t),s=i(s),w(s[0])){const e=await s[0].sumLength(z(s[1]),null,n.abortSignal);if(n.abortSignal.aborted)throw new r("Cancelled",t);return e}let u=s[0];if((M(s[0])||f(s[0]))&&(u=h(s[0],n.spatialReference)),null===u)return 0;if(!(u instanceof U))throw new r("InvalidParameter",t);return R("length",[u.toJSON(),z(s[1])])})},H.functions.length3d=function(n,t){return H.standardFunctionAsync(n,t,async(e,a,s)=>{if(o(s,1,2,t),null===(s=i(s))[0])return 0;let u=s[0];if((M(s[0])||f(s[0]))&&(u=h(s[0],n.spatialReference)),null===u)return 0;if(!(u instanceof U))throw new r("InvalidParameter",t);if(!0===u.hasZ){const{convertFromSpatialReferenceUnit:n,toLengthUnit:t}=await(import("../geometry/unitConversion.js")),e=P(u);return n(u.spatialReference,t(s[1]),e)}return R("length",[u.toJSON(),z(s[1])])})},H.functions.lengthgeodetic=function(n,t){return H.standardFunctionAsync(n,t,async(e,a,s)=>{o(s,1,3,t);let u=(s=i(s))[0];(M(s[0])||f(s[0]))&&(u=h(s[0],n.spatialReference));const c=z(s[1]),l=v(s[2]);if(w(u)){const e=await u.sumLength(c,l,n.abortSignal);if(n.abortSignal.aborted)throw new r("Cancelled",t);return e}if(null===u)return 0;if(!y(u))throw new r("InvalidParameter",t);return R("geodeticLength",[u.toJSON(),c,l])})},H.functions.distance=function(n,t){return H.standardFunctionAsync(n,t,async(e,a,s)=>{s=i(s),o(s,2,3,t);let u=s[0];if((M(s[0])||f(s[0]))&&(u=N(s[0],n.spatialReference)),!(u instanceof U))throw new r("InvalidParameter",t);let c=s[1];if((M(s[1])||f(s[1]))&&(c=N(s[1],n.spatialReference)),!(c instanceof U))throw new r("InvalidParameter",t);return R("distance",[u.toJSON(),c.toJSON(),z(s[2])])})},H.functions.distancegeodetic=function(n,t){return H.standardFunctionAsync(n,t,async(n,e,a)=>{a=i(a),o(a,2,4,t);const s=a[0];if(!(s instanceof C))throw new r("InvalidParameter",t);const u=a[1];if(!(u instanceof C))throw new r("InvalidParameter",t);return R("geodeticDistance",[s.toJSON(),u.toJSON(),z(a[2]),v(a[3])])})},H.functions.densify=function(n,t){return H.standardFunctionAsync(n,t,async(n,e,a)=>{if(a=i(a),o(a,2,3,t),null===a[0])return null;if(!(a[0]instanceof U))throw new r("InvalidParameter",t);const s=S(a[1]);if(isNaN(s))throw new r("InvalidParameter",t);if(s<=0)throw new r("InvalidParameter",t);switch(a[0].type){case"polygon":case"polyline":case"extent":return k(await R("densify",[a[0].toJSON(),s,z(a[2])]));default:return a[0]}})},H.functions.densifygeodetic=function(n,t){return H.standardFunctionAsync(n,t,async(n,e,a)=>{a=i(a),o(a,2,4,t);const s=a[0];if(null==s)return null;if(!y(s))throw new r("InvalidParameter",t);const u=S(a[1]);if(isNaN(u))throw new r("InvalidParameter",t);if(u<=0)throw new r("InvalidParameter",t);const c=z(a[2]),l=v(a[3]);switch(s.type){case"polygon":case"polyline":case"extent":return k(await R("geodeticDensify",[s.toJSON(),u,c,l]));default:return s}})},H.functions.generalize=function(n,t){return H.standardFunctionAsync(n,t,async(n,e,a)=>{if(a=i(a),o(a,2,4,t),null===a[0])return null;if(!(a[0]instanceof U))throw new r("InvalidParameter",t);const s=S(a[1]);if(isNaN(s))throw new r("InvalidParameter",t);const u=g(p(a[2],!0));return k(await R("generalize",[a[0].toJSON(),s,z(a[3]),{removeDegenerateParts:u}]))})},H.functions.buffer=function(n,t){return H.standardFunctionAsync(n,t,async(n,e,s)=>{if(s=i(s),o(s,2,3,t),null===s[0])return null;if(!(s[0]instanceof U))throw new r("InvalidParameter",t);const u=S(s[1]);if(isNaN(u))throw new r("InvalidParameter",t);return 0===u?a(s[0]):k(await R("buffer",[s[0].toJSON(),u,z(s[2])]))})},H.functions.buffergeodetic=function(n,t){return H.standardFunctionAsync(n,t,async(n,e,s)=>{s=i(s),o(s,2,4,t);const u=s[0];if(null==u)return null;if(!y(u))throw new r("InvalidParameter",t);const c=S(s[1]);if(isNaN(c))throw new r("InvalidParameter",t);if(0===c)return a(u);const l=z(s[2]),f=v(s[3]);return k(await R("geodesicBuffer",[u.toJSON(),c,l,f]))})},H.functions.offset=function(n,t){return H.standardFunctionAsync(n,t,async(n,e,a)=>{a=i(a),o(a,2,6,t);const s=a[0];if(null===s)return null;if(!(s instanceof D||s instanceof E))throw new r("InvalidParameter",t);const u=S(a[1]);if(isNaN(u))throw new r("InvalidParameter",t);const c=a[2],l=I(a[3]),f=S(p(a[4],10));if(isNaN(f))throw new r("InvalidParameter",t);const d=S(p(a[5],0));if(isNaN(d))throw new r("InvalidParameter",t);return k(await R("offset",[s.toJSON(),u,z(c),l,f,d]))})},H.functions.rotate=function(n,t){return H.standardFunctionAsync(n,t,async(n,e,a)=>{a=i(a),o(a,2,3,t);const s=a[0];if(null===s)return null;if(!(s instanceof U))throw new r("InvalidParameter",t);const u=S(a[1]);if(!Number.isFinite(u))throw new r("InvalidParameter",t);const c=a[2];if(null!=c&&!(c instanceof C))throw new r("InvalidParameter",t);return k(await R("rotate",[s.toJSON(),u,c?.x,c?.y]))})},H.functions.centroid=function(n,t){return H.standardFunctionAsync(n,t,async(e,a,s)=>{if(s=i(s),o(s,1,2,t),null===s[0])return null;const u=A(s[1]);let c=s[0];if((M(s[0])||f(s[0]))&&(c="geometric"===u?N(s[0],n.spatialReference):m(s[0],n.spatialReference),null===c))return null;if(!(c instanceof U))throw new r("InvalidParameter",t);return k("geometric"===u?await R("centroid",[c.toJSON()]):await R("labelPoint",[c.toJSON()]))})},H.functions.measuretocoordinate=function(n,t){return H.standardFunctionAsync(n,t,F)},H.functions.pointtocoordinate=function(n,t){return H.standardFunctionAsync(n,t,j)},H.functions.distancetocoordinate=function(n,t){return H.standardFunctionAsync(n,t,b)},H.functions.multiparttosinglepart=function(n,t){return H.standardFunctionAsync(n,t,async(n,e,a)=>{if(a=i(a),o(a,1,1,t),null===a[0])return null;if(!(a[0]instanceof U))throw new r("InvalidParameter",t);return(await R("multiPartToSinglePart",[a[0].toJSON()])).map(n=>k(n))})},H.functions.isselfintersecting=function(n,t){return H.standardFunctionAsync(n,t,async(n,t,e)=>{o(e,1,1,t);let r=(e=i(e))[0];if((M(e[0])||f(e[0]))&&(r=h(e[0],n.spatialReference)),r instanceof _){const n=r.points;for(let t=0;t<n.length;t++)for(let e=t+1;e<n.length;e++)if(x(n[t],n[e]))return!0;return!1}return(r instanceof E||r instanceof D)&&await R("isSelfIntersecting",[r.toJSON()])})},H.functions.issimple=function(n,t){return H.standardFunctionAsync(n,t,(n,e,a)=>{if(a=i(a),o(a,1,1,t),null===a[0])return!0;if(!(a[0]instanceof U))throw new r("InvalidParameter",t);return R("isSimple",[a[0].toJSON()])})},H.functions.simplify=function(n,t){return H.standardFunctionAsync(n,t,async(n,e,a)=>{if(a=i(a),o(a,1,1,t),null===a[0])return null;if(!(a[0]instanceof U))throw new r("InvalidParameter",t);return k(await R("simplify",[a[0].toJSON()]))})},H.functions.convexhull=function(n,t){return H.standardFunctionAsync(n,t,async(n,e,a)=>{if(a=i(a),o(a,1,1,t),null===a[0])return null;if(!(a[0]instanceof U))throw new r("InvalidParameter",t);return k(await R("convexHull",[a[0].toJSON()]))})},H.functions.getuser=function(e,a){return H.standardFunctionAsync(e,a,async(i,s,u)=>{o(u,0,2,a);let c=p(u[1],""),f=!0===c;if(c=!0===c||!1===c?"":l(c),0===u.length||u[0]instanceof n){const n=O(e,u.length>0?u[0]:null),r=await q(n,c,f);return null!=r?t(JSON.parse(JSON.stringify(r))):null}let d=null;if(w(u[0])&&(d=u[0]),d){if(f=!1,c)return null;await d.load();const r=await d.getOwningSystemUrl();if(!r){if(!c){const n=await d.getIdentityUser();return null!=n?t({username:n}):null}return null}const a=O(e,new n(r)),i=await q(a,c,f);return null!=i?t(JSON.parse(JSON.stringify(i))):null}throw new r("InvalidParameter",a)})},H.functions.nearestcoordinate=function(n,t){return H.standardFunctionAsync(n,t,async(n,a,s)=>{if(s=i(s),o(s,2,2,t),!(s[0]instanceof U||null===s[0]))throw new r("InvalidParameter",t);if(!(s[1]instanceof C||null===s[1]))throw new r("InvalidParameter",t);if(null===s[0]||null===s[1])return null;const u=s[0]instanceof L?D.fromExtent(s[0]):s[0],c=await R("getNearestCoordinate",[u.toJSON(),s[1].toJSON(),{calculateLeftRightSide:!0}]);return null===c?null:e.createMutable({__proto__:null,coordinate:k(c.coordinate),distance:c.distance,sideOfLine:0===c.distance?"straddle":c.isRightSide?"right":"left"})})},H.functions.nearestvertex=function(n,t){return H.standardFunctionAsync(n,t,async(n,a,s)=>{if(s=i(s),o(s,2,2,t),!(s[0]instanceof U||null===s[0]))throw new r("InvalidParameter",t);if(!(s[1]instanceof C||null===s[1]))throw new r("InvalidParameter",t);if(null===s[0]||null===s[1])return null;const u=s[0]instanceof L?D.fromExtent(s[0]):s[0],c=await R("getNearestVertex",[u.toJSON(),s[1].toJSON()]);return null==c?null:e.createMutable({__proto__:null,coordinate:k(c.coordinate),distance:c.distance,sideOfLine:c.sideOfLine})})})}export{H as registerFunctions};
|