PageSourceSearch

https://epsmasdash-ms8uwkec.manus.space/assets/AgentAccountsPanel-B0GtKqEU.js

js epsmasdash-ms8uwkec.manus.space collected 2026-10-03 05:02:06 UTC 53,482 bytes, 938 lines download raw bytes

1import { c as createLucideIcon, j as jsxRuntimeExports, V as cn, t as trpc, r as reactExports, b as toast, m as Users, U as USFlag, B as Button, a8 as UserPlus, o as RefreshCw, M as Mail, d as Badge, P as Pencil, a1 as ShieldCheck } from './index-CNT5CkK7.js';
2import { I as Input } from './input-Dy4-W9m0.js';
3import { D as Dialog, b as DialogContent, c as DialogHeader, d as DialogTitle, e as DialogFooter } from './useComposition-DPCJbBnn.js';
4import { D as DropdownMenu, a as DropdownMenuTrigger, b as DropdownMenuContent, c as DropdownMenuItem, d as DropdownMenuSeparator } from './dropdown-menu-Cv-n8opx.js';
5import { C as Copy } from './copy-BAoxz8Jl.js';
6import { I as Info } from './info-D8W5gqg6.js';
7import { C as ChevronUp } from './chevron-up-Do8Lk9oa.js';
8import { C as ChevronDown } from './chevron-down-DFKrqu4j.js';
9import { M as Monitor } from './monitor-D_0pd9Oa.js';
10import { S as Smartphone } from './smartphone-CqOXnKJs.js';
11import { L as Link2 } from './link-2-fjaVShKv.js';
12import { C as Check } from './check-BezXvNsL.js';
13import { K as KeyRound } from './key-round-CJadK3Ea.js';
14import { T as Trash2 } from './trash-2-DkCMhEWr.js';
15import './index-BEBgmBqK.js';
16import './index-D1Fi90JZ.js';
17
18/**
19 * @license lucide-react v0.453.0 - ISC
20 *
21 * This source code is licensed under the ISC license.
22 * See the LICENSE file in the root directory of this source tree.
23 */
24
25
26const EllipsisVertical = createLucideIcon("EllipsisVertical", [
27  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
28  ["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
29  ["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
30]);
31
32/**
33 * @license lucide-react v0.453.0 - ISC
34 *
35 * This source code is licensed under the ISC license.
36 * See the LICENSE file in the root directory of this source tree.
37 */
38
39
40const ShieldOff = createLucideIcon("ShieldOff", [
41  ["path", { d: "m2 2 20 20", key: "1ooewy" }],
42  [
43    "path",
44    {
45      d: "M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",
46      key: "1jlk70"
47    }
48  ],
49  [
50    "path",
51    {
52      d: "M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",
53      key: "18rp1v"
54    }
55  ]
56]);
57
58function Table({ className, ...props }) {
59  return /* @__PURE__ */ jsxRuntimeExports.jsx(
60    "div",
61    {
62      "data-slot": "table-container",
63      className: "relative w-full overflow-x-auto",
64      children: /* @__PURE__ */ jsxRuntimeExports.jsx(
65        "table",
66        {
67          "data-slot": "table",
68          className: cn("w-full caption-bottom text-sm", className),
69          ...props
70        }
71      )
72    }
73  );
74}
75function TableHeader({ className, ...props }) {
76  return /* @__PURE__ */ jsxRuntimeExports.jsx(
77    "thead",
78    {
79      "data-slot": "table-header",
80      className: cn("[&_tr]:border-b", className),
81      ...props
82    }
83  );
84}
85function TableBody({ className, ...props }) {
86  return /* @__PURE__ */ jsxRuntimeExports.jsx(
87    "tbody",
88    {
89      "data-slot": "table-body",
90      className: cn("[&_tr:last-child]:border-0", className),
91      ...props
92    }
93  );
94}
95function TableRow({ className, ...props }) {
96  return /* @__PURE__ */ jsxRuntimeExports.jsx(
97    "tr",
98    {
99      "data-slot": "table-row",
100      className: cn(
101        "hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",
102        className
103      ),
104      ...props
105    }
106  );
107}
108function TableHead({ className, ...props }) {
109  return /* @__PURE__ */ jsxRuntimeExports.jsx(
110    "th",
111    {
112      "data-slot": "table-head",
113      className: cn(
114        "text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
115        className
116      ),
117      ...props
118    }
119  );
120}
121function TableCell({ className, ...props }) {
122  return /* @__PURE__ */ jsxRuntimeExports.jsx(
123    "td",
124    {
125      "data-slot": "table-cell",
126      className: cn(
127        "p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
128        className
129      ),
130      ...props
131    }
132  );
133}
134
135const AGENT_ROSTER = [
136  { agentKey: "josh-hinkle", agentName: "Josh Hinkle", defaultEmail: "[email protected]" },
137  { agentKey: "charlie-drain", agentName: "Charlie Drain", defaultEmail: "[email protected]" },
138  { agentKey: "michael-jividen", agentName: "Michael Jividen", defaultEmail: "[email protected]" },
139  { agentKey: "jon-bucher", agentName: "Jon Bucher", defaultEmail: "[email protected]" },
140  { agentKey: "zach-hinkle", agentName: "Zach Hinkle", defaultEmail: "[email protected]" },
141  { agentKey: "angie-hinkle", agentName: "Angie Hinkle", defaultEmail: "[email protected]" },
142  { agentKey: "adam-kaufman", agentName: "Adam Kaufman", defaultEmail: "[email protected]" },
143  { agentKey: "lesley-wiegand", agentName: "Lesley Wiegand", defaultEmail: "[email protected]" },
144  { agentKey: "stacey-hinkle", agentName: "Stacey Hinkle", defaultEmail: "[email protected]" }
145];
146function generatePin() {
147  return String(Math.floor(1e5 + Math.random() * 9e5));
148}
149function AgentAccountsPanel() {
150  const utils = trpc.useUtils();
151  const { data: accounts = [], isLoading } = trpc.agentAuth.listAccounts.useQuery();
152  const [createOpen, setCreateOpen] = reactExports.useState(false);
153  const [createForm, setCreateForm] = reactExports.useState({
154    agentKey: "",
155    agentName: "",
156    pin: "",
157    email: "",
158    calendlyLink: ""
159  });
160  const [copiedPassword, setCopiedPassword] = reactExports.useState(false);
161  const [resetOpen, setResetOpen] = reactExports.useState(false);
162  const [resetTarget, setResetTarget] = reactExports.useState(null);
163  const [newPassword, setNewPassword] = reactExports.useState("");
164  const [copiedReset, setCopiedReset] = reactExports.useState(false);
165  const [editOpen, setEditOpen] = reactExports.useState(false);
166  const [editTarget, setEditTarget] = reactExports.useState(null);
167  const [editEmail, setEditEmail] = reactExports.useState("");
168  const [editCalendly, setEditCalendly] = reactExports.useState("");
169  const [deleteOpen, setDeleteOpen] = reactExports.useState(false);
170  const [deleteTarget, setDeleteTarget] = reactExports.useState(null);
171  const createAccount = trpc.agentAuth.createAccount.useMutation({
172    onSuccess: () => {
173      toast.success(`Account created for ${createForm.agentName}`);
174      utils.agentAuth.listAccounts.invalidate();
175      setCreateOpen(false);
176      setCreateForm({ agentKey: "", agentName: "", pin: "", email: "", calendlyLink: "" });
177    },
178    onError: (e) => toast.error(e.message)
179  });
180  const setPin = trpc.agentAuth.setPin.useMutation({
181    onSuccess: () => {
182      toast.success(`PIN updated for ${resetTarget?.agentName}`);
183      utils.agentAuth.listAccounts.invalidate();
184      setResetOpen(false);
185      setResetTarget(null);
186      setNewPassword("");
187    },
188    onError: (e) => toast.error(e.message)
189  });
190  const setActive = trpc.agentAuth.setActive.useMutation({
191    onSuccess: (_, vars) => {
192      toast.success(vars.isActive ? "Account activated" : "Account deactivated");
193      utils.agentAuth.listAccounts.invalidate();
194    },
195    onError: (e) => toast.error(e.message)
196  });
197  const deleteAccount = trpc.agentAuth.deleteAccount.useMutation({
198    onMutate: async ({ agentKey }) => {
199      await utils.agentAuth.listAccounts.cancel();
200      const prev = utils.agentAuth.listAccounts.getData();
201      utils.agentAuth.listAccounts.setData(
202        void 0,
203        (old) => old?.filter((a) => a.agentKey !== agentKey) ?? []
204      );
205      return { prev };
206    },
207    onError: (_err, _vars, context) => {
208      if (context?.prev) utils.agentAuth.listAccounts.setData(void 0, context.prev);
209      toast.error("Failed to delete account");
210    },
211    onSuccess: (_, vars) => {
212      toast.success(`Account for ${deleteTarget?.agentName ?? vars.agentKey} deleted`);
213      setDeleteOpen(false);
214      setDeleteTarget(null);
215    },
216    onSettled: () => utils.agentAuth.listAccounts.invalidate()
217  });
218  const updateAccount = trpc.agentAuth.updateAccount.useMutation({
219    onSuccess: () => {
220      toast.success(`Updated info for ${editTarget?.agentName}`);
221      utils.agentAuth.listAccounts.invalidate();
222      setEditOpen(false);
223      setEditTarget(null);
224    },
225    onError: (e) => toast.error(e.message)
226  });
227  const existingKeys = new Set(accounts.map((a) =>
227 a.agentKey));
228  const availableAgents = AGENT_ROSTER.filter((a) => !existingKeys.has(a.agentKey));
229  function handleAgentSelect(agentKey) {
230    const agent = AGENT_ROSTER.find((a) => a.agentKey === agentKey);
231    if (!agent) return;
232    const pin = generatePin();
233    setCreateForm({ agentKey, agentName: agent.agentName, pin, email: agent.defaultEmail, calendlyLink: "" });
234  }
235  function copyToClipboard(text, setCopied) {
236    navigator.clipboard.writeText(text).then(() => {
237      setCopied(true);
238      setTimeout(() => setCopied(false), 2e3);
239    });
240  }
241  function openReset(account) {
242    setResetTarget(account);
243    setNewPassword(generatePin());
244    setResetOpen(true);
245    setCopiedReset(false);
246  }
247  function openEdit(account) {
248    setEditTarget(account);
249    setEditEmail(account.email ?? "");
250    setEditCalendly(account.calendlyLink ?? "");
251    setEditOpen(true);
252  }
253  const agentLoginUrl = `${window.location.origin}/agent-login`;
254  const [showInstructions, setShowInstructions] = reactExports.useState(false);
255  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-6 max-w-5xl mx-auto", children: [
256    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between mb-6", children: [
257      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
258        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-10 h-10 rounded-lg flex items-center justify-center", style: { background: "var(--eps-gold)" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Users, { className: "w-5 h-5 text-slate-900" }) }),
259        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
260          /* @__PURE__ */ jsxRuntimeExports.jsxs("h1", { className: "text-xl font-bold text-white", style: { fontFamily: "'Playfair Display', serif" }, children: [
261            /* @__PURE__ */ jsxRuntimeExports.jsx(USFlag, { size: 18 }),
262            " Agent Account Management"
263          ] }),
264          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-slate-400", children: "Create and manage agent login credentials" })
265        ] })
266      ] }),
267      /* @__PURE__ */ jsxRuntimeExports.jsxs(
268        Button,
269        {
270          onClick: () => {
271            setCreateForm({ agentKey: "", agentName: "", pin: "", email: "", calendlyLink: "" });
272            setCreateOpen(true);
273          },
274          disabled: availableAgents.length === 0,
275          className: "gap-2 font-semibold",
276          style: { background: "var(--eps-gold)", color: "white", fontWeight: "bold" },
277          children: [
278            /* @__PURE__ */ jsxRuntimeExports.jsx(UserPlus, { className: "w-4 h-4" }),
279            "New Agent Account"
280          ]
281        }
282      )
283    ] }),
284    /* @__PURE__ */ jsxRuntimeExports.jsxs(
285      "div",
286      {
287        className: "rounded-lg border p-4 mb-6 flex items-center justify-between gap-4",
288        style: { background: "rgba(212,175,55,0.08)", borderColor: "rgba(212,175,55,0.3)" },
289        children: [
290          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
291            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-slate-400 mb-1", children: "Agent Login URL — share this with all agents" }),
292            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-mono text-white", children: agentLoginUrl })
293          ] }),
294          /* @__PURE__ */ jsxRuntimeExports.jsxs(
295            Button,
296            {
297              variant: "outline",
298              size: "sm",
299              className: "gap-2 flex-shrink-0 border-yellow-600/40 text-yellow-400 hover:bg-yellow-900/20",
300              onClick: () => {
301                navigator.clipboard.writeText(agentLoginUrl);
302                toast.success("URL copied!");
303              },
304              children: [
305                /* @__PURE__ */ jsxRuntimeExports.jsx(Copy, { className: "w-3.5 h-3.5" }),
306                "Copy URL"
307              ]
308            }
309          )
310        ]
311      }
312    ),
313    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "rounded-lg border mb-6 overflow-hidden", style: { borderColor: "rgba(212,175,55,0.3)" }, children: [
314      /* @__PURE__ */ jsxRuntimeExports.jsxs(
315        "button",
316        {
317          onClick: () => setShowInstructions((o) => !o),
318          className: "w-full flex items-center justify-between px-4 py-3 text-left hover:bg-white/5 transition-colors",
319          style: { background: "rgba(212,175,55,0.06)" },
320          children: [
321            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
322              /* @__PURE__ */ jsxRuntimeExports.jsx(Info, { className: "w-4 h-4", style: { color: "var(--eps-gold)" } }),
323              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm font-semibold text-white", children: "Agent Login & App Download Instructions" })
324            ] }),
325            showInstructions ? /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronUp, { className: "w-4 h-4 text-slate-400" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-4 h-4 text-slate-400" })
326          ]
327        }
328      ),
329      showInstructions && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-4 pb-5 pt-2 space-y-5", style: { background: "rgba(0,0,0,0.2)" }, children: [
330        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
331          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
332            /* @__PURE__ */ jsxRuntimeExports.jsx(Monitor, { className: "w-4 h-4", style: { color: "var(--eps-gold)" } }),
333            /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-sm font-semibold text-white", children: "Logging In on a Computer or Laptop" })
334          ] }),
335          /* @__PURE__ */ jsxRuntimeExports.jsxs("ol", { className: "space-y-1.5 text-sm text-slate-300 list-decimal list-inside", children: [
336            /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: "Open any web browser (Chrome, Edge, Safari, Firefox)." }),
337            /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
338              "Go to: ",
339              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-mono text-blue-400 break-all", children: agentLoginUrl })
340            ] }),
341            /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
342              "Enter your ",
343              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white font-medium", children: "Username" }),
344              " and ",
345              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white font-medium", children: "6-digit PIN" }),
346              " provided by your administrator."
347            ] }),
348            /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
349              "Click ",
350              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white font-medium", children: "Sign In" }),
351              ". You will stay logged in until you manually sign out."
352            ] })
353          ] }),
354          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 flex", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
355            Button,
356            {
357              variant: "outline",
358              size: "sm",
359              className: "gap-2 border-yellow-600/40 text-yellow-400 hover:bg-yellow-900/20 text-xs",
360              onClick: () => {
361                navigator.clipboard.writeText(agentLoginUrl);
362                toast.success("Login URL copied!");
363              },
364              children: [
365                /* @__PURE__ */ jsxRuntimeExports.jsx(Copy, { className: "w-3 h-3" }),
366                " Copy Login URL"
367              ]
368            }
369          ) })
370        ] }),
371        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border-t", style: { borderColor: "rgba(255,255,255,0.08)" } }),
372        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
373          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
374            /* @__PURE__ */ jsxRuntimeExports.jsx(Smartphone, { className: "w-4 h-4", style: { color: "var(--eps-gold)" } }),
375            /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-sm font-semibold text-white", children: "Installing the App on Your Phone" })
376          ] }),
377          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-slate-400 mb-3", children: "The EPS MAS Dashboard is a Progressive Web App (PWA) — no app store required. Follow the steps for your device below." }),
378          /* @__P
378URE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
379            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "rounded-lg border p-3", style: { borderColor: "rgba(255,255,255,0.1)", background: "rgba(255,255,255,0.03)" }, children: [
380              /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs font-semibold text-white mb-2 flex items-center gap-1.5", children: [
381                /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-base", children: "🍎" }),
382                " iPhone / iPad (Safari)"
383              ] }),
384              /* @__PURE__ */ jsxRuntimeExports.jsxs("ol", { className: "space-y-1 text-xs text-slate-300 list-decimal list-inside", children: [
385                /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
386                  "Open ",
387                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white font-medium", children: "Safari" }),
388                  " (must be Safari, not Chrome)."
389                ] }),
390                /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
391                  "Navigate to: ",
392                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-mono text-blue-400 break-all", children: agentLoginUrl })
393                ] }),
394                /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
395                  "Tap the ",
396                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white font-medium", children: "Share" }),
397                  " button (box with arrow pointing up) at the bottom of the screen."
398                ] }),
399                /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
400                  "Scroll down and tap ",
401                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white font-medium", children: '"Add to Home Screen"' }),
402                  "."
403                ] }),
404                /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
405                  "Tap ",
406                  /* @__P
406URE__ */ jsxRuntimeExports.jsx("span", { className: "text-white font-medium", children: "Add" }),
407                  " in the top-right corner."
408                ] }),
409                /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: "The EPS app icon will appear on your home screen. Tap it to open and log in." })
410              ] })
411            ] }),
412            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "rounded-lg border p-3", style: { borderColor: "rgba(255,255,255,0.1)", background: "rgba(255,255,255,0.03)" }, children: [
413              /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs font-semibold text-white mb-2 flex items-center gap-1.5", children: [
414                /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-base", children: "🤖" }),
415                " Android (Chrome)"
416              ] }),
417              /* @__PURE__ */ jsxRuntimeExports.jsxs("ol", { className: "space-y-1 text-xs text-slate-300 list-decimal list-inside", children: [
418                /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
419                  "Open ",
420                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white font-medium", children: "Chrome" }),
421                  " on your Android device."
422                ] }),
423                /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
424                  "Navigate to: ",
425                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-mono text-blue-400 break-all", children: agentLoginUrl })
426                ] }),
427                /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
428                  "Tap the ",
429                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white font-medium", children: "three-dot menu" }),
430                  " (⋮) in the top-right corner."
431                ] }),
432                /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
433                  "Tap ",
434                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white font-medium", children: '"Add to Home screen"' }),
435                  " or ",
436                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white font-medium", children: '"Install app"' }),
437                  "."
438                ] }),
439                /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
440                  "Tap ",
441                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white font-medium", children: "Add" }),
442                  " or ",
443                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white font-medium", children: "Install" }),
444                  " to confirm."
445                ] }),
446                /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: "The EPS app icon will appear on your home screen. Tap it to open and log in." })
447              ] })
448            ] })
449          ] }),
450          /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-slate-500 mt-3", children: [
451            "💡 ",
452            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-slate-400", children: "Tip:" }),
453            " Once installed, the app works just like a native app — full screen, no browser bar, and stays logged in."
454          ] })
455        ] })
456      ] })
457    ] }),
458    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "rounded-lg border overflow-hidden", style: { borderColor: "var(--sidebar-border)" }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Table, { children: [
459      /* @__PURE__ */ jsxRuntimeExports.jsx(TableHeader, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(TableRow, { style: { background: "var(--eps-navy)" }, children: [
460        /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { className: "text-slate-300 font-semibold", children: "Agent" }),
461        /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { className: "text-slate-300 font-semibold hidden md:table-cell", children: "Username" }),
462        /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { className: "text-slate-300 font-semibold hidden lg:table-cell", children: "Email / Calendly" }),
463        /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { className: "text-slate-300 font-semibold hidden xl:table-cell", children: "Review Link" }),
464        /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { className: "text-slate-300 font-semibold", children: "Status" }),
465        /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { className: "text-slate-300 font-semibold hidden sm:table-cell", children: "Last Login" }),
466        /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { className: "text-slate-300 font-semibold text-right", children: "Actions" })
467      ] }) }),
468      /* @__PURE__ */ jsxRuntimeExports.jsx(TableBody, { children: isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(TableRow, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(TableCell, { colSpan: 7, className: "text-center py-8 text-slate-400", children: [
469        /* @__PURE__ */ jsxRuntimeExports.jsx(RefreshCw, { className: "w-4 h-4 animate-spin inline mr-2" }),
470        "Loading accounts..."
471      ] }) }) : accounts.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(TableRow, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(TableCell, { colSpan: 7, className: "text-center py-10 text-slate-400", children: [
472        /* @__PURE__ */ jsxRuntimeExports.jsx(Users, { className: "w-8 h-8 mx-auto mb-2 opacity-30" }),
473        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm", children: "No agent accounts yet." }),
474        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs mt-1", children: 'Click "New Agent Account" to create the first one.' })
475      ] }) }) : accounts.map((account) => /* @__PURE__ */ jsxRuntimeExports.jsxs(TableRow, { className: "border-b", style: { borderColor: "var(--sidebar-border)" }, children: [
476        /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
477          account.headshotUrl ? /* @__PURE__ */ jsxRuntimeExports.jsx(
478            "img",
479            {
480              src: account.headshotUrl,
481              alt: account.agentName,
482              className: "w-9 h-9 rounded-full object-cover flex-shrink-0 border border-slate-600"
483            }
484          ) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-9 h-9 rounded-full bg-slate-700 flex items-center justify-center flex-shrink-0 border border-slate-600", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm font-bold text-slate-300", children: account.agentName.charAt(0) }) }),
485          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
486            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white font-medium text-sm", children: account.agentName }),
487            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-slate-500", children: account.agentKey })
488          ] })
489        ] }) }),
490        /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "hidden md:table-cell", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-mono text-sm text-slate-300", children: account.username }) }),
491        /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "hidden lg:table-cell", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-1", children: [
492          account.email ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1.5 text-xs text-slate-300", children: [
493            /* @__PURE__ */ jsxRuntimeExports.jsx(Mail, { className: "w-3 h-3 text-slate-500 flex-shrink-0" }),
494            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate max-w-[160px]", children: account.email })
495          ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1.5 text-xs text-slate-600 italic", children: [
496            /* @__PURE__ */ jsxRuntimeExports.jsx(Mail, { className: "w-3 h-3 flex-shrink-0" }),
497            "No email set"
498          ] }),
499          account.calendlyLink ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1.5 text-xs text-blue-400", children: [
500            /* @__PURE__ */ jsxRuntimeExports.jsx(Link2, { className: "w-3 h-3 flex-shrink-0" }),
501            /* @__PURE__ */ jsxRuntimeExports.jsx(
502              "a",
503              {
504                href: account.calendlyLink,
505                target: "_blank",
506                rel: "noopener noreferrer",
507                className: "truncate max-w-[160px] hover:underline",
508                children: account.calendlyLink.replace("https://", "")
509              }
510            )
511          ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1.5 text-xs text-slate-600 italic", children: [
512            /* @__PURE__ */ jsxRuntimeExports.jsx(Link2, { className: "w-3 h-3 flex-shrink-0" }),
513            "No Calendly set"
514          ] })
515        ] }) }),
516        /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "hidden xl:table-cell", children: account.googleReviewLink ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
517          "a",
518          {
519            href: account.googleReviewLink,
520            target: "_blank",
521            rel: "noopener noreferrer",
522            className: "text-xs text-green-400 hover:underline flex items-center gap-1",
523            title: account.googleReviewLink,
524            children: [
525              /* @__PURE__ */ jsxRuntimeExports.jsx(Check, { className: "w-3 h-3" }),
526              " Set"
527            ]
528          }
529        ) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs text-slate-600 italic", children: "Not set" }) }),
530        /* @__PURE__ */ jsxRuntimeExports.jsxs(TableCell, { children: [
531          account.isActive ? /* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { className: "bg-green-900/40 text-green-400 border-green-700/40 text-xs", children: "Active" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { className: "bg-red-900/40 text-red-400 border-red-700/40 text-xs", children: "Inactive" }),
532          account.failedAttempts > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-amber-400 text-xs mt-1", children: [
533            account.failedAttempts,
534            " failed"
535          ] })
536        ] }),
537        /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "text-slate-400 text-sm hidden sm:table-cell", children: account.lastLogin ? new Date(account.lastLogin).toLocaleString() : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-slate-600 italic text-xs", children: "Never" }) }),
538        /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "text-right", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(DropdownMenu, { children: [
539          /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "ghost", size: "sm", className: "h-8 w-8 p-0 text-slate-400 hover:text-white", children: /* @__PURE__ */ jsxRuntimeExports.jsx(EllipsisVertical, { className: "w-4 h-4" }) }) }),
540          /* @__PURE__ */ jsxRuntimeExports.jsxs(DropdownMenuContent, { align: "end", className: "w-44", children: [
541            /* @__PURE__ */ jsxRuntimeExports.jsxs(DropdownMenuItem, { onClick: () => openReset(account), className: "gap-2 cursor-pointer", children: [
542              /* @__PURE__ */ jsxRuntimeExports.jsx(KeyRound, { className: "w-3.5 h-3.5", style: { color: "var(--eps-gold)" } }),
543              "Set PIN"
544            ] }),
545            /* @__PURE__ */ jsxRuntimeExports.jsxs(DropdownMenuItem, { onClick: () => openEdit(account), className: "gap-2 cursor-pointer", children: [
546              /* @__PURE__ */ jsxRuntimeExports.jsx(Pencil, { className: "w-3.5 h-3.5" }),
547              "Edit Details"
548            ] }),
549            /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownMenuSeparator, {}),
550            /* @__PURE__ */ jsxRuntimeExports.jsx(
551              DropdownMenuItem,
552              {
553                onClick: () => setActive.mutate({ agentKey: account.agentKey, isActive: !account.isActive }),
554                disabled: setActive.isPending,
555                className: `gap-2 cursor-pointer ${account.isActive ? "text-red-400 focus:text-red-300" : "text-green-400 focus:text-green-300"}`,
556                children: account.isActive ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
557                  /* @__PURE__ */ jsxRuntimeExports.jsx(ShieldOff, { className: "w-3.5 h-3.5" }),
558                  "Deactivate"
559                ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
560                  /* @__PURE__ */ jsxRuntimeExports.jsx(ShieldCheck, { className: "w-3.5 h-3.5" }),
561                  "Activate"
562                ] })
563              }
564            ),
565            /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownMenuSeparator, {}),
566            /* @__PURE__ */ jsxRuntimeExports.jsxs(
567              DropdownMenuItem,
568              {
569                onClick: () => {
570                  setDeleteTarget(account);
571                  setDeleteOpen(true);
572                },
573                className: "gap-2 cursor-pointer text-red-500 focus:text-red-400 focus:bg-red-950/40",
574                children: [
575                  /* @__PURE__ */ jsxRuntimeExports.jsx(Trash2, { className: "w-3.5 h-3.5" }),
576                  "Delete Account"
577                ]
578              }
579            )
580          ] })
581        ] }) })
582      ] }, account.id)) })
583    ] }) }),
584    availableAgents.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-4 rounded-lg border p-4", style: { borderColor: "rgba(212,175,55,0.2)", background: "rgba(212,175,55,0.04)" }, children: [
585      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-slate-400 mb-2 font-medium", children: "Agents without accounts yet:" }),
586      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-wrap gap-2", children: availableAgents.map((a) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
587        "button",
588        {
589          className: "text-xs px-3 py-1.5 rounded-full border font-medium transition-colors hover:opacity-80",
590          style: { borderColor: "rgba(212,175,55,0.4)", color: "var(--eps-gold)", background: "rgba(212,175,55,0.08)" },
591          onClick: () => {
592            handleAgentSelect(a.agentKey);
593            setCreateOpen(true);
594          },
595          children: [
596            "+ ",
597            a.agentName
598          ]
599        },
600        a.agentKey
601      )) })
602    ] }),
603    /* @__PURE__ */ jsxRuntimeExports.jsx(Dialog, { open: createOpen, onOpenChange: setCreateOpen, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogContent, { className: "max-w-md", style: { background: "var(--eps-navy)", borderColor: "var(--sidebar-border)" }, children: [
604      /* @__PURE__ */ jsxRuntimeExports.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogTitle, { className: "text-white flex items-center gap-2", children: [
605        /* @__PURE__ */ jsxRuntimeExports.jsx(UserPlus, { className: "w-5 h-5", style: { color: "var(--eps-gold)" } }),
606        "Create Agent Account"
607      ] }) }),
608      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4 py-2", children: [
609        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
610          /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-xs text-slate-400 mb-1.5 block font-medium", children: "Select Agent" }),
611          /* @__PURE__ */ jsxRuntimeExports.jsxs(
612            "select",
613            {
614              className: "w-full rounded-md border px-3 py-2 text-sm text-white bg-slate-800 border-slate-600 focus:outline-none focus:ring-1 focus:ring-yellow-500",
615              value: createForm.agentKey,
616              onChange: (e) => handleAgentSelect(e.target.value),
617              children: [
618                /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", children: "— Choose an agent —" }),
619                availableAgents.map((a) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: a.agentKey, children: a.agentName }, a.agentKey))
620              ]
621            }
622          )
623        ] }),
624        createForm.agentKey && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
625          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
626            /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-xs text-slate-400 mb-1.5 block font-medium", children: "6-Digit PIN" }),
627            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2", children: [
628              /* @__PURE__ */ jsxRuntimeExports.jsx(
629                Input,
630                {
631                  value: createForm.pin,
632                  onChange: (e) => setCreateForm((f) => ({ ...f, pin: e.target.value.replace(/\D/g, "").slice(0, 6) })),
633                  className: "bg-slate-800 border-slate-600 text-white font-mono text-sm flex-1 tracking-widest",
634                  placeholder: "6 digits",
635                  maxLength: 6,
636                  inputMode: "numeric"
637                }
638              ),
639              /* @__PURE__ */ jsxRuntimeExports.jsx(
640                Button,
641                {
642                  variant: "outline",
643                  size: "icon",
644                  className: "flex-shrink-0 border-slate-600 text-slate-300 hover:text-white w-9 h-9",
645                  onClick: () => setCreateForm((f) => ({ ...f, pin: generatePin() })),
646                  title: "Generate random PIN",
647                  children: /* @__PURE__ */ jsxRuntimeExports.jsx(RefreshCw, { className: "w-3.5 h-3.5" })
648                }
649              ),
650              /* @__PURE__ */ jsxRuntimeExports.jsx(
651                Button,
652                {
653                  variant: "outline",
654                  size: "icon",
655                  className: "flex-shrink-0 border-slate-600 text-slate-300 hover:text-white w-9 h-9",
656                  onClick: () => copyToClipboard(createForm.pin, setCopiedPassword),
657                  title: "Copy PIN",
658                  children: copiedPassword ? /* @__PURE__ */ jsxRuntimeExports.jsx(Check, { className: "w-3.5 h-3.5 text-green-400" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Copy, { className: "w-3.5 h-3.5" })
659                }
660              )
661            ] }),
662            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-slate-500 mt-1", children: "Copy this PIN before saving — it won't be shown again." })
663          ] }),
664          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
665            /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "text-xs text-slate-400 mb-1.5 block font-medium", children: [
666              "Email ",
667              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-400", children: "*" }),
668              " ",
669              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-slate-500 text-[10px]", children: "(welcome email will be sent)" })
670            ] }),
671            /* @__PURE__ */ jsxRuntimeExports.jsx(
672              Input,
673              {
674                value: createForm.email,
675                onChange: (e) => setCreateForm((f) => ({ ...f, email: e.target.value })),
676                className: "bg-slate-800 border-slate-600 text-white text-sm",
677                placeholder: "[email protected]",
678                type: "email"
679              }
680            )
681          ] }),
682          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
683            /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "text-xs text-slate-400 mb-1.5 block font-medium", children: [
684              "Calendly Link ",
685              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-slate-600", children: "(optional)" })
686            ] }),
687            /* @__PURE__ */ jsxRuntimeExports.jsx(
688              Input,
689              {
690                value: createForm.calendlyLink,
691                onChange: (e) => setCreateForm((f) => ({ ...f, calendlyLink: e.target.value })),
692                className: "bg-slate-800 border-slate-600 text-white text-sm",
693                placeholder: "https://calendly.com/agentname",
694                type: "url"
695              }
696            )
697          ] }),
698          /* @__PURE__ */ jsxRuntimeExports.jsxs(
699            "div",
700            {
701              className: "rounded-lg border p-3 text-xs font-mono space-y-1",
702              style: { background: "rgba(0,0,0,0.3)", borderColor: "rgba(212,175,55,0.2)" },
703              children: [
704                /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-slate-400", children: [
705                  "Login URL: ",
706                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white", children: agentLoginUrl })
707                ] }),
708                /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-slate-400", children: [
709                  "Agent: ",
710                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white", children: createForm.agentName })
711                ] }),
712                /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-slate-400", children: [
713                  "PIN: ",
714                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-yellow-400", children: createForm.pin })
715                ] })
716              ]
717            }
718          )
719        ] })
720      ] }),
721      /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogFooter, { children: [
722        /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "ghost", className: "text-slate-400", onClick: () => setCreateOpen(false), children: "Cancel" }),
723        /* @__PURE__ */ jsxRuntimeExports.jsxs(
724          Button,
725          {
726            onClick: () => createAccount.mutate({
727              agentKey: createForm.agentKey,
728              agentName: createForm.agentName,
729              pin: createForm.pin,
730              email: createForm.email || void 0,
731              calendlyLink: createForm.calendlyLink || void 0
732            }),
733            disabled: !createForm.agentKey || createForm.pin.length !== 6 || !createForm.email || createAccount.isPending,
734            className: "font-semibold gap-2",
735            style: { background: "var(--eps-gold)", color: "white", fontWeight: "bold" },
736            children: [
737              createAccount.isPending ? /* @__PURE__ */ jsxRuntimeExports.jsx(RefreshCw, { className: "w-3.5 h-3.5 animate-spin" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(UserPlus, { className: "w-3.5 h-3.5" }),
738              "Create Account"
739            ]
740          }
741        )
742      ] })
743    ] }) }),
744    /* @__PURE__ */ jsxRuntimeExports.jsx(Dialog, { open: editOpen, onOpenChange: setEditOpen, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogContent, { className: "max-w-md", style: { background: "var(--eps-navy)", borderColor: "var(--sidebar-border)" }, children: [
745      /* @__PURE__ */ jsxRuntimeExports.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogTitle, { className: "text-white flex items-center gap-2", children: [
746        /* @__PURE__ */ jsxRuntimeExports.jsx(Pencil, { className: "w-5 h-5", style: { color: "var(--eps-gold)" } }),
747        "Edit Info — ",
748        editTarget?.agentName
749      ] }) }),
750      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4 py-2", children: [
751        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
752          /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-xs text-slate-400 mb-1.5 block font-medium", children: "Email" }),
753          /* @__PURE__ */ jsxRuntimeExports.jsx(
754            Input,
755            {
756              value: editEmail,
757              onChange: (e) => setEditEmail(e.target.value),
758              className: "bg-slate-800 border-slate-600 text-white text-sm",
759              placeholder: "[email protected]",
760              type: "email"
761            }
762          )
763        ] }),
764        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
765          /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-xs text-slate-400 mb-1.5 block font-medium", children: "Calendly Link" }),
766          /* @__PURE__ */ jsxRuntimeExports.jsx(
767            Input,
768            {
769              value: editCalendly,
770              onChange: (e) => setEditCalendly(e.target.value),
771              className: "bg-slate-800 border-slate-600 text-white text-sm",
772              placeholder: "https://calendly.com/agentname",
773              type: "url"
774            }
775          ),
776          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-slate-500 mt-1", children: "This link will be auto-inserted into renewal emails sent by this agent." })
777        ] })
778      ] }),
779      /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogFooter, { children: [
780        /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "ghost", className: "text-slate-400", onClick: () => setEditOpen(false), children: "Cancel" }),
781        /* @__PURE__ */ jsxRuntimeExports.jsxs(
782          Button,
783          {
784            onClick: () => editTarget && updateAccount.mutate({
785              agentKey: editTarget.agentKey,
786              email: editEmail || null,
787              calendlyLink: editCalendly || null
788            }),
789            disabled: updateAccount.isPending,
790            className: "font-semibold gap-2",
791            style: { background: "var(--eps-gold)", color: "white", fontWeight: "bold" },
792            children: [
793              updateAccount.isPending ? /* @__PURE__ */ jsxRuntimeExports.jsx(RefreshCw, { className: "w-3.5 h-3.5 animate-spin" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Check, { className: "w-3.5 h-3.5" }),
794              "Save Changes"
795            ]
796          }
797        )
798      ] })
799    ] }) }),
800    /* @__PURE__ */ jsxRuntimeExports.jsx(Dialog, { open: deleteOpen, onOpenChange: setDeleteOpen, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogContent, { className: "max-w-sm", style: { background: "var(--eps-navy)", borderColor: "var(--sidebar-border)" }, children: [
801      /* @__PURE__ */ jsxRuntimeExports.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogTitle, { className: "text-white flex items-center gap-2", children: [
802        /* @__PURE__ */ jsxRuntimeExports.jsx(Trash2, { className: "w-5 h-5 text-red-400" }),
803        "Delete Agent Account"
804      ] }) }),
805      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "py-3", children: [
806        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-slate-300 text-sm", children: [
807          "Are you sure you want to permanently delete the account for",
808          " ",
809          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-semibold text-white", children: deleteTarget?.agentName }),
810          "?"
811        ] }),
812        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-slate-500 text-xs mt-2", children: "This action cannot be undone. The agent will no longer be able to log in." })
813      ] }),
814      /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogFooter, { children: [
815        /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "ghost", className: "text-slate-400", onClick: () => setDeleteOpen(false), children: "Cancel" }),
816        /* @__PURE__ */ jsxRuntimeExports.jsxs(
817          Button,
818          {
819            onClick: () => deleteTarget && deleteAccount.mutate({ agentKey: deleteTarget.agentKey }),
820            disabled: deleteAccount.isPending,
821            className: "gap-2 font-semibold bg-red-700 hover:bg-red-600 text-white border-0",
822            children: [
823              deleteAccount.isPending ? /* @__PURE__ */ jsxRuntimeExports.jsx(RefreshCw, { className: "w-3.5 h-3.5 animate-spin" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Trash2, { className: "w-3.5 h-3.5" }),
824              "Delete Account"
825            ]
826          }
827        )
828      ] })
829    ] }) }),
830    /* @__PURE__ */ jsxRuntimeExports.jsx(Dialog, { open: resetOpen, onOpenChange: setResetOpen, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogContent, { className: "max-w-md", style: { background: "var(--eps-navy)", borderColor: "var(--sidebar-border)" }, children: [
831      /* @__PURE__ */ jsxRuntimeExports.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogTitle, { className: "text-white flex items-center gap-2", children: [
832        /* @__PURE__ */ jsxRuntimeExports.jsx(KeyRound, { className: "w-5 h-5", style: { color: "var(--eps-gold)" } }),
833        "Set PIN — ",
834        resetTarget?.agentName
835      ] }) }),
836      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4 py-2", children: [
837        /* @__PURE__ */ jsxRuntimeExports.jsxs(
838          "div",
839          {
840            className: "rounded-xl border p-5 text-center space-y-3",
841            style: { background: "rgba(0,0,0,0.4)", borderColor: "rgba(212,175,55,0.3)" },
842            children: [
843              /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-slate-400 font-medium uppercase tracking-widest", children: [
844                "PIN for ",
845                resetTarget?.agentName
846              ] }),
847              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center gap-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-mono text-4xl font-bold tracking-[0.3em] text-yellow-400", children: newPassword || "——" }) }),
848              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-center gap-2", children: [
849                /* @__PURE__ */ jsxRuntimeExports.jsx(
850                  Button,
851                  {
852                    variant: "outline",
853                    size: "sm",
854                    className: "gap-1.5 border-slate-600 text-slate-300 hover:text-white",
855                    onClick: () => copyToClipboard(newPassword, setCopiedReset),
856                    disabled: newPassword.length !== 6,
857                    children: copiedReset ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
858                      /* @__PURE__ */ jsxRuntimeExports.jsx(Check, { className: "w-3.5 h-3.5 text-green-400" }),
859                      "Copied!"
860                    ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
861                      /* @__PURE__ */ jsxRuntimeExports.jsx(Copy, { className: "w-3.5 h-3.5" }),
862                      "Copy PIN"
863                    ] })
864                  }
865                ),
866                /* @__PURE__ */ jsxRuntimeExports.jsxs(
867                  Button,
868                  {
869                    variant: "outline",
870                    size: "sm",
871                    className: "gap-1.5 border-slate-600 text-slate-300 hover:text-white",
872                    onClick: () => {
873                      setNewPassword(generatePin());
874                      setCopiedReset(false);
875                    },
876                    title: "Generate a new random PIN",
877                    children: [
878                      /* @__PURE__ */ jsxRuntimeExports.jsx(RefreshCw, { className: "w-3.5 h-3.5" }),
879                      "New PIN"
880                    ]
881                  }
882                )
883              ] })
884            ]
885          }
886        ),
887        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
888          /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-xs text-slate-400 mb-1.5 block font-medium", children: "Or type a custom 6-digit PIN" }),
889          /* @__PURE__ */ jsxRuntimeExports.jsx(
890            Input,
891            {
892              value: newPassword,
893              onChange: (e) => {
894                setNewPassword(e.target.value.replace(/\D/g, "").slice(0, 6));
895                setCopiedReset(false);
896              },
897              className: "bg-slate-800 border-slate-600 text-white font-mono text-lg tracking-widest text-center",
898              placeholder: "000000",
899              maxLength: 6,
900              inputMode: "numeric"
901            }
902          )
903        ] }),
904        /* @__PURE__ */ jsxRuntimeExports.jsx(
905          "div",
906          {
907            className: "rounded-lg border p-3 text-xs font-mono",
908            style: { background: "rgba(0,0,0,0.2)", borderColor: "var(--sidebar-border)" },
909            children: /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-slate-400", children: [
910              "Login URL: ",
911              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-blue-400 break-all", children: agentLoginUrl })
912            ] })
913          }
914        )
915      ] }),
916      !copiedReset && newPassword.length === 6 && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-amber-400 text-center -mt-1", children: "⚠ Copy the PIN before saving so you can share it with the agent." }),
917      /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogFooter, { children: [
918        /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "ghost", className: "text-slate-400", onClick: () => setResetOpen(false), children: "Cancel" }),
919        /* @__PURE__ */ jsxRuntimeExports.jsxs(
920          Button,
921          {
922            onClick: () => resetTarget && setPin.mutate({ agentKey: resetTarget.agentKey, pin: newPassword }),
923            disabled: newPassword.length !== 6 || setPin.isPending || !copiedReset,
924            className: "font-semibold gap-2",
925            style: { background: "var(--eps-gold)", color: "white", fontWeight: "bold" },
926            title: !copiedReset ? "Copy the PIN first before saving" : "",
927            children: [
928              setPin.isPending ? /* @__PURE__ */ jsxRuntimeExports.jsx(RefreshCw, { className: "w-3.5 h-3.5 animate-spin" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(KeyRound, { className: "w-3.5 h-3.5" }),
929              "Save PIN"
930            ]
931          }
932        )
933      ] })
934    ] }) })
935  ] });
936}
937
938export { AgentAccountsPanel as default };

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.