Files
service-finder/frontend_admin/.nuxt/dist/client/_nuxt/BkOfz63t.js
2026-06-29 14:11:15 +00:00

2 lines
13 KiB
JavaScript

import{_ as O}from"./C94yYWrE.js";import{p as J,e as q,K as Q,q as X,s as Y,f as Z,g as ee,Q as te,o,c as r,j as H,a as e,b as B,w,k as d,F as f,r as b,y as L,R as S,t as u,L as R,i as A,d as $,P as se,m as k,l as m,h as oe}from"./Dc9IRd06.js";import{u as ne}from"./BZYi31Gu.js";const le=J("/logo.svg"),ae={class:"min-h-screen bg-slate-900 text-white flex"},re={class:"flex items-center gap-3 min-w-0"},ie={class:"flex-1 px-2 py-4 space-y-2 overflow-y-auto overflow-x-hidden"},de={key:0},ue=["onClick"],ce=["innerHTML"],he={class:"ml-2 mt-1 space-y-1 overflow-hidden transition-all duration-200"},ve=["innerHTML"],pe={class:"whitespace-nowrap overflow-hidden"},fe=["innerHTML"],xe={class:"p-4 border-t border-slate-700 overflow-hidden"},ke={class:"flex-1 flex flex-col min-w-0 transition-all duration-300 ease-in-out"},me={class:"sticky top-0 z-10 bg-slate-800/95 backdrop-blur-sm border-b border-slate-700"},ge={class:"flex items-center justify-between h-16 px-4 lg:px-6"},we={class:"flex items-center gap-3"},be={class:"text-lg font-semibold text-white truncate"},ye={class:"flex items-center gap-3"},_e={class:"flex items-center bg-slate-700/50 rounded-lg p-0.5"},Ce=["onClick"],Me={class:"w-8 h-8 rounded-full bg-indigo-600 flex items-center justify-center text-sm font-bold text-white"},ze={class:"hidden sm:block text-sm text-slate-300"},je={key:0,class:"absolute right-0 mt-2 w-56 bg-slate-800 border border-slate-700 rounded-xl shadow-xl py-1 z-50"},He={class:"px-4 py-3 border-b border-slate-700"},Be={class:"text-sm font-medium text-white"},Le={class:"text-xs text-slate-400 mt-0.5"},Se={class:"flex-1 p-4 lg:p-6 overflow-auto"},Te=q({__name:"default",setup(Re){const c=Q(),F=X(),h=Y(),C=ne(),{locale:M,locales:V}=Z(),T=k(()=>V.value),E=k(()=>M.value);function G(){const t=oe("access_token").value;return t?{Authorization:`Bearer ${t}`}:{}}async function N(s){M.value=s;try{await $fetch("/api/v1/auth/me/language",{method:"PATCH",headers:{...G(),"Content-Type":"application/json"},body:{preferred_language:s}})}catch(t){console.error("[Layout] Failed to persist language preference:",t)}}const n=m(!1),i=m(!1),p=m(!1),y=m(null),x=m(new Set(["Központ"])),z=k(()=>h.userEmail||"Ismeretlen Felhasználó"),P=k(()=>{const s=h.userEmail;return s?s.split("@")[0].split(".").map(t=>t[0]).join("").toUpperCase().slice(0,2):"??"}),W=[{title:"Központ",items:[{path:"/",label:"Dashboard",icon:'<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" /></svg>'}]},{title:"Felhasználók & Partnerek",items:[{label:"Garázsok",icon:'<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><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" /></svg>',children:[{path:"/garages",label:"Garázsok listája",icon:'<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" /></svg>'}]},{label:"Felhasználók",icon:'<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><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" /></svg>',children:[{path:"/users",label:"Felhasználók listája",icon:'<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><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" /></svg>'},{path:"/persons",label:"Személyek",icon:'<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><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 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z" /></svg>'}]}]},{title:"Pénzügyek",items:[{path:"/packages",label:"Csomagok",icon:'<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5m8.25 3v6.75m0 0l-3-3m3 3l3-3M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z" /></svg>'}]},{title:"Rendszer",items:[{path:"/permissions",label:"Jogosultságok",icon:'<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" /></svg>'},{label:"Rendszernaplók",icon:'<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /></svg>',children:[{path:"/",label:"Rendszernaplók",icon:'<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /></svg>'}]}]}],D=k(()=>c.path==="/"?"Dashboard":c.path.startsWith("/permissions")?"Jogosultság Kezelés":c.path.startsWith("/garages")?"Garázsok":c.path.startsWith("/persons")?"Személyek":c.path.startsWith("/users")?"Felhasználók":c.path.startsWith("/logs")?"Rendszernaplók":c.path.startsWith("/packages")?"Csomagok":"Admin Panel");function _(s){return s==="/"?c.path==="/":c.path.startsWith(s)}function U(s){return s.children?s.children.some(t=>_(t.path)):!1}function I(s){x.value.has(s.label)?x.value.delete(s.label):x.value.add(s.label)}function K(){h.logout(),p.value=!1,F.push("/login")}function j(s){y.value&&!y.value.contains(s.target)&&(p.value=!1)}return ee(()=>{document.addEventListener("click",j),C.fetchRegions().then(()=>{h.user?.region_code&&C.setActiveRegion(h.user.region_code)})}),te(()=>{document.removeEventListener("click",j)}),(s,t)=>{const g=O;return o(),r("div",ae,[n.value?(o(),r("div",{key:0,class:"fixed inset-0 bg-black/50 z-20 lg:hidden",onClick:t[0]||(t[0]=a=>n.value=!1)})):H("",!0),e("aside",{class:d(["fixed lg:static inset-y-0 left-0 z-30 flex flex-col bg-slate-800 border-r border-slate-700 transition-all duration-300 ease-in-out overflow-hidden",n.value||!i.value?"w-52":"w-20"])},[B(g,{to:"/",class:"flex items-center h-16 px-4 border-b border-slate-700 overflow-hidden hover:bg-slate-700/50 transition"},{default:w(()=>[e("div",re,[t[8]||(t[8]=e("img",{src:le,class:"h-8 w-auto flex-shrink-0",alt:"SF Logo"},null,-1)),e("div",{class:d(["transition-all duration-300 ease-in-out overflow-hidden whitespace-nowrap",n.value||!i.value?"opacity-100 max-w-[200px]":"opacity-0 max-w-0"])},[...t[7]||(t[7]=[e("div",{class:"text-sm font-bold text-white leading-tight"},"Service Finder",-1),e("div",{class:"text-[10px] font-semibold uppercase tracking-wider text-indigo-400 leading-tight"},"Admin",-1)])],2)])]),_:1}),e("button",{class:"hidden lg:flex items-center justify-center h-10 mx-2 mt-2 rounded-lg text-slate-400 hover:text-white hover:bg-slate-700 transition flex-shrink-0",onClick:t[1]||(t[1]=a=>i.value=!i.value)},[(o(),r("svg",{class:d(["w-5 h-5 transition-transform duration-300",{"rotate-180":i.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[9]||(t[9]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 19l-7-7 7-7m8 14l-7-7 7-7"},null,-1)])],2))]),e("nav",ie,[(o(),r(f,null,b(W,a=>(o(),r(f,{key:a.title},[L(e("div",{class:"px-3 py-1 text-xs font-semibold uppercase tracking-wider text-slate-500 whitespace-nowrap overflow-hidden"},u(a.title),513),[[S,n.value||!i.value]]),(o(!0),r(f,null,b(a.items,l=>(o(),r(f,{key:l.label},[l.children?(o(),r("div",de,[e("button",{class:d(["flex items-center w-full gap-3 px-3 py-2.5 rounded-lg text-sm font-medium transition",U(l)?"bg-indigo-600/20 text-indigo-300":"text-slate-300 hover:bg-slate-700 hover:text-white"]),onClick:v=>I(l)},[e("span",{class:"flex-shrink-0 w-5 h-5",innerHTML:l.icon},null,8,ce),e("span",{class:d(["flex-1 text-left whitespace-nowrap overflow-hidden transition-all duration-300 ease-in-out",n.value||!i.value?"opacity-100 max-w-[200px]":"opacity-0 max-w-0"])},u(l.label),3),(o(),r("svg",{class:d(["w-4 h-4 transition-all duration-300 ease-in-out flex-shrink-0",{"rotate-90":x.value.has(l.label),"opacity-100":n.value||!i.value,"opacity-0":i.value&&!n.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[10]||(t[10]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2))],10,ue),L(e("div",he,[(o(!0),r(f,null,b(l.children,v=>(o(),R(g,{key:v.path,to:v.path,class:d(["flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition",_(v.path)?"bg-indigo-600 text-white":"text-slate-400 hover:bg-slate-700 hover:text-white"]),onClick:t[2]||(t[2]=Ae=>n.value=!1)},{default:w(()=>[e("span",{class:"flex-shrink-0 w-4 h-4",innerHTML:v.icon},null,8,ve),e("span",pe,u(v.label),1)]),_:2},1032,["to","class"]))),128))],512),[[S,x.value.has(l.label)&&(n.value||!i.value)]])])):(o(),R(g,{key:1,to:l.path,class:d(["flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm font-medium transition",_(l.path)?"bg-indigo-600 text-white":"text-slate-300 hover:bg-slate-700 hover:text-white"]),onClick:t[3]||(t[3]=v=>n.value=!1)},{default:w(()=>[e("span",{class:"flex-shrink-0 w-5 h-5",innerHTML:l.icon},null,8,fe),e("span",{class:d(["whitespace-nowrap overflow-hidden transition-all duration-300 ease-in-out",n.value||!i.value?"opacity-100 max-w-[200px]":"opacity-0 max-w-0"])},u(l.label),3)]),_:2},1032,["to","class"]))],64))),128))],64))),64))]),e("div",xe,[e("div",{class:d(["text-xs text-slate-500 whitespace-nowrap transition-all duration-300 ease-in-out",n.value||!i.value?"opacity-100 max-w-[200px]":"opacity-0 max-w-0"])}," ServiceFinder v2.0 ",2)])],2),e("div",ke,[e("header",me,[e("div",ge,[e("div",we,[e("button",{class:"lg:hidden p-2 rounded-lg text-slate-400 hover:text-white hover:bg-slate-700 transition",onClick:t[4]||(t[4]=a=>n.value=!0)},[...t[11]||(t[11]=[e("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h16"})],-1)])]),e("h1",be,u(D.value),1)]),e("div",ye,[e("div",_e,[(o(!0),r(f,null,b(T.value,a=>(o(),r("button",{key:a.code,onClick:l=>N(a.code),class:d(["px-2.5 py-1 text-xs font-medium rounded-md transition",E.value===a.code?"bg-indigo-600 text-white shadow-sm":"text-slate-400 hover:text-white"])},u(a.code==="hu"?"HU":"EN"),11,Ce))),128))]),e("div",{class:"relative",ref_key:"dropdownRef",ref:y},[e("button",{class:"flex items-center gap-2 p-1.5 rounded-lg hover:bg-slate-700 transition",onClick:t[5]||(t[5]=a=>p.value=!p.value)},[e("div",Me,u(P.value),1),e("span",ze,u(z.value),1),t[12]||(t[12]=e("svg",{class:"w-4 h-4 text-slate-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1))]),p.value?(o(),r("div",je,[e("div",He,[e("p",Be,u(z.value),1),e("p",Le,u(A(h).userRole==="SUPERADMIN"?"Super Administrator":A(h).userRole||"Administrator"),1)]),B(g,{to:"/profile",class:"flex items-center gap-3 px-4 py-2.5 text-sm text-slate-300 hover:bg-slate-700 hover:text-white transition",onClick:t[6]||(t[6]=a=>p.value=!1)},{default:w(()=>[...t[13]||(t[13]=[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:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})],-1),$(" Profile Settings ",-1)])]),_:1}),e("button",{class:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-red-400 hover:bg-slate-700 hover:text-red-300 transition",onClick:K},[...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:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"})],-1),$(" Sign Out ",-1)])])])):H("",!0)],512)])])]),e("main",Se,[se(s.$slots,"default")])])])}}});export{Te as default};