1import{a7 as u,a8 as t,I as h,L as f}from"#entry";const c=u("profile",{state:()=>({pending:!1,orders:{firstPageUrl:"",nextPageUrl:"",prevPageUrl:"",currentPage:1,perPage:null,from:null,path:"",data:[],to:null},archive:{isArchived:!1},profile:{data:{fullName:"",firstName:null,surName:null,email:"",messengers:{email:"",viber:"",telegram:"",whatsapp:""},phone:"",additionalPhone:"",role:null,passengersList:[],phoneConfirmed:!1},componentLogic:{hasAdditionalPhone:!1}}}),actions:{async fetchProfileInfo(){this.pending=!0;const{data:a,error:e}=await t("/profile");if(a.value){const r=a.value.data;r.additionalPhone&&(this.profile.componentLogic.hasAdditionalPhone=!0),this.profile.data=r}return this.pending=!1,{data:a.value,error:{...e.value}}},async updateUserProfile(a){this.pending=!0;const{data:e,error:r}=await t("/profile",{method:"PUT",body:a});return e.value&&(this.profile.data=e.value.data),this.pending=!1,{data:e.value,error:r.value}},async storePassenger(a){this.pending=!0;const{data:e,error:r}=await t("/profile/passengers",{method:"POST",body:a});return e.value&&(this.profile.data=e.value.data),this.pending=!1,{data:e.value,error:r.value}},async updatePassenger(a){this.pending=!0;const{data:e,error:r}=await t(`/profile/passengers/${a.id}`,{method:"PUT",body:a});return e.value&&(this.profile.data=e.value.data),this.pending=!1,{data:e.value,error:r.value}},async deletePassenger(a){this.pending=!0;const{data:e,error:r}=await t(`/profile/passengers/${a}`,{method:"DELETE"});return e.value&&(this.profile.data=e.value.data),this.pending=!1,{data:e.value,error:r.value}},async deleteAccount(){const{data:a,error:e}=await t("/profile",{method:"DELETE"});return a.value&&(this.resetProfileData(),this.resetOrdersData(),f().resetFullAuthData()),this.pending=!1,{data:a.value,error:e.value}},async getOrders(a=!1,e=null){this.pending=!0;const r={};r.archived=this.archive.isArchived=a,e&&(r.page=e);const{data:s,error:o}=await t("/profile/orders",{query:r});if(s.value){if(!e)return this.orders=s.value.data,this.pending=!1;s.value.data.data.forEach(i=>{const d=this.orders.data.find(l=>l.date===i.date);d?d.orders=d.orders.concat(i.orders):this.orders.data.push(i)}),this.orders.currentPage=s.value.data.currentPage,this.orders.nextPageUrl=s.value.data.nextPageUrl}return this.pending=!1,{data:s.value,error:o.value}},async confirmOrder(a,e=void 0){const{openModalOrderConfirmed:r,openModalOrderConfirmedError:s}=h(),{data:o,error:n}=await t(`orders/${a}/confirm`,{method:"POST",body:{token:e}});return o.value&&r(),n.value&&s(n.value.data?.message),{data:o.value,error:{...n.value}}},async cancelOrder(a){const{data:e,error:r}=await t(`orders/${a}/cancel`,{method:"POST"});return{data:e.value,error:{...r.value}}},async payOrder(a){const{data:e,error:r}=await t(`orders/${a}/pay`,{method:"POST"});return{data:e.value,error:{...r.value}}},async saveReview(a){this.pending=!0;const{data:e,error:r}=await t(`/orders/${a.orderId}/review`,{method:"POST",body:{rating:a.rating,review:a.text}});if(e.value)for(const s of this.orders.data)for(const o of s.orders)o.id===a.orderId&&(o.badges.reviewed=!0);return this.pending=!1,{data:e.value,error:r.value}},async sendCode(a){this.pending=!0;const{data:e,error:r}=await t("/phone/send_code",{method:"POST",body:{phone:a}});return this.pending=!1,{data:e.value,error:{...r.value}}},async verifyPhone(a){this.pending=!0;const{data:e,error:r}
1=await t("/phone/verify",{method:"POST",body:{code:a,phone:this.profile.data.phone}});return e.value&&(this.profile.data.phoneConfirmed=!0),this.pending=!1,{data:e.value,error:{...r.value}}},resetOrdersData(){this.orders={firstPageUrl:"",nextPageUrl:"",prevPageUrl:"",currentPage:1,perPage:null,from:null,path:"",data:[],to:null}},resetProfileData(){this.profile={data:{fullName:"",firstName:null,surName:null,email:"",messengers:{email:"",viber:"",telegram:"",whatsapp:""},phone:"",additionalPhone:"",role:null,passengersList:[],phoneConfirmed:!1},componentLogic:{hasAdditionalPhone:!1}}}}});export{c as u};
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.