// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.23/esri/copyright.txt for details.
//>>built
define("esri/tasks/NARouteSharing","dojo/_base/declare dojo/_base/array dojo/json dojo/Deferred dojo/promise/all dojo/_base/lang dojo/i18n!../nls/jsapi dojo/number ../request ../graphic ../renderers/SimpleRenderer ../renderers/UniqueValueRenderer ../symbols/PictureMarkerSymbol ../symbols/SimpleMarkerSymbol ../symbols/SimpleLineSymbol ../arcgis/Portal ../tasks/RouteParameters ../tasks/RouteResult ../SpatialReference ../tasks/FeatureSet ../tasks/GeometryService ../tasks/ProjectParameters ../geometry/webMercatorUtils".split(" "),
function(T,O,z,y,C,n,t,U,D,P,x,A,u,E,F,V,W,X,G,K,Y,Z,Q){return T(null,{declaredClass:"esri.tasks.NARouteSharing",portal:null,outSR:null,firstStopSymbol:{angle:0,xoffset:0,yoffset:9,type:"esriPMS",width:17,height:24,imageData:"iVBORw0KGgoAAAANSUhEUgAAABYAAAAgCAYAAAAWl4iLAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAADLElEQVRIS42WP2vbQBjG/VUyatR4640aNWormoroEEyGYryYksEYDyZ4MMGDIR4MzhBwhkCngDsE3KGQDh3yMTJen+c9nXQ6ndMKHlt+7/TTe++fOw+MMWd1/Hk0s/sbU62GpliUJp8Wck/b4eU7psSfo6LG/fNBIPo6M+lUGbXQRm8yUYr79FphTJvsOjecGz5P9Qz0SE0AWmcmfygaZdQ9lRu9o/CSJV4yVqZaVni0y+n8qFYVvIEnO8AesXRfD2UD1zVcEb7WJpmkEiqf1ULxVjUFlB56wMK7pyy8Bast4BvAER7fc/m4e7qTJfEBWXoNLJ6qVg7e8boGbxGStRLG7eOtwAXMJCjE1HnrQ0soW2Mcq1EIk17ZeY3XACuC6fUSiR5rC6a3EgLf2ycLznelSa8w+Uqb0WYk4n1yiapglTThsOB0oyTe9NrGFtnl8lowl16Z5EuKmp3Rg85FG8f0thtnAc9tIgd6jAGGIQDreWaKuWQ6enGM9dwDr2w4BvxgIkIwQ3B4keKPXhxLLtMeWPRVAcxmQKxCMJd6enutMf2LY8lnB25jTDHJA9ItGPKSR/v+eV9j+hfHJLERMMvOxhhLkXDUYEovEPdJXmP6l55g+dxHGAa/KlDPEmOp4VU/zhS9ZtW8v7/XOCP3tNHbpkEEWoNRyxleOpjtZiadB+FwcHynyMHFp0S8p3jPpWoAY4lLpqnUu3QeE9iEI4RDGet1CYjbPjHHedtpjrqtuVcLeLT9JpsIvfbhPREo0LAxLPgCXTdcjxixdnfLpnWsfbjIAn1o1NuFTdrrHynRFnz8fZRMswvtwzWoA6QctPXWdZt/XDVgqoXTc+8FDvifUKoDpghnCfLYEVAAbJcPKJZPR2IHa+eHrxwxF7gPDKFornOndc/gdHo72VMaCXWwBsrlo0TPQamo0Wn/4yBbYwtta/Xcse8UNfoql6Vs3oSKsD8M8RchnBcqavTFZLKtnbcMz/HXCUPx+U5RYygeNUwWPWeXhuMxRY2hbnY3dovEocsVhOMxRY2h2KaaG5XXsv9S1BhTiT04/Bv1kaLGmFhet/gPEtrjMoO/bgAlOuupzJ0AAAAASUVORK5CYII\x3d",
contentType:"image/png"},interimStopSymbol:{angle:0,xoffset:0,yoffset:9,type:"esriPMS",width:17,height:24,imageData:"iVBORw0KGgoAAAANSUhEUgAAABYAAAAgCAYAAAAWl4iLAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAC4klEQVRIS5WWMYujQBiG/RnbprS0tE2ZMmVaS6slpBCxEbEIYYsQtljCFQemWLA5yBYHXnPgFgfZ4sAtDrLl/ozv3m/G0RkzXnLFs5t8jk9eP2dGHSIapX6rafO8o/Apo8XDkubrgMLHTNSOvyoMsZ/HXBTOH2cqf5Y0zwOaJiG5UUZeuid/XZEH3GRP7iojH8dmaYCxR5xmOhjjS/PeIFFMfhSQn5c0fTwb+FuJ98A05KYleauAApyje5he+ueMAUvyopim25MQzZ56bHJ33dAkr2myitGqEBqLONhCmmQXwiFK3qUWcoD26MnFn/1LIS7J3zadeP5F8dl91sVS3ovv0hN6H9L+ZS/kaEEjboKXH420UvhJi6/yP6OO6am7xCxPjrg/CykuviMtWsADzbRSqpByu9hV4pRbEovUDvfFTYsLMcsC5qDLL8Uei7t2gKigYBuTw9G9vBqIpYilCpX6qjiBC07HX0GMAbeJb0gM3HuIvSi0iGUrlFx9Hu3xQOxFS4itifvUvXRczFIzcdD2eH0yxLq8p5Ua4j7tpJXyfOb2OjyH3RTzDwPtcomqKanP/TUWSAvm8iwPyckOO+xge6MdulxHHGsDjPX3brWjDNuqU73y9MDKwwBOocv5sjthiy1tLz7hxgVUv9dyw+CtkjcRlVrI9R9g2jozmvY+pviwkUua/zDTRPZal9vg49a0UYnNPxBSQ1z9rkVLXOyv8mSI1I+033WpkVasNtmCCzFTd3JOjok+pBUaaS1SxhAzLJ8mCzzbik4ypJPi8qeYrkMpY3zR4fk9wTPNJrwmZS4KitMHVhAucZJWplD1FDdqTMpYi4rj6xGPm6W2XBmeqyFVb//5XjGEH7K8eSvxBKtUzdV/YS3q8OVyQpWW+zocY8NaHCJTl9gHbkvLWItDCrxyudFGPHR5IQ2P27AWbfAs0JfsNaxFG+ETXqPQkmF9DGvRRvmjpN03+ZZzHXL+Atsof8D3QNX7AAAAAElFTkSuQmCC",
contentType:"image/png"},lastStopSymbol:{angle:0,xoffset:0,yoffset:9,type:"esriPMS",width:17,height:24,imageData:"iVBORw0KGgoAAAANSUhEUgAAABYAAAAgCAYAAAAWl4iLAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAADBklEQVRIS62WsWvbQBTG9Sdk9OrRWwwZbMhiQwYbPNiQwYYMJmQIxYOHDiFr6djJo+lQULfLUFCHgrIU1KFwHQoetebPeP2+J519ks9uSBL4YutJ99O77969cyQiB2W/G0k/fZBkeS1mPpF42sf3mcY2PxI8Eh5HBYP5YyJmOpR40BZz3pCk15Rs0JLsoikJrs3ZicS9lsTjrtgHgyH7jL2AWVzrIII20y7Uls1lqTFio5bYQVMsXpZ2TmTdaYq5nWFolVO5SBYzMRhgCbsC1Jd7AeCWcGRvew3JAI8xgzp8+8UQeoGMCJn3Jadu+vp9M6/BXdaEwxoLuDmDRR5c/9mva0y/WUy9BOa31LD4dC9w8HG7kjXBmnkHM/i8UriC48u+ZHhwBx1KisFbjaiWpPA9way4mMk5BJADUyksWeO+gpmt4UIhGwfNF0NZnTa0vI6Jz3ARnR2FJcgeWau3zIQ+KhjQfDmRFTx7+mv59uDf0++sAHs+UwkX8mYCG1CrGaarNjDbJfT+5eCstCNao2bVhi14Ivnd7MVgirUdxWWJbf19AzArbJfxG4KLjOGxZdH7VrzGY4gu7NfwK6uCtWzAjNgCU9wM1XH68f6oQuDkFHDci3K8mXZUt/MQfQNdC1PSTyyGCruNbdRgx8WYUQxIsfMKMG1Y45nsIS672t07HcSsffhWuGZc75e9QhsRs/W2tMGLyCJTwfkfK/GoW3jtw0vtoJBrnbXu5vpEXqzLrm3mj6laYpkNIfqC8rMGrWQLMHcbDwf/uNqCqfxXAdfM9fRwAlChEKFetiEoVQFTNJ62aGMizMk/lspsOX1d+MDBWrlw0kphfQPggEEo+vSh03ov4LT5WdpCEIEeNGO5sccc+QkQDDrpIcBGrsASCl9jlKb9Fj72nYJBX2aOY4obgGUF8ThytXpMwaAvTlczLHcW7eEa1J+rKxisy1whaywWj53nZEsFg3XxcNQ+AZ+PLZivYDAkVoE72p+jYDAk/aUES+rxQwoGQ2J5ZV+KXzn/l0T/AJfvVAR5fRz8AAAAAElFTkSuQmCC",
contentType:"image/png"},unlocatedStopSymbol:{angle:0,xoffset:0,yoffset:9,type:"esriPMS",width:17,height:24,imageData:"iVBORw0KGgoAAAANSUhEUgAAABYAAAAgCAYAAAAWl4iLAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAACiUlEQVRIS42VMWvcQBCF77+a/IDgKhxuwuEiCBfhSBGOFIFLEZCLwKUI2E3AKQJOEbgUgUuRwj9jM9+TZhmtxoqLZ+tmd799ejuSVqWURe3f78v2zbZ0r7qyuex0Te3w6WDD+RqUFvvrgyDAtq+3Zfd2V/Yf9gLWTV5uJOa269GsAGhzuRHo5suNdPh8GGQu++u+9B97jbPJ+mKtzVvO5AcTuqtOkJtbg0b5Bg2cu8E5dxFZEygCcvf1bqYM7vHs3u1qbBMwu3P7LBToW6IIj65HMFpfEGEvuMBAmeTQ++/3M1X46HoSxwj2zAVmMEYg0I9BWmAZch1dcw6ojQMNB98P2TIQ3R5/HjXp7NmZJPjomvleB96CGe+uthaDejHEYO4AH38Z3IARHn9zWFnOHofAbQxAT79P5fTnNIFV6NiSGRitXwCmGwLY3QJ9+PugDdjcoSyaHWADZv6KFllyTIbRLeJ2Fx17FEyagM01YBY5TJ1guUb4MtheNgzWwxvjiE6BUmec6CrcOqAFsyFz9FqkoDhGsPcteQpqvwW2zZnHwvPn50OrNe3GfA68PnnxcRbcBMSvqQs8HhxAubX/DkXEwPjwAjL78ekTZNzAr93t0rsCg7D0SPNncD1kXeGNKtTcZG83jPl7YgJmATuyQJBWDTTGoAMbu2sGRhWOcwNFOVTgEYrbDIomYCS4TWSRYC6HBrfcfgZFkx9RZC54BD4RimaFKGIB4kCH0qdLUJQWXYA8c2UKlLYy6GOffVdajNJH0g6IWBBPlvfqktJiFLeLw/oQ2HU7J1NabOWf9qe6RWmxFR9H4GjpwKLSYiYiiI/s/5QWMykKc9zWH1NazER70XZtPVdZ/QN2IySZrUmdSgAAAABJRU5ErkJggg\x3d\x3d",
contentType:"image/png"},waypointSymbol:{color:[255,255,255,255],size:10,angle:0,xoffset:0,yoffset:0,type:"esriSMS",style:"esriSMSCircle",outline:{color:[20,89,127,255],width:2.5,type:"esriSLS",style:"esriSLSSolid"}},directionSymbol:{color:[0,122,194,255],width:6,type:"esriSLS",style:"esriSLSSolid"},directionPointSymbol:{color:[100,100,255,255],size:12,type:"esriSMS",style:"esriSMSCircle",outline:{color:[255,255,255,255],width:2,type:"esriSLS",style:"esriSLSSolid"}},directionEventSymbol:{color:[100,
255,100,255],size:8,type:"esriSMS",style:"esriSMSCircle",outline:{color:[0,69,0,255],width:1,type:"esriSLS",style:"esriSLSSolid"}},directionLineSymbol:{color:[0,122,194,255],width:6,type:"esriSLS",style:"esriSLSSolid"},routeSymbol:{color:[20,89,127,255],width:8,type:"esriSLS",style:"esriSLSSolid"},barrierRenderer:new A({type:"uniqueValue",field1:"BarrierType",defaultSymbol:{type:"esriPMS",imageData:"iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAByklEQVRIS7WVPU4DMRCF9yhwjEg05BiRKFBOgSIalCOkilYUSDkCDVJokHKE0CUFRY5h5hvbg71MYDeBJ739GXt+/MbebUIIP3L7vg2zu1lol22Y3EyM7XIR1i/PMsX3y3SNEOfx9TisnlZht9+JqQa2zdsmtI+tFiBw43wzUDHVrl/X8toBiY4kG12NAr6CKl71kquucC/VYWNq5sVltDGWcPg4uKuxB4i2BirtBvZIsmK1JCl7oxdIcNMah26g35hWQ4xUqBh1JEpjmpOk69yXKQZJslRi7UjTR5ZjRK6ELJVYQ8OLgrvnOIS3Uw3FFtYEHBjTnkHPaQjTKthVyNQkrSIYLCYNQi6u8J1J4xsuhk4Vg1CuPjWb3n41uNw95yZIkk/FVkuUd9C5CRJUouoMlJNOJUUmaJP1c5z78MfblB0qlv85aPOHuX5dxRplssMm+9d17sMkNZJXnwrIP8AO3ClS5QIFSXIx6kh8YDmVVCQ74XNNcBQRyKDOiA8wJ7GVcJdfpjaOQGVQkpeHVEBwGiuwmPaQuZMkyGU7qwT9cUBBvX6ZJVmmViTaev9ngmozZU5uqEfXmElFcUWLGEiIhJCgpdY+Q/MJtbNzCJoj+q0AAAAASUVORK5CYII\x3d",
contentType:"image/png",width:18,height:18},uniqueValueInfos:[{value:"2",symbol:{type:"esriPMS",imageData:"iVBORw0KGgoAAAANSUhEUgAAABkAAAAYCAYAAAAPtVbGAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAABuklEQVRIS7WVsUrEQBCGfQwLC30MwUbLA19AsBArCb6EHBZHHuGwOEgj5BFyzUF8Ay2Es7C4B7CwsBjnn80su5vJmogufMnsn81k/91JskdEo9m+PvPJvpbDFIeY38+puCk47F/LYYoW1WpJ7VNLu/cd4WHp9RymaFHcigNpXWyOszDFFHVB64boYSlupiybKaaUi5JP3E7PiA6PJIQ2thBMMcS7YAcyHEx0Y4ohkQt9yMG+SLjWYAmD8RamqKCKMGNaVdxjKWSCG1NUfEVhH+64bL84Bog7N+2m/dGNKQLMMHLhErmGGNrVtYyZnc+gRveHmCKIXGAYNl6bFkFXafVjlXVjit06xxWVLpfqnZvc3vQE1L6vKE0ELi+IPj4diFXH3rxt2U096KYndOsbz1Z54ZcPpLq6GfjcRB3MBOsrLU0EMFPd9BC4kXttN1HHu+CZ9RIB7FG4TyEZNz5wLmoO0WNpKqg0zoFPED5FyKL4wFfUkIuh6go5OZYUqRs54Mnigqukd6Pi1to1xNYYYLiRQ7ngmaGFH8GUMU6A4Sb+IVk3/QbOFb6g0W/1r5u6kbJF5z9A7mbd0Deb57AijFvMOAAAAABJRU5ErkJggg\x3d\x3d",
contentType:"image/png",width:19,height:18}}]}),polylineBarrierRenderer:new A({type:"uniqueValue",field1:"BarrierType",defaultSymbol:{color:[255,0,0,184],width:7.5,type:"esriSLS",style:"esriSLSSolid"},uniqueValueInfos:[{value:"1",symbol:{color:[255,85,0,184],width:7.5,type:"esriSLS",style:"esriSLSSolid"}}]}),polygonBarrierRenderer:new A({type:"uniqueValue",field1:"BarrierType",defaultSymbol:{color:[255,0,0,156],outline:{color:[255,0,0,153],width:2.4,type:"esriSLS",style:"esriSLSSolid"},type:"esriSFS",
style:"esriSFSSolid"},uniqueValueInfos:[{value:"1",symbol:{color:[255,170,0,156],outline:{color:[255,0,0,153],width:7.5,type:"esriSLS",style:"esriSLSSolid"},type:"esriSFS",style:"esriSFSSolid"}}]}),_geometryService:null,_jsonStringFieldSize:1048576,constructor:function(c,a){c&&(this.portal=new V.Portal(c),this._outSR=a)},getFolders:function(){return this.portal?this.portal.signIn().then(n.hitch(this,function(){return this.portal.getPortalUser().getFolders()},!1)).then(n.hitch(this,function(c){var a=
this.portal.getPortalUser();c=c||[];c.splice(0,0,{created:a.created,portal:this.portal,title:a.username+" ("+t.networkAnalysis.sharing.rootFolder+")",url:a.userContentUrl});return c})):[]},canCreateItem:function(){var c=new y;this.portal?this.portal.signIn().then(n.hitch(this,function(){c.resolve(-1<(this.portal.getPortalUser().privileges||[]).indexOf("portal:user:createItem"))}),c.reject):c.reject(Error("No URL to a Portal instance or ArcGIS Online was specified at construction time."));return c.promise},
toMinutes:function(c,a,e){c=c||0;switch(a){case "esriNAUSeconds":c/=Math.pow(60,e?-1:1);break;case "esriNAUHours":c*=Math.pow(60,e?-1:1);break;case "esriNAUDays":c*=Math.pow(1440,e?-1:1)}return c},fromMinutes:function(c,a){return this.toMinutes(c,a,!0)},toMeters:function(c,a,e){c=c||0;switch((a||"").replace("esriNAU","esri")){case "esriInches":c*=Math.pow(.0254,e?-1:1);break;case "esriFeet":c*=Math.pow(.3048,e?-1:1);break;case "esriYards":c*=Math.pow(.9144,e?-1:1);break;case "esriMiles":c*=Math.pow(1609.344,
e?-1:1);break;case "esriNauticalMiles":c*=Math.pow(1851.995396854,e?-1:1);break;case "esriMillimeters":c/=Math.pow(1E3,e?-1:1);break;case "esriCentimeters":c/=Math.pow(100,e?-1:1);break;case "esriKilometers":c*=Math.pow(1E3,e?-1:1);break;case "esriDecimeters":c/=Math.pow(10,e?-1:1)}return c},fromMeters:function(c,a){return this.toMeters(c,a,!0)},toGeolocalTime:function(c,a){return void 0===c||null===c?void 0:c+6E4*(a||0)},toUTCTime:function(c,a){-22091616E5===c&&(c=void 0);return null!==a&&void 0!==
a?c-6E4*a:c},getUTCOffset:function(c,a){return null!==a&&void 0!==a&&0<a?(c-a)/60/1E3:void 0},getAttributeUnits:function(c,a){for(var e=a.networkDataset.networkAttributes,h,b=0;b<e.length;b++)if(e[b].name===c&&"esriNAUTCost"===e[b].usageType){h=e[b].units;break}return h},addAttributePrefix:function(c,a){var e={},h;for(h in c)c.hasOwnProperty(h)&&(e[a+h]=c[h]);return e},project:function(c,a,e){var h=new y;if(c&&c.length&&a&&e&&a.wkid!==e.wkid){var b=a instanceof G?a:new G(a),g=e instanceof G?e:new G(e);
if(Q.canProject(b,g))O.forEach(c,function(a,d){a.geometry&&(a.geometry.spatialReference||(a.geometry.spatialReference=b.toJson()),a=new P(a),a.setGeometry(Q.project(a.geometry,g)),c[d]=a.toJson())}),h.resolve(c);else if(!this._geometryService&&this.portal&&this.portal.helperServices.geometry&&(this._geometryService=new Y(this.portal.helperServices.geometry.url)),this._geometryService){var d=n.hitch(this,function(a,b){var d=new Z,e=new y;d.outSR=g;d.geometries=[a.geometry];this._geometryService.project(d).then(n.hitch(this,
function(d){a.setGeometry(d[0]);c[b]=a.toJson();e.resolve()}),e.reject);return e.promise}),f=[];O.forEach(c,n.hitch(this,function(a,c){a.geometry&&(a.geometry.spatialReference||(a.geometry.spatialReference=b.toJson()),f.push(d(new P(a),c)))}));C(f).then(h.resolve,h.reject)}else h.resolve(c)}else h.resolve(c);return h.promise},load:function(c,a){var e=new y,h=n.hitch(this,this.fromMeters),b=n.hitch(this,this.fromMinutes),g=n.hitch(this,this.addAttributePrefix);this.portal?this.portal.signIn().then(n.hitch(this,
function(){var d=this.portal.getPortalUser(),f=d.userContentUrl.replace(/\/users\/.+\/?$/,"/items/");D({url:f+c,content:{f:"json"},callbackParamName:"callback"}).then(n.hitch(this,function(k){D({url:f+c+"/data",content:{f:"json"},callbackParamName:"callback"}).then(n.hitch(this,function(c){var f=function(a){for(var b=0;b<c.layers.length;b++)if(c.layers[b].layerDefinition.name===a)return c.layers[b]},m=f("Directions"),R=m&&m.featureSet.features||[],r=f("DirectionEvents"),S=r&&r.featureSet.features||
[],u=f("DirectionPoints"),v=u&&u.featureSet.features||[],q=(r=f("DirectionLines"))&&r.featureSet.features||[],J=f("Stops"),w=J&&J.featureSet.features||[],L=(r=f("PolygonBarriers"))&&r.featureSet.features||[],M=(r=f("PolylineBarriers"))&&r.featureSet.features||[],y=(r=f("Barriers"))&&r.featureSet.features||[],H=(f=f("RouteInfo"))&&f.featureSet.features,r=w&&w.length?J.featureSet.spatialReference||w[0].geometry.spatialReference:null,B=this._outSR?this._outSR:r,x=[this.project(R,r,this._outSR),this.project(S,
r,this._outSR),this.project(v,r,this._outSR),this.project(q,r,this._outSR),this.project(w,r,this._outSR),this.project(L,r,this._outSR),this.project(M,r,this._outSR),this.project(y,r,this._outSR),this.project(H,r,this._outSR)],I=f&&f.layerDefinition&&[{geometry:f.layerDefinition.extent}];I&&x.push(this.project(I,r,this._outSR));C(x).then(n.hitch(this,function(){H=H&&H[0];I=I&&I[0].geometry;var c=H&&H.attributes,f=c?z.parse(c.AnalysisSettings):void 0,l=f?f.travelMode.timeAttributeName:void 0,r=f?f.travelMode.distanceAttributeName:
void 0,p=this.getAttributeUnits(l,a),x=this.getAttributeUnits(r,a),A=a.directionsLengthUnits,E=c?c.Messages:void 0,C=[],D=0,F=(m||u)&&c?{directions:{routeId:1,routeName:c.RouteName,summary:{totalLength:this.fromMeters(c.TotalMeters,A),totalTime:this.fromMinutes(c.TotalMinutes,p),totalDriveTime:this.fromMinutes(c.TotalMinutes-c.TotalWaitMinutes,p),envelope:I},spatialReference:B,geometryType:"esriGeometryPolyline",features:n.hitch(this,function(){var a=(c.Version||"0.0.0").split("."),b;if("0"===a[0])return this._loadDirectionsFeatureSet(R,
S,A,p,B);if("1"===a[0]){for(a=0;a<v.length;a++)if(void 0!==v[a].attributes.StopID)for(b=0;b<w.length;b++)if(w[b].attributes[J.layerDefinition.objectIdField||"__OBJECTID"]==v[a].attributes.StopID){v[a].attributes.StopSequence=w[b].attributes.Sequence;break}for(a=0;a<q.length;a++)if(void 0!==q[a].attributes.DirectionPointID)for(b=0;b<v.length;b++)if(v[b].attributes[u.layerDefinition.objectIdField||"__OBJECTID"]==q[a].attributes.DirectionPointID){q[a].attributes.DirectionSequence=v[b].attributes.Sequence;
break}for(a=0;a<q.length-1;){for(b=a+1;b<q.length;)q[a].attributes.DirectionPointID===q[b].attributes.DirectionPointID&&(q[a].geometry&&q[a].geometry.paths[0]?q[a].geometry.paths[0]=q[a].geometry.paths[0].concat(q[b].geometry.paths[0]||[]):q[a].geometry=q[b].geometry,q[a].attributes.DirectionLineType=this._lineTypeStringToLineTypeCode("esriDLTSegment"),q[a].attributes.Meters+=q[b].attributes.Meters||0,q[a].attributes.Minutes+=q[b].attributes.Minutes||0,q[a].attributes.ToLevel=q[b].attributes.ToLevel||
q[a].attributes.ToLevel,q.splice(b,1)),b++;a++}return this._loadDirectionsFeatureSet_100(v,q,w,A,p,B)}e.reject(Error("Unsupported version of route layer."))})()},stops:n.hitch(this,function(){for(var a=[],c=0;c<w.length;c++){var b=w[c].attributes,d={geometry:w[c].geometry,attributes:{ObjectID:b.__OBJECTID,Name:b.Name,RouteName:null,Sequence:b.Sequence,TimeWindowStart:b.TimeWindowStart,TimeWindowEnd:b.TimeWindowEnd,ArriveCurbApproach:b.ArrivalCurbApproach,DepartCurbApproach:b.DepartureCurbApproach,
CurbApproach:b.CurbApproach,Status:b.Status,ArriveTime:this.toGeolocalTime(b.ArrivalTime,b.ArrivalUTCOffset),DepartTime:this.toGeolocalTime(b.DepartureTime,b.DepartureUTCOffset),ArriveTimeUTC:b.ArrivalTime,DepartTimeUTC:b.DepartureTime,isWaypoint:1===b.LocationType}},e=d.attributes;e["Attr_"+l]=this.fromMinutes(b.ServiceMinutes,p);e["Attr_"+r]=this.fromMeters(b.ServiceMeters,x);n.mixin(e,g(z.parse(b.ServiceCosts||"{}"),"Attr_"));e["Cumul_"+l]=this.fromMinutes(b.CumulativeMinutes,p);e["Cumul_"+r]=
this.fromMeters(b.CumulativeMeters,x);n.mixin(e,g(z.parse(b.CumulativeCosts||"{}"),"Cumul_"));a.push(d)}return a})(),routeName:c.RouteName,spatialReference:B}:void 0,N=!1,f=J?n.mixin({returnStops:!0,returnDirections:!0,returnRoutes:!1,ignoreInvalidLocations:!0,outputLines:"esriNAOutputLineTrueShape",directionsOutputType:"complete",directionsLengthUnits:A,doNotLocateOnRestrictedElements:!0,outSpatialReference:new G(B),startTime:c&&0<c.StartTime?new Date(c.StartTime):null,startTimeIsUTC:!0,timeWindowsAreUTC:!0,
stops:new K(function(){for(var a=[],c=0;c<w.length;c++){var d=w[c].attributes,e={geometry:w[c].geometry,attributes:{CurbApproach:d.CurbApproach,Name:d.Name,Sequence:d.Sequence,isWaypoint:1===d.LocationType,TimeWindowStart:d.TimeWindowStart,TimeWindowEnd:d.TimeWindowEnd}};e.attributes["Attr_"+l]=b(d.ServiceMinutes,p);e.attributes["Attr_"+r]=h(d.ServiceMeters,x);n.mixin(e.attributes,g(z.parse(d.ServiceCosts||"{}"),"Attr_"));a.push(e);N=N||0<d.TimeWindowStart}return{spatialReference:B,geometryType:"esriGeometryPoint",
features:a}}()),barriers:new K(function(){for(var a=[],c=0;c<y.length;c++){var b=y[c].attributes,d={geometry:y[c].geometry,attributes:{CurbApproach:b.CurbApproach,Name:b.Name,FullEdge:b.FullEdge,BarrierType:b.BarrierType}};n.mixin(d.attributes,g(z.parse(b.Costs||b.OtherCosts||"{}"),"Attr_"));a.push(d)}return{spatialReference:B,geometryType:"esriGeometryPoint",features:a}}()),polylineBarriers:new K(function(){for(var a=[],c=0;c<M.length;c++){var b=M[c].attributes,d={geometry:M[c].geometry,attributes:{Name:b.Name,
ScaleFactor:b.ScaleFactor,BarrierType:b.BarrierType}};n.mixin(d.attributes,g(z.parse(b.Costs||b.OtherCosts||"{}"),"Attr_"));a.push(d)}return{spatialReference:B,geometryType:"esriGeometryPolyline",features:a}}()),polygonBarriers:new K(function(){for(var a=[],c=0;c<L.length;c++){var b=L[c].attributes,d={geometry:L[c].geometry,attributes:{Name:b.Name,ScaleFactor:b.ScaleFactor,BarrierType:b.BarrierType}};n.mixin(d.attributes,g(z.parse(b.Costs||b.OtherCosts||"{}"),"Attr_"));a.push(d)}return{spatialReference:B,
geometryType:"esriGeometryPolygon",features:a}}())},f):void 0;n.mixin(f||{},{useTimeWindows:N});p&&x||(C.push({message:t.networkAnalysis.sharing.costAttributeMissing,messageType:"Warning"}),D=1);e.resolve({routeParameters:n.mixin(new W,f),solveResult:{barriers:f&&f.barriers&&f.barriers.features||[],polygonBarriers:f&&f.polygonBarriers&&f.polygonBarriers.features||[],polylineBarriers:f&&f.polylineBarriers&&f.polylineBarriers.features||[],messages:z.parse(E||"[]"),routeResults:F?[new X(F)]:void 0},
loadMessages:C,isItemOwner:d.username===k.owner,title:k.title,ownerFolder:k.ownerFolder,successCode:D})}),e.reject)}),e.reject)}),e.reject)}),e.reject):e.reject(Error("No URL to a Portal instance or ArcGIS Online was specified at construction time."));return e.promise},store:function(c,a,e){var h=new y;c?e||c.directions?"1.0.0"!==e||c.directionPoints&&c.directionLines?c.stops&&c.stops.length?c.extent?c.routeInfo?c.folder?c.name?this.portal?this.portal.signIn().then(n.hitch(this,function(){var b=this._getRouteId();
this._addOrUpdateItem(this._populateLayerInfo(b,c,e),c,b,a,e).then(h.resolve,h.reject)}),h.reject):h.reject(Error("No URL to a Portal instance or ArcGIS Online was specified at construction time.")):h.reject(Error("Layer name is required.")):h.reject(Error("Folder Url is required.")):h.reject(Error("RouteInfo is required.")):h.reject(Error("Extent is required.")):h.reject(Error("Stops are required.")):h.reject(Error("DirectionPoints and DirectionLines are required.")):h.reject(Error("Directions are required.")):
h.reject(Error("Missing required parameters."));return h.promise},createFeatureCollection:function(c,a){var e=new y;if(c)if(a||c.directions)if("1.0.0"!==a||c.directionPoints&&c.directionLines)if(c.stops&&c.stops.length)if(c.extent)if(c.routeInfo)if(c.name){var h=this._getRouteId();e.resolve({title:c.name,layerInfo:this._populateLayerInfo(h,c,a)})}else e.reject(Error("Layer name is required."));else e.reject(Error("RouteInfo are required."));else e.reject(Error("Extent is required."));else e.reject(Error("Stops are required."));
else e.reject(Error("DirectionPoints and DirectionLines are required."));else e.reject(Error("Directions are required."));else e.reject(Error("Missing required parameters."));return e.promise},_addOrUpdateItem:function(c,a,e,h,b){var g=function(a){for(var b=0;b<c.layers.length;b++)if(c.layers[b].layerDefinition.name===a)return c.layers[b].featureSet.features;return[]};return n.hitch(this,function(){var c=new y;if(a.extent){var b=g("Stops"),e=[{geometry:a.extent}],h=a.extent.spatialReference,l=new G(4326),
h=[this.project(b,h,l),this.project(e,h,l)];C(h).then(n.hitch(this,function(){var a=e[0]&&e[0].geometry,d="";a&&(d=a.xmin+","+a.ymin+","+a.xmax+","+a.ymax);c.resolve({extent:d,stops:b})}),c.resolve)}else c.resolve();return c.promise})().then(n.hitch(this,function(d){var e=(d||{}).extent,k=(d||{}).stops;return D({url:h?a.folder+"/items/"+h+"/update":a.folder+"/addItem",content:{text:z.stringify(c),extent:e,title:a.name,type:"Feature Collection",typeKeywords:"Data, Feature Collection, Multilayer, Route Layer",
description:t.networkAnalysis.sharing.itemSnippet+" "+a.name+n.hitch(this,function(){var a=b?g("DirectionPoints"):g("Directions"),c=g("Stops"),d=g("RouteInfo")[0].attributes,e="english"===this.portal.getPortalUser().units?"esriMiles":"esriMeters",f=function(a){return U.format(a,{places:2,locale:"root"})},h=n.hitch(this,function(a){return f(this.fromMeters(a,e))+" "+("esriMiles"===e?t.networkAnalysis.sharing.Miles:t.networkAnalysis.sharing.Meters)}),u=n.hitch(this,function(d){for(var e="\x3col\x3e",
g=0;g<a.length;g++){var l;a:{l=a[g].attributes.StopSequence;if(void 0!==l)for(var k=0;k<c.length;k++)if(c[k].attributes.Sequence===l){l=c[k].attributes;break a}l={}}k=b?this._itemToManeuverType(this._itemCodeToItemString(a[g].attributes.DirectionPointType)):a[g].attributes.ManeuverType;if(d||!g&&"esriDMTDepart"===k||g&&"esriDMTStop"===k)e+='\x3cli\x3e\x3cimg style\x3d"display:inline-block;margin:-3px 15px;" src\x3d"js/jsapi/esri/dijit/images/Directions/maneuvers/'+(null===l.ArrivalCurbApproach&&null!==
l.DepartureCurbApproach?"esriDMTStopOrigin":null!==l.ArrivalCurbApproach&&null===l.DepartureCurbApproach?"esriDMTStopDestination":k)+'.png"\x3e\x3cspan\x3e'+(a[g].attributes.DirectionText||a[g].attributes.DisplayText)+"\x3c/span\x3e\x3cbr\x3e",d&&!b&&(e+="\x3cspan\x3e"+f(a[g].attributes.Minutes)+" "+t.networkAnalysis.sharing.Minutes+"\x26nbsp;\x26middot;\x26nbsp;"+h(a[g].attributes.Meters)+"\x3c/span\x3e"),e+="\x3c/li\x3e"}return e+"\x3c/ol\x3e"}),v=function(a){a=new Date(a);var c=function(a){return 10>
a?"0"+a:a};return a.getUTCFullYear()+"-"+c(a.getUTCMonth()+1)+"-"+c(a.getUTCDate())+" "+c(a.getUTCHours())+":"+c(a.getUTCMinutes())+":"+c(a.getUTCSeconds())+" UTC"},d="\x3cbr\x3e\x3cbr\x3e\x3cb\x3e"+t.networkAnalysis.sharing.routeInfoLayer+"\x3c/b\x3e\x3cul\x3e\x3cli\x3e"+f(d.TotalMinutes)+" "+t.networkAnalysis.sharing.Minutes+"\x3c/li\x3e\x3cli\x3e"+h(d.TotalMeters)+"\x3c/li\x3e"+(d.StartTime?"\x3cli\x3e"+t.networkAnalysis.sharing.StartTime+" "+v(d.StartTime)+"\x3c/li\x3e":"")+"\x3c/ul\x3e"+(k?"\x3ca href\x3d'"+
function(){var a="arcgis-navigator://";k.map(function(c,b){var d=c.geometry;a+=(b?"\x26":"?")+"stop\x3d"+d.y+","+d.x+(""!==c.attributes.Name?"\x26stopname\x3d"+encodeURIComponent(c.attributes.Name).replace("'","%27"):"")});return a}()+"'\x3e"+t.networkAnalysis.sharing.navigatorStopList+"\x3c/a\x3e\x3cbr\x3e\x3cbr\x3e":"")+"\x3cb\x3e"+t.networkAnalysis.sharing.directionsLayer+"\x3c/b\x3e",v=u(!0);65536<=(d+v).length&&(v=u(!1));return d+v})(),tags:t.networkAnalysis.sharing.itemTags+(a.name?", "+a.name.substr(0,
255):""),snippet:t.networkAnalysis.sharing.itemSnippet+" "+a.name,thumbnailUrl:a.thumbnail,licenseInfo:t.widgets.directions.printDisclaimer,f:"json"},callbackParamName:"callback"},{usePost:!0})}))},_getRouteId:function(){for(var c="",a=0;32>a;a++)c+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[Math.floor(62*Math.random())];return c},_populateLayerInfo:function(c,a,e){var h={visibility:!0,layers:[],visibleLayers:[0,1,(a.barriers||[]).length?2:0,(a.barriers||[]).length?4:3,4,5,6],
opacity:1};void 0===e?(this._addRouteInfoToLayerInfo(h,c,a.routeInfo,a.extent),this._addDirectionsToLayerInfo(h,c,a.directions,a.extent),this._addDirectionEventsToLayerInfo(h,c,a.directionEvents||[],a.extent),this._addBarriersToLayerInfo(h,c,a.barriers||[],a.extent),this._addPolylineBarriersToLayerInfo(h,c,a.polylineBarriers||[],a.extent),this._addPolygonBarriersToLayerInfo(h,c,a.polygonBarriers||[],a.extent),this._addStopsToLayerInfo(h,c,a.stops,a.extent)):"1.0.0"===e&&((a.polygonBarriers||[]).length&&
this._addPolygonBarriersToLayerInfo(h,c,a.polygonBarriers||[],a.extent),(a.polylineBarriers||[]).length&&this._addPolylineBarriersToLayerInfo(h,c,a.polylineBarriers||[],a.extent),this._addRouteInfoToLayerInfo_100(h,c,a.routeInfo,a.extent,e),this._addDirectionLinesToLayerInfo_100(h,c,a.directionLines||[],a.extent),(a.barriers||[]).length&&this._addBarriersToLayerInfo(h,c,a.barriers||[],a.extent),this._addDirectionPointsToLayerInfo_100(h,c,a.directionPoints,a.extent),this._addStopsToLayerInfo_100(h,
c,a.stops,a.extent));return h},_addStopsToLayerInfo:function(c,a,e,h){a=t.networkAnalysis;var b={type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:a.enums.esriNACurbApproachType.esriNAEitherSideOfVehicle,code:0},{name:a.enums.esriNACurbApproachType.esriNARightSideOfVehicle,code:1},{name:a.enums.esriNACurbApproachType.esriNALeftSideOfVehicle,code:2},{name:a.enums.esriNACurbApproachType.esriNANoUTurn,code:3}]},g=this._generateFeatureCollectionTemplate("Stops",a.sharing.stopsLayer,"esriGeometryPoint"),
d=g.layerDefinition.fields,f=0<e[0].attributes.ArrivalTime;d.push(this._createField("CurbApproach",a.fields.stops.CurbApproach,"integer",!1,b));d.push(this._createField("ArrivalCurbApproach",a.fields.stops.ArrivalCurbApproach,"integer",!0,b));d.push(this._createField("DepartureCurbApproach",a.fields.stops.DepartureCurbApproach,"integer",!0,b));d.push(this._createField("Name",a.fields.stops.Name,"string",!0));d.push(this._createField("Sequence",a.fields.stops.Sequence,"integer",!0));d.push(this._createField("Status",
a.fields.stops.Status,"integer",!0,{type:"codedValue",name:"esriNAObjectStatus",codedValues:[{name:a.enums.esriNAObjectStatus.esriNAObjectStatusOK,code:0},{name:a.enums.esriNAObjectStatus.esriNAObjectStatusNotLocated,code:1},{name:a.enums.esriNAObjectStatus.esriNAObjectStatusElementNotLocated,code:2},{name:a.enums.esriNAObjectStatus.esriNAObjectStatusElementNotTraversable,code:3},{name:a.enums.esriNAObjectStatus.esriNAObjectStatusInvalidFieldValues,code:4},{name:a.enums.esriNAObjectStatus.esriNAObjectStatusNotReached,
code:5},{name:a.enums.esriNAObjectStatus.esriNAObjectStatusTimeWindowViolation,code:6}]}));d.push(this._createField("LocationType",a.fields.stops.LocationType,"integer",!0,{type:"codedValue",name:"esriNALocationType",codedValues:[{name:a.enums.esriNALocationType.stop,code:0},{name:a.enums.esriNALocationType.waypoint,code:1}]}));d.push(this._createField("TimeWindowStart",a.fields.stops.TimeWindowStart,"date",!1));d.push(this._createField("TimeWindowEnd",a.fields.stops.TimeWindowEnd,"date",!1));d.push(this._createField("ServiceMinutes",
a.fields.stops.ServiceMinutes,"double",!1));d.push(this._createField("ServiceMeters",a.fields.stops.ServiceMeters,"double",!1));d.push(this._createField("ServiceCosts",a.fields.stops.ServiceCosts,"string",!1,null,this._jsonStringFieldSize));d.push(this._createField("CumulativeMinutes",a.fields.stops.CumulativeMinutes,"double",!0));d.push(this._createField("CumulativeMeters",a.fields.stops.CumulativeMeters,"double",!0));d.push(this._createField("CumulativeCosts",a.fields.stops.CumulativeCosts,"string",
!1,null,this._jsonStringFieldSize));d.push(this._createField("LateMinutes",a.fields.stops.LateMinutes,"double",!1));d.push(this._createField("WaitMinutes",a.fields.stops.WaitMinutes,"double",!1));d.push(this._createField("ArrivalTime",a.fields.stops.ArrivalTime,"date",f));d.push(this._createField("DepartureTime",a.fields.stops.DepartureTime,"date",f));d.push(this._createField("ArrivalUTCOffset",a.fields.stops.ArrivalUTCOffset,"integer",f));d.push(this._createField("DepartureUTCOffset",a.fields.stops.DepartureUTCOffset,
"integer",f));for(b=d=0;b<e.length;b++){var k=e[b],m=k.geometry;g.featureSet.features.push({geometry:m.toJson?m.toJson():m,attributes:n.mixin(k.attributes,{__OBJECTID:d++})})}g.layerDefinition.extent=h.toJson?h.toJson():h;h=new A(2>=e.length?new u(this.firstStopSymbol):new u(this.interimStopSymbol),"Sequence");for(b=0;b<e.length;b++)d=e[b].attributes,k=null,m=a.enums.esriNALocationType.stop,1===d.LocationType?(k=new E(this.waypointSymbol),m=a.enums.esriNALocationType.waypoint):null===d.ArrivalCurbApproach&&
null===d.DepartureCurbApproach?(k=new u(this.unlocatedStopSymbol),m=a.enums.esriNALocationType.stop+" : "+a.enums.esriNAObjectStatus.esriNAObjectStatusNotReached):null===d.ArrivalCurbApproach&&null!==d.DepartureCurbApproach?k=new u(this.firstStopSymbol):null!==d.ArrivalCurbApproach&&null===d.DepartureCurbApproach&&(k=new u(this.lastStopSymbol)),k&&h.addValue({value:d.Sequence,symbol:k,label:m});g.layerDefinition.drawingInfo.renderer=h.toJson();g.popupInfo={title:"{Name}",fieldInfos:[{fieldName:"Name",
label:a.fields.stops.Name,isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"Sequence",label:a.fields.stops.Sequence,isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalTime",label:a.fields.stops.ArrivalTime,isEditable:!0,tooltip:"",visible:f,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"ArrivalUTCOffset",label:a.fields.stops.ArrivalUTCOffset,isEditable:!1,tooltip:"",
visible:f,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DepartureTime",label:a.fields.stops.DepartureTime,isEditable:!0,tooltip:"",visible:f,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"DepartureUTCOffset",label:a.fields.stops.DepartureUTCOffset,isEditable:!1,tooltip:"",visible:f,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CurbApproach",label:a.fields.stops.CurbApproach,isEditable:!0,tooltip:"",
visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalCurbApproach",label:a.fields.stops.ArrivalCurbApproach,isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DepartureCurbApproach",label:a.fields.stops.DepartureCurbApproach,isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Status",label:a.fields.stops.Status,isEditable:!1,tooltip:"",
visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"LocationType",label:a.fields.stops.LocationType,isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TimeWindowStart",label:a.fields.stops.TimeWindowStart,isEditable:!0,tooltip:"",visible:!1,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"TimeWindowEnd",label:a.fields.stops.TimeWindowEnd,isEditable:!0,tooltip:"",visible:!1,
format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"ServiceMinutes",label:a.fields.stops.ServiceMinutes,isEditable:!0,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceMeters",label:a.fields.stops.ServiceMeters,isEditable:!0,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceCosts",label:a.fields.stops.ServiceCosts,isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"},
{fieldName:"CumulativeMinutes",label:a.fields.stops.CumulativeMinutes,isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CumulativeMeters",label:a.fields.stops.CumulativeMeters,isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CumulativeCosts",label:a.fields.stops.CumulativeCosts,isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"LateMinutes",label:a.fields.stops.LateMinutes,
isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"WaitMinutes",label:a.fields.stops.WaitMinutes,isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]};c.layers.push(g)},_addDirectionsToLayerInfo:function(c,a,e,h){a=t.networkAnalysis;var b=a.enums.esriDirectionsManeuverType,g=this._generateFeatureCollectionTemplate("Directions",a.sharing.directionsLayer,
"esriGeometryPolyline"),d=g.layerDefinition.fields,f=e[0]&&e[0].attributes&&0<e[0].attributes.ArrivalTime;d.push(this._createField("Sequence",a.fields.directions.Sequence,"integer"));d.push(this._createField("StopSequence",a.fields.directions.StopSequence,"integer"));d.push(this._createField("ArrivalTime",a.fields.directions.ArrivalTime,"date",f));d.push(this._createField("UTCOffset",a.fields.directions.UTCOffset,"integer",f));d.push(this._createField("ManeuverType",a.fields.directions.ManeuverType,
"string",!0,{type:"codedValue",name:"esriDirectionsManeuverType",codedValues:[{name:b.esriDMTBearLeft,code:"esriDMTBearLeft"},{name:b.esriDMTBearRight,code:"esriDMTBearRight"},{name:b.esriDMTDepart,code:"esriDMTDepart"},{name:b.esriDMTDoorPassage,code:"esriDMTDoorPassage"},{name:b.esriDMTElevator,code:"esriDMTElevator"},{name:b.esriDMTEndOfFerry,code:"esriDMTEndOfFerry"},{name:b.esriDMTEscalator,code:"esriDMTEscalator"},{name:b.esriDMTFerry,code:"esriDMTFerry"},{name:b.esriDMTForkCenter,code:"esriDMTForkCenter"},
{name:b.esriDMTForkLeft,code:"esriDMTForkLeft"},{name:b.esriDMTForkRight,code:"esriDMTForkRight"},{name:b.esriDMTHighwayChange,code:"esriDMTHighwayChange"},{name:b.esriDMTHighwayExit,code:"esriDMTHighwayExit"},{name:b.esriDMTHighwayMerge,code:"esriDMTHighwayMerge"},{name:b.esriDMTPedestrianRamp,code:"esriDMTPedestrianRamp"},{name:b.esriDMTRampLeft,code:"esriDMTRampLeft"},{name:b.esriDMTRampRight,code:"esriDMTRampRight"},{name:b.esriDMTRoundabout,code:"esriDMTRoundabout"},{name:b.esriDMTSharpLeft,
code:"esriDMTSharpLeft"},{name:b.esriDMTSharpRight,code:"esriDMTSharpRight"},{name:b.esriDMTStairs,code:"esriDMTStairs"},{name:b.esriDMTStop,code:"esriDMTStop"},{name:b.esriDMTStraight,code:"esriDMTStraight"},{name:b.esriDMTTripItem,code:"esriDMTTripItem"},{name:b.esriDMTTurnLeft,code:"esriDMTTurnLeft"},{name:b.esriDMTTurnLeftLeft,code:"esriDMTTurnLeftLeft"},{name:b.esriDMTTurnLeftRight,code:"esriDMTTurnLeftRight"},{name:b.esriDMTTurnRight,code:"esriDMTTurnRight"},{name:b.esriDMTTurnRightLeft,code:"esriDMTTurnRightLeft"},
{name:b.esriDMTTurnRightRight,code:"esriDMTTurnRightRight"},{name:b.esriDMTUnknown,code:"esriDMTUnknown"},{name:b.esriDMTUTurn,code:"esriDMTUTurn"}]}));d.push(this._createField("Meters",a.fields.directions.Meters,"double",!0));d.push(this._createField("Minutes",a.fields.directions.Minutes,"double",!0));d.push(this._createField("DirectionText",a.fields.directions.DirectionText,"string",!0,null,2048));d.push(this._createField("ManeuverMessages",a.fields.directions.ManeuverMessages,"string",!1,null,
this._jsonStringFieldSize));for(d=b=0;d<e.length;d++){var k=e[d],m=k.geometry;g.featureSet.features.push({geometry:m&&m.toJson?m.toJson():m,attributes:n.mixin(k.attributes,{__OBJECTID:b++})})}g.layerDefinition.extent=h.toJson?h.toJson():h;e=new x(new F(this.directionSymbol));g.layerDefinition.drawingInfo.renderer=e.toJson();g.popupInfo={title:"{Text}",fieldInfos:[{fieldName:"ManeuverType",label:a.fields.directions.ManeuverType,isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"DirectionText",
label:a.fields.directions.DirectionText,isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"Sequence",label:a.fields.directions.Sequence,isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"StopSequence",label:a.fields.directions.StopSequence,isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalTime",label:a.fields.directions.ArrivalTime,isEditable:!0,
tooltip:"",visible:f,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"UTCOffset",label:a.fields.directions.UTCOffset,isEditable:!1,tooltip:"",visible:f,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Meters",label:a.fields.directions.Meters,isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Minutes",label:a.fields.directions.Minutes,isEditable:!1,tooltip:"",visible:!0,format:{places:2,
digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ManeuverMessages",label:a.fields.directions.ManeuverMessages,isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]};c.layers.push(g)},_addDirectionEventsToLayerInfo:function(c,a,e,h){a=t.networkAnalysis;var b=this._generateFeatureCollectionTemplate("DirectionEvents",a.sharing.directionEventsLayer,"esriGeometryPoint"),g=b.layerDefinition.fields,d=e[0]&&e[0].attributes&&0<e[0].attributes.ArrivalTime;
g.push(this._createField("ArrivalTime",a.fields.directionEvents.ArrivalTime,"date",d));g.push(this._createField("UTCOffset",a.fields.directionEvents.UTCOffset,"integer",d));g.push(this._createField("DirectionSequence",a.fields.directionEvents.DirectionSequence,"integer"));g.push(this._createField("Sequence",a.fields.directionEvents.Sequence,"integer"));g.push(this._createField("EventText",a.fields.directionEvents.EventText,"string",!0,null,2048));g.push(this._createField("EventMessages",a.fields.directionEvents.EventMessages,
"string",!1,null,this._jsonStringFieldSize));for(var f=g=0;f<e.length;f++){var k=e[f],m=k.geometry;b.featureSet.features.push({geometry:m&&m.toJson?m.toJson():m,attributes:n.mixin(k.attributes,{__OBJECTID:g++})})}b.layerDefinition.extent=h.toJson?h.toJson():h;e=new x(new E(this.directionEventSymbol));b.layerDefinition.drawingInfo.renderer=e.toJson();b.popupInfo={title:a.sharing.directionEventsLayer,fieldInfos:[{fieldName:"EventText",label:a.fields.directionEvents.EventText,isEditable:!1,tooltip:"",
visible:!0,stringFieldOption:"textbox"},{fieldName:"ArrivalTime",label:a.fields.directionEvents.ArrivalTime,isEditable:!0,tooltip:"",visible:d,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"UTCOffset",label:a.fields.directionEvents.UTCOffset,isEditable:!1,tooltip:"",visible:d,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DirectionSequence",label:a.fields.directionEvents.DirectionSequence,isEditable:!1,tooltip:"",visible:!1,format:{places:0,
digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Sequence",label:a.fields.directionEvents.Sequence,isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"EventMessages",label:a.fields.directionEvents.EventMessages,isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]};c.layers.push(b)},_addBarriersToLayerInfo:function(c,a,e,h){a=t.networkAnalysis;var b=this._generateFeatureCollectionTemplate("Barriers",
a.sharing.barriersLayer,"esriGeometryPoint"),g=b.layerDefinition.fields;g.push(this._createField("Name",a.fields.barriers.Name,"string",!0));g.push(this._createField("BarrierType",a.fields.barriers.BarrierType,"integer",!0,{type:"codedValue",name:"esriNABarrierType",codedValues:[{name:a.enums.esriNABarrierType.esriNABTRestriction,code:0},{name:a.enums.esriNABarrierType.esriNABTScaledCost,code:1},{name:a.enums.esriNABarrierType.esriNABTAddedCost,code:2}]}));g.push(this._createField("FullEdge",a.fields.barriers.FullEdge,
"integer",!0,{type:"codedValue",name:"esriNAIntYesNo",codedValues:[{name:a.enums.esriNAIntYesNo.No,code:0},{name:a.enums.esriNAIntYesNo.Yes,code:1}]}));g.push(this._createField("AddedCost",a.fields.barriers.AddedCost,"double",!0));g.push(this._createField("Costs",a.fields.barriers.Costs,"string",!1,null,this._jsonStringFieldSize));g.push(this._createField("Status",a.fields.barriers.Status,"integer",!0,{type:"codedValue",name:"esriNAObjectStatus",codedValues:[{name:a.enums.esriNAObjectStatus.esriNAObjectStatusOK,
code:0},{name:a.enums.esriNAObjectStatus.esriNAObjectStatusNotLocated,code:1},{name:a.enums.esriNAObjectStatus.esriNAObjectStatusElementNotLocated,code:2},{name:a.enums.esriNAObjectStatus.esriNAObjectStatusElementNotTraversable,code:3},{name:a.enums.esriNAObjectStatus.esriNAObjectStatusInvalidFieldValues,code:4},{name:a.enums.esriNAObjectStatus.esriNAObjectStatusNotReached,code:5},{name:a.enums.esriNAObjectStatus.esriNAObjectStatusTimeWindowViolation,code:6}]}));g.push(this._createField("CurbApproach",
a.fields.barriers.CurbApproach,"integer",!1,{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:a.enums.esriNACurbApproachType.esriNAEitherSideOfVehicle,code:0},{name:a.enums.esriNACurbApproachType.esriNARightSideOfVehicle,code:1},{name:a.enums.esriNACurbApproachType.esriNALeftSideOfVehicle,code:2},{name:a.enums.esriNACurbApproachType.esriNANoUTurn,code:3}]}));for(var g=0,d=!1,f=!1,k=0;k<e.length;k++){var m=e[k],l=m.geometry,p=m.attributes,d=d||void 0!==l.m,f=f||void 0!==l.z;b.featureSet.features.push({geometry:n.mixin(l&&
l.toJson?l.toJson():l,d?{m:l.m}:{}),attributes:n.mixin(m.attributes,{__OBJECTID:++g,FullEdge:p.FullEdge||0,Status:p.Status||0,CurbApproach:p.CurbApproach||0})})}n.mixin(b.layerDefinition,{extent:h.toJson?h.toJson():h,hasM:d,hasZ:f});b.layerDefinition.drawingInfo.renderer=this.barrierRenderer.toJson();b.popupInfo={title:a.sharing.barriersLayer,fieldInfos:[{fieldName:"Name",label:a.fields.barriers.Name,isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"BarrierType",label:a.fields.barriers.BarrierType,
isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"CurbApproach",label:a.fields.barriers.CurbApproach,isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"FullEdge",label:a.fields.barriers.FullEdge,isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"AddedCost",label:a.fields.barriers.AddedCost,isEditable:!0,tooltip:"",visible:!0,format:{places:3,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Costs",label:a.fields.barriers.Costs,
isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"Status",label:a.fields.barriers.Status,isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]};c.layers.push(b)},_addPolylineBarriersToLayerInfo:function(c,a,e,h){a=t.networkAnalysis;var b=this._generateFeatureCollectionTemplate("PolylineBarriers",a.sharing.polylineBarriersLayer,"esriGeometryPolyline"),g=b.layerDefinition.fields;g.push(this._createField("Name",
a.fields.polylineBarriers.Name,"string",!0));g.push(this._createField("BarrierType",a.fields.polylineBarriers.BarrierType,"integer",!0,{type:"codedValue",name:"esriNABarrierType",codedValues:[{name:a.enums.esriNABarrierType.esriNABTRestriction,code:0},{name:a.enums.esriNABarrierType.esriNABTScaledCost,code:1},{name:a.enums.esriNABarrierType.esriNABTAddedCost,code:2}]}));g.push(this._createField("ScaleFactor",a.fields.polylineBarriers.ScaleFactor,"double",!0));g.push(this._createField("Costs",a.fields.polylineBarriers.Costs,
"string",!1,null,this._jsonStringFieldSize));for(var g=0,d=!1,f=!1,k=0;k<e.length;k++){var m=e[k],l=m.geometry,p=m.attributes;l&&p&&(d=d||l.hasM||!1,f=f||l.hasZ||!1,b.featureSet.features.push({geometry:l&&l.toJson?l.toJson():l,attributes:n.mixin(m.attributes,{__OBJECTID:++g})}))}n.mixin(b.layerDefinition,{extent:h.toJson?h.toJson():h,hasM:d,hasZ:f});b.layerDefinition.drawingInfo.renderer=this.polylineBarrierRenderer.toJson();b.popupInfo={title:a.sharing.polylineBarriersLayer,fieldInfos:[{fieldName:"Name",
label:a.fields.polylineBarriers.Name,isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"BarrierType",label:a.fields.polylineBarriers.BarrierType,isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"ScaleFactor",label:a.fields.polylineBarriers.ScaleFactor,isEditable:!0,tooltip:"",visible:!0,format:{places:3,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Costs",label:a.fields.polylineBarriers.Costs,isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"}],
description:null,showAttachments:!1,mediaInfos:[]};c.layers.push(b)},_addPolygonBarriersToLayerInfo:function(c,a,e,h){a=t.networkAnalysis;var b=this._generateFeatureCollectionTemplate("PolygonBarriers",a.sharing.polygonBarriersLayer,"esriGeometryPolygon"),g=b.layerDefinition.fields;g.push(this._createField("Name",a.fields.polygonBarriers.Name,"string",!0));g.push(this._createField("BarrierType",a.fields.polygonBarriers.BarrierType,"integer",!0,{type:"codedValue",name:"esriNABarrierType",codedValues:[{name:a.enums.esriNABarrierType.esriNABTRestriction,
code:0},{name:a.enums.esriNABarrierType.esriNABTScaledCost,code:1},{name:a.enums.esriNABarrierType.esriNABTAddedCost,code:2}]}));g.push(this._createField("ScaleFactor",a.fields.polygonBarriers.ScaleFactor,"double",!0));g.push(this._createField("Costs",a.fields.polygonBarriers.Costs,"string",!1,null,this._jsonStringFieldSize));for(var g=0,d=!1,f=!1,k=0;k<e.length;k++){var m=e[k],l=m.geometry,p=m.attributes;l&&p&&(d=d||l.hasM||!1,f=f||l.hasZ||!1,b.featureSet.features.push({geometry:l&&l.toJson?l.toJson():
l,attributes:n.mixin(m.attributes,{__OBJECTID:++g})}))}n.mixin(b.layerDefinition,{extent:h.toJson?h.toJson():h,hasM:d,hasZ:f});b.layerDefinition.drawingInfo.renderer=this.polygonBarrierRenderer.toJson();b.popupInfo={title:a.sharing.polygonBarriersLayer,fieldInfos:[{fieldName:"Name",label:a.fields.polygonBarriers.Name,isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"BarrierType",label:a.fields.polygonBarriers.BarrierType,isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},
{fieldName:"ScaleFactor",label:a.fields.polygonBarriers.ScaleFactor,isEditable:!0,tooltip:"",visible:!0,format:{places:3,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Costs",label:a.fields.polygonBarriers.Costs,isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]};c.layers.push(b)},_addRouteInfoToLayerInfo:function(c,a,e,h){a=t.networkAnalysis;var b=this._generateFeatureCollectionTemplate("RouteInfo",a.sharing.routeInfoLayer,
"esriGeometryPolyline"),g=b.layerDefinition.fields,d=void 0!==e.attributes.StartTime&&null!==e.attributes.StartTime;g.push(this._createField("RouteName",a.fields.routeInfo.RouteName,"string",!0,null,1024));g.push(this._createField("TotalMinutes",a.fields.routeInfo.TotalMinutes,"double",!0));g.push(this._createField("TotalMeters",a.fields.routeInfo.TotalMeters,"double",!0));g.push(this._createField("TotalLateMinutes",a.fields.routeInfo.TotalLateMinutes,"double"));g.push(this._createField("TotalWaitMinutes",
a.fields.routeInfo.TotalWaitMinutes,"double"));g.push(this._createField("TotalCosts",a.fields.routeInfo.TotalCosts,"string",!1,null,this._jsonStringFieldSize));g.push(this._createField("StartTime",a.fields.routeInfo.StartTime,"date",d));g.push(this._createField("StartUTCOffset",a.fields.routeInfo.StartUTCOffset,"integer",d));g.push(this._createField("EndTime",a.fields.routeInfo.EndTime,"date",d));g.push(this._createField("EndUTCOffset",a.fields.routeInfo.EndUTCOffset,"integer",d));g.push(this._createField("Messages",
a.fields.routeInfo.Messages,"string",!1,null,this._jsonStringFieldSize));g.push(this._createField("AnalysisSettings",a.fields.routeInfo.AnalysisSettings,"string",!1,null,this._jsonStringFieldSize));g=e.geometry;b.featureSet.features.push({geometry:g&&g.toJson?g.toJson():g,attributes:n.mixin(e.attributes,{__OBJECTID:1})});b.layerDefinition.extent=h.toJson?h.toJson():h;e=new x(new F(this.routeSymbol));b.layerDefinition.drawingInfo.renderer=e.toJson();b.popupInfo={title:a.sharing.routeInfoLayer,fieldInfos:[{fieldName:"RouteName",
label:a.fields.routeInfo.RouteName,isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"TotalMinutes",label:a.fields.routeInfo.TotalMinutes,isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalMeters",label:a.fields.routeInfo.TotalMeters,isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalLateMinutes",label:a.fields.routeInfo.TotalLateMinutes,isEditable:!1,
tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalWaitMinutes",label:a.fields.routeInfo.TotalWaitMinutes,isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalCosts",label:a.fields.routeInfo.TotalCosts,isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"StartTime",label:a.fields.routeInfo.StartTime,isEditable:!1,tooltip:"",visible:d,format:{dateFormat:"shortDateShortTime24"},
stringFieldOption:"textbox"},{fieldName:"StartUTCOffset",label:a.fields.routeInfo.StartUTCOffset,isEditable:!1,tooltip:"",visible:d,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"EndTime",label:a.fields.routeInfo.EndTime,isEditable:!1,tooltip:"",visible:d,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"EndUTCOffset",label:a.fields.routeInfo.EndUTCOffset,isEditable:!1,tooltip:"",visible:d,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},
{fieldName:"Messages",label:a.fields.routeInfo.Messages,isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"SolverSettings",label:a.fields.routeInfo.SolverSettings,isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]};c.layers.push(b)},_loadDirectionsFeatureSet:function(c,a,e,h,b){for(var g=[],d=function(a){var d=a,e=c[d].geometry;a=function(a){for(;!e&&(0>a&&0<d||0<a&&d<c.length-1);){d+=a;var f=c[d].geometry;
if(f&&f.paths&&f.paths[0]){e={paths:[[f.paths[0][0<a?0:f.paths[0].length-1],f.paths[0][0<a?0:f.paths[0].length-1]]],spatialReference:b};break}}return e};return a(1)||a(-1)},f=n.hitch(this,function(c){for(var b=[],d=0;d<a.length;d++)a[d].attributes.DirectionSequence===c&&(b.push({ETA:this.toGeolocalTime(a[d].attributes.ArrivalTime,a[d].attributes.UTCOffset),arriveTimeUTC:null===a[d].attributes.UTCOffset?void 0:a[d].attributes.ArrivalTime,strings:z.parse(a[d].attributes.EventMessages)||[],point:{x:a[d].geometry.x,
y:a[d].geometry.y}}),a[d].attributes.EventText&&b[b.length-1].strings.splice(0,0,{string:a[d].attributes.EventText,stringType:"esriDSTGeneral"}));return b}),k=0;k<c.length;k++){var m={attributes:{length:this.fromMeters(c[k].attributes.Meters,e),time:this.fromMinutes(c[k].attributes.Minutes,h),text:c[k].attributes.DirectionText,ETA:this.toGeolocalTime(c[k].attributes.ArrivalTime,c[k].attributes.UTCOffset),arriveTimeUTC:null===c[k].attributes.UTCOffset?void 0:c[k].attributes.ArrivalTime,maneuverType:c[k].attributes.ManeuverType,
_stopSequence:c[k].attributes.StopSequence},geometry:d(k)||ss[0]&&ss[0].geometry&&{paths:[[[ss[0].geometry.x,ss[0].geometry.y]]],spatialReference:b},strings:z.parse(c[k].attributes.ManeuverMessages||"[]"),events:f(k)};0===m.strings.length&&delete m.strings;g.push(m)}return g},_addStopsToLayerInfo_100:function(c,a,e,h){a=t.networkAnalysis;var b={type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:a.enums.esriNACurbApproachType.esriNAEitherSideOfVehicle,code:0},{name:a.enums.esriNACurbApproachType.esriNARightSideOfVehicle,
code:1},{name:a.enums.esriNACurbApproachType.esriNALeftSideOfVehicle,code:2},{name:a.enums.esriNACurbApproachType.esriNANoUTurn,code:3}]},g=this._generateFeatureCollectionTemplate("Stops",a.sharing.stopsLayer,"esriGeometryPoint"),d=g.layerDefinition.fields,f=0<e[0].attributes.ArrivalTime;d.push(this._createField("CurbApproach",a.fields.stops.CurbApproach,"integer",!1,b));d.push(this._createField("ArrivalCurbApproach",a.fields.stops.ArrivalCurbApproach,"integer",!0,b));d.push(this._createField("DepartureCurbApproach",
a.fields.stops.DepartureCurbApproach,"integer",!0,b));d.push(this._createField("Name",a.fields.stops.Name,"string",!0));d.push(this._createField("RouteName",a.fields.routeInfo.RouteName,"string",!0));d.push(this._createField("Sequence",a.fields.stops.Sequence,"integer",!0));d.push(this._createField("Status",a.fields.stops.Status,"integer",!0,{type:"codedValue",name:"esriNAObjectStatus",codedValues:[{name:a.enums.esriNAObjectStatus.esriNAObjectStatusOK,code:0},{name:a.enums.esriNAObjectStatus.esriNAObjectStatusNotLocated,
code:1},{name:a.enums.esriNAObjectStatus.esriNAObjectStatusElementNotLocated,code:2},{name:a.enums.esriNAObjectStatus.esriNAObjectStatusElementNotTraversable,code:3},{name:a.enums.esriNAObjectStatus.esriNAObjectStatusInvalidFieldValues,code:4},{name:a.enums.esriNAObjectStatus.esriNAObjectStatusNotReached,code:5},{name:a.enums.esriNAObjectStatus.esriNAObjectStatusTimeWindowViolation,code:6}]}));d.push(this._createField("LocationType",a.fields.stops.LocationType,"integer",!0,{type:"codedValue",name:"esriNALocationType",
codedValues:[{name:a.enums.esriNALocationType.stop,code:0},{name:a.enums.esriNALocationType.waypoint,code:1}]}));d.push(this._createField("TimeWindowStart",a.fields.stops.TimeWindowStart,"date",!1));d.push(this._createField("TimeWindowEnd",a.fields.stops.TimeWindowEnd,"date",!1));d.push(this._createField("TimeWindowStartUTCOffset",a.fields.stops.TimeWindowStart+": "+a.fields.directions.UTCOffset,"integer",f));d.push(this._createField("TimeWindowEndUTCOffset",a.fields.stops.TimeWindowEnd+": "+a.fields.directions.UTCOffset,
"integer",f));d.push(this._createField("ServiceMinutes",a.fields.stops.ServiceMinutes,"double",!1));d.push(this._createField("ServiceMeters",a.fields.stops.ServiceMeters,"double",!1));d.push(this._createField("ServiceCosts",a.fields.stops.ServiceCosts,"string",!1,null,this._jsonStringFieldSize));d.push(this._createField("CumulativeMinutes",a.fields.stops.CumulativeMinutes,"double",!0));d.push(this._createField("CumulativeMeters",a.fields.stops.CumulativeMeters,"double",!0));d.push(this._createField("CumulativeCosts",
a.fields.stops.CumulativeCosts,"string",!1,null,this._jsonStringFieldSize));d.push(this._createField("LateMinutes",a.fields.stops.LateMinutes,"double",!1));d.push(this._createField("WaitMinutes",a.fields.stops.WaitMinutes,"double",!1));d.push(this._createField("ArrivalTime",a.fields.stops.ArrivalTime,"date",f));d.push(this._createField("DepartureTime",a.fields.stops.DepartureTime,"date",f));d.push(this._createField("ArrivalUTCOffset",a.fields.stops.ArrivalUTCOffset,"integer",f));d.push(this._createField("DepartureUTCOffset",
a.fields.stops.DepartureUTCOffset,"integer",f));for(var d=0,k=!1,m=!1,b=0;b<e.length;b++){var l=e[b],p=l.geometry,k=k||void 0!==p.m,m=m||void 0!=p.m;g.featureSet.features.push({geometry:n.mixin(p&&p.toJson?p.toJson():p,k?{m:p.m}:{}),attributes:void 0!==l.attributes.__OBJECTID?l.attributes:n.mixin(l.attributes,{__OBJECTID:++d})})}n.mixin(g.layerDefinition,{extent:h.toJson?h.toJson():h,hasM:k,hasZ:m});h=new A(2>=e.length?new u(this.firstStopSymbol):new u(this.interimStopSymbol),"Sequence");for(b=0;b<
e.length;b++)d=e[b].attributes,k=null,m=a.enums.esriNALocationType.stop,1===d.LocationType?(k=new E(this.waypointSymbol),m=a.enums.esriNALocationType.waypoint):null===d.ArrivalCurbApproach&&null===d.DepartureCurbApproach?(k=new u(this.unlocatedStopSymbol),m=a.enums.esriNALocationType.stop+" : "+a.enums.esriNAObjectStatus.esriNAObjectStatusNotReached):null===d.ArrivalCurbApproach&&null!==d.DepartureCurbApproach?k=new u(this.firstStopSymbol):null!==d.ArrivalCurbApproach&&null===d.DepartureCurbApproach&&
(k=new u(this.lastStopSymbol)),k&&h.addValue({value:d.Sequence,symbol:k,label:m});g.layerDefinition.drawingInfo.renderer=h.toJson();g.popupInfo={title:"{Name}",fieldInfos:[{fieldName:"Name",label:a.fields.stops.Name,isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"RouteName",label:a.fields.routeInfo.RouteName,isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"Sequence",label:a.fields.stops.Sequence,isEditable:!1,tooltip:"",visible:!0,format:{places:0,
digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalTime",label:a.fields.stops.ArrivalTime,isEditable:!0,tooltip:"",visible:f,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"ArrivalUTCOffset",label:a.fields.stops.ArrivalUTCOffset,isEditable:!1,tooltip:"",visible:f,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DepartureTime",label:a.fields.stops.DepartureTime,isEditable:!0,tooltip:"",visible:f,format:{dateFormat:"shortDateShortTime24"},
stringFieldOption:"textbox"},{fieldName:"DepartureUTCOffset",label:a.fields.stops.DepartureUTCOffset,isEditable:!1,tooltip:"",visible:f,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CurbApproach",label:a.fields.stops.CurbApproach,isEditable:!0,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalCurbApproach",label:a.fields.stops.ArrivalCurbApproach,isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},
stringFieldOption:"textbox"},{fieldName:"DepartureCurbApproach",label:a.fields.stops.DepartureCurbApproach,isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Status",label:a.fields.stops.Status,isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"LocationType",label:a.fields.stops.LocationType,isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},
{fieldName:"TimeWindowStart",label:a.fields.stops.TimeWindowStart,isEditable:!0,tooltip:"",visible:!1,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"TimeWindowStartUTCOffset",label:a.fields.stops.TimeWindowStart+": "+a.fields.directions.UTCOffset,isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TimeWindowEnd",label:a.fields.stops.TimeWindowEnd,isEditable:!0,tooltip:"",visible:!1,format:{dateFormat:"shortDateShortTime24"},
stringFieldOption:"textbox"},{fieldName:"TimeWindowEndUTCOffset",label:a.fields.stops.TimeWindowEnd+": "+a.fields.directions.UTCOffset,isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceMinutes",label:a.fields.stops.ServiceMinutes,isEditable:!0,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceMeters",label:a.fields.stops.ServiceMeters,isEditable:!0,tooltip:"",visible:!1,format:{places:2,
digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceCosts",label:a.fields.stops.ServiceCosts,isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"CumulativeMinutes",label:a.fields.stops.CumulativeMinutes,isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CumulativeMeters",label:a.fields.stops.CumulativeMeters,isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},
{fieldName:"CumulativeCosts",label:a.fields.stops.CumulativeCosts,isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"LateMinutes",label:a.fields.stops.LateMinutes,isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"WaitMinutes",label:a.fields.stops.WaitMinutes,isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]};
c.layers.push(g)},_addRouteInfoToLayerInfo_100:function(c,a,e,h,b){this._addRouteInfoToLayerInfo(c,a,e,h);a=t.networkAnalysis;c=c.layers[c.layers.length-1];c.layerDefinition.fields.push(this._createField("Version",a.fields.routeInfo.Version,"string",!0,null,16));c.popupInfo.fieldInfos.push({fieldName:"Version",label:a.fields.routeInfo.Version,isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"});c.featureSet.features[0].attributes.Version=b;e=e.geometry;n.mixin(c.layerDefinition,{hasM:e.hasM||
!1,hasZ:e.hasZ||!1})},_addDirectionPointsToLayerInfo_100:function(c,a,e,h){a=t.networkAnalysis;var b=a.enums.esriDirectionItemType,g=this._generateFeatureCollectionTemplate("DirectionPoints",a.sharing.directionPointsLayer,"esriGeometryPoint"),d=g.layerDefinition.fields,f=e[0]&&e[0].attributes&&0<e[0].attributes.ArrivalTime;d.push(this._createField("Sequence",a.fields.directions.Sequence,"integer",!0));d.push(this._createField("StopID",a.fields.directions.StopID,"integer",!0));d.push(this._createField("DirectionPointType",
a.fields.directions.ItemType,"integer",!0,{type:"codedValue",name:"esriDirectionPointType",codedValues:[{name:b.esriDITUnknown,code:0},{name:"",code:1},{name:b.esriDITManeuverArrive,code:50},{name:b.esriDITManeuverDepart,code:51},{name:b.esriDITManeuverStraight,code:52},{name:b.esriDITManeuverFerryOn,code:100},{name:b.esriDITManeuverFerryOff,code:101},{name:b.esriDITManeuverForkCenter,code:102},{name:b.esriDITManeuverRoundabout,code:103},{name:b.esriDITManeuverUTurn,code:104},{name:b.esriDITManeuverDoor,
code:150},{name:b.esriDITManeuverStairs,code:151},{name:b.esriDITManeuverElevator,code:152},{name:b.esriDITManeuverEscalator,code:153},{name:b.esriDITManeuverPedestrianRamp,code:154},{name:b.esriDITManeuverForkLeft,code:200},{name:b.esriDITManeuverRampLeft,code:201},{name:b.esriDITManeuverRoundaboutLeft,code:202},{name:b.esriDITManeuverUTurnLeft,code:203},{name:b.esriDITManeuverBearLeft,code:204},{name:b.esriDITManeuverTurnLeft,code:205},{name:b.esriDITManeuverSharpLeft,code:206},{name:b.esriDITManeuverTurnLeftLeft,
code:207},{name:b.esriDITManeuverTurnLeftRight,code:208},{name:b.esriDITManeuverForkRight,code:300},{name:b.esriDITManeuverRampRight,code:301},{name:b.esriDITManeuverRoundaboutRight,code:302},{name:b.esriDITManeuverUTurnRight,code:303},{name:b.esriDITManeuverBearRight,code:304},{name:b.esriDITManeuverTurnRight,code:305},{name:b.esriDITManeuverSharpRight,code:306},{name:b.esriDITManeuverTurnRightLeft,code:307},{name:b.esriDITManeuverTurnRightRight,code:308},{name:b.esriDITManeuverElevatorUp,code:400},
{name:b.esriDITManeuverEscalatorUp,code:401},{name:b.esriDITManeuverStairsUp,code:402},{name:b.esriDITManeuverElevatorDown,code:500},{name:b.esriDITManeuverEscalatorDown,code:501},{name:b.esriDITManeuverStairsDown,code:502},{name:b.esriDITEvent,code:1E3},{name:b.esriDITEventLandmark,code:1001},{name:b.esriDITEventTimeZone,code:1002},{name:b.esriDITEventTraffic,code:1003},{name:b.esriDITEventBarrier,code:1004},{name:b.esriDITEventBoundary,code:1005},{name:b.esriDITEventRestrictionViolation,code:1006}]}));
d.push(this._createField("DisplayText",a.fields.directions.DisplayText,"string",!0,null,2048));d.push(this._createField("ArrivalTime",a.fields.directions.ArrivalTime,"date",f));d.push(this._createField("ArrivalUTCOffset",a.fields.directions.UTCOffset,"integer",f));d.push(this._createField("Azimuth",a.fields.directions.Azimuth,"double",!0));d.push(this._createField("Name",a.fields.directions.Name,"string",!0,null,2048));d.push(this._createField("AlternateName",a.fields.directions.AlternativeName,"string",
!0,null,2048));d.push(this._createField("ExitName",a.fields.directions.ExitName,"string",!0,null,2048));d.push(this._createField("IntersectingName",a.fields.directions.IntersectingName,"string",!0,null,2048));d.push(this._createField("BranchName",a.fields.directions.BranchName,"string",!0,null,2048));d.push(this._createField("TowardName",a.fields.directions.TowardName,"string",!0,null,2048));d.push(this._createField("ShortVoiceInstruction",a.fields.directions.VoiceShortText,"string",!0,null,2048));
d.push(this._createField("VoiceInstruction",a.fields.directions.VoiceFullText,"string",!0,null,2048));d.push(this._createField("Level",a.fields.directions.Level,"integer",!0));for(var b=0,k=d=!1,m=0;m<e.length;m++){var l=e[m],p=l.geometry,l=l.attributes;p&&l&&(d=d||void 0!==p.m,k=k||void 0!==p.hasZ,l.DirectionPointType=this._itemStringToItemCode(l.DirectionPointType),g.featureSet.features.push({geometry:n.mixin(p&&p.toJson?p.toJson():p,d?{m:p.m}:{}),attributes:void 0!==l.__OBJECTID?l:n.mixin(l,{__OBJECTID:++b})}))}n.mixin(g.layerDefinition,
{extent:h.toJson?h.toJson():h,hasM:d,hasZ:k});e=new x(new E(this.directionPointSymbol));g.layerDefinition.drawingInfo.renderer=e.toJson();g.popupInfo={title:"{DisplayText}",fieldInfos:[{fieldName:"DirectionPointType",label:a.fields.directions.ItemType,isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"DisplayText",label:a.fields.directions.DisplayText,isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"Sequence",label:a.fields.directions.Sequence,
isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"StopID",label:a.fields.directions.StopID,isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalTime",label:a.fields.directions.ArrivalTime,isEditable:!0,tooltip:"",visible:f,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"ArrivalUTCOffset",label:a.fields.directions.UTCOffset,isEditable:!1,
tooltip:"",visible:f,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Azimuth",label:a.fields.directions.Azimuth,isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Name",label:a.fields.directions.Name,isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"AlternateName",label:a.fields.directions.AlternativeName,isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"ExitName",
label:a.fields.directions.ExitName,isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"IntersectingName",label:a.fields.directions.IntersectingName,isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"BranchName",label:a.fields.directions.BranchName,isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"TowardName",label:a.fields.directions.TowardName,isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"ShortVoiceInstruction",
label:a.fields.directions.VoiceShortText,isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"VoiceInstruction",label:a.fields.directions.VoiceFullText,isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]};c.layers.push(g)},_addDirectionLinesToLayerInfo_100:function(c,a,e,h){a=t.networkAnalysis;var b=a.enums.esriDirectionsLineType,g=this._generateFeatureCollectionTemplate("DirectionLines",a.sharing.directionLinesLayer,
"esriGeometryPolyline"),d=g.layerDefinition.fields;d.push(this._createField("DirectionPointID",a.fields.directionLines.DirectionPointID,"integer"));d.push(this._createField("DirectionLineType",a.fields.directionLines.LineType,"integer",!0,{type:"codedValue",name:"esriDirectionsLineType",codedValues:[{name:b.esriDLTUnknown,code:0},{name:b.esriDLTSegment,code:1},{name:b.esriDLTSegmentManeuver,code:2},{name:b.esriDLTSoftRestrictionViolation,code:3},{name:b.esriDLTBarrier,code:4},{name:b.esriDLTStopAndGoTraffic,
code:5},{name:b.esriDLTSlowTraffic,code:6},{name:b.esriDLTModerateTraffic,code:7}]}));d.push(this._createField("Meters",a.fields.directionLines.Meters,"double",!0));d.push(this._createField("Minutes",a.fields.directionLines.Minutes,"double",!0));d.push(this._createField("FromLevel",a.fields.directionLines.LevelFrom,"integer"));d.push(this._createField("ToLevel",a.fields.directionLines.LevelTo,"integer"));for(var b=0,f=d=!1,k=0;k<e.length;k++){var m=e[k],l=m.geometry,m=m.attributes;l&&m&&(d=d||l.hasM||
!1,f=f||l.hasZ||!1,m.DirectionLineType=this._lineTypeStringToLineTypeCode(m.DirectionLineType),g.featureSet.features.push({geometry:l&&l.toJson?l.toJson():l,attributes:void 0!==m.__OBJECTID?m:n.mixin(m,{__OBJECTID:++b})}))}n.mixin(g.layerDefinition,{extent:h.toJson?h.toJson():h,hasM:d,hasZ:f});e=new x(new F(this.directionLineSymbol));g.layerDefinition.drawingInfo.renderer=e.toJson();g.popupInfo={title:a.sharing.directionLinesLayer,fieldInfos:[{fieldName:"DirectionLineType",label:a.fields.directionLines.LineType,
isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"Meters",label:a.fields.directionLines.Meters,isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Minutes",label:a.fields.directionLines.Minutes,isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DirectionPointID",label:a.fields.directionLines.DirectionPointID,isEditable:!1,tooltip:"",visible:!0,format:{places:0,
digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"FromLevel",label:a.fields.directionLines.LevelFrom,isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ToLevel",label:a.fields.directionLines.LevelTo,isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]};c.layers.push(g)},_loadDirectionsFeatureSet_100:function(c,a,e,h,b,g){var d=[],
f,k=function(c){for(var b=0;b<a.length;b++)if(a[b].attributes.DirectionSequence==c)return a[b];return null},m=n.hitch(this,function(a){for(var b=[];a<c.length&&0===c[a].attributes.DirectionPointType.indexOf("esriDPTEvent");)b.push({ETA:this.toGeolocalTime(c[a].attributes.ArrivalTime,c[a].attributes.ArrivalUTCOffset),arriveTimeUTC:null===c[a].attributes.ArrivalUTCOffset?void 0:c[a].attributes.ArrivalTime,strings:c[a].attributes.DisplayText?[{string:c[a].attributes.DisplayText,stringType:"esriDSTGeneral"}]:
[],point:{x:c[a].geometry.x,y:c[a].geometry.y}}),a++;return b});for(f=0;f<c.length;f++)if(c[f].attributes.DirectionPointType=this._itemCodeToItemString(c[f].attributes.DirectionPointType),c[f].attributes.StopSequence)for(var l=0;l<e.length;l++)e[l].attributes.Sequence===c[f].attributes.StopSequence&&(c[f]._associatedStopRecord=e[l]);for(f=0;f<c.length;f++)if(e=c[f].attributes.DirectionPointType,0===e.indexOf("esriDPTManeuver")||"esriDPTUnknown"===e){var l=k(c[f].attributes.Sequence),p=void 0!==c[f].geometry.m;
e={attributes:{length:this.fromMeters(l&&l.attributes.Meters||c[f]._associatedStopRecord&&c[f]._associatedStopRecord.attributes.ServiceMeters||0,h),time:this.fromMinutes(l&&l.attributes.Minutes||c[f]._associatedStopRecord&&c[f]._associatedStopRecord.attributes.ServiceMinutes||0,b),text:c[f].attributes.DisplayText,ETA:this.toGeolocalTime(c[f].attributes.ArrivalTime,c[f].attributes.ArrivalUTCOffset),arriveTimeUTC:null===c[f].attributes.ArrivalUTCOffset?void 0:c[f].attributes.ArrivalTime,maneuverType:this._itemToManeuverType(e),
_stopSequence:c[f].attributes.StopSequence},geometry:l?l.geometry:{paths:p?[[[c[f].geometry.x,c[f].geometry.y,c[f].geometry.m],[c[f].geometry.x,c[f].geometry.y,c[f].geometry.m]]]:[[[c[f].geometry.x,c[f].geometry.y],[c[f].geometry.x,c[f].geometry.y]]],hasM:p,spatialReference:g},strings:function(){var a=[],b=c[f].attributes;b.Name&&a.push({string:b.Name,stringType:"esriDSTStreetName"});b.AlternateName&&a.push({string:b.Name,stringType:"esriDSTAltName"});b.ExitName&&a.push({string:b.Name,stringType:"esriDSTExit"});
b.IntersectingName&&a.push({string:b.Name,stringType:"esriDSTCrossStreet"});b.BranchName&&a.push({string:b.Name,stringType:"esriDSTBranch"});b.TowardName&&a.push({string:b.Name,stringType:"esriDSTToward"});return a}(),events:m(c[f].attributes.Sequence)};0===e.strings.length&&delete e.strings;d.push(e)}return d},_generateFeatureCollectionTemplate:function(c,a,e){return{layerDefinition:{name:c,title:a,geometryType:e,objectIdField:"__OBJECTID",type:"Feature Layer",typeIdField:"",drawingInfo:{fixedSymbols:!0},
fields:[{name:"__OBJECTID",alias:"OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null}],types:[],capabilities:"Query,Update"},featureSet:{features:[],geometryType:e}}},_createField:function(c,a,e,h,b,g){return"integer"===e?{name:c,alias:a,type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!!h,domain:b}:"double"===e?{name:c,alias:a,type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!!h,domain:b}:"date"===e?{name:c,alias:a,type:"esriFieldTypeDate",length:36,editable:!0,
nullable:!0,visible:!!h,domain:b}:{name:c,alias:a,type:"esriFieldTypeString",length:g||255,editable:!0,nullable:!0,visible:!!h,domain:b}},_itemToManeuverType:function(c){switch(c){case "esriDPTManeuverArrive":return"esriDMTStop";case "esriDPTManeuverDepart":return"esriDMTDepart";case "esriDPTManeuverDoor":return"esriDMTDoorPassage";case "esriDPTManeuverBearLeft":return"esriDMTBearLeft";case "esriDPTManeuverBearRight":return"esriDMTBearRight";case "esriDPTManeuverElevator":case "esriDPTManeuverElevatorUp":case "esriDPTManeuverElevatorDown":return"esriDMTElevator";
case "esriDPTManeuverEscalator":case "esriDPTManeuverEscalatorDown":case "esriDPTManeuverEscalatorUp":return"esriDMTEscalator";case "esriDPTManeuverFerryOn":return"esriDMTFerry";case "esriDPTManeuverFerryOff":return"esriDMTEndOfFerry";case "esriDPTManeuverForkCenter":return"esriDMTForkCenter";case "esriDPTManeuverForkLeft":return"esriDMTForkLeft";case "esriDPTManeuverForkRight":return"esriDMTForkRight";case "esriDPTManeuverPedestrianRamp":return"esriDMTPedestrianRamp";case "esriDPTManeuverRampLeft":return"esriDMTRampLeft";
case "esriDPTManeuverRampRight":return"esriDMTRampRight";case "esriDPTManeuverRoundabout":case "esriDPTManeuverRoundaboutLeft":case "esriDPTManeuverRoundaboutRight":return"esriDMTRoundabout";case "esriDPTManeuverTurnLeft":return"esriDMTTurnLeft";case "esriDPTManeuverTurnLeftLeft":return"esriDMTLeftLeft";case "esriDPTManeuverTurnLeftRight":return"esriDMTLeftRight";case "esriDPTManeuverTurnRight":return"esriDMTTurnRight";case "esriDPTManeuverTurnRightLeft":return"esriDMTRightLeft";case "esriDPTManeuverTurnRightRight":return"esriDMTRightRight";
case "esriDPTManeuverSharpLeft":return"esriDMTSharpLeft";case "esriDPTManeuverSharpRight":return"esriDMTSharpRight";case "esriDPTManeuverStraight":return"esriDMTStraight";case "esriDPTManeuverStairs":case "esriDPTManeuverStairsUp":case "esriDPTManeuverStairsDown":return"esriDMTStrairs";case "esriDPTManeuverUTurn":case "esriDPTManeuverUTurnLeft":case "esriDPTManeuverUTurnRight":return"esriDMTUTurn"}return"esriDMTUnknown"},_itemStringToItemCode:function(c){switch(c){case "esriDPTHeader":return 1;case "esriDPTManeuverArrive":return 50;
case "esriDPTManeuverDepart":return 51;case "esriDPTManeuverStraight":return 52;case "esriDPTManeuverFerryOn":return 100;case "esriDPTManeuverFerryOff":return 101;case "esriDPTManeuverForkCenter":return 102;case "esriDPTManeuverRoundabout":return 103;case "esriDPTManeuverUTurn":return 104;case "esriDPTManeuverDoor":return 150;case "esriDPTManeuverStairs":return 151;case "esriDPTManeuverElevator":return 152;case "esriDPTManeuverEscalator":return 153;case "esriDPTManeuverPedestrianRamp":return 154;
case "esriDPTManeuverForkLeft":return 200;case "esriDPTManeuverRampLeft":return 201;case "esriDPTManeuverRoundaboutLeft":return 202;case "esriDPTManeuverUTurnLeft":return 203;case "esriDPTManeuverBearLeft":return 204;case "esriDPTManeuverTurnLeft":return 205;case "esriDPTManeuverSharpLeft":return 206;case "esriDPTManeuverTurnLeftLeft":return 207;case "esriDPTManeuverTurnLeftRight":return 208;case "esriDPTManeuverForkRight":return 300;case "esriDPTManeuverRampRight":return 301;case "esriDPTManeuverRoundaboutRight":return 302;
case "esriDPTManeuverUTurnRight":return 303;case "esriDPTManeuverBearRight":return 304;case "esriDPTManeuverTurnRight":return 305;case "esriDPTManeuverSharpRight":return 306;case "esriDPTManeuverTurnRightLeft":return 307;case "esriDPTManeuverTurnRightRight":return 308;case "esriDPTManeuverElevatorUp":return 400;case "esriDPTManeuverEscalatorUp":return 401;case "esriDPTManeuverStairsUp":return 402;case "esriDPTManeuverElevatorDown":return 500;case "esriDPTManeuverEscalatorDown":return 501;case "esriDPTManeuverStairsDown":return 502;
case "esriDPTEvent":return 1E3;case "esriDPTEventLandmark":return 1001;case "esriDPTEventTimeZone":return 1002;case "esriDPTEventTraffic":return 1003;case "esriDPTEventBarrier":return 1004;case "esriDPTEventBoundary":return 1005;case "esriDPTEventRestrictionViolation":return 1006}return 0},_itemCodeToItemString:function(c){switch(c){case 1:return"esriDPTHeader";case 50:return"esriDPTManeuverArrive";case 51:return"esriDPTManeuverDepart";case 52:return"esriDPTManeuverStraight";case 100:return"esriDPTManeuverFerryOn";
case 101:return"esriDPTManeuverFerryOff";case 102:return"esriDPTManeuverForkCenter";case 103:return"esriDPTManeuverRoundabout";case 104:return"esriDPTManeuverUTurn";case 150:return"esriDPTManeuverDoor";case 151:return"esriDPTManeuverStairs";case 152:return"esriDPTManeuverElevator";case 153:return"esriDPTManeuverEscalator";case 154:return"esriDPTManeuverPedestrianRamp";case 200:return"esriDPTManeuverForkLeft";case 201:return"esriDPTManeuverRampLeft";case 202:return"esriDPTManeuverRoundaboutLeft";case 203:return"esriDPTManeuverUTurnLeft";
case 204:return"esriDPTManeuverBearLeft";case 205:return"esriDPTManeuverTurnLeft";case 206:return"esriDPTManeuverSharpLeft";case 207:return"esriDPTManeuverTurnLeftLeft";case 208:return"esriDPTManeuverTurnLeftRight";case 300:return"esriDPTManeuverForkRight";case 301:return"esriDPTManeuverRampRight";case 302:return"esriDPTManeuverRoundaboutRight";case 303:return"esriDPTManeuverUTurnRight";case 304:return"esriDPTManeuverBearRight";case 305:return"esriDPTManeuverTurnRight";case 306:return"esriDPTManeuverSharpRight";
case 307:return"esriDPTManeuverTurnRightLeft";case 308:return"esriDPTManeuverTurnRightRight";case 400:return"esriDPTManeuverElevatorUp";case 401:return"esriDPTManeuverEscalatorUp";case 402:return"esriDPTManeuverStairsUp";case 500:return"esriDPTManeuverElevatorDown";case 501:return"esriDPTManeuverEscalatorDown";case 502:return"esriDPTManeuverStairsDown";case 1E3:return"esriDPTEvent";case 1001:return"esriDPTEventLandmark";case 1002:return"esriDPTEventTimeZone";case 1003:return"esriDPTEventTraffic";
case 1004:return"esriDPTEventBarrier";case 1005:return"esriDPTEventBoundary";case 1006:return"esriDPTEventRestrictionViolation"}return"esriDPTUnknown"},_lineTypeStringToLineTypeCode:function(c){switch(c){case "esriDLTSegment":return 1;case "esriDLTManeuverSegment":return 2;case "esriDLTRestrictionViolation":return 3;case "esriDLTBarrier":return 4;case "esriDLTStopAndGoTraffic":return 5;case "esriDLTSlowTraffic":return 6;case "esriDLTModerateTraffic":return 7}return 0},_lineTypeCodeToLineTypeString:function(c){switch(c){case 1:return"esriDLTSegment";
case 2:return"esriDLTManeuverSegment";case 3:return"esriDLTRestrictionViolation";case 4:return"esriDLTBarrier";case 5:return"esriDLTStopAndGoTraffic";case 6:return"esriDLTSlowTraffic";case 7:return"esriDLTModerateTraffic"}return"esriDLTUnknown"}})});