RouteLayer-3ZJ4UGAZ.js 59 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041
  1. import {
  2. A,
  3. D,
  4. D2,
  5. N,
  6. O as O2,
  7. R,
  8. S as S3,
  9. U as U2,
  10. a as a3,
  11. a2 as a4,
  12. b,
  13. f as f3,
  14. f2 as f4,
  15. g as g2,
  16. h,
  17. h2,
  18. i as i5,
  19. l as l3,
  20. n as n3,
  21. n2 as n4,
  22. r as r4,
  23. s as s5,
  24. t as t4,
  25. w as w3,
  26. y as y3
  27. } from "./chunk-QO6QPGRC.js";
  28. import {
  29. i as i4
  30. } from "./chunk-LX2NI53X.js";
  31. import "./chunk-IZUZZJS7.js";
  32. import {
  33. f as f2
  34. } from "./chunk-2HUEYG7P.js";
  35. import {
  36. x as x2
  37. } from "./chunk-NLLFSKB2.js";
  38. import {
  39. _n,
  40. rn
  41. } from "./chunk-P24XEEHY.js";
  42. import {
  43. v as v3
  44. } from "./chunk-WOXHUQGM.js";
  45. import {
  46. f,
  47. i as i2
  48. } from "./chunk-FMPQIGFA.js";
  49. import "./chunk-SAJAEMIJ.js";
  50. import {
  51. o as o3
  52. } from "./chunk-RHFU6KWO.js";
  53. import "./chunk-3FNKD2EB.js";
  54. import "./chunk-ZOO4I2U4.js";
  55. import "./chunk-JPUFJK2B.js";
  56. import "./chunk-HZ2WKB3G.js";
  57. import "./chunk-RVCE264D.js";
  58. import "./chunk-HKJ7X3BD.js";
  59. import "./chunk-Y74D3LKQ.js";
  60. import "./chunk-PK4W65H4.js";
  61. import {
  62. g
  63. } from "./chunk-7C23ILQ4.js";
  64. import {
  65. k as k2
  66. } from "./chunk-P6VVVEX6.js";
  67. import {
  68. S2,
  69. j2 as j4,
  70. m as m2,
  71. y as y2
  72. } from "./chunk-3Z755LKF.js";
  73. import "./chunk-LTZ5XXDV.js";
  74. import "./chunk-IEU3AM37.js";
  75. import "./chunk-SKKBVHTF.js";
  76. import "./chunk-DLMAGHHC.js";
  77. import {
  78. i as i3
  79. } from "./chunk-JOYXMSKE.js";
  80. import {
  81. S
  82. } from "./chunk-SZFMKPVM.js";
  83. import {
  84. a as a2
  85. } from "./chunk-YZVAB3DF.js";
  86. import "./chunk-CRHRHOXH.js";
  87. import "./chunk-ECY35CJI.js";
  88. import "./chunk-PT62335L.js";
  89. import "./chunk-JGBXYDGB.js";
  90. import "./chunk-QEWF7QPH.js";
  91. import "./chunk-PJNBFKPF.js";
  92. import "./chunk-C7742RNZ.js";
  93. import "./chunk-FNA5GLRW.js";
  94. import "./chunk-MCWCB5IY.js";
  95. import "./chunk-TV3CFJQR.js";
  96. import {
  97. a
  98. } from "./chunk-TJV6ODRM.js";
  99. import {
  100. v as v4
  101. } from "./chunk-JUWKPBLS.js";
  102. import {
  103. c as c2
  104. } from "./chunk-WLSB4F4I.js";
  105. import "./chunk-GLSWDDR3.js";
  106. import {
  107. O
  108. } from "./chunk-MIQGEDET.js";
  109. import "./chunk-DUEMJ5XS.js";
  110. import "./chunk-VRLXUHP2.js";
  111. import "./chunk-3LVSQLWJ.js";
  112. import "./chunk-4ONPMX2F.js";
  113. import "./chunk-CRGY2SDS.js";
  114. import "./chunk-4T5ZGMEN.js";
  115. import {
  116. n as n2
  117. } from "./chunk-XTVKPAWY.js";
  118. import "./chunk-3OSQ6GXO.js";
  119. import "./chunk-3WQOA5CB.js";
  120. import {
  121. t as t3
  122. } from "./chunk-PLWDAYK7.js";
  123. import "./chunk-FZQZIM7U.js";
  124. import "./chunk-CZBRZ6SU.js";
  125. import "./chunk-VGWC3IKZ.js";
  126. import "./chunk-2H5MD622.js";
  127. import {
  128. E2 as E
  129. } from "./chunk-3RSFVUKZ.js";
  130. import "./chunk-UVVU4UUO.js";
  131. import "./chunk-O6VYMEIX.js";
  132. import "./chunk-X4SA4ELJ.js";
  133. import {
  134. r as r3
  135. } from "./chunk-5N7JLUJJ.js";
  136. import "./chunk-ZAY3CMAZ.js";
  137. import "./chunk-P3XKUGLS.js";
  138. import "./chunk-2ZSOO377.js";
  139. import {
  140. x
  141. } from "./chunk-YUA3AHKR.js";
  142. import {
  143. j as j5
  144. } from "./chunk-LU5IJZB4.js";
  145. import "./chunk-7IBV2TRE.js";
  146. import "./chunk-ZLNEXZAN.js";
  147. import "./chunk-5UVJ64RB.js";
  148. import "./chunk-SFEFRQCL.js";
  149. import {
  150. b as b2
  151. } from "./chunk-DXVOOCG4.js";
  152. import "./chunk-3GZSQU56.js";
  153. import "./chunk-ZYRIJWLX.js";
  154. import "./chunk-RYY6632W.js";
  155. import "./chunk-DW42UVIT.js";
  156. import "./chunk-YAEIHDJH.js";
  157. import "./chunk-TJNOJH33.js";
  158. import "./chunk-OSHI574D.js";
  159. import {
  160. i
  161. } from "./chunk-ETGAZ7LF.js";
  162. import "./chunk-75U5LM2V.js";
  163. import {
  164. v as v2
  165. } from "./chunk-RMDDCMKS.js";
  166. import {
  167. m2 as m,
  168. u
  169. } from "./chunk-VCH45Q2I.js";
  170. import {
  171. j as j2
  172. } from "./chunk-LBW34VZ2.js";
  173. import "./chunk-GSSTTHIT.js";
  174. import "./chunk-YFSLJIO4.js";
  175. import "./chunk-IM3LVQXV.js";
  176. import "./chunk-55RWC67C.js";
  177. import {
  178. s as s4
  179. } from "./chunk-HZRKBTHJ.js";
  180. import {
  181. U
  182. } from "./chunk-DVUG3KID.js";
  183. import "./chunk-FWSQEIAR.js";
  184. import {
  185. Ct,
  186. j as j3
  187. } from "./chunk-VEGAOVMY.js";
  188. import {
  189. o as o2,
  190. w,
  191. w2
  192. } from "./chunk-6T6G6LCQ.js";
  193. import "./chunk-YEJL5NEF.js";
  194. import {
  195. c,
  196. k2 as k,
  197. r as r2
  198. } from "./chunk-PQFTYGF5.js";
  199. import {
  200. e,
  201. l3 as l2,
  202. n5 as n,
  203. y3 as y
  204. } from "./chunk-2Z2TG5CU.js";
  205. import "./chunk-6KZ2LTDA.js";
  206. import "./chunk-U2XHEJM7.js";
  207. import {
  208. v
  209. } from "./chunk-SQOPWYIT.js";
  210. import {
  211. j
  212. } from "./chunk-V6P2MAQQ.js";
  213. import {
  214. s,
  215. s2,
  216. s3
  217. } from "./chunk-E5O6P5I2.js";
  218. import {
  219. o,
  220. t as t2
  221. } from "./chunk-SPWQ3AWG.js";
  222. import "./chunk-2TIUKVZN.js";
  223. import {
  224. e as e2,
  225. l,
  226. r,
  227. t
  228. } from "./chunk-YXWMMD76.js";
  229. import "./chunk-S5KM4IGW.js";
  230. // node_modules/@arcgis/core/layers/support/RouteStopSymbols.js
  231. var p = class extends l2 {
  232. constructor(o4) {
  233. super(o4), this.break = new y2({ color: [255, 255, 255], size: 12, outline: { color: [0, 122, 194], width: 3 } }), this.first = new y2({ color: [0, 255, 0], size: 20, outline: { color: [255, 255, 255], width: 4 } }), this.unlocated = new y2({ color: [255, 0, 0], size: 12, outline: { color: [255, 255, 255], width: 3 } }), this.last = new y2({ color: [255, 0, 0], size: 20, outline: { color: [255, 255, 255], width: 4 } }), this.middle = new y2({ color: [51, 51, 51], size: 12, outline: { color: [0, 122, 194], width: 3 } }), this.waypoint = new y2({ color: [255, 255, 255], size: 12, outline: { color: [0, 122, 194], width: 3 } });
  234. }
  235. };
  236. e([y({ types: j4 })], p.prototype, "break", void 0), e([y({ types: j4 })], p.prototype, "first", void 0), e([y({ types: j4 })], p.prototype, "unlocated", void 0), e([y({ types: j4 })], p.prototype, "last", void 0), e([y({ types: j4 })], p.prototype, "middle", void 0), e([y({ types: j4 })], p.prototype, "waypoint", void 0), p = e([n("esri.layers.support.RouteStopSymbols")], p);
  237. var l4 = p;
  238. // node_modules/@arcgis/core/layers/support/RouteSymbols.js
  239. var n5 = class extends l2 {
  240. constructor(o4) {
  241. super(o4), this.directionLines = new m2({ color: [0, 122, 194], width: 6 }), this.directionPoints = new y2({ color: [255, 255, 255], size: 6, outline: { color: [0, 122, 194], width: 2 } }), this.pointBarriers = new y2({ style: "x", size: 10, outline: { color: [255, 0, 0], width: 3 } }), this.polygonBarriers = new S2({ color: [255, 170, 0, 0.6], outline: { width: 7.5, color: [255, 0, 0, 0.6] } }), this.polylineBarriers = new m2({ width: 7.5, color: [255, 85, 0, 0.7] }), this.routeInfo = new m2({ width: 8, color: [20, 89, 127] }), this.stops = new l4();
  242. }
  243. };
  244. e([y({ types: j4 })], n5.prototype, "directionLines", void 0), e([y({ types: j4 })], n5.prototype, "directionPoints", void 0), e([y({ types: j4 })], n5.prototype, "pointBarriers", void 0), e([y({ types: j4 })], n5.prototype, "polygonBarriers", void 0), e([y({ types: j4 })], n5.prototype, "polylineBarriers", void 0), e([y({ types: j4 })], n5.prototype, "routeInfo", void 0), e([y({ type: l4 })], n5.prototype, "stops", void 0), n5 = e([n("esri.layers.support.RouteSymbols")], n5);
  245. var y4 = n5;
  246. // node_modules/@arcgis/core/rest/support/NetworkAttribute.js
  247. var n6 = class extends l2 {
  248. constructor(t6) {
  249. super(t6), this.dataType = null, this.name = null, this.parameterNames = null, this.restrictionUsageParameterName = null, this.timeNeutralAttributeName = null, this.trafficSupport = null, this.units = null, this.usageType = null;
  250. }
  251. };
  252. e([y({ type: String })], n6.prototype, "dataType", void 0), e([r3(y3, { ignoreUnknown: false })], n6.prototype, "name", void 0), e([y({ type: [String] })], n6.prototype, "parameterNames", void 0), e([y({ type: String })], n6.prototype, "restrictionUsageParameterName", void 0), e([r3(N, { ignoreUnknown: false })], n6.prototype, "timeNeutralAttributeName", void 0), e([y({ type: String })], n6.prototype, "trafficSupport", void 0), e([y({ type: String })], n6.prototype, "units", void 0), e([r3(U2)], n6.prototype, "usageType", void 0), n6 = e([n("esri.rest.support.NetworkAttribute")], n6);
  253. var u2 = n6;
  254. // node_modules/@arcgis/core/rest/support/NetworkDataset.js
  255. var p2 = class extends l2 {
  256. constructor(t6) {
  257. super(t6), this.buildTime = null, this.name = null, this.networkAttributes = null, this.networkSources = null, this.state = null;
  258. }
  259. };
  260. e([y({ type: Number })], p2.prototype, "buildTime", void 0), e([y({ type: String })], p2.prototype, "name", void 0), e([y({ type: [u2] })], p2.prototype, "networkAttributes", void 0), e([y()], p2.prototype, "networkSources", void 0), e([y({ type: String })], p2.prototype, "state", void 0), p2 = e([n("esri.rest.support.NetworkDataset")], p2);
  261. var i6 = p2;
  262. // node_modules/@arcgis/core/rest/support/NetworkServiceDescription.js
  263. var d = class extends l2 {
  264. constructor(t6) {
  265. super(t6), this.accumulateAttributeNames = null, this.currentVersion = null, this.defaultTravelMode = null, this.directionsLanguage = null, this.directionsLengthUnits = null, this.directionsSupportedLanguages = null, this.directionsTimeAttribute = null, this.hasZ = null, this.impedance = null, this.networkDataset = null, this.supportedTravelModes = null;
  266. }
  267. readAccumulateAttributes(t6) {
  268. return t(t6) ? null : t6.map((t7) => y3.fromJSON(t7));
  269. }
  270. writeAccumulateAttributes(t6, e3, o4) {
  271. !t(t6) && t6.length && (e3[o4] = t6.map((t7) => y3.toJSON(t7)));
  272. }
  273. };
  274. e([y()], d.prototype, "accumulateAttributeNames", void 0), e([o2("accumulateAttributeNames")], d.prototype, "readAccumulateAttributes", null), e([r2("accumulateAttributeNames")], d.prototype, "writeAccumulateAttributes", null), e([y()], d.prototype, "currentVersion", void 0), e([y()], d.prototype, "defaultTravelMode", void 0), e([y()], d.prototype, "directionsLanguage", void 0), e([r3(r4)], d.prototype, "directionsLengthUnits", void 0), e([y()], d.prototype, "directionsSupportedLanguages", void 0), e([r3(N, { ignoreUnknown: false })], d.prototype, "directionsTimeAttribute", void 0), e([y()], d.prototype, "hasZ", void 0), e([r3(y3, { ignoreUnknown: false })], d.prototype, "impedance", void 0), e([y({ type: i6 })], d.prototype, "networkDataset", void 0), e([y({ type: [A] })], d.prototype, "supportedTravelModes", void 0), d = e([n("esri.rest.support.NetworkServiceDescription")], d);
  275. var y5 = d;
  276. // node_modules/@arcgis/core/rest/networkService.js
  277. var d2 = s2.getLogger("esri.rest.networkService");
  278. function u3(e3, r5, t6, o4) {
  279. o4[t6] = [r5.length, r5.length + e3.length], e3.forEach((e4) => {
  280. r5.push(e4.geometry);
  281. });
  282. }
  283. function f5(e3, r5) {
  284. for (let t6 = 0; t6 < r5.length; t6++) {
  285. const o4 = e3[r5[t6]];
  286. if (o4 && o4.length)
  287. for (const e4 of o4)
  288. e4.z = void 0;
  289. }
  290. d2.warnOnce("The remote Network Analysis service is powered by a network dataset which is not Z-aware.\nZ-coordinates of the input geometry are ignored.");
  291. }
  292. function c3(e3, r5) {
  293. for (let t6 = 0; t6 < r5.length; t6++) {
  294. const s7 = e3[r5[t6]];
  295. if (s7 && s7.length) {
  296. for (const e4 of s7)
  297. if (r(e4) && e4.hasZ)
  298. return true;
  299. }
  300. }
  301. return false;
  302. }
  303. async function p3(t6, o4, s7) {
  304. if (!t6)
  305. throw new s3("network-service:missing-url", "Url to Network service is missing");
  306. const a8 = i2({ f: "json", token: o4 }, s7), { data: l8 } = await U(t6, a8);
  307. l8.supportedTravelModes || (l8.supportedTravelModes = []);
  308. for (let e3 = 0; e3 < l8.supportedTravelModes.length; e3++)
  309. l8.supportedTravelModes[e3].id || (l8.supportedTravelModes[e3].id = l8.supportedTravelModes[e3].itemId);
  310. const d3 = l8.currentVersion >= 10.4 ? m3(t6, o4, s7) : v5(t6, s7), { defaultTravelMode: u8, supportedTravelModes: f7 } = await d3;
  311. return l8.defaultTravelMode = u8, l8.supportedTravelModes = f7, y5.fromJSON(l8);
  312. }
  313. async function v5(r5, t6) {
  314. var _a, _b, _c;
  315. const o4 = i2({ f: "json" }, t6), { data: i9 } = await U(r5.replace(/\/rest\/.*$/i, "/info"), o4);
  316. if (!i9 || !i9.owningSystemUrl)
  317. return { supportedTravelModes: [], defaultTravelMode: null };
  318. const { owningSystemUrl: d3 } = i9, u8 = Ct(d3) + "/sharing/rest/portals/self", { data: f7 } = await U(u8, o4), c11 = t2("helperServices.routingUtilities.url", f7);
  319. if (!c11)
  320. return { supportedTravelModes: [], defaultTravelMode: null };
  321. const p8 = f(d3), v6 = /\/solve$/i.test(p8.path) ? "Route" : /\/solveclosestfacility$/i.test(p8.path) ? "ClosestFacility" : "ServiceAreas", m6 = i2({ f: "json", serviceName: v6 }, t6), T = Ct(c11) + "/GetTravelModes/execute", M = await U(T, m6), h3 = [];
  322. let g3 = null;
  323. if ((_b = (_a = M == null ? void 0 : M.data) == null ? void 0 : _a.results) == null ? void 0 : _b.length) {
  324. const e3 = M.data.results;
  325. for (const r6 of e3)
  326. if ("supportedTravelModes" === r6.paramName) {
  327. if ((_c = r6.value) == null ? void 0 : _c.features) {
  328. for (const { attributes: e4 } of r6.value.features)
  329. if (e4) {
  330. const r7 = JSON.parse(e4.TravelMode);
  331. h3.push(r7);
  332. }
  333. }
  334. } else
  335. "defaultTravelMode" === r6.paramName && (g3 = r6.value);
  336. }
  337. return { supportedTravelModes: h3, defaultTravelMode: g3 };
  338. }
  339. async function m3(t6, o4, s7) {
  340. try {
  341. const r5 = i2({ f: "json", token: o4 }, s7), l8 = Ct(t6) + "/retrieveTravelModes", { data: { supportedTravelModes: i9, defaultTravelMode: d3 } } = await U(l8, r5);
  342. return { supportedTravelModes: i9, defaultTravelMode: d3 };
  343. } catch (l8) {
  344. throw new s3("network-service:retrieveTravelModes", "Could not get to the NAServer's retrieveTravelModes.", { error: l8 });
  345. }
  346. }
  347. // node_modules/@arcgis/core/rest/support/GPMessage.js
  348. var p4 = new s4({ esriJobMessageTypeInformative: "informative", esriJobMessageTypeProcessDefinition: "process-definition", esriJobMessageTypeProcessStart: "process-start", esriJobMessageTypeProcessStop: "process-stop", esriJobMessageTypeWarning: "warning", esriJobMessageTypeError: "error", esriJobMessageTypeEmpty: "empty", esriJobMessageTypeAbort: "abort" });
  349. var i7 = class extends l2 {
  350. constructor(e3) {
  351. super(e3), this.description = null, this.type = null;
  352. }
  353. };
  354. e([y({ type: String, json: { write: true } })], i7.prototype, "description", void 0), e([y({ type: String, json: { read: p4.read, write: p4.write } })], i7.prototype, "type", void 0), i7 = e([n("esri.rest.support.GPMessage")], i7);
  355. var a5 = i7;
  356. // node_modules/@arcgis/core/rest/support/NAMessage.js
  357. var p5 = new s4({ 0: "informative", 1: "process-definition", 2: "process-start", 3: "process-stop", 50: "warning", 100: "error", 101: "empty", 200: "abort" });
  358. var c4 = class extends a5 {
  359. constructor(r5) {
  360. super(r5), this.type = null;
  361. }
  362. };
  363. e([y({ type: String, json: { read: p5.read, write: p5.write } })], c4.prototype, "type", void 0), c4 = e([n("esri.rest.support.NAMessage")], c4);
  364. var a6 = c4;
  365. // node_modules/@arcgis/core/rest/support/DirectionsString.js
  366. var c5 = class extends l2 {
  367. constructor(r5) {
  368. super(r5);
  369. }
  370. };
  371. e([y({ json: { read: { source: "string" } } })], c5.prototype, "text", void 0), e([r3(R, { name: "stringType" })], c5.prototype, "type", void 0), c5 = e([n("esri.rest.support.DirectionsString")], c5);
  372. var i8 = c5;
  373. // node_modules/@arcgis/core/rest/support/DirectionsEvent.js
  374. var a7 = class extends l2 {
  375. constructor(r5) {
  376. super(r5), this.arriveTime = null, this.arriveTimeOffset = null, this.geometry = null, this.strings = null;
  377. }
  378. readArriveTimeOffset(r5, e3) {
  379. return a4(e3.ETA, e3.arriveTimeUTC);
  380. }
  381. readGeometry(r5, e3) {
  382. return w.fromJSON(e3.point);
  383. }
  384. };
  385. e([y({ type: Date, json: { read: { source: "arriveTimeUTC" } } })], a7.prototype, "arriveTime", void 0), e([y()], a7.prototype, "arriveTimeOffset", void 0), e([o2("arriveTimeOffset", ["arriveTimeUTC", "ETA"])], a7.prototype, "readArriveTimeOffset", null), e([y({ type: w })], a7.prototype, "geometry", void 0), e([o2("geometry", ["point"])], a7.prototype, "readGeometry", null), e([y({ type: [i8] })], a7.prototype, "strings", void 0), a7 = e([n("esri.rest.support.DirectionsEvent")], a7);
  386. var c6 = a7;
  387. // node_modules/@arcgis/core/rest/support/DirectionsFeature.js
  388. function m4(r5) {
  389. if (t(r5) || "" === r5)
  390. return null;
  391. let e3 = 0, t6 = 0, o4 = 0, p8 = 0;
  392. const n9 = [];
  393. let c11, i9, a8, m6, u8, l8, f7, y8, d3 = 0, h3 = 0, j6 = 0;
  394. if (u8 = r5.match(/((\+|\-)[^\+\-\|]+|\|)/g), u8 || (u8 = []), 0 === parseInt(u8[d3], 32)) {
  395. d3 = 2;
  396. const r6 = parseInt(u8[d3], 32);
  397. d3++, l8 = parseInt(u8[d3], 32), d3++, 1 & r6 && (h3 = u8.indexOf("|") + 1, f7 = parseInt(u8[h3], 32), h3++), 2 & r6 && (j6 = u8.indexOf("|", h3) + 1, y8 = parseInt(u8[j6], 32), j6++);
  398. } else
  399. l8 = parseInt(u8[d3], 32), d3++;
  400. for (; d3 < u8.length && "|" !== u8[d3]; ) {
  401. c11 = parseInt(u8[d3], 32) + e3, d3++, e3 = c11, i9 = parseInt(u8[d3], 32) + t6, d3++, t6 = i9;
  402. const r6 = [c11 / l8, i9 / l8];
  403. h3 && (m6 = parseInt(u8[h3], 32) + o4, h3++, o4 = m6, r6.push(m6 / f7)), j6 && (a8 = parseInt(u8[j6], 32) + p8, j6++, p8 = a8, r6.push(a8 / y8)), n9.push(r6);
  404. }
  405. return { paths: [n9], hasZ: h3 > 0, hasM: j6 > 0 };
  406. }
  407. var u4 = class extends g {
  408. constructor(r5) {
  409. super(r5), this.events = null, this.strings = null;
  410. }
  411. readGeometry(r5, e3) {
  412. const s7 = m4(e3.compressedGeometry);
  413. return r(s7) ? m.fromJSON(s7) : null;
  414. }
  415. };
  416. e([y({ type: [c6] })], u4.prototype, "events", void 0), e([o2("geometry", ["compressedGeometry"])], u4.prototype, "readGeometry", null), e([y({ type: [i8] })], u4.prototype, "strings", void 0), u4 = e([n("esri.rest.support.DirectionsFeature")], u4);
  417. var l5 = u4;
  418. // node_modules/@arcgis/core/rest/support/DirectionsFeatureSet.js
  419. function u5(e3, t6) {
  420. if (0 === e3.length)
  421. return new m({ spatialReference: t6 });
  422. const r5 = [];
  423. for (const p8 of e3)
  424. for (const e4 of p8.paths)
  425. r5.push(...e4);
  426. const o4 = [];
  427. r5.forEach((e4, t7) => {
  428. 0 !== t7 && e4[0] === r5[t7 - 1][0] && e4[1] === r5[t7 - 1][1] || o4.push(e4);
  429. });
  430. const { hasM: s7, hasZ: a8 } = e3[0];
  431. return new m({ hasM: s7, hasZ: a8, paths: [o4], spatialReference: t6 });
  432. }
  433. var c7 = class extends x2 {
  434. constructor(e3) {
  435. super(e3), this.extent = null, this.features = null, this.geometryType = "polyline", this.routeId = null, this.routeName = null, this.totalDriveTime = null, this.totalLength = null, this.totalTime = null;
  436. }
  437. readFeatures(e3, r5) {
  438. var _a;
  439. if (!e3)
  440. return [];
  441. const o4 = (_a = r5.summary.envelope.spatialReference) != null ? _a : r5.spatialReference, s7 = o4 && k.fromJSON(o4);
  442. return e3.map((e4) => {
  443. const r6 = l5.fromJSON(e4);
  444. if (r(r6.geometry) && (r6.geometry.spatialReference = s7), r(r6.events))
  445. for (const o5 of r6.events)
  446. r(o5.geometry) && (o5.geometry.spatialReference = s7);
  447. return r6;
  448. });
  449. }
  450. get mergedGeometry() {
  451. if (!this.features)
  452. return null;
  453. return u5(this.features.map(({ geometry: e3 }) => e2(e3)), this.extent.spatialReference);
  454. }
  455. get strings() {
  456. return this.features.map(({ strings: e3 }) => e3).flat().filter(r);
  457. }
  458. };
  459. e([y({ type: w2, json: { read: { source: "summary.envelope" } } })], c7.prototype, "extent", void 0), e([y()], c7.prototype, "features", void 0), e([o2("features")], c7.prototype, "readFeatures", null), e([y()], c7.prototype, "geometryType", void 0), e([y({ readOnly: true })], c7.prototype, "mergedGeometry", null), e([y()], c7.prototype, "routeId", void 0), e([y()], c7.prototype, "routeName", void 0), e([y({ value: null, readOnly: true })], c7.prototype, "strings", null), e([y({ json: { read: { source: "summary.totalDriveTime" } } })], c7.prototype, "totalDriveTime", void 0), e([y({ json: { read: { source: "summary.totalLength" } } })], c7.prototype, "totalLength", void 0), e([y({ json: { read: { source: "summary.totalTime" } } })], c7.prototype, "totalTime", void 0), c7 = e([n("esri.rest.support.DirectionsFeatureSet")], c7);
  460. var f6 = c7;
  461. // node_modules/@arcgis/core/rest/support/RouteResult.js
  462. var n7 = class extends l2 {
  463. constructor(t6) {
  464. super(t6), this.directionLines = null, this.directionPoints = null, this.directions = null, this.route = null, this.routeName = null, this.stops = null, this.traversedEdges = null, this.traversedJunctions = null, this.traversedTurns = null;
  465. }
  466. };
  467. e([y({ type: x2, json: { write: true } })], n7.prototype, "directionLines", void 0), e([y({ type: x2, json: { write: true } })], n7.prototype, "directionPoints", void 0), e([y({ type: f6, json: { write: true } })], n7.prototype, "directions", void 0), e([y({ type: g, json: { write: true } })], n7.prototype, "route", void 0), e([y({ type: String, json: { write: true } })], n7.prototype, "routeName", void 0), e([y({ type: [g], json: { write: true } })], n7.prototype, "stops", void 0), e([y({ type: x2, json: { write: true } })], n7.prototype, "traversedEdges", void 0), e([y({ type: x2, json: { write: true } })], n7.prototype, "traversedJunctions", void 0), e([y({ type: x2, json: { write: true } })], n7.prototype, "traversedTurns", void 0), n7 = e([n("esri.rest.support.RouteResult")], n7);
  468. var u6 = n7;
  469. // node_modules/@arcgis/core/rest/support/RouteSolveResult.js
  470. function u7(r5) {
  471. return r5 && x2.fromJSON(r5).features.map((r6) => r6);
  472. }
  473. var n8 = class extends l2 {
  474. constructor(r5) {
  475. super(r5), this.messages = null, this.pointBarriers = null, this.polylineBarriers = null, this.polygonBarriers = null, this.routeResults = null;
  476. }
  477. readPointBarriers(r5, o4) {
  478. return u7(o4.barriers);
  479. }
  480. readPolylineBarriers(r5) {
  481. return u7(r5);
  482. }
  483. readPolygonBarriers(r5) {
  484. return u7(r5);
  485. }
  486. };
  487. e([y({ type: [a6] })], n8.prototype, "messages", void 0), e([y({ type: [g] })], n8.prototype, "pointBarriers", void 0), e([o2("pointBarriers", ["barriers"])], n8.prototype, "readPointBarriers", null), e([y({ type: [g] })], n8.prototype, "polylineBarriers", void 0), e([o2("polylineBarriers")], n8.prototype, "readPolylineBarriers", null), e([y({ type: [g] })], n8.prototype, "polygonBarriers", void 0), e([o2("polygonBarriers")], n8.prototype, "readPolygonBarriers", null), e([y({ type: [u6] })], n8.prototype, "routeResults", void 0), n8 = e([n("esri.rest.support.RouteSolveResult")], n8);
  488. var y6 = n8;
  489. // node_modules/@arcgis/core/rest/route.js
  490. function l6(e3) {
  491. return e3 instanceof x2;
  492. }
  493. async function m5(r5, t6, p8) {
  494. const c11 = [], m6 = [], d3 = {}, g3 = {}, h3 = f(r5), { path: R3 } = h3;
  495. l6(t6.stops) && u3(t6.stops.features, m6, "stops.features", d3), l6(t6.pointBarriers) && u3(t6.pointBarriers.features, m6, "pointBarriers.features", d3), l6(t6.polylineBarriers) && u3(t6.polylineBarriers.features, m6, "polylineBarriers.features", d3), l6(t6.polygonBarriers) && u3(t6.polygonBarriers.features, m6, "polygonBarriers.features", d3);
  496. const v6 = await v3(m6);
  497. for (const e3 in d3) {
  498. const r6 = d3[e3];
  499. c11.push(e3), g3[e3] = v6.slice(r6[0], r6[1]);
  500. }
  501. if (c3(g3, c11)) {
  502. let e3 = null;
  503. try {
  504. e3 = await p3(R3, t6.apiKey, p8);
  505. } catch {
  506. }
  507. e3 && !e3.hasZ && f5(g3, c11);
  508. }
  509. for (const e3 in g3)
  510. g3[e3].forEach((r6, s7) => {
  511. t6.get(e3)[s7].geometry = r6;
  512. });
  513. const B = { ...p8, query: { ...h3.query, ...n4(t6), f: "json" } }, E2 = R3.endsWith("/solve") ? R3 : `${R3}/solve`, { data: T } = await U(E2, B);
  514. return y7(T);
  515. }
  516. function y7(e3) {
  517. var _a;
  518. const { barriers: s7, directionLines: o4, directionPoints: a8, directions: i9, messages: n9, polygonBarriers: u8, polylineBarriers: f7, routes: p8, stops: l8, traversedEdges: m6, traversedJunctions: y8, traversedTurns: d3 } = e3, g3 = (e4) => {
  519. const r5 = R3.find((r6) => r6.routeName === e4);
  520. if (r(r5))
  521. return r5;
  522. const s8 = { routeId: R3.length + 1, routeName: e4 };
  523. return R3.push(s8), s8;
  524. }, h3 = (e4) => {
  525. const r5 = R3.find((r6) => r6.routeId === e4);
  526. if (r(r5))
  527. return r5;
  528. const s8 = { routeId: e4, routeName: null };
  529. return R3.push(s8), s8;
  530. }, R3 = [];
  531. p8 == null ? void 0 : p8.features.forEach((e4, r5) => {
  532. e4.geometry.spatialReference = p8.spatialReference;
  533. const t6 = e4.attributes.Name, s8 = r5 + 1;
  534. R3.push({ routeId: s8, routeName: t6, route: e4 });
  535. }), i9 == null ? void 0 : i9.forEach((e4) => {
  536. const { routeName: r5 } = e4;
  537. g3(r5).directions = e4;
  538. });
  539. const v6 = ((_a = l8 == null ? void 0 : l8.features.every((e4) => t(e4.attributes.RouteName))) != null ? _a : false) && R3.length > 0 ? R3[0].routeName : null;
  540. return l8 == null ? void 0 : l8.features.forEach((e4) => {
  541. var _a2, _b;
  542. var r5;
  543. e4.geometry && ((_a2 = (r5 = e4.geometry).spatialReference) != null ? _a2 : r5.spatialReference = l8.spatialReference);
  544. const t6 = v6 != null ? v6 : e4.attributes.RouteName, s8 = g3(t6);
  545. (_b = s8.stops) != null ? _b : s8.stops = [], s8.stops.push(e4);
  546. }), o4 == null ? void 0 : o4.features.forEach((e4) => {
  547. var _a2;
  548. const r5 = e4.attributes.RouteID, t6 = h3(r5), { geometryType: s8, spatialReference: a9 } = o4;
  549. (_a2 = t6.directionLines) != null ? _a2 : t6.directionLines = { features: [], geometryType: s8, spatialReference: a9 }, t6.directionLines.features.push(e4);
  550. }), a8 == null ? void 0 : a8.features.forEach((e4) => {
  551. var _a2;
  552. const r5 = e4.attributes.RouteID, t6 = h3(r5), { geometryType: s8, spatialReference: o5 } = a8;
  553. (_a2 = t6.directionPoints) != null ? _a2 : t6.directionPoints = { features: [], geometryType: s8, spatialReference: o5 }, t6.directionPoints.features.push(e4);
  554. }), m6 == null ? void 0 : m6.features.forEach((e4) => {
  555. var _a2;
  556. const r5 = e4.attributes.RouteID, t6 = h3(r5), { geometryType: s8, spatialReference: o5 } = m6;
  557. (_a2 = t6.traversedEdges) != null ? _a2 : t6.traversedEdges = { features: [], geometryType: s8, spatialReference: o5 }, t6.traversedEdges.features.push(e4);
  558. }), y8 == null ? void 0 : y8.features.forEach((e4) => {
  559. var _a2;
  560. const r5 = e4.attributes.RouteID, t6 = h3(r5), { geometryType: s8, spatialReference: o5 } = y8;
  561. (_a2 = t6.traversedJunctions) != null ? _a2 : t6.traversedJunctions = { features: [], geometryType: s8, spatialReference: o5 }, t6.traversedJunctions.features.push(e4);
  562. }), d3 == null ? void 0 : d3.features.forEach((e4) => {
  563. var _a2;
  564. const r5 = e4.attributes.RouteID, t6 = h3(r5);
  565. (_a2 = t6.traversedTurns) != null ? _a2 : t6.traversedTurns = { features: [] }, t6.traversedTurns.features.push(e4);
  566. }), y6.fromJSON({ routeResults: R3, barriers: s7, polygonBarriers: u8, polylineBarriers: f7, messages: n9 });
  567. }
  568. // node_modules/@arcgis/core/rest/support/commonProperties.js
  569. var t5 = { type: String, json: { read: { source: "token" }, write: { target: "token" } } };
  570. // node_modules/@arcgis/core/rest/support/DataLayer.js
  571. var l7 = class extends i3(l2) {
  572. constructor(o4) {
  573. super(o4), this.doNotLocateOnRestrictedElements = null, this.geometry = null, this.geometryType = null, this.name = null, this.spatialRelationship = null, this.type = "layer", this.where = null;
  574. }
  575. };
  576. e([y({ type: Boolean, json: { write: true } })], l7.prototype, "doNotLocateOnRestrictedElements", void 0), e([y({ types: i, json: { read: v2, write: true } })], l7.prototype, "geometry", void 0), e([r3(w3)], l7.prototype, "geometryType", void 0), e([y({ type: String, json: { name: "layerName", write: true } })], l7.prototype, "name", void 0), e([r3(S3, { name: "spatialRel" })], l7.prototype, "spatialRelationship", void 0), e([y({ type: String, json: { write: true } })], l7.prototype, "type", void 0), e([y({ type: String, json: { write: true } })], l7.prototype, "where", void 0), l7 = e([n("esri.rest.support.DataLayer")], l7);
  577. var c8 = l7;
  578. // node_modules/@arcgis/core/rest/support/NetworkFeatureSet.js
  579. var s6;
  580. var c9 = s6 = class extends x2 {
  581. constructor(e3) {
  582. super(e3), this.doNotLocateOnRestrictedElements = null;
  583. }
  584. clone() {
  585. return new s6({ doNotLocateOnRestrictedElements: this.doNotLocateOnRestrictedElements, ...this.cloneProperties() });
  586. }
  587. };
  588. e([y({ type: Boolean, json: { write: true } })], c9.prototype, "doNotLocateOnRestrictedElements", void 0), c9 = s6 = e([n("esri.rest.support.NetworkFeatureSet")], c9);
  589. var p6 = c9;
  590. // node_modules/@arcgis/core/rest/support/NetworkUrl.js
  591. var p7 = class extends i3(l2) {
  592. constructor(o4) {
  593. super(o4), this.doNotLocateOnRestrictedElements = null, this.url = null;
  594. }
  595. };
  596. e([y({ type: Boolean, json: { write: true } })], p7.prototype, "doNotLocateOnRestrictedElements", void 0), e([y({ type: String, json: { write: true } })], p7.prototype, "url", void 0), p7 = e([n("esri.rest.support.NetworkUrl")], p7);
  597. var c10 = p7;
  598. // node_modules/@arcgis/core/rest/support/RouteParameters.js
  599. var O3;
  600. function U3(t6) {
  601. return t6 && "type" in t6;
  602. }
  603. function J(t6) {
  604. return t6 && "features" in t6 && "doNotLocateOnRestrictedElements" in t6;
  605. }
  606. function L(t6) {
  607. return t6 && "url" in t6;
  608. }
  609. function R2(t6) {
  610. return t6 && "features" in t6;
  611. }
  612. function C(t6) {
  613. return U3(t6) ? c8.fromJSON(t6) : L(t6) ? c10.fromJSON(t6) : J(t6) ? p6.fromJSON(t6) : R2(t6) ? x2.fromJSON(t6) : null;
  614. }
  615. function D3(t6, e3, o4) {
  616. r(t6) && (e3[o4] = j2.isCollection(t6) ? { features: t6.toArray().map((t7) => t7.toJSON()) } : t6.toJSON());
  617. }
  618. var k3 = O3 = class extends i3(l2) {
  619. constructor(t6) {
  620. super(t6), this.accumulateAttributes = null, this.apiKey = null, this.attributeParameterValues = null, this.directionsLanguage = null, this.directionsLengthUnits = null, this.directionsOutputType = null, this.directionsStyleName = null, this.directionsTimeAttribute = null, this.findBestSequence = null, this.geometryPrecision = null, this.geometryPrecisionM = null, this.geometryPrecisionZ = null, this.ignoreInvalidLocations = null, this.impedanceAttribute = null, this.outputGeometryPrecision = null, this.outputGeometryPrecisionUnits = null, this.outputLines = "true-shape", this.outSpatialReference = null, this.overrides = null, this.pointBarriers = null, this.polygonBarriers = null, this.polylineBarriers = null, this.preserveFirstStop = null, this.preserveLastStop = null, this.preserveObjectID = null, this.restrictionAttributes = null, this.restrictUTurns = null, this.returnBarriers = false, this.returnDirections = false, this.returnPolygonBarriers = false, this.returnPolylineBarriers = false, this.returnRoutes = true, this.returnStops = false, this.returnTraversedEdges = null, this.returnTraversedJunctions = null, this.returnTraversedTurns = null, this.returnZ = true, this.startTime = null, this.startTimeIsUTC = true, this.stops = null, this.timeWindowsAreUTC = null, this.travelMode = null, this.useHierarchy = null, this.useTimeWindows = null;
  621. }
  622. static from(t6) {
  623. return v(O3, t6);
  624. }
  625. readAccumulateAttributes(t6) {
  626. return t(t6) ? null : t6.map((t7) => y3.fromJSON(t7));
  627. }
  628. writeAccumulateAttributes(t6, e3, r5) {
  629. !t(t6) && t6.length && (e3[r5] = t6.map((t7) => y3.toJSON(t7)));
  630. }
  631. writePointBarriers(t6, e3, r5) {
  632. D3(t6, e3, r5);
  633. }
  634. writePolygonBarrier(t6, e3, r5) {
  635. D3(t6, e3, r5);
  636. }
  637. writePolylineBarrier(t6, e3, r5) {
  638. D3(t6, e3, r5);
  639. }
  640. readRestrictionAttributes(t6) {
  641. return t(t6) ? null : t6.map((t7) => D.fromJSON(t7));
  642. }
  643. writeRestrictionAttributes(t6, e3, r5) {
  644. !t(t6) && t6.length && (e3[r5] = t6.map((t7) => D.toJSON(t7)));
  645. }
  646. readStartTime(t6, e3) {
  647. const { startTime: r5 } = e3;
  648. return t(r5) ? null : "now" === r5 ? "now" : new Date(r5);
  649. }
  650. writeStartTime(t6, e3) {
  651. t(t6) || (e3.startTime = "now" === t6 ? "now" : t6.getTime());
  652. }
  653. readStops(t6, e3) {
  654. return C(e3.stops);
  655. }
  656. writeStops(t6, e3, r5) {
  657. D3(t6, e3, r5);
  658. }
  659. };
  660. e([y({ type: [String], json: { name: "accumulateAttributeNames", write: true } })], k3.prototype, "accumulateAttributes", void 0), e([o2("accumulateAttributes")], k3.prototype, "readAccumulateAttributes", null), e([r2("accumulateAttributes")], k3.prototype, "writeAccumulateAttributes", null), e([y(t5)], k3.prototype, "apiKey", void 0), e([y({ json: { write: true } })], k3.prototype, "attributeParameterValues", void 0), e([y({ type: String, json: { write: true } })], k3.prototype, "directionsLanguage", void 0), e([r3(r4)], k3.prototype, "directionsLengthUnits", void 0), e([r3(s5)], k3.prototype, "directionsOutputType", void 0), e([r3(f3)], k3.prototype, "directionsStyleName", void 0), e([r3(N, { name: "directionsTimeAttributeName", ignoreUnknown: false })], k3.prototype, "directionsTimeAttribute", void 0), e([y({ type: Boolean, json: { write: true } })], k3.prototype, "findBestSequence", void 0), e([y({ type: Number, json: { write: true } })], k3.prototype, "geometryPrecision", void 0), e([y({ type: Number, json: { write: true } })], k3.prototype, "geometryPrecisionM", void 0), e([y({ type: Number, json: { write: true } })], k3.prototype, "geometryPrecisionZ", void 0), e([y({ type: Boolean, json: { write: true } })], k3.prototype, "ignoreInvalidLocations", void 0), e([r3(y3, { name: "impedanceAttributeName", ignoreUnknown: false })], k3.prototype, "impedanceAttribute", void 0), e([y({ type: Number, json: { write: true } })], k3.prototype, "outputGeometryPrecision", void 0), e([r3(i5)], k3.prototype, "outputGeometryPrecisionUnits", void 0), e([r3(a3)], k3.prototype, "outputLines", void 0), e([y({ type: k, json: { name: "outSR", write: true } })], k3.prototype, "outSpatialReference", void 0), e([y({ json: { write: true } })], k3.prototype, "overrides", void 0), e([y({ json: { name: "barriers", write: true } })], k3.prototype, "pointBarriers", void 0), e([r2("pointBarriers")], k3.prototype, "writePointBarriers", null), e([y({ json: { write: true } })], k3.prototype, "polygonBarriers", void 0), e([r2("polygonBarriers")], k3.prototype, "writePolygonBarrier", null), e([y({ json: { write: true } })], k3.prototype, "polylineBarriers", void 0), e([r2("polylineBarriers")], k3.prototype, "writePolylineBarrier", null), e([y({ type: Boolean, json: { write: true } })], k3.prototype, "preserveFirstStop", void 0), e([y({ type: Boolean, json: { write: true } })], k3.prototype, "preserveLastStop", void 0), e([y({ type: Boolean, json: { write: true } })], k3.prototype, "preserveObjectID", void 0), e([y({ type: [String], json: { name: "restrictionAttributeNames", write: true } })], k3.prototype, "restrictionAttributes", void 0), e([o2("restrictionAttributes")], k3.prototype, "readRestrictionAttributes", null), e([r2("restrictionAttributes")], k3.prototype, "writeRestrictionAttributes", null), e([r3(n3)], k3.prototype, "restrictUTurns", void 0), e([y({ type: Boolean, json: { write: true } })], k3.prototype, "returnBarriers", void 0), e([y({ type: Boolean, json: { write: true } })], k3.prototype, "returnDirections", void 0), e([y({ type: Boolean, json: { write: true } })], k3.prototype, "returnPolygonBarriers", void 0), e([y({ type: Boolean, json: { write: true } })], k3.prototype, "returnPolylineBarriers", void 0), e([y({ type: Boolean, json: { write: true } })], k3.prototype, "returnRoutes", void 0), e([y({ type: Boolean, json: { write: true } })], k3.prototype, "returnStops", void 0), e([y({ type: Boolean, json: { write: true } })], k3.prototype, "returnTraversedEdges", void 0), e([y({ type: Boolean, json: { write: true } })], k3.prototype, "returnTraversedJunctions", void 0), e([y({ type: Boolean, json: { write: true } })], k3.prototype, "returnTraversedTurns", void 0), e([y({ type: Boolean, json: { write: true } })], k3.prototype, "returnZ", void 0), e([y({ type: Date, json: { type: Number, write: true } })], k3.prototype, "startTime", void 0), e([o2("startTime")], k3.prototype, "readStartTime", null), e([r2("startTime")], k3.prototype, "writeStartTime", null), e([y({ type: Boolean, json: { write: true } })], k3.prototype, "startTimeIsUTC", void 0), e([y({ json: { write: true } })], k3.prototype, "stops", void 0), e([o2("stops")], k3.prototype, "readStops", null), e([r2("stops")], k3.prototype, "writeStops", null), e([y({ type: Boolean, json: { write: true } })], k3.prototype, "timeWindowsAreUTC", void 0), e([y({ type: A, json: { write: true } })], k3.prototype, "travelMode", void 0), e([y({ type: Boolean, json: { write: true } })], k3.prototype, "useHierarchy", void 0), e([y({ type: Boolean, json: { write: true } })], k3.prototype, "useTimeWindows", void 0), k3 = O3 = e([n("esri.rest.support.RouteParameters")], k3);
  661. var I = k3;
  662. // node_modules/@arcgis/core/layers/RouteLayer.js
  663. function X(e3) {
  664. return e3.length ? e3 : null;
  665. }
  666. function ee(e3) {
  667. const { defaultTravelMode: t6, supportedTravelModes: r5 } = e3;
  668. return r5 == null ? void 0 : r5.find(({ id: e4 }) => e4 === t6);
  669. }
  670. function te(e3) {
  671. switch (e3) {
  672. case "esriGeometryPoint":
  673. return { type: "esriSMS", style: "esriSMSCircle", size: 12, color: [0, 0, 0, 0], outline: te("esriGeometryPolyline") };
  674. case "esriGeometryPolyline":
  675. return { type: "esriSLS", style: "esriSLSSolid", width: 1, color: [0, 0, 0, 0] };
  676. case "esriGeometryPolygon":
  677. return { type: "esriSFS", style: "esriSFSNull", outline: te("esriGeometryPolyline") };
  678. }
  679. }
  680. function re(e3) {
  681. return "layers" in e3;
  682. }
  683. function oe(e3) {
  684. return "esri.rest.support.FeatureSet" === e3.declaredClass;
  685. }
  686. function ie(e3) {
  687. return "esri.rest.support.NetworkFeatureSet" === e3.declaredClass;
  688. }
  689. function se(e3, t6, r5) {
  690. var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n2, _o, _p, _q, _r, _s, _t, _u, _v;
  691. const o4 = (_a = t6.networkDataset) == null ? void 0 : _a.networkAttributes, i9 = (_b = o4 == null ? void 0 : o4.filter((e4) => "cost" === e4.usageType)) != null ? _b : [], s7 = ee(t6), a8 = (_c = r5.travelMode) != null ? _c : s7;
  692. if (t(a8))
  693. return void we.warn("route-layer:missing-travel-mode", "The routing service must have a default travel mode or one must be specified in the route parameter.");
  694. const { timeAttributeName: l8, distanceAttributeName: c11 } = a8, y8 = i9.find((e4) => e4.name === l8), f7 = i9.find((e4) => e4.name === c11), d3 = (_f = (_e = (_d = e2(r5.travelMode)) == null ? void 0 : _d.impedanceAttributeName) != null ? _e : e2(r5.impedanceAttribute)) != null ? _f : t6.impedance, h3 = t4.fromJSON(y8 == null ? void 0 : y8.units), w4 = r4.fromJSON(f7 == null ? void 0 : f7.units);
  695. if (!h3 || !w4)
  696. throw new s3("routelayer:unknown-impedance-units", "the units of either the distance or time impedance are unknown");
  697. const S4 = (_g = r5.directionsLanguage) != null ? _g : t6.directionsLanguage, g3 = (_i = (_h = e2(r5.accumulateAttributes)) != null ? _h : t6.accumulateAttributeNames) != null ? _i : [], b3 = new Set(i9.filter(({ name: e4 }) => e4 === l8 || e4 === c11 || e4 === d3 || null != e4 && g3.includes(e4)).map(({ name: e4 }) => e4)), v6 = (e4) => {
  698. for (const t7 in e4)
  699. b3.has(t7) || delete e4[t7];
  700. };
  701. for (const n9 of e3.pointBarriers)
  702. r(n9.costs) && (n9.addedCost = (_j = n9.costs[d3]) != null ? _j : 0, v6(n9.costs));
  703. for (const n9 of e3.polygonBarriers)
  704. r(n9.costs) && (n9.scaleFactor = (_k = n9.costs[d3]) != null ? _k : 1, v6(n9.costs));
  705. for (const n9 of e3.polylineBarriers)
  706. r(n9.costs) && (n9.scaleFactor = (_l = n9.costs[d3]) != null ? _l : 1, v6(n9.costs));
  707. const { routeInfo: B } = e3, { findBestSequence: P, preserveFirstStop: j6, preserveLastStop: I2, startTimeIsUTC: N2, timeWindowsAreUTC: _ } = r5;
  708. B.analysisSettings = new l3({ accumulateAttributes: g3, directionsLanguage: S4, findBestSequence: P, preserveFirstStop: j6, preserveLastStop: I2, startTimeIsUTC: N2, timeWindowsAreUTC: _, travelMode: a8 }), B.totalDuration = ae((_m = B.totalCosts[l8]) != null ? _m : 0, h3), B.totalDistance = le((_n2 = B.totalCosts[c11]) != null ? _n2 : 0, w4), B.totalLateDuration = ae((_o = B.totalViolations[l8]) != null ? _o : 0, h3), B.totalWaitDuration = ae((_p = B.totalWait[l8]) != null ? _p : 0, h3), r(B.totalCosts) && v6(B.totalCosts), r(B.totalViolations) && v6(B.totalViolations), r(B.totalWait) && v6(B.totalWait);
  709. for (const n9 of e3.stops)
  710. r(n9.serviceCosts) && (n9.serviceDuration = ae((_q = n9.serviceCosts[l8]) != null ? _q : 0, h3), n9.serviceDistance = le((_r = n9.serviceCosts[c11]) != null ? _r : 0, w4), v6(n9.serviceCosts)), r(n9.cumulativeCosts) && (n9.cumulativeDuration = ae((_s = n9.cumulativeCosts[l8]) != null ? _s : 0, h3), n9.cumulativeDistance = le((_t = n9.cumulativeCosts[c11]) != null ? _t : 0, w4), v6(n9.cumulativeCosts)), r(n9.violations) && (n9.lateDuration = ae((_u = n9.violations[l8]) != null ? _u : 0, h3), v6(n9.violations)), r(n9.wait) && (n9.waitDuration = ae((_v = n9.wait[l8]) != null ? _v : 0, h3), v6(n9.wait));
  711. }
  712. async function ne(e3) {
  713. const t6 = k.WGS84;
  714. return await _n(e3.spatialReference, t6), rn(e3, t6);
  715. }
  716. function ae(e3, t6) {
  717. switch (t6) {
  718. case "seconds":
  719. return e3 / 60;
  720. case "hours":
  721. return 60 * e3;
  722. case "days":
  723. return 60 * e3 * 24;
  724. default:
  725. return e3;
  726. }
  727. }
  728. function le(e3, t6) {
  729. return "decimal-degrees" === t6 || "points" === t6 || "unknown" === t6 ? e3 : E(e3, t6, "meters");
  730. }
  731. function pe(e3) {
  732. const { attributes: t6, geometry: r5, popupTemplate: o4, symbol: i9 } = e3.toGraphic().toJSON();
  733. return { attributes: t6, geometry: r5, popupInfo: o4, symbol: i9 };
  734. }
  735. var ue = j2.ofType(b);
  736. var me = j2.ofType(h);
  737. var ce = j2.ofType(O2);
  738. var ye = j2.ofType(g2);
  739. var fe = j2.ofType(f4);
  740. var de = j2.ofType(D2);
  741. var he = "esri.layers.RouteLayer";
  742. var we = s2.getLogger(he);
  743. var Se = class extends n2(t3(c2(v4(O(a2(b2)))))) {
  744. constructor(e3) {
  745. super(e3), this._cachedServiceDescription = null, this._featureCollection = null, this._type = "Feature Collection", this.defaultSymbols = new y4(), this.directionLines = null, this.directionPoints = null, this.featureCollectionType = "route", this.legendEnabled = false, this.maxScale = 0, this.minScale = 0, this.pointBarriers = new ce(), this.polygonBarriers = new ye(), this.polylineBarriers = new fe(), this.routeInfo = null, this.spatialReference = k.WGS84, this.stops = new de(), this.type = "route";
  746. const t6 = () => {
  747. this._setStopSymbol(this.stops);
  748. };
  749. this.addHandles(a(() => this.stops, "change", t6, { sync: true, onListenerAdd: t6 }));
  750. }
  751. writeFeatureCollectionWebmap(e3, t6, r5, o4) {
  752. const i9 = [this._writePolygonBarriers(), this._writePolylineBarriers(), this._writePointBarriers(), this._writeRouteInfo(), this._writeDirectionLines(), this._writeDirectionPoints(), this._writeStops()].filter((e4) => !!e4), s7 = i9.map((e4, t7) => t7), n9 = "web-map" === o4.origin ? "featureCollection.layers" : "layers";
  753. o(n9, i9, t6), t6.opacity = this.opacity, t6.visibility = this.visible, t6.visibleLayers = s7;
  754. }
  755. readDirectionLines(e3, t6) {
  756. return this._getNetworkFeatures(t6, "DirectionLines", (e4) => b.fromGraphic(e4));
  757. }
  758. readDirectionPoints(e3, t6) {
  759. return this._getNetworkFeatures(t6, "DirectionPoints", (e4) => h.fromGraphic(e4));
  760. }
  761. get fullExtent() {
  762. var _a;
  763. const e3 = new w2({ xmin: -180, ymin: -90, xmax: 180, ymax: 90, spatialReference: k.WGS84 });
  764. if (r(this.routeInfo) && r(this.routeInfo.geometry))
  765. return (_a = this.routeInfo.geometry.extent) != null ? _a : e3;
  766. if (t(this.stops))
  767. return e3;
  768. const t6 = this.stops.filter((e4) => r(e4.geometry));
  769. if (t6.length < 2)
  770. return e3;
  771. const { spatialReference: r5 } = t6.getItemAt(0).geometry;
  772. if (t(r5))
  773. return e3;
  774. const o4 = t6.toArray().map((e4) => {
  775. const t7 = e4.geometry;
  776. return [t7.x, t7.y];
  777. });
  778. return new u({ points: o4, spatialReference: r5 }).extent;
  779. }
  780. readMaxScale(e3, t6) {
  781. var _a, _b;
  782. return (_b = (_a = (re(t6) ? t6.layers : t6.featureCollection.layers).find((e4) => r(e4.layerDefinition.maxScale))) == null ? void 0 : _a.layerDefinition.maxScale) != null ? _b : 0;
  783. }
  784. readMinScale(e3, t6) {
  785. var _a, _b;
  786. return (_b = (_a = (re(t6) ? t6.layers : t6.featureCollection.layers).find((e4) => r(e4.layerDefinition.minScale))) == null ? void 0 : _a.layerDefinition.minScale) != null ? _b : 0;
  787. }
  788. readPointBarriers(e3, t6) {
  789. return this._getNetworkFeatures(t6, "Barriers", (e4) => O2.fromGraphic(e4));
  790. }
  791. readPolygonBarriers(e3, t6) {
  792. return this._getNetworkFeatures(t6, "PolygonBarriers", (e4) => g2.fromGraphic(e4));
  793. }
  794. readPolylineBarriers(e3, t6) {
  795. return this._getNetworkFeatures(t6, "PolylineBarriers", (e4) => f4.fromGraphic(e4));
  796. }
  797. readRouteInfo(e3, t6) {
  798. const r5 = this._getNetworkFeatures(t6, "RouteInfo", (e4) => h2.fromGraphic(e4));
  799. return r5.length > 0 ? r5.getItemAt(0) : null;
  800. }
  801. readSpatialReference(e3, t6) {
  802. var _a, _b, _c, _d, _e;
  803. const r5 = re(t6) ? t6.layers : t6.featureCollection.layers;
  804. if (!r5.length)
  805. return k.WGS84;
  806. const { layerDefinition: o4, featureSet: i9 } = r5[0], s7 = i9.features[0], n9 = (_e = (_d = (_c = (_b = (_a = e2(s7 == null ? void 0 : s7.geometry)) == null ? void 0 : _a.spatialReference) != null ? _b : i9.spatialReference) != null ? _c : o4.spatialReference) != null ? _d : o4.extent.spatialReference) != null ? _e : c;
  807. return k.fromJSON(n9);
  808. }
  809. readStops(e3, t6) {
  810. return this._getNetworkFeatures(t6, "Stops", (e4) => D2.fromGraphic(e4), (e4) => this._setStopSymbol(e4));
  811. }
  812. get title() {
  813. return r(this.routeInfo) && r(this.routeInfo.name) ? this.routeInfo.name : "Route";
  814. }
  815. set title(e3) {
  816. this._overrideIfSome("title", e3);
  817. }
  818. get url() {
  819. return s.routeServiceUrl;
  820. }
  821. set url(e3) {
  822. null != e3 ? this._set("url", S(e3, we)) : this._set("url", s.routeServiceUrl);
  823. }
  824. load(e3) {
  825. return this.addResolvingPromise(this.loadFromPortal({ supportedTypes: ["Feature Collection"] }, e3)), Promise.resolve(this);
  826. }
  827. removeAll() {
  828. this.removeResult(), this.pointBarriers.removeAll(), this.polygonBarriers.removeAll(), this.polylineBarriers.removeAll(), this.stops.removeAll();
  829. }
  830. removeResult() {
  831. r(this.directionLines) && (this.directionLines.removeAll(), this._set("directionLines", null)), r(this.directionPoints) && (this.directionPoints.removeAll(), this._set("directionPoints", null)), r(this.routeInfo) && this._set("routeInfo", null);
  832. }
  833. async save() {
  834. await this.load();
  835. const { fullExtent: e3, portalItem: t6 } = this;
  836. if (!t6)
  837. throw new s3("routelayer:portal-item-not-set", "save() requires to the layer to have a portal item");
  838. if (!t6.id)
  839. throw new s3("routelayer:portal-item-not-saved", "Please use saveAs() first to save the routelayer");
  840. if ("Feature Collection" !== t6.type)
  841. throw new s3("routelayer:portal-item-wrong-type", 'Portal item needs to have type "Feature Collection"');
  842. if (t(this.routeInfo))
  843. throw new s3("routelayer:route-unsolved", "save() requires a solved route");
  844. const { portal: r5 } = t6;
  845. await r5._signIn(), r5.user || await t6.reload();
  846. const { itemUrl: o4, itemControl: i9 } = t6;
  847. if ("admin" !== i9 && "update" !== i9)
  848. throw new s3("routelayer:insufficient-permissions", "To save this layer, you need to be the owner or an administrator of your organization");
  849. const s7 = { messages: [], origin: "portal-item", portal: r5, url: o4 && j3(o4), writtenProperties: [] }, a8 = this.write(null, s7);
  850. return t6.extent = await ne(e3), t6.title = this.title, await t6.update({ data: a8 }), t6;
  851. }
  852. async saveAs(e3, t6 = {}) {
  853. var _a, _b, _c;
  854. if (await this.load(), t(this.routeInfo))
  855. throw new s3("routelayer:route-unsolved", "saveAs() requires a solved route");
  856. const r5 = x.from(e3).clone();
  857. (_a = r5.extent) != null ? _a : r5.extent = await ne(this.fullExtent), r5.id = null, (_b = r5.portal) != null ? _b : r5.portal = j5.getDefault(), (_c = r5.title) != null ? _c : r5.title = this.title, r5.type = "Feature Collection", r5.typeKeywords = ["Data", "Feature Collection", f2.MULTI_LAYER, "Route Layer"];
  858. const { portal: o4 } = r5, i9 = { messages: [], origin: "portal-item", portal: o4, url: null, writtenProperties: [] };
  859. await o4._signIn();
  860. const s7 = t6 == null ? void 0 : t6.folder, a8 = this.write(null, i9);
  861. return await o4.user.addItem({ item: r5, folder: s7, data: a8 }), this.portalItem = r5, i4(i9), i9.portalItem = r5, r5;
  862. }
  863. async solve(e3, t6) {
  864. var _a, _b, _c, _d, _e;
  865. const r5 = (_a = e3 == null ? void 0 : e3.stops) != null ? _a : this.stops, o4 = (_b = e3 == null ? void 0 : e3.pointBarriers) != null ? _b : X(this.pointBarriers), i9 = (_c = e3 == null ? void 0 : e3.polylineBarriers) != null ? _c : X(this.polylineBarriers), a8 = (_d = e3 == null ? void 0 : e3.polygonBarriers) != null ? _d : X(this.polygonBarriers);
  866. if (t(r5))
  867. throw new s3("routelayer:undefined-stops", "the route layer must have stops defined in the route parameters.");
  868. if ((oe(r5) || ie(r5)) && r5.features.length < 2 || j2.isCollection(r5) && r5.length < 2)
  869. throw new s3("routelayer:insufficent-stops", "the route layer must have two or more stops to solve a route.");
  870. if (j2.isCollection(r5))
  871. for (const s7 of r5)
  872. s7.routeName = null;
  873. const l8 = e3 == null ? void 0 : e3.apiKey, m6 = this.url, y8 = await this._getServiceDescription(m6, l8, t6), f7 = ee(y8), h3 = (_e = e3 == null ? void 0 : e3.travelMode) != null ? _e : f7, w4 = l(e3 == null ? void 0 : e3.accumulateAttributes, []);
  874. r(h3) && (w4.push(h3.distanceAttributeName), h3.timeAttributeName && w4.push(h3.timeAttributeName));
  875. const S4 = { startTime: new Date() }, g3 = { accumulateAttributes: w4, directionsOutputType: "featuresets", ignoreInvalidLocations: true, pointBarriers: o4, polylineBarriers: i9, polygonBarriers: a8, preserveFirstStop: true, preserveLastStop: true, returnBarriers: !!o4, returnDirections: true, returnPolygonBarriers: !!a8, returnPolylineBarriers: !!i9, returnRoutes: true, returnStops: true, stops: r5 }, b3 = e3 ? I.from(e3) : new I();
  876. for (const s7 in S4)
  877. null == b3[s7] && (b3[s7] = S4[s7]);
  878. let v6;
  879. b3.set(g3);
  880. try {
  881. v6 = await m5(m6, b3, t6);
  882. } catch (P) {
  883. throw j(P) ? P : new s3("routelayer:failed-route-request", "the routing request failed", { error: P });
  884. }
  885. const B = this._toRouteLayerSolution(v6);
  886. return this._isOverridden("title") || (this.title = l(B.routeInfo.name, "Route")), se(B, y8, b3), B;
  887. }
  888. update(e3) {
  889. const { stops: t6, directionLines: r5, directionPoints: o4, pointBarriers: i9, polylineBarriers: s7, polygonBarriers: n9, routeInfo: a8 } = e3;
  890. this.set({ stops: t6, pointBarriers: i9, polylineBarriers: s7, polygonBarriers: n9 }), this._set("directionLines", r5), this._set("directionPoints", o4), this._set("routeInfo", a8), r(a8.geometry) && (this.spatialReference = a8.geometry.spatialReference);
  891. }
  892. _getNetworkFeatures(e3, t6, n9, a8) {
  893. var _a, _b, _c;
  894. const l8 = (re(e3) ? e3.layers : e3.featureCollection.layers).find((e4) => e4.layerDefinition.name === t6);
  895. if (t(l8))
  896. return new j2();
  897. const { layerDefinition: m6, popupInfo: c11, featureSet: y8 } = l8, f7 = m6.drawingInfo.renderer, { features: d3 } = y8, h3 = (_c = (_b = (_a = y8.spatialReference) != null ? _a : m6.spatialReference) != null ? _b : m6.extent.spatialReference) != null ? _c : c, w4 = f7 && o3(f7), S4 = k.fromJSON(h3), g3 = d3.map((e4) => {
  898. var _a2, _b2, _c2;
  899. const i9 = g.fromJSON(e4);
  900. r(i9.geometry) && r(e4.geometry) && t(e4.geometry.spatialReference) && (i9.geometry.spatialReference = S4);
  901. const s7 = n9(i9);
  902. return (_b2 = s7.symbol) != null ? _b2 : s7.symbol = (_a2 = w4 == null ? void 0 : w4.getSymbol(i9)) != null ? _a2 : this._getNetworkSymbol(t6), (_c2 = s7.popupTemplate) != null ? _c2 : s7.popupTemplate = c11 && k2.fromJSON(c11), s7;
  903. });
  904. return a8 && g3.some((e4) => !e4.symbol) && a8(g3), new j2(g3);
  905. }
  906. _getNetworkSymbol(e3) {
  907. switch (e3) {
  908. case "Barriers":
  909. return this.defaultSymbols.pointBarriers;
  910. case "DirectionPoints":
  911. return this.defaultSymbols.directionPoints;
  912. case "DirectionLines":
  913. return this.defaultSymbols.directionLines;
  914. case "PolylineBarriers":
  915. return this.defaultSymbols.polylineBarriers;
  916. case "PolygonBarriers":
  917. return this.defaultSymbols.polygonBarriers;
  918. case "RouteInfo":
  919. return this.defaultSymbols.routeInfo;
  920. case "Stops":
  921. return null;
  922. }
  923. }
  924. async _getServiceDescription(e3, t6, r5) {
  925. if (r(this._cachedServiceDescription) && this._cachedServiceDescription.url === e3)
  926. return this._cachedServiceDescription.serviceDescription;
  927. const o4 = await p3(e3, t6, r5);
  928. return this._cachedServiceDescription = { serviceDescription: o4, url: e3 }, o4;
  929. }
  930. _setStopSymbol(e3) {
  931. if (!e3 || 0 === e3.length)
  932. return;
  933. if (t(this.defaultSymbols.stops))
  934. return;
  935. if (e3.every((e4) => r(e4.symbol)))
  936. return;
  937. const { first: t6, last: r5, middle: o4, unlocated: i9, waypoint: s7, break: n9 } = this.defaultSymbols.stops;
  938. if (t(this.routeInfo) || 1 === e3.length)
  939. return void e3.forEach((i10, s8) => {
  940. switch (s8) {
  941. case 0:
  942. i10.symbol = t6;
  943. break;
  944. case e3.length - 1:
  945. i10.symbol = r5;
  946. break;
  947. default:
  948. i10.symbol = o4;
  949. }
  950. });
  951. const a8 = e3.map((e4) => e4.sequence).filter((e4) => r(e4)), l8 = Math.min(...a8), m6 = Math.max(...a8);
  952. for (const p8 of e3)
  953. p8.sequence !== l8 ? p8.sequence !== m6 ? "ok" === p8.status || "not-located-on-closest" === p8.status ? "waypoint" !== p8.locationType ? "break" !== p8.locationType ? p8.symbol = o4 : p8.symbol = n9 : p8.symbol = s7 : p8.symbol = i9 : p8.symbol = r5 : p8.symbol = t6;
  954. }
  955. _toRouteLayerSolution(e3) {
  956. var _a, _b, _c, _d, _e;
  957. const t6 = e3.routeResults[0].stops.map((e4) => D2.fromJSON(e4.toJSON()));
  958. this._setStopSymbol(t6);
  959. const r5 = new de(t6), o4 = new ye((_a = e3.polygonBarriers) == null ? void 0 : _a.map((e4) => {
  960. const t7 = g2.fromJSON(e4.toJSON());
  961. return t7.symbol = this.defaultSymbols.polygonBarriers, t7;
  962. })), i9 = new fe((_b = e3.polylineBarriers) == null ? void 0 : _b.map((e4) => {
  963. const t7 = f4.fromJSON(e4.toJSON());
  964. return t7.symbol = this.defaultSymbols.polylineBarriers, t7;
  965. })), s7 = new ce((_c = e3.pointBarriers) == null ? void 0 : _c.map((e4) => {
  966. const t7 = O2.fromJSON(e4.toJSON());
  967. return t7.symbol = this.defaultSymbols.pointBarriers, t7;
  968. })), n9 = h2.fromJSON(e3.routeResults[0].route.toJSON());
  969. n9.symbol = this.defaultSymbols.routeInfo;
  970. const a8 = new me((_d = e3.routeResults[0].directionPoints) == null ? void 0 : _d.features.map((e4) => {
  971. const t7 = h.fromJSON(e4.toJSON());
  972. return t7.symbol = this.defaultSymbols.directionPoints, t7;
  973. }));
  974. return { directionLines: new ue((_e = e3.routeResults[0].directionLines) == null ? void 0 : _e.features.map((e4) => {
  975. const t7 = b.fromJSON(e4.toJSON());
  976. return t7.symbol = this.defaultSymbols.directionLines, t7;
  977. })), directionPoints: a8, pointBarriers: s7, polygonBarriers: o4, polylineBarriers: i9, routeInfo: n9, stops: r5 };
  978. }
  979. _writeDirectionLines() {
  980. return this._writeNetworkFeatures(this.directionLines, this.defaultSymbols.directionLines, "esriGeometryPolyline", b.fields, b.popupInfo, "DirectionLines", "Direction Lines");
  981. }
  982. _writeDirectionPoints() {
  983. return this._writeNetworkFeatures(this.directionPoints, this.defaultSymbols.directionPoints, "esriGeometryPoint", h.fields, h.popupInfo, "DirectionPoints", "Direction Points");
  984. }
  985. _writeNetworkFeatures(e3, t6, r5, o4, i9, s7, n9) {
  986. if (t(e3) || !e3.length)
  987. return null;
  988. const a8 = this.spatialReference.toJSON(), { fullExtent: l8, maxScale: m6, minScale: c11 } = this;
  989. return { featureSet: { features: e3.toArray().map((e4) => pe(e4)), geometryType: r5, spatialReference: a8 }, layerDefinition: { capabilities: "Query,Update,Editing", drawingInfo: { renderer: { type: "simple", symbol: r(t6) ? t6.toJSON() : te(r5) } }, extent: l8.toJSON(), fields: o4, geometryType: r5, hasM: false, hasZ: false, maxScale: m6, minScale: c11, name: s7, objectIdField: "ObjectID", spatialReference: a8, title: n9, type: "Feature Layer", typeIdField: "" }, popupInfo: i9 };
  990. }
  991. _writePointBarriers() {
  992. return this._writeNetworkFeatures(this.pointBarriers, this.defaultSymbols.pointBarriers, "esriGeometryPoint", O2.fields, O2.popupInfo, "Barriers", "Point Barriers");
  993. }
  994. _writePolygonBarriers() {
  995. return this._writeNetworkFeatures(this.polygonBarriers, this.defaultSymbols.polygonBarriers, "esriGeometryPolygon", g2.fields, g2.popupInfo, "PolygonBarriers", "Polygon Barriers");
  996. }
  997. _writePolylineBarriers() {
  998. return this._writeNetworkFeatures(this.polylineBarriers, this.defaultSymbols.polylineBarriers, "esriGeometryPolyline", f4.fields, f4.popupInfo, "PolylineBarriers", "Line Barriers");
  999. }
  1000. _writeRouteInfo() {
  1001. return this._writeNetworkFeatures(r(this.routeInfo) ? new j2([this.routeInfo]) : null, this.defaultSymbols.routeInfo, "esriGeometryPolyline", h2.fields, h2.popupInfo, "RouteInfo", "Route Details");
  1002. }
  1003. _writeStops() {
  1004. const e3 = this._writeNetworkFeatures(this.stops, null, "esriGeometryPoint", D2.fields, D2.popupInfo, "Stops", "Stops");
  1005. if (t(e3))
  1006. return null;
  1007. const { stops: t6 } = this.defaultSymbols, r5 = r(t6) && r(t6.first) && t6.first.toJSON(), o4 = r(t6) && r(t6.middle) && t6.middle.toJSON(), i9 = r(t6) && r(t6.last) && t6.last.toJSON();
  1008. return e3.layerDefinition.drawingInfo.renderer = { type: "uniqueValue", field1: "Sequence", defaultSymbol: o4, uniqueValueInfos: [{ value: "1", symbol: r5, label: "First Stop" }, { value: `${this.stops.length}`, symbol: i9, label: "Last Stop" }] }, e3;
  1009. }
  1010. };
  1011. e([y({ readOnly: true, json: { read: false, origins: { "portal-item": { write: { allowNull: true, ignoreOrigin: true } }, "web-map": { write: { overridePolicy() {
  1012. return { allowNull: true, ignoreOrigin: null == this.portalItem };
  1013. } } } } } })], Se.prototype, "_featureCollection", void 0), e([r2(["web-map", "portal-item"], "_featureCollection")], Se.prototype, "writeFeatureCollectionWebmap", null), e([y({ readOnly: true, json: { read: false, origins: { "web-map": { write: { target: "type", overridePolicy() {
  1014. return { ignoreOrigin: null != this.portalItem };
  1015. } } } } } })], Se.prototype, "_type", void 0), e([y({ nonNullable: true, type: y4 })], Se.prototype, "defaultSymbols", void 0), e([y({ readOnly: true })], Se.prototype, "directionLines", void 0), e([o2(["web-map", "portal-item"], "directionLines", ["layers", "featureCollection.layers"])], Se.prototype, "readDirectionLines", null), e([y({ readOnly: true })], Se.prototype, "directionPoints", void 0), e([o2(["web-map", "portal-item"], "directionPoints", ["layers", "featureCollection.layers"])], Se.prototype, "readDirectionPoints", null), e([y({ readOnly: true, json: { read: false, origins: { "web-map": { write: { ignoreOrigin: true } } } } })], Se.prototype, "featureCollectionType", void 0), e([y({ readOnly: true })], Se.prototype, "fullExtent", null), e([y({ json: { origins: { "web-map": { name: "featureCollection.showLegend" } }, write: true } })], Se.prototype, "legendEnabled", void 0), e([y({ type: ["show", "hide"] })], Se.prototype, "listMode", void 0), e([y({ type: Number, nonNullable: true, json: { write: false } })], Se.prototype, "maxScale", void 0), e([o2(["web-map", "portal-item"], "maxScale", ["layers", "featureCollection.layers"])], Se.prototype, "readMaxScale", null), e([y({ type: Number, nonNullable: true, json: { write: false } })], Se.prototype, "minScale", void 0), e([o2(["web-map", "portal-item"], "minScale", ["layers", "featureCollection.layers"])], Se.prototype, "readMinScale", null), e([y({ type: ["ArcGISFeatureLayer"], value: "ArcGISFeatureLayer" })], Se.prototype, "operationalLayerType", void 0), e([y({ nonNullable: true, type: j2.ofType(O2) })], Se.prototype, "pointBarriers", void 0), e([o2(["web-map", "portal-item"], "pointBarriers", ["layers", "featureCollection.layers"])], Se.prototype, "readPointBarriers", null), e([y({ nonNullable: true, type: j2.ofType(g2) })], Se.prototype, "polygonBarriers", void 0), e([o2(["web-map", "portal-item"], "polygonBarriers", ["layers", "featureCollection.layers"])], Se.prototype, "readPolygonBarriers", null), e([y({ nonNullable: true, type: j2.ofType(f4) })], Se.prototype, "polylineBarriers", void 0), e([o2(["web-map", "portal-item"], "polylineBarriers", ["layers", "featureCollection.layers"])], Se.prototype, "readPolylineBarriers", null), e([y({ readOnly: true })], Se.prototype, "routeInfo", void 0), e([o2(["web-map", "portal-item"], "routeInfo", ["layers", "featureCollection.layers"])], Se.prototype, "readRouteInfo", null), e([y({ type: k })], Se.prototype, "spatialReference", void 0), e([o2(["web-map", "portal-item"], "spatialReference", ["layers", "featureCollection.layers"])], Se.prototype, "readSpatialReference", null), e([y({ nonNullable: true, type: j2.ofType(D2) })], Se.prototype, "stops", void 0), e([o2(["web-map", "portal-item"], "stops", ["layers", "featureCollection.layers"])], Se.prototype, "readStops", null), e([y()], Se.prototype, "title", null), e([y({ readOnly: true, json: { read: false } })], Se.prototype, "type", void 0), e([y()], Se.prototype, "url", null), Se = e([n(he)], Se);
  1016. var ge = Se;
  1017. export {
  1018. ge as default
  1019. };
  1020. //# sourceMappingURL=RouteLayer-3ZJ4UGAZ.js.map