1import{_ as oe}from"./S1VcnB0a.js";import{y as r,z as ae,A as q,c as C,o as u,a as t,b as s,w as D,H as a,d as se,t as B,I as O,_ as ne,aa as re,ai as ie,v as ue,Y as de,a0 as me,al as pe,a8 as ve,f as b,g as f,J as U,ap as k,N as S,K as g,af as ce,aR as ge,F as ye}from"./C263r544.js";import{s as L}from"./uLgEtwsc.js";import{s as m,a as fe}from"./C-IHwTTN.js";import{s as we}from"./y-YQPFD_.js";import{p as be}from"./B1tkbvRe.js";import{P as he}from"./Ch6wK1Zg.js";import"./DIgozFZO.js";import"./DkSTAEgl.js";import"./b4xJxszQ.js";import"./D_FyBQtW.js";const Ve={class:"my-4"},xe={class:"my-4 canaro-font"},_e={__name:"Orders",props:{userId:{type:Number,required:!0}},setup($){const I=O(),h=$,w=r({user_id:h.userId}),V=r([]),y=async()=>{try{const i=new URLSearchParams(w.value).toString(),d=await(await fetch(`${I.public.BACKEND_URL}/api/orders?${i}`,{method:"GET",headers:{"Content-Type":"application/json"}})).json();console.log("contenido de data order",d),d.status&&(V.value=d.before_today.data)}catch(i){console.error("Error fetching data:",i)}},T=i=>new Date(i).toLocaleString("en-US",{day:"2-digit",month:"short",year:"numeric",hour:"numeric",minute:"numeric",hour12:!0});return ae(()=>h.userId,i=>{w.value.user_id=i,y()}),q(()=>{y()}),(i,x)=>(u(),C("div",Ve,[x[0]||(x[0]=t("h2",null,"Orders",-1)),t("div",xe,[s(a(fe),{value:V.value,showGridlines:"",tableStyle:"min-width: 50rem"},{default:D(()=>[s(a(m),{field:"created_at",header:"Booking date"},{body:D(d=>[se(B(T(d.data.created_at)),1)]),_:1}),s(a(m),{field:"booking_id",header:"Order#"}),s(a(m),{field:"booking_status",header:"Booking_status"}),s(a(m),{field:"start",header:"Travel date"}),s(a(m),{field:"start_city",header:"Departure place"}),s(a(m),{field:"duration",header:"Trip duration"}),s(a(m),{field:"end_city",header:"Destination(s)"}),s(a(m),{field:"travelers_number",header:"Max Group Size"}),s(a(m),{header:"Paid by traveler"},{body:D(d=>[t("p",null,B("$"+d.data.paid),1)]),_:1})]),_:1},8,["value"])])]))}},Se={class:"overflow-hidden mb-8 main-spacing"},$e={class:"grid"},Ie={class:"col-12 lg:col-10"},Ue={class:"header-container flex align-items-center justify-content-between bg-gray-700 px-5 py-2"},ke={class:"left-section flex align-items-center"},De={class:"right-section"},Ce={class:"my-4 titleh"},Te={style:{width:"100%"}},Me={style:{"text-align":"center",width:"25%"}},Ee={style:{"text-align":"center",width:"25%"}},Le={style:{"text-align":"center"}},Pe={style:{"text-align":"center"}},Ne={style:{"text-align":"center"}},Re={style:{"text-align":"center"}},Fe={style:{width:"100%"}},Ae={style:{"text-align":"center",width:"25%"}},Be={style:{"text-align":"center",width:"25%"}},qe={style:{"text-align":"right"}},Oe={style:{display:"inline-flex","margin-right":"-28%"}},Ge={style:{"text-align":"center"}},je={style:{"text-align":"center"}},Ke={class:"calendar-wrapper"},ze={style:{"text-align":"center"}},He={class:"calendar-wrapper"},Ye={style:{padding:"auto"}},Je={class:"flex flex-row items-center space-x-2"},Qe={class:"flex flex-row items-center space-x-2"},We={class:"flex flex-row items-center space-x-2"},Xe={key:6,class:"overlay"},Ze={__name:"TravelerD",props:{isPersonalForm:{type:Boolean,default:!1}},setup($){const I=re(),h=O(),w=ie(),V=ue(),y=r(!1),T=de(),i=r(null),x=me(),d=pe(),G=ve(),P=r(`${h.public.BACKEND_URL}`),N=r(!1),j=r(!1),p=r(!1),R=r(!1),K=$,z=r([{text:"yes",id:1},{text:"no",id:2}]),l=r({travelers:1,user_log:i.value,birth:null,issue:null,expire:null}),M=n=>{if(!l.value[n])return;const e=new Date(l.value[n]),c=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),le=String(e.getDate()).padStart(2,"0");l.value[n]=`${c}-${o}-${le}`,console.log("contenido de fecha:",l.value)},E=r([]),v=r({id:0,hear:"",suscribed:0,internal_notes:""}),_=r({traveler_id:0,user_id:0}),H=r([{label:"Male",value:"male"},{label:"Female",value:"female"}]),Y=r([{label:"Mr.",value:"Mr."},{label:"Ms.",value:"Ms."},{label:"Mrs.",value:"Mrs."},{label:"Miss",value:"Miss"}]),J=async n=>{console.log("imprime id enviado:",n);const e=await G.travelerId({id:n},`${P.value}`);if(e.success){const c=e.data;_.value.traveler_id=c,d.push({path:"/account-settings",query:{userId:c}})}_.value.user_id=localStorage.getItem("user_id")},Q=async()=>{j.value=!0;try{p.value=!0;const n=await I.GetCountries("",P.value);E.value=n.data}catch{console.error("Error fetching data:","no entro")}finally{p.value=!1}},W=async()=>{const n=new URLSearchParams(_.value).toString();try{if(_.value.traveler_id){const e=await w.get(`/travelers?${n}`,{rawResponse:!0,showErrorToast:!1});l.value=e,v.value=e.user_,N.value=!0,l.value.country=Number(l.value.country)}else l.value.mail=localStorage.getItem("email"),l.value.name=localStorage.getItem("name"),l.value.user_id=localStorage.getItem("user_id");l.value.user_log=localStorage.getItem("user_id")}catch(e){console.error("Error fetching data:",e)}},F=n=>{T.require({message:"Are you sure you want to SAVE?",header:"Confirmation",iconProps:{class:"red-icon"},accept:()=>{ee()},reject:()=>{}})},X=async()=>{console.log("contenido para enviar de personal info:",l.value);const n=new URLSearchParams(l.value).toString();try{const e=await w.post(`/write-travelers?${n}`,void 0,{rawResponse:!0,errorMessage:c=>{const o=c?.data?.message;return Array.isArray(o)?o[0]:o||"Data could not be updated"},errorTitle:"Error!!"});e.success?(console.log("contenido de respuesta",e),l.value=e.data,l.value.country=Number(l.value.country),V.add({severity:"success",summary:"Success!!",detail
1:"Data Updated",life:3e3})):V.add({severity:"error",summary:"Error!!",detail:e.message[0],life:3e3})}catch(e){console.error("Error fetching data:",e)}},Z=async()=>{const n=new URLSearchParams(v.value).toString();try{const e=await w.post(`/users-travelers?${n}`,void 0,{rawResponse:!0,showErrorToast:!1});console.log("contenido de update user traveler",e)}catch(e){console.error("Error fetching data:",e)}},ee=async()=>{y.value=!0,A(),await Z(),await X(),y.value=!1},A=()=>{R.value=!0,setTimeout(()=>{R.value=!1},5e3)},te=()=>{const n=x.query.userId;_.value.traveler_id=n};return q(async()=>{p.value=!0,l.value.user_log=localStorage.getItem("user_id"),K.isPersonalForm?await J(l.value.user_log):te(),await Q(),await W(),A(),p.value=!1,y.value=!1,console.log("personal info:",l.value),console.log("countries:",E.value)}),(n,e)=>{const c=oe;return u(),C(ye,null,[t("div",Se,[t("div",$e,[t("div",Ie,[t("div",Ue,[t("div",ke,[s(a(U),{icon:"pi pi-arrow-left","aria-label":"Back",style:{height:"100px","margin-top":"-1%","margin-bottom":"-1%","margin-left":"-2%","background-color":"#82cf45"}}),e[21]||(e[21]=t("h1",{class:"canaro-font font-semibold text-white ml-3"}," Traveler Details ",-1))]),t("div",De,[s(a(U),{label:"Save",severity:"warning","aria-label":"Settings",onClick:e[0]||(e[0]=o=>F())})])]),e[41]||(e[41]=t("br",null,null,-1)),p.value?(u(),b(a(k),{key:0,mode:"indeterminate",style:{height:"6px"}})):f("",!0),t("div",Ce,[t("div",null,[e[28]||(e[28]=t("h3",null,"Personal information",-1)),t("table",Te,[t("tr",null,[e[22]||(e[22]=t("td",{style:{width:"25%"}},[t("p",null,"Title")],-1)),t("td",Me,[s(a(S),{class:"w-full md:w-15rem",style:{"margin-bottom":"2%",height:"25%"},modelValue:l.value.title,"onUpdate:modelValue":e[1]||(e[1]=o=>l.value.title=o),options:Y.value,optionLabel:"label",optionValue:"value"},null,8,["modelValue","options"])]),e[23]||(e[23]=t("td",{style:{width:"25%"}},[t("p",null,"Email")],-1)),t("td",Ee,[s(a(g),{type:"text",modelValue:l.value.mail,"onUpdate:modelValue":e[2]||(e[2]=o=>l.value.mail=o)},null,8,["modelValue"])])]),t("tr",null,[e[24]||(e[24]=t("td",null,[t("p",null,"Firt Name")],-1)),t("td",Le,[s(a(g),{type:"text",modelValue:l.value.name,"onUpdate:modelValue":e[3]||(e[3]=o=>l.value.name=o)},null,8,["modelValue"])]),e[25]||(e[25]=t("td",null,[t("p",null,"Gender")],-1)),t("td",Pe,[s(a(S),{class:"w-full md:w-15rem",style:{"margin-bottom":"2%",height:"25%"},modelValue:l.value.gender,"onUpdate:modelValue":e[4]||(e[4]=o=>l.value.gender=o),options:H.value,optionLabel:"label",optionValue:"value"},null,8,["modelValue","options"])])]),t("tr",null,[e[26]||(e[26]=t("td",null,[t("p",null,"Last Name")],-1)),t("td",Ne,[s(a(g),{type:"text",modelValue:l.value.last,"onUpdate:modelValue":e[5]||(e[5]=o=>l.value.last=o)},null,8,["modelValue"])]),e[27]||(e[27]=t("td",null,[t("p",null,"Birthdate")],-1)),t("td",Re,[s(a(L),{style:{width:"60%"},showIcon:"",showOnFocus:!1,modelValue:l.value.birth,"onUpdate:modelValue":e[6]||(e[6]=o=>l.value.birth=o),dateFormat:"yy-mm-dd",onChange:e[7]||(e[7]=()=>M("birth"))},null,8,["modelValue"])])])])]),t("div",null,[e[35]||(e[35]=t("h3",null,"Contact Information",-1)),t("table",Fe,[t("tr",null,[e[29]||(e[29]=t("td",{style:{width:"25%"}},[t("p",null,"Address")],-1)),t("td",Ae,[s(a(g),{type:"text",modelValue:l.value.address,"onUpdate:modelValue":e[8]||(e[8]=o=>l.value.address=o)},null,8,["modelValue"])]),e[30]||(e[30]=t("td",{style:{width:"25%"}},[t("p",null,"Country")],-1)),t("td",Be,[s(a(S),{modelValue:l.value.country,"onUpdate:modelValue":e[9]||(e[9]=o=>l.value.country=o),editable:"",options:E.value,optionLabel:"name",optionValue:"t_country_id",placeholder:"Select a Country",class:"w-full md:w-15rem"},null,8,["modelValue","options"])])]),t("tr",null,[e[31]||(e[31]=t("td",null,[t("p",null,"Mobile Number")],-1)),t("td",qe,[t("div",Oe,[s(a(S),{modelValue:l.value.phone_country,"onUpdate:modelValue":e[10]||(e[10]=o=>l.value.phone_country=o),options:a(be),optionLabel:"name",optionValue:"name",placeholder:"(+)",style:{height:"40px",width:"33%"}},null,8,["modelValue","options"]),s(a(g),{type:"text",modelValue:l.value.phone,"onUpdate:modelValue":e[11]||(e[11]=o=>l.value.phone=o),style:{width:"35%"}},null,8,["modelValue"])])]),e[32]||(e[32]=t("td",null,[t("p",null,"Passport")],-1)),t("td",Ge,[s(a(g),{type:"text",style:{"margin-top":"3%"},modelValue:l.value.passport,"onUpdate:modelValue":e[12]||(e[12]=o=>l.value.passport=o)},null,8,["modelValue"])])]),t("tr",null,[e[33]||(e[33]=t("td",null,[t("p",null,"Passport issue Date")],-1)),t("td",je,[t("div",Ke,[s(a(L),{style:{width:"60%"},showIcon:"",showOnFocus:!1,modelValue:l.value.issue,"onUpdate:modelValue":e[13]||(e[13]=o=>l.value.issue=o),dateFormat:"yy-mm-dd",onChange:e[14]||(e[14]=()=>M("issue"))},null,8,["modelValue"])])]),e[34]||(e[34]=t("td",null,[t("p",null,"Passport expire date")],-1)),t("td",ze,[t("div",He,[s(a(L),{style:{width:"60%"},showIcon:"",showOnFocus:!1,modelValue:l.value.expire,"onUpdate:modelValue":e[15]||(e[15]=o=>l.value.expire=o),dateFormat:"yy-mm-dd",onChange:e[16]||(e[16]=()=>M("expire"))},null,8,["modelValue"])])])])])]),t("div",Ye,[e[39]||(e[39]=t("h3",null,"Marketing Information",-1)),t("div",Je,[e[36]||(e[36]=t("p",{style:{width:"15%"}},"How did you hear about us?",-1)),s(a(g),{style:{"margin-top":"-6%",width:"60%"},modelValue:v.value.hear,"onUpdate:modelValue":e[17]||(e[17]=o=>v.value.hear=o)},null,8,["modelValue"])]),t("div",Qe,[e[37]||(e[37]=t("p",{style:{width:"15%"}},"Internal Notes",-1)),s(a(g),{style:{"margin-top":"-6%",width:"60%"},modelValue:v.value.internal_notes,"onUpdate:modelValue":e[18]||(e[18]=o=>v.value.internal_notes=o)},null,8,["modelValue"])]),t("div",We,[e[38]||(e[38]=t("p",{style:{width:"15%"}},"Subscribed",-1)),s(a(S),{style:{"margin-top":"-6%",width:"5%"},modelValue:v.value.suscribed,"onUpdate:modelValue":e[19]||(e[19]=o=>v.value.suscribed=o),options:z.value,optionLabel:"text",optionValue:"id",class:"w-full md:w-8rem"},null,8,["modelValue","options"])])]),e[40]||(e[40]=t("br",null,null,-1)),t("div",null,[s(a(U),{label:"Save",severity:"warning",class:"btnS",onClick:e[20]||(e[20]=o=>F())}),s(a(U),{label:"Delete",class:"btnS",severity:"secondary",style:{"margin-right":"15px","background-color":"white","border-color":"orangered",color:"black"}})])]),e[42]||(e[42]=t("br",null,null,-1)),p.value?(u(),b(a(k),{key:1,mode:"indeterminate",style:{height:"6px"}})):f("",!0),l.value.user_id?(u(),b(_e,{key:2,userId:l.value.user_id},null,8,["userId"])):f("",!0),e[43]||(e[43]=t("br",null,null,-1)),p.value?(u(),b(a(k),{key:3,mode:"indeterminate",style:{height:"6px"}})):f("",!0),N.value&&l.value.user_id?(u(),b(c,{key:4,userId:l.value.user_id},null,8,["userId"])):f("",!0),e[44]||(e[44]=t("br",null,null,-1)),p.value?(u(),b(a(k),{key:5,mode:"indeterminate",style:{height:"6px"}})):f("",!0),e[45]||(e[45]=t("br",null,null,-1)),y.value?(u(),C("div",Xe,[s(a(we),{class:"custom-spinner"})])):f("",!0)])])]),s(a(ce)),s(a(ge),null,{icon:D(()=>[...e[46]||(e[46]=[t("i",{class:"pi pi-exclamation-triangle red-icon"},null,-1)])]),_:1})],64)}}},et=ne(Ze,[["__scopeId","data-v-a3e4bcdb"]]),tt={class:"overflow-hidden mb-8 main-spacing"},lt={class:"grid"},ot={class:"col-12 lg:col-2"},at={class:"col-12 lg:col-10"},yt={__name:"index",setup($){return(I,h)=>(u(),C("div",tt,[t("div",lt,[t("div",ot,[s(he)]),t("div",at,[s(et)])])]))}};export{yt 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.