1import{_ as j,a5 as H,cm as N,e8 as z,o as P,ec as R,t as q,ed as D,J as K}from"./jUn5Q-A0.js";import{_ as W,n as J,p as Q}from"./Yb1n4zQk.js";import{d as A,L as s,R as a,O as r,Z as k,X as p,a1 as w,I as T,x as t,H as h,W as E,v as C,o as O,w as F,M as I,e as X,y as U,c as Y,Y as b,N as S,a2 as Z}from"./JFTuL8MR.js";import{u as M}from"./BYRuk7Yy.js";import{u as G}from"./rWMyMZ9T.js";import"./CuXfEcPf.js";import"./ZE0XUaFf.js";import"./a3sj5zmn.js";import"./DNsWKQp2.js";const ee={class:"flex flex-col gap-1 min-w-0"},te={class:"text-[11px] font-medium text-light-black-700"},se={key:0,class:"text-[#a83232]","aria-hidden":"true"},re=["value"],ae=["value"],oe=["type","value","inputmode"],le={key:2,class:"text-[11px] font-medium text-[#a83232]"},ne={key:3,class:"text-[11px] text-light-black-400"},ie=A({__name:"field",props:{field:{},value:{},error:{}},emits:["update"],setup(i,{emit:e}){const c=i,y=e,v=C(()=>c.value===void 0||c.value===null?"":String(c.value));function x(g){const l=g.target.value;if(c.field.type==="number"){y("update",l===""?void 0:Number(l));return}y("update",l)}return(g,l)=>(s(),a("label",ee,[r("span",te,[k(p(i.field.label)+" ",1),i.field.required?(s(),a("span",se,"*")):w("",!0)]),i.field.type==="select"?(s(),a("select",{key:0,value:t(v),class:T(["w-full rounded-lg-default border bg-white px-3 py-2 text-sm text-primary focus:outline-none transition-colors",i.error?"border-[#a83232]":"border-gray-200 focus:border-primary"]),onChange:l[0]||(l[0]=f=>y("update",f.target.value))},[l[1]||(l[1]=r("option",{value:""},"â",-1)),(s(!0),a(h,null,E(i.field.options||[],f=>(s(),a("option",{key:f.value,value:f.value},p(f.label),9,ae))),128))],42,re)):(s(),a("input",{key:1,type:i.field.type,value:t(v),inputmode:i.field.type==="number"?"numeric":void 0,class:T(["w-full rounded-lg-default border bg-white px-3 py-2 text-sm text-primary placeholder:text-gray-400 focus:outline-none transition-colors",i.error?"border-[#a83232]":"border-gray-200 focus:border-primary"]),onInput:x},null,42,oe)),i.error?(s(),a("span",le,p(i.error),1)):i.field.help?(s(),a("span",ne,p(i.field.help),1)):w("",!0)]))}}),ce=Object.assign(ie,{__name:"AssistantField"}),de={class:"flex flex-col gap-5"},ue={class:"flex items-baseline justify-between gap-3"},pe={class:"flex items-center gap-2 px-4 py-2.5 bg-gray-50 border-b border-gray-200"},me={class:"text-xs font-semibold text-light-black-900 truncate"},xe={class:"p-4 grid grid-cols-1 sm:grid-cols-2 gap-3"},ge={key:0,class:"sm:col-span-2 rounded-lg-default border border-gray-200 p-3 flex flex-col gap-3"},fe={class:"px-1 text-[11px] font-semibold text-light-black-700"},ye={class:"font-normal text-light-black-400"},be={class:"grid grid-cols-1 sm:grid-cols-3 gap-3"},ve={key:0,class:"rounded-xl-default border border-gray-200 bg-white overflow-hidden"},_e={class:"p-4 grid grid-cols-1 sm:grid-cols-2 gap-3"},he=A({__name:"travellers",setup(i){const e=M();O(()=>{e.initTravellers(),e.validateTravellers()}),F(()=>e.retainedProviders.join(","),()=>e.validateTravellers()),F(()=>e.travellerCount,()=>e.initTravellers());const c=C(()=>e.passengerFields.filter(n=>n.group==="passport")),y=C(()=>e.passengerFields.filter(n=>n.group!=="passport")),v=C(()=>[...new Set(c.value.flatMap(n=>n.requiredBy))].join(", ")||"le transporteur"),x=n=>!Object.keys(e.travellerErrors).some(o=>o.startsWith(`travellers[${n}].`)),g=C(()=>e.travellers.filter((n,o)=>x(o)).length),l=C(()=>g.value===e.travellers.length);function f(n,o){return[n.firstname,n.lastname].filter(Boolean).join(" ").trim()||`Voyageur ${o+1}`}return(n,o)=>{const _=j,$=ce;return s(),a("div",de,[r("header",ue,[o[0]||(o[0]=r("div",{class:"flex flex-col"},[r("h2",{class:"text-md font-bold text-primary"},"Qui voyage ?"),r("p",{class:"text-[11px] text-light-black-500"}," Ces informations partent aux transporteurs pour émettre les billets. ")],-1)),r("span",{class:T(["text-[11px] font-medium tabular-nums",t(l)?"text-green-700":"text-light-black-500"])},p(t(g))+"/"+p(t(e).travellers.length)+" complet"+p(t(e).travellers.length>1?"s":""),3)]),(s(!0),a(h,null,E(t(e).travellers,(m,d)=>(s(),a("section",{key:d,class:T(["rounded-xl-default border bg-white overflow-hidden transition-colors",x(d)?"border-gray-200":"border-secondary/40"])},[r("div",pe,[r("span",{class:T(["inline-flex items-center justify-center w-5 h-5 rounded-full text-[10px] font-bold shrink-0",x(d)?"bg-green-700 text-white":"bg-gray-200 text-light-black-500"])},[x(d)?(s(),I(_,{key:0,name:"heroicons:check",class:"w-3 h-3"})):(s(),a(h,{key:1}
1,[k(p(d+1),1)],64))],2),r("span",me,p(f(m,d)),1)]),r("div",xe,[(s(!0),a(h,null,E(t(y),u=>(s(),I($,{key:u.key,field:u,value:m[u.key],error:t(e).travellerErrors[`travellers[${d}].${u.key}`],onUpdate:B=>t(e).setTraveller(d,{[u.key]:B})},null,8,["field","value","error","onUpdate"]))),128)),t(c).length?(s(),a("fieldset",ge,[r("legend",fe,[o[1]||(o[1]=k(" Pièce d'identité ",-1)),r("span",ye,"â exigée par "+p(t(v))+", les trois champs ensemble",1)]),r("div",be,[(s(!0),a(h,null,E(t(c),u=>(s(),I($,{key:u.key,field:u,value:m[u.key],error:t(e).travellerErrors[`travellers[${d}].${u.key}`],onUpdate:B=>t(e).setTraveller(d,{[u.key]:B})},null,8,["field","value","error","onUpdate"]))),128))])])):w("",!0)])],2))),128)),t(e).contactFields.length?(s(),a("section",ve,[o[2]||(o[2]=r("div",{class:"px-4 py-2.5 bg-gray-50 border-b border-gray-200"},[r("span",{class:"text-xs font-semibold text-light-black-900"},"Vos coordonnées"),r("span",{class:"ml-1 text-[11px] text-light-black-400"},"â pour la confirmation et les billets")],-1)),r("div",_e,[(s(!0),a(h,null,E(t(e).contactFields,m=>(s(),I($,{key:m.key,field:m,value:t(e).contact[m.key],error:t(e).travellerErrors[`contact.${m.key}`],onUpdate:d=>t(e).setContact({[m.key]:d})},null,8,["field","value","error","onUpdate"]))),128))])])):w("",!0)])}}}),ke=Object.assign(he,{__name:"AssistantTravellers"}),we={class:"mx-auto w-full max-w-6xl px-4 py-8 flex flex-col gap-6"},$e={class:"flex flex-col gap-1"},Ce={key:0,class:"rounded-xl-default border border-gray-200 bg-white p-8 text-center"},Ee={key:1,class:"grid grid-cols-1 lg:grid-cols-[minmax(0,380px)_minmax(0,1fr)] gap-6 items-start"},Ie={class:"lg:sticky lg:top-4 flex flex-col gap-3"},Te={class:"flex flex-col gap-6"},Be={key:1,class:"flex flex-col gap-4"},Se={key:0,class:"rounded-xl-default border border-green-700/30 bg-green-50 p-4 flex gap-3"},Fe={key:2,class:"flex items-start gap-1.5 text-xs font-medium text-[#a83232]"},Ae={key:3,class:"flex flex-col gap-2"},Le=["disabled"],V=88,Pe=A({__name:"checkout",setup(i){H({title:"Finaliser votre voyage"});const e=M(),c=N(),y=z(),v=P(),{fixed:x}=G(),g=X(x.value?`${V}px`:"0px"),l=()=>{g.value=J(Q(document),g.value,V)};F(x,()=>U(l)),O(async()=>{await e.loadBasket(),e.placedCartId&&(c.cartId=e.placedCartId,c.persistCartToLocalStorage(),await c.loadCart(),y.step=R.RESUME),l(),await U(),l(),window.addEventListener("resize",l)}),Y(()=>window.removeEventListener("resize",l));async function f(){if(!await e.placeOrder())return;const n=e.order?.cartId;n&&(c.cartId=n,c.persistCartToLocalStorage(),await c.loadCart(),y.step=R.RESUME)}return(n,o)=>{const _=j,$=q,m=W,d=ke,u=D,B=K;return s(),a("div",{class:"bg-background-component min-h-screen",style:Z({paddingTop:t(g)})},[r("div",we,[r("header",$e,[b($,{to:t(v)("/assistant"),class:"inline-flex items-center gap-1.5 text-sm text-light-black-500 hover:text-primary transition-colors w-fit"},{default:S(()=>[b(_,{name:"heroicons:chevron-left",class:"w-3.5 h-3.5"}),o[0]||(o[0]=k(" Revenir à la conversation ",-1))]),_:1},8,["to"]),o[1]||(o[1]=r("h1",{class:"text-h4 font-bold text-primary"},"Finaliser votre voyage",-1))]),!t(e).basket.length&&!t(e).placedCartId?(s(),a("div",Ce,[o[3]||(o[3]=r("p",{class:"text-md text-light-black-700"},"Votre voyage est vide.",-1)),b($,{to:t(v)("/assistant"),class:"mt-4 inline-flex px-5 py-2.5 rounded-lg-default bg-primary text-white text-sm font-semibold hover:opacity-90 transition-opacity"},{default:S(()=>[...o[2]||(o[2]=[k(" Composer un voyage ",-1)])]),_:1},8,["to"])])):(s(),a("div",Ee,[r("aside",Ie,[b(m,{readonly:!!t(e).placedCartId,cta:!1,collapsible:!1},null,8,["readonly"])]),r("section",Te,[t(e).placedCartId?t(e).order?(s(),a("div",Be,[t(e).order.retained.length?(s(),a("div",Se,[b(_,{name:"heroicons:check-circle",class:"w-5 h-5 text-green-700 shrink-0"}),o[4]||(o[4]=r("div",{class:"flex flex-col gap-1"},[r("span",{class:"text-sm font-semibold text-primary"},"Votre voyage est réservé"),r("span",{class:"text-[11px] text-light-black-600"},"Il reste à le payer pour confirmer les billets.")],-1))])):w("",!0),(s(!0),a(h,null,E(t(e).order.refused,L=>(s(),a("p",{key:L.id,class:"rounded-lg-default border border-amber-400/50 bg-amber-50 px-3 py-2.5 text-xs text-light-black-800"},p(L.message),1))),128))])):w("",!0):(s(),I(d,{key:0})),t(e).basketMessage?(s(),a("p",Fe,[b(_,{name:"heroicons:exclamation-triangle",class:"w-4 h-4 shrink-0 mt-px"}),k(" "+p(t(e).basketMessage),1)])):w("",!0),t(e).placedCartId?(s(),I(B,{key:4},{default:S(()=>[b(u)]),_:1})):(s(),a("div",Ae,[r("button",{class:"w-full inline-flex items-center justify-center gap-2 px-5 py-3 rounded-lg-default bg-primary text-white text-sm font-semibold hover:opacity-90 transition-opacity disabled:opacity-40 disabled:cursor-not-allowed",disabled:!t(e).checkoutReady||t(e).ordering,onClick:f},[b(_,{name:t(e).ordering?"heroicons:arrow-path":"heroicons:lock-closed",class:T(["w-4 h-4",t(e).ordering?"animate-spin":""])},null,8,["name","class"]),k(" "+p(t(e).ordering?"Réservation en coursâ¦":"Réserver mon voyage"),1)],8,Le),o[5]||(o[5]=r("p",{class:"text-[11px] text-light-black-400 text-center"}," La réservation bloque vos places avant le paiement : vous saurez ce qui est réellement disponible, et le montant exact, avant de payer. ",-1))]))])]))])],4)}}});
1export{Pe as default};
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.