import{_ as B}from"./C2l6xpLd.js";import{e as H,g as $,c as o,a as e,i as n,F as A,r as V,j as d,x as _,d as r,t as i,y as T,z as N,A as R,l as u,h as E,o as l,b as F,w as L}from"./BIbQr1Hg.js";import{u as P}from"./XheHpngv.js";import{_ as S}from"./DlAUqK2U.js";import"./DXATb271.js";const D={key:0,class:"flex items-center justify-center py-20"},I={key:1,class:"bg-rose-500/10 border border-rose-500/30 rounded-xl p-6 mb-8"},q={key:2,class:"space-y-4"},K={class:"flex items-start justify-between gap-4"},O={class:"flex-1 min-w-0"},U={class:"flex items-center gap-3 mb-2"},G={class:"text-lg font-semibold text-white truncate"},J={class:"text-xs font-mono text-slate-400 bg-slate-700/50 px-2 py-0.5 rounded"},Q={key:0,class:"inline-flex items-center px-2 py-0.5 rounded text-xs font-mono bg-slate-700/50 text-slate-400"},W={class:"grid grid-cols-2 gap-x-8 gap-y-2 text-sm"},X={key:0,class:"text-slate-300"},Y={key:1,class:"text-slate-300"},Z={key:2,class:"text-slate-300"},tt={class:"text-slate-300"},et={class:"text-rose-400 font-medium ml-1"},st={key:3,class:"text-slate-300"},ot={class:"flex flex-col gap-2 flex-shrink-0"},lt=["onClick","disabled"],at={key:0,class:"w-4 h-4 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},nt={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},rt={key:0,class:"bg-slate-800 rounded-xl border border-slate-700 p-12 text-center"},it={class:"bg-slate-800 rounded-xl border border-slate-700 p-6 w-full max-w-lg mx-4 shadow-2xl"},dt={class:"text-sm text-slate-400 mb-6"},ut={class:"text-white"},mt={class:"mb-4"},ct={class:"flex justify-end gap-3"},xt=["disabled"],pt={key:0,class:"w-4 h-4 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},vt={key:4,class:"fixed bottom-6 right-6 z-50 bg-emerald-600 text-white px-4 py-3 rounded-lg shadow-lg text-sm flex items-center gap-2 animate-slide-up"},ft=H({__name:"rejected",setup(kt){const{formatDate:z}=P(),k=u(!0),b=u(!1),c=u([]),v=u(""),g=u(null),x=u(!1),m=u(null),p=u(""),f=u(!1);function h(){const t=E("access_token").value;return t?{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}:{"Content-Type":"application/json"}}function y(a){v.value=a,setTimeout(()=>{v.value=""},3e3)}async function w(){k.value=!0,b.value=!1;try{const a=await $fetch("/api/v1/admin/providers?status=rejected&limit=100&sort_by=created_at&sort_order=desc",{headers:h()});c.value=a}catch(a){console.error("Failed to fetch rejected providers:",a),b.value=!0}finally{k.value=!1}}function j(a){m.value=a,p.value="",x.value=!0}async function C(){if(m.value){f.value=!0;try{await $fetch(`/api/v1/admin/providers/${m.value.id}/restore`,{method:"POST",headers:h(),body:{reason:p.value||"Admin restored via rejected queue"}}),y(`"${m.value.name}" sikeresen visszaállítva`),c.value=c.value.filter(a=>a.id!==m.value.id),x.value=!1,m.value=null}catch(a){const t=a?.response?._data?.detail||a?.data?.detail||"Ismeretlen hiba";y(`Hiba: ${t}`),console.error("Failed to restore provider:",a)}finally{f.value=!1}}}return $(()=>{w()}),(a,t)=>{const M=B;return l(),o("div",null,[t[23]||(t[23]=e("div",{class:"mb-8"},[e("h1",{class:"text-2xl font-bold text-white"},"Elutasított szolgáltatók"),e("p",{class:"text-slate-400 mt-1"},"Elutasított szolgáltatók visszaállítása az aktív kereshető szolgáltatók közé")],-1)),n(k)?(l(),o("div",D,[...t[3]||(t[3]=[e("div",{class:"text-slate-400 flex items-center gap-3"},[e("svg",{class:"w-5 h-5 animate-spin",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"})]),e("span",null,"Elutasított szolgáltatók betöltése...")],-1)])])):n(b)?(l(),o("div",I,[t[4]||(t[4]=e("p",{class:"text-rose-400"},"Hiba történt a szolgáltatók betöltése közben.",-1)),e("button",{onClick:w,class:"mt-3 text-sm text-rose-300 hover:text-rose-200 underline"},"Újrapróbálkozás")])):(l(),o("div",q,[(l(!0),o(A,null,V(n(c),s=>(l(),o("div",{key:s.id,class:"bg-slate-800 rounded-xl border border-slate-700 p-6 hover:border-rose-500/30 transition"},[e("div",K,[e("div",O,[e("div",U,[e("h3",G,i(s.name),1),t[5]||(t[5]=e("span",{class:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-rose-500/10 text-rose-400"}," Elutasított ",-1)),e("code",J,i(s.source),1),s.source_table?(l(),o("span",Q,i(s.source_table),1)):d("",!0)]),e("div",W,[s.address?(l(),o("div",X,[t[6]||(t[6]=e("span",{class:"text-slate-500"},"Cím:",-1)),r(" "+i(s.address),1)])):d("",!0),s.city?(l(),o("div",Y,[t[7]||(t[7]=e("span",{class:"text-slate-500"},"Város:",-1)),r(" "+i(s.city),1)])):d("",!0),s.category?(l(),o("div",Z,[t[8]||(t[8]=e("span",{class:"text-slate-500"},"Kategória:",-1)),r(" "+i(s.category),1)])):d("",!0),e("div",tt,[t[9]||(t[9]=e("span",{class:"text-slate-500"},"Validációs pontszám:",-1)),e("span",et,i(s.validation_score),1)]),s.created_at?(l(),o("div",st,[t[10]||(t[10]=e("span",{class:"text-slate-500"},"Létrehozva:",-1)),r(" "+i(n(z)(s.created_at)),1)])):d("",!0)])]),e("div",ot,[e("button",{onClick:bt=>j(s),disabled:n(g)===s.id,class:"px-4 py-2 bg-emerald-600 hover:bg-emerald-500 disabled:bg-emerald-600/50 text-white rounded-lg text-sm font-medium transition flex items-center gap-2"},[n(g)===s.id?(l(),o("svg",at,[...t[11]||(t[11]=[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"},null,-1)])])):(l(),o("svg",nt,[...t[12]||(t[12]=[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"},null,-1)])])),t[13]||(t[13]=r(" Visszaállítás ",-1))],8,lt),F(M,{to:`/providers/${s.id}`,class:"px-4 py-2 bg-slate-700 hover:bg-slate-600 text-slate-300 rounded-lg text-sm font-medium transition flex items-center gap-2 text-center"},{default:L(()=>[...t[14]||(t[14]=[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 12a3 3 0 11-6 0 3 3 0 016 0z"}),e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})],-1),r(" Részletek ",-1)])]),_:1},8,["to"])])])]))),128)),n(c).length===0?(l(),o("div",rt,[...t[15]||(t[15]=[e("svg",{class:"w-12 h-12 mx-auto text-slate-600 mb-4",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),e("h3",{class:"text-lg font-medium text-slate-400 mb-1"},"Nincs elutasított szolgáltató",-1),e("p",{class:"text-sm text-slate-500"},"Minden szolgáltató jóváhagyott státuszban van.",-1)])])):d("",!0)])),n(x)?(l(),o("div",{key:3,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:t[2]||(t[2]=_(s=>x.value=!1,["self"]))},[e("div",it,[t[21]||(t[21]=e("h2",{class:"text-lg font-semibold text-white mb-2"},"Szolgáltató visszaállítása",-1)),e("p",dt,[t[16]||(t[16]=r(" Biztosan visszaállítod a(z) ",-1)),e("strong",ut,i(n(m)?.name),1),t[17]||(t[17]=r(" szolgáltatót? A visszaállítás után a szolgáltató újra elérhető lesz a keresőben és a listákban. ",-1))]),e("form",{onSubmit:_(C,["prevent"])},[e("div",mt,[t[18]||(t[18]=e("label",{class:"block text-sm font-medium text-slate-300 mb-1"},"Indoklás (opcionális)",-1)),T(e("textarea",{"onUpdate:modelValue":t[0]||(t[0]=s=>R(p)?p.value=s:null),rows:"3",placeholder:"Add meg a visszaállítás okát...",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-emerald-500/50 focus:border-emerald-500 text-sm resize-none"},null,512),[[N,n(p)]])]),e("div",ct,[e("button",{type:"button",onClick:t[1]||(t[1]=s=>x.value=!1),class:"px-4 py-2 text-sm text-slate-400 hover:text-white transition"},"Mégse"),e("button",{type:"submit",disabled:n(f),class:"px-4 py-2 bg-emerald-600 hover:bg-emerald-500 disabled:bg-emerald-600/50 text-white rounded-lg text-sm font-medium transition flex items-center gap-2"},[n(f)?(l(),o("svg",pt,[...t[19]||(t[19]=[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"},null,-1)])])):d("",!0),t[20]||(t[20]=r(" Visszaállítás ",-1))],8,xt)])],32)])])):d("",!0),n(v)?(l(),o("div",vt,[t[22]||(t[22]=e("svg",{class:"w-4 h-4 flex-shrink-0",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)),r(" "+i(n(v)),1)])):d("",!0)])}}}),zt=S(ft,[["__scopeId","data-v-956f226d"]]);export{zt as default};