1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];if(null!=a)for(var r in a)a.hasOwnProperty(r)&&(e[r]=a[r])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:kombo-app":!0})}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2977],{6245:e=>{e.exports={"discount-card-purchase-type":"styles_discount-card-purchase-type__OU7lg","purchase-type-content":"styles_purchase-type-content__45XLK","radio-container":"styles_radio-container__DI0pX",invalid:"styles_invalid__rrSJX",selected:"styles_selected__9R5AI","select-children":"styles_select-children__ddRsY","select-custom":"styles_select-custom__2SKxj"}},9613:e=>{e.exports={"back-arrow":"styles_back-arrow__KrXYd"}},11127:(e,t,a)=>{"use strict";a.d(t,{EY:()=>i.A,In:()=>n.A,az:()=>r.A,me:()=>s.A});var r=a(87913),n=a(43449),s=a(28319),i=a(14073)},11230:(e,t)=>{var a;!function(){"use strict";var r={}.hasOwnProperty;function n(){for(var e="",t=0;t<arguments.length;t++){var a=arguments[t];a&&(e=s(e,function(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return n.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var a in e)r.call(e,a)&&e[a]&&(t=s(t,a));return t}(a)))}return e}function s(e,t){return t?e?e+" "+t:e+t:e}e.exports?(n.default=n,e.exports=n):void 0===(a=(function(){return n}).apply(t,[]))||(e.exports=a)}()},11306:(e,t,a)=>{"use strict";a.d(t,{A:()=>P,X:()=>w});var r=a(80263),n=a(17343),s=a(32559),i=a(29980),l=a(29515),o=a(8809),c=a(47591),d=a(73858),u=a(43565),p=a(95759),h=a(67376),m=a(46905),x=a(20110),g=a(19702),v=a(44915),y=a(36126),f=a(87490),_=a(95217),j=a.n(_),b=a(65708),A=a(53239),C=a(94638),S=a(85080),E=a(33121),D=a.n(E);let N=j().bind(D()),w=async e=>o.th?(await (0,y.oi)("discountCardPurchase.getPurchaseStatus",async()=>f.A.get("".concat(o.th?"http:":window.location.protocol,"//").concat(o.yb,"/discountCardPurchase/").concat(e,"/pollStatus")))).data:x.N.getPurchaseStatus(e),P=e=>{let{price:t,encodedBookingId:a,locale:o,cardTypeUrlParam:x,company:y,isClickable:f,isOpen:_,title:j}=e,{t:E}=(0,C.B)([v.NS.PaymentForm]),D=(0,S.wA)(),P=(0,b.useRouter)(),{handleConfirmPurchase:I}=(0,c.TO)(),{retrieveEncodedAxeptaData:T}=(0,d.js)();(0,A.useEffect)(()=>{D((0,g.VR)(g.ME.Payment,!1))},[D]);let k=(0,A.useCallback)(async e=>{await I(a,t,n.PaymentMethod.Paypal,e)},[I,a,t]);return(0,u.$)(async()=>{let e=await w(a);if(null==e?void 0:e.authorizationErrorReason){let t;if(null==e?void 0:e.paymentErrorTranslationKey)t=null==e?void 0:e.paymentErrorTranslationKey;else{let a=(0,m.SK)(null==e?void 0:e.authorizationErrorReason,n.PurchaseFunnelType.DiscountCard);t=null==a?void 0:a.message}D((0,g.VR)(g.ME.Payment,!0,g.VL.Error,t)),await T()}else(null==e?void 0:e.done)&&await P.replace("/".concat(o,"/discount-card/").concat(x,"/confirm/").concat(a))},1e3),(0,r.jsx)(i.A,{clickable:f,open:_,title:null!=j?j:E("PAIEMENT"),children:(0,r.jsxs)("div",{className:N("payment-page-container"),children:[(0,r.jsx)(l.A,{place:g.ME.Payment,namespaces:[v.NS.PaymentForm,v.NS.Common]}),(0,r.jsx)(s.e,{encodedBookingId:a,priceToPay:t,onPaypalCancel:async()=>Promise.resolve(),onPaypalApprove:k,onPaypalError:async()=>{D((0,g.VR)(g.ME.Payment,!0,g.VL.Error,"ERROR_TRY_AGAIN"))},purchaseType:n.PurchaseFunnelType.DiscountCard,displayVoucher:!1,displayPaypal:!1,authorizationRequest:async()=>!0,enableSaveCardCheckbox:!0}),t.amount>0&&y&&(0,r.jsx)(h.A,{companies:[y],cgvLinkOverride:(0,p.vz)(x,o)})]})})}},17740:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});var r=a(80263),n=a(47591),s=a(19702),i=a(53239),l=a(85080),o=a(99019);let c=e=>{let{activeStep:t,handleOptionContinueClick:a,handleFormContinueClick:c,cardPrice:d,isLoading:u}=e,p=(0,l.wA)(),{purchaseErrorNotification:h}=(0,n.TO)();return((0,i.useEffect)(()=>{h&&p((0,s.VR)(s.ME.Payment,!0,s.VL.Error,h))},[h,p]),3===t)?null:(0,r.jsx)(o.m,{type:"submit",onClick:1===t?a:c,price:d,isLoading:u,loadingText:""})}},18996:e=>{e.exports={"discount-card-info-form-container":"styles_discount-card-info-form-container__STtz4","discount-card-validity-sentence":"styles_discount-card-validity-sentence__SELzV"}},20110:(e,t,a)=>{"use strict";a.d(t,{N:()=>l});var r=a(87490),n=a(36126),s=a(8809);let i=r.A.create({baseURL:"//"+s.yb+"/discountCardPurchase",timeout:6e4});i.defaults.withCredentials=!0;
1let l=(0,n.VT)("discountCardPurchase",{getCardDetails:async(e,t,a,r)=>(await i.get("cardDetails/".concat(e),{params:{departureCityId:a,arrivalCityId:r,locale:t}})).data,createDraft:async e=>(await i.post("draft",e)).data,retrieveAxeptaEncodedData:async(e,t)=>(await i.post("".concat(e,"/axepta/retrieveEncodedData"),t)).data,authorizePurchase:async(e,t)=>(await i.post("".concat(e,"/authorization"),t)).data,purchaseDiscountCard:async(e,t)=>(await i.post("".concat(e),t)).data,getPurchaseStatus:async e=>(await i.get("".concat(e,"/pollStatus"))).data,getPurchaseDetails:async e=>(await i.get("".concat(e))).data,getDiscountCardPdfUrl:async e=>(await i.get("".concat(e,"/pdfUrl"))).data})},24123:e=>{e.exports={"favourite-button":"styles_favourite-button__nD_JS"}},30640:(e,t,a)=>{"use strict";a.d(t,{E:()=>n.A,Z:()=>r.A});var r=a(93543),n=a(14073)},33121:e=>{e.exports={"payment-page-container":"styles_payment-page-container__a9Aly"}},36195:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var r=a(80263),n=a(25164),s=a(95217),i=a.n(s),l=a(9613),o=a.n(l);let c=i().bind(o()),d=e=>{let{onBack:t}=e;return t?(0,r.jsx)("button",{onClick:t,className:c("back-arrow"),children:(0,r.jsx)(n.I,{icon:"backArrow",height:"revert-layer",width:"revert-layer"})}):null}},37336:(e,t,a)=>{"use strict";a.d(t,{HN:()=>o,Mg:()=>m,OP:()=>u,en:()=>h,fm:()=>c,kn:()=>p,zD:()=>d});var r=a(8809),n=a(56798),s=a(35104);let i=e=>{let t=(()=>{var e,t;let a=null==window||null==(t=window.webkit)||null==(e=t.messageHandlers)?void 0:e.ReactNativeWebView;if(a)return{postMessage:e=>a.postMessage(e)};let r=null==window?void 0:window.ReactNativeWebView;return r&&"function"==typeof r.postMessage?r:null})();if(!t)return!1;try{return t.postMessage(e),!0}catch(e){return(0,s.v)(e),!1}},l=!1,o=(e,t)=>{if(!r.jx&&(0,n.KR)()){if(!(0,n.Qi)("nativeEvents")){if(!l){var a,o;l=!0,(0,s.O)("nativeEvents unsupported by this app version",{tags:{appSupportsNativeEvents:"false"},extra:{userAgent:null!=(a=null==(o=window.navigator)?void 0:o.userAgent)?a:""}})}return}i(JSON.stringify({type:"firebaseLog",event:e,data:t}))}},c=()=>{i("appRating")},d=e=>{let t;i((t=e,"BRIGHTNESS_".concat(t)))},u=()=>{i("OPEN_OCTOPUS")},p=()=>{i("CLOSE_OCTOPUS")},h=e=>{i(e)},m=()=>{i("ASK_NOTIFICATION_PERMISSION")}},40586:(e,t,a)=>{"use strict";a.d(t,{b4:()=>eH,Xy:()=>eK,Qs:()=>eY});var r=a(80263),n=a(17343),s=a(59913),i=a(77686),l=a(47591),o=a(63310),c=a(73858),d=a(44250),u=a(75129),p=a(17744),h=a(20110),m=a(19702),x=a(44915),g=a(45706),v=a(25175),y=a(65708),f=a(53239),_=a(94638),j=a(85080),b=a(17740),A=a(30990);let C=()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(A.I,{width:200,height:25}),(0,r.jsx)(A.I,{width:200,height:25,style:{marginTop:16}})]}),(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(A.I,{width:200,height:25}),(0,r.jsx)(A.I,{width:200,height:25,style:{marginTop:16}})]})]});var S=a(12414),E=a(15850),D=a(95217),N=a.n(D),w=a(71987),P=a.n(w);let I=N().bind(P()),T=e=>{let{onClose:t,cardSlug:a,suggestedCardType:n,onClick:s}=e,{t:i}=(0,_.B)([x.NS.DiscountCardFunnel]);return(0,r.jsx)(E.A,{headingText:i("discount-card.card.change.modal.title"),onClose:t,children:(0,r.jsxs)("div",{className:I("discount-card-modal"),children:[(0,r.jsx)(S.E,{variant:"medium",fontWeight:"medium",as:"p",children:i("discount-card.card.change.modal.sentence",{cardType:i("discount-card.card.title",{context:a}),suggestedCardType:i("discount-card.card.title",{context:n})})}),(0,r.jsx)(S.$,{fullWidth:!0,onClick:s,children:i("discount-card.card.change.modal.cta",{context:n})})]})})};var k=a(29980),R=a(25260),O=a(74770),F=a(77854),L=a(87913),M=a(93543),V=a(14073),B=a(29123),q=a(29515),z=a(59116),U=a(9356),G=a(91116),W=a(55414),Y=a(26187),K=a(47666),H=a(43449),Q=a(92706),Z=a(95759),X=a(25955),J=a(11230),$=a.n(J);a(50914);let ee="termsConsent",et=()=>{let{t:e}=(0,_.B)([x.NS.DiscountCardFunnel]),t=(0,W.Y)(),[,a,n]=(0,O.Mt)(ee),s=Z.Xz[t].kombo,i=a.touched&&!!a.error;return(0,r.jsxs)(L.A,{d:"flex",flexDirection:"column",gap:"4px",children:[(0,r.jsxs)(L.A,{as:"label",d:"flex",alignItems:"flex-start",gap:"12px",cursor:"pointer",children:[(0,r.jsx)("input",{type:"checkbox",name:ee,checked:a.value,onChange:()=>{n.setTouched(!0,!1),n.setValue(!a.value)}
1,"aria-invalid":i,className:$()("_1kxtt0k0",{_1kxtt0k1:i})}),(0,r.jsx)(V.A,{variant:"medium",children:e("discount-card.form.consent.immediateExecution")})]}),s&&(0,r.jsx)(L.A,{pl:"32px",children:(0,r.jsx)(Q.A,{href:s,endIcon:(0,r.jsx)(H.A,{icon:"redirect",width:"20px",height:"20px"}),children:(0,r.jsx)(V.A,{variant:"medium",color:"primary",fontWeight:"bold",children:e("discount-card.form.consent.cgvLink",{brand:(0,X.LV)()})})})}),a.touched&&a.error&&(0,r.jsx)(V.A,{variant:"small",color:"redError",children:e(a.error)})]})};var ea=a(18996),er=a.n(ea);let en=N().bind(er()),es="discountCardNumber[0].cardNumber",ei=e=>{var t,a,s,i;let{isFirstPurchase:l,cardType:o,notificationCardInfoInputRef:c}=e,{t:d}=(0,_.B)([x.NS.DiscountCardFunnel]),u=(0,W.Y)(),{values:p}=(0,O.j7)(),[,,h]=(0,O.Mt)(es),g=(0,n.getPrefixFromCardId)(o),v=(0,n.getCardPattern)(o),y=null!=(t=null==g?void 0:g.replace(/\s/g,""))?t:"",j=String(null!=(a=null==(i=p.discountCardNumber)||null==(s=i[0])?void 0:s.cardNumber)?a:""),b=y&&j.startsWith(y)?j.slice(y.length):j,A=(0,f.useMemo)(()=>{var e;if(l)return;let t=p.passenger;if(!(null==(e=t.discountCards)?void 0:e.length))return;let a=(0,G.ns)(t.discountCards,o);if(!(null==a?void 0:a.expirationDate))return;let r=new Date(a.expirationDate);return r>new Date?r:void 0},[l,p.passenger,o]);return(0,r.jsxs)("div",{className:en("discount-card-info-form-container"),children:[(0,r.jsxs)(M.A,{title:d("discount-card.form.card.info"),children:[(0,r.jsxs)(L.A,{d:"flex",flexDirection:"column",gap:"16px",children:[A&&(0,r.jsx)(V.A,{variant:"small",color:"orange",as:"p",children:d("discount-card.form.card.expirationInfo",{expirationDate:(0,K.GP)(A,"d MMMM yyyy",{locale:Y.Qj[u]})})}),!l&&(0,r.jsx)(z.Ay,{type:"tel",name:es,placeholder:d("discount-card.form.card.placeholder_".concat(o)),label:d("discount-card.form.card.number"),displayError:!0,autoComplete:"off",prefix:g,pattern:v,maxLength:17,value:b,onChange:e=>{let t=e.target.value.replace(/\s/g,"");h.setValue(t?"".concat(y).concat(t):"")}}),(0,r.jsx)(U.A,{name:"startingDate",label:d("discount-card.form.card.validity")}),(0,r.jsx)(V.A,{variant:"small",color:"grey3",as:"p",children:d("discount-card.form.validity")})]}),(0,r.jsx)("div",{ref:c,children:(0,r.jsx)(q.A,{place:m.ME.InfoCardInput,namespaces:[x.NS.PaymentForm,x.NS.DiscountCardFunnel],noMargin:!0})})]}),(0,r.jsx)(B.A,{mb:"32px",children:(0,r.jsx)(et,{})})]})};var el=a(42895),eo=a(90257),ec=a(13213),ed=a(71756),eu=a(52840),ep=a(59419),eh=a(12852);let em=e=>{if(!e)return;let t=Number(e.day),a=Number(e.month),r=Number(e.year);if(t>0&&a>0&&r>=1e3)return(0,eh.Lu)({day:t,month:a,year:r})},ex=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Date,a=em(e);return!!a&&(0,ep.getAgeAtDate)(a,t)>=60},eg=function(e,t){var a;let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Date,n=em(e);if(!n)return;let s=(0,ep.getAgeAtDate)(n,null!=(a=em(t))?a:r);if(!(s<58)&&!(s>=60))return s+1<60?{kind:"fullYear"}:{kind:"untilSixty",validUntil:new Date(Date.UTC(n.getFullYear()+60,n.getMonth(),n.getDate()-1))}},ev=e=>{let{cardType:t,birthday:a,startingDate:n}=e,{t:s}=(0,_.B)([x.NS.DiscountCardFunnel]),i=(0,W.Y)();if(!(0,G.NN)(t))return null;let l=eg(a,n);return l?"fullYear"===l.kind?(0,r.jsx)(eo.A,{variant:eo.V.Info,message:s("discount-card.form.avantageAdulte.validity.fullYear")}):(0,r.jsx)(eo.A,{variant:eo.V.Warning,message:s("discount-card.form.avantageAdulte.validity.untilSixty",{date:(0,g.G8)(l.validUntil,i)})}):null};var ey=a(31718),ef=a(37614),e_=a(98879),ej=a(91869),eb=a(62034),eA=a(83582),eC=a(70719),eS=a(41175),eE=a.n(eS);let eD=N().bind(eE()),eN=e=>{let{initialSelected:t,onSubmit:a,onClose:s,headingText:l}=e,{t:o}=(0,_.B)([x.NS.PassengerForm,x.NS.Searchbar]),[c,d]=(0,f.useState)(t),[u,p]=(0,f.useState)(!1),[h,m]=(0,f.useState)(!1),{data:g,refetch:v}=(0,i.EG)(),{isVirtualKeyboardOpen:y}=(0,eA.A)(),j=async e=>{try{m(!0),(0,eC.hZ)(e)||(e.onLap=!1);let t=await eb.Z.addUserPassenger({passenger:e});t.success?(v(),d(t.newPassenger),m(!1)):console.error(t),p(!1)}catch(e){console.error(e),m(!1)}},b=(0,f.useRef)(null);return g?(0,r.jsx)(E.A,{headingText:l,onClose:s,stickyButton:!y&&(u?(0,r.jsx)(e_.A,{fullWidth:!0,isLoading:h,onClick:async()=>{var e;
1return null==(e=b.current)?void 0:e.submitForm()},children:o("Continuer")}):(0,r.jsx)(L.A,{d:"flex",flexDirection:"column",gap:"12px",children:(0,r.jsx)(e_.A,{fullWidth:!0,onClick:()=>void(c&&(a(c),s())),isLoading:h,children:o("Continuer")})})),hasBlueBackground:!0,children:(0,r.jsxs)("div",{className:eD("select-passengers-container"),children:[(0,r.jsx)(B.A,{children:g.map(e=>{let t=(null==c?void 0:c.id)===e.id;return(0,r.jsx)(ef.A,{passenger:e,onClick:()=>d(e),isSelected:t,displayElements:{forms:!1}},e.id)})}),(0,r.jsx)(B.A,{p:"0",mt:"8px",children:(0,r.jsx)(e_.A,{onClick:()=>p(!0),variant:"unstyled",isLoading:h,fullWidth:!0,children:(0,r.jsxs)(L.A,{d:"flex",alignItems:"center",justifyContent:"space-between",p:"16px",children:[(0,r.jsxs)(L.A,{d:"flex",alignItems:"center",gap:"16px",children:[(0,r.jsx)(H.A,{icon:"addPassenger"}),(0,r.jsx)(V.A,{variant:"medium",fontWeight:"semibold",children:o("Ajouter un passager")})]}),(0,r.jsx)(H.A,{icon:"plus",height:"24px",width:"24px",color:"textPrimary"})]})})}),u&&(0,r.jsx)(B.A,{mt:"8px",children:(0,r.jsx)(ej.M,{title:o("PASSENGER_NB",{count:g.length+1}),onSubmit:j,formikRef:b,setShowAddPassenger:p,displayDiscountCard:!1,displayToddlerOnLap:!1,isSexRequired:(0,n.isGenderRequiredForProviders)([n.ProviderId.SNCF])})})]})}):null},ew=N().bind(eE()),eP=e=>{var t,a;let{cardType:n,isPurchase:s,passengers:i,passengerId:l}=e,[o,c]=(0,f.useState)(!0),[d,u]=(0,f.useState)(()=>{var e;return l&&null!=(e=i.find(e=>e.id===l))?e:i[0]}),{setFieldValue:p,errors:h,setErrors:m}=(0,O.j7)(),{t:g}=(0,_.B)([x.NS.PassengerForm]),v=g(s?"DCPF_SELECT_PASSENGER_PURCHASE":"DCPF_SELECT_PASSENGER_RENEWAL",{discountCardName:G.xG[n]});return((0,f.useEffect)(()=>{var e;if(d&&(p("passenger",d,!1),m({passenger:void 0}),!s&&(null==(e=d.discountCards)?void 0:e.length))){let e=(0,G.ns)(d.discountCards,n);if((null==e?void 0:e.cardNumber)&&p("discountCardNumber",[{cardNumber:e.cardNumber}],!1),null==e?void 0:e.expirationDate){let t=new Date(e.expirationDate),a=t>new Date?t:new Date;p("startingDate",{day:a.getDate(),month:a.getMonth()+1,year:a.getFullYear()},!1)}}},[d,s]),i.length)?(0,r.jsxs)(r.Fragment,{children:[d&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ef.A,{passenger:d,onClick:()=>c(!0),isSelected:!0}),(!!(null==(t=h.passenger)?void 0:t.birthday)||!d.birthday)&&(0,r.jsx)(U.A,{name:"passenger.birthday",label:g("Date de naissance")}),(!!(null==(a=h.passenger)?void 0:a.email)||!d.email)&&(0,r.jsx)(ec.A,{name:"passenger.email",placeholder:g("PLACEHOLDER_MAIL"),label:g("Email")}),(0,r.jsx)("hr",{className:ew("passenger-info-separator")})]}),(0,r.jsx)(ey.a,{width:"100%",d:"flex",justifyContent:"center",children:(0,r.jsx)(ey.$,{variant:"secondary",fullWidth:!0,onClick:()=>c(!0),children:g(d?"SELECT_ANOTHER_PASSENGER":"SELECT_PASSENGER")})}),o&&(0,r.jsx)(eN,{headingText:v,initialSelected:d,onSubmit:u,onClose:()=>c(!1)})]}):null},eI=e=>{let{cardType:t,isPurchase:a,passengerId:s,cardSlug:l}=e,{t:o}=(0,_.B)([x.NS.DiscountCardFunnel,x.NS.PassengerForm]),{auth:c,checkedAuth:d}=(0,eu.As)(),{data:u,refetch:p}=(0,i.EG)(),[h,g]=(0,f.useState)(!0),{values:v}=(0,O.j7)(),y=v.passenger,j=(0,f.useMemo)(()=>{var e;return null==(e=y.discountCards)?void 0:e.some(e=>{var a;return(null==(a=e.cardType)?void 0:a.id)===t})},[t,y]);if((0,f.useEffect)(()=>{let e=async()=>{c&&await p(),g(!1)};d&&e()},[c,d,p]),h)return(0,r.jsx)(el.A,{});let b=(0,r.jsx)(ev,{cardType:t,birthday:y.birthday,startingDate:v.startingDate});return(0,r.jsx)(M.A,{title:o("discount-card.form.card.holder"),children:(null==u?void 0:u.length)?(0,r.jsxs)(L.A,{d:"flex",flexDirection:"column",gap:"12px",children:[a&&j&&(0,r.jsx)(eo.A,{variant:eo.V.Warning,message:o("PASSENGER_ALREADY_HAS_CARDTYPE",{cardType:o("discount-card.card.title",{context:l})})}),(0,r.jsx)(eP,{cardType:t,passengers:u,isPurchase:a,passengerId:s}),b]}):(0,r.jsxs)(L.A,{d:"flex",flexDirection:"column",gap:"16px",children:[(0,n.isGenderRequiredForProviders)([n.ProviderId.SNCF])&&(0,r.jsx)(ed.A,{name:"passenger.sex"}),(0,r.jsx)(z.Ay,{label:o("Pr\xe9nom",{ns:x.NS.PassengerForm}),type:"text",name:"passenger.firstName",placeholder:o("PLACEHOLDER_NAME",{ns:x.NS.PassengerForm}),autoComplete:"given-name",maxLength:50,capitalize:!0}),(0,r.jsx)(z.Ay,{label:o("Nom",{ns:x.NS.PassengerForm}),type:"text",name:"passenger.lastName",placeholder:o("PLACEHOLDER_SURNAME",{ns:x.NS.PassengerForm}),autoComplete:"family-name",maxLength:50,capitalize:!0}),(0,r.jsx)(U.A,{name:"passenger.birthday",label:o("Date de naissance")}),b,(0,r.jsx)(ec.A,{name:"passenger.email",placeholder:o("PLACEHOLDER_MAIL",{ns:x.NS.PassengerForm}),label:o("Email",{ns:x.NS.PassengerForm})}),(0,r.jsx)(q.A,{place:m.ME.PassengersInput,namespaces:[x.NS.PassengerForm]})]})})};var eT=a(15200),ek=a(51135),eR=a(23803);
1let eO="discount-card.form.consent.required",eF=e=>{let t,{title:a,isPurchase:s,onSubmit:i,formValues:l,isConfirmed:o=!1,isClickable:c=!1,isOpen:d=!0,handleClick:u,notificationCardInfoInputRef:p,cardType:h,passengerId:m,cardSlug:g}=e,{t:v}=(0,_.B)([x.NS.DiscountCardFunnel]);return(0,r.jsx)(k.A,{clickable:c,open:d,confirmed:o,title:a,handleClick:u,children:o?(null==l?void 0:l.passenger)?(0,r.jsx)(R.A,{passenger:l.passenger,noIdentityFields:!0,noDiscountCard:!0,displayAddressInfos:!0}):null:(0,r.jsx)(O.l1,{initialValues:l?{...l}:{startingDate:{day:0,month:0,year:0},discountCardNumber:void 0,termsConsent:!1,passenger:{sex:void 0,firstName:"",lastName:"",birthday:{day:0,month:0,year:0},email:"",address:{street:"",city:"",zipPostCode:"",country:{code:"",displayName:""}}}},onSubmit:i,validationSchema:eR.Ik().shape({startingDate:(t=(0,ek.w)(!0),(0,G.NN)(h)?t.test("Avantage Adulte starts before sixty","AVANTAGE_ADULTE_START_AFTER_SIXTY_ERROR",function(e){var t;let a,r,n=null==(t=this.parent.passenger)?void 0:t.birthday;return ex(n)||(a=em(n),r=em(e),!a||!r||60>(0,ep.getAgeAtDate)(a,r))}):t),termsConsent:eR.lc().oneOf([!0],eO).required(eO),discountCardNumber:s?(0,eT.dK)(n.ProviderId.SNCF):(0,eT.dK)(n.ProviderId.SNCF).required(),passenger:eR.Ik({sex:(0,eT.ji)((0,n.isGenderRequiredForProviders)([n.ProviderId.SNCF])),firstName:(0,eT.KT)().required(),lastName:(0,eT.KT)().required(),birthday:(0,eT.Qz)().required(),email:(0,eT.jy)(!0).required()})}),children:(0,r.jsxs)(O.lV,{children:[(0,r.jsx)(F.E,{variant:"medium",as:"p",marginTop:"12px",marginBottom:"16px",children:v("discount-card.form.explanation")}),(0,r.jsx)(eI,{cardType:h,isPurchase:s,passengerId:m,cardSlug:g}),(0,r.jsx)(ei,{isFirstPurchase:s,cardType:h,notificationCardInfoInputRef:p}),(0,r.jsx)("button",{id:"submit-form-button",type:"submit",style:{display:"none"}})]})})})};var eL=a(11306),eM=a(45608),eV=a(71863),eB=a(6245),eq=a.n(eB);let ez=N().bind(eq()),eU=e=>{let{onChange:t,isPurchase:a}=e,{t:n}=(0,_.B)([x.NS.DiscountCardFunnel]),s=[{label:n("discount-card.option.buy"),value:"true"},{label:n("discount-card.option.renewal"),value:"false"}];return(0,r.jsx)(M.A,{children:(0,r.jsx)("div",{className:ez("discount-card-purchase-type"),children:(0,r.jsx)("div",{className:ez("purchase-type-content"),children:(0,r.jsx)(eV.A,{options:s,onValueChange:e=>t("true"===e),value:String(a)})})})})},eG=e=>{let{cardSlug:t,title:a,isPurchase:n,handleOptionOnChange:s,cardPrice:i,isConfirmed:l=!1,isClickable:o=!1,isOpen:c=!0,handleClick:d}=e;return(0,r.jsxs)(k.A,{clickable:o,open:c,confirmed:l,title:a,handleClick:d,children:[(0,r.jsx)(eU,{onChange:s,isPurchase:n}),(0,r.jsx)(eM.A,{cardSlug:t,cardPrice:i})]})},eW={[n.DiscountCardIdValues.SncfAvantageSenior]:"carte-avantage-senior",[n.DiscountCardIdValues.SncfAvantageJeune]:"carte-avantage-jeune",[n.DiscountCardIdValues.SncfAvantageAdulte]:"carte-avantage-adulte",[n.DiscountCardIdValues.SncfLiberte]:"carte-liberte"},eY=[n.DiscountCardIdValues.SncfAvantageSenior,n.DiscountCardIdValues.SncfAvantageJeune,n.DiscountCardIdValues.SncfAvantageAdulte,n.DiscountCardIdValues.SncfLiberte],eK=e=>eY.some(t=>t===e.id),eH=e=>{var t;let{discountCardDetails:a,cardSlug:A,locale:S}=e,{t:E}=(0,_.B)([x.NS.DiscountCardFunnel]),D=(0,j.wA)(),N=(0,y.useRouter)(),w=a.id,P=N.query.activeStep?parseInt(N.query.activeStep):1,I=N.query.passengerId?parseInt(N.query.passengerId):void 0,k="renewal"===N.query.type,[R,O]=(0,f.useState)(!1),[F,L]=(0,f.useState)(!0),[M,V]=(0,f.useState)(!1),[B,q]=(0,f.useState)(!1),[z,U]=(0,f.useState)(!1),[G,W]=(0,f.useState)(),Y=(0,f.useMemo)(()=>null==G?void 0:G.price,[G]),[K,H]=(0,f.useState)(!0),Q=(0,f.useRef)(null),[Z,X]=(0,f.useState)(),[J,$]=(0,f.useState)(),[ee,et]=(0,f.useState)();(0,f.useEffect)(()=>{(async()=>{W(await h.N.getCardDetails(w,S)),L(!1)})()},[w,S]),(0,f.useEffect)(()=>{(async()=>{!R&&(P>3||P<1||3===P&&!ee)&&(L(!0),await N.replace("/".concat(S,"/discount-card/").concat(A)),L(!1))})()},[P,A,ee,R,S,N]),(0,f.useEffect)(()=>{k&&H(!1)},[k]);let ea=(0,f.useCallback)((e,t)=>{switch(e){case 1:V(t);break;case 2:q(t)}},[]),er=(0,f.useCallback)(async()=>{ea(P,!1);let e=P+1,t=N.query.passengerId?"&passengerId=".concat(N.query.passengerId):"",a=K?"":"&type=renewal";await N.push("/".concat(S,"/discount-card/").concat(A,"/?activeStep=").concat(e).concat(t).concat(a),void 0,{shallow:!0})},[P,ea,N,A,S,K]),en=(0,f.useCallback)(e=>H(e),[]),es=(0,f.useCallback)(async e=>{try{var t,a,r,s,i;D((0,m.VR)(m.ME.PassengersInput,!1)),D((0,m.VR)(m.ME.InfoCardInput,!1)),O(!0),$(e);let l=e.passenger;l.locale=S;let o={locale:S,cardType:w,providerId:n.ProviderId.SNCF,startingDate:e.startingDate,purchaseType:K?n.DiscountCardPurchaseType.CREATION:n.DiscountCardPurchaseType.RENEWAL,cardNumber:K||null==(t=e.discountCardNumber)?void 0:t[0].cardNumber.toString(),passenger:l,price:Y},c=await h.N.createDraft(o);if(!1===c.success&&(null==c?void 0:c.suggestedDiscountCardId))X(null==c?void 0:c.suggestedDiscountCardId),U(!0);else if(!1===c.success){let{errorMessage:e,maxDate:t}=c,n=!e.includes("discount-card.error.age")&&!e.includes("discount-card.error.invali
1d")&&!e.includes("discount-card.error.departure");if(D((0,m.VR)(n?m.ME.InfoCardInput:m.ME.PassengersInput,!0,m.VL.Error,E(e),{date:t?(0,g.G8)(new Date(t),S):void 0})),n){let e=window.innerHeight,t=null!=(a=null==(s=Q.current)?void 0:s.offsetTop)?a:0,n=null!=(r=null==(i=Q.current)?void 0:i.offsetHeight)?r:0;(0,v.VG)({top:t-(e-n)/2,behavior:"smooth"})}else(0,v.VG)({top:document.body.scrollHeight,behavior:"smooth"})}else et(c.encodedBookingId),await er();O(!1)}catch(e){console.error(e),D((0,m.VR)(m.ME.PassengersInput,!0,m.VL.Error,"ERROR_TRY_AGAIN")),(0,v.VG)({top:document.body.scrollHeight,behavior:"smooth"})}finally{O(!1)}},[D,S,w,K,Y,er,E,Q]),ei=(0,f.useCallback)(async()=>{var e;if(!Z)return;let t=null!=(e=eW[Z])?e:"";L(!0),await N.push("/".concat(S,"/discount-card/").concat(t)),L(!1),M||V(!0),z&&U(!1)},[N,S,Z,z,M]),el=(0,f.useCallback)(async e=>{if(!ee)throw Error("Encoded booking ID is not set");return h.N.retrieveAxeptaEncodedData(ee,e)},[ee]);return(0,r.jsx)(u.A,{idName:"discount-card-purchase-funnel-body",handleBack:()=>{document.referrer.includes(window.location.origin)?N.back():N.push("/".concat(S===n.LOCALE.fr?S:"en","/train/SNCF/carte-avantage"))},locale:S,children:(0,r.jsx)(s.A,{children:(0,r.jsx)(i.$5,{children:(0,r.jsx)(l.r_,{children:F||void 0===Y?(0,r.jsx)(p.A,{children:(0,r.jsx)(C,{})}):(0,r.jsx)(d.G,{buttons:(0,r.jsx)(b.A,{activeStep:P,handleOptionContinueClick:er,handleFormContinueClick:()=>{var e;return null==(e=document.getElementById("submit-form-button"))?void 0:e.click()},cardPrice:Y,isLoading:R}),displayButtons:3!==P,fullHeight:!0,children:(0,r.jsxs)(p.A,{children:[(0,r.jsx)(eG,{cardSlug:A,isPurchase:K,handleOptionOnChange:en,title:E("discount-card.option.title"),cardPrice:Y,isClickable:P>1,isConfirmed:P>1,isOpen:M||1===P,handleClick:()=>V(!M)}),P>=2&&(0,r.jsx)(eF,{isPurchase:K,title:E("discount-card.form.title"),formValues:J,isClickable:P>2,isConfirmed:P>2,isOpen:B||2===P,handleClick:()=>q(!B),onSubmit:es,notificationCardInfoInputRef:Q,cardType:w,passengerId:I,cardSlug:A}),P>=3&&ee&&(0,r.jsx)(c.tR,{getEncodedDataRequest:el,children:(0,r.jsx)(o.ts,{children:(0,r.jsx)(eL.A,{title:E("PAIEMENT",{ns:x.NS.PaymentForm}),price:Y,isClickable:!1,isOpen:3===P,encodedBookingId:ee,locale:S,cardTypeUrlParam:A,company:null==G?void 0:G.company})})}),z&&(0,r.jsx)(T,{onClose:()=>U(!1),cardSlug:A,suggestedCardType:null==(t=Object.entries(n.DiscountCardIdValues).find(e=>{let[,t]=e;return t===Z}))?void 0:t[0],onClick:ei})]})})})})})})}},41175:e=>{e.exports={"select-passengers-container":"DiscountCardSelectPassenger_select-passengers-container__k1tCV",separator:"DiscountCardSelectPassenger_separator__xYY17","select-passengers":"DiscountCardSelectPassenger_select-passengers__c7eJF","select-passenger":"DiscountCardSelectPassenger_select-passenger__5xcpA","add-passengers-container":"DiscountCardSelectPassenger_add-passengers-container__pUwVB",action:"DiscountCardSelectPassenger_action__ucKeF","passenger-info-separator":"DiscountCardSelectPassenger_passenger-info-separator__zJFH8"}},44250:(e,t,a)=>{"use strict";a.d(t,{G:()=>E});var r=a(80263),n=a(95217),s=a.n(n),i=a(36195),l=a(69312),o=a.n(l);let c=s().bind(o()),d=e=>{let{children:t}=e;return(0,r.jsx)("div",{className:c("fixed-buttons-content"),children:t})};var u=a(60829),p=a(53239);let h=s().bind(o()),m=e=>{let{children:t,fullHeight:a}=e,[n,s]=(0,p.useState)(!1);return(0,p.useEffect)(()=>{s(!!document.getElementById("bottom-nav-bar"))},[]),(0,r.jsx)("div",{className:h("fixed-buttons-flex",{"with-bottom-nav":n,"full-height":a}),children:t})};var x=a(36775),g=a(94638),v=a(9556),y=a(34120),f=a(44915),_=a(57569),j=a.n(_);let b=s().bind(j()),A=e=>{let{companies:t}=e,{t:a}=(0,g.B)([f.NS.Common]),n=(0,y.L0)();return(0,r.jsxs)(x.a,{d:"flex",alignItems:"center",justifyContent:"space-between",marginTop:"16px",children:[(null==t?void 0:t.length)?(0,r.jsxs)("div",{className:b("reassurance-payment-companies"),children:[(0,r.jsx)(x.a,{fontSize:{mobile:"11px",tablet:"13px"},color:"textPrimary",fontWeight:"semibold",marginLeft:"4px",whiteSpace:"nowrap",children:a("AUTHORIZED_AGENCY")}),(0,r.jsx)(x.a,{d:"flex",alignItems:"center",gap:"8px",marginLeft:"8px",children:t.slice(0,n?1:t.length).map(e=>(0,r.jsx)(v.v,{displayName:e.displayName,logoName:e.logoName},e.id))})]}):(0,r.jsxs)(x.a,{d:"flex",alignItems:"center",children:[(0,r.jsx)(x.I,{icon:"lock",height:"12px",width:"12px"}),(0,r.jsx)(x.a,{fontSize:{mobile:"11px",tablet:"13px"},color:"textPrimary",fontWeight:"semibold",marginLeft:"4px",children:a("LOLLAPALOOZA_REASSURANCE")})]}),(0,r.jsxs)(x.a,{d:"flex",alignItems:"center",gap:"4px",children:[(0,r.jsx)(x.I,{icon:"trustRating",width:"68px",height:"16px"}),(0,r.jsx)(x.a,{fontSize:{mobile:"11px",tablet:"13px"},color:"textPrimary",fontWeight:"semibold",whiteSpace:"nowrap",children:a("LOLLAPALOOZA_REASSURANCE_TRUSTPILOT")})]})]})},C=s().bind(o()),S=e=>{let{buttons:t,onBack:a,children:n,displayButtons:s,displayBackArrow:l,isSticky:o=!0,displayReassurancePayment:c=!1,buttonInTickets:p,hideButtonsOnMobile:h=!1,companies:x,fullHeight:g=!1}=e,v=(0,u.M)();return v?(0,r.jsxs)(m,{fullHeight:g,children:[(0,r.jsxs)(d,{children:[n,a&&l&&(0,r.jsx)(i.A,{onBack:a})]}),(0,r.jsxs)("div",{className:C("fixed-buttons-wrapper",o?"":"notSticky",h?"hideButtonsOnMobile":""),children:[!p&&s&&t&&(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:C("fixed-buttons-wrapper-inner"),children:[t,c&&(0,r.jsx)("div",{className:C("reassurance-payment-container"),children:(0,r.jsx)(A,{companies:x})})]})}),(0,r.jsx)("div",{ref:v,className:C("fixed-buttons-wrapper-inner")}),!t&&s&&c&&(0,r.jsx)(r.Fragment,{children:c&&(0,r.jsx)("div",{className:C("reassurance-payment-container-outside"),children:(0,r.jsx)(A,{companies:x})})})]})]}):null},E=e=>(0,r.jsx)(u.J,{children:(0,r.jsx)(S,{...e})})},45608:(e,t,a)=>{"use strict";a.d(t,{A:()=>m});var r=a(80263),n=a(30640),s=a(50343),i=a(44915),l=a(95217),o=a.n(l),c=a(53239),d=a(94638),u=a(62338),p=a.n(u);let h=o().bind(p()),m=e=>{let{cardSlug:t,cardPrice:a}=e,{t:l}=(0,d.B)(i.NS.DiscountCardFunnel),o=(0,s.T)(),[u,p]=(0,c.useState)([]),m=l("discount-card.card.advantages.list",{context:t,returnObjects:!0});return(0,c.useEffect)(()=>{try{let e=JSON.parse(m);p(e)}catch(e){console.error("Could not parse advantages list")}},[m]),(0,r.jsx)(n.Z,{children:(0,r.jsx)("div",{className:h("discount-card-presentation"),children:(0,r.jsxs)("div",{className:h("presentation-content"),children:[(0,r.jsxs)("div",{className:h("presentation-header"),children:[(0,r.jsx)(n.E,{color:"primaryDarker",variant:"h3",fontWeight:"semibold",as:"h2",lineHeight:"8",children:l("discount-card.card.title",{context:t})}),(0,r.jsx)("div",{className:h("presentation-sub-header"),children:(0,r.jsxs)(n.E,{variant:"large",fontWeight:"medium",as:"h3",lineHeight:"short",children:[void 0!==a&&o(a,!1)+" ⢠",l("discount-card.card.duration",{context:t}),"carte-liberte"!==t&&(0,r.jsxs)(r.Fragment,{children:[" ⢠",l("discount-card.card.age",{context:t})]})]})})]}),(0,r.jsx)(n.E,{variant:"large",color:"goodGreen",fontWeight:"semibold",as:"h4",children:l("discount-card.card.advantage.title",{context:t})}),(0,r.jsx)("div",{className:h("presentation-advantages-list"),children:u.map((e,t)=>(0,r.jsxs)(n.E,{variant:"medium",as:"p",color:"grey3",children:["⢠",e]},t))})]})})})}},47591:(e,t,a)=>{"use strict";a.d(t,{TO:()=>d,r_:()=>u});var r=a(80263),n=a(17343),s=a(65708),i=a(53239),l=a(46905),o=a(20110);let c=i.createContext(void 0),d=()=>{let e=i.useContext(c);if(void 0===e)throw Error("useDiscountCardPurchaseConfirmation must be used within a DiscountCardPurchaseConfirmationProvider");return e},u=e=>{let{children:t}=e,a=(()=>{var e,t;
1let a=(0,s.useRouter)(),r=n.LOCALE[null==(e=a.query)?void 0:e.locale],c=null==(t=a.query)?void 0:t.slug,[d,u]=(0,i.useState)(!1),[p,h]=(0,i.useState)(!0),[m,x]=(0,i.useState)(),[g,v]=(0,i.useState)(),[y,f]=(0,i.useState)(),_=(0,i.useMemo)(()=>null==g?void 0:g.cardNumber,[g]),j=(0,i.useMemo)(()=>null==g?void 0:g.cardType,[g]),b=(0,i.useMemo)(()=>null==g?void 0:g.passenger,[g]),A=(0,i.useMemo)(()=>null==g?void 0:g.expirationDate,[g]),C=(0,i.useMemo)(()=>null==g?void 0:g.purchaseType,[g]);return{handleConfirmPurchase:(0,i.useCallback)(async(e,t,s,i)=>{u(!0);try{let d=await o.N.authorizePurchase(e,{displayedPrice:t,method:s});if(!1===d.success){let e=(0,l.SK)(d.reason,n.PurchaseFunnelType.DiscountCard);throw Error(e.message)}if((await o.N.purchaseDiscountCard(e,{paymentMethod:s,tokenOrOrderId:i})).success)await a.replace("/".concat(r,"/discount-card/").concat(c,"/confirm/").concat(e));else throw Error()}catch(e){var d,p;e instanceof Error&&x((null==e||null==(d=e.message)?void 0:d.includes("BOOKING_"))?e.message:null==(p=(0,l.SK)(void 0,n.PurchaseFunnelType.DiscountCard))?void 0:p.message)}finally{u(!1)}},[c,r,a]),purchaseErrorNotification:m,setPurchaseErrorNotification:x,fetchDiscountCardDetails:(0,i.useCallback)(async e=>{v(await o.N.getPurchaseDetails(e)),f((await o.N.getDiscountCardPdfUrl(e)).url),h(!1)},[]),cardNumber:_,cardType:j,cardHolder:b,expirationDate:A,pdfUrl:y,purchaseType:C,isConfirming:d,isPending:p}})();return(0,r.jsx)(c.Provider,{value:a,children:t})}},50914:()=>{},51135:(e,t,a)=>{"use strict";a.d(t,{V:()=>u,w:()=>c});var r=a(74498),n=a(74735),s=a(23803),i=a(15200),l=a(12852),o=a(8275);let c=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0,a=s.Ik({day:s.ai().typeError(i.a).required(i.a).min(1,i.a).max(31,i.a).test("day valid",i.a,function(e){let{year:t,month:a}=this.parent;return(0,l.pc)(t,a,e)}).typeError(),month:s.ai().typeError(i.AD).required(i.AD).min(1,i.AD).max(12,i.AD),year:s.ai().typeError(i.tM).required(i.tM).test("length",i.tM,e=>(null==e?void 0:e.toString().length)===4)}).test("Discount card in the future","La date doit \xeatre dans le futur",function(e){return!!e&&((0,r.c)((0,l.Lu)(e))||(0,n.G)((0,l.Lu)(e)))}).test("Discount card before departure","La date doit \xeatre avant le d\xe9part",function(e){return!e||!t||(0,l.Lu)(e).getTime()<t.getTime()});return e&&(a=a.required()),a},d=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return s.Ik().shape({passengerId:s.ai().required(),crossSellOption:s.Yj().oneOf(Object.values(o.UK)).required("CROSS_SELL_OPTION_REQUIRED"),startingDate:c(t,e)})},u=(e,t)=>s.Ik().shape({passengers:s.YO().of(s.RZ(a=>{var r;return d(t,null==(r=e.find(e=>e.id===(null==a?void 0:a.passengerId)))?void 0:r.buyDiscountCard)}))})},56003:(e,t,a)=>{"use strict";a.d(t,{o:()=>u});var r=a(80263),n=a(25164),s=a(95217),i=a.n(s),l=a(94638),o=a(24123),c=a.n(o);let d=i().bind(c()),u=e=>{let{isFavourite:t,onClick:a}=e,{t:s}=(0,l.B)();return(0,r.jsx)("button",{type:"button",className:d("favourite-button",{active:t}),onClick:a,"aria-label":s(t?"REMOVE_FROM_FAVOURITES":"ADD_TO_FAVOURITES"),children:(0,r.jsx)(n.I,{icon:t?"heartFilled":"heart",color:t?"redError":"grey2",height:"15px",width:"15px"})})}},57569:e=>{e.exports={"reassurance-payment-companies":"styles_reassurance-payment-companies__WDSxG"}},60829:(e,t,a)=>{"use strict";a.d(t,{J:()=>l,M:()=>i});var r=a(80263),n=a(53239);let s=(0,n.createContext)(null),i=()=>(0,n.useContext)(s),l=e=>{let{children:t}=e,a=(0,n.useRef)(null);return(0,r.jsx)(s.Provider,{value:a,children:t})}},62338:e=>{e.exports={"discount-card-presentation":"styles_discount-card-presentation__16xcZ","presentation-content":"styles_presentation-content__8MPFx","presentation-header":"styles_presentation-header__JWRpf","presentation-sub-header":"styles_presentation-sub-header__Zx2wi","presentation-advantages-list":"styles_presentation-advantages-list__f83RC"}},63310:(e,t,a)=>{"use strict";a.d(t,{ts:()=>o});var r=a(80263),n=a(17343),s=a(53239),i=a(47591);let l=s.createContext(void 0),o=e=>{let{children:t}=e,a=(()=>{let{handleConfirmPurchase:e}=(0,i.TO)();return{handlePaypalApprove:(0,s.useCallback)(async(t,a)=>e(t,a,n.PaymentMethod.Paypal),[e])}})();return(0,r.jsx)(l.Provider,{value:a,children:t})}},69312:e=>{e.exports={"fixed-buttons-flex":"styles_fixed-buttons-flex__ifid9","full-height":"styles_full-height___EtcO","
1with-bottom-nav":"styles_with-bottom-nav__vx8Sl","fixed-buttons-content":"styles_fixed-buttons-content__QmNPV","fixed-buttons-wrapper":"styles_fixed-buttons-wrapper__ibKQ_","app-footer":"styles_app-footer__s2C3Y",notSticky:"styles_notSticky__G_3_j","fixed-buttons-wrapper-inner":"styles_fixed-buttons-wrapper-inner__mcfzz","paypal-button":"styles_paypal-button__6WzIm","paypal-button-shape-rect":"styles_paypal-button-shape-rect__JIXtc","reassurance-payment-container":"styles_reassurance-payment-container__iG_WQ",hideButtonsOnMobile:"styles_hideButtonsOnMobile__GZd28","reassurance-payment-container-outside":"styles_reassurance-payment-container-outside__2_TPk"}},71987:e=>{e.exports={"discount-card-modal":"styles_discount-card-modal__uUhDq"}},74498:(e,t,a)=>{"use strict";a.d(t,{c:()=>s});var r=a(96697),n=a(43220);function s(e,t){var a;return(0,n.r)((0,r.w)((null==t?void 0:t.in)||e,e),(a=(null==t?void 0:t.in)||e,(0,r.w)(a,Date.now())))}},84167:(e,t,a)=>{"use strict";a.d(t,{U:()=>x,b:()=>v});var r=a(53239),n=a(88797),s=a(74196),i=a(13609),l=a(52840),o=a(80263),c=a(2936),d=a(94638),u=a(92566);let p=e=>{let{id:t}=e,{t:a}=(0,d.B)();return(0,o.jsxs)(c.az,{onClick:()=>u.oR.dismiss(t),d:"flex",alignItems:"flex-start",p:"16px",borderRadius:"lg",style:{background:"var(--color-subtle-red)",border:"0.5px solid var(--color-red-error)",width:"100%"},children:[(0,o.jsx)(c.az,{flexShrink:0,marginRight:"16px",style:{color:"var(--color-red-error)"},children:(0,o.jsx)(c.In,{icon:"heartFilledShaky",color:"redError",width:"32px",height:"32px"})}),(0,o.jsxs)(c.az,{flexGrow:1,children:[(0,o.jsx)(c.az,{marginBottom:"2px",children:(0,o.jsx)(c.EY,{variant:"small",fontWeight:"semibold",style:{color:"var(--color-red-error)"},children:a("ADDED_TO_FAVOURITES_TOAST_TITLE")})}),(0,o.jsx)(c.EY,{variant:"mini",color:"textPrimary",children:a("ADDED_TO_FAVOURITES_TOAST_TEXT")})]})]})};var h=a(62034);let m="favourite-trips",x="favourites-updated",g=e=>e.split("+").map(e=>e.slice(0,-6).split("_").map(e=>e.slice(0,30)).join("_")).join("+"),v=function(){let{onAdd:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{fullAccess:t}=(0,l.As)(),a=(0,n.jE)(),{data:c,isLoading:d}=(0,s.I)({queryKey:[m],queryFn:async()=>{var e;let t=await h.Z.getFavouriteTrips();if(!t.success)throw Error("Could not fetch favourite trips");return null!=(e=t.tripIds)?e:[]},enabled:!!t,staleTime:6e4}),v=(0,r.useMemo)(()=>null!=c?c:[],[c]),y=(0,r.useMemo)(()=>new Set(v.map(g)),[v]),f=(0,r.useCallback)(e=>y.has(g(e)),[y]),_=(0,i.n)({mutationFn:async e=>{let{tripId:t,passengerCount:a,displayedPrice:r}=e;return h.Z.addFavouriteTrip(t,a,r)},onMutate:async e=>{let{tripId:t}=e;await a.cancelQueries({queryKey:[m]});let r=a.getQueryData([m]);return a.setQueryData([m],e=>[...null!=e?e:[],t]),{previous:r}},onSuccess:()=>{(null!=e?e:()=>{u.oR.custom(e=>(0,o.jsx)(p,{id:e}),{duration:4e3})})()},onError:(e,t,r)=>{(null==r?void 0:r.previous)&&a.setQueryData([m],r.previous)},onSettled:async()=>{await a.invalidateQueries({queryKey:[m]}),window.dispatchEvent(new Event(x))}}),j=(0,r.useCallback)(e=>{let t=g(e);return v.find(e=>g(e)===t)},[v]),b=(0,i.n)({mutationFn:async e=>h.Z.removeFavouriteTrip(e),onMutate:async e=>{await a.cancelQueries({queryKey:[m]});let t=a.getQueryData([m]),r=g(e);return a.setQueryData([m],e=>(null!=e?e:[]).filter(e=>g(e)!==r)),{previous:t}},onError:(e,t,r)=>{(null==r?void 0:r.previous)&&a.setQueryData([m],r.previous)},onSettled:async()=>{await a.invalidateQueries({queryKey:[m]}),window.dispatchEvent(new Event(x))}}),A=(0,r.useCallback)((e,t,a)=>{if(f(e)){let t=j(e);t&&b.mutate(t)}else _.mutate({tripId:e,passengerCount:t,displayedPrice:a})},[f,j,_,b]);return{isFavourite:f,toggleFavourite:A,isLoading:d,favouriteCount:v.length}}},99019:(e,t,a)=>{"use strict";a.d(t,{m:()=>y});var r=a(80263),n=a(830),s=a(53239),i=a(94638),l=a(52840),o=a(84167),c=a(11127),d=a(65708),u=a(15850),p=a(55414),h=a(17836);let m=e=>{let{show:t,onClose:a}=e,n=(0,d.useRouter)(),s=(0,p.Y)(),{t:l}=(0,i.B)();
1return t?(0,r.jsxs)(u.A,{onClose:a,noHeader:!0,hasBlueBackground:!0,isSurModal:!0,children:[(0,r.jsxs)(c.az,{d:"flex",alignItems:"center",marginBottom:"24px",children:[(0,r.jsx)(c.EY,{variant:"h4",fontWeight:"semibold",color:"textPrimary",as:"h2",children:l("ADDED_TO_FAVOURITES_NOTIF_TITLE")}),(0,r.jsx)(c.az,{marginLeft:"16px",children:(0,r.jsx)(c.In,{icon:"heartFilledShaky",color:"redError",width:"24px",height:"24px"})})]}),(0,r.jsxs)(c.az,{marginBottom:"24px",children:[(0,r.jsx)(c.EY,{variant:"medium",color:"textPrimary",as:"p",marginBottom:"8px",children:l("ADDED_TO_FAVOURITES_NOTIF_TEXT_1")}),(0,r.jsx)(c.EY,{variant:"medium",color:"textPrimary",as:"p",children:l("ADDED_TO_FAVOURITES_NOTIF_TEXT_2")})]}),(0,r.jsx)(c.me,{options:[{label:l("VIEW_MY_FAVOURITES"),onClick:()=>{a(),n.push((0,h.Xm)(s))},icon:"heart"},{label:l("Retour"),onClick:a,icon:"chevron-left-outline"}]})]}):null};var x=a(50343),g=a(44915),v=a(56003);let y=e=>{let{type:t,form:a,label:c,labelIcon:d,onClick:u,price:p,roundTrip:h,passengerCount:y,isLoading:f,loadingText:_,disabled:j,displayFavouriteButton:b,tripId:A}=e,{t:C}=(0,i.B)([g.NS.Common]),S=(0,x.T)(),{fullAccess:E}=(0,l.As)(),[D,N]=(0,s.useState)(!1),{isFavourite:w,toggleFavourite:P}=(0,o.b)({onAdd:()=>N(!0)});return(0,r.jsxs)(n.az,{d:"flex",flexDirection:"column",gap:"16px",children:[void 0!==p&&!isNaN(p.amount)&&!f&&(0,r.jsxs)(n.az,{d:"flex",alignItems:"center",justifyContent:"center",pos:"relative",children:[(0,r.jsxs)(n.az,{textAlign:"center",children:[(0,r.jsx)(n.EY,{variant:"medium",children:void 0!==h&&void 0!==y?(0,r.jsx)(r.Fragment,{children:C(h?"TOTAL_ROUND":"TOTAL_OUTWARD",{count:y})}):(0,r.jsx)(r.Fragment,{children:"".concat(C("TOTAL")," : ")})}),(0,r.jsx)(n.EY,{variant:"medium",color:"primaryDarker",fontWeight:"bold",children:S(p)})]}),b&&E&&A&&(0,r.jsx)(n.az,{pos:"absolute",right:"4px",d:{mobile:"block","tablet-landscape":"none"},children:(0,r.jsx)(v.o,{isFavourite:w(A),onClick:e=>{e.stopPropagation(),A&&P(A,y,p)}})})]}),(0,r.jsxs)(n.$n,{fullWidth:!0,type:t,form:a,onClick:u,isLoading:f,loadingText:null!=_?_:C("V\xe9rification des prix"),disabled:j,children:[null!=c?c:C("Continuer"),d&&(0,r.jsx)(n.In,{icon:d,width:"24px",height:"24px"})]}),(0,r.jsx)(m,{show:D,onClose:()=>N(!1)})]})}}}]);
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.