2 lines
87 KiB
JavaScript
2 lines
87 KiB
JavaScript
import{e as pe,c as r,a as e,t,j as x,d as w,m as S,o as i,s as fe,F as D,r as P,k as M,g as we,B as ke,h as Z,n as ge,y as _,C as he,z as k,l as v,J as Se,L as ue,i as Ee,b as De,w as He,T as Fe,K as Ie,D as Ne}from"./CQHa_U7G.js";import{_ as Ge}from"./Ihs0kuGb.js";import"./DlAUqK2U.js";const Oe={class:"space-y-6"},Re={class:"bg-slate-800/50 border border-slate-700 rounded-xl overflow-hidden"},Pe={class:"px-6 py-4 border-b border-slate-700 flex items-center gap-3"},Je={class:"text-base font-semibold text-white"},Qe={class:"px-6 py-5"},qe={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},Ke={class:"space-y-4"},We={class:"text-xs text-slate-500 uppercase tracking-wider"},Xe={class:"text-sm text-white mt-1"},Ye={class:"text-xs text-slate-500 uppercase tracking-wider"},Ze={class:"text-sm text-white mt-1"},et={class:"text-xs text-slate-500 uppercase tracking-wider"},tt={class:"text-sm text-white mt-1"},st={class:"space-y-4"},at={class:"text-xs text-slate-500 uppercase tracking-wider"},ot={class:"text-sm text-white mt-1"},lt={class:"text-xs text-slate-500 uppercase tracking-wider"},nt={class:"text-sm text-white mt-1"},it={class:"text-xs text-slate-500 uppercase tracking-wider"},rt={class:"text-sm text-white mt-1"},dt={class:"mt-6 pt-6 border-t border-slate-700/50"},ct={class:"text-xs text-slate-500 uppercase tracking-wider mb-3"},ut={class:"text-sm text-white"},gt={key:0,class:"mt-4 pt-4 border-t border-slate-700/50"},pt={class:"text-xs text-slate-500 uppercase tracking-wider mb-3"},mt={class:"text-sm text-white"},xt={key:1,class:"mt-4 pt-4 border-t border-slate-700/50"},bt={class:"text-xs text-slate-500 uppercase tracking-wider mb-3"},ht={class:"text-sm text-white"},ft={class:"mt-6 pt-4 border-t border-slate-700/50"},vt={class:"flex gap-6 text-xs font-mono text-slate-500"},_t={class:"text-slate-400"},yt={class:"text-slate-400"},wt={class:"text-slate-400"},kt={class:"bg-slate-800/50 border border-slate-700 rounded-xl overflow-hidden"},$t={class:"px-6 py-4 border-b border-slate-700 flex items-center gap-3"},Ct={class:"text-base font-semibold text-white"},Mt={class:"px-6 py-5"},zt={key:0,class:"grid grid-cols-1 md:grid-cols-2 gap-6"},jt={class:"space-y-4"},Vt={class:"text-xs text-slate-500 uppercase tracking-wider"},Bt={class:"text-sm text-white mt-1 font-medium"},Tt={class:"text-xs text-slate-500 uppercase tracking-wider"},At={class:"text-sm text-white mt-1 flex items-center gap-1.5"},Lt={class:"space-y-4"},Ut={class:"text-xs text-slate-500 uppercase tracking-wider"},St={class:"text-sm text-white mt-1 flex items-center gap-1.5"},Et={key:0},Dt={class:"text-xs text-slate-500 uppercase tracking-wider"},Ht={class:"text-sm text-white mt-1"},Ft={key:0},It={key:1,class:"text-center py-4"},Nt={class:"text-sm text-slate-400"},Gt=pe({__name:"GarageGeneralTab",props:{garage:{}},setup(u){const V=u;function N(p){return{dealership:"Dealership",service:"Service Center",rental:"Rental Agency",fleet:"Fleet Operator",individual:"Individual",workshop:"Workshop",garage:"Garage",other:"Other"}[p?.toLowerCase()]||p||"-"}function y(p){if(!p)return"-";try{return new Intl.DateTimeFormat("hu-HU",{year:"numeric",month:"2-digit",day:"2-digit"}).format(new Date(p))}catch{return p}}function z(p,m="address"){if(!V.garage)return"-";if(p&&typeof p=="object"){const j=[p.zip,p.city,p.street_name,p.street_type,p.house_number].filter(Boolean);if(j.length>0)return j.join(" ");if(p.full_address_text)return p.full_address_text}return[V.garage[`${m}_zip`],V.garage[`${m}_city`],V.garage[`${m}_street_name`],V.garage[`${m}_street_type`],V.garage[`${m}_house_number`]].filter(Boolean).join(" ")||"-"}const H=S(()=>z(V.garage?.address_detail,"address")),A=S(()=>z(V.garage?.billing_address_detail,"billing")),n=S(()=>z(V.garage?.notification_address_detail,"notification"));return(p,m)=>(i(),r("div",Oe,[e("div",Re,[e("div",Pe,[m[0]||(m[0]=e("div",{class:"p-2 rounded-lg bg-indigo-500/10 text-indigo-400"},[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"})])],-1)),e("h3",Je,t(p.$t("garages.details.company_info")),1)]),e("div",Qe,[e("div",qe,[e("div",Ke,[e("div",null,[e("p",We,t(p.$t("garages.details.company_name")),1),e("p",Xe,t(u.garage.full_name),1)]),e("div",null,[e("p",Ye,t(p.$t("garages.details.display_name")),1),e("p",Ze,t(u.garage.display_name||"—"),1)]),e("div",null,[e("p",et,t(p.$t("garages.details.org_type")),1),e("p",tt,t(N(u.garage.org_type)),1)])]),e("div",st,[e("div",null,[e("p",at,t(p.$t("garages.details.tax_number")),1),e("p",ot,t(u.garage.tax_number||"—"),1)]),e("div",null,[e("p",lt,t(p.$t("garages.details.reg_number")),1),e("p",nt,t(u.garage.reg_number||"—"),1)]),e("div",null,[e("p",it,t(p.$t("garages.details.created_at")),1),e("p",rt,t(y(u.garage.created_at)),1)])])]),e("div",dt,[e("p",ct,t(p.$t("garages.details.address")),1),e("p",ut,t(H.value),1)]),A.value?(i(),r("div",gt,[e("p",pt,t(p.$t("garages.details.billing_address")),1),e("p",mt,t(A.value),1)])):x("",!0),n.value?(i(),r("div",xt,[e("p",bt,t(p.$t("garages.details.notification_address")),1),e("p",ht,t(n.value),1)])):x("",!0),e("div",ft,[m[4]||(m[4]=e("p",{class:"text-xs text-slate-500 uppercase tracking-wider mb-3"},"Rendszer Azonosítók",-1)),e("div",vt,[e("span",null,[m[1]||(m[1]=w("Garázs ID: ",-1)),e("span",_t,t(u.garage.id),1)]),e("span",null,[m[2]||(m[2]=w("User ID: ",-1)),e("span",yt,t(u.garage.owner_user_id??"N/A"),1)]),e("span",null,[m[3]||(m[3]=w("Person ID: ",-1)),e("span",wt,t(u.garage.owner_person_id??"N/A"),1)])])])])]),e("div",kt,[e("div",$t,[m[5]||(m[5]=e("div",{class:"p-2 rounded-lg bg-emerald-500/10 text-emerald-400"},[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"})])],-1)),e("h3",Ct,t(p.$t("garages.details.contact_info")),1)]),e("div",Mt,[u.garage.contact_person_name||u.garage.contact_email||u.garage.contact_phone||u.garage.primary_contact?(i(),r("div",zt,[e("div",jt,[e("div",null,[e("p",Vt,t(p.$t("garages.details.contact_name")),1),e("p",Bt,t(u.garage.contact_person_name||u.garage.primary_contact?.full_name||"—"),1)]),e("div",null,[e("p",Tt,t(p.$t("garages.details.contact_email")),1),e("p",At,[m[6]||(m[6]=e("svg",{class:"w-4 h-4 text-slate-400 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})],-1)),e("span",null,t(u.garage.contact_email||u.garage.primary_contact?.email||"—"),1)])])]),e("div",Lt,[e("div",null,[e("p",Ut,t(p.$t("garages.details.contact_phone")),1),e("p",St,[m[7]||(m[7]=e("svg",{class:"w-4 h-4 text-slate-400 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"})],-1)),e("span",null,t(u.garage.contact_phone||u.garage.primary_contact?.phone||"—"),1)])]),u.garage.primary_contact?.role||u.garage.primary_contact?.department?(i(),r("div",Et,[e("p",Dt,t(p.$t("garages.details.contact_role")),1),e("p",Ht,[w(t(u.garage.primary_contact.role||"—"),1),u.garage.primary_contact?.department?(i(),r("span",Ft," · "+t(u.garage.primary_contact.department),1)):x("",!0)])])):x("",!0)])])):(i(),r("div",It,[e("p",Nt,t(p.$t("garages.details.no_contact")),1)]))])])]))}}),Ot={class:"space-y-6"},Rt={class:"flex items-center justify-between"},Pt={class:"flex items-center gap-3"},Jt={class:"text-base font-semibold text-white"},Qt={class:"text-xs text-slate-400 mt-0.5"},qt={class:"bg-slate-800/50 border border-slate-700 rounded-xl overflow-hidden"},Kt={class:"overflow-x-auto"},Wt={class:"w-full text-sm"},Xt={class:"border-b border-slate-700"},Yt={class:"text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider"},Zt={class:"text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider"},es={class:"text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider"},ts={class:"text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider"},ss={class:"text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider"},as={class:"px-4 py-3"},os={class:"text-sm font-bold text-white"},ls={class:"px-4 py-3"},ns={class:"text-sm text-slate-300"},is={key:0,class:"text-slate-500 mx-1"},rs={key:1,class:"text-sm text-slate-300"},ds={class:"px-4 py-3 text-sm text-slate-300"},cs={class:"px-4 py-3"},us={class:"text-xs font-mono text-slate-400"},gs={class:"px-4 py-3"},ps={key:0},ms={colspan:"5",class:"px-4 py-12 text-center"},xs={class:"text-sm text-slate-400"},bs={key:1},hs={colspan:"5",class:"px-4 py-12 text-center"},fs={class:"text-sm text-slate-400 mt-2"},vs={key:1,class:"bg-slate-800/50 border border-slate-700 rounded-xl p-12 text-center"},_s={class:"text-sm text-slate-400"},ys=pe({__name:"GarageFleetTab",props:{garage:{},orgId:{},fleetVehicles:{},fleetLoading:{type:Boolean}},setup(u){const V=u,N=fe();function y(n){return!!(N.isAdmin||N.user?.system_capabilities?.[n]||N.user?.org_capabilities?.[V.orgId]?.[n])}function z(n){return{active:"Active",inactive:"Inactive",sold:"Sold",scrapped:"Scrapped",pending:"Pending",draft:"Draft"}[n?.toLowerCase()]||n||"Unknown"}function H(n){return{active:"bg-green-500/10 text-green-400",inactive:"bg-gray-500/10 text-gray-400",sold:"bg-red-500/10 text-red-400",scrapped:"bg-red-500/10 text-red-400",pending:"bg-yellow-500/10 text-yellow-400",draft:"bg-gray-500/10 text-gray-400"}[n?.toLowerCase()]||"bg-gray-500/10 text-gray-400"}function A(n){return{active:"bg-green-400",inactive:"bg-gray-400",sold:"bg-red-400",scrapped:"bg-red-400",pending:"bg-yellow-400",draft:"bg-gray-400"}[n?.toLowerCase()]||"bg-gray-400"}return(n,p)=>(i(),r("div",Ot,[y("fleet:view")?(i(),r(D,{key:0},[e("div",Rt,[e("div",Pt,[p[0]||(p[0]=e("div",{class:"p-2 rounded-lg bg-indigo-500/10 text-indigo-400"},[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 17a2 2 0 11-4 0 2 2 0 014 0zM19 17a2 2 0 11-4 0 2 2 0 014 0z"}),e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16V6a1 1 0 00-1-1H4a1 1 0 00-1 1v10a1 1 0 001 1h1m8-1a1 1 0 01-1 1H9m4-1V8a1 1 0 011-1h2.586a1 1 0 01.707.293l3.414 3.414a1 1 0 01.293.707V16a1 1 0 01-1 1h-1m-6-1a1 1 0 001 1h1M5 17a2 2 0 104 0m-4 0a2 2 0 114 0m6 0a2 2 0 104 0m-4 0a2 2 0 114 0"})])],-1)),e("div",null,[e("h3",Jt,t(n.$t("garages.fleet.title")),1),e("p",Qt,t(n.$t("garages.fleet.total_vehicles",{count:u.fleetVehicles.length})),1)])])]),e("div",qt,[e("div",Kt,[e("table",Wt,[e("thead",null,[e("tr",Xt,[e("th",Yt,t(n.$t("garages.fleet.plate")),1),e("th",Zt,t(n.$t("garages.fleet.brand_model")),1),e("th",es,t(n.$t("garages.fleet.year")),1),e("th",ts,t(n.$t("garages.fleet.vin")),1),e("th",ss,t(n.$t("garages.fleet.status")),1)])]),e("tbody",null,[(i(!0),r(D,null,P(u.fleetVehicles,m=>(i(),r("tr",{key:m.id,class:"border-b border-slate-700/50 last:border-b-0 hover:bg-slate-700/30 transition"},[e("td",as,[e("span",os,t(m.license_plate||"—"),1)]),e("td",ls,[e("span",ns,t(m.brand||"—"),1),m.brand&&m.model?(i(),r("span",is,"·")):x("",!0),m.model?(i(),r("span",rs,t(m.model),1)):x("",!0)]),e("td",ds,t(m.year||"—"),1),e("td",cs,[e("span",us,t(m.vin||"—"),1)]),e("td",gs,[e("span",{class:M(["inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-medium",H(m.status)])},[e("span",{class:M(["w-1.5 h-1.5 rounded-full",A(m.status)])},null,2),w(" "+t(z(m.status)),1)],2)])]))),128)),u.fleetVehicles.length===0&&!u.fleetLoading?(i(),r("tr",ps,[e("td",ms,[p[1]||(p[1]=e("svg",{class:"w-12 h-12 text-slate-600 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M9 17a2 2 0 11-4 0 2 2 0 014 0zM19 17a2 2 0 11-4 0 2 2 0 014 0z"}),e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M13 16V6a1 1 0 00-1-1H4a1 1 0 00-1 1v10a1 1 0 001 1h1m8-1a1 1 0 01-1 1H9m4-1V8a1 1 0 011-1h2.586a1 1 0 01.707.293l3.414 3.414a1 1 0 01.293.707V16a1 1 0 01-1 1h-1m-6-1a1 1 0 001 1h1M5 17a2 2 0 104 0m-4 0a2 2 0 114 0m6 0a2 2 0 104 0m-4 0a2 2 0 114 0"})],-1)),e("p",xs,t(n.$t("garages.fleet.no_vehicles")),1)])])):x("",!0),u.fleetLoading?(i(),r("tr",bs,[e("td",hs,[p[2]||(p[2]=e("svg",{class:"w-8 h-8 text-indigo-400 animate-spin mx-auto",fill:"none",viewBox:"0 0 24 24"},[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})],-1)),e("p",fs,t(n.$t("garages.details.loading")),1)])])):x("",!0)])])])])],64)):(i(),r("div",vs,[p[3]||(p[3]=e("svg",{class:"w-12 h-12 text-slate-600 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"})],-1)),e("p",_s,t(n.$t("garages.fleet.no_fleet_access")),1)]))]))}}),ws={class:"space-y-6"},ks={class:"bg-slate-800/50 border border-slate-700 rounded-xl overflow-hidden"},$s={class:"px-6 py-4 border-b border-slate-700 flex items-center gap-3"},Cs={class:"text-base font-semibold text-white"},Ms={class:"px-6 py-5"},zs={key:0,class:"grid grid-cols-2 md:grid-cols-4 gap-4"},js={class:"bg-slate-900/30 rounded-lg p-3"},Vs={class:"text-xs text-slate-500 uppercase tracking-wider mb-1"},Bs={class:"bg-slate-900/30 rounded-lg p-3"},Ts={class:"text-xs text-slate-500 uppercase tracking-wider mb-1"},As={class:"text-sm font-semibold text-white"},Ls={class:"bg-slate-900/30 rounded-lg p-3"},Us={class:"text-xs text-slate-500 uppercase tracking-wider mb-1"},Ss={key:0,class:"text-sm font-semibold text-white"},Es={key:1,class:"text-sm text-slate-400 italic"},Ds={class:"bg-slate-900/30 rounded-lg p-3"},Hs={class:"text-xs text-slate-500 uppercase tracking-wider mb-1"},Fs={class:"text-sm font-semibold text-white"},Is={key:1,class:"mt-4 grid grid-cols-2 gap-4"},Ns={class:"bg-slate-900/30 rounded-lg p-3"},Gs={class:"text-xs text-slate-500 uppercase tracking-wider mb-1"},Os={class:"text-sm font-semibold text-white"},Rs={class:"mt-2 w-full h-1.5 bg-slate-700 rounded-full overflow-hidden"},Ps={class:"bg-slate-900/30 rounded-lg p-3"},Js={class:"text-xs text-slate-500 uppercase tracking-wider mb-1"},Qs={class:"text-sm font-semibold text-white"},qs={class:"mt-2 w-full h-1.5 bg-slate-700 rounded-full overflow-hidden"},Ks={class:"bg-slate-900/30 rounded-lg p-3"},Ws={class:"text-xs text-slate-500 uppercase tracking-wider mb-1"},Xs={class:"text-sm font-semibold text-white"},Ys={key:0,class:"mt-2 w-full h-1.5 bg-slate-700 rounded-full overflow-hidden"},Zs={class:"bg-slate-900/30 rounded-lg p-3 flex flex-col justify-center"},ea={class:"text-xs text-slate-500 uppercase tracking-wider mb-1"},ta={key:2,class:"mt-4 border-t border-slate-700/50 pt-4"},sa={class:"text-xs text-slate-500 uppercase tracking-wider mb-3"},aa={class:"overflow-hidden border border-slate-700/50 rounded-lg"},oa={class:"w-full text-sm"},la={class:"bg-slate-900/40"},na={class:"px-3 py-2 text-left text-xs font-medium text-slate-400 uppercase tracking-wider"},ia={class:"px-3 py-2 text-center text-xs font-medium text-slate-400 uppercase tracking-wider"},ra={class:"px-3 py-2 text-right text-xs font-medium text-slate-400 uppercase tracking-wider"},da={class:"divide-y divide-slate-700/50"},ca={class:"px-3 py-2.5 text-slate-300"},ua={class:"px-3 py-2.5 text-center"},ga={class:"inline-flex items-center justify-center w-7 h-7 rounded-full bg-indigo-500/20 text-indigo-300 text-xs font-bold"},pa={class:"px-3 py-2.5 text-right text-slate-500"},ma={key:0},xa={key:1,class:"italic"},ba={key:3,class:"mt-4 border-t border-slate-700/50 pt-4"},ha={class:"text-xs text-slate-500 uppercase tracking-wider mb-1"},fa={class:"bg-slate-900/20 border border-slate-700/30 rounded-lg px-4 py-3 text-center"},va={class:"text-xs text-slate-500 italic"},_a={key:4,class:"text-center py-4"},ya={class:"text-sm text-slate-400"},wa={class:"bg-slate-800/50 border border-slate-700 rounded-xl overflow-hidden"},ka={class:"px-6 py-4 border-b border-slate-700 flex items-center gap-3"},$a={class:"text-base font-semibold text-white"},Ca={class:"px-6 py-5 space-y-5"},Ma={class:"block text-sm font-medium text-slate-300 mb-2"},za={value:"",disabled:""},ja=["value"],Va={class:"block text-sm font-medium text-slate-300 mb-2"},Ba={class:"text-xs text-slate-500 ml-1"},Ta={class:"text-xs text-slate-500 mt-1.5"},Aa={class:"block text-sm font-medium text-slate-300 mb-3"},La={class:"text-xs text-slate-500 ml-1"},Ua={class:"grid grid-cols-1 md:grid-cols-3 gap-3"},Sa={class:"bg-slate-900/30 border border-slate-700/50 rounded-lg p-3"},Ea={class:"block text-xs text-slate-400 mb-1.5"},Da={class:"flex items-center gap-2"},Ha={class:"block text-xs text-slate-500 mt-2 mb-1"},Fa={class:"bg-slate-900/30 border border-slate-700/50 rounded-lg p-3"},Ia={class:"block text-xs text-slate-400 mb-1.5"},Na={class:"flex items-center gap-2"},Ga={class:"block text-xs text-slate-500 mt-2 mb-1"},Oa={class:"bg-slate-900/30 border border-slate-700/50 rounded-lg p-3"},Ra={class:"block text-xs text-slate-400 mb-1.5"},Pa={class:"flex items-center gap-2"},Ja={class:"block text-xs text-slate-500 mt-2 mb-1"},Qa={class:"text-xs text-slate-500 mt-3"},qa={key:0,class:"bg-red-500/10 border border-red-500/20 rounded-lg px-4 py-3"},Ka={class:"text-sm text-red-400"},Wa={class:"flex items-center justify-end gap-3 pt-2"},Xa=["disabled"],Ya={key:0,class:"flex items-center gap-2"},Za={key:1},eo={class:"bg-slate-800/50 border border-slate-700 rounded-xl overflow-hidden"},to={class:"px-6 py-4 border-b border-slate-700 flex items-center gap-3"},so={class:"text-base font-semibold text-white"},ao={class:"px-6 py-5"},oo={class:"overflow-x-auto"},lo={class:"w-full text-sm"},no={class:"border-b border-slate-700"},io={class:"text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider"},ro={class:"text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider"},co={class:"text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider"},uo={class:"text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider"},go={class:"px-4 py-3 text-sm text-slate-300"},po={class:"px-4 py-3 text-sm text-slate-300"},mo={class:"px-4 py-3 text-sm text-slate-300 max-w-xs"},xo={class:"space-y-1"},bo={class:"text-xs text-slate-400 block"},ho={key:0,class:"text-xs text-slate-300 space-y-0.5"},fo={key:1,class:"text-xs text-slate-500 italic"},vo={class:"px-4 py-3"},_o={class:"flex flex-col gap-1"},yo={key:0,class:"text-[10px] text-slate-500 text-center"},wo={key:1},ko={colspan:"4",class:"px-4 py-12 text-center"},$o={class:"flex flex-col items-center gap-3"},Co={class:"text-sm text-slate-400"},Mo=pe({__name:"GarageSubscriptionTab",props:{garage:{},fleetVehicles:{}},emits:["refresh"],setup(u,{expose:V,emit:N}){const y=u,z=N,H=fe(),A=v([]);we(()=>{I()});const n=v(""),p=v(""),m=v(!1),B=v(null),j=v(0),U=v(0),L=v(0),$=Se({vehicles:"",branches:"",users:""});function ee(){const o=y.garage?.subscription;if(!o)return;const d=o.extra_allowances||{};if(j.value=d.extra_vehicles??0,U.value=d.extra_branches??0,L.value=d.extra_users??0,o.addons?.length)for(const c of o.addons)c.type==="extra_vehicles"&&c.expires_at?$.vehicles=c.expires_at.slice(0,10):c.type==="extra_branches"&&c.expires_at?$.branches=c.expires_at.slice(0,10):c.type==="extra_users"&&c.expires_at&&($.users=c.expires_at.slice(0,10))}ke(()=>y.garage?.subscription,o=>{o&&ee()},{immediate:!0});const b=S(()=>y.garage?.subscription?.asset_limit?y.garage.subscription.asset_limit:5),J=S(()=>{const o=b.value;return o<=0?0:Math.min(100,Math.round(y.fleetVehicles.length/o*100))}),F=S(()=>{const o=y.garage?.branches?.length||0,d=y.garage?.subscription?.branch_limit;return!d||d<=0?0:Math.min(100,Math.round(o/d*100))}),Q=S(()=>{const o=y.garage?.member_count||0,d=y.garage?.subscription?.user_limit;return!d||d<=0?0:Math.min(100,Math.round(o/d*100))}),q=S(()=>{if(!y.garage?.subscription)return!1;const o=y.garage.subscription,d=o.extra_allowances?.extra_vehicles??0,c=o.extra_allowances?.extra_branches??0,h=o.extra_allowances?.extra_users??0;return j.value!==d||U.value!==c||L.value!==h});function K(o){if(!o)return null;const d=o.old_data||{},c=o.new_data||{},h=[];if(o.action==="SUBSCRIPTION_TIER_CHANGE"){const C=d.tier_id,G=c.tier_id,O=c.tier_name;(C!==void 0||G!==void 0)&&h.push(`Csomag: #${C??"?"} → ${O??"#"+G}`);const E=d.addons||{},ne=c.addons||{};for(const R of["extra_vehicles","extra_branches","extra_users"]){const ie=E[R]??0,de=ne[R]??0;if(ie!==de){const xe=R==="extra_vehicles"?"Extra Jármű":R==="extra_branches"?"Extra Telephely":"Extra Dolgozó";h.push(`${xe}: ${ie} → ${de}`)}}return h.length>0?h:null}if(o.action==="SUBSCRIPTION_ADDON_OVERRIDE"){const C=d.addons||{},G=c.addons||{};let O=!1;for(const E of["extra_vehicles","extra_branches","extra_users"]){const ne=C[E]??0,R=G[E]??0;if(ne!==R){O=!0;const ie=E==="extra_vehicles"?"Extra Jármű":E==="extra_branches"?"Extra Telephely":"Extra Dolgozó";h.push(`${ie}: ${ne} → ${R}`)}}return O?h:null}const T=new Set([...Object.keys(d),...Object.keys(c)]);for(const C of T){if(C==="addons")continue;const G=JSON.stringify(d[C]??null),O=JSON.stringify(c[C]??null);G!==O&&h.push(`${C}: ${G} → ${O}`)}return h.length>0?h:null}function W(o){if(!o)return"-";try{return new Intl.DateTimeFormat("hu-HU",{year:"numeric",month:"2-digit",day:"2-digit"}).format(new Date(o))}catch{return o}}function le(o){return{extra_vehicles:"Extra Jármű",extra_branches:"Extra Telephely",extra_users:"Extra Dolgozó"}[o]||o}function te(o){return{basic:"bg-gray-100 text-gray-800",premium:"bg-yellow-100 text-yellow-800",enterprise:"bg-purple-100 text-purple-800",trial:"bg-blue-100 text-blue-800"}[o?.toLowerCase()]||"bg-gray-100 text-gray-800"}function se(o){return{active:"Active",inactive:"Inactive",suspended:"Suspended",pending:"Pending"}[o?.toLowerCase()]||o}function ae(o){return{active:"bg-green-100 text-green-800",inactive:"bg-gray-100 text-gray-800",suspended:"bg-red-100 text-red-800",pending:"bg-yellow-100 text-yellow-800"}[o?.toLowerCase()]||"bg-gray-100 text-gray-800"}function oe(o){return{active:"bg-green-400",inactive:"bg-gray-400",suspended:"bg-red-400",pending:"bg-yellow-400"}[o?.toLowerCase()]||"bg-gray-400"}async function I(){try{const d=(Z("access_token").value||H.token||"").trim();console.log("[GarageSubscriptionTab] Fetching tiers...");const c=await fetch("/api/v1/admin/packages?include_hidden=true&limit=100",{headers:{Authorization:`Bearer ${d}`,"Content-Type":"application/json"}});if(!c.ok){const T=await c.text().catch(()=>"");throw console.error(`[GarageSubscriptionTab] Fetch tiers failed: ${c.status} ${c.statusText}`,T),new Error(`Failed to fetch tiers: ${c.status} ${T}`)}const h=await c.json();console.log("[GarageSubscriptionTab] Fetched tiers response:",JSON.stringify(h)),A.value=h.tiers||[],console.log("[GarageSubscriptionTab] availableTiers set:",A.value.length,"items")}catch(o){console.error("[GarageSubscriptionTab] Failed to fetch tiers:",o),B.value=`Hiba a csomagok betöltésekor: ${o.message}`}}async function me(){if(!(!n.value&&!q.value)){m.value=!0,B.value=null;try{const d=(Z("access_token").value||H.token||"").trim(),c=y.garage?.id,h={};n.value&&(h.tier_id=n.value),p.value&&(h.expires_at=new Date(p.value).toISOString()),h.extra_vehicles=j.value,h.extra_branches=U.value,h.extra_users=L.value,h.extra_vehicles_expires_at=$.vehicles||null,h.extra_branches_expires_at=$.branches||null,h.extra_users_expires_at=$.users||null,console.log("[GarageSubscriptionTab] PATCH Payload:",JSON.stringify(h,null,2));const T=await fetch(`/api/v1/admin/organizations/${c}/subscription`,{method:"PATCH",headers:{Authorization:`Bearer ${d}`,"Content-Type":"application/json"},body:JSON.stringify(h)});if(!T.ok){const C=await T.json().catch(()=>({}));throw new Error(C.detail||`Update subscription failed: ${T.status}`)}n.value="",z("refresh")}catch(o){B.value=o.message||"Failed to update subscription"}finally{m.value=!1}}}return V({fetchTiers:I}),(o,d)=>(i(),r("div",ws,[e("div",ks,[e("div",$s,[d[14]||(d[14]=e("div",{class:"p-2 rounded-lg bg-amber-500/10 text-amber-400"},[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})])],-1)),e("h3",Cs,t(o.$t("garages.details.subscription_info")),1)]),e("div",Ms,[u.garage.subscription?(i(),r("div",zs,[e("div",js,[e("p",Vs,t(o.$t("garages.details.tier_name")),1),e("span",{class:M(["inline-flex px-2.5 py-0.5 rounded-full text-xs font-medium",te(u.garage.subscription.tier_name)])},t(u.garage.subscription.tier_name),3)]),e("div",Bs,[e("p",Ts,t(o.$t("garages.details.tier_level")),1),e("p",As,t(o.$t("garages.details.level_n",{n:u.garage.subscription.tier_level})),1)]),e("div",Ls,[e("p",Us,t(o.$t("garages.details.expires_at")),1),u.garage.subscription.expires_at?(i(),r("p",Ss,t(W(u.garage.subscription.expires_at)),1)):(i(),r("p",Es,t(o.$t("garages.indefinite")),1))]),e("div",Ds,[e("p",Hs,t(o.$t("garages.details.asset_limit")),1),e("p",Fs,t(u.garage.subscription.asset_limit)+" "+t(o.$t("garages.details.vehicles")),1)])])):x("",!0),u.garage.subscription?(i(),r("div",Is,[e("div",Ns,[e("p",Gs,t(o.$t("garages.details.vehicles_used")),1),e("p",Os,t(u.fleetVehicles.length)+" / "+t(u.garage.subscription?.asset_limit??"∞"),1),e("div",Rs,[e("div",{class:M(["h-full rounded-full transition-all duration-500",J.value>=90?"bg-red-500":J.value>=70?"bg-amber-500":"bg-blue-500"]),style:ge({width:Math.min(100,J.value)+"%"})},null,6)])]),e("div",Ps,[e("p",Js,t(o.$t("garages.details.branches_used")),1),e("p",Qs,t(u.garage.branches?.length||0)+" / "+t(u.garage.subscription?.branch_limit??"∞"),1),e("div",qs,[e("div",{class:M(["h-full rounded-full transition-all duration-500",F.value>=90?"bg-red-500":F.value>=70?"bg-amber-500":"bg-emerald-500"]),style:ge({width:Math.min(100,F.value)+"%"})},null,6)])]),e("div",Ks,[e("p",Ws,t(o.$t("garages.details.employees_used")),1),e("p",Xs,t(u.garage.member_count||0)+" / "+t(u.garage.subscription?.user_limit&&u.garage.subscription.user_limit>0?u.garage.subscription.user_limit:"∞"),1),u.garage.subscription?.user_limit&&u.garage.subscription.user_limit>0?(i(),r("div",Ys,[e("div",{class:M(["h-full rounded-full transition-all duration-500",Q.value>=90?"bg-red-500":Q.value>=70?"bg-amber-500":"bg-purple-500"]),style:ge({width:Math.min(100,Q.value)+"%"})},null,6)])):x("",!0)]),e("div",Zs,[e("p",ea,t(o.$t("garages.details.status")),1),e("span",{class:M(["inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium self-start",ae(u.garage.status)])},[e("span",{class:M(["w-1.5 h-1.5 rounded-full",oe(u.garage.status)])},null,2),w(" "+t(se(u.garage.status)),1)],2)])])):x("",!0),u.garage.subscription?.addons?.length?(i(),r("div",ta,[e("p",sa,t(o.$t("garages.active_addons")),1),e("div",aa,[e("table",oa,[e("thead",null,[e("tr",la,[e("th",na,t(o.$t("garages.addon_type")),1),e("th",ia,t(o.$t("garages.addon_quantity")),1),e("th",ra,t(o.$t("garages.addon_expires")),1)])]),e("tbody",da,[(i(!0),r(D,null,P(u.garage.subscription.addons,c=>(i(),r("tr",{key:c.type,class:"bg-slate-900/20 hover:bg-slate-900/40 transition"},[e("td",ca,t(le(c.type)),1),e("td",ua,[e("span",ga,t(c.quantity),1)]),e("td",pa,[c.expires_at||c.valid_until?(i(),r("span",ma,t(W(c.expires_at||c.valid_until)),1)):(i(),r("span",xa,t(o.$t("garages.indefinite")),1))])]))),128))])])])])):u.garage.subscription?(i(),r("div",ba,[e("p",ha,t(o.$t("garages.active_addons")),1),e("div",fa,[e("p",va,t(o.$t("garages.no_active_addons")),1)])])):(i(),r("div",_a,[e("p",ya,t(o.$t("garages.details.no_subscription")),1)]))])]),e("div",wa,[e("div",ka,[d[15]||(d[15]=e("div",{class:"p-2 rounded-lg bg-indigo-500/10 text-indigo-400"},[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})])],-1)),e("h3",$a,t(o.$t("garages.change_package")),1)]),e("div",Ca,[e("div",null,[e("label",Ma,t(o.$t("garages.select_package")),1),_(e("select",{"onUpdate:modelValue":d[0]||(d[0]=c=>n.value=c),class:"w-full px-3 py-2.5 bg-slate-900 border border-slate-700 rounded-lg text-sm text-white focus:outline-none focus:ring-2 focus:ring-indigo-500/50 transition"},[e("option",za,t(o.$t("garages.select_package_placeholder")),1),(i(!0),r(D,null,P(A.value,c=>(i(),r("option",{key:c.id,value:c.id},t(c.name)+" (Level "+t(c.tier_level)+") ",9,ja))),128))],512),[[he,n.value]])]),e("div",null,[e("label",Va,[w(t(o.$t("garages.custom_expiration"))+" ",1),e("span",Ba,"("+t(o.$t("garages.optional"))+")",1)]),_(e("input",{"onUpdate:modelValue":d[1]||(d[1]=c=>p.value=c),type:"date",class:"w-full px-3 py-2.5 bg-slate-900 border border-slate-700 rounded-lg text-sm text-white focus:outline-none focus:ring-2 focus:ring-indigo-500/50 transition"},null,512),[[k,p.value]]),e("p",Ta,t(o.$t("garages.custom_expiration_hint")),1)]),e("div",null,[e("label",Aa,[w(t(o.$t("garages.addons_title"))+" ",1),e("span",La,"("+t(o.$t("garages.optional"))+")",1)]),e("div",Ua,[e("div",Sa,[e("label",Ea,t(o.$t("garages.addon_vehicles")),1),e("div",Da,[e("button",{onClick:d[2]||(d[2]=c=>j.value=Math.max(0,j.value-1)),class:"w-8 h-8 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-300 flex items-center justify-center transition text-sm font-bold"},"−"),_(e("input",{"onUpdate:modelValue":d[3]||(d[3]=c=>j.value=c),type:"number",min:"0",max:"999",class:"w-full px-2 py-1.5 bg-slate-900 border border-slate-700 rounded-lg text-sm text-white text-center focus:outline-none focus:ring-2 focus:ring-indigo-500/50 transition [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"},null,512),[[k,j.value,void 0,{number:!0}]]),e("button",{onClick:d[4]||(d[4]=c=>j.value=Math.min(999,j.value+1)),class:"w-8 h-8 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-300 flex items-center justify-center transition text-sm font-bold"},"+")]),e("label",Ha,t(o.$t("garages.addon_vehicles_expiration")),1),_(e("input",{"onUpdate:modelValue":d[5]||(d[5]=c=>$.vehicles=c),type:"date",class:"w-full px-3 py-2 bg-slate-900 border border-slate-700 rounded-lg text-sm text-white focus:outline-none focus:ring-2 focus:ring-indigo-500/50 transition"},null,512),[[k,$.vehicles]])]),e("div",Fa,[e("label",Ia,t(o.$t("garages.addon_branches")),1),e("div",Na,[e("button",{onClick:d[6]||(d[6]=c=>U.value=Math.max(0,U.value-1)),class:"w-8 h-8 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-300 flex items-center justify-center transition text-sm font-bold"},"−"),_(e("input",{"onUpdate:modelValue":d[7]||(d[7]=c=>U.value=c),type:"number",min:"0",max:"999",class:"w-full px-2 py-1.5 bg-slate-900 border border-slate-700 rounded-lg text-sm text-white text-center focus:outline-none focus:ring-2 focus:ring-indigo-500/50 transition [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"},null,512),[[k,U.value,void 0,{number:!0}]]),e("button",{onClick:d[8]||(d[8]=c=>U.value=Math.min(999,U.value+1)),class:"w-8 h-8 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-300 flex items-center justify-center transition text-sm font-bold"},"+")]),e("label",Ga,t(o.$t("garages.addon_branches_expiration")),1),_(e("input",{"onUpdate:modelValue":d[9]||(d[9]=c=>$.branches=c),type:"date",class:"w-full px-3 py-2 bg-slate-900 border border-slate-700 rounded-lg text-sm text-white focus:outline-none focus:ring-2 focus:ring-indigo-500/50 transition"},null,512),[[k,$.branches]])]),e("div",Oa,[e("label",Ra,t(o.$t("garages.addon_users")),1),e("div",Pa,[e("button",{onClick:d[10]||(d[10]=c=>L.value=Math.max(0,L.value-1)),class:"w-8 h-8 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-300 flex items-center justify-center transition text-sm font-bold"},"−"),_(e("input",{"onUpdate:modelValue":d[11]||(d[11]=c=>L.value=c),type:"number",min:"0",max:"999",class:"w-full px-2 py-1.5 bg-slate-900 border border-slate-700 rounded-lg text-sm text-white text-center focus:outline-none focus:ring-2 focus:ring-indigo-500/50 transition [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"},null,512),[[k,L.value,void 0,{number:!0}]]),e("button",{onClick:d[12]||(d[12]=c=>L.value=Math.min(999,L.value+1)),class:"w-8 h-8 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-300 flex items-center justify-center transition text-sm font-bold"},"+")]),e("label",Ja,t(o.$t("garages.addon_users_expiration")),1),_(e("input",{"onUpdate:modelValue":d[13]||(d[13]=c=>$.users=c),type:"date",class:"w-full px-3 py-2 bg-slate-900 border border-slate-700 rounded-lg text-sm text-white focus:outline-none focus:ring-2 focus:ring-indigo-500/50 transition"},null,512),[[k,$.users]])])]),e("p",Qa,t(o.$t("garages.addon_expiration_hint")),1)]),B.value?(i(),r("div",qa,[e("p",Ka,t(B.value),1)])):x("",!0),e("div",Wa,[e("button",{onClick:me,disabled:m.value||!n.value&&!q.value,class:M(["px-5 py-2 text-sm font-medium rounded-lg transition disabled:opacity-50 disabled:cursor-not-allowed",m.value?"bg-indigo-600/50 text-indigo-200 cursor-wait":"bg-indigo-600 text-white hover:bg-indigo-500"])},[m.value?(i(),r("span",Ya,[d[16]||(d[16]=e("svg",{class:"w-4 h-4 animate-spin",fill:"none",viewBox:"0 0 24 24"},[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})],-1)),w(" "+t(o.$t("garages.saving")),1)])):(i(),r("span",Za,t(o.$t("garages.save")),1))],10,Xa)])])]),e("div",eo,[e("div",to,[d[17]||(d[17]=e("div",{class:"p-2 rounded-lg bg-cyan-500/10 text-cyan-400"},[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1)),e("h3",so,t(o.$t("garages.details.subscription_history")),1)]),e("div",ao,[e("div",oo,[e("table",lo,[e("thead",null,[e("tr",no,[e("th",io,t(o.$t("garages.details.history_date")),1),e("th",ro,t(o.$t("garages.details.history_package")),1),e("th",co,t(o.$t("garages.details.history_action")),1),e("th",uo,t(o.$t("garages.details.history_status")),1)])]),e("tbody",null,[u.garage?.subscription_history?.length?(i(!0),r(D,{key:0},P(u.garage.subscription_history,c=>(i(),r("tr",{key:c.id,class:"border-b border-slate-700/50 last:border-b-0 hover:bg-slate-700/30 transition"},[e("td",go,t(W(c.timestamp)),1),e("td",po,t(c.tier_name||"—"),1),e("td",mo,[e("div",xo,[e("span",bo,t(c.action||"—"),1),K(c)?(i(),r("div",ho,[(i(!0),r(D,null,P(K(c),(h,T)=>(i(),r("div",{key:T,class:"flex items-start gap-1"},[d[18]||(d[18]=e("span",{class:"text-cyan-400 shrink-0"},"›",-1)),e("span",null,t(h),1)]))),128))])):(i(),r("span",fo,"Nincs részletes adat"))])]),e("td",vo,[e("div",_o,[d[19]||(d[19]=e("span",{class:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-500/10 text-green-400"}," Sikeres ",-1)),c.admin_user_id?(i(),r("span",yo," Admin #"+t(c.admin_user_id),1)):x("",!0)])])]))),128)):(i(),r("tr",wo,[e("td",ko,[e("div",$o,[d[20]||(d[20]=e("svg",{class:"w-10 h-10 text-slate-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),e("p",Co,t(o.$t("garages.details.no_subscription_history")),1)])])]))])])])])])]))}}),zo={key:0,class:"flex items-center justify-center py-20"},jo={class:"flex flex-col items-center gap-3"},Vo={class:"text-slate-400 text-sm"},Bo={key:1,class:"flex flex-col items-center justify-center py-20 text-center"},To={class:"text-red-400 text-sm mb-2"},Ao={key:0,class:"mb-6 p-4 bg-amber-500/10 border border-amber-500/30 rounded-xl"},Lo={class:"flex items-start gap-3"},Uo={class:"flex-1 min-w-0"},So={class:"flex items-center justify-between"},Eo={class:"text-sm font-semibold text-amber-300"},Do={class:"text-xs text-amber-400/70"},Ho={class:"text-xs text-amber-400/80 mt-1"},Fo={class:"flex flex-wrap gap-2 mt-3"},Io={class:"mb-8"},No={class:"flex items-center justify-between"},Go={class:"flex items-center gap-4"},Oo={class:"flex items-center gap-3"},Ro={class:"text-2xl font-bold text-white"},Po={class:"text-sm text-slate-400 mt-0.5"},Jo={key:0,class:"ml-2 text-slate-500"},Qo={class:"flex items-center gap-3"},qo={class:"border-b border-slate-700 mb-6"},Ko={class:"flex gap-6"},Wo=["onClick"],Xo={key:2,class:"space-y-6"},Yo={class:"flex items-center justify-between"},Zo={class:"flex items-center gap-3"},el={class:"text-base font-semibold text-white"},tl={class:"text-xs text-slate-400 mt-0.5"},sl={class:"bg-slate-800/50 border border-slate-700 rounded-xl overflow-hidden"},al={class:"overflow-x-auto"},ol={class:"w-full text-sm"},ll={class:"border-b border-slate-700"},nl={class:"text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider"},il={class:"text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider"},rl={class:"text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider"},dl={class:"text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider"},cl={class:"text-right px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider"},ul={class:"px-4 py-3"},gl={class:"flex items-center gap-3"},pl={class:"text-sm font-medium text-white"},ml={class:"text-xs text-slate-500"},xl={class:"flex gap-3 mt-0.5 text-xs text-slate-500 font-mono"},bl={class:"text-slate-400"},hl={class:"text-slate-400"},fl={class:"px-4 py-3"},vl={class:"space-y-0.5"},_l={key:0,class:"text-sm text-slate-300"},yl={key:1,class:"text-sm text-slate-500 italic"},wl={key:2,class:"text-xs text-slate-400"},kl={class:"px-4 py-3"},$l={class:"px-4 py-3"},Cl={class:"px-4 py-3 text-right"},Ml={class:"flex items-center justify-end gap-2"},zl=["onClick"],jl=["onClick"],Vl={key:0},Bl={colspan:"5",class:"px-4 py-12 text-center"},Tl={class:"text-sm text-slate-400"},Al={key:5,class:"space-y-6"},Ll={class:"grid grid-cols-1 md:grid-cols-3 gap-4"},Ul={class:"bg-slate-800/50 border border-slate-700 rounded-xl p-5"},Sl={class:"flex items-center gap-3 mb-3"},El={class:"text-xs font-medium text-slate-400 uppercase tracking-wider"},Dl={class:"bg-slate-800/50 border border-slate-700 rounded-xl p-5"},Hl={class:"flex items-center gap-3 mb-3"},Fl={class:"text-xs font-medium text-slate-400 uppercase tracking-wider"},Il={class:"text-xs text-slate-400 mt-1"},Nl={class:"bg-slate-800/50 border border-slate-700 rounded-xl p-5"},Gl={class:"flex items-center gap-3 mb-3"},Ol={class:"text-xs font-medium text-slate-400 uppercase tracking-wider"},Rl={class:"text-xs text-emerald-400 mt-1 flex items-center gap-1"},Pl={class:"grid grid-cols-1 md:grid-cols-3 gap-4"},Jl={class:"bg-slate-800/50 border border-slate-700 rounded-xl p-5"},Ql={class:"flex items-center gap-3 mb-3"},ql={class:"text-xs font-medium text-slate-400 uppercase tracking-wider"},Kl={class:"text-xs text-slate-400 mt-1"},Wl={class:"bg-slate-800/50 border border-slate-700 rounded-xl p-5"},Xl={class:"flex items-center gap-3 mb-3"},Yl={class:"text-xs font-medium text-slate-400 uppercase tracking-wider"},Zl={class:"text-xs text-slate-400 mt-1"},en={class:"bg-slate-800/50 border border-slate-700 rounded-xl p-5"},tn={class:"flex items-center gap-3 mb-3"},sn={class:"text-xs font-medium text-slate-400 uppercase tracking-wider"},an={class:"text-xs text-slate-400 mt-1"},on={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},ln={class:"bg-slate-800/50 border border-slate-700 rounded-xl p-5"},nn={class:"flex items-center gap-3 mb-4"},rn={class:"text-sm font-semibold text-white"},dn={class:"mb-4"},cn={class:"flex items-center justify-between mb-1.5"},un={class:"text-xs text-slate-400"},gn={class:"text-xs text-slate-500"},pn={class:"w-full h-2 bg-slate-700 rounded-full overflow-hidden"},mn={class:"text-xs text-slate-500 mt-1"},xn={class:"bg-slate-800/50 border border-slate-700 rounded-xl p-5"},bn={class:"flex items-center gap-3 mb-4"},hn={class:"text-sm font-semibold text-white"},fn={class:"flex items-center justify-between py-2 border-b border-slate-700/50"},vn={class:"text-xs text-slate-400"},_n={class:"flex items-center justify-between py-2 border-b border-slate-700/50"},yn={class:"text-xs text-slate-400"},wn={class:"flex items-center justify-between py-2 border-b border-slate-700/50"},kn={class:"text-xs text-slate-400"},$n={class:"flex items-center justify-between py-2"},Cn={class:"text-xs text-slate-400"},Mn={key:6,class:"fixed inset-0 z-50 flex items-center justify-center p-4"},zn={class:"relative w-full max-w-2xl bg-slate-800 border border-slate-700 rounded-2xl shadow-2xl max-h-[90vh] overflow-hidden flex flex-col"},jn={class:"px-6 py-4 border-b border-slate-700 flex items-center justify-between flex-shrink-0"},Vn={class:"text-lg font-semibold text-white"},Bn={class:"px-6 pt-4 border-b border-slate-700 flex-shrink-0"},Tn={class:"flex gap-4"},An=["onClick"],Ln={class:"flex-1 overflow-y-auto p-6 space-y-6"},Un={key:0,class:"space-y-5"},Sn={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},En={class:"block text-xs font-medium text-slate-400 mb-1.5"},Dn={class:"block text-xs font-medium text-slate-400 mb-1.5"},Hn={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Fn={class:"block text-xs font-medium text-slate-400 mb-1.5"},In={class:"block text-xs font-medium text-slate-400 mb-1.5"},Nn={class:"border-t border-slate-700/50 pt-4 mt-4"},Gn={class:"text-sm font-semibold text-white mb-3"},On={key:1,class:"space-y-5"},Rn={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Pn={class:"block text-xs font-medium text-slate-400 mb-1.5"},Jn={class:"block text-xs font-medium text-slate-400 mb-1.5"},Qn={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},qn={class:"block text-xs font-medium text-slate-400 mb-1.5"},Kn={key:2,class:"space-y-8"},Wn={class:"text-sm font-semibold text-white mb-3"},Xn={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Yn={class:"block text-xs font-medium text-slate-400 mb-1.5"},Zn={class:"block text-xs font-medium text-slate-400 mb-1.5"},ei={class:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4"},ti={class:"block text-xs font-medium text-slate-400 mb-1.5"},si={class:"block text-xs font-medium text-slate-400 mb-1.5"},ai={class:"mt-4"},oi={class:"block text-xs font-medium text-slate-400 mb-1.5"},li={class:"text-sm font-semibold text-white mb-3"},ni={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},ii={class:"block text-xs font-medium text-slate-400 mb-1.5"},ri={class:"block text-xs font-medium text-slate-400 mb-1.5"},di={class:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4"},ci={class:"block text-xs font-medium text-slate-400 mb-1.5"},ui={class:"block text-xs font-medium text-slate-400 mb-1.5"},gi={class:"mt-4"},pi={class:"block text-xs font-medium text-slate-400 mb-1.5"},mi={class:"px-6 py-4 border-t border-slate-700 flex items-center justify-end gap-3 flex-shrink-0"},xi=["disabled"],bi={key:0,class:"w-4 h-4 animate-spin",fill:"none",viewBox:"0 0 24 24"},hi={key:7,class:"fixed inset-0 z-50 flex items-center justify-center p-4"},fi={class:"relative w-full max-w-md bg-slate-800 border border-slate-700 rounded-2xl shadow-2xl p-6"},vi={class:"text-lg font-semibold text-white mb-4"},_i={class:"space-y-4"},yi={class:"block text-xs font-medium text-slate-400 mb-1.5"},wi=["placeholder"],ki={class:"block text-xs font-medium text-slate-400 mb-1.5"},$i={value:"member"},Ci={value:"manager"},Mi={value:"admin"},zi={class:"flex justify-end gap-3 mt-6"},ji=["disabled"],Vi={key:0,class:"w-4 h-4 animate-spin",fill:"none",viewBox:"0 0 24 24"},Bi={key:8,class:"fixed inset-0 z-50 flex items-center justify-center p-4"},Ti={class:"relative w-full max-w-md bg-slate-800 border border-slate-700 rounded-2xl shadow-2xl p-6"},Ai={class:"text-lg font-semibold text-white mb-4"},Li={class:"block text-xs font-medium text-slate-400 mb-1.5"},Ui={value:"member"},Si={value:"manager"},Ei={value:"admin"},Di={class:"flex justify-end gap-3 mt-6"},Hi=["disabled"],Fi={key:0,class:"w-4 h-4 animate-spin",fill:"none",viewBox:"0 0 24 24"},Ii={key:9,class:"fixed inset-0 z-50 overflow-y-auto","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true"},Ni={class:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0"},Gi={class:"inline-block align-bottom bg-slate-800 rounded-2xl px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl border border-slate-700 transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full sm:p-6"},Oi={class:"sm:flex sm:items-start"},Ri={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},Pi={class:"text-lg leading-6 font-medium text-white"},Ji={class:"mt-2"},Qi={class:"text-sm text-slate-400"},qi={class:"mt-5 sm:mt-4 sm:flex sm:flex-row-reverse gap-2"},Ki=["disabled"],Wi={key:0,class:"w-4 h-4 animate-spin mr-2",fill:"none",viewBox:"0 0 24 24"},Xi={key:0,class:"fixed top-4 right-4 z-[100] max-w-sm w-full bg-slate-800 border border-slate-700 shadow-lg rounded-xl pointer-events-auto overflow-hidden"},Yi={class:"p-4"},Zi={class:"flex items-start"},er={class:"flex-shrink-0"},tr={key:0,class:"h-6 w-6 text-green-400",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},sr={key:1,class:"h-6 w-6 text-red-400",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},ar={class:"ml-3 w-0 flex-1 pt-0.5"},or={class:"text-sm font-medium text-white"},lr={class:"ml-4 flex-shrink-0 flex"},dr=pe({__name:"index",setup(u){const V=Ie(),N=Ne(),y=fe(),z=V.params.id,H=v(!0),A=v(null),n=v(null),p=v([]),m=v("general"),B=v([]),j=v(!1),U=v(null),L=v(!1),$=v("basic"),ee=v(!1),b=v({full_name:"",name:"",display_name:"",email:"",phone:"",tax_number:"",reg_number:"",org_type:"",address_detail:{zip:null,city:null,street_name:null,street_type:null,house_number:null,stairwell:null,floor:null,door:null,parcel_id:null,full_address_text:null,latitude:null,longitude:null},contact_person_name:"",contact_email:"",contact_phone:"",billing_zip:"",billing_city:"",billing_street_name:"",billing_street_type:"",billing_house_number:"",notification_zip:"",notification_city:"",notification_street_name:"",notification_street_type:"",notification_house_number:""}),J=v(!1),F=v(""),Q=v("member"),q=v(!1),K=v(!1),W=v(null),le=v("member"),te=v(!1),se=v(!1),ae=v(null),oe=v(!1),I=v({show:!1,type:"success",message:""}),me=[{key:"general",label:"garages.details.generalTab"},{key:"employees",label:"garages.details.employeesTab"},{key:"fleet",label:"garages.details.fleetTab"},{key:"subscription",label:"garages.details.subscriptionTab"},{key:"analytics",label:"garages.details.analyticsTab"}],o=[{key:"basic",label:"garages.details.editBasicTab"},{key:"contact",label:"garages.details.editContactTab"},{key:"addresses",label:"garages.details.editAddressTab"}];function d(s){return!!(y.isAdmin||y.user?.system_capabilities?.[s]||y.user?.org_capabilities?.[z]?.[s])}const c=S(()=>n.value?.subscription?.asset_limit?n.value.subscription.asset_limit:5),h=S(()=>{const s=c.value;return s<=0?0:Math.min(100,Math.round(B.value.length/s*100))}),T=S(()=>{if(!n.value)return[];const s=[],a=n.value,g=a.org_type==="individual";return g||a.tax_number||s.push({key:"tax_number",label:"garages.details.missing_tax_number"}),!a.contact_email&&!a.email&&s.push({key:"contact_email",label:"garages.details.missing_contact_email"}),!a.contact_phone&&!a.phone&&s.push({key:"contact_phone",label:"garages.details.missing_contact_phone"}),g||(!a.billing_city||!a.billing_zip)&&s.push({key:"billing",label:"garages.details.missing_billing"}),s});async function C(){H.value=!0,A.value=null;try{const g={Authorization:`Bearer ${(Z("access_token").value||y.token||"").trim()}`,"Content-Type":"application/json"},f=await fetch(`/api/v1/admin/organizations/${z}/details`,{headers:g});if(!f.ok)throw new Error(`Failed to fetch organization: ${f.status}`);const Y=await f.json();n.value=Y,p.value=Y.members||[]}catch(s){A.value=s.message||"Failed to load garage details"}finally{H.value=!1}}async function G(){j.value=!0;try{const a=(Z("access_token").value||y.token||"").trim(),g=await fetch(`/api/v1/admin/organizations/${z}/vehicles`,{headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json"}});if(!g.ok)throw new Error(`Failed to fetch fleet: ${g.status}`);const f=await g.json();B.value=f.vehicles||[]}catch(s){console.error("Fleet fetch error:",s),B.value=[]}finally{j.value=!1}}function O(){if(!n.value)return;const s=n.value.address_detail||{};b.value={full_name:n.value.full_name||"",name:n.value.name||"",display_name:n.value.display_name||"",email:n.value.email||"",phone:n.value.phone||"",tax_number:n.value.tax_number||"",reg_number:n.value.reg_number||"",org_type:n.value.org_type||"",address_detail:{zip:s.zip||s.address_zip||null,city:s.city||null,street_name:s.street_name||s.address_street_name||null,street_type:s.street_type||s.address_street_type||null,house_number:s.house_number||s.address_house_number||null,stairwell:s.stairwell||null,floor:s.floor||null,door:s.door||null,parcel_id:s.parcel_id||null,full_address_text:s.full_address_text||null,latitude:s.latitude??null,longitude:s.longitude??null},contact_person_name:n.value.contact_person_name||"",contact_email:n.value.contact_email||"",contact_phone:n.value.contact_phone||"",billing_zip:n.value.billing_zip||"",billing_city:n.value.billing_city||"",billing_street_name:n.value.billing_street_name||"",billing_street_type:n.value.billing_street_type||"",billing_house_number:n.value.billing_house_number||"",notification_zip:n.value.notification_zip||"",notification_city:n.value.notification_city||"",notification_street_name:n.value.notification_street_name||"",notification_street_type:n.value.notification_street_type||"",notification_house_number:n.value.notification_house_number||""},$.value="basic",L.value=!0}function E(){L.value=!1}async function ne(){ee.value=!0;try{const a=(Z("access_token").value||y.token||"").trim(),g=b.value,f={full_name:g.full_name||void 0,name:g.name||void 0,display_name:g.display_name||void 0,email:g.email||void 0,phone:g.phone||void 0,tax_number:g.tax_number||void 0,reg_number:g.reg_number||void 0,org_type:g.org_type||void 0,contact_person_name:g.contact_person_name||void 0,contact_email:g.contact_email||void 0,contact_phone:g.contact_phone||void 0,billing_zip:g.billing_zip||void 0,billing_city:g.billing_city||void 0,billing_street_name:g.billing_street_name||void 0,billing_street_type:g.billing_street_type||void 0,billing_house_number:g.billing_house_number||void 0,notification_zip:g.notification_zip||void 0,notification_city:g.notification_city||void 0,notification_street_name:g.notification_street_name||void 0,notification_street_type:g.notification_street_type||void 0,notification_house_number:g.notification_house_number||void 0,address_detail:{zip:g.address_detail.zip,city:g.address_detail.city,street_name:g.address_detail.street_name,street_type:g.address_detail.street_type,house_number:g.address_detail.house_number,stairwell:g.address_detail.stairwell,floor:g.address_detail.floor,door:g.address_detail.door,parcel_id:g.address_detail.parcel_id,full_address_text:g.address_detail.full_address_text,latitude:g.address_detail.latitude,longitude:g.address_detail.longitude}};for(const l of Object.keys(f))f[l]===void 0&&delete f[l];f.address_detail&&Object.values(f.address_detail).every(l=>l==null)&&delete f.address_detail,n.value?.org_type==="individual"&&(f.contact_email&&!f.email&&(f.email=f.contact_email),f.contact_phone&&!f.phone&&(f.phone=f.contact_phone));const Y=await fetch(`/api/v1/admin/organizations/${z}`,{method:"PUT",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json"},body:JSON.stringify(f)});if(!Y.ok)throw new Error(`Save failed: ${Y.status}`);const re=await Y.json();re.organization?n.value={...n.value,...re.organization}:n.value={...n.value,...re},E(),X("success","Garage updated successfully"),await C()}catch(s){X("error",s.message||"Failed to save")}finally{ee.value=!1}}async function R(){if(F.value){q.value=!0;try{const a=(Z("access_token").value||y.token||"").trim(),g=await fetch(`/api/v1/admin/organizations/${z}/members`,{method:"POST",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json"},body:JSON.stringify({email:F.value,role:Q.value})});if(!g.ok){const f=await g.json().catch(()=>({}));throw new Error(f.detail||`Add member failed: ${g.status}`)}J.value=!1,F.value="",Q.value="member",X("success","Member added successfully"),await C()}catch(s){X("error",s.message||"Failed to add member")}finally{q.value=!1}}}function ie(s){W.value=s,le.value=s.role||"member",K.value=!0}async function de(){if(W.value){te.value=!0;try{const a=(Z("access_token").value||y.token||"").trim(),g=await fetch(`/api/v1/admin/organizations/${z}/members/${W.value.id}`,{method:"PUT",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json"},body:JSON.stringify({role:le.value})});if(!g.ok)throw new Error(`Update role failed: ${g.status}`);K.value=!1,W.value=null,X("success","Role updated successfully"),await C()}catch(s){X("error",s.message||"Failed to update role")}finally{te.value=!1}}}function xe(s){ae.value=s,se.value=!0}async function $e(){if(ae.value){oe.value=!0;try{const a=(Z("access_token").value||y.token||"").trim(),g=await fetch(`/api/v1/admin/organizations/${z}/members/${ae.value.id}`,{method:"DELETE",headers:{Authorization:`Bearer ${a}`}});if(!g.ok)throw new Error(`Remove failed: ${g.status}`);se.value=!1,ae.value=null,X("success","Member removed successfully"),await C()}catch(s){X("error",s.message||"Failed to remove member")}finally{oe.value=!1}}}function X(s,a){I.value={show:!0,type:s,message:a},setTimeout(()=>{I.value.show=!1},4e3)}function Ce(){N.push("/garages")}const Me=S(()=>n.value?(n.value.display_name||n.value.name||n.value.full_name||"").replace(/[\s-]*#\d+\s*$/g,"").trim()||"Garage #"+n.value.id:"");function ve(){return n.value?n.value.name||n.value.email||n.value.full_name||"Garage #"+n.value.id:""}function _e(s){return s?s.split(" ").map(a=>a[0]).join("").toUpperCase().slice(0,2):"?"}function ye(s){const a=["bg-red-500","bg-yellow-500","bg-green-500","bg-blue-500","bg-indigo-500","bg-purple-500","bg-pink-500","bg-teal-500"];let g=0;for(let f=0;f<(s||"").length;f++)g=s.charCodeAt(f)+((g<<5)-g);return a[Math.abs(g)%a.length]}function ze(s){return{active:"Active",inactive:"Inactive",suspended:"Suspended",pending:"Pending"}[s?.toLowerCase()]||s}function je(s){return{active:"bg-green-100 text-green-800",inactive:"bg-gray-100 text-gray-800",suspended:"bg-red-100 text-red-800",pending:"bg-yellow-100 text-yellow-800"}[s?.toLowerCase()]||"bg-gray-100 text-gray-800"}function Ve(s){return{active:"bg-green-400",inactive:"bg-gray-400",suspended:"bg-red-400",pending:"bg-yellow-400"}[s?.toLowerCase()]||"bg-gray-400"}function ce(s){if(!s)return"";if(s.display_name)return s.display_name;if(s.name)return s.name;if(s.email)return s.email;if(s.person){const a=s.person.first_name||"",f=`${s.person.last_name||""} ${a}`.trim();if(f)return f;if(s.person.email)return s.person.email}return s.user_id?String(s.user_id):"Unknown"}function Be(s){return{admin:"Admin",manager:"Manager",member:"Member",owner:"Owner"}[s?.toLowerCase()]||s||"Member"}function Te(s){return{admin:"bg-purple-100 text-purple-800",manager:"bg-blue-100 text-blue-800",member:"bg-green-100 text-green-800",owner:"bg-yellow-100 text-yellow-800"}[s?.toLowerCase()]||"bg-gray-100 text-gray-800"}function Ae(s){return{active:"Active",invited:"Invited",suspended:"Suspended",inactive:"Inactive"}[s?.toLowerCase()]||s||"Unknown"}function Le(s){return{active:"bg-green-100 text-green-800",invited:"bg-blue-100 text-blue-800",suspended:"bg-red-100 text-red-800",inactive:"bg-gray-100 text-gray-800"}[s?.toLowerCase()]||"bg-gray-100 text-gray-800"}function Ue(s){return{active:"bg-green-400",invited:"bg-blue-400",suspended:"bg-red-400",inactive:"bg-gray-400"}[s?.toLowerCase()]||"bg-gray-400"}return we(()=>{C()}),ke(m,s=>{(s==="fleet"||s==="analytics"||s==="subscription")&&B.value.length===0&&G(),s==="subscription"&&U.value?.fetchTiers()}),(s,a)=>{const g=Gt,f=ys,Y=Mo,re=Ge;return i(),r("div",null,[H.value?(i(),r("div",zo,[e("div",jo,[a[29]||(a[29]=e("svg",{class:"w-8 h-8 text-indigo-400 animate-spin",fill:"none",viewBox:"0 0 24 24"},[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})],-1)),e("p",Vo,t(s.$t("garages.details.loading")),1)])])):A.value?(i(),r("div",Bo,[a[30]||(a[30]=e("svg",{class:"w-12 h-12 text-red-500 mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),e("p",To,t(A.value),1),e("button",{onClick:C,class:"px-4 py-2 text-sm bg-indigo-600/20 text-indigo-300 hover:bg-indigo-600/30 rounded-lg transition"},t(s.$t("garages.details.retry")),1)])):n.value?(i(),r(D,{key:2},[T.value.length>0?(i(),r("div",Ao,[e("div",Lo,[a[32]||(a[32]=e("div",{class:"p-1.5 rounded-lg bg-amber-500/20 text-amber-400 flex-shrink-0"},[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})])],-1)),e("div",Uo,[e("div",So,[e("p",Eo,t(s.$t("garages.details.missing_data_title")),1),e("span",Do,t(s.$t("garages.details.missing_data_count",{count:T.value.length})),1)]),e("p",Ho,t(n.value.status!=="active"?s.$t("garages.details.missing_data_activation_required"):s.$t("garages.details.missing_data_desc")),1),e("div",Fo,[(i(!0),r(D,null,P(T.value,l=>(i(),r("span",{key:l.key,class:"inline-flex items-center gap-1 px-2.5 py-1 rounded-md text-xs font-medium bg-amber-500/10 text-amber-300"},[a[31]||(a[31]=e("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)),w(" "+t(s.$t(l.label)),1)]))),128))])])])])):x("",!0),e("div",Io,[e("button",{onClick:Ce,class:"inline-flex items-center gap-1.5 text-sm text-slate-400 hover:text-white transition mb-4"},[a[33]||(a[33]=e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)),w(" "+t(s.$t("garages.details.back")),1)]),e("div",No,[e("div",Go,[e("div",{class:M(["w-12 h-12 rounded-xl flex items-center justify-center text-lg font-bold text-white",ye(ve())])},t(_e(ve())),3),e("div",null,[e("div",Oo,[e("h1",Ro,t(Me.value),1),e("span",{class:M(["inline-flex items-center px-3 py-1 rounded-full text-xs font-medium",je(n.value.status)])},[e("span",{class:M(["w-1.5 h-1.5 rounded-full mr-1.5",Ve(n.value.status)])},null,2),w(" "+t(ze(n.value.status)),1)],2)]),e("p",Po,[w(t(n.value.full_name)+" ",1),n.value.tax_number?(i(),r("span",Jo,"· "+t(s.$t("garages.details.tax_number"))+": "+t(n.value.tax_number),1)):x("",!0)])])]),e("div",Qo,[d("org:edit")?(i(),r("button",{key:0,onClick:O,class:"inline-flex items-center gap-1.5 px-4 py-2 text-sm font-medium bg-indigo-600/20 text-indigo-300 hover:bg-indigo-600/30 rounded-lg transition"},[a[34]||(a[34]=e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})],-1)),w(" "+t(s.$t("garages.details.edit_details")),1)])):x("",!0)])])]),e("div",qo,[e("nav",Ko,[(i(),r(D,null,P(me,l=>e("button",{key:l.key,onClick:be=>m.value=l.key,class:M(["pb-3 text-sm font-medium transition border-b-2 -mb-px",m.value===l.key?"text-indigo-400 border-indigo-400":"text-slate-400 border-transparent hover:text-slate-300"])},t(s.$t(l.label)),11,Wo)),64))])]),m.value==="general"?(i(),ue(g,{key:1,garage:n.value},null,8,["garage"])):x("",!0),m.value==="employees"?(i(),r("div",Xo,[e("div",Yo,[e("div",Zo,[a[35]||(a[35]=e("div",{class:"p-2 rounded-lg bg-cyan-500/10 text-cyan-400"},[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197m13.5-9a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z"})])],-1)),e("div",null,[e("h3",el,t(s.$t("garages.employees.title")),1),e("p",tl,t(s.$t("garages.employees.total_count",{count:p.value.length})),1)])]),d("org:manage-members")?(i(),r("button",{key:0,onClick:a[0]||(a[0]=(...l)=>s.openAddEmployeeModal&&s.openAddEmployeeModal(...l)),class:"inline-flex items-center gap-1.5 px-4 py-2 text-sm font-medium bg-emerald-600/20 text-emerald-300 hover:bg-emerald-600/30 rounded-lg transition"},[a[36]||(a[36]=e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z"})],-1)),w(" "+t(s.$t("garages.employees.add_employee")),1)])):x("",!0)]),e("div",sl,[e("div",al,[e("table",ol,[e("thead",null,[e("tr",ll,[e("th",nl,t(s.$t("garages.employees.name")),1),e("th",il,t(s.$t("garages.employees.email_phone")),1),e("th",rl,t(s.$t("garages.employees.role")),1),e("th",dl,t(s.$t("garages.employees.status")),1),e("th",cl,t(s.$t("garages.employees.actions")),1)])]),e("tbody",null,[(i(!0),r(D,null,P(p.value,l=>(i(),r("tr",{key:l.id,class:"border-b border-slate-700/50 last:border-b-0 hover:bg-slate-700/30 transition"},[e("td",ul,[e("div",gl,[e("div",{class:M(["w-8 h-8 rounded-lg flex items-center justify-center text-xs font-bold text-white flex-shrink-0",ye(ce(l))])},t(_e(ce(l))),3),e("div",null,[e("p",pl,t(ce(l)),1),e("p",ml,"ID: "+t(l.user_id||l.id),1),e("div",xl,[e("span",null,[a[37]||(a[37]=w("User_id: ",-1)),e("span",bl,t(l.user_id||"N/A"),1)]),e("span",null,[a[38]||(a[38]=w("Person_id: ",-1)),e("span",hl,t(l.person?.id||"N/A"),1)])])])])]),e("td",fl,[e("div",vl,[l.person?.email?(i(),r("p",_l,t(l.person.email),1)):(i(),r("p",yl,"—")),l.person?.phone?(i(),r("p",wl,t(l.person.phone),1)):x("",!0)])]),e("td",kl,[e("span",{class:M(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",Te(l.role)])},t(Be(l.role)),3)]),e("td",$l,[e("span",{class:M(["inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-medium",Le(l.status)])},[e("span",{class:M(["w-1.5 h-1.5 rounded-full",Ue(l.status)])},null,2),w(" "+t(Ae(l.status)),1)],2)]),e("td",Cl,[e("div",Ml,[d("org:manage-members")?(i(),r("button",{key:0,onClick:be=>ie(l),class:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-indigo-300 bg-indigo-500/10 hover:bg-indigo-500/20 rounded-lg transition"},[a[39]||(a[39]=e("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})],-1)),w(" "+t(s.$t("garages.employees.edit_role")),1)],8,zl)):x("",!0),d("org:manage-members")?(i(),r("button",{key:1,onClick:be=>xe(l),class:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-red-300 bg-red-500/10 hover:bg-red-500/20 rounded-lg transition"},[a[40]||(a[40]=e("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)),w(" "+t(s.$t("garages.employees.remove")),1)],8,jl)):x("",!0)])])]))),128)),p.value.length===0?(i(),r("tr",Vl,[e("td",Bl,[a[41]||(a[41]=e("svg",{class:"w-10 h-10 text-slate-600 mx-auto mb-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"})],-1)),e("p",Tl,t(s.$t("garages.employees.no_employees")),1)])])):x("",!0)])])])])])):x("",!0),m.value==="fleet"?(i(),ue(f,{key:3,garage:n.value,"org-id":Ee(z),"fleet-vehicles":B.value,"fleet-loading":j.value},null,8,["garage","org-id","fleet-vehicles","fleet-loading"])):x("",!0),m.value==="subscription"?(i(),ue(Y,{key:4,ref_key:"subscriptionTabRef",ref:U,garage:n.value,"fleet-vehicles":B.value,onRefresh:C},null,8,["garage","fleet-vehicles"])):x("",!0),m.value==="analytics"?(i(),r("div",Al,[e("div",Ll,[e("div",Ul,[e("div",Sl,[a[42]||(a[42]=e("div",{class:"p-2 rounded-lg bg-emerald-500/10 text-emerald-400"},[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"})])],-1)),e("span",El,t(s.$t("garages.analytics.ltv")),1)]),a[43]||(a[43]=e("p",{class:"text-2xl font-bold text-white"},"150 000 Ft",-1)),a[44]||(a[44]=e("p",{class:"text-xs text-emerald-400 mt-1 flex items-center gap-1"},[e("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 10l7-7m0 0l7 7m-7-7v18"})]),w(" +12% ezen a hónapon ")],-1))]),e("div",Dl,[e("div",Hl,[a[45]||(a[45]=e("div",{class:"p-2 rounded-lg bg-blue-500/10 text-blue-400"},[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1)),e("span",Fl,t(s.$t("garages.analytics.mrr")),1)]),a[46]||(a[46]=e("p",{class:"text-2xl font-bold text-white"},"15 000 Ft",-1)),e("p",Il,t(s.$t("garages.analytics.monthly_recurring")),1)]),e("div",Nl,[e("div",Gl,[a[47]||(a[47]=e("div",{class:"p-2 rounded-lg bg-amber-500/10 text-amber-400"},[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 14l6-6m-5.5.5h.01m4.99 5h.01M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16l3.5-2 3.5 2 3.5-2 3.5 2zM10 8.5a.5.5 0 11-1 0 .5.5 0 011 0zm5 5a.5.5 0 11-1 0 .5.5 0 011 0z"})])],-1)),e("span",Ol,t(s.$t("garages.analytics.outstanding")),1)]),a[49]||(a[49]=e("p",{class:"text-2xl font-bold text-white"},"0 Ft",-1)),e("p",Rl,[a[48]||(a[48]=e("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),w(" "+t(s.$t("garages.analytics.all_settled")),1)])])]),e("div",Pl,[e("div",Jl,[e("div",Ql,[a[50]||(a[50]=e("div",{class:"p-2 rounded-lg bg-yellow-500/10 text-yellow-400"},[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})])],-1)),e("span",ql,t(s.$t("garages.analytics.earned_credits")),1)]),a[51]||(a[51]=e("p",{class:"text-2xl font-bold text-yellow-300"},"450 XP",-1)),e("p",Kl,t(s.$t("garages.analytics.contribution_xp")),1)]),e("div",Wl,[e("div",Xl,[a[52]||(a[52]=e("div",{class:"p-2 rounded-lg bg-purple-500/10 text-purple-400"},[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z"})])],-1)),e("span",Yl,t(s.$t("garages.analytics.invited_companies")),1)]),a[53]||(a[53]=e("p",{class:"text-2xl font-bold text-white"},"12",-1)),e("p",Zl,t(s.$t("garages.analytics.companies_joined")),1)]),e("div",en,[e("div",tn,[a[54]||(a[54]=e("div",{class:"p-2 rounded-lg bg-cyan-500/10 text-cyan-400"},[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})])],-1)),e("span",sn,t(s.$t("garages.analytics.validated_garages")),1)]),a[55]||(a[55]=e("p",{class:"text-2xl font-bold text-white"},"8",-1)),e("p",an,t(s.$t("garages.analytics.garages_confirmed")),1)])]),e("div",on,[e("div",ln,[e("div",nn,[a[56]||(a[56]=e("div",{class:"p-2 rounded-lg bg-indigo-500/10 text-indigo-400"},[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})])],-1)),e("h3",rn,t(s.$t("garages.analytics.utilization")),1)]),e("div",dn,[e("div",cn,[e("span",un,t(s.$t("garages.analytics.vehicle_quota")),1),e("span",gn,t(B.value.length)+" / "+t(c.value),1)]),e("div",pn,[e("div",{class:M(["h-full rounded-full transition-all duration-500",h.value>=90?"bg-red-500":h.value>=70?"bg-amber-500":"bg-blue-500"]),style:ge({width:h.value+"%"})},null,6)]),e("p",mn,t(h.value)+"% "+t(s.$t("garages.analytics.utilized")),1)])]),e("div",xn,[e("div",bn,[a[57]||(a[57]=e("div",{class:"p-2 rounded-lg bg-pink-500/10 text-pink-400"},[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 3.055A9.001 9.001 0 1020.945 13H11V3.055z"}),e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20.488 9H15V3.512A9.025 9.025 0 0120.488 9z"})])],-1)),e("h3",hn,t(s.$t("garages.analytics.marketplace_engagement")),1)]),e("div",fn,[e("span",vn,t(s.$t("garages.analytics.avg_rating")),1),a[58]||(a[58]=e("div",{class:"flex items-center gap-1"},[e("svg",{class:"w-4 h-4 text-yellow-400",fill:"currentColor",viewBox:"0 0 20 20"},[e("path",{d:"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"})]),e("span",{class:"text-sm font-medium text-white"},"4.8")],-1))]),e("div",_n,[e("span",yn,t(s.$t("garages.analytics.total_reviews")),1),a[59]||(a[59]=e("span",{class:"text-sm font-medium text-white"},"124",-1))]),e("div",wn,[e("span",kn,t(s.$t("garages.analytics.service_requests")),1),a[60]||(a[60]=e("span",{class:"text-sm font-medium text-white"},"47",-1))]),e("div",$n,[e("span",Cn,t(s.$t("garages.analytics.response_rate")),1),a[61]||(a[61]=e("span",{class:"text-sm font-medium text-emerald-400"},"92%",-1))])])])])):x("",!0),L.value?(i(),r("div",Mn,[e("div",{class:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:E}),e("div",zn,[e("div",jn,[e("h3",Vn,t(s.$t("garages.details.edit_details")),1),e("button",{onClick:E,class:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-700 transition"},[...a[62]||(a[62]=[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),e("div",Bn,[e("nav",Tn,[(i(),r(D,null,P(o,l=>e("button",{key:l.key,onClick:be=>$.value=l.key,class:M(["pb-3 text-sm font-medium transition border-b-2 -mb-px",$.value===l.key?"text-indigo-400 border-indigo-400":"text-slate-400 border-transparent hover:text-slate-300"])},t(s.$t(l.label)),11,An)),64))])]),e("div",Ln,[$.value==="basic"?(i(),r("div",Un,[e("div",Sn,[e("div",null,[e("label",En,t(s.$t("garages.details.company_name")),1),_(e("input",{"onUpdate:modelValue":a[1]||(a[1]=l=>b.value.full_name=l),type:"text",class:"w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"},null,512),[[k,b.value.full_name]])]),e("div",null,[e("label",Dn,t(s.$t("garages.details.display_name")),1),_(e("input",{"onUpdate:modelValue":a[2]||(a[2]=l=>b.value.display_name=l),type:"text",class:"w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"},null,512),[[k,b.value.display_name]])])]),e("div",Hn,[e("div",null,[e("label",Fn,t(s.$t("garages.details.tax_number")),1),_(e("input",{"onUpdate:modelValue":a[3]||(a[3]=l=>b.value.tax_number=l),type:"text",class:"w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"},null,512),[[k,b.value.tax_number]])]),e("div",null,[e("label",In,t(s.$t("garages.details.reg_number")),1),_(e("input",{"onUpdate:modelValue":a[4]||(a[4]=l=>b.value.reg_number=l),type:"text",class:"w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"},null,512),[[k,b.value.reg_number]])])]),e("div",Nn,[e("h4",Gn,t(s.$t("garages.details.address")),1),b.value.address_detail?(i(),ue(re,{key:0,modelValue:b.value.address_detail,"onUpdate:modelValue":a[5]||(a[5]=l=>b.value.address_detail=l)},null,8,["modelValue"])):x("",!0)])])):x("",!0),$.value==="contact"?(i(),r("div",On,[e("div",Rn,[e("div",null,[e("label",Pn,t(s.$t("garages.details.contact_person")),1),_(e("input",{"onUpdate:modelValue":a[6]||(a[6]=l=>b.value.contact_person_name=l),type:"text",class:"w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"},null,512),[[k,b.value.contact_person_name]])]),e("div",null,[e("label",Jn,t(s.$t("garages.details.contact_email")),1),_(e("input",{"onUpdate:modelValue":a[7]||(a[7]=l=>b.value.contact_email=l),type:"email",class:"w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"},null,512),[[k,b.value.contact_email]])])]),e("div",Qn,[e("div",null,[e("label",qn,t(s.$t("garages.details.contact_phone")),1),_(e("input",{"onUpdate:modelValue":a[8]||(a[8]=l=>b.value.contact_phone=l),type:"text",class:"w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"},null,512),[[k,b.value.contact_phone]])])])])):x("",!0),$.value==="addresses"?(i(),r("div",Kn,[e("div",null,[e("h4",Wn,t(s.$t("garages.details.billing_address")),1),e("div",Xn,[e("div",null,[e("label",Yn,t(s.$t("garages.details.zip")),1),_(e("input",{"onUpdate:modelValue":a[9]||(a[9]=l=>b.value.billing_zip=l),type:"text",class:"w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"},null,512),[[k,b.value.billing_zip]])]),e("div",null,[e("label",Zn,t(s.$t("garages.details.city")),1),_(e("input",{"onUpdate:modelValue":a[10]||(a[10]=l=>b.value.billing_city=l),type:"text",class:"w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"},null,512),[[k,b.value.billing_city]])])]),e("div",ei,[e("div",null,[e("label",ti,t(s.$t("garages.details.street_name")),1),_(e("input",{"onUpdate:modelValue":a[11]||(a[11]=l=>b.value.billing_street_name=l),type:"text",class:"w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"},null,512),[[k,b.value.billing_street_name]])]),e("div",null,[e("label",si,t(s.$t("garages.details.street_type")),1),_(e("input",{"onUpdate:modelValue":a[12]||(a[12]=l=>b.value.billing_street_type=l),type:"text",class:"w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"},null,512),[[k,b.value.billing_street_type]])])]),e("div",ai,[e("label",oi,t(s.$t("garages.details.house_number")),1),_(e("input",{"onUpdate:modelValue":a[13]||(a[13]=l=>b.value.billing_house_number=l),type:"text",class:"w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"},null,512),[[k,b.value.billing_house_number]])])]),e("div",null,[e("h4",li,t(s.$t("garages.details.notification_address")),1),e("div",ni,[e("div",null,[e("label",ii,t(s.$t("garages.details.zip")),1),_(e("input",{"onUpdate:modelValue":a[14]||(a[14]=l=>b.value.notification_zip=l),type:"text",class:"w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"},null,512),[[k,b.value.notification_zip]])]),e("div",null,[e("label",ri,t(s.$t("garages.details.city")),1),_(e("input",{"onUpdate:modelValue":a[15]||(a[15]=l=>b.value.notification_city=l),type:"text",class:"w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"},null,512),[[k,b.value.notification_city]])])]),e("div",di,[e("div",null,[e("label",ci,t(s.$t("garages.details.street_name")),1),_(e("input",{"onUpdate:modelValue":a[16]||(a[16]=l=>b.value.notification_street_name=l),type:"text",class:"w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"},null,512),[[k,b.value.notification_street_name]])]),e("div",null,[e("label",ui,t(s.$t("garages.details.street_type")),1),_(e("input",{"onUpdate:modelValue":a[17]||(a[17]=l=>b.value.notification_street_type=l),type:"text",class:"w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"},null,512),[[k,b.value.notification_street_type]])])]),e("div",gi,[e("label",pi,t(s.$t("garages.details.house_number")),1),_(e("input",{"onUpdate:modelValue":a[18]||(a[18]=l=>b.value.notification_house_number=l),type:"text",class:"w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"},null,512),[[k,b.value.notification_house_number]])])])])):x("",!0)]),e("div",mi,[e("button",{onClick:E,class:"px-4 py-2 text-sm font-medium text-slate-300 hover:text-white bg-slate-700/50 hover:bg-slate-700 rounded-lg transition"},t(s.$t("garages.details.cancel")),1),e("button",{onClick:ne,disabled:ee.value,class:"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-500 rounded-lg transition disabled:opacity-50 disabled:cursor-not-allowed"},[ee.value?(i(),r("svg",bi,[...a[63]||(a[63]=[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"},null,-1)])])):x("",!0),w(" "+t(ee.value?s.$t("garages.details.saving"):s.$t("garages.details.save")),1)],8,xi)])])])):x("",!0),J.value?(i(),r("div",hi,[e("div",{class:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:a[19]||(a[19]=l=>J.value=!1)}),e("div",fi,[e("h3",vi,t(s.$t("garages.employees.add_employee")),1),e("div",_i,[e("div",null,[e("label",yi,t(s.$t("garages.employees.email")),1),_(e("input",{"onUpdate:modelValue":a[20]||(a[20]=l=>F.value=l),type:"email",class:"w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500",placeholder:s.$t("garages.employees.email_placeholder")},null,8,wi),[[k,F.value]])]),e("div",null,[e("label",ki,t(s.$t("garages.employees.role")),1),_(e("select",{"onUpdate:modelValue":a[21]||(a[21]=l=>Q.value=l),class:"w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"},[e("option",$i,t(s.$t("garages.roles.member")),1),e("option",Ci,t(s.$t("garages.roles.manager")),1),e("option",Mi,t(s.$t("garages.roles.admin")),1)],512),[[he,Q.value]])])]),e("div",zi,[e("button",{onClick:a[22]||(a[22]=l=>J.value=!1),class:"px-4 py-2 text-sm font-medium text-slate-300 hover:text-white bg-slate-700/50 hover:bg-slate-700 rounded-lg transition"},t(s.$t("garages.employees.cancel")),1),e("button",{onClick:R,disabled:q.value||!F.value,class:"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-emerald-600 hover:bg-emerald-500 rounded-lg transition disabled:opacity-50 disabled:cursor-not-allowed"},[q.value?(i(),r("svg",Vi,[...a[64]||(a[64]=[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"},null,-1)])])):x("",!0),w(" "+t(q.value?s.$t("garages.employees.adding"):s.$t("garages.employees.add")),1)],8,ji)])])])):x("",!0),K.value?(i(),r("div",Bi,[e("div",{class:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:a[23]||(a[23]=l=>K.value=!1)}),e("div",Ti,[e("h3",Ai,t(s.$t("garages.employees.edit_role")),1),e("div",null,[e("label",Li,t(s.$t("garages.employees.role")),1),_(e("select",{"onUpdate:modelValue":a[24]||(a[24]=l=>le.value=l),class:"w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"},[e("option",Ui,t(s.$t("garages.roles.member")),1),e("option",Si,t(s.$t("garages.roles.manager")),1),e("option",Ei,t(s.$t("garages.roles.admin")),1)],512),[[he,le.value]])]),e("div",Di,[e("button",{onClick:a[25]||(a[25]=l=>K.value=!1),class:"px-4 py-2 text-sm font-medium text-slate-300 hover:text-white bg-slate-700/50 hover:bg-slate-700 rounded-lg transition"},t(s.$t("garages.employees.cancel")),1),e("button",{onClick:de,disabled:te.value,class:"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-500 rounded-lg transition disabled:opacity-50 disabled:cursor-not-allowed"},[te.value?(i(),r("svg",Fi,[...a[65]||(a[65]=[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"},null,-1)])])):x("",!0),w(" "+t(te.value?s.$t("garages.employees.saving"):s.$t("garages.employees.save")),1)],8,Hi)])])])):x("",!0),se.value?(i(),r("div",Ii,[e("div",Ni,[e("div",{class:"fixed inset-0 bg-black/60 backdrop-blur-sm transition-opacity",onClick:a[26]||(a[26]=l=>se.value=!1)}),a[68]||(a[68]=e("span",{class:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true"},"",-1)),e("div",Gi,[e("div",Oi,[a[66]||(a[66]=e("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-500/20 sm:mx-0 sm:h-10 sm:w-10"},[e("svg",{class:"h-6 w-6 text-red-400",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"})])],-1)),e("div",Ri,[e("h3",Pi,t(s.$t("garages.employees.removeTitle")),1),e("div",Ji,[e("p",Qi,t(s.$t("garages.employees.removeConfirm",{name:ce(ae.value)})),1)])])]),e("div",qi,[e("button",{onClick:$e,disabled:oe.value,type:"button",class:"w-full inline-flex justify-center rounded-xl border border-transparent shadow-sm px-4 py-2.5 bg-red-600 text-base font-medium text-white hover:bg-red-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:w-auto sm:text-sm disabled:opacity-50 disabled:cursor-not-allowed transition"},[oe.value?(i(),r("svg",Wi,[...a[67]||(a[67]=[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"},null,-1)])])):x("",!0),w(" "+t(oe.value?s.$t("garages.employees.removing"):s.$t("garages.employees.remove")),1)],8,Ki),e("button",{onClick:a[27]||(a[27]=l=>se.value=!1),type:"button",class:"mt-3 w-full inline-flex justify-center rounded-xl border border-slate-600 shadow-sm px-4 py-2.5 bg-slate-700/50 text-base font-medium text-slate-300 hover:bg-slate-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:w-auto sm:text-sm transition"},t(s.$t("garages.employees.cancel")),1)])])])])):x("",!0),De(Fe,{"enter-active-class":"transition ease-out duration-300","enter-from-class":"translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2","enter-to-class":"translate-y-0 opacity-100 sm:translate-x-0","leave-active-class":"transition ease-in duration-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:He(()=>[I.value.show?(i(),r("div",Xi,[e("div",Yi,[e("div",Zi,[e("div",er,[I.value.type==="success"?(i(),r("svg",tr,[...a[69]||(a[69]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])])):x("",!0),I.value.type==="error"?(i(),r("svg",sr,[...a[70]||(a[70]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z"},null,-1)])])):x("",!0)]),e("div",ar,[e("p",or,t(I.value.message),1)]),e("div",lr,[e("button",{onClick:a[28]||(a[28]=l=>I.value.show=!1),class:"bg-slate-700/50 rounded-md inline-flex text-slate-400 hover:text-slate-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"},[...a[71]||(a[71]=[e("span",{class:"sr-only"},"Close",-1),e("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)])])])])])])):x("",!0)]),_:1})],64)):x("",!0)])}}});export{dr as default};
|