@arcgis/core 4.34.0-next.1 → 4.34.0-next.10
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/Map.js +1 -1
- package/WebScene.js +1 -1
- package/analysis/DimensionAnalysis.js +1 -1
- package/analysis/LineOfSightAnalysis.js +1 -1
- package/analysis/ViewshedAnalysis.js +1 -1
- package/applications/ExperienceBuilder/sketchUtils.d.ts +1 -0
- package/applications/ExperienceBuilder/sketchUtils.js +1 -1
- package/arcade/Voxel.js +1 -1
- package/arcade/functions/knowledgegraph.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0039dee1337160366112.js +1 -0
- package/assets/esri/core/workers/chunks/074498a4d685223ec058.js +1 -0
- package/assets/esri/core/workers/chunks/{54ea93f416ab52b413c1.js → 076f830d6d0337dfce9d.js} +1 -1
- package/assets/esri/core/workers/chunks/09907c9ff597df9bc954.js +1 -0
- package/assets/esri/core/workers/chunks/0dbb350ce651bc236ec8.js +1 -0
- package/assets/esri/core/workers/chunks/0ed4ec00ef16aa58a33d.js +1 -0
- package/assets/esri/core/workers/chunks/{ead5d4e271effc04def3.js → 1415d4e2f5f3193be004.js} +1 -1
- package/assets/esri/core/workers/chunks/{0624ae07d3af8d5f1ac8.js → 15b3eb60f86954783fab.js} +1 -1
- package/assets/esri/core/workers/chunks/18011c691e0aca4144dd.js +1 -0
- package/assets/esri/core/workers/chunks/1dc1084eb34748a35d35.js +1 -0
- package/assets/esri/core/workers/chunks/1f315f0eeb26dad1addd.js +1 -0
- package/assets/esri/core/workers/chunks/2254989ca3ff3960f2fe.js +1 -0
- package/assets/esri/core/workers/chunks/2dc54925d473a959119c.js +1 -0
- package/assets/esri/core/workers/chunks/2e1ceff3f88a6c78dfa2.js +1 -0
- package/assets/esri/core/workers/chunks/{847e88e1d6da1e74cdc8.js → 2ecc1057d53e0b4a60b7.js} +1 -1
- package/assets/esri/core/workers/chunks/3025e420e13e2bc8c0a1.js +1 -0
- package/assets/esri/core/workers/chunks/{ece68a25651ef03fc95d.js → 342f61e784c9364a493b.js} +1 -1
- package/assets/esri/core/workers/chunks/{0d23610475c85385fbff.js → 355e6bcdb401ada71f39.js} +1 -1
- package/assets/esri/core/workers/chunks/{bba6d7615d8f3862fe70.js → 36f0046ff6b46adce7b7.js} +1 -1
- package/assets/esri/core/workers/chunks/{1c86aa3802d9ae0230ae.js → 3916879b9ca8c6979011.js} +1 -1
- package/assets/esri/core/workers/chunks/3a74654fa539f78ceb86.js +1 -0
- package/assets/esri/core/workers/chunks/3adcf78ed1e7cd82666d.js +1 -0
- package/assets/esri/core/workers/chunks/3b63edcd34f832ac7bd8.js +1 -0
- package/assets/esri/core/workers/chunks/{b0522dffa5600345c07e.js → 3e85e63148b5e93d3074.js} +1 -1
- package/assets/esri/core/workers/chunks/4088f4c25a09932a3eb1.js +1 -0
- package/assets/esri/core/workers/chunks/427318722815bef1496b.js +1 -0
- package/assets/esri/core/workers/chunks/464c15b2779f9b803a06.js +1 -0
- package/assets/esri/core/workers/chunks/49089731ecfe7e8bb2f6.js +1 -0
- package/assets/esri/core/workers/chunks/4c3bd6cc0badb78c7112.js +1 -0
- package/assets/esri/core/workers/chunks/4e0bae3671fe1c7efa76.js +1 -0
- package/assets/esri/core/workers/chunks/500fb5f615f0c1db1b66.js +1 -0
- package/assets/esri/core/workers/chunks/52c34d6ecd9d45a33e69.js +1 -0
- package/assets/esri/core/workers/chunks/539541dec5fcf3b657aa.js +1 -0
- package/assets/esri/core/workers/chunks/{fa63b0f7fa799cb2f81d.js → 562800b0af52a38a311b.js} +1 -1
- package/assets/esri/core/workers/chunks/{b87fec1753f164c845c5.js → 58f403f956b7b3467344.js} +1 -1
- package/assets/esri/core/workers/chunks/5bfcb3d87380e7f85b08.js +1 -0
- package/assets/esri/core/workers/chunks/5d3246b8fc50f9d9e2c4.js +1 -0
- package/assets/esri/core/workers/chunks/5e539ce4751bcfa57145.js +1 -0
- package/assets/esri/core/workers/chunks/{6ee41e9c92ed8ba4c763.js → 5ef1095842e21090f1f4.js} +1 -1
- package/assets/esri/core/workers/chunks/6194636638b0439fccd8.js +1 -0
- package/assets/esri/core/workers/chunks/{9fc35ec8185beba96715.js → 632d1a1287dde980479e.js} +1 -1
- package/assets/esri/core/workers/chunks/{1d043965dcdc11b3aeaa.js → 63852887b3f07d50f7c9.js} +1 -1
- package/assets/esri/core/workers/chunks/6a86fee4e945e61d9639.js +1 -0
- package/assets/esri/core/workers/chunks/6b0ae9ccdd1acef5b5b4.js +1 -0
- package/assets/esri/core/workers/chunks/6d90887dc605261dd7b3.js +1 -0
- package/assets/esri/core/workers/chunks/72ea996b03932c0f004f.js +1 -0
- package/assets/esri/core/workers/chunks/7317346ed8d7c5bb859d.js +1 -0
- package/assets/esri/core/workers/chunks/74276044cb75b51967f2.js +1 -0
- package/assets/esri/core/workers/chunks/766e08d0c56b2b31b63b.js +1 -0
- package/assets/esri/core/workers/chunks/{bd7b54db7fd278b15500.js → 7a2189614f2dad49ffcd.js} +1 -1
- package/assets/esri/core/workers/chunks/7ae88c141a5d85e5bb88.js +1 -0
- package/assets/esri/core/workers/chunks/7aef81778155be373d3e.js +1 -0
- package/assets/esri/core/workers/chunks/7e1906d35a764f7f10b0.js +1 -0
- package/assets/esri/core/workers/chunks/7fa46d1e9fcd8c0c6302.js +1 -0
- package/assets/esri/core/workers/chunks/{06eb4832b6c86744e52e.js → 8008f5479f4d16964088.js} +1 -1
- package/assets/esri/core/workers/chunks/80777a9db53bee2ad8a8.js +1 -0
- package/assets/esri/core/workers/chunks/81614beb51405d064a6c.js +1 -0
- package/assets/esri/core/workers/chunks/83db8bd42f94f97c7cf1.js +1 -0
- package/assets/esri/core/workers/chunks/88b1214c284c2ec7d51b.js +1 -0
- package/assets/esri/core/workers/chunks/91d484960df25ec9554b.js +1 -0
- package/assets/esri/core/workers/chunks/92a5dccb328229a9336b.js +1 -0
- package/assets/esri/core/workers/chunks/948c5454881e661c3bdc.js +1 -0
- package/assets/esri/core/workers/chunks/{631205dc4d73d49ec9ed.js → 95507ff0a243e451b99e.js} +1 -1
- package/assets/esri/core/workers/chunks/9cb242dfc3765b590f51.js +1 -0
- package/assets/esri/core/workers/chunks/{1051a5a57b2fb843a555.js → 9cd55043f3d789f41815.js} +1 -1
- package/assets/esri/core/workers/chunks/9ddb0b07be31c3747238.js +1 -0
- package/assets/esri/core/workers/chunks/9f0f1472f36b42c507d1.js +1 -0
- package/assets/esri/core/workers/chunks/{ac2607f1e8cd2e99907c.js → 9f964467f7353039dd9c.js} +3 -3
- package/assets/esri/core/workers/chunks/9fe62638dc7dce466612.js +1 -0
- package/assets/esri/core/workers/chunks/a2e9141ff4efd13413a1.js +66 -0
- package/assets/esri/core/workers/chunks/a693cd3af2e995972252.js +1 -0
- package/assets/esri/core/workers/chunks/a6fb75929e456f87f804.js +1 -0
- package/assets/esri/core/workers/chunks/aaa564c84ee8ea36fbb4.js +1 -0
- package/assets/esri/core/workers/chunks/ad4f65d764654c70a117.js +1 -0
- package/assets/esri/core/workers/chunks/adf6982e2d8102669cdf.js +1 -0
- package/assets/esri/core/workers/chunks/af0d7a7cbbaad47a49c6.js +1 -0
- package/assets/esri/core/workers/chunks/af2f2df3c43b49ad1a70.js +1 -0
- package/assets/esri/core/workers/chunks/b09539a4b491a90a6bbe.js +1 -0
- package/assets/esri/core/workers/chunks/{d9b2263e0a9f9068ab62.js → b6c3a2d93a59df9a1418.js} +1 -1
- package/assets/esri/core/workers/chunks/{d7b640f7a181bd26c7c7.js → bac5e1d50b69f0d94694.js} +1 -1
- package/assets/esri/core/workers/chunks/bbbd58b02a3ee8fe595e.js +1 -0
- package/assets/esri/core/workers/chunks/{9ca480eb8b2312381ccf.js → bcadcb709e622f2aaaf9.js} +1 -1
- package/assets/esri/core/workers/chunks/{6993a59cbb78bc26f029.js → c45a314ace9725aa250e.js} +1 -1
- package/assets/esri/core/workers/chunks/{c16e0da7a19310c71e8b.js → c6cd8784a3e222eb2d4a.js} +1 -1
- package/assets/esri/core/workers/chunks/{571252c9822d73cf7b01.js → c6fa79ce324122e08dbb.js} +1 -1
- package/assets/esri/core/workers/chunks/c8856370bae65d9eeb2b.js +1 -0
- package/assets/esri/core/workers/chunks/{97c148adf0347c69a79c.js → c9604f8df909ec4fad46.js} +1 -1
- package/assets/esri/core/workers/chunks/c96fed4889712f5a9135.js +1 -0
- package/assets/esri/core/workers/chunks/{faa40ef04604c7cce706.js → cb63ea6a53d3c2fc3179.js} +1 -1
- package/assets/esri/core/workers/chunks/cc37bfa72c34bc2ef993.js +1 -0
- package/assets/esri/core/workers/chunks/cfc5e0ec9b0290407383.js +1 -0
- package/assets/esri/core/workers/chunks/{9a06476b834584d00d5c.js → d0372bac0c5f4fbed468.js} +1 -1
- package/assets/esri/core/workers/chunks/d28d874c1337b69fedc0.js +1 -0
- package/assets/esri/core/workers/chunks/{54f4a1131f99468db076.js → d33a5d79f2163ad62b1d.js} +1 -1
- package/assets/esri/core/workers/chunks/{0bbb38f59f37c51c72f0.js → d45a4e5806a80b69ceec.js} +1 -1
- package/assets/esri/core/workers/chunks/{7a23dc625a812a562c21.js → d5f770302dc686e55ba7.js} +1 -1
- package/assets/esri/core/workers/chunks/d942cb9cf82b1c056979.js +1 -0
- package/assets/esri/core/workers/chunks/dc14507cfc052faa5890.js +1 -0
- package/assets/esri/core/workers/chunks/{ca60b34c3e1ed2ff5934.js → dd2b316baae02bbdddac.js} +1 -1
- package/assets/esri/core/workers/chunks/dea3e131bbd48cc48e1a.js +346 -0
- package/assets/esri/core/workers/chunks/df84863cb0600f658541.js +1 -0
- package/assets/esri/core/workers/chunks/e0ae33206f519b159b49.js +1 -0
- package/assets/esri/core/workers/chunks/e7589c39b13295af8f1d.js +1 -0
- package/assets/esri/core/workers/chunks/e7a440476cd1eb4c6547.js +1 -0
- package/assets/esri/core/workers/chunks/{e3c1aea34ece8336dae1.js → e9aa1d9ded8a52a40c57.js} +1 -1
- package/assets/esri/core/workers/chunks/eb23ce385b0d18959c7c.js +1 -0
- package/assets/esri/core/workers/chunks/{80b596496800e8d60eb8.js → ed75e0962358523f4439.js} +1 -1
- package/assets/esri/core/workers/chunks/ede9738ac20e7dd5ce63.js +1 -0
- package/assets/esri/core/workers/chunks/eec034d88db320880133.js +1 -0
- package/assets/esri/core/workers/chunks/f2aa8090827086c62dde.js +1 -0
- package/assets/esri/core/workers/chunks/f48eb59b94ba8b7d4d72.js +1 -0
- package/assets/esri/core/workers/chunks/f5741d09fd4e1809f580.js +1 -0
- package/assets/esri/core/workers/chunks/fe3832107278244dc04d.js +1 -0
- package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
- package/assets/esri/themes/base/widgets/_Directions.scss +1 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_en.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_no.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_en.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
- package/chunks/FocusAreaColor.glsl.js +10 -8
- package/chunks/FocusAreaMask.glsl.js +1 -1
- package/chunks/Laserlines.glsl.js +2 -2
- package/chunks/aiServices.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/persistableUrlUtils.js +1 -1
- package/chunks/sphere.js +1 -1
- package/chunks/vec42.js +1 -1
- package/config.js +1 -1
- package/core/accessorSupport/decorators/persistable.js +1 -1
- package/core/accessorSupport/ensureType.js +1 -1
- package/core/libs/gl-matrix-2/math/quat.js +1 -1
- package/core/libs/gl-matrix-2/math/vec4.js +1 -1
- package/core/workers/Connection.js +1 -1
- package/core/workers/RemoteClient.js +1 -1
- package/core/workers/WorkerHandle.js +1 -1
- package/effects/FocusArea.d.ts +4 -0
- package/effects/FocusArea.js +5 -0
- package/effects/FocusAreaOutline.d.ts +4 -0
- package/effects/FocusAreaOutline.js +5 -0
- package/effects/FocusAreas.d.ts +4 -0
- package/effects/FocusAreas.js +5 -0
- package/form/elements/GroupElement.js +1 -1
- package/form/elements/inputs.js +1 -1
- package/form/elements.js +1 -1
- package/geometry/projection/projectPointToVector.js +1 -1
- package/geometry/projection/projectVectorToPoint.js +1 -1
- package/geometry/projection/projectVectorToVector.js +1 -1
- package/geometry/projection.js +1 -1
- package/geometry/projectionUtils.js +5 -0
- package/geometry/support/frustum.js +1 -1
- package/geometry/support/meshUtils/elevation.js +1 -1
- package/geometry/support/meshUtils/extent.js +1 -1
- package/geometry/support/sphere.js +1 -1
- package/geometry.js +1 -1
- package/interfaces.d.ts +745 -567
- package/kernel.js +1 -1
- package/layers/BuildingSceneLayer.js +1 -1
- package/layers/CatalogLayer.js +1 -1
- package/layers/GeoJSONLayer.js +1 -1
- package/layers/GroupLayer.js +1 -1
- package/layers/ImageryLayer.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/MapNotesLayer.js +1 -1
- package/layers/OGCFeatureLayer.js +1 -1
- package/layers/RouteLayer.js +1 -1
- package/layers/VideoLayer.js +1 -1
- package/layers/WFSLayer.js +1 -1
- package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
- package/layers/catalog/CatalogFootprintLayer.js +1 -1
- package/layers/graphics/applyEditsUtils.js +1 -1
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/graphics/data/projectionSupport.js +1 -1
- package/layers/graphics/data/queryUtils.js +1 -1
- package/layers/graphics/editingSupport.js +1 -1
- package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/mixins/operationalLayerModuleMap.js +1 -1
- package/layers/mixins/operationalLayers.js +1 -1
- package/layers/ogc/wfsUtils.js +1 -1
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
- package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/layers/support/BuildingSummaryStatistics.js +1 -1
- package/layers/support/ControlPointsGeoreference.js +1 -1
- package/layers/support/CornersGeoreference.js +1 -1
- package/layers/support/ElevationQuery.js +1 -1
- package/layers/support/ExtentAndRotationGeoreference.js +1 -1
- package/layers/support/GeoreferenceBase.js +1 -1
- package/layers/support/LocalMediaElementSource.js +1 -1
- package/layers/support/MediaElementView.js +1 -1
- package/layers/support/PolygonCollection.js +1 -1
- package/layers/support/PromiseQueue.js +1 -1
- package/layers/support/SceneModification.js +1 -1
- package/layers/support/TelemetryDisplay.js +1 -1
- package/layers/support/TitleCreator.js +1 -1
- package/layers/support/arcgisLayers.js +1 -1
- package/layers/support/featurePopupQueryUtils.js +5 -0
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/layersCreator.js +1 -1
- package/layers/support/multiLayerServiceUtils.js +5 -0
- package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/layers/video/videoUtils.js +1 -1
- package/networks/CircuitManager.js +1 -1
- package/networks/UnitIdentifierManager.js +1 -1
- package/networks/UtilityNetwork.js +1 -1
- package/networks/support/UNTraceConfiguration.js +1 -1
- package/networks/support/typeUtils.js +1 -1
- package/package.json +1 -1
- package/portal/PortalItem.js +1 -1
- package/portal/schemas/definitions.js +1 -1
- package/portal/schemas/webScene.js +1 -1
- package/portal/support/layersLoader.js +1 -1
- package/portal/support/portalItemUtils.js +1 -1
- package/portal/support/portalLayers.js +1 -1
- package/rasterRenderers.js +1 -1
- package/renderers/RasterStretchRenderer.js +1 -1
- package/renderers/support/AuthoringInfoVisualVariable.js +1 -1
- package/renderers/support/RasterSymbolizer.js +1 -1
- package/renderers/support/colorRampUtils.js +1 -1
- package/renderers/support/rasterRendererHelper.js +1 -1
- package/renderers.js +1 -1
- package/rest/featureService/FeatureService.js +1 -1
- package/rest/knowledgeGraph/GraphAddFieldIndexResult.js +5 -0
- package/rest/knowledgeGraph/GraphAddNamedTypesResult.js +1 -1
- package/rest/knowledgeGraph/GraphAddPropertyResult.js +1 -1
- package/rest/knowledgeGraph/GraphDataModelOperationResult.js +5 -0
- package/rest/knowledgeGraph/GraphDeleteFieldIndexResult.js +5 -0
- package/rest/knowledgeGraph/GraphDeleteNamedTypeResult.js +1 -1
- package/rest/knowledgeGraph/GraphDeletePropertyResult.js +1 -1
- package/rest/knowledgeGraph/GraphUpdateNamedTypesResult.js +1 -1
- package/rest/knowledgeGraph/GraphUpdatePropertyResult.js +1 -1
- package/rest/knowledgeGraph/GraphUpdateSearchIndexResult.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/updateToWasmEncodedFactories.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/wasmToDataModelChangeResponseFactories.js +1 -1
- package/rest/knowledgeGraphService.js +1 -1
- package/rest/locator/locationToAddress.js +1 -1
- package/rest/networks/circuits/queryCircuits.js +1 -1
- package/rest/networks/circuits/support/QueryCircuitsParameters.js +1 -1
- package/rest/networks/queryAssociations.js +1 -1
- package/rest/networks/support/CircuitPath.js +5 -0
- package/rest/networks/support/CircuitPathConnectivityElement.js +5 -0
- package/rest/networks/support/CircuitTraceResult.js +5 -0
- package/rest/networks/support/TraceLocation.js +1 -1
- package/rest/networks/support/TraceResult.js +1 -1
- package/rest/networks/unitIdentifiers/support/{QueryUnitIdentifiersParamters.js → QueryUnitIdentifiersParameters.js} +1 -1
- package/rest/support/LocationToAddressParameters.js +1 -1
- package/rest/support/geocodeEnums.js +5 -0
- package/smartMapping/renderers/pieChart.js +1 -1
- package/smartMapping/renderers/predominance.js +1 -1
- package/smartMapping/renderers/size.js +1 -1
- package/smartMapping/renderers/support/rendererUtils.js +1 -1
- package/smartMapping/renderers/support/spikeUtils.d.ts +4 -0
- package/smartMapping/renderers/support/spikeUtils.js +1 -1
- package/smartMapping/statistics/histogram.js +1 -1
- package/smartMapping/statistics/summaryStatistics.js +1 -1
- package/support/persistableUrlUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/animationUtils.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/defaultCIMValues.js +1 -1
- package/symbols/cim/effects/EffectEnclosingPolygon.js +1 -1
- package/symbols/cim/utils.js +1 -1
- package/symbols/support/ElevationInfo.d.ts +4 -0
- package/symbols/support/ElevationInfo.js +1 -1
- package/symbols/support/FeatureExpressionInfo.d.ts +4 -0
- package/symbols/support/FeatureExpressionInfo.js +1 -1
- package/symbols/support/cimSymbolUtils.js +1 -1
- package/symbols/support/previewCIMSymbol.js +1 -1
- package/symbols.js +1 -1
- package/undoredo/support/Services.js +1 -1
- package/views/2d/ViewStateManager.js +1 -1
- package/views/2d/constraints/GeometryConstraint.js +1 -1
- package/views/2d/engine/Bitmap.js +1 -1
- package/views/2d/engine/flow/styles/Imagery.js +1 -1
- package/views/2d/engine/vectorTiles/GlyphMosaic.js +1 -1
- package/views/2d/engine/vectorTiles/SpriteMosaic.js +1 -1
- package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/SymbolDeclutterer.js +1 -1
- package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
- package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
- package/views/2d/engine/webgl/Overlay.js +1 -1
- package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
- package/views/2d/engine/webgl/SpriteMosaic.js +1 -1
- package/views/2d/engine/webgl/animations/infos.js +1 -1
- package/views/2d/engine/webgl/animations/instructions.js +1 -1
- package/views/2d/engine/webgl/animations/utils.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushTileDebugInfo.js +1 -1
- package/views/2d/engine/webgl/effects/highlight/HighlightGradient.js +1 -1
- package/views/2d/engine/webgl/effects/post-processing/Colorize.js +1 -1
- package/views/2d/engine/webgl/effects/post-processing/DropShadow.js +1 -1
- package/views/2d/engine/webgl/effects/post-processing/Opacity.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/GraphicInstanceStore.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueType.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedPolyShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedLineShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechniques.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/ComputedAnimatedParams.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/attributes.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/enums.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/blend/BlendTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityResources.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/magnifier/MagnifierTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/textureUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/utils.js +1 -1
- package/views/2d/grid/GridView2D.js +1 -1
- package/views/2d/interactive/editingTools/ControlPointsTransformTool.js +1 -1
- package/views/2d/interactive/editingTools/TransformTool.js +1 -1
- package/views/2d/layers/KMLLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/VideoLayerView2D.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/utils.js +1 -1
- package/views/2d/viewpointUtils.js +1 -1
- package/views/3d/FocusAreasView.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/analysis/support/projectionUtils.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/environment/LocalAtmosphere.js +1 -1
- package/views/3d/environment/MarsAtmosphere.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
- package/views/3d/interactive/editingTools/media/MediaElementControllerControlPoints.js +1 -1
- package/views/3d/interactive/editingTools/media/MediaElementControllerShape.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
- package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
- package/views/3d/interactive/visualElements/support/Segment.js +1 -1
- package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
- package/views/3d/layers/DrapedSubView3D.js +1 -1
- package/views/3d/layers/DynamicLayerView3D.js +1 -1
- package/views/3d/layers/FeatureLayerView3D.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/I3SMeshWorkerHandle.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/SceneLayerWorker.js +1 -1
- package/views/3d/layers/SubView3D.js +1 -1
- package/views/3d/layers/TileLayerView3D.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/graphics/Graphics3DFeatureStore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/focusAreaStyle.js +1 -1
- package/views/3d/layers/graphics/graphicUtils.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
- package/views/3d/layers/i3s/I3SUtil.js +1 -1
- package/views/3d/layers/support/DefinitionExpressionSceneLayerView.js +1 -1
- package/views/3d/layers/support/FeatureVisibilityFilter.js +1 -1
- package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
- package/views/3d/layers/support/PopupSceneLayerView.js +1 -1
- package/views/3d/state/NearFarHeuristic.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/engineContent/marker.js +1 -1
- package/views/3d/support/geometryUtils/sphere.js +1 -1
- package/views/3d/support/sunUtils.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/ExtentHelper.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/webgl/RenderCamera.js +1 -1
- package/views/3d/webgl/RenderNode.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +3 -3
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaEffect.js +5 -0
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaOutlineItem.js +5 -0
- package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
- package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
- package/views/3d/webgl-engine/lib/Octree.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/stippleTextureRepository.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/FocusAreaColor.glsl.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/SelectionManager.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/View2D.js +1 -1
- package/views/draw/support/GraphicMover.js +1 -1
- package/views/interactive/GraphicManipulator.js +1 -1
- package/views/interactive/dragEventPipeline.js +1 -1
- package/views/interactive/snapping/GridSnappingEngine.js +1 -1
- package/views/interactive/snapping/SnappingManager.js +1 -1
- package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
- package/views/layers/CatalogDynamicGroupLayerView.js +1 -1
- package/views/layers/CatalogFootprintLayerView.js +1 -1
- package/views/layers/FeatureLayerView.js +1 -1
- package/views/layers/ImageryLayerView.js +1 -1
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/views/layers/PointCloudLayerView.js +1 -1
- package/views/layers/SceneLayerView.js +1 -1
- package/views/support/TextureCompressionTracker.js +5 -0
- package/views/support/imageReprojection.js +1 -1
- package/views/support/projectionUtils.js +1 -1
- package/views/webgl/RenderingContext.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/views/webgl/rasterUtils.js +1 -1
- package/webdoc/support/writeUtils.js +1 -1
- package/webmap/utils.js +1 -1
- package/webscene/Slide.js +1 -1
- package/widgets/Attachments.js +1 -1
- package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
- package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
- package/widgets/CoordinateConversion/support/Format.js +1 -1
- package/widgets/Daylight/DaylightViewModel.js +1 -1
- package/widgets/Directions/DirectionsVisibleElements.js +1 -1
- package/widgets/Directions/css.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/Editor/AddAssociationWorkflowData.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflowData.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflowData.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/Upload.js +1 -1
- package/widgets/Editor/components/Notices.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/Editor/support/SketchController.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
- package/widgets/Expand.js +1 -1
- package/widgets/Feature/support/featureUtils.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm/VisibleElements.js +1 -1
- package/widgets/FeatureForm/featureFormUtils.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FieldColumn.js +1 -1
- package/widgets/FeatureTable/Grid/EditorColumn.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
- package/widgets/OrientedImageryViewer/videoViewerUtils.js +5 -0
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Search/LocatorSearchSource.js +1 -1
- package/widgets/Search/SearchSource.js +1 -1
- package/widgets/Search/SearchViewModel.js +1 -1
- package/widgets/Search/support/locatorUtils.js +1 -1
- package/widgets/ShadowCast/DiscreteOptions.js +1 -1
- package/widgets/ShadowCast/DurationOptions.js +1 -1
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/widgets/ShadowCast/ShadowCastVisibleElements.js +1 -1
- package/widgets/ShadowCast/ThresholdOptions.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/UtilityNetworkTrace/support/GeometryHandler.js +1 -1
- package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
- package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
- package/widgets/VideoPlayer.js +1 -1
- package/widgets/support/AnchorElementViewModel.js +1 -1
- package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/Selector2D/SelectionOperation.js +1 -1
- package/widgets/support/Selector2D/selectorUtils.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/utils/isFromElement.js +1 -1
- package/widgets/support/tests.js +1 -1
- package/assets/esri/core/workers/chunks/003ddb190a5cc56f7925.js +0 -1
- package/assets/esri/core/workers/chunks/094e8aae6dada24c8115.js +0 -1
- package/assets/esri/core/workers/chunks/0a770f283eb77c8dc97a.js +0 -1
- package/assets/esri/core/workers/chunks/0b70b2ee62904318a12c.js +0 -1
- package/assets/esri/core/workers/chunks/0c2dccec20c0994366fe.js +0 -1
- package/assets/esri/core/workers/chunks/0cf979a093e9744d1e80.js +0 -1
- package/assets/esri/core/workers/chunks/0fb5de3f8a4d69b2d514.js +0 -1
- package/assets/esri/core/workers/chunks/1d7f2abfccc54659d6f2.js +0 -1
- package/assets/esri/core/workers/chunks/1f9c6fbcd4d0eae1e574.js +0 -1
- package/assets/esri/core/workers/chunks/24327d01cb2c5c55a4b7.js +0 -1
- package/assets/esri/core/workers/chunks/253bcc3cc7bc4c2dc6ea.js +0 -1
- package/assets/esri/core/workers/chunks/2b1486a466760d2152f5.js +0 -1
- package/assets/esri/core/workers/chunks/2cf82d3645c75d311e99.js +0 -1
- package/assets/esri/core/workers/chunks/2d90806faa4269828948.js +0 -1
- package/assets/esri/core/workers/chunks/306e262f148b3057b11b.js +0 -1
- package/assets/esri/core/workers/chunks/32ee2708edd307954125.js +0 -1
- package/assets/esri/core/workers/chunks/36b0d6b4089a96475201.js +0 -1
- package/assets/esri/core/workers/chunks/377a7f0f7d304ff9fe5b.js +0 -1
- package/assets/esri/core/workers/chunks/3a743653b786b010a57f.js +0 -1
- package/assets/esri/core/workers/chunks/3bf1cf6c3cba172e2f6d.js +0 -1
- package/assets/esri/core/workers/chunks/3d7eedb787c1e3b9fbfc.js +0 -1
- package/assets/esri/core/workers/chunks/3fe7be535affae31de7e.js +0 -1
- package/assets/esri/core/workers/chunks/40f54c4f8ae63c6f3df9.js +0 -1
- package/assets/esri/core/workers/chunks/417293f00b2c21cc3175.js +0 -1
- package/assets/esri/core/workers/chunks/41cbba9b286cf5558a9c.js +0 -1
- package/assets/esri/core/workers/chunks/42d9989b2aad3ac28d4d.js +0 -1
- package/assets/esri/core/workers/chunks/465f2db4ab8aa9c9f907.js +0 -1
- package/assets/esri/core/workers/chunks/4ca0738ed38c15b68a77.js +0 -1
- package/assets/esri/core/workers/chunks/515e3295495d0958db7e.js +0 -1
- package/assets/esri/core/workers/chunks/51c31e6d014005107d42.js +0 -1
- package/assets/esri/core/workers/chunks/523046e04679e301797d.js +0 -1
- package/assets/esri/core/workers/chunks/536d7986ebb710a8a452.js +0 -1
- package/assets/esri/core/workers/chunks/55f087bca75c3f2a4515.js +0 -1
- package/assets/esri/core/workers/chunks/5617532299f73d186968.js +0 -1
- package/assets/esri/core/workers/chunks/56d2a20c1b143697aa19.js +0 -1
- package/assets/esri/core/workers/chunks/585c7b485c42555ec554.js +0 -346
- package/assets/esri/core/workers/chunks/5890740d5a761b038560.js +0 -1
- package/assets/esri/core/workers/chunks/5dbd8d81d94cfda5bb32.js +0 -1
- package/assets/esri/core/workers/chunks/5e1f7fe6bbc5754efee1.js +0 -1
- package/assets/esri/core/workers/chunks/62b2d3720693c93a60f2.js +0 -1
- package/assets/esri/core/workers/chunks/66e79aa02b3aa12b3778.js +0 -1
- package/assets/esri/core/workers/chunks/67338948e470c1251d8a.js +0 -66
- package/assets/esri/core/workers/chunks/6b23ca6570357f9fb724.js +0 -1
- package/assets/esri/core/workers/chunks/6d1e1a4fcb90ea8b6848.js +0 -1
- package/assets/esri/core/workers/chunks/6ecc3a3737ae8622dfa4.js +0 -1
- package/assets/esri/core/workers/chunks/85efb318cda7260221ae.js +0 -1
- package/assets/esri/core/workers/chunks/86023cc5ccbc7ac43479.js +0 -1
- package/assets/esri/core/workers/chunks/87eca6de502d18d8b7eb.js +0 -1
- package/assets/esri/core/workers/chunks/87fc7b6c3e2d4f7775e2.js +0 -1
- package/assets/esri/core/workers/chunks/937b653b10e8704b38bf.js +0 -1
- package/assets/esri/core/workers/chunks/98ef17d15517368d2383.js +0 -1
- package/assets/esri/core/workers/chunks/9cac00d4bfac14aaae12.js +0 -1
- package/assets/esri/core/workers/chunks/a036503087baa1f9fd00.js +0 -1
- package/assets/esri/core/workers/chunks/a0c35521e677459f6fa3.js +0 -1
- package/assets/esri/core/workers/chunks/aaa6d45316a7d3466d0f.js +0 -1
- package/assets/esri/core/workers/chunks/ae733c963d61065faa54.js +0 -1
- package/assets/esri/core/workers/chunks/b06cb23048c32940f5de.js +0 -1
- package/assets/esri/core/workers/chunks/b5d68d8460b7c15001dd.js +0 -1
- package/assets/esri/core/workers/chunks/bf3555f91492a1a3b613.js +0 -1
- package/assets/esri/core/workers/chunks/bf9b6b74654d303a6dae.js +0 -1
- package/assets/esri/core/workers/chunks/c6580fdcdc33153008b0.js +0 -1
- package/assets/esri/core/workers/chunks/c779335f5d5455c77a62.js +0 -1
- package/assets/esri/core/workers/chunks/c9ab067b07d1eab974d1.js +0 -1
- package/assets/esri/core/workers/chunks/d2ebb72a43d995ed368a.js +0 -1
- package/assets/esri/core/workers/chunks/d3d98ea5b5e56fc60a31.js +0 -1
- package/assets/esri/core/workers/chunks/d52f5214a0330ed2e05e.js +0 -1
- package/assets/esri/core/workers/chunks/d839a237d5edc243d645.js +0 -1
- package/assets/esri/core/workers/chunks/dbe10c20df7e0e563a0b.js +0 -1
- package/assets/esri/core/workers/chunks/df7ca2fe12e22ccfde17.js +0 -1
- package/assets/esri/core/workers/chunks/df933eac03dc63064723.js +0 -1
- package/assets/esri/core/workers/chunks/e04bcc98a557f77cc6fa.js +0 -1
- package/assets/esri/core/workers/chunks/e77371ddbaf4b2d9be8d.js +0 -1
- package/assets/esri/core/workers/chunks/e89345c7af9d3d4d8452.js +0 -1
- package/assets/esri/core/workers/chunks/ee6240636d04d7d37b7b.js +0 -1
- package/assets/esri/core/workers/chunks/f00f8609bf0d14b488b8.js +0 -1
- package/assets/esri/core/workers/chunks/fc0a3db3d6d26c763fb9.js +0 -1
- package/assets/esri/core/workers/chunks/fc61d02286b6ff5447cc.js +0 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerTechnique.js +0 -5
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedShader.js +0 -5
- package/views/FocusArea.js +0 -5
- package/views/FocusAreaOutline.js +0 -5
- package/views/FocusAreaOutlineItem.js +0 -5
- package/views/FocusAreas.js +0 -5
- package/views/support/TextureCompressionHandle.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Evented.js";import{makeHandle as i}from"../../core/handleUtils.js";import n from"../../core/Logger.js";import{removeMaybe as s}from"../../core/maybe.js";import{when as a,watch as l,on as r,initial as o,syncAndInitial as h}from"../../core/reactiveUtils.js";import{schedule as g}from"../../core/scheduling.js";import{truncateLocalTime as d,isValidDate as p,resetUTCDate as u,offsetDate as c}from"../../core/timeUtils.js";import{property as y}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import _ from"../../views/3d/environment/SunLighting.js";import f from"../../views/3d/environment/VirtualLighting.js";import{positionToTimezoneInfo as D}from"../../views/3d/support/earthUtils.js";import{dateTimeToSliderPos as w,sliderPosToDateTime as T,getSeasonFromDate as S,getNorthernHemisphereSeason as U,getSeasonDate as v,Hemisphere as L,calculatePlaySpeed as P}from"./support/daylightUtils.js";import{SliderWithDropdownViewModel as b}from"./support/SliderWithDropdownViewModel.js";import{formatSliderLabel as C,getSunriseAndSunsetTimes as E}from"../support/timeWidgetUtils.js";let O=class extends e.EventedAccessor{constructor(t){super(t),this.view=null,this.timeSliderViewModel=new b({min:0,max:1439,values:[0],labelFormatFunction:C,inputFormatFunction:C}),this.lightingUpdateInterval=200,this._oldLighting=null,this.playSpeedMultiplier=1,this._lastTime=null,this._sunrise=null,this._sunset=null,this._cachedLightingDateUTC=new Date(0),this._cachedDisplayUTCOffset=0,this._lastLightingUpdate=0,this._lightingUpdateHandle=null}initialize(){this.addHandles([a((()=>this.view),(t=>t.when((()=>this._updateLighting()))),o),l((()=>{const t=this._lighting;return"sun"===t?.type?this._ensureValidDate(t):null}),(t=>this._scheduleLightingUpdate(t))),r((()=>this._lighting),"timezone-will-change",(t=>this._timezoneWillChange(t)),{onListenerAdd:()=>this._timezoneWillChange(null)}),l((()=>!0===this.view?.stationary),(()=>{(this.dayPlaying||this.yearPlaying)&&this._updateSunriseAndSunset()}),o),l((()=>{const t=this.timeSliderViewModel;return{vm:t,state:t.state,sliderPosition:this.timeSliderPosition}}),(({vm:t,state:e,sliderPosition:i})=>{"ready"===e&&t.setValue(0,i)})),l((()=>this.timeSliderViewModel?.utcOffset),(t=>{null!=t&&(this.utcOffset=t)})),l((()=>({utcOffset:this.utcOffset,sliderViewModel:this.timeSliderViewModel})),(({utcOffset:t,sliderViewModel:e})=>{e&&(e.utcOffset=t)}),h),l((()=>this.timeSliderViewModel.timezonePickerOpen),(()=>this.stopPlaying())),l((()=>this.timeSliderViewModel.values),(t=>this._setTimeSliderPosition(t?.[0]??0,{forceLightingUpdate:!1})))])}destroy(){this._cancelLightingUpdate(),this.view=null}get isSupported(){return null==this.view||"3d"===this.view.type}get utcOffset(){return this._cachedDisplayUTCOffset}set utcOffset(t){t!==this.utcOffset&&null!=this._lighting&&"virtual"!==this._lighting.type&&(this._lighting.displayUTCOffset=t,this._updateLighting())}get localDate(){return d(this._lightingDateDisplay)}set localDate(t){this.view?.ready?p(t)&&t.getTime()!==this.localDate.getTime()&&(this._lightingDateDisplay=u(this._lightingDateDisplay,t)):n.getLogger(this).error("The localDate property cannot be set before the view and the widget are ready.")}get timeSliderPosition(){return w(this._lightingDateDisplay)}set timeSliderPosition(t){this.view?.ready&&"ready"===this.timeSliderViewModel?.state?this._setTimeSliderPosition(t,{forceLightingUpdate:!0}):n.getLogger(this).error("The timeSliderPosition property cannot be set before the view and the widget are ready.")}_setTimeSliderPosition(t,e){Math.abs(t-this.timeSliderPosition)<=1/60||(this.stopPlaying(),this._onUserDateTimeChange(),e.forceLightingUpdate&&(this._cancelLightingUpdate(),this._updateLighting()),this._lightingDateDisplay=T(this._lightingDateDisplay,t))}_timezoneFromCamera(t,e){if(null==e||!t.cameraTrackingEnabled)return 0;const i=D([e.longitude,e.latitude]);return null==i?0:Math.round(i.hours+i.minutes/60+i.seconds/3600)}get directShadowsEnabled(){return this._lighting?.directShadowsEnabled??!1}set directShadowsEnabled(t){const e=this._lighting;e&&(e.directShadowsEnabled=t)}get sunLightingEnabled(){return"sun"===this._lightingType}set sunLightingEnabled(t){const e=this._environment;if(t===this._get("sunLightingEnabled")||null==e)return;const i=e.lighting,n=this._oldLighting;this._oldLighting=i;const s={directShadowsEnabled:i.directShadowsEnabled,cameraTrackingEnabled:i.cameraTrackingEnabled},a=t?"sun":"virtual";let l;l=null!=n&&n.type===a?n:t?new _:new f,l.set(s),e.lighting=l,t||(this.stopPlaying(),this.timeSliderViewModel.timezonePickerOpen=!1)}set playingState(t){this.playingState!==t&&(this._set("playingState",t),"none"!==t&&this.sunLightingEnabled&&(this._updateSunriseAndSunset(),this._lastTime=Date.now(),this._play(),this._onUserDateTimeChange()))}get dayPlaying(){return"day"===this.playingState}set dayPlaying(t){t?this.playingState="day":this.dayPlaying&&(this.playingState="none")}get yearPlaying(){return"year"===this.playingState}set yearPlaying(t){t?this.playingState="year":this.yearPlaying&&(this.playingState="none")}get currentSeason(){return S(this.localDate,this._currentHemisphere)}set currentSeason(t){this.stopPlaying(),this._onUserDateTimeChange();const e=U(t,this._currentHemisphere);this.localDate=v(this.localDate,e,L.NORTHERN)}get _currentHemisphere(){const t=this.view?.camera?.position?.latitude;return null==t||t>=0?L.NORTHERN:L.SOUTHERN}get _environment(){return this.view?.environment}get _lighting(){return this._environment?.lighting}get _lightingType(){return this._lighting?.type}get _lightingDateDisplay(){return c(this._cachedLightingDateUTC,this._cachedDisplayUTCOffset,"hours")}set _lightingDateDisplay(t){const e=this._lighting;if(null==e||!this.sunLightingEnabled||"virtual"===e.type||!p(t))return;const i=this._ensureValidDate(e),n=c(t,-this._cachedDisplayUTCOffset,"hours");n.getTime()!==i.getTime()&&(e.date=n,this._updateLighting())}stopPlaying(){this.playingState="none"}toggleDayPlaying(){this.dayPlaying=!this.dayPlaying}toggleYearPlaying(){this.yearPlaying=!this.yearPlaying}toggleSunLightingEnabled(){this.stopPlaying(),this.sunLightingEnabled=!this.sunLightingEnabled}toggleDirectShadowsEnabled(){this.stopPlaying(),this.directShadowsEnabled=!this.directShadowsEnabled}onDateChange(t){this.dayPlaying=!1,this.localDate=t,this._onUserDateTimeChange()}_updateLighting(t){const e=Date.now();this._lastLightingUpdate=e;const{view:i}=this,n=this._lighting;if(null==i||null==n||"virtual"===n.type)return;t??=this._ensureValidDate(n);const s=n.displayUTCOffset,a=null!=s?s:this._timezoneFromCamera(n,i.camera?.position);this._cachedLightingDateUTC.getTime()!==t.getTime()&&(this._cachedLightingDateUTC=new Date(t.getTime())),this._cachedDisplayUTCOffset!==a&&(this._cachedDisplayUTCOffset=a)}_timezoneWillChange(t){const e=this._lighting;if(null==e||"virtual"===e.type||!e.cameraTrackingEnabled)return;let i;if(t)i=t.timezoneOffset;else{if(null!=e.displayUTCOffset)return;i=_.calculateTimezoneOffset(e.positionTimezoneInfo)}e.displayUTCOffset=i,this._scheduleLightingUpdate()}_scheduleLightingUpdate(t){if(t&&(this._lightingUpdateHandle=s(this._lightingUpdateHandle),!p(t)))return;if(this._lightingUpdateHandle)return;const e=Date.now()-this._lastLightingUpdate,n=this.lightingUpdateInterval-e;let a=null;const l=()=>{this._updateLighting(t),this._lightingUpdateHandle===a&&(this._lightingUpdateHandle=null)};if(n<=0)this._lightingUpdateHandle=a=g(l);else{const t=setTimeout(l,n);this._lightingUpdateHandle=a=i((()=>clearTimeout(t)))}}_cancelLightingUpdate(){this._lightingUpdateHandle=s(this._lightingUpdateHandle)}_play(){const t=this._lighting;if(null==t||!this.sunLightingEnabled||"virtual"===t.type)return;const e=this._ensureValidDate(t);if(this.dayPlaying||this.yearPlaying){const i=Date.now()-(this._lastTime??0);if(this.dayPlaying){this._lastTime=Date.now();const n=P(this._sunrise,this._sunset,e)*this.playSpeedMultiplier/100*i;if(n>0){let i=new Date(e.getTime()+n);const s=t.displayUTCOffset??0;if(((i.getUTCHours()+s)%24+24)%24<((e.getUTCHours()+s)%24+24)%24){const t=864e5;i=new Date(e.getTime()+n-t)}t.date=i}}else{if(i>1e3){this._lastTime=Date.now();const i=(e.getUTCMonth()+1)%12,n=new Date(e.getTime());n.setUTCMonth(i),t.date=n}}requestAnimationFrame((()=>this._play()))}}_updateSunriseAndSunset(){const t=this._lighting;if(null==t||"virtual"===t.type||!this.sunLightingEnabled)return;const e=this.view?.camera?.position;if(null==e)return;const{latitude:i,longitude:n}=e,{date:s,displayUTCOffset:a}=t,l=E(s,i,n,a??0);l&&(this._sunrise=new Date(l.sunrise),this._sunset=new Date(l.sunset))}_ensureValidDate(t){return p(t.date)||(n.getLogger(this).warn("Invalid date. Reverting to the current date/time."),t.date=new Date),t.date}_onUserDateTimeChange(){this.emit("user-date-time-change",{})}};t([y()],O.prototype,"view",void 0),t([y({type:b,nonNullable:!0})],O.prototype,"timeSliderViewModel",void 0),t([y()],O.prototype,"isSupported",null),t([y()],O.prototype,"lightingUpdateInterval",void 0),t([y()],O.prototype,"utcOffset",null),t([y({type:Date})],O.prototype,"localDate",null),t([y()],O.prototype,"timeSliderPosition",null),t([y()],O.prototype,"directShadowsEnabled",null),t([y()],O.prototype,"sunLightingEnabled",null),t([y({type:["none","day","year"],value:"none"})],O.prototype,"playingState",null),t([y()],O.prototype,"dayPlaying",null),t([y()],O.prototype,"yearPlaying",null),t([y()],O.prototype,"playSpeedMultiplier",void 0),t([y()],O.prototype,"currentSeason",null),t([y()],O.prototype,"_lastTime",void 0),t([y()],O.prototype,"_sunrise",void 0),t([y()],O.prototype,"_sunset",void 0),t([y()],O.prototype,"_cachedLightingDateUTC",void 0),t([y()],O.prototype,"_cachedDisplayUTCOffset",void 0),t([y()],O.prototype,"_currentHemisphere",null),t([y()],O.prototype,"_environment",null),t([y()],O.prototype,"_lighting",null),t([y()],O.prototype,"_lightingType",null),t([y()],O.prototype,"_lightingDateDisplay",null),O=t([m("esri.widgets.Daylight.DaylightViewModel")],O);const H=O;export{H as default};
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Evented.js";import{makeHandle as i}from"../../core/handleUtils.js";import n from"../../core/Logger.js";import{removeMaybe as s}from"../../core/maybe.js";import{when as a,watch as l,on as o,initial as r,syncAndInitial as h}from"../../core/reactiveUtils.js";import{schedule as g}from"../../core/scheduling.js";import{truncateLocalTime as d,isValidDate as p,resetUTCDate as u,offsetDate as c}from"../../core/timeUtils.js";import{property as y}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import _ from"../../views/3d/environment/SunLighting.js";import f from"../../views/3d/environment/VirtualLighting.js";import{positionToTimezoneInfo as D}from"../../views/3d/support/earthUtils.js";import{dateTimeToSliderPos as w,sliderPosToDateTime as T,getSeasonFromDate as S,getNorthernHemisphereSeason as U,getSeasonDate as v,Hemisphere as L,calculatePlaySpeed as P}from"./support/daylightUtils.js";import{SliderWithDropdownViewModel as b}from"./support/SliderWithDropdownViewModel.js";import{formatSliderLabel as C,getSunriseAndSunsetTimes as E}from"../support/timeWidgetUtils.js";let O=class extends e.EventedAccessor{constructor(t){super(t),this.view=null,this.timeSliderViewModel=new b({min:0,max:1439,values:[0],labelFormatFunction:C,inputFormatFunction:C}),this.lightingUpdateInterval=200,this._oldLighting=null,this.playSpeedMultiplier=1,this._lastTime=null,this._sunrise=null,this._sunset=null,this._cachedLightingDateUTC=new Date(0),this._cachedDisplayUTCOffset=0,this._lastLightingUpdate=0,this._lightingUpdateHandle=null}initialize(){this.addHandles([a((()=>this.view),(t=>t.when((()=>this._updateLighting()))),r),l((()=>{const t=this._lighting;return"sun"===t?.type?t.date:null}),(t=>this._scheduleLightingUpdate(t))),o((()=>this._lighting),"timezone-will-change",(t=>this._timezoneWillChange(t)),{onListenerAdd:()=>this._timezoneWillChange(null)}),l((()=>!0===this.view?.stationary),(()=>{(this.dayPlaying||this.yearPlaying)&&this._updateSunriseAndSunset()}),r),l((()=>{const t=this.timeSliderViewModel;return{vm:t,state:t.state,sliderPosition:this.timeSliderPosition}}),(({vm:t,state:e,sliderPosition:i})=>{"ready"===e&&t.setValue(0,i)})),l((()=>this.timeSliderViewModel?.utcOffset),(t=>{null!=t&&(this.utcOffset=t)})),l((()=>({utcOffset:this.utcOffset,sliderViewModel:this.timeSliderViewModel})),(({utcOffset:t,sliderViewModel:e})=>{e&&(e.utcOffset=t)}),h),l((()=>this.timeSliderViewModel.timezonePickerOpen),(()=>this.stopPlaying())),l((()=>this.timeSliderViewModel.values),(t=>this._setTimeSliderPosition(t?.[0]??0,{forceLightingUpdate:!1})))])}destroy(){this._cancelLightingUpdate(),this.view=null}get isSupported(){return null==this.view||"3d"===this.view.type}get utcOffset(){return this._cachedDisplayUTCOffset}set utcOffset(t){t!==this.utcOffset&&null!=this._lighting&&"virtual"!==this._lighting.type&&(this._lighting.displayUTCOffset=t,this._updateLighting())}get localDate(){return d(this._lightingDateDisplay)}set localDate(t){this.view?.ready?p(t)&&t.getTime()!==this.localDate.getTime()&&(this._lightingDateDisplay=u(this._lightingDateDisplay,t)):n.getLogger(this).error("The localDate property cannot be set before the view and the widget are ready.")}get timeSliderPosition(){return w(this._lightingDateDisplay)}set timeSliderPosition(t){this.view?.ready&&"ready"===this.timeSliderViewModel?.state?this._setTimeSliderPosition(t,{forceLightingUpdate:!0}):n.getLogger(this).error("The timeSliderPosition property cannot be set before the view and the widget are ready.")}_setTimeSliderPosition(t,e){Math.abs(t-this.timeSliderPosition)<=1/60||(this.stopPlaying(),this._onUserDateTimeChange(),e.forceLightingUpdate&&(this._cancelLightingUpdate(),this._updateLighting()),this._lightingDateDisplay=T(this._lightingDateDisplay,t))}_timezoneFromCamera(t,e){if(null==e||!t.cameraTrackingEnabled)return 0;const i=D([e.longitude,e.latitude]);return null==i?0:Math.round(i.hours+i.minutes/60+i.seconds/3600)}get directShadowsEnabled(){return this._lighting?.directShadowsEnabled??!1}set directShadowsEnabled(t){const e=this._lighting;e&&(e.directShadowsEnabled=t)}get sunLightingEnabled(){return"sun"===this._lightingType}set sunLightingEnabled(t){const e=this._environment;if(t===this._get("sunLightingEnabled")||null==e)return;const i=e.lighting,n=this._oldLighting;this._oldLighting=i;const s={directShadowsEnabled:i.directShadowsEnabled,cameraTrackingEnabled:i.cameraTrackingEnabled},a=t?"sun":"virtual";let l;l=null!=n&&n.type===a?n:t?new _:new f,l.set(s),e.lighting=l,t||(this.stopPlaying(),this.timeSliderViewModel.timezonePickerOpen=!1)}set playingState(t){this.playingState!==t&&(this._set("playingState",t),"none"!==t&&this.sunLightingEnabled&&(this._updateSunriseAndSunset(),this._lastTime=Date.now(),this._play(),this._onUserDateTimeChange()))}get dayPlaying(){return"day"===this.playingState}set dayPlaying(t){t?this.playingState="day":this.dayPlaying&&(this.playingState="none")}get yearPlaying(){return"year"===this.playingState}set yearPlaying(t){t?this.playingState="year":this.yearPlaying&&(this.playingState="none")}get currentSeason(){return S(this.localDate,this._currentHemisphere)}set currentSeason(t){this.stopPlaying(),this._onUserDateTimeChange();const e=U(t,this._currentHemisphere);this.localDate=v(this.localDate,e,L.NORTHERN)}get _currentHemisphere(){const t=this.view?.camera?.position?.latitude;return null==t||t>=0?L.NORTHERN:L.SOUTHERN}get _environment(){return this.view?.environment}get _lighting(){return this._environment?.lighting}get _lightingType(){return this._lighting?.type}get _lightingDateDisplay(){return c(this._cachedLightingDateUTC,this._cachedDisplayUTCOffset,"hours")}set _lightingDateDisplay(t){const e=this._lighting;if(null==e||!this.sunLightingEnabled||"virtual"===e.type||!p(t))return;const i=e.date,n=c(t,-this._cachedDisplayUTCOffset,"hours");n.getTime()!==i.getTime()&&(e.date=n,this._updateLighting())}stopPlaying(){this.playingState="none"}toggleDayPlaying(){this.dayPlaying=!this.dayPlaying}toggleYearPlaying(){this.yearPlaying=!this.yearPlaying}toggleSunLightingEnabled(){this.stopPlaying(),this.sunLightingEnabled=!this.sunLightingEnabled}toggleDirectShadowsEnabled(){this.stopPlaying(),this.directShadowsEnabled=!this.directShadowsEnabled}onDateChange(t){this.dayPlaying=!1,this.localDate=t,this._onUserDateTimeChange()}_updateLighting(t){const e=Date.now();this._lastLightingUpdate=e;const{view:i}=this,n=this._lighting;if(null==i||null==n||"virtual"===n.type)return;t??=n.date;const s=n.displayUTCOffset,a=null!=s?s:this._timezoneFromCamera(n,i.camera?.position);this._cachedLightingDateUTC.getTime()!==t.getTime()&&(this._cachedLightingDateUTC=new Date(t.getTime())),this._cachedDisplayUTCOffset!==a&&(this._cachedDisplayUTCOffset=a)}_timezoneWillChange(t){const e=this._lighting;if(null==e||"virtual"===e.type||!e.cameraTrackingEnabled)return;let i;if(t)i=t.timezoneOffset;else{if(null!=e.displayUTCOffset)return;i=_.calculateTimezoneOffset(e.positionTimezoneInfo)}e.displayUTCOffset=i,this._scheduleLightingUpdate()}_scheduleLightingUpdate(t){if(t&&(this._lightingUpdateHandle=s(this._lightingUpdateHandle),!p(t)))return;if(this._lightingUpdateHandle)return;const e=Date.now()-this._lastLightingUpdate,n=this.lightingUpdateInterval-e;let a=null;const l=()=>{this._updateLighting(t),this._lightingUpdateHandle===a&&(this._lightingUpdateHandle=null)};if(n<=0)this._lightingUpdateHandle=a=g(l);else{const t=setTimeout(l,n);this._lightingUpdateHandle=a=i((()=>clearTimeout(t)))}}_cancelLightingUpdate(){this._lightingUpdateHandle=s(this._lightingUpdateHandle)}_play(){const t=this._lighting;if(null==t||!this.sunLightingEnabled||"virtual"===t.type)return;const e=t.date;if(this.dayPlaying||this.yearPlaying){const i=Date.now()-(this._lastTime??0);if(this.dayPlaying){this._lastTime=Date.now();const n=P(this._sunrise,this._sunset,e)*this.playSpeedMultiplier/100*i;if(n>0){let i=new Date(e.getTime()+n);const s=t.displayUTCOffset??0;if(((i.getUTCHours()+s)%24+24)%24<((e.getUTCHours()+s)%24+24)%24){const t=864e5;i=new Date(e.getTime()+n-t)}t.date=i}}else{if(i>1e3){this._lastTime=Date.now();const i=(e.getUTCMonth()+1)%12,n=new Date(e.getTime());n.setUTCMonth(i),t.date=n}}requestAnimationFrame((()=>this._play()))}}_updateSunriseAndSunset(){const t=this._lighting;if(null==t||"virtual"===t.type||!this.sunLightingEnabled)return;const e=this.view?.camera?.position;if(null==e)return;const{latitude:i,longitude:n}=e,{date:s,displayUTCOffset:a}=t,l=E(s,i,n,a??0);l&&(this._sunrise=new Date(l.sunrise),this._sunset=new Date(l.sunset))}_onUserDateTimeChange(){this.emit("user-date-time-change",{})}};t([y()],O.prototype,"view",void 0),t([y({type:b,nonNullable:!0})],O.prototype,"timeSliderViewModel",void 0),t([y()],O.prototype,"isSupported",null),t([y()],O.prototype,"lightingUpdateInterval",void 0),t([y()],O.prototype,"utcOffset",null),t([y({type:Date})],O.prototype,"localDate",null),t([y()],O.prototype,"timeSliderPosition",null),t([y()],O.prototype,"directShadowsEnabled",null),t([y()],O.prototype,"sunLightingEnabled",null),t([y({type:["none","day","year"],value:"none"})],O.prototype,"playingState",null),t([y()],O.prototype,"dayPlaying",null),t([y()],O.prototype,"yearPlaying",null),t([y()],O.prototype,"playSpeedMultiplier",void 0),t([y()],O.prototype,"currentSeason",null),t([y()],O.prototype,"_lastTime",void 0),t([y()],O.prototype,"_sunrise",void 0),t([y()],O.prototype,"_sunset",void 0),t([y()],O.prototype,"_cachedLightingDateUTC",void 0),t([y()],O.prototype,"_cachedDisplayUTCOffset",void 0),t([y()],O.prototype,"_currentHemisphere",null),t([y()],O.prototype,"_environment",null),t([y()],O.prototype,"_lighting",null),t([y()],O.prototype,"_lightingType",null),t([y()],O.prototype,"_lightingDateDisplay",null),O=t([m("esri.widgets.Daylight.DaylightViewModel")],O);const H=O;export{H as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as o}from"../../chunks/tslib.es6.js";import
|
|
5
|
+
import{_ as o}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";let r=class extends t{constructor(){super(...arguments),this.editRouteButton=!0,this.layerDetails=!0,this.saveAsButton=!0,this.saveButton=!0}};o([e({type:Boolean,nonNullable:!0})],r.prototype,"editRouteButton",void 0),o([e({type:Boolean,nonNullable:!0})],r.prototype,"layerDetails",void 0),o([e({type:Boolean,nonNullable:!0})],r.prototype,"saveAsButton",void 0),o([e({type:Boolean,nonNullable:!0})],r.prototype,"saveButton",void 0),r=o([s("esri.widgets.Directions.DirectionsVisibleElements")],r);const i=r;export{i as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const e="esri-directions",t={base:e,accordion:`${e}__accordion`,actionContainer:`${e}__action-container`,addStopButton:`${e}__add-stop-button`,departureTime:`${e}__departure-time`,departureTimeOptions:`${e}__departure-time-options`,directionsHeader:`${e}__directions-header`,directionsHeaderStopName:`${e}__directions-header-stop-name`,editFooter:`${e}__edit-footer`,editRouteButton:`${e}__edit-route-button`,editToolbar:`${e}__edit-toolbar`,editToolbarContainer:`${e}__edit-toolbar-container`,flexColumn:`${e}__flex-column`,flexRow:`${e}__flex-row`,folder:`${e}__folder`,folderHome:`${e}__folder-home`,headerStops:`${e}__header-stops`,labelEmphasize:`${e}__label-emphasize`,labelNoBottomMargin:`${e}__label-no-bottom-margin`,marginInlineMedium:`${e}__margin-inline-medium`,optimizeSection:`${e}__optimize-section`,optimizeSwitches:`${e}__optimize-switches`,paddingMedium:`${e}__padding-medium`,primaryFlowItem:`${e}__primary-flow-item`,primaryFooter:`${e}__primary-footer`,primaryFooterCentered:`${e}__primary-footer-centered`,primaryFooterLoader:`${e}__primary-footer-loader`,printAvoidPageBreak:`${e}__print--avoid-page-break`,printBody:`${e}__print-body`,printDocument:`${e}__print-document`,printDocumentClose:`${e}__print-document-close`,printDocumentPrint:`${e}__print-document-print`,printHeader:`${e}__print-header`,printHeaderButtons:`${e}__print-header-buttons`,printHeaderLabel:`${e}__print-header-label`,printHideOnPrint:`${e}__print--hide-on-print`,printSection:`${e}__print-section`,routeItem:`${e}__route-item`,routeItemButton:`${e}__route-item-button`,routeItemButtonContent:`${e}__route-item-button-content`,routeItemDescription:`${e}__route-item-description`,routeItemLabel:`${e}__route-item-label`,saveError:`${e}__save-error`,saveErrorIcon:`${e}__save-error-icon`,saveErrorLabel:`${e}__save-error-label`,saveProcessLoader:`${e}__save-process-loader`,selectedFeatureContainer:`${e}__selected-feature-container`,separator:`${e}__separator`,solveRoute:`${e}__solve-route`,stopContainer:`${e}__stop-container`,stopItem:`${e}__stop-item`,stopList:`${e}__stop-list`};export{t as css};
|
|
5
|
+
const e="esri-directions",t={base:e,accordion:`${e}__accordion`,actionContainer:`${e}__action-container`,addStopButton:`${e}__add-stop-button`,departureTime:`${e}__departure-time`,departureTimeOptions:`${e}__departure-time-options`,directionsHeader:`${e}__directions-header`,directionsHeaderStopName:`${e}__directions-header-stop-name`,editFooter:`${e}__edit-footer`,editRouteButton:`${e}__edit-route-button`,editToolbar:`${e}__edit-toolbar`,editToolbarContainer:`${e}__edit-toolbar-container`,flexColumn:`${e}__flex-column`,flexRow:`${e}__flex-row`,folder:`${e}__folder`,folderHome:`${e}__folder-home`,headerStops:`${e}__header-stops`,labelEmphasize:`${e}__label-emphasize`,labelNoBottomMargin:`${e}__label-no-bottom-margin`,marginInlineMedium:`${e}__margin-inline-medium`,optimizeSection:`${e}__optimize-section`,optimizeSwitches:`${e}__optimize-switches`,paddingMedium:`${e}__padding-medium`,primaryFlowItem:`${e}__primary-flow-item`,primaryFooter:`${e}__primary-footer`,primaryFooterCentered:`${e}__primary-footer-centered`,primaryFooterLoader:`${e}__primary-footer-loader`,printAvoidPageBreak:`${e}__print--avoid-page-break`,printBody:`${e}__print-body`,printDocument:`${e}__print-document`,printDocumentClose:`${e}__print-document-close`,printDocumentPrint:`${e}__print-document-print`,printHeader:`${e}__print-header`,printHeaderButtons:`${e}__print-header-buttons`,printHeaderLabel:`${e}__print-header-label`,printHideOnPrint:`${e}__print--hide-on-print`,printMedia:`${e}__print-media`,printSection:`${e}__print-section`,routeItem:`${e}__route-item`,routeItemButton:`${e}__route-item-button`,routeItemButtonContent:`${e}__route-item-button-content`,routeItemDescription:`${e}__route-item-description`,routeItemLabel:`${e}__route-item-label`,saveError:`${e}__save-error`,saveErrorIcon:`${e}__save-error-icon`,saveErrorLabel:`${e}__save-error-label`,saveProcessLoader:`${e}__save-process-loader`,selectedFeatureContainer:`${e}__selected-feature-container`,separator:`${e}__separator`,solveRoute:`${e}__solve-route`,stopContainer:`${e}__stop-container`,stopItem:`${e}__stop-item`,stopList:`${e}__stop-list`};export{t as css};
|
package/widgets/Directions.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import{isSome as t}from"../core/arrayUtils.js";import i from"../core/Collection.js";import{addEventListener as s}from"../core/events.js";import{makeHandle as o}from"../core/handleUtils.js";import{destroyMaybe as r}from"../core/maybe.js";import{debounce as n,isAbortError as a}from"../core/promiseUtils.js";import{watch as l,initial as c,on as d}from"../core/reactiveUtils.js";import{escapeRegExpString as h}from"../core/string.js";import{property as m}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import u from"../portal/Portal.js";import{defaultUnitPropertyMetadata as v}from"../properties/defaultUnit.js";import _ from"../rest/support/Stop.js";import g from"../symbols/SimpleMarkerSymbol.js";import w from"./Search.js";import y from"./Widget.js";import{css as b}from"./Directions/css.js";import{DirectionsSearchTool as S}from"./Directions/DirectionsSearchTool.js";import f from"./Directions/DirectionsViewModel.js";import k from"./Directions/DirectionsVisibleElements.js";import{formatDistance as C,formatDuration as D,DepartureTimeOption as M,getIconName as I}from"./Directions/support/directionsUtils.js";import{isArcGISWorldGeocoder as T,meteredArcGISLocatorUrl as F}from"./Search/support/locatorUtils.js";import{loadCalciteComponents as P}from"./support/componentsUtils.js";import{globalCss as x}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as E}from"./support/decorators/messageBundle.js";import{tsx as R}from"./support/jsxFactory.js";function L(e){const{branchName:i,displayText:s,exitName:o,intersectingName:r,name:n,towardName:a}=e;if(null==s)return null;const l=[i,o,r,n,a].filter(t).sort(((e,t)=>t.length-e.length)).map((e=>h(e)));if(!l.length)return s;const c=new RegExp(l.join("|"),"g"),d=s.matchAll(c);let m=0;const p=[];for(const{0:t,index:h}of d)p.push(s.slice(m,h),R("span",{class:b.labelEmphasize,key:`maneuver-${h}`},t)),m=h+t.length;return p.push(s.slice(m)),R("span",null,p)}let A=class extends y{constructor(e,t){super(e,t),this._activeManeuver=null,this._placeholderStops=new i([new _,new _]),this._portalFolderCombobox=null,this._portalFolders=null,this._portalItemNameInput=null,this._portalUserName=null,this._printDocument=null,this._printDocumentParent=null,this._sections=null,this._stopsToSearches=new Map,this._printDocumentOpen=!1,this._currentFlowItem="primary",this._parentFlowItem="primary",this._saveState="initialized",this._searchTool=null,this.headingLevel=2,this.messages=null,this.messagesUnits=null,this.searchProperties=null,this.viewModel=new f,this.visibleElements=new k,this._solveRouteDebounced=n((()=>this._solveRoute()))}initialize(){this.addHandles([l((()=>this.viewModel.layer),(()=>{try{this.viewModel.load()}catch{}}),c),l((()=>this.viewModel.layer?.routeInfo),(()=>{this._sections=this._getStopSections()}),c),l((()=>this.viewModel.layer?.stops.toArray()),(e=>{e&&this.view?.activeTool&&this._searchTool&&this.view.activeTool===this._searchTool&&!e.includes(this._searchTool.stop)&&(this.view.tools.remove(this._searchTool),this._searchTool=null)})),s(window,"beforeprint",this._beforePrint.bind(this)),s(window,"afterprint",this._afterPrint.bind(this))])}loadDependencies(){return P({accordion:()=>import("@esri/calcite-components/dist/components/calcite-accordion"),"accordion-item":()=>import("@esri/calcite-components/dist/components/calcite-accordion-item"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),"block-section":()=>import("@esri/calcite-components/dist/components/calcite-block-section"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch")})}destroy(){this._stopsToSearches.forEach(r)}get apiKey(){return this.viewModel.apiKey}set apiKey(e){this.viewModel.apiKey=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"right"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get lastRoute(){return this.viewModel.lastRoute}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get maxStops(){return this.viewModel.maxStops}set maxStops(e){this.viewModel.maxStops=e}get unit(){return this.defaultUnit}set unit(e){this._overrideIfSome("unit",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}acquireSearch(e){const{view:t}=this.viewModel;if(this._stopsToSearches.has(e)){const i=this._stopsToSearches.get(e);return i.view=t,this._overrideDefaultSources(i),i}const i=new w({icon:!1,popupEnabled:!1,resultGraphicEnabled:!1,view:t,...this.searchProperties});return this._normalizeSearchSources(i),this.addHandles([d((()=>i.allSources),"change",(()=>this._normalizeSearchSources(i))),i.on("search-clear",(()=>{e.geometry=null,e.name=null,this.viewModel.layer?.removeResult()})),i.on("select-result",(()=>{const t=i.selectedResult;e.geometry=t?.feature.geometry,e.name=t?.name,this._solveRouteDebounced()})),l((()=>i.searchTerm),(t=>{e.name=t}))],i),this._stopsToSearches.set(e,i),i}getDirections(){return this.viewModel.getDirections()}render(){return R("div",{class:this.classes(b.base,x.widget,x.panel)},R("calcite-flow",null,this._renderPrimaryFlowItem(),this._renderDirectionsFlowItem(),this._renderEditFlowItem(),this._renderSaveFlowItem()),this._renderPrintDocument())}save(){return this.viewModel.save()}saveAs(e,t={}){return this.viewModel.saveAs(e,t)}zoomToRoute(){return this.viewModel.zoomToRoute()}_afterPrint(){this._printDocumentOpen&&this._printDocument&&this._printDocumentParent?.appendChild(this._printDocument)}_applyLocatorSourceOverrides({allSources:e}){for(const t of e)"url"in t&&t.url&&(t.locationType??="street",T(t.url)&&this.apiKey&&null==t.apiKey&&(t.apiKey=this.apiKey,t.url=F))}_beforePrint(){this._printDocumentOpen&&this._printDocument&&document.body.appendChild(this._printDocument)}_disposeSearch(e){if(!e||!this._stopsToSearches.has(e))return;const t=this._stopsToSearches.get(e);this.removeHandles(t),t.destroy(),this._stopsToSearches.delete(e)}_getEffectiveStops(){return this.viewModel.layer?.stops??this._placeholderStops}_getErrorDescription(){switch(this.viewModel.lastError?.name){case"directions-view-model:unable-to-route":return this.messages.errors.unableToRoute;case"directions-view-model:service-metadata-unavailable":return this.messages.errors.unableToLoadServiceMetadata;default:return this.messages.errors.unknownError}}_getNetworkFeatureName(e){switch(e.type){case"stop":switch(e.locationType){case"stop":default:return this.messages.networkFeatures.stops.stop;case"waypoint":return this.messages.networkFeatures.stops.waypoint;case"break":return this.messages.networkFeatures.stops.break}case"point-barrier":return this.messages.networkFeatures.pointBarrier;case"polyline-barrier":return this.messages.networkFeatures.polylineBarrier;case"polygon-barrier":return this.messages.networkFeatures.polygonBarrier}}_getRouteCostSummary(){const e=this.viewModel.layer?.routeInfo;if(!e)return null;const t=e.totalDistance??0,i=e.totalDuration??0,{messagesUnits:s,unit:o}=this;return{distance:C(s,t,o),duration:D(i)}}_getStopSections(){if(!this.viewModel.layer)return null;const{directionPoints:e,directionLines:t,stops:i}=this.viewModel.layer;if(!e||!t)return null;const s=[];let o=null;for(const r of e){const{objectId:e,stopId:n}=r;if(null!=n){const e=i.find((({objectId:e})=>e===n));o&&o.stop===e||(o={stop:e,directions:[]},s.push(o));continue}if(null==o)continue;const a=t.find((({directionPointId:t})=>t===e));null!=a&&o.directions.push({directionPoint:r,directionLine:a})}return s}_handleAddStopClick(){const e=new g;this.viewModel.layer?.stops.add(new _({symbol:e}))}_handleAutoSolveChange({target:e}){this.viewModel.autoSolve=e.checked}_handleCreatePolylineBarrierClick(){this.viewModel.create("polyline-barrier")}_handleClearRouteClick(){this._currentFlowItem="primary",this.viewModel.reset()}_handleCreateStopClick(){this.viewModel.create("stop")}_handleDeleteNetworkFeatureClick(e){this.viewModel.remove(e),this.viewModel.autoSolve&&this._solveRouteDebounced()}_handleDeleteStopClick(e){this._getEffectiveStops().remove(e),this._disposeSearch(e),this._solveRouteDebounced()}_handleDepartureDateChange({currentTarget:{value:e}}){Array.isArray(e)||(this.viewModel.departureIsoDate=e,this._solveRouteDebounced())}_handleDepartureTimeChange({currentTarget:{value:e}}){this.viewModel.departureIsoTime=e,this._solveRouteDebounced()}_handleDepartureTimeOptionChange({currentTarget:e}){const{selectedItems:t}=e;t.length&&(this.viewModel.departureOption=t[0].value,this._solveRouteDebounced())}_handleDirectionsFlowItemBackClick(e){e.stopPropagation(),this._currentFlowItem="primary"}_handleDirectionTurnItemSelect(e){this._activeManeuver===e?this.zoomToRoute():(this._activeManeuver=e,this.viewModel.centerAt(e.geometry))}_handleDirectionTurnPointerEnter(e){this.viewModel.highlight(e)}_handleDirectionTurnPointerLeave(){this.viewModel.clearHighlights()}_handleEditFlowItemBackClick(e){e.stopPropagation(),this.viewModel.stopEditing(),this._currentFlowItem="primary"}_handleEditingDoneClick(){this.viewModel.stopEditing(),this._currentFlowItem="primary"}_handleEditRouteClick(){this._currentFlowItem="edit",this.viewModel.startEditing()}_handleItemDetailsClick(){const e=this.viewModel.layer?.portalItem;e&&window.open(`${e.portal.url}/home/item.html?id=${e.id}`,"_blank")}_handleLocateStopClick(e){const{view:t}=this;if(!t)return;const i="directions-search-tool";this.removeHandles(i),this._searchTool=new S({stop:e,view:t}),this.addHandles([this._searchTool.on("click",(async t=>{if(t.mapPoint&&this._stopsToSearches.has(e)){const i=this._stopsToSearches.get(e),s=await i.search(t.mapPoint),o=s?.results?.[0].results?.[0];if(o){const{feature:t,name:s}=o;i.searchTerm=s,e.geometry=t.geometry}}this.removeHandles(i)})),o((()=>{this._searchTool&&(this.view?.tools.remove(this._searchTool),this._searchTool=null)}))],i),t.addAndActivateTool(this._searchTool)}_handleOptimizeStopOrderToggle({target:{expanded:e}}){this.viewModel.routeParameters.findBestSequence=e,this._solveRouteDebounced()}_handlePanToStopClick(e){this.viewModel.centerAt(e)}_handlePreserveFirstStopChange({target:{checked:e}}){this.viewModel.routeParameters.preserveFirstStop=e,this._solveRouteDebounced()}_handlePreserveLastStopChange({target:{checked:e}}){this.viewModel.routeParameters.preserveLastStop=e,this._solveRouteDebounced()}_handlePrintDocumentAfterCreate(e){e.focus(),this._printDocument=e,this._printDocumentParent=e.parentElement}_handlePrintDocumentClick(){this._printDocumentOpen=!0}_handlePrintDocumentCloseClick(){this._printDocumentOpen=!1}_handlePrintDocumentKeyDown(e){"Escape"===e.key&&(this._printDocumentOpen=!1)}_handlePrintDocumentPrintClick(){window.print()}_handleResolveRouteClick(){this._solveRouteDebounced()}_handleReverseStopOrderClick(){this._getEffectiveStops().reverse(),this._solveRouteDebounced()}_handleSaveErrorCloseClick(){this._currentFlowItem=this._parentFlowItem}_handleSaveFlowItemBackClick(e){e.stopPropagation(),this._currentFlowItem=this._parentFlowItem}async _handleSaveLayerAs(){const e=u.getDefault();try{await e.signIn()}catch(t){if(a(t)||"identity-manager:user-aborted"===t.name)return;return this._parentFlowItem=this._currentFlowItem,this._currentFlowItem="save",void(this._saveState="connect-to-portal-error")}this._saveState="fetch-portal-information",this._parentFlowItem=this._currentFlowItem,this._currentFlowItem="save",this._portalUserName=e.user?.username;try{this._portalFolders=await(e.user?.fetchFolders())}catch{return void(this._saveState="fetch-portal-information-error")}this._saveState="save-layer"}_handleSaveLayerClick(){this.viewModel.layer?.save()}_handleSaveLayerButtonClick(){if(this._saveState="saving",null==this.layer||null==this._portalFolders)return;const e=this._portalItemNameInput?.value,t=this._portalFolderCombobox?.value,i=this._portalFolders.find((({id:e})=>e===t));this.layer.saveAs({title:e},{folder:i}).then((()=>{this._currentFlowItem=this._parentFlowItem})).catch((()=>{this._saveState="saving-error"}))}_handleSaveLayerCancelClick(){this._currentFlowItem=this._parentFlowItem}_handleSaveLayerFolderCreate(e){this._portalFolderCombobox=e}_handleSaveLayerNameCreate(e){this._portalItemNameInput=e}_handleSignInClick(){this.viewModel.load().catch((()=>{}))}_handleStopListReorder({detail:{dragEl:e,newIndex:t}}){this._getEffectiveStops().reorder(e.value,t),this._solveRouteDebounced()}_handleTravelModeChange({currentTarget:{selectedItems:e}}){e.length&&(this.viewModel.selectedTravelMode=e[0].value,this._solveRouteDebounced())}_handleViewDrivingDirectionsClick(){this._currentFlowItem="directions"}_normalizeSearchSources(e){this._overrideDefaultSources(e),this._applyLocatorSourceOverrides(e)}_overrideDefaultSources(e){for(const t of e.viewModel.defaultSources)t.autoNavigate=!1}_renderClearRouteAction(e){return R("calcite-action",{bind:this,icon:"trash",key:"clear-route",onclick:this._handleClearRouteClick,...e,text:this.messages.common.clear,textEnabled:!0})}_renderDeleteStopAction(e){return R("calcite-action",{icon:"trash",onclick:this._handleDeleteStopClick.bind(this,e),scale:"s",slot:"actions-end",text:this.messages.deleteStop,title:this.messages.deleteStop})}_renderDepartureTime(){const{DEPART_AT:e,NOW:t,UNSPECIFIED:i}=M;return R("calcite-label",{class:b.departureTime,key:"departure-time"},this.messages.departureTime,R("calcite-combobox",{bind:this,clearDisabled:!0,label:this.messages.departureTime,overlayPositioning:"fixed",selectionMode:"single",onCalciteComboboxChange:this._handleDepartureTimeOptionChange},R("calcite-combobox-item",{heading:this.messages.leaveNow,key:t,label:this.messages.leaveNow,selected:this.viewModel.departureOption===t,value:t}),R("calcite-combobox-item",{heading:this.messages.departAt,key:e,label:this.messages.departAt,selected:this.viewModel.departureOption===e,value:e}),R("calcite-combobox-item",{heading:this.messages.timeUnspecified,key:i,label:this.messages.timeUnspecified,selected:this.viewModel.departureOption===i,value:i})))}_renderDepartureTimeOptions(){return this.viewModel.departureOption!==M.DEPART_AT?null:R("div",{class:b.departureTimeOptions},R("calcite-input-date-picker",{bind:this,scale:"s",value:this.viewModel.departureIsoDate,onCalciteInputDatePickerChange:this._handleDepartureDateChange}),R("calcite-input-time-picker",{bind:this,scale:"s",value:this.viewModel.departureIsoTime,onCalciteInputTimePickerClose:this._handleDepartureTimeChange}))}_renderDirectionsFlowItem(){if("directions"!==this._currentFlowItem)return null;const e=this._getRouteCostSummary();if(!this._sections||!e)return null;const{distance:t,duration:i}=e,{formattedEta:s}=this.viewModel,o=this._sections.at(0)?.stop.name??"",r=this._sections.at(-1)?.stop.name??"";return R("calcite-flow-item",{bind:this,key:"directions-flow-item",overlayPositioning:"fixed",selected:"directions"===this._currentFlowItem,onCalciteFlowItemBack:this._handleDirectionsFlowItemBackClick},R("div",{class:b.directionsHeader,slot:"header-content"},R("div",{class:b.headerStops},R("span",null,this.messages.from)," ",R("span",{class:b.directionsHeaderStopName},o),R("span",null,this.messages.to)," ",R("span",{class:b.directionsHeaderStopName},r)),R("div",{class:b.flexColumn},R("span",null,`${i} (${t})`),s?R("span",null,s):null)),this._renderRouteLayerActions({slot:"header-menu-actions"}),R("calcite-accordion",{class:b.accordion,iconPosition:"start",selectionMode:"single"},this._sections.map(((e,t)=>this._renderDirectionSection(e,t)))))}_renderDirectionSection(e,t){const{stop:i,directions:s}=e,{name:o}=i;return R("calcite-accordion-item",{expanded:0===t,heading:o??"",key:`stop-${t}`},R("calcite-action",{icon:"zoom-to-object",onclick:this._handlePanToStopClick.bind(this,i),slot:"actions-end",text:this.messages.panToStop}),this._renderDirectionTurns(s))}_renderDirectionTurns(e){return R("calcite-list",{label:this.messages.drivingDirections,selectionMode:"none"},e.map(((e,t)=>{const{directionPoint:i,directionLine:s}=e,{distance:o,duration:r}=s,n=C(this.messagesUnits,o??0,this.unit),a=D(r??0),l=n&&a?`${n} | ${a}`:`${n||a}`,c=L(i),d=I(i.directionPointType);return R("calcite-list-item",{class:b.labelNoBottomMargin,key:`driving-direction-${t}`,onpointerenter:this._handleDirectionTurnPointerEnter.bind(this,s),onpointerleave:this._handleDirectionTurnPointerLeave.bind(this),onCalciteListItemSelect:this._handleDirectionTurnItemSelect.bind(this,s)},R("calcite-icon",{icon:d,slot:"content-start"}),R("div",{slot:"content"},R("calcite-label",{layout:"inline",scale:"s"},c),R("calcite-label",{layout:"inline",scale:"s"},l)))})))}_renderEditFlowItem(){return"edit"!==this._currentFlowItem?null:R("calcite-flow-item",{bind:this,heading:this.messages.editRoute,headingLevel:this.headingLevel,key:"edit-flow-item",loading:"routing"===this.viewModel.state,selected:"edit"===this._currentFlowItem,onCalciteFlowItemBack:this._handleEditFlowItemBackClick},R("div",{class:b.flexColumn,key:"edit-container"},R("div",{class:b.editToolbarContainer},R("calcite-label",{layout:"inline",scale:"s"},this.messages.automaticallySolve,R("calcite-switch",{bind:this,checked:this.viewModel.autoSolve,scale:"s",onCalciteSwitchChange:this._handleAutoSolveChange})),R("div",{class:b.editToolbar},R("calcite-action",{bind:this,disabled:!this.viewModel.layer||this.viewModel.layer.stops.length>=this.maxStops,icon:"flag",onclick:this._handleCreateStopClick,scale:"s",text:this.messages.networkFeatures.stops.stop,textEnabled:!0}),R("calcite-action",{bind:this,icon:"line",onclick:this._handleCreatePolylineBarrierClick,scale:"s",text:this.messages.barrier,textEnabled:!0}),R("calcite-action",{bind:this,class:b.solveRoute,disabled:this.viewModel.autoSolve,icon:"refresh",onclick:this._handleResolveRouteClick,scale:"s",text:this.messages.solve,textEnabled:!0}))),R("div",{class:b.selectedFeatureContainer},R("calcite-list",{label:this.messages.selectedNetworkFeatures,scale:"s",selectionMode:"none"},this.viewModel.selectedNetworkFeatures?.toArray().map(((e,t)=>R("calcite-list-item",{description:this._getNetworkFeatureName(e),key:`network-feature-${t}`,label:e.name??e.objectId?.toString()??this.messages.unnamed},R("calcite-action",{icon:"trash",onclick:this._handleDeleteNetworkFeatureClick.bind(this,e),scale:"s",slot:"actions-end",text:this.messages.common.delete})))))),R("div",{class:b.editFooter},this._renderEditFooterContent())))}_renderEditFooterContent(){return this.viewModel.lastError?this._renderErrorNotice():R("calcite-button",{appearance:"outline-fill",bind:this,onclick:this._handleEditingDoneClick,width:"full"},this.messages.common.done)}_renderErrorNotice(){return R("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0},R("calcite-label",{class:b.labelNoBottomMargin,slot:"message"},this._getErrorDescription()))}_renderFooter(){if(!this.viewModel.layer)return R("div",{class:b.primaryFooter,key:"footer-missing-layer"},R("calcite-notice",{icon:"information",open:!0},R("calcite-label",{class:b.labelNoBottomMargin,slot:"message"},this.messages.missingLayer)));if("unauthenticated"===this.viewModel.state)return R("div",{class:b.primaryFooterCentered,key:"footer-sign-in"},R("calcite-label",null,this.messages.signInRequired),R("calcite-button",{bind:this,onclick:this._handleSignInClick},this.messages.common.auth.signIn));if("routing"===this.viewModel.state)return R("div",{class:this.classes(b.primaryFooter,b.primaryFooterLoader),key:"footer-routing"},R("calcite-loader",{label:this.messages.solve,scale:"s"}));if("error"===this.viewModel.state)return R("div",{class:b.primaryFooter,key:"footer-service-error"},this._renderErrorNotice());if(!this.viewModel.layer?.routeInfo)return R("div",{class:b.primaryFooter,key:"footer-unsolved-route"},R("calcite-notice",{icon:"information",open:!0},R("calcite-label",{class:b.labelNoBottomMargin,slot:"message"},this.messages.directionsPlaceholder)));const e=this._getRouteCostSummary();if(!e||!this.viewModel.layer?.directionPoints)return R("div",{class:b.primaryFooter,key:"footer-invalid-route"},R("calcite-notice",{icon:"exclamation-mark-triangle",kind:"danger",open:!0},R("calcite-label",{class:b.labelNoBottomMargin,slot:"message"},this.messages.invalidRoute)));const{distance:t,duration:i}=e,{formattedEta:s}=this.viewModel;return R("div",{class:b.routeItem,key:"footer-directions-summary"},R("button",{"aria-busy":"false","aria-label":this.messages.viewDrivingDirections,"aria-live":"polite",bind:this,class:b.routeItemButton,onclick:this._handleViewDrivingDirectionsClick,type:"button"},R("div",{class:b.routeItemButtonContent},R("span",{class:b.routeItemLabel},`${i} (${t})`),R("span",{class:b.routeItemDescription},s)),R("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s"})),R("calcite-action-menu",{label:"test"},R("calcite-action",{icon:"ellipsis",key:"route-actions",slot:"trigger",text:"Route actions"}),this._renderRouteLayerActions()))}_renderInteractiveRouteActions(){return R("div",{class:b.actionContainer,key:b.actionContainer},R("calcite-button",{appearance:"outline",bind:this,class:b.addStopButton,disabled:this._getEffectiveStops().length>=this.maxStops,iconStart:"plus",kind:"neutral",label:this.messages.addStop,onclick:this._handleAddStopClick,width:"half"},this.messages.addStop),R("calcite-button",{appearance:"outline",bind:this,class:b.editRouteButton,disabled:"2d"!==this.viewModel.view?.type,iconStart:"pencil",kind:"neutral",label:this.messages.editRoute,onclick:this._handleEditRouteClick,width:"half"},this.messages.editRoute))}_renderLocateStopAction(e){if(null!=e.name||null!=e.geometry)return null;const t=this._getEffectiveStops().indexOf(e),i=!!this.view?.activeTool&&this.view.activeTool===this._searchTool&&this._searchTool.stop===e;return R("calcite-action",{active:i,icon:"crosshair",key:`stop-location-action-${t}`,onclick:this._handleLocateStopClick.bind(this,e),scale:"s",slot:"actions-end",text:this.messages.pickALocationOnTheMap,title:this.messages.pickALocationOnTheMap})}_renderOptimizeStopOrder(){const{routeParameters:e}=this.viewModel,{findBestSequence:t,preserveFirstStop:i,preserveLastStop:s}=e;return R("calcite-block-section",{bind:this,class:b.optimizeSection,text:this.messages.optimizeOrder,toggleDisplay:"switch",onCalciteBlockSectionToggle:this._handleOptimizeStopOrderToggle},t?[R("calcite-label",{class:b.optimizeSwitches,key:"preserve-first-stop",layout:"inline-space-between"},this.messages.preserveFirstStop,R("calcite-switch",{bind:this,checked:i,scale:"s",onCalciteSwitchChange:this._handlePreserveFirstStopChange})),R("calcite-label",{class:b.optimizeSwitches,key:"preserve-last-stop",layout:"inline-space-between"},this.messages.preserveLastStop,R("calcite-switch",{bind:this,checked:s,scale:"s",onCalciteSwitchChange:this._handlePreserveLastStopChange}))]:null)}_renderPrimaryFlowItem(){return R("calcite-flow-item",{key:"primary-flow-item",loading:"initializing"===this.viewModel.state,selected:"primary"===this._currentFlowItem},R("calcite-panel",{class:b.primaryFlowItem,disabled:!this.viewModel.layer||"unauthenticated"===this.viewModel.state||"error"===this.viewModel.state&&!this.viewModel.serviceDescription},this._renderStops(),this._renderInteractiveRouteActions(),this._renderSeparator(),this._renderRouteSolveOptions()),this._renderFooter())}_renderPrintDocument(){if(!this._printDocumentOpen)return null;const e=this._getRouteCostSummary();if(!this._sections||!e)return null;const{distance:t,duration:i}=e,{formattedEta:s}=this.viewModel,o=this._sections.at(0)?.stop.name??"",r=this._sections.at(-1)?.stop.name??"";return R("div",{afterCreate:this._handlePrintDocumentAfterCreate,bind:this,class:b.printDocument,onkeydown:this._handlePrintDocumentKeyDown,tabindex:0},R("div",{class:b.printBody},R("div",{class:b.printHeader},R("div",{class:b.printHeaderLabel},R("div",{class:b.headerStops},R("span",null,this.messages.from)," ",R("span",{class:b.directionsHeaderStopName},o),R("span",null,this.messages.to)," ",R("span",{class:b.directionsHeaderStopName},r))),R("div",{class:this.classes(b.printHeaderButtons,b.printHideOnPrint)},R("calcite-button",{class:b.printDocumentPrint,iconStart:"print",onclick:this._handlePrintDocumentPrintClick},this.messages.common.print),R("calcite-button",{appearance:"outline",bind:this,class:b.printDocumentClose,iconStart:"x-circle",onclick:this._handlePrintDocumentCloseClick},this.messages.common.close))),R("div",{class:b.directionsHeader},R("span",null,`${i} (${t})`),s?R("span",null,s):null),this._sections.map(((e,t)=>this._renderPrintSection(e,t)))))}_renderPrintManuever(e,t){const{directionPoint:i,directionLine:s}=e,{distance:o,duration:r}=s,n=C(this.messagesUnits,o??0,this.unit),a=D(r??0),l=n&&a?`${n} | ${a}`:`${n||a}`,c=L(i),d=I(i.directionPointType);return R("div",{class:this.classes(b.flexRow,b.printAvoidPageBreak),key:`direction-${t}`},R("calcite-icon",{icon:d}),R("div",{class:b.flexColumn},R("span",null,c),R("span",null,l)))}_renderPrintRouteAction(e){const t=!this.viewModel.layer?.routeInfo;return R("calcite-action",{bind:this,disabled:t,icon:"print",key:"print-route",onclick:this._handlePrintDocumentClick,...e,text:this.messages.common.print,textEnabled:!0})}_renderPrintSection({stop:e,directions:t},i){return R("div",{class:b.printSection,key:`section-${i}`},R("span",{class:b.directionsHeaderStopName},e.name??""),t.map(((e,t)=>this._renderPrintManuever(e,t))))}_renderRouteLayerActions(e){return[this._renderClearRouteAction(e),this._renderSaveLayerAction(e),this._renderSaveLayerAsAction(e),this._renderPrintRouteAction(e),this._renderViewItemDetailsAction(e)]}_renderRouteSolveOptions(){return R("div",{class:b.marginInlineMedium,key:"route-solve-options"},this._renderTravelModes(),this._renderDepartureTime(),this._renderDepartureTimeOptions(),this._renderOptimizeStopOrder())}_renderSaveContent(){switch(this._saveState){case"initialized":return this._renderSaveInitialized();case"connect-to-portal":return this._renderSaveProcessing(this.messages.identity.lblSigning);case"connect-to-portal-error":return this._renderSaveError(this.messages.errors.authenticating);case"fetch-portal-information":return this._renderSaveProcessing(this.messages.processing.fetching);case"fetch-portal-information-error":return this._renderSaveError(this.messages.errors.fetching);case"save-layer":return this._renderSaveLayerSettings();case"saving":return this._renderSaveProcessing(this.messages.processing.saving);case"saving-error":return this._renderSaveError(this.messages.errors.saving)}}_renderSaveError(e){return R("calcite-panel",{class:b.paddingMedium,key:"save-layer-error"},R("div",{class:b.saveError},R("calcite-icon",{class:b.saveErrorIcon,icon:"exclamation-mark-triangle",scale:"l",textLabel:this.messages.common.errorMessage}),R("calcite-label",{class:b.saveErrorLabel},e)),R("calcite-button",{appearance:"outline",bind:this,onclick:this._handleSaveErrorCloseClick,slot:"footer-actions",width:"full"},this.messages.common.close))}_renderSaveInitialized(){return R("calcite-panel",{class:b.paddingMedium,key:"save-layer-initialized"})}_renderSaveFlowItem(){return"save"!==this._currentFlowItem?null:R("calcite-flow-item",{bind:this,heading:this.messages.saveLayer,headingLevel:this.headingLevel,key:"save-layer-flow-item",selected:"save"===this._currentFlowItem,onCalciteFlowItemBack:this._handleSaveFlowItemBackClick},this._renderSaveContent())}_renderSaveLayerAction(e){if(!this.visibleElements.saveButton)return null;const t=this.viewModel.layer,i=t?.routeInfo,s=t?.portalItem?.itemControl;return R("calcite-action",{bind:this,disabled:!(!!i&&("admin"===s||"update"===s)),icon:"save",key:"save-route",onclick:this._handleSaveLayerClick,...e,text:this.messages.common.save,textEnabled:!0})}_renderSaveLayerAsAction(e){if(!this.visibleElements.saveAsButton)return null;const t=!this.viewModel.layer?.routeInfo;return R("calcite-action",{disabled:t,icon:"save-as",key:"save-as-route",onclick:()=>{this._handleSaveLayerAs()},...e,text:this.messages.common.saveAs,textEnabled:!0})}_renderSaveLayerSettings(){if(null==this.layer||null==this._portalFolders||null==this._portalUserName)return this._renderSaveInitialized();const{stops:e}=this.layer,t=`${e.at(0).name} - ${e.at(-1).name}`,i=[R("calcite-combobox-item",{heading:`${this._portalUserName} (${this.messages.common.home})`,key:b.folderHome,selected:!0,value:b.folderHome}),...this._portalFolders.map((e=>R("calcite-combobox-item",{heading:e.title??"",key:`${b.folder}-${e.id}`,value:e.id})))];return R("calcite-panel",{key:"save-layer-panel"},R("div",{class:b.paddingMedium},R("calcite-label",null,this.messages.layerName,R("calcite-input",{afterCreate:this._handleSaveLayerNameCreate,bind:this,label:this.messages.layerName,value:t})),R("calcite-label",null,this.messages.saveInFolder,R("calcite-combobox",{afterCreate:this._handleSaveLayerFolderCreate,bind:this,clearDisabled:!0,label:this.messages.saveInFolder,overlayPositioning:"fixed",selectionMode:"single"},i))),R("calcite-button",{bind:this,onclick:this._handleSaveLayerButtonClick,slot:"footer-actions",width:"full"},this.messages.common.save),R("calcite-button",{appearance:"outline",bind:this,onclick:this._handleSaveLayerCancelClick,slot:"footer-actions",width:"full"},this.messages.common.cancel))}_renderSaveProcessing(e){return R("calcite-panel",{class:b.marginInlineMedium,key:"save-layer-processing"},R("calcite-loader",{class:b.saveProcessLoader,label:e,text:e}))}_renderSeparator(){return R("div",{class:b.separator})}_renderStop(e){const t=this.acquireSearch(e);null!=e.name&&(t.searchTerm=e.name);const i=this._getEffectiveStops(),s=this._renderLocateStopAction(e),o=i.length>2&&this._renderDeleteStopAction(e);return R("calcite-list-item",{key:e,value:e},s,o,R("div",{class:b.stopItem,slot:"content"},t.render()))}_renderStops(){const e=this._getEffectiveStops();for(const t of this._stopsToSearches.keys())e.includes(t)||this._disposeSearch(t);return R("div",{class:b.stopContainer,key:b.stopContainer},R("calcite-list",{bind:this,class:b.stopList,dragEnabled:!0,label:this.messages.widgetLabel,scale:"s",onCalciteListOrderChange:this._handleStopListReorder},e.toArray().map((e=>this._renderStop(e)))),2===e.length&&R("calcite-action",{bind:this,icon:"arrow-up-down",onclick:this._handleReverseStopOrderClick,scale:"s",text:this.messages.reverseStops}))}_renderTravelMode(e){const{id:t,name:i}=e;return R("calcite-combobox-item",{heading:i,key:t,label:i,selected:this.viewModel.selectedTravelMode?.id===t,value:e})}_renderTravelModes(){return this.viewModel.travelModes.length?R("calcite-label",{key:"travel-modes"},this.messages.mode,R("calcite-combobox",{bind:this,clearDisabled:!0,label:this.messages.mode,overlayPositioning:"fixed",selectionMode:"single",onCalciteComboboxChange:this._handleTravelModeChange},this.viewModel.travelModes.map((e=>this._renderTravelMode(e))))):null}_renderViewItemDetailsAction(e){return this.visibleElements.layerDetails?R("calcite-action",{bind:this,disabled:!this.viewModel.layer?.portalItem,icon:"launch",key:"open-route-details-link",onclick:this._handleItemDetailsClick,...e,text:this.messages.viewLayerDetails,textEnabled:!0}):null}async _solveRoute(){this.viewModel.updateDepartureTime();if(!((this.viewModel.layer?.stops.filter((({geometry:e})=>!!e)).length??0)<2))try{await this.viewModel.getDirections()}catch{}}};e([m()],A.prototype,"_printDocumentOpen",void 0),e([m()],A.prototype,"_currentFlowItem",void 0),e([m()],A.prototype,"_saveState",void 0),e([m()],A.prototype,"_searchTool",void 0),e([m()],A.prototype,"apiKey",null),e([m(v)],A.prototype,"defaultUnit",void 0),e([m()],A.prototype,"goToOverride",null),e([m()],A.prototype,"headingLevel",void 0),e([m()],A.prototype,"icon",null),e([m()],A.prototype,"label",null),e([m({readOnly:!0})],A.prototype,"lastRoute",null),e([m()],A.prototype,"layer",null),e([m()],A.prototype,"maxStops",null),e([m(),E("esri/widgets/Directions/t9n/Directions")],A.prototype,"messages",void 0),e([m(),E("esri/core/t9n/Units")],A.prototype,"messagesUnits",void 0),e([m()],A.prototype,"searchProperties",void 0),e([m()],A.prototype,"unit",null),e([m()],A.prototype,"view",null),e([m({type:f})],A.prototype,"viewModel",void 0),e([m({type:k,nonNullable:!0})],A.prototype,"visibleElements",void 0),A=e([p("esri.widgets.Directions")],A);const O=A;export{O as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import{isSome as t}from"../core/arrayUtils.js";import i from"../core/Collection.js";import{addEventListener as s}from"../core/events.js";import{makeHandle as o}from"../core/handleUtils.js";import{destroyMaybe as r}from"../core/maybe.js";import{debounce as n,isAbortError as a}from"../core/promiseUtils.js";import{watch as l,initial as c,on as d}from"../core/reactiveUtils.js";import{escapeRegExpString as h}from"../core/string.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{onLocaleChange as u,getLocaleParts as v}from"../intl/locale.js";import _ from"../portal/Portal.js";import{defaultUnitPropertyMetadata as g}from"../properties/defaultUnit.js";import w from"../rest/support/Stop.js";import y from"../symbols/SimpleMarkerSymbol.js";import b from"./Search.js";import S from"./Widget.js";import{css as f}from"./Directions/css.js";import{DirectionsSearchTool as k}from"./Directions/DirectionsSearchTool.js";import C from"./Directions/DirectionsViewModel.js";import D from"./Directions/DirectionsVisibleElements.js";import{formatDistance as M,formatDuration as I,DepartureTimeOption as T,getIconName as F}from"./Directions/support/directionsUtils.js";import{isArcGISWorldGeocoder as P,meteredArcGISLocatorUrl as x}from"./Search/support/locatorUtils.js";import{loadCalciteComponents as E}from"./support/componentsUtils.js";import{globalCss as R}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as L}from"./support/decorators/messageBundle.js";import{tsx as A}from"./support/jsxFactory.js";function O(e){const{branchName:i,displayText:s,exitName:o,intersectingName:r,name:n,towardName:a}=e;if(null==s)return null;const l=[i,o,r,n,a].filter(t).sort(((e,t)=>t.length-e.length)).map((e=>h(e)));if(!l.length)return s;const c=new RegExp(l.join("|"),"g"),d=s.matchAll(c);let p=0;const m=[];for(const{0:t,index:h}of d)m.push(s.slice(p,h),A("span",{class:f.labelEmphasize,key:`maneuver-${h}`},t)),p=h+t.length;return m.push(s.slice(p)),A("span",null,m)}let N=class extends S{constructor(e,t){super(e,t),this._activeManeuver=null,this._placeholderStops=new i([new w,new w]),this._portalFolderCombobox=null,this._portalFolders=null,this._portalItemNameInput=null,this._portalUserName=null,this._printDocument=null,this._printDocumentParent=null,this._sections=null,this._stopsToSearches=new Map,this._printDocumentOpen=!1,this._currentFlowItem="primary",this._parentFlowItem="primary",this._saveState="initialized",this._searchTool=null,this.headingLevel=2,this.messages=null,this.messagesUnits=null,this.searchProperties=null,this.viewModel=new C,this.visibleElements=new D,this._solveRouteDebounced=n((()=>this._solveRoute()))}initialize(){this.addHandles([l((()=>this.viewModel.layer),(()=>{try{this.viewModel.load()}catch{}}),c),l((()=>this.viewModel.layer?.routeInfo),(()=>{this._sections=this._getStopSections()}),c),l((()=>this.viewModel.layer?.stops.toArray()),(e=>{e&&this.view?.activeTool&&this._searchTool&&this.view.activeTool===this._searchTool&&!e.includes(this._searchTool.stop)&&(this.view.tools.remove(this._searchTool),this._searchTool=null)})),s(window,"beforeprint",this._beforePrint.bind(this)),s(window,"afterprint",this._afterPrint.bind(this))])}loadDependencies(){return E({accordion:()=>import("@esri/calcite-components/dist/components/calcite-accordion"),"accordion-item":()=>import("@esri/calcite-components/dist/components/calcite-accordion-item"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),"block-section":()=>import("@esri/calcite-components/dist/components/calcite-block-section"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch")})}destroy(){this._stopsToSearches.forEach(r)}get apiKey(){return this.viewModel.apiKey}set apiKey(e){this.viewModel.apiKey=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"right"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get lastRoute(){return this.viewModel.lastRoute}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get maxStops(){return this.viewModel.maxStops}set maxStops(e){this.viewModel.maxStops=e}get unit(){return this.defaultUnit}set unit(e){this._overrideIfSome("unit",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}acquireSearch(e){const{view:t}=this.viewModel;if(this._stopsToSearches.has(e)){const i=this._stopsToSearches.get(e);return i.view=t,this._overrideDefaultSources(i),i}const i=new b({icon:!1,popupEnabled:!1,resultGraphicEnabled:!1,view:t,...this.searchProperties});return this._normalizeSearchSources(i),this.addHandles([d((()=>i.allSources),"change",(()=>this._normalizeSearchSources(i))),i.on("search-clear",(()=>{e.geometry=null,e.name=null,this.viewModel.layer?.removeResult()})),i.on("select-result",(()=>{const t=i.selectedResult;e.geometry=t?.feature.geometry,e.name=t?.name,this._solveRouteDebounced()})),l((()=>i.searchTerm),(t=>{e.name=t})),u((()=>this._normalizeSearchSources(i)))],i),this._stopsToSearches.set(e,i),i}getDirections(){return this.viewModel.getDirections()}render(){return A("div",{class:this.classes(f.base,R.widget,R.panel)},A("calcite-flow",null,this._renderPrimaryFlowItem(),this._renderDirectionsFlowItem(),this._renderEditFlowItem(),this._renderSaveFlowItem()),this._renderPrintDocument())}save(){return this.viewModel.save()}saveAs(e,t={}){return this.viewModel.saveAs(e,t)}zoomToRoute(){return this.viewModel.zoomToRoute()}_afterPrint(){this._printDocumentOpen&&this._printDocument&&this._printDocumentParent?.appendChild(this._printDocument)}_applyLocatorSourceOverrides({allSources:e}){for(const t of e)"url"in t&&t.url&&(t.language=v()?.language,t.locationType??="street",P(t.url)&&this.apiKey&&null==t.apiKey&&(t.apiKey=this.apiKey,t.url=x))}_beforePrint(){this._printDocumentOpen&&this._printDocument&&document.body.appendChild(this._printDocument)}_disposeSearch(e){if(!e||!this._stopsToSearches.has(e))return;const t=this._stopsToSearches.get(e);this.removeHandles(t),t.destroy(),this._stopsToSearches.delete(e)}_getEffectiveStops(){return this.viewModel.layer?.stops??this._placeholderStops}_getErrorDescription(){switch(this.viewModel.lastError?.name){case"directions-view-model:unable-to-route":return this.messages.errors.unableToRoute;case"directions-view-model:service-metadata-unavailable":return this.messages.errors.unableToLoadServiceMetadata;default:return this.messages.errors.unknownError}}_getNetworkFeatureName(e){switch(e.type){case"stop":switch(e.locationType){case"stop":default:return this.messages.networkFeatures.stops.stop;case"waypoint":return this.messages.networkFeatures.stops.waypoint;case"break":return this.messages.networkFeatures.stops.break}case"point-barrier":return this.messages.networkFeatures.pointBarrier;case"polyline-barrier":return this.messages.networkFeatures.polylineBarrier;case"polygon-barrier":return this.messages.networkFeatures.polygonBarrier}}_getRouteCostSummary(){const e=this.viewModel.layer?.routeInfo;if(!e)return null;const t=e.totalDistance??0,i=e.totalDuration??0,{messagesUnits:s,unit:o}=this;return{distance:M(s,t,o),duration:I(i)}}_getStopCostDescription(e){if(!e.directions.length)return;const{totalDistance:t,totalDuration:i}=e.directions.reduce(((e,{lines:t})=>{for(const{distance:i,duration:s}of t)e.totalDistance+=i??0,e.totalDuration+=s??0;return e}),{totalDistance:0,totalDuration:0}),{messagesUnits:s,unit:o}=this,r=M(s,t,o);return`${I(i)} (${r})`}_getStopSections(){if(!this.viewModel.layer)return null;const{directionPoints:e,directionLines:t,stops:i}=this.viewModel.layer;if(!e||!t)return null;const s=[];let o=null;for(const r of e){const{objectId:e,stopId:n}=r;if(null!=n){const e=i.find((({objectId:e})=>e===n));o&&o.stop===e||(o={stop:e,directions:[]},s.push(o));continue}if(null==o)continue;const a=t.toArray().filter((({directionPointId:t})=>t===e));0!==a.length&&o.directions.push({directionPoint:r,lines:a})}return s}_handleAddStopClick(){const e=new y;this.viewModel.layer?.stops.add(new w({symbol:e}))}_handleAutoSolveChange({target:e}){this.viewModel.autoSolve=e.checked}_handleCreatePolylineBarrierClick(){this.viewModel.create("polyline-barrier")}_handleClearRouteClick(){this._currentFlowItem="primary",this.viewModel.reset()}_handleCreateStopClick(){this.viewModel.create("stop")}_handleDeleteNetworkFeatureClick(e){this.viewModel.remove(e),this.viewModel.autoSolve&&this._solveRouteDebounced()}_handleDeleteStopClick(e){this._getEffectiveStops().remove(e),this._disposeSearch(e),this._solveRouteDebounced()}_handleDepartureDateChange({currentTarget:{value:e}}){Array.isArray(e)||(this.viewModel.departureIsoDate=e,this._solveRouteDebounced())}_handleDepartureTimeChange({currentTarget:{value:e}}){this.viewModel.departureIsoTime=e,this._solveRouteDebounced()}_handleDepartureTimeOptionChange({currentTarget:e}){const{selectedItems:t}=e;t.length&&(this.viewModel.departureOption=t[0].value,this._solveRouteDebounced())}_handleDirectionsFlowItemBackClick(e){e.stopPropagation(),this._currentFlowItem="primary"}_handleDirectionTurnItemSelect(e){this._activeManeuver===e?this.zoomToRoute():(this._activeManeuver=e,this.viewModel.centerAt(e.geometry))}_handleDirectionTurnPointerEnter(e){this.viewModel.highlight(e)}_handleDirectionTurnPointerLeave(){this.viewModel.clearHighlights()}_handleEditFlowItemBackClick(e){e.stopPropagation(),this.viewModel.stopEditing(),this._currentFlowItem="primary"}_handleEditingDoneClick(){this.viewModel.stopEditing(),this._currentFlowItem="primary"}_handleEditRouteClick(){this._currentFlowItem="edit",this.viewModel.startEditing()}_handleItemDetailsClick(){const e=this.viewModel.layer?.portalItem;e&&window.open(`${e.portal.url}/home/item.html?id=${e.id}`,"_blank")}_handleLocateStopClick(e){const{view:t}=this;if(!t)return;const i="directions-search-tool";this.removeHandles(i),this._searchTool=new k({stop:e,view:t}),this.addHandles([this._searchTool.on("click",(async t=>{if(t.mapPoint&&this._stopsToSearches.has(e)){const i=this._stopsToSearches.get(e),s=await i.search(t.mapPoint),o=s?.results?.[0].results?.[0];if(o){const{feature:t,name:s}=o;i.searchTerm=s,e.geometry=t.geometry}}this.removeHandles(i)})),o((()=>{this._searchTool&&(this.view?.tools.remove(this._searchTool),this._searchTool=null)}))],i),t.addAndActivateTool(this._searchTool)}_handleOptimizeStopOrderToggle({target:{expanded:e}}){this.viewModel.routeParameters.findBestSequence=e,this._solveRouteDebounced()}_handlePanToStopClick(e){this.viewModel.centerAt(e)}_handlePreserveFirstStopChange({target:{checked:e}}){this.viewModel.routeParameters.preserveFirstStop=e,this._solveRouteDebounced()}_handlePreserveLastStopChange({target:{checked:e}}){this.viewModel.routeParameters.preserveLastStop=e,this._solveRouteDebounced()}_handlePrintDocumentAfterCreate(e){e.focus(),this._printDocument=e,this._printDocumentParent=e.parentElement}_handlePrintDocumentClick(){this._printDocumentOpen=!0}_handlePrintDocumentCloseClick(){this._printDocumentOpen=!1}_handlePrintDocumentKeyDown(e){"Escape"===e.key&&(this._printDocumentOpen=!1)}_handlePrintDocumentPrintClick(){document.body.classList.add(f.printMedia),window.print(),document.body.classList.remove(f.printMedia)}_handleResolveRouteClick(){this._solveRouteDebounced()}_handleReverseStopOrderClick(){this._getEffectiveStops().reverse(),this._solveRouteDebounced()}_handleSaveErrorCloseClick(){this._currentFlowItem=this._parentFlowItem}_handleSaveFlowItemBackClick(e){e.stopPropagation(),this._currentFlowItem=this._parentFlowItem}async _handleSaveLayerAs(){const e=_.getDefault();try{await e.signIn()}catch(t){if(a(t)||"identity-manager:user-aborted"===t.name)return;return this._parentFlowItem=this._currentFlowItem,this._currentFlowItem="save",void(this._saveState="connect-to-portal-error")}this._saveState="fetch-portal-information",this._parentFlowItem=this._currentFlowItem,this._currentFlowItem="save",this._portalUserName=e.user?.username;try{this._portalFolders=await(e.user?.fetchFolders())}catch{return void(this._saveState="fetch-portal-information-error")}this._saveState="save-layer"}_handleSaveLayerClick(){this.viewModel.layer?.save()}_handleSaveLayerButtonClick(){this._saveState="saving";const{layer:e}=this;if(!e||!this._portalFolders)return;const t=this._portalItemNameInput?.value,i=this._portalFolderCombobox?.value,s=this._portalFolders.find((({id:e})=>e===i));e.saveAs({title:t},{folder:s}).then((()=>{e.title=t,this._currentFlowItem=this._parentFlowItem})).catch((()=>{this._saveState="saving-error"}))}_handleSaveLayerCancelClick(){this._currentFlowItem=this._parentFlowItem}_handleSaveLayerFolderCreate(e){this._portalFolderCombobox=e}_handleSaveLayerNameCreate(e){this._portalItemNameInput=e}_handleSignInClick(){this.viewModel.load().catch((()=>{}))}_handleStopListReorder({detail:{dragEl:e,newIndex:t}}){this._getEffectiveStops().reorder(e.value,t),this._solveRouteDebounced()}_handleTravelModeChange({currentTarget:{selectedItems:e}}){e.length&&(this.viewModel.selectedTravelMode=e[0].value,this._solveRouteDebounced())}_handleViewDrivingDirectionsClick(){this._currentFlowItem="directions"}_normalizeSearchSources(e){this._overrideDefaultSources(e),this._applyLocatorSourceOverrides(e)}_overrideDefaultSources(e){for(const t of e.viewModel.defaultSources)t.autoNavigate=!1}_renderClearRouteAction(e){return A("calcite-action",{bind:this,icon:"trash",key:"clear-route",onclick:this._handleClearRouteClick,...e,text:this.messages.common.clear,textEnabled:!0})}_renderDeleteStopAction(e){return A("calcite-action",{icon:"trash",onclick:this._handleDeleteStopClick.bind(this,e),scale:"s",slot:"actions-end",text:this.messages.deleteStop,title:this.messages.deleteStop})}_renderDepartureTime(){const{DEPART_AT:e,NOW:t,UNSPECIFIED:i}=T;return A("calcite-label",{class:f.departureTime,key:"departure-time"},this.messages.departureTime,A("calcite-combobox",{bind:this,clearDisabled:!0,label:this.messages.departureTime,overlayPositioning:"fixed",selectionMode:"single-persist",onCalciteComboboxChange:this._handleDepartureTimeOptionChange},A("calcite-combobox-item",{heading:this.messages.leaveNow,key:t,label:this.messages.leaveNow,selected:this.viewModel.departureOption===t,value:t}),A("calcite-combobox-item",{heading:this.messages.departAt,key:e,label:this.messages.departAt,selected:this.viewModel.departureOption===e,value:e}),A("calcite-combobox-item",{heading:this.messages.timeUnspecified,key:i,label:this.messages.timeUnspecified,selected:this.viewModel.departureOption===i,value:i})))}_renderDepartureTimeOptions(){return this.viewModel.departureOption!==T.DEPART_AT?null:A("div",{class:f.departureTimeOptions},A("calcite-input-date-picker",{bind:this,scale:"s",value:this.viewModel.departureIsoDate,onCalciteInputDatePickerChange:this._handleDepartureDateChange}),A("calcite-input-time-picker",{bind:this,scale:"s",value:this.viewModel.departureIsoTime,onCalciteInputTimePickerClose:this._handleDepartureTimeChange}))}_renderDirectionsFlowItem(){if("directions"!==this._currentFlowItem)return null;const e=this._getRouteCostSummary();if(!this._sections||!e)return null;const{distance:t,duration:i}=e,{formattedEta:s}=this.viewModel,o=this._sections.at(0)?.stop.name??"",r=this._sections.at(-1)?.stop.name??"";return A("calcite-flow-item",{bind:this,key:"directions-flow-item",overlayPositioning:"fixed",selected:"directions"===this._currentFlowItem,onCalciteFlowItemBack:this._handleDirectionsFlowItemBackClick},A("div",{class:f.directionsHeader,slot:"header-content"},A("div",{class:f.headerStops},A("span",null,this.messages.from)," ",A("span",{class:f.directionsHeaderStopName},o),A("span",null,this.messages.to)," ",A("span",{class:f.directionsHeaderStopName},r)),A("div",{class:f.flexColumn},A("span",null,`${i} (${t})`),s?A("span",null,s):null)),this._renderRouteLayerActions({slot:"header-menu-actions"}),A("calcite-accordion",{class:f.accordion,iconPosition:"start",selectionMode:"single"},this._sections.map(((e,t)=>this._renderDirectionSection(e,t)))))}_renderDirectionSection(e,t){const{stop:i,directions:s}=e,{name:o}=i,r=0===t,n=this._getStopCostDescription(e);return A("calcite-accordion-item",{description:n,expanded:r,heading:o??"",key:`stop-${t}`},A("calcite-action",{icon:"zoom-to-object",onclick:this._handlePanToStopClick.bind(this,i),slot:"actions-end",text:this.messages.panToStop,title:this.messages.panToStop}),this._renderDirectionTurns(s))}_renderDirectionTurns(e){return A("calcite-list",{label:this.messages.drivingDirections,selectionMode:"none"},e.map(((e,t)=>{const{directionPoint:i,lines:s}=e,o=s[0],{distance:r,duration:n}=o,a=M(this.messagesUnits,r??0,this.unit),l=I(n??0),c=a&&l?`${a} | ${l}`:`${a||l}`,d=O(i),h=F(i.directionPointType);return A("calcite-list-item",{class:f.labelNoBottomMargin,key:`driving-direction-${t}`,onpointerenter:this._handleDirectionTurnPointerEnter.bind(this,o),onpointerleave:this._handleDirectionTurnPointerLeave.bind(this),onCalciteListItemSelect:this._handleDirectionTurnItemSelect.bind(this,o)},A("calcite-icon",{icon:h,slot:"content-start"}),A("div",{slot:"content"},A("calcite-label",{layout:"inline",scale:"s"},d),A("calcite-label",{layout:"inline",scale:"s"},c)))})))}_renderEditFlowItem(){return"edit"!==this._currentFlowItem?null:A("calcite-flow-item",{bind:this,heading:this.messages.editRoute,headingLevel:this.headingLevel,key:"edit-flow-item",loading:"routing"===this.viewModel.state,selected:"edit"===this._currentFlowItem,onCalciteFlowItemBack:this._handleEditFlowItemBackClick},A("div",{class:f.flexColumn,key:"edit-container"},A("div",{class:f.editToolbarContainer},A("calcite-label",{layout:"inline",scale:"s"},this.messages.automaticallySolve,A("calcite-switch",{bind:this,checked:this.viewModel.autoSolve,scale:"s",onCalciteSwitchChange:this._handleAutoSolveChange})),A("div",{class:f.editToolbar},A("calcite-action",{bind:this,disabled:!this.viewModel.layer||this.viewModel.layer.stops.length>=this.maxStops,icon:"flag",onclick:this._handleCreateStopClick,scale:"s",text:this.messages.networkFeatures.stops.stop,textEnabled:!0}),A("calcite-action",{bind:this,icon:"line",onclick:this._handleCreatePolylineBarrierClick,scale:"s",text:this.messages.barrier,textEnabled:!0}),A("calcite-action",{bind:this,class:f.solveRoute,disabled:this.viewModel.autoSolve,icon:"refresh",onclick:this._handleResolveRouteClick,scale:"s",text:this.messages.solve,textEnabled:!0}))),A("div",{class:f.selectedFeatureContainer},A("calcite-list",{label:this.messages.selectedNetworkFeatures,scale:"s",selectionMode:"none"},this.viewModel.selectedNetworkFeatures?.toArray().map(((e,t)=>A("calcite-list-item",{description:this._getNetworkFeatureName(e),key:`network-feature-${t}`,label:e.name??e.objectId?.toString()??this.messages.unnamed},A("calcite-action",{icon:"trash",onclick:this._handleDeleteNetworkFeatureClick.bind(this,e),scale:"s",slot:"actions-end",text:this.messages.common.delete})))))),A("div",{class:f.editFooter},this._renderEditFooterContent())))}_renderEditFooterContent(){return this.viewModel.lastError?this._renderErrorNotice():A("calcite-button",{appearance:"outline-fill",bind:this,onclick:this._handleEditingDoneClick,width:"full"},this.messages.common.done)}_renderErrorNotice(){return A("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0},A("calcite-label",{class:f.labelNoBottomMargin,slot:"message"},this._getErrorDescription()))}_renderFooter(){if(!this.viewModel.layer)return A("div",{class:f.primaryFooter,key:"footer-missing-layer"},A("calcite-notice",{icon:"information",open:!0},A("calcite-label",{class:f.labelNoBottomMargin,slot:"message"},this.messages.missingLayer)));if("unauthenticated"===this.viewModel.state)return A("div",{class:f.primaryFooterCentered,key:"footer-sign-in"},A("calcite-label",null,this.messages.signInRequired),A("calcite-button",{bind:this,onclick:this._handleSignInClick},this.messages.common.auth.signIn));if("routing"===this.viewModel.state)return A("div",{class:this.classes(f.primaryFooter,f.primaryFooterLoader),key:"footer-routing"},A("calcite-loader",{label:this.messages.solve,scale:"s"}));if("error"===this.viewModel.state)return A("div",{class:f.primaryFooter,key:"footer-service-error"},this._renderErrorNotice());if(!this.viewModel.layer?.routeInfo)return A("div",{class:f.primaryFooter,key:"footer-unsolved-route"},A("calcite-notice",{icon:"information",open:!0},A("calcite-label",{class:f.labelNoBottomMargin,slot:"message"},this.messages.directionsPlaceholder)));const e=this._getRouteCostSummary();if(!e||!this.viewModel.layer?.directionPoints)return A("div",{class:f.primaryFooter,key:"footer-invalid-route"},A("calcite-notice",{icon:"exclamation-mark-triangle",kind:"danger",open:!0},A("calcite-label",{class:f.labelNoBottomMargin,slot:"message"},this.messages.invalidRoute)));const{distance:t,duration:i}=e,{formattedEta:s}=this.viewModel;return A("div",{class:f.routeItem,key:"footer-directions-summary"},A("button",{"aria-busy":"false","aria-label":this.messages.viewDrivingDirections,"aria-live":"polite",bind:this,class:f.routeItemButton,onclick:this._handleViewDrivingDirectionsClick,title:this.messages.viewDrivingDirections,type:"button"},A("div",{class:f.routeItemButtonContent},A("span",{class:f.routeItemLabel},`${i} (${t})`),A("span",{class:f.routeItemDescription},s)),A("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s"})),A("calcite-action-menu",{label:"test"},A("calcite-action",{icon:"ellipsis",key:"route-actions",slot:"trigger",text:"Route actions"}),this._renderRouteLayerActions()))}_renderInteractiveRouteActions(){return A("div",{class:f.actionContainer,key:f.actionContainer},A("calcite-button",{appearance:"outline",bind:this,class:f.addStopButton,disabled:this._getEffectiveStops().length>=this.maxStops,iconStart:"plus",kind:"neutral",label:this.messages.addStop,onclick:this._handleAddStopClick,title:this.messages.addStop,width:"half"},this.messages.addStop),this.visibleElements.editRouteButton?A("calcite-button",{appearance:"outline",bind:this,class:f.editRouteButton,disabled:"2d"!==this.viewModel.view?.type,iconStart:"pencil",kind:"neutral",label:this.messages.editRoute,onclick:this._handleEditRouteClick,title:this.messages.editRoute,width:"half"},this.messages.editRoute):null)}_renderLocateStopAction(e){if(null!=e.name||null!=e.geometry)return null;const t=this._getEffectiveStops().indexOf(e),i=!!this.view?.activeTool&&this.view.activeTool===this._searchTool&&this._searchTool.stop===e;return A("calcite-action",{active:i,icon:"crosshair",key:`stop-location-action-${t}`,onclick:this._handleLocateStopClick.bind(this,e),scale:"s",slot:"actions-end",text:this.messages.pickALocationOnTheMap,title:this.messages.pickALocationOnTheMap})}_renderOptimizeStopOrder(){const{routeParameters:e}=this.viewModel,{findBestSequence:t,preserveFirstStop:i,preserveLastStop:s}=e;return A("calcite-block-section",{bind:this,class:f.optimizeSection,text:this.messages.optimizeOrder,toggleDisplay:"switch",onCalciteBlockSectionToggle:this._handleOptimizeStopOrderToggle},t?[A("calcite-label",{class:f.optimizeSwitches,key:"preserve-first-stop",layout:"inline-space-between"},this.messages.preserveFirstStop,A("calcite-switch",{bind:this,checked:i,scale:"s",onCalciteSwitchChange:this._handlePreserveFirstStopChange})),A("calcite-label",{class:f.optimizeSwitches,key:"preserve-last-stop",layout:"inline-space-between"},this.messages.preserveLastStop,A("calcite-switch",{bind:this,checked:s,scale:"s",onCalciteSwitchChange:this._handlePreserveLastStopChange}))]:null)}_renderPrimaryFlowItem(){return A("calcite-flow-item",{key:"primary-flow-item",loading:"initializing"===this.viewModel.state,selected:"primary"===this._currentFlowItem},A("calcite-panel",{class:f.primaryFlowItem,disabled:!this.viewModel.layer||"unauthenticated"===this.viewModel.state||"error"===this.viewModel.state&&!this.viewModel.serviceDescription},this._renderStops(),this._renderInteractiveRouteActions(),this._renderSeparator(),this._renderRouteSolveOptions()),this._renderFooter())}_renderPrintDocument(){if(!this._printDocumentOpen)return null;const e=this._getRouteCostSummary();if(!this._sections||!e)return null;const{distance:t,duration:i}=e,{formattedEta:s}=this.viewModel,o=this._sections.at(0)?.stop.name??"",r=this._sections.at(-1)?.stop.name??"";return A("div",{afterCreate:this._handlePrintDocumentAfterCreate,bind:this,class:f.printDocument,onkeydown:this._handlePrintDocumentKeyDown,tabindex:0},A("div",{class:f.printBody},A("div",{class:f.printHeader},A("div",{class:f.printHeaderLabel},A("div",{class:f.headerStops},A("span",null,this.messages.from)," ",A("span",{class:f.directionsHeaderStopName},o),A("span",null,this.messages.to)," ",A("span",{class:f.directionsHeaderStopName},r))),A("div",{class:this.classes(f.printHeaderButtons,f.printHideOnPrint)},A("calcite-button",{class:f.printDocumentPrint,iconStart:"print",onclick:this._handlePrintDocumentPrintClick},this.messages.common.print),A("calcite-button",{appearance:"outline",bind:this,class:f.printDocumentClose,iconStart:"x-circle",onclick:this._handlePrintDocumentCloseClick},this.messages.common.close))),A("div",{class:f.directionsHeader},A("span",null,`${i} (${t})`),s?A("span",null,s):null),this._sections.map(((e,t)=>this._renderPrintSection(e,t)))))}_renderPrintManuever(e,t){const{directionPoint:i,lines:s}=e,{distance:o,duration:r}=s.at(0)??{},n=M(this.messagesUnits,o??0,this.unit),a=I(r??0),l=n&&a?`${n} | ${a}`:`${n||a}`,c=O(i),d=F(i.directionPointType);return A("div",{class:this.classes(f.flexRow,f.printAvoidPageBreak),key:`direction-${t}`},A("calcite-icon",{icon:d}),A("div",{class:f.flexColumn},A("span",null,c),A("span",null,l)))}_renderPrintRouteAction(e){const t=!this.viewModel.layer?.routeInfo;return A("calcite-action",{bind:this,disabled:t,icon:"print",key:"print-route",onclick:this._handlePrintDocumentClick,...e,text:this.messages.common.print,textEnabled:!0})}_renderPrintSection({stop:e,directions:t},i){return A("div",{class:f.printSection,key:`section-${i}`},A("span",{class:f.directionsHeaderStopName},e.name??""),t.map(((e,t)=>this._renderPrintManuever(e,t))))}_renderRouteLayerActions(e){return[this._renderClearRouteAction(e),this._renderSaveLayerAction(e),this._renderSaveLayerAsAction(e),this._renderPrintRouteAction(e),this._renderViewItemDetailsAction(e)]}_renderRouteSolveOptions(){return A("div",{class:f.marginInlineMedium,key:"route-solve-options"},this._renderTravelModes(),this._renderDepartureTime(),this._renderDepartureTimeOptions(),this._renderOptimizeStopOrder())}_renderSaveContent(){switch(this._saveState){case"initialized":return this._renderSaveInitialized();case"connect-to-portal":return this._renderSaveProcessing(this.messages.identity.lblSigning);case"connect-to-portal-error":return this._renderSaveError(this.messages.errors.authenticating);case"fetch-portal-information":return this._renderSaveProcessing(this.messages.processing.fetching);case"fetch-portal-information-error":return this._renderSaveError(this.messages.errors.fetching);case"save-layer":return this._renderSaveLayerSettings();case"saving":return this._renderSaveProcessing(this.messages.processing.saving);case"saving-error":return this._renderSaveError(this.messages.errors.saving)}}_renderSaveError(e){return A("calcite-panel",{class:f.paddingMedium,key:"save-layer-error"},A("div",{class:f.saveError},A("calcite-icon",{class:f.saveErrorIcon,icon:"exclamation-mark-triangle",scale:"l",textLabel:this.messages.common.errorMessage}),A("calcite-label",{class:f.saveErrorLabel},e)),A("calcite-button",{appearance:"outline",bind:this,onclick:this._handleSaveErrorCloseClick,slot:"footer-actions",width:"full"},this.messages.common.close))}_renderSaveInitialized(){return A("calcite-panel",{class:f.paddingMedium,key:"save-layer-initialized"})}_renderSaveFlowItem(){return"save"!==this._currentFlowItem?null:A("calcite-flow-item",{bind:this,heading:this.messages.saveLayer,headingLevel:this.headingLevel,key:"save-layer-flow-item",selected:"save"===this._currentFlowItem,onCalciteFlowItemBack:this._handleSaveFlowItemBackClick},this._renderSaveContent())}_renderSaveLayerAction(e){if(!this.visibleElements.saveButton)return null;const t=this.viewModel.layer,i=t?.routeInfo,s=t?.portalItem?.itemControl;return A("calcite-action",{bind:this,disabled:!(!!i&&("admin"===s||"update"===s)),icon:"save",key:"save-route",onclick:this._handleSaveLayerClick,...e,text:this.messages.common.save,textEnabled:!0})}_renderSaveLayerAsAction(e){if(!this.visibleElements.saveAsButton)return null;const t=!this.viewModel.layer?.routeInfo;return A("calcite-action",{disabled:t,icon:"save-as",key:"save-as-route",onclick:()=>{this._handleSaveLayerAs()},...e,text:this.messages.common.saveAs,textEnabled:!0})}_renderSaveLayerSettings(){if(null==this.layer||null==this._portalFolders||null==this._portalUserName)return this._renderSaveInitialized();const{stops:e}=this.layer,t=`${e.at(0).name} - ${e.at(-1).name}`,i=[A("calcite-combobox-item",{heading:`${this._portalUserName} (${this.messages.common.home})`,key:f.folderHome,selected:!0,value:f.folderHome}),...this._portalFolders.map((e=>A("calcite-combobox-item",{heading:e.title??"",key:`${f.folder}-${e.id}`,value:e.id})))];return A("calcite-panel",{key:"save-layer-panel"},A("div",{class:f.paddingMedium},A("calcite-label",null,this.messages.layerName,A("calcite-input",{afterCreate:this._handleSaveLayerNameCreate,bind:this,label:this.messages.layerName,value:t})),A("calcite-label",null,this.messages.saveInFolder,A("calcite-combobox",{afterCreate:this._handleSaveLayerFolderCreate,bind:this,clearDisabled:!0,label:this.messages.saveInFolder,overlayPositioning:"fixed",selectionMode:"single-persist"},i))),A("calcite-button",{bind:this,onclick:this._handleSaveLayerButtonClick,slot:"footer-actions",width:"full"},this.messages.common.save),A("calcite-button",{appearance:"outline",bind:this,onclick:this._handleSaveLayerCancelClick,slot:"footer-actions",width:"full"},this.messages.common.cancel))}_renderSaveProcessing(e){return A("calcite-panel",{class:f.marginInlineMedium,key:"save-layer-processing"},A("calcite-loader",{class:f.saveProcessLoader,label:e,text:e}))}_renderSeparator(){return A("div",{class:f.separator})}_renderStop(e){const t=this.acquireSearch(e);null!=e.name&&(t.searchTerm=e.name);const i=this._getEffectiveStops(),s=this._renderLocateStopAction(e),o=i.length>2&&this._renderDeleteStopAction(e);return A("calcite-list-item",{key:e,value:e},s,o,A("div",{class:f.stopItem,slot:"content"},t.render()))}_renderStops(){const e=this._getEffectiveStops();for(const t of this._stopsToSearches.keys())e.includes(t)||this._disposeSearch(t);return A("div",{class:f.stopContainer,key:f.stopContainer},A("calcite-list",{bind:this,class:f.stopList,dragEnabled:!0,label:this.messages.widgetLabel,scale:"s",onCalciteListOrderChange:this._handleStopListReorder},e.toArray().map((e=>this._renderStop(e)))),2===e.length&&A("calcite-action",{bind:this,icon:"arrow-up-down",onclick:this._handleReverseStopOrderClick,scale:"s",text:this.messages.reverseStops,title:this.messages.reverseStops}))}_renderTravelMode(e){const{id:t,name:i}=e;return A("calcite-combobox-item",{heading:i,key:t,label:i,selected:this.viewModel.selectedTravelMode?.id===t,value:e})}_renderTravelModes(){return this.viewModel.travelModes.length?A("calcite-label",{key:"travel-modes"},this.messages.mode,A("calcite-combobox",{bind:this,clearDisabled:!0,label:this.messages.mode,overlayPositioning:"fixed",selectionMode:"single-persist",onCalciteComboboxChange:this._handleTravelModeChange},this.viewModel.travelModes.map((e=>this._renderTravelMode(e))))):null}_renderViewItemDetailsAction(e){return this.visibleElements.layerDetails?A("calcite-action",{bind:this,disabled:!this.viewModel.layer?.portalItem,icon:"launch",key:"open-route-details-link",onclick:this._handleItemDetailsClick,...e,text:this.messages.viewLayerDetails,textEnabled:!0}):null}async _solveRoute(){this.viewModel.updateDepartureTime();if(!((this.viewModel.layer?.stops.filter((({geometry:e})=>!!e)).length??0)<2))try{await this.viewModel.getDirections()}catch{}}};e([p()],N.prototype,"_printDocumentOpen",void 0),e([p()],N.prototype,"_currentFlowItem",void 0),e([p()],N.prototype,"_saveState",void 0),e([p()],N.prototype,"_searchTool",void 0),e([p()],N.prototype,"apiKey",null),e([p(g)],N.prototype,"defaultUnit",void 0),e([p()],N.prototype,"goToOverride",null),e([p()],N.prototype,"headingLevel",void 0),e([p()],N.prototype,"icon",null),e([p()],N.prototype,"label",null),e([p({readOnly:!0})],N.prototype,"lastRoute",null),e([p()],N.prototype,"layer",null),e([p()],N.prototype,"maxStops",null),e([p(),L("esri/widgets/Directions/t9n/Directions")],N.prototype,"messages",void 0),e([p(),L("esri/core/t9n/Units")],N.prototype,"messagesUnits",void 0),e([p()],N.prototype,"searchProperties",void 0),e([p()],N.prototype,"unit",null),e([p()],N.prototype,"view",null),e([p({type:C})],N.prototype,"viewModel",void 0),e([p({type:D,nonNullable:!0})],N.prototype,"visibleElements",void 0),N=e([m("esri.widgets.Directions")],N);const j=N;export{j as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import o from"../../core/Accessor.js";import e from"../../core/Error.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";var s;let a=s=class extends o{constructor(t){super(t),this.editorItem=null,this.feature=null,this.utilityNetwork=null,this.associationType=null,this.parent=null,this.associationInput=null,this.viewModel=null}static async create(t){const{feature:o,parent:r,viewModel:i,utilityNetwork:a,associationType:p,associationInput:n}=t,c=i.editorItems.find((t=>t.layer===o.
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import o from"../../core/Accessor.js";import e from"../../core/Error.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";var s;let a=s=class extends o{constructor(t){super(t),this.editorItem=null,this.feature=null,this.utilityNetwork=null,this.associationType=null,this.parent=null,this.associationInput=null,this.viewModel=null}static async create(t){const{feature:o,parent:r,viewModel:i,utilityNetwork:a,associationType:p,associationInput:n}=t,c=i.editorItems.find((t=>t.layer===o.sourceLayer));if(!c)throw new e("no-editorItem-found","The EditorViewModel provided did not have an EditorItem associated with the specified Graphic's layer");return new s({editorItem:c,feature:o,parent:r,viewModel:i,utilityNetwork:a,associationType:p,associationInput:n})}};t([r({constructOnly:!0})],a.prototype,"editorItem",void 0),t([r()],a.prototype,"feature",void 0),t([r({constructOnly:!0})],a.prototype,"utilityNetwork",void 0),t([r({constructOnly:!0})],a.prototype,"associationType",void 0),t([r()],a.prototype,"parent",void 0),t([r()],a.prototype,"associationInput",void 0),t([r()],a.prototype,"viewModel",void 0),a=s=t([i("esri.widgets.Editor.AddAssociationWorkflowData")],a);export{a as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import{isSome as t}from"../../core/arrayUtils.js";import{createTask as i}from"../../core/asyncUtils.js";import a from"../../core/Collection.js";import r from"../../core/Error.js";import s from"../../core/Evented.js";import{makeHandle as o}from"../../core/handleUtils.js";import n from"../../core/Logger.js";import{destroyMaybe as l,abortMaybe as p,removeMaybe as c}from"../../core/maybe.js";import{throwIfAborted as d,createResolver as u}from"../../core/promiseUtils.js";import{watch as h,on as w,when as f,syncAndInitial as m,initial as y,sync as g,whenOnce as k}from"../../core/reactiveUtils.js";import{property as v}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as _}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as W}from"../../core/support/UpdatingHandles.js";import{getTemplatesForLayers as M}from"../../editing/templateUtils.js";import F from"../../layers/GraphicsLayer.js";import{isEditableLayer as E}from"../../layers/support/editableLayers.js";import{isFeatureLayer as b,isSubtypeGroupLayer as V,getOwningPortalUrl as T}from"../../layers/support/layerUtils.js";import{parseKnownArcGISOnlineDomain as I}from"../../portal/support/urlUtils.js";import L from"../../views/SelectionManager.js";import A from"../../views/interactive/sketch/SketchOptions.js";import{SnappingManager as U}from"../../views/interactive/snapping/SnappingManager.js";import S from"../../views/interactive/snapping/SnappingOptions.js";import{isSelectableLayer as C}from"../../views/support/selectionUtils.js";import O from"../Attachments/AttachmentsViewModel.js";import j from"./CreateFeaturesWorkflow.js";import P from"./UpdateFeaturesWorkflow.js";import R from"./UpdateWorkflow.js";import{getLayersFromWorkflow as H,isUpdateWorkflow as G,whenEditorLayerView as x}from"./workflowUtils.js";import D from"./support/EditorItem.js";import{makeTemplateGroupInfoForLayer as B}from"../FeatureTemplates/featureTemplatesUtils.js";import q from"../FeatureTemplates/FeatureTemplatesViewModel.js";import N from"../Sketch/SketchViewModel.js";import Q from"../Spinner/SpinnerViewModel.js";import{goTo as z}from"../support/goToUtils.js";import{isFeatureItem as Z,isLayerItem as $}from"../support/SelectionList/selectionListUtils.js";import J from"../support/SelectionList/SelectionListViewModel.js";import K from"../support/SelectionToolbar/SelectionToolbarViewModel.js";function X(e,t){return e?.find((e=>e.layer===t))}let Y=class extends s.EventedAccessor{constructor(e){super(e),this._templatesByLayer=new Map,this._sketchEventListenerHandle=null,this._sketchGraphicsLayer=new F({listMode:"hide",internal:!0}),this._snappingManager=null,this._updateItemsTask=null,this._updateTemplatesTask=null,this._updatingHandles=new W,this._featureTemplatesViewModelIsRestricted=!1,this.activeWorkflow=null,this._activityQueue=new a,this.editorItems=new a,this.failures=[],this.hideTemplatesForInactiveLayers=!1,this.attachmentsViewModel=new O({capabilities:{editing:!0}}),this.featureTemplatesViewModel=new q({disabledItemFunction:({layer:e})=>this._itemIsSuspended(e)}),this.layerInfos=null,this.ownSketchViewModel=new N({layer:this._sketchGraphicsLayer}),this.selectionListViewModel=new J,this.selectionManager=new L,this.selectionToolbarViewModel=new K({persistSelection:!1,returnGeometry:!1}),this.sketchOptions=new A,this.snappingOptions=new S({attributeRulesEnabled:!0}),this.spinnerViewModel=new Q,this.pageStack=[],this.showDiscardEditsPrompt=()=>Promise.resolve(!0),this._candidateCommitted=!1,this.back=async()=>{this.selectionToolbarViewModel.cancel(),"viewing-selection-list"!==this.state?this.canGoBack&&(this.activeWorkflow?.hasPreviousStep?await this.activeWorkflow.back(this.showDiscardEditsPrompt):await this._cancelWorkflow({force:!this.hasPendingEdits})):this.effectiveSelectionManager.clear()},this.saveWorkflow=async()=>await(this.activeWorkflow?.save()),this.selectFeature=(e,t=!1)=>{const i=this.activeWorkflow;this._candidateCommitted||"update"!==i?.type||(i.data.rootFeature=e,t&&(i.next(),this._candidateCommitted=!0))}}initialize(){this.addHandles([h((()=>{const e=this.view,t=e?.map?.editableLayers.toArray(),i=e?.allLayerViews,a=i?.filter((e=>!!t?.includes(e.layer)));return[t,a,this.layerInfos]}),(()=>this._updateEditorItems()),m),h((()=>this.hideTemplatesForInactiveLayers),(()=>this.syncFeatureTemplates())),w((()=>this.activeWorkflow),"cancel",(()=>this.emit("workflow-cancel"))),w((()=>this.activeWorkflow),"commit",(()=>this.emit("workflow-commit"))),w((()=>this.activeWorkflow),"complete",(()=>{this.emit("workflow-commit"),this._set("activeWorkflow",null)})),f((()=>this.view?.map),(e=>e.add(this._sketchGraphicsLayer)),y),w((()=>this.editorItems),"change",(()=>this._afterEditorItemsChange())),h((()=>[this.canCreate,this.canUpdateVisible]),(()=>this._afterEditorItemsChange())),h((()=>this.page),((e,t)=>{const i=[...this.pageStack];if(-1===i.indexOf(e))i.push(e);else for(;i.length&&i.at(-1)!==e;)i.pop();this.pageStack=i}),m),f((()=>"awaiting-update-feature-candidate"===this.state),(()=>this._candidateCommitted=!1)),w((()=>this.featureTemplatesViewModel),"select",(async({item:e,oldItem:t})=>{const{activeWorkflow:i}=this;if(i){if("update"===i.type&&"awaiting-feature-creation-info"===i.activeWorkflow?.stepId)return;try{await this.cancelWorkflow({force:!this.hasPendingEdits})}catch{return void this.featureTemplatesViewModel.select(t,{emit:!1})}}if(!e)return;const a={layer:e.layer,template:e.template};if(e.supportsUpload)return this.featureTemplatesViewModel.select(t,{emit:!1}),this.startCreateFeaturesWorkflow(a);this.startCreateFeaturesWorkflowAtFeatureCreation(a)})),h((()=>[this.view,this.featureTemplatesViewModel]),(([e,t])=>{t.view=e}),m),w((()=>this.view),"key-down",(e=>{"Escape"===e.key&&this.activeWorkflow?.keyboardCancellationEnabled&&(e.stopPropagation(),this.back())})),w((()=>this.sketchViewModel),["create","delete","update"],(e=>{const{activeWorkflow:t}=this,i="update"===t?.type,a=H(t),r=i?t?.activeWorkflow?.parentLayer:void 0,s=`sketch-${e.type}`;this.emit(s,{type:s,detail:e,layer:a[0],layers:a,parentLayer:r})}),g),h((()=>this.view),(e=>{if(this._snappingManager=l(this._snappingManager),!e)return;const t=this.snappingOptions;this._snappingManager=new U({view:e,options:t}),this.ownSketchViewModel.snappingManager=this._snappingManager}),m),h((()=>this.snappingOptions),(e=>{this._snappingManager&&(this._snappingManager.options=e)}),m),w((()=>this.selectionToolbarViewModel),"complete",(e=>this._onSelectionComplete(e))),h((()=>({view:this.view,selectionManager:this.effectiveSelectionManager,selectionListViewModel:this.selectionListViewModel,selectionToolbarViewModel:this.selectionToolbarViewModel})),(({view:e,selectionManager:t,selectionListViewModel:i,selectionToolbarViewModel:a})=>{t.view=e,i.view=e,a.view=e}),m),h((()=>this.effectiveSelectionManager),(e=>{this.selectionListViewModel.selectionManager=e,this.selectionToolbarViewModel.selectionManager=e}),m)])}destroy(){this._cancelWorkflow({warnIfNoWorkflow:!1}).then((()=>{this.view?.map?.remove(this._sketchGraphicsLayer),this.view=null})),this._updateItemsTask=p(this._updateItemsTask),this._updatingHandles.destroy(),this._sketchEventListenerHandle=c(this._sketchEventListenerHandle)}get _featureTemplatesLayersAndTables(){const e=new a;for(const t of this.editorItems){const i=this.hideTemplatesForInactiveLayers&&!t.visible;t.supportsCreateFeaturesWorkflow&&!i&&e.push(t.layer)}return e}get activeLeafWorkflow(){const e=this.activeWorkflow;return e&&G(e)?e.activeWorkflow??e:e}get canCreate(){return this.editorItems.some((e=>e.supportsCreateFeaturesWorkflow))}get canCreateVisible(){return!!this.featureTemplatesLayers.length}get canUpdate(){return this.editorItems.some((e=>e.supportsUpdateWorkflow))}get canUpdateVisible(){return this.editorItems.some((e=>e.supportsUpdateWorkflow&&e.visible))}get featureTemplatesLayers(){return this._featureTemplatesLayersAndTables.filter((e=>"scene"===e.type||!e.isTable))}get effectiveSelectionManager(){return this.selectionManager}get featureFormViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeFeatureFormViewModel:"create-features"===e?.type?e.featureFormViewModel:null}get formViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeFeatureFormViewModel:"create-features"===e?.type?e.featureFormViewModel:"update-features"===e?.type?e.formViewModel:null}get utilityNetworkAssociationAddAssociationViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeUtilityNetworkAssociationAddAssociationViewModel:null}get labelOptions(){return this.sketchOptions.labels}set labelOptions(e){this.sketchOptions.labels=e}get sketchViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeSketchViewModel:"create-features"===e?.type?e.sketchViewModel:this.ownSketchViewModel}get state(){if(!this.view?.ready)return"disabled";const e=this.attachmentsViewModel.mode;if("add"===e)return"adding-attachment";if("edit"===e)return"editing-attachment";const{activeWorkflow:t}=this,i=!t?.stepId;return this.effectiveSelectionManager.count&&i?"viewing-selection-list":i?"ready":"update"===t.type&&t.activeWorkflow?.stepId?t.activeWorkflow.stepId:t.stepId}get syncing(){return this._activityQueue.length>0}get updating(){return this._updatingHandles.updating||!0===this.activeWorkflow?.updating}get tooltipOptions(){return this.sketchOptions.tooltips}set tooltipOptions(e){this.sketchOptions.tooltips=e}get valueOptions(){return this.sketchOptions.values}set valueOptions(e){this.sketchOptions.values=e}set view(e){this.ownSketchViewModel.view=e,this.spinnerViewModel.view=e,this._set("view",e)}get canZoomTo(){const e=this.sketchViewModel,t=e?.createGraphic?.geometry?.type;return!(!e?.updateGraphics?.length&&"multipoint"!==t)}get page(){const{activeWorkflow:e,state:t}=this;if("update"===e?.type&&null!=e?.activeWorkflow?.featureFormViewModel?.associatedLayer)return"viewing-associated-features";if("update"===e?.type&&null!=e?.activeWorkflow?.featureFormViewModel?.associationId)return"viewing-associated-layers";if("update"===e?.type&&"awaiting-feature-to-update"===e.stepId)return"ready";if("create-features"===e?.type&&0===e.numPendingFeatures){const t=e.data.upload;if(t)return"default"===t.state?"ready":"creating-features-upload-details"}return t??"disabled"}get featureFormDisabled(){const{activeWorkflow:e}=this;return"update"===e?.type&&(!1===e.activeEditorItem?.capabilities.update.attributes||!0===e.activeFeatureFormViewModel?.disabled)}get featureFormHasAssociation(){return!!this.featureFormViewModel?.activeAssociation}get canGoBack(){return null!=this.activeWorkflow&&!this.syncing}get shouldShowDeleteButton(){const{activeWorkflow:e}=this;return!!e&&"update"===e.type&&!!e.activeEditorItem?.capabilities.delete.enabled}get hasPendingEdits(){return this.activeWorkflow?.hasPendingEdits??!1}get snappingManager(){return this._snappingManager}getTemplatesForLayer(e){return this._templatesByLayer.get(e)??[]}async startCreateFeaturesWorkflowAtFeatureTypeSelection(){return this.startCreateFeaturesWorkflow()}async startCreateFeaturesWorkflowAtFeatureCreation(e){return this.startCreateFeaturesWorkflow(e,"creating-features")}async startCreateFeaturesWorkflow(e,t="awaiting-feature-creation-info"){if(await k((()=>!this.updating)),!this.canCreate)throw new r("editing:unsupported-workflow","Creating features is unsupported or disabled.");const i=this._createUpdatingResolver();try{await this._cancelWorkflow();const i=this._createCreateFeaturesWorkflow(e,t);this._set("activeWorkflow",i),await i.start()}catch(a){this._logErrorAndCancelWorkflow(a)}finally{i.resolve()}}async startCreateFeaturesWorkflowAtFeatureEdit(e){await k((()=>!this.updating));const t=this._createUpdatingResolver();try{const{initialFeature:t}=e,i=t.sourceLayer=t.layer,a=i?this.findEditorItemForLayer(i):void 0;if(!a?.supportsCreateFeaturesWorkflow)throw new r("editing:unsupported-workflow","Creating features is unsupported or disabled for this layer.");await this._cancelWorkflow();const s=this._createCreateFeaturesWorkflow({initialFeature:t,layer:a.layer,maxFeatures:1},"creating-features");this._set("activeWorkflow",s),await s.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startUpdateFeaturesWorkflow(e){if(await k((()=>!this.updating)),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update features workflow is unsupported or disabled.");const t=this._createUpdatingResolver();try{await this._cancelWorkflow();const t=this._createUpdateFeaturesWorkflow(e);this._set("activeWorkflow",t),await t.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startUpdateWorkflowAtFeatureSelection(){if(await k((()=>!this.updating)),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const e=this._createUpdatingResolver();try{await this._cancelWorkflow();const e=this._createUpdateWorkflow();this._set("activeWorkflow",e),await e.start()}catch(t){this._logErrorAndCancelWorkflow(t)}finally{e.resolve()}}async startUpdateWorkflowAtMultipleFeatureSelection(e){if(await k((()=>!this.updating)),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const t=this._createUpdatingResolver();try{await this._cancelWorkflow();const t=this._createUpdateWorkflow("awaiting-update-feature-candidate");t.data.candidates=e,this._set("activeWorkflow",t),await t.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startUpdateWorkflowAtFeatureEdit(e){if(await k((()=>!this.updating)),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const t=this._createUpdatingResolver();try{await this._cancelWorkflow();const t=this._createUpdateWorkflow("editing-existing-feature");t.data.rootFeature=e,t.addHandles(w((()=>t),"commit",(()=>{t.destroy(),this.activeWorkflow===t&&this._set("activeWorkflow",null)}))),this._set("activeWorkflow",t),await t.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startUpdateWorkflowWithActiveSelection(){const{selectionListViewModel:e}=this;if(!e.visibleFeatureCount)throw new r("editing:missing-selection","Unable to determine visible selection.");if(e.visibleLayerCount>1)throw new r("editing:features-different-layers","Cannot start workflow with features from different layers.");const t=e.activeLayerItem??e.layerItems.find((e=>e.total>0));if(!t)throw new r("editing:no-layer-item","Unable to determine source layer of active selection.");const i=t.selection.map((e=>e.graphic));1===i.length?this.startUpdateWorkflowAtFeatureEdit(i[0]):this.startUpdateFeaturesWorkflow(i)}async deleteFeatureFromWorkflow(){const{activeWorkflow:e}=this;e&&"update"===e.type?await e.deleteActiveFeature():this._logError("editing:unsupported-workflow","Deleting a feature requires an active update workflow.")}async deleteAssociationFromWorkflow(){const{activeWorkflow:e}=this;e&&"update"===e.type?await e.deleteActiveAssociation():this._logError("editing:unsupported-workflow","Deleting an association requires an active update workflow.")}async cancelWorkflow(e){return this._cancelWorkflow({warnIfNoWorkflow:!0,...e})}findEditorItemForLayer(e){return this.editorItems.find((t=>t.layer===e))}itemHasInvalidFormTemplate(e){return null!=e&&!0===this.findEditorItemForLayer(e.layer)?.hasInvalidFormTemplate}syncFeatureTemplates(){this._featureTemplatesViewModelIsRestricted||this._updateTemplates()}zoomTo(e){const i=this.sketchViewModel,a=e?e.geometry:i?.updateGraphics.length?i?.updateGraphics.toArray().map((e=>e.geometry)).filter(t):i?.createGraphic?.geometry;a&&this.view&&z(this.view,a)}async toggleUpdateWorkflow(){this.canUpdate&&(this.hasPendingEdits&&!await this.showDiscardEditsPrompt()||(this.activeWorkflow&&"awaiting-feature-to-update"===this.state?await this.cancelWorkflow({force:!0}):await this.startUpdateWorkflowAtFeatureSelection()))}async onSelectionListItemSelect(e){Z(e)&&this.startUpdateWorkflowAtFeatureEdit(e.graphic)}async onSelectionListMenuItemSelect(e){if(Z(e))this.startUpdateWorkflowAtFeatureEdit(e.graphic);else if($(e)){const t=e.selection.map((e=>e.graphic));1===t.length?this.startUpdateWorkflowAtFeatureEdit(t[0]):this.startUpdateFeaturesWorkflow(t)}}restrictFeatureTemplatesViewModelToLayer(e){return this._featureTemplatesViewModelIsRestricted=!0,this._setFeatureTemplatesViewModelLayers([e]),o((()=>{this._featureTemplatesViewModelIsRestricted=!1,this._setFeatureTemplatesViewModelLayers(this.featureTemplatesLayers)}))}async _getEditorItemCandidates(e){const{view:t}=this;if(!t?.map)return[];const{map:i}=t,a=i.editableLayers.toArray(),r=i.allTables.toArray().filter((e=>b(e)||V(e)));return await Promise.allSettled([...a.flatMap((e=>this._getLayerLoadPromise(e))),...r.flatMap((e=>this._getLayerLoadPromise(e)))]),d(e),[...a.reverse(),...r.reverse()].filter((e=>E(e)&&("mesh"!==e.geometryType||"3d"===t.type))).flatMap((e=>"subtype-group"===e.type?e.sublayers.toArray():e))}_getLayerLoadPromise(e){return V(e)?e.loadAll():e.load()}_drainEditorItems(){this.editorItems.drain((e=>e.destroy()))}_updateEditorItems(){p(this._updateItemsTask);const{view:e}=this,t=i((async t=>{if(!e?.map||!e?.allLayerViews)return;const i=await this._getEditorItemCandidates(t);if(!i.length)return void this._drainEditorItems();const a=[],r=[],s=[],{layerInfos:o}=this;for(const l of i){const t=X(o,l),i=await x(e,l).catch((()=>null));(t?a:i?r:s).push(new D({layer:l,layerInfo:t,layerView:i}))}o?.length&&a.sort(((e,t)=>o.findIndex((({layer:t})=>t===e.layer))-o.findIndex((({layer:e})=>e===t.layer))));const n=[...a,...r,...s];t.aborted||(this._drainEditorItems(),this.editorItems.addMany(n))}));this._updatingHandles.addPromise(t.promise),this._updateItemsTask=t}_updateTemplates(){p(this._updateTemplatesTask);const e=i((async e=>{const t=this._templatesByLayer,i=this._featureTemplatesLayersAndTables.filter((e=>!t.has(e)));if(i.length>0){const a=await M(i.toArray(),this.view,e);for(const{layer:e,templates:i}of a)t.set(e,i)}this._setFeatureTemplatesViewModelLayers(this.featureTemplatesLayers)}));this._updatingHandles.addPromise(e.promise),this._updateTemplatesTask=e}_setFeatureTemplatesViewModelLayers(e){const t=this._templatesByLayer,i=[];for(const a of e){const e=t.get(a);e&&e.length>0&&i.push(B(a,e))}this.featureTemplatesViewModel.templateInfos=i}_afterEditorItemsChange(){const{activeWorkflow:e}=this;if(this.syncFeatureTemplates(),this._syncSelectionSources(),!e)return;const{stepId:t}=e;"create-features"!==e.type?"update"===e.type&&("awaiting-feature-to-update"===t&&!this.canUpdateVisible||"awaiting-update-feature-candidate"===t&&!e.hasUpdatableCandidates)&&this._cancelWorkflow():"awaiting-feature-creation-info"!==t||this.canCreate||this._cancelWorkflow()}async _cancelWorkflow(e){const t=this.activeWorkflow;if(!t)return void(e?.warnIfNoWorkflow&&this._logError("editing:no-active-workflow","There is no active workflow to cancel."));if(!e||!1!==e.force){this.emit("workflow-cancel"),this._set("activeWorkflow",null);try{await t.cancel(e)}finally{t.destroy()}}else try{await t.cancel(e),this._set("activeWorkflow",null),t.destroy()}catch(i){}}_createCreateFeaturesWorkflow(e,t){return j.create({viewModel:this,creationInfo:e,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,startAt:t,applyEditsCallback:(e,t,i)=>this._applyEdits(e,t,i),applyEditsFeatureServiceCallback:(e,t,i)=>this._applyEditsFeatureService(e,t,i),addAttachmentsCallback:(e,t)=>this._addAttachments(e,t)})}_createUpdateFeaturesWorkflow(e){const t=P.create({viewModel:this,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,features:e,applyEdits:(e,t,i)=>this._applyEdits(e,t,i),applyEditsFeatureService:(e,t,i)=>this._applyEditsFeatureService(e,t,i)});return t.addHandles(w((()=>t),"commit",(()=>{t.destroy(),this.activeWorkflow===t&&this._set("activeWorkflow",null)}))),t}_createUpdateWorkflow(e){return R.create({viewModel:this,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,startAt:e,applyEditsCallback:(e,t,i)=>this._applyEdits(e,t,i),applyEditsFeatureServiceCallback:(e,t,i)=>this._applyEditsFeatureService(e,t,i),addAttachmentsCallback:(e,t)=>this._addAttachments(e,t)})}_addAttachments(e,t){const i=t.map((t=>this._addAttachment(e,t.feature,t.attachment)))??[];return Promise.all(i)}async _addAttachment(e,t,i){let a=null;if(!("addAttachment"in e)||null==e.capabilities?.attachment)throw new r("editor:attachments-not-supported","Adding attachments is not supported for this layer type");return await this._queueOperation((async()=>(a=await(e.addAttachment?.(t,i).catch((e=>{throw e?.error||e})))??null,a))),a}async _applyEdits(e,t,i){let a=null;const r=e.url?await T(e.url):null,s={returnServiceEditsOption:(!r||!I(r))&&!RegExp("/hosted/","i").test(e.url)?"original-and-current-features":void 0,...i};return await this._queueOperation((async()=>{const{view:i}=this;if(!i)return null;const r=await x(i,e).catch((()=>null));return a=await e.applyEdits(t,s),r&&await k((()=>!r.updating)),a})),a}async _applyEditsFeatureService(e,t,i){let a=null;return await this._queueOperation((async()=>a=await e.applyEdits(t,i))),a}_queueOperation(e){this._activityQueue.push(e);const t=(e,t)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1)};return e().then((e=>(Array.isArray(e)?e.forEach((e=>this._handleEditsResultError(e))):this._handleEditsResultError(e),e))).catch((i=>{this._logError("editing:operation-error","An error occurred.",{error:i});const a={error:i,retry:()=>(t(a,this.failures),this._queueOperation(e)),cancel:()=>{t(a,this.failures)}};this._set("failures",[...this.failures,a])})).then((()=>{t(e,this._activityQueue)}))}_handleEditsResultError(e){if(null!=e&&"error"in e&&null!=e.error)throw e.error;if(null!=e&&"addFeatureResults"in e){const{addFeatureResults:t,deleteFeatureResults:i,updateFeatureResults:a}=e,r=t.find((e=>!!e.error))||a.find((e=>!!e.error))||i.find((e=>!!e.error));if(r)throw r.error}}_createUpdatingResolver(){const e=u();return this._updatingHandles.addPromise(e.promise),e}_logErrorAndCancelWorkflow(e){const{name:t,message:i,details:a}=e;this._logError(t??"editing:workflow-start-failed",i??void 0,a??e),this._cancelWorkflow({force:!0})}_itemIsSuspended(e){const t=this.findEditorItemForLayer(e);return null!=t&&(!t.visible||t.disabled)}_logError(e,t,i){n.getLogger(this).error(new r(e,t,i))}_syncSelectionSources(){const{selectionManager:e}=this,t=[];this.editorItems.forEach((e=>{C(e.layer)&&e.supportsUpdateWorkflow&&t.push(e.layer)})),e.sources.removeAll(),e.sources.addMany(t)}async _onSelectionComplete(e){if(e.aborted)return;const{operationType:t,selection:i}=e,{effectiveSelectionManager:a}=this,r="ready"===this.state,s=1===i.length;if(r&&s&&(0===a.count&&"add"===t||"replace"===t))return this.startUpdateWorkflowAtFeatureEdit(i[0]);switch(t){case"remove":a.updateSelection({current:[],added:[],removed:i});break;case"replace":a.clear(),a.updateSelection({current:i,added:[],removed:[]});break;case"add":a.updateSelection({current:i,added:[],removed:[]})}}};e([v()],Y.prototype,"_featureTemplatesLayersAndTables",null),e([v()],Y.prototype,"_snappingManager",void 0),e([v({readOnly:!0})],Y.prototype,"activeWorkflow",void 0),e([v()],Y.prototype,"activeLeafWorkflow",null),e([v({readOnly:!0})],Y.prototype,"_activityQueue",void 0),e([v({readOnly:!0})],Y.prototype,"canCreate",null),e([v()],Y.prototype,"canCreateVisible",null),e([v({readOnly:!0})],Y.prototype,"canUpdate",null),e([v()],Y.prototype,"canUpdateVisible",null),e([v()],Y.prototype,"featureTemplatesLayers",null),e([v()],Y.prototype,"editorItems",void 0),e([v()],Y.prototype,"effectiveSelectionManager",null),e([v({readOnly:!0})],Y.prototype,"failures",void 0),e([v()],Y.prototype,"hideTemplatesForInactiveLayers",void 0),e([v({type:O})],Y.prototype,"attachmentsViewModel",void 0),e([v()],Y.prototype,"featureFormViewModel",null),e([v()],Y.prototype,"formViewModel",null),e([v()],Y.prototype,"utilityNetworkAssociationAddAssociationViewModel",null),e([v({type:q})],Y.prototype,"featureTemplatesViewModel",void 0),e([v()],Y.prototype,"labelOptions",null),e([v()],Y.prototype,"layerInfos",void 0),e([v()],Y.prototype,"ownSketchViewModel",void 0),e([v()],Y.prototype,"selectionListViewModel",void 0),e([v()],Y.prototype,"selectionManager",void 0),e([v()],Y.prototype,"selectionToolbarViewModel",void 0),e([v()],Y.prototype,"sketchOptions",void 0),e([v()],Y.prototype,"sketchViewModel",null),e([v({type:S,nonNullable:!0})],Y.prototype,"snappingOptions",void 0),e([v()],Y.prototype,"spinnerViewModel",void 0),e([v()],Y.prototype,"state",null),e([v({readOnly:!0})],Y.prototype,"syncing",null),e([v()],Y.prototype,"updating",null),e([v()],Y.prototype,"tooltipOptions",null),e([v()],Y.prototype,"valueOptions",null),e([v()],Y.prototype,"view",null),e([v()],Y.prototype,"canZoomTo",null),e([v()],Y.prototype,"pageStack",void 0),e([v()],Y.prototype,"showDiscardEditsPrompt",void 0),e([v()],Y.prototype,"_candidateCommitted",void 0),e([v()],Y.prototype,"page",null),e([v()],Y.prototype,"featureFormDisabled",null),e([v()],Y.prototype,"featureFormHasAssociation",null),e([v()],Y.prototype,"canGoBack",null),e([v()],Y.prototype,"shouldShowDeleteButton",null),e([v()],Y.prototype,"hasPendingEdits",null),e([v()],Y.prototype,"snappingManager",null),Y=e([_("esri.widgets.Editor.EditorViewModel")],Y);const ee=Y;export{ee as default};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import{isSome as t}from"../../core/arrayUtils.js";import{createTask as i}from"../../core/asyncUtils.js";import a from"../../core/Collection.js";import{deprecatedFunction as r}from"../../core/deprecate.js";import s from"../../core/Error.js";import o from"../../core/Evented.js";import{makeHandle as n}from"../../core/handleUtils.js";import l from"../../core/Logger.js";import{destroyMaybe as c,abortMaybe as p,removeMaybe as d}from"../../core/maybe.js";import{throwIfAborted as u,createResolver as h}from"../../core/promiseUtils.js";import{watch as w,on as f,when as m,syncAndInitial as y,initial as g,sync as k,whenOnce as v}from"../../core/reactiveUtils.js";import{property as _}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as W}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as M}from"../../core/support/UpdatingHandles.js";import{getTemplatesForLayers as F}from"../../editing/templateUtils.js";import E from"../../layers/GraphicsLayer.js";import{isEditableLayer as b}from"../../layers/support/editableLayers.js";import{isFeatureLayer as V,isSubtypeGroupLayer as T,getOwningPortalUrl as I}from"../../layers/support/layerUtils.js";import{parseKnownArcGISOnlineDomain as L}from"../../portal/support/urlUtils.js";import S from"../../views/SelectionManager.js";import A from"../../views/interactive/sketch/SketchOptions.js";import{SnappingManager as U}from"../../views/interactive/snapping/SnappingManager.js";import C from"../../views/interactive/snapping/SnappingOptions.js";import{isSelectableLayer as O}from"../../views/support/selectionUtils.js";import j from"../Attachments/AttachmentsViewModel.js";import P from"./CreateFeaturesWorkflow.js";import R from"./UpdateFeaturesWorkflow.js";import H from"./UpdateWorkflow.js";import{getLayersFromWorkflow as G,isCreateFeaturesWorkflow as D,isUpdateRecordWorkflow as x,isUpdateFeaturesWorkflow as B,isUpdateWorkflow as q,whenEditorLayerView as N}from"./workflowUtils.js";import Q from"./support/EditorItem.js";import{makeTemplateGroupInfoForLayer as z}from"../FeatureTemplates/featureTemplatesUtils.js";import Z from"../FeatureTemplates/FeatureTemplatesViewModel.js";import $ from"../Sketch/SketchViewModel.js";import J from"../Spinner/SpinnerViewModel.js";import{goTo as K}from"../support/goToUtils.js";import{isFeatureItem as X,isLayerItem as Y}from"../support/SelectionList/selectionListUtils.js";import ee from"../support/SelectionList/SelectionListViewModel.js";import te from"../support/SelectionToolbar/SelectionToolbarViewModel.js";function ie(e,t){return e?.find((e=>e.layer===t))}let ae=class extends o.EventedAccessor{constructor(e){super(e),this._templatesByLayer=new Map,this._sketchEventListenerHandle=null,this._sketchGraphicsLayer=new E({listMode:"hide",internal:!0}),this._snappingManager=null,this._updateItemsTask=null,this._updateTemplatesTask=null,this._updatingHandles=new M,this._featureTemplatesViewModelIsRestricted=!1,this.activeWorkflow=null,this._activityQueue=new a,this.editorItems=new a,this.failures=[],this.hideTemplatesForInactiveLayers=!1,this.attachmentsViewModel=new j({capabilities:{editing:!0}}),this.featureTemplatesViewModel=new Z({disabledItemFunction:({layer:e})=>this._itemIsSuspended(e)}),this.layerInfos=null,this.ownSketchViewModel=new $({layer:this._sketchGraphicsLayer}),this.selectionListViewModel=new ee,this.selectionManager=new S,this.selectionToolbarViewModel=new te({persistSelection:!1,returnGeometry:!1}),this.sketchOptions=new A,this.snappingOptions=new C({attributeRulesEnabled:!0}),this.spinnerViewModel=new J,this.pageStack=[],this.showDiscardEditsPrompt=()=>Promise.resolve(!0),this._candidateCommitted=!1,this.back=async()=>{this.selectionToolbarViewModel.cancel(),"viewing-selection-list"!==this.state?this.canGoBack&&(this.activeWorkflow?.hasPreviousStep?await this.activeWorkflow.back(this.showDiscardEditsPrompt):await this._cancelWorkflow({force:!this.hasPendingEdits})):this.effectiveSelectionManager.clear()},this.saveWorkflow=async()=>await(this.activeWorkflow?.save()),this.selectFeature=(e,t=!1)=>{const i=this.activeWorkflow;this._candidateCommitted||"update"!==i?.type||(i.data.rootFeature=e,t&&(i.next(),this._candidateCommitted=!0))}}initialize(){this.addHandles([w((()=>{const e=this.view,t=e?.map?.editableLayers.toArray(),i=e?.allLayerViews,a=i?.filter((e=>!!t?.includes(e.layer)));return[t,a,this.layerInfos]}),(()=>this._updateEditorItems()),y),w((()=>this.hideTemplatesForInactiveLayers),(()=>this.syncFeatureTemplates())),w((()=>this._selectionSources),(()=>this._syncSelectionSources()),g),f((()=>this.activeWorkflow),"cancel",(()=>this.emit("workflow-cancel"))),f((()=>this.activeWorkflow),"commit",(()=>this.emit("workflow-commit"))),f((()=>this.activeWorkflow),"complete",(()=>{this.emit("workflow-commit"),this._set("activeWorkflow",null)})),w((()=>this.activeWorkflow),(e=>this.selectionManager.showHighlight=!e)),m((()=>this.view?.map),(e=>e.add(this._sketchGraphicsLayer)),g),f((()=>this.editorItems),"change",(()=>this._afterEditorItemsChange())),w((()=>[this.canCreate,this.canUpdateVisible]),(()=>this._afterEditorItemsChange())),w((()=>this.page),((e,t)=>{const i=[...this.pageStack];if(-1===i.indexOf(e))i.push(e);else for(;i.length&&i.at(-1)!==e;)i.pop();this.pageStack=i}),y),m((()=>"awaiting-update-feature-candidate"===this.state),(()=>this._candidateCommitted=!1)),f((()=>this.featureTemplatesViewModel),"select",(async({item:e,oldItem:t})=>{const{activeWorkflow:i}=this;if(i){if("update"===i.type&&"awaiting-feature-creation-info"===i.activeWorkflow?.stepId)return;try{await this.cancelWorkflow({force:!this.hasPendingEdits})}catch{return void this.featureTemplatesViewModel.select(t,{emit:!1})}}if(!e)return;const a={layer:e.layer,template:e.template};if(e.supportsUpload)return this.featureTemplatesViewModel.select(t,{emit:!1}),this.startCreateFeaturesWorkflow(a);this.startCreateFeaturesWorkflowAtFeatureCreation(a)})),w((()=>[this.view,this.featureTemplatesViewModel]),(([e,t])=>{t.view=e}),y),f((()=>this.view),"key-down",(e=>{"Escape"===e.key&&this.activeWorkflow?.keyboardCancellationEnabled&&(e.stopPropagation(),this.back())})),f((()=>this.sketchViewModel),["create","delete","update"],(e=>{const{activeWorkflow:t}=this,i="update"===t?.type,a=G(t),r=i?t?.activeWorkflow?.parentLayer:void 0,s=`sketch-${e.type}`;this.emit(s,{type:s,detail:e,layer:a[0],layers:a,parentLayer:r})}),k),w((()=>this.view),(e=>{if(this._snappingManager=c(this._snappingManager),!e)return;const t=this.snappingOptions;this._snappingManager=new U({view:e,options:t}),this.ownSketchViewModel.snappingManager=this._snappingManager}),y),w((()=>this.snappingOptions),(e=>{this._snappingManager&&(this._snappingManager.options=e)}),y),f((()=>this.selectionToolbarViewModel),"complete",(e=>this._onSelectionComplete(e))),w((()=>({view:this.view,selectionManager:this.effectiveSelectionManager,selectionListViewModel:this.selectionListViewModel,selectionToolbarViewModel:this.selectionToolbarViewModel})),(({view:e,selectionManager:t,selectionListViewModel:i,selectionToolbarViewModel:a})=>{t.view=e,i.view=e,a.view=e}),y),w((()=>this.effectiveSelectionManager),(e=>{this.selectionListViewModel.selectionManager=e,this.selectionToolbarViewModel.selectionManager=e}),y)])}destroy(){this._cancelWorkflow({warnIfNoWorkflow:!1}).then((()=>{this.view?.map?.remove(this._sketchGraphicsLayer),this.view=null})),this._updateItemsTask=p(this._updateItemsTask),this._updatingHandles.destroy(),this._sketchEventListenerHandle=d(this._sketchEventListenerHandle),this.selectionManager.destroy()}get _featureTemplatesLayersAndTables(){const e=new a;for(const t of this.editorItems){const i=this.hideTemplatesForInactiveLayers&&!t.visible;t.supportsCreateFeaturesWorkflow&&!i&&e.push(t.layer)}return e}get _selectionSources(){const e=new a;for(const t of this.editorItems)O(t.layer)&&t.supportsUpdateWorkflow&&t.visible&&e.push(t.layer);return e}get activeFeatureCount(){const e=this.activeLeafWorkflow;return D(e)?e.pendingFeatures.length:x(e)&&e.data.edits.feature?1:B(e)?e.data.features.length:0}get activeLeafWorkflow(){const e=this.activeWorkflow;return e&&q(e)?e.activeWorkflow??e:e}get canCreate(){return this.editorItems.some((e=>e.supportsCreateFeaturesWorkflow))}get canCreateVisible(){return!!this.featureTemplatesLayers.length}get canUpdate(){return this.editorItems.some((e=>e.supportsUpdateWorkflow))}get canUpdateVisible(){return this.editorItems.some((e=>e.supportsUpdateWorkflow&&e.visible))}get featureTemplatesLayers(){return this._featureTemplatesLayersAndTables.filter((e=>"scene"===e.type||!e.isTable))}get effectiveSelectionManager(){return this.selectionManager}get featureFormViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeFeatureFormViewModel:"create-features"===e?.type?e.featureFormViewModel:null}get formViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeFeatureFormViewModel:"create-features"===e?.type?e.featureFormViewModel:"update-features"===e?.type?e.formViewModel:null}get utilityNetworkAssociationAddAssociationViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeUtilityNetworkAssociationAddAssociationViewModel:null}get labelOptions(){return this.sketchOptions.labels}set labelOptions(e){this.sketchOptions.labels=e}get sketchViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeSketchViewModel:"create-features"===e?.type?e.sketchViewModel:this.ownSketchViewModel}get state(){if(!this.view?.ready)return"disabled";const e=this.attachmentsViewModel.mode;if("add"===e)return"adding-attachment";if("edit"===e)return"editing-attachment";const{activeWorkflow:t}=this,i=!t?.stepId;return this.effectiveSelectionManager.count&&i?"viewing-selection-list":i?"ready":"update"===t.type&&t.activeWorkflow?.stepId?t.activeWorkflow.stepId:t.stepId}get syncing(){return this._activityQueue.length>0}get updating(){return this._updatingHandles.updating||!0===this.activeWorkflow?.updating}get tooltipOptions(){return this.sketchOptions.tooltips}set tooltipOptions(e){this.sketchOptions.tooltips=e}get valueOptions(){return this.sketchOptions.values}set valueOptions(e){this.sketchOptions.values=e}set view(e){this.ownSketchViewModel.view=e,this.spinnerViewModel.view=e,this._set("view",e)}get canZoomTo(){const e=this.sketchViewModel,t=e?.createGraphic?.geometry?.type;return!(!e?.updateGraphics?.length&&"multipoint"!==t)}get page(){const{activeWorkflow:e,state:t}=this;if("update"===e?.type&&null!=e?.activeWorkflow?.featureFormViewModel?.associatedLayer)return"viewing-associated-features";if("update"===e?.type&&null!=e?.activeWorkflow?.featureFormViewModel?.associationId)return"viewing-associated-layers";if("update"===e?.type&&"awaiting-feature-to-update"===e.stepId)return"ready";if("create-features"===e?.type&&0===e.numPendingFeatures){const t=e.data.upload;if(t)return"default"===t.state?"ready":"creating-features-upload-details"}return t??"disabled"}get featureFormDisabled(){const{activeWorkflow:e}=this;return"update"===e?.type&&(!1===e.activeEditorItem?.capabilities.update.attributes||!0===e.activeFeatureFormViewModel?.disabled)}get featureFormHasAssociation(){return!!this.featureFormViewModel?.activeAssociation}get canGoBack(){return null!=this.activeWorkflow&&!this.syncing}get shouldShowDeleteButton(){const{activeWorkflow:e}=this;return!this.featureFormDisabled&&(q(e)&&e.activeEditorItem?.capabilities.delete.enabled||B(e)&&e.data.editorItems.every((e=>e.capabilities.delete.enabled)))}get hasPendingEdits(){return this.activeWorkflow?.hasPendingEdits??!1}get snappingManager(){return this._snappingManager}getTemplatesForLayer(e){return this._templatesByLayer.get(e)??[]}async startCreateFeaturesWorkflowAtFeatureTypeSelection(){return this.startCreateFeaturesWorkflow()}async startCreateFeaturesWorkflowAtFeatureCreation(e){return this.startCreateFeaturesWorkflow(e,"creating-features")}async startCreateFeaturesWorkflow(e,t="awaiting-feature-creation-info"){if(await v((()=>!this.updating)),!this.canCreate)throw new s("editing:unsupported-workflow","Creating features is unsupported or disabled.");const i=this._createUpdatingResolver();try{await this._cancelWorkflow();const i=this._createCreateFeaturesWorkflow(e,t);this._set("activeWorkflow",i),await i.start()}catch(a){this._logErrorAndCancelWorkflow(a)}finally{i.resolve()}}async startCreateFeaturesWorkflowAtFeatureEdit(e){await v((()=>!this.updating));const t=this._createUpdatingResolver();try{const{initialFeature:t}=e,i=t.sourceLayer=t.layer,a=i?this.findEditorItemForLayer(i):void 0;if(!a?.supportsCreateFeaturesWorkflow)throw new s("editing:unsupported-workflow","Creating features is unsupported or disabled for this layer.");await this._cancelWorkflow();const r=this._createCreateFeaturesWorkflow({initialFeature:t,layer:a.layer,maxFeatures:1},"creating-features");this._set("activeWorkflow",r),await r.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startUpdateFeaturesWorkflow(e){if(await v((()=>!this.updating)),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update features workflow is unsupported or disabled.");const t=this._createUpdatingResolver();try{await this._cancelWorkflow();const t=this._createUpdateFeaturesWorkflow(e);this._set("activeWorkflow",t),await t.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startUpdateWorkflowAtFeatureSelection(){if(await v((()=>!this.updating)),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const e=this._createUpdatingResolver();try{await this._cancelWorkflow();const e=this._createUpdateWorkflow();this._set("activeWorkflow",e),await e.start()}catch(t){this._logErrorAndCancelWorkflow(t)}finally{e.resolve()}}async startUpdateWorkflowAtMultipleFeatureSelection(e){if(await v((()=>!this.updating)),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const t=this._createUpdatingResolver();try{await this._cancelWorkflow();const t=this._createUpdateWorkflow("awaiting-update-feature-candidate");t.data.candidates=e,this._set("activeWorkflow",t),await t.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startUpdateWorkflowAtFeatureEdit(e){if(await v((()=>!this.updating)),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const t=this._createUpdatingResolver();try{await this._cancelWorkflow();const t=this._createUpdateWorkflow("editing-existing-feature");t.data.rootFeature=e,t.addHandles(f((()=>t),"commit",(()=>{t.destroy(),this.activeWorkflow===t&&this._set("activeWorkflow",null)}))),this._set("activeWorkflow",t),await t.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startUpdateWorkflowWithActiveSelection(){const{selectionListViewModel:e}=this;if(!e.visibleFeatureCount)throw new s("editing:missing-selection","Unable to determine visible selection.");if(e.visibleLayerCount>1)throw new s("editing:features-different-layers","Cannot start workflow with features from different layers.");const t=e.activeLayerItem??e.layerItems.find((e=>e.total>0));if(!t)throw new s("editing:no-layer-item","Unable to determine source layer of active selection.");const i=t.selection.map((e=>e.graphic));1===i.length?this.startUpdateWorkflowAtFeatureEdit(i[0]):this.startUpdateFeaturesWorkflow(i)}async deleteFeatureFromWorkflow(){r(l.getLogger(this),"EditorViewModel.deleteFeatureFromWorkflow is deprecated. Use EditorViewModel.deleteFeatures instead.",{version:"4.33",replacement:"EditorViewModel.deleteFeatures",warnOnce:!0}),await this.deleteFeatures()}async deleteFeatures(){const e=this.activeWorkflow;return q(e)?e.deleteActiveFeature():B(e)?e.deleteAndCommit():void this._logError("editing:unsupported-workflow","Deleting features requires an active update workflow.")}async deleteAssociationFromWorkflow(){const{activeWorkflow:e}=this;e&&"update"===e.type?await e.deleteActiveAssociation():this._logError("editing:unsupported-workflow","Deleting an association requires an active update workflow.")}async cancelWorkflow(e){return this._cancelWorkflow({warnIfNoWorkflow:!0,...e})}findEditorItemForLayer(e){return this.editorItems.find((t=>t.layer===e))}itemHasInvalidFormTemplate(e){return null!=e&&!0===this.findEditorItemForLayer(e.layer)?.hasInvalidFormTemplate}syncFeatureTemplates(){this._featureTemplatesViewModelIsRestricted||this._updateTemplates()}zoomTo(e){const i=this.sketchViewModel,a=e?e.geometry:i?.updateGraphics.length?i?.updateGraphics.toArray().map((e=>e.geometry)).filter(t):i?.createGraphic?.geometry;a&&this.view&&K(this.view,a)}async toggleUpdateWorkflow(){this.canUpdate&&(this.hasPendingEdits&&!await this.showDiscardEditsPrompt()||(this.activeWorkflow&&"awaiting-feature-to-update"===this.state?await this.cancelWorkflow({force:!0}):await this.startUpdateWorkflowAtFeatureSelection()))}async onSelectionListItemSelect(e){X(e)&&this.startUpdateWorkflowAtFeatureEdit(e.graphic)}async onSelectionListMenuItemSelect(e){if(X(e))this.startUpdateWorkflowAtFeatureEdit(e.graphic);else if(Y(e)){const t=e.selection.map((e=>e.graphic));1===t.length?this.startUpdateWorkflowAtFeatureEdit(t[0]):this.startUpdateFeaturesWorkflow(t)}}restrictFeatureTemplatesViewModelToLayer(e){return this._featureTemplatesViewModelIsRestricted=!0,this._setFeatureTemplatesViewModelLayers([e]),n((()=>{this._featureTemplatesViewModelIsRestricted=!1,this._setFeatureTemplatesViewModelLayers(this.featureTemplatesLayers)}))}async _getEditorItemCandidates(e){const{view:t}=this;if(!t?.map)return[];const{map:i}=t,a=i.editableLayers.toArray(),r=i.allTables.toArray().filter((e=>V(e)||T(e)));return await Promise.allSettled([...a.flatMap((e=>this._getLayerLoadPromise(e))),...r.flatMap((e=>this._getLayerLoadPromise(e)))]),u(e),[...a.reverse(),...r.reverse()].filter((e=>b(e)&&("mesh"!==e.geometryType||"3d"===t.type))).flatMap((e=>"subtype-group"===e.type?e.sublayers.toArray():e))}_getLayerLoadPromise(e){return T(e)?e.loadAll():e.load()}_drainEditorItems(){this.editorItems.drain((e=>e.destroy()))}_updateEditorItems(){p(this._updateItemsTask);const{view:e}=this,t=i((async t=>{if(!e?.map||!e?.allLayerViews)return;const i=await this._getEditorItemCandidates(t);if(!i.length)return void this._drainEditorItems();const a=[],r=[],s=[],{layerInfos:o}=this;for(const l of i){const t=ie(o,l),i=await N(e,l).catch((()=>null));(t?a:i?r:s).push(new Q({layer:l,layerInfo:t,layerView:i}))}o?.length&&a.sort(((e,t)=>o.findIndex((({layer:t})=>t===e.layer))-o.findIndex((({layer:e})=>e===t.layer))));const n=[...a,...r,...s];t.aborted||(this._drainEditorItems(),this.editorItems.addMany(n))}));this._updatingHandles.addPromise(t.promise),this._updateItemsTask=t}_updateTemplates(){p(this._updateTemplatesTask);const e=i((async e=>{const t=this._templatesByLayer,i=this._featureTemplatesLayersAndTables.filter((e=>!t.has(e)));if(i.length>0){const a=await F(i.toArray(),this.view,e);for(const{layer:e,templates:i}of a)t.set(e,i)}this._setFeatureTemplatesViewModelLayers(this.featureTemplatesLayers)}));this._updatingHandles.addPromise(e.promise),this._updateTemplatesTask=e}_setFeatureTemplatesViewModelLayers(e){const t=this._templatesByLayer,i=[];for(const a of e){const e=t.get(a);e&&e.length>0&&i.push(z(a,e))}this.featureTemplatesViewModel.templateInfos=i}_afterEditorItemsChange(){const{activeWorkflow:e}=this;if(this.syncFeatureTemplates(),!e)return;const{stepId:t}=e;"create-features"!==e.type?"update"===e.type&&("awaiting-feature-to-update"===t&&!this.canUpdateVisible||"awaiting-update-feature-candidate"===t&&!e.hasUpdatableCandidates)&&this._cancelWorkflow():"awaiting-feature-creation-info"!==t||this.canCreate||this._cancelWorkflow()}async _cancelWorkflow(e){const t=this.activeWorkflow;if(!t)return void(e?.warnIfNoWorkflow&&this._logError("editing:no-active-workflow","There is no active workflow to cancel."));if(!e||!1!==e.force){this.emit("workflow-cancel"),this._set("activeWorkflow",null);try{await t.cancel(e)}finally{t.destroy()}}else try{await t.cancel(e),this._set("activeWorkflow",null),t.destroy()}catch(i){}}_createCreateFeaturesWorkflow(e,t){return P.create({viewModel:this,creationInfo:e,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,startAt:t,applyEditsCallback:(e,t,i)=>this._applyEdits(e,t,i),applyEditsFeatureServiceCallback:(e,t,i)=>this._applyEditsFeatureService(e,t,i),addAttachmentsCallback:(e,t)=>this._addAttachments(e,t)})}_createUpdateFeaturesWorkflow(e){const t=R.create({viewModel:this,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,features:e,applyEdits:(e,t,i)=>this._applyEdits(e,t,i),applyEditsFeatureService:(e,t,i)=>this._applyEditsFeatureService(e,t,i)});return t.addHandles(f((()=>t),"commit",(()=>{t.destroy(),this.activeWorkflow===t&&this._set("activeWorkflow",null)}))),t}_createUpdateWorkflow(e){return H.create({viewModel:this,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,startAt:e,applyEditsCallback:(e,t,i)=>this._applyEdits(e,t,i),applyEditsFeatureServiceCallback:(e,t,i)=>this._applyEditsFeatureService(e,t,i),addAttachmentsCallback:(e,t)=>this._addAttachments(e,t)})}_addAttachments(e,t){const i=t.map((t=>this._addAttachment(e,t.feature,t.attachment)))??[];return Promise.all(i)}async _addAttachment(e,t,i){let a=null;if(!("addAttachment"in e)||null==e.capabilities?.attachment)throw new s("editor:attachments-not-supported","Adding attachments is not supported for this layer type");return await this._queueOperation((async()=>(a=await(e.addAttachment?.(t,i).catch((e=>{throw e?.error||e})))??null,a))),a}async _applyEdits(e,t,i){let a=null;const r=e.url?await I(e.url):null,s={returnServiceEditsOption:(!r||!L(r))&&!RegExp("/hosted/","i").test(e.url)?"original-and-current-features":void 0,...i};return await this._queueOperation((async()=>{const{view:i}=this;if(!i)return null;const r=await N(i,e).catch((()=>null));return a=await e.applyEdits(t,s),r&&await v((()=>!r.updating)),a})),a}async _applyEditsFeatureService(e,t,i){let a=null;return await this._queueOperation((async()=>a=await e.applyEdits(t,i))),a}_queueOperation(e){this._activityQueue.push(e);const t=(e,t)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1)};return e().then((e=>(Array.isArray(e)?e.forEach((e=>this._handleEditsResultError(e))):this._handleEditsResultError(e),e))).catch((i=>{this._logError("editing:operation-error","An error occurred.",{error:i});const a={error:i,retry:()=>(t(a,this.failures),this._queueOperation(e)),cancel:()=>{t(a,this.failures)}};this._set("failures",[...this.failures,a])})).then((()=>{t(e,this._activityQueue)}))}_handleEditsResultError(e){if(null!=e&&"error"in e&&null!=e.error)throw e.error;if(null!=e&&"addFeatureResults"in e){const{addFeatureResults:t,deleteFeatureResults:i,updateFeatureResults:a}=e,r=t.find((e=>!!e.error))||a.find((e=>!!e.error))||i.find((e=>!!e.error));if(r)throw r.error}}_createUpdatingResolver(){const e=h();return this._updatingHandles.addPromise(e.promise),e}_logErrorAndCancelWorkflow(e){const{name:t,message:i,details:a}=e;this._logError(t??"editing:workflow-start-failed",i??void 0,a??e),this._cancelWorkflow({force:!0})}_itemIsSuspended(e){const t=this.findEditorItemForLayer(e);return null!=t&&(!t.visible||t.disabled)}_logError(e,t,i){l.getLogger(this).error(new s(e,t,i))}_syncSelectionSources(){this.selectionManager.sources.items=this._selectionSources.toArray()}async _onSelectionComplete(e){if(e.aborted)return;const{operationType:t,selection:i}=e,{effectiveSelectionManager:a}=this,r="ready"===this.state,s=1===i.length;if(r&&s&&(0===a.count&&"add"===t||"replace"===t))return this.startUpdateWorkflowAtFeatureEdit(i[0]);switch(t){case"remove":a.updateSelection({current:[],added:[],removed:i});break;case"replace":a.clear(),a.updateSelection({current:i,added:[],removed:[]});break;case"add":a.updateSelection({current:i,added:[],removed:[]})}}};e([_()],ae.prototype,"_featureTemplatesLayersAndTables",null),e([_()],ae.prototype,"_snappingManager",void 0),e([_()],ae.prototype,"_selectionSources",null),e([_()],ae.prototype,"activeFeatureCount",null),e([_({readOnly:!0})],ae.prototype,"activeWorkflow",void 0),e([_()],ae.prototype,"activeLeafWorkflow",null),e([_({readOnly:!0})],ae.prototype,"_activityQueue",void 0),e([_({readOnly:!0})],ae.prototype,"canCreate",null),e([_()],ae.prototype,"canCreateVisible",null),e([_({readOnly:!0})],ae.prototype,"canUpdate",null),e([_()],ae.prototype,"canUpdateVisible",null),e([_()],ae.prototype,"featureTemplatesLayers",null),e([_()],ae.prototype,"editorItems",void 0),e([_()],ae.prototype,"effectiveSelectionManager",null),e([_({readOnly:!0})],ae.prototype,"failures",void 0),e([_()],ae.prototype,"hideTemplatesForInactiveLayers",void 0),e([_({type:j})],ae.prototype,"attachmentsViewModel",void 0),e([_()],ae.prototype,"featureFormViewModel",null),e([_()],ae.prototype,"formViewModel",null),e([_()],ae.prototype,"utilityNetworkAssociationAddAssociationViewModel",null),e([_({type:Z})],ae.prototype,"featureTemplatesViewModel",void 0),e([_()],ae.prototype,"labelOptions",null),e([_()],ae.prototype,"layerInfos",void 0),e([_()],ae.prototype,"ownSketchViewModel",void 0),e([_()],ae.prototype,"selectionListViewModel",void 0),e([_()],ae.prototype,"selectionManager",void 0),e([_()],ae.prototype,"selectionToolbarViewModel",void 0),e([_()],ae.prototype,"sketchOptions",void 0),e([_()],ae.prototype,"sketchViewModel",null),e([_({type:C,nonNullable:!0})],ae.prototype,"snappingOptions",void 0),e([_()],ae.prototype,"spinnerViewModel",void 0),e([_()],ae.prototype,"state",null),e([_({readOnly:!0})],ae.prototype,"syncing",null),e([_()],ae.prototype,"updating",null),e([_()],ae.prototype,"tooltipOptions",null),e([_()],ae.prototype,"valueOptions",null),e([_()],ae.prototype,"view",null),e([_()],ae.prototype,"canZoomTo",null),e([_()],ae.prototype,"pageStack",void 0),e([_()],ae.prototype,"showDiscardEditsPrompt",void 0),e([_()],ae.prototype,"_candidateCommitted",void 0),e([_()],ae.prototype,"page",null),e([_()],ae.prototype,"featureFormDisabled",null),e([_()],ae.prototype,"featureFormHasAssociation",null),e([_()],ae.prototype,"canGoBack",null),e([_()],ae.prototype,"shouldShowDeleteButton",null),e([_()],ae.prototype,"hasPendingEdits",null),e([_()],ae.prototype,"snappingManager",null),ae=e([W("esri.widgets.Editor.EditorViewModel")],ae);const re=ae;export{re as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Error.js";import{makeHandle as i}from"../../core/handleUtils.js";import"../../core/has.js";import{destroyMaybe as o}from"../../core/maybe.js";import{watch as s}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import l from"../../layers/GraphicsLayer.js";import{hasEffectiveFeatureExpressionInfo as d}from"../../support/elevationInfoUtils.js";import{highlightsSupported as n}from"../../views/support/layerViewUtils.js";import h from"./UpdateFeatureWorkflowData.js";import{UpdateRecordWorkflow as c,handleKeys as p}from"./UpdateRecordWorkflow.js";import{getVisualVariableAttributes as w,setUpGeometryUpdate as m,updateGraphicSymbolWhenRequired as u,swapForEditingSession as y,cloneGraphicExceptMesh as f,canCreateInteractiveEditSession as g,isTerminalUpdateEventType as k}from"./workflowUtils.js";import _ from"../Sketch/SketchViewModel.js";var V;const v={...p,highlights:Symbol(),sketchGraphics:Symbol(),sketchViewModel:Symbol(),waitingForTool:Symbol()};let M=V=class extends c{constructor(e){super(e),this.type="update-feature",this._layerViewEditSession=null,this._sketchGraphicClone=null,this._sketchViewModel=null,this._webStyleCache=new Map}destroy(){this._layerViewEditSession?.rollback()}async commit(){this.removeHandles(v.sketchGraphics);try{const e=this.data.edits.stagedForDelete;await super.commit();const t=this._layerViewEditSession;e?t?.rollback():t?.commit()}catch(e){throw await this._configureSketchViewModel(),new t("editor-workflow:failed-to-commit","An error occurred when sending the updates to the service",{error:e})}}async start(){return await super.start(),await this._initializeSketchViewModel()}_initializeFeatureFormViewModel(){super._initializeFeatureFormViewModel(),this.addHandles([this._featureFormViewModel.on("value-change",(e=>{this._layerViewEditSession?.setAttribute(e.fieldName,e.value)})),s((()=>this._featureFormViewModel.feature?.sourceLayer),(e=>this._sketchGraphicClone.sourceLayer=e))])}_configureHighlight(){const{edits:e,layerView:t}=this.data;n(t)&&this.addHandles(t.highlight(e.feature),v.highlights)}async _configureSketchViewModel(){const e=this._sketchViewModel;if(!e)return;const{data:t,_featureFormViewModel:i,_sketchGraphicClone:o}=this,{edits:s,viewModel:a}=t,r=s.feature,{view:l}=a,d=w(r),n=await m({feature:r,featureClone:o,visualVariableAttributes:d,sketchViewModel:e,view:l,onUpdate:({geometry:e,attributes:t},o)=>{if(s.updateAttributes(t),s.updateGeometry(e),i.feature&&(i.feature.geometry=e),null!=d.rotation){const{field:e}=d.rotation;i.setValue(e,t[e])}if(null!=d.size){const{field:e}=d.size;i.setValue(e,t[e])}("undo"===o.type||"redo"===o.type||"update"===o.type&&null!=o.toolEventInfo&&k(o.toolEventInfo.type))&&i.notifyFeatureGeometryChanged()},addUpdatingPromise:e=>{this._updatingHandles.addPromise(e)},addHandle:e=>{this.addHandles(e,v.waitingForTool)},webStyleCache:this._webStyleCache});this.addHandles(n,v.sketchGraphics),e.addHandles(n)}async _initializeSketchViewModel(){const{data:e,_sketchGraphicClone:t}=this,{readOnly:s}=e,a=e.edits.feature,{capabilities:r,layer:n}=e.editorItem,{view:h}=e.viewModel;if(this.removeHandles([v.highlights,v.sketchGraphics,v.sketchViewModel,v.waitingForTool]),!r.update.geometry||s||"3d"===h?.type&&d(n.elevationInfo))return{enter:async()=>{this.hasHandles(v.highlights)||this._configureHighlight()},exit:()=>this.removeHandles([v.highlights])};const c=new l({elevationInfo:n.elevationInfo,internal:!0,listMode:"hide"}),p=new _({allowDeleteKey:!1,layer:c,sketchOptions:e.sketchOptions,snappingManager:e.snappingManager,updateOnGraphicClick:!1,view:h});return this._sketchViewModel=p,h?.map.add(c),await(h?.whenLayerView(c)),this.addHandles(i((()=>{h?.destroyed||h?.map.remove(c),c.destroy(),this._sketchViewModel=o(p)})),v.sketchViewModel),await u(t,this._webStyleCache,"2d"===h?.type?h.scale:null),this.addHandles([await y(p,a,t)]),{enter:async()=>{this.hasHandles(v.sketchGraphics)||await this._configureSketchViewModel()},exit:()=>this.removeHandles([v.sketchGraphics]),viewModel:p}}_onFullFeatureLoaded(e){super._onFullFeatureLoaded(e);const t=this._sketchGraphicClone=f(e),{edits:i,layerView:o}=this.data;i.updateGeometry(e.geometry),i.trackChanges(),g(o)&&(this._layerViewEditSession=o.createInteractiveEditSession(t))}static async create(e){const t=new V({data:await h.create(e),onCommit:this._onCommitFactory(e.applyEdits)});return t._set("steps",this._createWorkflowSteps(t)),t}get test(){}};e([a()],M.prototype,"_layerViewEditSession",void 0),e([a()],M.prototype,"_sketchGraphicClone",void 0),e([a()],M.prototype,"_sketchViewModel",void 0),M=V=e([r("esri.widgets.Editor.UpdateFeatureWorkflow")],M);export{M as UpdateFeatureWorkflow,v as handleKeys};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Error.js";import{makeHandle as i}from"../../core/handleUtils.js";import"../../core/has.js";import{destroyMaybe as o}from"../../core/maybe.js";import{watch as s}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import l from"../../layers/GraphicsLayer.js";import{hasEffectiveFeatureExpressionInfo as d}from"../../support/elevationInfoUtils.js";import{highlightsSupported as n}from"../../views/support/layerViewUtils.js";import h from"./UpdateFeatureWorkflowData.js";import{UpdateRecordWorkflow as c,handleKeys as p}from"./UpdateRecordWorkflow.js";import{getVisualVariableAttributes as w,setUpGeometryUpdate as m,updateGraphicSymbolWhenRequired as u,swapForEditingSession as y,cloneGraphicExceptMesh as f,canCreateInteractiveEditSession as g,isTerminalUpdateEventType as k}from"./workflowUtils.js";import _ from"../Sketch/SketchViewModel.js";var V;const v={...p,highlights:Symbol(),sketchGraphics:Symbol(),sketchViewModel:Symbol(),waitingForTool:Symbol()};let M=V=class extends c{constructor(e){super(e),this.type="update-feature",this._layerViewEditSession=null,this._sketchGraphicClone=null,this._sketchViewModel=null,this._webStyleCache=new Map}destroy(){this._layerViewEditSession?.rollback()}async commit(){this.removeHandles(v.sketchGraphics);try{const e=this.data.edits.stagedForDelete;await super.commit();const t=this._layerViewEditSession;e?t?.rollback():t?.commit()}catch(e){throw await this._configureSketchViewModel(),new t("editor-workflow:failed-to-commit","An error occurred when sending the updates to the service",{error:e})}}async start(){return await super.start(),await this._initializeSketchViewModel()}_initializeFeatureFormViewModel(){super._initializeFeatureFormViewModel(),this.addHandles([this._featureFormViewModel.on("value-change",(e=>{this._layerViewEditSession?.setAttribute(e.fieldName,e.value)})),s((()=>this._featureFormViewModel.feature?.sourceLayer),(e=>this._sketchGraphicClone.sourceLayer=e))])}_configureHighlight(){const{edits:e,layerView:t}=this.data;n(t)&&this.addHandles(t.highlight(e.feature),v.highlights)}async _configureSketchViewModel(){const e=this._sketchViewModel;if(!e)return;const{data:t,_featureFormViewModel:i,_sketchGraphicClone:o}=this,{edits:s,viewModel:a}=t,r=s.feature,{view:l}=a,d=w(r),n=await m({feature:r,featureClone:o,visualVariableAttributes:d,sketchViewModel:e,view:l,onUpdate:({geometry:e,attributes:t},o)=>{if(s.updateAttributes(t),s.updateGeometry(e),i.feature&&(i.feature.geometry=e),null!=d.rotation){const{field:e}=d.rotation;i.setValue(e,t[e])}if(null!=d.size){const{field:e}=d.size;i.setValue(e,t[e])}("undo"===o.type||"redo"===o.type||"update"===o.type&&null!=o.toolEventInfo&&k(o.toolEventInfo.type))&&i.notifyFeatureGeometryChanged()},addUpdatingPromise:e=>{this._updatingHandles.addPromise(e)},addHandle:e=>{this.addHandles(e,v.waitingForTool)},webStyleCache:this._webStyleCache});this.addHandles(n,v.sketchGraphics),e.addHandles(n)}async _initializeSketchViewModel(){const{data:e,_sketchGraphicClone:t}=this,{readOnly:s}=e,a=e.edits.feature,{capabilities:r,layer:n}=e.editorItem,{view:h}=e.viewModel;if(this.removeHandles([v.highlights,v.sketchGraphics,v.sketchViewModel,v.waitingForTool]),!r.update.geometry||s||"3d"===h?.type&&d(n.elevationInfo))return{enter:async()=>{this.hasHandles(v.highlights)||this._configureHighlight()},exit:()=>this.removeHandles([v.highlights])};const c=new l({elevationInfo:n.elevationInfo,internal:!0,listMode:"hide"}),p=new _({allowDeleteKey:!1,layer:c,sketchOptions:e.sketchOptions,snappingManager:e.snappingManager,updateOnGraphicClick:!1,view:h});return this._sketchViewModel=p,h?.map.add(c),await(h?.whenLayerView(c)),this.addHandles(i((()=>{h?.destroyed||h?.map.remove(c),c.destroyed||c.destroy(),this._sketchViewModel=o(p)})),v.sketchViewModel),await u(t,this._webStyleCache,"2d"===h?.type?h.scale:null),this.addHandles([await y(p,a,t)]),{enter:async()=>{this.hasHandles(v.sketchGraphics)||await this._configureSketchViewModel()},exit:()=>this.removeHandles([v.sketchGraphics]),viewModel:p}}_onFullFeatureLoaded(e){super._onFullFeatureLoaded(e);const t=this._sketchGraphicClone=f(e),{edits:i,layerView:o}=this.data;i.updateGeometry(e.geometry),i.trackChanges(),g(o)&&(this._layerViewEditSession=o.createInteractiveEditSession(t))}static async create(e){const t=new V({data:await h.create(e),onCommit:this._onCommitFactory(e.applyEdits)});return t._set("steps",this._createWorkflowSteps(t)),t}get test(){}};e([a()],M.prototype,"_layerViewEditSession",void 0),e([a()],M.prototype,"_sketchGraphicClone",void 0),e([a()],M.prototype,"_sketchViewModel",void 0),M=V=e([r("esri.widgets.Editor.UpdateFeatureWorkflow")],M);export{M as UpdateFeatureWorkflow,v as handleKeys};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import{unique as e,isSome as r}from"../../core/arrayUtils.js";import o from"../../core/Collection.js";import i from"../../core/Error.js";import
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import{unique as e,isSome as r}from"../../core/arrayUtils.js";import o from"../../core/Collection.js";import i from"../../core/Error.js";import s from"../../core/Logger.js";import{destroyMaybe as a}from"../../core/maybe.js";import{whenOnce as n}from"../../core/reactiveUtils.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{isTable as u}from"../../layers/support/layerUtils.js";import{hasEffectiveFeatureExpressionInfo as p}from"../../support/elevationInfoUtils.js";import c from"../BatchAttributeForm/BatchAttributeFormViewModel.js";import f from"./UpdateFeaturesWorkflowData.js";import h from"./Workflow.js";import{whenEditorLayerView as m}from"./workflowUtils.js";import{SketchController as w}from"./support/SketchController.js";var y;const g=()=>s.getLogger("esri.widgets.Editor.UpdateFeaturesWorkflow");let F=y=class extends h{constructor(t){super(t),this.type="update-features",this._formViewModel=null,this._sketchController=null}async initialize(){this._initializeFormViewModel();try{await this._updatingHandles.addPromise((async()=>{const{fullFeatures:t}=await this.data.when();this._formViewModel.features=new o(t),await this._initializeVisuals(t)})())}catch(t){this.cancel({force:!0,error:new i("update-features-workflow:initialize","Failed to initialize the workflow data.",t)})}}destroy(){this._sketchController=a(this._sketchController),this._formViewModel.destroy()}get features(){return this.data.features}get formViewModel(){return this._formViewModel}get hasPendingEdits(){const{data:t}=this;return t.features.some((e=>!!t.getPendingEditsForFeature(e)?.modified))}get parent(){return this.data.parent}get parentLayer(){return this.parent?.data.editorItem.layer}get selectedFeature(){return this.data.selectedFeature}get updating(){return this._updatingHandles.updating||this._formViewModel.updating||!!this._sketchController?.updating}static create(t){const{applyEdits:o,applyEditsFeatureService:i,...s}=t,a=e(t.features.map((t=>t.sourceLayer??t.layer))).map((e=>t.viewModel.editorItems.find((t=>t.layer===e)))).filter(r),n=new y({data:new f({...s,editorItems:a}),onCommit:k(t.applyEdits)});return n._set("steps",v()),n}async deleteAndCommit(){return this.data.stageDelete(),this.commit()}enter(){throw new Error("Method not implemented.")}exit(t){throw new Error("Method not implemented.")}async reset(){}async save(){const{formViewModel:t}=this;t.submit(),t.valid&&await super.save()}async start(){await super.start(),await n((()=>!this.updating))}_initializeFormViewModel(){const{data:t}=this,e=t.viewModel.view,r=new c({editType:"UPDATE",map:e?.map,spatialReference:e?.spatialReference,timeZone:t.timeZone});this._formViewModel=r,this.addHandles(r.on("value-change",(e=>{for(const r of e.features)t.getPendingEditsForFeature(r)?.setAttribute(e.fieldName,e.value);this._sketchController?.notifyAttributesChanged(e)})))}async _initializeHighlights(t,e,r){const o=await m(r,e);this.addHandles(o.highlight(t))}async _initializeSketchController(t,e,r){const o=new w({sourceLayer:e,view:r,features:t});this._sketchController=o,await n((()=>!o.updating));const{data:i}=this;await o.startUpdatingFeatures(t,(t=>{const e=[];for(const{feature:r,geometry:o}of t)i.getPendingEditsForFeature(r)?.updateGeometry(o),e.push(r);this._formViewModel.notifyGeometriesChanged(e)}),(()=>{g().warnOnce("editor:batch-update-visual-variables","UpdateFeaturesWorkflow does not currently support modifying visual variables through the scale and rotate tools.")}))}async _initializeVisuals(t){const{data:e}=this,{view:r}=e.viewModel;if(!r)return;const o=M(e);if(u(o))return;const i=e.getEditorItemForLayer(o);return!i?.capabilities.update.geometry||"3d"===r?.type&&p(o.elevationInfo)?this._initializeHighlights(t,o,r):this._initializeSketchController(t,o,r)}};t([l()],F.prototype,"features",null),t([l()],F.prototype,"formViewModel",null),t([l()],F.prototype,"hasPendingEdits",null),t([l()],F.prototype,"parent",null),t([l()],F.prototype,"parentLayer",null),t([l()],F.prototype,"selectedFeature",null),t([l()],F.prototype,"type",void 0),t([l()],F.prototype,"updating",null),t([l()],F.prototype,"_formViewModel",void 0),t([l()],F.prototype,"_sketchController",void 0),F=y=t([d("esri.widgets.Editor.UpdateFeaturesWorkflow")],F);const _=F;function v(){return[{id:"editing-features",async setUp(){},async tearDown(){}}]}function k(t){return async e=>{const r=M(e),o=[],i=[];for(const t of e.fullFeatures){const r=e.getPendingEditsForFeature(t),s=r?.stagedForDelete;if(!r?.modified&&!s)continue;const a=t.clone();if(!r?.attributesModified||s){const e=t.sourceLayer;if(!e){g().warn("Feature has no sourceLayer. It will not be included in any applyEdits payload.");continue}const r=e.objectIdField;if(a.attributes={[r]:t.getAttribute(r)},"scene"===e.type&&null!=e.infoFor3D){const r=e.associatedLayer?.globalIdField;null!=r&&a.setAttribute(r,t.getAttribute(r))}}r?.geometryModified&&!s||(a.geometry=null),s?i.push(a):o.push(a)}if(o.length+i.length===0)return void g().warn("No edits to apply. Workflow will finish without sending an applyEdits request.");const s={updateFeatures:o.length>0?o:void 0,deleteFeatures:i.length>0?i:void 0};await t(r,s)}}function M(t){if(t.layers.length>1)throw new i("update-features-workflow:multiple-layers-not-supported","The UpdateFeaturesWorkflow does not support updating features from multiple layers.");return t.layers[0]}export{_ as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import{unique as e,isSome as r}from"../../core/arrayUtils.js";import s from"../../core/Error.js";import{abortHandle as
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import{unique as e,isSome as r}from"../../core/arrayUtils.js";import s from"../../core/Error.js";import{abortHandle as i}from"../../core/handleUtils.js";import o from"../../core/Promise.js";import{throwIfAborted as a,isAbortError as l}from"../../core/promiseUtils.js";import n from"../../core/ReactiveMap.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import d from"./Edits.js";import{groupFeaturesByLayer as f,fetchFullFeatures as c}from"./workflowUtils.js";let h=class extends o{constructor(t){super(t),this.editorItems=[],this.features=[],this.parent=null,this.selectedFeature=null,this.sketchOptions=null,this.snappingManager=null,this.viewModel=null,this._editorItemsByLayer=new n,this._fullFeatures=new Map,this._pendingEdits=new n}initialize(){const t=new AbortController;this.addResolvingPromise(this._initializeFullFeatures(t.signal).then((e=>{a(t.signal),this._initializeEdits(e)})).catch((t=>{if(l(t))throw new s("update-features-workflow:full-features-aborted","Fetching of full features was aborted.");throw t}))),this.addHandles(i(t)),this._initializeEditorItemsByLayer()}get fullFeatures(){return Array.from(this._fullFeatures.values())}get layers(){return e(this.features.map((t=>t.sourceLayer)).filter(r))}set timeZone(t){this._set("timeZone",t),this._pendingEdits.forEach((e=>{e.timeZone=t}))}getEditorItemForLayer(t){return this._editorItemsByLayer.get(t)}getFeatureTitle(t){return this._pendingEdits.get(t)?.displayTitle}getPendingEditsForFeature(t){return this._pendingEdits.get(this._fullFeatures.get(t)??t)}isSubmittable(t){const e=this._pendingEdits.get(t);return!!e&&(e.submittable||e.isAssociation)}stageDelete(){for(const t of this._pendingEdits.values())t.stageDelete()}_initializeEditorItemsByLayer(){for(const t of this.editorItems)this._editorItemsByLayer.set(t.layer,t)}_initializeEdits(t){const{timeZone:e}=this;for(const r of t){const t=new d({feature:r,timeZone:e});t.trackChanges(),this._pendingEdits.set(r,t)}}async _initializeFullFeatures(t){const{spatialReference:e}=this.viewModel.view,r=this._fullFeatures,i=f(this.features),o=Array.from(i.entries()).map((async([i,o])=>{const a=await c(o,i,e,t);if(a.length!==o.length)throw new s("editor:update-features-workflow:fetch-full-features-incomplete","Failed to fetch full features for one or more of the provided features.");const l=i.objectIdField,n=(t,e)=>t.attributes[l]>e.attributes[l]?1:-1,u=o.sort(n),p=a.sort(n);for(let t=0;t<u.length;t++)r.set(u[t],p[t]);return a}));return(await Promise.all(o)).flat()}};t([u({constructOnly:!0})],h.prototype,"editorItems",void 0),t([u({constructOnly:!0})],h.prototype,"features",void 0),t([u()],h.prototype,"fullFeatures",null),t([u()],h.prototype,"layers",null),t([u()],h.prototype,"parent",void 0),t([u()],h.prototype,"selectedFeature",void 0),t([u({constructOnly:!0})],h.prototype,"sketchOptions",void 0),t([u()],h.prototype,"snappingManager",void 0),t([u()],h.prototype,"timeZone",null),t([u()],h.prototype,"viewModel",void 0),t([u()],h.prototype,"_fullFeatures",void 0),h=t([p("esri.widgets.Editor.UpdateFeaturesWorkflowData")],h);const m=h;export{m as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import o from"../../core/Error.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import a from"./Edits.js";var i;let p=i=class extends e{constructor(t){super(t),this.association=null,this.editorItem=null,this.edits=null,this.parent=null,this.featureFormCallbacks=null,this.viewModel=null,this.readOnly=!1}get attachmentsCapabilities(){const t=this.editorItem.capabilities.update.attachments.enabled;return{editing:!0,operations:{add:t,update:t,delete:t}}}get formTemplate(){return this.editorItem.formTemplate}static async create(t){const e=i._makeConstructorProps(t);return new i(e)}static _makeConstructorProps(t){const{association:e,feature:r,parent:s,featureFormCallbacks:i,viewModel:p,readOnly:d}=t,
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import o from"../../core/Error.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import a from"./Edits.js";var i;let p=i=class extends e{constructor(t){super(t),this.association=null,this.editorItem=null,this.edits=null,this.parent=null,this.featureFormCallbacks=null,this.viewModel=null,this.readOnly=!1}get attachmentsCapabilities(){const t=this.editorItem.capabilities.update.attachments.enabled;return{editing:!0,operations:{add:t,update:t,delete:t}}}get formTemplate(){return this.editorItem.formTemplate}static async create(t){const e=i._makeConstructorProps(t);return new i(e)}static _makeConstructorProps(t){const{association:e,feature:r,parent:s,featureFormCallbacks:i,viewModel:p,readOnly:d}=t,n=p.editorItems.find((t=>t.layer===r.sourceLayer));if(!n)throw new o("no-editorItem-found","The EditorViewModel provided did not have an EditorItem associated with the specified Graphic's layer");return{association:e,editorItem:n,edits:new a({feature:r}),parent:s,featureFormCallbacks:i,viewModel:p,readOnly:d}}};t([r()],p.prototype,"association",void 0),t([r()],p.prototype,"attachmentsCapabilities",null),t([r({constructOnly:!0})],p.prototype,"editorItem",void 0),t([r()],p.prototype,"edits",void 0),t([r()],p.prototype,"formTemplate",null),t([r()],p.prototype,"parent",void 0),t([r()],p.prototype,"featureFormCallbacks",void 0),t([r()],p.prototype,"viewModel",void 0),t([r()],p.prototype,"readOnly",void 0),p=i=t([s("esri.widgets.Editor.UpdateRecordWorkflowData")],p);const d=p;export{d as default};
|