import{d as B,f as S,a as j}from"../chunks/8V7BUHOp.js";import{p as C,b as E,d as J,u as K,t as N,a as Q,c as e,s as o,e as A,r as s,g as v,h as R,i as T}from"../chunks/CwuLZfOX.js";import{s as p}from"../chunks/CaaTB9LM.js";import{e as V,i as W,s as O}from"../chunks/B7ONiQEN.js";import{S as X}from"../chunks/DbqSSRnN.js";import"../chunks/DUxDMF0-.js";import{G as Y}from"../chunks/6TBmuFbO.js";import{g as D}from"../chunks/CBsIh6Wh.js";var Z=(d,l)=>D("/users/"+l()),ee=(d,l)=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),D("/users/"+l()))},se=S('<div role="link" tabindex="0" class="mt-4 grid gap-8 lg:gap-12 border-2 border-secondary p-2 rounded-xl cursor-pointer"><div class="flex justify-between items-center w-full"><h3 class="text-3xl font-semibold"> </h3> <div class="flex items-center gap-2"><span class="badge badge-success h-8">Admin</span> <a class="btn btn-primary btn-sm">Edit</a></div></div> <div><p class="mt-2 text-base font-medium"> </p> <p class="mt-2 text-base font-medium"> </p> <p class="mt-2 text-base font-medium"> </p></div></div>'),te=S('<section><div class="container mx-auto"><div class="flex items-center gap-2 sticky bg-base-100 z-40" style="top:4.11rem"><!></div> <div class="flex justify-between text-left mb-2"><h2 class="text-4xl font-semibold">Users</h2> <a class="btn btn-primary btn-sm">+ Add User</a></div> <!></div></section>');function me(d,l){C(l,!0);const F=new X(["Users/#"]);let y=E(J({})),k=E(0);K(()=>{const _=F.getData(),a={};for(const[m,r]of Object.entries(_)){const i=m.split("/");if(i.length<3)continue;const[,t,n]=i;if(!(!t||!n)){a[t]||(a[t]={}),a[t].Id=parseInt(t);try{a[t][n]=r}catch(x){console.warn(`Failed to parse field "${n}" with value "${r}"`,x)}}}const c=Object.keys(a).map(Number);A(k,c.length>0?Math.max(...c)+1:1,!0),A(y,a,!0)});var u=te(),w=e(u),f=e(w),G=e(f);Y(G,{}),s(f);var b=o(f,2),P=o(e(b),2);s(b);var z=o(b,2);V(z,17,()=>Object.entries(v(y)),W,(_,a)=>{var c=R(()=>T(v(a),2));let m=()=>v(c)[0],r=()=>v(c)[1];var i=se();i.__click=[Z,m],i.__keydown=[ee,m];var t=e(i),n=e(t),x=e(n,!0);s(n);var $=o(n,2),H=o(e($),2);s($),s(t);var I=o(t,2),h=e(I),L=e(h);s(h);var g=o(h,2),M=e(g);s(g);var U=o(g,2),q=e(U);s(U),s(I),s(i),N(()=>{p(x,r().Username),O(H,"href","/users/"+m()),p(L,`Name: ${r().FirstName??""} ${r().LastName??""}`),p(M,`Email: ${r().Email??""}`),p(q,`Phone: ${r().Phone??""}`)}),j(_,i)}),s(w),s(u),N(()=>O(P,"href","/users/new_"+v(k))),j(d,u),Q()}B(["click","keydown"]);export{me as component};
