Files
service-finder/frontend_admin/.output/public/_nuxt/CBgSvLGj.js
2026-07-01 02:27:38 +00:00

2 lines
88 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{e as ge,c as r,a as e,t,j as p,d as w,m as S,o as i,s as fe,F as H,r as P,k as z,g as ye,B as we,h as ee,n as ue,y as b,C as be,z as v,l as h,J as Ue,L as xe,i as Se,b as Ee,w as De,T as He,K as Fe,D as Ie}from"./Duy9QquX.js";const Ne={class:"space-y-6"},Ge={class:"bg-slate-800/50 border border-slate-700 rounded-xl overflow-hidden"},Re={class:"px-6 py-4 border-b border-slate-700 flex items-center gap-3"},Oe={class:"text-base font-semibold text-white"},Pe={class:"px-6 py-5"},Je={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},Qe={class:"space-y-4"},qe={class:"text-xs text-slate-500 uppercase tracking-wider"},Ke={class:"text-sm text-white mt-1"},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:"space-y-4"},tt={class:"text-xs text-slate-500 uppercase tracking-wider"},st={class:"text-sm text-white mt-1"},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:"mt-6 pt-6 border-t border-slate-700/50"},rt={class:"text-xs text-slate-500 uppercase tracking-wider mb-3"},dt={class:"text-sm text-white"},ct={key:0,class:"mt-4 pt-4 border-t border-slate-700/50"},ut={class:"text-xs text-slate-500 uppercase tracking-wider mb-3"},gt={class:"text-sm text-white"},pt={key:1,class:"mt-4 pt-4 border-t border-slate-700/50"},mt={class:"text-xs text-slate-500 uppercase tracking-wider mb-3"},xt={class:"text-sm text-white"},bt={class:"mt-6 pt-4 border-t border-slate-700/50"},ft={class:"flex gap-6 text-xs font-mono text-slate-500"},ht={class:"text-slate-400"},vt={class:"text-slate-400"},_t={class:"text-slate-400"},yt={class:"bg-slate-800/50 border border-slate-700 rounded-xl overflow-hidden"},wt={class:"px-6 py-4 border-b border-slate-700 flex items-center gap-3"},kt={class:"text-base font-semibold text-white"},$t={class:"px-6 py-5"},Ct={key:0,class:"grid grid-cols-1 md:grid-cols-2 gap-6"},Mt={class:"space-y-4"},zt={class:"text-xs text-slate-500 uppercase tracking-wider"},jt={class:"text-sm text-white mt-1 font-medium"},Vt={class:"text-xs text-slate-500 uppercase tracking-wider"},Bt={class:"text-sm text-white mt-1 flex items-center gap-1.5"},Tt={class:"space-y-4"},At={class:"text-xs text-slate-500 uppercase tracking-wider"},Lt={class:"text-sm text-white mt-1 flex items-center gap-1.5"},Ut={key:0},St={class:"text-xs text-slate-500 uppercase tracking-wider"},Et={class:"text-sm text-white mt-1"},Dt={key:0},Ht={key:1,class:"text-center py-4"},Ft={class:"text-sm text-slate-400"},It=ge({__name:"GarageGeneralTab",props:{garage:{}},setup(u){const k=u;function N(o){return{dealership:"Dealership",service:"Service Center",rental:"Rental Agency",fleet:"Fleet Operator",individual:"Individual",workshop:"Workshop",garage:"Garage",other:"Other"}[o?.toLowerCase()]||o||"-"}function y(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}}const j=S(()=>k.garage?[k.garage.address_zip,k.garage.address_city,k.garage.address_street_name,k.garage.address_street_type,k.garage.address_house_number].filter(Boolean).join(" ")||"-":""),E=S(()=>k.garage&&[k.garage.billing_zip,k.garage.billing_city,k.garage.billing_street_name,k.garage.billing_street_type,k.garage.billing_house_number].filter(Boolean).join(" ")||""),B=S(()=>k.garage&&[k.garage.notification_zip,k.garage.notification_city,k.garage.notification_street_name,k.garage.notification_street_type,k.garage.notification_house_number].filter(Boolean).join(" ")||"");return(o,m)=>(i(),r("div",Ne,[e("div",Ge,[e("div",Re,[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",Oe,t(o.$t("garages.details.company_info")),1)]),e("div",Pe,[e("div",Je,[e("div",Qe,[e("div",null,[e("p",qe,t(o.$t("garages.details.company_name")),1),e("p",Ke,t(u.garage.full_name),1)]),e("div",null,[e("p",We,t(o.$t("garages.details.display_name")),1),e("p",Xe,t(u.garage.display_name||"—"),1)]),e("div",null,[e("p",Ye,t(o.$t("garages.details.org_type")),1),e("p",Ze,t(N(u.garage.org_type)),1)])]),e("div",et,[e("div",null,[e("p",tt,t(o.$t("garages.details.tax_number")),1),e("p",st,t(u.garage.tax_number||"—"),1)]),e("div",null,[e("p",at,t(o.$t("garages.details.reg_number")),1),e("p",ot,t(u.garage.reg_number||"—"),1)]),e("div",null,[e("p",lt,t(o.$t("garages.details.created_at")),1),e("p",nt,t(y(u.garage.created_at)),1)])])]),e("div",it,[e("p",rt,t(o.$t("garages.details.address")),1),e("p",dt,t(j.value),1)]),E.value?(i(),r("div",ct,[e("p",ut,t(o.$t("garages.details.billing_address")),1),e("p",gt,t(E.value),1)])):p("",!0),B.value?(i(),r("div",pt,[e("p",mt,t(o.$t("garages.details.notification_address")),1),e("p",xt,t(B.value),1)])):p("",!0),e("div",bt,[m[4]||(m[4]=e("p",{class:"text-xs text-slate-500 uppercase tracking-wider mb-3"},"Rendszer Azonosítók",-1)),e("div",ft,[e("span",null,[m[1]||(m[1]=w("Garázs ID: ",-1)),e("span",ht,t(u.garage.id),1)]),e("span",null,[m[2]||(m[2]=w("User ID: ",-1)),e("span",vt,t(u.garage.owner_user_id??"N/A"),1)]),e("span",null,[m[3]||(m[3]=w("Person ID: ",-1)),e("span",_t,t(u.garage.owner_person_id??"N/A"),1)])])])])]),e("div",yt,[e("div",wt,[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",kt,t(o.$t("garages.details.contact_info")),1)]),e("div",$t,[u.garage.contact_person_name||u.garage.contact_email||u.garage.contact_phone||u.garage.primary_contact?(i(),r("div",Ct,[e("div",Mt,[e("div",null,[e("p",zt,t(o.$t("garages.details.contact_name")),1),e("p",jt,t(u.garage.contact_person_name||u.garage.primary_contact?.full_name||"—"),1)]),e("div",null,[e("p",Vt,t(o.$t("garages.details.contact_email")),1),e("p",Bt,[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",Tt,[e("div",null,[e("p",At,t(o.$t("garages.details.contact_phone")),1),e("p",Lt,[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",Ut,[e("p",St,t(o.$t("garages.details.contact_role")),1),e("p",Et,[w(t(u.garage.primary_contact.role||"—"),1),u.garage.primary_contact?.department?(i(),r("span",Dt," · "+t(u.garage.primary_contact.department),1)):p("",!0)])])):p("",!0)])])):(i(),r("div",Ht,[e("p",Ft,t(o.$t("garages.details.no_contact")),1)]))])])]))}}),Nt={class:"space-y-6"},Gt={class:"flex items-center justify-between"},Rt={class:"flex items-center gap-3"},Ot={class:"text-base font-semibold text-white"},Pt={class:"text-xs text-slate-400 mt-0.5"},Jt={class:"bg-slate-800/50 border border-slate-700 rounded-xl overflow-hidden"},Qt={class:"overflow-x-auto"},qt={class:"w-full text-sm"},Kt={class:"border-b border-slate-700"},Wt={class:"text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider"},Xt={class:"text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider"},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:"px-4 py-3"},ss={class:"text-sm font-bold text-white"},as={class:"px-4 py-3"},os={class:"text-sm text-slate-300"},ls={key:0,class:"text-slate-500 mx-1"},ns={key:1,class:"text-sm text-slate-300"},is={class:"px-4 py-3 text-sm text-slate-300"},rs={class:"px-4 py-3"},ds={class:"text-xs font-mono text-slate-400"},cs={class:"px-4 py-3"},us={key:0},gs={colspan:"5",class:"px-4 py-12 text-center"},ps={class:"text-sm text-slate-400"},ms={key:1},xs={colspan:"5",class:"px-4 py-12 text-center"},bs={class:"text-sm text-slate-400 mt-2"},fs={key:1,class:"bg-slate-800/50 border border-slate-700 rounded-xl p-12 text-center"},hs={class:"text-sm text-slate-400"},vs=ge({__name:"GarageFleetTab",props:{garage:{},orgId:{},fleetVehicles:{},fleetLoading:{type:Boolean}},setup(u){const k=u,N=fe();function y(o){return!!(N.isAdmin||N.user?.system_capabilities?.[o]||N.user?.org_capabilities?.[k.orgId]?.[o])}function j(o){return{active:"Active",inactive:"Inactive",sold:"Sold",scrapped:"Scrapped",pending:"Pending",draft:"Draft"}[o?.toLowerCase()]||o||"Unknown"}function E(o){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"}[o?.toLowerCase()]||"bg-gray-500/10 text-gray-400"}function B(o){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"}[o?.toLowerCase()]||"bg-gray-400"}return(o,m)=>(i(),r("div",Nt,[y("fleet:view")?(i(),r(H,{key:0},[e("div",Gt,[e("div",Rt,[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:"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",Ot,t(o.$t("garages.fleet.title")),1),e("p",Pt,t(o.$t("garages.fleet.total_vehicles",{count:u.fleetVehicles.length})),1)])])]),e("div",Jt,[e("div",Qt,[e("table",qt,[e("thead",null,[e("tr",Kt,[e("th",Wt,t(o.$t("garages.fleet.plate")),1),e("th",Xt,t(o.$t("garages.fleet.brand_model")),1),e("th",Yt,t(o.$t("garages.fleet.year")),1),e("th",Zt,t(o.$t("garages.fleet.vin")),1),e("th",es,t(o.$t("garages.fleet.status")),1)])]),e("tbody",null,[(i(!0),r(H,null,P(u.fleetVehicles,_=>(i(),r("tr",{key:_.id,class:"border-b border-slate-700/50 last:border-b-0 hover:bg-slate-700/30 transition"},[e("td",ts,[e("span",ss,t(_.license_plate||"—"),1)]),e("td",as,[e("span",os,t(_.brand||"—"),1),_.brand&&_.model?(i(),r("span",ls,"·")):p("",!0),_.model?(i(),r("span",ns,t(_.model),1)):p("",!0)]),e("td",is,t(_.year||"—"),1),e("td",rs,[e("span",ds,t(_.vin||"—"),1)]),e("td",cs,[e("span",{class:z(["inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-medium",E(_.status)])},[e("span",{class:z(["w-1.5 h-1.5 rounded-full",B(_.status)])},null,2),w(" "+t(j(_.status)),1)],2)])]))),128)),u.fleetVehicles.length===0&&!u.fleetLoading?(i(),r("tr",us,[e("td",gs,[m[1]||(m[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",ps,t(o.$t("garages.fleet.no_vehicles")),1)])])):p("",!0),u.fleetLoading?(i(),r("tr",ms,[e("td",xs,[m[2]||(m[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",bs,t(o.$t("garages.details.loading")),1)])])):p("",!0)])])])])],64)):(i(),r("div",fs,[m[3]||(m[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",hs,t(o.$t("garages.fleet.no_fleet_access")),1)]))]))}}),_s={class:"space-y-6"},ys={class:"bg-slate-800/50 border border-slate-700 rounded-xl overflow-hidden"},ws={class:"px-6 py-4 border-b border-slate-700 flex items-center gap-3"},ks={class:"text-base font-semibold text-white"},$s={class:"px-6 py-5"},Cs={key:0,class:"grid grid-cols-2 md:grid-cols-4 gap-4"},Ms={class:"bg-slate-900/30 rounded-lg p-3"},zs={class:"text-xs text-slate-500 uppercase tracking-wider mb-1"},js={class:"bg-slate-900/30 rounded-lg p-3"},Vs={class:"text-xs text-slate-500 uppercase tracking-wider mb-1"},Bs={class:"text-sm font-semibold text-white"},Ts={class:"bg-slate-900/30 rounded-lg p-3"},As={class:"text-xs text-slate-500 uppercase tracking-wider mb-1"},Ls={key:0,class:"text-sm font-semibold text-white"},Us={key:1,class:"text-sm text-slate-400 italic"},Ss={class:"bg-slate-900/30 rounded-lg p-3"},Es={class:"text-xs text-slate-500 uppercase tracking-wider mb-1"},Ds={class:"text-sm font-semibold text-white"},Hs={key:1,class:"mt-4 grid grid-cols-2 gap-4"},Fs={class:"bg-slate-900/30 rounded-lg p-3"},Is={class:"text-xs text-slate-500 uppercase tracking-wider mb-1"},Ns={class:"text-sm font-semibold text-white"},Gs={class:"mt-2 w-full h-1.5 bg-slate-700 rounded-full overflow-hidden"},Rs={class:"bg-slate-900/30 rounded-lg p-3"},Os={class:"text-xs text-slate-500 uppercase tracking-wider mb-1"},Ps={class:"text-sm font-semibold text-white"},Js={class:"mt-2 w-full h-1.5 bg-slate-700 rounded-full overflow-hidden"},Qs={class:"bg-slate-900/30 rounded-lg p-3"},qs={class:"text-xs text-slate-500 uppercase tracking-wider mb-1"},Ks={class:"text-sm font-semibold text-white"},Ws={key:0,class:"mt-2 w-full h-1.5 bg-slate-700 rounded-full overflow-hidden"},Xs={class:"bg-slate-900/30 rounded-lg p-3 flex flex-col justify-center"},Ys={class:"text-xs text-slate-500 uppercase tracking-wider mb-1"},Zs={key:2,class:"mt-4 border-t border-slate-700/50 pt-4"},ea={class:"text-xs text-slate-500 uppercase tracking-wider mb-3"},ta={class:"overflow-hidden border border-slate-700/50 rounded-lg"},sa={class:"w-full text-sm"},aa={class:"bg-slate-900/40"},oa={class:"px-3 py-2 text-left text-xs font-medium text-slate-400 uppercase tracking-wider"},la={class:"px-3 py-2 text-center text-xs font-medium text-slate-400 uppercase tracking-wider"},na={class:"px-3 py-2 text-right text-xs font-medium text-slate-400 uppercase tracking-wider"},ia={class:"divide-y divide-slate-700/50"},ra={class:"px-3 py-2.5 text-slate-300"},da={class:"px-3 py-2.5 text-center"},ca={class:"inline-flex items-center justify-center w-7 h-7 rounded-full bg-indigo-500/20 text-indigo-300 text-xs font-bold"},ua={class:"px-3 py-2.5 text-right text-slate-500"},ga={key:0},pa={key:1,class:"italic"},ma={key:3,class:"mt-4 border-t border-slate-700/50 pt-4"},xa={class:"text-xs text-slate-500 uppercase tracking-wider mb-1"},ba={class:"bg-slate-900/20 border border-slate-700/30 rounded-lg px-4 py-3 text-center"},fa={class:"text-xs text-slate-500 italic"},ha={key:4,class:"text-center py-4"},va={class:"text-sm text-slate-400"},_a={class:"bg-slate-800/50 border border-slate-700 rounded-xl overflow-hidden"},ya={class:"px-6 py-4 border-b border-slate-700 flex items-center gap-3"},wa={class:"text-base font-semibold text-white"},ka={class:"px-6 py-5 space-y-5"},$a={class:"block text-sm font-medium text-slate-300 mb-2"},Ca={value:"",disabled:""},Ma=["value"],za={class:"block text-sm font-medium text-slate-300 mb-2"},ja={class:"text-xs text-slate-500 ml-1"},Va={class:"text-xs text-slate-500 mt-1.5"},Ba={class:"block text-sm font-medium text-slate-300 mb-3"},Ta={class:"text-xs text-slate-500 ml-1"},Aa={class:"grid grid-cols-1 md:grid-cols-3 gap-3"},La={class:"bg-slate-900/30 border border-slate-700/50 rounded-lg p-3"},Ua={class:"block text-xs text-slate-400 mb-1.5"},Sa={class:"flex items-center gap-2"},Ea={class:"block text-xs text-slate-500 mt-2 mb-1"},Da={class:"bg-slate-900/30 border border-slate-700/50 rounded-lg p-3"},Ha={class:"block text-xs text-slate-400 mb-1.5"},Fa={class:"flex items-center gap-2"},Ia={class:"block text-xs text-slate-500 mt-2 mb-1"},Na={class:"bg-slate-900/30 border border-slate-700/50 rounded-lg p-3"},Ga={class:"block text-xs text-slate-400 mb-1.5"},Ra={class:"flex items-center gap-2"},Oa={class:"block text-xs text-slate-500 mt-2 mb-1"},Pa={class:"text-xs text-slate-500 mt-3"},Ja={key:0,class:"bg-red-500/10 border border-red-500/20 rounded-lg px-4 py-3"},Qa={class:"text-sm text-red-400"},qa={class:"flex items-center justify-end gap-3 pt-2"},Ka=["disabled"],Wa={key:0,class:"flex items-center gap-2"},Xa={key:1},Ya={class:"bg-slate-800/50 border border-slate-700 rounded-xl overflow-hidden"},Za={class:"px-6 py-4 border-b border-slate-700 flex items-center gap-3"},eo={class:"text-base font-semibold text-white"},to={class:"px-6 py-5"},so={class:"overflow-x-auto"},ao={class:"w-full text-sm"},oo={class:"border-b border-slate-700"},lo={class:"text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider"},no={class:"text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider"},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:"px-4 py-3 text-sm text-slate-300"},uo={class:"px-4 py-3 text-sm text-slate-300"},go={class:"px-4 py-3 text-sm text-slate-300 max-w-xs"},po={class:"space-y-1"},mo={class:"text-xs text-slate-400 block"},xo={key:0,class:"text-xs text-slate-300 space-y-0.5"},bo={key:1,class:"text-xs text-slate-500 italic"},fo={class:"px-4 py-3"},ho={class:"flex flex-col gap-1"},vo={key:0,class:"text-[10px] text-slate-500 text-center"},_o={key:1},yo={colspan:"4",class:"px-4 py-12 text-center"},wo={class:"flex flex-col items-center gap-3"},ko={class:"text-sm text-slate-400"},$o=ge({__name:"GarageSubscriptionTab",props:{garage:{},fleetVehicles:{}},emits:["refresh"],setup(u,{expose:k,emit:N}){const y=u,j=N,E=fe(),B=h([]);ye(()=>{I()});const o=h(""),m=h(""),_=h(!1),T=h(null),A=h(0),U=h(0),L=h(0),C=Ue({vehicles:"",branches:"",users:""});function te(){const n=y.garage?.subscription;if(!n)return;const d=n.extra_allowances||{};if(A.value=d.extra_vehicles??0,U.value=d.extra_branches??0,L.value=d.extra_users??0,n.addons?.length)for(const c of n.addons)c.type==="extra_vehicles"&&c.expires_at?C.vehicles=c.expires_at.slice(0,10):c.type==="extra_branches"&&c.expires_at?C.branches=c.expires_at.slice(0,10):c.type==="extra_users"&&c.expires_at&&(C.users=c.expires_at.slice(0,10))}we(()=>y.garage?.subscription,n=>{n&&te()},{immediate:!0});const g=S(()=>y.garage?.subscription?.asset_limit?y.garage.subscription.asset_limit:5),J=S(()=>{const n=g.value;return n<=0?0:Math.min(100,Math.round(y.fleetVehicles.length/n*100))}),F=S(()=>{const n=y.garage?.branches?.length||0,d=y.garage?.subscription?.branch_limit;return!d||d<=0?0:Math.min(100,Math.round(n/d*100))}),Q=S(()=>{const n=y.garage?.member_count||0,d=y.garage?.subscription?.user_limit;return!d||d<=0?0:Math.min(100,Math.round(n/d*100))}),q=S(()=>{if(!y.garage?.subscription)return!1;const n=y.garage.subscription,d=n.extra_allowances?.extra_vehicles??0,c=n.extra_allowances?.extra_branches??0,f=n.extra_allowances?.extra_users??0;return A.value!==d||U.value!==c||L.value!==f});function K(n){if(!n)return null;const d=n.old_data||{},c=n.new_data||{},f=[];if(n.action==="SUBSCRIPTION_TIER_CHANGE"){const M=d.tier_id,G=c.tier_id,R=c.tier_name;(M!==void 0||G!==void 0)&&f.push(`Csomag: #${M??"?"}${R??"#"+G}`);const D=d.addons||{},ie=c.addons||{};for(const O of["extra_vehicles","extra_branches","extra_users"]){const re=D[O]??0,de=ie[O]??0;if(re!==de){const me=O==="extra_vehicles"?"Extra Jármű":O==="extra_branches"?"Extra Telephely":"Extra Dolgozó";f.push(`${me}: ${re}${de}`)}}return f.length>0?f:null}if(n.action==="SUBSCRIPTION_ADDON_OVERRIDE"){const M=d.addons||{},G=c.addons||{};let R=!1;for(const D of["extra_vehicles","extra_branches","extra_users"]){const ie=M[D]??0,O=G[D]??0;if(ie!==O){R=!0;const re=D==="extra_vehicles"?"Extra Jármű":D==="extra_branches"?"Extra Telephely":"Extra Dolgozó";f.push(`${re}: ${ie}${O}`)}}return R?f:null}const V=new Set([...Object.keys(d),...Object.keys(c)]);for(const M of V){if(M==="addons")continue;const G=JSON.stringify(d[M]??null),R=JSON.stringify(c[M]??null);G!==R&&f.push(`${M}: ${G}${R}`)}return f.length>0?f:null}function W(n){if(!n)return"-";try{return new Intl.DateTimeFormat("hu-HU",{year:"numeric",month:"2-digit",day:"2-digit"}).format(new Date(n))}catch{return n}}function ne(n){return{extra_vehicles:"Extra Jármű",extra_branches:"Extra Telephely",extra_users:"Extra Dolgozó"}[n]||n}function se(n){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"}[n?.toLowerCase()]||"bg-gray-100 text-gray-800"}function ae(n){return{active:"Active",inactive:"Inactive",suspended:"Suspended",pending:"Pending"}[n?.toLowerCase()]||n}function oe(n){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"}[n?.toLowerCase()]||"bg-gray-100 text-gray-800"}function le(n){return{active:"bg-green-400",inactive:"bg-gray-400",suspended:"bg-red-400",pending:"bg-yellow-400"}[n?.toLowerCase()]||"bg-gray-400"}async function I(){try{const d=(ee("access_token").value||E.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 V=await c.text().catch(()=>"");throw console.error(`[GarageSubscriptionTab] Fetch tiers failed: ${c.status} ${c.statusText}`,V),new Error(`Failed to fetch tiers: ${c.status} ${V}`)}const f=await c.json();console.log("[GarageSubscriptionTab] Fetched tiers response:",JSON.stringify(f)),B.value=f.tiers||[],console.log("[GarageSubscriptionTab] availableTiers set:",B.value.length,"items")}catch(n){console.error("[GarageSubscriptionTab] Failed to fetch tiers:",n),T.value=`Hiba a csomagok betöltésekor: ${n.message}`}}async function pe(){if(!(!o.value&&!q.value)){_.value=!0,T.value=null;try{const d=(ee("access_token").value||E.token||"").trim(),c=y.garage?.id,f={};o.value&&(f.tier_id=o.value),m.value&&(f.expires_at=new Date(m.value).toISOString()),f.extra_vehicles=A.value,f.extra_branches=U.value,f.extra_users=L.value,f.extra_vehicles_expires_at=C.vehicles||null,f.extra_branches_expires_at=C.branches||null,f.extra_users_expires_at=C.users||null,console.log("[GarageSubscriptionTab] PATCH Payload:",JSON.stringify(f,null,2));const V=await fetch(`/api/v1/admin/organizations/${c}/subscription`,{method:"PATCH",headers:{Authorization:`Bearer ${d}`,"Content-Type":"application/json"},body:JSON.stringify(f)});if(!V.ok){const M=await V.json().catch(()=>({}));throw new Error(M.detail||`Update subscription failed: ${V.status}`)}o.value="",j("refresh")}catch(n){T.value=n.message||"Failed to update subscription"}finally{_.value=!1}}}return k({fetchTiers:I}),(n,d)=>(i(),r("div",_s,[e("div",ys,[e("div",ws,[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",ks,t(n.$t("garages.details.subscription_info")),1)]),e("div",$s,[u.garage.subscription?(i(),r("div",Cs,[e("div",Ms,[e("p",zs,t(n.$t("garages.details.tier_name")),1),e("span",{class:z(["inline-flex px-2.5 py-0.5 rounded-full text-xs font-medium",se(u.garage.subscription.tier_name)])},t(u.garage.subscription.tier_name),3)]),e("div",js,[e("p",Vs,t(n.$t("garages.details.tier_level")),1),e("p",Bs,t(n.$t("garages.details.level_n",{n:u.garage.subscription.tier_level})),1)]),e("div",Ts,[e("p",As,t(n.$t("garages.details.expires_at")),1),u.garage.subscription.expires_at?(i(),r("p",Ls,t(W(u.garage.subscription.expires_at)),1)):(i(),r("p",Us,t(n.$t("garages.indefinite")),1))]),e("div",Ss,[e("p",Es,t(n.$t("garages.details.asset_limit")),1),e("p",Ds,t(u.garage.subscription.asset_limit)+" "+t(n.$t("garages.details.vehicles")),1)])])):p("",!0),u.garage.subscription?(i(),r("div",Hs,[e("div",Fs,[e("p",Is,t(n.$t("garages.details.vehicles_used")),1),e("p",Ns,t(u.fleetVehicles.length)+" / "+t(u.garage.subscription?.asset_limit??"∞"),1),e("div",Gs,[e("div",{class:z(["h-full rounded-full transition-all duration-500",J.value>=90?"bg-red-500":J.value>=70?"bg-amber-500":"bg-blue-500"]),style:ue({width:Math.min(100,J.value)+"%"})},null,6)])]),e("div",Rs,[e("p",Os,t(n.$t("garages.details.branches_used")),1),e("p",Ps,t(u.garage.branches?.length||0)+" / "+t(u.garage.subscription?.branch_limit??"∞"),1),e("div",Js,[e("div",{class:z(["h-full rounded-full transition-all duration-500",F.value>=90?"bg-red-500":F.value>=70?"bg-amber-500":"bg-emerald-500"]),style:ue({width:Math.min(100,F.value)+"%"})},null,6)])]),e("div",Qs,[e("p",qs,t(n.$t("garages.details.employees_used")),1),e("p",Ks,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",Ws,[e("div",{class:z(["h-full rounded-full transition-all duration-500",Q.value>=90?"bg-red-500":Q.value>=70?"bg-amber-500":"bg-purple-500"]),style:ue({width:Math.min(100,Q.value)+"%"})},null,6)])):p("",!0)]),e("div",Xs,[e("p",Ys,t(n.$t("garages.details.status")),1),e("span",{class:z(["inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium self-start",oe(u.garage.status)])},[e("span",{class:z(["w-1.5 h-1.5 rounded-full",le(u.garage.status)])},null,2),w(" "+t(ae(u.garage.status)),1)],2)])])):p("",!0),u.garage.subscription?.addons?.length?(i(),r("div",Zs,[e("p",ea,t(n.$t("garages.active_addons")),1),e("div",ta,[e("table",sa,[e("thead",null,[e("tr",aa,[e("th",oa,t(n.$t("garages.addon_type")),1),e("th",la,t(n.$t("garages.addon_quantity")),1),e("th",na,t(n.$t("garages.addon_expires")),1)])]),e("tbody",ia,[(i(!0),r(H,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",ra,t(ne(c.type)),1),e("td",da,[e("span",ca,t(c.quantity),1)]),e("td",ua,[c.expires_at||c.valid_until?(i(),r("span",ga,t(W(c.expires_at||c.valid_until)),1)):(i(),r("span",pa,t(n.$t("garages.indefinite")),1))])]))),128))])])])])):u.garage.subscription?(i(),r("div",ma,[e("p",xa,t(n.$t("garages.active_addons")),1),e("div",ba,[e("p",fa,t(n.$t("garages.no_active_addons")),1)])])):(i(),r("div",ha,[e("p",va,t(n.$t("garages.details.no_subscription")),1)]))])]),e("div",_a,[e("div",ya,[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",wa,t(n.$t("garages.change_package")),1)]),e("div",ka,[e("div",null,[e("label",$a,t(n.$t("garages.select_package")),1),b(e("select",{"onUpdate:modelValue":d[0]||(d[0]=c=>o.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",Ca,t(n.$t("garages.select_package_placeholder")),1),(i(!0),r(H,null,P(B.value,c=>(i(),r("option",{key:c.id,value:c.id},t(c.name)+" (Level "+t(c.tier_level)+") ",9,Ma))),128))],512),[[be,o.value]])]),e("div",null,[e("label",za,[w(t(n.$t("garages.custom_expiration"))+" ",1),e("span",ja,"("+t(n.$t("garages.optional"))+")",1)]),b(e("input",{"onUpdate:modelValue":d[1]||(d[1]=c=>m.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),[[v,m.value]]),e("p",Va,t(n.$t("garages.custom_expiration_hint")),1)]),e("div",null,[e("label",Ba,[w(t(n.$t("garages.addons_title"))+" ",1),e("span",Ta,"("+t(n.$t("garages.optional"))+")",1)]),e("div",Aa,[e("div",La,[e("label",Ua,t(n.$t("garages.addon_vehicles")),1),e("div",Sa,[e("button",{onClick:d[2]||(d[2]=c=>A.value=Math.max(0,A.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"},""),b(e("input",{"onUpdate:modelValue":d[3]||(d[3]=c=>A.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),[[v,A.value,void 0,{number:!0}]]),e("button",{onClick:d[4]||(d[4]=c=>A.value=Math.min(999,A.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",Ea,t(n.$t("garages.addon_vehicles_expiration")),1),b(e("input",{"onUpdate:modelValue":d[5]||(d[5]=c=>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),[[v,C.vehicles]])]),e("div",Da,[e("label",Ha,t(n.$t("garages.addon_branches")),1),e("div",Fa,[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"},""),b(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),[[v,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",Ia,t(n.$t("garages.addon_branches_expiration")),1),b(e("input",{"onUpdate:modelValue":d[9]||(d[9]=c=>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),[[v,C.branches]])]),e("div",Na,[e("label",Ga,t(n.$t("garages.addon_users")),1),e("div",Ra,[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"},""),b(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),[[v,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",Oa,t(n.$t("garages.addon_users_expiration")),1),b(e("input",{"onUpdate:modelValue":d[13]||(d[13]=c=>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),[[v,C.users]])])]),e("p",Pa,t(n.$t("garages.addon_expiration_hint")),1)]),T.value?(i(),r("div",Ja,[e("p",Qa,t(T.value),1)])):p("",!0),e("div",qa,[e("button",{onClick:pe,disabled:_.value||!o.value&&!q.value,class:z(["px-5 py-2 text-sm font-medium rounded-lg transition disabled:opacity-50 disabled:cursor-not-allowed",_.value?"bg-indigo-600/50 text-indigo-200 cursor-wait":"bg-indigo-600 text-white hover:bg-indigo-500"])},[_.value?(i(),r("span",Wa,[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(n.$t("garages.saving")),1)])):(i(),r("span",Xa,t(n.$t("garages.save")),1))],10,Ka)])])]),e("div",Ya,[e("div",Za,[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",eo,t(n.$t("garages.details.subscription_history")),1)]),e("div",to,[e("div",so,[e("table",ao,[e("thead",null,[e("tr",oo,[e("th",lo,t(n.$t("garages.details.history_date")),1),e("th",no,t(n.$t("garages.details.history_package")),1),e("th",io,t(n.$t("garages.details.history_action")),1),e("th",ro,t(n.$t("garages.details.history_status")),1)])]),e("tbody",null,[u.garage?.subscription_history?.length?(i(!0),r(H,{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",co,t(W(c.timestamp)),1),e("td",uo,t(c.tier_name||"—"),1),e("td",go,[e("div",po,[e("span",mo,t(c.action||"—"),1),K(c)?(i(),r("div",xo,[(i(!0),r(H,null,P(K(c),(f,V)=>(i(),r("div",{key:V,class:"flex items-start gap-1"},[d[18]||(d[18]=e("span",{class:"text-cyan-400 shrink-0"},"",-1)),e("span",null,t(f),1)]))),128))])):(i(),r("span",bo,"Nincs részletes adat"))])]),e("td",fo,[e("div",ho,[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",vo," Admin #"+t(c.admin_user_id),1)):p("",!0)])])]))),128)):(i(),r("tr",_o,[e("td",yo,[e("div",wo,[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",ko,t(n.$t("garages.details.no_subscription_history")),1)])])]))])])])])])]))}}),Co={key:0,class:"flex items-center justify-center py-20"},Mo={class:"flex flex-col items-center gap-3"},zo={class:"text-slate-400 text-sm"},jo={key:1,class:"flex flex-col items-center justify-center py-20 text-center"},Vo={class:"text-red-400 text-sm mb-2"},Bo={key:0,class:"mb-6 p-4 bg-amber-500/10 border border-amber-500/30 rounded-xl"},To={class:"flex items-start gap-3"},Ao={class:"flex-1 min-w-0"},Lo={class:"flex items-center justify-between"},Uo={class:"text-sm font-semibold text-amber-300"},So={class:"text-xs text-amber-400/70"},Eo={class:"text-xs text-amber-400/80 mt-1"},Do={class:"flex flex-wrap gap-2 mt-3"},Ho={class:"mb-8"},Fo={class:"flex items-center justify-between"},Io={class:"flex items-center gap-4"},No={class:"flex items-center gap-3"},Go={class:"text-2xl font-bold text-white"},Ro={class:"text-sm text-slate-400 mt-0.5"},Oo={key:0,class:"ml-2 text-slate-500"},Po={class:"flex items-center gap-3"},Jo={class:"border-b border-slate-700 mb-6"},Qo={class:"flex gap-6"},qo=["onClick"],Ko={key:2,class:"space-y-6"},Wo={class:"flex items-center justify-between"},Xo={class:"flex items-center gap-3"},Yo={class:"text-base font-semibold text-white"},Zo={class:"text-xs text-slate-400 mt-0.5"},el={class:"bg-slate-800/50 border border-slate-700 rounded-xl overflow-hidden"},tl={class:"overflow-x-auto"},sl={class:"w-full text-sm"},al={class:"border-b border-slate-700"},ol={class:"text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider"},ll={class:"text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider"},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-right px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider"},dl={class:"px-4 py-3"},cl={class:"flex items-center gap-3"},ul={class:"text-sm font-medium text-white"},gl={class:"text-xs text-slate-500"},pl={class:"flex gap-3 mt-0.5 text-xs text-slate-500 font-mono"},ml={class:"text-slate-400"},xl={class:"text-slate-400"},bl={class:"px-4 py-3"},fl={class:"space-y-0.5"},hl={key:0,class:"text-sm text-slate-300"},vl={key:1,class:"text-sm text-slate-500 italic"},_l={key:2,class:"text-xs text-slate-400"},yl={class:"px-4 py-3"},wl={class:"px-4 py-3"},kl={class:"px-4 py-3 text-right"},$l={class:"flex items-center justify-end gap-2"},Cl=["onClick"],Ml=["onClick"],zl={key:0},jl={colspan:"5",class:"px-4 py-12 text-center"},Vl={class:"text-sm text-slate-400"},Bl={key:5,class:"space-y-6"},Tl={class:"grid grid-cols-1 md:grid-cols-3 gap-4"},Al={class:"bg-slate-800/50 border border-slate-700 rounded-xl p-5"},Ll={class:"flex items-center gap-3 mb-3"},Ul={class:"text-xs font-medium text-slate-400 uppercase tracking-wider"},Sl={class:"bg-slate-800/50 border border-slate-700 rounded-xl p-5"},El={class:"flex items-center gap-3 mb-3"},Dl={class:"text-xs font-medium text-slate-400 uppercase tracking-wider"},Hl={class:"text-xs text-slate-400 mt-1"},Fl={class:"bg-slate-800/50 border border-slate-700 rounded-xl p-5"},Il={class:"flex items-center gap-3 mb-3"},Nl={class:"text-xs font-medium text-slate-400 uppercase tracking-wider"},Gl={class:"text-xs text-emerald-400 mt-1 flex items-center gap-1"},Rl={class:"grid grid-cols-1 md:grid-cols-3 gap-4"},Ol={class:"bg-slate-800/50 border border-slate-700 rounded-xl p-5"},Pl={class:"flex items-center gap-3 mb-3"},Jl={class:"text-xs font-medium text-slate-400 uppercase tracking-wider"},Ql={class:"text-xs text-slate-400 mt-1"},ql={class:"bg-slate-800/50 border border-slate-700 rounded-xl p-5"},Kl={class:"flex items-center gap-3 mb-3"},Wl={class:"text-xs font-medium text-slate-400 uppercase tracking-wider"},Xl={class:"text-xs text-slate-400 mt-1"},Yl={class:"bg-slate-800/50 border border-slate-700 rounded-xl p-5"},Zl={class:"flex items-center gap-3 mb-3"},en={class:"text-xs font-medium text-slate-400 uppercase tracking-wider"},tn={class:"text-xs text-slate-400 mt-1"},sn={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},an={class:"bg-slate-800/50 border border-slate-700 rounded-xl p-5"},on={class:"flex items-center gap-3 mb-4"},ln={class:"text-sm font-semibold text-white"},nn={class:"mb-4"},rn={class:"flex items-center justify-between mb-1.5"},dn={class:"text-xs text-slate-400"},cn={class:"text-xs text-slate-500"},un={class:"w-full h-2 bg-slate-700 rounded-full overflow-hidden"},gn={class:"text-xs text-slate-500 mt-1"},pn={class:"bg-slate-800/50 border border-slate-700 rounded-xl p-5"},mn={class:"flex items-center gap-3 mb-4"},xn={class:"text-sm font-semibold text-white"},bn={class:"flex items-center justify-between py-2 border-b border-slate-700/50"},fn={class:"text-xs text-slate-400"},hn={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"},kn={class:"text-xs text-slate-400"},$n={key:6,class:"fixed inset-0 z-50 flex items-center justify-center p-4"},Cn={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"},Mn={class:"px-6 py-4 border-b border-slate-700 flex items-center justify-between flex-shrink-0"},zn={class:"text-lg font-semibold text-white"},jn={class:"px-6 pt-4 border-b border-slate-700 flex-shrink-0"},Vn={class:"flex gap-4"},Bn=["onClick"],Tn={class:"flex-1 overflow-y-auto p-6 space-y-6"},An={key:0,class:"space-y-5"},Ln={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Un={class:"block text-xs font-medium text-slate-400 mb-1.5"},Sn={class:"block text-xs font-medium text-slate-400 mb-1.5"},En={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Dn={class:"block text-xs font-medium text-slate-400 mb-1.5"},Hn={class:"block text-xs font-medium text-slate-400 mb-1.5"},Fn={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},In={class:"block text-xs font-medium text-slate-400 mb-1.5"},Nn={class:"block text-xs font-medium text-slate-400 mb-1.5"},Gn={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Rn={class:"block text-xs font-medium text-slate-400 mb-1.5"},On={class:"block text-xs font-medium text-slate-400 mb-1.5"},Pn={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Jn={class:"block text-xs font-medium text-slate-400 mb-1.5"},Qn={key:1,class:"space-y-5"},qn={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Kn={class:"block text-xs font-medium text-slate-400 mb-1.5"},Wn={class:"block text-xs font-medium text-slate-400 mb-1.5"},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={key:2,class:"space-y-8"},ei={class:"text-sm font-semibold text-white mb-3"},ti={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},si={class:"block text-xs font-medium text-slate-400 mb-1.5"},ai={class:"block text-xs font-medium text-slate-400 mb-1.5"},oi={class:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4"},li={class:"block text-xs font-medium text-slate-400 mb-1.5"},ni={class:"block text-xs font-medium text-slate-400 mb-1.5"},ii={class:"mt-4"},ri={class:"block text-xs font-medium text-slate-400 mb-1.5"},di={class:"text-sm font-semibold text-white mb-3"},ci={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},ui={class:"block text-xs font-medium text-slate-400 mb-1.5"},gi={class:"block text-xs font-medium text-slate-400 mb-1.5"},pi={class:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4"},mi={class:"block text-xs font-medium text-slate-400 mb-1.5"},xi={class:"block text-xs font-medium text-slate-400 mb-1.5"},bi={class:"mt-4"},fi={class:"block text-xs font-medium text-slate-400 mb-1.5"},hi={class:"px-6 py-4 border-t border-slate-700 flex items-center justify-end gap-3 flex-shrink-0"},vi=["disabled"],_i={key:0,class:"w-4 h-4 animate-spin",fill:"none",viewBox:"0 0 24 24"},yi={key:7,class:"fixed inset-0 z-50 flex items-center justify-center p-4"},wi={class:"relative w-full max-w-md bg-slate-800 border border-slate-700 rounded-2xl shadow-2xl p-6"},ki={class:"text-lg font-semibold text-white mb-4"},$i={class:"space-y-4"},Ci={class:"block text-xs font-medium text-slate-400 mb-1.5"},Mi=["placeholder"],zi={class:"block text-xs font-medium text-slate-400 mb-1.5"},ji={value:"member"},Vi={value:"manager"},Bi={value:"admin"},Ti={class:"flex justify-end gap-3 mt-6"},Ai=["disabled"],Li={key:0,class:"w-4 h-4 animate-spin",fill:"none",viewBox:"0 0 24 24"},Ui={key:8,class:"fixed inset-0 z-50 flex items-center justify-center p-4"},Si={class:"relative w-full max-w-md bg-slate-800 border border-slate-700 rounded-2xl shadow-2xl p-6"},Ei={class:"text-lg font-semibold text-white mb-4"},Di={class:"block text-xs font-medium text-slate-400 mb-1.5"},Hi={value:"member"},Fi={value:"manager"},Ii={value:"admin"},Ni={class:"flex justify-end gap-3 mt-6"},Gi=["disabled"],Ri={key:0,class:"w-4 h-4 animate-spin",fill:"none",viewBox:"0 0 24 24"},Oi={key:9,class:"fixed inset-0 z-50 overflow-y-auto","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true"},Pi={class:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0"},Ji={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"},Qi={class:"sm:flex sm:items-start"},qi={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},Ki={class:"text-lg leading-6 font-medium text-white"},Wi={class:"mt-2"},Xi={class:"text-sm text-slate-400"},Yi={class:"mt-5 sm:mt-4 sm:flex sm:flex-row-reverse gap-2"},Zi=["disabled"],er={key:0,class:"w-4 h-4 animate-spin mr-2",fill:"none",viewBox:"0 0 24 24"},tr={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"},sr={class:"p-4"},ar={class:"flex items-start"},or={class:"flex-shrink-0"},lr={key:0,class:"h-6 w-6 text-green-400",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},nr={key:1,class:"h-6 w-6 text-red-400",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},ir={class:"ml-3 w-0 flex-1 pt-0.5"},rr={class:"text-sm font-medium text-white"},dr={class:"ml-4 flex-shrink-0 flex"},ur=ge({__name:"index",setup(u){const k=Fe(),N=Ie(),y=fe(),j=k.params.id,E=h(!0),B=h(null),o=h(null),m=h([]),_=h("general"),T=h([]),A=h(!1),U=h(null),L=h(!1),C=h("basic"),te=h(!1),g=h({full_name:"",name:"",display_name:"",email:"",phone:"",tax_number:"",reg_number:"",org_type:"",address_zip:"",address_city:"",address_street_name:"",address_street_type:"",address_house_number:"",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=h(!1),F=h(""),Q=h("member"),q=h(!1),K=h(!1),W=h(null),ne=h("member"),se=h(!1),ae=h(!1),oe=h(null),le=h(!1),I=h({show:!1,type:"success",message:""}),pe=[{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"}],n=[{key:"basic",label:"garages.details.editBasicTab"},{key:"contact",label:"garages.details.editContactTab"},{key:"addresses",label:"garages.details.editAddressTab"}];function d(a){return!!(y.isAdmin||y.user?.system_capabilities?.[a]||y.user?.org_capabilities?.[j]?.[a])}const c=S(()=>o.value?.subscription?.asset_limit?o.value.subscription.asset_limit:5),f=S(()=>{const a=c.value;return a<=0?0:Math.min(100,Math.round(T.value.length/a*100))}),V=S(()=>{if(!o.value)return[];const a=[],s=o.value,x=s.org_type==="individual";return x||s.tax_number||a.push({key:"tax_number",label:"garages.details.missing_tax_number"}),!s.contact_email&&!s.email&&a.push({key:"contact_email",label:"garages.details.missing_contact_email"}),!s.contact_phone&&!s.phone&&a.push({key:"contact_phone",label:"garages.details.missing_contact_phone"}),x||(!s.billing_city||!s.billing_zip)&&a.push({key:"billing",label:"garages.details.missing_billing"}),a});async function M(){E.value=!0,B.value=null;try{const x={Authorization:`Bearer ${(ee("access_token").value||y.token||"").trim()}`,"Content-Type":"application/json"},$=await fetch(`/api/v1/admin/organizations/${j}/details`,{headers:x});if(!$.ok)throw new Error(`Failed to fetch organization: ${$.status}`);const Y=await $.json();o.value=Y,m.value=Y.members||[]}catch(a){B.value=a.message||"Failed to load garage details"}finally{E.value=!1}}async function G(){A.value=!0;try{const s=(ee("access_token").value||y.token||"").trim(),x=await fetch(`/api/v1/admin/organizations/${j}/vehicles`,{headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json"}});if(!x.ok)throw new Error(`Failed to fetch fleet: ${x.status}`);const $=await x.json();T.value=$.vehicles||[]}catch(a){console.error("Fleet fetch error:",a),T.value=[]}finally{A.value=!1}}function R(){o.value&&(g.value={full_name:o.value.full_name||"",name:o.value.name||"",display_name:o.value.display_name||"",email:o.value.email||"",phone:o.value.phone||"",tax_number:o.value.tax_number||"",reg_number:o.value.reg_number||"",org_type:o.value.org_type||"",address_zip:o.value.address_zip||"",address_city:o.value.address_city||"",address_street_name:o.value.address_street_name||"",address_street_type:o.value.address_street_type||"",address_house_number:o.value.address_house_number||"",contact_person_name:o.value.contact_person_name||"",contact_email:o.value.contact_email||"",contact_phone:o.value.contact_phone||"",billing_zip:o.value.billing_zip||"",billing_city:o.value.billing_city||"",billing_street_name:o.value.billing_street_name||"",billing_street_type:o.value.billing_street_type||"",billing_house_number:o.value.billing_house_number||"",notification_zip:o.value.notification_zip||"",notification_city:o.value.notification_city||"",notification_street_name:o.value.notification_street_name||"",notification_street_type:o.value.notification_street_type||"",notification_house_number:o.value.notification_house_number||""},C.value="basic",L.value=!0)}function D(){L.value=!1}async function ie(){te.value=!0;try{const s=(ee("access_token").value||y.token||"").trim(),x={};for(const[l,Z]of Object.entries(g.value))Z!==""&&Z!==null&&Z!==void 0&&(x[l]=Z);o.value?.org_type==="individual"&&(x.contact_email&&!x.email&&(x.email=x.contact_email),x.contact_phone&&!x.phone&&(x.phone=x.contact_phone));const $=await fetch(`/api/v1/admin/organizations/${j}`,{method:"PUT",headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json"},body:JSON.stringify(x)});if(!$.ok)throw new Error(`Save failed: ${$.status}`);const Y=await $.json();Y.organization?o.value={...o.value,...Y.organization}:o.value={...o.value,...Y},D(),X("success","Garage updated successfully"),await M()}catch(a){X("error",a.message||"Failed to save")}finally{te.value=!1}}async function O(){if(F.value){q.value=!0;try{const s=(ee("access_token").value||y.token||"").trim(),x=await fetch(`/api/v1/admin/organizations/${j}/members`,{method:"POST",headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json"},body:JSON.stringify({email:F.value,role:Q.value})});if(!x.ok){const $=await x.json().catch(()=>({}));throw new Error($.detail||`Add member failed: ${x.status}`)}J.value=!1,F.value="",Q.value="member",X("success","Member added successfully"),await M()}catch(a){X("error",a.message||"Failed to add member")}finally{q.value=!1}}}function re(a){W.value=a,ne.value=a.role||"member",K.value=!0}async function de(){if(W.value){se.value=!0;try{const s=(ee("access_token").value||y.token||"").trim(),x=await fetch(`/api/v1/admin/organizations/${j}/members/${W.value.id}`,{method:"PUT",headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json"},body:JSON.stringify({role:ne.value})});if(!x.ok)throw new Error(`Update role failed: ${x.status}`);K.value=!1,W.value=null,X("success","Role updated successfully"),await M()}catch(a){X("error",a.message||"Failed to update role")}finally{se.value=!1}}}function me(a){oe.value=a,ae.value=!0}async function ke(){if(oe.value){le.value=!0;try{const s=(ee("access_token").value||y.token||"").trim(),x=await fetch(`/api/v1/admin/organizations/${j}/members/${oe.value.id}`,{method:"DELETE",headers:{Authorization:`Bearer ${s}`}});if(!x.ok)throw new Error(`Remove failed: ${x.status}`);ae.value=!1,oe.value=null,X("success","Member removed successfully"),await M()}catch(a){X("error",a.message||"Failed to remove member")}finally{le.value=!1}}}function X(a,s){I.value={show:!0,type:a,message:s},setTimeout(()=>{I.value.show=!1},4e3)}function $e(){N.push("/garages")}const Ce=S(()=>o.value?(o.value.display_name||o.value.name||o.value.full_name||"").replace(/[\s-]*#\d+\s*$/g,"").trim()||"Garage #"+o.value.id:"");function he(){return o.value?o.value.name||o.value.email||o.value.full_name||"Garage #"+o.value.id:""}function ve(a){return a?a.split(" ").map(s=>s[0]).join("").toUpperCase().slice(0,2):"?"}function _e(a){const s=["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 x=0;for(let $=0;$<(a||"").length;$++)x=a.charCodeAt($)+((x<<5)-x);return s[Math.abs(x)%s.length]}function Me(a){return{active:"Active",inactive:"Inactive",suspended:"Suspended",pending:"Pending"}[a?.toLowerCase()]||a}function ze(a){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"}[a?.toLowerCase()]||"bg-gray-100 text-gray-800"}function je(a){return{active:"bg-green-400",inactive:"bg-gray-400",suspended:"bg-red-400",pending:"bg-yellow-400"}[a?.toLowerCase()]||"bg-gray-400"}function ce(a){if(!a)return"";if(a.display_name)return a.display_name;if(a.name)return a.name;if(a.email)return a.email;if(a.person){const s=a.person.first_name||"",$=`${a.person.last_name||""} ${s}`.trim();if($)return $;if(a.person.email)return a.person.email}return a.user_id?String(a.user_id):"Unknown"}function Ve(a){return{admin:"Admin",manager:"Manager",member:"Member",owner:"Owner"}[a?.toLowerCase()]||a||"Member"}function Be(a){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"}[a?.toLowerCase()]||"bg-gray-100 text-gray-800"}function Te(a){return{active:"Active",invited:"Invited",suspended:"Suspended",inactive:"Inactive"}[a?.toLowerCase()]||a||"Unknown"}function Ae(a){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"}[a?.toLowerCase()]||"bg-gray-100 text-gray-800"}function Le(a){return{active:"bg-green-400",invited:"bg-blue-400",suspended:"bg-red-400",inactive:"bg-gray-400"}[a?.toLowerCase()]||"bg-gray-400"}return ye(()=>{M()}),we(_,a=>{(a==="fleet"||a==="analytics"||a==="subscription")&&T.value.length===0&&G(),a==="subscription"&&U.value?.fetchTiers()}),(a,s)=>{const x=It,$=vs,Y=$o;return i(),r("div",null,[E.value?(i(),r("div",Co,[e("div",Mo,[s[33]||(s[33]=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",zo,t(a.$t("garages.details.loading")),1)])])):B.value?(i(),r("div",jo,[s[34]||(s[34]=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",Vo,t(B.value),1),e("button",{onClick:M,class:"px-4 py-2 text-sm bg-indigo-600/20 text-indigo-300 hover:bg-indigo-600/30 rounded-lg transition"},t(a.$t("garages.details.retry")),1)])):o.value?(i(),r(H,{key:2},[V.value.length>0?(i(),r("div",Bo,[e("div",To,[s[36]||(s[36]=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",Ao,[e("div",Lo,[e("p",Uo,t(a.$t("garages.details.missing_data_title")),1),e("span",So,t(a.$t("garages.details.missing_data_count",{count:V.value.length})),1)]),e("p",Eo,t(o.value.status!=="active"?a.$t("garages.details.missing_data_activation_required"):a.$t("garages.details.missing_data_desc")),1),e("div",Do,[(i(!0),r(H,null,P(V.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"},[s[35]||(s[35]=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(a.$t(l.label)),1)]))),128))])])])])):p("",!0),e("div",Ho,[e("button",{onClick:$e,class:"inline-flex items-center gap-1.5 text-sm text-slate-400 hover:text-white transition mb-4"},[s[37]||(s[37]=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(a.$t("garages.details.back")),1)]),e("div",Fo,[e("div",Io,[e("div",{class:z(["w-12 h-12 rounded-xl flex items-center justify-center text-lg font-bold text-white",_e(he())])},t(ve(he())),3),e("div",null,[e("div",No,[e("h1",Go,t(Ce.value),1),e("span",{class:z(["inline-flex items-center px-3 py-1 rounded-full text-xs font-medium",ze(o.value.status)])},[e("span",{class:z(["w-1.5 h-1.5 rounded-full mr-1.5",je(o.value.status)])},null,2),w(" "+t(Me(o.value.status)),1)],2)]),e("p",Ro,[w(t(o.value.full_name)+" ",1),o.value.tax_number?(i(),r("span",Oo,"· "+t(a.$t("garages.details.tax_number"))+": "+t(o.value.tax_number),1)):p("",!0)])])]),e("div",Po,[d("org:edit")?(i(),r("button",{key:0,onClick:R,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"},[s[38]||(s[38]=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(a.$t("garages.details.edit_details")),1)])):p("",!0)])])]),e("div",Jo,[e("nav",Qo,[(i(),r(H,null,P(pe,l=>e("button",{key:l.key,onClick:Z=>_.value=l.key,class:z(["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(a.$t(l.label)),11,qo)),64))])]),_.value==="general"?(i(),xe(x,{key:1,garage:o.value},null,8,["garage"])):p("",!0),_.value==="employees"?(i(),r("div",Ko,[e("div",Wo,[e("div",Xo,[s[39]||(s[39]=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",Yo,t(a.$t("garages.employees.title")),1),e("p",Zo,t(a.$t("garages.employees.total_count",{count:m.value.length})),1)])]),d("org:manage-members")?(i(),r("button",{key:0,onClick:s[0]||(s[0]=(...l)=>a.openAddEmployeeModal&&a.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"},[s[40]||(s[40]=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(a.$t("garages.employees.add_employee")),1)])):p("",!0)]),e("div",el,[e("div",tl,[e("table",sl,[e("thead",null,[e("tr",al,[e("th",ol,t(a.$t("garages.employees.name")),1),e("th",ll,t(a.$t("garages.employees.email_phone")),1),e("th",nl,t(a.$t("garages.employees.role")),1),e("th",il,t(a.$t("garages.employees.status")),1),e("th",rl,t(a.$t("garages.employees.actions")),1)])]),e("tbody",null,[(i(!0),r(H,null,P(m.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",dl,[e("div",cl,[e("div",{class:z(["w-8 h-8 rounded-lg flex items-center justify-center text-xs font-bold text-white flex-shrink-0",_e(ce(l))])},t(ve(ce(l))),3),e("div",null,[e("p",ul,t(ce(l)),1),e("p",gl,"ID: "+t(l.user_id||l.id),1),e("div",pl,[e("span",null,[s[41]||(s[41]=w("User_id: ",-1)),e("span",ml,t(l.user_id||"N/A"),1)]),e("span",null,[s[42]||(s[42]=w("Person_id: ",-1)),e("span",xl,t(l.person?.id||"N/A"),1)])])])])]),e("td",bl,[e("div",fl,[l.person?.email?(i(),r("p",hl,t(l.person.email),1)):(i(),r("p",vl,"—")),l.person?.phone?(i(),r("p",_l,t(l.person.phone),1)):p("",!0)])]),e("td",yl,[e("span",{class:z(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",Be(l.role)])},t(Ve(l.role)),3)]),e("td",wl,[e("span",{class:z(["inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-medium",Ae(l.status)])},[e("span",{class:z(["w-1.5 h-1.5 rounded-full",Le(l.status)])},null,2),w(" "+t(Te(l.status)),1)],2)]),e("td",kl,[e("div",$l,[d("org:manage-members")?(i(),r("button",{key:0,onClick:Z=>re(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"},[s[43]||(s[43]=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(a.$t("garages.employees.edit_role")),1)],8,Cl)):p("",!0),d("org:manage-members")?(i(),r("button",{key:1,onClick:Z=>me(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"},[s[44]||(s[44]=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(a.$t("garages.employees.remove")),1)],8,Ml)):p("",!0)])])]))),128)),m.value.length===0?(i(),r("tr",zl,[e("td",jl,[s[45]||(s[45]=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",Vl,t(a.$t("garages.employees.no_employees")),1)])])):p("",!0)])])])])])):p("",!0),_.value==="fleet"?(i(),xe($,{key:3,garage:o.value,"org-id":Se(j),"fleet-vehicles":T.value,"fleet-loading":A.value},null,8,["garage","org-id","fleet-vehicles","fleet-loading"])):p("",!0),_.value==="subscription"?(i(),xe(Y,{key:4,ref_key:"subscriptionTabRef",ref:U,garage:o.value,"fleet-vehicles":T.value,onRefresh:M},null,8,["garage","fleet-vehicles"])):p("",!0),_.value==="analytics"?(i(),r("div",Bl,[e("div",Tl,[e("div",Al,[e("div",Ll,[s[46]||(s[46]=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",Ul,t(a.$t("garages.analytics.ltv")),1)]),s[47]||(s[47]=e("p",{class:"text-2xl font-bold text-white"},"150 000 Ft",-1)),s[48]||(s[48]=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",Sl,[e("div",El,[s[49]||(s[49]=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",Dl,t(a.$t("garages.analytics.mrr")),1)]),s[50]||(s[50]=e("p",{class:"text-2xl font-bold text-white"},"15 000 Ft",-1)),e("p",Hl,t(a.$t("garages.analytics.monthly_recurring")),1)]),e("div",Fl,[e("div",Il,[s[51]||(s[51]=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",Nl,t(a.$t("garages.analytics.outstanding")),1)]),s[53]||(s[53]=e("p",{class:"text-2xl font-bold text-white"},"0 Ft",-1)),e("p",Gl,[s[52]||(s[52]=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(a.$t("garages.analytics.all_settled")),1)])])]),e("div",Rl,[e("div",Ol,[e("div",Pl,[s[54]||(s[54]=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",Jl,t(a.$t("garages.analytics.earned_credits")),1)]),s[55]||(s[55]=e("p",{class:"text-2xl font-bold text-yellow-300"},"450 XP",-1)),e("p",Ql,t(a.$t("garages.analytics.contribution_xp")),1)]),e("div",ql,[e("div",Kl,[s[56]||(s[56]=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",Wl,t(a.$t("garages.analytics.invited_companies")),1)]),s[57]||(s[57]=e("p",{class:"text-2xl font-bold text-white"},"12",-1)),e("p",Xl,t(a.$t("garages.analytics.companies_joined")),1)]),e("div",Yl,[e("div",Zl,[s[58]||(s[58]=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",en,t(a.$t("garages.analytics.validated_garages")),1)]),s[59]||(s[59]=e("p",{class:"text-2xl font-bold text-white"},"8",-1)),e("p",tn,t(a.$t("garages.analytics.garages_confirmed")),1)])]),e("div",sn,[e("div",an,[e("div",on,[s[60]||(s[60]=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",ln,t(a.$t("garages.analytics.utilization")),1)]),e("div",nn,[e("div",rn,[e("span",dn,t(a.$t("garages.analytics.vehicle_quota")),1),e("span",cn,t(T.value.length)+" / "+t(c.value),1)]),e("div",un,[e("div",{class:z(["h-full rounded-full transition-all duration-500",f.value>=90?"bg-red-500":f.value>=70?"bg-amber-500":"bg-blue-500"]),style:ue({width:f.value+"%"})},null,6)]),e("p",gn,t(f.value)+"% "+t(a.$t("garages.analytics.utilized")),1)])]),e("div",pn,[e("div",mn,[s[61]||(s[61]=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",xn,t(a.$t("garages.analytics.marketplace_engagement")),1)]),e("div",bn,[e("span",fn,t(a.$t("garages.analytics.avg_rating")),1),s[62]||(s[62]=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",hn,[e("span",vn,t(a.$t("garages.analytics.total_reviews")),1),s[63]||(s[63]=e("span",{class:"text-sm font-medium text-white"},"124",-1))]),e("div",_n,[e("span",yn,t(a.$t("garages.analytics.service_requests")),1),s[64]||(s[64]=e("span",{class:"text-sm font-medium text-white"},"47",-1))]),e("div",wn,[e("span",kn,t(a.$t("garages.analytics.response_rate")),1),s[65]||(s[65]=e("span",{class:"text-sm font-medium text-emerald-400"},"92%",-1))])])])])):p("",!0),L.value?(i(),r("div",$n,[e("div",{class:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:D}),e("div",Cn,[e("div",Mn,[e("h3",zn,t(a.$t("garages.details.edit_details")),1),e("button",{onClick:D,class:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-700 transition"},[...s[66]||(s[66]=[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",jn,[e("nav",Vn,[(i(),r(H,null,P(n,l=>e("button",{key:l.key,onClick:Z=>C.value=l.key,class:z(["pb-3 text-sm font-medium transition border-b-2 -mb-px",C.value===l.key?"text-indigo-400 border-indigo-400":"text-slate-400 border-transparent hover:text-slate-300"])},t(a.$t(l.label)),11,Bn)),64))])]),e("div",Tn,[C.value==="basic"?(i(),r("div",An,[e("div",Ln,[e("div",null,[e("label",Un,t(a.$t("garages.details.company_name")),1),b(e("input",{"onUpdate:modelValue":s[1]||(s[1]=l=>g.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),[[v,g.value.full_name]])]),e("div",null,[e("label",Sn,t(a.$t("garages.details.display_name")),1),b(e("input",{"onUpdate:modelValue":s[2]||(s[2]=l=>g.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),[[v,g.value.display_name]])])]),e("div",En,[e("div",null,[e("label",Dn,t(a.$t("garages.details.tax_number")),1),b(e("input",{"onUpdate:modelValue":s[3]||(s[3]=l=>g.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),[[v,g.value.tax_number]])]),e("div",null,[e("label",Hn,t(a.$t("garages.details.reg_number")),1),b(e("input",{"onUpdate:modelValue":s[4]||(s[4]=l=>g.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),[[v,g.value.reg_number]])])]),e("div",Fn,[e("div",null,[e("label",In,t(a.$t("garages.details.zip")),1),b(e("input",{"onUpdate:modelValue":s[5]||(s[5]=l=>g.value.address_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),[[v,g.value.address_zip]])]),e("div",null,[e("label",Nn,t(a.$t("garages.details.city")),1),b(e("input",{"onUpdate:modelValue":s[6]||(s[6]=l=>g.value.address_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),[[v,g.value.address_city]])])]),e("div",Gn,[e("div",null,[e("label",Rn,t(a.$t("garages.details.street_name")),1),b(e("input",{"onUpdate:modelValue":s[7]||(s[7]=l=>g.value.address_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),[[v,g.value.address_street_name]])]),e("div",null,[e("label",On,t(a.$t("garages.details.street_type")),1),b(e("input",{"onUpdate:modelValue":s[8]||(s[8]=l=>g.value.address_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),[[v,g.value.address_street_type]])])]),e("div",Pn,[e("div",null,[e("label",Jn,t(a.$t("garages.details.house_number")),1),b(e("input",{"onUpdate:modelValue":s[9]||(s[9]=l=>g.value.address_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),[[v,g.value.address_house_number]])])])])):p("",!0),C.value==="contact"?(i(),r("div",Qn,[e("div",qn,[e("div",null,[e("label",Kn,t(a.$t("garages.details.contact_person")),1),b(e("input",{"onUpdate:modelValue":s[10]||(s[10]=l=>g.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),[[v,g.value.contact_person_name]])]),e("div",null,[e("label",Wn,t(a.$t("garages.details.contact_email")),1),b(e("input",{"onUpdate:modelValue":s[11]||(s[11]=l=>g.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),[[v,g.value.contact_email]])])]),e("div",Xn,[e("div",null,[e("label",Yn,t(a.$t("garages.details.contact_phone")),1),b(e("input",{"onUpdate:modelValue":s[12]||(s[12]=l=>g.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),[[v,g.value.contact_phone]])])])])):p("",!0),C.value==="addresses"?(i(),r("div",Zn,[e("div",null,[e("h4",ei,t(a.$t("garages.details.billing_address")),1),e("div",ti,[e("div",null,[e("label",si,t(a.$t("garages.details.zip")),1),b(e("input",{"onUpdate:modelValue":s[13]||(s[13]=l=>g.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),[[v,g.value.billing_zip]])]),e("div",null,[e("label",ai,t(a.$t("garages.details.city")),1),b(e("input",{"onUpdate:modelValue":s[14]||(s[14]=l=>g.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),[[v,g.value.billing_city]])])]),e("div",oi,[e("div",null,[e("label",li,t(a.$t("garages.details.street_name")),1),b(e("input",{"onUpdate:modelValue":s[15]||(s[15]=l=>g.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),[[v,g.value.billing_street_name]])]),e("div",null,[e("label",ni,t(a.$t("garages.details.street_type")),1),b(e("input",{"onUpdate:modelValue":s[16]||(s[16]=l=>g.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),[[v,g.value.billing_street_type]])])]),e("div",ii,[e("label",ri,t(a.$t("garages.details.house_number")),1),b(e("input",{"onUpdate:modelValue":s[17]||(s[17]=l=>g.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),[[v,g.value.billing_house_number]])])]),e("div",null,[e("h4",di,t(a.$t("garages.details.notification_address")),1),e("div",ci,[e("div",null,[e("label",ui,t(a.$t("garages.details.zip")),1),b(e("input",{"onUpdate:modelValue":s[18]||(s[18]=l=>g.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),[[v,g.value.notification_zip]])]),e("div",null,[e("label",gi,t(a.$t("garages.details.city")),1),b(e("input",{"onUpdate:modelValue":s[19]||(s[19]=l=>g.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),[[v,g.value.notification_city]])])]),e("div",pi,[e("div",null,[e("label",mi,t(a.$t("garages.details.street_name")),1),b(e("input",{"onUpdate:modelValue":s[20]||(s[20]=l=>g.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),[[v,g.value.notification_street_name]])]),e("div",null,[e("label",xi,t(a.$t("garages.details.street_type")),1),b(e("input",{"onUpdate:modelValue":s[21]||(s[21]=l=>g.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),[[v,g.value.notification_street_type]])])]),e("div",bi,[e("label",fi,t(a.$t("garages.details.house_number")),1),b(e("input",{"onUpdate:modelValue":s[22]||(s[22]=l=>g.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),[[v,g.value.notification_house_number]])])])])):p("",!0)]),e("div",hi,[e("button",{onClick:D,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(a.$t("garages.details.cancel")),1),e("button",{onClick:ie,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",_i,[...s[67]||(s[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)])])):p("",!0),w(" "+t(te.value?a.$t("garages.details.saving"):a.$t("garages.details.save")),1)],8,vi)])])])):p("",!0),J.value?(i(),r("div",yi,[e("div",{class:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:s[23]||(s[23]=l=>J.value=!1)}),e("div",wi,[e("h3",ki,t(a.$t("garages.employees.add_employee")),1),e("div",$i,[e("div",null,[e("label",Ci,t(a.$t("garages.employees.email")),1),b(e("input",{"onUpdate:modelValue":s[24]||(s[24]=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:a.$t("garages.employees.email_placeholder")},null,8,Mi),[[v,F.value]])]),e("div",null,[e("label",zi,t(a.$t("garages.employees.role")),1),b(e("select",{"onUpdate:modelValue":s[25]||(s[25]=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",ji,t(a.$t("garages.roles.member")),1),e("option",Vi,t(a.$t("garages.roles.manager")),1),e("option",Bi,t(a.$t("garages.roles.admin")),1)],512),[[be,Q.value]])])]),e("div",Ti,[e("button",{onClick:s[26]||(s[26]=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(a.$t("garages.employees.cancel")),1),e("button",{onClick:O,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",Li,[...s[68]||(s[68]=[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)])])):p("",!0),w(" "+t(q.value?a.$t("garages.employees.adding"):a.$t("garages.employees.add")),1)],8,Ai)])])])):p("",!0),K.value?(i(),r("div",Ui,[e("div",{class:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:s[27]||(s[27]=l=>K.value=!1)}),e("div",Si,[e("h3",Ei,t(a.$t("garages.employees.edit_role")),1),e("div",null,[e("label",Di,t(a.$t("garages.employees.role")),1),b(e("select",{"onUpdate:modelValue":s[28]||(s[28]=l=>ne.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",Hi,t(a.$t("garages.roles.member")),1),e("option",Fi,t(a.$t("garages.roles.manager")),1),e("option",Ii,t(a.$t("garages.roles.admin")),1)],512),[[be,ne.value]])]),e("div",Ni,[e("button",{onClick:s[29]||(s[29]=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(a.$t("garages.employees.cancel")),1),e("button",{onClick:de,disabled:se.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"},[se.value?(i(),r("svg",Ri,[...s[69]||(s[69]=[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)])])):p("",!0),w(" "+t(se.value?a.$t("garages.employees.saving"):a.$t("garages.employees.save")),1)],8,Gi)])])])):p("",!0),ae.value?(i(),r("div",Oi,[e("div",Pi,[e("div",{class:"fixed inset-0 bg-black/60 backdrop-blur-sm transition-opacity",onClick:s[30]||(s[30]=l=>ae.value=!1)}),s[72]||(s[72]=e("span",{class:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true"},"",-1)),e("div",Ji,[e("div",Qi,[s[70]||(s[70]=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",qi,[e("h3",Ki,t(a.$t("garages.employees.removeTitle")),1),e("div",Wi,[e("p",Xi,t(a.$t("garages.employees.removeConfirm",{name:ce(oe.value)})),1)])])]),e("div",Yi,[e("button",{onClick:ke,disabled:le.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"},[le.value?(i(),r("svg",er,[...s[71]||(s[71]=[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)])])):p("",!0),w(" "+t(le.value?a.$t("garages.employees.removing"):a.$t("garages.employees.remove")),1)],8,Zi),e("button",{onClick:s[31]||(s[31]=l=>ae.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(a.$t("garages.employees.cancel")),1)])])])])):p("",!0),Ee(He,{"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:De(()=>[I.value.show?(i(),r("div",tr,[e("div",sr,[e("div",ar,[e("div",or,[I.value.type==="success"?(i(),r("svg",lr,[...s[73]||(s[73]=[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)])])):p("",!0),I.value.type==="error"?(i(),r("svg",nr,[...s[74]||(s[74]=[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)])])):p("",!0)]),e("div",ir,[e("p",rr,t(I.value.message),1)]),e("div",dr,[e("button",{onClick:s[32]||(s[32]=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"},[...s[75]||(s[75]=[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)])])])])])])):p("",!0)]),_:1})],64)):p("",!0)])}}});export{ur as default};