import{e as ne,o as n,c as i,a as t,k as h,t as g,F as x,r as v,b as ie,j as k,g as ke,d as y,P as _e,y as c,z as p,x as I,N as oe,I as we,l as b,J as ze,m as le,h as Ce,D as Se,K as je,L as $e,O as Ve}from"./BIbQr1Hg.js";import{_ as Ae}from"./DlAUqK2U.js";const Ne={class:"flex items-center gap-2 py-1"},Te={class:"flex items-center gap-2 cursor-pointer flex-1"},He=["checked"],Me={class:"text-sm text-slate-300"},Be={class:"text-xs text-slate-500"},Ie={key:0,class:"ml-6 border-l border-slate-700 pl-3"},re=ne({__name:"TreeNode",props:{node:{},selectedIds:{},expandedIds:{}},emits:["toggle","toggle-expand"],setup(d){return(w,m)=>{const B=re;return n(),i("div",null,[t("div",Ne,[t("button",{onClick:m[0]||(m[0]=f=>w.$emit("toggle-expand",d.node.id)),class:"text-slate-500 hover:text-slate-300 transition w-4 h-4 flex items-center justify-center"},[(n(),i("svg",{class:h(["w-3 h-3 transition-transform",d.expandedIds.has(d.node.id)?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...m[4]||(m[4]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2))]),t("label",Te,[t("input",{type:"checkbox",checked:d.selectedIds.includes(d.node.id),onChange:m[1]||(m[1]=f=>w.$emit("toggle",d.node.id)),class:"w-4 h-4 rounded border-slate-500 bg-slate-700 text-indigo-500 focus:ring-indigo-500/50"},null,40,He),t("span",Me,g(d.node.name_hu||d.node.name_en||d.node.key),1),t("span",Be,"(Szint "+g(d.node.level)+")",1)])]),d.expandedIds.has(d.node.id)&&d.node.children?.length?(n(),i("div",Ie,[(n(!0),i(x,null,v(d.node.children,f=>(n(),i("div",{key:f.id},[ie(B,{node:f,"selected-ids":d.selectedIds,"expanded-ids":d.expandedIds,onToggle:m[2]||(m[2]=_=>w.$emit("toggle",_)),onToggleExpand:m[3]||(m[3]=_=>w.$emit("toggle-expand",_))},null,8,["node","selected-ids","expanded-ids"])]))),128))])):k("",!0)])}}}),Oe={class:"mb-8"},Ue={class:"text-slate-400 mt-1"},Fe={key:0,class:"flex items-center justify-center py-20"},Ke={key:1,class:"bg-rose-500/10 border border-rose-500/30 rounded-xl p-6 mb-8"},De={key:2,class:"bg-slate-800 rounded-xl border border-slate-700 p-6"},Ee={class:"border-b border-slate-700 mb-6"},Je={class:"flex gap-6 -mb-px"},Le=["onClick"],Pe={key:0,class:"max-w-3xl"},Re={class:"bg-slate-800 rounded-xl border border-slate-700 p-6 mb-6"},Ye={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Ge={class:"md:col-span-2"},We={class:"w-full px-3 py-2 bg-slate-700/50 border border-slate-600 rounded-lg text-slate-400 text-sm"},Xe={class:"bg-slate-800 rounded-xl border border-slate-700 p-6 mb-6"},qe={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Ze={class:"md:col-span-2"},Qe={key:1,class:"max-w-4xl"},et={class:"bg-slate-800 rounded-xl border border-slate-700 p-6 mb-6"},tt={class:"mb-8"},st={class:"grid grid-cols-2 md:grid-cols-4 gap-3"},ot=["value","checked","onChange"],lt={class:"text-sm"},nt={class:"mb-8"},it={key:0,class:"flex items-center gap-2 text-sm text-slate-400 py-4"},rt={key:1,class:"space-y-1 max-h-96 overflow-y-auto pr-2"},at={class:"flex items-center gap-2 py-1"},dt=["onClick"],ut={class:"flex items-center gap-2 cursor-pointer flex-1"},ct=["checked","onChange"],pt={class:"text-sm font-medium text-white"},gt={class:"text-xs text-slate-500"},mt={key:0,class:"ml-6 border-l border-slate-700 pl-3"},bt={key:2,class:"mt-4 flex flex-wrap gap-2"},xt=["onClick"],ft={class:"mb-4"},yt={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},vt={class:"flex flex-wrap gap-2 mb-2"},ht=["onClick"],kt={class:"flex gap-2"},_t=["onKeydown"],wt=["disabled"],zt={class:"flex flex-wrap gap-2 mb-2"},Ct=["onClick"],St={class:"flex gap-2"},jt=["onKeydown"],$t=["disabled"],Vt={key:2,class:"max-w-3xl"},At={class:"bg-slate-800 rounded-xl border border-slate-700 p-6 mb-6"},Nt={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Tt={class:"md:col-span-2"},Ht={class:"md:col-span-2"},Mt={key:3,class:"max-w-3xl"},Bt={class:"bg-slate-800 rounded-xl border border-slate-700 p-6 mb-6"},It={class:"mb-6 p-4 rounded-lg border bg-indigo-500/5 border-indigo-500/20"},Ot={class:"flex items-center gap-3 cursor-pointer"},Ut={class:"flex items-center gap-2 w-36 flex-shrink-0 cursor-pointer"},Ft=["checked","onChange","disabled"],Kt={class:"text-sm font-medium text-white"},Dt={key:0,class:"flex items-center gap-2"},Et=["value","onInput","disabled"],Jt=["value","onInput","disabled"],Lt={key:1,class:"text-sm text-slate-500 italic"},Pt={class:"sticky bottom-0 bg-slate-900/90 backdrop-blur-sm border-t border-slate-700 -mx-6 px-6 py-4 mt-8"},Rt={class:"flex items-center justify-between max-w-4xl"},Yt={class:"text-sm text-slate-400"},Gt={key:0,class:"text-amber-400"},Wt={key:1,class:"text-slate-500"},Xt={class:"flex gap-3"},qt=["disabled"],Zt={key:0,class:"w-4 h-4 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Qt={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},es=ne({__name:"edit",setup(d){const w=[{key:"car",label:"Személyautó"},{key:"motorcycle",label:"Motorkerékpár"},{key:"truck",label:"Teherautó"},{key:"hgv",label:"Nehézgépjármű (HGV)"},{key:"light_commercial",label:"Kishaszonjármű"},{key:"personal",label:"Személyes"},{key:"boat",label:"Csónak/Vízi"},{key:"other",label:"Egyéb"}],m=je(),B=Se(),f=le(()=>Number(m.params.id)),_=b(!0),O=b(!1),$=b(null),V=b(!1),A=b(null),z=b("basic"),ae=[{key:"basic",label:"Alapadatok & Kapcsolat",icon:"svg"},{key:"matrix",label:"Szolgáltatások & Járművek",icon:"svg"},{key:"location",label:"Helyszín & Lokáció",icon:"svg"},{key:"hours",label:"Nyitvatartás",icon:"svg"}],U=b([]),F=b(!1),N=b(new Set),T=b(""),H=b(""),s=ze({name:"",address:"",city:"",address_zip:"",address_street_name:"",address_street_type:"",address_house_number:"",plus_code:"",contact_phone:"",contact_email:"",website:"",category:"",category_ids:[],supported_vehicle_classes:[],specializations:{brands:[],propulsion:[]},opening_hours:{},is_always_open:!1}),P=le(()=>{if(!$.value)return!1;const o=$.value;if(s.name!==(o.name||"")||s.address!==(o.address||"")||s.city!==(o.city||"")||s.address_zip!==(o.address_zip||"")||s.address_street_name!==(o.address_street_name||"")||s.address_street_type!==(o.address_street_type||"")||s.address_house_number!==(o.address_house_number||"")||s.plus_code!==(o.plus_code||"")||s.contact_phone!==(o.contact_phone||"")||s.contact_email!==(o.contact_email||"")||s.website!==(o.website||"")||s.category!==(o.category||""))return!0;const e=[...s.category_ids].sort(),r=[...o.category_ids||[]].sort();if(JSON.stringify(e)!==JSON.stringify(r))return!0;const l=[...s.supported_vehicle_classes].sort(),a=[...o.supported_vehicle_classes||[]].sort();if(JSON.stringify(l)!==JSON.stringify(a))return!0;const C=u=>({brands:Array.isArray(u?.brands)?[...u.brands].sort():[],propulsion:Array.isArray(u?.propulsion)?[...u.propulsion].sort():[]});if(JSON.stringify(C(s.specializations))!==JSON.stringify(C(o.specializations)))return!0;const M=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],S=u=>{const J={},he=u?.days||u;for(const L of M){const j=he?.[L];j&&typeof j=="object"&&j.open&&j.close?J[L]={open:j.open,close:j.close}:J[L]=null}return J};return JSON.stringify(S(s.opening_hours))!==JSON.stringify(S(o.opening_hours))||s.is_always_open!==(o.opening_hours?.always_open===!0)});function K(){const o=Ce("access_token").value,e={"Content-Type":"application/json"};return o&&(e.Authorization=`Bearer ${o}`),e}async function R(){_.value=!0,O.value=!1;try{const o=await $fetch(`/api/v1/admin/providers/${f.value}`,{headers:K()});$.value=o,de(o)}catch(o){console.error("Failed to fetch provider:",o),O.value=!0}finally{_.value=!1}}function de(o){s.name=o.name||"",s.address=o.address||"",s.city=o.city||"",s.address_zip=o.address_zip||"",s.address_street_name=o.address_street_name||"",s.address_street_type=o.address_street_type||"",s.address_house_number=o.address_house_number||"",s.plus_code=o.plus_code||"",s.contact_phone=o.contact_phone||"",s.contact_email=o.contact_email||"",s.website=o.website||"",s.category=o.category||"",s.category_ids=o.category_ids||[],s.supported_vehicle_classes=o.supported_vehicle_classes||[];const e=o.specializations||{};s.specializations={brands:Array.isArray(e.brands)?e.brands:[],propulsion:Array.isArray(e.propulsion)?e.propulsion:[]};const r=o.opening_hours||{},l=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],a=r.always_open===!0,C=r.days||r;s.is_always_open=a;const M={};for(const S of l){const u=C[S];u&&typeof u=="object"&&u.open&&u.close?M[S]={open:u.open,close:u.close}:M[S]=null}s.opening_hours=M}async function ue(){F.value=!0;try{const o=await $fetch("/api/v1/providers/categories/tree",{headers:K()});U.value=o||[]}catch(o){console.error("Failed to fetch category tree:",o)}finally{F.value=!1}}function Y(o,e){for(const r of e){if(r.id===o)return r;if(r.children?.length){const l=Y(o,r.children);if(l)return l}}return null}function ce(o){const e=Y(o,U.value);return e?e.name_hu||e.name_en||e.key:`#${o}`}function pe(o){const e=s.supported_vehicle_classes.indexOf(o);e>=0?s.supported_vehicle_classes.splice(e,1):s.supported_vehicle_classes.push(o)}function G(o){const e=s.category_ids.indexOf(o);e>=0?s.category_ids.splice(e,1):s.category_ids.push(o)}function W(o){const e=new Set(N.value);e.has(o)?e.delete(o):e.add(o),N.value=e}function ge(o){return s.category_ids.includes(o)}function me(o){const e=s.category_ids.indexOf(o);e>=0&&s.category_ids.splice(e,1)}function X(){const o=T.value.trim();o&&!s.specializations.brands.includes(o)&&s.specializations.brands.push(o),T.value=""}function be(o){s.specializations.brands.splice(o,1)}function q(){const o=H.value.trim();o&&!s.specializations.propulsion.includes(o)&&s.specializations.propulsion.push(o),H.value=""}function xe(o){s.specializations.propulsion.splice(o,1)}const D=[{key:"monday",label:"Hétfő"},{key:"tuesday",label:"Kedd"},{key:"wednesday",label:"Szerda"},{key:"thursday",label:"Csütörtök"},{key:"friday",label:"Péntek"},{key:"saturday",label:"Szombat"},{key:"sunday",label:"Vasárnap"}];function fe(){s.is_always_open?Q("00:00","23:59"):ee()}function ye(o){s.opening_hours[o]?s.opening_hours[o]=null:s.opening_hours[o]={open:"08:00",close:"17:00"}}function Z(o,e,r){const l=s.opening_hours[o];l&&(l[e]=r)}function Q(o,e){for(const r of D)s.opening_hours[r.key]={open:o,close:e}}function ve(){const o=s.opening_hours.monday;if(!o)return;const e=["tuesday","wednesday","thursday","friday"];for(const r of e)s.opening_hours[r]={open:o.open,close:o.close}}function ee(){for(const o of D)s.opening_hours[o.key]=null}async function E(){if(V.value)return;V.value=!0;const o=s.address?.trim()||s.name,e={name:s.name,address:o,category:s.category||null,contact_phone:s.contact_phone||null,contact_email:s.contact_email||null,website:s.website||null,city:s.city||null,address_zip:s.address_zip||null,address_street_name:s.address_street_name||null,address_street_type:s.address_street_type||null,address_house_number:s.address_house_number||null,plus_code:s.plus_code||null,category_ids:s.category_ids,supported_vehicle_classes:s.supported_vehicle_classes,specializations:s.specializations,opening_hours:s.opening_hours,is_always_open:s.is_always_open};try{await $fetch(`/api/v1/admin/providers/${f.value}`,{method:"PATCH",headers:K(),body:e}),se("success","Szolgáltató sikeresen frissítve!"),setTimeout(()=>{B.push(`/providers/${f.value}`)},1200)}catch(r){console.error("Failed to save provider:",r);const l=r?.data?.detail||r?.message||"Ismeretlen hiba történt mentés közben.";se("error",`Hiba: ${l}`)}finally{V.value=!1}}function te(){B.push(`/providers/${f.value}`)}function se(o,e){A.value={type:o,message:e},setTimeout(()=>{A.value=null},3e3)}return ke(async()=>{await R(),await ue()}),(o,e)=>{const r=re;return n(),i("div",null,[t("div",Oe,[t("button",{onClick:te,class:"inline-flex items-center gap-1.5 text-sm text-slate-400 hover:text-white transition mb-4"},[...e[15]||(e[15]=[t("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1),y(" Vissza a szolgáltatóhoz ",-1)])]),e[16]||(e[16]=t("h1",{class:"text-2xl font-bold text-white"},"Szolgáltató szerkesztése",-1)),t("p",Ue,"Szolgáltató #"+g((o._.provides[_e]||o.$route).params.id),1)]),_.value?(n(),i("div",Fe,[...e[17]||(e[17]=[t("div",{class:"text-slate-400 flex items-center gap-3"},[t("svg",{class:"w-5 h-5 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("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"})]),t("span",null,"Szolgáltató betöltése...")],-1)])])):O.value?(n(),i("div",Ke,[e[18]||(e[18]=t("p",{class:"text-rose-400"},"Hiba történt a szolgáltató betöltése közben.",-1)),t("button",{onClick:R,class:"mt-3 text-sm text-rose-300 hover:text-rose-200 underline"},"Újrapróbálkozás")])):$.value?(n(),i(x,{key:3},[t("div",Ee,[t("nav",Je,[(n(),i(x,null,v(ae,l=>t("button",{key:l.key,onClick:a=>z.value=l.key,class:h(["pb-3 text-sm font-medium border-b-2 transition flex items-center gap-2",z.value===l.key?"text-indigo-400 border-indigo-400":"text-slate-400 border-transparent hover:text-slate-300"])},[(n(),$e(Ve(l.icon),{class:"w-4 h-4"})),y(" "+g(l.label),1)],10,Le)),64))])]),z.value==="basic"?(n(),i("div",Pe,[t("form",{onSubmit:I(E,["prevent"])},[t("div",Re,[e[23]||(e[23]=t("h2",{class:"text-lg font-semibold text-white mb-4"},"Alapadatok",-1)),t("div",Ye,[t("div",Ge,[e[20]||(e[20]=t("label",{class:"block text-sm font-medium text-slate-300 mb-1"},"Név *",-1)),c(t("input",{"onUpdate:modelValue":e[0]||(e[0]=l=>s.name=l),required:"",class:"w-full px-3 py-2 bg-slate-700 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 text-sm"},null,512),[[p,s.name]])]),t("div",null,[e[21]||(e[21]=t("label",{class:"block text-sm font-medium text-slate-300 mb-1"},"Kategória",-1)),c(t("input",{"onUpdate:modelValue":e[1]||(e[1]=l=>s.category=l),placeholder:"pl. Autószerviz, Gumiszerviz",class:"w-full px-3 py-2 bg-slate-700 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 text-sm"},null,512),[[p,s.category]])]),t("div",null,[e[22]||(e[22]=t("label",{class:"block text-sm font-medium text-slate-300 mb-1"},"Forrás",-1)),t("div",We,g($.value.source),1)])])]),t("div",Xe,[e[27]||(e[27]=t("h2",{class:"text-lg font-semibold text-white mb-4"},"Elérhetőség",-1)),t("div",qe,[t("div",null,[e[24]||(e[24]=t("label",{class:"block text-sm font-medium text-slate-300 mb-1"},"Telefon",-1)),c(t("input",{"onUpdate:modelValue":e[2]||(e[2]=l=>s.contact_phone=l),placeholder:"+36 30 123 4567",class:"w-full px-3 py-2 bg-slate-700 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 text-sm"},null,512),[[p,s.contact_phone]])]),t("div",null,[e[25]||(e[25]=t("label",{class:"block text-sm font-medium text-slate-300 mb-1"},"Email",-1)),c(t("input",{"onUpdate:modelValue":e[3]||(e[3]=l=>s.contact_email=l),type:"email",placeholder:"info@example.com",class:"w-full px-3 py-2 bg-slate-700 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 text-sm"},null,512),[[p,s.contact_email]])]),t("div",Ze,[e[26]||(e[26]=t("label",{class:"block text-sm font-medium text-slate-300 mb-1"},"Weboldal",-1)),c(t("input",{"onUpdate:modelValue":e[4]||(e[4]=l=>s.website=l),placeholder:"https://...",class:"w-full px-3 py-2 bg-slate-700 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 text-sm"},null,512),[[p,s.website]])])])])],32)])):k("",!0),z.value==="matrix"?(n(),i("div",Qe,[t("div",et,[e[41]||(e[41]=t("h2",{class:"text-lg font-semibold text-white mb-2"},"3D Képesség Mátrix",-1)),e[42]||(e[42]=t("p",{class:"text-sm text-slate-400 mb-6"}," Állítsd be, hogy a szolgáltató milyen járműosztályokhoz, szolgáltatási kategóriákhoz és specializációkhoz tartozik. ",-1)),t("div",tt,[e[28]||(e[28]=t("h3",{class:"text-md font-medium text-white mb-3 flex items-center gap-2"},[t("span",{class:"w-6 h-6 rounded-full bg-indigo-500/20 text-indigo-400 flex items-center justify-center text-xs font-bold"},"A"),y(" Járműosztályok (Vehicle Classes) ")],-1)),e[29]||(e[29]=t("p",{class:"text-xs text-slate-500 mb-3"},"Mely járműtípusokat szervizeli a szolgáltató?",-1)),t("div",st,[(n(),i(x,null,v(w,l=>t("label",{key:l.key,class:h(["flex items-center gap-3 p-3 rounded-lg border cursor-pointer transition",s.supported_vehicle_classes.includes(l.key)?"bg-indigo-500/10 border-indigo-500/40 text-indigo-300":"bg-slate-700/50 border-slate-600 hover:border-slate-500 text-slate-300"])},[t("input",{type:"checkbox",value:l.key,checked:s.supported_vehicle_classes.includes(l.key),onChange:a=>pe(l.key),class:"w-4 h-4 rounded border-slate-500 bg-slate-700 text-indigo-500 focus:ring-indigo-500/50"},null,40,ot),t("span",lt,g(l.label),1)],2)),64))])]),t("div",nt,[e[33]||(e[33]=t("h3",{class:"text-md font-medium text-white mb-3 flex items-center gap-2"},[t("span",{class:"w-6 h-6 rounded-full bg-emerald-500/20 text-emerald-400 flex items-center justify-center text-xs font-bold"},"B"),y(" Szolgáltatási Kategóriák (Expertise Tags) ")],-1)),e[34]||(e[34]=t("p",{class:"text-xs text-slate-500 mb-3"},"Válaszd ki a szolgáltatóhoz tartozó kategóriákat a hierarchikus fából.",-1)),F.value?(n(),i("div",it,[...e[30]||(e[30]=[t("svg",{class:"w-4 h-4 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("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),t("span",null,"Kategóriák betöltése...",-1)])])):(n(),i("div",rt,[(n(!0),i(x,null,v(U.value,l=>(n(),i("div",{key:l.id,class:"ml-0"},[t("div",at,[t("button",{onClick:a=>W(l.id),class:"text-slate-500 hover:text-slate-300 transition w-4 h-4 flex items-center justify-center"},[(n(),i("svg",{class:h(["w-3 h-3 transition-transform",N.value.has(l.id)?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...e[31]||(e[31]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2))],8,dt),t("label",ut,[t("input",{type:"checkbox",checked:ge(l.id),onChange:a=>G(l.id),class:"w-4 h-4 rounded border-slate-500 bg-slate-700 text-indigo-500 focus:ring-indigo-500/50"},null,40,ct),t("span",pt,g(l.name_hu||l.name_en||l.key),1),t("span",gt,"(Szint "+g(l.level)+")",1)])]),N.value.has(l.id)&&l.children?.length?(n(),i("div",mt,[(n(!0),i(x,null,v(l.children,a=>(n(),i("div",{key:a.id},[ie(r,{node:a,"selected-ids":s.category_ids,"expanded-ids":N.value,onToggle:G,onToggleExpand:W},null,8,["node","selected-ids","expanded-ids"])]))),128))])):k("",!0)]))),128))])),s.category_ids.length>0?(n(),i("div",bt,[(n(!0),i(x,null,v(s.category_ids,l=>(n(),i("span",{key:l,class:"inline-flex items-center gap-1 px-2 py-1 bg-indigo-500/10 text-indigo-300 rounded-full text-xs"},[y(g(ce(l))+" ",1),t("button",{onClick:a=>me(l),class:"hover:text-white transition"},[...e[32]||(e[32]=[t("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])],8,xt)]))),128))])):k("",!0)]),t("div",ft,[e[39]||(e[39]=t("h3",{class:"text-md font-medium text-white mb-3 flex items-center gap-2"},[t("span",{class:"w-6 h-6 rounded-full bg-amber-500/20 text-amber-400 flex items-center justify-center text-xs font-bold"},"C"),y(" Specializációk ")],-1)),e[40]||(e[40]=t("p",{class:"text-xs text-slate-500 mb-3"},"Adj meg speciális márkákat, hajtáslánc típusokat vagy egyéb címkéket.",-1)),t("div",yt,[t("div",null,[e[36]||(e[36]=t("label",{class:"block text-sm font-medium text-slate-300 mb-1"},"Márkák (Brands)",-1)),t("div",vt,[(n(!0),i(x,null,v(s.specializations.brands,(l,a)=>(n(),i("span",{key:a,class:"inline-flex items-center gap-1 px-2 py-1 bg-amber-500/10 text-amber-300 rounded-full text-xs"},[y(g(l)+" ",1),t("button",{onClick:C=>be(a),class:"hover:text-white transition"},[...e[35]||(e[35]=[t("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])],8,ht)]))),128))]),t("div",kt,[c(t("input",{"onUpdate:modelValue":e[5]||(e[5]=l=>T.value=l),onKeydown:oe(I(X,["prevent"]),["enter"]),placeholder:"pl. Volvo, Scania",class:"flex-1 px-3 py-2 bg-slate-700 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 text-sm"},null,40,_t),[[p,T.value]]),t("button",{onClick:X,disabled:!T.value.trim(),class:"px-3 py-2 bg-indigo-600 hover:bg-indigo-500 disabled:bg-indigo-600/50 text-white rounded-lg text-sm transition"}," Hozzáad ",8,wt)])]),t("div",null,[e[38]||(e[38]=t("label",{class:"block text-sm font-medium text-slate-300 mb-1"},"Hajtáslánc (Propulsion)",-1)),t("div",zt,[(n(!0),i(x,null,v(s.specializations.propulsion,(l,a)=>(n(),i("span",{key:a,class:"inline-flex items-center gap-1 px-2 py-1 bg-emerald-500/10 text-emerald-300 rounded-full text-xs"},[y(g(l)+" ",1),t("button",{onClick:C=>xe(a),class:"hover:text-white transition"},[...e[37]||(e[37]=[t("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])],8,Ct)]))),128))]),t("div",St,[c(t("input",{"onUpdate:modelValue":e[6]||(e[6]=l=>H.value=l),onKeydown:oe(I(q,["prevent"]),["enter"]),placeholder:"pl. EV, Hybrid, Diesel",class:"flex-1 px-3 py-2 bg-slate-700 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 text-sm"},null,40,jt),[[p,H.value]]),t("button",{onClick:q,disabled:!H.value.trim(),class:"px-3 py-2 bg-indigo-600 hover:bg-indigo-500 disabled:bg-indigo-600/50 text-white rounded-lg text-sm transition"}," Hozzáad ",8,$t)])])])])])])):k("",!0),z.value==="location"?(n(),i("div",Vt,[t("form",{onSubmit:I(E,["prevent"])},[t("div",At,[e[49]||(e[49]=t("h2",{class:"text-lg font-semibold text-white mb-4"},"Cím adatok",-1)),t("div",Nt,[t("div",Tt,[e[43]||(e[43]=t("label",{class:"block text-sm font-medium text-slate-300 mb-1"},"Teljes cím",-1)),c(t("input",{"onUpdate:modelValue":e[7]||(e[7]=l=>s.address=l),placeholder:"Teljes cím szövege",class:"w-full px-3 py-2 bg-slate-700 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 text-sm"},null,512),[[p,s.address]])]),t("div",null,[e[44]||(e[44]=t("label",{class:"block text-sm font-medium text-slate-300 mb-1"},"Város",-1)),c(t("input",{"onUpdate:modelValue":e[8]||(e[8]=l=>s.city=l),placeholder:"Budapest",class:"w-full px-3 py-2 bg-slate-700 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 text-sm"},null,512),[[p,s.city]])]),t("div",null,[e[45]||(e[45]=t("label",{class:"block text-sm font-medium text-slate-300 mb-1"},"Irányítószám",-1)),c(t("input",{"onUpdate:modelValue":e[9]||(e[9]=l=>s.address_zip=l),placeholder:"1011",class:"w-full px-3 py-2 bg-slate-700 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 text-sm"},null,512),[[p,s.address_zip]])]),t("div",null,[e[46]||(e[46]=t("label",{class:"block text-sm font-medium text-slate-300 mb-1"},"Utca",-1)),c(t("input",{"onUpdate:modelValue":e[10]||(e[10]=l=>s.address_street_name=l),placeholder:"Egressy",class:"w-full px-3 py-2 bg-slate-700 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 text-sm"},null,512),[[p,s.address_street_name]])]),t("div",null,[e[47]||(e[47]=t("label",{class:"block text-sm font-medium text-slate-300 mb-1"},"Házszám",-1)),c(t("input",{"onUpdate:modelValue":e[11]||(e[11]=l=>s.address_house_number=l),placeholder:"4/b",class:"w-full px-3 py-2 bg-slate-700 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 text-sm"},null,512),[[p,s.address_house_number]])]),t("div",Ht,[e[48]||(e[48]=t("label",{class:"block text-sm font-medium text-slate-300 mb-1"},"Plus Code",-1)),c(t("input",{"onUpdate:modelValue":e[12]||(e[12]=l=>s.plus_code=l),placeholder:"8FVC9X8V+XV",class:"w-full px-3 py-2 bg-slate-700 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 text-sm"},null,512),[[p,s.plus_code]])])])])],32)])):k("",!0),z.value==="hours"?(n(),i("div",Mt,[t("div",Bt,[e[52]||(e[52]=t("h2",{class:"text-lg font-semibold text-white mb-2"},"Nyitvatartás",-1)),e[53]||(e[53]=t("p",{class:"text-sm text-slate-400 mb-6"}," Állítsd be a szolgáltató nyitvatartási idejét napokra bontva. ",-1)),t("div",It,[t("label",Ot,[c(t("input",{type:"checkbox","onUpdate:modelValue":e[13]||(e[13]=l=>s.is_always_open=l),onChange:fe,class:"w-5 h-5 rounded border-slate-500 bg-slate-700 text-indigo-500 focus:ring-indigo-500/50"},null,544),[[we,s.is_always_open]]),e[50]||(e[50]=t("div",null,[t("span",{class:"text-sm font-medium text-white"},"Folyamatos (0-24) nyitvatartás"),t("p",{class:"text-xs text-slate-400 mt-0.5"},"A szolgáltató a hét minden napján 0-24 óráig nyitva van")],-1))])]),t("div",{class:h(["flex flex-wrap gap-2 mb-6",{"opacity-50 pointer-events-none":s.is_always_open}])},[t("button",{onClick:e[14]||(e[14]=l=>Q("00:00","23:59")),class:"px-3 py-1.5 text-xs font-medium rounded-lg border border-emerald-600/30 text-emerald-400 hover:bg-emerald-600/10 transition"}," 24/7 Folyamatos nyitvatartás "),t("button",{onClick:ve,class:"px-3 py-1.5 text-xs font-medium rounded-lg border border-indigo-600/30 text-indigo-400 hover:bg-indigo-600/10"}," Hétköznapok másolása (Hétfő → K-P) "),t("button",{onClick:ee,class:"px-3 py-1.5 text-xs font-medium rounded-lg border border-rose-600/30 text-rose-400 hover:bg-rose-600/10"}," Összes törlése ")],2),t("div",{class:h(["space-y-3",{"opacity-50 pointer-events-none":s.is_always_open}])},[(n(),i(x,null,v(D,l=>t("div",{key:l.key,class:h(["flex items-center gap-4 p-4 rounded-lg border",s.opening_hours[l.key]?"bg-indigo-500/5 border-indigo-500/20":"bg-slate-700/30 border-slate-600"])},[t("label",Ut,[t("input",{type:"checkbox",checked:!!s.opening_hours[l.key],onChange:a=>ye(l.key),disabled:s.is_always_open,class:"w-4 h-4 rounded border-slate-500 bg-slate-700 text-indigo-500 focus:ring-indigo-500/50"},null,40,Ft),t("span",Kt,g(l.label),1)]),s.opening_hours[l.key]?(n(),i("div",Dt,[t("input",{type:"time",value:s.opening_hours[l.key]?.open||"08:00",onInput:a=>Z(l.key,"open",a.target.value),disabled:s.is_always_open,class:"w-28 px-2 py-1.5 bg-slate-700 border border-slate-600 rounded-lg text-white text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 disabled:opacity-50"},null,40,Et),e[51]||(e[51]=t("span",{class:"text-slate-500 text-sm"},"–",-1)),t("input",{type:"time",value:s.opening_hours[l.key]?.close||"17:00",onInput:a=>Z(l.key,"close",a.target.value),disabled:s.is_always_open,class:"w-28 px-2 py-1.5 bg-slate-700 border border-slate-600 rounded-lg text-white text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 disabled:opacity-50"},null,40,Jt)])):(n(),i("span",Lt,"Zárva"))],2)),64))],2)])])):k("",!0),t("div",Pt,[t("div",Rt,[t("div",Yt,[P.value?(n(),i("span",Gt,"● Módosítások el nem mentve")):(n(),i("span",Wt,"Nincs változás"))]),t("div",Xt,[t("button",{onClick:te,class:"px-4 py-2 text-sm text-slate-400 hover:text-white transition"}," Mégse "),t("button",{onClick:E,disabled:V.value||!P.value,class:"px-6 py-2 bg-indigo-600 hover:bg-indigo-500 disabled:bg-indigo-600/50 text-white rounded-lg text-sm font-medium transition flex items-center gap-2"},[V.value?(n(),i("svg",Zt,[...e[54]||(e[54]=[t("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"},null,-1)])])):(n(),i("svg",Qt,[...e[55]||(e[55]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)])])),e[56]||(e[56]=y(" Mentés ",-1))],8,qt)])])])],64)):(n(),i("div",De,[...e[19]||(e[19]=[t("p",{class:"text-slate-400 text-center py-12"},"A szolgáltató nem található.",-1)])])),A.value?(n(),i("div",{key:4,class:h(["fixed top-4 right-4 z-50 px-4 py-3 rounded-lg shadow-xl text-sm font-medium transition-all duration-300",A.value.type==="success"?"bg-emerald-600 text-white":"bg-rose-600 text-white"])},g(A.value.message),3)):k("",!0)])}}}),os=Ae(es,[["__scopeId","data-v-4a0954df"]]);export{os as default};