1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2280],{4566:(e,t,i)=>{i.d(t,{u:()=>o});var r=i(65094);let o=e=>(0,r.fC)(e)&&e.message||"An unknown error occurred"},6955:(e,t,i)=>{i.d(t,{N:()=>n});var r=i(90656),o=i(61872),a=i(57109),l=i(1263);let n=e=>{let t=(0,r.useRouter)(),{navigationLinks:i,config:n}=(0,a.usePageContext)(),s=l.Q.use.userSession(),c=l.Q.use.isAuthenticated(),[d,p]=(0,o.useState)(!1),u=n.app?.runmode==="author";return(0,o.useEffect)(()=>{if(u)return void p(!0);if(s)if(c)p(!0);else{let r=e??i.home;t.replace(r)}},[u,c,t,e,s,i.home]),d}},9425:(e,t,i)=>{i.d(t,{Z:()=>y,A:()=>x});var r=i(47388),o=i(88365),a=i(52949),l=i(6903),n=i(64947),s=i(882),c=i(57521),d=i(8085),p=i(70841),u=i(2891),g=i(47928),h=i(55301);let f={AlertWrapper:{width:"100%",gap:"0px",svg:{transform:"scale(0.75)"},"> .MuiPaper-root":{padding:"16px 24px 16px 24px !important",gap:"0px"},"& .MuiAlert-icon":{marginRight:"4px",paddingTop:"0px"}},ErrorBody:{borderRadius:"4px",border:`1px solid var(--Alerts-Error-Subtle, ${h.J.vinhoDoPorto})`,background:h.J.errorRed,fontSize:"14px",fontStyle:"normal",fontWeight:"400",lineHeight:"20px","& .MuiAlert-icon":{marginRight:"4px",paddingTop:"0px"}},ErrorTitle:{color:h.J.semanticRed,fontSize:"16px",fontStyle:"normal",fontWeight:"700",lineHeight:"24px",alignSelf:"stretch",marginTop:"0px",marginBottom:"0px"},ErrorContent:{color:h.J.semanticRed,fontSize:"14px","> div > p":{margin:"0px",fontSize:"14px"}},ConfirmationBody:{background:h.J.aliceBlue,border:`1px solid ${h.J.outerReef}`,fontSize:"14px",fontStyle:"normal",fontWeight:"400",lineHeight:"20px","& .MuiAlert-icon":{marginRight:"4px",paddingTop:"0px"}},ConfirmationTitle:{color:h.J.steelBlue,fontSize:"16px",fontStyle:"normal",fontWeight:"700",lineHeight:"24px",alignSelf:"stretch",marginTop:"0px",marginBottom:"0px"},ConfirmationContent:{color:h.J.steelBlue,fontSize:"14px","> div > p":{margin:"0px",fontSize:"14px"}},WarningBody:{background:h.J.orange500,border:`1px solid ${h.J.orange800}`,fontSize:"14px",fontStyle:"normal",fontWeight:"400",lineHeight:"20px","& .MuiAlert-icon":{marginRight:"4px",paddingTop:"0px"}},WarningTitle:{color:h.J.orange800,fontSize:"16px",fontStyle:"normal",fontWeight:"700",lineHeight:"24px",alignSelf:"stretch",marginTop:"0px",marginBottom:"0px"},WarningContent:{color:h.J.orange800,fontSize:"14px","> div > p":{margin:"0px",fontSize:"14px"}}},m={success:{severity:"success",icon:(0,r.jsx)(e=>(0,r.jsx)(d.default,{...e,viewBox:"0 0 16 16",children:(0,r.jsx)("g",{id:"icons",children:(0,r.jsx)("path",{id:"Icon",d:"M8.00043 0C10.1219 8.53595e-05 12.1565 0.842722 13.6567 2.34277C15.1569 3.843 15.9994 5.87835 15.9994 8C15.9994 9.58207 15.5307 11.1289 14.6518 12.4443C13.7728 13.7598 12.5227 14.7852 11.061 15.3906C9.59949 15.9959 7.99136 16.1542 6.43988 15.8457C4.88809 15.537 3.46197 14.775 2.3432 13.6562C1.22455 12.5375 0.462416 11.1122 0.153746 9.56055C-0.154924 8.00876 0.00432389 6.40023 0.6098 4.93848C1.21528 3.47674 2.24056 2.22764 3.55609 1.34863C4.87162 0.469638 6.41826 0 8.00043 0ZM10.7016 1.47461C9.41133 0.940043 7.99132 0.800839 6.62152 1.07324C5.25172 1.34566 3.99385 2.0183 3.00628 3.00586C2.01872 3.99342 1.34609 5.2513 1.07367 6.62109C0.801265 7.99089 0.940468 9.4109 1.47503 10.7012C2.00963 11.9915 2.91521 13.0943 4.0766 13.8701C5.23798 14.6459 6.60378 15.0598 8.00043 15.0596C9.87239 15.0586 11.667 14.3139 12.9907 12.9902C14.3143 11.6665 15.059 9.87196 15.06 8C15.0603 6.60335 14.6463 5.23756 13.8705 4.07617C13.0948 2.91478 11.9919 2.00921 10.7016 1.47461ZM11.9496 5.06934C12.0116 5.06754 12.0735 5.07829 12.1313 5.10059C12.189 5.12288 12.2419 5.15634 12.2866 5.19922C12.3337 5.2424 12.3715 5.29527 12.3979 5.35352C12.4242 5.41196 12.4387 5.47593 12.4399 5.54004C12.4388 5.66174 12.3915 5.77854 12.3071 5.86621L9.80023 8.52637L9.76019 8.56641L7.31976 11.1523C7.30576 11.1773 7.28834 11.2006 7.26703 11.2197C7.17979 11.3052 7.06198 11.3526 6.93988 11.3525C6.8089 11.3485 6.68427 11.2935 6.5932 11.1992L4.08734 8.54004C4.00346 8.44807 3.95861 8.32656 3.96234 8.20215C3.96608 8.07782 4.01773 7.95979 4.10687 7.87305H4.11371C4.15791 7.83057 4.20993 7.79673 4.26703 7.77441C4.32411 7.75211 4.38544 7.74193 4.44671 7.74316C4.50791 7.74444 4.56839 7.75766 4.62445 7.78223C4.68052 7.80683 4.73146 7.84255 4.77386 7.88672L4.7807 7.89258
1L6.93988 10.1865L9.10687 7.88672C9.1202 7.87339 9.12674 7.85921 9.14007 7.85254L11.6196 5.21973C11.6616 5.17415 11.7126 5.1371 11.769 5.11133C11.8255 5.08554 11.8876 5.0712 11.9496 5.06934Z",fill:"#2C6293"})})}),{}),bodyKey:"ConfirmationBody",titleKey:"ConfirmationTitle",contentKey:"ConfirmationContent"},error:{severity:"error",icon:(0,r.jsx)(p.I,{}),bodyKey:"ErrorBody",titleKey:"ErrorTitle",contentKey:"ErrorContent"},warning:{severity:"warning",icon:(0,r.jsx)(u.O,{}),bodyKey:"WarningBody",titleKey:"WarningTitle",contentKey:"WarningContent"}},y=({title:e="",message:t="",type:i="success",styleParts:d})=>{let p=(0,o.A)(),u=m[i],h=p.molecules?.AlertBanner,y=(0,c.o)(f[u.bodyKey],h?.[u.bodyKey],d?.[u.bodyKey]),x=(0,c.o)(f[u.titleKey],h?.[u.titleKey],d?.[u.titleKey]),b=(0,c.o)(f[u.contentKey],h?.[u.contentKey],d?.[u.contentKey]),C=(0,c.o)(f.AlertWrapper,h?.AlertWrapper,d?.AlertWrapper);return(0,r.jsx)(a.default,{sx:C,children:(0,r.jsx)(l.A,{"data-testid":"alert-type",severity:u.severity,icon:u.icon,sx:y,children:(0,r.jsxs)(a.default,{children:[(0,r.jsx)(n.A,{"data-testid":"alert-title",sx:x,children:(0,r.jsx)("div",{dangerouslySetInnerHTML:{__html:(0,g.p)(e)}})}),(0,r.jsx)(s.Ay,{"data-testid":"alert-description",sx:b,children:(0,r.jsx)("div",{dangerouslySetInnerHTML:{__html:(0,g.p)(t)}})})]})})})},x=y},25680:(e,t,i)=>{i.d(t,{l:()=>l});var r=i(47388),o=i(37305),a=i(85494);let l=({formControlProps:e={},required:t,label:i,placeholder:l="Select",options:n,value:s,onChange:c,onClose:d,onOpen:p,renderOption:u,sx:g={},valueLabelSx:h={},name:f,register:m,errors:y,disabled:x=!1,"data-testid":b,dropdownMenuProps:C,isRequired:S})=>(0,r.jsx)(a.$,{label:i,formControlProps:e,required:t,dataTestId:b,name:f,errors:y,isRequired:S,children:(0,r.jsx)(o.e,{options:n,value:s,onChange:c,onOpen:p,placeholder:l,renderOption:u,dataTestId:b,sx:g,name:f,register:m,onClose:d,errors:y,disabled:x,dropdownMenuProps:C,valueLabelSx:h})})},42280:(e,t,i)=>{i.r(t),i.d(t,{ProfilePreferences:()=>eF});var r=i(47388),o=i(17348),a=i(91106);let l={maxWidth:"432px"},n={flexGrow:1},s=e=>({backgroundColor:e.palette.background.primary,paddingBlock:3,paddingInline:6,borderRadius:`${e.borderRadius.mediumCard}px`,boxShadow:"0px 4px 4px 0px rgba(0, 0, 0, 0.04), 0px 0px 8px 0px rgba(0, 0, 0, 0.04), 0px 4px 16px 0px rgba(0, 0, 0, 0.1);","& > :not(:last-child)":{borderBottom:`1px solid ${e.palette.stroke.lowContrast}`,paddingBottom:2}}),c={paddingBlock:7},d={marginLeft:"auto",paddingInline:7};var p=i(51101),u=i(45315),g=i(99701),h=i(10431),f=i(57109),m=i(82714),y=i(75267),x=i(61872);let b=(0,x.createContext)({editable:!0,ueModelId:"",name:"",path:"",id:"profilepreferences",":type":"platform/components/content/profilepreferences/v1/profilepreferences",children:[],i18n:{},companyInfoTitle:"",companyInfoName:"",protectionsCoveragesTitle:"",addOnsTitle:"",addOnsDescription:"",vehiclesTitle:"",vehiclesDescription:"",pickUpLocationsTitle:"",pickUpLocationsDescription:"",protectionsCoveragesDescription:"",preferredVehiclesList:[],companyTitle:"",personalizationLocation:"",showPersonalization:!1,isInherited:!1,labelSuffix:""}),C=()=>(0,x.useContext)(b);var S=i(25229),P=i(37925),L=i(80307),v=i(63549),j=i(38831),A=i(90544);let T={flexWrap:"wrap"},k=e=>{let t=C();return(0,r.jsxs)(p.default,{direction:"row",justifyContent:"space-between",paddingTop:2,"data-testid":`${e.id}-preference-category`,children:[(0,r.jsxs)(p.default,{gap:1,children:[(0,r.jsx)(h.Q,{"data-testid":`${e.id}-preference-category-title`,variant:"bodyLargeBold","data-aue-prop":e.aueTitleProp,"data-aue-label":e.aueTitleLabel,"data-aue-type":"text",children:e.title}),(0,r.jsx)(h.Q,{"data-testid":`${e.id}-preference-category-description`,variant:"bodyRegularRegular","data-aue-prop":e.aueDescriptionProp,"data-aue-label":e.aueDescriptionLabel,"data-aue-type":"text",children:e.description}),(0,r.jsx)(p.default,{gap:2,direction:"row",sx:T,children:e.items?.map(t=>(0,r.jsx)(p.default,{direction:"column",gap:1,children:(0,r.jsx)(v.A,{"data-testid":`${e.id}-preference-category-chip-${t.id}`,variant:"secondary",label:t.label,...t.icon?{icon:"string"==typeof t.icon?(0,r.jsx)(A.AemImage,{src:t.icon,alt:"addon image",width:16,height:16,style:{objectFit:"cover"},"data-testid":`${e.id}-preference-category-add-on-icon-${t.id}`}):t.icon??(0,r.jsx)(r.Fragment,{})}:{}})},t.id))})]}),(0,r.jsx)(j.default,{className:"tertiaryText","data-testid":`${e.id}-preference-category-edit-button`,onClick:e.onEdit,children:t.i18n["global.edit.placeholder.label"]})]})};var w=i(42846),E=i(59917),I=i(88307),D=i(80181),O=i(81597),M=i(4010),R=i(40885),N=i(52949),V=i(17783),_=i(7566),B=i(87962),$=i(63751),U=i(27152),W=i(47928);let F={maxHeight:"70dvh"},z={width:"14px",height:"14px"},K={width:"432px"},H={width:"40px",height:"40px",display:"flex",justifyContent:"center",flexShrink:0},J={flexGrow:1},q={"& p":{margin:0}},G={paddingBlock:"24px"};var Q=i(95579),Z=i(1263);let Y={[S.ProductPreferenceType.ANCILLARY]:"Add-ons",[S.ProductPreferenceType.INSURANCE]:"Protections"};var X=i(23141);let ee=e=>{let{onClose:t,preferences:i,preferenceType:o,title:a,description:l,ctaButtonLabel:n}=e,s=((e,t,i)=>{let[r,o]=(0,x.useState)(e),a=(0,Q.S)(),l=(0,L.OV)(),n=async()=>{let e={products:r.reduce((e,i)=>Array.isArray(i.codes)?[...e,...i.codes.map(e=>({sequenceNumber:"1",type:t,status:i.isSelected?X.ProductPreferenceStatus.SELECTED:X.ProductPreferenceStatus.DECLINED,code:e}))]:(e.push({sequenceNumber:"1",type:t,status:i.isSelected?X.ProductPreferenceStatus.SELECTED:X.ProductPreferenceStatus.DECLINED,code:i.codes}),e),[]).map((e,t)=>({...e,sequenceNumber:(t+1).toString()}))},o=await a.updateProfile({preferences:e},{analyticsEmitter:l,analyticsPayload:{edit_category:"Preferences",edit_section:Y[t]??"",edit_type:"edit"}});if(!o)return;let n=Z.Z.getState(),s=(0,y.tB)(n);s&&(n.setUserProfile({...s,preferences:{...o.preferences,products:o.preferences?.products??[]}}),i())};return{preferences:r,toggleSelection:e=>{o(t=>{let i=!e.isSelected&&Array.isArray(e.codes);return t.map(t=>{let r=Array.isArray(t.codes),o=t.id===e.id;return r&&i&&!o?{...t,isSelected:!1}:{...t,isSelected:o?!t.isSelected:t.isSelected}})})},saveChanges:n,...a}})(i,o,t);return(0,r.jsxs)(I.default,{open:!0,onClose:t,slotProps:{paper:{sx:K}},"aria-labelledby":`${o}-edit-dialog-title`,"aria-describedby":`${o}-edit-dialog-description`,"data-testid":"action-dialog",children:[(0,r.jsxs)(D.default,{id:`${o}-edit-dialog-title`,children:[(0,r.jsx)("span",{"data-testid":`${o}-edit-dialog-title-content`,children:a}),(0,r.jsx)(O.default,{"data-testid":`${o}-edit-dialog-close-button`,"aria-label":"close",onClick:t,children:(0,r.jsx)(_.U,{sx:z})})]}),(0,r.jsx)(M.default,{sx:F,children:(0,r.jsxs)(p.default,{gap:3,"data-testid":`${o}-edit-dialog-content`,children:[(0,r.jsx)(h.Q,{variant:"bodyRegularRegular",color:"textSecondary","data-testid":`${o}-edit-dialog-description`,children:l}),s.error&&(0,r.jsx)(B.F,{open:!0,type:$.v.ERROR,title:"Failed to update",description:s.error,level:$.N.LEVEL_3,onClose:s.clearError}),(0,r.jsx)(p.default,{divider:(0,r.jsx)(R.default,{flexItem:!0}),children:s.preferences.map(e=>(0,r.jsxs)(p.default,{sx:G,direction:"row",gap:1,children:[(0,r.jsx)(N.default,{sx:H,children:e.icon&&(0,r.jsx)(A.AemImage,{src:e.icon,alt:`${o} image`,width:24,height:24,"data-testid":`${o}-item-icon`})}),(0,r.jsxs)(p.default,{sx:J,children:[(0,r.jsx)(h.Q,{variant:"bodyRegularBold",fontWeight:"700","data-testid":`${o}-item-label`,children:e.label}),(0,r.jsx)(h.Q,{sx:q,variant:"bodyRegularRegular",dangerouslySetInnerHTML:{__html:(0,W.p)(e.description)},"data-testid":`${o}-item-description`})]}),(0,r.jsx)(U.l,{"data-testid":`${o}-item-switch`,slotProps:{input:{"aria-label":`toggle ${o}`}},checked:e.isSelected,onChange:()=>s.toggleSelection(e)})]},e.id))})]})}),(0,r.jsx)(V.default,{children:(0,r.jsx)(j.default,{className:"primary",onClick:()=>void s.saveChanges(),"data-testid":"save-changes",children:n})})]})};var et=i(32259);let ei=()=>{let{openRegularModal:e}=(0,P.V)(),t=C(),i=(()=>{let[e,t]=(0,x.useState)(null),i=(0,w.A6)(),r=(0,y.DH)(),o=(0,E.useLocationService)();return(0,x.useEffect)(()=>{r&&(async()=>{try{let e=await o.countryAddOns(r);t(e)}catch(e){console.error(e)}})()},[o,r,i]),e})(),o=(0,y.qw)(),a=(0,L.OV)(),l=(0,x.useMemo)(()=>((e,t)=>{let i,r;if(!t)return[];let o=e.filter(({type:e,status:t})=>e===S.ProductPreferenceType.ANCILLARY&&"SELECTED"===t),a=(0,et.A)(o,({code:e})=>e);return[...(i=t.data.addOnBundleList.items,i.filter(({preferredEnrollmentStatus:e})=>e).reduce((e,t)=>
1{let i=t.includedAddons.every(({code:e})=>a[e]);return e.push({id:t.bundleName,label:t.bundleName,icon:t.image?._path,isSelected:i,description:t.bundleDescription.html,codes:t.includedAddons.map(({code:e})=>e)}),e},[])),...(r=t.data.addOnCategoryList.items,r.flatMap(({addOnList:e})=>e).filter(({preferredEnrollmentStatus:e,enabled:t})=>e&&t).reduce((e,t)=>{let i=!!a[t.code];return e.push({id:t.code,label:t.name,icon:t.icon?._path,isSelected:i,description:t.description.html,codes:t.code}),e},[]))]})(o??[],i),[i,o]),n=l.filter(({isSelected:e})=>e);return 0===l.length?null:(0,r.jsx)(k,{id:"addOns",title:t.addOnsTitle,description:t.addOnsDescription,aueTitleProp:"addOnsTitle",aueTitleLabel:"Add-Ons section title",aueDescriptionProp:"addOnsDescription",aueDescriptionLabel:"Add-Ons section description",items:n,onEdit:()=>{e?.(ee,{preferenceType:S.ProductPreferenceType.ANCILLARY,preferences:l,title:t.i18n["profileManagement.addOns.modal.title"],description:t.i18n["profileManagement.addOns.modal.subTitle"],ctaButtonLabel:t.i18n["global.saveChanges.label"]}),a({edit_category:"Preferences",edit_section:"Add-Ons",edit_type:"start"})}})};var er=i(65941),eo=i(87503),ea=i(6643),el=i(78162),en=i(9425),es=i(15134),ec=i(55301);let ed={"& .MuiDialog-paper":{width:{sm:"432px",xs:"100%"},margin:{sm:2,xs:0}}},ep={width:"100%"},eu={letterSpacing:"0.3px"},eg={color:ec.J.secondary400},eh=(0,x.memo)(({onClose:e,onSuccess:t})=>{let i=C(),o=Z.Q.use.setUserProfile(),a=Z.Q.use.userProfile(),l=(0,y.gM)(),n=l?.[0]?.nickname,s=l?.[0]?.companyNumber,c=(0,g.A)(i.i18n),{emitEvent:d}=(0,es.useAnalyticsGeneralEngagement)(),p=(0,er.mN)({defaultValues:{companyName:n}}),u=p.watch("companyName"),{updateProfile:h,isLoading:f,error:m}=(0,Q.S)(),x=async()=>{if(!u||!s||u===n)return void e();let i=await h({companyInformation:[{action:ea.profile.ProfileApiAction.UPDATE,nickname:u,sequenceNumber:"1",companyNumber:s}]});i?.companyInformation&&a&&o({...a,companyInformation:i?.companyInformation}),t()};return(0,r.jsxs)(el.n,{"data-testid":"edit-company-info-dialog",isOpen:!0,onClose:e,styleParts:{actionDialog:{dialogStyling:ed,actionButtonStyling:ep,dialogTitleStyling:eu}},divider:!1,title:i.companyInfoTitle,primaryActionLabel:c("global.saveChanges.label"),onPrimaryAction:e=>{d(e.currentTarget),x()},isLoading:f,primaryActionDisabled:f,children:[(0,r.jsx)(er.Op,{...p,children:(0,r.jsx)(eo.J,{name:"companyName",label:c("reservationCheckout.billingDetailsForm.company.label"),testId:"company-name-input",textFieldProps:{fullWidth:!0}})}),m&&(0,r.jsx)(en.A,{type:"error",title:m,message:""})]})}),ef=()=>{let e=C(),[t,i]=(0,x.useState)(!1),[o,a]=(0,x.useState)(!1),l=(0,g.A)(e.i18n),n=(0,y.gM)(),s=n?.[0]?.nickname,c=(0,L.OV)(),d=(0,x.useCallback)(()=>{i(!0),c({edit_category:"Preferences",edit_section:"Company Info",edit_type:"start"})},[c]),p=(0,x.useCallback)(()=>{i(!1)},[]),u=(0,x.useCallback)(()=>{a(!0),p()},[p]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(k,{id:"companyInfo","data-testid":"company-info",title:e.companyInfoTitle,description:s||l("reservationProtections.bundles.coverage.none.label"),aueTitleProp:"companyInfoTitle",aueTitleLabel:"Company Info section title",onEdit:d}),o&&(0,r.jsx)(B.F,{withIcon:!1,level:1,open:!0,closable:!0,onClose:()=>a(!1),title:e.i18n["profileManagement.paymentMethods.updatedNotification.text"],type:$.v.CONFIRMATION}),t&&(0,r.jsx)(eh,{onClose:p,onSuccess:u})]})};var em=i(10524),ey=i(85494),ex=i(58625);let eb={amountOfCities:5,amountOfPoI:5,amountOfAirports:5,amountOfNeighborhoodLocations:10,amountOfTruckLocation:5};var eC=i(59961),eS=i(87937),eP=i(37271),eL=i(49507),ev=i(91267);let ej=({i18n:e,isPickUpSearch:t,name:i,label:o,placeholder:a})=>{let l,n,{fetchBookingCurrentLocationSuggestions:s,fetchBookingLocationSuggestions:c}=(()=>{let e=(0,eS.Fu)(),{country:t,locale:i}=(0,f.usePageContext)(),r=(0,x.useMemo)(()=>({"context.domainCountry":t.toUpperCase(),"context.locale":(0,eL.M)(i),excludeSuggestionTypes:[X.LocationSuggestionTypes.OTR_POINT_OF_INTEREST,X.LocationSuggestionTypes.OTR_CITY].join(",")}),[t,i]),o=(0,eC.w)(async(t,i,o=!0)=>{let a=new URLSearchParams({isPickUpSearch:String(o),suggestionLimit:ev.P,keyword:i,...r}),l=await (0,eP.V)(e,a,{signal:t});return t.aborted?[]:l},[e,r]),a=(0,x.useCallback)(async t=>{let i=new URLSearchParams({latitude:t.latitude.toString(),longitude:t.longitude.toString(),suggestionLimit:ev.P,radialDistanceMiles:"30",...r});return(0,eP.o)(e,i)},[e,r]);return(0,x.useMemo)(()=>({fetchBookingLocationSuggestions:o,fetchBookingCurrentLocationSuggestions:a}),[a,o])})(),{locationSearchLabels:d}=(l=(0,g.A)(e),n=(0,x.useMemo)(()=>({placeholder:l("locationSearch.search.label"),loadingText:l("locationSearch.loadingText.label"),multipleLocationsLabel:l("locationSearch.multipleLocations.label"),airportsLabel:l("locationSearch.airports.label"),showAllAirportsLabel:l("locationSearch.showAllAirports.label"),reviseSearchLabel:l("locationSearch.reviseSearch.label"),showingAllAirportsLabel:l("locationSearch.airports.inputValue.amount.label"),citiesLabel:l("locationSearch.cities.label"),showAllCitiesLabel:l("locationSearch.showAllCities.label"),showingAllCitiesLabel:l("locationSearch.cities.inputValue.amount.label"),recentLabel:l("locationSearch.recent.label"),showAllRecentLabel:l("locationSearch.show.recents.amount.label"),pointsOfInterestLabel:l("locationSearch.pointsOfInterest.label"),showAllPOILabel:l("locationSearch.show.interestPoints.amount.label"),showingAllPOILabel:l("locationSearch.interestPoints.inputValue.amount.label"),neighborhoodLabel:l("locationSearch.neighborhood.locations.label"),showAllNeighborhoodLabel:l("locationSearch.neighborhood.locations.amount.label"),showingAllNeighborhoodLabel:l("locationSearch.neighborhood.inputValue.amount.label"),truckLabel:l("bookingWidget.location.truck.label"),showAllTruckLabel:l("bookingWidget.location.showAll.truck.label"),showingAllTruckLabel:l("bookingWidget.location.showingAll.truck.label"),myLocationsLabel:l("locationSearch.myLocations.label"),useCurrentLocationLabel:l("locationSearch.currentLocation.label"),useCurrentLocationFoundErrorMessage:l("bookingWidget.currentLocation.search.error.text"),groupBackButtonLabel:l("bookingWidget.location.backToResult.text"),noMatchLabel:l("locationSearch.noMatch.label"),is24hoursDropOffAvailableLabel:l("locationMap.icon.hourDrop.label"),addressLabel:l("locationMap.address.label"),locationLinkLabel:l("locationMap.ctaLabel.locationDetail
1s.label"),hoursOfOperationLabel:l("locationMap.hoursOfOperation.label"),phoneLabel:l("locationMap.phone.label"),incorrectValue:l("bookingWidget.pickup.error.incorrectValue"),emptyValue:l("bookingWidget.pickup.error.emptyValue"),isKeyDropLocationLabel:l("locationMap.icon.keyDrop.label"),currentReturnLabel:"",selectAsPickupLabel:l("bookingWidget.select.pickup.cta.label"),selectAsDropoffLabel:l("bookingWidget.select.dropoff.cta.label"),holidayHoursLabel:l("locationMap.hoursModal.holidayHours.label"),featuresLabel:l("bookingWidget.features.label"),browseForLocationLabel:"",helperSearchText:""}),[l]),(0,x.useMemo)(()=>({locationSearchLabels:n}),[n]));return(0,r.jsx)(ey.$,{label:o,children:(0,r.jsx)(ex.C,{testIdPrefix:`${i}-location-field`,name:i,groupLimits:eb,loadOptions:e=>c(e,t),loadCurrentOptions:e=>s(e),errors:{incorrectValue:d.incorrectValue,emptyValue:d.emptyValue},allowGeolocation:!0,uiTextData:a?{...d,placeholder:a}:d,optionTestIdBuilder:({identifier:e,suggestionTypeCode:t})=>`pickup-location-option-${e}-${t}`})})};var eA=i(65349),eT=i(92188);let ek=eA.z.object({pickup:eT.Uq.refine(e=>!!e&&null!==e.identifier,{message:"Pickup location must be selected"})}),ew=({onClose:e})=>{let t=C(),i=(0,er.mN)({defaultValues:{pickup:null},resolver:(0,em.u)(ek),mode:"onTouched"}),o=(0,g.A)(t.i18n),{updateProfile:a,isLoading:l}=(0,Q.S)(),n=(0,L.OV)(),s=async()=>{if(!await i.trigger("pickup"))return;let t=i.getValues("pickup");if(!t)return;let r={locations:[{sequenceNumber:"1",code:t.mnemonic??""}]},o=await a({preferences:r},{analyticsEmitter:n,analyticsPayload:{edit_category:"Preferences",edit_section:"Pick Up Locations",edit_type:"edit"}}),l=Z.Z.getState(),s=(0,y.tB)(l);s&&o&&(l.setUserProfile({...s,preferences:{...s.preferences,locations:o.preferences?.locations??[]}}),e())};return(0,r.jsx)(el.n,{isOpen:!0,onClose:e,divider:!0,title:o("profilePreferences.pickUpLocations.modal.title"),description:o("profilePreferences.pickUpLocations.modal.subTitle"),primaryActionLabel:o("global.saveChanges.label"),styleParts:{actionDialog:{dialogStyling:ed,actionButtonStyling:ep,dialogTitleStyling:eu,dialogDescriptionStyling:eg}},onPrimaryAction:()=>void s(),primaryActionDisabled:l,children:(0,r.jsx)(er.Op,{...i,children:(0,r.jsx)(ej,{label:o("profilePreferences.pickUpLocations.field.title"),name:"pickup",i18n:t.i18n,placeholder:o("profilePreferences.pickUpLocations.field.placeholder"),isPickUpSearch:!0})})})};var eE=i(19690);let eI=()=>{let e=C(),[t,i]=(0,x.useState)(!1),o=(()=>{let[e,t]=(0,x.useState)(null),i=(0,eS.Fu)(),[r]=(0,y.H3)()??[];return(0,x.useEffect)(()=>{let e=async e=>{if(!(0,eE.r)(e))return void t(null);try{let r=new URLSearchParams({mnemonic:e}),o=await i.refdata(`/location/title?${r}`);t(o)}catch{t(null)}};r?.code&&e(r?.code)},[r?.code,i]),r?.code?[{id:r.code,label:e?.title??r.code,icon:""}]:[]})();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(k,{id:"pickUpLocations",title:e.pickUpLocationsTitle,description:e.pickUpLocationsDescription,aueTitleProp:"pickUpLocationsTitle",aueTitleLabel:"Pick Up Locations section title",aueDescriptionProp:"pickUpLocationsDescription",aueDescriptionLabel:"Pick Up Locations section description",items:o,onEdit:()=>i(!0)}),t&&(0,r.jsx)(ew,{onClose:()=>i(!1)})]})},eD=()=>{let{openRegularModal:e}=(0,P.V)(),t=C(),i=(()=>{let[e,t]=(0,x.useState)(null),i=(0,y.DH)(),r=(0,E.useLocationService)();return(0,x.useEffect)(()=>{i&&(async()=>{try{let e=await r.countryProtections(i);t(e)}catch(e){console.error(e)}})()},[r,i]),e})(),o=(0,y.qw)(),a=(0,L.OV)(),l=(0,x.useMemo)(()=>((e,t)=>{let i,r;if(!t)return[];let o=e.filter(({type:e,status:t})=>e===S.ProductPreferenceType.INSURANCE&&"SELECTED"===t),a=(0,et.A)(o,({code:e})=>e);return[...(i=t.data.protectionBundleList.items,i.reduce((e,t)=>{let i=t.includedProtections.every(({code:e})=>a[e]);return t.preferredEnrollmentStatus&&e.push({id:t.bundleName,label:t.bundleName,icon:t.icon?._path??"",isSelected:i,description:t.bundleDescription.html,codes:t.includedProtections.map(({code:e})=>e)}),e},[])),...(r=t.data.protectionReferencesList.items,r.flatMap(({protectionList:e})=>e).filter(({preferredEnrollmentStatus:e,enabled:t})=>e&&t).reduce((e,t)=>
1{let i=!!a[t.code];return e.push({id:t.code,label:t.name,icon:t.icon?._path,isSelected:i,description:t.description.html,codes:t.code}),e},[]))]})(o??[],i),[i,o]),n=l.filter(({isSelected:e})=>e);return 0===l.length?null:(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(k,{id:"protectionsCoverages",title:t.protectionsCoveragesTitle,description:t.protectionsCoveragesDescription,aueTitleProp:"protectionsCoveragesTitle",aueTitleLabel:"Protections & Coverages section title",aueDescriptionProp:"protectionsCoveragesDescription",aueDescriptionLabel:"Protections & Coverages section description",items:n,onEdit:()=>{e?.(ee,{preferences:l,preferenceType:S.ProductPreferenceType.INSURANCE,title:t.i18n["profilePreferences.protectionsCoverages.modal.title"],description:t.i18n["profileManagement.protectionsCoverages.modal.subTitle"],ctaButtonLabel:t.i18n["global.saveChanges.label"]}),a({edit_category:"Preferences",edit_section:"Protections & Coverages",edit_type:"start"})}})})};var eO=i(25680),eM=i(37514);let eR={width:"100%",".MuiSvgIcon-root":{visibility:"hidden"}},eN=e=>({li:{padding:"16px",height:"76px",width:"100%",".MuiSvgIcon-root":{visibility:"hidden"},"&.Mui-selected":{borderRadius:`${e.borderRadius.main}px`,backgroundColor:ec.J.black+" !important",".MuiTypography-root":{fontWeight:500,color:ec.J.white100},".MuiSvgIcon-root":{visibility:"visible",path:{stroke:ec.J.white100}}}}});var eV=i(35355);let e_=e=>(0,r.jsx)(eO.l,{required:!0,dropdownMenuProps:{sx:eN},"data-testid":"vehicle-type-preferences",...e,renderOption:e=>(0,r.jsxs)(p.default,{sx:eR,direction:"row",alignItems:"center",justifyContent:"space-between",children:[(0,r.jsxs)(p.default,{direction:"row",alignItems:"center",spacing:2,children:[(0,r.jsx)(A.AemImage,{src:e.image?.source,fallbackSrc:eV.default,width:70,height:40,alt:e.label,style:{objectFit:"contain"},"data-testid":"vehicle-type-preferences-option-image"}),(0,r.jsx)(h.Q,{variant:"bodySmallRegular","data-testid":"vehicle-type-preferences-option-label",children:e.label})]}),(0,r.jsx)(eM.S,{strokeWidth:1,fontSize:"inherit","data-testid":"vehicle-type-preferences-option-check-icon"})]})}),eB=({onClose:e})=>{let{i18n:t,preferredVehiclesList:i}=C(),o=(0,g.A)(t),a=(0,er.mN)({defaultValues:{preferredVehicleGroup:""},mode:"onTouched"}),{updateProfile:l,isLoading:n,error:s,clearError:c}=(0,Q.S)(),d=(0,L.OV)(),p=async()=>{if(!await a.trigger())return;let t=a.getValues("preferredVehicleGroup"),i={products:[{sequenceNumber:"1",type:S.ProductPreferenceType.VEHICLE,code:t,status:X.ProductPreferenceStatus.SELECTED}]},r=await l({preferences:i},{analyticsEmitter:d,analyticsPayload:{edit_category:"Preferences",edit_section:"Vehicles",edit_type:"edit"}}),o=Z.Z.getState(),n=(0,y.tB)(o);n&&r&&(o.setUserProfile({...n,preferences:{...n.preferences,products:r.preferences?.products??[]}}),e())},u=(0,x.useMemo)(()=>i?.map(({title:e,vehicleGroup:t,vehicleImageItem:i})=>({label:e,value:t,image:i}))??[],[i]);return(0,r.jsxs)(el.n,{isOpen:!0,onClose:e,divider:!0,styleParts:{actionDialog:{dialogStyling:ed,actionButtonStyling:ep,dialogTitleStyling:eu,dialogDescriptionStyling:eg}},title:o("profilePreferences.preferredVehicles.modal.title"),description:o("profilePreferences.preferredVehicles.modal.subTitle"),primaryActionLabel:o("global.saveChanges.label"),onPrimaryAction:()=>void p(),isLoading:n,primaryActionDisabled:n,children:[s&&(0,r.jsx)(B.F,{open:!0,type:$.v.ERROR,title:"Failed to update",description:s,level:$.N.LEVEL_3,onClose:c}),(0,r.jsx)(er.Op,{...a,children:(0,r.jsx)(er.xI,{name:"preferredVehicleGroup",rules:{required:o("global.field.validation.fieldRequired.message",{field:o("profilePreferences.primaryVehicleGroup.title")})},render:({field:{onChange:e,value:t}})=>(0,r.jsx)(e_,{value:t,onChange:e,options:u,onClose:()=>{a.trigger("preferredVehicleGroup")},errors:a.formState.errors,name:"preferredVehicleGroup",label:o("profilePreferences.primaryVehicleGroup.title"),placeholder:o("profilePreferences.primaryVehicleGroup.placeholder")})})})]})};var e$=i(93452);let eU=()=>{let e,t,i,o=C(),[a,l]=(0,x.useState)(!1),n=(0,L.OV)(),s=(e=(0,y.qw)(),t=C(),i=(0,et.A)(t.preferredVehiclesList,({vehicleGroup:e})=>e),e?.filter(({type:e,status:t})=>e===S.ProductPreferenceType.VEHICLE&&t===X.ProductPreferenceStatus.SELECTED).map(({code:e})=>{let t=i[e];return{id:e,icon:(0,r.jsx)(e$.A,{}),label:t?.title??e}})??[]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(k,{id:"vehicles",title:o.vehiclesTitle,de
1scription:o.vehiclesDescription,aueTitleProp:"vehiclesTitle",aueTitleLabel:"Vehicles section title",aueDescriptionProp:"vehiclesDescription",aueDescriptionLabel:"Vehicles section description",items:s,onEdit:()=>{l(!0),n({edit_category:"Preferences",edit_section:"Vehicles",edit_type:"start"})}}),a&&(0,r.jsx)(eB,{onClose:()=>l(!1)})]})},eW=({model:e})=>{let t=(0,g.A)(e.i18n),{navigationLinks:i}=(0,f.usePageContext)();(0,m.I)();let o=(0,y.gM)(),a=o?.[0]?.companyNumber;return(0,r.jsx)(b.Provider,{value:e,children:(0,r.jsxs)(p.default,{direction:{xs:"column",md:"row"},gap:{xs:2,md:16},children:[(0,r.jsxs)(p.default,{gap:2,sx:l,children:[(0,r.jsx)(h.Q,{variant:"h4","data-testid":"profile-preferences-title",children:t("profilePreferences.myBookingPreferences.title.label")}),(0,r.jsx)(h.Q,{variant:"bodyLargeRegular",color:"textSecondary",children:t("profilePreferences.myBookingPreferences.subtitle.label")})]}),(0,r.jsxs)(p.default,{sx:n,gap:4,children:[(0,r.jsxs)(p.default,{sx:s,gap:2,"data-testid":"preferences-category-section",children:[a&&(0,r.jsx)(ef,{}),(0,r.jsx)(eD,{}),(0,r.jsx)(ei,{}),(0,r.jsx)(eU,{}),(0,r.jsx)(eI,{})]}),(0,r.jsxs)(p.default,{sx:d,direction:"row",gap:3,children:[i.privacyPolicy&&(0,r.jsx)(u.A,{variant:"actionSmallRegular",className:"tertiaryText tertiary-color",href:i.privacyPolicy,"data-testid":"privacy-policy-link",children:t("global.field.privacyPolicy.label")}),i.loyaltyTermsAndConditions&&(0,r.jsx)(u.A,{variant:"actionSmallRegular",className:"tertiaryText tertiary-color",href:i.loyaltyTermsAndConditions,"data-testid":"privacy-terms-conditions-link",children:t("rentals.termsAndConditions.text")})]})]})]})})},eF=({model:e,aemAttributes:t})=>(0,r.jsx)(o.default,{sx:c,maxWidth:"xl",...t,"data-aue-type":"component","data-testid":"profile-preferences-container",children:(0,r.jsx)(a.l,{children:(0,r.jsx)(eW,{model:e})})})},82714:(e,t,i)=>{i.d(t,{I:()=>c});var r=i(26985),o=i(87937),a=i(57109),l=i(75267),n=i(1263),s=i(20732);let c=e=>{let t=(0,l.zl)(),i=(0,o.Fu)(),{locale:c,licenseeLocale:d,country:p}=(0,a.usePageContext)();(0,r.u)(t=>{let r=n.Z.getState(),o=(0,l.Xh)(r),a=(0,l.o7)(r);if(e&&!o&&!a)return void r.setIsUserProfileFullDetailsFetched();let u=async()=>{let e=await (0,s.e)({bffClient:i,accessToken:a??"",params:{locale:c,licenseeLocale:d,country:p},signal:t});r.setUserProfile(e),r.setIsUserProfileFullDetailsFetched()};!o&&a&&u()},[t,i,p,c,d,e])}},85494:(e,t,i)=>{i.d(t,{$:()=>s});var r=i(47388),o=i(69578),a=i(52949),l=i(52590),n=i(88330);let s=({formControlProps:e,label:t,required:i,dataTestId:s="select",name:c,errors:d,children:p,isRequired:u})=>(0,r.jsxs)(o.A,{"data-testid":`${s}-wrapper`,...e,children:[(0,r.jsxs)(a.default,{component:"label",htmlFor:`${s}-select`,hidden:!t,sx:n.qf,children:[t,(i||u)&&(0,r.jsx)(a.default,{component:"span",className:"MuiInputLabel-asterisk",sx:n.Az,children:"*"})]}),p,(0,r.jsx)(l.A,{error:!0,sx:n.cy,children:c&&d?.[c]?.message})]})},91106:(e,t,i)=>{i.d(t,{l:()=>n});var r=i(47388),o=i(22472),a=i(57109),l=i(6955);let n=({children:e})=>{let{navigationLinks:t,brand:i}=(0,a.usePageContext)();return(0,l.N)(t.login)?e:(0,r.jsx)(o.Loader,{isActive:!0,brand:i})}},95579:(e,t,i)=>{i.d(t,{S:()=>h});var r=i(61872),o=i(25229),a=i(87937),l=i(57109),n=i(38129),s=i(49507),c=i(4566),d=i(28744),p=i(75267),u=i(1263),g=i(31797);let h=()=>{let e=(0,a.Fu)(),{licenseeLocale:t}=(0,l.usePageContext)(),[i,h]=(0,r.useState)(!1),[f,m]=(0,r.useState)(),{isCbpFlow:y}=(0,d.E)(),{belongsToRegions:x}=(0,g.y)(),b=x([n.g.EMEA]),C=(0,r.useCallback)(async()=>{try{let t=await e.customer("corporate-bridge/enrollment-info");return t?.isCbp}catch{return!1}},[e]);return{updateProfile:(0,r.useCallback)(async(i,r)=>{h(!0);let a=(0,p.U6)(u.Z.getState()),l=(0,p.tB)(u.Z.getState()),n=!1;y&&(n=await C());
1try{let c=t?`?context.locale=${(0,s.M)(t)}`:"",d=await e.customer(`/update${c}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a?.accessToken||""}`},body:JSON.stringify({...n&&{requestContext:{channelInfo:{channelCode:"CBP"}}},...b&&{emailDetails:[{...l?.emailDetails?.[0],action:o.ProfileApiAction.UPDATE}]},...i})});return r?.analyticsEmitter&&r?.analyticsPayload&&r?.analyticsEmitter?.(r.analyticsPayload),d&&u.Z.getState().setUserProfile(d),d}catch(e){return m((0,c.u)(e)),null}finally{h(!1)}},[e,y,C,t]),clearError:()=>m(void 0),isLoading:i,error:f,setError:m}}}}]); 2//# sourceMappingURL=2280.90760ed874e67d5d.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.