1"use strict";(self.webpackChunkuar_web=self.webpackChunkuar_web||[]).push([["1769"],{40532:function(e,t,n){n.d(t,{A:function(){return p}}),n(9087);var o=n(29466),r=n(47370),a=n(32485),i=n.n(a),l=n(98099),s=n(60305),c=n(134),u=(0,n(60448).n9)()(function(e){return{labelWithTooltip:{display:"flex"},tooltipContainer:{fontWeight:700,backgroundColor:e.palette.common.foreground.inverse,fontSize:e.typography.pxToRem(14),color:e.palette.common.foreground.primary},toolTipIcon:(0,c.A)({width:12,height:12,fill:e.palette.common.foreground.primary,verticalAlign:"top",marginTop:10,marginLeft:5},e.breakpoints.down("md"),{marginTop:3}),value:{display:"inline-block",color:e.palette.common.black,lineHeight:e.typography.pxToRem(52)},ghostValue:{width:"fit-content",height:e.typography.pxToRem(52)},label:{display:"inline-flex",marginTop:e.spacing(1),height:e.typography.pxToRem(16),"& span:first-child":{whiteSpace:"nowrap"}},labelText:{fontWeight:600,fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(14),lineHeight:e.typography.pxToRem(16),color:e.palette.support.range.four,textTransform:"capitalize"},unit:{textTransform:"lowercase"}}}),d=n(74848),p=function(e){var t=e.className,n=e.valueClass,a=e.labelClass,c=e.unitClass,p=e.isLoading,f=e.label,g=e.unit,m=e.value,h=e.tooltip,v=e.shouldShowZero,x=e.ghostValueWidth,y=e.ghostLabelWidth,b=u().classes;return!(void 0!==v&&v)&&[0,"0","00:00"].includes(m)?null:(0,d.jsxs)("div",{className:t,children:[(0,d.jsxs)("div",{className:b.labelWithTooltip,children:[p?(0,d.jsx)(l.A,{center:!0,height:40,width:void 0===x?60:x,containerClass:b.ghostValue}):(0,d.jsx)(s.A,{variant:"s4",color:"primary",className:i()(n,b.value),children:m}),h&&(0,d.jsx)(o.A,{title:h,classes:{tooltip:b.tooltipContainer},"aria-label":"total title",placement:"top",enterTouchDelay:100,children:(0,d.jsx)(r.A,{className:b.toolTipIcon})})]}),(0,d.jsx)("div",{className:b.label,children:p?(0,d.jsx)(l.A,{center:!1,height:16,width:void 0===y?95:y}):(0,d.jsxs)(s.A,{variant:"body1",className:i()(a,b.labelText),children:[f,g&&(0,d.jsx)("span",{className:i()(b.unit,c),children:" (".concat(g,")")})]})})]})}},77810:function(e,t,n){n.d(t,{A:function(){return u}});var o=n(76249),r=n(96540),a=n(60448),i=n(80036),l=n(85806),s=n(134),c=n(74848),u=(0,a.Xy)(function(e){var t=e.classes,n=e.children,a=e.isOpen,s=e.onClose,u=e.onConfirm,d=e.disableAutoFocus,p=e.disableBackdropClick,f=e.disableEnforceFocus,g=e.disableEscapeKeyDown,m=e.disableRestoreFocus,h=e.disableScrollLock,v=e.hideBackdrop,x=e.confirmText,y=e.dismissText,b=(0,r.useState)(!1),k=(0,o.A)(b,2),w=k[0],j=k[1];return(0,r.useEffect)(function(){a||j(!1)},[a]),(0,c.jsxs)(l.a,{isOpen:a,onClose:s,disableAutoFocus:d,disableEnforceFocus:f,disableEscapeKeyDown:g,disableRestoreFocus:m,disableScrollLock:h,disableBackdropClick:p,hideBackdrop:v,children:[n,(0,c.jsxs)("div",{className:t.buttonContainer,children:[(0,c.jsx)(i.$n,{variant:"outlined",color:"primary",disabled:w,className:t.button,onClick:s,children:y}),(0,c.jsx)(i.$n,{variant:"contained",color:"primary",loading:w,disabled:w,className:t.button,onClick:function(){j(!0),u()},children:x})]})]})},function(e){return{buttonContainer:(0,s.A)({width:"100%",display:"flex",flexWrap:"nowrap",textAlign:"center",justifyContent:"center",columnGap:e.typography.pxToRem(16)},e.breakpoints.down("lg"),{rowGap:16,flexDirection:"column",alignItems:"center"}),button:(0,s.A)({flexGrow:0,flexShrink:1,flexBasis:"50%"},e.breakpoints.down("lg"),{flexBasis:"auto",width:e.typography.pxToRem(264)})}})},59663:function(e,t,n){n.d(t,{A:function(){return p}});var o=n(66577),r=n(25184),a=n(20973),i=n(32485),l=n.n(i),s=n(60448),c=n(23694),u=n(134),d=n(74848),p=(0,s.Xy)(function(e){var t=e.classes,n=e.children,i=e.isOpen,s=e.onClose,u=e.disableAutoFocus,p=e.disableEnforceFocus,f=e.disableBackdropClick,g=e.disableEscapeKeyDown,m=e.disableRestoreFocus,h=e.disableScrollLock,v=e.hideBackdrop,x=e.hideCancel,y=e.modalClass,b=e.contentClass;return(0,d.jsx)(o.A,{open:!!i,disableAutoFocus:void 0===u||u,disableEnforceFocus:p,disableEscapeKeyDown:void 0!==g&&g,disableRestoreFocus:void 0===m||m,disableScrollLock:h,hideBackdrop:v,BackdropComponent:r.A,BackdropProps:{timeout:300},children:(0,d.jsx)(a.A,{in:i,timeout:300,children:(0,d.jsx)("div",{id:"backdrop",role:"dialog","aria-modal":"true","aria-label":"Modal",className:t.container,onClick:void 0!==f&&f?null:function(e){"backdrop"===e.target.id&&s()},children:(0,d.jsxs)("div",{className:l()(t.modal,y),children:[!(void 0!==x&&x)&&(0,d.jsx)("div",{className:t.iconContainer,children:(0,d.jsx)(c.A,{className:t.cancelIcon,name:"x",tabIndex:0,onClick:s,onKeyUp:function(e){"Enter"===e.key&&s()}})}),(0,d.jsx)("div",{className:l()(t.contentContainer,b),children:n})]})})})})},function(e){return{container:{top:0,left:0,right:0,bottom:0,display:"flex",position:"absolute",flexDirection:"column",paddingLeft:e.typography.pxToRem(16),paddingRight:e.typography.pxToRem(16),"&:focus":{outline:"none"}},modal:{top:"50%",left:"50%",minHeight:0,overflowY:"auto",position:"relative",transform:"translate(-50%, -50%)",maxWidth:e.typography.pxToRem(584),minWidth:e.typography.pxToRem(272),backgroundColor:e.palette.common.white,"&:focus":{outline:"none"}},iconContainer:{top:0,width:"calc(100% - 6px)",position:"absolute",height:e.typography.pxToRem(24),marginTop:e.typography.pxToRem(6)},cancelIcon:{right:0,top:"50%",cursor:"pointer",position:"absolute",transform:"translateY(-50%)",transition:"fill 200ms ease-out",height:e.typography.pxToRem(24),width:e.typography.pxToRem(24),fill:e.palette.common.brand.black,"&:hover":{fill:e.palette.common.brand.red},"@media (hover: none)":{"&:hover":{outline:0,borderRadius:4,fill:e.palette.common.brand.black,boxShadow:"0 0 0 2px ".concat(e.palette.common.brand.black)}},"&:focus":{outline:0,borderRadius:4,boxShadow:"0 0 0 2px ".concat(e.palette.common.brand.black)}},contentContainer:(0,u.A)((0,u.A)({position:"relative"},e.breakpoints.up("lg"),{marginTop:e.typography.pxToRem(48),marginRight:e.typography.pxToRem(48),marginBottom:e.typography.pxToRem(40),marginLeft:e.typography.pxToRem(48)}),e.breakpoints.down("xl"),{marginTop:e.typography.pxToRem(48),marginRight:e.typography.pxToRem(40),marginBottom:e.typography.pxToRem(40),marginLeft:e.typography.pxToRem(40)})}})},85806:function(e,t,n){n.d(t,{R:function(){return o.A},a:function(){return r.A}});var o=n(77810),r=n(59663)},62810:function(e,t,n){n.d(t,{A:function(){return d}});var o=n(134),r=n(32485),a=n.n(r),i=n(17437),l=n(60448),s=(0,i.i7)({from:{backgroundPosition:"-1000px 0"},to:{backgroundPosition:"1000px 0"}}),c=(0,l.n9)()(function(e){return{container:{display:"flex",width:"100%",height:"100%"}
1,center:{justifyContent:"center",alignItems:"center"},centerX:{justifyContent:"center"},centerY:{alignItems:"center"},circle:{borderRadius:"50% !important"},element:{borderRadius:e.typography.pxToRem(4),backgroundColor:e.palette.support.range.two},animate:{animation:"".concat(s," 3s infinite linear")},normalColor:{background:"linear-gradient(to right, ".concat(e.palette.support.main," 4%, ").concat(e.palette.support.range.one," 25%, ").concat(e.palette.support.main," 36%)"),backgroundSize:"1000px 100%"},contrastColor:{background:"linear-gradient(to right, ".concat(e.palette.support.range.three," 4%, ").concat(e.palette.support.range.two," 25%, ").concat(e.palette.support.range.three," 36%)"),backgroundSize:"1000px 100%"}}}),u=n(74848),d=function(e){var t=e.className,n=e.containerClass,r=e.center,i=e.centerX,l=e.centerY,s=e.circle,d=e.height,p=e.width,f=e.color,g=void 0===f?"normal":f,m=c().classes;return(0,u.jsx)("div",{className:a()(n,(0,o.A)((0,o.A)((0,o.A)((0,o.A)({},m.container,!0),m.center,r),m.centerX,i),m.centerY,l)),children:(0,u.jsx)("div",{className:a()(t,(0,o.A)((0,o.A)((0,o.A)((0,o.A)((0,o.A)({},m.animate,!0),m.normalColor,"normal"===g),m.contrastColor,"contrast"===g),m.element,!0),m.circle,s)),style:{height:d,width:p}})})}},98099:function(e,t,n){n.d(t,{A:function(){return o.A}});var o=n(62810)},58339:function(e,t,n){n.d(t,{q:function(){return o}});var o={roadmap:"Road Map",terrain:"Terrain",satellite:"Satellite",hybrid:"Hybrid",OSM:"OpenStreet",USA_TOPO:"USA Topo",WORLD_TOPO:"World Topo"}},50457:function(e,t,n){n.d(t,{A:function(){return s}});var o=n(51214),r=n(39146),a=n(73263),i=(0,n(60448).n9)()(function(e){return{label:{color:e.palette.support.range.four,marginBottom:4},value:{color:e.palette.common.foreground.primary}}}),l=n(74848),s=function(e){var t=e.className,n=e.label,s=e.measurement,c=e.isDistance,u=e.unitType,d=i().classes,p=u===r._O;return(0,l.jsxs)("div",{className:t,children:[(0,l.jsx)(a.o5,{variant:"l3",className:d.label,children:n}),(0,l.jsx)(a.o5,{variant:"s5",className:d.value,children:void 0!==c&&c?(0,l.jsx)(o.e,{value:s,to:p?r.ty:r._v}):(0,l.jsx)(o.CR,{digits:0,value:s,to:p?r.x8:r.Tk})})]})}},58440:function(e,t,n){n.d(t,{A:function(){return c}});var o=n(67438),r=n(51214),a=n(39146),i=n(73263),l=(0,n(60448).n9)()(function(e){return{container:{background:e.palette.common.background.midground,border:"1px solid ".concat(e.palette.common.foreground.quaternary),padding:8},distance:{marginBottom:4}}}),s=n(74848),c=function(e){var t,n=e.active,c=e.payload,u=e.isImperial,d=l().classes;if(!n)return null;var p=null==c||null==(t=c[0])?void 0:t.payload;return p?(0,s.jsx)("div",{className:d.container,children:(0,s.jsxs)("dl",{children:[(0,s.jsx)(i.o5,{variant:"h5",className:d.distance,children:(0,s.jsx)(r.e,{value:p.distance,digits:2,to:u?a.ty:a._v})}),(0,s.jsx)("div",{children:(0,s.jsxs)(i.o5,{variant:"caption",children:[(0,s.jsx)(o.A,{id:"workout.time_series.tooltip.elevation",defaultMessage:"Elevation: "}),(0,s.jsx)(r.CR,{value:p.elevation,digits:0,to:u?a.x8:a.Tk})]})})]})}):null}},75773:function(e,t,n){n.d(t,{A:function(){return rj}}),n(39813),n(3504);var o=n(69736),r=n.n(o),a=n(44301),i=n.n(a),l=n(82731),s=n.n(l),c=n(59614),u=n.n(c),d=n(969),p=n.n(d),f=n(66681),g=n.n(f),m=n(76249),h=n(134),v=n(96540),x=n(57614),y=n(2984),b=n(36631),k=n(56347),w=n(74848),j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=(0,v.useState)(!1),n=(0,m.A)(t,2),o=n[0],r=n[1];return(0,v.useEffect)(function(){var t=function(t){if(o)return t.returnValue=e,e};return window.addEventListener("beforeunload",t),function(){return window.removeEventListener("beforeunload",t)}},[o]),[(0,w.jsx)(k.XG,{when:o,message:e}),r]},M=n(38221),A=n.n(M),C=n(67438),T=n(3279),R=n(52956),S=n(10132),N=n(55931),E=n(27767),L=n(54416),P=n(46274);n(15144),n(95853),n(54913);var B=n(44675),D=n(5886),F=n(99167),I=n(46831),H=n(66286),O=n(90463),_=n(33551),W=n(64705),G=n(80685),z=n(38809),K=n(20256),U=n(96994),Y=n(13035),q=n(58992),V=n(7970),J=n(60448),$=(0,J.n9)()(function(e){return{dialog:{"& .MuiDialog-paper":(0,h.A)({minWidth:400,maxWidth:600,overflow:"hidden"},e.breakpoints.down("md"),{minWidth:"auto",maxWidth:"90vw"})},dialogTitle:{paddingBottom:e.spacing(1)},inputContainer:{display:"flex",alignItems:"center",gap:e.spacing(2),marginBottom:e.spacing(3)},selectedIconDisplay:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:40,"& svg":{fontSize:32,color:e.palette.text.primary}},textInput:{flex:1},iconGrid:{marginTop:e.spacing(2)},iconButton:{display:"flex",alignItems:"center",justifyContent:"center",aspectRatio:"1",padding:e.spacing(2),border:"2px s
1olid transparent",borderRadius:e.shape.borderRadius,cursor:"pointer",transition:"all 0.2s ease",backgroundColor:e.palette.background.paper,"&:hover":{backgroundColor:e.palette.action.hover},"& svg":{fontSize:32,color:e.palette.text.primary}},iconButtonSelected:{border:"2px solid ".concat(e.palette.primary.main),backgroundColor:e.palette.action.selected},mvpMessage:{padding:e.spacing(3),backgroundColor:e.palette.grey[100],borderRadius:e.shape.borderRadius,marginBottom:e.spacing(2),textAlign:"center"},emphasisLink:{color:e.palette.primary.main,fontWeight:"bold",textDecoration:"underline","&:hover":{color:e.palette.primary.dark}},dialogActions:{padding:e.spacing(2,3),justifyContent:"space-between"},cancelButton:{color:e.palette.error.main,fontWeight:700,"&:hover":{backgroundColor:"transparent",textDecoration:"underline"}},saveButton:{backgroundColor:e.palette.common.black,color:e.palette.common.white,fontWeight:700,padding:e.spacing(1.5,4),"&:hover":{backgroundColor:e.palette.grey[800]},"&:disabled":{backgroundColor:e.palette.action.disabledBackground,color:e.palette.action.disabled}},removeButton:{color:e.palette.error.main,fontWeight:700,padding:e.spacing(.5,1),minWidth:"auto","&:hover":{backgroundColor:"transparent",textDecoration:"underline"}}}}),X=n(28119),Q=(0,X.YK)({title:{id:"routes.customMarker.title",defaultMessage:"ADD MAP MARKER"},editTitle:{id:"routes.customMarker.editTitle",defaultMessage:"EDIT MAP MARKER"},iconLabel:{id:"routes.customMarker.iconLabel",defaultMessage:"Icon"},labelInput:{id:"routes.customMarker.labelInput",defaultMessage:"Label"},labelPlaceholder:{id:"routes.customMarker.labelPlaceholder",defaultMessage:"Enter waypoint label"},selectIconPlaceholder:{id:"routes.customMarker.selectIconPlaceholder",defaultMessage:"Select an icon"},save:{id:"routes.customMarker.save",defaultMessage:"Save"},cancel:{id:"routes.customMarker.cancel",defaultMessage:"Cancel"},close:{id:"routes.customMarker.close",defaultMessage:"Close"},mvpFeatureMessage:{id:"routes.customMarker.mvpFeatureMessage",defaultMessage:"Custom Map Markers are an MVP Feature"},learnMore:{id:"routes.customMarker.learnMore",defaultMessage:"Click {here} to learn more about adding custom icons and labels to your route, or {upgrade}."},learnMoreHere:{id:"routes.customMarker.learnMoreHere",defaultMessage:"here"},upgradeToMvp:{id:"routes.customMarker.upgradeToMvp",defaultMessage:"Upgrade to MVP"},none:{id:"routes.customMarker.none",defaultMessage:"None (Remove Marker)"},removeMarker:{id:"routes.customMarker.removeMarker",defaultMessage:"Remove Marker"}});function Z(e,t){var n=r()(e);if(i()){var o=i()(e);t&&(o=o.filter(function(t){return s()(e,t).enumerable})),n.push.apply(n,o)}return n}function ee(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(n),!0).forEach(function(t){(0,h.A)(e,t,n[t])}):u()?p()(e,u()(n)):Z(Object(n)).forEach(function(t){g()(e,t,s()(n,t))})}return e}var et={start:q.yZ,finish:q.NX,medical:q.DF,water_station:q.jD,photographer:q.pP,toilets:q.st,turn_left:q.Kf,turn_right:q.$b,information:q.uQ},en={customWaypointSavedEvent:P.customWaypointSavedEvent,upsellViewedEvent:P.upsellViewedEvent,customLinkClickedEvent:P.customLinkClickedEvent,customButtonClickedEvent:P.customButtonClickedEvent},eo=(0,R.Ng)(function(e){return{isPremium:(0,V.Y4)(e)}},en)((0,T.Ay)(function(e){var t=e.open,n=e.onClose,o=e.onSave,r=e.waypointData,a=e.isPremium,i=e.intl,l=e.customWaypointSavedEvent,s=e.upsellViewedEvent,c=e.customLinkClickedEvent,u=e.customButtonClickedEvent,d=$().classes,p=(0,B.A)(),f=(0,D.A)(p.breakpoints.down("md")),g=(0,v.useState)(""),h=(0,m.A)(g,2),x=h[0],y=h[1],b=(0,v.useState)(""),k=(0,m.A)(b,2),j=k[0],M=k[1],A=(0,v.useState)(!1),T=(0,m.A)(A,2),R=T[0],S=T[1],N=(0,Y.Jk)(),E=f?4:7;(0,v.useEffect)(function(){if(null!=r&&r.marker){var e=(0,Y.du)(r.marker.markerId);y((null==e?void 0:e.id)||""),M(r.marker.notes||""),S(!0)}else t&&(y(""),M(""),S(!1))},[r,t]),(0,v.useEffect)(function(){t&&!a&&s("Custom Map Marker Upsell")},[t,a,s]);var L=function(e){if(y(e),!R){var t=N.find(function(t){return t.value===e});t&&M(t.label)}},P=function(){a||u("Close","Custom Map Marker Upsell"),n()},q=x?et[x]:null;return(0,w.jsxs)(F.A,{open:t,onClose:P,className:d.dialog,maxWidth:"md",fullWidth:!0,children:[(0,w.jsx)(I.A,{className:d.dialogTitle,children:(0,w.jsx)(C.A,ee({},null!=r&&r.marker?Q.editTitle:Q.title))}),(0,w.jsx)(H.A,{children:a?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(O.A,{className:d.inputContainer,children:[(0,w.jsx)(O.A,{className:d.selectedIconDisplay,children:q&&(0,w.jsx)(q,{})}),(0,w.jsx)(G.A,{className:d.textInput,value:j,onChange:function(e){M(e.target.value.slice(0,50)),S(!0)},placeholder:i.formatMessage(x?Q.labelPlaceholder:Q.selectIconPlaceholder),variant:"outlined",fullWidth:!0,disabled:!x,inputProps:{maxLength:50}}),(null==r?void 0:r.marker)&&(0,w.jsx)(z.A,{onClick:function(){a&&(o({remove:!0}),n())},className:d.removeButton,children:"REMOVE"})]}),(0,w.jsx)(K.Ay,{container:!0,spacing:2,className:d.iconGrid,children:N.map(function(e){var t=et[e.value];return(0,w.jsx)(K.Ay,{item:!0,xs:12/E,children:(0,w.jsx)(O.A,{className:"".concat(d.iconButton," ").concat(x===e.value?d.iconButtonSelected:""),onClick:function(){return L(e.value)},children:t&&(0,w.jsx)(t,{})})},e.value)})})]}):(0,w.jsxs)(O.A,{className:d.mvpMessage,children:[(0,w.jsx)(_.A,{variant:"body1",gutterBottom:!0,children:(0,w.jsx)(C.A,ee({},Q.mvpFeatureMessage))}),(0,w.jsx)(_.A,{variant:"body2",children:(0,w.jsx)(C.A,ee(ee({},Q.learnMore),{},{values:{here:(0,w.jsx)(W.A,{href:"https://help.mapmyfitness.com/hc/articles/36605820530199",target:"_blank",rel:"noopener noreferrer",className:d.emphasisLink,onClick:function(){return c("Learn More","Custom Map Marker Upsell")},children:(0,w.jsx)(C.A,ee({},Q.learnMoreHere))}),upgrade:(0,w.jsx)(W.A,{href:"/mvp",target:"_blank",rel:"noopener noreferrer",className:d.emphasisLink,onClick:function(){return c("Upgrade to MVP","Custom Map Marker Upsell")},children:(0,w.jsx)(C.A,ee({},Q.upgradeToMvp))})}}))})]})}),(0,w.jsx)(U.A,{className:d.dialogActions,children:a?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(z.A,{onClick:P,className:d.cancelButton,children:(0,w.jsx)(C.A,ee({},Q.cancel))}),(0,w.jsx)(z.A,{onClick:function(){if(a&&x){var e=(0,Y.du)(x);e&&l(e.label),o({markerId:x,notes:j||""}),n()}},className:d.saveButton,variant:"contained",disabled:!x,children:(0,w.jsx)(C.A,ee({},Q.save))})]}):(0,w.jsx)(z.A,{onClick:P,className:d.cancelButton,children:(0,w.jsx)(C.A,ee({},Q.close))})})]})})),er=n(69857),ea=n(7471),ei=n(17809),el=n(32485),es=n.n(el),ec=n(30608),eu=n(40532),ed=n(73263),ep=n(50457),ef=(0,X.YK)({gradeIncrease:{i
1d:"map.editor.elevation.panel.gradeIncrease",defaultMessage:"Grade Increase"},gradeDecrease:{id:"map.editor.elevation.panel.gradeDecrease",defaultMessage:"Grade Decrease"},noChange:{id:"map.editor.elevation.panel.noChange",defaultMessage:"No Change"},sliderAriaMessage:{id:"map.editor.elevation.slider.aria",defaultMessage:"Elevation Slider"}}),eg=(0,J.n9)()(function(e,t,n){return{close:{cursor:"pointer"},header:{display:"flex",justifyContent:"space-between",marginBottom:16},elevationPanelText:{marginBottom:32},panel:{width:"100%",padding:16},gradeMessage:{color:e.palette.support.range.four},stats:{display:"flex",justifyContent:"space-between"},subtitle:{marginTop:32,marginBottom:16,textTransform:"uppercase",color:e.palette.common.brand.red},root:{height:8,padding:"32px 0 12px","&.Mui-disabled":{color:e.palette.common.brand.black}},thumb:(0,h.A)((0,h.A)({backgroundColor:"currentColor"},"&:focus, &:hover, &.".concat(n.active),{boxShadow:"inherit"}),"&.Mui-disabled",{marginTop:-4,height:15,width:15,border:"2px solid white"}),thumbTriangle:{backgroundColor:"transparent",borderLeft:"10px solid transparent",borderRight:"10px solid transparent",borderRadius:"0%","&.Mui-disabled":{width:0,height:0},"&:after":{content:'""',width:0,height:0,backgroundColor:"transparent",borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderRadius:"0%",left:-8}},thumbTriangleUp:{borderBottom:"16px solid white","&.Mui-disabled":{marginTop:-6},"&:after":{borderBottom:"14px solid currentColor",top:2}},thumbTriangleDown:{borderTop:"16px solid white","&.Mui-disabled":{marginTop:-2},"&:after":{borderTop:"14px solid currentColor",marginTop:-2}},active:{},valueLabel:{left:"calc(-50% + 4px)"},track:{height:8,borderRadius:4},rail:{height:8,borderRadius:4,opacity:1},marks:{display:"flex",justifyContent:"space-between",color:e.palette.support.range.four}}}),em=(0,R.Ng)(function(e){return{unitType:N.KR(e)}},{})((0,T.Ay)(function(e){var t=e.selectedElevation,n=e.onClose,o=e.intl,r=e.unitType,a=eg().classes,i=Math.max.apply(Math,(0,er.A)(t.map(function(e){return e.elevation}))),l=(0,ec.iQ)(t),s=t[0]||{},c=t[t.length-1]||{},u=s.distance,d=s.elevation,p=c.distance,f=(c.elevation-d)/(p-u)*100;return(0,w.jsxs)("div",{className:a.panel,children:[(0,w.jsxs)("div",{className:a.header,children:[(0,w.jsx)(ed.o5,{variant:"h2",children:(0,w.jsx)(C.A,{id:"map.editor.elevation.panel.title",defaultMessage:"Selected Elevation"})}),(0,w.jsx)(ei.A,{onClick:n,className:a.close})]}),(0,w.jsx)("div",{className:a.elevationPanelText,children:(0,w.jsx)(ed.o5,{variant:"caption",color:"primary",children:(0,w.jsx)(C.A,{id:"map.editor.elevation.data.approx",defaultMessage:"The elevation data below is approximated. Exact elevation data is shown when the route is saved."})})}),(0,w.jsxs)("div",{children:[(0,w.jsx)(eu.A,{label:(0,w.jsx)(ed.o5,{variant:"l3",className:a.gradeMessage,children:o.formatMessage(f>0?ef.gradeIncrease:f<0?ef.gradeDecrease:ef.noChange)}),value:"".concat(f.toFixed(2),"%")}),(0,w.jsxs)("div",{children:[(0,w.jsx)(ea.Ay,{classes:{root:a.root,thumb:f<-5?es()(a.thumbTriangle,a.thumbTriangleDown):f>5?es()(a.thumbTriangle,a.thumbTriangleUp):a.thumb,active:a.active,valueLabel:a.valueLabel,track:a.track,rail:a.rail},min:-20,max:20,disabled:!0,defaultValue:f,"aria-label":o.formatMessage(ef.sliderAriaMessage)},"slider-".concat(f)),(0,w.jsxs)("div",{className:a.marks,children:[(0,w.jsx)(ed.o5,{variant:"l2",children:(0,w.jsx)(C.A,{id:"map.editor.elevation.panel.steepDecline",defaultMessage:"Steep Decline"})}),(0,w.jsx)(ed.o5,{variant:"l2",children:(0,w.jsx)(C.A,{id:"map.editor.elevation.panel.flat",defaultMessage:"Flat"})}),(0,w.jsx)(ed.o5,{variant:"l2",children:(0,w.jsx)(C.A,{id:"map.editor.elevation.panel.steepIncline",defaultMessage:"Steep Incline"})})]})]})]}),(0,w.jsxs)("div",{children:[(0,w.jsx)(ed.o5,{variant:"h4",className:a.subtitle,children:(0,w.jsx)(C.A,{id:"map.editor.elevation.panel.elevationGain",defaultMessage:"Elevation Gain"})}),(0,w.jsxs)("div",{className:a.stats,children:[(0,w.jsx)(ep.A,{label:(0,w.jsx)(C.A,{id:"map.editor.elevation.panel.start",defaultMessage:"Start"}),measurement:d,unitType:r}),(0,w.jsx)(ep.A,{label:(0,w.jsx)(C.A,{id:"map.editor.elevation.panel.max",defaultMessage:"Max"}),measurement:i,unitType:r}),(0,w.jsx)(ep.A,{label:(0,w.jsx)(C.A,{id:"map.editor.elevation.panel.gain",defaultMessage:"Gain"}),measurement:null==l?void 0:l.ascent,unitType:r})]})]}),(0,w.jsxs)("div",{children:[(0,w.jsx)(ed.o5,{variant:"h4",className:a.subtitle,children:(0,w.jsx)(C.A,{id:"map.editor.elevation.panel.Distance",defaultMessage:"Distance"})}),(0,w.jsxs)("div",{className:a.stats,children:[(0,w.jsx)(ep.A,{label:(0,w.jsx)(C.A,{id:"map.editor.elevation.panel.start",defaultMessage:"Start"}),measurement:u,unitType:r,isDistance:!0}),(0,w.jsx)(ep.A,{label:(0,w.jsx)(C.A,{id:"map.editor.elevation.panel.end",defaultMessage:"End"}),measurement:p,unitType:r,isDistance:!0}),(0,w.jsx)(ep.A,{label:(0,w.jsx)(C.A,{id:"map.editor.elevation.panel.length",defaultMessage:"Length"}),measurement:p-u,unitType:r,isDistance:!0})]})]})]})})),eh=n(75062),ev=n.n(eh),ex=n(47744),ey=n.n(ex),eb=n(75019),ek=n.n(eb),ew=n(11919),ej=n.n(ew),eM=n(25182);n(65049);var eA=n(89492),eC=n(94342),eT=n(71768),eR=n(75772);n(52346),n(64509);var eS=n(44653),eN=n(50300),eE=n(81971),eL=n(69107),eP=n(77984),eB=n(23495),eD=n(88621),eF=n(84124),eI=n(39146),eH=n(97353),eO=n(58440),e_={setSelectedElevationSegment:P.setSelectedElevationSegment,setElevationCursor:P.setElevationCursor},eW=(0,eH.A)(function(e){var t=e.points,n=e.chartData,o=e.totalDistance,r=e.unitType,a=e.formatDistance,i=e.formatElevation,l=e.onDragDropEnd,s=e.setElevationCursor,c=e.setSelectedElevationSegment,u=e.elevationSegment,d=(0,v.useState)(!1),p=(0,m.A)(d,2),f=p[0],g=p[1],h=(0,v.useState)(null),x=(0,m.A)(h,2),y=x[0],b=x[1],k=(0,v.useState)(null),j=(0,m.A)(k,2),M=j[0],A=j[1];(0,v.useEffect)(function(){u||(b(null),A(null))},[u]);
1var C=n.map(function(e,t){var r=e.elevation,a=e.location;return{distance:t/n.length*o,elevation:r,location:a.toJSON?a.toJSON():a}}),T=r===eI._O;return(0,w.jsx)(eS.u,{width:"100%",height:150,children:(0,w.jsxs)(eN.Q,{data:C,margin:{top:10,right:0,left:0,bottom:0},onClick:function(){},onMouseMove:function(e){var t,n,o,r=null==e?void 0:e.activeLabel,a=null==e||null==(t=e.activePayload)||null==(n=t[0])||null==(o=n.payload)?void 0:o.location;a&&s(a,!1),f&&void 0!==r&&A(Number(r))},onMouseDown:function(e){if(void 0!==(null==e?void 0:e.activeLabel)){var t,n,o,r=(null==e||null==(t=e.activePayload)||null==(n=t[0])||null==(o=n.payload)?void 0:o.distance)||0;A(null),b(r),g(!0)}},onMouseUp:function(e){var n=null==e?void 0:e.activeLabel;if(void 0!==n){var o=null==e||null==(a=e.activePayload)||null==(i=a[0])||null==(u=i.payload)?void 0:u.distance,r=o;if(y===o){var a,i,u,d,p,f,m,h=null==e||null==(p=e.activePayload)||null==(f=p[0])||null==(m=f.payload)?void 0:m.location;b(null),r=null,c({start:null,end:null}),s(h,!0),l&&l(!1)}else if(c({start:y,end:n}),l){var v=y,x=o;void 0!==v&&void 0!==x&&v>x&&(x=v,v=o);var k=function(e){var t=e.distance;return void 0!==t&&void 0!==v&&void 0!==x&&t>=v&&t<=x};l(C.filter(k),(null!=t?t:[]).filter(k))}A(null!=(d=r)?d:null),g(!1)}},onMouseLeave:function(){s({})},children:[(0,w.jsx)(eE.m,{content:(0,w.jsx)(eO.A,{isImperial:T})}),(0,w.jsx)(eL.d,{height:205,vertical:!1,stroke:eA.S.palette.support.range.four,strokeDasharray:"1 2"}),(0,w.jsx)(eP.W,{dataKey:"distance",axisLine:!1,tickLine:!1,type:"number",tickCount:10,tickFormatter:function(e){return a({value:e,system:r,to:T?eI.ty:eI._v})},tick:{fill:eA.S.palette.support.range.four,fontSize:12},domain:[0,"dataMax"]}),(0,w.jsx)(eB.h,{yAxisId:"elevation",tick:{fill:eA.S.palette.support.range.four,fontSize:12},tickSize:0,tickFormatter:function(e){return i({value:e,digits:0,to:T?eI.x8:eI.Tk})},axisLine:!1,tickLine:!1,domain:["auto","auto"],width:40},"elevation"),y&&M?(0,w.jsx)(eD.T,{yAxisId:"elevation",x1:y,x2:M,fillOpacity:.06,fill:eA.S.palette.common.brand.black}):null,(0,w.jsx)(eF.G,{type:"monotone",yAxisId:"elevation",dataKey:"elevation",stroke:"none",fillOpacity:.1,fill:eA.S.palette.common.brand.black,activeDot:{r:5,stroke:eA.S.palette.common.brand.black,fill:eA.S.palette.common.brand.black}})]})})}),eG=(0,R.Ng)(function(e){return{elevationSegment:N.lw(e),points:N.IH(e)}},e_)(eW),ez=n(24500),eK=(0,X.YK)({elevationExpandTitle:{id:"map.editor.elevation.expand.title",defaultMessage:"Expand or Collapse elevation chart"}}),eU=(0,J.n9)()(function(e){return{root:{position:"relative",borderTop:"1px solid ".concat(e.palette.support.range.three)},container:{marginTop:8,marginBottom:8},title:{marginBottom:8},header:{margin:"16px 20px",display:"flex",justifyContent:"space-between"},stats:{width:250,display:"flex",justifyContent:"space-between",margin:"0 16px","& > :not(:first-child)":{marginLeft:8}},chart:{"& .recharts-xAxis .recharts-cartesian-axis-tick:first-child":{display:"none"},"& .recharts-wrapper":{userSelect:"none"},marginLeft:16,marginRight:16},toggle:{position:"absolute",top:-28,right:116,backgroundColor:e.palette.common.background.midground,width:42,height:28,cursor:"pointer",display:"flex",justifyContent:"center",alignItems:"center",borderTop:"1px solid ".concat(e.palette.support.range.three),borderLeft:"1px solid ".concat(e.palette.support.range.three),borderRight:"1px solid ".concat(e.palette.support.range.three),zIndex:2},arrowIcon:{fontSize:28}}});function eY(e,t){var n=r()(e);if(i()){var o=i()(e);t&&(o=o.filter(function(t){return s()(e,t).enumerable})),n.push.apply(n,o)}return n}function eq(){var e,t,n="function"==typeof ev()?ev():{},o=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function a(n,o,r,a){var s=o&&o.prototype instanceof l?o:l,c=ey()(s.prototype);return eV(c,"_invoke",function(n,o,r){var a,l,s,c=0,u=r||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return a=t,l=0,s=e,p.n=n,i}};function f(n,o){for(l=n,s=o,t=0;!d&&c&&!r&&t<u.length;t++){var r,a=u[t],f=p.p,g=a[2];n>3?(r=g===o)&&(s=a[(l=a[4])?5:(l=3,3)],a[4]=a[5]=e):a[0]<=f&&((r=n<2&&f<a[1])?(l=0,p.v=o,p.n=a[1]):f<g&&(r=n<3||a[0]>o||o>g)&&(a[4]=n,a[5]=o,p.n=g,l=0))}if(r||n>1)return i;throw d=!0,o}return function(r,u,g){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,g),l=u,s=g;(t=l<2?e:s)||!d;){a||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,a){if(l||(r="next"),t=a[r]){if(!(t=t.call(a,s)))throw TypeError("iterator result is not an object");
1if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=a.return)&&t.call(a),l<2&&(s=TypeError("The iterator does not provide a '"+r+"' method"),l=1);a=e}else if((t=(d=p.n<0)?s:n.call(o,p))!==i)break}catch(t){a=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,r,a),!0),c}var i={};function l(){}function s(){}function c(){}t=ek();var u=[][o]?t(t([][o]())):(eV(t={},o,function(){return this}),t),d=c.prototype=l.prototype=ey()(u);function p(e){return ej()?ej()(e,c):(e.__proto__=c,eV(e,r,"GeneratorFunction")),e.prototype=ey()(d),e}return s.prototype=c,eV(d,"constructor",c),eV(c,"constructor",s),s.displayName="GeneratorFunction",eV(c,r,"GeneratorFunction"),eV(d),eV(d,r,"Generator"),eV(d,o,function(){return this}),eV(d,"toString",function(){return"[object Generator]"}),(eq=function(){return{w:a,m:p}})()}function eV(e,t,n,o){var r=g();try{r({},"",{})}catch(e){r=0}(eV=function(e,t,n,o){function a(t,n){eV(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[t]=n:(a("next",0),a("throw",1),a("return",2))})(e,t,n,o)}var eJ=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eY(Object(n),!0).forEach(function(t){(0,h.A)(e,t,n[t])}):u()?p()(e,u()(n)):eY(Object(n)).forEach(function(t){g()(e,t,s()(n,t))})}return e}({},P),e$=(0,R.Ng)(function(e){return{points:N.IX(e),distance:N.Gx(e),unitType:N.KR(e),expandElevation:N.Oi(e),showElevation:N.Ix(e),elevationApiRoot:(0,ez.a6)(e)}},eJ)((0,T.Ay)(function(e){var t=e.points,n=e.distance,o=e.height,r=e.unitType,a=e.onDragDrop,i=e.expandElevation,l=e.showElevation,s=e.elevationApiRoot,c=e.intl,u=e.setToggleElevation,d=eU().classes,p=(0,v.useState)([]),f=(0,m.A)(p,2),g=f[0],h=f[1],x=(0,v.useState)(!1),y=(0,m.A)(x,2),b=y[0],k=y[1],j=(0,v.useState)(!1),M=(0,m.A)(j,2),A=M[0],T=M[1];if((0,v.useEffect)(function(){if(t&&l){var e=!1;return T(!0),function(){o.apply(this,arguments)}(),function(){e=!0}}function o(){return(o=(0,eM.A)(eq().m(function o(){var r,a,i,l,c,u;return eq().w(function(o){for(;;)switch(o.p=o.n){case 0:return o.p=0,a=eR.li-2,i=[],t&&t.length>a&&(l=n/a,i=(0,ec.Qi)(l,t)),c={path:null!=(r=i)&&r.length?i:t||[],samples:eR.wc},o.n=1,(0,ec.Q$)(c,s||"");case 1:if(u=o.v,!e){o.n=2;break}return o.a(2);case 2:h(u),k(!0),T(!1),o.n=5;break;case 3:if(o.p=3,console.error("[ElevationWidgetMapLibre] Error fetching elevation samples:",o.v),!e){o.n=4;break}return o.a(2);case 4:k(!0),T(!1);case 5:return o.a(2)}},o,null,[[0,3]])}))).apply(this,arguments)}},[t,l,s,n]),!l)return null;var R=g.map(function(e){return e.elevation}).filter(function(e){return"number"==typeof e&&!isNaN(e)}),S=R.length>0?Math.max.apply(Math,(0,er.A)(R)):0,N=(0,ec.iQ)(g),E=function(){u(!i)};return(0,w.jsxs)("div",{className:d.root,children:[(0,w.jsx)("div",{className:d.toggle,onClick:E,onKeyDown:function(e){var t=e.keyCode;(13===t||32===t)&&E()},tabIndex:0,title:c.formatMessage(eK.elevationExpandTitle),children:i?(0,w.jsx)(eC.A,{className:d.arrowIcon}):(0,w.jsx)(eT.A,{className:d.arrowIcon})}),i?(0,w.jsxs)("div",{className:d.container,style:{height:o},children:[(0,w.jsxs)("div",{className:d.header,children:[(0,w.jsxs)("div",{children:[(0,w.jsxs)(ed.o5,{className:d.title,variant:"h2",children:[(0,w.jsx)(C.A,{id:"map.editor.elevation.title",defaultMessage:"Elevation"}),(0,w.jsx)("span",{})]}),(0,w.jsx)(ed.o5,{variant:"caption",children:(0,w.jsx)(C.A,{id:"map.editor.elevation.description",defaultMessage:"Click and drag over a section to see approximated elevation data. Exact elevation data is shown when the route is saved."})})]}),null!=g&&g.length?(0,w.jsxs)("div",{className:d.stats,children:[(0,w.jsx)(ep.A,{label:(0,w.jsx)(C.A,{id:"map.editor.stats.start",defaultMessage:"Start"}),measurement:g[0].elevation,unitType:r}),(0,w.jsx)(ep.A,{label:(0,w.jsx)(C.A,{id:"map.editor.stats.max",defaultMessage:"Max"}),measurement:S,unitType:r}),(0,w.jsx)(ep.A,{label:(0,w.jsx)(C.A,{id:"map.editor.stats.gain",defaultMessage:"Gain"}),measurement:null==N?void 0:N.ascent,unitType:r})]}):null]}),(0,w.jsx)("div",{className:d.chart,children:(null==g?void 0:g.length)>0?(0,w.jsx)(eG,{chartData:g,unitType:r,totalDistance:n,onDragDropEnd:a}):A?(0,w.jsx)("div",{style:{padding:"20px",textAlign:"center",color:eA.S.palette.support.range.five},children:(0,w.jsx)(ed.o5,{variant:"body2",children:(0,w.jsx)(C.A,{id:"map.editor.elevation.loading",defaultMessage:"Loading elevation data..."})})}):b&&t&&t.length>0?(0,w.jsx)("div",{style:{padding:"20px",textAlign:"center",color:eA.S.palette.support.range.five},children:(0,w.jsx)(ed.o5,{variant:"body2",children:(0,w.jsx)(C.A,{id:"map.editor.elevation.unavailable",defaultMessage:"Elevation data unavailable. Please check your connection or try again."})})}):null})]}):null]})})),eX=n(60305);n(70489);var eQ=n(61043),eZ=n(87606),e0=n(56260),e1=n(83574),e2=(0,J.n9)()(function(e){return{panel:{boxShadow:"none",marginBottom:0,"&.expanded":{margin:0,borderBottom:"1px solid ".concat(e.palette.support.range.three),"&:before":{opacity:1}},borderBottom:"1px solid ".concat(e.palette.support.range.three),"&:before":{backgroundColor:e.palette.support.range.three}},panelSummary:{padding:"0 2px",minHeight:48,"&.expanded":{minHeight:48},backgroundColor:e.palette.common.background.midground,"&:hover":{backgroundColor:e.palette.support.range.one},"&:focus":{backgroundColor:e.palette.support.main}},panelSummaryContent:{fontSize:20,fontWeight:700,margin:"12px 0","&.expanded":{margin:"12px 0"}},panelSummaryExpandIcon:{marginRight:10,padding:2,"&.expanded":{transform:"rotate(90deg)"}},panelDetails:{"&&":{color:"inherit"},padding:0,overflowY:"scroll"},collapse:{flexGrow:1,overflow:"auto",minHeight:0}}});function e4(e,t){var n=r()(e);if(i()){var o=i()(e);t&&(o=o.filter(function(t){return s()(e,t).enumerable})),n.push.apply(n,o)}return n}var e5=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?e4(Object(n),!0).forEach(function(t){(0,h.A)(e,t,n[t])}):u()?p()(e,u()(n)):e4(Object(n)).forEach(function(t){g()(e,t,s()(n,t))})}return e}({},P),e3=(0,R.Ng)(function(e){return{expandedPanel:N.ww(e)}},e5)(function(e){var t=e.header,n=e.children,o=e.className,a=e.expandedPanel,i=e.name,l=e.setPanelChange,s=e.setSelectedElevationSegmentPoints,c=e2().classes;return(0,w.jsxs)(eQ.A,{classes:{root:es()(c.panel,o),expanded:"expanded"},expanded:a[i],onChange:function(){var e=a[i],t={};r()(a).forEach(function(n){t[n]=n===i&&!e}),l(t),s([])},TransitionProps:{className:c.collapse},square:!0,slotProps:{heading:{component:"h2"}},children:[(0,w.jsx)(eZ.A,{classes:{root:c.panelSummary,content:c.panelSummaryContent,expanded:"expanded",expandIconWrapper:c.panelSummaryExpandIcon},expandIcon:(0,w.jsx)(e1.A,{}),children:t}),(0,w.jsx)(e0.A,{className:c.panelDetails,children:n})]})});n(4040),n(68305);var e6=n(23694),e8={ferry:"ferry",slightright:"turn-slight-right",slightleft:"turn-slight-left",northeast:"turn-slight-right",northwest:"turn-slight-left",southeast:"southeast",southwest:"southwest",north:"north",straight:"north",south:"south",west:"west",east:"east",left:"turn-left",right:"turn-right",sharpright:"turn-sharp_right",sharpleft:"turn-sharp_left","roundabout-right":"roundabout-right","roundabout-left":"roundabout-left",custom_note:"note"},e9=n(85703),e7=(0,J.n9)()(function(e){return{panel:{display:"flex",flexDirection:"column",minHeight:0},title:{paddingLeft:14,paddingRight:14},container:(0,h.A)((0,h.A)({width:"100%",marginBottom:10},e.breakpoints.up("md"),{maxWidth:270}),e.breakpoints.up("lg"),{maxWidth:340}),note:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"10px 16px",borderTop:"1px solid ".concat((0,e9.X4)(e.palette.common.black,.12)),"&:hover":{fontWeight:600,backgroundColor:e.palette.support.range.one},"&:focus":{backgroundColor:e.palette.support.main},cursor:"pointer"},direction:{display:"flex",alignItems:"center"},instruction:{paddingLeft:20,maxWidth:200},unit:{marginRight:2,fontWeight:700},icon:{paddingRight:20,width:35,height:35},directionIcon:{fill:e.palette.support.range.four,color:e.palette.support.range.four}}});function te(e,t){var n=r()(e);if(i()){var o=i()(e);t&&(o=o.filter(function(t){return s()(e,t).enumerable})),n.push.apply(n,o)}return n}var tt={start:q.yZ,finish:q.NX,medical:q.DF,photographer:q.pP,water_station:q.jD,toilets:q.st,information:q.uQ,turn_left:q.Kf,turn_right:q.$b},tn=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?te(Object(n),!0).forEach(function(t){(0,h.A)(e,t,n[t])}):u()?p()(e,u()(n)):te(Object(n)).forEach(function(t){g()(e,t,s()(n,t))})}return e}({},P),to=(0,R.Ng)(function(e){return{unitType:N.KR(e)}},tn)((0,eH.A)(function(e){var t,n,o=e.direction,r=e.formatDistance,a=e.unitType,i=e.setDirectionCursor,l=e7().classes,s=a===eI._O,c=function(e){i(e.point,!1)},u=function(e){i(e.point,!0)},d=null==o?void 0:o.instructions,p=null==o?void 0:o.isCustomNote,f=null==o?void 0:o.markerType,g=p&&f?tt[f]:null,m=g?null:(t=d.match(/north\s?east|north\s?west|south\s?east|south\s?west|north|south|east|west|slight\s?(<.*>)?right|slight\s?(<.*>)?left|sharp\s?(<.*>)?right|sharp\s?(<.*>)?left|slight\s?(<.*>)?right|slight\s?(<.*>)?left|right|left/i),(n=p?"custom_note":null==t?void 0:t[0].replace(/\s|(<.*>)/g,"").toLowerCase())?e8[n]:"direction_info"),h=p?null==o?void 0:o.distance:null==o?void 0:o.distanceToHere,v=r({value:h,onlyValue:!0,to:s?eI.ty:eI._v}),x=r({value:h,onlyUnit:!0,to:s?eI.ty:eI._v});return(0,w.jsxs)("div",{className:l.note,onMouseEnter:function(){return c(o)},onClick:function(){return u(o)},children:[(0,w.jsxs)("div",{className:l.direction,children:[g?(0,w.jsx)(g,{style:{width:20,height:20},className:l.directionIcon}):(0,w.jsx)(e6.A,{name:null!=m?m:void 0,height:20,width:20,className:l.directionIcon}),(0,w.jsxs)(ed.o5,{variant:"body2",className:l.instruction,children:[" ",d.replace(/(<div.*Destination[\w\s]+<\/div>)/i,"").replace(/<\/?[^>]+(>|$)/g,"").replace(/ /g," ").replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/"/g,'"')," "]})]}),(0,w.jsxs)("div",{className:l.direction,children:[(0,w.jsx)(ed.o5,{variant:"h5",className:l.unit,children:v}),(0,w.jsx)(ed.o5,{variant:"body1",children:x})]})]})}));function tr(e,t){var n=r()(e);if(i()){var o=i()(e);t&&(o=o.filter(function(t){return s()(e,t).enumerable})),n.push.apply(n,o)}return n}var ta=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?tr(Object(n),!0).forEach(function(t){(0,h.A)(e,t,n[t])}):u()?p()(e,u()(n)):tr(Object(n)).forEach(function(t){g()(e,t,s()(n,t))})}return e}({},P),ti=(0,R.Ng)(function(e){return{directionsNotes:N.Hc(e),unitType:N.KR(e)}},ta)(function(e){var t=e.directionsNotes,n=e.setDirectionCursor,o=e7().classes,r=(0,v.useRef)(null),a=function(){var e;null==(e=r.current)||e.scrollIntoView({behavior:"smooth"})};return(0,v.useEffect)(function(){a()},[t]),(0,w.jsx)(e3,{header:(0,w.jsx)(eX.A,{variant:"h2",component:"span",className:o.title,children:(0,w.jsx)(C.A,{id:"map.editor.directions.title",defaultMessage:"Directions"})}),name:"directions",className:o.panel,children:(0,w.jsxs)("div",{className:o.container,onMouseLeave:function(){n(null,void 0)},children:[t.map(function(e,t){return(0,w.jsx)(to,{direction:e},"note_".concat(t))}),(0,w.jsx)("div",{ref:r})]})})});n(17482),n(95165),n(35890),n(9087);var tl=n(35921),ts=n(35230),tc=n(37235),tu=n(14605),td=(0,X.YK)({AvoidHighwayAriaLabel:{id:"map.editor.options.AvoidHighwayAriaLabel",defaultMessage:"Avoid Highways Toggle"},showDistanceAriaLabel:{id:"map.editor.options.showDistanceAriaLabel",defaultMessage:"Show Distance Markers Toggle"},showTrafficAriaLabel:{id:"map.editor.options.showTrafficAriaLabel",defaultMessage:"Show Traffic Toggle"},showBikePathAriaLabel:{id:"map.editor.options.showBikePathAriaLabel",defaultMessage:"Show Bike Paths Toggle"},shareMyLocationWarningText:{id:"map.editor.show.location.message",defaultMessage:"Your current location could not be determined. Check your browserâs location permissions."},searchPlaceholder:{id:"map.editor.options.searchLocation",defaultMessage:"Search location"},searchNoOptionsText:{id:"map.editor.options.searchNoOptionsText",defaultMessage:"No results found"}}),tp=(0,J.n9)()(function(e){return{panel:{display:"flex",flexDirection:"column",minHeight:49},title:{paddingLeft:12,paddingRight:12},root:{width:"100%",marginTop:10,marginBottom:10,paddingLeft:16,paddingRight:16},searchLocation:{marginBottom:20},section1:{marginBottom:30},section2:{marginBottom:20},subTitle1:{marginBottom:30,textTransform:"uppercase",color:e.palette.common.brand.red},units:{marginBottom:20},radioOption:{minHeight:"30px !important",padding:0},field:{marginBottom:24}}}),tf=n(22092),tg=n(88032),tm=n.n(tg),th=n(80662),tv=n.n(th);n(20341),n(20957);var tx=n(21279),ty=(0,J.n9)()(function(){return{option:{display:"flex",flexDirection:"column"},mainText:{fontSize:16,fontWeight:600},subText:{fontSize:14},autoRoot:{},inputRoot:{height:42,"&&& $input":{paddingTop:0,paddingBottom:0}},icon:{padding:0}}}),tb=["key"];function tk(e,t){var n=r()(e);if(i()){var o=i()(e);t&&(o=o.filter(function(t){return s()(e,t).enumerable})),n.push.apply(n,o)}return n}function tw(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tk(Object(n),!0).forEach(function(t){(0,h.A)(e,t,n[t])}):u()?p()(e,u()(n)):tk(Object(n)).forEach(function(t){g()(e,t,s()(n,t))})}return e}var tj={getLocationDetails:P.getLocationDetails,routeControlPerformedEvent:P.routeControlPerformedEvent,getCurrentLocation:P.getCurrentLocation,getLocationSuggestionsMapLibre:tx.getLocationSuggestionsMapLibre},tM=(0,R.Ng)(function(e){return{isRouteNameManuallyEdited:(0,N.Lz)(e)}},tj)((0,T.Ay)(function(e){var t=e.intl,n=e.isRouteNameManuallyEdited,o=e.getLocationDetails,r=e.routeControlPerformedEvent,a=e.getCurrentLocation,i=e.getLocationSuggestionsMapLibre,l=ty().classes,s=(0,v.useState)([]),c=(0,m.A)(s,2),u=c[0],d=c[1],p=(0,v.useState)(""),f=(0,m.A)(p,2),g=f[0],h=f[1],x=A()(function(e,t){if((null==t?void 0:t.length)===3||(null==t?void 0:t.length)>=5)if(/^((-?|\+?)?\d+(\.\d+)?),\s*((-?|\+?)?\d+(\.\d+)?)$/gi.test(t)){var n=t.split(",");d([{mainText:t,label:t,value:{lat:tm()(n[0]),lng:tm()(n[1])},isLatLng:!0}])}else i(t).then(function(e){var t,n=((null==e||null==(t=e.value)?void 0:t.result)||[]).map(function(e){var t,n,o=e.place_name||e.text,r=o.split(","),a=e.center||(null==(t=e.geometry)?void 0:t.coordinates);return{mainText:(null==(n=r[0])?void 0:n.trim())||o,subText:r.slice(1).join(",").trim(),label:o,value:{lat:null==a?void 0:a[1],lng:null==a?void 0:a[0]},bbox:e.bbox,isLatLng:!0}});d((0,er.A)(new(tv())(n.map(function(e){return[e.label,e]}
1)).values()))}).catch(function(e){console.error("Location search failed:",e),d([])})},400);return(0,w.jsx)(tc.Mc,{name:"city-search",placeholder:t.formatMessage(td.searchPlaceholder),showSearchIcon:!1,noOptionsText:t.formatMessage(td.searchNoOptionsText),options:u,value:g,getOptionLabel:function(e){return e.label||""},renderOption:function(e,t){var n=e.key,o=(0,tf.A)(e,tb);return(0,w.jsx)("li",tw(tw({},o),{},{children:(0,w.jsxs)("div",{className:l.option,children:[(0,w.jsxs)("span",{className:l.mainText,children:[" ",t.mainText]}),(0,w.jsxs)("span",{className:l.subText,children:[" ",t.subText]})]})}),n)},onInputChange:x,onChange:function(e,t,a){"clear"===a&&d([]),null!=t&&t.value&&(h(t),r("Search Location",{}),o({location:null!=t&&t.isLatLng?{latLng:t.value,bbox:t.bbox}:{placeId:t.value},isRouteNameManuallyEdited:n,isTextSearch:!0}))},onLocationClick:function(){a(t.formatMessage(td.shareMyLocationWarningText),!0,n)}})})),tA=n(7823),tC=(0,J.n9)()(function(e){return{root:{width:"100%",border:"none","&:focus-within":{boxShadow:"none"}},select:{"&&":{padding:0,fontWeight:400,fontSize:e.typography.pxToRem(16),lineHeight:e.typography.pxToRem(24),fontFamily:'"Plus Jakarta Sans", Helvetica, Arial, -apple-system, sans-serif'},"&:focus":{background:e.palette.common.background.midground,border:"none"},"&:hover":{background:e.palette.common.background.midground,border:"none"}}}}),tT=function(e){var t=e.value,n=e.name,o=e.children,r=e.onChange,a=tC().classes;return(0,w.jsx)(tA.A,{className:a.root,classes:{select:a.select},variant:"standard",disableUnderline:!0,inputProps:{name:n},onChange:function(e){r&&r(e)},value:t,name:n,IconComponent:eC.A,children:o})},tR=n(95513),tS=n(58145),tN=n.p+"asset/bike.4c703215.svg",tE=n.p+"asset/car.ad122278.svg",tL=n.p+"asset/walk.3ca13f5f.svg",tP=[{icon:tL,mode:"WALKING",messages:(0,X.YK)({title:{id:"map.editor.directions.useWalkingDirectionTitle",defaultMessage:"Use Walking Directions"},imgAlt:{id:"map.editor.directions.useWalkingDirectionImgAlt",defaultMessage:"Use Walking Directions Icon"}})},{icon:tN,mode:"BICYCLING",messages:(0,X.YK)({title:{id:"map.editor.directions.useBicyclingDirectionTitle",defaultMessage:"Use Bicycling Directions"},imgAlt:{id:"map.editor.directions.useBicyclingDirectionImgAlt",defaultMessage:"Use Bicycling Directions Icon"}})},{icon:tE,mode:"DRIVING",messages:(0,X.YK)({title:{id:"map.editor.directions.useDrivingDirectionTitle",defaultMessage:"Use Driving Directions"},imgAlt:{id:"map.editor.directions.useDrivingDirectionImgAlt",defaultMessage:"Use Walking Directions Icon"}})}],tB=(0,J.n9)()(function(e){return{root:{display:"flex",marginBottom:e.typography.pxToRem(24)},groupedHorizontal:{"&:not(:first-child)":{marginLeft:0}},button:{width:"100%",border:"1px solid ".concat(e.palette.support.range.three),padding:e.typography.pxToRem(8)},selected:{"&.Mui-selected":{backgroundColor:e.palette.support.main,marginLeft:0}}}}),tD={routeControlPerformedEvent:P.routeControlPerformedEvent},tF=(0,R.Ng)(null,tD)((0,T.Ay)(function(e){var t=e.intl,n=e.value,o=e.onToggle,r=e.routeControlPerformedEvent,a=tB().classes;return(0,w.jsx)(tR.A,{exclusive:!0,classes:{root:a.root,groupedHorizontal:a.groupedHorizontal},value:n,onChange:function(e,t){r("TravelMode",{type:t}),o&&o(e,t)},children:tP.map(function(e){var n=e.mode,o=e.icon,r=e.messages;return(0,w.jsx)(tS.A,{classes:{root:a.button,selected:a.selected},value:n,"aria-label":t.formatMessage(r.title),children:(0,w.jsx)("img",{src:o,alt:t.formatMessage(r.imgAlt)})},n)})})}));function tI(e,t){var n=r()(e);if(i()){var o=i()(e);t&&(o=o.filter(function(t){return s()(e,t).enumerable})),n.push.apply(n,o)}return n}function tH(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tI(Object(n),!0).forEach(function(t){(0,h.A)(e,t,n[t])}):u()?p()(e,u()(n)):tI(Object(n)).forEach(function(t){g()(e,t,s()(n,t))})}return e}var tO={setRouteOptions:P.setRouteOptions,setElevationToggledTouched:P.setElevationToggledTouched,routeControlPerformedEvent:P.routeControlPerformedEvent},t_=(0,T.Ay)(function(e){var t=e.routeOptions,n=e.intl,o=e.mapType,r=e.setRouteOptions,a=e.setElevationToggledTouched,i=e.routeControlPerformedEvent,l=tp().classes,s=(0,ts.Wx)({initialValues:tH({},t),enableReinitialize:!0,onSubmit:function(){}});(0,v.useEffect)(function(){r(tH({},s.values))},[s.values]);var c=function(e,t){s.handleChange(e),i(t,{})};return(0,w.jsx)(e3,{header:(0,w.jsx)(ed.o5,{variant:"h2",component:"span",className:l.title,children:(0,w.jsx)(C.A,{id:"map.editor.options.title",defaultMessage:"Controls"})}),name:"controls",className:l.panel,children:(0,w.jsxs)("div",{className:l.root,children:[(0,w.jsx)("div",{className:l.searchLocation,children:(0,w.jsx)(tM,{})}),(0,w.jsxs)("div",{className:l.section1,children:[(0,w.jsx)(ed.o5,{className:l.subTitle1,variant:"h4",children:(0,w.jsx)(C.A,{id:"map.editor.options.preferences",defaultMessage:"Preferences"})}),(0,w.jsxs)("div",{children:[(0,w.jsx)(tF,{name:"travelMode",onToggle:function(e,t){s.setFieldValue("travelMode",t)},value:s.values.travelMode}),(0,w.jsx)(tc.RF,{name:"avoidHighways",className:l.field,onToggle:function(e){return c(e,"Avoid Highways")},value:s.values.avoidHighways,label:(0,w.jsx)(ed.o5,{variant:"body1",children:(0,w.jsx)(C.A,{id:"map.editor.options.avoidHighways",defaultMessage:"Avoid Highways"})}),ariaLabel:n.formatMessage(td.AvoidHighwayAriaLabel)})]})]}),(0,w.jsxs)("div",{className:l.section2,children:[(0,w.jsx)(ed.o5,{className:l.subTitle1,variant:"h4",children:(0,w.jsx)(C.A,{id:"map.editor.options.display",defaultMessage:"Display"})}),(0,w.jsx)(tc.RF,{name:"showMileMarkers",className:l.field,onToggle:function(e){return c(e,"Distance Markers")},value:s.values.showMileMarkers,label:(0,w.jsx)(ed.o5,{variant:"body1",children:(0,w.jsx)(C.A,{id:"map.editor.options.showMileMarkers",defaultMessage:"Show Distance Markers"})}),ariaLabel:n.formatMessage(td.showDistanceAriaLabel)}),(0,w.jsx)(tc.RF,{name:"showElevation",className:l.field,onToggle:function(e){a(!0),c(e,"Show Elevation")},value:s.values.showElevation,label:(0,w.jsx)(ed.o5,{variant:"body1",children:(0,w.jsx)(C.A,{id:"map.editor.options.showElevationToggle",defaultMessage:"Show Elevation"})}),ariaLabel:n.formatMessage(td.showDistanceAriaLabel)}),(0,w.jsx)(tc.RF,{name:"showBikePaths",className:l.field,onToggle:function(e){return c(e,"Bike Paths")},value:s.values.showBikePaths,label:(0,w.jsx)(ed.o5,{variant:"body1",children:(0,w.jsx)(C.A,{id:"map.editor.options.showBikePaths",defaultMessage:"Show Bike Paths"})}),disabled:["satellite","OSM"].includes(o),ariaLabel:n.formatMessage(td.showBikePathAriaLabel)}),(0,w.jsx)("div",{className:l.field,children:(0,w.jsxs)(tT,{name:"unitType",onChange:function(e){return c(e,"Units")},value:s.values.unitType,children:[(0,w.jsx)(tl.A,{value:"imperial",children:(0,w.jsx)(C.A,{id:"map.editor.options.imperials",defaultMessage:"Imperial Units"})}),(0,w.jsx)(tl.A,{value:"metric",children:(0,w.jsx)(C.A,{id:"map.editor.options.metric",defaultMessage:"Metric Units"})})]})})]})]})})}),tW=(0,R.Ng)(function(e){return{routeOptions:N.gt(e),mapType:(0,tu.DH)(e)}},tO)(t_),tG=n(94594),tz=n(33031),tK=n(6888),tU=n(51214),tY=(0,J.n9)()(function(e){return{root:{display:"flex",alignItems:"center"},label:{color:e.palette.common.brand.red},labelRight:{marginRight:8},labelBottom:{marginBottom:8}}}),tq=(0,R.Ng)(function(e){return{distance:(0,N.Gx)(e),unitType:(0,N.KR
1)(e)}})(function(e){var t=e.distance,n=e.unitType,o=e.horizontal,r=tY().classes;if(t<=0)return null;var a=n===eI._O;return(0,w.jsxs)("div",{className:es()((0,h.A)({},r.root,o)),children:[(0,w.jsx)(ed.o5,{variant:"h4",className:es()(r.label,(0,h.A)((0,h.A)({},r.labelRight,o),r.labelBottom,!o)),children:(0,w.jsx)(C.A,{id:"map.editor.distance.stats.title",defaultMessage:"Distance"})}),(0,w.jsx)(ed.o5,{variant:"s5",children:(0,w.jsx)(tU.e,{digits:2,value:t,to:a?eI.ty:eI._v})})]})}),tV=(0,X.YK)({helpModal:{id:"map.editor.help.modal",defaultMessage:"Help"}}),tJ=(0,J.n9)()(function(e){return{help:{display:"flex",justifyContent:"flex-end",cursor:"pointer"},svg:{marginLeft:e.typography.pxToRem(4)}}}),t$=(0,R.Ng)(function(e){return{distance:(0,N.Gx)(e),unitType:(0,N.KR)(e)}})(function(e){var t=e.onHelpClick,n=tJ().classes;return(0,w.jsx)("div",{className:n.help,children:(0,w.jsxs)(ed.wp,{external:!0,onClick:function(){t(!0)},align:"center",children:[(0,w.jsx)(ed.Ge,{formattedValue:tV.helpModal}),(0,w.jsx)(ed.BS,{name:"help",height:14,width:14,className:n.svg})]})})}),tX=(0,X.YK)({routeName:{id:"map.editor.routeName.inputField.title",defaultMessage:"Route Name"}}),tQ={setRouteName:P.setRouteName},tZ=(0,R.Ng)(function(){return{}},tQ)((0,T.Ay)(function(e){var t=e.intl,n=e.routeName,o=e.toggleEdit,r=e.setRouteName,a=(0,ts.Wx)({initialValues:{routeName:n},enableReinitialize:!0,onSubmit:function(){}});return(0,w.jsx)(tc.FO,{name:"routeName",label:t.formatMessage(tX.routeName),value:a.values.routeName,onChange:a.handleChange,onBlur:function(){r(a.values.routeName,!0),o()}})})),t0=(0,X.YK)({editRouteNameTitle:{id:"map.editor.routeDetail.editRoute.title",defaultMessage:"Edit Route Name"},defaultName:{id:"map.editor.routeDetail.defaultName",defaultMessage:"{city} Route"}}),t1=(0,J.n9)()(function(e){return{root:{padding:"16px 16px 24px",borderBottom:"1px solid ".concat(e.palette.support.range.three),cursor:"auto"},container:{display:"flex",justifyContent:"space-between",alignItems:"center"},titleRoot:{cursor:"text","&:hover":{backgroundColor:e.palette.support.range.one},"&:focus":{backgroundColor:e.palette.support.main},overflow:"hidden",display:"-webkit-box","-webkit-line-clamp":4,"-webkit-box-orient":"vertical"},title:{textTransform:"uppercase",wordWrap:"break-word"},stats:{marginTop:24,display:"flex",justifyContent:"space-between",alignItems:"flex-end"},menu:{zIndex:2001},iconRoot:{padding:0,"&:focus":{backgroundColor:e.palette.support.main}},help:{display:"flex",justifyContent:"flex-end",cursor:"pointer"},svg:{marginLeft:e.typography.pxToRem(4)}}}),t2=(0,R.Ng)(function(e){return{routeName:(0,N.Uq)(e),defaultRouteCity:(0,N.W4)(e)}},{})((0,T.Ay)(function(e){var t=e.routeName,n=e.defaultRouteCity,o=e.intl,r=e.onHelpModalClick,a=t1().classes,i=(0,v.useState)(!1),l=(0,m.A)(i,2),s=l[0],c=l[1],u=(0,v.useState)(null),d=(0,m.A)(u,2),p=d[0],f=d[1],g=function(){f(null)},h=function(){c(!s),p&&g()},x=o.formatMessage(t0.defaultName,{city:n}),y=t||x;return(0,w.jsxs)("div",{className:a.root,children:[s?(0,w.jsx)("form",{children:(0,w.jsx)(tZ,{routeName:y,toggleEdit:h})}):(0,w.jsxs)("div",{className:a.container,children:[(0,w.jsx)("div",{tabIndex:0,role:"button",title:o.formatMessage(t0.editRouteNameTitle),onClick:h,onKeyDown:function(e){var t=e.keyCode;(13===t||32===t)&&h()},className:a.titleRoot,children:(0,w.jsx)(ed.o5,{className:a.title,variant:"h3",children:y})}),(0,w.jsxs)("div",{children:[(0,w.jsx)(tG.A,{className:a.iconRoot,"aria-label":o.formatMessage(t0.editRouteNameTitle),onClick:function(e){f(e.currentTarget)},children:(0,w.jsx)(tK.A,{})}),(0,w.jsx)(tz.A,{anchorEl:p,keepMounted:!0,open:!!p,onClose:g,className:a.menu,children:(0,w.jsx)(tl.A,{onClick:h,children:(0,w.jsx)(ed.o5,{variant:"caption",children:o.formatMessage(t0.editRouteNameTitle)})})})]})]}),(0,w.jsxs)("div",{className:a.stats,children:[(0,w.jsx)(tq,{}),(0,w.jsx)(t$,{onHelpClick:r})]})]})})),t4=(0,J.n9)()(function(){return{mainPanel:{display:"flex",flexDirection:"column",flexGrow:1,minHeight:0}}});function t5(e,t){var n=r()(e);if(i()){var o=i()(e);t&&(o=o.filter(function(t){return s()(e,t).enumerable})),n.push.apply(n,o)}return n}var t3=function(e){var t=t4().classes;return(0,w.jsxs)("div",{className:t.mainPanel,children:[(0,w.jsx)(t2,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?t5(Object(n),!0).forEach(function(t){(0,h.A)(e,t,n[t])}):u()?p()(e,u()(n)):t5(Object(n)).forEach(function(t){g()(e,t,s()(n,t))})}return e}({},e)),(0,w.jsx)(tW,{}),(0,w.jsx)(ti,{})]})},t6=n(16443),t8=n.n(t6),t9=n(85806),t7=n(58339),ne=n(91415),nt=n(93294),nn=n(5338),no=n(80036),nr=(0,X.YK)({addNoteBtnTitle:{id:"map.editor.addNote.button.ariaTitle",defaultMessage:"Add Note Button"}}),na=(0,J.n9)()(function(e){return{root:{width:218},modal:{backgroundColor:"white",fontSize:14,padding:12,width:250},title:{paddingTop:4,paddingBottom:4,fontWeight:600,fontSize:e.typography.pxToRem(18),lineHeight:e.typography.pxToRem(22),fontFamily:e.typography.fontFamilyText},caption:{paddingBottom:e.spacing(4),fontWeight:400,fontSize:e.typography.pxToRem(12),lineHeight:e.typography.pxToRem(18),fontFamily:e.typography.fontFamilyText},inputRoot:{borderWidth:1,borderColor:e.palette.support.range.two,borderStyle:"solid",borderRadius:4,minHeight:e.typography.pxToRem(104),"&:hover, &:focus-within":{borderColor:e.palette.common.black,boxShadow:"inset 0 0 0 1px ".concat(e.palette.common.black)},"&:focus-within":{borderColor:e.palette.common.black,boxShadow:"inset 0 0 0 1px ".concat(e.palette.common.black,", 0 0 8px 0 ").concat((0,e9.X4)(e.palette.common.black,.5))}},input:{color:e.palette.common.black,padding:e.spacing(4),fontSize:e.typography.pxToRem(14),fontFamily:e.typography.fontFamily,height:"100%","&::-webkit-calendar-picker-indicator":{marginLeft:e.spacing(4)},"&::placeholder":{color:e.palette.support.range.four}},inputMultiline:{padding:e.spacing(4)},buttonRoot:{marginTop:e.spacing(4),float:"right",textTransform:"uppercase",borderWidth:2,borderRadius:2,display:"flex",boxShadow:"none",padding:"6px 30px",borderStyle:"solid",borderColor:"transparent",fontWeight:800,fontSize:e.typography.pxToRem(18),lineHeight:e.typography.pxToRem(24),letterSpacing:e.typography.pxToRem(.25),fontFamily:e.typography.fontFamilyCondensed},contained:{color:e.palette.common.brand.black,backgroundColor:e.palette.support.main,boxShadow:"none","@media (hover: none)":{boxShadow:"none","&:hover":{backgroundColor:"".concat(e.palette.support.range.two," !important"),borderColor:"transparent !important",boxShadow:"none !important"}},"&:focus, &:active":{borderColor:e.palette.common.white,boxShadow:"0 0 0 2px ".concat(e.palette.support.range.two)},"&:hover":{backgroundColor:e.palette.support.range.two,boxShadow:"none"},"&:disabled":{backgroundColor:e.palette.support.range.one,color:e.palette.support.range.two}},sizeSmall:{fontWeight:600,textTransform:"none",fontSize:e.typography.pxToRem(12),lineHeight:e.typography.pxToRem(16),fontFamily:e.typography.fontFamily},containedSizeSmall:{padding:"6px 14px",textTransform:"uppercase"}}});function ni(e,t){var n=r()(e);if(i()){var o=i()(e);t&&(o=o.filter(function(t){return s()(e,t).enumerable})),n.push.apply(n,o)}return n}var nl=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ni(Object(n),!0).forEach(function(t){(0,h.A)(e,t,n[t])}):u()?p()(e,u()(n)):ni(Object(n)).forEach(function(t){g()(e,t,s()(n,t))})}return e}({},P),ns=(0,eH.A)(function(e){var t=e.showNote,n=e.addNotes,o=e.showNoteModal,r=e.formatDistance,a=e.unitType,i=e.intl,l=(0,nt.Jb)(),s=na().classes,c=(0,v.useRef)(null),u=(0,v.useRef)(document.createElement("div")),d=(0,v.useRef)(null),p=function(){o({position:null,distance:0,segmentIndex:-1,isEndPoint:!1})},f=(0,ts.Wx)({initialValues:{note:""},onSubmit:function(e,o){var r,a,i,l=o.resetForm;e.note&&n({segmentIndex:null!=(r=null==t?void 0:t.segmentIndex)?r:-1,distance:null==t?void 0:t.distance,note:e.note,point:{lat:null==t||null==(a=t.position)?void 0:a.lat,lng:null==t||null==(i=t.position)?void 0:i.lng},isEndPoint:null==t?void 0:t.isEndPoint}),l(),p()},enableReinitialize:!0}),g=null==t?void 0:t.position,m=a===eI._O,h=r({value:null==t?void 0:t.distance,to:m?eI.ty:eI._v});return(0,v.useEffect)(function(){if(l){if(null!=t&&t.position)if(c.current)c.current.setLngLat(t.position),c.current.addTo(l);else{c.current=new(t8()).Popup({offset:10,anchor:"bottom",closeButton:!0,closeOnClick:!1}).setLngLat(g).setDOMContent(u.current).addTo(l);var e,n=null==(e=c.current)?void 0:e.getElement();n&&(n.style.zIndex="100"),c.current.on("close",p)}else c.current&&(c.current.remove(),c.current=null);return function(){c.current&&(c.current.remove(),c.current=null)}}},[t,l]),(0,v.useEffect)(function(){!d.current&&u.current&&(d.current=(0,nn.createRoot)(u.current)),null!=t&&t.position&&u.current&&d.current?d.current.render((0,w.jsx)("form",{onSubmit:f.handleSubmit,children:(0,w.jsxs)("div",{className:s.root,children:[(0,w.jsx)(ed.o5,{variant:"h5",className:s.title,children:(0,w.jsx)(C.A,{id:"map.editor.note.title",defaultMessage:"Note"})}),(0,w.jsx)(ed.o5,{variant:"caption",className:s.caption,children:h}
1),(0,w.jsx)(tc.FO,{name:"note",onChange:f.handleChange,value:f.values.note,multiline:!0,rows:3,classes:{root:s.inputRoot,input:s.input,inputMultiline:s.inputMultiline}}),(0,w.jsx)(no.$n,{type:"submit",size:"small",disableRipple:!0,classes:{root:s.buttonRoot,contained:s.contained,sizeSmall:s.sizeSmall,containedSizeSmall:s.containedSizeSmall},"aria-label":i.formatMessage(nr.addNoteBtnTitle),children:(0,w.jsx)(C.A,{id:"map.editor.save.note",defaultMessage:"Save"})})]})})):d.current&&(d.current.unmount(),d.current=null)},[t,f,h,i,s]),null}),nc=(0,R.Ng)(function(e){return{showNote:N.sf(e),unitType:N.KR(e)}},nl)((0,T.Ay)(ns)),nu=(0,J.n9)()(function(e){return{dropdown:{backgroundColor:"white",fontSize:14,width:200,maxHeight:"85vh",minHeight:"22vh",marginTop:25,padding:"0 12px"},item:{padding:"4px 0px",fontSize:12,fontFamily:e.typography.fontFamily,color:e.palette.common.foreground.primary,cursor:"pointer","&:hover":{backgroundColor:e.palette.common.background.background}},itemDestructive:{padding:"4px 0px",fontSize:12,fontFamily:e.typography.fontFamily,color:e.palette.error.main,cursor:"pointer","&:hover":{backgroundColor:e.palette.common.background.background}},divide:{margin:"4px 0px",border:"1px solid ".concat(e.palette.support.main)},title:{margin:"4px 0px 6px 0px",paddingTop:8,paddingBottom:8,fontSize:14,fontFamily:e.typography.fontFamily,fontWeight:700,color:e.palette.common.foreground.primary},iconWithDistance:{display:"flex",alignItems:"center",fontWeight:700,fontSize:16,marginTop:4,"& span":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1}},distance:{fontSize:16,fontFamily:e.typography.fontFamily,color:e.palette.text.secondary,fontWeight:900},createMarkerButton:{width:"100%",padding:"12px 16px",marginBottom:8,backgroundColor:e.palette.common.black,color:e.palette.common.white,border:"none",borderRadius:4,fontSize:12,fontWeight:600,fontFamily:e.typography.fontFamily,textTransform:"uppercase",letterSpacing:"0.5px",cursor:"pointer",transition:"background-color 0.2s ease","&:hover":{backgroundColor:e.palette.grey[800]},"&:active":{backgroundColor:e.palette.common.black}}}});function nd(e,t){var n=r()(e);if(i()){var o=i()(e);t&&(o=o.filter(function(t){return s()(e,t).enumerable})),n.push.apply(n,o)}return n}function np(){var e,t,n="function"==typeof ev()?ev():{},o=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function a(n,o,r,a){var s=o&&o.prototype instanceof l?o:l,c=ey()(s.prototype);return nf(c,"_invoke",function(n,o,r){var a,l,s,c=0,u=r||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return a=t,l=0,s=e,p.n=n,i}};function f(n,o){for(l=n,s=o,t=0;!d&&c&&!r&&t<u.length;t++){var r,a=u[t],f=p.p,g=a[2];n>3?(r=g===o)&&(s=a[(l=a[4])?5:(l=3,3)],a[4]=a[5]=e):a[0]<=f&&((r=n<2&&f<a[1])?(l=0,p.v=o,p.n=a[1]):f<g&&(r=n<3||a[0]>o||o>g)&&(a[4]=n,a[5]=o,p.n=g,l=0))}if(r||n>1)return i;throw d=!0,o}return function(r,u,g){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,g),l=u,s=g;(t=l<2?e:s)||!d;){a||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,a){if(l||(r="next"),t=a[r]){if(!(t=t.call(a,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=a.return)&&t.call(a),l<2&&(s=TypeError("The iterator does not provide a '"+r+"' method"),l=1);a=e}else if((t=(d=p.n<0)?s:n.call(o,p))!==i)break}catch(t){a=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,r,a),!0),c}var i={};function l(){}function s(){}function c(){}t=ek();var u=[][o]?t(t([][o]())):(nf(t={},o,function(){return this}),t),d=c.prototype=l.prototype=ey()(u);function p(e){return ej()?ej()(e,c):(e.__proto__=c,nf(e,r,"GeneratorFunction")),e.prototype=ey()(d),e}return s.prototype=c,nf(d,"constructor",c),nf(c,"constructor",s),s.displayName="GeneratorFunction",nf(c,r,"GeneratorFunction"),nf(d),nf(d,r,"Generator"),nf(d,o,function(){return this}),nf(d,"toString",function(){return"[object Generator]"}),(np=function(){return{w:a,m:p}})()}function nf(e,t,n,o){var r=g();try{r({},"",{})}catch(e){r=0}(nf=function(e,t,n,o){function a(t,n){nf(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[t]=n:(a("next",0),a("throw",1),a("return",2))})(e,t,n,o)}var ng={start:q.yZ,finish:q.NX,medical:q.DF,water_station:q.jD,photographer:q.pP,toilets:q.st,turn_left:q.Kf,turn_right:q.$b,information:q.uQ},nm=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?nd(Object(n),!0).forEach(function(t){(0,h.A)(e,t,n[t])}):u()?p()(e,u()(n)):nd(Object(n)).forEach(function(t){g()(e,t,s()(n,t))})}return e}({},P),nh=(0,eH.A)(function(e){var t,n,o,r=e.addSegmentWithAsyncRouting,a=e.autoFollowRoads,i=e.avoidHighways,l=e.formatDistance,s=e.segments,c=e.pointActionPosition,u=e.distance,d=e.unitType,p=e.setPointActionsPosition,f=e.setRouteOriginPoint,g=e.updateSegments,m=e.updateSegmentWithFinalRoute,h=e.routePointInteractionPerformedEvent,x=e.travelMode,y=e.setCustomMarkerModal,b=e.customMarkers,k=(0,nt.Jb)(),j=(0,v.useRef)(null),M=(0,v.useRef)(document.createElement("div")),A=(0,v.useRef)(null),T=null==c?void 0:c.latLng,R=null!=(o=null==c?void 0:c.index)?o:-1,S=null==c?void 0:c.isStart,N=null==c?void 0:c.isLast,E=nu().classes,L=d===eI._O,P=(null==s?void 0:s.length)||0,B=l({value:u||0,to:L?eI.ty:eI._v}),D=function(){var e;null==(e=j.current)||e.remove(),j.current=null},F=function(e){var t=e.children,n=e.onClick,o=e.destructive;return(0,w.jsx)("div",{className:void 0!==o&&o?E.itemDestructive:E.item,onClick:n,children:t})},I=function(){h("Add Map Marker"),p(null),D();var e=N?s.length:R,t=null==b?void 0:b[e];y({open:!0,waypointData:{waypointIndex:e,lat:null==T?void 0:T.lat,lng:null==T?void 0:T.lng,marker:t}})},H=(t=(0,eM.A)(np().m(function e(){var t,n,o;return np().w(function(e){for(;;)switch(e.n){case 0:return h("Loop Route to this Point"),p(null),D(),t=s[R],n={origin:s[P-1].points.slice(-1)[0],destination:t.points[0],autoFollowRoads:a,avoidHighways:i,travelMode:x},e.n=1,(0,ec.dP)(n);case 1:(o=e.v).options=n,r(o);case 2:return e.a(2)}},e)})),function(){return t.apply(this,arguments)}),O=(n=(0,eM.A)(np().m(function e(){var t,n,o,r;return np().w(function(e){for(;;)switch(e.p=e.n){case 0:if(h("Delete this Point"),p(null),D(),!(S||N)){e.n=1;break}g([],R,1,N),e.n=8;break;case 1:if(!(R>0&&R<s.length)){e.n=7;break}return t=s[R-1],n=s[R],o={origin:t.points[0],destination:n.points.slice(-1)[0],autoFollowRoads:a,avoidHighways:i,travelMode:x},e.n=2,(0,ec.dP)(o);case 2:if(g([e.v],R-1,2),!a){e.n=6;break}return e.p=3,e.n=4,(0,ec.H2)(o);case 4:m(R-1,e.v),e.n=6;break;case 5:e.p=5,console.warn("â Failed to get routed segment for point deletion, keeping straight line:",(null==(r=e.v)?void 0:r.message)||r);case 6:e.n=8;break;case 7:console.warn("â Invalid segment index for point deletion:",{segmentIndex:R,segmentsLength:s.length});case 8:return e.a(2)}},e,null,[[3,5]])})),function(){return n.apply(this,arguments)}),_=function(){h("Delete All Points Before"),p(null),D(),g([],0,N?P:R,N),N&&f(T)},W=function(){h("Delete All Points After"),p(null),D(),g([],R,P-R),S&&f(T)},G=function(){var e=N?s.length:R,t=null==b?void 0:b[e],n=null,o=null;if(t&&t.markerId){n=ng[t.markerId];var r=(0,Y.du)(t.markerId);o=t.notes||(null==r?void 0:r.label)||"Waypoint"}var a=!!t;return(0,w.jsxs)("div",{className:E.dropdown,children:[(0,w.jsx)("div",{className:E.title,children:n?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("div",{className:E.distance,children:B}),(0,w.jsxs)("div",{className:E.iconWithDistance,children:[(0,w.jsx)(n,{style:{fontSize:28,marginRight:8}}),(0,w.jsx)("span",{children:o})]})]}):(0,w.jsx)("span",{children:B})}),P?(0,w.jsx)("button",{className:E.createMarkerButton,onClick:I,children:a?(0,w.jsx)(C.A,{id:"map.editor.dropdown.editMarker",defaultMessage:"EDIT MAP MARKER"}):(0,w.jsx)(C.A,{id:"map.editor.dropdown.addMarker",defaultMessage:"ADD MAP MARKER"})}):null,P&&!N?(0,w.jsx)(F,{onClick:H,children:(0,w.jsx)(C.A,{id:"map.editor.dropdown.loopRoute",defaultMessage:"Loop route to this point"})}):null,(0,w.jsx)(F,{onClick:O,destructive:!0,children:(0,w.jsx)(C.A,{id:"map.editor.dropdown.deleteThis",defaultMessage:"Delete this point"})}),S?null:(0,w.jsx)(F,{onClick:_,destructive:!0,children:(0,w.jsx)(C.A,{id:"map.editor.dropdown.deleteAllBefore",defaultMessage:"Delete all points before"})}),P&&!N?(0,w.jsx)(F,{onClick:W,destructive:!0,children:(0,w.jsx)(C.A,{id:"map.editor.dropdown.deleteAllAfter",defaultMessage:"Delete all points after"})}):null]})};return(0,v.useEffect)(function(){s.length||D()},[s]),(0,v.useEffect)(function(){if(k&&T){var e,t=window.innerHeight<600?100:50;!A.current&&M.current&&(A.current=(0,nn.createRoot)(M.current)),M.current&&A.current?A.current.render(G()):A.current&&(A.current.unmount(),A.current=null),j.current=ne
1w(t8()).Popup({offset:10,anchor:"bottom",closeOnClick:!0}).setLngLat([T.lng,T.lat]).setDOMContent(M.current).addTo(k);var n=null==(e=j.current)?void 0:e.getElement();return n&&(n.style.zIndex="100"),j.current.on("close",D),k.flyTo({center:T,offset:[0,t]}),function(){var e;null==(e=j.current)||e.remove()}}},[c]),null}),nv=(0,R.Ng)(function(e){return{segments:N.Pk(e),pointActionPosition:N.lr(e),distance:N.IV(e),unitType:N.KR(e),autoFollowRoads:N.ce(e),avoidHighways:N.BC(e),travelMode:N.qp(e),customMarkers:N.tM(e)}},nm)(nh),nx=n(57727),ny=(0,X.YK)({autoFollowRoads:{id:"map.editor.options.autoFollow",defaultMessage:"Auto Follow Roads"},AutoFollowAriaLabel:{id:"map.editor.options.AutoFollowAriaLabel",defaultMessage:"Auto-follow roads Toggle"}});function nb(e,t){var n=r()(e);if(i()){var o=i()(e);t&&(o=o.filter(function(t){return s()(e,t).enumerable})),n.push.apply(n,o)}return n}var nk=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nb(Object(n),!0).forEach(function(t){(0,h.A)(e,t,n[t])}):u()?p()(e,u()(n)):nb(Object(n)).forEach(function(t){g()(e,t,s()(n,t))})}return e}({},P),nw=(0,R.Ng)(function(e){return{autoFollow:(0,N.ce)(e)}},nk)((0,T.Ay)(function(e){var t=e.autoFollow,n=e.intl,o=e.routeControlPerformedEvent,r=e.setAutoFollow;return(0,w.jsx)("div",{style:{position:"absolute",right:140,zIndex:9,padding:"10px"},children:(0,w.jsx)(nx.q,{name:"autoFollow",checked:t,onChange:function(e){var t,n=null==e||null==(t=e.target)?void 0:t.checked;o("Auto-follow roads"),r(n)},ariaLabel:n.formatMessage(ny.AutoFollowAriaLabel),label:n.formatMessage(ny.autoFollowRoads)})})})),nj=(0,J.n9)()(function(e){return{controlRoot:{width:68,height:46,backgroundColor:e.palette.common.background.midground,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:4,border:"1px solid ".concat(e.palette.support.range.three),marginLeft:12,marginBottom:6,fontSize:9,fontWeight:700,fontFamily:e.typography.fontFamily,textTransform:"uppercase",cursor:"pointer"},label:{marginTop:4,lineHeight:1.5}}}),nM=function(e){var t=e.icon,n=e.label,o=e.onClick,r=e.tooltip,a=e.imgAlt,i=nj().classes;return(0,w.jsxs)("div",{className:i.controlRoot,onClick:function(e){o&&o(e)},title:r,tabIndex:0,children:[(0,w.jsx)("img",{src:t,alt:a}),(0,w.jsxs)("div",{className:i.label,children:[" ",n," "]})]})},nA=n(54001),nC=n.n(nA),nT=n.p+"asset/clear.cc24e895.svg",nR=n.p+"asset/outBack.72476c17.svg",nS=n.p+"asset/return.06112e1d.svg",nN=n.p+"asset/reverse.b2501324.svg",nE=n.p+"asset/undo.59d52ba0.svg",nL=n(47351),nP=n(22106),nB=(0,X.YK)({return:{id:"map.editor.map.control.return",defaultMessage:"Return"},returnTooltip:{id:"map.editor.map.control.returnTooltip",defaultMessage:"Take the shortest path back to start"},returnAlt:{id:"map.editor.map.control.returnAlt",defaultMessage:"Return to Start Icon"},reverse:{id:"map.editor.map.control.reverse",defaultMessage:"Reverse"},reverseTooltip:{id:"map.editor.map.control.reverseTooltip",defaultMessage:"Flip the start and end points of a route"},reverseAlt:{id:"map.editor.map.control.reverseAlt",defaultMessage:"Reverse"},outBack:{id:"map.editor.map.control.outBack",defaultMessage:"Out + Back"},outBackTooltip:{id:"map.editor.map.control.outBackTooltip",defaultMessage:"Take the same path back to start"},outBackAlt:{id:"map.editor.map.control.outBackAlt",defaultMessage:"Out & Back"},undo:{id:"map.editor.map.control.undo",defaultMessage:"Undo"},undoTooltip:{id:"map.editor.map.control.undoTooltip",defaultMessage:"Undo the previous action"},undoAlt:{id:"map.editor.map.control.undoAlt",defaultMessage:"Undo"},clear:{id:"map.editor.map.control.clear",defaultMessage:"Clear"},clearTooltip:{id:"map.editor.map.control.clearTooltip",defaultMessage:"Clear the map"},clearAlt:{id:"map.editor.map.control.clearAlt",defaultMessage:"Clear"},warning:{id:"map.editor.directions.api.message",defaultMessage:'There was a problem retrieving auto-route information for that location. Try disabling "follow roads" in the map controls or try again at a later time.'}});function nD(){var e,t,n="function"==typeof ev()?ev():{},o=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function a(n,o,r,a){var s=o&&o.prototype instanceof l?o:l,c=ey()(s.prototype);return nF(c,"_invoke",function(n,o,r){var a,l,s,c=0,u=r||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return a=t,l=0,s=e,p.n=n,i}};function f(n,o){for(l=n,s=o,t=0;!d&&c&&!r&&t<u.length;t++){var r,a=u[t],f=p.p,g=a[2];n>3?(r=g===o)&&(s=a[(l=a[4])?5:(l=3,3)],a[4]=a[5]=e):a[0]<=f&&((r=n<2&&f<a[1])?(l=0,p.v=o,p.n=a[1]):f<g&&(r=n<3||a[0]>o||o>g)&&(a[4]=n,a[5]=o,p.n=g,l=0))}if(r||n>1)return i;throw d=!0,o}return function(r,u,g){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,g),l=u,s=g;(t=l<2?e:s)||!d;){a||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,a){if(l||(r="next"),t=a[r]){if(!(t=t.call(a,s)))throw TypeError("iterator result is not an object");
1if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=a.return)&&t.call(a),l<2&&(s=TypeError("The iterator does not provide a '"+r+"' method"),l=1);a=e}else if((t=(d=p.n<0)?s:n.call(o,p))!==i)break}catch(t){a=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,r,a),!0),c}var i={};function l(){}function s(){}function c(){}t=ek();var u=[][o]?t(t([][o]())):(nF(t={},o,function(){return this}),t),d=c.prototype=l.prototype=ey()(u);function p(e){return ej()?ej()(e,c):(e.__proto__=c,nF(e,r,"GeneratorFunction")),e.prototype=ey()(d),e}return s.prototype=c,nF(d,"constructor",c),nF(c,"constructor",s),s.displayName="GeneratorFunction",nF(c,r,"GeneratorFunction"),nF(d),nF(d,r,"Generator"),nF(d,o,function(){return this}),nF(d,"toString",function(){return"[object Generator]"}),(nD=function(){return{w:a,m:p}})()}function nF(e,t,n,o){var r=g();try{r({},"",{})}catch(e){r=0}(nF=function(e,t,n,o){function a(t,n){nF(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[t]=n:(a("next",0),a("throw",1),a("return",2))})(e,t,n,o)}function nI(e,t){var n=r()(e);if(i()){var o=i()(e);t&&(o=o.filter(function(t){return s()(e,t).enumerable})),n.push.apply(n,o)}return n}function nH(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nI(Object(n),!0).forEach(function(t){(0,h.A)(e,t,n[t])}):u()?p()(e,u()(n)):nI(Object(n)).forEach(function(t){g()(e,t,s()(n,t))})}return e}var nO=nH(nH({},P),nP),n_=(0,R.Ng)(function(e){return{segments:N.Pk(e),highlightedPoints:N.Sb(e),segmentsManager:N.Y0(e),routeOriginPoint:N.DK(e),endSegment:N.fw(e),autoFollowRoads:N.ce(e),avoidHighways:N.BC(e),travelMode:N.qp(e)}},nO)((0,T.Ay)(function(e){var t,n,o=e.autoFollowRoads,r=e.avoidHighways,a=e.intl,i=e.segments,l=e.endSegment,s=e.routeOriginPoint,c=e.setRouteOriginPoint,u=e.updateSegments,d=e.addSegmentWithAsyncRouting,p=e.undoSegment,f=e.setSelectedElevationSegmentPoints,g=e.setConfirmClearModal,m=e.setElevationCursor,h=e.segmentsManager,v=e.routeControlPerformedEvent,x=e.showLoadingDialog,y=e.travelMode,b=e.setHasUnsavedChanges,k=e.showNotification,j=e.highlightedPoints,M=function(){v("Undo"),h.length?p():s&&(c(null),null==b||b(!1)),null!=j&&j.length&&f([])};(0,nL.vC)("ctrl+z, cmd+z",M,[h,s]);var A=function(e){return new(nC())(function(t){return setTimeout(t,e)})},C=(t=(0,eM.A)(nD().m(function e(){return nD().w(function(e){for(;;)switch(e.p=e.n){case 0:if(v("Reverse"),!i.length){e.n=4;break}return e.p=1,x(!0),e.n=2,nC().all((0,er.A)(i).reverse().map(function(){var e=(0,eM.A)(nD().m(function e(t,n){var a,i,l,s,c,u,d;return nD().w(function(e){for(;;)switch(e.n){case 0:if(a=[],i=[],!t.isStaticData){e.n=1;break}a=null==t?void 0:t.points.reverse(),i=null==t?void 0:t.notes,e.n=4;break;case 1:if(l=n-9,!(n>9)){e.n=2;break}return e.n=2,A(1e3*l);case 2:return c=(s=(null==t?void 0:t.points)||[])[s.length-1],u=s[0],e.n=3,(0,ec.ip)({origin:c,destination:u,avoidHighways:r,travelMode:y});case 3:d=e.v,a=o?null==d?void 0:d.waypoints:[c,u],i=null==d?void 0:d.notes;case 4:return e.a(2,nH(nH({},t),{},{points:(0,er.A)(a),notes:i}))}},e)}));return function(t,n){return e.apply(this,arguments)}}()));case 2:u(e.v),x(!1),e.n=4;break;case 3:e.p=3,e.v,x(!1),k(!0,a.formatMessage(nB.warning));case 4:return e.a(2)}},e,null,[[1,3]])})),function(){return t.apply(this,arguments)}),T=(n=(0,eM.A)(nD().m(function e(){var t,n;return nD().w(function(e){for(;;)switch(e.n){case 0:if(v("Return"),!i.length){e.n=2;break}return t={origin:null==l?void 0:l.points.slice(-1)[0],destination:i[0].points[0],autoFollowRoads:o,avoidHighways:r,travelMode:y},e.n=1,(0,ec.dP)(t);case 1:(n=e.v).options=t,d(n);case 2:return e.a(2)}},e)})),function(){return n.apply(this,arguments)});return(0,w.jsxs)("div",{style:{zIndex:6,position:"absolute",bottom:"26px",left:"0px"},children:[(0,w.jsx)(nM,{icon:nS,label:a.formatMessage(nB.return),onClick:T,tooltip:a.formatMessage(nB.returnTooltip),imgAlt:a.formatMessage(nB.returnAlt)}),(0,w.jsx)(nM,{icon:nN,label:a.formatMessage(nB.reverse),onClick:C,tooltip:a.formatMessage(nB.reverseTooltip),imgAlt:a.formatMessage(nB.reverseAlt)}),(0,w.jsx)(nM,{icon:nR,label:a.formatMessage(nB.outBack),onClick:function(){if(v("Out + Back"),i.length){var e=(0,er.A)(i).reverse().map(function(e){var t=(0,er.A)(e.points).reverse();return nH(nH({},e),{},{points:(0,er.A)(t)})});u([].concat((0,er.A)(i),(0,er.A)(e)))}},tooltip:a.formatMessage(nB.outBackTooltip),imgAlt:a.formatMessage(nB.outBackAlt)}
1),(0,w.jsx)(nM,{icon:nE,label:a.formatMessage(nB.undo),onClick:M,tooltip:a.formatMessage(nB.undoTooltip),imgAlt:a.formatMessage(nB.undoAlt)}),(0,w.jsx)(nM,{icon:nT,label:a.formatMessage(nB.clear),onClick:function(){v("Clear"),g(!0),m({}),null==b||b(!1)},tooltip:a.formatMessage(nB.clearTooltip),imgAlt:a.formatMessage(nB.clearAlt)})]})})),nW=n(4002),nG=(0,J.n9)()(function(){return{root:{zIndex:20}}}),nz=function(e){var t=e.onMapTypeUpdate,n=nG().classes;return(0,w.jsx)("div",{className:n.root,style:{position:"absolute",top:0,right:10,zIndex:9,padding:"10px"},children:(0,w.jsx)(nW.A,{onMapTypeUpdate:t,loadedMapType:"maplibre"})})},nK=(0,J.n9)()(function(e){return{root:(0,h.A)({backgroundColor:e.palette.common.background.midground,padding:16,margin:10,width:300,maxHeight:178},e.breakpoints.down("lg"),{width:225}),titleRoot:{overflow:"hidden",display:"-webkit-box","-webkit-line-clamp":2,"-webkit-box-orient":"vertical",maxHeight:70},title:{textTransform:"uppercase",wordWrap:"break-word"},stats:{display:"flex",justifyContent:"space-between",alignItems:"center"}}}),nU=(0,R.Ng)(function(e){return{distance:(0,N.Gx)(e)}},{})(function(e){var t=e.distance,n=e.onHelpModalClick,o=nK().classes;return t<=0?null:(0,w.jsx)("div",{style:{position:"absolute",top:0,left:"50%",transform:"translateX(-50%)",zIndex:9},children:(0,w.jsx)("div",{className:o.root,children:(0,w.jsxs)("div",{className:o.stats,children:[(0,w.jsx)(tq,{horizontal:!0}),(0,w.jsx)(t$,{onHelpClick:n})]})})})}),nY=n(7142),nq=n(23099);function nV(e,t){var n=r()(e);if(i()){var o=i()(e);t&&(o=o.filter(function(t){return s()(e,t).enumerable})),n.push.apply(n,o)}return n}var nJ=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nV(Object(n),!0).forEach(function(t){(0,h.A)(e,t,n[t])}):u()?p()(e,u()(n)):nV(Object(n)).forEach(function(t){g()(e,t,s()(n,t))})}return e}({},P),n$=(0,R.Ng)(function(e){return{segments:N.Pk(e),highlightedPoints:N.Sb(e)}},nJ)(function(e){var t=e.addPointMarker,n=e.segments,o=e.highlightedPoints,r=(0,nt.Jb)(),a=(0,v.useRef)(n),i=(0,v.useRef)(null),l=(0,v.useState)(!1),s=(0,m.A)(l,2),c=s[0],u=s[1],d=function(e,n){var o={lat:e.lngLat.lat,lng:e.lngLat.lng},r=a.current[n],i=r.points[0],l=r.points[r.points.length-1],s=(0,nY.dl)(o,i),c=(0,nY.dl)(o,l);s>35&&c>35&&t(o,n)},p=function(){t(null)},f={type:"FeatureCollection",features:[]},g=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o={type:"Feature",properties:{id:t,isTemporary:n},geometry:{type:"LineString",coordinates:e.map(function(e){return[e.lng,e.lat]})}};f.features.push(o)},h=function(){r&&(r.addLayer({id:"custom-lineLayer",type:"line",source:"custom-lineSource",filter:["!=",["get","isTemporary"],!0],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":eA.S.palette.common.brand.red,"line-width":6,"line-opacity":.6}}),r.addLayer({id:"custom-tempLineLayer",type:"line",source:"custom-lineSource",filter:["==",["get","isTemporary"],!0],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":eA.S.palette.common.brand.red,"line-width":4,"line-opacity":.4,"line-dasharray":[2,2]}}))},x=function(){!r||r.getLayer("custom-tempLineLayer")||(r.getLayer("custom-lineLayer")&&r.removeLayer("custom-lineLayer"),h())},y=function(){if(n.length&&r){a.current=n,f.features=[],n.forEach(function(e,t){g(e.points,t,e.isTemporary)});var e=r.getSource("custom-lineSource");e instanceof t6.GeoJSONSource?(x(),e.setData(f)):(r.addSource("custom-lineSource",{type:"geojson",data:f}),h())}};return(0,v.useEffect)(function(){if(r&&n.length)if(r.isStyleLoaded())y(),u(!0);else{var e=function(){y(),u(!0)};return r.once("style.load",e),function(){r.off("style.load",e)}}},[r,n]),(0,v.useEffect)(function(){if(r&&c){var e=function(e){i.current&&(clearTimeout(i.current),i.current=null),r.getCanvas().style.cursor="crosshair";var t,n,o=null==(t=e.features)?void 0:t[0];o&&d(e,null==(n=o.properties)?void 0:n.id)},t=function(){r.getCanvas().style.cursor="crosshair",i.current=setTimeout(function(){i.current=null,p()},150)},n=function(e){if(e.features&&e.features.length>0){var t;e.originalEvent&&(e.originalEvent.preventDefault(),e.originalEvent.stopPropagation()),d(e,null==(t=e.features[0].properties)?void 0:t.id)}},o=function(){};return r.on("mousemove","custom-lineLayer",e),r.on("mouseleave","custom-lineLayer",t),r.on("touchstart","custom-lineLayer",n),r.on("touchend","custom-lineLayer",o),function(){i.current&&(clearTimeout(i.current),i.current=null),r.off("mousemove","custom-lineLayer",e),r.off("mouseleave","custom-lineLayer",t),r.off("touchstart","custom-lineLayer",n),r.off("touchend","custom-lineLayer",o)}}},[r,n,c]),(0,v.useEffect)(function(){if(r&&null!=r&&r.loaded()){if(!(null!=n&&n.length)){var e=null==r?void 0:r.getSource("custom-lineSource");e instanceof t6.GeoJSONSource&&e.setData({type:"FeatureCollection",features:[]})}if(!(null!=o&&o.length)){var t=null==r?void 0:r.getSource("custom-highlighted-line-source");t instanceof t6.GeoJSONSource&&t.setData({type:"LineString",coordinates:[]})}}},[n,o,r]),(0,w.jsx)(w.Fragment,{children:null!=o&&o.length?(0,w.jsx)(nq.C,{points:o}):null})}),nX=n(18416),nQ=n(28089),nZ=(0,X.YK)({addPointTitle:{id:"map.editor.addPoint.segment.ariaTitle",defaultMessage:"Add point on the map segment"},endPointTitle:{id:"map.editor.end.point.ariaTitle",defaultMessage:"End Point on the map"},startPointTitle:{id:"map.editor.start.point.ariaTitle",defaultMessage:"Start Point on the map"},segmentPointTitle:{id:"map.editor.segment.point.ariaTitle",defaultMessage:"Segment point on the map"}});function n0(e,t){var n=r()(e);if(i()){var o=i()(e);t&&(o=o.filter(function(t){return s()(e,t).enumerable})),n.push.apply(n,o)}return n}function n1(){var e,t,n="function"==typeof ev()?ev():{},o=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function a(n,o,r,a){var s=o&&o.prototype instanceof l?o:l,c=ey()(s.prototype);return n2(c,"_invoke",function(n,o,r){var a,l,s,c=0,u=r||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return a=t,l=0,s=e,p.n=n,i}};function f(n,o){for(l=n,s=o,t=0;!d&&c&&!r&&t<u.length;t++){var r,a=u[t],f=p.p,g=a[2];n>3?(r=g===o)&&(s=a[(l=a[4])?5:(l=3,3)],a[4]=a[5]=e):a[0]<=f&&((r=n<2&&f<a[1])?(l=0,p.v=o,p.n=a[1]):f<g&&(r=n<3||a[0]>o||o>g)&&(a[4]=n,a[5]=o,p.n=g,l=0))}if(r||n>1)return i;throw d=!0,o}return function(r,u,g){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,g),l=u,s=g;(t=l<2?e:s)||!d;){a||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,a){if(l||(r="next"),t=a[r]){if(!(t=t.call(a,s)))throw TypeError("iterator result is not an object");
1if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=a.return)&&t.call(a),l<2&&(s=TypeError("The iterator does not provide a '"+r+"' method"),l=1);a=e}else if((t=(d=p.n<0)?s:n.call(o,p))!==i)break}catch(t){a=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,r,a),!0),c}var i={};function l(){}function s(){}function c(){}t=ek();var u=[][o]?t(t([][o]())):(n2(t={},o,function(){return this}),t),d=c.prototype=l.prototype=ey()(u);function p(e){return ej()?ej()(e,c):(e.__proto__=c,n2(e,r,"GeneratorFunction")),e.prototype=ey()(d),e}return s.prototype=c,n2(d,"constructor",c),n2(c,"constructor",s),s.displayName="GeneratorFunction",n2(c,r,"GeneratorFunction"),n2(d),n2(d,r,"Generator"),n2(d,o,function(){return this}),n2(d,"toString",function(){return"[object Generator]"}),(n1=function(){return{w:a,m:p}})()}function n2(e,t,n,o){var r=g();try{r({},"",{})}catch(e){r=0}(n2=function(e,t,n,o){function a(t,n){n2(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[t]=n:(a("next",0),a("throw",1),a("return",2))})(e,t,n,o)}var n4=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?n0(Object(n),!0).forEach(function(t){(0,h.A)(e,t,n[t])}):u()?p()(e,u()(n)):n0(Object(n)).forEach(function(t){g()(e,t,s()(n,t))})}return e}({},P),n5=(0,R.Ng)(function(e){return{addPointLocation:N.wt(e),segments:N.Pk(e),autoFollowRoads:N.ce(e),avoidHighways:N.BC(e),travelMode:N.qp(e)}},n4)((0,T.Ay)(function(e){var t,n,o=e.addPointMarker,r=e.addPointLocation,a=e.autoFollowRoads,i=e.avoidHighways,l=e.segments,s=e.updateSegments,c=e.routePointInteractionPerformedEvent,u=e.travelMode,d=e.intl,p=(0,nt.Jb)(),f=(0,v.useRef)([]);if(!r||!p)return null;f.current.forEach(function(e){return e.remove()}),f.current.splice(0,f.current.length);var g=r.location,m=r.segmentIndex,h=(t=(0,eM.A)(n1().m(function e(t){var n,r,d,p,f,g,h,v,x,y,b,k,w,j,M,A;return n1().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=l[m],r=null==t?void 0:t.getLngLat(),d=(0,nY.IM)(n.points,r),!(0===n.travelMode&&n.points.length>2&&d)){e.n=1;break}for(v=0,g=0,h=1/0;v<n.points.length;v++)(y=Math.sqrt(Math.pow((x=n.points[v]).lat-d.lat,2)+Math.pow(x.lng-d.lng,2)))<h&&(h=y,g=v);g=Math.max(1,Math.min(g,n.points.length-2)),b=n.points.slice(0,g+1),k=n.points.slice(g),p={points:b,distance:(0,ec.dQ)(b),notes:[],travelMode:0,isTemporary:!1,shouldPreservePoints:!0},f={points:k,distance:(0,ec.dQ)(k),notes:[],travelMode:0,isTemporary:!1,shouldPreservePoints:!0},e.n=12;break;case 1:if(w={origin:n.points[0],destination:d,autoFollowRoads:a,avoidHighways:i,includeStartEnd:!0,travelMode:u},j={origin:d,destination:n.points.slice(-1)[0],autoFollowRoads:a,avoidHighways:i,includeStartEnd:!0,travelMode:u},!a){e.n=9;break}return e.p=2,e.n=3,(0,ec.H2)(w);case 3:return p=e.v,e.n=4,(0,ec.H2)(j);case 4:f=e.v,e.n=8;break;case 5:return e.p=5,e.v,e.n=6,(0,ec.dP)(w);case 6:return p=e.v,e.n=7,(0,ec.dP)(j);case 7:f=e.v;case 8:e.n=12;break;case 9:return e.n=10,(0,ec.dP)(w);case 10:return p=e.v,e.n=11,(0,ec.dP)(j);case 11:f=e.v;case 12:M=(0,nX.M)("segment"),A=(0,nX.M)("segment"),p.segmentId=M,f.segmentId=A,s([p,f],m,1),o(null),c("Add Point");case 13:return e.a(2)}},e,null,[[2,5]])})),function(e){return t.apply(this,arguments)});return(0,w.jsx)(w.Fragment,{children:r.location?void((n=null!=g&&g.lat&&null!=g&&g.lng?new(t8()).Marker({element:(0,nQ.w)({color:"#".concat(eA.S.palette.common.foreground.inverse.substring(1)),borderColor:"#".concat(eA.S.palette.common.brand.red.substring(1)),size:24,label:"+",title:d.formatMessage(nZ.addPointTitle)})}).setLngLat([null==g?void 0:g.lng,null==g?void 0:g.lat]).addTo(p):null)&&(f.current.push(n),n.getElement().addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),h(n)}),n.getElement().addEventListener("touchstart",function(e){e.preventDefault(),e.stopPropagation(),h(n)}),n.getElement().addEventListener("touchend",function(e){e.preventDefault(),e.stopPropagation()}))):null})})),n3=n(37347),n6=(0,R.Ng)(function(e){return{directionCursor:(0,N.cf)(e)}},{})(function(e){var t=e.directionCursor,n=(0,nt.Jb)(),o=(0,v.useRef)([]);if(!(null!=t&&t.point))return o.current.forEach(function(e){return null==e?void 0:e.remove()}),o.current.splice(0,o.current.length),null;o.current.forEach(function(e){return null==e?void 0:e.remove()}),o.current.splice(0,o.current.length);var r=t.point,a=r.lat,i=r.lng;
1return a&&i?(0,w.jsx)(n3.I,{mapRef:n,markerRef:o,position:{lat:a,lng:i}}):null}),n8=n(28192),n9=(0,R.Ng)(function(e){return{distancePoints:N._G(e),showMileMarkers:N.jW(e)}},{})((0,T.Ay)(function(e){var t=e.distancePoints,n=e.showMileMarkers,o=(0,nt.Jb)(),r=(0,v.useRef)([]);return r.current.forEach(function(e){return e.remove()}),r.current.splice(0,r.current.length),(0,w.jsx)(w.Fragment,{children:n?t.map(function(e){return(0,w.jsx)(n8.y,{position:e,label:e.label,mapRef:o,distanceMarkersRef:r},e.lat)}):null})})),n7=(0,R.Ng)(function(e){return{elevationCursor:(0,N.mn)(e)}},{})(function(e){var t=e.elevationCursor,n=(0,nt.Jb)(),o=(0,v.useRef)([]);if(!(null!=t&&t.point))return null;o.current.forEach(function(e){return null==e?void 0:e.remove()}),o.current.splice(0,o.current.length);var r=t.point,a=r.lat,i=r.lng;return a&&i?(0,w.jsx)(n3.I,{mapRef:n,markerRef:o,position:{lat:a,lng:i}}):null}),oe=n(8829);function ot(e,t){var n=r()(e);if(i()){var o=i()(e);t&&(o=o.filter(function(t){return s()(e,t).enumerable})),n.push.apply(n,o)}return n}function on(){var e,t,n="function"==typeof ev()?ev():{},o=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function a(n,o,r,a){var s=o&&o.prototype instanceof l?o:l,c=ey()(s.prototype);return oo(c,"_invoke",function(n,o,r){var a,l,s,c=0,u=r||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return a=t,l=0,s=e,p.n=n,i}};function f(n,o){for(l=n,s=o,t=0;!d&&c&&!r&&t<u.length;t++){var r,a=u[t],f=p.p,g=a[2];n>3?(r=g===o)&&(s=a[(l=a[4])?5:(l=3,3)],a[4]=a[5]=e):a[0]<=f&&((r=n<2&&f<a[1])?(l=0,p.v=o,p.n=a[1]):f<g&&(r=n<3||a[0]>o||o>g)&&(a[4]=n,a[5]=o,p.n=g,l=0))}if(r||n>1)return i;throw d=!0,o}return function(r,u,g){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,g),l=u,s=g;(t=l<2?e:s)||!d;){a||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,a){if(l||(r="next"),t=a[r]){if(!(t=t.call(a,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=a.return)&&t.call(a),l<2&&(s=TypeError("The iterator does not provide a '"+r+"' method"),l=1);a=e}else if((t=(d=p.n<0)?s:n.call(o,p))!==i)break}catch(t){a=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,r,a),!0),c}var i={};function l(){}function s(){}function c(){}t=ek();var u=[][o]?t(t([][o]())):(oo(t={},o,function(){return this}),t),d=c.prototype=l.prototype=ey()(u);function p(e){return ej()?ej()(e,c):(e.__proto__=c,oo(e,r,"GeneratorFunction")),e.prototype=ey()(d),e}return s.prototype=c,oo(d,"constructor",c),oo(c,"constructor",s),s.displayName="GeneratorFunction",oo(c,r,"GeneratorFunction"),oo(d),oo(d,r,"Generator"),oo(d,o,function(){return this}),oo(d,"toString",function(){return"[object Generator]"}),(on=function(){return{w:a,m:p}})()}function oo(e,t,n,o){var r=g();try{r({},"",{})}catch(e){r=0}(oo=function(e,t,n,o){function a(t,n){oo(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[t]=n:(a("next",0),a("throw",1),a("return",2))})(e,t,n,o)}var or=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ot(Object(n),!0).forEach(function(t){(0,h.A)(e,t,n[t])}):u()?p()(e,u()(n)):ot(Object(n)).forEach(function(t){g()(e,t,s()(n,t))})}return e}({},P),oa=(0,R.Ng)(function(e){return{segments:N.Pk(e),endSegment:N.fw(e),autoFollowRoads:N.ce(e),avoidHighways:N.BC(e),travelMode:N.qp(e),customMarkers:N.tM(e)}},or)((0,T.Ay)(function(e){var t,n,o=e.autoFollowRoads,r=e.avoidHighways,a=e.endSegment,i=e.segments,l=e.setPointActionsPosition,s=e.updateSegments,c=e.updateSegmentWithFinalRoute,u=e.intl,d=e.travelMode,p=e.customMarkers,f=(0,nt.Jb)(),g=i.length-1,m=(0,v.useRef)([]);null!=i&&i.length||(m.current.forEach(function(e){return e.remove()}),m.current.splice(0,m.current.length));var h=(t=(0,eM.A)(on().m(function e(t){var n,i,l;return on().w(function(e){for(;;)switch(e.p=e.n){case 0:return n=null==t?void 0:t.getLngLat(),i={origin:null==a?void 0:a.points[0],destination:n&&{lng:n.lng,lat:n.lat},autoFollowRoads:o,avoidHighways:r,travelMode:d},e.n=1,(0,ec.dP)(i);case 1:if(s([e.v],g),!o){e.n=5;break}return e.p=2,e.n=3,(0,ec.H2)(i);case 3:c(g,e.v),e.n=5;break;case 4:e.p=4,console.warn("â Failed to get routed segment for end marker drag, keeping straight line:",(null==(l=e.v)?void 0:l.message)||l);case 5:return e.a(2)}},e,null,[[2,4]])})),function(e){return t.apply(this,arguments)}),x=(n=(0,eM.A)(on().m(function e(t){return on().w(function(e){for(;;)switch(e.n){case 0:l({latLng:null==t?void 0:t.getLngLat(),index:g,isLast:!0});case 1:return e.a(2)}},e)})),function(e){return n.apply(this,arguments)}),y=i.length,b=null==p?void 0:p[y],k=b?(0,Y.Ir)(b.markerId):null;return b&&!k&&console.warn("[EndMarker] Invalid marker ID at waypoint ".concat(y,": ").concat(b.markerId)),(0,w.jsx)(w.Fragment,{children:a?(0,w.jsx)(oe.g,{mapRef:f,position:a.points.slice(-1)[0],draggable:!0,onDragEnd:h,onClick:x,title:(null==b?void 0:b.notes)||u.formatMessage(nZ.endPointTitle),endMarkersRef:m,customIcon:k}):null})})),oi=n(91076),ol=function(e){var t=e.position,n=e.mapRef,o=e.markerElement,r=e.onDragEnd,a=e.handleOnClick,i=e.index,l=e.highlightedMarkersRef;if(n){var s=new(t8()).Marker({element:o,draggable:!0}).setLngLat([null==t?void 0:t.lng,null==t?void 0:t.lat]).addTo(n);l.current.push(s),s.on("dragend",function(){r(i,s.getLngLat())}),o.addEventListener("click",function(e){e.stopPropagation(),a(s,i)}),o.addEventListener("mouseenter",function(){o.style.width="24px",o.style.height="24px"}),o.addEventListener("mouseleave",function(){o.style.width="20px",o.style.height="20px"})}};function os(e,t){var n=r()(e);if(i()){var o=i()(e);t&&(o=o.filter(function(t){return s()(e,t).enumerable})),n.push.apply(n,o)}return n}function oc(){var e,t,n="function"==typeof ev()?ev():{},o=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function a(n,o,r,a){var s=o&&o.prototype instanceof l?o:l,c=ey()(s.prototype);return ou(c,"_invoke",function(n,o,r){var a,l,s,c=0,u=r||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return a=t,l=0,s=e,p.n=n,i}};function f(n,o){for(l=n,s=o,t=0;!d&&c&&!r&&t<u.length;t++){var r,a=u[t],f=p.p,g=a[2];n>3?(r=g===o)&&(s=a[(l=a[4])?5:(l=3,3)],a[4]=a[5]=e):a[0]<=f&&((r=n<2&&f<a[1])?(l=0,p.v=o,p.n=a[1]):f<g&&(r=n<3||a[0]>o||o>g)&&(a[4]=n,a[5]=o,p.n=g,l=0))}if(r||n>1)return i;throw d=!0,o}return function(r,u,g){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,g),l=u,s=g;(t=l<2?e:s)||!d;){a||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,a){if(l||(r="next"),t=a[r]){if(!(t=t.call(a,s)))throw TypeError("iterator result is not an object");
1if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=a.return)&&t.call(a),l<2&&(s=TypeError("The iterator does not provide a '"+r+"' method"),l=1);a=e}else if((t=(d=p.n<0)?s:n.call(o,p))!==i)break}catch(t){a=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,r,a),!0),c}var i={};function l(){}function s(){}function c(){}t=ek();var u=[][o]?t(t([][o]())):(ou(t={},o,function(){return this}),t),d=c.prototype=l.prototype=ey()(u);function p(e){return ej()?ej()(e,c):(e.__proto__=c,ou(e,r,"GeneratorFunction")),e.prototype=ey()(d),e}return s.prototype=c,ou(d,"constructor",c),ou(c,"constructor",s),s.displayName="GeneratorFunction",ou(c,r,"GeneratorFunction"),ou(d),ou(d,r,"Generator"),ou(d,o,function(){return this}),ou(d,"toString",function(){return"[object Generator]"}),(oc=function(){return{w:a,m:p}})()}function ou(e,t,n,o){var r=g();try{r({},"",{})}catch(e){r=0}(ou=function(e,t,n,o){function a(t,n){ou(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[t]=n:(a("next",0),a("throw",1),a("return",2))})(e,t,n,o)}var od=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?os(Object(n),!0).forEach(function(t){(0,h.A)(e,t,n[t])}):u()?p()(e,u()(n)):os(Object(n)).forEach(function(t){g()(e,t,s()(n,t))})}return e}({},P),op=(0,R.Ng)(function(e){return{segments:N.Pk(e),autoFollowRoads:N.ce(e),avoidHighways:N.BC(e),travelMode:N.qp(e),customMarkers:N.tM(e)}},od)((0,T.Ay)(function(e){var t,n,o=e.autoFollowRoads,r=e.avoidHighways,a=e.segments,i=e.setPointActionsPosition,l=e.updateSegments,s=e.updateSegmentWithFinalRoute,c=e.travelMode,u=e.intl,d=e.customMarkers,p=(0,nt.Jb)(),f=(0,v.useRef)([]),g=a.slice(1);if(!(null!=g&&g.length))return f.current.forEach(function(e){return e.remove()}),f.current.splice(0,f.current.length),null;f.current.forEach(function(e){return e.remove()}),f.current.splice(0,f.current.length);var m=function(e){var t=e+1,n=null==d?void 0:d[t],o=n?(0,Y.Ir)(n.markerId):null;return(n&&!o&&console.warn("[HighlightedMarkers] Invalid marker ID at waypoint ".concat(t,": ").concat(n.markerId)),null!=o&&o.iconComponent)?(0,oi.N)({iconComponent:o.iconComponent,size:24,color:eA.S.palette.common.black,backgroundColor:eA.S.palette.common.white,title:(null==n?void 0:n.notes)||o.label||u.formatMessage(nZ.segmentPointTitle)}):(0,nQ.w)({color:"#".concat(eA.S.palette.common.foreground.inverse.substring(1)),borderColor:"#".concat(eA.S.palette.common.brand.red.substring(1)),size:20,title:u.formatMessage(nZ.segmentPointTitle)})},h=(t=(0,eM.A)(oc().m(function e(t,n){var i,u,d,p,f,g,m,h,v,x,y;return oc().w(function(e){for(;;)switch(e.p=e.n){case 0:return i={lat:null==n?void 0:n.lat,lng:null==n?void 0:n.lng},u=a[t],d=a[t+1],p=0===u.travelMode||0===d.travelMode,f={origin:u.points[0],destination:i,autoFollowRoads:o,avoidHighways:r,travelMode:c,includeStartEnd:p},g={origin:i,destination:d.points.slice(-1)[0],autoFollowRoads:o,avoidHighways:r,travelMode:c,includeStartEnd:p},e.n=1,(0,ec.dP)(f);case 1:return m=e.v,e.n=2,(0,ec.dP)(g);case 2:if(h=e.v,l([m,h],t,2),!o){e.n=7;break}return e.p=3,e.n=4,(0,ec.H2)(f);case 4:return v=e.v,e.n=5,(0,ec.H2)(g);case 5:x=e.v,s(t,v),s(t+1,x),e.n=7;break;case 6:e.p=6,console.warn("â Failed to get routed segments for dragged point, keeping straight lines:",(null==(y=e.v)?void 0:y.message)||y);case 7:return e.a(2)}},e,null,[[3,6]])})),function(e,n){return t.apply(this,arguments)}),x=(n=(0,eM.A)(oc().m(function e(t,n){return oc().w(function(e){for(;;)switch(e.n){case 0:i({latLng:null==t?void 0:t.getLngLat(),index:n+1});case 1:return e.a(2)}},e)})),function(e,t){return n.apply(this,arguments)});return(0,w.jsx)(w.Fragment,{children:g.map(function(e,t){return(0,w.jsx)(ol,{index:t,mapRef:p,position:e.points[0],markerElement:m(t),onDragEnd:h,handleOnClick:x,highlightedMarkersRef:f},t)})})})),of=n(53807);function og(e,t){var n=r()(e);if(i()){var o=i()(e);t&&(o=o.filter(function(t){return s()(e,t).enumerable})),n.push.apply(n,o)}return n}function om(){var e,t,n="function"==typeof ev()?ev():{},o=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function a(n,o,r,a){var s=o&&o.prototype instanceof l?o:l,c=ey()(s.prototype);return oh(c,"_invoke",function(n,o,r){var a,l,s,c=0,u=r||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return a=t,l=0,s=e,p.n=n,i}};function f(n,o){for(l=n,s=o,t=0;!d&&c&&!r&&t<u.length;t++){var r,a=u[t],f=p.p,g=a[2];n>3?(r=g===o)&&(s=a[(l=a[4])?5:(l=3,3)],a[4]=a[5]=e):a[0]<=f&&((r=n<2&&f<a[1])?(l=0,p.v=o,p.n=a[1]):f<g&&(r=n<3||a[0]>o||o>g)&&(a[4]=n,a[5]=o,p.n=g,l=0))}if(r||n>1)return i;throw d=!0,o}return function(r,u,g){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,g),l=u,s=g;(t=l<2?e:s)||!d;){a||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,a){if(l||(r="next"),t=a[r]){if(!(t=t.call(a,s)))throw TypeError("iterator result is not an object");
1if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=a.return)&&t.call(a),l<2&&(s=TypeError("The iterator does not provide a '"+r+"' method"),l=1);a=e}else if((t=(d=p.n<0)?s:n.call(o,p))!==i)break}catch(t){a=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,r,a),!0),c}var i={};function l(){}function s(){}function c(){}t=ek();var u=[][o]?t(t([][o]())):(oh(t={},o,function(){return this}),t),d=c.prototype=l.prototype=ey()(u);function p(e){return ej()?ej()(e,c):(e.__proto__=c,oh(e,r,"GeneratorFunction")),e.prototype=ey()(d),e}return s.prototype=c,oh(d,"constructor",c),oh(c,"constructor",s),s.displayName="GeneratorFunction",oh(c,r,"GeneratorFunction"),oh(d),oh(d,r,"Generator"),oh(d,o,function(){return this}),oh(d,"toString",function(){return"[object Generator]"}),(om=function(){return{w:a,m:p}})()}function oh(e,t,n,o){var r=g();try{r({},"",{})}catch(e){r=0}(oh=function(e,t,n,o){function a(t,n){oh(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[t]=n:(a("next",0),a("throw",1),a("return",2))})(e,t,n,o)}var ov=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?og(Object(n),!0).forEach(function(t){(0,h.A)(e,t,n[t])}):u()?p()(e,u()(n)):og(Object(n)).forEach(function(t){g()(e,t,s()(n,t))})}return e}({},P),ox=(0,R.Ng)(function(e){return{startSegment:N.YX(e),routeOriginPoint:N.DK(e),autoFollowRoads:N.ce(e),avoidHighways:N.BC(e),travelMode:N.qp(e),customMarkers:N.tM(e)}},ov)((0,T.Ay)(function(e){var t,n,o,r=e.autoFollowRoads,a=e.avoidHighways,i=e.startSegment,l=e.routeOriginPoint,s=e.setPointActionsPosition,c=e.updateSegments,u=e.updateSegmentWithFinalRoute,d=e.intl,p=e.travelMode,f=e.customMarkers,g=(0,nt.Jb)(),m=(null==i||null==(o=i.points)?void 0:o[0])||l,h=(0,v.useRef)([]);if(!m)return h.current.forEach(function(e){return e.remove()}),h.current.splice(0,h.current.length),null;var x=(t=(0,eM.A)(om().m(function e(t){var n,o,l,s;return om().w(function(e){for(;;)switch(e.p=e.n){case 0:return l={origin:(o=null==t?void 0:t.getLngLat())&&{lng:o.lng,lat:o.lat},destination:null==i||null==(n=i.points)?void 0:n.slice(-1)[0],autoFollowRoads:r,avoidHighways:a,travelMode:p},e.n=1,(0,ec.dP)(l);case 1:if(c([e.v],0),!r){e.n=5;break}return e.p=2,e.n=3,(0,ec.H2)(l);case 3:u(0,e.v),e.n=5;break;case 4:e.p=4,console.warn("â Failed to get routed segment for start marker drag, keeping straight line:",(null==(s=e.v)?void 0:s.message)||s);case 5:return e.a(2)}},e,null,[[2,4]])})),function(e){return t.apply(this,arguments)}),y=(n=(0,eM.A)(om().m(function e(t){return om().w(function(e){for(;;)switch(e.n){case 0:s({latLng:null==t?void 0:t.getLngLat(),index:0,isStart:!0});case 1:return e.a(2)}},e)})),function(e){return n.apply(this,arguments)}),b=null==f?void 0:f[0],k=b?(0,Y.Ir)(b.markerId):null;return b&&!k&&console.warn("[StartMarker] Invalid marker ID at waypoint ".concat(0,": ").concat(b.markerId)),(0,w.jsx)(w.Fragment,{children:m?(0,w.jsx)(of.V,{mapRef:g,position:m,draggable:!0,onDragEnd:x,onClick:y,title:(null==b?void 0:b.notes)||d.formatMessage(nZ.startPointTitle),startMarkersRef:h,customIcon:k}):null})})),oy=function(){return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(n5,{}),(0,w.jsx)(ox,{}),(0,w.jsx)(oa,{}),(0,w.jsx)(op,{}),(0,w.jsx)(n6,{}),(0,w.jsx)(n7,{}),(0,w.jsx)(n9,{})]})},ob=function(e){var t=e.onMapLoad,n=e.zoomLevel,o=e.defaultLocation,r=e.mapType,a=e.setHasUnsavedChanges,i=e.height,l=e.onMapTypeUpdate,s=e.showBikePaths,c=e.onMapCenter,u=e.isMobile,d=e.showLeftPanel,p=e.onHelpModalClick;return(0,w.jsx)("div",{style:{width:"100%",height:"".concat(i,"px")},children:(0,w.jsxs)(nt.K4,{center:o,onMapLoad:t,zoom:n,mapType:r,showBikePaths:s,onMapCenter:c,allowedControls:{fullscreen:!u,center:!0},isMobile:u,allowZoom:!1,children:[(0,w.jsx)(n_,{setHasUnsavedChanges:a}),(0,w.jsx)(oy,{}),(0,w.jsx)(n$,{mapType:r}),(0,w.jsx)(nv,{}),(0,w.jsx)(nc,{}),(0,w.jsx)(nz,{onMapTypeUpdate:l}),(0,w.jsx)(nw,{}),d?null:(0,w.jsx)(w.Fragment,{children:(0,w.jsx)(nU,{onHelpModalClick:p})})]})})},ok=(0,J.n9)()(function(e){return{mapContainer:{position:"relative",width:"100%","& .gm-style .gm-style-iw-c":{borderRadius:"4px !important"}},mapLibreContainer:{position:"relative",width:"100%",height:"100%","& .gm-style .gm-style-iw-c":{borderRadius:"4px !important"}},snackBarRoot:{backgroundColor:e.palette.warning.main,fontSize:14,fontWeight:700},copyContainer:{marginBottom:24},heightAnimation:{transition:"height 0.3s ease-in-out"},newMapContainer:{height:"95%",minHeight:"200px"}}});function ow(e,t){var n=r()(e);if(i()){var o=i()(e);t&&(o=o.filter(function(t){return s()(e,t).enumerable})),n.push.apply(n,o)}return n}function oj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?ow(Object(n),!0).forEach(function(t){(0,h.A)(e,t,n[t])}):u()?p()(e,u()(n)):ow(Object(n)).forEach(function(t){g()(e,t,s()(n,t))})}return e}function oM(){var e,t,n="function"==typeof ev()?ev():{},o=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function a(n,o,r,a){var s=o&&o.prototype instanceof l?o:l,c=ey()(s.prototype);return oA(c,"_invoke",function(n,o,r){var a,l,s,c=0,u=r||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return a=t,l=0,s=e,p.n=n,i}};function f(n,o){for(l=n,s=o,t=0;!d&&c&&!r&&t<u.length;t++){var r,a=u[t],f=p.p,g=a[2];n>3?(r=g===o)&&(s=a[(l=a[4])?5:(l=3,3)],a[4]=a[5]=e):a[0]<=f&&((r=n<2&&f<a[1])?(l=0,p.v=o,p.n=a[1]):f<g&&(r=n<3||a[0]>o||o>g)&&(a[4]=n,a[5]=o,p.n=g,l=0))}if(r||n>1)return i;throw d=!0,o}return function(r,u,g){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,g),l=u,s=g;(t=l<2?e:s)||!d;){a||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,a){if(l||(r="next"),t=a[r]){if(!(t=t.call(a,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=a.return)&&t.call(a),l<2&&(s=TypeError("The iterator does not provide a '"+r+"' method"),l=1);a=e}else if((t=(d=p.n<0)?s:n.call(o,p))!==i)break}catch(t){a=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,r,a),!0),c}var i={};function l(){}function s(){}function c(){}t=ek();var u=[][o]?t(t([][o]())):(oA(t={},o,function(){return this}),t),d=c.prototype=l.prototype=ey()(u);function p(e){return ej()?ej()(e,c):(e.__proto__=c,oA(e,r,"GeneratorFunction")),e.prototype=ey()(d),e}return s.prototype=c,oA(d,"constructor",c),oA(c,"constructor",s),s.displayName="GeneratorFunction",oA(c,r,"GeneratorFunction"),oA(d),oA(d,r,"Generator"),oA(d,o,function(){return this}),oA(d,"toString",function(){return"[object Generator]"}),(oM=function(){return{w:a,m:p}})()}function oA(e,t,n,o){var r=g();try{r({},"",{})}catch(e){r=0}(oA=function(e,t,n,o){function a(t,n){oA(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[t]=n:(a("next",0),a("throw",1),a("return",2))})(e,t,n,o)}var oC=oj(oj({},P),L),oT=(0,R.Ng)(function(e){return{segments:N.Pk(e),endSegment:N.fw(e),routeOriginPoint:N.DK(e),points:N.IX(e),autoFollowRoads:N.ce(e),avoidHighways:N.BC(e),expandElevation:N.Oi(e),directionCursor:N.cf(e),elevationCursor:N.mn(e),showConfirmModal:N.fD(e),highlightedPoints:N.Sb(e),isMobile:(0,E.H6)(e),travelMode:N.qp(e),showElevation:N.Ix(e),showBikePaths:N.tL(e),mapType:tu.DH(e)}},oC)(function(e){var t,n=e.autoFollowRoads,o=e.avoidHighways,r=e.addSegmentWithAsyncRouting,a=e.className,i=e.defaultLocation,l=e.locationBbox,s=e.directionCursor,c=e.elevationCursor,u=e.endSegment,d=e.pageHeight,p=e.elevationHeight,f=e.routeOriginPoint,g=e.segments,m=e.setRouteOriginPoint,h=e.expandElevation,x=e.showElevation,y=e.points,b=e.destroySegments,k=e.setConfirmClearModal,j=e.showConfirmModal,M=e.highlightedPoints,A=e.setSelectedElevationSegmentPoints,T=e.isMobile,R=e.routeControlPerformedEvent,S=e.setPointActionsPosition,N=e.travelMode,E=e.showStartMessage,L=e.showLeftPanel,P=e.onHelpModalClick,B=e.setHasUnsavedChanges,D=e.updateRouteNameByLocation,F=e.setMapLibreRef,I=e.showBikePaths,H=e.mapType,O=e.setMapType,_=ok().classes,W=(0,v.useRef)(null),G=(0,v.useRef)(f),z=(0,v.useRef)(u),K=(0,v.useRef)(g),U=(0,v.useRef)(y),Y=(0,v.useRef)(i),q=(0,v.useRef)(l),V=(0,v.useRef)(n),J=(0,v.useRef)(N),$=(0,v.useRef)(o),X=(0,v.useRef)(!1),Q=x&&h&&!T?(null!=d?d:0)-(null!=p?p:0):d,Z=new(t8()).Popup({closeButton:!1,closeOnClick:!1});(0,v.useEffect)(function(){G.current=f,z.current=u,K.current=g,U.current=y,Y.current=i,q.current=l,V.current=n,J.current=N,$.current=o},[f,u,g,y,i,l,n,N,o]),(0,v.useEffect)(function(){W.current&&l&&W.current.fitBounds(l,{padding:T?50:200,animate:!0})},[l,T]),(0,v.useEffect)(function(){if(W.current&&(null!=s&&s.panTo?W.current.panTo(s.point):null!=c&&c.panTo&&W.current.panTo(c.point),null!=M&&M.length)){var e,t=new(t8()).LngLatBounds;null==(e=U.current)||e.forEach(function(e){var n=e.lng,o=e.lat;t.extend([n,o])}),W.current.fitBounds(t)}},[s,c,M]);var ee=function(){if(W.current&&U.current){var e=new(t8()).LngLatBounds;U.current.forEach(function(t){var n=t.lng,o=t.lat;e.extend([n,o])});var t=(null!=Q?Q:0)<500?100:200;W.current.fitBounds(e,{padding:T?50:t,animate:!1})}},et=function(){if(W.current)if(X.current)X.current=!1;else if(q.current)W.current.fitBounds(q.current,{padding:T?50:200,animate:!1});else{var e,t,n,o,r,a,i,l=(null==Y||null==(e=Y.current)?void 0:e.zoom)||14;null==W||null==(t=W.current)||t.setZoom(l),null==W||null==(n=W.current)||n.setCenter([null!=(o=null==Y||null==(r=Y.current)?void 0:r.lng)?o:0,null!=(a=null==Y||null==(i=Y.current)?void 0:i.lat)?a:0])}},en=(t=(0,eM.A)(oM().m(function e(t,n){var o,a;return oM().w(function(e){for(;;)switch(e.n){case 0:return o={origin:t,destination:n,autoFollowRoads:V.current,avoidHighways:$.current,travelMode:J.current},e.n=1,(0,ec.dP)(o);
1case 1:(a=e.v).options=o,r(a);case 2:return e.a(2)}},e)})),function(e,n){return t.apply(this,arguments)}),eo=function(e){var t,n,o,r={lat:null==e||null==(t=e.lngLat)?void 0:t.lat,lng:null==e||null==(n=e.lngLat)?void 0:n.lng};null!=K&&null!=(o=K.current)&&o.length?en(z.current.points.slice(-1)[0],r):G.current?en(G.current,r):(m(r),G.current=r,Z.remove(),D({latLng:null==e?void 0:e.lngLat}),E(null)),S(null),B(!0)},er=function(e){G.current||(E(null==e?void 0:e.lngLat),Z.setLngLat(null==e?void 0:e.lngLat).setHTML("Click to Start Route").addTo(W.current))},ea=function(){Z.remove(),E(null)};return(0,w.jsxs)("div",{className:es()(_.mapLibreContainer,a),children:[(0,w.jsx)(ob,{containerElement:(0,w.jsx)("div",{style:{height:Q},className:_.heightAnimation}),mapElement:(0,w.jsx)("div",{style:{height:"100%"}}),onMapClick:eo,onMapMouseMove:er,onMapMouseOut:ea,onMapLoad:function(e){e&&(W.current=e,F(e),e.getCanvas().style.cursor="crosshair",e.on("click",function(e){var t;null!=e&&e.defaultPrevented||null!=e&&null!=(t=e.originalEvent)&&t.defaultPrevented||eo(e)}),e.on("mousemove",function(e){er(e)}),e.on("mouseout",function(){ea()}),et())},onMapCenter:function(){var e;R("Center"),null!=K&&null!=(e=K.current)&&e.length&&ee()},defaultLocation:i,zoomLevel:(null==i?void 0:i.zoom)||14,mapType:H,isMobile:T,onMapTypeUpdate:function(e){R("Map Type",{mapType:t7.q[e]}),O(e),X.current=!0},showLeftPanel:L,onHelpModalClick:function(e){P(e)},setHasUnsavedChanges:B,routeOriginPoint:f,mapTypeControlClass:_.newMapContainer,height:Q,showBikePaths:I}),(0,w.jsx)(ne.A,{severity:"warning"}),(0,w.jsx)(t9.R,{isOpen:j,onConfirm:function(){b(),m(null),k(!1),A([])},onClose:function(){k(!1)},confirmText:(0,w.jsx)(C.A,{id:"map.editor.control.confirm.button",defaultMessage:"Confirm"}),dismissText:(0,w.jsx)(C.A,{id:"map.editor.control.cancel.button",defaultMessage:"Cancel"}),children:(0,w.jsx)(ed.o5,{variant:"body1",className:_.copyContainer,children:(0,w.jsx)(C.A,{id:"map.editor.control.confirmClear",defaultMessage:"Are you sure you want to clear the map?"})})})]})}),oR=n.p+"asset/fullscreen.ac6a99ea.svg",oS=n.p+"asset/location.e581a5a0.svg",oN=(0,J.n9)()(function(e){return{controlItemRoot:{display:"flex",alignItems:"center",marginBottom:12},squareContainer:{height:46,backgroundColor:e.palette.common.background.midground,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:4,border:"1px solid ".concat(e.palette.support.range.three)},largeBorder:{width:68,paddingTop:4},smallBorder:{width:46},title:{fontSize:9,fontWeight:700,textTransform:"uppercase"},desc:(0,h.A)({overflowWrap:"break-word",maxWidth:170},e.breakpoints.down("md"),{maxWidth:220}),smallDesc:{marginLeft:5},largeDesc:{marginLeft:16},borderContainer:{width:68,display:"flex",justifyContent:"center"}}}),oE=(0,T.Ay)(function(e){var t=e.intl,n=e.icon,o=e.title,r=e.description,a=oN().classes;return(0,w.jsxs)("div",{className:a.controlItemRoot,children:[(0,w.jsx)("div",{className:a.borderContainer,children:(0,w.jsxs)("div",{className:es()(a.squareContainer,(0,h.A)((0,h.A)({},a.largeBorder,!!o),a.smallBorder,!o)),children:[(0,w.jsx)("img",{src:n}),o?(0,w.jsx)(ed.o5,{variant:"caption",className:a.title,children:t.formatMessage(o)}):null]})}),(0,w.jsx)(ed.o5,{variant:"caption",className:es()(a.desc,(0,h.A)((0,h.A)({},a.largeDesc,!!o),a.smallDesc,!o)),children:t.formatMessage(r)})]})}),oL=(0,J.n9)()(function(e){return{containerRoot:(0,h.A)({display:"flex",justifyContent:"center",marginTop:28,marginBottom:28},e.breakpoints.down("md"),{flexDirection:"column"}),controlsRoot:{display:"flex",flexDirection:"column",flexWrap:"wrap",height:"100%"}}}),oP=(0,X.YK)({reverse:{id:"create.route.onboarding.controls.reverse",defaultMessage:"Flip start and end points of a route"},reverseTitle:{id:"create.route.onboarding.controls.reverseTitle",defaultMessage:"Reverse"},return:{id:"create.route.onboarding.controls.return",defaultMessage:"Take the shortest path back to start"},returnTitle:{id:"create.route.onboarding.controls.returnTitle",defaultMessage:"Return"},outBack:{id:"create.route.onboarding.controls.outBack",defaultMessage:"Take the same path back to start"},outBackTitle:{id:"create.route.onboarding.controls.outBackTitle",defaultMessage:"Out + Back"},undo:{id:"create.route.onboarding.controls.undo",defaultMessage:"Undo the previous action"},undoTitle:{id:"create.route.onboarding.controls.undoTitle",defaultMessage:"Undo"},clear:{id:"create.route.onboarding.controls.clear",defaultMessage:"Clear the map"},clearTitle:{id:"create.route.onboarding.controls.clearTitle",defaultMessage:"Clear"},walkRules:{id:"create.route.onboarding.controls.walkRules",defaultMessage:"Route follows roads with no restrictions"},bikeRules:{id:"create.route.onboarding.controls.bikeRules",defaultMessage:"Route obeys the rules of the road and will follow bike paths"},roadRules:{id:"create.route.onboarding.controls.roadRules",defaultMessage:"Route obeys the rules of the road"},fullScreen:{id:"create.route.onboarding.controls.fullScreen",defaultMessage:"View Map Area in full screen"},shareLocation:{id:"create.route.onboarding.controls.shareLocation",defaultMessage:"Change map to current location"}}),oB=[{icon:nN,title:oP.reverseTitle,description:oP.reverse}
1,{icon:nS,title:oP.returnTitle,description:oP.return},{icon:nR,title:oP.outBackTitle,description:oP.outBack},{icon:nE,title:oP.undoTitle,description:oP.undo},{icon:nT,title:oP.clearTitle,description:oP.clear}],oD=[{icon:tL,description:oP.walkRules,noBorder:!1},{icon:tN,description:oP.bikeRules,noBorder:!1},{icon:tE,description:oP.roadRules,noBorder:!1},{icon:oR,description:oP.fullScreen,noBorder:!1},{icon:oS,description:oP.shareLocation,noBorder:!0}],oF=function(){var e=oL().classes;return(0,w.jsxs)("div",{children:[(0,w.jsx)(ed.o5,{variant:"h2",component:"h2",children:(0,w.jsx)(C.A,{id:"create.route.onboarding.controls.title",defaultMessage:"Tools to Know"})}),(0,w.jsxs)("div",{className:e.containerRoot,children:[(0,w.jsx)("div",{className:e.controlsRoot,children:oB.map(function(e,t){return(0,w.jsx)(oE,{icon:e.icon,title:e.title,description:e.description},t)})}),(0,w.jsx)("div",{className:e.controlsRoot,children:oD.map(function(e,t){return(0,w.jsx)(oE,{icon:e.icon,description:e.description,noBorder:e.noBorder},t)})})]})]})},oI=(0,J.n9)()(function(){return{root:{display:"flex",flexWrap:"wrap",justifyContent:"center",marginTop:46,marginBottom:46}}}),oH=n.p+"asset/instruction1.fe2c06df.png",oO=n.p+"asset/instruction2.f8db1c7d.png",o_=n.p+"asset/instruction3.15b6a78c.png",oW=n.p+"asset/instruction4.6a369159.png",oG=(0,X.YK)({instruction1:{id:"create.route.onboarding.draw.step1",defaultMessage:"Click and drag a point to move it."},instruction2:{id:"create.route.onboarding.draw.step2",defaultMessage:"Click on the line to add a route point."},instruction3:{id:"create.route.onboarding.draw.step3",defaultMessage:"Click on a point to see options like looping route back to that point."},instruction4:{id:"create.route.onboarding.draw.step4",defaultMessage:"Add custom notes to route points."}}),oz=[{img:oH,description:oG.instruction1},{img:oO,description:oG.instruction2},{img:o_,description:oG.instruction3},{img:oW,description:oG.instruction4}],oK=(0,J.n9)()(function(){return{root:{display:"flex",flexDirection:"column",alignItems:"center",paddingTop:8,paddingBottom:8,paddingLeft:8,maxWidth:134,"&:not(:last-child)":{paddingRight:8}},img:{maxWidth:"100%"}}}),oU=(0,T.Ay)(function(e){var t=e.intl,n=e.img,o=e.description,r=oK().classes;return(0,w.jsxs)("div",{className:r.root,children:[(0,w.jsx)("div",{children:(0,w.jsx)("img",{src:n,className:r.img})}),(0,w.jsx)(ed.o5,{variant:"caption",children:t.formatMessage(o)})]})}),oY=function(){var e=oI().classes;return(0,w.jsxs)("div",{children:[(0,w.jsx)(ed.o5,{variant:"h2",component:"h2",children:(0,w.jsx)(C.A,{id:"create.route.onboarding.draw.title",defaultMessage:"How to Draw"})}),(0,w.jsx)("div",{className:e.root,children:oz.map(function(e,t){return(0,w.jsx)(oU,{img:e.img,description:e.description},"Instruction".concat(t))})})]})},oq=n.p+"asset/mobile_navigation.ed00b83a.gif",oV=n.p+"asset/navigation.9d6e367f.gif",oJ=(0,J.n9)()(function(){return{navigationRoot:{maxWidth:"100%",marginTop:28,marginBottom:28}}}),o$=(0,R.Ng)(function(e){return{isMobile:(0,E.H6)(e)}},{})(function(e){var t=e.isMobile,n=oJ().classes;return(0,w.jsxs)("div",{children:[(0,w.jsx)(ed.o5,{variant:"h2",component:"h2",children:(0,w.jsx)(C.A,{id:"create.route.onboarding.navigate.title",defaultMessage:"Navigating the Layout"})}),(0,w.jsx)("img",{src:t?oq:oV,className:n.navigationRoot})]})}),oX=(0,J.n9)()(function(e){return{root:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%"},dotButton:{height:10,width:10,cursor:"pointer",border:0,background:"none",padding:0,margin:8},dot:{height:10,width:10,borderRadius:6},inActive:{backgroundColor:e.palette.support.main},active:{backgroundColor:e.palette.common.brand.black}}}),oQ=function(e){var t=e.isActive,n=e.index,o=e.onClick,r=oX().classes;return(0,w.jsx)("button",{className:r.dotButton,onClick:function(){o(n)},children:(0,w.jsx)("div",{className:es()(r.dot,(0,h.A)((0,h.A)({},r.active,t),r.inActive,!t))})})},oZ=function(e){for(var t=e.numberOfDots,n=e.onNavigation,o=e.onClose,r=e.index,a=oX().classes,i=function(e){n(e)},l=[],s=function(e){l.push((0,w.jsx)(oQ,{index:e,isActive:r===e,onClick:function(){return i(e)}},e))},c=0;c<t;c+=1)s(c);return(0,w.jsxs)("div",{className:a.root,children:[(0,w.jsx)(no.$n,{variant:"contained",onClick:function(){var e=r-1;e>=0&&n(e)},size:"small",children:(0,w.jsx)(C.A,{id:"create.route.onboarding.show.back",defaultMessage:"Back"})}),(0,w.jsx)("div",{children:l}),r===t-1?(0,w.jsx)(no.$n,{variant:"contained",color:"primary",size:"small",onClick:function(){o()},children:(0,w.jsx)(C.A,{id:"create.route.onboarding.show.finish",defaultMessage:"Finish"})}):(0,w.jsx)(no.$n,{variant:"contained",color:"primary",size:"small",onClick:function(){var e=r+1;e<t&&n(e)},children:(0,w.jsx)(C.A,{id:"create.route.onboarding.show.Next",defaultMessage:"Next"})})]})},o0=(0,J.n9)()(function(e){return{title:{marginBottom:24},desc:{marginBottom:24},footer:(0,h.A)({width:"100%",display:"flex",flexWrap:"nowrap",textAlign:"center",justifyContent:"center",columnGap:e.typography.pxToRem(16)},e.breakpoints.down("md"),{rowGap:16,flexDirection:"column",alignItems:"center"}),button:(0,h.A)({flexGrow:0,flexShrink:1,flexBasis:"50%"},e.breakpoints.down("md"),{flexBasis:"auto",width:e.typography.pxToRem(264)})}}),o1=function(e){var t=e.onClose,n=e.onConfirm,o=o0().classes;return(0,w.jsxs)("div",{children:[(0,w.jsx)(ed.o5,{variant:"h1",component:"h1",className:o.title,children:(0,w.jsx)(C.A,{id:"create.route.onboarding.welcome.title",defaultMessage:"Welcome to the New Route Creator!"})}),(0,w.jsx)(ed.o5,{variant:"body1",className:o.desc,children:(0,w.jsx)(C.A,{id:"create.route.onboarding.welcome.desc1",defaultMessage:"Your favorite route creator has a fresh new look. The functionality of creating a route should remain largely the same."})}),(0,w.jsx)(ed.o5,{variant:"body1",className:o.desc,children:(0,w.jsx)(C.A,{id:"create.route.onboarding.welcome.desc2",defaultMessage:"Click show highlights to go through the basics of the new Create Route page or explore it on your own!"})}),(0,w.jsx)(ed.o5,{variant:"body1",className:o.desc,children:(0,w.jsx)(C.A,{id:"create.route.onboarding.welcome.desc3",defaultMessage:"The
1se highlights will always be available by clicking the help link near the route title."})}),(0,w.jsxs)("div",{className:o.footer,children:[(0,w.jsx)(no.$n,{variant:"outlined",color:"primary",className:o.button,onClick:t,children:(0,w.jsx)(C.A,{id:"create.route.onboarding.no.thanks",defaultMessage:"No, Thanks"})}),(0,w.jsx)(no.$n,{variant:"contained",color:"primary",className:o.button,onClick:n,children:(0,w.jsx)(C.A,{id:"create.route.onboarding.show.highlights",defaultMessage:"Show Highlights"})})]})]})},o2=(0,J.n9)()(function(e){return{pageContainer:(0,h.A)((0,h.A)({},e.breakpoints.up("lg"),{height:390}),"paddingTop",e.typography.pxToRem(12)),modalContainer:(0,h.A)({},e.breakpoints.up("lg"),{height:482}),contentContainer:{marginTop:e.typography.pxToRem(24),marginRight:e.typography.pxToRem(24),marginBottom:e.typography.pxToRem(24),marginLeft:e.typography.pxToRem(24)},welcomeContentContainer:{marginTop:e.typography.pxToRem(48),marginRight:e.typography.pxToRem(24),marginBottom:e.typography.pxToRem(24),marginLeft:e.typography.pxToRem(24)}}}),o4=function(e){var t=e.isModalOpen,n=e.onClose,o=e.defaultShowHighlights,r=o2().classes,a=(0,v.useState)(void 0!==o&&o),i=(0,m.A)(a,2),l=i[0],s=i[1],c=(0,v.useState)(0),u=(0,m.A)(c,2),d=u[0],p=u[1],f=function(){n()},g=[(0,w.jsx)(oY,{},"draw"),(0,w.jsx)(o$,{},"navigation"),(0,w.jsx)(oF,{},"controls")];return(0,w.jsx)(t9.a,{isOpen:t,onClose:f,modalClass:r.modalContainer,contentClass:l?r.contentContainer:r.welcomeContentContainer,children:l?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("div",{className:r.pageContainer,children:g[d]}),(0,w.jsx)("div",{children:(0,w.jsx)(oZ,{numberOfDots:3,index:d,onNavigation:function(e){p(e)},onClose:f})})]}):(0,w.jsx)(o1,{onClose:f,onConfirm:function(){s(!0)}})})},o5=n(36941),o3=(0,J.n9)()(function(e){return{banner:(0,h.A)((0,h.A)({display:"flex",backgroundColor:e.palette.common.foreground.primary,color:e.palette.common.foreground.inverse,height:48,padding:8},e.breakpoints.down("md"),{height:100}),e.breakpoints.up("md"),{alignItems:"center"}),container:(0,h.A)({display:"flex",alignItems:"center"},e.breakpoints.down("md"),{flexDirection:"column",marginRight:10}),content:{display:"flex",alignItems:"center"},desc:{marginLeft:16},highlightButton:(0,h.A)({textAlign:"center",color:e.palette.common.foreground.inverse,borderColor:e.palette.common.foreground.inverse,textTransform:"capitalize",marginLeft:16,lineHeight:"normal","&:hover":{borderColor:e.palette.common.foreground.inverse,boxShadow:"0 0 0 1px ".concat(e.palette.common.foreground.inverse)}},e.breakpoints.down("md"),{marginTop:12,marginLeft:"auto",marginRight:0}),close:{marginLeft:"auto",marginRight:0,cursor:"pointer"}}}),o6=function(e){var t=e.onClose,n=e.onShow,o=o3().classes;return(0,w.jsxs)("div",{className:o.banner,children:[(0,w.jsxs)("div",{className:o.container,children:[(0,w.jsxs)("div",{className:o.content,children:[(0,w.jsx)(o5.A,{}),(0,w.jsx)(ed.o5,{className:o.desc,variant:"caption",children:(0,w.jsx)(C.A,{id:"create.route.highlights.message",defaultMessage:"Weâve updated this page. Learn the basics of creating a route by seeing the highlights of the update."})})]}),(0,w.jsx)(no.$n,{color:"primary",size:"small",variant:"outlined",className:o.highlightButton,onClick:function(){n(!0)},children:(0,w.jsx)(C.A,{id:"create.route.see.highlights",defaultMessage:"See Highlights"})})]}),(0,w.jsx)(ei.A,{className:o.close,onClick:function(){t()}})]})},o8=n(4263),o9=n(15650),o7=n(57171),re=(0,X.YK)({saveBtnAriaLabel:{id:"map.editor.save.button.ariaLabel",defaultMessage:"Save Button"}}),rt=(0,J.n9)()(function(e){return{root:{position:"sticky",bottom:0,left:0,padding:"20px 16px",backgroundColor:e.palette.common.foreground.inverse},button:{height:48}}});function rn(e,t){var n=r()(e);if(i()){var o=i()(e);t&&(o=o.filter(function(t){return s()(e,t).enumerable})),n.push.apply(n,o)}return n}function ro(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rn(Object(n),!0).forEach(function(t){(0,h.A)(e,t,n[t])}):u()?p()(e,u()(n)):rn(Object(n)).forEach(function(t){g()(e,t,s()(n,t))})}return e}var rr=ro(ro({},P),o7),ra=(0,R.Ng)(function(e){return{formValues:N.ap(e),site:(0,o9.Gd)(e),segments:N.Pk(e),routeOriginPoint:N.DK(e),distance:N.Gx(e),customMarkers:N.tM(e)}},rr)((0,T.Ay)(function(e){var t=e.isEdit,n=e.isCopy,o=e.bookmarkRoute,r=e.createRoute,a=e.updateRoute,i=e.resetRouteData,l=e.formValues,s=e.segments,c=e.onFirstSaveClick,u=e.showSavePanel,d=e.site,p=e.routeCreatedLogEvent,f=e.routeUpdatedLogEvent,g=e.buttonClickedEvent,h=e.setSelectedElevationSegmentPoints,x=e.routeId,y=e.routeOriginPoint,b=e.distance,k=e.userId,j=e.intl,M=e.setHasUnsavedChanges,A=e.isRouteBookmarked,T=e.deleteRouteBookmark,R=e.customMarkers,S=rt().classes,N=(0,v.useState)(!1),E=(0,m.A)(N,2),L=E[0],P=E[1],B=function(e){window.location.href="/routes/view/".concat(e,"/")},D=function(e){var t=l.bookmark,a=l.description,i=l.activityType;r(e).then(function(r){var l=r.value.data._links,s=l.self[0].id;p({activityType:null==i?void 0:i.label,routeId:s,routeDistance:e.distance,routeDescription:!!a,bookmark:t},!!n),t?o(s,l.user[0].id).then(function(){B(s)}):B(s)}).catch(function(){return P(!1)})},F=function(e){var t=l.bookmark,n=l.activityType,r=[a(e,x)];if(t&&!A)r.push(o(x,k));else if(!t&&A){var s,c,u=null==A||null==(s=A._links)||null==(c=s.self[0])?void 0:c.id;u&&T(u)}nC().all(r).then(function(){f({activityType:null==n?void 0:n.label,routeId:x,routeDistance:e.distance}),i(),B(x)}).catch(function(){return P(!1)})};return(0,w.jsx)(w.Fragment,{children:s.length?(0,w.jsx)("div",{className:S.root,children:(0,w.jsx)(no.$n,{className:S.button,color:"primary",size:"large",fullWidth:!0,onClick:function(){if(u){var e=l.activityType,n=l.description,o=l.name,r=l.privacy,a=(0,ec.dF)(s,R),i=(0,o8.A)(o),p=(0,o8.A)(n);if(o&&e){P(!0);var f={_links:{activity_types:[{href:"/v7.2/activity_type/".concat(e.id),id:e.id}],privacy:[{href:"/v7.2/privacy_option/".concat(r,"/"),id:r}]},data_source:"".concat(d.slug,":RE"),distance:b,description:p,name:i,points:a,starting_location:{coordinates:[y.lat,y.lng],type:"Point"},start_point_type:""};t?(f._links.self=[{href:"/v7.2/route/".concat(x),id:x}],f.activityType=e,F(f),g("Edit Route")):(D(f),g("Save Route")),M(!1)}}else c(),h([])},loading:L,"aria-label":j.formatMessage(re.saveBtnAriaLabel),children:(0,w.jsx)(C.A,{id:"map.editor.save.button",defaultMessage:"Save Route"})})}):null})})),ri=n(69851),rl=n(32678),rs=n(44017),rc=n(31322),ru=(0,X.YK)({routeName:{id:"map.editor.save.inputField.routeName",defaultMessage:"Route Name"},description:{id:"map.editor.save.inputField.description",defaultMessage:"Description"},privacy:{id:"map.editor.save.inputField.privacy",defaultMessage:"Privacy Settings"},activityType:{id:"map.editor.save.inputField.activityType",defaultMessage:"Activity Type"},defaultName:{id:"map.editor.save.defaultName",defaultMessage:"{city} Route"}}),rd=(0,X.YK)({required:{id:"map.editor.save.fieldname.error.required",defaultMessage:"{fieldname} is required."},activityType:{id:"map.editor.save.activityType.error.required",defaultMessage:"Activity Type"},name:{id:"map.editor.save.name.error.required",defaultMessage:"Route Name"}}),rp=(0,X.YK)({bookmarkToggleAriaLabel:{id:"map.editor.save.bookmarkToggleAriaLabel",defaultMessage:"Bookmark Toggle"}}),rf=n(38444),rg=(0,J.n9)()(function(e){return{header:{display:"flex",justifyContent:"space-between",marginBottom:30},root:{width:"100%",paddingLeft:16,paddingRight:16,overflowY:"scroll","& .Select-menu-outer":{top:"auto",bottom:"100%"},"& > .Select-menu-outer":{top:"auto",bottom:"100%"}},chips:{marginBottom:32},formFields:{display:"flex",flexDirection:"column",rowGap:e.typography.pxToRem(16)},bookmark:{marginTop:20}}}),rm={routeControlPerformedEvent:P.routeControlPerformedEvent,setCreateRouteFormValues:P.setCreateRouteFormValues},rh=(0,T.Ay)(function(e){var t=e.intl,n=e.segments,o=e.defaultRouteCity,r=e.defaultRoutePrivacy,a=e.routeName,i=e.routeDesc,l=e.onClose,s=e.isRouteBookmarked,c=e.activityTypes,u=e.routeControlPerformedEvent,d=e.setCreateRouteFormValues,p=rg().classes,f=[ri.Uj,ri.Kx,ri.q].map(function(e){return{label:t.formatMessage(ri.Ji[e].label.message),value:e}}),g=t.formatMessage(ru.defaultName,{city:o}),m=(0,rl.tK)(t,null!=c?c:[]).find(function(e){return"16"===e.id}),h=(0,ts.Wx)({initialValues:{name:a||g,description:i,activityType:m,privacy:null==r?void 0:r.id,bookmark:void 0!==s&&s},enableReinitialize:!0,validationSchema:rf.Ik().shape({name:rf.Yj().required(t.formatMessage(rd.required,{fieldname:t.formatMessage(rd.name)})),activityType:rf.Ik().required(t.formatMessage(rd.required,{fieldname:t.formatMessage(rd.activityType)}))}),onSubmit:function(){}});(0,v.useEffect)(function(){n.length&&d(h.values)},[h.values,n.length]);var x=function(e,t){h.handleChange(e),t&&u(t,{})};return n.length?(0,w.jsxs)("div",{className:p.root,children:[(0,w.jsxs)("div",{className:p.header,children:[(0,w.jsx)(eX.A,{variant:"h2",children:(0,w.jsx)(C.A,{id:"map.editor.save.title",defaultMessage:"Save Route"})}),(0,w.jsx)(ei.A,{onClick:l})]}),(0,w.jsx)("div",{className:p.chips,children:(0,w.jsx)(tq,{})}),(0,w.jsxs)("div",{className:p.formFields,children:[(0,w.jsx)(tc.FO,{name:"name",required:!0,label:t.formatMessage(ru.routeName),onChange:h.handleChange,value:h.values.name,errorText:h.errors.name}),(0,w.jsx)(tc.FO,{multiline:!0,rows:3,name:"description",label:t.formatMessage(ru.description),onChange:h.handleChange,value:h.values.description}),(0,w.jsx)(tc.Cm,{name:"activityType",required:!0,outdoor:!0,value:h.values.activityType,onCh
1ange:function(e,t){h.setFieldValue("activityType",t)},errorText:"string"==typeof h.errors.activityType?h.errors.activityType:void 0}),(0,w.jsx)(tc.QE,{label:t.formatMessage(ru.privacy),name:"privacy",value:h.values.privacy,menu:f,onChange:h.handleChange}),(0,w.jsx)(tc.RF,{name:"bookmark",onToggle:function(e){return x(e,"Bookmark")},value:h.values.bookmark,className:p.bookmark,label:(0,w.jsx)(eX.A,{variant:"body1",children:(0,w.jsx)(C.A,{id:"map.editor.options.bookmarkRoute",defaultMessage:"Bookmark Route"})}),ariaLabel:t.formatMessage(rp.bookmarkToggleAriaLabel)})]})]}):null}),rv=(0,R.Ng)(function(e){return{segments:N.Pk(e),routeName:N.Uq(e),routeDesc:N.wf(e),defaultRouteCity:N.W4(e),defaultRoutePrivacy:(0,rc.se)(e),activityTypes:(0,rs.L2)(e)}},rm)(rh),rx=(0,X.YK)({leftExpandTitle:{id:"map.editor.mapEditor.expand.title",defaultMessage:"Expand or Collapse left panel"},browserConfirmation:{id:"map.editor.browser.close",defaultMessage:"Changes you made may not be saved?"}}),ry=(0,J.n9)()(function(e){return{root:(0,h.A)({display:"flex",position:"relative",marginBottom:-85,backgroundColor:e.palette.common.foreground.inverse},e.breakpoints.down("md"),{flexDirection:"column"}),leftPanel:{position:"relative",borderRight:"1px solid ".concat(e.palette.support.range.three)},leftContainer:(0,h.A)((0,h.A)({width:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between"},e.breakpoints.up("md"),{minWidth:270,maxWidth:270,height:"100%"}),e.breakpoints.up("lg"),{minWidth:340,maxWidth:340,height:"100%"}),mainPanel:{display:"flex",flexDirection:"column",flexGrow:1,minHeight:0},mapContainer:{height:800},loaderContainer:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"400px"},rightPanel:{display:"flex",flexDirection:"column",width:"100%",overflowX:"hidden"},mobileElevationPanel:{borderTop:"1px solid ".concat(e.palette.support.range.three)},toggle:{position:"absolute",top:74,backgroundColor:e.palette.common.background.midground,width:28,height:42,cursor:"pointer",display:"flex",justifyContent:"center",alignItems:"center",zIndex:7,borderTop:"1px solid ".concat(e.palette.support.range.three),borderRight:"1px solid ".concat(e.palette.support.range.three),borderBottom:"1px solid ".concat(e.palette.support.range.three)},arrowIcon:{fontSize:28}}});function rb(e,t){var n=r()(e);if(i()){var o=i()(e);t&&(o=o.filter(function(t){return s()(e,t).enumerable})),n.push.apply(n,o)}return n}function rk(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rb(Object(n),!0).forEach(function(t){(0,h.A)(e,t,n[t])}):u()?p()(e,u()(n)):rb(Object(n)).forEach(function(t){g()(e,t,s()(n,t))})}return e}var rw=rk(rk({},P),L),rj=(0,R.Ng)(function(e){return{mapLocation:N.Kl(e),locationBbox:N.ZM(e),elevationSegmentPoints:N.Sb(e),expandedPanel:N.ww(e),isMobile:(0,E.H6)(e),isTablet:(0,E.PB)(e),isLoading:N.QW(e),customMarkerModal:N.p0(e)}},rw)((0,T.Ay)(function(e){var t,n,o,r,a,i,l=e.mapLocation,s=e.locationBbox,c=e.elevationSegmentPoints,u=e.expandedPanel,d=e.isMobile,p=e.isTablet,f=e.isEdit,g=e.isCopy,h=e.routeId,k=e.userId,M=e.isRouteBookmarked,T=void 0!==M&&M,R=e.isLoading,N=e.intl,E=e.customMarkerModal,L=e.setCustomMarkerModal,P=e.setCustomMarker,B=e.setSelectedElevationSegment,D=e.setSelectedElevationSegmentPoints,F=e.removeCustomMarker,I=ry().classes,H=function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight},O=N.formatMessage(rx.browserConfirmation),_=(0,v.useState)(H()),W=(0,m.A)(_,2),G=W[0],z=W[1],K=(0,v.useState)(!1),U=(0,m.A)(K,2),Y=U[0],q=U[1],V=(0,v.useState)([]),J=(0,m.A)(V,2),$=J[0],X=J[1],Q=(0,v.useState)(!0),Z=(0,m.A)(Q,2),ee=Z[0],et=Z[1],en=(0,v.useState)(!1),er=(0,m.A)(en,2),ea=er[0],ei=er[1],el=(t="cache_banner_key",n=(0,v.useState)((0,b.s)(t)),r=(o=(0,m.A)(n,2))[0],a=o[1],(0,v.useEffect)(function(){return function(){(0,b.U)(t,!0)}},[]),[r,function(){a(!0),(0,b.U)(t,!0)}]),es=(0,m.A)(el,2),ec=es[0],eu=es[1],ed=j(O),ep=(0,m.A)(ed,2),ef=ep[0],eg=ep[1];(0,v.useEffect)(function(){var e=A()(function(){z(H())},1e3);return window.addEventListener("resize",e),function(){e.cancel(),window.removeEventListener("resize",e)}},[]);var eh=d?142:64,ev=G-(ec?eh:eh+48),ex=d?228:218,ey=function(e,t){e?(X(e),D(null!=t?t:[])):(X([]),B(null),D([]))},eb=(null==u?void 0:u.controls)||(null==u?void 0:u.directions),ek=d&&(eb||Y),ew={};(!d||ek)&&(ew.height=ev);var ej=function(){et(!ee)},eM=function(e){ei(e)},eA=(0,w.jsx)(ra,{onFirstSaveClick:function(){q(!0)},showSavePanel:Y,isEdit:void 0!==f&&f,isCopy:void 0!==g&&g,routeId:h,userId:k,setHasUnsavedChanges:eg,isRouteBookmarked:T}),eC=(0,w.jsx)(em,{onClose:function(){return ey(!1)},selectedElevation:$});return i=Y?(0,w.jsx)(rv,{onClose:function(){q(!1)},isRouteBookmarked:!!T}):!d&&null!=c&&c.length?eC:(0,w.jsx)(t3,{isMobile:d,onHelpModalClick:eM}),(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(o4,{isModalOpen:ea,onClose:function(){ei(!1)},defaultShowHighlights:ec}),(0,w.jsx)(eo,{open:(null==E?void 0:E.open)||!1,onClose:function(){L({open:!1,waypointData:null})}
1,onSave:function(e){if(null!=E&&E.waypointData){var t=E.waypointData.waypointIndex;"remove"in e&&e.remove?F(t):"markerId"in e&&P(t,e)}L({open:!1,waypointData:null})},waypointData:null==E?void 0:E.waypointData}),ec?null:(0,w.jsx)("div",{children:(0,w.jsx)(o6,{onClose:eu,onShow:eM})}),(0,w.jsxs)("div",{className:I.root,children:[(0,w.jsx)(S.A,{isLoading:R,children:(0,w.jsx)(C.A,{id:"edit.route.loading.route",defaultMessage:"Calculating Route..."})}),ef,(0,w.jsxs)("div",{className:I.leftPanel,children:[d?null:(0,w.jsx)("div",{className:I.toggle,onClick:ej,onKeyDown:function(e){var t=e.keyCode;(13===t||32===t)&&ej()},style:{left:ee?p?271:340:0},title:N.formatMessage(rx.leftExpandTitle),tabIndex:0,role:"button",children:ee?(0,w.jsx)(x.A,{className:I.arrowIcon}):(0,w.jsx)(y.A,{className:I.arrowIcon})}),ee?(0,w.jsxs)("div",{className:I.leftContainer,style:ew,children:[i,d?null:eA]}):null]}),ek?null:(0,w.jsxs)("div",{className:I.rightPanel,children:[(0,w.jsx)(oT,{defaultLocation:l,locationBbox:s,pageHeight:ev,elevationHeight:ex,showLeftPanel:ee,onHelpModalClick:eM,setHasUnsavedChanges:eg}),(0,w.jsx)(e$,{height:ex,onDragDrop:ey})]}),d?(0,w.jsxs)("div",{children:[null!=c&&c.length?(0,w.jsx)("div",{className:I.mobileElevationPanel,children:eC}):null,eA]}):null]})]})}))}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.