1import{d as V,u as w,b as k,a as x,f as m,s as C,h as p,o as _,i as s,x as U,t as o,j as a,m as f,F as g,n as B,k as M,E as S}from"./index-LQcU8CUU.js";import{_ as W}from"./parkify-blue-C2_ikghz.js";import{_ as A}from"./attention-F58mTuch.js";import{U as v}from"./UserService-A7lNYlSM.js";import{B as D}from"./BaseModal-BOXBDePB.js";const T="/img/svg/car-add.svg",L="/img/svg/trash.svg",N={class:"main__top"},j={class:"main__title m-0"},E={href:"/user/add-new-vehicle",class:"btn btn_primary-outline ps-5 pe-3"},F={class:"vehicle-grid"},O={class:"car"},P={class:"number"},Y=["onClick"],$={class:"text-center"},I={class:"main__title"},q={class:"d-flex justify-content-center mt-4"},X=V({__name:"UserVehicles",setup(z){const{t:l}=w(),d=k(),r=x(),c=m([]),u=m(null),i=m(!1),y=t=>{i.value=!0,u.value=t},h=async()=>{d.show();try{const t=await v.getUserVehicles();t.code==="1"&&Array.isArray(t.details)?c.value=t.details:(c.value=[],r.error(t.message))}catch(t){console.error(t),r.error(l("somethingWhenWrongPleaseTryAgain"))}finally{d.hide()}},b=async()=>{if(!u.value)return;const t=u.value.id??"";d.show();try{const e=await v.deleteUserVehicle(t??"");e.code==="1"?(r.success("Vehicle deleted successfully"),await h()):r.error(e.message)}catch(e){console.error(e),r.error(l("somethingWhenWrongPleaseTryAgain"))}finally{d.hide(),i.value=!1}};return C(()=>{h()}),(t,e)=>(_(),p(g,null,[s("div",N,[s("h2",j,o(a(l)("myVehicles")),1),s("a",E,[e[2]||(e[2]=s("img",{src:T,alt:"","aria-hidden":"true",width:"24",class:"icon icon_left"},null,-1)),f(" "+o(a(l)("addVehicle")),1)])]),s("ul",F,[(_(!0),p(g,null,B(c.value,n=>(_(),p("li",{key:n.id},[e[4]||(e[4]=s("img",{src:W,alt:"","aria-hidden":"true",width:"35",class:"icon"},null,-1)),s("p",O,o(n.description)+" . "+o(n.make)+" . "+o(n.color),1),s("p",P,o(n?.number_plate),1),s("button",{type:"button",class:"delete",onClick:M(G=>y(n),["prevent"])},[...e[3]||(e[3]=[s("img",{src:L,alt:"","aria-hidden":"true",width:"24"},null,-1)])],8,Y)]))),128))]),U(D,{modelValue:i.value,"onUpdate:modelValue":e[1]||(e[1]=n=>i.value=n)},{content:S(()=>[s("div",$,[e[7]||(e[7]=s("img",{src:A,alt:"",width:"48",class:"attention-icon mb-3"},null,-1)),s("h2",I,o(a(l)("areYouSure")),1),s("p",null,[f(o(a(l)("areSureYouWantDelete"))+" ",1),e[5]||(e[5]=s("br",null,null,-1)),s("strong",null,o(u.value?.number_plate),1),e[6]||(e[6]=f("? ",-1))]),s("div",q,[s("button",{type:"button",class:"btn btn_secondary-outline ps-5 pe-5 me-2",onClick:e[0]||(e[0]=n=>i.value=!1)},o(a(l)("no")),1),s("button",{type:"button",class:"btn ps-5 pe-5",onClick:b},o(a(l)("yes")),1)])])]),_:1},8,["modelValue"])],64))}});export{X 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.