1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6781],{11088:t=>{t.exports={"m-t-2xs":"TripLockWaypoints_m-t-2xs__lBvMr","m-t-xs":"TripLockWaypoints_m-t-xs__TTwB0","m-t-sm":"TripLockWaypoints_m-t-sm__7h4II","m-t-md":"TripLockWaypoints_m-t-md__yVSWx","m-t-lg":"TripLockWaypoints_m-t-lg__XsvTd","m-t-xl":"TripLockWaypoints_m-t-xl__vfq_J","m-t-xl--desktop":"TripLockWaypoints_m-t-xl--desktop__ruQKL","m-t-2xl":"TripLockWaypoints_m-t-2xl__i3Ajw","m-t-3xl":"TripLockWaypoints_m-t-3xl__Aa0Zg","m-t-4xl":"TripLockWaypoints_m-t-4xl__cyYI3","m-b-sm":"TripLockWaypoints_m-b-sm__bJQag","m-b-md":"TripLockWaypoints_m-b-md__ivfQr","m-b-lg":"TripLockWaypoints_m-b-lg__rBIKs","m-b-xl":"TripLockWaypoints_m-b-xl__1T1C1","m-b-3xl":"TripLockWaypoints_m-b-3xl___vvQY","m-r-xl":"TripLockWaypoints_m-r-xl__zWKeb","m-l-sm":"TripLockWaypoints_m-l-sm__Lv_qO","lock-waypoints":"TripLockWaypoints_lock-waypoints__MoCvO","lock-waypoints__header":"TripLockWaypoints_lock-waypoints__header__N9XjP","lock-waypoints__title":"TripLockWaypoints_lock-waypoints__title__ySvD9","lock-waypoints__description":"TripLockWaypoints_lock-waypoints__description__EOzJu","lock-waypoints__list":"TripLockWaypoints_lock-waypoints__list__lJasE","lock-waypoints__item":"TripLockWaypoints_lock-waypoints__item__Q_wun","lock-waypoints__item-number":"TripLockWaypoints_lock-waypoints__item-number__pP_vb","lock-waypoints__item-content":"TripLockWaypoints_lock-waypoints__item-content__pnyBR","lock-waypoints__item-name":"TripLockWaypoints_lock-waypoints__item-name__W4vwB","lock-waypoints__item-type":"TripLockWaypoints_lock-waypoints__item-type__v7NlN","lock-waypoints__warning":"TripLockWaypoints_lock-waypoints__warning__04LGZ","lock-waypoints__actions":"TripLockWaypoints_lock-waypoints__actions__Q1_9h","rotate-three-sixty":"TripLockWaypoints_rotate-three-sixty__oshun","slide-in-to-left":"TripLockWaypoints_slide-in-to-left__tpuA_","slide-out-to-left":"TripLockWaypoints_slide-out-to-left__YrTAg","slide-in-to-right":"TripLockWaypoints_slide-in-to-right__Lt5Bt","slide-out-to-right":"TripLockWaypoints_slide-out-to-right__Z3HYr"}},24316:(t,e,i)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/trips/lock-waypoints/[id]",function(){return i(24511)}])},24511:(t,e,i)=>{"use strict";i.r(e),i.d(e,{Page:()=>f,__N_SSP:()=>T,default:()=>v});var o=i(37876),l=i(14232),a=i(48218),r=i(35906),n=i(30578),s=i.n(n),c=i(48230),_=i.n(c),p=i(88896),d=i(70366),m=i(18685),y=i(93739),u=i(51826),b=i(81814),k=i(11088),h=i.n(k);let w=s().bind(h()),x=t=>{let{waypoint:e,index:i,onToggleLock:a}=t,[r,n]=(0,l.useState)(!1),s=(0,l.useCallback)(async()=>{n(!0);try{await a(e)}finally{n(!1)}},[a,e]);return(0,o.jsxs)("div",{className:w("lock-waypoints__item",{"lock-waypoints__item--locked":e.locked}),children:[(0,o.jsx)("span",{className:w("lock-waypoints__item-number"),children:i+1}),(0,o.jsxs)("div",{className:w("lock-waypoints__item-content"),children:[(0,o.jsx)("span",{className:w("lock-waypoints__item-name"),children:e.name||"Unnamed stop"}),(0,o.jsx)("span",{className:w("lock-waypoints__item-type"),children:e.waypointType})]}),(0,o.jsx)(b.A,{type:"button",icon:e.locked?"lock_fill":"unlock",onClick:s,disabled:r,dataEvent:e.locked?"waypoint-unlock":"waypoint-lock"})]})},g=s().bind(h()),A=t=>{let{trip:e,waypoints:i,vehicle:a}=t,{setTrip:r,setWaypoints:n,setVehicle:s,waypoints:c}=(0,p.$K)(),{toggleLockWaypoint:b}=(0,d.A)(),{autopopulateTrip:k,loading:h,errors:w}=(()=>{let{createRecord:t,loading:e,errors:i}=(0,m.A)(),{loadTrip:o}=(0,y.A)();return{autopopulateTrip:(0,l.useCallback)(async e=>{let i=await t({type:"autopopulate-trips",tripId:e});return i.record&&await o(e),i},[t,o]),loading:e,errors:i}})();(0,l.useEffect)(()=>{r(e),n(i),s(a)},[e,i,a,r,n,s]);let A=(0,l.useCallback)(async()=>{e&&await k(e.id)},[e,k]),T=c.filter(t=>t.locked).length>=2;return(0,o.jsxs)("div",{className:g("lock-waypoints"),children:[(0,o.jsxs)("div",{className:g("lock-waypoints__header"),children:[(0,o.jsx)("h1",{className:g("lock-waypoints__title"),children:"Review Recommended Stops"}),(0,o.jsxs)("p",{className:g("lock-waypoints__description"),children:["Lock the stops you want to keep. Unlocked stops may change when we update recommendations.",(0,o.jsx)("br",{}),"Then click Refresh Stops to get new campground recommendations, or click Done to finalize your trip."]})]}),(0,o.jsx)("div",{className:g("lock-waypoints__list"),children:c.map((t,e)=>(0,o.jsx)(x,{waypoint:t,index:e,onToggleLock:b},t.id))}),!T&&(0,o.jsx)("p",{className:g("lock-waypoints__warning"),children:"You must lock at least two stops"}),null==w?void 0:w.map((t,e)=>(0,o.jsx)("p",{className:g("lock-waypoints__warning"),children:t},e)),(0,o.jsxs)("div",{className:g("lock-waypoints__actions"),children:[(0,o.jsx)(u.A,{type:"button",label:h?"Refreshing...":"Refresh Stops",dataEvent:"trip-lock-reautopopulate",onClick:A,disabled:h||!T,ghost:!0}),(0,o.jsx)(_(),{href:"/trips/details/".concat(e.id,"?created=true"),passHref:!0,legacyBehavior:!0,children:(0,o.jsx)(u.A,{type:"button",label:"Done",dataEvent:"trip-lock-done"})})]})]})};var T=!0;let f=t=>{let{trip:e,waypoints:i,vehicle:l}=t;return(0,o.jsx)(a.A,{pageTitle:"Lock Waypoints - ".concat(e.name||"Trip"),socialDescription:"Lock waypoints for trip: ".concat(e.name),noFrame:!0,noPadding:!0,content:(0,o.jsx)(r.A,{children:(0,o.jsx)(A,{trip:e,waypoints:i,vehicle:l})})})},v=f},25790:(t,e,i)=>{"use strict";i.d(e,{BO:()=>a,E:()=>r,L5:()=>l,To:()=>_,WU:()=>n,ZH:()=>d,_q:()=>p,b_:()=>o,db:()=>s,x2:()=>c});let o=t=>{let e=Math.floor(t/60),i=Math.floor(t-60*e);return"".concat(e,"h ").concat(i,"m")},l=t=>{let e=Math.floor(t/60),i=Math.floor(t-60*e);return"".concat(e," h ").concat(i," min")},a=t=>"".concat(Math.round(t)," mi"),r=(t,e,i)=>{let o="https://thedyrt.com/api/v10".replace(/\/v\d+$/,""),l=new URLSearchParams({trip:t,width:String(e),height:String(i),double_size:"1"});return"".concat(o,"/v4/trips/static-image?").concat(l.toString())},n=1e5,s=(t,e)=>!!e&&t.some(t=>t.value===e&&t.rv),c=Array.from({length:12},(t,e)=>({label:"".concat(e+1," hour").concat(e+1>1?"s":""),value:String((e+1)*60)})),_=[{label:"Any",value:"any"},{label:"Under $25",value:"under25"},{label:"Under $50",value:"under50"},{label:"Under $100",value:"under100"},{label:"Over $100",value:"over100"},{label:"Free",value:"free"}],p=t=>{if(t.length<2)return"";let e=t[0],i=t[t.length-1],o=t.slice(1,-1).slice(0,9).map(t=>"".concat(t.latitude,",").concat(t.longitude)).join("|"),l="https://www.google.com/maps/dir/?api=1&origin=".concat(e.latitude,",").concat(e.longitude,"&destination=").concat(i.latitude,",").concat(i.longitude);return o&&(l+="&waypoints=".concat(encodeURIComponent(o))),l},d=t=>Math.max(0,t-2)>9},35906:(t,e,i)=>{"use strict";i.d(e,{A:()=>d});var o=i(37876);i(14232);var l=i(30578),a=i.n(l),r=i(23290),n=i(41559),s=i(46498),c=i(88968),_=i.n(c);let p=a().bind(_()),d=t=>{let{children:e}=t,i=(0,r.A)();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:p("trip-mobile-redirect"),children:[(0,o.jsxs)("section",{className:p("trip-mobile-redirect__section"),children:[(0,o.jsx)("h2",{className:p("trip-mobile-redirect__heading"),children:"Plan Your Trip in The Dyrt App"}),(0,o.jsx)("p",{className:p("trip-mobile-redirect__body"),children:"Use our app to use the trip planning feature on a mobile device."}),(0,o.jsx)("img",{className:p("trip-mobile-redirect__image"),src:"https://assets.thedyrt.com/assets/images/trips/trip-blank-route-app-6a8c63f16b9fe6df9c297d8419a756b9.png",alt:"The Dyrt trip planner app screenshot",width:"228",height:"295"}),i&&(0,o.jsx)(s.A,{label:"Open the App",dataEvent:"trip-mobile-redirect-open-app",icon:"arrow_right",path:(0,n.A)({adjustAdGroup:"trip-planner",adjustCampaign:"Trip Planner"}),skipInterstitalAd:!0})]}),(0,o.jsxs)("section",{className:p("trip-mobile-redirect__section"),children:[(0,o.jsx)("h2",{className:p("trip-mobile-redirect__heading"),children:"Or, Visit Our Website on a Computer"}),(0,o.jsx)("p",{className:p("trip-mobile-redirect__body"),children:"Trip planning is available on the web at bigger screen sizes."}),(0,o.jsx)("img",{className:p("trip-mobile-redirect__image"),src:"https://assets.thedyrt.com/assets/images/trips/trip-blank-search-web-891426782b2d1810ff0e344d1b50536f.png",alt:"The Dyrt trip planner on the web",width:"280",height:"257"})]})]}),(0,o.jsx)("div",{className:p("trip-mobile-redirect__desktop-content"),children:e})]})}},40606:(t,e,i)=>{"use strict";i.d(e,{A:()=>n});var o=i(14232),l=i(72767),a=i(31468),r=i(92506);let n=()=>{let t=(0,a.A)(),e=(0,r.A)(),[i,n]=(0,o.useState)({loading:!1,errors:null});return{deleteRecord:(0,o.useCallback)(async(i,o)=>{n({loading:!0,errors:null});try{await (0,l.LK)(i,{},t),n({loading:!1,errors:null}),o&&o()}catch(t){n({loading:!1,errors:e(t)})}},[n,t,e]),...i}}},42910:t=>
1{t.exports={"m-t-2xs":"AppAction_m-t-2xs__lYjY_","m-t-xs":"AppAction_m-t-xs__9kc6i","m-t-sm":"AppAction_m-t-sm__FfO0Z","m-t-md":"AppAction_m-t-md__xGrzv","m-t-lg":"AppAction_m-t-lg__bMVLY","m-t-xl":"AppAction_m-t-xl__YXy1w","m-t-xl--desktop":"AppAction_m-t-xl--desktop__ApceP","m-t-2xl":"AppAction_m-t-2xl__yJFuD","m-t-3xl":"AppAction_m-t-3xl__0ezNE","m-t-4xl":"AppAction_m-t-4xl__5Hm_6","m-b-sm":"AppAction_m-b-sm__7JW5f","m-b-md":"AppAction_m-b-md__Geah9","m-b-lg":"AppAction_m-b-lg__U782z","m-b-xl":"AppAction_m-b-xl__mBgDM","m-b-3xl":"AppAction_m-b-3xl__u8tRx","m-r-xl":"AppAction_m-r-xl__Hq4K8","m-l-sm":"AppAction_m-l-sm__hsnMH",action:"AppAction_action__F1Q2U",action__label:"AppAction_action__label__d5_xC","action__icon-container":"AppAction_action__icon-container__85kd6","action__icon-container--transparent":"AppAction_action__icon-container--transparent__tlrgc",action__icon:"AppAction_action__icon__OJSP_","rotate-three-sixty":"AppAction_rotate-three-sixty__lzkHy","slide-in-to-left":"AppAction_slide-in-to-left__CBH3j","slide-out-to-left":"AppAction_slide-out-to-left__Z6wk_","slide-in-to-right":"AppAction_slide-in-to-right__jOeUg","slide-out-to-right":"AppAction_slide-out-to-right__CRV_T"}},70366:(t,e,i)=>{"use strict";i.d(e,{A:()=>d});var o=i(14232),l=i(18685),a=i(38304),r=i(40606),n=i(69264),s=i(93739),c=i(97999),_=i(25790);let p={Campground:"campground",FuelStation:"fuel-station",Place:"place"},d=()=>{let{trip:t,waypoints:e,setSaving:i,setWaypoints:d,updateWaypoint:m,setLoading:y,setWaypointToReplace:u,setSearchResults:b,setSearchPinsGeoJSON:k,setActiveTab:h}=(0,n.fO)(),{createRecord:w}=(0,l.A)(),{updateRecord:x}=(0,a.A)(),{deleteRecord:g}=(0,r.A)(),{loadTrip:A}=(0,s.A)(),T=(0,o.useCallback)(()=>{b([],null),k(null)},[b,k]),f=(0,o.useCallback)(async(o,l)=>{if(t){i(!0);try{var a,r,n,s,d,m;let{tripId:i,subjectType:y,subjectId:u,...b}=o,k={type:"waypoints",...b};if(void 0!==l){let t=l+1,i=t>0&&null!=(n=null==(a=e[t-1])?void 0:a.order)?n:0,o=t<e.length&&null!=(s=null==(r=e[t])?void 0:r.order)?s:i+2*_.WU;k.order=Math.floor((i+o)/2)}let g={trip:{data:{id:t.id,type:"trips"}}};y&&u&&(g.subject={data:{id:u,type:null!=(d=p[y])?d:y}});let f=await w(k,g);if(f.record){let i=e.map(t=>t.id);await x({type:"trips",id:t.id,orderedWaypointIds:i}),await A(t.id),T(),h("waypoints"),(0,c.P)("".concat(null!=(m=o.name)?m:"Stop"," added to trip."))}return f}finally{i(!1)}}},[t,e,w,x,A,i,T,h]),v=(0,o.useCallback)(async o=>{if(!t)return;let l=o.name;i(!0);try{await g({type:"waypoints",id:o.id},async()=>{let i=e.filter(t=>t.id!==o.id).map(t=>t.id);await x({type:"trips",id:t.id,orderedWaypointIds:i}),await A(t.id),(0,c.P)("".concat(l," removed from trip."))})}finally{i(!1)}},[t,e,g,x,A,i]),j=(0,o.useCallback)(async(o,l)=>{if(t){i(!0);try{let i=[...e],[a]=i.splice(o,1);i.splice(l,0,a);let r=i.map((t,e)=>({...t,order:e*_.WU}));d(r);let n=i.map(t=>t.id);y(!0),await x({type:"trips",id:t.id,orderedWaypointIds:n}),await A(t.id)}finally{i(!1)}}},[t,e,i,d,y,x,A]),L=(0,o.useCallback)(async(o,l)=>{if(t){i(!0);try{var a,r;let i=o.name,n=o.order;await g({type:"waypoints",id:o.id});let{tripId:s,subjectType:_,subjectId:d,...m}=l,y={trip:{data:{id:t.id,type:"trips"}}};_&&d&&(y.subject={data:{id:d,type:null!=(a=p[_])?a:_}});let b=await w({type:"waypoints",...m,order:n},y);if(b.record){u(null);let a=e.filter(t=>t.id!==o.id).map(t=>t.id),n=e.findIndex(t=>t.id===o.id);a.splice(n>=0?n:a.length,0,b.record.id),await x({type:"trips",id:t.id,orderedWaypointIds:a}),await A(t.id),T(),h("waypoints"),(0,c.P)("".concat(i," was replaced by ").concat(null!=(r=l.name)?r:"new stop","."))}return b}finally{i(!1)}}},[t,e,w,g,x,i,u,A,T,h]);return{addWaypoint:f,deleteWaypoint:v,reorderWaypoints:j,replaceWaypoint:L,saveNote:(0,o.useCallback)(async(e,o)=>{i(!0);try{let i=await x({type:"waypoints",id:e.id,note:o});return i.record&&t&&await A(t.id),i}finally{i(!1)}},[x,t,A,i]),toggleLockWaypoint:(0,o.useCallback)(async t=>{i(!0);try{let e=await x({type:"waypoints",id:t.id,locked:!t.locked});return e.record&&m(t.id,{locked:e.record.locked}),e}finally{i(!1)}},[x,m,i])}}},81814:(t,e,i)=>{"use strict";i.d(e,{A:()=>_});var o=i(37876);i(14232);var l=i(30578),a=i.n(l),r=i(66674),n=i(42910),s=i.n(n);let c=a().bind(s()),_=t=>{let{type:e,className:i,classNameIcon:l,classNameSvg:a,classNameLabel:n,dataEvent:_,disabled:p,icon:d,label:m,name:y,onClick:u,transparentBackgroun
1d:b,fillColor:k}=t,h=c({"action__icon-container":!0,"action__icon-container--transparent":b});return(0,o.jsxs)("button",{type:e,className:"".concat(s().action," ").concat(i||""),disabled:p,onClick:u,"data-event":_,name:y,children:[(0,o.jsx)(r.A,{classNameWrapper:"".concat(h," ").concat(l||""),classNameSvg:["".concat(s().action__icon),"".concat(a)],icon:d,fillColor:k}),!!m&&(0,o.jsx)("span",{className:"".concat(s().action__label," ").concat(n||""),children:m})]})}},88968:t=>{t.exports={"m-t-2xs":"TripMobileRedirect_m-t-2xs__b4ng_","m-t-xs":"TripMobileRedirect_m-t-xs__2XctY","m-t-sm":"TripMobileRedirect_m-t-sm__oSXl5","m-t-md":"TripMobileRedirect_m-t-md__7oNx_","m-t-lg":"TripMobileRedirect_m-t-lg___z_4j","m-t-xl":"TripMobileRedirect_m-t-xl__hoXY_","m-t-xl--desktop":"TripMobileRedirect_m-t-xl--desktop__lYjPY","m-t-2xl":"TripMobileRedirect_m-t-2xl__BibBP","m-t-3xl":"TripMobileRedirect_m-t-3xl__OgsJZ","m-t-4xl":"TripMobileRedirect_m-t-4xl__gOFQn","m-b-sm":"TripMobileRedirect_m-b-sm__xZcKy","m-b-md":"TripMobileRedirect_m-b-md__GzMnD","m-b-lg":"TripMobileRedirect_m-b-lg__IX6fX","m-b-xl":"TripMobileRedirect_m-b-xl___XxYw","m-b-3xl":"TripMobileRedirect_m-b-3xl__lD7ur","m-r-xl":"TripMobileRedirect_m-r-xl__W4nLr","m-l-sm":"TripMobileRedirect_m-l-sm__aimpC","trip-mobile-redirect":"TripMobileRedirect_trip-mobile-redirect__zhVjj","trip-mobile-redirect__section":"TripMobileRedirect_trip-mobile-redirect__section__Dq9mv","trip-mobile-redirect__heading":"TripMobileRedirect_trip-mobile-redirect__heading__neGla","trip-mobile-redirect__body":"TripMobileRedirect_trip-mobile-redirect__body__NV8r8","trip-mobile-redirect__image":"TripMobileRedirect_trip-mobile-redirect__image__ZKq53","trip-mobile-redirect__desktop-content":"TripMobileRedirect_trip-mobile-redirect__desktop-content__Zasdj","rotate-three-sixty":"TripMobileRedirect_rotate-three-sixty__jQQlI","slide-in-to-left":"TripMobileRedirect_slide-in-to-left__wLE1n","slide-out-to-left":"TripMobileRedirect_slide-out-to-left__YTvDN","slide-in-to-right":"TripMobileRedirect_slide-in-to-right__MW_2G","slide-out-to-right":"TripMobileRedirect_slide-out-to-right__fYp_Y"}},93739:(t,e,i)=>{"use strict";i.d(e,{A:()=>r});var o=i(14232),l=i(66149),a=i(88896);let r=()=>{let{setTrip:t,setWaypoints:e,setVehicle:i,setLoading:r}=(0,a.$K)(),{loadRecord:n,loading:s,errors:c}=(0,l.A)();return{loadTrip:(0,o.useCallback)(async o=>{r(!0),await n("trips",o,{include:"waypoints.subject,vehicle"},{},o=>{var l;let{data:a,included:n}=o;t(a);let s=null!=(l=null==n?void 0:n.filter(t=>"waypoints"===t.type))?l:[],c=null==n?void 0:n.filter(t=>"waypoints"!==t.type&&"vehicles"!==t.type);s.forEach(t=>{if(t.subjectId){let e=null==c?void 0:c.find(e=>e.id===t.subjectId);e&&(t.subject=e)}}),e(s);let _=null==n?void 0:n.find(t=>"vehicles"===t.type);i(null!=_?_:null),r(!1)})},[n,t,e,i,r]),loading:s,errors:c}}},97999:(t,e,i)=>{"use strict";i.d(e,{A:()=>r,P:()=>a});var o=i(14232);let l=[],a=t=>{l.forEach(e=>e(t))},r=()=>{let[t,e]=(0,o.useState)([]);return(0,o.useEffect)(()=>{let t=t=>{let i=Date.now();e(e=>[...e,{id:i,message:t}]),setTimeout(()=>{e(t=>t.filter(t=>t.id!==i))},3e3)};return l.push(t),()=>{l=l.filter(e=>e!==t)}},[]),{toasts:t,dismissToast:(0,o.useCallback)(t=>{e(e=>e.filter(e=>e.id!==t))},[])}}}},t=>{t.O(0,[9469,4587,2867,9548,6215,7967,2113,636,6593,8792],()=>t(t.s=24316)),_N_E=t.O()}]); 2//# sourceMappingURL=[id]-15bed20534e5ec3e.js.map
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.