@arcgis/core 5.2.0-next.95 → 5.2.0-next.96
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/applications/WebEditor/geometryUtils.d.ts +1 -1
- package/arcade/arcadeAsyncRuntime.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/arcadeRuntime.js +1 -1
- package/arcade/containerUtils.js +1 -1
- package/arcade/functions/track.js +1 -1
- package/arcgisGlobal.d.ts +2 -0
- package/assets/components/assets/icon/aiAgent16.json +1 -0
- package/assets/components/assets/icon/aiAgent24.json +1 -0
- package/assets/components/assets/icon/aiAgent32.json +1 -0
- package/assets/components/assets/icon/aiAgents16.json +1 -0
- package/assets/components/assets/icon/aiAgents24.json +1 -0
- package/assets/components/assets/icon/aiAgents32.json +1 -0
- package/assets/components/assets/icon/explodeGeometry16.json +1 -0
- package/assets/components/assets/icon/explodeGeometry24.json +1 -0
- package/assets/components/assets/icon/explodeGeometry32.json +1 -0
- package/assets/components/assets/icon/integration16.json +1 -0
- package/assets/components/assets/icon/integration24.json +1 -0
- package/assets/components/assets/icon/integration32.json +1 -0
- package/assets/components/assets/icon/spatiotemporalCatalog16.json +1 -0
- package/assets/components/assets/icon/spatiotemporalCatalog24.json +1 -0
- package/assets/components/assets/icon/spatiotemporalCatalog32.json +1 -0
- package/assets/components/assets/input-time-zone/t9n/messages.de.json +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/000f91a18c22377f8525.js +1 -0
- package/assets/esri/core/workers/chunks/{05662a663f761dd3dea5.js → 006146ad6d4a5cbf1a1f.js} +1 -1
- package/assets/esri/core/workers/chunks/{bd1a7e95a797e1ed4a7b.js → 013c17e07756fa465845.js} +1 -1
- package/assets/esri/core/workers/chunks/014eaccf2c2d357981f0.js +1 -0
- package/assets/esri/core/workers/chunks/{f253875feb11883deb84.js → 04d4cd66485b622403d0.js} +1 -1
- package/assets/esri/core/workers/chunks/05eb064f9b543890ae24.js +1 -0
- package/assets/esri/core/workers/chunks/05fbd1f373cfa3724f0c.js +1 -0
- package/assets/esri/core/workers/chunks/{26737d061c7cfbbab95c.js → 0809a55a2f9be07cc5a9.js} +1 -1
- package/assets/esri/core/workers/chunks/0930738f43ce09b2ed2d.js +1 -0
- package/assets/esri/core/workers/chunks/{691434d4c6a38e63d819.js → 0a242e76bc293b0ad04b.js} +1 -1
- package/assets/esri/core/workers/chunks/0a4092578dc7578bcf76.js +1 -0
- package/assets/esri/core/workers/chunks/0e11bee9b56a7f51b012.js +1 -0
- package/assets/esri/core/workers/chunks/0e65869a5dd5a3917da7.js +1 -0
- package/assets/esri/core/workers/chunks/0ffb5a1275d07dcd9115.js +1 -0
- package/assets/esri/core/workers/chunks/{e370a3337b3c90240e73.js → 105da965fc90604eb6bf.js} +1 -1
- package/assets/esri/core/workers/chunks/1082bb0858585bd4fa21.js +2 -0
- package/assets/esri/core/workers/chunks/{5235b9c21ac4156c2375.js → 10f4c5533f50c3693318.js} +1 -1
- package/assets/esri/core/workers/chunks/1201bb22a2bfd7d7ecba.js +1 -0
- package/assets/esri/core/workers/chunks/16f55c5d642a23c2547e.js +1 -0
- package/assets/esri/core/workers/chunks/{09e01fd1c199be0c8e03.js → 16ffbe484f6cd4736f79.js} +1 -1
- package/assets/esri/core/workers/chunks/{1bf967c68d0c795d3fb4.js → 19a4907fc93ae8b817e9.js} +1 -1
- package/assets/esri/core/workers/chunks/{f74c7cbe4bd12f73ae90.js → 19d7339f20f3008c4893.js} +1 -1
- package/assets/esri/core/workers/chunks/{a8aa8cb60b30f0983e7e.js → 1a9f17781e0a3bc5106f.js} +1 -1
- package/assets/esri/core/workers/chunks/{bf7875fda48b15271a10.js → 1bef7097fe5e402539ea.js} +1 -1
- package/assets/esri/core/workers/chunks/{fa377112ef3b78f6ed18.js → 1de1cc0ed0f169a58aff.js} +1 -1
- package/assets/esri/core/workers/chunks/{0549e2badf511e27aa54.js → 1e3b07cf0e608431a277.js} +1 -1
- package/assets/esri/core/workers/chunks/{2e51764c8aa31096cb2a.js → 20feca2fdd304b3e9664.js} +1 -1
- package/assets/esri/core/workers/chunks/{4c73c2f4331351e2a50c.js → 22ff018342860249b3eb.js} +1 -1
- package/assets/esri/core/workers/chunks/248df6fda489a9de5852.js +1 -0
- package/assets/esri/core/workers/chunks/279b16727d4b515eca44.js +1 -0
- package/assets/esri/core/workers/chunks/2b10d6597af3eeec5396.js +1 -0
- package/assets/esri/core/workers/chunks/2bd4b536e329112591c4.js +1 -0
- package/assets/esri/core/workers/chunks/2c01477b69c38f691e19.js +1 -0
- package/assets/esri/core/workers/chunks/2e2349387a2b9903f13c.js +2 -0
- package/assets/esri/core/workers/chunks/{4d700cb028f6306b163e.js → 32aa1529e84b839d051d.js} +1 -1
- package/assets/esri/core/workers/chunks/33041e50ea02d99480b0.js +1 -0
- package/assets/esri/core/workers/chunks/{5d7a5aa608ed6192b016.js → 349982635e921e838030.js} +1 -1
- package/assets/esri/core/workers/chunks/35d0a7597473d46866de.js +1 -0
- package/assets/esri/core/workers/chunks/374d726fdd0a9848cea5.js +1 -0
- package/assets/esri/core/workers/chunks/379f5ca5372d834af497.js +1 -0
- package/assets/esri/core/workers/chunks/37ae52c71bf9c70fbb92.js +1 -0
- package/assets/esri/core/workers/chunks/{05393b23ab24126d4236.js → 38bc5d09ae07f486d457.js} +1 -1
- package/assets/esri/core/workers/chunks/3bafa01ca01a67d09432.js +1 -0
- package/assets/esri/core/workers/chunks/3c7901ea007c9615ba54.js +1 -0
- package/assets/esri/core/workers/chunks/4047208f9559e06d7102.js +1 -0
- package/assets/esri/core/workers/chunks/4049e9b86c8e27a7ff12.js +1 -0
- package/assets/esri/core/workers/chunks/411bbdecba340df11d95.js +2 -0
- package/assets/esri/core/workers/chunks/42b5533f94ebcdc4befe.js +1 -0
- package/assets/esri/core/workers/chunks/44ca13c874b5aa0ed5a0.js +1 -0
- package/assets/esri/core/workers/chunks/4717831effb1ac6d5f5d.js +1 -0
- package/assets/esri/core/workers/chunks/{5edf77618ca51819d7c4.js → 476535cfb06ced74d611.js} +2 -2
- package/assets/esri/core/workers/chunks/486f1277fe834c0fc4c1.js +1 -0
- package/assets/esri/core/workers/chunks/48ade66f1685a1aaffba.js +1 -0
- package/assets/esri/core/workers/chunks/4d13c1a04788e5222678.js +1 -0
- package/assets/esri/core/workers/chunks/{cc3186dcbbf5edff8b9e.js → 4d7f6c92041d52cc8732.js} +1 -1
- package/assets/esri/core/workers/chunks/{595edbc1e9bba47d5676.js → 4f89da01b67b66a92c01.js} +1 -1
- package/assets/esri/core/workers/chunks/507bbcde2b39321b50a4.js +1 -0
- package/assets/esri/core/workers/chunks/{9b8e33985310f281f084.js → 56a5b65961e722f5cae9.js} +1 -1
- package/assets/esri/core/workers/chunks/5830deda121e4c95d199.js +1 -0
- package/assets/esri/core/workers/chunks/{b102ae764c14d8b32ace.js → 58a52adc42fbe5cd12c6.js} +1 -1
- package/assets/esri/core/workers/chunks/{b0e25ccb5a1e57a82628.js → 58b93f13316196d2e97d.js} +1 -1
- package/assets/esri/core/workers/chunks/58f98bd89b644cfdafae.js +1 -0
- package/assets/esri/core/workers/chunks/5a8658e4ef5163e8ab3b.js +1 -0
- package/assets/esri/core/workers/chunks/5aa3e1e9c701c7fef6e4.js +1 -0
- package/assets/esri/core/workers/chunks/5bb8d9d887dd4211afd2.js +1 -0
- package/assets/esri/core/workers/chunks/5d7625eb9997cd0dff09.js +1 -0
- package/assets/esri/core/workers/chunks/5e56a004b4407b8066eb.js +1 -0
- package/assets/esri/core/workers/chunks/5efc66be4576c6f67064.js +1 -0
- package/assets/esri/core/workers/chunks/60b1af54e7fc20fd9588.js +1 -0
- package/assets/esri/core/workers/chunks/6134a2c6983792787184.js +1 -0
- package/assets/esri/core/workers/chunks/6319413b89e23f671487.js +1 -0
- package/assets/esri/core/workers/chunks/{1b311ff39dede07865df.js → 633454b27c34f9ec7940.js} +1 -1
- package/assets/esri/core/workers/chunks/63c43ebf46964c283b4d.js +1 -0
- package/assets/esri/core/workers/chunks/65d3638ded62c5606ae3.js +1 -0
- package/assets/esri/core/workers/chunks/{aa0ef4493a7e9bed159f.js → 662f4b39ec44c68e0733.js} +1 -1
- package/assets/esri/core/workers/chunks/680bef5e8237cc3bdd84.js +1 -0
- package/assets/esri/core/workers/chunks/6835f959952f70972fce.js +1 -0
- package/assets/esri/core/workers/chunks/{ddf284648a73b6993737.js → 68d823697c298122ee08.js} +1 -1
- package/assets/esri/core/workers/chunks/6aaefd61505027267c9b.js +1 -0
- package/assets/esri/core/workers/chunks/6ceb17eada151230abf7.js +1 -0
- package/assets/esri/core/workers/chunks/6df29716f75696434807.js +1 -0
- package/assets/esri/core/workers/chunks/6e804bd6bb4b0ee44fa9.js +1 -0
- package/assets/esri/core/workers/chunks/{ee77999df3785468b2b6.js → 6f6e8b7e6e2c856e4ed1.js} +1 -1
- package/assets/esri/core/workers/chunks/{8ea28a4b1afe8bb2d313.js → 7091bbdc36f1f03f14b3.js} +1 -1
- package/assets/esri/core/workers/chunks/7608de0d942b4c16b2f6.js +1 -0
- package/assets/esri/core/workers/chunks/{4b6f433022a6822706cb.js → 762817d30474c15142b4.js} +1 -1
- package/assets/esri/core/workers/chunks/762e9a15b2638475a2b4.js +1 -0
- package/assets/esri/core/workers/chunks/79088d5c9c2e6a780929.js +1 -0
- package/assets/esri/core/workers/chunks/{f3d57c5b9dffd12e45b4.js → 7c3a89c12ea32a071ad4.js} +1 -1
- package/assets/esri/core/workers/chunks/7c67596c0792282afdfc.js +1 -0
- package/assets/esri/core/workers/chunks/7cef6e5f39137e74bbc3.js +1 -0
- package/assets/esri/core/workers/chunks/{87e0ceb1a64ab08e679a.js → 7fd54fa2f91cdab44ab3.js} +1 -1
- package/assets/esri/core/workers/chunks/822a5020afbca21df7f7.js +1 -0
- package/assets/esri/core/workers/chunks/8599d2f2eb0fbb4a8bf5.js +1 -0
- package/assets/esri/core/workers/chunks/862f7090ba4a56c07093.js +1 -0
- package/assets/esri/core/workers/chunks/{97c7dfd29ad4c2966cb4.js → 88252899a5291ad29710.js} +1 -1
- package/assets/esri/core/workers/chunks/8837fbcc0d484659b79c.js +1 -0
- package/assets/esri/core/workers/chunks/8dcc7749de3391710864.js +1 -0
- package/assets/esri/core/workers/chunks/900dad076347443b3ad9.js +1 -0
- package/assets/esri/core/workers/chunks/{f8f7b86bbd62106bc3d4.js → 925f83be3c1eb4b5c6af.js} +1 -1
- package/assets/esri/core/workers/chunks/{a4a22149077c7780481c.js → 9378ce457b02717304e6.js} +1 -1
- package/assets/esri/core/workers/chunks/93a7cf23f73b23fc7802.js +1 -0
- package/assets/esri/core/workers/chunks/93c1d1e7c0935242071e.js +1 -0
- package/assets/esri/core/workers/chunks/{fddcb8be714ad18ad0c8.js → 970b33947bf61fccd461.js} +1 -1
- package/assets/esri/core/workers/chunks/97aaff86e06380a68df8.js +1 -0
- package/assets/esri/core/workers/chunks/9bc7df2b8ae0ed443d13.js +1 -0
- package/assets/esri/core/workers/chunks/9cc14a41d4a90f6d626e.js +1 -0
- package/assets/esri/core/workers/chunks/9e514a58b1165e273202.js +1 -0
- package/assets/esri/core/workers/chunks/9fe1db0762ab3326eab4.js +1 -0
- package/assets/esri/core/workers/chunks/{a5bb19d2b7d7db22222b.js → a10188c4d1904965898a.js} +1 -1
- package/assets/esri/core/workers/chunks/a2288d44cba34d947613.js +1 -0
- package/assets/esri/core/workers/chunks/a26916de4c105859621e.js +1 -0
- package/assets/esri/core/workers/chunks/a322afbb48898ce35851.js +1 -0
- package/assets/esri/core/workers/chunks/a34cadd486e7fcc79063.js +1 -0
- package/assets/esri/core/workers/chunks/{cefb70d633c220cbedf9.js → a4dc1a80ed6604d71722.js} +1 -1
- package/assets/esri/core/workers/chunks/{6baae3e856d904fef9b1.js → a8f70cece5ce2b095cdd.js} +1 -1
- package/assets/esri/core/workers/chunks/ab332bd411d6c7d4190c.js +1 -0
- package/assets/esri/core/workers/chunks/{777f2fdf1f4b9f243893.js → ab3a6ce7bc2a27b92469.js} +1 -1
- package/assets/esri/core/workers/chunks/abd2f8fae6b918fbdd6d.js +1 -0
- package/assets/esri/core/workers/chunks/{b13d2da33ec07e9d41ff.js → b0da2b089a89d643df1e.js} +1 -1
- package/assets/esri/core/workers/chunks/{65f4ca7201e7267bfc81.js → b5fcf4165ac72654742d.js} +1 -1
- package/assets/esri/core/workers/chunks/b82b523b6837ed1f28d3.js +2 -0
- package/assets/esri/core/workers/chunks/{527b87fddf33bb5d519e.js → ba77a8892cb23c7a297d.js} +1 -1
- package/assets/esri/core/workers/chunks/bb8089929ded0613d8e7.js +1 -0
- package/assets/esri/core/workers/chunks/bc7ca87d3bfe8a4aec81.js +1 -0
- package/assets/esri/core/workers/chunks/bc9b96a539f28afcb8cb.js +1 -0
- package/assets/esri/core/workers/chunks/{2d07d5a9ec67c39ef10c.js → bd4f29d2681e5596591a.js} +1 -1
- package/assets/esri/core/workers/chunks/bf9eba555aebca2c132b.js +1 -0
- package/assets/esri/core/workers/chunks/{903c7bd079888f65fef1.js → c3fbd81bb5820e48038f.js} +1 -1
- package/assets/esri/core/workers/chunks/c9df18e9ff7367a004b6.js +1 -0
- package/assets/esri/core/workers/chunks/ca8061e0a6d78d646ebf.js +1 -0
- package/assets/esri/core/workers/chunks/cc73ac8404615dc392d2.js +1 -0
- package/assets/esri/core/workers/chunks/{e823c9ccb7bc348d8824.js → ccb26860518dce6d01c0.js} +1 -1
- package/assets/esri/core/workers/chunks/cded34b161fcc790e672.js +1 -0
- package/assets/esri/core/workers/chunks/{1bf5c0a4bc5a960a3fa2.js → d1d4979e9dcabe5e4619.js} +1 -1
- package/assets/esri/core/workers/chunks/d2865c604849ce79183f.js +1 -0
- package/assets/esri/core/workers/chunks/{9b81bd62a2c72f592db1.js → d826f6d32b4c5885276a.js} +1 -1
- package/assets/esri/core/workers/chunks/d92540d3ffc4af980dd8.js +1 -0
- package/assets/esri/core/workers/chunks/dc7853795439ae77ace9.js +1 -0
- package/assets/esri/core/workers/chunks/{1f047dd747e7c1916dc7.js → dd55737fba0a8fe68101.js} +3 -3
- package/assets/esri/core/workers/chunks/dd8d19eb6b8e955c8067.js +1 -0
- package/assets/esri/core/workers/chunks/dda269a088275c823b40.js +1 -0
- package/assets/esri/core/workers/chunks/{7b70d6fdfa7a19ffffb0.js → de95dee8db92cf8f796f.js} +1 -1
- package/assets/esri/core/workers/chunks/e1c8767143f9f9d1f049.js +1 -0
- package/assets/esri/core/workers/chunks/{2cf2f2842c19be84ab4d.js → e6cb31c727f799c1297c.js} +1 -1
- package/assets/esri/core/workers/chunks/e934ef66d130c212c05b.js +1 -0
- package/assets/esri/core/workers/chunks/{7c56446184abcd14678b.js → ea77654c8964cc39b9a6.js} +1 -1
- package/assets/esri/core/workers/chunks/eb167f9f6132a6348d2e.js +1 -0
- package/assets/esri/core/workers/chunks/ed5ac1efd3cba49be756.js +1 -0
- package/assets/esri/core/workers/chunks/ef24fd6c0322e5de9fdf.js +2 -0
- package/assets/esri/core/workers/chunks/f219ba010c480bb75684.js +1 -0
- package/assets/esri/core/workers/chunks/fbf2d90240d36f8b423f.js +1 -0
- package/assets/esri/core/workers/chunks/{4ee99e654dad6f09abee.js → fc042b9936686785c39e.js} +1 -1
- package/assets/esri/core/workers/chunks/fc1658eae7b312502fab.js +1 -0
- package/assets/esri/core/workers/chunks/{af6b9fd77b1792fbb66e.js → fd4d124c5bf810d9e352.js} +1 -1
- package/assets/esri/core/workers/chunks/ffa35ecc681ec1c4739a.js +1 -0
- package/assets/esri/core/workers/chunks/ffca0b2333e760b66d3a.js +1 -0
- package/config.js +1 -1
- package/editing/sharedTemplates/executor/builders/bufferLineToPolygon.js +1 -1
- package/editing/sharedTemplates/executor/builders/bufferPointToPolygon.js +1 -1
- package/editing/sharedTemplates/executor/builders/bufferPolygonToPolygon.js +1 -1
- package/editing/sharedTemplates/executor/builders/pointAtIntersectionVerticesOfLine.js +1 -1
- package/editing/sharedTemplates/executor/builders/support/offsetUtils.js +1 -1
- package/editing/sharedTemplates/executor/support/createPresetServiceEdit.js +1 -1
- package/geometry/Polygon.js +1 -1
- package/geometry/geometryEngine.d.ts +36 -36
- package/geometry/operators/affineTransformOperator.d.ts +30 -1
- package/geometry/operators/affineTransformOperator.js +1 -1
- package/geometry/operators/alphaShapeOperator.d.ts +49 -5
- package/geometry/operators/alphaShapeOperator.js +1 -1
- package/geometry/operators/areaOperator.d.ts +28 -4
- package/geometry/operators/areaOperator.js +1 -1
- package/geometry/operators/autoCompleteOperator.d.ts +25 -2
- package/geometry/operators/autoCompleteOperator.js +1 -1
- package/geometry/operators/boundaryOperator.d.ts +40 -2
- package/geometry/operators/boundaryOperator.js +1 -1
- package/geometry/operators/bufferOperator.d.ts +51 -6
- package/geometry/operators/bufferOperator.js +1 -1
- package/geometry/operators/centroidOperator.d.ts +23 -2
- package/geometry/operators/centroidOperator.js +1 -1
- package/geometry/operators/clipOperator.d.ts +34 -2
- package/geometry/operators/clipOperator.js +1 -1
- package/geometry/operators/containsOperator.d.ts +32 -2
- package/geometry/operators/containsOperator.js +1 -1
- package/geometry/operators/convexHullOperator.d.ts +47 -4
- package/geometry/operators/convexHullOperator.js +1 -1
- package/geometry/operators/crossesOperator.d.ts +35 -2
- package/geometry/operators/crossesOperator.js +1 -1
- package/geometry/operators/cutOperator.d.ts +23 -2
- package/geometry/operators/cutOperator.js +1 -1
- package/geometry/operators/densifyOperator.d.ts +61 -6
- package/geometry/operators/densifyOperator.js +1 -1
- package/geometry/operators/differenceOperator.d.ts +34 -2
- package/geometry/operators/differenceOperator.js +1 -1
- package/geometry/operators/disjointOperator.d.ts +33 -2
- package/geometry/operators/disjointOperator.js +1 -1
- package/geometry/operators/distanceOperator.d.ts +29 -4
- package/geometry/operators/distanceOperator.js +1 -1
- package/geometry/operators/equalsOperator.d.ts +32 -2
- package/geometry/operators/equalsOperator.js +1 -1
- package/geometry/operators/extendOperator.d.ts +29 -3
- package/geometry/operators/extendOperator.js +1 -1
- package/geometry/operators/generalizeOperator.d.ts +46 -5
- package/geometry/operators/generalizeOperator.js +1 -1
- package/geometry/operators/geodesicBufferOperator.d.ts +71 -7
- package/geometry/operators/geodesicBufferOperator.js +1 -1
- package/geometry/operators/geodesicProximityOperator.d.ts +106 -14
- package/geometry/operators/geodesicProximityOperator.js +1 -1
- package/geometry/operators/geodeticAreaOperator.d.ts +51 -5
- package/geometry/operators/geodeticAreaOperator.js +1 -1
- package/geometry/operators/geodeticDensifyOperator.d.ts +65 -6
- package/geometry/operators/geodeticDensifyOperator.js +1 -1
- package/geometry/operators/geodeticDistanceOperator.d.ts +52 -5
- package/geometry/operators/geodeticDistanceOperator.js +1 -1
- package/geometry/operators/geodeticLengthOperator.d.ts +51 -5
- package/geometry/operators/geodeticLengthOperator.js +1 -1
- package/geometry/operators/geodeticUtilsOperator.d.ts +79 -9
- package/geometry/operators/geodeticUtilsOperator.js +1 -1
- package/geometry/operators/graphicBufferOperator.d.ts +47 -4
- package/geometry/operators/graphicBufferOperator.js +1 -1
- package/geometry/operators/integrateOperator.d.ts +24 -2
- package/geometry/operators/integrateOperator.js +1 -1
- package/geometry/operators/intersectionOperator.d.ts +88 -3
- package/geometry/operators/intersectionOperator.js +1 -1
- package/geometry/operators/intersectsOperator.d.ts +32 -2
- package/geometry/operators/intersectsOperator.js +1 -1
- package/geometry/operators/isNearOperator.d.ts +31 -4
- package/geometry/operators/isNearOperator.js +1 -1
- package/geometry/operators/json/bufferOperator.js +1 -1
- package/geometry/operators/json/containsOperator.js +1 -1
- package/geometry/operators/json/convexHullOperator.js +1 -1
- package/geometry/operators/json/crossesOperator.js +1 -1
- package/geometry/operators/json/disjointOperator.js +1 -1
- package/geometry/operators/json/generalizeOperator.js +1 -1
- package/geometry/operators/json/geodesicBufferOperator.js +1 -1
- package/geometry/operators/json/graphicBufferOperator.js +1 -1
- package/geometry/operators/json/intersectionOperator.js +1 -1
- package/geometry/operators/json/intersectsOperator.js +1 -1
- package/geometry/operators/json/lengthOperator.js +1 -1
- package/geometry/operators/json/offsetOperator.js +1 -1
- package/geometry/operators/json/overlapsOperator.js +1 -1
- package/geometry/operators/json/projectOperator.js +1 -1
- package/geometry/operators/json/simplifyOperator.js +1 -1
- package/geometry/operators/json/simplifyOperatorOGC.js +1 -1
- package/geometry/operators/json/touchesOperator.js +1 -1
- package/geometry/operators/json/unionOperator.js +1 -1
- package/geometry/operators/json/withinOperator.js +1 -1
- package/geometry/operators/labelPointOperator.d.ts +32 -2
- package/geometry/operators/labelPointOperator.js +1 -1
- package/geometry/operators/lengthOperator.d.ts +28 -4
- package/geometry/operators/lengthOperator.js +1 -1
- package/geometry/operators/linesToPolygonsOperator.d.ts +23 -2
- package/geometry/operators/linesToPolygonsOperator.js +1 -1
- package/geometry/operators/locateBetweenOperator.d.ts +28 -2
- package/geometry/operators/locateBetweenOperator.js +1 -1
- package/geometry/operators/minimumBoundingCircleOperator.d.ts +38 -4
- package/geometry/operators/minimumBoundingCircleOperator.js +1 -1
- package/geometry/operators/multiPartToSinglePartOperator.d.ts +33 -4
- package/geometry/operators/multiPartToSinglePartOperator.js +1 -1
- package/geometry/operators/offsetOperator.d.ts +50 -5
- package/geometry/operators/offsetOperator.js +1 -1
- package/geometry/operators/overlapsOperator.d.ts +33 -2
- package/geometry/operators/overlapsOperator.js +1 -1
- package/geometry/operators/polygonOverlayOperator.d.ts +31 -5
- package/geometry/operators/polygonOverlayOperator.js +1 -1
- package/geometry/operators/polygonSlicerOperator.d.ts +72 -10
- package/geometry/operators/polygonSlicerOperator.js +1 -1
- package/geometry/operators/projectOperator.d.ts +63 -3
- package/geometry/operators/projectOperator.js +1 -1
- package/geometry/operators/proximityOperator.d.ts +71 -9
- package/geometry/operators/proximityOperator.js +1 -1
- package/geometry/operators/relateOperator.d.ts +41 -2
- package/geometry/operators/relateOperator.js +1 -1
- package/geometry/operators/reshapeOperator.d.ts +28 -2
- package/geometry/operators/reshapeOperator.js +1 -1
- package/geometry/operators/shapePreservingProjectOperator.d.ts +64 -6
- package/geometry/operators/shapePreservingProjectOperator.js +1 -1
- package/geometry/operators/simplifyOGCOperator.d.ts +72 -6
- package/geometry/operators/simplifyOGCOperator.js +1 -1
- package/geometry/operators/simplifyOperator.d.ts +72 -4
- package/geometry/operators/simplifyOperator.js +1 -1
- package/geometry/operators/singlePartToMultiPartOperator.js +1 -1
- package/geometry/operators/support/Transformation.d.ts +17 -11
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/operators/symmetricDifferenceOperator.d.ts +33 -2
- package/geometry/operators/symmetricDifferenceOperator.js +1 -1
- package/geometry/operators/touchesOperator.d.ts +32 -2
- package/geometry/operators/touchesOperator.js +1 -1
- package/geometry/operators/types.d.ts +4 -1
- package/geometry/operators/unionOperator.d.ts +33 -2
- package/geometry/operators/unionOperator.js +1 -1
- package/geometry/operators/withinOperator.d.ts +32 -2
- package/geometry/operators/withinOperator.js +1 -1
- package/geometry/projectionUtils.js +1 -1
- package/geometry/support/geometryUtils.js +1 -1
- package/geometry/support/normalizeUtils.d.ts +5 -3
- package/geometry/support/normalizeUtils.js +1 -1
- package/interfaces.d.ts +202 -202
- package/kernel.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/data/queryUtils.js +1 -1
- package/layers/graphics/data/spatialQuerySupport.js +1 -1
- package/layers/graphics/sources/support/sourceUtils.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/TiledImagery.js +1 -1
- package/layers/orientedImagery/transformations/updateElevationUtils.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/video/videoUtils.js +1 -1
- package/package.json +4 -4
- package/popup/FeatureContentCollection.d.ts +3 -3
- package/popup/FeatureContentCollection.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/tests/setupServiceMocksMesh.js +1 -1
- package/symbols/cim/CIMEffects.js +1 -1
- package/symbols/cim/effects/EffectBuffer.js +1 -1
- package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
- package/symbols/cim/effects/EffectDonut.js +1 -1
- package/symbols/cim/effects/EffectEnclosingPolygon.js +1 -1
- package/symbols/cim/effects/EffectOffset.js +1 -1
- package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementController.js +1 -1
- package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementController.js +1 -1
- package/views/2d/engine/webgl/Overlay.js +1 -1
- package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/support/RouteLayerWaypointVisualization.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementController.js +1 -1
- package/views/3d/layers/ElevationLayerView3D.js +1 -1
- package/views/3d/layers/ElevationLayerView3DModifications.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
- package/views/MapView.d.ts +3 -3
- package/views/VideoView.js +1 -1
- package/views/View2D.d.ts +22 -22
- package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
- package/views/draw/DrawTool.js +1 -1
- package/views/draw/support/createUtils.js +1 -1
- package/views/layers/SceneLayerView.js +1 -1
- package/views/support/GeometryWorker.js +1 -1
- package/views/support/imageReprojection.js +1 -1
- package/views/video/VideoOperationalDataView.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
- package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
- package/widgets/BatchAttributeForm/expressions/expressionUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.js +1 -1
- package/widgets/BatchAttributeForm/templates/FieldElementTemplate.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
- package/widgets/Editor/support/mergeFeaturesUtils.js +1 -1
- package/widgets/Editor/support/splitFeatureUtils.js +1 -1
- package/widgets/ElevationProfile/support/ElevationProfileView.js +1 -1
- package/widgets/ElevationProfile/support/InputRepresentation2D.js +1 -1
- package/widgets/ElevationProfile/support/InputRepresentation3D.js +1 -1
- package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/widgets/OrientedImageryViewer/support/panConstraint.js +1 -1
- package/widgets/OrientedImageryViewer/support/superimposeUtils.js +1 -1
- package/widgets/OrientedImageryViewer/videoViewerUtils.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/UtilityNetworkTrace/support/GeometryHandler.js +1 -1
- package/widgets/support/FilterBuilder/FilterBuilderViewModel.d.ts +104 -0
- package/widgets/support/FilterBuilder/FilterBuilderViewModel.js +1 -1
- package/widgets/support/FilterBuilder.js +1 -1
- package/widgets/support/FilterCondition/FilterConditionViewModel.d.ts +145 -0
- package/widgets/support/FilterCondition/FilterConditionViewModel.js +1 -1
- package/widgets/support/FilterCondition/types.d.ts +20 -0
- package/widgets/support/ItemList.js +1 -1
- package/widgets/support/SelectionList/FeatureItem.d.ts +17 -68
- package/widgets/support/SelectionList/FeatureItem.js +1 -1
- package/widgets/support/SelectionList/GroupLayerItem.d.ts +12 -50
- package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
- package/widgets/support/SelectionList/ItemBase.d.ts +14 -44
- package/widgets/support/SelectionList/ItemBase.js +1 -1
- package/widgets/support/SelectionList/LayerItem.d.ts +10 -56
- package/widgets/support/SelectionList/LayerItem.js +1 -1
- package/widgets/support/SelectionList/types.d.ts +4 -4
- package/widgets/support/Selector2D/selectorUtils.js +1 -1
- package/assets/esri/core/workers/chunks/090ea7a131f8f60203ed.js +0 -1
- package/assets/esri/core/workers/chunks/0b4a7209b99227a842ad.js +0 -1
- package/assets/esri/core/workers/chunks/0be98adfef79fc5036f0.js +0 -1
- package/assets/esri/core/workers/chunks/0d2e2d90a4e4a28e2c0c.js +0 -1
- package/assets/esri/core/workers/chunks/0d7763d39a5a8586a0ae.js +0 -1
- package/assets/esri/core/workers/chunks/0d95f72e1c07ab867d21.js +0 -1
- package/assets/esri/core/workers/chunks/0dbbac7a2378728571a7.js +0 -1
- package/assets/esri/core/workers/chunks/0df9864ecebe6a2b973f.js +0 -1
- package/assets/esri/core/workers/chunks/104d74bc36c28c519396.js +0 -1
- package/assets/esri/core/workers/chunks/1670e9867efde4d7a6d6.js +0 -1
- package/assets/esri/core/workers/chunks/1c803eef9a8fdabc61e3.js +0 -2
- package/assets/esri/core/workers/chunks/1e192ac0533a5c0b5a7a.js +0 -1
- package/assets/esri/core/workers/chunks/1fe077f57a087c0e9119.js +0 -1
- package/assets/esri/core/workers/chunks/20f7b5fe64a217cb3d3d.js +0 -1
- package/assets/esri/core/workers/chunks/212222b64039d436b9a6.js +0 -1
- package/assets/esri/core/workers/chunks/24944b625ed8dcd904f0.js +0 -1
- package/assets/esri/core/workers/chunks/2b6d261fe79fe186fb22.js +0 -1
- package/assets/esri/core/workers/chunks/2bc3e7f394386fa75447.js +0 -1
- package/assets/esri/core/workers/chunks/30af0f7c4cfa541c9efd.js +0 -1
- package/assets/esri/core/workers/chunks/30d816bdeea00f6fa1ca.js +0 -1
- package/assets/esri/core/workers/chunks/35d46c2f658a8e92d913.js +0 -1
- package/assets/esri/core/workers/chunks/36e35a8067b18f59cc05.js +0 -1
- package/assets/esri/core/workers/chunks/3869dca884d7ca6488f5.js +0 -1
- package/assets/esri/core/workers/chunks/3f5234120d3a14186c1c.js +0 -1
- package/assets/esri/core/workers/chunks/45c1c90ac6c14657f3ff.js +0 -1
- package/assets/esri/core/workers/chunks/4a40b894ec89b0a4f9bf.js +0 -1
- package/assets/esri/core/workers/chunks/5165d367328ac7badf47.js +0 -1
- package/assets/esri/core/workers/chunks/5168bd8ab6233dc9c32a.js +0 -1
- package/assets/esri/core/workers/chunks/545bec045167c433af8f.js +0 -1
- package/assets/esri/core/workers/chunks/5782c0362a1799ceef41.js +0 -1
- package/assets/esri/core/workers/chunks/59598023c0aea62a6297.js +0 -1
- package/assets/esri/core/workers/chunks/59f0a2bd40b033ce77e4.js +0 -1
- package/assets/esri/core/workers/chunks/5af16937904c06fb06f6.js +0 -1
- package/assets/esri/core/workers/chunks/5b8591486f33627f5389.js +0 -1
- package/assets/esri/core/workers/chunks/6057a79c68c33ee4a193.js +0 -1
- package/assets/esri/core/workers/chunks/607acd9f615f87e14075.js +0 -1
- package/assets/esri/core/workers/chunks/62ee6c247f783acabb74.js +0 -1
- package/assets/esri/core/workers/chunks/63127e3b22e7eac6003d.js +0 -2
- package/assets/esri/core/workers/chunks/6564f17c4700dc8d9c0e.js +0 -2
- package/assets/esri/core/workers/chunks/678585509706755c0434.js +0 -2
- package/assets/esri/core/workers/chunks/691e9cc541cfaebe1776.js +0 -1
- package/assets/esri/core/workers/chunks/6a2d890640b2cd6c5ccb.js +0 -1
- package/assets/esri/core/workers/chunks/6b84982dfaf084a61b93.js +0 -1
- package/assets/esri/core/workers/chunks/6cbc30b31f0bb39c73ca.js +0 -1
- package/assets/esri/core/workers/chunks/6f01bd01b13662eb3bd7.js +0 -1
- package/assets/esri/core/workers/chunks/74cd9df85c4560bb8e52.js +0 -1
- package/assets/esri/core/workers/chunks/75bddfe2be64379db8fd.js +0 -1
- package/assets/esri/core/workers/chunks/7cf903db44f3647c8fd4.js +0 -1
- package/assets/esri/core/workers/chunks/7ddb5800777fbecee3a8.js +0 -1
- package/assets/esri/core/workers/chunks/7eae9053065d3d38e54e.js +0 -1
- package/assets/esri/core/workers/chunks/80f38ab2b7ae61e6f301.js +0 -1
- package/assets/esri/core/workers/chunks/854f42f16fdb40000aae.js +0 -1
- package/assets/esri/core/workers/chunks/87094044458b0ea5cb0f.js +0 -2
- package/assets/esri/core/workers/chunks/88f03352a4dc6184ea1f.js +0 -1
- package/assets/esri/core/workers/chunks/909ee7d2a0eec773037a.js +0 -1
- package/assets/esri/core/workers/chunks/91ac9328afff8a51bd96.js +0 -1
- package/assets/esri/core/workers/chunks/9246e2468528650bdc7c.js +0 -1
- package/assets/esri/core/workers/chunks/92a6559a6999b26362d7.js +0 -1
- package/assets/esri/core/workers/chunks/94ddfe165ac25aef8229.js +0 -1
- package/assets/esri/core/workers/chunks/9509bef285929c52c244.js +0 -1
- package/assets/esri/core/workers/chunks/99966339b061eb9945b8.js +0 -1
- package/assets/esri/core/workers/chunks/99f627938dbf0152fc02.js +0 -1
- package/assets/esri/core/workers/chunks/9df38cadebf8e6fd746c.js +0 -1
- package/assets/esri/core/workers/chunks/9e2b3754a76e0dd4a94a.js +0 -1
- package/assets/esri/core/workers/chunks/a0565137027c83108953.js +0 -1
- package/assets/esri/core/workers/chunks/a0eb882a5a81d25b9153.js +0 -1
- package/assets/esri/core/workers/chunks/a785e827f0215a73103d.js +0 -1
- package/assets/esri/core/workers/chunks/abe7670db06b27c0c8c8.js +0 -1
- package/assets/esri/core/workers/chunks/b19cff0e43fab2632660.js +0 -1
- package/assets/esri/core/workers/chunks/b333de4dea14c5db0a4d.js +0 -1
- package/assets/esri/core/workers/chunks/b6af90be328ebda26b8d.js +0 -1
- package/assets/esri/core/workers/chunks/b7c0da9d255d5e48320d.js +0 -1
- package/assets/esri/core/workers/chunks/bd7d87d175ba933ab2ce.js +0 -1
- package/assets/esri/core/workers/chunks/be0417df35a7d99af675.js +0 -1
- package/assets/esri/core/workers/chunks/c30b6bbabd05e4976fba.js +0 -1
- package/assets/esri/core/workers/chunks/c35553d07ad169910742.js +0 -1
- package/assets/esri/core/workers/chunks/c5c2fed38e0ccf84f1fa.js +0 -1
- package/assets/esri/core/workers/chunks/c88bfa51d2a8a024fc24.js +0 -1
- package/assets/esri/core/workers/chunks/ca36d85a47179d95f2fc.js +0 -1
- package/assets/esri/core/workers/chunks/d0cf9ff48f051adbd455.js +0 -1
- package/assets/esri/core/workers/chunks/d1304d414b1fa725168a.js +0 -1
- package/assets/esri/core/workers/chunks/d24125a791247019e2ca.js +0 -1
- package/assets/esri/core/workers/chunks/d26be8313526ecea9c68.js +0 -1
- package/assets/esri/core/workers/chunks/d2cb3d5ef0a9285afb78.js +0 -1
- package/assets/esri/core/workers/chunks/d4b0012ae1d3b8a9ba01.js +0 -1
- package/assets/esri/core/workers/chunks/e018cbd97e6e0e4ca5c4.js +0 -1
- package/assets/esri/core/workers/chunks/e39bccc000c768120a32.js +0 -1
- package/assets/esri/core/workers/chunks/e4380706b629729f2212.js +0 -1
- package/assets/esri/core/workers/chunks/ea1877ce00da3b585a30.js +0 -1
- package/assets/esri/core/workers/chunks/ea5ee1b12b43594592a0.js +0 -1
- package/assets/esri/core/workers/chunks/ea91c57a0b31f3f65ee5.js +0 -1
- package/assets/esri/core/workers/chunks/eafc591e1a98000d54ef.js +0 -1
- package/assets/esri/core/workers/chunks/ef851a2cff76fd211c07.js +0 -1
- package/assets/esri/core/workers/chunks/f3e53be08ab9dbdf17ae.js +0 -1
- package/assets/esri/core/workers/chunks/f53010adb70463b75bb9.js +0 -1
- package/assets/esri/core/workers/chunks/f5a058a0ce006bce2a2a.js +0 -1
- package/assets/esri/core/workers/chunks/f5f5b54cab722abe88e0.js +0 -1
- package/assets/esri/core/workers/chunks/f60ed579981913d44675.js +0 -1
- package/assets/esri/core/workers/chunks/f6f56f3e011dcef90bbb.js +0 -1
- package/assets/esri/core/workers/chunks/f83c3597e9332bd991eb.js +0 -1
- package/assets/esri/core/workers/chunks/f9a4387f850d85c44ca5.js +0 -1
- package/assets/esri/core/workers/chunks/fdd0e6d9927d3c43b0d3.js +0 -1
- package/geometry/operators/importUtils.js +0 -2
- /package/assets/esri/core/workers/chunks/{1c803eef9a8fdabc61e3.js.LICENSE.txt → 1082bb0858585bd4fa21.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{87094044458b0ea5cb0f.js.LICENSE.txt → 2e2349387a2b9903f13c.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{678585509706755c0434.js.LICENSE.txt → 411bbdecba340df11d95.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{5edf77618ca51819d7c4.js.LICENSE.txt → 476535cfb06ced74d611.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{6564f17c4700dc8d9c0e.js.LICENSE.txt → b82b523b6837ed1f28d3.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{63127e3b22e7eac6003d.js.LICENSE.txt → ef24fd6c0322e5de9fdf.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{floatEqualUlp as e,lerp as t}from"../../../core/mathUtils.js";import{throwIfAborted as n}from"../../../core/promiseUtils.js";import{getMetersPerUnitForSR as r}from"../../../core/units.js";import{distance as s,lerp as o}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{lerp as i}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{geodesicLengths as a,isSupported as c,inverseGeodeticSolver as u,directGeodeticSolver as l}from"../../../geometry/geodesicUtils.js";import f from"../../../geometry/Polyline.js";import{initializeProjection as h,project as m}from"../../../geometry/projectionUtils.js";import p from"../../../geometry/SpatialReference.js";import{getElevationOffset as d}from"../../../support/elevationInfoUtils.js";import{TooComplexError as g}from"./elevationProfileErrors.js";async function y(e,t,s,o,i,c,u){let l,f,d;const y=e.spatialReference,j=y.isGeographic||y.isWebMercator;let v=0;if(!j){const{
|
|
2
|
+
import{floatEqualUlp as e,lerp as t}from"../../../core/mathUtils.js";import{throwIfAborted as n}from"../../../core/promiseUtils.js";import{getMetersPerUnitForSR as r}from"../../../core/units.js";import{distance as s,lerp as o}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{lerp as i}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{geodesicLengths as a,isSupported as c,inverseGeodeticSolver as u,directGeodeticSolver as l}from"../../../geometry/geodesicUtils.js";import f from"../../../geometry/Polyline.js";import{initializeProjection as h,project as m}from"../../../geometry/projectionUtils.js";import p from"../../../geometry/SpatialReference.js";import{getElevationOffset as d}from"../../../support/elevationInfoUtils.js";import{TooComplexError as g}from"./elevationProfileErrors.js";async function y(e,t,s,o,i,c,u){let l,f,d;const y=e.spatialReference,j=y.isGeographic||y.isWebMercator;let v=0;if(!j){const{lengthExecute:t}=await(import("../../../geometry/operators/lengthOperator.js"));n(u),v=t(e,{unit:"meters"}),n(u)}const P=1/r(o);if(j){await h([{source:y,dest:o},{source:y,dest:p.WGS84}],u);const n=q(e);l=a([n],"meters")[0];const r=w(l,i);if(C(e,l,r)>c)throw new g;const j=R(n,t,s);({densifiedPath:f,distances:d}=G(j,r,P)),f=m(f,o)}else{await h([{source:y,dest:o}],u),l=v;const r=w(l,i);if(C(e,l,r)>c)throw new g;const a=R(e,t,s);({densifiedPath:f,distances:d}=E(a,r,P)),n(u),f=m(f,o)}return{densifiedPath:f,pathLength:l*P,distances:d}}function w(e,t){const n=e/t.densificationMaxSamples;return Math.max(t.samplingDistance,n)}function R(e,t,n){if(null==t)return P(e);const r=e.spatialReference,s=t.mode,o=d(t,r);let i=null;switch(n.type){case"2d":i=j(e,s,o);break;case"3d":i=v(e,s,o,n)}return null==i?P(e):new f({hasZ:!0,hasM:!1,spatialReference:r,paths:Z(e.paths,i)})}function j({hasZ:e},t,n){return"absolute-height"===t?e?([e,t,r])=>[e,t,r+n]:([e,t])=>[e,t,n]:null}function v({spatialReference:e,hasZ:t},n,r,{elevationProvider:s}){const o=(t,n,r,o)=>s?.getElevation(t,n,r,e,o)??0;switch(n){case"on-the-ground":return([e,t])=>[e,t,o(e,t,0,"ground")];case"absolute-height":return t?([e,t,n])=>[e,t,n+r]:([e,t])=>[e,t,r];case"relative-to-ground":return t?([e,t,n])=>[e,t,n+o(e,t,n,"ground")+r]:([e,t])=>[e,t,o(e,t,0,"ground")+r];case"relative-to-scene":return t?([e,t,n])=>[e,t,n+o(e,t,n,"scene")+r]:([e,t])=>[e,t,o(e,t,0,"scene")+r];default:return null}}function P(e){return e.hasZ?new f({hasZ:!1,hasM:!1,spatialReference:e.spatialReference,paths:Z(e.paths,([e,t])=>[e,t])}):e}function Z(e,t){const n=e.length,r=new Array(n);for(let s=0;s<n;++s){const n=e[s],o=n.length,i=new Array(n.length);r[s]=i;for(let e=0;e<o;++e)i[e]=t(n[e])}return r}function x(e){return S(e)&&e.paths.some(e=>e.length>1)}function M(e){return b(e)&&x(e.geometry)}function b(e){return A(e)&&S(e?.geometry)}function S(e){return!A(e)&&null!=e&&"polyline"===e.type}function A(e){return null!=e&&"geometry"in e}function U(e){const t=e?.layer;return null!=t&&"graphics"===t.type&&t.internal}function z(t,n,s,o,i){const{spatialReference:a,hasZ:c}=t,u={from:null,to:null,distance:0,azimuth:0,reverseAzimuth:0,spatialReference:a,metersPerSR:r(a)},l=[],h=[];let m=0;for(let r=0;r<t.paths.length;++r){const a=t.paths[r],c=new Array,f=new Array;let p=0;for(let t=1;t<a.length;++t){const r=a[t-1],l=a[t],h=o(u,r,l);let d;for(d=p;d<h.distance&&!e(d,h.distance);d+=n)c.push(i(h,d)),f.push((m+d)*s);p=d-h.distance,m+=h.distance,c.push(l),f.push(m*s)}l[r]=c,h[r]=f}return{densifiedPath:new f({spatialReference:a,hasZ:c,paths:l}),distances:h}}function E(e,t,n){const{hasZ:r}=e;return z(e,t,n,k,r?O:L)}function G(e,t,n){const{hasZ:r}=e;return z(e,t,n,W,r?I:D)}function W(e,t,n){return e.distance=0,u(e,t,n,e.spatialReference),e.from=t,e.to=n,e}function k(e,t,n){return e.from=t,e.to=n,e.distance=s(n,t)*e.metersPerSR,e}function D({from:e,azimuth:t,spatialReference:n},r){return l([0,0],e,t,r,n)}function I({from:e,to:n,azimuth:r,distance:s,spatialReference:o},i){const a=i/s,c=[0,0,t(e[2],n[2],a)];return l(c,e,r,i,o),c}function L({from:e,to:t,distance:n},r){return o([0,0],e,t,r/n)}function O({from:e,to:t,distance:n},r){return i([0,0,0],e,t,r/n)}function q(e){return c(e.spatialReference)?e:m(e,p.WGS84)}function B(e){return e.paths.reduce((e,t)=>e+t.length,0)}function C(e,t,n){return B(e)+Math.floor(t/n)+Math.max(0,e.paths.reduce(e=>1+e,0)-1)}export{B as countPoints,y as densifyPath,A as isGraphic,U as isInternalGraphic,S as isPolyline,b as isPolylineGraphic,M as isValidInputGraphic,x as isValidInputPath,R as toAbsoluteHeightElevation};
|
package/views/draw/DrawTool.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__addDisposableResource as e,__disposeResources as t,__decorate as i}from"tslib";import{createTask as n}from"../../core/asyncUtils.js";import{makeHandle as a,disposable as s}from"../../core/handleUtils.js";import r from"../../core/Logger.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{destroyMaybe as l,abortMaybe as d}from"../../core/maybe.js";import{ignoreAbortErrors as p}from"../../core/promiseUtils.js";import{when as u,initial as c,watch as g,syncAndInitial as h,on as m,sync as v}from"../../core/reactiveUtils.js";import{screenPointEqual as y,createScreenPoint as f}from"../../core/screenUtils.js";import{diff as M}from"../../core/accessorSupport/diffUtils.js";import{property as _}from"../../core/accessorSupport/decorators/property.js";import{subclass as b}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as w}from"../../core/support/UpdatingHandles.js";import S from"../../geometry/Polygon.js";import{isSimple as C,execute as P}from"../../geometry/operators/simplifyOperator.js";import{isPolygon as H}from"../../geometry/support/typeUtils.js";import{isCurvedGeometry as x}from"../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as I}from"../../geometry/support/curves/densifyCurvedGeometry.js";import{getEffectiveElevationInfo as L}from"../../support/elevationInfoUtils.js";import{getMaxDeviationInPixels as O,getMinSegmentsPerCurve as k}from"../2d/layers/graphics/densificationConstants.js";import{createSnappingVisualizer as T}from"./support/createSnappingVisualizer.js";import{multipointFromGeometry as V,markHandled as G,getPointerType as j,getPointerId as E}from"./support/drawToolUtils.js";import{PluginContext as D}from"./support/PluginContext.js";import{viewEventToCommand as U}from"./support/input/drawToolInput.js";import{EditSessionManager as A}from"./support/managers/EditSessionManager.js";import{GlobalStateManager as F}from"./support/managers/GlobalStateManager.js";import{InteractiveHandleManager as R}from"./support/managers/InteractiveHandleManager.js";import{MeasurementManager as Z}from"./support/managers/MeasurementManager.js";import{PluginLifecycleManager as B}from"./support/managers/PluginLifecycleManager.js";import{SurfaceManager as q}from"./support/managers/SurfaceManager.js";import{TooltipManager as z}from"./support/managers/TooltipManager.js";import{ViewEventPriorities as K}from"../input/InputManager.js";import{createCoordinateHelper as N}from"../interactive/coordinateHelper.js";import{InteractiveToolBase as Q}from"../interactive/InteractiveToolBase.js";import{KeyBindings as W,mediaKeys as $,sketchKeys as J,advancedSketchKeys as X,tooltipKeys as Y}from"../interactive/keybindings.js";import{isInputModeAvailable as ee}from"../interactive/tooltip/tooltipCommonUtils.js";const te=Symbol();let ie=class extends Q{constructor(e){super(e),this._shapeVisualId=Symbol(),this._vertexVisualId=Symbol(),this._pluginContexts=new Map,this._queuedFeedbackEvents=[],this._flushingQueuedFeedbackEvents=!1,this._commandsSuspended=!1,this._snappingVisualizer=null,this._segmentLabels=null,this._segmentLabelsImportTask=null,this._updatingHandles=new w,this._keybindings=this._makeKeyBindings(),this._pendingBeginRequest=null,this.type="draw-2.0",this.automaticManipulatorSelection=!0,this.snappingManager=null,this.toolOptions=null,this.elevationInfo=null,this.hasZ=!1,this.defaultZ=0,this.lastScreenPosition=null,this.measurementManager=new Z,this.globalStateManager=new F({getPluginStack:()=>this.pluginStack}),this.editSessionManager=new A({getContext:()=>this._editSessionManagerContext}),this.lifecycleManager=new B({getContext:this._getContextForPlugin.bind(this),editSessionManager:this.editSessionManager,afterAttach:this._afterAttach.bind(this),afterDetach:this._afterDetach.bind(this),beforeResume:this._beforeResume.bind(this)}),this.surfaceManager=null,this.interactiveHandleManager=null,this.renderer=null,this.readPluginSetting=null,this.enableVertexVisuals=!0}initialize(){const{view:e}=this;this.interactiveHandleManager=new R({view:e,renderer:this.renderer}),this._override("manipulators",this.interactiveHandleManager.manipulators),this.tooltipManager=new z({getDependencies:()=>this._tooltipDependencies,getLastScreenPosition:()=>this.lastScreenPosition}),this.addHandles(u(()=>this.renderer,t=>{t.addOrUpdateVisual(this._shapeVisualId,{role:"outputGeometry"}),t.addOrUpdateVisual(this._vertexVisualId,{role:"vertex"}),this._updatingHandles.addPromise(T(e,t).then(e=>this._snappingVisualizer=e))},c)),this.addHandles([g(()=>[this.view,this.coordinateHelper.spatialReference,this.defaultZ,this.hasZ,this.elevationInfo],([e,t,i,n,a])=>{this.surfaceManager?.destroy(),this.surfaceManager=new q({spatialReference:t,excludedGraphicsLayer:null,defaultZ:i,hasZ:n,view:e,elevationInfo:a,getContext:()=>({drawAtFixedElevation:this.globalStateManager.drawAtFixedElevation,elevationConstraint:this.tooltipManager?.elevationConstraint,constraintsEnabled:this.tooltipManager?.constraintsEnabled??!1})})},h),u(()=>this.toolOptions?.tooltips.effectiveEnabled,()=>this.measurementManager.preloadMeasurementUtils(),{once:!0,initial:!0}),g(()=>[this.editGeometryOperations,this.toolOptions?.labels.enabled,this.globalStateManager.segmentLabelsDisabled],()=>{this._updatingHandles.addPromise(this._setupSegmentLabels())},c),m(()=>this.editSessionManager,"cancelPlugin",({plugin:e})=>{this._suspendPlugin(e)},v),m(()=>this.editSessionManager,"restartPlugin",({restartInfo:e})=>{this._resumePlugin(e)},v),g(()=>this.lifecycleManager.updating,e=>{e||this._emitQueuedFeedbackEvents()},v),m(()=>this.editGeometryOperations,["vertex-add","vertex-update","vertex-remove"],e=>{const t=e.vertices.map(e=>({componentIndex:0,vertexIndex:e.index,coordinates:this.coordinateHelper.vectorToArray(e.pos)})),i=t.map(e=>e.coordinates);switch(e.type){case"vertex-add":this._emitWhenReady(e.type,{...e,added:i,vertices:t});break;case"vertex-update":this._emitWhenReady(e.type,{...e,updated:i,vertices:t});break;case"vertex-remove":this._emitWhenReady(e.type,{...e,removed:i,vertices:t})}})])}destroy(){this.active&&this.onDeactivate(),this.editSessionManager.destroy(),this.lifecycleManager.destroy(),this.measurementManager.destroy(),this.globalStateManager.destroy();for(const e of this._pluginContexts.values())e.destroy();this._pluginContexts.clear(),this.surfaceManager=l(this.surfaceManager),this.interactiveHandleManager=l(this.interactiveHandleManager),this._segmentLabelsImportTask=d(this._segmentLabelsImportTask),this._segmentLabels=l(this._segmentLabels),this.tooltipManager=l(this.tooltipManager)}get _zOfLastUserInput(){const e=this.mostDownstreamPlugin&&this.editSessionManager.getSession(this.mostDownstreamPlugin),t=e?.firstPointAddedBySession?.point;return t?.hasZ?t.z:null}get _tooltipDependencies(){const{defaultZ:e,editGeometryOperations:t,toolOptions:i,directionOptions:n,elevationInfo:a,view:s}=this;return t&&i&&s?{defaultZ:e,directionOptions:n,elevationInfo:a,editGeometryOperations:t,toolOptions:i,view:s,getActiveHandle:()=>this.interactiveHandleManager?.focusedHandle,getAllHandles:()=>this.interactiveHandleManager?.allhandles,getHelpMessageKey:()=>this.helpMessageKey,notifyTooltipsChanged:()=>{const{interactiveHandleManager:e,movementCommandContext:t}=this;e&&t&&e.reapplyPositions(t)}}:null}get _editSessionManagerContext(){const{coordinateHelper:e,view:t}=this;if(!t)return null;return{coordinateHelper:e,viewingMode:"3d"===t.type&&"global"===t.viewingMode?1:2}}get _densificationParameters(){const{view:e,coordinateHelper:t}=this,i=t.spatialReference,n=e?.spatialReference,a=e.resolution;if(!(i&&n&&a&&Number.isFinite(a)))return null;const s=n.metersPerUnit/i.metersPerUnit;return{maxDeviation:2**Math.round(Math.log2(a))*O()*s,minSegmentsPerCurve:k()}}get test(){return{densificationParameters:this._densificationParameters,segmentLabels:this._segmentLabels}}get updating(){return this._updatingHandles.updating||this.snappingManager?.updating||this.lifecycleManager.updating||!!this._segmentLabels?.updating}get coordinateHelper(){return N(this.hasZ,!1,this.view.spatialReference)}get editGeometry(){return this.editGeometryOperations?.data}get editGeometryOperations(){return this.editSessionManager.editGeometryOperations}get unprocessedGeometry(){return this.editSessionManager.outputGeometry}get simplifiedGeometryPreview(){const e=this.editSessionManager.outputGeometry;if(e&&H(e))try{const t=this._densificationParameters,i=x(e)&&t?new S({...I(e,t)}):e;if(!C(i))return P(i)}catch(t){return e}return e}get _suppressCoincidentPointOverlaysIn3D(){return"3d"===this.view.type&&"point"===this.unprocessedGeometry?.type&&!!this.interactiveHandleManager?.allhandles?.find(e=>"primary"===e.role)?.outputMapPosition}get _shapeVisualGeometry(){return this._suppressCoincidentPointOverlaysIn3D?null:this.simplifiedGeometryPreview}get _vertexVisualGeometry(){return this._suppressCoincidentPointOverlaysIn3D?null:this.unprocessedGeometry}get canUndo(){return this.editSessionManager.canUndo}get canRedo(){return this.editSessionManager.canRedo}get pluginStack(){return this.lifecycleManager.pluginStack}get mostDownstreamPlugin(){return this.pluginStack.at(-1)}get mostUpstreamPlugin(){return this.pluginStack.at(0)}get positionOfLastUserInput(){const e=this.lastScreenPosition;return e?this.surfaceManager?.screenToMap(e,{firstPointZ:this._zOfLastUserInput})??this.view.toMap(e):this.view.center}get movementCommandContext(){const{editGeometryOperations:e,tooltipManager:t,surfaceManager:i,snappingManager:n,interactiveHandleManager:a,_snappingVisualizer:s,defaultZ:r,hasZ:o,globalStateManager:{drawAtFixedElevation:l},view:d}=this;return{tooltipManager:t,editGeometryOperations:e,surfaceManager:i,interactiveHandleManager:a,snappingManager:n,snappingVisualizer:s,pointerType:"mouse",hasZ:o,defaultZ:r,view:d,drawAtFixedElevation:l}}get tooltip(){return this.tooltipManager?.tooltip}get activeTooltipInfo(){return this.tooltipManager?.tooltipInfo}get helpMessageKey(){return this.pluginStack.items.findLast(e=>e.helpMessageKey)?.helpMessageKey??"noTool"}begin(e){this.active?(this.lifecycleManager.begin(e),this._pendingBeginRequest=null):this._pendingBeginRequest=e}complete(e){const t=this.lifecycleManager;if(e&&t.complete(e),0===t.pluginStack.length){const e=this.unprocessedGeometry,t=!e||"mesh"===e.type||C(e);this.emit("complete",{geometry:e,isSimple:t,aborted:!1,type:"complete",vertices:[]}),this.view?.activeTool===this&&(this.view.activeTool=null)}}cancelFirstUserLeafPlugin(){const e=this.pluginStack.toArray().findLast(e=>!0!==e.configuration?.hidden);e&&this.lifecycleManager.cancel(e)}getVertexSnappingCandidates(){return"secondary"===this.interactiveHandleManager?.capturingHandle?.role?[]:this.snappingManager?.getVertexCandidates()??[]}replaceLeaf(e){const t=this.lifecycleManager;t.updating?r.getLogger(this).info("Ignoring command; arrived while updating:","replaceLeaf"):t.replaceLeaf(e)}finishPart(){const e=this.mostUpstreamPlugin,t=e?.configuration;if(this.editGeometryOperations&&t&&t.kind?.includes("multipart")){const e=this.pluginStack.at(1);e&&this.complete(e)}}undo(){this._handleCommand({action:"undo"})}redo(){this._handleCommand({action:"redo"})}executeCommand(e){return this._handleCommand(e)}suspendCommands(){return this._commandsSuspended=!0,a(()=>{this._commandsSuspended=!1;const e=this.view?.inputManager.latestPointerInfo;if(e){const{x:t,y:i}=e.location;this._handleCommand({action:"manipulator-move-to",x:t,y:i})}})}addPromise(e){return this._updatingHandles.addPromise(e)}readPluginSettingValue(e,t){return this.readPluginSetting?.(e,t)}getGeometryIfCompleted(){const e=this.lifecycleManager.gatherCompletablePlugins();return this.editSessionManager?.generatePreviewGeometryForPlugins(e)}onActivate(){super.onActivate();const{view:e}=this;this.lastScreenPosition=e?.inputManager.latestPointerInfo?.location,this.renderer?.activate(),this._pendingBeginRequest&&(this.begin(this._pendingBeginRequest),this._pendingBeginRequest=null),this.enableVertexVisuals&&this.addHandles(g(()=>this._vertexVisualGeometry,e=>{this.renderer?.addOrUpdateVisual(this._vertexVisualId,{geometry:e?V(e):null})},c)),this.addHandles([g(()=>this._shapeVisualGeometry,e=>{this.renderer?.addOrUpdateVisual(this._shapeVisualId,{geometry:e})},c),u(()=>this.interactiveHandleManager?.capturingHandle?.screenPosition,e=>this.lastScreenPosition=e,{initial:!0,equals:y}),g(()=>this.interactiveHandleManager?.capturingHandle?.outputMapPosition,(e,t)=>{const i=this.interactiveHandleManager?.capturingHandle?.editSession?.endVertex;e&&t&&i&&this._emitWhenReady("cursor-update",{updated:i.pos,type:"vertex-update",operation:"apply",vertices:[{componentIndex:i.part.index,vertexIndex:i.index,coordinates:i.pos}]})},v),this._keybindings.register(e,K.TOOL),g(()=>e.viewpoint,(e,t)=>{e&&t&&M(e,t)&&this._handleCommand({action:"viewpoint-moved"})})],te)}onDeactivate(){super.onDeactivate(),this.removeHandles(te),this.renderer?.deactivate(),this.snappingManager?.doneSnapping(),this.lifecycleManager.cancelAll(),this._pendingBeginRequest=null}onInputEvent(e){"pointer-down"===e.type?this.interactiveHandleManager?.notePointerDown(e.pointerId,e.pointerType):"pointer-up"!==e.type&&"pointer-leave"!==e.type||this.interactiveHandleManager?.notePointerUp(e.pointerId,e.pointerType);const t=U(e);t&&this._handleCommand(t)}forceAddVertex(){this._commitNext()}_emitWhenReady(e,t){if(this.destroyed)return;const i=()=>{this.emit(e,t)};this.lifecycleManager.updating||this._flushingQueuedFeedbackEvents?this._queuedFeedbackEvents.push(i):i()}_emitQueuedFeedbackEvents(){if(!(this.destroyed||this._flushingQueuedFeedbackEvents||this.lifecycleManager.updating||0===this._queuedFeedbackEvents.length)){this._flushingQueuedFeedbackEvents=!0;try{for(;!this.destroyed&&!this.lifecycleManager.updating&&this._queuedFeedbackEvents.length>0;)this._queuedFeedbackEvents.shift()?.()}finally{this._flushingQueuedFeedbackEvents=!1}}}async _handleCommand(e){if(!this._commandsSuspended)if(this.lifecycleManager.updating)r.getLogger(this).info("Ignoring command; arrived while updating:",e.action);else switch(e.action){case"view-drag":return await this._handleViewDragCommand(e);case"vertex-add":return this._guardCommand(e,()=>{G(e),this._commitNext()});case"vertex-add-and-finish-part":return this._handleVertexAddAndFinishPartCommand(e);case"cancel":return this._guardCommand(e,()=>this.cancel());case"complete":return this._guardCommand(e,()=>{this.mostUpstreamPlugin&&(G(e),this.complete(this.mostUpstreamPlugin))});case"finish-part":return this._guardCommand(e,()=>this.finishPart());case"undo":return this._guardCommand(e,()=>this.editSessionManager.undo());case"redo":return this._guardCommand(e,()=>this.editSessionManager.redo());case"next-manipulator":return this._guardCommand(e,()=>this.interactiveHandleManager?.cycleManipulator("forward"));case"previous-manipulator":return this._guardCommand(e,()=>this.interactiveHandleManager?.cycleManipulator("backward"));case"toggle-manipulator-follow":this.interactiveHandleManager?.toggleFollow()&&G(e);break;case"viewpoint-moved":return await this._handleViewpointMovedCommand(e);case"manipulator-move-to":return await this._handleManipulatorMoveToCommand(e);case"manipulator-drag-to":return await this._handleManipulatorDragToCommand(e);case"vertex-add-at-point":return await this._handleVertexAddAtPointCommand(e);case"show-tooltip":return this._guardCommand(e,async()=>{const t=this.tooltipManager?.tooltip;t&&ee(t.info)&&(await t.enterInputMode(),G(e))});case"constraint-center":this.globalStateManager.setCentered(e.enabled);break;case"constraint-aspect":this.globalStateManager.setPreserveAspectRatio(e.enabled)}}async _handleViewDragCommand(e){if(!this.editable)return;const t=e.originalEvent,i=this.interactiveHandleManager?.capturingHandle;(!t||!("pointerType"in t)||"touch"!==t.pointerType||"capture-always"!==i?.captureMode&&"capture-when-engaged"!==i?.captureMode)&&"capture-when-engaged"!==this.interactiveHandleManager?.capturingHandle?.captureMode?this._before(e)&&G(e):G(e)}_handleVertexAddAndFinishPartCommand(e){this._before(e)||(G(e),this._commitNext(),this.finishPart())}async _handleViewpointMovedCommand(e){if(!this.editable)return;const t=j(e.originalEvent),i=E(e.originalEvent);await this._updatingHandles.addPromise(this.interactiveHandleManager?.capturingHandle?.moveTo(null,{...this.movementCommandContext,pointerType:t,pointerId:i})),this.interactiveHandleManager?.updateAllScreenPositions(this.movementCommandContext.surfaceManager)}async _handleManipulatorMoveToCommand(e){if(!this.editable)return;const t=j(e.originalEvent),i=E(e.originalEvent);if(!this.interactiveHandleManager?.shouldCaptureInput(i,t))return;const n=this._updateLastScreenPosition(e);this.interactiveHandleManager?.capturingHandle&&G(e),await this._updatingHandles.addPromise(this.interactiveHandleManager?.capturingHandle?.moveTo(n,{...this.movementCommandContext,pointerType:t,pointerId:i}))}async _handleManipulatorDragToCommand(e){if(!this.editable)return;const t=j(e.originalEvent),i=E(e.originalEvent);if(!this.interactiveHandleManager?.shouldCaptureInput(i,t))return;const n=this._updateLastScreenPosition(e),a=this.interactiveHandleManager?.findHandleByManipulator(n,t);"touch"===t&&a&&"start"===e.state&&this.interactiveHandleManager?.releaseHandle();const s=this.interactiveHandleManager?.findHandleDragging(),r=this.interactiveHandleManager?.capturingHandle,o=s??r??a;o&&!a&&G(e),"capture-when-engaged"===o?.captureMode||"capture-always"===o?.captureMode&&"touch"===t?"end"===e.state?await this._updatingHandles.addPromise(o.noteDragEnd(n,{...this.movementCommandContext,pointerType:t,pointerId:i}).then(()=>{o&&"touch"===j(e.originalEvent)&&"grabbable-object"!==o.captureMode&&"capture-when-engaged"!==o.defaultCaptureMode&&"primary"===o.role&&(1===this.interactiveHandleManager?.handleCount?this._handleCommand({action:"vertex-add"}):this.interactiveHandleManager?.releaseHandle())})):"start"===e.state?await this._updatingHandles.addPromise(o.noteDragStart(n,{...this.movementCommandContext,pointerType:t,pointerId:i}).then(()=>{o&&"touch"===j(e.originalEvent)&&"grabbable-object"!==o.captureMode&&"capture-when-engaged"!==o.defaultCaptureMode&&!o.editSession?.lastPointAddedBySession&&this._handleCommand({action:"vertex-add"})})):await this._updatingHandles.addPromise(o?.moveTo(n,{...this.movementCommandContext,pointerType:t,pointerId:i})):"grabbable-object"===o?.captureMode&&(this.interactiveHandleManager?.releaseHandle(r),await this._updatingHandles.addPromise(o.moveTo(n,{...this.movementCommandContext,pointerType:t,pointerId:i})))}async _handleVertexAddAtPointCommand(e){const t=this._updateLastScreenPosition(e),i=j(e.originalEvent),n=E(e.originalEvent);if(!this.interactiveHandleManager?.shouldCaptureInput(n,i))return;const a=this.interactiveHandleManager?.capturingHandle??this.interactiveHandleManager?.findHandleByManipulator(t,i);this.editable&&a&&(this._before(e)||(G(e),await this._updatingHandles.addPromise(a.moveTo(t,{...this.movementCommandContext,skipSnapping:!0,pointerType:i,pointerId:n}).finally(()=>this._commitNext()))))}_makeKeyBindings(){const e=new W,t=(t,i)=>{e.addToggle(t,e=>this._handleCommand({action:i,originalEvent:e,enabled:"key-down"===e.type}))},i=(t,i)=>{e.add(t,e=>this._handleCommand({action:i,originalEvent:e}))};return t($.preserveAspectRatio,"constraint-aspect"),t(J.center,"constraint-center"),i(X.toggleFollowManipulator,"toggle-manipulator-follow"),i(J.undo,"undo"),i(J.redo,"redo"),i(J.complete,"complete"),i(J.vertexAdd,"vertex-add"),i({key:Y.enterInputMode,continuePropagation:!0,repeats:!0},"show-tooltip"),e}_afterAttach(){}_afterDetach(e){this.interactiveHandleManager?.unregisterCustomConstraint(e),this.interactiveHandleManager?.unregisterHandle(e),this.tooltipManager?.unregisterPluginFields(e),this.globalStateManager.clearPluginOverrides(e);const t=this._pluginContexts.get(e);t&&(t.destroy(),this._pluginContexts.delete(e))}_beforeResume(e,t){this.interactiveHandleManager?.replaceEditSessions(e,t)}_commitNext(){const i={stack:[],error:void 0,hasError:!1};try{const t=this.mostDownstreamPlugin;if(!t)return;this.tooltipManager?.storeConstraintSnapshot();let n=!1;const a=this.editGeometryOperations;e(i,a?s(a.on("vertex-add",()=>n=!0)):null,!1);t.completeStep?t.completeStep():this.complete(t),n&&this.tooltipManager?.unlockOnVertexPlacement()}catch(n){i.error=n,i.hasError=!0}finally{t(i)}}_suspendPlugin(e){this.lifecycleManager.suspend(e),this.measurementManager.suspendPlugin(e)}_resumePlugin(e){this.lifecycleManager.resume(e)}_updateLastScreenPosition(e){const t=f(e.x,e.y);return this.lastScreenPosition=t,t}_getContextForPlugin(e,t){const i=o(this._pluginContexts,e,()=>new D({drawTool:this,plugin:e,session:t}));return i.session=t,i}_before(e){if(!this.hasEventListener(`before-${e.action}`))return!1;const t=new CustomEvent(`before-${e.action}`,{detail:e,cancelable:!0});return this.emit(`before-${e.action}`,t),t.defaultPrevented}_guardCommand(e,t,i){return this._before(e)?i?.():t()}async _setupSegmentLabels(){const e=this.editGeometryOperations,t=this.toolOptions?.labels,i=!!t?.enabled,n=this.globalStateManager.segmentLabelsDisabled;if(!e||!t||!i)return void(this._segmentLabels=l(this._segmentLabels));if(n)return void(this._segmentLabels&&(this._segmentLabels.visible=!1));if(this._segmentLabels?.context?.editGeometryOperations===e&&this._segmentLabels.context.labelOptions===t)return void(this._segmentLabels.visible=!0);const a=await this._createSegmentLabels(e,t);a&&(this._segmentLabels=l(this._segmentLabels),this._segmentLabels=a)}async _createSegmentLabels(e,t){this._segmentLabelsImportTask?.abort();const i=this._segmentLabelsImportTask=n(async i=>{if("3d"===this.view.type){const n=import("../3d/interactive/SegmentLabels3D.js"),{SegmentLabels3D:a}=await this._updatingHandles.addPromise(n);return this._isSegmentLabelsSetupStale(i,e,t)?null:new a({context:{view:this.view,editGeometryOperations:e,elevationInfo:L(this.hasZ,this.elevationInfo),labelOptions:t},visible:!0})}const n=import("../2d/interactive/SegmentLabels2D.js"),{SegmentLabels2D:a}=await this._updatingHandles.addPromise(n);return this._isSegmentLabelsSetupStale(i,e,t)?null:new a({context:{view:this.view,editGeometryOperations:e,elevationInfo:L(this.hasZ,this.elevationInfo),labelOptions:t},visible:!0})});return p(i.promise)}_isSegmentLabelsSetupStale(e,t,i){return e.aborted||this.editGeometryOperations!==t||this.toolOptions?.labels!==i||!i.enabled||this.globalStateManager.segmentLabelsDisabled}};i([_()],ie.prototype,"_commandsSuspended",void 0),i([_()],ie.prototype,"_zOfLastUserInput",null),i([_()],ie.prototype,"_snappingVisualizer",void 0),i([_()],ie.prototype,"_segmentLabels",void 0),i([_()],ie.prototype,"_segmentLabelsImportTask",void 0),i([_()],ie.prototype,"_tooltipDependencies",null),i([_()],ie.prototype,"_editSessionManagerContext",null),i([_()],ie.prototype,"_densificationParameters",null),i([_({constructOnly:!0,nonNullable:!0})],ie.prototype,"view",void 0),i([_()],ie.prototype,"automaticManipulatorSelection",void 0),i([_()],ie.prototype,"updating",null),i([_()],ie.prototype,"coordinateHelper",null),i([_()],ie.prototype,"editGeometry",null),i([_()],ie.prototype,"editGeometryOperations",null),i([_()],ie.prototype,"unprocessedGeometry",null),i([_()],ie.prototype,"simplifiedGeometryPreview",null),i([_()],ie.prototype,"_suppressCoincidentPointOverlaysIn3D",null),i([_()],ie.prototype,"_shapeVisualGeometry",null),i([_()],ie.prototype,"_vertexVisualGeometry",null),i([_()],ie.prototype,"snappingManager",void 0),i([_()],ie.prototype,"toolOptions",void 0),i([_()],ie.prototype,"elevationInfo",void 0),i([_()],ie.prototype,"hasZ",void 0),i([_()],ie.prototype,"defaultZ",void 0),i([_()],ie.prototype,"directionOptions",void 0),i([_()],ie.prototype,"canUndo",null),i([_()],ie.prototype,"canRedo",null),i([_()],ie.prototype,"pluginStack",null),i([_()],ie.prototype,"mostDownstreamPlugin",null),i([_()],ie.prototype,"mostUpstreamPlugin",null),i([_()],ie.prototype,"lastScreenPosition",void 0),i([_()],ie.prototype,"positionOfLastUserInput",null),i([_()],ie.prototype,"tooltipManager",void 0),i([_()],ie.prototype,"measurementManager",void 0),i([_()],ie.prototype,"globalStateManager",void 0),i([_()],ie.prototype,"editSessionManager",void 0),i([_()],ie.prototype,"lifecycleManager",void 0),i([_()],ie.prototype,"surfaceManager",void 0),i([_()],ie.prototype,"interactiveHandleManager",void 0),i([_()],ie.prototype,"renderer",void 0),i([_()],ie.prototype,"readPluginSetting",void 0),i([_()],ie.prototype,"movementCommandContext",null),i([_()],ie.prototype,"tooltip",null),i([_()],ie.prototype,"activeTooltipInfo",null),i([_()],ie.prototype,"helpMessageKey",null),i([_({constructOnly:!0})],ie.prototype,"enableVertexVisuals",void 0),ie=i([b("esri.views.draw.DrawTool")],ie);export{ie as DrawTool};
|
|
2
|
+
import{__addDisposableResource as e,__disposeResources as t,__decorate as i}from"tslib";import{createTask as n}from"../../core/asyncUtils.js";import{makeHandle as a,disposable as s}from"../../core/handleUtils.js";import r from"../../core/Logger.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{destroyMaybe as l,abortMaybe as d}from"../../core/maybe.js";import{ignoreAbortErrors as p}from"../../core/promiseUtils.js";import{when as u,initial as c,watch as g,syncAndInitial as h,on as m,sync as v}from"../../core/reactiveUtils.js";import{screenPointEqual as y,createScreenPoint as f}from"../../core/screenUtils.js";import{diff as M}from"../../core/accessorSupport/diffUtils.js";import{property as _}from"../../core/accessorSupport/decorators/property.js";import{subclass as b}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as w}from"../../core/support/UpdatingHandles.js";import S from"../../geometry/Polygon.js";import{simplifyIsSimple as C,simplifyExecute as P}from"../../geometry/operators/simplifyOperator.js";import{isPolygon as H}from"../../geometry/support/typeUtils.js";import{isCurvedGeometry as x}from"../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as I}from"../../geometry/support/curves/densifyCurvedGeometry.js";import{getEffectiveElevationInfo as L}from"../../support/elevationInfoUtils.js";import{getMaxDeviationInPixels as O,getMinSegmentsPerCurve as k}from"../2d/layers/graphics/densificationConstants.js";import{createSnappingVisualizer as T}from"./support/createSnappingVisualizer.js";import{multipointFromGeometry as V,markHandled as G,getPointerType as j,getPointerId as E}from"./support/drawToolUtils.js";import{PluginContext as D}from"./support/PluginContext.js";import{viewEventToCommand as U}from"./support/input/drawToolInput.js";import{EditSessionManager as A}from"./support/managers/EditSessionManager.js";import{GlobalStateManager as F}from"./support/managers/GlobalStateManager.js";import{InteractiveHandleManager as R}from"./support/managers/InteractiveHandleManager.js";import{MeasurementManager as Z}from"./support/managers/MeasurementManager.js";import{PluginLifecycleManager as B}from"./support/managers/PluginLifecycleManager.js";import{SurfaceManager as q}from"./support/managers/SurfaceManager.js";import{TooltipManager as z}from"./support/managers/TooltipManager.js";import{ViewEventPriorities as K}from"../input/InputManager.js";import{createCoordinateHelper as N}from"../interactive/coordinateHelper.js";import{InteractiveToolBase as Q}from"../interactive/InteractiveToolBase.js";import{KeyBindings as W,mediaKeys as $,sketchKeys as J,advancedSketchKeys as X,tooltipKeys as Y}from"../interactive/keybindings.js";import{isInputModeAvailable as ee}from"../interactive/tooltip/tooltipCommonUtils.js";const te=Symbol();let ie=class extends Q{constructor(e){super(e),this._shapeVisualId=Symbol(),this._vertexVisualId=Symbol(),this._pluginContexts=new Map,this._queuedFeedbackEvents=[],this._flushingQueuedFeedbackEvents=!1,this._commandsSuspended=!1,this._snappingVisualizer=null,this._segmentLabels=null,this._segmentLabelsImportTask=null,this._updatingHandles=new w,this._keybindings=this._makeKeyBindings(),this._pendingBeginRequest=null,this.type="draw-2.0",this.automaticManipulatorSelection=!0,this.snappingManager=null,this.toolOptions=null,this.elevationInfo=null,this.hasZ=!1,this.defaultZ=0,this.lastScreenPosition=null,this.measurementManager=new Z,this.globalStateManager=new F({getPluginStack:()=>this.pluginStack}),this.editSessionManager=new A({getContext:()=>this._editSessionManagerContext}),this.lifecycleManager=new B({getContext:this._getContextForPlugin.bind(this),editSessionManager:this.editSessionManager,afterAttach:this._afterAttach.bind(this),afterDetach:this._afterDetach.bind(this),beforeResume:this._beforeResume.bind(this)}),this.surfaceManager=null,this.interactiveHandleManager=null,this.renderer=null,this.readPluginSetting=null,this.enableVertexVisuals=!0}initialize(){const{view:e}=this;this.interactiveHandleManager=new R({view:e,renderer:this.renderer}),this._override("manipulators",this.interactiveHandleManager.manipulators),this.tooltipManager=new z({getDependencies:()=>this._tooltipDependencies,getLastScreenPosition:()=>this.lastScreenPosition}),this.addHandles(u(()=>this.renderer,t=>{t.addOrUpdateVisual(this._shapeVisualId,{role:"outputGeometry"}),t.addOrUpdateVisual(this._vertexVisualId,{role:"vertex"}),this._updatingHandles.addPromise(T(e,t).then(e=>this._snappingVisualizer=e))},c)),this.addHandles([g(()=>[this.view,this.coordinateHelper.spatialReference,this.defaultZ,this.hasZ,this.elevationInfo],([e,t,i,n,a])=>{this.surfaceManager?.destroy(),this.surfaceManager=new q({spatialReference:t,excludedGraphicsLayer:null,defaultZ:i,hasZ:n,view:e,elevationInfo:a,getContext:()=>({drawAtFixedElevation:this.globalStateManager.drawAtFixedElevation,elevationConstraint:this.tooltipManager?.elevationConstraint,constraintsEnabled:this.tooltipManager?.constraintsEnabled??!1})})},h),u(()=>this.toolOptions?.tooltips.effectiveEnabled,()=>this.measurementManager.preloadMeasurementUtils(),{once:!0,initial:!0}),g(()=>[this.editGeometryOperations,this.toolOptions?.labels.enabled,this.globalStateManager.segmentLabelsDisabled],()=>{this._updatingHandles.addPromise(this._setupSegmentLabels())},c),m(()=>this.editSessionManager,"cancelPlugin",({plugin:e})=>{this._suspendPlugin(e)},v),m(()=>this.editSessionManager,"restartPlugin",({restartInfo:e})=>{this._resumePlugin(e)},v),g(()=>this.lifecycleManager.updating,e=>{e||this._emitQueuedFeedbackEvents()},v),m(()=>this.editGeometryOperations,["vertex-add","vertex-update","vertex-remove"],e=>{const t=e.vertices.map(e=>({componentIndex:0,vertexIndex:e.index,coordinates:this.coordinateHelper.vectorToArray(e.pos)})),i=t.map(e=>e.coordinates);switch(e.type){case"vertex-add":this._emitWhenReady(e.type,{...e,added:i,vertices:t});break;case"vertex-update":this._emitWhenReady(e.type,{...e,updated:i,vertices:t});break;case"vertex-remove":this._emitWhenReady(e.type,{...e,removed:i,vertices:t})}})])}destroy(){this.active&&this.onDeactivate(),this.editSessionManager.destroy(),this.lifecycleManager.destroy(),this.measurementManager.destroy(),this.globalStateManager.destroy();for(const e of this._pluginContexts.values())e.destroy();this._pluginContexts.clear(),this.surfaceManager=l(this.surfaceManager),this.interactiveHandleManager=l(this.interactiveHandleManager),this._segmentLabelsImportTask=d(this._segmentLabelsImportTask),this._segmentLabels=l(this._segmentLabels),this.tooltipManager=l(this.tooltipManager)}get _zOfLastUserInput(){const e=this.mostDownstreamPlugin&&this.editSessionManager.getSession(this.mostDownstreamPlugin),t=e?.firstPointAddedBySession?.point;return t?.hasZ?t.z:null}get _tooltipDependencies(){const{defaultZ:e,editGeometryOperations:t,toolOptions:i,directionOptions:n,elevationInfo:a,view:s}=this;return t&&i&&s?{defaultZ:e,directionOptions:n,elevationInfo:a,editGeometryOperations:t,toolOptions:i,view:s,getActiveHandle:()=>this.interactiveHandleManager?.focusedHandle,getAllHandles:()=>this.interactiveHandleManager?.allhandles,getHelpMessageKey:()=>this.helpMessageKey,notifyTooltipsChanged:()=>{const{interactiveHandleManager:e,movementCommandContext:t}=this;e&&t&&e.reapplyPositions(t)}}:null}get _editSessionManagerContext(){const{coordinateHelper:e,view:t}=this;if(!t)return null;return{coordinateHelper:e,viewingMode:"3d"===t.type&&"global"===t.viewingMode?1:2}}get _densificationParameters(){const{view:e,coordinateHelper:t}=this,i=t.spatialReference,n=e?.spatialReference,a=e.resolution;if(!(i&&n&&a&&Number.isFinite(a)))return null;const s=n.metersPerUnit/i.metersPerUnit;return{maxDeviation:2**Math.round(Math.log2(a))*O()*s,minSegmentsPerCurve:k()}}get test(){return{densificationParameters:this._densificationParameters,segmentLabels:this._segmentLabels}}get updating(){return this._updatingHandles.updating||this.snappingManager?.updating||this.lifecycleManager.updating||!!this._segmentLabels?.updating}get coordinateHelper(){return N(this.hasZ,!1,this.view.spatialReference)}get editGeometry(){return this.editGeometryOperations?.data}get editGeometryOperations(){return this.editSessionManager.editGeometryOperations}get unprocessedGeometry(){return this.editSessionManager.outputGeometry}get simplifiedGeometryPreview(){const e=this.editSessionManager.outputGeometry;if(e&&H(e))try{const t=this._densificationParameters,i=x(e)&&t?new S({...I(e,t)}):e;if(!C(i))return P(i)}catch(t){return e}return e}get _suppressCoincidentPointOverlaysIn3D(){return"3d"===this.view.type&&"point"===this.unprocessedGeometry?.type&&!!this.interactiveHandleManager?.allhandles?.find(e=>"primary"===e.role)?.outputMapPosition}get _shapeVisualGeometry(){return this._suppressCoincidentPointOverlaysIn3D?null:this.simplifiedGeometryPreview}get _vertexVisualGeometry(){return this._suppressCoincidentPointOverlaysIn3D?null:this.unprocessedGeometry}get canUndo(){return this.editSessionManager.canUndo}get canRedo(){return this.editSessionManager.canRedo}get pluginStack(){return this.lifecycleManager.pluginStack}get mostDownstreamPlugin(){return this.pluginStack.at(-1)}get mostUpstreamPlugin(){return this.pluginStack.at(0)}get positionOfLastUserInput(){const e=this.lastScreenPosition;return e?this.surfaceManager?.screenToMap(e,{firstPointZ:this._zOfLastUserInput})??this.view.toMap(e):this.view.center}get movementCommandContext(){const{editGeometryOperations:e,tooltipManager:t,surfaceManager:i,snappingManager:n,interactiveHandleManager:a,_snappingVisualizer:s,defaultZ:r,hasZ:o,globalStateManager:{drawAtFixedElevation:l},view:d}=this;return{tooltipManager:t,editGeometryOperations:e,surfaceManager:i,interactiveHandleManager:a,snappingManager:n,snappingVisualizer:s,pointerType:"mouse",hasZ:o,defaultZ:r,view:d,drawAtFixedElevation:l}}get tooltip(){return this.tooltipManager?.tooltip}get activeTooltipInfo(){return this.tooltipManager?.tooltipInfo}get helpMessageKey(){return this.pluginStack.items.findLast(e=>e.helpMessageKey)?.helpMessageKey??"noTool"}begin(e){this.active?(this.lifecycleManager.begin(e),this._pendingBeginRequest=null):this._pendingBeginRequest=e}complete(e){const t=this.lifecycleManager;if(e&&t.complete(e),0===t.pluginStack.length){const e=this.unprocessedGeometry,t=!e||"mesh"===e.type||C(e);this.emit("complete",{geometry:e,isSimple:t,aborted:!1,type:"complete",vertices:[]}),this.view?.activeTool===this&&(this.view.activeTool=null)}}cancelFirstUserLeafPlugin(){const e=this.pluginStack.toArray().findLast(e=>!0!==e.configuration?.hidden);e&&this.lifecycleManager.cancel(e)}getVertexSnappingCandidates(){return"secondary"===this.interactiveHandleManager?.capturingHandle?.role?[]:this.snappingManager?.getVertexCandidates()??[]}replaceLeaf(e){const t=this.lifecycleManager;t.updating?r.getLogger(this).info("Ignoring command; arrived while updating:","replaceLeaf"):t.replaceLeaf(e)}finishPart(){const e=this.mostUpstreamPlugin,t=e?.configuration;if(this.editGeometryOperations&&t&&t.kind?.includes("multipart")){const e=this.pluginStack.at(1);e&&this.complete(e)}}undo(){this._handleCommand({action:"undo"})}redo(){this._handleCommand({action:"redo"})}executeCommand(e){return this._handleCommand(e)}suspendCommands(){return this._commandsSuspended=!0,a(()=>{this._commandsSuspended=!1;const e=this.view?.inputManager.latestPointerInfo;if(e){const{x:t,y:i}=e.location;this._handleCommand({action:"manipulator-move-to",x:t,y:i})}})}addPromise(e){return this._updatingHandles.addPromise(e)}readPluginSettingValue(e,t){return this.readPluginSetting?.(e,t)}getGeometryIfCompleted(){const e=this.lifecycleManager.gatherCompletablePlugins();return this.editSessionManager?.generatePreviewGeometryForPlugins(e)}onActivate(){super.onActivate();const{view:e}=this;this.lastScreenPosition=e?.inputManager.latestPointerInfo?.location,this.renderer?.activate(),this._pendingBeginRequest&&(this.begin(this._pendingBeginRequest),this._pendingBeginRequest=null),this.enableVertexVisuals&&this.addHandles(g(()=>this._vertexVisualGeometry,e=>{this.renderer?.addOrUpdateVisual(this._vertexVisualId,{geometry:e?V(e):null})},c)),this.addHandles([g(()=>this._shapeVisualGeometry,e=>{this.renderer?.addOrUpdateVisual(this._shapeVisualId,{geometry:e})},c),u(()=>this.interactiveHandleManager?.capturingHandle?.screenPosition,e=>this.lastScreenPosition=e,{initial:!0,equals:y}),g(()=>this.interactiveHandleManager?.capturingHandle?.outputMapPosition,(e,t)=>{const i=this.interactiveHandleManager?.capturingHandle?.editSession?.endVertex;e&&t&&i&&this._emitWhenReady("cursor-update",{updated:i.pos,type:"vertex-update",operation:"apply",vertices:[{componentIndex:i.part.index,vertexIndex:i.index,coordinates:i.pos}]})},v),this._keybindings.register(e,K.TOOL),g(()=>e.viewpoint,(e,t)=>{e&&t&&M(e,t)&&this._handleCommand({action:"viewpoint-moved"})})],te)}onDeactivate(){super.onDeactivate(),this.removeHandles(te),this.renderer?.deactivate(),this.snappingManager?.doneSnapping(),this.lifecycleManager.cancelAll(),this._pendingBeginRequest=null}onInputEvent(e){"pointer-down"===e.type?this.interactiveHandleManager?.notePointerDown(e.pointerId,e.pointerType):"pointer-up"!==e.type&&"pointer-leave"!==e.type||this.interactiveHandleManager?.notePointerUp(e.pointerId,e.pointerType);const t=U(e);t&&this._handleCommand(t)}forceAddVertex(){this._commitNext()}_emitWhenReady(e,t){if(this.destroyed)return;const i=()=>{this.emit(e,t)};this.lifecycleManager.updating||this._flushingQueuedFeedbackEvents?this._queuedFeedbackEvents.push(i):i()}_emitQueuedFeedbackEvents(){if(!(this.destroyed||this._flushingQueuedFeedbackEvents||this.lifecycleManager.updating||0===this._queuedFeedbackEvents.length)){this._flushingQueuedFeedbackEvents=!0;try{for(;!this.destroyed&&!this.lifecycleManager.updating&&this._queuedFeedbackEvents.length>0;)this._queuedFeedbackEvents.shift()?.()}finally{this._flushingQueuedFeedbackEvents=!1}}}async _handleCommand(e){if(!this._commandsSuspended)if(this.lifecycleManager.updating)r.getLogger(this).info("Ignoring command; arrived while updating:",e.action);else switch(e.action){case"view-drag":return await this._handleViewDragCommand(e);case"vertex-add":return this._guardCommand(e,()=>{G(e),this._commitNext()});case"vertex-add-and-finish-part":return this._handleVertexAddAndFinishPartCommand(e);case"cancel":return this._guardCommand(e,()=>this.cancel());case"complete":return this._guardCommand(e,()=>{this.mostUpstreamPlugin&&(G(e),this.complete(this.mostUpstreamPlugin))});case"finish-part":return this._guardCommand(e,()=>this.finishPart());case"undo":return this._guardCommand(e,()=>this.editSessionManager.undo());case"redo":return this._guardCommand(e,()=>this.editSessionManager.redo());case"next-manipulator":return this._guardCommand(e,()=>this.interactiveHandleManager?.cycleManipulator("forward"));case"previous-manipulator":return this._guardCommand(e,()=>this.interactiveHandleManager?.cycleManipulator("backward"));case"toggle-manipulator-follow":this.interactiveHandleManager?.toggleFollow()&&G(e);break;case"viewpoint-moved":return await this._handleViewpointMovedCommand(e);case"manipulator-move-to":return await this._handleManipulatorMoveToCommand(e);case"manipulator-drag-to":return await this._handleManipulatorDragToCommand(e);case"vertex-add-at-point":return await this._handleVertexAddAtPointCommand(e);case"show-tooltip":return this._guardCommand(e,async()=>{const t=this.tooltipManager?.tooltip;t&&ee(t.info)&&(await t.enterInputMode(),G(e))});case"constraint-center":this.globalStateManager.setCentered(e.enabled);break;case"constraint-aspect":this.globalStateManager.setPreserveAspectRatio(e.enabled)}}async _handleViewDragCommand(e){if(!this.editable)return;const t=e.originalEvent,i=this.interactiveHandleManager?.capturingHandle;(!t||!("pointerType"in t)||"touch"!==t.pointerType||"capture-always"!==i?.captureMode&&"capture-when-engaged"!==i?.captureMode)&&"capture-when-engaged"!==this.interactiveHandleManager?.capturingHandle?.captureMode?this._before(e)&&G(e):G(e)}_handleVertexAddAndFinishPartCommand(e){this._before(e)||(G(e),this._commitNext(),this.finishPart())}async _handleViewpointMovedCommand(e){if(!this.editable)return;const t=j(e.originalEvent),i=E(e.originalEvent);await this._updatingHandles.addPromise(this.interactiveHandleManager?.capturingHandle?.moveTo(null,{...this.movementCommandContext,pointerType:t,pointerId:i})),this.interactiveHandleManager?.updateAllScreenPositions(this.movementCommandContext.surfaceManager)}async _handleManipulatorMoveToCommand(e){if(!this.editable)return;const t=j(e.originalEvent),i=E(e.originalEvent);if(!this.interactiveHandleManager?.shouldCaptureInput(i,t))return;const n=this._updateLastScreenPosition(e);this.interactiveHandleManager?.capturingHandle&&G(e),await this._updatingHandles.addPromise(this.interactiveHandleManager?.capturingHandle?.moveTo(n,{...this.movementCommandContext,pointerType:t,pointerId:i}))}async _handleManipulatorDragToCommand(e){if(!this.editable)return;const t=j(e.originalEvent),i=E(e.originalEvent);if(!this.interactiveHandleManager?.shouldCaptureInput(i,t))return;const n=this._updateLastScreenPosition(e),a=this.interactiveHandleManager?.findHandleByManipulator(n,t);"touch"===t&&a&&"start"===e.state&&this.interactiveHandleManager?.releaseHandle();const s=this.interactiveHandleManager?.findHandleDragging(),r=this.interactiveHandleManager?.capturingHandle,o=s??r??a;o&&!a&&G(e),"capture-when-engaged"===o?.captureMode||"capture-always"===o?.captureMode&&"touch"===t?"end"===e.state?await this._updatingHandles.addPromise(o.noteDragEnd(n,{...this.movementCommandContext,pointerType:t,pointerId:i}).then(()=>{o&&"touch"===j(e.originalEvent)&&"grabbable-object"!==o.captureMode&&"capture-when-engaged"!==o.defaultCaptureMode&&"primary"===o.role&&(1===this.interactiveHandleManager?.handleCount?this._handleCommand({action:"vertex-add"}):this.interactiveHandleManager?.releaseHandle())})):"start"===e.state?await this._updatingHandles.addPromise(o.noteDragStart(n,{...this.movementCommandContext,pointerType:t,pointerId:i}).then(()=>{o&&"touch"===j(e.originalEvent)&&"grabbable-object"!==o.captureMode&&"capture-when-engaged"!==o.defaultCaptureMode&&!o.editSession?.lastPointAddedBySession&&this._handleCommand({action:"vertex-add"})})):await this._updatingHandles.addPromise(o?.moveTo(n,{...this.movementCommandContext,pointerType:t,pointerId:i})):"grabbable-object"===o?.captureMode&&(this.interactiveHandleManager?.releaseHandle(r),await this._updatingHandles.addPromise(o.moveTo(n,{...this.movementCommandContext,pointerType:t,pointerId:i})))}async _handleVertexAddAtPointCommand(e){const t=this._updateLastScreenPosition(e),i=j(e.originalEvent),n=E(e.originalEvent);if(!this.interactiveHandleManager?.shouldCaptureInput(n,i))return;const a=this.interactiveHandleManager?.capturingHandle??this.interactiveHandleManager?.findHandleByManipulator(t,i);this.editable&&a&&(this._before(e)||(G(e),await this._updatingHandles.addPromise(a.moveTo(t,{...this.movementCommandContext,skipSnapping:!0,pointerType:i,pointerId:n}).finally(()=>this._commitNext()))))}_makeKeyBindings(){const e=new W,t=(t,i)=>{e.addToggle(t,e=>this._handleCommand({action:i,originalEvent:e,enabled:"key-down"===e.type}))},i=(t,i)=>{e.add(t,e=>this._handleCommand({action:i,originalEvent:e}))};return t($.preserveAspectRatio,"constraint-aspect"),t(J.center,"constraint-center"),i(X.toggleFollowManipulator,"toggle-manipulator-follow"),i(J.undo,"undo"),i(J.redo,"redo"),i(J.complete,"complete"),i(J.vertexAdd,"vertex-add"),i({key:Y.enterInputMode,continuePropagation:!0,repeats:!0},"show-tooltip"),e}_afterAttach(){}_afterDetach(e){this.interactiveHandleManager?.unregisterCustomConstraint(e),this.interactiveHandleManager?.unregisterHandle(e),this.tooltipManager?.unregisterPluginFields(e),this.globalStateManager.clearPluginOverrides(e);const t=this._pluginContexts.get(e);t&&(t.destroy(),this._pluginContexts.delete(e))}_beforeResume(e,t){this.interactiveHandleManager?.replaceEditSessions(e,t)}_commitNext(){const i={stack:[],error:void 0,hasError:!1};try{const t=this.mostDownstreamPlugin;if(!t)return;this.tooltipManager?.storeConstraintSnapshot();let n=!1;const a=this.editGeometryOperations;e(i,a?s(a.on("vertex-add",()=>n=!0)):null,!1);t.completeStep?t.completeStep():this.complete(t),n&&this.tooltipManager?.unlockOnVertexPlacement()}catch(n){i.error=n,i.hasError=!0}finally{t(i)}}_suspendPlugin(e){this.lifecycleManager.suspend(e),this.measurementManager.suspendPlugin(e)}_resumePlugin(e){this.lifecycleManager.resume(e)}_updateLastScreenPosition(e){const t=f(e.x,e.y);return this.lastScreenPosition=t,t}_getContextForPlugin(e,t){const i=o(this._pluginContexts,e,()=>new D({drawTool:this,plugin:e,session:t}));return i.session=t,i}_before(e){if(!this.hasEventListener(`before-${e.action}`))return!1;const t=new CustomEvent(`before-${e.action}`,{detail:e,cancelable:!0});return this.emit(`before-${e.action}`,t),t.defaultPrevented}_guardCommand(e,t,i){return this._before(e)?i?.():t()}async _setupSegmentLabels(){const e=this.editGeometryOperations,t=this.toolOptions?.labels,i=!!t?.enabled,n=this.globalStateManager.segmentLabelsDisabled;if(!e||!t||!i)return void(this._segmentLabels=l(this._segmentLabels));if(n)return void(this._segmentLabels&&(this._segmentLabels.visible=!1));if(this._segmentLabels?.context?.editGeometryOperations===e&&this._segmentLabels.context.labelOptions===t)return void(this._segmentLabels.visible=!0);const a=await this._createSegmentLabels(e,t);a&&(this._segmentLabels=l(this._segmentLabels),this._segmentLabels=a)}async _createSegmentLabels(e,t){this._segmentLabelsImportTask?.abort();const i=this._segmentLabelsImportTask=n(async i=>{if("3d"===this.view.type){const n=import("../3d/interactive/SegmentLabels3D.js"),{SegmentLabels3D:a}=await this._updatingHandles.addPromise(n);return this._isSegmentLabelsSetupStale(i,e,t)?null:new a({context:{view:this.view,editGeometryOperations:e,elevationInfo:L(this.hasZ,this.elevationInfo),labelOptions:t},visible:!0})}const n=import("../2d/interactive/SegmentLabels2D.js"),{SegmentLabels2D:a}=await this._updatingHandles.addPromise(n);return this._isSegmentLabelsSetupStale(i,e,t)?null:new a({context:{view:this.view,editGeometryOperations:e,elevationInfo:L(this.hasZ,this.elevationInfo),labelOptions:t},visible:!0})});return p(i.promise)}_isSegmentLabelsSetupStale(e,t,i){return e.aborted||this.editGeometryOperations!==t||this.toolOptions?.labels!==i||!i.enabled||this.globalStateManager.segmentLabelsDisabled}};i([_()],ie.prototype,"_commandsSuspended",void 0),i([_()],ie.prototype,"_zOfLastUserInput",null),i([_()],ie.prototype,"_snappingVisualizer",void 0),i([_()],ie.prototype,"_segmentLabels",void 0),i([_()],ie.prototype,"_segmentLabelsImportTask",void 0),i([_()],ie.prototype,"_tooltipDependencies",null),i([_()],ie.prototype,"_editSessionManagerContext",null),i([_()],ie.prototype,"_densificationParameters",null),i([_({constructOnly:!0,nonNullable:!0})],ie.prototype,"view",void 0),i([_()],ie.prototype,"automaticManipulatorSelection",void 0),i([_()],ie.prototype,"updating",null),i([_()],ie.prototype,"coordinateHelper",null),i([_()],ie.prototype,"editGeometry",null),i([_()],ie.prototype,"editGeometryOperations",null),i([_()],ie.prototype,"unprocessedGeometry",null),i([_()],ie.prototype,"simplifiedGeometryPreview",null),i([_()],ie.prototype,"_suppressCoincidentPointOverlaysIn3D",null),i([_()],ie.prototype,"_shapeVisualGeometry",null),i([_()],ie.prototype,"_vertexVisualGeometry",null),i([_()],ie.prototype,"snappingManager",void 0),i([_()],ie.prototype,"toolOptions",void 0),i([_()],ie.prototype,"elevationInfo",void 0),i([_()],ie.prototype,"hasZ",void 0),i([_()],ie.prototype,"defaultZ",void 0),i([_()],ie.prototype,"directionOptions",void 0),i([_()],ie.prototype,"canUndo",null),i([_()],ie.prototype,"canRedo",null),i([_()],ie.prototype,"pluginStack",null),i([_()],ie.prototype,"mostDownstreamPlugin",null),i([_()],ie.prototype,"mostUpstreamPlugin",null),i([_()],ie.prototype,"lastScreenPosition",void 0),i([_()],ie.prototype,"positionOfLastUserInput",null),i([_()],ie.prototype,"tooltipManager",void 0),i([_()],ie.prototype,"measurementManager",void 0),i([_()],ie.prototype,"globalStateManager",void 0),i([_()],ie.prototype,"editSessionManager",void 0),i([_()],ie.prototype,"lifecycleManager",void 0),i([_()],ie.prototype,"surfaceManager",void 0),i([_()],ie.prototype,"interactiveHandleManager",void 0),i([_()],ie.prototype,"renderer",void 0),i([_()],ie.prototype,"readPluginSetting",void 0),i([_()],ie.prototype,"movementCommandContext",null),i([_()],ie.prototype,"tooltip",null),i([_()],ie.prototype,"activeTooltipInfo",null),i([_()],ie.prototype,"helpMessageKey",null),i([_({constructOnly:!0})],ie.prototype,"enableVertexVisuals",void 0),ie=i([b("esri.views.draw.DrawTool")],ie);export{ie as DrawTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{isSome as t,equals as e}from"../../../core/arrayUtils.js";import{clone as o}from"../../../core/lang.js";import{getMetersPerUnitForSR as r}from"../../../core/units.js";import{lerp as n}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import l from"../../../geometry/Circle.js";import s from"../../../geometry/Multipoint.js";import i from"../../../geometry/Point.js";import c from"../../../geometry/Polygon.js";import p from"../../../geometry/Polyline.js";import{
|
|
2
|
+
import{isSome as t,equals as e}from"../../../core/arrayUtils.js";import{clone as o}from"../../../core/lang.js";import{getMetersPerUnitForSR as r}from"../../../core/units.js";import{lerp as n}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import l from"../../../geometry/Circle.js";import s from"../../../geometry/Multipoint.js";import i from"../../../geometry/Point.js";import c from"../../../geometry/Polygon.js";import p from"../../../geometry/Polyline.js";import{distanceExecute as y}from"../../../geometry/operators/distanceOperator.js";import{simplifyIsSimple as m,simplifyExecute as u}from"../../../geometry/operators/simplifyOperator.js";import{isClockwise as f}from"../../../geometry/support/coordsUtils.js";import{isValid as x}from"../../../geometry/support/spatialReferenceUtils.js";import{makeSurfacePoint as h}from"./surfaceCoordinateSystems.js";import{unnormalize as M}from"../../support/unnormalizationUtils.js";function g(t,e){const o=new i({x:t[0],y:t[1],spatialReference:e});return t.length>2&&(o.z=t[2]),o}function d(t,e){return new s({points:t,spatialReference:e})}function R(t,e,o){const r=new p({paths:t,spatialReference:e});return o&&M(r,r.spatialReference),r}function j(t,r,n,a=!0){const l=o(t);l.forEach(t=>{const o=t[0],r=t[t.length-1];e(o,r)&&1!==t.length||t.push(t[0])});let s=new c({rings:l,spatialReference:r});return s.rings.forEach(t=>{f(t)||t.reverse()}),n&&M(s,s.spatialReference),a&&!m(s)&&x(r)&&(s=u(s)||s),s}function T(e,o,r){const n=o.mapToLocalMultiple(e),a=[],l={x:n[0].x,y:n[0].y},s={x:n[1].x,y:n[1].y},i=Math.round(s.x-l.x),c=Math.round(s.y-l.y),p=Math.max(Math.abs(i),Math.abs(c));if(r){const t={x:l.x+p,y:l.y+p},e={x:l.x-p,y:l.y-p};a.push(h(t.x,e.y),h(e.x,e.y),h(e.x,t.y),h(t.x,t.y))}else{const t={x:i>0?l.x+p:l.x-p,y:c>0?l.y+p:l.y-p};a.push(h(l.x,l.y),h(t.x,l.y),h(t.x,t.y),h(l.x,t.y))}return U(j([a.map(t=>o.localToMap(t)).filter(t)],o.spatialReference,o.doUnnormalization,!0),a,o)}function b(e,o,r){let n=o.mapToLocalMultiple(e);if(1===n.length){const t=48,e=n[0];n=[h(e.x-t,e.y+t),h(e.x+t,e.y-t),h(e.x+t,e.y-t),h(e.x-t,e.y+t)]}const a=[],l={x:n[0].x,y:n[0].y},s={x:n[1].x,y:n[1].y};if(r){const t=Math.round(s.x-l.x),e=Math.round(s.y-l.y);a.push(h(l.x-t,l.y-e),h(s.x,l.y-e),h(s.x,s.y),h(l.x-t,s.y))}else a.push(h(l.x,l.y),h(s.x,l.y),h(s.x,s.y),h(l.x,s.y));return U(j([a.map(t=>o.localToMap(t)).filter(t)],o.spatialReference,o.doUnnormalization,!0),a,o)}function U(t,e,o){const r=z(e[3],e[2],o),n=z(e[1],e[2],o),a=z(e[0],e[1],o),l=z(e[0],e[3],o);return{geometry:t,midpoints:null!=r&&null!=n&&null!=a&&null!=l?{top:r,right:n,bottom:a,left:l}:null}}function z(t,e,o){w[0]=t.x,w[1]=t.y,w[2]=0,I[0]=e.x,I[1]=e.y,I[2]=0,n(w,w,I,.5),P.x=w[0],P.y=I[1],P.z=I[2];const r=o.localToMap(P);return null!=r?g(r,o.spatialReference):null}const P=h(0,0,0),w=a(),I=a();function L(t,e,o,n){const a=e.mapToLocalMultiple(t);let s=null,i=null;if(o)s=a[0],i=a[1];else{const t=a[0],e=a[1],o=Math.round(e.x-t.x),r=Math.round(e.y-t.y),n=Math.max(Math.abs(o),Math.abs(r));s=h(o>0?t.x+n/2:t.x-n/2,r>0?t.y+n/2:t.y-n/2),i=h(Math.abs(o)>Math.abs(r)?s.x-n/2:s.x,Math.abs(o)>Math.abs(r)?s.y:s.y-n/2)}const c=e.localToMap(s),p=e.localToMap(i);if(null==c||null==p)return null;e.doUnnormalization&&M([[c,p]],e.spatialReference);const m=g(c,e.spatialReference),u=g(p,e.spatialReference),f=r(e.spatialReference);let d=0;if(x(e.spatialReference))d=f*y(m,u);else{const t=s.x-i.x,e=s.y-i.y;d=f*Math.sqrt(t*t+e*e)*(n||1)}const R=new l({center:m,radius:d,radiusUnit:"meters",spatialReference:e.spatialReference});return{geometry:j(R.rings,R.spatialReference,!1),center:m,edge:u}}function v(e,o,r){const n=o.mapToLocalMultiple(e),a=n[0],l=n[1],s=Math.round(l.x-a.x),i=Math.round(l.y-a.y),c=h(r?a.x:a.x+s/2,r?a.y:a.y+i/2),p=r?s:s/2,y=r?i:i/2,m=60,u=[],f=2*Math.PI/m;function x(t){const e=Math.cos(t),o=Math.sin(t);return h(p*e+c.x,y*o+c.y)}for(let t=0;t<m;t++)u.push(x(t*f));u.push(u[0]);const{spatialReference:M,doUnnormalization:d}=o,R=j([u.map(t=>o.localToMap(t)).filter(t)],M,d,!1),T=o.localToMap(x(Math.PI/2)),b=o.localToMap(x(0)),U=o.localToMap(x(-Math.PI/2)),z=o.localToMap(x(Math.PI));return{geometry:R,midpoints:null!=T&&null!=b&&null!=U&&null!=z?{top:g(T,M),right:g(b,M),bottom:g(U,M),left:g(z,M)}:null}}export{L as createCircle,v as createEllipse,d as createMultipoint,g as createPoint,j as createPolygon,R as createPolyline,b as createRectangle,T as createSquare};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{isSome as t}from"../../core/arrayUtils.js";import r from"../../core/Logger.js";import{abortMaybe as o}from"../../core/maybe.js";import{unwrapUpdating as i,updating as n,isUpdating as l}from"../../core/maybeUpdating.js";import{throwIfAbortError as s,throwIfNotAbortError as a}from"../../core/promiseUtils.js";import{whenOnce as m}from"../../core/reactiveUtils.js";import{property as p,subclass as y}from"../../core/accessorSupport/decorators.js";import{project as u,canProjectWithoutEngine as c,isLoaded as g,load as d}from"../../geometry/projectionUtils.js";import h from"../../layers/support/FeatureFilter.js";import{SceneLayerViewFilter as f}from"../../layers/support/SceneLayerViewFilter.js";import w from"./LayerView.js";let x=class extends w{constructor(e){super(e),this.layer=null,this.filter=null,this._geometryOperators=null,this._projectionEngineLoaded=!1,this._abortController=new AbortController}get availableFields(){return[]}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){throw new Error("Not implemented")}get maximumNumberOfFeaturesExceeded(){return!1}get layerFilter(){return i(this._layerFilter)}get _layerFilter(){const e=this.layer?.filter;if(null==e||e.geometries.length<1)return null;if(!this._geometryOperators||!this._projectionEngineLoaded&&this._filterNeedsProjectionEngine)return n;const[o,i,l]=this._geometryOperators,s=e.geometries.at(0).spatialReference,a=e.geometries.toArray().map(e=>{let t;try{t=i.
|
|
2
|
+
import{__decorate as e}from"tslib";import{isSome as t}from"../../core/arrayUtils.js";import r from"../../core/Logger.js";import{abortMaybe as o}from"../../core/maybe.js";import{unwrapUpdating as i,updating as n,isUpdating as l}from"../../core/maybeUpdating.js";import{throwIfAbortError as s,throwIfNotAbortError as a}from"../../core/promiseUtils.js";import{whenOnce as m}from"../../core/reactiveUtils.js";import{property as p,subclass as y}from"../../core/accessorSupport/decorators.js";import{project as u,canProjectWithoutEngine as c,isLoaded as g,load as d}from"../../geometry/projectionUtils.js";import h from"../../layers/support/FeatureFilter.js";import{SceneLayerViewFilter as f}from"../../layers/support/SceneLayerViewFilter.js";import w from"./LayerView.js";let x=class extends w{constructor(e){super(e),this.layer=null,this.filter=null,this._geometryOperators=null,this._projectionEngineLoaded=!1,this._abortController=new AbortController}get availableFields(){return[]}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){throw new Error("Not implemented")}get maximumNumberOfFeaturesExceeded(){return!1}get layerFilter(){return i(this._layerFilter)}get _layerFilter(){const e=this.layer?.filter;if(null==e||e.geometries.length<1)return null;if(!this._geometryOperators||!this._projectionEngineLoaded&&this._filterNeedsProjectionEngine)return n;const[o,i,l]=this._geometryOperators,s=e.geometries.at(0).spatialReference,a=e.geometries.toArray().map(e=>{let t;try{t=i.simplifyExecute(e)}catch(o){return r.getLogger(this).warnOncePerTick("Failed to simplify scene filter mask polygon. Polygon will be ignored."),null}if(!t)return null;if(t.spatialReference.equals(s))return t;try{return u(t,s)}catch(o){return r.getLogger(this).warnOncePerTick("Failed to project scene filter mask polygon. Polygon will be ignored."),null}}).filter(t).sort((e,t)=>e.extent.xmin-t.extent.xmin),m=new Set,p=new Array,y=new Array;for(let t of a){const e=t.extent.xmin;if(p.length=0,m.forEach(r=>{if(e>=r.extent.xmax)return y.push(r),void m.delete(r);t.extent.ymin<=r.extent.ymax&&t.extent.ymax>=r.extent.ymin&&o.intersectsExecute(t,r)&&p.push(r)}),p.length>0){let e;p.push(t);try{e=l.unionExecuteMany(p)}catch(c){r.getLogger(this).warnOncePerTick("Failed to unify filter mask polygons. Polygon will be ignored.");continue}p.pop(),e&&(p.forEach(e=>m.delete(e)),t=e)}m.add(t)}return m.forEach(e=>y.push(e)),y.length>0?new f(y,e.spatialRelationship):null}get _filterNeedsProjectionEngine(){const e=this.layer.filter;if(null==e||e.geometries.length<=1)return!1;const t=e.geometries.at(0).spatialReference;return e.geometries.some(({spatialReference:e})=>!e.equals(t)&&!c(e,t))}get layerFilterUpdating(){return l(this._layerFilter)}initialize(){const{signal:e}=this._abortController;m(()=>this.destroyed||!this._geometryOperators&&this.layer?.filter?.geometries?.length,e).then(async()=>{s(e),this._geometryOperators=await Promise.all([import("../../geometry/operators/intersectsOperator.js"),import("../../geometry/operators/simplifyOperator.js"),import("../../geometry/operators/unionOperator.js")])}).catch(a),this._projectionEngineLoaded=g(),m(()=>this.destroyed||!this._projectionEngineLoaded&&this._filterNeedsProjectionEngine,e).then(async()=>{s(e),await d(),this._projectionEngineLoaded=!0}).catch(a)}destroy(){this._abortController=o(this._abortController)}highlight(e,t){throw new Error("Not implemented")}queryFeatures(e,t){throw new Error("Not implemented")}queryObjectIds(e,t){throw new Error("Not implemented")}queryFeatureCount(e,t){throw new Error("Not implemented")}createQuery(){throw new Error("Not implemented")}queryExtent(e,t){throw new Error("Not implemented")}};e([p()],x.prototype,"layer",void 0),e([p()],x.prototype,"availableFields",null),e([p()],x.prototype,"maximumNumberOfFeatures",null),e([p({readOnly:!0})],x.prototype,"maximumNumberOfFeaturesExceeded",null),e([p({type:h})],x.prototype,"filter",void 0),e([p({readOnly:!0})],x.prototype,"layerFilter",null),e([p({readOnly:!0})],x.prototype,"_layerFilter",null),e([p()],x.prototype,"_geometryOperators",void 0),e([p()],x.prototype,"_projectionEngineLoaded",void 0),e([p()],x.prototype,"_filterNeedsProjectionEngine",null),e([p()],x.prototype,"layerFilterUpdating",null),x=e([y("esri.views.layers.SceneLayerView")],x);const j=x;export{j as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{max as
|
|
2
|
+
import{max as t,createLength as e,createArea as o}from"../../core/quantity.js";import{deriveLengthUnitFromAreaUnit as r}from"../../core/units.js";import{set as n,scale as i,normalize as s,cross as a,subtract as m,dot as c,add as f}from"../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isEarth as u,isSphericalECEF as l}from"../../geometry/ellipsoidUtils.js";import g from"../../geometry/Multipoint.js";import y from"../../geometry/Point.js";import O from"../../geometry/Polygon.js";import S from"../../geometry/Polyline.js";import{projectWithoutEngine as J}from"../../geometry/projectionUtils.js";import N from"../../geometry/SpatialReference.js";import{WGS84ECEFSpatialReference as h,getSphericalPCPF as d,SphericalECEFSpatialReference as j}from"../../geometry/spatialReferenceEllipsoidUtils.js";import{areaExecute as R}from"../../geometry/operators/areaOperator.js";import{centroidExecute as w}from"../../geometry/operators/centroidOperator.js";import{distanceExecute as v}from"../../geometry/operators/distanceOperator.js";import{geodeticAreaLoad as P,geodeticAreaExecute as U}from"../../geometry/operators/geodeticAreaOperator.js";import{geodeticDistanceLoad as L,geodeticDistanceExecute as M}from"../../geometry/operators/geodeticDistanceOperator.js";import{geodeticLengthLoad as b,geodeticLengthExecute as x}from"../../geometry/operators/geodeticLengthOperator.js";import{lengthExecute as k}from"../../geometry/operators/lengthOperator.js";import{simplifyExecute as C}from"../../geometry/operators/simplifyOperator.js";import{projectDirection as E}from"../../geometry/projection/projectDirection.js";import{fromJSON as q}from"../../geometry/support/jsonUtils.js";import{isWGS84 as z,isWebMercator as Z,isCGCS2000 as D,equals as W}from"../../geometry/support/spatialReferenceUtils.js";import{makeOrthonormal as $}from"../3d/support/mathUtils.js";import{autoMeasurementMode as A}from"./measurementWorkerUtils.js";async function I({geometryJSON:t,options:e}){await Promise.allSettled([P(),e?.returnLength?b():void 0]);const n=F(t,e),i=e?.unit??"square-meters",s=C(n)??n,a=U(s,{unit:i,...e}),m=o(a,i),c=e?.lengthUnit??r(i);return{area:m,centroid:e?.returnCentroid?G(s).toJSON():void 0,length:e?.returnLength?await H(s,{unit:c}):void 0}}function B(){P(),b(),L()}function F(t,e){const o="rings"in t?O.fromJSON(t):S.fromJSON(t);if(e?.stagedPoint){const t=y.fromJSON(e.stagedPoint),r=("rings"in o?o.rings:o.paths).at(-1);if(r){const{x:e,y:n,z:i,m:s}=t,a=o.hasZ&&o.hasM?[e,n,i??0,s??0]:o.hasZ?[e,n,i??0]:o.hasM?[e,n,s??0]:[e,n];r.push(a)}}return o}function G(t){return w(t)}async function H(t,o){await b();const r=o?.unit??"meters";return e(x(t,{...o,unit:r}),r)}function K({geometryJSON:t,options:e}){return H(F(t,e),e)}async function Q({geometry1JSON:t,geometry2JSON:o,options:r}){await L();const n=y.fromJSON(t),i=y.fromJSON(o),s=r?.unit??"meters";return e(M(n,i,{...r,unit:s}),s)}async function T({geometry1JSON:t,geometry2JSON:o,options:r}){await L();const n=g.fromJSON(t),i=g.fromJSON(o);if(n.points.length!==i.points.length)throw new Error("Input multipoints must have the same number of points.");const s=n.points.length,a=r?.unit??"meters",m=[],c={...r,unit:a};for(let f=0;f<s;f++){const t=n.getPoint(f),o=i.getPoint(f);m.push(null!=t&&null!=o?e(M(t,o,c),a):null)}return m}function V({geometryJSON:t,options:e}){return X(F(t,e),e)}function X(t,e){const n=e?.unit??"square-meters",i=e?.lengthUnit??r(n),s=C(t)??t,a=R(s,{unit:n,...e});return{area:o(a,n),centroid:e?.returnCentroid?G(s).toJSON():void 0,length:e?.returnLength?Y(s,{unit:i}):void 0}}function Y(t,o){const r=o?.unit??"meters";return e(k(t,{...o,unit:r}),r)}function _({geometryJSON:t,options:e}){return Y(F(t,e),e)}function tt({geometry1JSON:t,geometry2JSON:o,options:r}){const n=y.fromJSON(t),i=y.fromJSON(o),s=r?.unit??"meters";return e(v(n,i,{...r,unit:s}),s)}async function et(t){return it(t.geometryJSON.spatialReference,I,V)(t)}async function ot(t){return it(t.geometryJSON.spatialReference,K,_)(t)}async function rt(t){return it(t.geometry1JSON.spatialReference,Q,tt)(t)}async function nt(e){const o=it(e.topLeftJSON.spatialReference,Q,tt),{topLeftJSON:r,topRightJSON:n,bottomRightJSON:i,bottomLeftJSON:s,options:a}=e,[m,c,f,p]=await Promise.all([o({geometry1JSON:s,geometry2JSON:i,options:a}),o({geometry1JSON:r,geometry2JSON:n,options:a}),o({geometry1JSON:i,geometry2JSON:n,options:a}),o({geometry1JSON:s,geometry2JSON:r,options:a})]);return{width:t(m,c),height:t(p,f)}}function it(t,e,o){switch(A(t)){case 0:return e;case 1:return o}}function st(t){const{geometryJSON:e}=t,o=pt(e.spatialReference);if(!o)throw new Error("Cannot compute horizontal area without a valid spatial reference.");switch(o.mode){case 0:return V(t);case 1:return mt(o,t)}}function at({geometryJSON:t}){const e=q(t);if(!e)return null;const o=C(e);return o?o.toJSON():null}function mt(t,{geometryJSON:e,options:o}){const r=F(e,o),n=gt,i=ut,s=lt,a=W(r.spatialReference,t.spatialReference)?r.clone():J(r,r.spatialReference,t.spatialReference);if(!a)throw new Error(`Cannot project geometry from ${r.spatialReference?.wkid??"unknown"} to ${t.spatialReference.wkid}.`);ft(a,n,i,s);const{area:m,centroid:c,length:f}=X(a,o);return{area:m,centroid:ct(c,n,i,s,t.spatialReference,r.spatialReference),length:f}}function ct(t,e,o,r,n,s){if(!t)return t;i(o,o,t.x),i(r,r,t.y);const a=yt;return f(a,o,r),f(a,a,e),t.x=a[0],t.y=a[1],t.z=a[2],t.spatialReference=n,J(t,t.spatialReference,s)?.toJSON()??void 0}function ft(t,e,o,r){let f=0;n(e,0,0,0);for(const n of t.rings)for(const t of n)e[0]+=t[0],e[1]+=t[1],e[2]+=t[2],f++;i(e,e,1/f);const p=Ot;s(p,e);const u=St,l=Math.atan2(p[1],p[0]);n(u,-Math.sin(l),Math.cos(l),0),W(t.spatialReference,h)&&(E(e,p,j,p,t.spatialReference),E(e,u,j,u,t.spatialReference)),$(u,p,o),a(r,o,p);const g=yt;for(const i of t.rings)for(const t of i){n(g,t[0],t[1],t[2]),m(g,g,e);const i=c(o,g),s=c(r,g);t[0]=i,t[1]=s}t.hasZ=!1,t.spatialReference=N.WebMercator}function pt(t){return t?u(t)?z(t)||Z(t)||D(t)||l(t)||W(t,h)?{mode:1,spatialReference:h}:{mode:0,spatialReference:t}:{mode:1,spatialReference:d(t)}:null}const ut=p(),lt=p(),gt=p(),yt=p(),Ot=p(),St=p();export{V as area2D,st as areaHorizontal,et as autoArea2D,rt as autoDistance2DBetweenPoints,ot as autoLength2D,nt as autoSize2D,tt as distance2DBetweenPoints,I as geodeticArea,Q as geodeticDistanceBetweenPoints,T as geodeticDistanceBetweenPointsMany,K as geodeticLength,_ as length2D,B as preloadGeodetic,at as simplify};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../request.js";import t from"../../geometry/Point.js";import{
|
|
2
|
+
import e from"../../request.js";import t from"../../geometry/Point.js";import{projectExecute as r}from"../../geometry/operators/projectOperator.js";import{projectResolution as i,getProjectionOffsetGrid as n,load as s}from"../../layers/raster/functions/rasterProjectionHelper.js";import{isImageSource as a,rasterize as o}from"../2d/engine/Bitmap.js";import{RenderingDevice as c}from"../2d/engine/webgl/RenderingDevice.js";import{SimpleMesh as p}from"../2d/engine/webgl/meshing/SimpleMesh.js";import{ReprojectShader as h}from"../2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ReprojectShader.js";import{PixelType as m}from"../webgl/enums.js";import{DisposableFramebufferObject as x}from"../webgl/FramebufferObject.js";import{createTransformTexture as d}from"../webgl/rasterUtils.js";import{RenderingContext as u}from"../webgl/RenderingContext.js";import{RenderingContextOptions as g}from"../webgl/RenderingContextOptions.js";import l from"../webgl/Texture.js";import{TextureDescriptor as f}from"../webgl/TextureDescriptor.js";const w={color:{blendMode:"none",write:[!0,!0,!0,!0]},depth:!1,stencil:!1};class _{static{this._instanceRefCount=0}constructor(e){if(this._ownsRctx=!1,e)this._ownsRctx=!1,this._rctx=e;else{if(_._instance)return _._instanceRefCount++,_._instance;_._instanceRefCount=1,_._instance=this,this._ownsRctx=!0;const e=document.createElement("canvas").getContext("webgl2");e.getExtension("OES_texture_float"),this._rctx=new u(e,new g)}this._renderingDevice=new c,this._renderingDevice.setPipelineState(w),this._shader=new h,this._quad=p.fromVertexStream(this._rctx,[0,0,1,0,0,1,1,1])}reprojectTexture(e,s,a=!1){const o=r(e.extent,s),c=new t({x:(e.extent.xmax-e.extent.xmin)/e.texture.descriptor.width,y:(e.extent.ymax-e.extent.ymin)/e.texture.descriptor.height,spatialReference:e.extent.spatialReference}),{x:p,y:h}=i(c,s,e.extent);let u=(p+h)/2;const g=Math.round((o.xmax-o.xmin)/u),l=Math.round((o.ymax-o.ymin)/u);u=(o.width/g+o.height/l)/2;const w=new t({x:u,y:u,spatialReference:o.spatialReference}),_=n({projectedExtent:o,srcBufferExtent:e.extent,pixelSize:w,hasWrapAround:!0,spacing:[16,16]}),b=d(this._rctx,_),j=new f(g,l);j.wrapMode=33071;const D=new x(this._rctx,j);if(this._rctx.bindFramebuffer(D),this._rctx.setViewport(0,0,g,l),this._drawReprojectedTexture(e.texture,b,{targetImageSize:[g,l],transformSpacing:_.spacing,transformGridSize:_.size}),this._rctx.useProgram(null),this._rctx.bindFramebuffer(null),b.dispose(),a){const{width:e,height:t}=D,r=new ImageData(e??0,t??0);D.readPixels(0,0,e??0,t??0,6408,m.UNSIGNED_BYTE,r.data);const i=D.detachColorTexture();return D.dispose(),{texture:i,extent:o,imageData:r}}const R=D.detachColorTexture();return D.dispose(),{texture:R,extent:o}}reprojectBitmapData(e,t){const r=a(e.bitmapData)?o(e.bitmapData):e.bitmapData,i=new f(e.bitmapData.width,e.bitmapData.height);i.wrapMode=33071;const n=new l(this._rctx,i,r),s=this.reprojectTexture({texture:n,extent:e.extent},t,!0);s.texture.dispose();const c=document.createElement("canvas"),p=s.imageData;c.width=p.width,c.height=p.height;return c.getContext("2d").putImageData(p,0,0),{bitmapData:c,extent:s.extent}}async loadAndReprojectBitmapData(t,r,i){const[n]=await Promise.all([e(t,{responseType:"image"}).then(e=>e.data),s()]),a=document.createElement("canvas");a.width=n.width,a.height=n.height;const o=a.getContext("2d");o.drawImage(n,0,0);const c=o.getImageData(0,0,a.width,a.height);if(r.spatialReference.equals(i))return{bitmapData:c,extent:r};const p=this.reprojectBitmapData({bitmapData:c,extent:r},i);return{bitmapData:p.bitmapData,extent:p.extent}}_drawReprojectedTexture(e,t,r){const{width:i=0,height:n=0}=e.descriptor,s={coordScale:[1,1],srcImageSize:[i,n],opacity:1},a={texture:{texture:e,unit:0},projectionTextures:{transformTexture:{texture:t,unit:1}},pixelMaskTexture:null,highlightTexture:null},o={shader:this._shader,uniforms:{config:s,projectionConfig:r},textures:a,defines:{applyProjection:!0,lookupProjection:1===r.transformSpacing[0],bilinear:!1,bicubic:!1,nearestOnEdge:!1,applyPixelMask:!1,applyPixelHighlights:!1},optionalAttributes:{},useComputeBuffer:!1};this._renderingDevice.setPipelineStateNeedsUpdate(!0),this._renderingDevice.submitDrawMesh(this._rctx,o,this._quad)}destroy(){this._ownsRctx?(_._instanceRefCount--,0===_._instanceRefCount&&(this._destroyWebGLResource(),this._rctx.dispose(),_._instance=null)):this._destroyWebGLResource()}_destroyWebGLResource(){this._quad.destroy(),this._renderingDevice.dispose()}}export{_ as ImageReprojector};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../Viewpoint.js";import i from"../../core/CollectionFlattener.js";import{destroyMaybe as s}from"../../core/maybe.js";import{whenOnce as r,watch as o,syncAndInitial as a}from"../../core/reactiveUtils.js";import{property as n,subclass as l}from"../../core/accessorSupport/decorators.js";import{initialize as p}from"../../core/workers/workers.js";import{isLoadedOrLoadFor as h}from"../../geometry/projectionUtils.js";import{
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../Viewpoint.js";import i from"../../core/CollectionFlattener.js";import{destroyMaybe as s}from"../../core/maybe.js";import{whenOnce as r,watch as o,syncAndInitial as a}from"../../core/reactiveUtils.js";import{property as n,subclass as l}from"../../core/accessorSupport/decorators.js";import{initialize as p}from"../../core/workers/workers.js";import{isLoadedOrLoadFor as h}from"../../geometry/projectionUtils.js";import{projectLoad as d}from"../../geometry/operators/projectOperator.js";import g from"../../layers/support/TileInfo.js";import{computeVideoToMapBaricentric as m}from"../../layers/video/videoUtils.js";import c from"../View.js";import{Viewport2DBaseMixin as u}from"../Viewport2DBaseMixin.js";import w from"../2d/AnimationManager.js";import{GoToManager as y}from"../2d/GoToManager.js";import{layerView2DImporter as f}from"../2d/layerViewModuleImportUtils.js";import V from"../2d/tiling/TileInfoView.js";import"../2d/tiling/TileKey.js";import"../2d/tiling/TileQueue.js";import"../2d/tiling/TileStrategy.js";import{extentToScale as v}from"../2d/viewpointUtils.js";import T from"../2d/layers/features/support/TileStore.js";import{hitTest as j}from"../2d/support/hitTestUtils.js";import{Timeline as M}from"../2d/support/Timeline.js";let _,S,C;async function R(){const[,{GraphicsView2D:t,GraphicContainer:e,MapViewNavigation:i}]=await Promise.all([import("../2d/webglDeps.js"),import("../2d/mapViewDeps.js"),d()]);_=t,S=e,C=i}let b=class extends(u(c)){constructor(t){super(t),this.stage=null,this.rootLayerViews=new i({getCollections:()=>[this.layerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.graphicsView=null,this.timeline=new M,this.goToManager=new y({view:this}),this.map=null,this.surface=null,this.padding={top:0,right:0,bottom:0,left:0},p(),this._groundControlPoints=t?.groundControlPoints.bind(this),this._getVideoResolution=t?.getVideoResolution.bind(this),this._getSize=t?.getSize.bind(this)}initialize(){this.addResolvingPromise(r(()=>this.ready))}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=s(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy()}get graphicsTileStore(){return new T(this.featuresTilingScheme)}get typeSpecificPreconditionsReady(){const t=this._getDefaultViewpoint();if(!t)return!1;const e=t.targetGeometry,i=this.spatialReference;return h(e.spatialReference,i)}videoToMap(t){const e=this._groundControlPoints?.();if(!e)return null;const i=this._getVideoResolution?.(),s=this._getSize?.();if(!i||!s||0===i[1]||0===s[1])return null;const r=i[0]/s[0],o=i[1]/s[1];return t.x*=r,t.y*=-o,m(t,e,this.state.spatialReference)}async hitTest(t,e){return j(this,t,e)}goTo(t,e){return this.goToManager.goTo(t,e)}toMap(t){return this.stateManager.toMap(t)}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}loadAsyncDependencies(){return R()}hasLayerViewModule(t){return f.hasLayerViewModule(t)}importLayerView(t){return f.importLayerView(t)}_getDefaultViewpoint(){const{constraints:t,initialExtent:i,map:s,padding:r,size:o}=this;if(!t)return null;const a=s&&"initialViewProperties"in s?s.initialViewProperties:void 0,n=this.stateManager.getUserStartupOptions(this.size),l=a?.viewpoint,p=l?.targetGeometry?.extent??i,h=p?.center,d=l?.rotation??0,g=l?.scale||p&&v(p,[o[0]-r.left-r.right,o[1]-r.top-r.bottom]),m=n.center??h,c=n.rotation??d,u=n.scale??g;return m&&u?new e({targetGeometry:m,scale:u,rotation:c}):null}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach(t=>{this.stage.addChild(t.container)});const t=this.graphicsView;this.stage.addChild(t.container)}_startup(){this.timeline.begin("VideoOperationalDataView Startup");const t=this._getDefaultViewpoint();this.stateManager.startup(t,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;const e=new w({view:this});this._set("animationManager",e);const i=new C({view:this,animationManager:e});this._set("mapViewNavigation",i);const s=new V(g.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",s),this.stage.labelManager.featuresTilingScheme=s;const r=new _({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new S(s)});this._set("graphicsView",r),this.addHandles([this.rootLayerViews.on("change",()=>this._updateStageChildren()),this.stage.on("webgl-error",t=>this.fatalError=t.error),o(()=>this.stationary,t=>this.stage.stationary=t,a),o(()=>this.state.id,()=>this.stage.state=this.state,a)],"video-graphics-view"),this._updateStageChildren(),this.timeline.end("VideoOperationalDataView Startup"),this.frameTask.start(),this.stage.viewIsReady=!0,this._set("ready",!0)}_teardown(){this.removeHandles("video-graphics-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.stage.destroy(),this.stage=null;const t=this.graphicsView;this._set("graphicsView",null),t.destroy(),this._set("featuresTilingScheme",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}};t([n()],b.prototype,"stage",void 0),t([n({readOnly:!0})],b.prototype,"featuresTilingScheme",void 0),t([n({readOnly:!0})],b.prototype,"graphicsTileStore",null),t([n()],b.prototype,"graphicsView",void 0),t([n({type:M,readOnly:!0})],b.prototype,"timeline",void 0),t([n()],b.prototype,"goToManager",void 0),t([n()],b.prototype,"map",void 0),t([n({readOnly:!0})],b.prototype,"typeSpecificPreconditionsReady",null),t([n({readOnly:!0})],b.prototype,"surface",void 0),b=t([l("esri.views.video.VideoOperationalDataView")],b);const D=b;export{D as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{fetchMessageBundle as r,onLocaleChange as i}from"../../intl.js";import{multiplyOpacity as s,getContrast as a}from"../../core/colorUtils.js";import{destroyMaybe as o}from"../../core/maybe.js";import{watch as n,initial as m}from"../../core/reactiveUtils.js";import{formatDecimal as l,formatImperialArea as p,formatMetricArea as c,formatImperialLength as u,formatMetricLength as h}from"../../core/unitFormatUtils.js";import{convertUnit as d,deriveLengthUnitFromAreaUnit as y}from"../../core/units.js";import{property as v,subclass as g}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import{isSupported as _,geodesicDensify as w,geodesicLengths as b,geodesicAreas as L}from"../../geometry/geodesicUtils.js";import j from"../../geometry/Point.js";import S from"../../geometry/Polygon.js";import x from"../../geometry/Polyline.js";import{execute as A}from"../../geometry/operators/areaOperator.js";import{execute as G,load as M}from"../../geometry/operators/geodeticAreaOperator.js";import{execute as k,load as O}from"../../geometry/operators/geodeticDensifyOperator.js";import{execute as C,load as H}from"../../geometry/operators/geodeticLengthOperator.js";import{execute as R}from"../../geometry/operators/lengthOperator.js";import{execute as T}from"../../geometry/operators/simplifyOperator.js";import{polygonCentroidPoint as U}from"../../geometry/support/centroid.js";import q from"../../layers/GraphicsLayer.js";import z from"../../symbols/Font.js";import D from"../../symbols/SimpleFillSymbol.js";import P from"../../symbols/SimpleLineSymbol.js";import E from"../../symbols/SimpleMarkerSymbol.js";import V from"../../symbols/TextSymbol.js";import{SnappingVisualizer2D as F}from"../../views/2d/interactive/SnappingVisualizer2D.js";import W from"../../views/draw/Draw.js";import{createCoordinateHelper as I}from"../../views/interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as B,screenToMap as J,dragManipulatedObject as N}from"../../views/interactive/dragEventPipeline.js";import{GraphicManipulator as K}from"../../views/interactive/GraphicManipulator.js";import{InteractiveToolBase as Q}from"../../views/interactive/InteractiveToolBase.js";import{EditGeometry as X}from"../../views/interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as Y}from"../../views/interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as Z}from"../../views/interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as $}from"../../views/interactive/snapping/SnappingDragPipelineStep.js";import{setupSnappingToggleHandles as ee}from"../../views/interactive/snapping/snappingUtils.js";const te=1e5;let re=class extends Q{constructor(e){super(e),this._measurementLayer=new q({internal:!0,listMode:"hide",visible:!1,title:"Area measurement layer"}),this._manipulatorLayer=new q({internal:!0,listMode:"hide",visible:!1,title:"Area measurement manipulator layer"}),this._snappingLayer=new q({internal:!0,listMode:"hide",visible:!1,title:"Area measurement snapping layer"}),this._updatingHandles=new f,this._vertices=[],this._drawActive=!1,this.measurement=null,this.measurementLabel=null}initialize(){r("esri/core/t9n/Units").then(e=>{this.messages=e});const e=this.view;this._draw=new W({view:e}),e.map.addMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),e.focus(),this.addHandles([i(async()=>{this.messages=await r("esri/core/t9n/Units")}),n(()=>[this.unit,this.messages],()=>{this._updateGraphics()},m),n(()=>[this.view.effectiveTheme.accentColor,this.view.effectiveTheme.textColor],()=>{if(!this._vertices.length)return;const e=this._vertices.map(({coord:e})=>e);for(const{handle:t}of this._vertices)t.remove();this._vertices=[],this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this.manipulators.removeAll(),this._updateSketch(e)})]),ee(this)}destroy(){const{map:e}=this.view;this._draw.view=null,this._draw=o(this._draw),e.removeMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._measurementLayer=o(this._measurementLayer),this._manipulatorLayer=o(this._manipulatorLayer),this._snappingLayer=o(this._snappingLayer),this._updatingHandles=o(this._updatingHandles),this._resetVertices()}get cursor(){return this._drawActive?"crosshair":null}set editable(e){this._set("editable",e),e||this._draw.reset()}get snappingOptions(){return this.snappingManager.options}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}onActivate(){this._drawActive||0!==this._vertices.length||this._startSketch()}onShow(){this._measurementLayer.visible=!0,this._manipulatorLayer.visible=!0,this._snappingLayer.visible=!0}onHide(){this._measurementLayer.visible=!1,this._manipulatorLayer.visible=!1,this._snappingLayer.visible=!1}reset(){this.manipulators.removeAll(),this._resetVertices(),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._draw.reset(),this._drawActive=!1}_getSnappingContext(e){return new Z({elevationInfo:{mode:"on-the-ground",offset:0},pointer:e,editGeometryOperations:new Y(new X("point",I(!1,!1,this.view.spatialReference)),2),visualizer:new F(this._snappingLayer)})}_resetVertices(){for(const{handle:e}of this._vertices)e.remove();this._vertices=[]}_startSketch(){this._drawActive=!0;const{snappingManager:e}=this;this._draw.create("polyline",{mode:"click",snappingManager:e}).on(["draw-complete","vertex-add","vertex-update","vertex-remove","cursor-update","undo","redo"],e=>{this._updateSketch(e.vertices),"draw-complete"===e.type&&this._stopSketch()})}_stopSketch(){if(this._vertices.length<3)return this.reset(),void this._startSketch();this.manipulators.forEach(({manipulator:e})=>{e.interactive=!0}),this._drawActive=!1,this.finishToolCreation()}_updateSketch(e){const{spatialReference:t}=this.view;for(;this._vertices.length>e.length;){const{handle:e,manipulator:t}=this._vertices.pop();e.remove(),this.manipulators.remove(t)}for(let r=this._vertices.length;r<e.length;r++){const[i,s]=e[r],a=new j({x:i,y:s,spatialReference:t}),o=ie(a,this.view,this._manipulatorLayer);this.manipulators.add(o);const n=Y.fromGeometry(a,2);n.on("vertex-update",e=>{const t=e.vertices.at(0);t&&(this._vertices[r].coord=[t.pos[0],t.pos[1]],this._updateGraphics())});const m=B(o,(e,t,r,i)=>{const s=this._getSnappingContext(i),{snappingManager:a}=this,o=this._updatingHandles,{snappingStep:m}=$({snappingContext:s,snappingManager:a,updatingHandles:o});t.next(J(this.view)).next(t=>{if("start"===t.action){const r=new j(t.mapStart);e.graphic.geometry=r,n.trySetGeometry(r)}return t}).next(...m).next(N({operations:n})).next(()=>{e.graphic.geometry=n.data.geometry})});this._vertices.push({manipulator:o,coord:[i,s],handle:m})}if(this._vertices.length){const r=this._vertices.length-1,i=this._vertices[r],[s,a]=e[r];i.coord[0]===s&&i.coord[1]===a||(i.coord=[s,a],i.manipulator.graphic.geometry=new j({x:s,y:a,spatialReference:t}));const o=this._drawActive?this._vertices[r].manipulator:null;this.manipulators.forEach(({manipulator:e})=>{e.interactive=null==o||e!==o})}this._updateGraphics()}_updateGraphics(){if(this._vertices.length<2)return void this._measurementLayer.removeAll();const e=se(this._vertices.map(({coord:e})=>e),this.view.spatialReference);if(!e)return;const{measurement:r,fillGeometry:i,outlineGeometry:o}=e;this._set("measurement",r);const n=r?ne(this.messages,r,this.unit):null;if(this._set("measurementLabel",n),!i&&!o)return;let m,l,p;const{graphics:c}=this._measurementLayer,u=3===c.length,{effectiveTheme:h}=this.view;u?(m=c.at(0),l=c.at(1),p=c.at(2)):(m=new t({symbol:new D({color:s(h.accentColor,.3),outline:null})}),l=new t({symbol:new P({color:h.accentColor,width:2})}),p=new t({symbol:new V({color:h.textColor,font:new z({size:14,family:"sans-serif"}),haloColor:s(a(h.textColor,160),.5),haloSize:2})}),c.removeAll(),c.addMany([m,l,p])),m.geometry=i,l.geometry=o;const d=i?U(i):null,y=d?j.fromJSON(d):null;p.geometry=y,p.symbol.text=n?.area??""}};function ie(e,r,i){const a=8,o={style:"circle",color:s(r.effectiveTheme.accentColor,.5),outline:{type:"simple-line",width:0}},n=new E({...o,size:a}),m=new E({...o,size:1.5*a}),l=new t({geometry:e,symbol:n});return new K({view:r,layer:i,graphic:l,focusedSymbol:m,consumesClicks:!1})}function se(e,t){if(2===e.length){const r=new x({paths:[e],spatialReference:t});let i;return i=t.isGeographic?_(t)?w(r,te):k(r,te,{unit:"meters"}):t.isWebMercator?k(r,te,{unit:"meters"}):r,{measurement:null,fillGeometry:null,outlineGeometry:i}}e.push(e[0]);const r=new x({paths:[e],spatialReference:t}),i=new S({rings:[e],spatialReference:t});let s,a,o=null,n=null;if(t.isGeographic)if(_(t)){if(o=w(r,te),n=w(i,te),n=T(n),!n)return null;s=b([r],"meters")[0],a=L([n],"square-meters")[0]}else{if(o=k(r,te,{unit:"meters"}),n=k(i,te,{unit:"meters"}),n=T(n),!n)return null;s=C(r,{unit:"meters"}),a=G(n,{unit:"square-meters"})}else if(t.isWebMercator){if(o=k(r,te,{unit:"meters"}),n=k(i,te,{unit:"meters"}),!n||!o)return null;if(n=T(n),!n)return null;s=C(r,{unit:"meters"}),a=G(n,{unit:"square-meters"})}else{if(o=r,n=T(i),!n)return null;s=R(r,{unit:"meters"}),a=A(n,{unit:"square-meters"})}return{measurement:{geometry:n,area:a,perimeter:s},fillGeometry:n,outlineGeometry:o}}function ae(e){return null!=e}async function oe(e){(e?.isGeographic&&!_(e)||e?.isWebMercator)&&await Promise.all([M(),O(),H()])}function ne(e,t,r){if(!t||!e)return null;const i={area:null,perimeter:null},{area:s,perimeter:a}=t;switch(r){case"metric":i.area=c(e,s,"square-meters");break;case"imperial":i.area=p(e,s,"square-meters");break;default:{const t=d(s,"square-meters",r);i.area=l(e,t,r);break}}const o=y(r);if(o)switch(o){case"metric":i.perimeter=h(e,a,"meters");break;case"imperial":i.perimeter=u(e,a,"meters");break;default:{const t=d(a,"meters",o);i.perimeter=l(e,t,o);break}}else i.perimeter="";return i}e([v()],re.prototype,"_drawActive",void 0),e([v({readOnly:!0})],re.prototype,"cursor",null),e([v({value:!0})],re.prototype,"editable",null),e([v({readOnly:!0})],re.prototype,"measurement",void 0),e([v({readOnly:!0})],re.prototype,"measurementLabel",void 0),e([v()],re.prototype,"messages",void 0),e([v({constructOnly:!0})],re.prototype,"snappingManager",void 0),e([v()],re.prototype,"unit",void 0),e([v()],re.prototype,"updating",null),e([v({constructOnly:!0})],re.prototype,"view",void 0),re=e([g("esri.widgets.AreaMeasurement2D.AreaMeasurement2DTool")],re);export{re as AreaMeasurement2DTool,se as createAreaMeasurementInfo2D,ne as createAreaMeasurementLabel,ae as isSupported,oe as loadGeometryOperators};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{fetchMessageBundle as r,onLocaleChange as i}from"../../intl.js";import{multiplyOpacity as s,getContrast as a}from"../../core/colorUtils.js";import{destroyMaybe as o}from"../../core/maybe.js";import{watch as n,initial as m}from"../../core/reactiveUtils.js";import{formatDecimal as l,formatImperialArea as p,formatMetricArea as c,formatImperialLength as h,formatMetricLength as u}from"../../core/unitFormatUtils.js";import{convertUnit as y,deriveLengthUnitFromAreaUnit as d}from"../../core/units.js";import{property as v,subclass as g}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import{isSupported as _,geodesicDensify as w,geodesicLengths as b,geodesicAreas as L}from"../../geometry/geodesicUtils.js";import j from"../../geometry/Point.js";import S from"../../geometry/Polygon.js";import A from"../../geometry/Polyline.js";import{areaExecute as G}from"../../geometry/operators/areaOperator.js";import{geodeticAreaExecute as x,geodeticAreaLoad as M}from"../../geometry/operators/geodeticAreaOperator.js";import{geodeticDensifyExecute as k,geodeticDensifyLoad as O}from"../../geometry/operators/geodeticDensifyOperator.js";import{geodeticLengthExecute as C,geodeticLengthLoad as H}from"../../geometry/operators/geodeticLengthOperator.js";import{lengthExecute as R}from"../../geometry/operators/lengthOperator.js";import{simplifyExecute as T}from"../../geometry/operators/simplifyOperator.js";import{polygonCentroidPoint as U}from"../../geometry/support/centroid.js";import q from"../../layers/GraphicsLayer.js";import z from"../../symbols/Font.js";import D from"../../symbols/SimpleFillSymbol.js";import P from"../../symbols/SimpleLineSymbol.js";import E from"../../symbols/SimpleMarkerSymbol.js";import V from"../../symbols/TextSymbol.js";import{SnappingVisualizer2D as F}from"../../views/2d/interactive/SnappingVisualizer2D.js";import W from"../../views/draw/Draw.js";import{createCoordinateHelper as I}from"../../views/interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as B,screenToMap as J,dragManipulatedObject as N}from"../../views/interactive/dragEventPipeline.js";import{GraphicManipulator as K}from"../../views/interactive/GraphicManipulator.js";import{InteractiveToolBase as Q}from"../../views/interactive/InteractiveToolBase.js";import{EditGeometry as X}from"../../views/interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as Y}from"../../views/interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as Z}from"../../views/interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as $}from"../../views/interactive/snapping/SnappingDragPipelineStep.js";import{setupSnappingToggleHandles as ee}from"../../views/interactive/snapping/snappingUtils.js";const te=1e5;let re=class extends Q{constructor(e){super(e),this._measurementLayer=new q({internal:!0,listMode:"hide",visible:!1,title:"Area measurement layer"}),this._manipulatorLayer=new q({internal:!0,listMode:"hide",visible:!1,title:"Area measurement manipulator layer"}),this._snappingLayer=new q({internal:!0,listMode:"hide",visible:!1,title:"Area measurement snapping layer"}),this._updatingHandles=new f,this._vertices=[],this._drawActive=!1,this.measurement=null,this.measurementLabel=null}initialize(){r("esri/core/t9n/Units").then(e=>{this.messages=e});const e=this.view;this._draw=new W({view:e}),e.map.addMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),e.focus(),this.addHandles([i(async()=>{this.messages=await r("esri/core/t9n/Units")}),n(()=>[this.unit,this.messages],()=>{this._updateGraphics()},m),n(()=>[this.view.effectiveTheme.accentColor,this.view.effectiveTheme.textColor],()=>{if(!this._vertices.length)return;const e=this._vertices.map(({coord:e})=>e);for(const{handle:t}of this._vertices)t.remove();this._vertices=[],this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this.manipulators.removeAll(),this._updateSketch(e)})]),ee(this)}destroy(){const{map:e}=this.view;this._draw.view=null,this._draw=o(this._draw),e.removeMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._measurementLayer=o(this._measurementLayer),this._manipulatorLayer=o(this._manipulatorLayer),this._snappingLayer=o(this._snappingLayer),this._updatingHandles=o(this._updatingHandles),this._resetVertices()}get cursor(){return this._drawActive?"crosshair":null}set editable(e){this._set("editable",e),e||this._draw.reset()}get snappingOptions(){return this.snappingManager.options}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}onActivate(){this._drawActive||0!==this._vertices.length||this._startSketch()}onShow(){this._measurementLayer.visible=!0,this._manipulatorLayer.visible=!0,this._snappingLayer.visible=!0}onHide(){this._measurementLayer.visible=!1,this._manipulatorLayer.visible=!1,this._snappingLayer.visible=!1}reset(){this.manipulators.removeAll(),this._resetVertices(),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._draw.reset(),this._drawActive=!1}_getSnappingContext(e){return new Z({elevationInfo:{mode:"on-the-ground",offset:0},pointer:e,editGeometryOperations:new Y(new X("point",I(!1,!1,this.view.spatialReference)),2),visualizer:new F(this._snappingLayer)})}_resetVertices(){for(const{handle:e}of this._vertices)e.remove();this._vertices=[]}_startSketch(){this._drawActive=!0;const{snappingManager:e}=this;this._draw.create("polyline",{mode:"click",snappingManager:e}).on(["draw-complete","vertex-add","vertex-update","vertex-remove","cursor-update","undo","redo"],e=>{this._updateSketch(e.vertices),"draw-complete"===e.type&&this._stopSketch()})}_stopSketch(){if(this._vertices.length<3)return this.reset(),void this._startSketch();this.manipulators.forEach(({manipulator:e})=>{e.interactive=!0}),this._drawActive=!1,this.finishToolCreation()}_updateSketch(e){const{spatialReference:t}=this.view;for(;this._vertices.length>e.length;){const{handle:e,manipulator:t}=this._vertices.pop();e.remove(),this.manipulators.remove(t)}for(let r=this._vertices.length;r<e.length;r++){const[i,s]=e[r],a=new j({x:i,y:s,spatialReference:t}),o=ie(a,this.view,this._manipulatorLayer);this.manipulators.add(o);const n=Y.fromGeometry(a,2);n.on("vertex-update",e=>{const t=e.vertices.at(0);t&&(this._vertices[r].coord=[t.pos[0],t.pos[1]],this._updateGraphics())});const m=B(o,(e,t,r,i)=>{const s=this._getSnappingContext(i),{snappingManager:a}=this,o=this._updatingHandles,{snappingStep:m}=$({snappingContext:s,snappingManager:a,updatingHandles:o});t.next(J(this.view)).next(t=>{if("start"===t.action){const r=new j(t.mapStart);e.graphic.geometry=r,n.trySetGeometry(r)}return t}).next(...m).next(N({operations:n})).next(()=>{e.graphic.geometry=n.data.geometry})});this._vertices.push({manipulator:o,coord:[i,s],handle:m})}if(this._vertices.length){const r=this._vertices.length-1,i=this._vertices[r],[s,a]=e[r];i.coord[0]===s&&i.coord[1]===a||(i.coord=[s,a],i.manipulator.graphic.geometry=new j({x:s,y:a,spatialReference:t}));const o=this._drawActive?this._vertices[r].manipulator:null;this.manipulators.forEach(({manipulator:e})=>{e.interactive=null==o||e!==o})}this._updateGraphics()}_updateGraphics(){if(this._vertices.length<2)return void this._measurementLayer.removeAll();const e=se(this._vertices.map(({coord:e})=>e),this.view.spatialReference);if(!e)return;const{measurement:r,fillGeometry:i,outlineGeometry:o}=e;this._set("measurement",r);const n=r?ne(this.messages,r,this.unit):null;if(this._set("measurementLabel",n),!i&&!o)return;let m,l,p;const{graphics:c}=this._measurementLayer,h=3===c.length,{effectiveTheme:u}=this.view;h?(m=c.at(0),l=c.at(1),p=c.at(2)):(m=new t({symbol:new D({color:s(u.accentColor,.3),outline:null})}),l=new t({symbol:new P({color:u.accentColor,width:2})}),p=new t({symbol:new V({color:u.textColor,font:new z({size:14,family:"sans-serif"}),haloColor:s(a(u.textColor,160),.5),haloSize:2})}),c.removeAll(),c.addMany([m,l,p])),m.geometry=i,l.geometry=o;const y=i?U(i):null,d=y?j.fromJSON(y):null;p.geometry=d,p.symbol.text=n?.area??""}};function ie(e,r,i){const a=8,o={style:"circle",color:s(r.effectiveTheme.accentColor,.5),outline:{type:"simple-line",width:0}},n=new E({...o,size:a}),m=new E({...o,size:1.5*a}),l=new t({geometry:e,symbol:n});return new K({view:r,layer:i,graphic:l,focusedSymbol:m,consumesClicks:!1})}function se(e,t){if(2===e.length){const r=new A({paths:[e],spatialReference:t});let i;return i=t.isGeographic?_(t)?w(r,te):k(r,te,{unit:"meters"}):t.isWebMercator?k(r,te,{unit:"meters"}):r,{measurement:null,fillGeometry:null,outlineGeometry:i}}e.push(e[0]);const r=new A({paths:[e],spatialReference:t}),i=new S({rings:[e],spatialReference:t});let s,a,o=null,n=null;if(t.isGeographic)if(_(t)){if(o=w(r,te),n=w(i,te),n=T(n),!n)return null;s=b([r],"meters")[0],a=L([n],"square-meters")[0]}else{if(o=k(r,te,{unit:"meters"}),n=k(i,te,{unit:"meters"}),n=T(n),!n)return null;s=C(r,{unit:"meters"}),a=x(n,{unit:"square-meters"})}else if(t.isWebMercator){if(o=k(r,te,{unit:"meters"}),n=k(i,te,{unit:"meters"}),!n||!o)return null;if(n=T(n),!n)return null;s=C(r,{unit:"meters"}),a=x(n,{unit:"square-meters"})}else{if(o=r,n=T(i),!n)return null;s=R(r,{unit:"meters"}),a=G(n,{unit:"square-meters"})}return{measurement:{geometry:n,area:a,perimeter:s},fillGeometry:n,outlineGeometry:o}}function ae(e){return null!=e}async function oe(e){(e?.isGeographic&&!_(e)||e?.isWebMercator)&&await Promise.all([M(),O(),H()])}function ne(e,t,r){if(!t||!e)return null;const i={area:null,perimeter:null},{area:s,perimeter:a}=t;switch(r){case"metric":i.area=c(e,s,"square-meters");break;case"imperial":i.area=p(e,s,"square-meters");break;default:{const t=y(s,"square-meters",r);i.area=l(e,t,r);break}}const o=d(r);if(o)switch(o){case"metric":i.perimeter=u(e,a,"meters");break;case"imperial":i.perimeter=h(e,a,"meters");break;default:{const t=y(a,"meters",o);i.perimeter=l(e,t,o);break}}else i.perimeter="";return i}e([v()],re.prototype,"_drawActive",void 0),e([v({readOnly:!0})],re.prototype,"cursor",null),e([v({value:!0})],re.prototype,"editable",null),e([v({readOnly:!0})],re.prototype,"measurement",void 0),e([v({readOnly:!0})],re.prototype,"measurementLabel",void 0),e([v()],re.prototype,"messages",void 0),e([v({constructOnly:!0})],re.prototype,"snappingManager",void 0),e([v()],re.prototype,"unit",void 0),e([v()],re.prototype,"updating",null),e([v({constructOnly:!0})],re.prototype,"view",void 0),re=e([g("esri.widgets.AreaMeasurement2D.AreaMeasurement2DTool")],re);export{re as AreaMeasurement2DTool,se as createAreaMeasurementInfo2D,ne as createAreaMeasurementLabel,ae as isSupported,oe as loadGeometryOperators};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{isSome as e,addMany as n,pushIfSome as
|
|
2
|
+
import{isSome as e,addMany as n,pushIfSome as s}from"../../../core/arrayUtils.js";import{getOrCreateMapValue as t}from"../../../core/MapUtils.js";import o from"../../../core/Queue.js";import{addMany as i,last as r}from"../../../core/SetUtils.js";import{isFieldElementTemplate as a}from"../templates/support/templateUtils.js";class c{constructor({executorMap:e,fieldsIndex:n,preserveFieldValuesWhenHidden:s}){this.arcadeExecutorUses=new Map,this.components=[],this.preserveFieldValuesWhenHidden=!1,this.fieldsIndex=n,this.preserveFieldValuesWhenHidden=!0===s,this.elementTemplateMap=new Map;for(const t of e.keys())this.elementTemplateMap.set(t.elementId,t);this._buildDependencyGraph(e)}_buildDependencyGraph(e){const n=m(e,this.fieldsIndex),s={components:[],arcadeExecutorUses:this.arcadeExecutorUses,elementTemplatesById:new Map([...e.keys()].map(e=>[e.elementId,e])),executorMap:e,fieldElementTemplateMap:f(e),fieldReferencesMap:new Map,geometryReferences:new Set,originalFeatureReferences:new Set,nextIndex:0,nodeInfoMap:n,nodeStack:new o(r),shouldConsiderVisibility:!this.preserveFieldValuesWhenHidden};for(const[o,i]of e)if(null!=i)for(const e of Object.keys(i))switch(e){case"choiceExpression":case"editableExpression":case"requiredExpression":case"valueExpression":case"visibilityExpression":{const n=i[e];if(null==n)break;t(this.arcadeExecutorUses,n,()=>[]).push({elementId:o.elementId,executorPurpose:e});break}case"textExpressions":{const n=i[e];if(!Array.isArray(n))break;n.forEach((e,n)=>{t(this.arcadeExecutorUses,e,()=>[]).push({elementId:o.elementId,executorPurpose:"textExpressions",textExpressionIndex:n})});break}}for(const t of this.arcadeExecutorUses.values())t.sort(e=>"editableExpression"===e.executorPurpose?-1:1);for(const t of n.values())-1===t.index&&d(t,s);this.dependencyGraphComponents=x(n),this.fieldReferencesMap=h(s),this.geometryReferences=y(s.geometryReferences,n),this.originalFeatureReferences=y(s.originalFeatureReferences,n),this.components=s.components}}class l{constructor(){this._executors=new Set,this._fieldsReferenced=new Set,this.adjacencyList=new Set}get executors(){return this._executors}get fieldsReferenced(){return this._fieldsReferenced}addExecutor(e){this._executors.add(e.executor),i(this._fieldsReferenced,e.fieldsUsedNormalized)}}function d(e,n){e.index=e.lowlink=n.nextIndex++,n.nodeStack.push(e);for(const s of p(e,n))-1===s.index?(d(s,n),e.lowlink=Math.min(e.lowlink,s.lowlink)):s.index<e.index&&n.nodeStack.contains(s)&&(e.lowlink=Math.min(e.lowlink,s.index)),n.nodeStack.contains(s)||null!=s.component&&e.incomingCrossLinkNeighbors.add(s.component);if(e.lowlink===e.index){const s=new l;for(n.components.push(s);E(n.nodeStack)>=e.index;){const e=n.nodeStack.pop();if(null!=e){e.component=s,s.addExecutor(e);for(const n of e.incomingCrossLinkNeighbors)n.adjacencyList.add(s)}}}}function p({executor:n,fieldsUsedNormalized:s},o){const r=new Set;for(const e of s){t(o.fieldReferencesMap,e,()=>new Set).add(n),i(r,u(e,o))}n.geometryUsed&&o.geometryReferences.add(n),n.variablesUsed.includes("$originalfeature")&&o.originalFeatureReferences.add(n);const c=o.arcadeExecutorUses.get(n)??[];for(const e of c)switch(e.executorPurpose){case"valueExpression":{const s=o.executorMap.get(o.elementTemplatesById.get(e.elementId));s?.editableExpression&&s.editableExpression!==n&&r.add(s.editableExpression);break}case"visibilityExpression":{const n=o.elementTemplatesById.get(e.elementId);if(o.shouldConsiderVisibility&&n&&a(n)){const e=n.group,s=e?o.executorMap.get(e):null;s?.visibilityExpression&&r.add(s.visibilityExpression)}break}}return Array.from(r).map(e=>o.nodeInfoMap.get(e)).filter(e)}function u(e,{executorMap:n,fieldElementTemplateMap:t,shouldConsiderVisibility:o}){const i=[],r=t.get(e);if(null==r)return i;const a=n.get(r);if(null==a)return i;if(s(i,a.editableExpression),s(i,a.valueExpression),o){s(i,a.visibilityExpression);const{group:e}=r;if(null!=e){const t=n.get(e)?.visibilityExpression;s(i,t)}}return i}function f(e){const n=new Map;for(const s of e.keys())a(s)&&n.set(s.fieldName,s);return n}function m(s,t){const o=Array.from(s.values()).filter(e),i=new Set(o.flatMap(e=>{const{textExpressions:s,...t}=e,o=[];return s?.length&&n(o,s),n(o,Object.values(t)),o})),r=Array.from(i).filter(e).map(e=>({component:null,incomingCrossLinkNeighbors:new Set,executor:e,fieldsUsedNormalized:e.fieldsUsed.map(e=>t.normalizeFieldName(e)??e),index:-1,lowlink:-1,onStack:!1}));return new Map(r.map(e=>[e.executor,e]))}function x(e){return new Map([...e.values()].map(({component:e,executor:n})=>[n,e]))}function h({fieldReferencesMap:e,nodeInfoMap:n}){const s=new Map;for(const[t,o]of e.entries())s.set(t,y(o,n));return s}function y(e,n){const s=new Set;for(const t of e){const e=n.get(t);e?.component&&s.add(e.component)}return s}function E(e){return e.peek()?.index??-1}export{c as ExpressionsModel,l as StronglyConnectedComponent,p as getDirectDependencies};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../core/Error.js";import{DateOnly as t}from"../../../core/sql/DateOnly.js";import{TimeOnly as r}from"../../../core/sql/TimeOnly.js";async function n({element:e,expressionInfos:t,provider:r}){const n={};if(e.visibilityExpression){const i=t.get(e.visibilityExpression);n.visibilityExpression=i?await r.getArcadeExecutor(i.expression):void 0}if("editableExpression"in e&&e.editableExpression){const i=t.get(e.editableExpression);n.editableExpression=i?await r.getArcadeExecutor(i.expression):void 0}if("requiredExpression"in e&&e.requiredExpression){const i=t.get(e.requiredExpression);n.requiredExpression=i?await r.getArcadeExecutor(i.expression):void 0}if("valueExpression"in e&&e.valueExpression){const i=t.get(e.valueExpression);n.valueExpression=i?await r.getArcadeExecutor(i.expression):void 0}return n}function
|
|
2
|
+
import e from"../../../core/Error.js";import{DateOnly as t}from"../../../core/sql/DateOnly.js";import{TimeOnly as r}from"../../../core/sql/TimeOnly.js";import{isDynamicChoiceInput as i}from"../../../form/elements/inputs/inputUtils.js";import{isFieldElement as o}from"../../../form/support/formUtils.js";async function n({element:e,expressionInfos:t,provider:r}){const n={};if(e.visibilityExpression){const i=t.get(e.visibilityExpression);n.visibilityExpression=i?await r.getArcadeExecutor(i.expression):void 0}if("editableExpression"in e&&e.editableExpression){const i=t.get(e.editableExpression);n.editableExpression=i?await r.getArcadeExecutor(i.expression):void 0}if("requiredExpression"in e&&e.requiredExpression){const i=t.get(e.requiredExpression);n.requiredExpression=i?await r.getArcadeExecutor(i.expression):void 0}if("valueExpression"in e&&e.valueExpression){const i=t.get(e.valueExpression);n.valueExpression=i?await r.getArcadeExecutor(i.expression):void 0}const s=o(e)?e.input:void 0;if(s&&i(s)&&s.choiceExpression){const e=t.get(s.choiceExpression);n.choiceExpression=e?await r.getArcadeExecutor(e.expression):void 0}return n}function s(e){return new Map(e?.map(e=>[e.name,e]))}function a(i,o,n,s){if(null===i)return null;switch(o.type){case"big-integer":case"integer":case"long":case"oid":case"small-integer":{const e=u(i,s);return null==e?null:Math.floor(e)}case"single":case"double":return u(i,s);case"global-id":case"guid":case"string":return s.toString(i);case"date":{const t=l(i,n,s);if(t)return t.getTime();const r=u(i,s);if(null!==r&&!Number.isNaN(r)&&Number.isInteger(r))return r;throw new e("unsupported-value-type",`Unable to convert value ${i} to a date`)}case"date-only":{if(s.isDateOnly(i))return i.toStorageFormat();const r=l(i,n,s);if(!r)throw new e("unsupported-value-type",`Unable to convert value ${i} to a date-only string`);return t.fromDateTime(r.toDateTime()).toStorageFormat()}case"time-only":{if(s.isTime(i))return i.toStorageString();if(s.isDate(i)){return r.fromDateTime(i.toDateTime()).toStorageString()}const t=r.fromString(s.toString(i));if(!t)throw new e("unsupported-value-type",`Unable to convert value ${i} to a time-only string`);return t.toStorageString()}case"timestamp-offset":{const t=l(i,n,s);if(!t)throw new e("unsupported-value-type",`Unable to convert value ${i} to a timestamp-offset string`);return t.toISOString(!1)}}throw new e("unsupported-value-type",`Unable to convert value ${i} to a value matching field type`)}function u(e,t){if(""===e)return null;const r=t.toNumber(e);return Number.isNaN(r)?null:r}function l(e,t,r){if(r.isDate(e))return e;if(r.isDateOnly(e))return e.toArcadeDate();const i=r.toString(e),o=r.toDate(i,t);return o&&/\d{4}-\d{2}-\d{2}/.test(i)?o:null}function c(e,t,r){const{editType:i,map:o,spatialReference:n,timeZone:s}=e,a=t.layer,u="scene"===a?.type&&null!=a.associatedLayer?a.associatedLayer:a;return{variables:{$originalfeature:t.original,$editcontext:{editType:i},$layer:u,$featureset:u,$datastore:u?.url,$feature:t.plainGraphic,$map:o},executeContext:{rawOutput:!0,spatialReference:n??void 0,timeZone:s,abortSignal:r}}}export{a as castArcadeValue,c as makeArcadeContext,n as makeExecutorSetForFormElement,s as makeExpressionInfosMap};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{createTask as
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{createTask as s}from"../../../../core/asyncUtils.js";import o from"../../../../core/Logger.js";import{getOrCreateMapValue as i}from"../../../../core/MapUtils.js";import{abortMaybe as r}from"../../../../core/maybe.js";import{ignoreAbortErrors as n,throwIfAborted as a}from"../../../../core/promiseUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as p}from"../../../../core/support/UpdatingHandles.js";import{makeArcadeContext as u,castArcadeValue as h}from"../../expressions/expressionUtils.js";let d=class extends t{constructor(e){super(e),this.filterValue="",this._choices=[],this._expressionTask=null,this._updatingHandles=new p}destroy(){r(this._expressionTask),this._updatingHandles.destroy()}get arcadeContextInfo(){return this.fieldInput.expressionsManager.arcadeContext}get choices(){return this._choices}get evaluating(){return this._updatingHandles.updating}get features(){return this.fieldInput.features}get filteredChoices(){const e=this.choices,t=this.filterValue.trim().toLocaleLowerCase();return t?e.filter((e,s)=>this._normalizedChoiceNames[s].includes(t)):e}get input(){return this.fieldInput.input}get _normalizedChoiceNames(){return this._choices.map(({name:e})=>e.toLocaleLowerCase())}async evaluateChoiceExpression(){this._expressionTask=r(this._expressionTask);const e=s(e=>this._evaluateChoiceExpression(e));this._expressionTask=e;try{return await n(this._updatingHandles.addPromise(e.promise))??this.choices}finally{this._expressionTask===e&&(this._expressionTask=null)}}async _evaluateChoiceExpression(e){const t=await(import("../../../../arcade/languageUtils.js"));a(e);const s=this.arcadeContextInfo,o=this.fieldInput.field,r=new Array(this.features.length),n=new Map;let c;this.features.forEach((t,o)=>{const a=this.fieldInput.template.getExpressionExecutorsForLayer(t.layer)?.choiceExpression;if(!a)return void(r[o]=[]);const l=u(s,t,e);c||(c=l.executeContext),i(n,a,()=>[]).push({index:o,variables:l.variables})});for(const[i,p]of n){const n=await i.executeAsyncBatch(p,({variables:e})=>e,c);a(e);for(let e=0;e<n.length;e++){const i=n[e];"rejected"!==i.status?r[p[e].index]=this._parseChoices(i.value,s,o,t):r[p[e].index]=[]}}const l=g(m(r));return this._choices=l,l}_parseChoices(e,t,s,o){if(!o.isDictionary(e))return y(this),[];const i=e.hasField("choices")?e.field("choices"):null,r=o.isImmutableArray(i)?i.toArray():Array.isArray(i)?i:[],n=[];for(const a of r){if(!o.isDictionary(a)||!a.hasField("name")||!a.hasField("code")){y(this);continue}const e=a.field("name"),i=a.field("code");if("string"!=typeof e||void 0===i||o.isVoid(i)||o.isFunctionParameter(i)){y(this);continue}const r=h(i,s,t.timeZone,o);null!=r&&n.push({name:e,code:r})}return n}};e([c()],d.prototype,"arcadeContextInfo",null),e([c()],d.prototype,"choices",null),e([c()],d.prototype,"evaluating",null),e([c()],d.prototype,"features",null),e([c({constructOnly:!0})],d.prototype,"fieldInput",void 0),e([c()],d.prototype,"filteredChoices",null),e([c()],d.prototype,"filterValue",void 0),e([c()],d.prototype,"input",null),e([c()],d.prototype,"_choices",void 0),e([c()],d.prototype,"_normalizedChoiceNames",null),d=e([l("esri.widgets.BatchAttributeForm.inputs.support.DynamicChoiceController")],d);const f=d;function m(e){const[t,...s]=e;if(!t)return[];let o=t;for(const r of s.sort((e,t)=>e.length-t.length)){if(!r.length)return[];const e=new Map;for(const{code:t,name:s}of r)i(e,t,()=>new Set).add(s);if(o=o.filter(({code:t,name:s})=>e.get(t)?.has(s)),!o.length)break}return o}function g(e){const t=new Set;return e.filter(({code:e})=>!t.has(e)&&(t.add(e),!0))}function y(e){o.getLogger(e).error("Value returned by choice expression does not conform to specification.")}export{f as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as o}from"../../../core/accessorSupport/decorators.js";import{ElementTemplateBase as r}from"./ElementTemplateBase.js";let l=class extends r{constructor(e){super(e),this.domain=null,this.group=null,this.hint=null,this.input=null,this.type="field"}get fieldName(){return this.field.name}get hasValueCalculations(){for(const e of this.layers){const t=this.getExpressionExecutorsForLayer(e);if(t?.valueExpression)return!0}return!1}};e([t({clonable:"reference"})],l.prototype,"domain",void 0),e([t({clonable:"reference",constructOnly:!0})],l.prototype,"field",void 0),e([t()],l.prototype,"fieldName",null),e([t({clonable:!1})],l.prototype,"group",void 0),e([t()],l.prototype,"hint",void 0),e([t()],l.prototype,"input",void 0),e([t()],l.prototype,"type",void 0),e([t()],l.prototype,"hasValueCalculations",null),l=e([o("esri.widgets.BatchAttributeForm.templates.FieldElementTemplate")],l);export{l as FieldElementTemplate};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{createArcadeProfile as e,createArcadeExecutor as t}from"../../../../arcade.js";import{isSome as r}from"../../../../core/arrayUtils.js";import n from"../../../../core/Error.js";import o from"../../../../core/Logger.js";import{getEffectiveFieldAlias as i}from"../../../../editing/fieldUtils.js";import s from"../../../../form/ExpressionInfo.js";import a from"../../../../form/elements/AttachmentElement.js";import{isMultipleChoiceInput as m
|
|
2
|
+
import{createArcadeProfile as e,createArcadeExecutor as t}from"../../../../arcade.js";import{isSome as r}from"../../../../core/arrayUtils.js";import n from"../../../../core/Error.js";import o from"../../../../core/Logger.js";import{getEffectiveFieldAlias as i}from"../../../../editing/fieldUtils.js";import s from"../../../../form/ExpressionInfo.js";import a from"../../../../form/elements/AttachmentElement.js";import{isMultipleChoiceInput as m}from"../../../../form/elements/inputs/inputUtils.js";import l from"../../../../form/elements/inputs/attachments/AttachmentInput.js";import p from"../../../../form/elements/inputs/attachments/AudioInput.js";import c from"../../../../form/elements/inputs/attachments/DocumentInput.js";import d from"../../../../form/elements/inputs/attachments/ImageInput.js";import f from"../../../../form/elements/inputs/attachments/VideoInput.js";import{isAttachmentElement as u,isFieldElement as x,isGroupElement as y,isRelationshipElement as h,isTextElement as w,isUtilityNetworkAssociationsElement as E}from"../../../../form/support/formUtils.js";import{getLowerCaseEditTrackingFields as T,isFieldVisibleByDefault as I}from"../../../../layers/support/fieldUtils.js";import{isNumber as v}from"../../../../support/guards.js";import{layerSupportsAttachments as b,getLayerTimeZone as j}from"../../batchAttributeFormUtils.js";import{makeExpressionInfosMap as P,makeExecutorSetForFormElement as g}from"../../expressions/expressionUtils.js";import{AttachmentElementTemplate as Z}from"../AttachmentElementTemplate.js";import A from"../BatchFormTemplate.js";import{FieldElementTemplate as F}from"../FieldElementTemplate.js";import{GroupElementTemplate as U}from"../GroupElementTemplate.js";import{RelationshipElementTemplate as C}from"../RelationshipElementTemplate.js";import{TextElementTemplate as L}from"../TextElementTemplate.js";import{UtilityNetworkAssociationsElementTemplate as B}from"../UtilityNetworkAssociationsElementTemplate.js";import{isGroupElementTemplate as H}from"./templateUtils.js";import{compileTextElementMarkdownToHTML as N}from"./textElementTemplateUtils.js";const V="expression/dea57012-47ca4b55a000-8df62742ed0c",R=e("form-attachment-filename-calculation"),S=()=>o.getLogger("esri.widgets.BatchAttributeForm.templates.templateUtils");async function W(e,t,r=e.formTemplate){return await e.load(),r?.elements&&r.elements.length>0?D(r,e,t):k(e,t)}async function k(e,{arcadeExecutorProvider:t,attachmentsEnabled:r,formTimeZone:n}){const o=new Set(T(e)),i={arcadeExecutorProvider:t,formTimeZone:n,layer:e},s=[];for(const m of e.fields)Y(m,e,o)&&s.push(X(m,i));const a=await Promise.all(s);return r&&await O(a,{arcadeExecutorProvider:t,expressionInfos:P(void 0),layer:e}),new A({elements:a,title:e.formTemplate?.title,preserveFieldValuesWhenHidden:!0})}function K(e,t){for(const r of e??[])if("group"!==r.type){if("field"===r.type&&!1===r.editable&&!r.editableExpression)return!0}else if(K(r.elements??[]))return!0;return!1}async function O(e,{arcadeExecutorProvider:t,expressionInfos:r,layer:n}){if(!b(n))return;const o=await G(new a({displayFilename:!0,input:new l({attachmentAssociationType:"any",inputTypes:[new d,new c,new f,new p]})}),{arcadeExecutorProvider:t,expressionInfos:r,layer:n});e.push(o)}async function D(e,t,r){let n=null;K(e.elements??[])&&(n=new s({title:"",name:V,expression:"false"}));const o=P(n?[...e.expressionInfos??[],n]:e.expressionInfos),i={description:e.description,elements:new Array,title:e.title,preserveFieldValuesWhenHidden:e.preserveFieldValuesWhenHidden,supportsAttachmentElements:e.supportsAttachmentElements},{elements:a}=e;if(!a)return new A(i);let m=!1;const{arcadeExecutorProvider:l,formTimeZone:p}=r;for(const s of a){const e=await $(s,{arcadeExecutorProvider:l,expressionInfos:o,layer:t,formTimeZone:p});if(e){if(i.elements.push(e),m)continue;"attachment"===e.type&&(m=!0),H(e)&&e.elements.some(e=>("attachment"===e.type&&(m=!0),m))}}return e.supportsAttachmentElements||!r.attachmentsEnabled||m||await O(i.elements,{arcadeExecutorProvider:l,expressionInfos:o,layer:t}),new A(i)}async function G(e,{arcadeExecutorProvider:r,expressionInfos:n,layer:o}){let i=null;if(e.filenameExpression)try{i=await t(e.filenameExpression,R)}catch(m){S().error("Failed to compile attachment filename expression",m)}const s=new Z({allowUserRename:e.allowUserRename,attachmentKeyword:e.attachmentKeyword,description:e.description,displayFilename:e.displayFilename,filenameExpressionExecutor:i,input:e.input,label:e.label,maxAttachmentCount:e.maxAttachmentCount,minAttachmentCount:e.minAttachmentCount,useOriginalFilename:e.useOriginalFilename}),a=await g({element:e,expressionInfos:n,provider:r});return s.addLayer(o,a),s}async function $(e,t){return u(e)?G(e,{arcadeExecutorProvider:t.arcadeExecutorProvider,expressionInfos:t.expressionInfos,layer:t.layer}):x(e)?q(e,t):y(e)?z(e,t):h(e)?J(e,t):w(e)?M(e,t):E(e)?Q(e,t):null}async function q(e,{arcadeExecutorProvider:t,expressionInfos:r,layer:o,formTimeZone:i}){const{fieldsIndex:s}=o,{description:a,domain:l,fieldName:p,hint:c,input:d,label:f}=e;if(null==p||!s.has(p))return S().warn(new n("batch-attribute-form:invalid-form-element-field",`Field element with label '${f}' does not refer to a valid field`)),null;if(!1!==e.editable||e.editableExpression||((e=e.clone()).editableExpression=V),d&&m(d)&&d.otherChoice){const e=d.otherChoice.fieldName,t=s.get(e);t&&t.name!==e&&(d.otherChoice=d.otherChoice.clone(),d.otherChoice.fieldName=t.name)}const u=new F({description:a,domain:l,field:s.get(p),hint:c,input:d,formTimeZone:i,layerTimeZone:j(o),label:f}),x=await g({element:e,expressionInfos:r,provider:t});return u.addLayer(o,x),u}async function z(e,t){const{arcadeExecutorProvider:r,expressionInfos:n,layer:o}=t,{description:i,label:s,initialState:a}=e,m=[];for(const c of e.elements){const e=await $(c,t);e&&m.push(e)}const l=new U({description:i,elements:m,label:s,initialState:a??"expanded"}),p=await g({element:e,expressionInfos:n,provider:r});return l.addLayer(o,p),l}async function J(e,t){const{description:r,label:n,displayCount:o,displayType:i,orderByFields:s,relationshipId:a}=e,{arcadeExecutorProvider:m,expressionInfos:l,layer:p,formTimeZone:c}=t,d=new C({description:r,...v(o)&&{displayCount:o},displayType:i,formTimeZone:c,label:n,layerTimeZone:j(p),orderByFields:s,relationshipId:a}),f=await g({element:e,expressionInfos:l,provider:m});return d.addLayer(p,f),d}async function M(e,{arcadeExecutorProvider:t,expressionInfos:n,layer:o,formTimeZone:i}){const{description:s,label:a,text:m,textFormat:l}=e,{fieldsIndex:p}=o,c=m&&"markdown"===l?await N(m):m,d=new L({compiledText:c,description:s,fieldsIndex:p,formTimeZone:i,label:a,layerTimeZone:j(o)}),f=await g({element:e,expressionInfos:n,provider:t}),{expressionParts:u}=d;if(u.length){const e=await Promise.all(u.map(e=>{const r=n.get(e)?.expression??e;return t.getArcadeExecutor(r)}));f.textExpressions=e.filter(r)}return d.addLayer(o,f),d}async function Q(e,t){const{associationTypes:r,description:n,label:o}=e,{arcadeExecutorProvider:i,expressionInfos:s,formTimeZone:a,layer:m}=t,l=new B({associationTypes:r,description:n,formTimeZone:a,label:o,layerTimeZone:j(m)}),p=await g({element:e,expressionInfos:s,provider:i});return l.addLayer(m,p),l}async function X(e,{arcadeExecutorProvider:t,layer:r,formTimeZone:n}){const o=i(e,r)||e.name,s=new F({field:e,formTimeZone:n,label:o,layerTimeZone:j(r)}),a={};return e.editable&&r.userHasUpdateItemPrivileges&&(a.editableExpression=await t.getArcadeExecutor("true")),s.addLayer(r,a),s}function Y(e,t,r){return!r.has(e.name.toLowerCase())&&I(e,t)}export{W as createBatchFormTemplate,k as createBatchFormTemplateFromFields};
|