@mdxui/cockpit 0.2.0 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,61 +1,17 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
- var __spreadValues = (a, b) => {
11
- for (var prop in b || (b = {}))
12
- if (__hasOwnProp.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- if (__getOwnPropSymbols)
15
- for (var prop of __getOwnPropSymbols(b)) {
16
- if (__propIsEnum.call(b, prop))
17
- __defNormalProp(a, prop, b[prop]);
18
- }
19
- return a;
20
- };
21
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22
- var __copyProps = (to, from, except, desc) => {
23
- if (from && typeof from === "object" || typeof from === "function") {
24
- for (let key of __getOwnPropNames(from))
25
- if (!__hasOwnProp.call(to, key) && key !== except)
26
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
27
- }
28
- return to;
29
- };
30
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
31
- var __async = (__this, __arguments, generator) => {
32
- return new Promise((resolve, reject) => {
33
- var fulfilled = (value) => {
34
- try {
35
- step(generator.next(value));
36
- } catch (e) {
37
- reject(e);
38
- }
39
- };
40
- var rejected = (value) => {
41
- try {
42
- step(generator.throw(value));
43
- } catch (e) {
44
- reject(e);
45
- }
46
- };
47
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
48
- step((generator = generator.apply(__this, __arguments)).next());
49
- });
50
- };
51
-
52
1
  // src/developer/index.ts
53
- import { useAuth as useAuth10 } from "@workos-inc/authkit-react";
54
-
55
- // src/developer/themes/index.ts
56
- var themes_exports = {};
57
- __reExport(themes_exports, themes_star);
58
- import * as themes_star from "@mdxui/themes";
2
+ import { useAuth as useAuth9 } from "@mdxui/auth";
3
+ import {
4
+ themePresets,
5
+ themeNames,
6
+ isThemePreset,
7
+ useThemeStore,
8
+ applyThemeToElement as applyThemeToElement3,
9
+ getThemeCSS,
10
+ themeCSS,
11
+ ThemeScript,
12
+ getThemeScriptContent,
13
+ getResolvedMode
14
+ } from "@mdxui/themes";
59
15
 
60
16
  // src/developer/components/dashboard/activity-feed.tsx
61
17
  import { Avatar, AvatarFallback, AvatarImage } from "@mdxui/primitives/avatar";
@@ -176,7 +132,7 @@ function AreaChart({
176
132
  }
177
133
  ),
178
134
  /* @__PURE__ */ jsx2(ChartTooltip, { content: /* @__PURE__ */ jsx2(ChartTooltipContent, {}) }),
179
- yAxisKeys.map((key, index) => /* @__PURE__ */ jsx2(
135
+ yAxisKeys.map((key) => /* @__PURE__ */ jsx2(
180
136
  Area,
181
137
  {
182
138
  type: "monotone",
@@ -457,7 +413,6 @@ function DataTable({
457
413
  className,
458
414
  emptyMessage = "No results found."
459
415
  }) {
460
- var _a, _b, _c;
461
416
  const [sorting, setSorting] = useState2([]);
462
417
  const [columnFilters, setColumnFilters] = useState2([]);
463
418
  const [columnVisibility, setColumnVisibility] = useState2({});
@@ -490,11 +445,8 @@ function DataTable({
490
445
  Input,
491
446
  {
492
447
  placeholder: searchPlaceholder,
493
- value: (_b = (_a = table.getColumn(searchColumn)) == null ? void 0 : _a.getFilterValue()) != null ? _b : "",
494
- onChange: (event) => {
495
- var _a2;
496
- return (_a2 = table.getColumn(searchColumn)) == null ? void 0 : _a2.setFilterValue(event.target.value);
497
- },
448
+ value: table.getColumn(searchColumn)?.getFilterValue() ?? "",
449
+ onChange: (event) => table.getColumn(searchColumn)?.setFilterValue(event.target.value),
498
450
  className: "max-w-sm"
499
451
  }
500
452
  ) }),
@@ -502,7 +454,7 @@ function DataTable({
502
454
  /* @__PURE__ */ jsx6(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx6(TableRow, { children: headerGroup.headers.map((header) => {
503
455
  return /* @__PURE__ */ jsx6(TableHead, { children: header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()) }, header.id);
504
456
  }) }, headerGroup.id)) }),
505
- /* @__PURE__ */ jsx6(TableBody, { children: ((_c = table.getRowModel().rows) == null ? void 0 : _c.length) ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx6(TableRow, { "data-state": row.getIsSelected() && "selected", children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx6(TableCell, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) : /* @__PURE__ */ jsx6(TableRow, { children: /* @__PURE__ */ jsx6(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: emptyMessage }) }) })
457
+ /* @__PURE__ */ jsx6(TableBody, { children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx6(TableRow, { "data-state": row.getIsSelected() && "selected", children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx6(TableCell, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) : /* @__PURE__ */ jsx6(TableRow, { children: /* @__PURE__ */ jsx6(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: emptyMessage }) }) })
506
458
  ] }) }),
507
459
  paginated && /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between px-2", children: [
508
460
  /* @__PURE__ */ jsx6("div", { className: "flex-1 text-sm text-muted-foreground", children: table.getFilteredSelectedRowModel().rows.length > 0 && /* @__PURE__ */ jsxs5("span", { children: [
@@ -717,8 +669,8 @@ function LineChart({
717
669
  }
718
670
 
719
671
  // src/developer/components/layout/dashboard-layout.tsx
672
+ import { useAuth as useAuth2 } from "@mdxui/auth";
720
673
  import { DashboardShell } from "@mdxui/primitives/dashboard-shell";
721
- import { useAuth as useAuth2 } from "@workos-inc/authkit-react";
722
674
  import {
723
675
  Activity,
724
676
  BarChart3,
@@ -739,6 +691,7 @@ import { createContext, useContext, useMemo } from "react";
739
691
  // src/developer/hooks/use-theme-loader.ts
740
692
  import { useTheme } from "next-themes";
741
693
  import { useEffect as useEffect2, useRef } from "react";
694
+ import { applyThemeToElement } from "@mdxui/themes";
742
695
  function useThemeLoader(preset) {
743
696
  const { resolvedTheme } = useTheme();
744
697
  const currentPresetRef = useRef(void 0);
@@ -747,7 +700,7 @@ function useThemeLoader(preset) {
747
700
  if (!preset || !resolvedTheme) return;
748
701
  if (preset === currentPresetRef.current && resolvedTheme === currentModeRef.current) return;
749
702
  const mode = resolvedTheme === "dark" ? "dark" : "light";
750
- (0, themes_exports.applyThemeToElement)(document.documentElement, preset, mode);
703
+ applyThemeToElement(document.documentElement, preset, mode);
751
704
  currentPresetRef.current = preset;
752
705
  currentModeRef.current = resolvedTheme;
753
706
  }, [preset, resolvedTheme]);
@@ -801,6 +754,7 @@ var defaultConfig = {
801
754
  logo: void 0
802
755
  },
803
756
  routes: defaultRoutes,
757
+ customRoutes: [],
804
758
  theme: {
805
759
  preset: "cyan",
806
760
  mode: "system",
@@ -813,15 +767,19 @@ import { jsx as jsx9 } from "react/jsx-runtime";
813
767
  var DashboardContext = createContext(null);
814
768
  function DashboardProvider({ config, children }) {
815
769
  const value = useMemo(() => {
816
- const mergedConfig = __spreadProps(__spreadValues(__spreadValues({}, defaultConfig), config), {
817
- branding: __spreadValues(__spreadValues({}, defaultConfig.branding), config.branding),
818
- routes: __spreadValues(__spreadValues({}, defaultRoutes), config.routes),
819
- theme: __spreadValues(__spreadValues({}, defaultConfig.theme), config.theme),
820
- identity: __spreadValues(__spreadValues({}, defaultIdentity), config.identity)
821
- });
770
+ const mergedConfig = {
771
+ ...defaultConfig,
772
+ ...config,
773
+ branding: { ...defaultConfig.branding, ...config.branding },
774
+ routes: { ...defaultRoutes, ...config.routes },
775
+ customRoutes: config.customRoutes ?? [],
776
+ theme: { ...defaultConfig.theme, ...config.theme },
777
+ identity: { ...defaultIdentity, ...config.identity }
778
+ };
822
779
  return {
823
780
  config: mergedConfig,
824
781
  routes: mergedConfig.routes,
782
+ customRoutes: mergedConfig.customRoutes,
825
783
  basePath: mergedConfig.basePath
826
784
  };
827
785
  }, [config]);
@@ -840,6 +798,10 @@ function useRoutes() {
840
798
  const { routes } = useDashboard();
841
799
  return routes;
842
800
  }
801
+ function useCustomRoutes() {
802
+ const { customRoutes } = useDashboard();
803
+ return customRoutes;
804
+ }
843
805
 
844
806
  // src/developer/components/ui/sidebar-ad.tsx
845
807
  import { useSidebar } from "@mdxui/primitives/sidebar";
@@ -854,7 +816,7 @@ function SidebarAd({ headline, description, ctaText, ctaHref, onCtaClick, dismis
854
816
  if (state === "collapsed") return null;
855
817
  const handleDismiss = () => {
856
818
  setIsDismissed(true);
857
- onDismiss == null ? void 0 : onDismiss();
819
+ onDismiss?.();
858
820
  };
859
821
  const handleCtaClick = () => {
860
822
  if (onCtaClick) {
@@ -893,9 +855,8 @@ function SidebarAd({ headline, description, ctaText, ctaHref, onCtaClick, dismis
893
855
  }
894
856
 
895
857
  // src/developer/components/widgets/team-switcher.tsx
858
+ import { OrganizationSwitcher, useAuth } from "@mdxui/auth";
896
859
  import { SidebarMenu, SidebarMenuButton, SidebarMenuItem } from "@mdxui/primitives/sidebar";
897
- import { useAuth } from "@workos-inc/authkit-react";
898
- import { OrganizationSwitcher } from "@workos-inc/widgets";
899
860
  import { Building2 } from "lucide-react";
900
861
  import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
901
862
  function TeamSwitcher() {
@@ -903,7 +864,16 @@ function TeamSwitcher() {
903
864
  if (!organizationId) {
904
865
  return /* @__PURE__ */ jsx11(TeamSwitcherNone, {});
905
866
  }
906
- return /* @__PURE__ */ jsx11(SidebarMenu, { children: /* @__PURE__ */ jsx11(SidebarMenuItem, { children: /* @__PURE__ */ jsx11("div", { className: "organization-switcher-wrapper", children: /* @__PURE__ */ jsx11(OrganizationSwitcher, { authToken: getAccessToken, switchToOrganization }) }) }) });
867
+ const handleSwitchOrganization = ({ organizationId: organizationId2 }) => {
868
+ return switchToOrganization({ organizationId: organizationId2 });
869
+ };
870
+ return /* @__PURE__ */ jsx11(SidebarMenu, { children: /* @__PURE__ */ jsx11(SidebarMenuItem, { children: /* @__PURE__ */ jsx11("div", { className: "organization-switcher-wrapper", children: /* @__PURE__ */ jsx11(
871
+ OrganizationSwitcher,
872
+ {
873
+ authToken: getAccessToken,
874
+ switchToOrganization: handleSwitchOrganization
875
+ }
876
+ ) }) }) });
907
877
  }
908
878
  function TeamSwitcherNone() {
909
879
  return /* @__PURE__ */ jsx11(SidebarMenu, { children: /* @__PURE__ */ jsx11(SidebarMenuItem, { children: /* @__PURE__ */ jsxs9(SidebarMenuButton, { size: "lg", className: "pointer-events-none", children: [
@@ -959,8 +929,19 @@ function NavUser({ user, onSignOut }) {
959
929
  // src/developer/components/layout/dashboard-layout.tsx
960
930
  import { Fragment as Fragment2, jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
961
931
  function useNavItems() {
962
- const { routes } = useDashboard();
932
+ const { routes, customRoutes } = useDashboard();
963
933
  const items = [];
934
+ const customRouteToNavItem = (route) => ({
935
+ title: route.label,
936
+ url: route.path.startsWith("/") ? route.path : `/${route.path}`,
937
+ icon: route.icon
938
+ });
939
+ const sortedCustomRoutes = [...customRoutes].sort((a, b) => {
940
+ return (a.order ?? 100) - (b.order ?? 100);
941
+ });
942
+ const mainRoutes = sortedCustomRoutes.filter((r) => r.group === "main" || r.group === void 0);
943
+ const secondaryRoutes = sortedCustomRoutes.filter((r) => r.group === "secondary");
944
+ const adminRoutes = sortedCustomRoutes.filter((r) => r.group === "admin");
964
945
  if (routes.overview) {
965
946
  items.push({
966
947
  title: "Overview",
@@ -1000,7 +981,13 @@ function useNavItems() {
1000
981
  items.push({
1001
982
  title: "Webhooks",
1002
983
  url: "/webhooks",
1003
- icon: Webhook
984
+ icon: Webhook,
985
+ items: [
986
+ { title: "Endpoints", url: "/webhooks/endpoints" },
987
+ { title: "Activity", url: "/webhooks/activity" },
988
+ { title: "Logs", url: "/webhooks/logs" },
989
+ { title: "Event Catalog", url: "/webhooks/event-catalog" }
990
+ ]
1004
991
  });
1005
992
  }
1006
993
  if (routes.database) {
@@ -1024,24 +1011,37 @@ function useNavItems() {
1024
1011
  icon: Lock
1025
1012
  });
1026
1013
  }
1014
+ for (const route of mainRoutes) {
1015
+ items.push(customRouteToNavItem(route));
1016
+ }
1017
+ for (const route of secondaryRoutes) {
1018
+ items.push(customRouteToNavItem(route));
1019
+ }
1027
1020
  if (routes.settings) {
1028
1021
  items.push({
1029
1022
  title: "Settings",
1030
1023
  url: "/settings",
1031
- icon: Settings
1024
+ icon: Settings,
1025
+ items: [
1026
+ { title: "Profile", url: "/settings/profile" },
1027
+ { title: "Security", url: "/settings/security" },
1028
+ { title: "Sessions", url: "/settings/sessions" }
1029
+ ]
1032
1030
  });
1033
1031
  }
1032
+ for (const route of adminRoutes) {
1033
+ items.push(customRouteToNavItem(route));
1034
+ }
1034
1035
  return items;
1035
1036
  }
1036
1037
  function DashboardLayout() {
1037
- var _a;
1038
1038
  const { user, signOut } = useAuth2();
1039
1039
  const navItems = useNavItems();
1040
1040
  const navUser = user ? {
1041
1041
  id: user.id,
1042
1042
  name: user.firstName && user.lastName ? `${user.firstName} ${user.lastName}` : user.email,
1043
1043
  email: user.email,
1044
- avatar: (_a = user.profilePictureUrl) != null ? _a : void 0
1044
+ avatar: user.profilePictureUrl ?? void 0
1045
1045
  } : null;
1046
1046
  return /* @__PURE__ */ jsx14(
1047
1047
  DashboardShell,
@@ -1067,8 +1067,8 @@ function DashboardLayout() {
1067
1067
  }
1068
1068
 
1069
1069
  // src/developer/components/layout/landing-page.tsx
1070
+ import { useAuth as useAuth3 } from "@mdxui/auth";
1070
1071
  import { Button as Button2 } from "@mdxui/primitives/button";
1071
- import { useAuth as useAuth3 } from "@workos-inc/authkit-react";
1072
1072
  import { ArrowRight, BarChart3 as BarChart32, Key as Key2, Shield, Users as Users2 } from "lucide-react";
1073
1073
  import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
1074
1074
  function FeatureCard({ icon, title, description }) {
@@ -1079,14 +1079,13 @@ function FeatureCard({ icon, title, description }) {
1079
1079
  ] });
1080
1080
  }
1081
1081
  function LandingPage() {
1082
- var _a, _b, _c;
1083
1082
  const { signIn } = useAuth3();
1084
1083
  const { config } = useDashboard();
1085
- const brandName = (_b = (_a = config.branding) == null ? void 0 : _a.name) != null ? _b : "Dashboard";
1084
+ const brandName = config.branding?.name ?? "Dashboard";
1086
1085
  return /* @__PURE__ */ jsxs11("div", { className: "min-h-screen bg-background flex flex-col", children: [
1087
1086
  /* @__PURE__ */ jsx15("header", { className: "border-b", children: /* @__PURE__ */ jsxs11("div", { className: "container mx-auto px-4 h-16 flex items-center justify-between", children: [
1088
1087
  /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", children: [
1089
- (_c = config.branding) == null ? void 0 : _c.logo,
1088
+ config.branding?.logo,
1090
1089
  /* @__PURE__ */ jsx15("span", { className: "font-semibold text-lg", children: brandName })
1091
1090
  ] }),
1092
1091
  /* @__PURE__ */ jsxs11(Button2, { onClick: () => signIn(), children: [
@@ -1170,11 +1169,11 @@ function JsonViewer({ data, className }) {
1170
1169
  theme
1171
1170
  }).then(setHtml);
1172
1171
  }, [jsonString, resolvedTheme]);
1173
- const handleCopy = () => __async(null, null, function* () {
1174
- yield navigator.clipboard.writeText(jsonString);
1172
+ const handleCopy = async () => {
1173
+ await navigator.clipboard.writeText(jsonString);
1175
1174
  setCopied(true);
1176
1175
  setTimeout(() => setCopied(false), 2e3);
1177
- });
1176
+ };
1178
1177
  return /* @__PURE__ */ jsxs12("div", { className: cn5("relative rounded-md border bg-muted", className), children: [
1179
1178
  /* @__PURE__ */ jsx16(
1180
1179
  "button",
@@ -1310,11 +1309,11 @@ function VaultInputModal({
1310
1309
  }) {
1311
1310
  const [values, setValues] = useState5({});
1312
1311
  const [loading, setLoading] = useState5(false);
1313
- const handleSubmit = (e) => __async(null, null, function* () {
1312
+ const handleSubmit = async (e) => {
1314
1313
  e.preventDefault();
1315
1314
  setLoading(true);
1316
1315
  try {
1317
- yield onSave(values);
1316
+ await onSave(values);
1318
1317
  setValues({});
1319
1318
  onClose();
1320
1319
  } catch (error) {
@@ -1322,16 +1321,13 @@ function VaultInputModal({
1322
1321
  } finally {
1323
1322
  setLoading(false);
1324
1323
  }
1325
- });
1324
+ };
1326
1325
  const handleClose = () => {
1327
1326
  setValues({});
1328
1327
  onClose();
1329
1328
  };
1330
1329
  if (!integration) return null;
1331
- const isValid = integration.fields.filter((f) => f.required).every((f) => {
1332
- var _a;
1333
- return (_a = values[f.key]) == null ? void 0 : _a.trim();
1334
- });
1330
+ const isValid = integration.fields.filter((f) => f.required).every((f) => values[f.key]?.trim());
1335
1331
  return /* @__PURE__ */ jsx20(Dialog3, { open: isOpen, onOpenChange: handleClose, children: /* @__PURE__ */ jsxs16(DialogContent3, { children: [
1336
1332
  /* @__PURE__ */ jsx20(DialogHeader2, { children: /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-3", children: [
1337
1333
  /* @__PURE__ */ jsx20("div", { className: "flex h-10 w-10 items-center justify-center rounded-md bg-white overflow-hidden p-1 border border-border", children: integration.logoUrl ? /* @__PURE__ */ jsx20(
@@ -1364,7 +1360,8 @@ function VaultInputModal({
1364
1360
  type: field.type,
1365
1361
  placeholder: field.placeholder,
1366
1362
  value: values[field.key] || "",
1367
- onChange: (e) => setValues((prev) => __spreadProps(__spreadValues({}, prev), {
1363
+ onChange: (e) => setValues((prev) => ({
1364
+ ...prev,
1368
1365
  [field.key]: e.target.value
1369
1366
  })),
1370
1367
  required: field.required
@@ -1545,19 +1542,19 @@ function VaultList({ items, onRotate, onDelete, onOpenAddModal }) {
1545
1542
  setSelectedItem(item);
1546
1543
  setDeleteDialogOpen(true);
1547
1544
  };
1548
- const handleConfirmDelete = () => __async(null, null, function* () {
1545
+ const handleConfirmDelete = async () => {
1549
1546
  if (!selectedItem) return;
1550
- yield onDelete(selectedItem.id);
1547
+ await onDelete(selectedItem.id);
1551
1548
  setDeleteDialogOpen(false);
1552
1549
  setSelectedItem(null);
1553
- });
1554
- const handleSave = (credentials) => __async(null, null, function* () {
1550
+ };
1551
+ const handleSave = async (credentials) => {
1555
1552
  if (modalMode === "rotate" && selectedItem) {
1556
- yield onRotate(selectedItem.id, credentials);
1553
+ await onRotate(selectedItem.id, credentials);
1557
1554
  }
1558
1555
  setInputModalOpen(false);
1559
1556
  setSelectedItem(null);
1560
- });
1557
+ };
1561
1558
  const getIntegrationForModal = () => {
1562
1559
  if (!selectedItem) return void 0;
1563
1560
  const fields = integrationFields[selectedItem.integrationId] || integrationFields.default;
@@ -1593,7 +1590,7 @@ function VaultList({ items, onRotate, onDelete, onOpenAddModal }) {
1593
1590
  setDeleteDialogOpen(false);
1594
1591
  setSelectedItem(null);
1595
1592
  },
1596
- itemName: (selectedItem == null ? void 0 : selectedItem.name) || "",
1593
+ itemName: selectedItem?.name || "",
1597
1594
  onConfirm: handleConfirmDelete
1598
1595
  }
1599
1596
  ),
@@ -1624,9 +1621,9 @@ import { Table as Table2, TableBody as TableBody2, TableCell as TableCell2, Tabl
1624
1621
  import { Mail, MoreHorizontal, Plus, Shield as Shield2, User } from "lucide-react";
1625
1622
  import { jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
1626
1623
  var mockUsers = [
1627
- { id: "1", name: "John Doe", email: "john@example.com", role: "Admin", avatar: "", status: "Active" },
1628
- { id: "2", name: "Jane Smith", email: "jane@example.com", role: "Member", avatar: "", status: "Active" },
1629
- { id: "3", name: "Bob Johnson", email: "bob@example.com", role: "Member", avatar: "", status: "Pending" }
1624
+ { id: "1", name: "John Doe", email: "john@example.com.ai", role: "Admin", avatar: "", status: "Active" },
1625
+ { id: "2", name: "Jane Smith", email: "jane@example.com.ai", role: "Member", avatar: "", status: "Active" },
1626
+ { id: "3", name: "Bob Johnson", email: "bob@example.com.ai", role: "Member", avatar: "", status: "Pending" }
1630
1627
  ];
1631
1628
  var mockSessions = [
1632
1629
  { id: "1", device: "Chrome on macOS", location: "San Francisco, CA", lastActive: "Now", current: true },
@@ -1700,7 +1697,7 @@ function MockUserProfile() {
1700
1697
  ] }),
1701
1698
  /* @__PURE__ */ jsxs19("div", { className: "space-y-2", children: [
1702
1699
  /* @__PURE__ */ jsx23(Label2, { htmlFor: "email", children: "Email" }),
1703
- /* @__PURE__ */ jsx23(Input3, { id: "email", type: "email", defaultValue: "john@example.com", disabled: true })
1700
+ /* @__PURE__ */ jsx23(Input3, { id: "email", type: "email", defaultValue: "john@example.com.ai", disabled: true })
1704
1701
  ] }),
1705
1702
  /* @__PURE__ */ jsx23(Button7, { children: "Save Changes" })
1706
1703
  ] })
@@ -1825,20 +1822,14 @@ function SettingsPage({ sections, children }) {
1825
1822
  ] }),
1826
1823
  /* @__PURE__ */ jsx24(Separator, {}),
1827
1824
  /* @__PURE__ */ jsxs20(Tabs, { value: activeTab, onValueChange: (value) => setActiveTab(value), className: "space-y-6", children: [
1828
- /* @__PURE__ */ jsx24(TabsList, { className: "grid w-full grid-cols-2 sm:grid-cols-3 lg:grid-cols-7 gap-2", children: activeSections.map((section) => {
1829
- var _a;
1830
- return /* @__PURE__ */ jsx24(TabsTrigger, { value: section, children: ((_a = sectionMeta[section]) == null ? void 0 : _a.title) || section }, section);
1831
- }) }),
1832
- activeSections.map((section, index) => {
1833
- var _a, _b;
1834
- return /* @__PURE__ */ jsx24(TabsContent, { value: section, className: "space-y-6", children: /* @__PURE__ */ jsxs20(Card8, { children: [
1835
- /* @__PURE__ */ jsxs20(CardHeader7, { children: [
1836
- /* @__PURE__ */ jsx24(CardTitle7, { children: ((_a = sectionMeta[section]) == null ? void 0 : _a.title) || section }),
1837
- /* @__PURE__ */ jsx24(CardDescription6, { children: ((_b = sectionMeta[section]) == null ? void 0 : _b.description) || `Manage your ${section} settings` })
1838
- ] }),
1839
- /* @__PURE__ */ jsx24(CardContent7, { children: React.Children.toArray(children)[index] || /* @__PURE__ */ jsx24("div", { className: "text-center text-sm text-muted-foreground py-8", children: "No content provided for this section" }) })
1840
- ] }) }, section);
1841
- })
1825
+ /* @__PURE__ */ jsx24(TabsList, { className: "grid w-full grid-cols-2 sm:grid-cols-3 lg:grid-cols-7 gap-2", children: activeSections.map((section) => /* @__PURE__ */ jsx24(TabsTrigger, { value: section, children: sectionMeta[section]?.title || section }, section)) }),
1826
+ activeSections.map((section, index) => /* @__PURE__ */ jsx24(TabsContent, { value: section, className: "space-y-6", children: /* @__PURE__ */ jsxs20(Card8, { children: [
1827
+ /* @__PURE__ */ jsxs20(CardHeader7, { children: [
1828
+ /* @__PURE__ */ jsx24(CardTitle7, { children: sectionMeta[section]?.title || section }),
1829
+ /* @__PURE__ */ jsx24(CardDescription6, { children: sectionMeta[section]?.description || `Manage your ${section} settings` })
1830
+ ] }),
1831
+ /* @__PURE__ */ jsx24(CardContent7, { children: React.Children.toArray(children)[index] || /* @__PURE__ */ jsx24("div", { className: "text-center text-sm text-muted-foreground py-8", children: "No content provided for this section" }) })
1832
+ ] }) }, section))
1842
1833
  ] })
1843
1834
  ] });
1844
1835
  }
@@ -1853,19 +1844,18 @@ import { Label as Label3 } from "@mdxui/primitives/label";
1853
1844
  import { User as User2, Mail as Mail2, Upload } from "lucide-react";
1854
1845
  import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
1855
1846
  function UserProfile({ user, onUpdate, readonly = false }) {
1856
- var _a, _b;
1857
1847
  const [formData, setFormData] = React2.useState({
1858
- firstName: (user == null ? void 0 : user.firstName) || ((_a = user == null ? void 0 : user.name) == null ? void 0 : _a.split(" ")[0]) || "",
1859
- lastName: (user == null ? void 0 : user.lastName) || ((_b = user == null ? void 0 : user.name) == null ? void 0 : _b.split(" ").slice(1).join(" ")) || "",
1860
- email: (user == null ? void 0 : user.email) || "",
1861
- avatar: (user == null ? void 0 : user.avatar) || ""
1848
+ firstName: user?.firstName || user?.name?.split(" ")[0] || "",
1849
+ lastName: user?.lastName || user?.name?.split(" ").slice(1).join(" ") || "",
1850
+ email: user?.email || "",
1851
+ avatar: user?.avatar || ""
1862
1852
  });
1863
1853
  const handleSubmit = (e) => {
1864
1854
  e.preventDefault();
1865
- onUpdate == null ? void 0 : onUpdate(formData);
1855
+ onUpdate?.(formData);
1866
1856
  };
1867
1857
  const handleChange = (field, value) => {
1868
- setFormData((prev) => __spreadProps(__spreadValues({}, prev), { [field]: value }));
1858
+ setFormData((prev) => ({ ...prev, [field]: value }));
1869
1859
  };
1870
1860
  const getInitials = () => {
1871
1861
  const first = formData.firstName[0] || "";
@@ -1934,7 +1924,7 @@ function UserProfile({ user, onUpdate, readonly = false }) {
1934
1924
  type: "email",
1935
1925
  value: formData.email,
1936
1926
  onChange: (e) => handleChange("email", e.target.value),
1937
- placeholder: "john@example.com",
1927
+ placeholder: "john@example.com.ai",
1938
1928
  disabled: true
1939
1929
  }
1940
1930
  ),
@@ -2018,14 +2008,14 @@ function APIKeyManager({
2018
2008
  return next;
2019
2009
  });
2020
2010
  };
2021
- const copyToClipboard = (text, label) => __async(null, null, function* () {
2011
+ const copyToClipboard = async (text, label) => {
2022
2012
  try {
2023
- yield navigator.clipboard.writeText(text);
2013
+ await navigator.clipboard.writeText(text);
2024
2014
  toast.success(`${label} copied to clipboard`);
2025
2015
  } catch (err) {
2026
2016
  toast.error("Failed to copy to clipboard");
2027
2017
  }
2028
- });
2018
+ };
2029
2019
  const handleCreateKey = () => {
2030
2020
  if (!newKeyName.trim()) {
2031
2021
  toast.error("Please enter a key name");
@@ -2055,7 +2045,7 @@ function APIKeyManager({
2055
2045
  year: "numeric"
2056
2046
  }).format(date);
2057
2047
  };
2058
- const maskKey2 = (key, prefix) => {
2048
+ const maskKey2 = (_key, prefix) => {
2059
2049
  return `${prefix}${"\u2022".repeat(20)}`;
2060
2050
  };
2061
2051
  return /* @__PURE__ */ jsx26("div", { className: "space-y-4", children: /* @__PURE__ */ jsxs22(Card10, { children: [
@@ -2237,7 +2227,7 @@ function TeamManager({
2237
2227
  {
2238
2228
  id: "1",
2239
2229
  name: "John Doe",
2240
- email: "john@example.com",
2230
+ email: "john@example.com.ai",
2241
2231
  role: "owner",
2242
2232
  avatar: "",
2243
2233
  status: "active",
@@ -2246,7 +2236,7 @@ function TeamManager({
2246
2236
  {
2247
2237
  id: "2",
2248
2238
  name: "Jane Smith",
2249
- email: "jane@example.com",
2239
+ email: "jane@example.com.ai",
2250
2240
  role: "admin",
2251
2241
  avatar: "",
2252
2242
  status: "active",
@@ -2255,7 +2245,7 @@ function TeamManager({
2255
2245
  {
2256
2246
  id: "3",
2257
2247
  name: "Bob Johnson",
2258
- email: "bob@example.com",
2248
+ email: "bob@example.com.ai",
2259
2249
  role: "member",
2260
2250
  avatar: "",
2261
2251
  status: "pending",
@@ -2288,14 +2278,14 @@ function TeamManager({
2288
2278
  const handleRoleChange = (memberId, newRole) => {
2289
2279
  setMembers(
2290
2280
  members.map(
2291
- (m) => m.id === memberId ? __spreadProps(__spreadValues({}, m), { role: newRole }) : m
2281
+ (m) => m.id === memberId ? { ...m, role: newRole } : m
2292
2282
  )
2293
2283
  );
2294
2284
  toast2.success("Member role updated");
2295
2285
  };
2296
2286
  const handleRemoveMember = (memberId) => {
2297
2287
  const member = members.find((m) => m.id === memberId);
2298
- if ((member == null ? void 0 : member.role) === "owner") {
2288
+ if (member?.role === "owner") {
2299
2289
  toast2.error("Cannot remove the workspace owner");
2300
2290
  return;
2301
2291
  }
@@ -2364,7 +2354,7 @@ function TeamManager({
2364
2354
  type: "email",
2365
2355
  value: inviteEmail,
2366
2356
  onChange: (e) => setInviteEmail(e.target.value),
2367
- placeholder: "colleague@example.com"
2357
+ placeholder: "colleague@example.com.ai"
2368
2358
  }
2369
2359
  )
2370
2360
  ] }),
@@ -2585,7 +2575,7 @@ function Billing({
2585
2575
  };
2586
2576
  const handleRemovePaymentMethod = (methodId) => {
2587
2577
  const method = paymentMethods.find((pm) => pm.id === methodId);
2588
- if (method == null ? void 0 : method.isDefault) {
2578
+ if (method?.isDefault) {
2589
2579
  toast3.error("Cannot remove default payment method");
2590
2580
  return;
2591
2581
  }
@@ -2594,7 +2584,8 @@ function Billing({
2594
2584
  };
2595
2585
  const handleSetDefaultPaymentMethod = (methodId) => {
2596
2586
  setPaymentMethods(
2597
- paymentMethods.map((pm) => __spreadProps(__spreadValues({}, pm), {
2587
+ paymentMethods.map((pm) => ({
2588
+ ...pm,
2598
2589
  isDefault: pm.id === methodId
2599
2590
  }))
2600
2591
  );
@@ -2810,9 +2801,32 @@ function Billing({
2810
2801
  ] });
2811
2802
  }
2812
2803
 
2804
+ // src/developer/lib/icons.ts
2805
+ import * as LucideIcons from "lucide-react";
2806
+ function getIconByName(name) {
2807
+ const icons = LucideIcons;
2808
+ const icon = icons[name];
2809
+ if (icon && typeof icon === "function") {
2810
+ return icon;
2811
+ }
2812
+ return void 0;
2813
+ }
2814
+ var dashboardIcons = {
2815
+ overview: "BarChart3",
2816
+ requests: "Activity",
2817
+ keys: "Key",
2818
+ team: "Users",
2819
+ billing: "CreditCard",
2820
+ settings: "Settings",
2821
+ webhooks: "Webhook",
2822
+ database: "Database",
2823
+ integrations: "Puzzle",
2824
+ vault: "Lock"
2825
+ };
2826
+
2813
2827
  // src/developer/providers/app-providers.tsx
2814
2828
  import { ThemeProvider } from "next-themes";
2815
- import { useEffect as useEffect6 } from "react";
2829
+ import { useEffect as useEffect5 } from "react";
2816
2830
 
2817
2831
  // src/developer/lib/platform.ts
2818
2832
  import { createSDK } from "platform.do";
@@ -2879,7 +2893,6 @@ function clearAuth() {
2879
2893
  }
2880
2894
  var apiBaseUrl = "/api";
2881
2895
  function getDebugStatus() {
2882
- var _a;
2883
2896
  const effectiveToken = getEffectiveToken();
2884
2897
  return {
2885
2898
  isAuthenticated: currentToken !== null,
@@ -2887,30 +2900,28 @@ function getDebugStatus() {
2887
2900
  hasEffectiveToken: effectiveToken !== null,
2888
2901
  hasSDK: sdkInstance !== null,
2889
2902
  tokenSource: currentToken ? "auth" : devToken ? "dev" : "none",
2890
- tokenLength: (_a = effectiveToken == null ? void 0 : effectiveToken.length) != null ? _a : 0,
2903
+ tokenLength: effectiveToken?.length ?? 0,
2891
2904
  tokenPreview: effectiveToken ? `${effectiveToken.slice(0, 20)}...${effectiveToken.slice(-10)}` : null,
2892
2905
  debugMode,
2893
2906
  apiBaseUrl
2894
2907
  };
2895
2908
  }
2896
- function testSDKConnection() {
2897
- return __async(this, null, function* () {
2898
- const status = getDebugStatus();
2899
- console.log("[Platform SDK] Testing connection...", status);
2900
- if (!sdkInstance) {
2901
- console.error("[Platform SDK] No SDK instance - not authenticated and no dev token");
2902
- return { success: false, error: "No SDK instance", status };
2903
- }
2904
- try {
2905
- console.log("[Platform SDK] Calling api.APIKeys.list()...");
2906
- const result = yield sdkInstance.api.APIKeys.list();
2907
- console.log("[Platform SDK] Connection successful!", { result });
2908
- return { success: true, result, status };
2909
- } catch (error) {
2910
- console.error("[Platform SDK] Connection failed:", error);
2911
- return { success: false, error, status };
2912
- }
2913
- });
2909
+ async function testSDKConnection() {
2910
+ const status = getDebugStatus();
2911
+ console.log("[Platform SDK] Testing connection...", status);
2912
+ if (!sdkInstance) {
2913
+ console.error("[Platform SDK] No SDK instance - not authenticated and no dev token");
2914
+ return { success: false, error: "No SDK instance", status };
2915
+ }
2916
+ try {
2917
+ console.log("[Platform SDK] Calling api.APIKeys.list()...");
2918
+ const result = await sdkInstance.api.APIKeys.list();
2919
+ console.log("[Platform SDK] Connection successful!", { result });
2920
+ return { success: true, result, status };
2921
+ } catch (error) {
2922
+ console.error("[Platform SDK] Connection failed:", error);
2923
+ return { success: false, error, status };
2924
+ }
2914
2925
  }
2915
2926
  if (typeof window !== "undefined") {
2916
2927
  ;
@@ -2927,56 +2938,12 @@ if (typeof window !== "undefined") {
2927
2938
  }
2928
2939
 
2929
2940
  // src/developer/providers/identity-provider.tsx
2930
- import { AuthKitProvider } from "@workos-inc/authkit-react";
2931
- import { WorkOsWidgets } from "@workos-inc/widgets";
2932
- import { useEffect as useEffect4, useState as useState12 } from "react";
2941
+ import { IdentityProvider as AuthIdentityProvider, WidgetsProvider } from "@mdxui/auth";
2933
2942
  import { jsx as jsx29 } from "react/jsx-runtime";
2934
- function IdentityWidgetsWrapper({ children }) {
2935
- const [mounted, setMounted] = useState12(false);
2936
- const [isDark, setIsDark] = useState12(false);
2937
- useEffect4(() => {
2938
- setMounted(true);
2939
- const checkDarkMode = () => {
2940
- const isDarkClass = document.documentElement.classList.contains("dark");
2941
- const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
2942
- setIsDark(isDarkClass || !document.documentElement.classList.contains("light") && prefersDark);
2943
- };
2944
- checkDarkMode();
2945
- const observer = new MutationObserver(checkDarkMode);
2946
- observer.observe(document.documentElement, { attributes: true, attributeFilter: ["class"] });
2947
- const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
2948
- mediaQuery.addEventListener("change", checkDarkMode);
2949
- return () => {
2950
- observer.disconnect();
2951
- mediaQuery.removeEventListener("change", checkDarkMode);
2952
- };
2953
- }, []);
2954
- const appearance = mounted ? isDark ? "dark" : "light" : "inherit";
2955
- return /* @__PURE__ */ jsx29(
2956
- WorkOsWidgets,
2957
- {
2958
- theme: {
2959
- appearance,
2960
- radius: "medium",
2961
- scaling: "100%"
2962
- },
2963
- elements: {
2964
- primaryButton: {
2965
- variant: "solid"
2966
- },
2967
- secondaryButton: {
2968
- variant: "outline"
2969
- }
2970
- },
2971
- children
2972
- }
2973
- );
2974
- }
2975
2943
  function IdentityProvider({ children }) {
2976
- var _a, _b;
2977
2944
  const { config } = useDashboard();
2978
2945
  const { identity } = config;
2979
- const redirectUri = (_b = identity.redirectUri) != null ? _b : typeof window !== "undefined" ? `${window.location.origin}${(_a = config.basePath) != null ? _a : "/"}` : void 0;
2946
+ const redirectUri = identity.redirectUri ?? (typeof window !== "undefined" ? `${window.location.origin}${config.basePath ?? "/"}` : void 0);
2980
2947
  const onRedirectCallback = () => {
2981
2948
  if (typeof window !== "undefined") {
2982
2949
  const url = new URL(window.location.href);
@@ -2986,23 +2953,23 @@ function IdentityProvider({ children }) {
2986
2953
  }
2987
2954
  };
2988
2955
  return /* @__PURE__ */ jsx29(
2989
- AuthKitProvider,
2956
+ AuthIdentityProvider,
2990
2957
  {
2991
2958
  clientId: identity.clientId,
2992
2959
  apiHostname: identity.apiHostname,
2993
2960
  devMode: identity.devMode,
2994
2961
  redirectUri,
2995
2962
  onRedirectCallback,
2996
- children: /* @__PURE__ */ jsx29(IdentityWidgetsWrapper, { children })
2963
+ children
2997
2964
  }
2998
2965
  );
2999
2966
  }
3000
2967
 
3001
2968
  // src/developer/providers/query-provider.tsx
2969
+ import { useAuth as useAuth4 } from "@mdxui/auth";
3002
2970
  import { QueryClientProvider } from "@tanstack/react-query";
3003
2971
  import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
3004
- import { useAuth as useAuth4 } from "@workos-inc/authkit-react";
3005
- import { useEffect as useEffect5 } from "react";
2972
+ import { useEffect as useEffect4 } from "react";
3006
2973
 
3007
2974
  // src/developer/lib/query-client.ts
3008
2975
  import { QueryClient } from "@tanstack/react-query";
@@ -3023,21 +2990,19 @@ var queryClient = new QueryClient({
3023
2990
  import { Fragment as Fragment5, jsx as jsx30, jsxs as jsxs25 } from "react/jsx-runtime";
3024
2991
  function AuthSync({ children }) {
3025
2992
  const { user, getAccessToken } = useAuth4();
3026
- useEffect5(() => {
3027
- function syncToken() {
3028
- return __async(this, null, function* () {
3029
- if (user) {
3030
- try {
3031
- const token = yield getAccessToken();
3032
- setAuthToken(token);
3033
- } catch (e) {
3034
- clearAuth();
3035
- }
3036
- } else {
2993
+ useEffect4(() => {
2994
+ async function syncToken() {
2995
+ if (user) {
2996
+ try {
2997
+ const token = await getAccessToken();
2998
+ setAuthToken(token);
2999
+ } catch {
3037
3000
  clearAuth();
3038
- queryClient.clear();
3039
3001
  }
3040
- });
3002
+ } else {
3003
+ clearAuth();
3004
+ queryClient.clear();
3005
+ }
3041
3006
  }
3042
3007
  syncToken();
3043
3008
  }, [user, getAccessToken]);
@@ -3053,7 +3018,7 @@ function QueryProvider({ children }) {
3053
3018
  // src/developer/providers/app-providers.tsx
3054
3019
  import { jsx as jsx31, jsxs as jsxs26 } from "react/jsx-runtime";
3055
3020
  function SDKInitializer({ config }) {
3056
- useEffect6(() => {
3021
+ useEffect5(() => {
3057
3022
  if (config.debug) {
3058
3023
  setDebugMode(true);
3059
3024
  }
@@ -3064,8 +3029,7 @@ function SDKInitializer({ config }) {
3064
3029
  return null;
3065
3030
  }
3066
3031
  function AppProviders({ config, children }) {
3067
- var _a, _b;
3068
- const themeMode = (_b = (_a = config.theme) == null ? void 0 : _a.mode) != null ? _b : "system";
3032
+ const themeMode = config.theme?.mode ?? "system";
3069
3033
  return /* @__PURE__ */ jsx31(
3070
3034
  ThemeProvider,
3071
3035
  {
@@ -3082,43 +3046,25 @@ function AppProviders({ config, children }) {
3082
3046
  }
3083
3047
 
3084
3048
  // src/developer/providers/auth-gate.tsx
3085
- import { useAuth as useAuth5 } from "@workos-inc/authkit-react";
3086
- import { Fragment as Fragment6, jsx as jsx32, jsxs as jsxs27 } from "react/jsx-runtime";
3049
+ import { AuthGate as AuthAuthGate } from "@mdxui/auth";
3050
+ import { jsx as jsx32 } from "react/jsx-runtime";
3087
3051
  function AuthGate({ children }) {
3088
- var _a, _b;
3089
3052
  const { config } = useDashboard();
3090
- const { user, isLoading } = useAuth5();
3091
3053
  const { identity } = config;
3092
- const required = (_a = identity.required) != null ? _a : true;
3093
- const onUnauthenticated = (_b = identity.onUnauthenticated) != null ? _b : "landing";
3094
- if (!required) {
3095
- return /* @__PURE__ */ jsx32(Fragment6, { children });
3096
- }
3097
- if (isLoading) {
3098
- return /* @__PURE__ */ jsx32("div", { className: "min-h-screen bg-background flex items-center justify-center", children: /* @__PURE__ */ jsxs27("div", { className: "flex flex-col items-center gap-4", children: [
3099
- /* @__PURE__ */ jsx32("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" }),
3100
- /* @__PURE__ */ jsx32("p", { className: "text-sm text-muted-foreground", children: "Loading..." })
3101
- ] }) });
3102
- }
3103
- if (user) {
3104
- return /* @__PURE__ */ jsx32(Fragment6, { children });
3105
- }
3106
- switch (onUnauthenticated) {
3107
- case "redirect":
3108
- if (identity.unauthenticatedRedirectUrl && typeof window !== "undefined") {
3109
- window.location.href = identity.unauthenticatedRedirectUrl;
3110
- return /* @__PURE__ */ jsx32("div", { className: "min-h-screen bg-background flex items-center justify-center", children: /* @__PURE__ */ jsx32("p", { className: "text-sm text-muted-foreground", children: "Redirecting..." }) });
3111
- }
3112
- return identity.landingComponent ? identity.landingComponent : /* @__PURE__ */ jsx32(LandingPage, {});
3113
- case "allow":
3114
- return /* @__PURE__ */ jsx32(Fragment6, { children });
3115
- case "landing":
3116
- return identity.landingComponent ? identity.landingComponent : /* @__PURE__ */ jsx32(LandingPage, {});
3117
- }
3054
+ return /* @__PURE__ */ jsx32(
3055
+ AuthAuthGate,
3056
+ {
3057
+ required: identity.required ?? true,
3058
+ onUnauthenticated: identity.onUnauthenticated ?? "landing",
3059
+ redirectUrl: identity.unauthenticatedRedirectUrl,
3060
+ landingComponent: identity.landingComponent ?? /* @__PURE__ */ jsx32(LandingPage, {}),
3061
+ children
3062
+ }
3063
+ );
3118
3064
  }
3119
3065
 
3120
3066
  // src/developer/router.tsx
3121
- import { useEffect as useEffect9 } from "react";
3067
+ import { useEffect as useEffect8 } from "react";
3122
3068
  import { BrowserRouter, MemoryRouter, Navigate, Route, Routes, useLocation as useLocation2 } from "react-router-dom";
3123
3069
 
3124
3070
  // src/developer/pages/billing.tsx
@@ -3133,7 +3079,7 @@ import { SidebarTrigger } from "@mdxui/primitives/sidebar";
3133
3079
  import { Switch } from "@mdxui/primitives/switch";
3134
3080
  import { Table as Table6, TableBody as TableBody6, TableCell as TableCell6, TableHead as TableHead6, TableHeader as TableHeader6, TableRow as TableRow6 } from "@mdxui/primitives/table";
3135
3081
  import { Bell, Check as Check2, CreditCard as CreditCard3, Download as Download2, FileText as FileText2, Receipt } from "lucide-react";
3136
- import { useState as useState13 } from "react";
3082
+ import { useState as useState12 } from "react";
3137
3083
  import { toast as toast4 } from "sonner";
3138
3084
 
3139
3085
  // src/developer/lib/mock-data.ts
@@ -3703,7 +3649,7 @@ var mockWebhookActivity = {
3703
3649
  };
3704
3650
 
3705
3651
  // src/developer/pages/billing.tsx
3706
- import { Fragment as Fragment7, jsx as jsx33, jsxs as jsxs28 } from "react/jsx-runtime";
3652
+ import { Fragment as Fragment6, jsx as jsx33, jsxs as jsxs27 } from "react/jsx-runtime";
3707
3653
  function formatRelativeDate(dateString) {
3708
3654
  const date = new Date(dateString);
3709
3655
  return date.toLocaleDateString("en-US", {
@@ -3726,95 +3672,145 @@ function getUsageColor(percentage) {
3726
3672
  if (percentage >= 75) return "bg-yellow-500";
3727
3673
  return "";
3728
3674
  }
3729
- function BillingPage() {
3730
- const [alertsEnabled, setAlertsEnabled] = useState13(mockBillingData.billingAlerts.enabled);
3731
- const handleDownloadInvoice = (invoiceNumber) => {
3732
- toast4.success("Invoice downloaded", {
3733
- description: `${invoiceNumber} has been downloaded.`
3734
- });
3675
+ function BillingPage({
3676
+ billingData: initialBillingData,
3677
+ onManagePlan,
3678
+ onUpdatePaymentMethod,
3679
+ onDownloadInvoice,
3680
+ onToggleAlerts,
3681
+ hideHeader = false,
3682
+ className
3683
+ } = {}) {
3684
+ const billingData = initialBillingData ?? mockBillingData;
3685
+ const [alertsEnabled, setAlertsEnabled] = useState12(billingData.billingAlerts.enabled);
3686
+ const handleManagePlan = async () => {
3687
+ if (onManagePlan) {
3688
+ try {
3689
+ await onManagePlan();
3690
+ } catch {
3691
+ toast4.error("Failed to open plan management");
3692
+ }
3693
+ } else {
3694
+ toast4.info("Plan management would open here");
3695
+ }
3696
+ };
3697
+ const handleUpdatePaymentMethod = async () => {
3698
+ if (onUpdatePaymentMethod) {
3699
+ try {
3700
+ await onUpdatePaymentMethod();
3701
+ } catch {
3702
+ toast4.error("Failed to update payment method");
3703
+ }
3704
+ } else {
3705
+ toast4.info("Payment method update would open here");
3706
+ }
3735
3707
  };
3736
- const handleAlertsToggle = (enabled) => {
3708
+ const handleDownloadInvoice = async (invoiceId, invoiceNumber) => {
3709
+ if (onDownloadInvoice) {
3710
+ try {
3711
+ await onDownloadInvoice(invoiceId);
3712
+ toast4.success("Invoice downloaded", {
3713
+ description: `${invoiceNumber} has been downloaded.`
3714
+ });
3715
+ } catch {
3716
+ toast4.error("Failed to download invoice");
3717
+ }
3718
+ } else {
3719
+ toast4.success("Invoice downloaded", {
3720
+ description: `${invoiceNumber} has been downloaded.`
3721
+ });
3722
+ }
3723
+ };
3724
+ const handleAlertsToggle = async (enabled) => {
3725
+ if (onToggleAlerts) {
3726
+ try {
3727
+ await onToggleAlerts(enabled);
3728
+ } catch {
3729
+ toast4.error("Failed to update alert settings");
3730
+ return;
3731
+ }
3732
+ }
3737
3733
  setAlertsEnabled(enabled);
3738
3734
  toast4.success(enabled ? "Billing alerts enabled" : "Billing alerts disabled", {
3739
- description: enabled ? `You'll be notified when usage reaches ${mockBillingData.billingAlerts.threshold}%.` : "You won't receive usage alerts."
3735
+ description: enabled ? `You'll be notified when usage reaches ${billingData.billingAlerts.threshold}%.` : "You won't receive usage alerts."
3740
3736
  });
3741
3737
  };
3742
- return /* @__PURE__ */ jsxs28(Fragment7, { children: [
3743
- /* @__PURE__ */ jsx33("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-2 px-4", children: [
3738
+ return /* @__PURE__ */ jsxs27(Fragment6, { children: [
3739
+ !hideHeader && /* @__PURE__ */ jsx33("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-2 px-4", children: [
3744
3740
  /* @__PURE__ */ jsx33(SidebarTrigger, { className: "-ml-1" }),
3745
3741
  /* @__PURE__ */ jsx33(Separator3, { orientation: "vertical", className: "mr-2 data-[orientation=vertical]:h-4" }),
3746
3742
  /* @__PURE__ */ jsx33(Breadcrumb, { children: /* @__PURE__ */ jsx33(BreadcrumbList, { children: /* @__PURE__ */ jsx33(BreadcrumbItem, { children: /* @__PURE__ */ jsx33(BreadcrumbPage, { children: "Billing" }) }) }) })
3747
3743
  ] }) }),
3748
- /* @__PURE__ */ jsxs28("div", { className: "flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 pt-0", children: [
3749
- /* @__PURE__ */ jsx33("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsxs28("div", { children: [
3744
+ /* @__PURE__ */ jsxs27("div", { className: `flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 ${hideHeader ? "" : "pt-0"} ${className ?? ""}`, children: [
3745
+ /* @__PURE__ */ jsx33("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsxs27("div", { children: [
3750
3746
  /* @__PURE__ */ jsx33("h1", { className: "text-2xl font-bold", children: "Billing" }),
3751
3747
  /* @__PURE__ */ jsx33("p", { className: "text-muted-foreground", children: "Manage your subscription and billing information." })
3752
3748
  ] }) }),
3753
- /* @__PURE__ */ jsxs28("div", { className: "grid gap-4 md:grid-cols-2", children: [
3754
- /* @__PURE__ */ jsxs28(Card13, { children: [
3755
- /* @__PURE__ */ jsxs28(CardHeader12, { children: [
3756
- /* @__PURE__ */ jsxs28("div", { className: "flex items-center justify-between", children: [
3749
+ /* @__PURE__ */ jsxs27("div", { className: "grid gap-4 md:grid-cols-2", children: [
3750
+ /* @__PURE__ */ jsxs27(Card13, { children: [
3751
+ /* @__PURE__ */ jsxs27(CardHeader12, { children: [
3752
+ /* @__PURE__ */ jsxs27("div", { className: "flex items-center justify-between", children: [
3757
3753
  /* @__PURE__ */ jsx33(CardTitle12, { children: "Current Plan" }),
3758
- /* @__PURE__ */ jsx33(Badge6, { variant: mockBillingData.status === "active" ? "default" : "secondary", children: mockBillingData.status })
3754
+ /* @__PURE__ */ jsx33(Badge6, { variant: billingData.status === "active" ? "default" : "secondary", children: billingData.status })
3759
3755
  ] }),
3760
- /* @__PURE__ */ jsxs28(CardDescription11, { children: [
3756
+ /* @__PURE__ */ jsxs27(CardDescription11, { children: [
3761
3757
  "Renews",
3762
3758
  " ",
3763
- new Date(mockBillingData.renewalDate).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" })
3759
+ new Date(billingData.renewalDate).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" })
3764
3760
  ] })
3765
3761
  ] }),
3766
- /* @__PURE__ */ jsxs28(CardContent12, { className: "space-y-4", children: [
3767
- /* @__PURE__ */ jsxs28("div", { className: "flex items-baseline gap-2", children: [
3768
- /* @__PURE__ */ jsx33("p", { className: "text-3xl font-bold", children: mockBillingData.plan }),
3769
- /* @__PURE__ */ jsxs28("p", { className: "text-lg text-muted-foreground", children: [
3762
+ /* @__PURE__ */ jsxs27(CardContent12, { className: "space-y-4", children: [
3763
+ /* @__PURE__ */ jsxs27("div", { className: "flex items-baseline gap-2", children: [
3764
+ /* @__PURE__ */ jsx33("p", { className: "text-3xl font-bold", children: billingData.plan }),
3765
+ /* @__PURE__ */ jsxs27("p", { className: "text-lg text-muted-foreground", children: [
3770
3766
  "$",
3771
- mockBillingData.planPrice.toFixed(0),
3767
+ billingData.planPrice.toFixed(0),
3772
3768
  "/mo"
3773
3769
  ] })
3774
3770
  ] }),
3775
- /* @__PURE__ */ jsx33("div", { className: "space-y-2", children: mockBillingData.planFeatures.map((feature) => /* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
3771
+ /* @__PURE__ */ jsx33("div", { className: "space-y-2", children: billingData.planFeatures.map((feature) => /* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
3776
3772
  /* @__PURE__ */ jsx33(Check2, { className: "h-4 w-4 text-primary" }),
3777
3773
  feature
3778
3774
  ] }, feature)) }),
3779
- /* @__PURE__ */ jsx33(Button12, { variant: "outline", size: "sm", className: "w-full", children: "Manage Plan" })
3775
+ /* @__PURE__ */ jsx33(Button12, { variant: "outline", size: "sm", className: "w-full", onClick: handleManagePlan, children: "Manage Plan" })
3780
3776
  ] })
3781
3777
  ] }),
3782
- /* @__PURE__ */ jsxs28(Card13, { children: [
3778
+ /* @__PURE__ */ jsxs27(Card13, { children: [
3783
3779
  /* @__PURE__ */ jsx33(CardHeader12, { children: /* @__PURE__ */ jsx33(CardTitle12, { children: "Total Spend" }) }),
3784
- /* @__PURE__ */ jsxs28(CardContent12, { className: "space-y-1", children: [
3785
- /* @__PURE__ */ jsxs28("p", { className: "text-3xl font-bold", children: [
3780
+ /* @__PURE__ */ jsxs27(CardContent12, { className: "space-y-1", children: [
3781
+ /* @__PURE__ */ jsxs27("p", { className: "text-3xl font-bold", children: [
3786
3782
  "$",
3787
- mockBillingData.totalSpend.toFixed(2)
3783
+ billingData.totalSpend.toFixed(2)
3788
3784
  ] }),
3789
3785
  /* @__PURE__ */ jsx33("p", { className: "text-sm text-muted-foreground", children: "This billing period" })
3790
3786
  ] })
3791
3787
  ] })
3792
3788
  ] }),
3793
- /* @__PURE__ */ jsxs28("div", { className: "grid gap-4 md:grid-cols-2", children: [
3794
- /* @__PURE__ */ jsxs28(Card13, { className: "md:row-span-2", children: [
3795
- /* @__PURE__ */ jsxs28(CardHeader12, { children: [
3789
+ /* @__PURE__ */ jsxs27("div", { className: "grid gap-4 md:grid-cols-2", children: [
3790
+ /* @__PURE__ */ jsxs27(Card13, { className: "md:row-span-2", children: [
3791
+ /* @__PURE__ */ jsxs27(CardHeader12, { children: [
3796
3792
  /* @__PURE__ */ jsx33(CardTitle12, { children: "Usage Breakdown" }),
3797
3793
  /* @__PURE__ */ jsx33(CardDescription11, { children: "Resource usage for the current billing period" })
3798
3794
  ] }),
3799
- /* @__PURE__ */ jsx33(CardContent12, { className: "space-y-6", children: mockBillingData.usageBreakdown.map((item) => {
3795
+ /* @__PURE__ */ jsx33(CardContent12, { className: "space-y-6", children: billingData.usageBreakdown.map((item) => {
3800
3796
  const percentage = getUsagePercentage(item.usage, item.limit);
3801
3797
  const colorClass = getUsageColor(percentage);
3802
- return /* @__PURE__ */ jsxs28("div", { className: "space-y-2", children: [
3803
- /* @__PURE__ */ jsxs28("div", { className: "flex items-center justify-between", children: [
3804
- /* @__PURE__ */ jsxs28("div", { children: [
3798
+ return /* @__PURE__ */ jsxs27("div", { className: "space-y-2", children: [
3799
+ /* @__PURE__ */ jsxs27("div", { className: "flex items-center justify-between", children: [
3800
+ /* @__PURE__ */ jsxs27("div", { children: [
3805
3801
  /* @__PURE__ */ jsx33("p", { className: "font-medium", children: item.resource }),
3806
- /* @__PURE__ */ jsxs28("p", { className: "text-sm text-muted-foreground", children: [
3802
+ /* @__PURE__ */ jsxs27("p", { className: "text-sm text-muted-foreground", children: [
3807
3803
  formatUsage(item.usage, item.unit),
3808
3804
  " of ",
3809
3805
  formatUsage(item.limit, item.unit)
3810
3806
  ] })
3811
3807
  ] }),
3812
- /* @__PURE__ */ jsxs28("div", { className: "text-right", children: [
3813
- /* @__PURE__ */ jsxs28("p", { className: "font-medium", children: [
3808
+ /* @__PURE__ */ jsxs27("div", { className: "text-right", children: [
3809
+ /* @__PURE__ */ jsxs27("p", { className: "font-medium", children: [
3814
3810
  "$",
3815
3811
  item.cost.toFixed(2)
3816
3812
  ] }),
3817
- /* @__PURE__ */ jsxs28("p", { className: "text-sm text-muted-foreground", children: [
3813
+ /* @__PURE__ */ jsxs27("p", { className: "text-sm text-muted-foreground", children: [
3818
3814
  percentage.toFixed(0),
3819
3815
  "% used"
3820
3816
  ] })
@@ -3824,44 +3820,44 @@ function BillingPage() {
3824
3820
  ] }, item.resource);
3825
3821
  }) })
3826
3822
  ] }),
3827
- /* @__PURE__ */ jsxs28(Card13, { children: [
3828
- /* @__PURE__ */ jsx33(CardHeader12, { className: "pb-3", children: /* @__PURE__ */ jsxs28(CardTitle12, { className: "flex items-center gap-2 text-base", children: [
3823
+ /* @__PURE__ */ jsxs27(Card13, { children: [
3824
+ /* @__PURE__ */ jsx33(CardHeader12, { className: "pb-3", children: /* @__PURE__ */ jsxs27(CardTitle12, { className: "flex items-center gap-2 text-base", children: [
3829
3825
  /* @__PURE__ */ jsx33(CreditCard3, { className: "h-4 w-4" }),
3830
3826
  "Payment Method"
3831
3827
  ] }) }),
3832
- /* @__PURE__ */ jsxs28(CardContent12, { className: "space-y-3", children: [
3833
- /* @__PURE__ */ jsxs28("div", { className: "flex items-center justify-between p-3 border rounded-md", children: [
3834
- /* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-3", children: [
3835
- /* @__PURE__ */ jsx33("div", { className: "h-8 w-12 bg-muted rounded flex items-center justify-center text-xs font-medium", children: mockBillingData.paymentMethod.brand }),
3836
- /* @__PURE__ */ jsxs28("div", { children: [
3837
- /* @__PURE__ */ jsxs28("p", { className: "font-medium text-sm", children: [
3828
+ /* @__PURE__ */ jsxs27(CardContent12, { className: "space-y-3", children: [
3829
+ /* @__PURE__ */ jsxs27("div", { className: "flex items-center justify-between p-3 border rounded-md", children: [
3830
+ /* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-3", children: [
3831
+ /* @__PURE__ */ jsx33("div", { className: "h-8 w-12 bg-muted rounded flex items-center justify-center text-xs font-medium", children: billingData.paymentMethod.brand }),
3832
+ /* @__PURE__ */ jsxs27("div", { children: [
3833
+ /* @__PURE__ */ jsxs27("p", { className: "font-medium text-sm", children: [
3838
3834
  "\u2022\u2022\u2022\u2022 ",
3839
- mockBillingData.paymentMethod.last4
3835
+ billingData.paymentMethod.last4
3840
3836
  ] }),
3841
- /* @__PURE__ */ jsxs28("p", { className: "text-xs text-muted-foreground", children: [
3837
+ /* @__PURE__ */ jsxs27("p", { className: "text-xs text-muted-foreground", children: [
3842
3838
  "Expires ",
3843
- mockBillingData.paymentMethod.expiryMonth,
3839
+ billingData.paymentMethod.expiryMonth,
3844
3840
  "/",
3845
- mockBillingData.paymentMethod.expiryYear
3841
+ billingData.paymentMethod.expiryYear
3846
3842
  ] })
3847
3843
  ] })
3848
3844
  ] }),
3849
3845
  /* @__PURE__ */ jsx33(Badge6, { variant: "secondary", className: "text-xs", children: "Default" })
3850
3846
  ] }),
3851
- /* @__PURE__ */ jsx33(Button12, { variant: "outline", size: "sm", className: "w-full", children: "Update" })
3847
+ /* @__PURE__ */ jsx33(Button12, { variant: "outline", size: "sm", className: "w-full", onClick: handleUpdatePaymentMethod, children: "Update" })
3852
3848
  ] })
3853
3849
  ] }),
3854
- /* @__PURE__ */ jsxs28(Card13, { children: [
3855
- /* @__PURE__ */ jsx33(CardHeader12, { className: "pb-3", children: /* @__PURE__ */ jsxs28(CardTitle12, { className: "flex items-center gap-2 text-base", children: [
3850
+ /* @__PURE__ */ jsxs27(Card13, { children: [
3851
+ /* @__PURE__ */ jsx33(CardHeader12, { className: "pb-3", children: /* @__PURE__ */ jsxs27(CardTitle12, { className: "flex items-center gap-2 text-base", children: [
3856
3852
  /* @__PURE__ */ jsx33(Bell, { className: "h-4 w-4" }),
3857
3853
  "Billing Alerts"
3858
3854
  ] }) }),
3859
- /* @__PURE__ */ jsx33(CardContent12, { children: /* @__PURE__ */ jsxs28("div", { className: "flex items-start justify-between gap-4", children: [
3860
- /* @__PURE__ */ jsxs28("div", { className: "space-y-1", children: [
3855
+ /* @__PURE__ */ jsx33(CardContent12, { children: /* @__PURE__ */ jsxs27("div", { className: "flex items-start justify-between gap-4", children: [
3856
+ /* @__PURE__ */ jsxs27("div", { className: "space-y-1", children: [
3861
3857
  /* @__PURE__ */ jsx33(Label7, { htmlFor: "alerts", className: "text-sm", children: "Usage alerts" }),
3862
- /* @__PURE__ */ jsxs28("p", { className: "text-xs text-muted-foreground", children: [
3858
+ /* @__PURE__ */ jsxs27("p", { className: "text-xs text-muted-foreground", children: [
3863
3859
  "Notify at ",
3864
- mockBillingData.billingAlerts.threshold,
3860
+ billingData.billingAlerts.threshold,
3865
3861
  "% usage"
3866
3862
  ] })
3867
3863
  ] }),
@@ -3869,32 +3865,32 @@ function BillingPage() {
3869
3865
  ] }) })
3870
3866
  ] })
3871
3867
  ] }),
3872
- /* @__PURE__ */ jsxs28(Card13, { children: [
3873
- /* @__PURE__ */ jsx33(CardHeader12, { children: /* @__PURE__ */ jsxs28(CardTitle12, { className: "flex items-center gap-2", children: [
3868
+ /* @__PURE__ */ jsxs27(Card13, { children: [
3869
+ /* @__PURE__ */ jsx33(CardHeader12, { children: /* @__PURE__ */ jsxs27(CardTitle12, { className: "flex items-center gap-2", children: [
3874
3870
  /* @__PURE__ */ jsx33(Receipt, { className: "h-5 w-5" }),
3875
3871
  "Invoice History"
3876
3872
  ] }) }),
3877
- /* @__PURE__ */ jsx33(CardContent12, { children: mockBillingData.invoices.length > 0 ? /* @__PURE__ */ jsxs28(Table6, { children: [
3878
- /* @__PURE__ */ jsx33(TableHeader6, { children: /* @__PURE__ */ jsxs28(TableRow6, { children: [
3873
+ /* @__PURE__ */ jsx33(CardContent12, { children: billingData.invoices.length > 0 ? /* @__PURE__ */ jsxs27(Table6, { children: [
3874
+ /* @__PURE__ */ jsx33(TableHeader6, { children: /* @__PURE__ */ jsxs27(TableRow6, { children: [
3879
3875
  /* @__PURE__ */ jsx33(TableHead6, { className: "pl-4", children: "Invoice" }),
3880
3876
  /* @__PURE__ */ jsx33(TableHead6, { children: "Date" }),
3881
3877
  /* @__PURE__ */ jsx33(TableHead6, { children: "Amount" }),
3882
3878
  /* @__PURE__ */ jsx33(TableHead6, { children: "Status" }),
3883
3879
  /* @__PURE__ */ jsx33(TableHead6, { className: "w-[80px]" })
3884
3880
  ] }) }),
3885
- /* @__PURE__ */ jsx33(TableBody6, { children: mockBillingData.invoices.map((invoice) => /* @__PURE__ */ jsxs28(TableRow6, { children: [
3881
+ /* @__PURE__ */ jsx33(TableBody6, { children: billingData.invoices.map((invoice) => /* @__PURE__ */ jsxs27(TableRow6, { children: [
3886
3882
  /* @__PURE__ */ jsx33(TableCell6, { className: "py-4 pl-4 font-mono text-sm", children: invoice.invoiceNumber }),
3887
3883
  /* @__PURE__ */ jsx33(TableCell6, { className: "py-4", children: formatRelativeDate(invoice.date) }),
3888
- /* @__PURE__ */ jsxs28(TableCell6, { className: "py-4 font-medium", children: [
3884
+ /* @__PURE__ */ jsxs27(TableCell6, { className: "py-4 font-medium", children: [
3889
3885
  "$",
3890
3886
  invoice.amount.toFixed(2)
3891
3887
  ] }),
3892
3888
  /* @__PURE__ */ jsx33(TableCell6, { className: "py-4", children: /* @__PURE__ */ jsx33(Badge6, { variant: invoice.status === "paid" ? "default" : "secondary", children: invoice.status }) }),
3893
- /* @__PURE__ */ jsx33(TableCell6, { className: "py-4 pr-4", children: /* @__PURE__ */ jsx33(Button12, { variant: "ghost", size: "icon", onClick: () => handleDownloadInvoice(invoice.invoiceNumber), children: /* @__PURE__ */ jsx33(Download2, { className: "h-4 w-4" }) }) })
3889
+ /* @__PURE__ */ jsx33(TableCell6, { className: "py-4 pr-4", children: /* @__PURE__ */ jsx33(Button12, { variant: "ghost", size: "icon", onClick: () => handleDownloadInvoice(invoice.id, invoice.invoiceNumber), children: /* @__PURE__ */ jsx33(Download2, { className: "h-4 w-4" }) }) })
3894
3890
  ] }, invoice.id)) })
3895
- ] }) : /* @__PURE__ */ jsxs28("div", { className: "flex flex-col items-center justify-center gap-4 py-16 text-center", children: [
3891
+ ] }) : /* @__PURE__ */ jsxs27("div", { className: "flex flex-col items-center justify-center gap-4 py-16 text-center", children: [
3896
3892
  /* @__PURE__ */ jsx33("div", { className: "rounded-full bg-muted p-4", children: /* @__PURE__ */ jsx33(FileText2, { className: "h-8 w-8 text-muted-foreground" }) }),
3897
- /* @__PURE__ */ jsxs28("div", { children: [
3893
+ /* @__PURE__ */ jsxs27("div", { children: [
3898
3894
  /* @__PURE__ */ jsx33("p", { className: "font-medium", children: "No invoices yet" }),
3899
3895
  /* @__PURE__ */ jsx33("p", { className: "text-sm text-muted-foreground mt-1", children: "Your invoices will appear here after your first billing cycle." })
3900
3896
  ] })
@@ -3910,22 +3906,22 @@ import { Card as Card14, CardContent as CardContent13 } from "@mdxui/primitives/
3910
3906
  import { Separator as Separator4 } from "@mdxui/primitives/separator";
3911
3907
  import { SidebarTrigger as SidebarTrigger2 } from "@mdxui/primitives/sidebar";
3912
3908
  import { Database as Database2 } from "lucide-react";
3913
- import { Fragment as Fragment8, jsx as jsx34, jsxs as jsxs29 } from "react/jsx-runtime";
3909
+ import { Fragment as Fragment7, jsx as jsx34, jsxs as jsxs28 } from "react/jsx-runtime";
3914
3910
  function DatabasePage() {
3915
- return /* @__PURE__ */ jsxs29(Fragment8, { children: [
3916
- /* @__PURE__ */ jsx34("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-2 px-4", children: [
3911
+ return /* @__PURE__ */ jsxs28(Fragment7, { children: [
3912
+ /* @__PURE__ */ jsx34("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-2 px-4", children: [
3917
3913
  /* @__PURE__ */ jsx34(SidebarTrigger2, { className: "-ml-1" }),
3918
3914
  /* @__PURE__ */ jsx34(Separator4, { orientation: "vertical", className: "mr-2 data-[orientation=vertical]:h-4" }),
3919
3915
  /* @__PURE__ */ jsx34(Breadcrumb2, { children: /* @__PURE__ */ jsx34(BreadcrumbList2, { children: /* @__PURE__ */ jsx34(BreadcrumbItem2, { children: /* @__PURE__ */ jsx34(BreadcrumbPage2, { children: "Database" }) }) }) })
3920
3916
  ] }) }),
3921
- /* @__PURE__ */ jsxs29("div", { className: "flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 pt-0", children: [
3922
- /* @__PURE__ */ jsxs29("div", { children: [
3917
+ /* @__PURE__ */ jsxs28("div", { className: "flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 pt-0", children: [
3918
+ /* @__PURE__ */ jsxs28("div", { children: [
3923
3919
  /* @__PURE__ */ jsx34("h1", { className: "text-2xl font-bold", children: "Database" }),
3924
3920
  /* @__PURE__ */ jsx34("p", { className: "text-muted-foreground", children: "Browse and manage your database." })
3925
3921
  ] }),
3926
- /* @__PURE__ */ jsx34(Card14, { children: /* @__PURE__ */ jsx34(CardContent13, { className: "py-16", children: /* @__PURE__ */ jsxs29("div", { className: "flex flex-col items-center justify-center gap-4 text-center", children: [
3922
+ /* @__PURE__ */ jsx34(Card14, { children: /* @__PURE__ */ jsx34(CardContent13, { className: "py-16", children: /* @__PURE__ */ jsxs28("div", { className: "flex flex-col items-center justify-center gap-4 text-center", children: [
3927
3923
  /* @__PURE__ */ jsx34("div", { className: "rounded-full bg-muted p-4", children: /* @__PURE__ */ jsx34(Database2, { className: "h-8 w-8 text-muted-foreground" }) }),
3928
- /* @__PURE__ */ jsxs29("div", { children: [
3924
+ /* @__PURE__ */ jsxs28("div", { children: [
3929
3925
  /* @__PURE__ */ jsx34("p", { className: "font-medium", children: "Coming soon" }),
3930
3926
  /* @__PURE__ */ jsx34("p", { className: "text-sm text-muted-foreground mt-1", children: "Database management tools will be available here." })
3931
3927
  ] })
@@ -3939,22 +3935,28 @@ import { Breadcrumb as Breadcrumb3, BreadcrumbItem as BreadcrumbItem3, Breadcrum
3939
3935
  import { Separator as Separator5 } from "@mdxui/primitives/separator";
3940
3936
  import { SidebarTrigger as SidebarTrigger3 } from "@mdxui/primitives/sidebar";
3941
3937
  import { Plug as Plug2 } from "lucide-react";
3942
- import { Fragment as Fragment9, jsx as jsx35, jsxs as jsxs30 } from "react/jsx-runtime";
3938
+ import { Fragment as Fragment8, jsx as jsx35, jsxs as jsxs29 } from "react/jsx-runtime";
3943
3939
  function IntegrationsPage() {
3944
- return /* @__PURE__ */ jsxs30(Fragment9, { children: [
3945
- /* @__PURE__ */ jsx35("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-2 px-4", children: [
3940
+ return /* @__PURE__ */ jsxs29(Fragment8, { children: [
3941
+ /* @__PURE__ */ jsx35("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-2 px-4", children: [
3946
3942
  /* @__PURE__ */ jsx35(SidebarTrigger3, { className: "-ml-1" }),
3947
- /* @__PURE__ */ jsx35(Separator5, { orientation: "vertical", className: "mr-2 data-[orientation=vertical]:h-4" }),
3943
+ /* @__PURE__ */ jsx35(
3944
+ Separator5,
3945
+ {
3946
+ orientation: "vertical",
3947
+ className: "mr-2 data-[orientation=vertical]:h-4"
3948
+ }
3949
+ ),
3948
3950
  /* @__PURE__ */ jsx35(Breadcrumb3, { children: /* @__PURE__ */ jsx35(BreadcrumbList3, { children: /* @__PURE__ */ jsx35(BreadcrumbItem3, { children: /* @__PURE__ */ jsx35(BreadcrumbPage3, { children: "Integrations" }) }) }) })
3949
3951
  ] }) }),
3950
- /* @__PURE__ */ jsxs30("div", { className: "flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 pt-0", children: [
3951
- /* @__PURE__ */ jsxs30("div", { children: [
3952
+ /* @__PURE__ */ jsxs29("div", { className: "flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 pt-0", children: [
3953
+ /* @__PURE__ */ jsxs29("div", { children: [
3952
3954
  /* @__PURE__ */ jsx35("h1", { className: "text-2xl font-bold", children: "Integrations" }),
3953
3955
  /* @__PURE__ */ jsx35("p", { className: "text-muted-foreground", children: "Connect third-party services." })
3954
3956
  ] }),
3955
- /* @__PURE__ */ jsxs30("div", { className: "flex flex-col items-center justify-center rounded-md border border-dashed py-24 gap-4", children: [
3957
+ /* @__PURE__ */ jsxs29("div", { className: "flex flex-col items-center justify-center rounded-md border border-dashed py-24 gap-4", children: [
3956
3958
  /* @__PURE__ */ jsx35("div", { className: "rounded-full bg-muted p-4", children: /* @__PURE__ */ jsx35(Plug2, { className: "h-8 w-8 text-muted-foreground" }) }),
3957
- /* @__PURE__ */ jsxs30("div", { className: "text-center", children: [
3959
+ /* @__PURE__ */ jsxs29("div", { className: "text-center", children: [
3958
3960
  /* @__PURE__ */ jsx35("p", { className: "font-medium", children: "Coming Soon" }),
3959
3961
  /* @__PURE__ */ jsx35("p", { className: "text-muted-foreground text-sm max-w-md mt-1", children: "Connect services like GitHub, Slack, Google, Salesforce, and more." })
3960
3962
  ] })
@@ -3974,9 +3976,9 @@ import { Separator as Separator6 } from "@mdxui/primitives/separator";
3974
3976
  import { SidebarTrigger as SidebarTrigger4 } from "@mdxui/primitives/sidebar";
3975
3977
  import { Table as Table7, TableBody as TableBody7, TableCell as TableCell7, TableHead as TableHead7, TableHeader as TableHeader7, TableRow as TableRow7 } from "@mdxui/primitives/table";
3976
3978
  import { AlertTriangle, BarChart3 as BarChart33, Check as Check3, Copy as Copy3, Key as Key6, MoreHorizontal as MoreHorizontal4, Pencil, Plus as Plus5, Trash2 as Trash24 } from "lucide-react";
3977
- import { useState as useState14 } from "react";
3979
+ import { useState as useState13 } from "react";
3978
3980
  import { toast as toast5 } from "sonner";
3979
- import { Fragment as Fragment10, jsx as jsx36, jsxs as jsxs31 } from "react/jsx-runtime";
3981
+ import { Fragment as Fragment9, jsx as jsx36, jsxs as jsxs30 } from "react/jsx-runtime";
3980
3982
  function maskKey(key) {
3981
3983
  const prefix = key.substring(0, 8);
3982
3984
  return `${prefix}${"\u2022".repeat(16)}`;
@@ -4010,40 +4012,76 @@ function StatusIndicator({ status }) {
4010
4012
  }
4011
4013
  };
4012
4014
  const { color, label } = config[status];
4013
- return /* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-2", children: [
4015
+ return /* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-2", children: [
4014
4016
  /* @__PURE__ */ jsx36("span", { className: `h-2 w-2 rounded-full ${color}` }),
4015
4017
  /* @__PURE__ */ jsx36("span", { className: "text-sm", children: label })
4016
4018
  ] });
4017
4019
  }
4018
- function KeysPage() {
4019
- const [keys, setKeys] = useState14(mockApiKeys);
4020
- const [newKeyName, setNewKeyName] = useState14("");
4021
- const [newlyCreatedKey, setNewlyCreatedKey] = useState14(null);
4022
- const [createDialogOpen, setCreateDialogOpen] = useState14(false);
4023
- const [revokeDialogOpen, setRevokeDialogOpen] = useState14(false);
4024
- const [renameDialogOpen, setRenameDialogOpen] = useState14(false);
4025
- const [keyToRevoke, setKeyToRevoke] = useState14(null);
4026
- const [keyToRename, setKeyToRename] = useState14(null);
4027
- const [renameValue, setRenameValue] = useState14("");
4028
- const [copiedKeyId, setCopiedKeyId] = useState14(null);
4029
- const [newKeyCopied, setNewKeyCopied] = useState14(false);
4030
- const handleCreateKey = () => {
4031
- const newKey = {
4032
- id: String(Date.now()),
4033
- name: newKeyName || "Untitled Key",
4034
- key: `sk_live_${Math.random().toString(36).substring(2, 15)}${Math.random().toString(36).substring(2, 15)}`,
4035
- created: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
4036
- lastUsed: null,
4037
- status: "never_used"
4038
- };
4039
- setKeys([...keys, newKey]);
4040
- setNewlyCreatedKey(newKey.key);
4020
+ function KeysPage({
4021
+ keys: initialKeys,
4022
+ onCreateKey,
4023
+ onRevokeKey,
4024
+ onRenameKey,
4025
+ hideHeader = false,
4026
+ className
4027
+ } = {}) {
4028
+ const [keys, setKeys] = useState13(initialKeys ?? mockApiKeys);
4029
+ const [newKeyName, setNewKeyName] = useState13("");
4030
+ const [newlyCreatedKey, setNewlyCreatedKey] = useState13(null);
4031
+ const [createDialogOpen, setCreateDialogOpen] = useState13(false);
4032
+ const [revokeDialogOpen, setRevokeDialogOpen] = useState13(false);
4033
+ const [renameDialogOpen, setRenameDialogOpen] = useState13(false);
4034
+ const [keyToRevoke, setKeyToRevoke] = useState13(null);
4035
+ const [keyToRename, setKeyToRename] = useState13(null);
4036
+ const [renameValue, setRenameValue] = useState13("");
4037
+ const [copiedKeyId, setCopiedKeyId] = useState13(null);
4038
+ const [newKeyCopied, setNewKeyCopied] = useState13(false);
4039
+ const handleCreateKey = async () => {
4040
+ const name = newKeyName || "Untitled Key";
4041
+ if (onCreateKey) {
4042
+ try {
4043
+ const result = await onCreateKey(name);
4044
+ const newKey = {
4045
+ id: result.id,
4046
+ name,
4047
+ key: result.key,
4048
+ created: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
4049
+ lastUsed: null,
4050
+ status: "never_used"
4051
+ };
4052
+ setKeys([...keys, newKey]);
4053
+ setNewlyCreatedKey(result.key);
4054
+ } catch {
4055
+ toast5.error("Failed to create API key");
4056
+ return;
4057
+ }
4058
+ } else {
4059
+ const newKey = {
4060
+ id: String(Date.now()),
4061
+ name,
4062
+ key: `sk_live_${Math.random().toString(36).substring(2, 15)}${Math.random().toString(36).substring(2, 15)}`,
4063
+ created: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
4064
+ lastUsed: null,
4065
+ status: "never_used"
4066
+ };
4067
+ setKeys([...keys, newKey]);
4068
+ setNewlyCreatedKey(newKey.key);
4069
+ }
4041
4070
  setNewKeyName("");
4042
4071
  };
4043
- const handleRevokeKey = () => {
4072
+ const handleRevokeKey = async () => {
4044
4073
  if (keyToRevoke) {
4045
4074
  const keyName = keyToRevoke.name;
4046
- setKeys(keys.filter((k) => k.id !== keyToRevoke.id));
4075
+ const keyId = keyToRevoke.id;
4076
+ if (onRevokeKey) {
4077
+ try {
4078
+ await onRevokeKey(keyId);
4079
+ } catch {
4080
+ toast5.error("Failed to revoke API key");
4081
+ return;
4082
+ }
4083
+ }
4084
+ setKeys(keys.filter((k) => k.id !== keyId));
4047
4085
  setKeyToRevoke(null);
4048
4086
  setRevokeDialogOpen(false);
4049
4087
  toast5.success("API key revoked", {
@@ -4051,10 +4089,19 @@ function KeysPage() {
4051
4089
  });
4052
4090
  }
4053
4091
  };
4054
- const handleRenameKey = () => {
4092
+ const handleRenameKey = async () => {
4055
4093
  if (keyToRename && renameValue.trim()) {
4056
4094
  const newName = renameValue.trim();
4057
- setKeys(keys.map((k) => k.id === keyToRename.id ? __spreadProps(__spreadValues({}, k), { name: newName }) : k));
4095
+ const keyId = keyToRename.id;
4096
+ if (onRenameKey) {
4097
+ try {
4098
+ await onRenameKey(keyId, newName);
4099
+ } catch {
4100
+ toast5.error("Failed to rename API key");
4101
+ return;
4102
+ }
4103
+ }
4104
+ setKeys(keys.map((k) => k.id === keyId ? { ...k, name: newName } : k));
4058
4105
  setKeyToRename(null);
4059
4106
  setRenameDialogOpen(false);
4060
4107
  setRenameValue("");
@@ -4063,15 +4110,15 @@ function KeysPage() {
4063
4110
  });
4064
4111
  }
4065
4112
  };
4066
- const handleCopyNewKey = () => __async(null, null, function* () {
4113
+ const handleCopyNewKey = async () => {
4067
4114
  if (newlyCreatedKey) {
4068
- yield navigator.clipboard.writeText(newlyCreatedKey);
4115
+ await navigator.clipboard.writeText(newlyCreatedKey);
4069
4116
  setNewKeyCopied(true);
4070
4117
  setCopiedKeyId("new");
4071
4118
  setTimeout(() => setCopiedKeyId(null), 2e3);
4072
4119
  toast5.success("API key copied to clipboard");
4073
4120
  }
4074
- });
4121
+ };
4075
4122
  const closeCreateDialog = () => {
4076
4123
  setCreateDialogOpen(false);
4077
4124
  setNewlyCreatedKey(null);
@@ -4087,52 +4134,52 @@ function KeysPage() {
4087
4134
  setKeyToRevoke(apiKey);
4088
4135
  setRevokeDialogOpen(true);
4089
4136
  };
4090
- return /* @__PURE__ */ jsxs31(Fragment10, { children: [
4091
- /* @__PURE__ */ jsx36("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-2 px-4", children: [
4137
+ return /* @__PURE__ */ jsxs30(Fragment9, { children: [
4138
+ !hideHeader && /* @__PURE__ */ jsx36("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-2 px-4", children: [
4092
4139
  /* @__PURE__ */ jsx36(SidebarTrigger4, { className: "-ml-1" }),
4093
4140
  /* @__PURE__ */ jsx36(Separator6, { orientation: "vertical", className: "mr-2 data-[orientation=vertical]:h-4" }),
4094
4141
  /* @__PURE__ */ jsx36(Breadcrumb4, { children: /* @__PURE__ */ jsx36(BreadcrumbList4, { children: /* @__PURE__ */ jsx36(BreadcrumbItem4, { children: /* @__PURE__ */ jsx36(BreadcrumbPage4, { children: "API Keys" }) }) }) })
4095
4142
  ] }) }),
4096
- /* @__PURE__ */ jsxs31("div", { className: "flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 pt-0", children: [
4097
- /* @__PURE__ */ jsxs31("div", { className: "flex items-center justify-between", children: [
4098
- /* @__PURE__ */ jsxs31("div", { children: [
4143
+ /* @__PURE__ */ jsxs30("div", { className: `flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 ${hideHeader ? "" : "pt-0"} ${className ?? ""}`, children: [
4144
+ /* @__PURE__ */ jsxs30("div", { className: "flex items-center justify-between", children: [
4145
+ /* @__PURE__ */ jsxs30("div", { children: [
4099
4146
  /* @__PURE__ */ jsx36("h1", { className: "text-2xl font-bold", children: "API Keys" }),
4100
4147
  /* @__PURE__ */ jsx36("p", { className: "text-muted-foreground", children: "Manage your API keys for accessing the API." })
4101
4148
  ] }),
4102
- /* @__PURE__ */ jsxs31(Dialog7, { open: createDialogOpen, onOpenChange: setCreateDialogOpen, children: [
4103
- /* @__PURE__ */ jsx36(DialogTrigger4, { asChild: true, children: /* @__PURE__ */ jsxs31(Button13, { children: [
4149
+ /* @__PURE__ */ jsxs30(Dialog7, { open: createDialogOpen, onOpenChange: setCreateDialogOpen, children: [
4150
+ /* @__PURE__ */ jsx36(DialogTrigger4, { asChild: true, children: /* @__PURE__ */ jsxs30(Button13, { children: [
4104
4151
  /* @__PURE__ */ jsx36(Plus5, { className: "h-4 w-4" }),
4105
4152
  "Create Key"
4106
4153
  ] }) }),
4107
- /* @__PURE__ */ jsx36(DialogContent7, { children: newlyCreatedKey ? /* @__PURE__ */ jsxs31(Fragment10, { children: [
4108
- /* @__PURE__ */ jsxs31(DialogHeader6, { children: [
4154
+ /* @__PURE__ */ jsx36(DialogContent7, { children: newlyCreatedKey ? /* @__PURE__ */ jsxs30(Fragment9, { children: [
4155
+ /* @__PURE__ */ jsxs30(DialogHeader6, { children: [
4109
4156
  /* @__PURE__ */ jsx36(DialogTitle6, { children: "API Key Created" }),
4110
4157
  /* @__PURE__ */ jsx36(DialogDescription5, { children: "Your new API key has been created successfully." })
4111
4158
  ] }),
4112
- /* @__PURE__ */ jsxs31(Alert, { variant: "warning", children: [
4159
+ /* @__PURE__ */ jsxs30(Alert, { variant: "warning", children: [
4113
4160
  /* @__PURE__ */ jsx36(AlertTriangle, { className: "h-4 w-4" }),
4114
4161
  /* @__PURE__ */ jsx36(AlertDescription, { children: "Copy your API key now. You won't be able to see it again." })
4115
4162
  ] }),
4116
- /* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-2", children: [
4163
+ /* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-2", children: [
4117
4164
  /* @__PURE__ */ jsx36(Input8, { value: newlyCreatedKey, readOnly: true, className: "font-mono text-sm" }),
4118
4165
  /* @__PURE__ */ jsx36(Button13, { variant: "outline", size: "icon", onClick: handleCopyNewKey, children: copiedKeyId === "new" ? /* @__PURE__ */ jsx36(Check3, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx36(Copy3, { className: "h-4 w-4" }) })
4119
4166
  ] }),
4120
4167
  /* @__PURE__ */ jsx36(DialogFooter6, { children: /* @__PURE__ */ jsx36(Button13, { onClick: closeCreateDialog, disabled: !newKeyCopied, children: "Done" }) })
4121
- ] }) : /* @__PURE__ */ jsxs31(Fragment10, { children: [
4122
- /* @__PURE__ */ jsxs31(DialogHeader6, { children: [
4168
+ ] }) : /* @__PURE__ */ jsxs30(Fragment9, { children: [
4169
+ /* @__PURE__ */ jsxs30(DialogHeader6, { children: [
4123
4170
  /* @__PURE__ */ jsx36(DialogTitle6, { children: "Create API Key" }),
4124
4171
  /* @__PURE__ */ jsx36(DialogDescription5, { children: "Give your API key a name to help you identify it later." })
4125
4172
  ] }),
4126
4173
  /* @__PURE__ */ jsx36(Input8, { placeholder: "Key name (optional)", value: newKeyName, onChange: (e) => setNewKeyName(e.target.value) }),
4127
- /* @__PURE__ */ jsxs31(DialogFooter6, { children: [
4174
+ /* @__PURE__ */ jsxs30(DialogFooter6, { children: [
4128
4175
  /* @__PURE__ */ jsx36(Button13, { variant: "outline", onClick: closeCreateDialog, children: "Cancel" }),
4129
4176
  /* @__PURE__ */ jsx36(Button13, { onClick: handleCreateKey, children: "Create" })
4130
4177
  ] })
4131
4178
  ] }) })
4132
4179
  ] })
4133
4180
  ] }),
4134
- /* @__PURE__ */ jsx36("div", { className: "rounded-md border", children: /* @__PURE__ */ jsxs31(Table7, { children: [
4135
- /* @__PURE__ */ jsx36(TableHeader7, { children: /* @__PURE__ */ jsxs31(TableRow7, { children: [
4181
+ /* @__PURE__ */ jsx36("div", { className: "rounded-md border", children: /* @__PURE__ */ jsxs30(Table7, { children: [
4182
+ /* @__PURE__ */ jsx36(TableHeader7, { children: /* @__PURE__ */ jsxs30(TableRow7, { children: [
4136
4183
  /* @__PURE__ */ jsx36(TableHead7, { className: "pl-4", children: "Name" }),
4137
4184
  /* @__PURE__ */ jsx36(TableHead7, { children: "Key" }),
4138
4185
  /* @__PURE__ */ jsx36(TableHead7, { children: "Status" }),
@@ -4140,39 +4187,39 @@ function KeysPage() {
4140
4187
  /* @__PURE__ */ jsx36(TableHead7, { children: "Last Used" }),
4141
4188
  /* @__PURE__ */ jsx36(TableHead7, { className: "w-[60px]" })
4142
4189
  ] }) }),
4143
- /* @__PURE__ */ jsxs31(TableBody7, { children: [
4144
- keys.map((apiKey) => /* @__PURE__ */ jsxs31(TableRow7, { children: [
4190
+ /* @__PURE__ */ jsxs30(TableBody7, { children: [
4191
+ keys.map((apiKey) => /* @__PURE__ */ jsxs30(TableRow7, { children: [
4145
4192
  /* @__PURE__ */ jsx36(TableCell7, { className: "py-4 pl-4 font-medium", children: apiKey.name }),
4146
4193
  /* @__PURE__ */ jsx36(TableCell7, { className: "py-4 font-mono text-sm text-muted-foreground", children: maskKey(apiKey.key) }),
4147
4194
  /* @__PURE__ */ jsx36(TableCell7, { className: "py-4", children: /* @__PURE__ */ jsx36(StatusIndicator, { status: apiKey.status }) }),
4148
4195
  /* @__PURE__ */ jsx36(TableCell7, { className: "py-4", children: apiKey.created }),
4149
4196
  /* @__PURE__ */ jsx36(TableCell7, { className: "py-4 text-muted-foreground", children: getRelativeTime(apiKey.lastUsed) }),
4150
- /* @__PURE__ */ jsx36(TableCell7, { className: "py-4 pr-4", children: /* @__PURE__ */ jsxs31(DropdownMenu4, { children: [
4197
+ /* @__PURE__ */ jsx36(TableCell7, { className: "py-4 pr-4", children: /* @__PURE__ */ jsxs30(DropdownMenu4, { children: [
4151
4198
  /* @__PURE__ */ jsx36(DropdownMenuTrigger4, { asChild: true, children: /* @__PURE__ */ jsx36(Button13, { variant: "ghost", size: "icon", className: "h-8 w-8", children: /* @__PURE__ */ jsx36(MoreHorizontal4, { className: "h-4 w-4" }) }) }),
4152
- /* @__PURE__ */ jsxs31(DropdownMenuContent4, { align: "end", children: [
4153
- /* @__PURE__ */ jsxs31(DropdownMenuItem4, { onClick: () => openRenameDialog(apiKey), children: [
4199
+ /* @__PURE__ */ jsxs30(DropdownMenuContent4, { align: "end", children: [
4200
+ /* @__PURE__ */ jsxs30(DropdownMenuItem4, { onClick: () => openRenameDialog(apiKey), children: [
4154
4201
  /* @__PURE__ */ jsx36(Pencil, { className: "h-4 w-4" }),
4155
4202
  "Rename"
4156
4203
  ] }),
4157
- /* @__PURE__ */ jsxs31(DropdownMenuItem4, { children: [
4204
+ /* @__PURE__ */ jsxs30(DropdownMenuItem4, { children: [
4158
4205
  /* @__PURE__ */ jsx36(BarChart33, { className: "h-4 w-4" }),
4159
4206
  "View Usage"
4160
4207
  ] }),
4161
4208
  /* @__PURE__ */ jsx36(DropdownMenuSeparator2, {}),
4162
- /* @__PURE__ */ jsxs31(DropdownMenuItem4, { className: "text-destructive focus:text-destructive", onClick: () => openRevokeDialog(apiKey), children: [
4209
+ /* @__PURE__ */ jsxs30(DropdownMenuItem4, { className: "text-destructive focus:text-destructive", onClick: () => openRevokeDialog(apiKey), children: [
4163
4210
  /* @__PURE__ */ jsx36(Trash24, { className: "h-4 w-4" }),
4164
4211
  "Revoke"
4165
4212
  ] })
4166
4213
  ] })
4167
4214
  ] }) })
4168
4215
  ] }, apiKey.id)),
4169
- keys.length === 0 && /* @__PURE__ */ jsx36(TableRow7, { children: /* @__PURE__ */ jsx36(TableCell7, { colSpan: 6, className: "py-16", children: /* @__PURE__ */ jsxs31("div", { className: "flex flex-col items-center justify-center gap-4 text-center", children: [
4216
+ keys.length === 0 && /* @__PURE__ */ jsx36(TableRow7, { children: /* @__PURE__ */ jsx36(TableCell7, { colSpan: 6, className: "py-16", children: /* @__PURE__ */ jsxs30("div", { className: "flex flex-col items-center justify-center gap-4 text-center", children: [
4170
4217
  /* @__PURE__ */ jsx36("div", { className: "rounded-full bg-muted p-4", children: /* @__PURE__ */ jsx36(Key6, { className: "h-8 w-8 text-muted-foreground" }) }),
4171
- /* @__PURE__ */ jsxs31("div", { children: [
4218
+ /* @__PURE__ */ jsxs30("div", { children: [
4172
4219
  /* @__PURE__ */ jsx36("p", { className: "font-medium", children: "No API keys yet" }),
4173
4220
  /* @__PURE__ */ jsx36("p", { className: "text-sm text-muted-foreground mt-1", children: "Create your first API key to start making requests." })
4174
4221
  ] }),
4175
- /* @__PURE__ */ jsxs31(Button13, { onClick: () => setCreateDialogOpen(true), className: "mt-2", children: [
4222
+ /* @__PURE__ */ jsxs30(Button13, { onClick: () => setCreateDialogOpen(true), className: "mt-2", children: [
4176
4223
  /* @__PURE__ */ jsx36(Plus5, { className: "h-4 w-4" }),
4177
4224
  "Create Your First Key"
4178
4225
  ] })
@@ -4180,13 +4227,13 @@ function KeysPage() {
4180
4227
  ] })
4181
4228
  ] }) })
4182
4229
  ] }),
4183
- /* @__PURE__ */ jsx36(Dialog7, { open: renameDialogOpen, onOpenChange: setRenameDialogOpen, children: /* @__PURE__ */ jsxs31(DialogContent7, { children: [
4184
- /* @__PURE__ */ jsxs31(DialogHeader6, { children: [
4230
+ /* @__PURE__ */ jsx36(Dialog7, { open: renameDialogOpen, onOpenChange: setRenameDialogOpen, children: /* @__PURE__ */ jsxs30(DialogContent7, { children: [
4231
+ /* @__PURE__ */ jsxs30(DialogHeader6, { children: [
4185
4232
  /* @__PURE__ */ jsx36(DialogTitle6, { children: "Rename API Key" }),
4186
4233
  /* @__PURE__ */ jsx36(DialogDescription5, { children: "Enter a new name for this API key." })
4187
4234
  ] }),
4188
4235
  /* @__PURE__ */ jsx36(Input8, { placeholder: "Key name", value: renameValue, onChange: (e) => setRenameValue(e.target.value) }),
4189
- /* @__PURE__ */ jsxs31(DialogFooter6, { children: [
4236
+ /* @__PURE__ */ jsxs30(DialogFooter6, { children: [
4190
4237
  /* @__PURE__ */ jsx36(
4191
4238
  Button13,
4192
4239
  {
@@ -4202,16 +4249,16 @@ function KeysPage() {
4202
4249
  /* @__PURE__ */ jsx36(Button13, { onClick: handleRenameKey, disabled: !renameValue.trim(), children: "Rename" })
4203
4250
  ] })
4204
4251
  ] }) }),
4205
- /* @__PURE__ */ jsx36(Dialog7, { open: revokeDialogOpen, onOpenChange: setRevokeDialogOpen, children: /* @__PURE__ */ jsxs31(DialogContent7, { children: [
4206
- /* @__PURE__ */ jsxs31(DialogHeader6, { children: [
4252
+ /* @__PURE__ */ jsx36(Dialog7, { open: revokeDialogOpen, onOpenChange: setRevokeDialogOpen, children: /* @__PURE__ */ jsxs30(DialogContent7, { children: [
4253
+ /* @__PURE__ */ jsxs30(DialogHeader6, { children: [
4207
4254
  /* @__PURE__ */ jsx36(DialogTitle6, { children: "Revoke API Key" }),
4208
- /* @__PURE__ */ jsxs31(DialogDescription5, { children: [
4255
+ /* @__PURE__ */ jsxs30(DialogDescription5, { children: [
4209
4256
  'Are you sure you want to revoke "',
4210
- keyToRevoke == null ? void 0 : keyToRevoke.name,
4257
+ keyToRevoke?.name,
4211
4258
  '"? This action cannot be undone.'
4212
4259
  ] })
4213
4260
  ] }),
4214
- /* @__PURE__ */ jsxs31(DialogFooter6, { children: [
4261
+ /* @__PURE__ */ jsxs30(DialogFooter6, { children: [
4215
4262
  /* @__PURE__ */ jsx36(
4216
4263
  Button13,
4217
4264
  {
@@ -4239,10 +4286,10 @@ import { Separator as Separator7 } from "@mdxui/primitives/separator";
4239
4286
  import { SidebarTrigger as SidebarTrigger5 } from "@mdxui/primitives/sidebar";
4240
4287
  import { Skeleton } from "@mdxui/primitives/skeleton";
4241
4288
  import { Activity as Activity2, AlertTriangle as AlertTriangle2, BarChart3 as BarChart34, ChevronDown, DollarSign as DollarSign2 } from "lucide-react";
4242
- import { useEffect as useEffect7, useState as useState15 } from "react";
4289
+ import { useEffect as useEffect6, useState as useState14 } from "react";
4243
4290
  import { Link as Link3 } from "react-router-dom";
4244
4291
  import { Area as Area3, AreaChart as AreaChart3, Bar as Bar2, BarChart as BarChart2, ReferenceLine as ReferenceLine2, XAxis as XAxis4, YAxis as YAxis4 } from "recharts";
4245
- import { Fragment as Fragment11, jsx as jsx37, jsxs as jsxs32 } from "react/jsx-runtime";
4292
+ import { Fragment as Fragment10, jsx as jsx37, jsxs as jsxs31 } from "react/jsx-runtime";
4246
4293
  var chartConfig = {
4247
4294
  requests: {
4248
4295
  label: "Requests",
@@ -4253,12 +4300,12 @@ function Sparkline({ data, color }) {
4253
4300
  return /* @__PURE__ */ jsx37("div", { className: "h-8 w-20", children: /* @__PURE__ */ jsx37(AreaChart3, { data, width: 80, height: 32, margin: { top: 2, right: 0, bottom: 0, left: 0 }, children: /* @__PURE__ */ jsx37(Area3, { type: "monotone", dataKey: "value", stroke: color, fill: color, fillOpacity: 0.2, strokeWidth: 1.5 }) }) });
4254
4301
  }
4255
4302
  function StatCardSkeleton() {
4256
- return /* @__PURE__ */ jsxs32(Card15, { children: [
4257
- /* @__PURE__ */ jsxs32(CardHeader13, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
4303
+ return /* @__PURE__ */ jsxs31(Card15, { children: [
4304
+ /* @__PURE__ */ jsxs31(CardHeader13, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
4258
4305
  /* @__PURE__ */ jsx37(Skeleton, { className: "h-4 w-24" }),
4259
4306
  /* @__PURE__ */ jsx37(Skeleton, { className: "h-4 w-4" })
4260
4307
  ] }),
4261
- /* @__PURE__ */ jsxs32(CardContent14, { children: [
4308
+ /* @__PURE__ */ jsxs31(CardContent14, { children: [
4262
4309
  /* @__PURE__ */ jsx37(Skeleton, { className: "h-8 w-20 mb-1" }),
4263
4310
  /* @__PURE__ */ jsx37(Skeleton, { className: "h-3 w-32" })
4264
4311
  ] })
@@ -4269,19 +4316,18 @@ function ChartSkeleton() {
4269
4316
  return /* @__PURE__ */ jsx37("div", { className: "h-[500px] w-full flex items-end justify-around gap-2 px-8", children: SKELETON_HEIGHTS.map((height, i) => /* @__PURE__ */ jsx37(Skeleton, { className: "w-full", style: { height: `${height}%` } }, i.toString())) });
4270
4317
  }
4271
4318
  function EmptyState() {
4272
- return /* @__PURE__ */ jsxs32("div", { className: "h-[500px] w-full flex flex-col items-center justify-center text-muted-foreground", children: [
4319
+ return /* @__PURE__ */ jsxs31("div", { className: "h-[500px] w-full flex flex-col items-center justify-center text-muted-foreground", children: [
4273
4320
  /* @__PURE__ */ jsx37(BarChart34, { className: "h-12 w-12 mb-4 opacity-50" }),
4274
4321
  /* @__PURE__ */ jsx37("p", { className: "text-lg font-medium", children: "No data available" }),
4275
4322
  /* @__PURE__ */ jsx37("p", { className: "text-sm", children: "There's no usage data for this time period." })
4276
4323
  ] });
4277
4324
  }
4278
4325
  function OverviewPage() {
4279
- var _a, _b, _c, _d;
4280
- const [selectedPeriod, setSelectedPeriod] = useState15("30d");
4281
- const [isLoading, setIsLoading] = useState15(true);
4282
- const [stats, setStats] = useState15(null);
4283
- const [usageData, setUsageData] = useState15([]);
4284
- useEffect7(() => {
4326
+ const [selectedPeriod, setSelectedPeriod] = useState14("30d");
4327
+ const [isLoading, setIsLoading] = useState14(true);
4328
+ const [stats, setStats] = useState14(null);
4329
+ const [usageData, setUsageData] = useState14([]);
4330
+ useEffect6(() => {
4285
4331
  let cancelled = false;
4286
4332
  const timer = setTimeout(() => {
4287
4333
  if (!cancelled) {
@@ -4299,66 +4345,66 @@ function OverviewPage() {
4299
4345
  setIsLoading(true);
4300
4346
  setSelectedPeriod(period);
4301
4347
  };
4302
- const selectedLabel = (_a = timePeriodOptions.find((opt) => opt.value === selectedPeriod)) == null ? void 0 : _a.label;
4303
- return /* @__PURE__ */ jsxs32(Fragment11, { children: [
4304
- /* @__PURE__ */ jsx37("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs32("div", { className: "flex items-center gap-2 px-4", children: [
4348
+ const selectedLabel = timePeriodOptions.find((opt) => opt.value === selectedPeriod)?.label;
4349
+ return /* @__PURE__ */ jsxs31(Fragment10, { children: [
4350
+ /* @__PURE__ */ jsx37("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-2 px-4", children: [
4305
4351
  /* @__PURE__ */ jsx37(SidebarTrigger5, { className: "-ml-1" }),
4306
4352
  /* @__PURE__ */ jsx37(Separator7, { orientation: "vertical", className: "mr-2 data-[orientation=vertical]:h-4" }),
4307
4353
  /* @__PURE__ */ jsx37(Breadcrumb5, { children: /* @__PURE__ */ jsx37(BreadcrumbList5, { children: /* @__PURE__ */ jsx37(BreadcrumbItem5, { children: /* @__PURE__ */ jsx37(BreadcrumbPage5, { children: "Overview" }) }) }) })
4308
4354
  ] }) }),
4309
- /* @__PURE__ */ jsxs32("div", { className: "flex flex-1 flex-col gap-4 px-16 py-4 pt-0", children: [
4310
- /* @__PURE__ */ jsxs32("div", { className: "flex items-center justify-between", children: [
4355
+ /* @__PURE__ */ jsxs31("div", { className: "flex flex-1 flex-col gap-4 px-16 py-4 pt-0", children: [
4356
+ /* @__PURE__ */ jsxs31("div", { className: "flex items-center justify-between", children: [
4311
4357
  /* @__PURE__ */ jsx37("h1", { className: "text-2xl font-semibold", children: "Usage" }),
4312
- /* @__PURE__ */ jsxs32(DropdownMenu5, { children: [
4313
- /* @__PURE__ */ jsx37(DropdownMenuTrigger5, { asChild: true, children: /* @__PURE__ */ jsxs32(Button14, { variant: "outline", className: "w-[140px] justify-between", children: [
4358
+ /* @__PURE__ */ jsxs31(DropdownMenu5, { children: [
4359
+ /* @__PURE__ */ jsx37(DropdownMenuTrigger5, { asChild: true, children: /* @__PURE__ */ jsxs31(Button14, { variant: "outline", className: "w-[140px] justify-between", children: [
4314
4360
  selectedLabel,
4315
4361
  /* @__PURE__ */ jsx37(ChevronDown, { className: "h-4 w-4 opacity-50" })
4316
4362
  ] }) }),
4317
4363
  /* @__PURE__ */ jsx37(DropdownMenuContent5, { align: "end", className: "w-[140px]", children: timePeriodOptions.map((option) => /* @__PURE__ */ jsx37(DropdownMenuItem5, { onClick: () => handlePeriodChange(option.value), children: option.label }, option.value)) })
4318
4364
  ] })
4319
4365
  ] }),
4320
- /* @__PURE__ */ jsx37("div", { className: "grid auto-rows-min gap-4 md:grid-cols-3", children: isLoading ? /* @__PURE__ */ jsxs32(Fragment11, { children: [
4366
+ /* @__PURE__ */ jsx37("div", { className: "grid auto-rows-min gap-4 md:grid-cols-3", children: isLoading ? /* @__PURE__ */ jsxs31(Fragment10, { children: [
4321
4367
  /* @__PURE__ */ jsx37(StatCardSkeleton, {}),
4322
4368
  /* @__PURE__ */ jsx37(StatCardSkeleton, {}),
4323
4369
  /* @__PURE__ */ jsx37(StatCardSkeleton, {})
4324
- ] }) : /* @__PURE__ */ jsxs32(Fragment11, { children: [
4325
- /* @__PURE__ */ jsx37(Link3, { to: "/requests", className: "block", children: /* @__PURE__ */ jsxs32(Card15, { className: "transition-colors hover:bg-muted/50 cursor-pointer", children: [
4326
- /* @__PURE__ */ jsxs32(CardHeader13, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
4370
+ ] }) : /* @__PURE__ */ jsxs31(Fragment10, { children: [
4371
+ /* @__PURE__ */ jsx37(Link3, { to: "/requests", className: "block", children: /* @__PURE__ */ jsxs31(Card15, { className: "transition-colors hover:bg-muted/50 cursor-pointer", children: [
4372
+ /* @__PURE__ */ jsxs31(CardHeader13, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
4327
4373
  /* @__PURE__ */ jsx37(CardTitle13, { className: "text-sm font-medium", children: "Total Requests" }),
4328
4374
  /* @__PURE__ */ jsx37(Activity2, { className: "h-4 w-4 text-muted-foreground" })
4329
4375
  ] }),
4330
- /* @__PURE__ */ jsx37(CardContent14, { children: /* @__PURE__ */ jsxs32("div", { className: "flex items-end justify-between", children: [
4331
- /* @__PURE__ */ jsxs32("div", { children: [
4332
- /* @__PURE__ */ jsx37("div", { className: "text-2xl font-bold", children: (_b = stats == null ? void 0 : stats.totalRequests.toLocaleString()) != null ? _b : "\u2014" }),
4376
+ /* @__PURE__ */ jsx37(CardContent14, { children: /* @__PURE__ */ jsxs31("div", { className: "flex items-end justify-between", children: [
4377
+ /* @__PURE__ */ jsxs31("div", { children: [
4378
+ /* @__PURE__ */ jsx37("div", { className: "text-2xl font-bold", children: stats?.totalRequests.toLocaleString() ?? "\u2014" }),
4333
4379
  /* @__PURE__ */ jsx37("p", { className: "text-xs text-muted-foreground", children: selectedLabel })
4334
4380
  ] }),
4335
4381
  /* @__PURE__ */ jsx37(Sparkline, { data: usageData.slice(-7).map((d) => ({ value: d.requests })), color: "var(--chart-1)" })
4336
4382
  ] }) })
4337
4383
  ] }) }),
4338
- /* @__PURE__ */ jsx37(Link3, { to: "/requests", className: "block", children: /* @__PURE__ */ jsxs32(Card15, { className: "transition-colors hover:bg-muted/50 cursor-pointer", children: [
4339
- /* @__PURE__ */ jsxs32(CardHeader13, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
4384
+ /* @__PURE__ */ jsx37(Link3, { to: "/requests", className: "block", children: /* @__PURE__ */ jsxs31(Card15, { className: "transition-colors hover:bg-muted/50 cursor-pointer", children: [
4385
+ /* @__PURE__ */ jsxs31(CardHeader13, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
4340
4386
  /* @__PURE__ */ jsx37(CardTitle13, { className: "text-sm font-medium", children: "Total Cost" }),
4341
4387
  /* @__PURE__ */ jsx37(DollarSign2, { className: "h-4 w-4 text-muted-foreground" })
4342
4388
  ] }),
4343
- /* @__PURE__ */ jsx37(CardContent14, { children: /* @__PURE__ */ jsxs32("div", { className: "flex items-end justify-between", children: [
4344
- /* @__PURE__ */ jsxs32("div", { children: [
4345
- /* @__PURE__ */ jsxs32("div", { className: "text-2xl font-bold", children: [
4389
+ /* @__PURE__ */ jsx37(CardContent14, { children: /* @__PURE__ */ jsxs31("div", { className: "flex items-end justify-between", children: [
4390
+ /* @__PURE__ */ jsxs31("div", { children: [
4391
+ /* @__PURE__ */ jsxs31("div", { className: "text-2xl font-bold", children: [
4346
4392
  "$",
4347
- (_c = stats == null ? void 0 : stats.totalCost.toFixed(2)) != null ? _c : "\u2014"
4393
+ stats?.totalCost.toFixed(2) ?? "\u2014"
4348
4394
  ] }),
4349
4395
  /* @__PURE__ */ jsx37("p", { className: "text-xs text-muted-foreground", children: selectedLabel })
4350
4396
  ] }),
4351
4397
  /* @__PURE__ */ jsx37(Sparkline, { data: usageData.slice(-7).map((d) => ({ value: d.requests * 0.02 })), color: "var(--chart-2)" })
4352
4398
  ] }) })
4353
4399
  ] }) }),
4354
- /* @__PURE__ */ jsx37(Link3, { to: "/requests?status=error", className: "block", children: /* @__PURE__ */ jsxs32(Card15, { className: "transition-colors hover:bg-muted/50 cursor-pointer", children: [
4355
- /* @__PURE__ */ jsxs32(CardHeader13, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
4400
+ /* @__PURE__ */ jsx37(Link3, { to: "/requests?status=error", className: "block", children: /* @__PURE__ */ jsxs31(Card15, { className: "transition-colors hover:bg-muted/50 cursor-pointer", children: [
4401
+ /* @__PURE__ */ jsxs31(CardHeader13, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
4356
4402
  /* @__PURE__ */ jsx37(CardTitle13, { className: "text-sm font-medium", children: "Error Count" }),
4357
4403
  /* @__PURE__ */ jsx37(AlertTriangle2, { className: "h-4 w-4 text-muted-foreground" })
4358
4404
  ] }),
4359
- /* @__PURE__ */ jsx37(CardContent14, { children: /* @__PURE__ */ jsxs32("div", { className: "flex items-end justify-between", children: [
4360
- /* @__PURE__ */ jsxs32("div", { children: [
4361
- /* @__PURE__ */ jsx37("div", { className: "text-2xl font-bold", children: (_d = stats == null ? void 0 : stats.errorCount) != null ? _d : "\u2014" }),
4405
+ /* @__PURE__ */ jsx37(CardContent14, { children: /* @__PURE__ */ jsxs31("div", { className: "flex items-end justify-between", children: [
4406
+ /* @__PURE__ */ jsxs31("div", { children: [
4407
+ /* @__PURE__ */ jsx37("div", { className: "text-2xl font-bold", children: stats?.errorCount ?? "\u2014" }),
4362
4408
  /* @__PURE__ */ jsx37("p", { className: "text-xs text-muted-foreground", children: "Failed requests" })
4363
4409
  ] }),
4364
4410
  /* @__PURE__ */ jsx37(
@@ -4373,13 +4419,13 @@ function OverviewPage() {
4373
4419
  ] }) })
4374
4420
  ] }) })
4375
4421
  ] }) }),
4376
- /* @__PURE__ */ jsxs32(Card15, { className: "flex-1", children: [
4377
- /* @__PURE__ */ jsx37(CardHeader13, { children: /* @__PURE__ */ jsxs32(CardTitle13, { children: [
4422
+ /* @__PURE__ */ jsxs31(Card15, { className: "flex-1", children: [
4423
+ /* @__PURE__ */ jsx37(CardHeader13, { children: /* @__PURE__ */ jsxs31(CardTitle13, { children: [
4378
4424
  "API Usage (",
4379
4425
  selectedLabel,
4380
4426
  ")"
4381
4427
  ] }) }),
4382
- /* @__PURE__ */ jsx37(CardContent14, { children: isLoading ? /* @__PURE__ */ jsx37(ChartSkeleton, {}) : usageData.length === 0 ? /* @__PURE__ */ jsx37(EmptyState, {}) : /* @__PURE__ */ jsx37(ChartContainer4, { config: chartConfig, className: "h-[500px] w-full", children: /* @__PURE__ */ jsxs32(BarChart2, { data: usageData, children: [
4428
+ /* @__PURE__ */ jsx37(CardContent14, { children: isLoading ? /* @__PURE__ */ jsx37(ChartSkeleton, {}) : usageData.length === 0 ? /* @__PURE__ */ jsx37(EmptyState, {}) : /* @__PURE__ */ jsx37(ChartContainer4, { config: chartConfig, className: "h-[500px] w-full", children: /* @__PURE__ */ jsxs31(BarChart2, { data: usageData, children: [
4383
4429
  /* @__PURE__ */ jsx37(
4384
4430
  XAxis4,
4385
4431
  {
@@ -4429,8 +4475,8 @@ import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from "
4429
4475
  import { SidebarTrigger as SidebarTrigger6 } from "@mdxui/primitives/sidebar";
4430
4476
  import { Table as Table8, TableBody as TableBody8, TableCell as TableCell8, TableHead as TableHead8, TableHeader as TableHeader8, TableRow as TableRow8 } from "@mdxui/primitives/table";
4431
4477
  import { Activity as Activity3, ChevronDown as ChevronDown2 } from "lucide-react";
4432
- import { useState as useState16 } from "react";
4433
- import { Fragment as Fragment12, jsx as jsx38, jsxs as jsxs33 } from "react/jsx-runtime";
4478
+ import { useState as useState15 } from "react";
4479
+ import { Fragment as Fragment11, jsx as jsx38, jsxs as jsxs32 } from "react/jsx-runtime";
4434
4480
  var statusFilterOptions = [
4435
4481
  { value: "all", label: "All Status" },
4436
4482
  { value: "success", label: "Success (2xx)" },
@@ -4464,10 +4510,9 @@ function formatCost(cost) {
4464
4510
  return `$${cost.toFixed(3)}`;
4465
4511
  }
4466
4512
  function RequestsPage() {
4467
- var _a;
4468
- const [statusFilter, setStatusFilter] = useState16("all");
4469
- const [selectedRequest, setSelectedRequest] = useState16(null);
4470
- const [sheetOpen, setSheetOpen] = useState16(false);
4513
+ const [statusFilter, setStatusFilter] = useState15("all");
4514
+ const [selectedRequest, setSelectedRequest] = useState15(null);
4515
+ const [sheetOpen, setSheetOpen] = useState15(false);
4471
4516
  const filteredRequests = mockRequests.filter((request) => {
4472
4517
  if (statusFilter === "all") return true;
4473
4518
  if (statusFilter === "success") return request.statusCode >= 200 && request.statusCode < 300;
@@ -4479,28 +4524,28 @@ function RequestsPage() {
4479
4524
  setSelectedRequest(request);
4480
4525
  setSheetOpen(true);
4481
4526
  };
4482
- return /* @__PURE__ */ jsxs33(Fragment12, { children: [
4483
- /* @__PURE__ */ jsx38("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs33("div", { className: "flex items-center gap-2 px-4", children: [
4527
+ return /* @__PURE__ */ jsxs32(Fragment11, { children: [
4528
+ /* @__PURE__ */ jsx38("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs32("div", { className: "flex items-center gap-2 px-4", children: [
4484
4529
  /* @__PURE__ */ jsx38(SidebarTrigger6, { className: "-ml-1" }),
4485
4530
  /* @__PURE__ */ jsx38(Separator8, { orientation: "vertical", className: "mr-2 data-[orientation=vertical]:h-4" }),
4486
4531
  /* @__PURE__ */ jsx38(Breadcrumb6, { children: /* @__PURE__ */ jsx38(BreadcrumbList6, { children: /* @__PURE__ */ jsx38(BreadcrumbItem6, { children: /* @__PURE__ */ jsx38(BreadcrumbPage6, { children: "Requests" }) }) }) })
4487
4532
  ] }) }),
4488
- /* @__PURE__ */ jsxs33("div", { className: "flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 pt-0", children: [
4489
- /* @__PURE__ */ jsxs33("div", { className: "flex items-center justify-between", children: [
4490
- /* @__PURE__ */ jsxs33("div", { children: [
4533
+ /* @__PURE__ */ jsxs32("div", { className: "flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 pt-0", children: [
4534
+ /* @__PURE__ */ jsxs32("div", { className: "flex items-center justify-between", children: [
4535
+ /* @__PURE__ */ jsxs32("div", { children: [
4491
4536
  /* @__PURE__ */ jsx38("h1", { className: "text-2xl font-bold", children: "Requests" }),
4492
4537
  /* @__PURE__ */ jsx38("p", { className: "text-muted-foreground", children: "Monitor and debug your API request logs." })
4493
4538
  ] }),
4494
- /* @__PURE__ */ jsxs33(DropdownMenu6, { children: [
4495
- /* @__PURE__ */ jsx38(DropdownMenuTrigger6, { asChild: true, children: /* @__PURE__ */ jsxs33(Button15, { variant: "outline", className: "w-[160px] justify-between", children: [
4496
- (_a = statusFilterOptions.find((o) => o.value === statusFilter)) == null ? void 0 : _a.label,
4539
+ /* @__PURE__ */ jsxs32(DropdownMenu6, { children: [
4540
+ /* @__PURE__ */ jsx38(DropdownMenuTrigger6, { asChild: true, children: /* @__PURE__ */ jsxs32(Button15, { variant: "outline", className: "w-[160px] justify-between", children: [
4541
+ statusFilterOptions.find((o) => o.value === statusFilter)?.label,
4497
4542
  /* @__PURE__ */ jsx38(ChevronDown2, { className: "h-4 w-4 opacity-50" })
4498
4543
  ] }) }),
4499
4544
  /* @__PURE__ */ jsx38(DropdownMenuContent6, { align: "end", className: "w-[160px]", children: statusFilterOptions.map((option) => /* @__PURE__ */ jsx38(DropdownMenuItem6, { onClick: () => setStatusFilter(option.value), children: option.label }, option.value)) })
4500
4545
  ] })
4501
4546
  ] }),
4502
- /* @__PURE__ */ jsx38("div", { className: "rounded-md border", children: /* @__PURE__ */ jsxs33(Table8, { children: [
4503
- /* @__PURE__ */ jsx38(TableHeader8, { children: /* @__PURE__ */ jsxs33(TableRow8, { children: [
4547
+ /* @__PURE__ */ jsx38("div", { className: "rounded-md border", children: /* @__PURE__ */ jsxs32(Table8, { children: [
4548
+ /* @__PURE__ */ jsx38(TableHeader8, { children: /* @__PURE__ */ jsxs32(TableRow8, { children: [
4504
4549
  /* @__PURE__ */ jsx38(TableHead8, { className: "pl-4", children: "Timestamp" }),
4505
4550
  /* @__PURE__ */ jsx38(TableHead8, { children: "Method" }),
4506
4551
  /* @__PURE__ */ jsx38(TableHead8, { children: "Endpoint" }),
@@ -4508,8 +4553,8 @@ function RequestsPage() {
4508
4553
  /* @__PURE__ */ jsx38(TableHead8, { children: "Latency" }),
4509
4554
  /* @__PURE__ */ jsx38(TableHead8, { children: "Cost" })
4510
4555
  ] }) }),
4511
- /* @__PURE__ */ jsxs33(TableBody8, { children: [
4512
- filteredRequests.map((request) => /* @__PURE__ */ jsxs33(TableRow8, { className: "cursor-pointer hover:bg-muted/50", onClick: () => handleRowClick(request), children: [
4556
+ /* @__PURE__ */ jsxs32(TableBody8, { children: [
4557
+ filteredRequests.map((request) => /* @__PURE__ */ jsxs32(TableRow8, { className: "cursor-pointer hover:bg-muted/50", onClick: () => handleRowClick(request), children: [
4513
4558
  /* @__PURE__ */ jsx38(TableCell8, { className: "py-3 pl-4 text-muted-foreground", children: formatTimestamp(request.timestamp) }),
4514
4559
  /* @__PURE__ */ jsx38(TableCell8, { className: "py-3", children: /* @__PURE__ */ jsx38("span", { className: `font-mono text-sm font-medium ${methodColors[request.method] || ""}`, children: request.method }) }),
4515
4560
  /* @__PURE__ */ jsx38(TableCell8, { className: "py-3 font-mono text-sm", children: request.endpoint }),
@@ -4517,9 +4562,9 @@ function RequestsPage() {
4517
4562
  /* @__PURE__ */ jsx38(TableCell8, { className: "py-3 text-muted-foreground", children: formatLatency(request.latency) }),
4518
4563
  /* @__PURE__ */ jsx38(TableCell8, { className: "py-3 text-muted-foreground", children: formatCost(request.cost) })
4519
4564
  ] }, request.id)),
4520
- filteredRequests.length === 0 && /* @__PURE__ */ jsx38(TableRow8, { children: /* @__PURE__ */ jsx38(TableCell8, { colSpan: 6, className: "py-16", children: /* @__PURE__ */ jsxs33("div", { className: "flex flex-col items-center justify-center gap-4 text-center", children: [
4565
+ filteredRequests.length === 0 && /* @__PURE__ */ jsx38(TableRow8, { children: /* @__PURE__ */ jsx38(TableCell8, { colSpan: 6, className: "py-16", children: /* @__PURE__ */ jsxs32("div", { className: "flex flex-col items-center justify-center gap-4 text-center", children: [
4521
4566
  /* @__PURE__ */ jsx38("div", { className: "rounded-full bg-muted p-4", children: /* @__PURE__ */ jsx38(Activity3, { className: "h-8 w-8 text-muted-foreground" }) }),
4522
- /* @__PURE__ */ jsxs33("div", { children: [
4567
+ /* @__PURE__ */ jsxs32("div", { children: [
4523
4568
  /* @__PURE__ */ jsx38("p", { className: "font-medium", children: "No requests found" }),
4524
4569
  /* @__PURE__ */ jsx38("p", { className: "text-sm text-muted-foreground mt-1", children: "No requests match the current filter." })
4525
4570
  ] })
@@ -4527,17 +4572,17 @@ function RequestsPage() {
4527
4572
  ] })
4528
4573
  ] }) })
4529
4574
  ] }),
4530
- /* @__PURE__ */ jsx38(Sheet, { open: sheetOpen, onOpenChange: setSheetOpen, children: /* @__PURE__ */ jsx38(SheetContent, { className: "w-full sm:max-w-lg overflow-y-auto", children: selectedRequest && /* @__PURE__ */ jsxs33(Fragment12, { children: [
4531
- /* @__PURE__ */ jsxs33(SheetHeader, { children: [
4532
- /* @__PURE__ */ jsxs33(SheetTitle, { className: "flex items-center gap-2", children: [
4575
+ /* @__PURE__ */ jsx38(Sheet, { open: sheetOpen, onOpenChange: setSheetOpen, children: /* @__PURE__ */ jsx38(SheetContent, { className: "w-full sm:max-w-lg overflow-y-auto", children: selectedRequest && /* @__PURE__ */ jsxs32(Fragment11, { children: [
4576
+ /* @__PURE__ */ jsxs32(SheetHeader, { children: [
4577
+ /* @__PURE__ */ jsxs32(SheetTitle, { className: "flex items-center gap-2", children: [
4533
4578
  /* @__PURE__ */ jsx38("span", { className: `font-mono ${methodColors[selectedRequest.method] || ""}`, children: selectedRequest.method }),
4534
4579
  /* @__PURE__ */ jsx38("span", { className: "font-mono text-muted-foreground font-normal", children: selectedRequest.endpoint })
4535
4580
  ] }),
4536
- /* @__PURE__ */ jsxs33(SheetDescription, { className: "flex items-center gap-2 text-sm", children: [
4581
+ /* @__PURE__ */ jsxs32(SheetDescription, { className: "flex items-center gap-2 text-sm", children: [
4537
4582
  /* @__PURE__ */ jsx38(StatusBadge, { status: selectedRequest.statusCode }),
4538
4583
  /* @__PURE__ */ jsx38("span", { className: "text-muted-foreground", children: "\u2022" }),
4539
4584
  /* @__PURE__ */ jsx38("span", { children: formatLatency(selectedRequest.latency) }),
4540
- selectedRequest.cost > 0 && /* @__PURE__ */ jsxs33(Fragment12, { children: [
4585
+ selectedRequest.cost > 0 && /* @__PURE__ */ jsxs32(Fragment11, { children: [
4541
4586
  /* @__PURE__ */ jsx38("span", { className: "text-muted-foreground", children: "\u2022" }),
4542
4587
  /* @__PURE__ */ jsx38("span", { children: formatCost(selectedRequest.cost) })
4543
4588
  ] }),
@@ -4545,12 +4590,12 @@ function RequestsPage() {
4545
4590
  /* @__PURE__ */ jsx38("span", { children: formatTimestamp(selectedRequest.timestamp) })
4546
4591
  ] })
4547
4592
  ] }),
4548
- /* @__PURE__ */ jsxs33("div", { className: "mt-6 space-y-6 px-4", children: [
4549
- /* @__PURE__ */ jsxs33("div", { children: [
4593
+ /* @__PURE__ */ jsxs32("div", { className: "mt-6 space-y-6 px-4", children: [
4594
+ /* @__PURE__ */ jsxs32("div", { children: [
4550
4595
  /* @__PURE__ */ jsx38("h4", { className: "text-sm font-semibold mb-2", children: "Request" }),
4551
4596
  /* @__PURE__ */ jsx38(JsonViewer, { data: selectedRequest.requestPayload })
4552
4597
  ] }),
4553
- /* @__PURE__ */ jsxs33("div", { children: [
4598
+ /* @__PURE__ */ jsxs32("div", { children: [
4554
4599
  /* @__PURE__ */ jsx38("h4", { className: "text-sm font-semibold mb-2", children: "Response" }),
4555
4600
  /* @__PURE__ */ jsx38(JsonViewer, { data: selectedRequest.responsePayload })
4556
4601
  ] })
@@ -4560,30 +4605,28 @@ function RequestsPage() {
4560
4605
  }
4561
4606
 
4562
4607
  // src/developer/pages/settings/profile.tsx
4608
+ import { useAuth as useAuth5, UserProfile as UserProfile2 } from "@mdxui/auth";
4563
4609
  import { Breadcrumb as Breadcrumb7, BreadcrumbItem as BreadcrumbItem7, BreadcrumbLink, BreadcrumbList as BreadcrumbList7, BreadcrumbPage as BreadcrumbPage7, BreadcrumbSeparator } from "@mdxui/primitives/breadcrumb";
4564
4610
  import { Separator as Separator9 } from "@mdxui/primitives/separator";
4565
4611
  import { SidebarTrigger as SidebarTrigger7 } from "@mdxui/primitives/sidebar";
4566
- import { useAuth as useAuth6 } from "@workos-inc/authkit-react";
4567
- import { UserProfile as UserProfile2 } from "@workos-inc/widgets";
4568
4612
  import { Link as Link4 } from "react-router-dom";
4569
- import { Fragment as Fragment13, jsx as jsx39, jsxs as jsxs34 } from "react/jsx-runtime";
4613
+ import { Fragment as Fragment12, jsx as jsx39, jsxs as jsxs33 } from "react/jsx-runtime";
4570
4614
  function SettingsProfilePage() {
4571
- var _a, _b;
4572
4615
  const { config } = useDashboard();
4573
- const useMockWidgets = (_b = (_a = config.identity) == null ? void 0 : _a.useMockWidgets) != null ? _b : false;
4574
- const { user, getAccessToken, isLoading } = useAuth6();
4575
- return /* @__PURE__ */ jsxs34(Fragment13, { children: [
4576
- /* @__PURE__ */ jsx39("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs34("div", { className: "flex items-center gap-2 px-4", children: [
4616
+ const useMockWidgets = config.identity?.useMockWidgets ?? false;
4617
+ const { user, getAccessToken, isLoading } = useAuth5();
4618
+ return /* @__PURE__ */ jsxs33(Fragment12, { children: [
4619
+ /* @__PURE__ */ jsx39("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs33("div", { className: "flex items-center gap-2 px-4", children: [
4577
4620
  /* @__PURE__ */ jsx39(SidebarTrigger7, { className: "-ml-1" }),
4578
4621
  /* @__PURE__ */ jsx39(Separator9, { orientation: "vertical", className: "mr-2 data-[orientation=vertical]:h-4" }),
4579
- /* @__PURE__ */ jsx39(Breadcrumb7, { children: /* @__PURE__ */ jsxs34(BreadcrumbList7, { children: [
4622
+ /* @__PURE__ */ jsx39(Breadcrumb7, { children: /* @__PURE__ */ jsxs33(BreadcrumbList7, { children: [
4580
4623
  /* @__PURE__ */ jsx39(BreadcrumbItem7, { className: "hidden md:block", children: /* @__PURE__ */ jsx39(BreadcrumbLink, { asChild: true, children: /* @__PURE__ */ jsx39(Link4, { to: "/settings/profile", children: "Settings" }) }) }),
4581
4624
  /* @__PURE__ */ jsx39(BreadcrumbSeparator, { className: "hidden md:block" }),
4582
4625
  /* @__PURE__ */ jsx39(BreadcrumbItem7, { children: /* @__PURE__ */ jsx39(BreadcrumbPage7, { children: "Profile" }) })
4583
4626
  ] }) })
4584
4627
  ] }) }),
4585
- /* @__PURE__ */ jsxs34("div", { className: "flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 pt-0", children: [
4586
- /* @__PURE__ */ jsxs34("div", { children: [
4628
+ /* @__PURE__ */ jsxs33("div", { className: "flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 pt-0", children: [
4629
+ /* @__PURE__ */ jsxs33("div", { children: [
4587
4630
  /* @__PURE__ */ jsx39("h1", { className: "text-2xl font-bold", children: "Profile" }),
4588
4631
  /* @__PURE__ */ jsx39("p", { className: "text-muted-foreground", children: "Manage your personal information and preferences." })
4589
4632
  ] }),
@@ -4593,27 +4636,24 @@ function SettingsProfilePage() {
4593
4636
  }
4594
4637
 
4595
4638
  // src/developer/pages/settings/security.tsx
4639
+ import { useAuth as useAuth6, UserSecurity } from "@mdxui/auth";
4596
4640
  import { Breadcrumb as Breadcrumb8, BreadcrumbItem as BreadcrumbItem8, BreadcrumbLink as BreadcrumbLink2, BreadcrumbList as BreadcrumbList8, BreadcrumbPage as BreadcrumbPage8, BreadcrumbSeparator as BreadcrumbSeparator2 } from "@mdxui/primitives/breadcrumb";
4597
4641
  import { Separator as Separator10 } from "@mdxui/primitives/separator";
4598
4642
  import { SidebarTrigger as SidebarTrigger8 } from "@mdxui/primitives/sidebar";
4599
- import { useAuth as useAuth7 } from "@workos-inc/authkit-react";
4600
- import { UserSecurity } from "@workos-inc/widgets";
4601
- import { useEffect as useEffect8, useRef as useRef2, useState as useState17 } from "react";
4643
+ import { useEffect as useEffect7, useRef as useRef2, useState as useState16 } from "react";
4602
4644
  import { Link as Link5 } from "react-router-dom";
4603
- import { Fragment as Fragment14, jsx as jsx40, jsxs as jsxs35 } from "react/jsx-runtime";
4645
+ import { Fragment as Fragment13, jsx as jsx40, jsxs as jsxs34 } from "react/jsx-runtime";
4604
4646
  function SettingsSecurityPage() {
4605
- var _a, _b;
4606
4647
  const { config } = useDashboard();
4607
- const useMockWidgets = (_b = (_a = config.identity) == null ? void 0 : _a.useMockWidgets) != null ? _b : false;
4608
- const { user, getAccessToken, isLoading } = useAuth7();
4609
- const [isEmpty, setIsEmpty] = useState17(false);
4648
+ const useMockWidgets = config.identity?.useMockWidgets ?? false;
4649
+ const { user, getAccessToken, isLoading } = useAuth6();
4650
+ const [isEmpty, setIsEmpty] = useState16(false);
4610
4651
  const containerRef = useRef2(null);
4611
- useEffect8(() => {
4652
+ useEffect7(() => {
4612
4653
  if (useMockWidgets || isLoading || !user) return;
4613
4654
  const timer = setTimeout(() => {
4614
- var _a2;
4615
4655
  if (containerRef.current) {
4616
- const content = (_a2 = containerRef.current.textContent) == null ? void 0 : _a2.trim();
4656
+ const content = containerRef.current.textContent?.trim();
4617
4657
  const hasVisibleContent = containerRef.current.querySelector('button, input, [role="button"]');
4618
4658
  if (!content && !hasVisibleContent) {
4619
4659
  setIsEmpty(true);
@@ -4622,18 +4662,18 @@ function SettingsSecurityPage() {
4622
4662
  }, 1e3);
4623
4663
  return () => clearTimeout(timer);
4624
4664
  }, [isLoading, user, useMockWidgets]);
4625
- return /* @__PURE__ */ jsxs35(Fragment14, { children: [
4626
- /* @__PURE__ */ jsx40("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs35("div", { className: "flex items-center gap-2 px-4", children: [
4665
+ return /* @__PURE__ */ jsxs34(Fragment13, { children: [
4666
+ /* @__PURE__ */ jsx40("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs34("div", { className: "flex items-center gap-2 px-4", children: [
4627
4667
  /* @__PURE__ */ jsx40(SidebarTrigger8, { className: "-ml-1" }),
4628
4668
  /* @__PURE__ */ jsx40(Separator10, { orientation: "vertical", className: "mr-2 data-[orientation=vertical]:h-4" }),
4629
- /* @__PURE__ */ jsx40(Breadcrumb8, { children: /* @__PURE__ */ jsxs35(BreadcrumbList8, { children: [
4669
+ /* @__PURE__ */ jsx40(Breadcrumb8, { children: /* @__PURE__ */ jsxs34(BreadcrumbList8, { children: [
4630
4670
  /* @__PURE__ */ jsx40(BreadcrumbItem8, { className: "hidden md:block", children: /* @__PURE__ */ jsx40(BreadcrumbLink2, { asChild: true, children: /* @__PURE__ */ jsx40(Link5, { to: "/settings/profile", children: "Settings" }) }) }),
4631
4671
  /* @__PURE__ */ jsx40(BreadcrumbSeparator2, { className: "hidden md:block" }),
4632
4672
  /* @__PURE__ */ jsx40(BreadcrumbItem8, { children: /* @__PURE__ */ jsx40(BreadcrumbPage8, { children: "Security" }) })
4633
4673
  ] }) })
4634
4674
  ] }) }),
4635
- /* @__PURE__ */ jsxs35("div", { className: "flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 pt-0", children: [
4636
- /* @__PURE__ */ jsxs35("div", { children: [
4675
+ /* @__PURE__ */ jsxs34("div", { className: "flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 pt-0", children: [
4676
+ /* @__PURE__ */ jsxs34("div", { children: [
4637
4677
  /* @__PURE__ */ jsx40("h1", { className: "text-2xl font-bold", children: "Security" }),
4638
4678
  /* @__PURE__ */ jsx40("p", { className: "text-muted-foreground", children: "Manage your password, two-factor authentication, and recovery codes." })
4639
4679
  ] }),
@@ -4643,30 +4683,28 @@ function SettingsSecurityPage() {
4643
4683
  }
4644
4684
 
4645
4685
  // src/developer/pages/settings/sessions.tsx
4686
+ import { useAuth as useAuth7, UserSessions } from "@mdxui/auth";
4646
4687
  import { Breadcrumb as Breadcrumb9, BreadcrumbItem as BreadcrumbItem9, BreadcrumbLink as BreadcrumbLink3, BreadcrumbList as BreadcrumbList9, BreadcrumbPage as BreadcrumbPage9, BreadcrumbSeparator as BreadcrumbSeparator3 } from "@mdxui/primitives/breadcrumb";
4647
4688
  import { Separator as Separator11 } from "@mdxui/primitives/separator";
4648
4689
  import { SidebarTrigger as SidebarTrigger9 } from "@mdxui/primitives/sidebar";
4649
- import { useAuth as useAuth8 } from "@workos-inc/authkit-react";
4650
- import { UserSessions } from "@workos-inc/widgets";
4651
4690
  import { Link as Link6 } from "react-router-dom";
4652
- import { Fragment as Fragment15, jsx as jsx41, jsxs as jsxs36 } from "react/jsx-runtime";
4691
+ import { Fragment as Fragment14, jsx as jsx41, jsxs as jsxs35 } from "react/jsx-runtime";
4653
4692
  function SettingsSessionsPage() {
4654
- var _a, _b;
4655
4693
  const { config } = useDashboard();
4656
- const useMockWidgets = (_b = (_a = config.identity) == null ? void 0 : _a.useMockWidgets) != null ? _b : false;
4657
- const { user, getAccessToken, isLoading } = useAuth8();
4658
- return /* @__PURE__ */ jsxs36(Fragment15, { children: [
4659
- /* @__PURE__ */ jsx41("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs36("div", { className: "flex items-center gap-2 px-4", children: [
4694
+ const useMockWidgets = config.identity?.useMockWidgets ?? false;
4695
+ const { user, getAccessToken, isLoading } = useAuth7();
4696
+ return /* @__PURE__ */ jsxs35(Fragment14, { children: [
4697
+ /* @__PURE__ */ jsx41("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs35("div", { className: "flex items-center gap-2 px-4", children: [
4660
4698
  /* @__PURE__ */ jsx41(SidebarTrigger9, { className: "-ml-1" }),
4661
4699
  /* @__PURE__ */ jsx41(Separator11, { orientation: "vertical", className: "mr-2 data-[orientation=vertical]:h-4" }),
4662
- /* @__PURE__ */ jsx41(Breadcrumb9, { children: /* @__PURE__ */ jsxs36(BreadcrumbList9, { children: [
4700
+ /* @__PURE__ */ jsx41(Breadcrumb9, { children: /* @__PURE__ */ jsxs35(BreadcrumbList9, { children: [
4663
4701
  /* @__PURE__ */ jsx41(BreadcrumbItem9, { className: "hidden md:block", children: /* @__PURE__ */ jsx41(BreadcrumbLink3, { asChild: true, children: /* @__PURE__ */ jsx41(Link6, { to: "/settings/profile", children: "Settings" }) }) }),
4664
4702
  /* @__PURE__ */ jsx41(BreadcrumbSeparator3, { className: "hidden md:block" }),
4665
4703
  /* @__PURE__ */ jsx41(BreadcrumbItem9, { children: /* @__PURE__ */ jsx41(BreadcrumbPage9, { children: "Sessions" }) })
4666
4704
  ] }) })
4667
4705
  ] }) }),
4668
- /* @__PURE__ */ jsxs36("div", { className: "flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 pt-0", children: [
4669
- /* @__PURE__ */ jsxs36("div", { children: [
4706
+ /* @__PURE__ */ jsxs35("div", { className: "flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 pt-0", children: [
4707
+ /* @__PURE__ */ jsxs35("div", { children: [
4670
4708
  /* @__PURE__ */ jsx41("h1", { className: "text-2xl font-bold", children: "Sessions" }),
4671
4709
  /* @__PURE__ */ jsx41("p", { className: "text-muted-foreground", children: "View and manage your active sessions across devices." })
4672
4710
  ] }),
@@ -4676,35 +4714,72 @@ function SettingsSessionsPage() {
4676
4714
  }
4677
4715
 
4678
4716
  // src/developer/pages/team.tsx
4679
- import { Breadcrumb as Breadcrumb10, BreadcrumbItem as BreadcrumbItem10, BreadcrumbList as BreadcrumbList10, BreadcrumbPage as BreadcrumbPage10 } from "@mdxui/primitives/breadcrumb";
4717
+ import { UsersManagement, useAuth as useAuth8 } from "@mdxui/auth";
4718
+ import {
4719
+ Breadcrumb as Breadcrumb10,
4720
+ BreadcrumbItem as BreadcrumbItem10,
4721
+ BreadcrumbList as BreadcrumbList10,
4722
+ BreadcrumbPage as BreadcrumbPage10
4723
+ } from "@mdxui/primitives/breadcrumb";
4680
4724
  import { Separator as Separator12 } from "@mdxui/primitives/separator";
4681
4725
  import { SidebarTrigger as SidebarTrigger10 } from "@mdxui/primitives/sidebar";
4682
- import { useAuth as useAuth9 } from "@workos-inc/authkit-react";
4683
- import { UsersManagement } from "@workos-inc/widgets";
4684
- import { Fragment as Fragment16, jsx as jsx42, jsxs as jsxs37 } from "react/jsx-runtime";
4685
- function TeamPage() {
4686
- var _a, _b;
4726
+ import { Fragment as Fragment15, jsx as jsx42, jsxs as jsxs36 } from "react/jsx-runtime";
4727
+ function TeamPage({
4728
+ useMockWidgets: useMockWidgetsProp,
4729
+ hideHeader = false,
4730
+ className
4731
+ } = {}) {
4687
4732
  const { config } = useDashboard();
4688
- const useMockWidgets = (_b = (_a = config.identity) == null ? void 0 : _a.useMockWidgets) != null ? _b : false;
4689
- const { user, getAccessToken, isLoading, organizationId, permissions } = useAuth9();
4690
- const hasOrganization = !!organizationId;
4691
- const canManageTeam = hasOrganization && (permissions == null ? void 0 : permissions.includes("widgets:users-table:manage"));
4692
- const loading = !useMockWidgets && isLoading;
4693
- return /* @__PURE__ */ jsxs37(Fragment16, { children: [
4694
- /* @__PURE__ */ jsx42("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs37("div", { className: "flex items-center gap-2 px-4", children: [
4733
+ const useMockWidgets = config.identity?.useMockWidgets ?? useMockWidgetsProp ?? false;
4734
+ return /* @__PURE__ */ jsxs36(Fragment15, { children: [
4735
+ !hideHeader && /* @__PURE__ */ jsx42("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs36("div", { className: "flex items-center gap-2 px-4", children: [
4695
4736
  /* @__PURE__ */ jsx42(SidebarTrigger10, { className: "-ml-1" }),
4696
- /* @__PURE__ */ jsx42(Separator12, { orientation: "vertical", className: "mr-2 data-[orientation=vertical]:h-4" }),
4737
+ /* @__PURE__ */ jsx42(
4738
+ Separator12,
4739
+ {
4740
+ orientation: "vertical",
4741
+ className: "mr-2 data-[orientation=vertical]:h-4"
4742
+ }
4743
+ ),
4697
4744
  /* @__PURE__ */ jsx42(Breadcrumb10, { children: /* @__PURE__ */ jsx42(BreadcrumbList10, { children: /* @__PURE__ */ jsx42(BreadcrumbItem10, { children: /* @__PURE__ */ jsx42(BreadcrumbPage10, { children: "Team" }) }) }) })
4698
4745
  ] }) }),
4699
- /* @__PURE__ */ jsxs37("div", { className: "flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 pt-0", children: [
4700
- /* @__PURE__ */ jsxs37("div", { children: [
4701
- /* @__PURE__ */ jsx42("h1", { className: "text-2xl font-bold", children: "Team" }),
4702
- /* @__PURE__ */ jsx42("p", { className: "text-muted-foreground", children: "Manage your team members and their permissions." })
4703
- ] }),
4704
- useMockWidgets ? /* @__PURE__ */ jsx42(MockUsersManagement, {}) : loading ? /* @__PURE__ */ jsx42("div", { className: "flex items-center justify-center py-12 text-muted-foreground", children: "Loading..." }) : !user ? /* @__PURE__ */ jsx42("div", { className: "flex items-center justify-center rounded-md border border-dashed py-24", children: /* @__PURE__ */ jsx42("p", { className: "text-muted-foreground text-sm", children: "Please sign in to manage your team." }) }) : !hasOrganization ? /* @__PURE__ */ jsx42("div", { className: "flex items-center justify-center rounded-md border border-dashed py-24", children: /* @__PURE__ */ jsx42("p", { className: "text-muted-foreground text-sm", children: "You need to be part of an organization to manage team members." }) }) : !canManageTeam ? /* @__PURE__ */ jsx42("div", { className: "flex items-center justify-center rounded-md border border-dashed py-24", children: /* @__PURE__ */ jsx42("p", { className: "text-muted-foreground text-sm", children: "You need admin permissions to manage team members." }) }) : /* @__PURE__ */ jsx42(UsersManagement, { authToken: getAccessToken })
4705
- ] })
4746
+ /* @__PURE__ */ jsxs36(
4747
+ "div",
4748
+ {
4749
+ className: `flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 ${hideHeader ? "" : "pt-0"} ${className ?? ""}`,
4750
+ children: [
4751
+ /* @__PURE__ */ jsxs36("div", { children: [
4752
+ /* @__PURE__ */ jsx42("h1", { className: "text-2xl font-bold", children: "Team" }),
4753
+ /* @__PURE__ */ jsx42("p", { className: "text-muted-foreground", children: "Manage your team members and their permissions." })
4754
+ ] }),
4755
+ /* @__PURE__ */ jsx42(TeamPageContent, { useMockWidgets })
4756
+ ]
4757
+ }
4758
+ )
4706
4759
  ] });
4707
4760
  }
4761
+ function TeamPageContent({ useMockWidgets }) {
4762
+ const { user, getAccessToken, isLoading, organizationId, permissions } = useAuth8();
4763
+ const hasOrganization = !!organizationId;
4764
+ const canManageTeam = hasOrganization && permissions?.includes("widgets:users-table:manage");
4765
+ const loading = !useMockWidgets && isLoading;
4766
+ if (loading) {
4767
+ return /* @__PURE__ */ jsx42("div", { className: "flex items-center justify-center py-12 text-muted-foreground", children: "Loading..." });
4768
+ }
4769
+ if (!user) {
4770
+ return /* @__PURE__ */ jsx42("div", { className: "flex items-center justify-center rounded-md border border-dashed py-24", children: /* @__PURE__ */ jsx42("p", { className: "text-muted-foreground text-sm", children: "Please sign in to manage your team." }) });
4771
+ }
4772
+ if (!hasOrganization) {
4773
+ return /* @__PURE__ */ jsx42("div", { className: "flex items-center justify-center rounded-md border border-dashed py-24", children: /* @__PURE__ */ jsx42("p", { className: "text-muted-foreground text-sm", children: "You need to be part of an organization to manage team members." }) });
4774
+ }
4775
+ if (!canManageTeam) {
4776
+ return /* @__PURE__ */ jsx42("div", { className: "flex items-center justify-center rounded-md border border-dashed py-24", children: /* @__PURE__ */ jsx42("p", { className: "text-muted-foreground text-sm", children: "You need admin permissions to manage team members." }) });
4777
+ }
4778
+ if (useMockWidgets) {
4779
+ return /* @__PURE__ */ jsx42(MockUsersManagement, {});
4780
+ }
4781
+ return /* @__PURE__ */ jsx42(UsersManagement, { authToken: getAccessToken });
4782
+ }
4708
4783
 
4709
4784
  // src/developer/pages/vault.tsx
4710
4785
  import { Breadcrumb as Breadcrumb11, BreadcrumbItem as BreadcrumbItem11, BreadcrumbList as BreadcrumbList11, BreadcrumbPage as BreadcrumbPage11 } from "@mdxui/primitives/breadcrumb";
@@ -4712,9 +4787,9 @@ import { Button as Button16 } from "@mdxui/primitives/button";
4712
4787
  import { Separator as Separator13 } from "@mdxui/primitives/separator";
4713
4788
  import { SidebarTrigger as SidebarTrigger11 } from "@mdxui/primitives/sidebar";
4714
4789
  import { Plus as Plus6 } from "lucide-react";
4715
- import { useState as useState18 } from "react";
4790
+ import { useState as useState17 } from "react";
4716
4791
  import { toast as toast6 } from "sonner";
4717
- import { Fragment as Fragment17, jsx as jsx43, jsxs as jsxs38 } from "react/jsx-runtime";
4792
+ import { Fragment as Fragment16, jsx as jsx43, jsxs as jsxs37 } from "react/jsx-runtime";
4718
4793
  var pendingCredentialRequest = {
4719
4794
  id: "stripe",
4720
4795
  name: "Stripe",
@@ -4725,14 +4800,14 @@ var pendingCredentialRequest = {
4725
4800
  ]
4726
4801
  };
4727
4802
  function VaultPage() {
4728
- const [items, setItems] = useState18(mockVaultItems);
4729
- const [addModalOpen, setAddModalOpen] = useState18(false);
4730
- const [pendingIntegration, setPendingIntegration] = useState18(null);
4803
+ const [items, setItems] = useState17(mockVaultItems);
4804
+ const [addModalOpen, setAddModalOpen] = useState17(false);
4805
+ const [pendingIntegration, setPendingIntegration] = useState17(null);
4731
4806
  const handleOpenAddModal = () => {
4732
4807
  setPendingIntegration(pendingCredentialRequest);
4733
4808
  setAddModalOpen(true);
4734
4809
  };
4735
- const handleAdd = (credentials) => __async(null, null, function* () {
4810
+ const handleAdd = async (_credentials) => {
4736
4811
  if (!pendingIntegration) return;
4737
4812
  const newItem = {
4738
4813
  id: Date.now().toString(),
@@ -4744,34 +4819,34 @@ function VaultPage() {
4744
4819
  };
4745
4820
  setItems((prev) => [...prev, newItem]);
4746
4821
  toast6.success(`${pendingIntegration.name} credentials added successfully`);
4747
- });
4822
+ };
4748
4823
  const handleCloseAddModal = () => {
4749
4824
  setAddModalOpen(false);
4750
4825
  setPendingIntegration(null);
4751
4826
  };
4752
- const handleRotate = (id, credentials) => __async(null, null, function* () {
4827
+ const handleRotate = async (id, _credentials) => {
4753
4828
  const item = items.find((i) => i.id === id);
4754
- setItems((prev) => prev.map((i) => i.id === id ? __spreadProps(__spreadValues({}, i), { updatedAt: /* @__PURE__ */ new Date() }) : i));
4755
- toast6.success(`${(item == null ? void 0 : item.name) || "Credentials"} rotated successfully`);
4756
- });
4757
- const handleDelete = (id) => __async(null, null, function* () {
4829
+ setItems((prev) => prev.map((i) => i.id === id ? { ...i, updatedAt: /* @__PURE__ */ new Date() } : i));
4830
+ toast6.success(`${item?.name || "Credentials"} rotated successfully`);
4831
+ };
4832
+ const handleDelete = async (id) => {
4758
4833
  const item = items.find((i) => i.id === id);
4759
4834
  setItems((prev) => prev.filter((i) => i.id !== id));
4760
- toast6.success(`${(item == null ? void 0 : item.name) || "Credentials"} deleted successfully`);
4761
- });
4762
- return /* @__PURE__ */ jsxs38(Fragment17, { children: [
4763
- /* @__PURE__ */ jsx43("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs38("div", { className: "flex items-center gap-2 px-4", children: [
4835
+ toast6.success(`${item?.name || "Credentials"} deleted successfully`);
4836
+ };
4837
+ return /* @__PURE__ */ jsxs37(Fragment16, { children: [
4838
+ /* @__PURE__ */ jsx43("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs37("div", { className: "flex items-center gap-2 px-4", children: [
4764
4839
  /* @__PURE__ */ jsx43(SidebarTrigger11, { className: "-ml-1" }),
4765
4840
  /* @__PURE__ */ jsx43(Separator13, { orientation: "vertical", className: "mr-2 data-[orientation=vertical]:h-4" }),
4766
4841
  /* @__PURE__ */ jsx43(Breadcrumb11, { children: /* @__PURE__ */ jsx43(BreadcrumbList11, { children: /* @__PURE__ */ jsx43(BreadcrumbItem11, { children: /* @__PURE__ */ jsx43(BreadcrumbPage11, { children: "Vault" }) }) }) })
4767
4842
  ] }) }),
4768
- /* @__PURE__ */ jsxs38("div", { className: "flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 pt-0", children: [
4769
- /* @__PURE__ */ jsxs38("div", { className: "flex items-center justify-between", children: [
4770
- /* @__PURE__ */ jsxs38("div", { children: [
4843
+ /* @__PURE__ */ jsxs37("div", { className: "flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 pt-0", children: [
4844
+ /* @__PURE__ */ jsxs37("div", { className: "flex items-center justify-between", children: [
4845
+ /* @__PURE__ */ jsxs37("div", { children: [
4771
4846
  /* @__PURE__ */ jsx43("h1", { className: "text-2xl font-bold", children: "Vault" }),
4772
4847
  /* @__PURE__ */ jsx43("p", { className: "text-muted-foreground", children: "Securely stored credentials for your agents." })
4773
4848
  ] }),
4774
- items.length > 0 && /* @__PURE__ */ jsxs38(Button16, { onClick: handleOpenAddModal, children: [
4849
+ items.length > 0 && /* @__PURE__ */ jsxs37(Button16, { onClick: handleOpenAddModal, children: [
4775
4850
  /* @__PURE__ */ jsx43(Plus6, { className: "h-4 w-4" }),
4776
4851
  "Add Credential"
4777
4852
  ] })
@@ -4821,9 +4896,9 @@ import { Progress as Progress2 } from "@mdxui/primitives/progress";
4821
4896
  import { Separator as Separator14 } from "@mdxui/primitives/separator";
4822
4897
  import { SidebarTrigger as SidebarTrigger12 } from "@mdxui/primitives/sidebar";
4823
4898
  import { Activity as Activity4, AlertTriangle as AlertTriangle3, CheckCircle2 as CheckCircle22, ChevronDown as ChevronDown3, Clock, XCircle } from "lucide-react";
4824
- import { useState as useState19 } from "react";
4899
+ import { useState as useState18 } from "react";
4825
4900
  import { Link as Link7 } from "react-router-dom";
4826
- import { Fragment as Fragment18, jsx as jsx44, jsxs as jsxs39 } from "react/jsx-runtime";
4901
+ import { Fragment as Fragment17, jsx as jsx44, jsxs as jsxs38 } from "react/jsx-runtime";
4827
4902
  var periodOptions = [
4828
4903
  { value: "7d", label: "Last 7 days" },
4829
4904
  { value: "24h", label: "Last 24 hours" },
@@ -4835,93 +4910,93 @@ var periodMultipliers = {
4835
4910
  "30d": 30
4836
4911
  };
4837
4912
  function WebhooksActivityPage() {
4838
- var _a;
4839
- const [period, setPeriod] = useState19("7d");
4913
+ const [period, setPeriod] = useState18("7d");
4840
4914
  const multiplier = periodMultipliers[period];
4841
4915
  const activity = {
4842
4916
  delivered: Math.round(mockWebhookActivity.delivered * multiplier),
4843
4917
  failed: Math.round(mockWebhookActivity.failed * multiplier),
4844
4918
  pending: mockWebhookActivity.pending,
4845
4919
  successRate: mockWebhookActivity.successRate,
4846
- endpointsWithIssues: mockWebhookActivity.endpointsWithIssues.map((ep) => __spreadProps(__spreadValues({}, ep), {
4920
+ endpointsWithIssues: mockWebhookActivity.endpointsWithIssues.map((ep) => ({
4921
+ ...ep,
4847
4922
  failures: Math.round(ep.failures * multiplier)
4848
4923
  }))
4849
4924
  };
4850
4925
  const total = activity.delivered + activity.failed + activity.pending;
4851
- return /* @__PURE__ */ jsxs39(Fragment18, { children: [
4852
- /* @__PURE__ */ jsx44("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-2 px-4", children: [
4926
+ return /* @__PURE__ */ jsxs38(Fragment17, { children: [
4927
+ /* @__PURE__ */ jsx44("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs38("div", { className: "flex items-center gap-2 px-4", children: [
4853
4928
  /* @__PURE__ */ jsx44(SidebarTrigger12, { className: "-ml-1" }),
4854
4929
  /* @__PURE__ */ jsx44(Separator14, { orientation: "vertical", className: "mr-2 data-[orientation=vertical]:h-4" }),
4855
- /* @__PURE__ */ jsx44(Breadcrumb12, { children: /* @__PURE__ */ jsxs39(BreadcrumbList12, { children: [
4930
+ /* @__PURE__ */ jsx44(Breadcrumb12, { children: /* @__PURE__ */ jsxs38(BreadcrumbList12, { children: [
4856
4931
  /* @__PURE__ */ jsx44(BreadcrumbItem12, { children: /* @__PURE__ */ jsx44(BreadcrumbLink4, { asChild: true, children: /* @__PURE__ */ jsx44(Link7, { to: "/webhooks", children: "Webhooks" }) }) }),
4857
4932
  /* @__PURE__ */ jsx44(BreadcrumbSeparator4, {}),
4858
4933
  /* @__PURE__ */ jsx44(BreadcrumbItem12, { children: /* @__PURE__ */ jsx44(BreadcrumbPage12, { children: "Activity" }) })
4859
4934
  ] }) })
4860
4935
  ] }) }),
4861
- /* @__PURE__ */ jsxs39("div", { className: "flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 pt-0", children: [
4862
- /* @__PURE__ */ jsxs39("div", { className: "flex items-center justify-between", children: [
4863
- /* @__PURE__ */ jsxs39("div", { children: [
4936
+ /* @__PURE__ */ jsxs38("div", { className: "flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 pt-0", children: [
4937
+ /* @__PURE__ */ jsxs38("div", { className: "flex items-center justify-between", children: [
4938
+ /* @__PURE__ */ jsxs38("div", { children: [
4864
4939
  /* @__PURE__ */ jsx44("h1", { className: "text-2xl font-bold", children: "Webhook Activity" }),
4865
4940
  /* @__PURE__ */ jsx44("p", { className: "text-muted-foreground", children: "Monitor webhook health and delivery status." })
4866
4941
  ] }),
4867
- /* @__PURE__ */ jsxs39(DropdownMenu7, { children: [
4868
- /* @__PURE__ */ jsx44(DropdownMenuTrigger7, { asChild: true, children: /* @__PURE__ */ jsxs39(Button17, { variant: "outline", className: "w-[160px] justify-between", children: [
4869
- (_a = periodOptions.find((o) => o.value === period)) == null ? void 0 : _a.label,
4942
+ /* @__PURE__ */ jsxs38(DropdownMenu7, { children: [
4943
+ /* @__PURE__ */ jsx44(DropdownMenuTrigger7, { asChild: true, children: /* @__PURE__ */ jsxs38(Button17, { variant: "outline", className: "w-[160px] justify-between", children: [
4944
+ periodOptions.find((o) => o.value === period)?.label,
4870
4945
  /* @__PURE__ */ jsx44(ChevronDown3, { className: "h-4 w-4 opacity-50" })
4871
4946
  ] }) }),
4872
4947
  /* @__PURE__ */ jsx44(DropdownMenuContent7, { align: "end", className: "w-[160px]", children: periodOptions.map((option) => /* @__PURE__ */ jsx44(DropdownMenuItem7, { onClick: () => setPeriod(option.value), children: option.label }, option.value)) })
4873
4948
  ] })
4874
4949
  ] }),
4875
- total === 0 ? /* @__PURE__ */ jsx44(Card16, { children: /* @__PURE__ */ jsx44(CardContent15, { className: "py-16", children: /* @__PURE__ */ jsxs39("div", { className: "flex flex-col items-center justify-center gap-4 text-center", children: [
4950
+ total === 0 ? /* @__PURE__ */ jsx44(Card16, { children: /* @__PURE__ */ jsx44(CardContent15, { className: "py-16", children: /* @__PURE__ */ jsxs38("div", { className: "flex flex-col items-center justify-center gap-4 text-center", children: [
4876
4951
  /* @__PURE__ */ jsx44("div", { className: "rounded-full bg-muted p-4", children: /* @__PURE__ */ jsx44(Activity4, { className: "h-8 w-8 text-muted-foreground" }) }),
4877
- /* @__PURE__ */ jsxs39("div", { children: [
4952
+ /* @__PURE__ */ jsxs38("div", { children: [
4878
4953
  /* @__PURE__ */ jsx44("p", { className: "font-medium", children: "No activity yet" }),
4879
4954
  /* @__PURE__ */ jsx44("p", { className: "text-sm text-muted-foreground mt-1", children: "Webhook activity will appear here once you start receiving events." })
4880
4955
  ] })
4881
- ] }) }) }) : /* @__PURE__ */ jsxs39(Fragment18, { children: [
4882
- /* @__PURE__ */ jsxs39("div", { className: "grid gap-4 md:grid-cols-3", children: [
4883
- /* @__PURE__ */ jsxs39(Card16, { children: [
4884
- /* @__PURE__ */ jsxs39(CardHeader14, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
4956
+ ] }) }) }) : /* @__PURE__ */ jsxs38(Fragment17, { children: [
4957
+ /* @__PURE__ */ jsxs38("div", { className: "grid gap-4 md:grid-cols-3", children: [
4958
+ /* @__PURE__ */ jsxs38(Card16, { children: [
4959
+ /* @__PURE__ */ jsxs38(CardHeader14, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
4885
4960
  /* @__PURE__ */ jsx44(CardTitle14, { className: "text-sm font-medium", children: "Delivered" }),
4886
4961
  /* @__PURE__ */ jsx44(CheckCircle22, { className: "h-4 w-4 text-success" })
4887
4962
  ] }),
4888
- /* @__PURE__ */ jsxs39(CardContent15, { children: [
4963
+ /* @__PURE__ */ jsxs38(CardContent15, { children: [
4889
4964
  /* @__PURE__ */ jsx44("div", { className: "text-2xl font-bold", children: activity.delivered.toLocaleString() }),
4890
- /* @__PURE__ */ jsxs39("p", { className: "text-xs text-muted-foreground", children: [
4965
+ /* @__PURE__ */ jsxs38("p", { className: "text-xs text-muted-foreground", children: [
4891
4966
  (activity.delivered / total * 100).toFixed(1),
4892
4967
  "% of total"
4893
4968
  ] })
4894
4969
  ] })
4895
4970
  ] }),
4896
- /* @__PURE__ */ jsxs39(Card16, { children: [
4897
- /* @__PURE__ */ jsxs39(CardHeader14, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
4971
+ /* @__PURE__ */ jsxs38(Card16, { children: [
4972
+ /* @__PURE__ */ jsxs38(CardHeader14, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
4898
4973
  /* @__PURE__ */ jsx44(CardTitle14, { className: "text-sm font-medium", children: "Failed" }),
4899
4974
  /* @__PURE__ */ jsx44(XCircle, { className: "h-4 w-4 text-destructive" })
4900
4975
  ] }),
4901
- /* @__PURE__ */ jsxs39(CardContent15, { children: [
4976
+ /* @__PURE__ */ jsxs38(CardContent15, { children: [
4902
4977
  /* @__PURE__ */ jsx44("div", { className: "text-2xl font-bold", children: activity.failed.toLocaleString() }),
4903
- /* @__PURE__ */ jsxs39("p", { className: "text-xs text-muted-foreground", children: [
4978
+ /* @__PURE__ */ jsxs38("p", { className: "text-xs text-muted-foreground", children: [
4904
4979
  (activity.failed / total * 100).toFixed(1),
4905
4980
  "% of total"
4906
4981
  ] })
4907
4982
  ] })
4908
4983
  ] }),
4909
- /* @__PURE__ */ jsxs39(Card16, { children: [
4910
- /* @__PURE__ */ jsxs39(CardHeader14, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
4984
+ /* @__PURE__ */ jsxs38(Card16, { children: [
4985
+ /* @__PURE__ */ jsxs38(CardHeader14, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
4911
4986
  /* @__PURE__ */ jsx44(CardTitle14, { className: "text-sm font-medium", children: "Pending" }),
4912
4987
  /* @__PURE__ */ jsx44(Clock, { className: "h-4 w-4 text-warning" })
4913
4988
  ] }),
4914
- /* @__PURE__ */ jsxs39(CardContent15, { children: [
4989
+ /* @__PURE__ */ jsxs38(CardContent15, { children: [
4915
4990
  /* @__PURE__ */ jsx44("div", { className: "text-2xl font-bold", children: activity.pending.toLocaleString() }),
4916
4991
  /* @__PURE__ */ jsx44("p", { className: "text-xs text-muted-foreground", children: "Waiting for delivery" })
4917
4992
  ] })
4918
4993
  ] })
4919
4994
  ] }),
4920
- /* @__PURE__ */ jsxs39(Card16, { children: [
4995
+ /* @__PURE__ */ jsxs38(Card16, { children: [
4921
4996
  /* @__PURE__ */ jsx44(CardHeader14, { children: /* @__PURE__ */ jsx44(CardTitle14, { className: "text-sm font-medium", children: "Delivery Success Rate" }) }),
4922
- /* @__PURE__ */ jsxs39(CardContent15, { children: [
4923
- /* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-4", children: [
4924
- /* @__PURE__ */ jsxs39(
4997
+ /* @__PURE__ */ jsxs38(CardContent15, { children: [
4998
+ /* @__PURE__ */ jsxs38("div", { className: "flex items-center gap-4", children: [
4999
+ /* @__PURE__ */ jsxs38(
4925
5000
  "div",
4926
5001
  {
4927
5002
  className: cn7(
@@ -4945,7 +5020,7 @@ function WebhooksActivityPage() {
4945
5020
  }
4946
5021
  ) })
4947
5022
  ] }),
4948
- /* @__PURE__ */ jsxs39("p", { className: "text-sm text-muted-foreground mt-2", children: [
5023
+ /* @__PURE__ */ jsxs38("p", { className: "text-sm text-muted-foreground mt-2", children: [
4949
5024
  activity.delivered.toLocaleString(),
4950
5025
  " of ",
4951
5026
  total.toLocaleString(),
@@ -4953,19 +5028,19 @@ function WebhooksActivityPage() {
4953
5028
  ] })
4954
5029
  ] })
4955
5030
  ] }),
4956
- activity.endpointsWithIssues.length > 0 && /* @__PURE__ */ jsxs39(Card16, { children: [
4957
- /* @__PURE__ */ jsx44(CardHeader14, { children: /* @__PURE__ */ jsxs39(CardTitle14, { className: "text-sm font-medium flex items-center gap-2", children: [
5031
+ activity.endpointsWithIssues.length > 0 && /* @__PURE__ */ jsxs38(Card16, { children: [
5032
+ /* @__PURE__ */ jsx44(CardHeader14, { children: /* @__PURE__ */ jsxs38(CardTitle14, { className: "text-sm font-medium flex items-center gap-2", children: [
4958
5033
  /* @__PURE__ */ jsx44(AlertTriangle3, { className: "h-4 w-4 text-warning" }),
4959
5034
  "Endpoints with Issues"
4960
5035
  ] }) }),
4961
- /* @__PURE__ */ jsx44(CardContent15, { children: /* @__PURE__ */ jsx44("div", { className: "space-y-3", children: activity.endpointsWithIssues.map((endpoint) => /* @__PURE__ */ jsxs39(
5036
+ /* @__PURE__ */ jsx44(CardContent15, { children: /* @__PURE__ */ jsx44("div", { className: "space-y-3", children: activity.endpointsWithIssues.map((endpoint) => /* @__PURE__ */ jsxs38(
4962
5037
  "div",
4963
5038
  {
4964
5039
  className: "flex items-center justify-between p-3 rounded-md bg-muted/50",
4965
5040
  children: [
4966
5041
  /* @__PURE__ */ jsx44("span", { className: "font-mono text-sm truncate flex-1", children: endpoint.url }),
4967
- /* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-4 ml-4", children: [
4968
- /* @__PURE__ */ jsxs39("span", { className: "text-sm text-destructive font-medium", children: [
5042
+ /* @__PURE__ */ jsxs38("div", { className: "flex items-center gap-4 ml-4", children: [
5043
+ /* @__PURE__ */ jsxs38("span", { className: "text-sm text-destructive font-medium", children: [
4969
5044
  endpoint.failures,
4970
5045
  " failures"
4971
5046
  ] }),
@@ -5002,10 +5077,10 @@ import { Separator as Separator15 } from "@mdxui/primitives/separator";
5002
5077
  import { SidebarTrigger as SidebarTrigger13 } from "@mdxui/primitives/sidebar";
5003
5078
  import { Switch as Switch2 } from "@mdxui/primitives/switch";
5004
5079
  import { Check as Check4, Circle, Copy as Copy4, Link2 as Link22, MoreHorizontal as MoreHorizontal5, Pencil as Pencil2, Plus as Plus7, RefreshCw, Trash2 as Trash25 } from "lucide-react";
5005
- import { useState as useState20 } from "react";
5080
+ import { useState as useState19 } from "react";
5006
5081
  import { Link as Link8 } from "react-router-dom";
5007
5082
  import { toast as toast7 } from "sonner";
5008
- import { Fragment as Fragment19, jsx as jsx45, jsxs as jsxs40 } from "react/jsx-runtime";
5083
+ import { Fragment as Fragment18, jsx as jsx45, jsxs as jsxs39 } from "react/jsx-runtime";
5009
5084
  function formatRelativeTime(timestamp) {
5010
5085
  if (!timestamp) return "Never";
5011
5086
  const date = new Date(timestamp);
@@ -5026,44 +5101,79 @@ var eventsByCategory = mockWebhookEvents.reduce((acc, event) => {
5026
5101
  acc[event.category].push(event);
5027
5102
  return acc;
5028
5103
  }, {});
5029
- function WebhooksEndpointsPage() {
5030
- const [endpoints, setEndpoints] = useState20(mockWebhookEndpoints);
5031
- const [createDialogOpen, setCreateDialogOpen] = useState20(false);
5032
- const [editDialogOpen, setEditDialogOpen] = useState20(false);
5033
- const [deleteDialogOpen, setDeleteDialogOpen] = useState20(false);
5034
- const [selectedEndpoint, setSelectedEndpoint] = useState20(null);
5035
- const [copiedSecret, setCopiedSecret] = useState20(null);
5036
- const [formUrl, setFormUrl] = useState20("");
5037
- const [formEvents, setFormEvents] = useState20([]);
5038
- const [formEnabled, setFormEnabled] = useState20(true);
5104
+ function WebhooksEndpointsPage({
5105
+ endpoints: initialEndpoints,
5106
+ onCreateEndpoint,
5107
+ onUpdateEndpoint,
5108
+ onDeleteEndpoint,
5109
+ hideHeader = false,
5110
+ className
5111
+ } = {}) {
5112
+ const [endpoints, setEndpoints] = useState19(initialEndpoints ?? mockWebhookEndpoints);
5113
+ const [createDialogOpen, setCreateDialogOpen] = useState19(false);
5114
+ const [editDialogOpen, setEditDialogOpen] = useState19(false);
5115
+ const [deleteDialogOpen, setDeleteDialogOpen] = useState19(false);
5116
+ const [selectedEndpoint, setSelectedEndpoint] = useState19(null);
5117
+ const [copiedSecret, setCopiedSecret] = useState19(null);
5118
+ const [formUrl, setFormUrl] = useState19("");
5119
+ const [formEvents, setFormEvents] = useState19([]);
5120
+ const [formEnabled, setFormEnabled] = useState19(true);
5039
5121
  const resetForm = () => {
5040
5122
  setFormUrl("");
5041
5123
  setFormEvents([]);
5042
5124
  setFormEnabled(true);
5043
5125
  };
5044
- const handleCreate = () => {
5045
- const newEndpoint = {
5046
- id: `ep_${Date.now()}`,
5047
- url: formUrl,
5048
- events: formEvents,
5049
- lastDelivery: null,
5050
- status: formEnabled ? "active" : "disabled",
5051
- secret: `whsec_${Math.random().toString(36).substring(2, 15)}`,
5052
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
5053
- failureCount: 0
5054
- };
5055
- setEndpoints([...endpoints, newEndpoint]);
5126
+ const handleCreate = async () => {
5127
+ if (onCreateEndpoint) {
5128
+ try {
5129
+ const result = await onCreateEndpoint({ url: formUrl, events: formEvents, enabled: formEnabled });
5130
+ const newEndpoint = {
5131
+ id: result.id,
5132
+ url: formUrl,
5133
+ events: formEvents,
5134
+ lastDelivery: null,
5135
+ status: formEnabled ? "active" : "disabled",
5136
+ secret: result.secret,
5137
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
5138
+ failureCount: 0
5139
+ };
5140
+ setEndpoints([...endpoints, newEndpoint]);
5141
+ } catch {
5142
+ toast7.error("Failed to create endpoint");
5143
+ return;
5144
+ }
5145
+ } else {
5146
+ const newEndpoint = {
5147
+ id: `ep_${Date.now()}`,
5148
+ url: formUrl,
5149
+ events: formEvents,
5150
+ lastDelivery: null,
5151
+ status: formEnabled ? "active" : "disabled",
5152
+ secret: `whsec_${Math.random().toString(36).substring(2, 15)}`,
5153
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
5154
+ failureCount: 0
5155
+ };
5156
+ setEndpoints([...endpoints, newEndpoint]);
5157
+ }
5056
5158
  setCreateDialogOpen(false);
5057
5159
  resetForm();
5058
5160
  toast7.success("Endpoint created", {
5059
5161
  description: "Your webhook endpoint has been created successfully."
5060
5162
  });
5061
5163
  };
5062
- const handleEdit = () => {
5164
+ const handleEdit = async () => {
5063
5165
  if (!selectedEndpoint) return;
5166
+ if (onUpdateEndpoint) {
5167
+ try {
5168
+ await onUpdateEndpoint(selectedEndpoint.id, { url: formUrl, events: formEvents, enabled: formEnabled });
5169
+ } catch {
5170
+ toast7.error("Failed to update endpoint");
5171
+ return;
5172
+ }
5173
+ }
5064
5174
  setEndpoints(
5065
5175
  endpoints.map(
5066
- (ep) => ep.id === selectedEndpoint.id ? __spreadProps(__spreadValues({}, ep), { url: formUrl, events: formEvents, status: formEnabled ? "active" : "disabled" }) : ep
5176
+ (ep) => ep.id === selectedEndpoint.id ? { ...ep, url: formUrl, events: formEvents, status: formEnabled ? "active" : "disabled" } : ep
5067
5177
  )
5068
5178
  );
5069
5179
  setEditDialogOpen(false);
@@ -5073,8 +5183,16 @@ function WebhooksEndpointsPage() {
5073
5183
  description: "Your webhook endpoint has been updated successfully."
5074
5184
  });
5075
5185
  };
5076
- const handleDelete = () => {
5186
+ const handleDelete = async () => {
5077
5187
  if (!selectedEndpoint) return;
5188
+ if (onDeleteEndpoint) {
5189
+ try {
5190
+ await onDeleteEndpoint(selectedEndpoint.id);
5191
+ } catch {
5192
+ toast7.error("Failed to delete endpoint");
5193
+ return;
5194
+ }
5195
+ }
5078
5196
  setEndpoints(endpoints.filter((ep) => ep.id !== selectedEndpoint.id));
5079
5197
  setDeleteDialogOpen(false);
5080
5198
  setSelectedEndpoint(null);
@@ -5093,12 +5211,12 @@ function WebhooksEndpointsPage() {
5093
5211
  setSelectedEndpoint(endpoint);
5094
5212
  setDeleteDialogOpen(true);
5095
5213
  };
5096
- const handleCopySecret = (endpoint) => __async(null, null, function* () {
5097
- yield navigator.clipboard.writeText(endpoint.secret);
5214
+ const handleCopySecret = async (endpoint) => {
5215
+ await navigator.clipboard.writeText(endpoint.secret);
5098
5216
  setCopiedSecret(endpoint.id);
5099
5217
  setTimeout(() => setCopiedSecret(null), 2e3);
5100
5218
  toast7.success("Secret copied to clipboard");
5101
- });
5219
+ };
5102
5220
  const toggleEvent = (eventName) => {
5103
5221
  if (formEvents.includes(eventName)) {
5104
5222
  setFormEvents(formEvents.filter((e) => e !== eventName));
@@ -5106,55 +5224,55 @@ function WebhooksEndpointsPage() {
5106
5224
  setFormEvents([...formEvents, eventName]);
5107
5225
  }
5108
5226
  };
5109
- return /* @__PURE__ */ jsxs40(Fragment19, { children: [
5110
- /* @__PURE__ */ jsx45("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs40("div", { className: "flex items-center gap-2 px-4", children: [
5227
+ return /* @__PURE__ */ jsxs39(Fragment18, { children: [
5228
+ !hideHeader && /* @__PURE__ */ jsx45("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-2 px-4", children: [
5111
5229
  /* @__PURE__ */ jsx45(SidebarTrigger13, { className: "-ml-1" }),
5112
5230
  /* @__PURE__ */ jsx45(Separator15, { orientation: "vertical", className: "mr-2 data-[orientation=vertical]:h-4" }),
5113
- /* @__PURE__ */ jsx45(Breadcrumb13, { children: /* @__PURE__ */ jsxs40(BreadcrumbList13, { children: [
5231
+ /* @__PURE__ */ jsx45(Breadcrumb13, { children: /* @__PURE__ */ jsxs39(BreadcrumbList13, { children: [
5114
5232
  /* @__PURE__ */ jsx45(BreadcrumbItem13, { children: /* @__PURE__ */ jsx45(BreadcrumbLink5, { asChild: true, children: /* @__PURE__ */ jsx45(Link8, { to: "/webhooks", children: "Webhooks" }) }) }),
5115
5233
  /* @__PURE__ */ jsx45(BreadcrumbSeparator5, {}),
5116
5234
  /* @__PURE__ */ jsx45(BreadcrumbItem13, { children: /* @__PURE__ */ jsx45(BreadcrumbPage13, { children: "Endpoints" }) })
5117
5235
  ] }) })
5118
5236
  ] }) }),
5119
- /* @__PURE__ */ jsxs40("div", { className: "flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 pt-0", children: [
5120
- /* @__PURE__ */ jsxs40("div", { className: "flex items-center justify-between", children: [
5121
- /* @__PURE__ */ jsxs40("div", { children: [
5237
+ /* @__PURE__ */ jsxs39("div", { className: `flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 ${hideHeader ? "" : "pt-0"} ${className ?? ""}`, children: [
5238
+ /* @__PURE__ */ jsxs39("div", { className: "flex items-center justify-between", children: [
5239
+ /* @__PURE__ */ jsxs39("div", { children: [
5122
5240
  /* @__PURE__ */ jsx45("h1", { className: "text-2xl font-bold", children: "Endpoints" }),
5123
5241
  /* @__PURE__ */ jsx45("p", { className: "text-muted-foreground", children: "Manage your webhook subscription endpoints." })
5124
5242
  ] }),
5125
- /* @__PURE__ */ jsxs40(Dialog8, { open: createDialogOpen, onOpenChange: setCreateDialogOpen, children: [
5126
- /* @__PURE__ */ jsx45(DialogTrigger5, { asChild: true, children: /* @__PURE__ */ jsxs40(Button18, { onClick: resetForm, children: [
5243
+ /* @__PURE__ */ jsxs39(Dialog8, { open: createDialogOpen, onOpenChange: setCreateDialogOpen, children: [
5244
+ /* @__PURE__ */ jsx45(DialogTrigger5, { asChild: true, children: /* @__PURE__ */ jsxs39(Button18, { onClick: resetForm, children: [
5127
5245
  /* @__PURE__ */ jsx45(Plus7, { className: "h-4 w-4" }),
5128
5246
  "Add Endpoint"
5129
5247
  ] }) }),
5130
- /* @__PURE__ */ jsxs40(DialogContent8, { className: "sm:max-w-xl", children: [
5131
- /* @__PURE__ */ jsxs40(DialogHeader7, { children: [
5248
+ /* @__PURE__ */ jsxs39(DialogContent8, { className: "sm:max-w-xl", children: [
5249
+ /* @__PURE__ */ jsxs39(DialogHeader7, { children: [
5132
5250
  /* @__PURE__ */ jsx45(DialogTitle7, { children: "Add Webhook Endpoint" }),
5133
5251
  /* @__PURE__ */ jsx45(DialogDescription6, { children: "Configure a new endpoint to receive webhook events." })
5134
5252
  ] }),
5135
- /* @__PURE__ */ jsxs40("div", { className: "space-y-6", children: [
5136
- /* @__PURE__ */ jsxs40("div", { className: "space-y-4", children: [
5137
- /* @__PURE__ */ jsxs40("div", { className: "space-y-2", children: [
5253
+ /* @__PURE__ */ jsxs39("div", { className: "space-y-6", children: [
5254
+ /* @__PURE__ */ jsxs39("div", { className: "space-y-4", children: [
5255
+ /* @__PURE__ */ jsxs39("div", { className: "space-y-2", children: [
5138
5256
  /* @__PURE__ */ jsx45(Label8, { htmlFor: "url", children: "Endpoint URL" }),
5139
5257
  /* @__PURE__ */ jsx45(
5140
5258
  Input9,
5141
5259
  {
5142
5260
  id: "url",
5143
- placeholder: "https://api.example.com/webhooks",
5261
+ placeholder: "https://api.example.com.ai/webhooks",
5144
5262
  value: formUrl,
5145
5263
  onChange: (e) => setFormUrl(e.target.value)
5146
5264
  }
5147
5265
  )
5148
5266
  ] }),
5149
- /* @__PURE__ */ jsxs40("div", { className: "flex items-center justify-between rounded-lg border p-3", children: [
5150
- /* @__PURE__ */ jsxs40("div", { className: "space-y-0.5", children: [
5267
+ /* @__PURE__ */ jsxs39("div", { className: "flex items-center justify-between rounded-lg border p-3", children: [
5268
+ /* @__PURE__ */ jsxs39("div", { className: "space-y-0.5", children: [
5151
5269
  /* @__PURE__ */ jsx45(Label8, { htmlFor: "enabled", className: "text-sm font-medium", children: "Active" }),
5152
5270
  /* @__PURE__ */ jsx45("p", { className: "text-xs text-muted-foreground", children: "Enable this endpoint to receive events" })
5153
5271
  ] }),
5154
5272
  /* @__PURE__ */ jsx45(Switch2, { id: "enabled", checked: formEnabled, onCheckedChange: setFormEnabled })
5155
5273
  ] })
5156
5274
  ] }),
5157
- /* @__PURE__ */ jsxs40("div", { className: "space-y-3", children: [
5275
+ /* @__PURE__ */ jsxs39("div", { className: "space-y-3", children: [
5158
5276
  /* @__PURE__ */ jsx45(Label8, { children: "Events to subscribe" }),
5159
5277
  /* @__PURE__ */ jsx45("div", { className: "rounded-lg border divide-y", children: Object.entries(eventsByCategory).map(([category, events]) => {
5160
5278
  const categoryEvents = events.map((e) => e.name);
@@ -5167,8 +5285,8 @@ function WebhooksEndpointsPage() {
5167
5285
  setFormEvents([.../* @__PURE__ */ new Set([...formEvents, ...categoryEvents])]);
5168
5286
  }
5169
5287
  };
5170
- return /* @__PURE__ */ jsxs40("div", { className: "p-3 space-y-2", children: [
5171
- /* @__PURE__ */ jsxs40("div", { className: "flex items-center gap-2", children: [
5288
+ return /* @__PURE__ */ jsxs39("div", { className: "p-3 space-y-2", children: [
5289
+ /* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-2", children: [
5172
5290
  /* @__PURE__ */ jsx45(
5173
5291
  Checkbox,
5174
5292
  {
@@ -5180,7 +5298,7 @@ function WebhooksEndpointsPage() {
5180
5298
  ),
5181
5299
  /* @__PURE__ */ jsx45(Label8, { htmlFor: `category-${category}`, className: "text-sm font-medium cursor-pointer", children: category })
5182
5300
  ] }),
5183
- /* @__PURE__ */ jsx45("div", { className: "ml-6 space-y-1.5", children: events.map((event) => /* @__PURE__ */ jsxs40("div", { className: "flex items-center gap-2", children: [
5301
+ /* @__PURE__ */ jsx45("div", { className: "ml-6 space-y-1.5", children: events.map((event) => /* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-2", children: [
5184
5302
  /* @__PURE__ */ jsx45(
5185
5303
  Checkbox,
5186
5304
  {
@@ -5193,7 +5311,7 @@ function WebhooksEndpointsPage() {
5193
5311
  ] }, event.name)) })
5194
5312
  ] }, category);
5195
5313
  }) }),
5196
- /* @__PURE__ */ jsxs40("p", { className: "text-xs text-muted-foreground", children: [
5314
+ /* @__PURE__ */ jsxs39("p", { className: "text-xs text-muted-foreground", children: [
5197
5315
  formEvents.length,
5198
5316
  " event",
5199
5317
  formEvents.length !== 1 ? "s" : "",
@@ -5201,19 +5319,19 @@ function WebhooksEndpointsPage() {
5201
5319
  ] })
5202
5320
  ] })
5203
5321
  ] }),
5204
- /* @__PURE__ */ jsxs40(DialogFooter7, { children: [
5322
+ /* @__PURE__ */ jsxs39(DialogFooter7, { children: [
5205
5323
  /* @__PURE__ */ jsx45(Button18, { variant: "outline", onClick: () => setCreateDialogOpen(false), children: "Cancel" }),
5206
5324
  /* @__PURE__ */ jsx45(Button18, { onClick: handleCreate, disabled: !formUrl || formEvents.length === 0, children: "Create Endpoint" })
5207
5325
  ] })
5208
5326
  ] })
5209
5327
  ] })
5210
5328
  ] }),
5211
- /* @__PURE__ */ jsxs40("div", { className: "space-y-3", children: [
5329
+ /* @__PURE__ */ jsxs39("div", { className: "space-y-3", children: [
5212
5330
  endpoints.map((endpoint) => {
5213
5331
  const hasIssues = endpoint.failureCount > 0;
5214
- return /* @__PURE__ */ jsx45(Card17, { children: /* @__PURE__ */ jsx45(CardContent16, { className: "p-4 py-0", children: /* @__PURE__ */ jsxs40("div", { className: "flex items-start justify-between gap-4", children: [
5215
- /* @__PURE__ */ jsxs40("div", { className: "min-w-0 flex-1 space-y-1", children: [
5216
- /* @__PURE__ */ jsxs40("div", { className: "flex items-center gap-2", children: [
5332
+ return /* @__PURE__ */ jsx45(Card17, { children: /* @__PURE__ */ jsx45(CardContent16, { className: "p-4 py-0", children: /* @__PURE__ */ jsxs39("div", { className: "flex items-start justify-between gap-4", children: [
5333
+ /* @__PURE__ */ jsxs39("div", { className: "min-w-0 flex-1 space-y-1", children: [
5334
+ /* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-2", children: [
5217
5335
  /* @__PURE__ */ jsx45(
5218
5336
  Circle,
5219
5337
  {
@@ -5223,20 +5341,20 @@ function WebhooksEndpointsPage() {
5223
5341
  /* @__PURE__ */ jsx45("span", { className: "font-mono text-sm truncate", children: endpoint.url }),
5224
5342
  endpoint.status === "disabled" && /* @__PURE__ */ jsx45(Badge7, { variant: "secondary", className: "shrink-0", children: "Disabled" })
5225
5343
  ] }),
5226
- /* @__PURE__ */ jsxs40("div", { className: "flex items-center gap-1 text-sm text-muted-foreground ml-4", children: [
5227
- /* @__PURE__ */ jsxs40("span", { children: [
5344
+ /* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-1 text-sm text-muted-foreground ml-4", children: [
5345
+ /* @__PURE__ */ jsxs39("span", { children: [
5228
5346
  endpoint.events.length,
5229
5347
  " event",
5230
5348
  endpoint.events.length !== 1 ? "s" : ""
5231
5349
  ] }),
5232
5350
  /* @__PURE__ */ jsx45("span", { children: "\xB7" }),
5233
- /* @__PURE__ */ jsxs40("span", { children: [
5351
+ /* @__PURE__ */ jsxs39("span", { children: [
5234
5352
  "Last delivery ",
5235
5353
  formatRelativeTime(endpoint.lastDelivery).toLowerCase()
5236
5354
  ] }),
5237
- endpoint.failureCount > 0 && /* @__PURE__ */ jsxs40(Fragment19, { children: [
5355
+ endpoint.failureCount > 0 && /* @__PURE__ */ jsxs39(Fragment18, { children: [
5238
5356
  /* @__PURE__ */ jsx45("span", { children: "\xB7" }),
5239
- /* @__PURE__ */ jsxs40("span", { className: "text-destructive", children: [
5357
+ /* @__PURE__ */ jsxs39("span", { className: "text-destructive", children: [
5240
5358
  endpoint.failureCount,
5241
5359
  " failure",
5242
5360
  endpoint.failureCount !== 1 ? "s" : ""
@@ -5244,23 +5362,23 @@ function WebhooksEndpointsPage() {
5244
5362
  ] })
5245
5363
  ] })
5246
5364
  ] }),
5247
- /* @__PURE__ */ jsxs40(DropdownMenu8, { children: [
5365
+ /* @__PURE__ */ jsxs39(DropdownMenu8, { children: [
5248
5366
  /* @__PURE__ */ jsx45(DropdownMenuTrigger8, { asChild: true, children: /* @__PURE__ */ jsx45(Button18, { variant: "ghost", size: "icon", className: "h-8 w-8 shrink-0", children: /* @__PURE__ */ jsx45(MoreHorizontal5, { className: "h-4 w-4" }) }) }),
5249
- /* @__PURE__ */ jsxs40(DropdownMenuContent8, { align: "end", children: [
5250
- /* @__PURE__ */ jsxs40(DropdownMenuItem8, { onClick: () => openEditDialog(endpoint), children: [
5367
+ /* @__PURE__ */ jsxs39(DropdownMenuContent8, { align: "end", children: [
5368
+ /* @__PURE__ */ jsxs39(DropdownMenuItem8, { onClick: () => openEditDialog(endpoint), children: [
5251
5369
  /* @__PURE__ */ jsx45(Pencil2, { className: "h-4 w-4" }),
5252
5370
  "Edit"
5253
5371
  ] }),
5254
- /* @__PURE__ */ jsxs40(DropdownMenuItem8, { onClick: () => handleCopySecret(endpoint), children: [
5372
+ /* @__PURE__ */ jsxs39(DropdownMenuItem8, { onClick: () => handleCopySecret(endpoint), children: [
5255
5373
  copiedSecret === endpoint.id ? /* @__PURE__ */ jsx45(Check4, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx45(Copy4, { className: "h-4 w-4" }),
5256
5374
  "Copy Secret"
5257
5375
  ] }),
5258
- /* @__PURE__ */ jsxs40(DropdownMenuItem8, { children: [
5376
+ /* @__PURE__ */ jsxs39(DropdownMenuItem8, { children: [
5259
5377
  /* @__PURE__ */ jsx45(RefreshCw, { className: "h-4 w-4" }),
5260
5378
  "Regenerate Secret"
5261
5379
  ] }),
5262
5380
  /* @__PURE__ */ jsx45(DropdownMenuSeparator3, {}),
5263
- /* @__PURE__ */ jsxs40(DropdownMenuItem8, { className: "text-destructive focus:text-destructive", onClick: () => openDeleteDialog(endpoint), children: [
5381
+ /* @__PURE__ */ jsxs39(DropdownMenuItem8, { className: "text-destructive focus:text-destructive", onClick: () => openDeleteDialog(endpoint), children: [
5264
5382
  /* @__PURE__ */ jsx45(Trash25, { className: "h-4 w-4" }),
5265
5383
  "Delete"
5266
5384
  ] })
@@ -5268,47 +5386,47 @@ function WebhooksEndpointsPage() {
5268
5386
  ] })
5269
5387
  ] }) }) }, endpoint.id);
5270
5388
  }),
5271
- endpoints.length === 0 && /* @__PURE__ */ jsx45(Card17, { children: /* @__PURE__ */ jsx45(CardContent16, { className: "py-16", children: /* @__PURE__ */ jsxs40("div", { className: "flex flex-col items-center justify-center gap-4 text-center", children: [
5389
+ endpoints.length === 0 && /* @__PURE__ */ jsx45(Card17, { children: /* @__PURE__ */ jsx45(CardContent16, { className: "py-16", children: /* @__PURE__ */ jsxs39("div", { className: "flex flex-col items-center justify-center gap-4 text-center", children: [
5272
5390
  /* @__PURE__ */ jsx45("div", { className: "rounded-full bg-muted p-4", children: /* @__PURE__ */ jsx45(Link22, { className: "h-8 w-8 text-muted-foreground" }) }),
5273
- /* @__PURE__ */ jsxs40("div", { children: [
5391
+ /* @__PURE__ */ jsxs39("div", { children: [
5274
5392
  /* @__PURE__ */ jsx45("p", { className: "font-medium", children: "No endpoints configured" }),
5275
5393
  /* @__PURE__ */ jsx45("p", { className: "text-sm text-muted-foreground mt-1", children: "Add your first endpoint to start receiving webhook events." })
5276
5394
  ] }),
5277
- /* @__PURE__ */ jsxs40(Button18, { onClick: () => setCreateDialogOpen(true), className: "mt-2", children: [
5395
+ /* @__PURE__ */ jsxs39(Button18, { onClick: () => setCreateDialogOpen(true), className: "mt-2", children: [
5278
5396
  /* @__PURE__ */ jsx45(Plus7, { className: "h-4 w-4" }),
5279
5397
  "Add Your First Endpoint"
5280
5398
  ] })
5281
5399
  ] }) }) })
5282
5400
  ] })
5283
5401
  ] }),
5284
- /* @__PURE__ */ jsx45(Dialog8, { open: editDialogOpen, onOpenChange: setEditDialogOpen, children: /* @__PURE__ */ jsxs40(DialogContent8, { className: "sm:max-w-xl", children: [
5285
- /* @__PURE__ */ jsxs40(DialogHeader7, { children: [
5402
+ /* @__PURE__ */ jsx45(Dialog8, { open: editDialogOpen, onOpenChange: setEditDialogOpen, children: /* @__PURE__ */ jsxs39(DialogContent8, { className: "sm:max-w-xl", children: [
5403
+ /* @__PURE__ */ jsxs39(DialogHeader7, { children: [
5286
5404
  /* @__PURE__ */ jsx45(DialogTitle7, { children: "Edit Endpoint" }),
5287
5405
  /* @__PURE__ */ jsx45(DialogDescription6, { children: "Update your webhook endpoint configuration." })
5288
5406
  ] }),
5289
- /* @__PURE__ */ jsxs40("div", { className: "space-y-6", children: [
5290
- /* @__PURE__ */ jsxs40("div", { className: "space-y-4", children: [
5291
- /* @__PURE__ */ jsxs40("div", { className: "space-y-2", children: [
5407
+ /* @__PURE__ */ jsxs39("div", { className: "space-y-6", children: [
5408
+ /* @__PURE__ */ jsxs39("div", { className: "space-y-4", children: [
5409
+ /* @__PURE__ */ jsxs39("div", { className: "space-y-2", children: [
5292
5410
  /* @__PURE__ */ jsx45(Label8, { htmlFor: "edit-url", children: "Endpoint URL" }),
5293
5411
  /* @__PURE__ */ jsx45(
5294
5412
  Input9,
5295
5413
  {
5296
5414
  id: "edit-url",
5297
- placeholder: "https://api.example.com/webhooks",
5415
+ placeholder: "https://api.example.com.ai/webhooks",
5298
5416
  value: formUrl,
5299
5417
  onChange: (e) => setFormUrl(e.target.value)
5300
5418
  }
5301
5419
  )
5302
5420
  ] }),
5303
- /* @__PURE__ */ jsxs40("div", { className: "flex items-center justify-between rounded-lg border p-3", children: [
5304
- /* @__PURE__ */ jsxs40("div", { className: "space-y-0.5", children: [
5421
+ /* @__PURE__ */ jsxs39("div", { className: "flex items-center justify-between rounded-lg border p-3", children: [
5422
+ /* @__PURE__ */ jsxs39("div", { className: "space-y-0.5", children: [
5305
5423
  /* @__PURE__ */ jsx45(Label8, { htmlFor: "edit-enabled", className: "text-sm font-medium", children: "Active" }),
5306
5424
  /* @__PURE__ */ jsx45("p", { className: "text-xs text-muted-foreground", children: "Enable this endpoint to receive events" })
5307
5425
  ] }),
5308
5426
  /* @__PURE__ */ jsx45(Switch2, { id: "edit-enabled", checked: formEnabled, onCheckedChange: setFormEnabled })
5309
5427
  ] })
5310
5428
  ] }),
5311
- /* @__PURE__ */ jsxs40("div", { className: "space-y-3", children: [
5429
+ /* @__PURE__ */ jsxs39("div", { className: "space-y-3", children: [
5312
5430
  /* @__PURE__ */ jsx45(Label8, { children: "Events to subscribe" }),
5313
5431
  /* @__PURE__ */ jsx45("div", { className: "rounded-lg border divide-y", children: Object.entries(eventsByCategory).map(([category, events]) => {
5314
5432
  const categoryEvents = events.map((e) => e.name);
@@ -5321,8 +5439,8 @@ function WebhooksEndpointsPage() {
5321
5439
  setFormEvents([.../* @__PURE__ */ new Set([...formEvents, ...categoryEvents])]);
5322
5440
  }
5323
5441
  };
5324
- return /* @__PURE__ */ jsxs40("div", { className: "p-3 space-y-2", children: [
5325
- /* @__PURE__ */ jsxs40("div", { className: "flex items-center gap-2", children: [
5442
+ return /* @__PURE__ */ jsxs39("div", { className: "p-3 space-y-2", children: [
5443
+ /* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-2", children: [
5326
5444
  /* @__PURE__ */ jsx45(
5327
5445
  Checkbox,
5328
5446
  {
@@ -5334,7 +5452,7 @@ function WebhooksEndpointsPage() {
5334
5452
  ),
5335
5453
  /* @__PURE__ */ jsx45(Label8, { htmlFor: `edit-category-${category}`, className: "text-sm font-medium cursor-pointer", children: category })
5336
5454
  ] }),
5337
- /* @__PURE__ */ jsx45("div", { className: "ml-6 space-y-1.5", children: events.map((event) => /* @__PURE__ */ jsxs40("div", { className: "flex items-center gap-2", children: [
5455
+ /* @__PURE__ */ jsx45("div", { className: "ml-6 space-y-1.5", children: events.map((event) => /* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-2", children: [
5338
5456
  /* @__PURE__ */ jsx45(
5339
5457
  Checkbox,
5340
5458
  {
@@ -5347,7 +5465,7 @@ function WebhooksEndpointsPage() {
5347
5465
  ] }, event.name)) })
5348
5466
  ] }, category);
5349
5467
  }) }),
5350
- /* @__PURE__ */ jsxs40("p", { className: "text-xs text-muted-foreground", children: [
5468
+ /* @__PURE__ */ jsxs39("p", { className: "text-xs text-muted-foreground", children: [
5351
5469
  formEvents.length,
5352
5470
  " event",
5353
5471
  formEvents.length !== 1 ? "s" : "",
@@ -5355,18 +5473,18 @@ function WebhooksEndpointsPage() {
5355
5473
  ] })
5356
5474
  ] })
5357
5475
  ] }),
5358
- /* @__PURE__ */ jsxs40(DialogFooter7, { children: [
5476
+ /* @__PURE__ */ jsxs39(DialogFooter7, { children: [
5359
5477
  /* @__PURE__ */ jsx45(Button18, { variant: "outline", onClick: () => setEditDialogOpen(false), children: "Cancel" }),
5360
5478
  /* @__PURE__ */ jsx45(Button18, { onClick: handleEdit, disabled: !formUrl || formEvents.length === 0, children: "Save Changes" })
5361
5479
  ] })
5362
5480
  ] }) }),
5363
- /* @__PURE__ */ jsx45(Dialog8, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: /* @__PURE__ */ jsxs40(DialogContent8, { children: [
5364
- /* @__PURE__ */ jsxs40(DialogHeader7, { children: [
5481
+ /* @__PURE__ */ jsx45(Dialog8, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: /* @__PURE__ */ jsxs39(DialogContent8, { children: [
5482
+ /* @__PURE__ */ jsxs39(DialogHeader7, { children: [
5365
5483
  /* @__PURE__ */ jsx45(DialogTitle7, { children: "Delete Endpoint" }),
5366
5484
  /* @__PURE__ */ jsx45(DialogDescription6, { children: "Are you sure you want to delete this endpoint? This action cannot be undone." })
5367
5485
  ] }),
5368
5486
  selectedEndpoint && /* @__PURE__ */ jsx45("div", { className: "rounded-md bg-muted p-3", children: /* @__PURE__ */ jsx45("p", { className: "font-mono text-sm truncate", children: selectedEndpoint.url }) }),
5369
- /* @__PURE__ */ jsxs40(DialogFooter7, { children: [
5487
+ /* @__PURE__ */ jsxs39(DialogFooter7, { children: [
5370
5488
  /* @__PURE__ */ jsx45(Button18, { variant: "outline", onClick: () => setDeleteDialogOpen(false), children: "Cancel" }),
5371
5489
  /* @__PURE__ */ jsx45(Button18, { variant: "destructive", onClick: handleDelete, children: "Delete" })
5372
5490
  ] })
@@ -5382,12 +5500,12 @@ import { Input as Input10 } from "@mdxui/primitives/input";
5382
5500
  import { Separator as Separator16 } from "@mdxui/primitives/separator";
5383
5501
  import { SidebarTrigger as SidebarTrigger14 } from "@mdxui/primitives/sidebar";
5384
5502
  import { BookOpen, ChevronRight as ChevronRight2, Search as Search2 } from "lucide-react";
5385
- import { useState as useState21 } from "react";
5503
+ import { useState as useState20 } from "react";
5386
5504
  import { Link as Link9 } from "react-router-dom";
5387
- import { Fragment as Fragment20, jsx as jsx46, jsxs as jsxs41 } from "react/jsx-runtime";
5505
+ import { Fragment as Fragment19, jsx as jsx46, jsxs as jsxs40 } from "react/jsx-runtime";
5388
5506
  function WebhooksEventCatalogPage() {
5389
- const [searchQuery, setSearchQuery] = useState21("");
5390
- const [expandedEvents, setExpandedEvents] = useState21(/* @__PURE__ */ new Set());
5507
+ const [searchQuery, setSearchQuery] = useState20("");
5508
+ const [expandedEvents, setExpandedEvents] = useState20(/* @__PURE__ */ new Set());
5391
5509
  const filteredEvents = mockWebhookEvents.filter(
5392
5510
  (event) => event.name.toLowerCase().includes(searchQuery.toLowerCase()) || event.description.toLowerCase().includes(searchQuery.toLowerCase()) || event.category.toLowerCase().includes(searchQuery.toLowerCase())
5393
5511
  );
@@ -5407,23 +5525,23 @@ function WebhooksEventCatalogPage() {
5407
5525
  }
5408
5526
  setExpandedEvents(newExpanded);
5409
5527
  };
5410
- return /* @__PURE__ */ jsxs41(Fragment20, { children: [
5411
- /* @__PURE__ */ jsx46("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-2 px-4", children: [
5528
+ return /* @__PURE__ */ jsxs40(Fragment19, { children: [
5529
+ /* @__PURE__ */ jsx46("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs40("div", { className: "flex items-center gap-2 px-4", children: [
5412
5530
  /* @__PURE__ */ jsx46(SidebarTrigger14, { className: "-ml-1" }),
5413
5531
  /* @__PURE__ */ jsx46(Separator16, { orientation: "vertical", className: "mr-2 data-[orientation=vertical]:h-4" }),
5414
- /* @__PURE__ */ jsx46(Breadcrumb14, { children: /* @__PURE__ */ jsxs41(BreadcrumbList14, { children: [
5532
+ /* @__PURE__ */ jsx46(Breadcrumb14, { children: /* @__PURE__ */ jsxs40(BreadcrumbList14, { children: [
5415
5533
  /* @__PURE__ */ jsx46(BreadcrumbItem14, { children: /* @__PURE__ */ jsx46(BreadcrumbLink6, { asChild: true, children: /* @__PURE__ */ jsx46(Link9, { to: "/webhooks", children: "Webhooks" }) }) }),
5416
5534
  /* @__PURE__ */ jsx46(BreadcrumbSeparator6, {}),
5417
5535
  /* @__PURE__ */ jsx46(BreadcrumbItem14, { children: /* @__PURE__ */ jsx46(BreadcrumbPage14, { children: "Event Catalog" }) })
5418
5536
  ] }) })
5419
5537
  ] }) }),
5420
- /* @__PURE__ */ jsxs41("div", { className: "flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 pt-0", children: [
5421
- /* @__PURE__ */ jsxs41("div", { className: "flex items-center justify-between", children: [
5422
- /* @__PURE__ */ jsxs41("div", { children: [
5538
+ /* @__PURE__ */ jsxs40("div", { className: "flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 pt-0", children: [
5539
+ /* @__PURE__ */ jsxs40("div", { className: "flex items-center justify-between", children: [
5540
+ /* @__PURE__ */ jsxs40("div", { children: [
5423
5541
  /* @__PURE__ */ jsx46("h1", { className: "text-2xl font-bold", children: "Event Catalog" }),
5424
5542
  /* @__PURE__ */ jsx46("p", { className: "text-muted-foreground", children: "Browse and search available webhook events." })
5425
5543
  ] }),
5426
- /* @__PURE__ */ jsxs41("div", { className: "relative", children: [
5544
+ /* @__PURE__ */ jsxs40("div", { className: "relative", children: [
5427
5545
  /* @__PURE__ */ jsx46(Search2, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
5428
5546
  /* @__PURE__ */ jsx46(
5429
5547
  Input10,
@@ -5436,18 +5554,18 @@ function WebhooksEventCatalogPage() {
5436
5554
  )
5437
5555
  ] })
5438
5556
  ] }),
5439
- /* @__PURE__ */ jsxs41("div", { className: "space-y-6", children: [
5440
- Object.entries(groupedEvents).map(([category, events]) => /* @__PURE__ */ jsxs41("div", { children: [
5557
+ /* @__PURE__ */ jsxs40("div", { className: "space-y-6", children: [
5558
+ Object.entries(groupedEvents).map(([category, events]) => /* @__PURE__ */ jsxs40("div", { children: [
5441
5559
  /* @__PURE__ */ jsx46("h2", { className: "text-sm font-semibold text-muted-foreground mb-3 pt-2", children: category }),
5442
- /* @__PURE__ */ jsx46("div", { className: "space-y-2", children: events.map((event) => /* @__PURE__ */ jsx46(Card18, { noPadding: true, children: /* @__PURE__ */ jsxs41(Collapsible, { open: expandedEvents.has(event.id), onOpenChange: () => toggleEvent(event.id), children: [
5443
- /* @__PURE__ */ jsx46(CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ jsx46(CardContent17, { className: "p-4 cursor-pointer hover:bg-muted/50 transition-colors", children: /* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-3", children: [
5560
+ /* @__PURE__ */ jsx46("div", { className: "space-y-2", children: events.map((event) => /* @__PURE__ */ jsx46(Card18, { noPadding: true, children: /* @__PURE__ */ jsxs40(Collapsible, { open: expandedEvents.has(event.id), onOpenChange: () => toggleEvent(event.id), children: [
5561
+ /* @__PURE__ */ jsx46(CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ jsx46(CardContent17, { className: "p-4 cursor-pointer hover:bg-muted/50 transition-colors", children: /* @__PURE__ */ jsxs40("div", { className: "flex items-center gap-3", children: [
5444
5562
  /* @__PURE__ */ jsx46(
5445
5563
  ChevronRight2,
5446
5564
  {
5447
5565
  className: `h-4 w-4 text-muted-foreground transition-transform ${expandedEvents.has(event.id) ? "rotate-90" : ""}`
5448
5566
  }
5449
5567
  ),
5450
- /* @__PURE__ */ jsxs41("div", { className: "flex-1 min-w-0", children: [
5568
+ /* @__PURE__ */ jsxs40("div", { className: "flex-1 min-w-0", children: [
5451
5569
  /* @__PURE__ */ jsx46("p", { className: "font-mono text-sm font-medium", children: event.name }),
5452
5570
  /* @__PURE__ */ jsx46("p", { className: "text-sm text-muted-foreground truncate", children: event.description })
5453
5571
  ] })
@@ -5455,9 +5573,9 @@ function WebhooksEventCatalogPage() {
5455
5573
  /* @__PURE__ */ jsx46(CollapsibleContent, { children: /* @__PURE__ */ jsx46("div", { className: "px-4 pb-4 ml-7 mr-7", children: /* @__PURE__ */ jsx46(JsonViewer, { data: event.payloadSchema }) }) })
5456
5574
  ] }) }, event.id)) })
5457
5575
  ] }, category)),
5458
- Object.keys(groupedEvents).length === 0 && /* @__PURE__ */ jsx46(Card18, { children: /* @__PURE__ */ jsx46(CardContent17, { className: "py-16", children: /* @__PURE__ */ jsxs41("div", { className: "flex flex-col items-center justify-center gap-4 text-center", children: [
5576
+ Object.keys(groupedEvents).length === 0 && /* @__PURE__ */ jsx46(Card18, { children: /* @__PURE__ */ jsx46(CardContent17, { className: "py-16", children: /* @__PURE__ */ jsxs40("div", { className: "flex flex-col items-center justify-center gap-4 text-center", children: [
5459
5577
  /* @__PURE__ */ jsx46("div", { className: "rounded-full bg-muted p-4", children: /* @__PURE__ */ jsx46(BookOpen, { className: "h-8 w-8 text-muted-foreground" }) }),
5460
- /* @__PURE__ */ jsxs41("div", { children: [
5578
+ /* @__PURE__ */ jsxs40("div", { children: [
5461
5579
  /* @__PURE__ */ jsx46("p", { className: "font-medium", children: "No events found" }),
5462
5580
  /* @__PURE__ */ jsx46("p", { className: "text-sm text-muted-foreground mt-1", children: "Try adjusting your search query." })
5463
5581
  ] })
@@ -5476,10 +5594,10 @@ import { Sheet as Sheet2, SheetContent as SheetContent2, SheetDescription as She
5476
5594
  import { SidebarTrigger as SidebarTrigger15 } from "@mdxui/primitives/sidebar";
5477
5595
  import { Table as Table9, TableBody as TableBody9, TableCell as TableCell9, TableHead as TableHead9, TableHeader as TableHeader9, TableRow as TableRow9 } from "@mdxui/primitives/table";
5478
5596
  import { Check as Check5, ChevronDown as ChevronDown4, Copy as Copy5, RefreshCw as RefreshCw2, ScrollText } from "lucide-react";
5479
- import { useState as useState22 } from "react";
5597
+ import { useState as useState21 } from "react";
5480
5598
  import { Link as Link10 } from "react-router-dom";
5481
5599
  import { toast as toast8 } from "sonner";
5482
- import { Fragment as Fragment21, jsx as jsx47, jsxs as jsxs42 } from "react/jsx-runtime";
5600
+ import { Fragment as Fragment20, jsx as jsx47, jsxs as jsxs41 } from "react/jsx-runtime";
5483
5601
  var statusFilterOptions2 = [
5484
5602
  { value: "all", label: "All Status" },
5485
5603
  { value: "success", label: "Success" },
@@ -5512,11 +5630,10 @@ function formatLatency2(ms) {
5512
5630
  return `${ms}ms`;
5513
5631
  }
5514
5632
  function WebhooksLogsPage() {
5515
- var _a;
5516
- const [statusFilter, setStatusFilter] = useState22("all");
5517
- const [selectedLog, setSelectedLog] = useState22(null);
5518
- const [sheetOpen, setSheetOpen] = useState22(false);
5519
- const [copiedUrl, setCopiedUrl] = useState22(false);
5633
+ const [statusFilter, setStatusFilter] = useState21("all");
5634
+ const [selectedLog, setSelectedLog] = useState21(null);
5635
+ const [sheetOpen, setSheetOpen] = useState21(false);
5636
+ const [copiedUrl, setCopiedUrl] = useState21(false);
5520
5637
  const filteredLogs = mockWebhookLogs.filter((log) => {
5521
5638
  if (statusFilter === "all") return true;
5522
5639
  if (statusFilter === "success") return log.statusCode >= 200 && log.statusCode < 300;
@@ -5527,43 +5644,43 @@ function WebhooksLogsPage() {
5527
5644
  setSheetOpen(true);
5528
5645
  setCopiedUrl(false);
5529
5646
  };
5530
- const handleCopyUrl = (url) => __async(null, null, function* () {
5531
- yield navigator.clipboard.writeText(url);
5647
+ const handleCopyUrl = async (url) => {
5648
+ await navigator.clipboard.writeText(url);
5532
5649
  setCopiedUrl(true);
5533
5650
  setTimeout(() => setCopiedUrl(false), 2e3);
5534
- });
5651
+ };
5535
5652
  const handleRetry = () => {
5536
5653
  toast8.success("Webhook retry triggered", {
5537
5654
  description: "The webhook delivery will be retried shortly."
5538
5655
  });
5539
5656
  setSheetOpen(false);
5540
5657
  };
5541
- return /* @__PURE__ */ jsxs42(Fragment21, { children: [
5542
- /* @__PURE__ */ jsx47("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs42("div", { className: "flex items-center gap-2 px-4", children: [
5658
+ return /* @__PURE__ */ jsxs41(Fragment20, { children: [
5659
+ /* @__PURE__ */ jsx47("header", { className: "flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: /* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-2 px-4", children: [
5543
5660
  /* @__PURE__ */ jsx47(SidebarTrigger15, { className: "-ml-1" }),
5544
5661
  /* @__PURE__ */ jsx47(Separator17, { orientation: "vertical", className: "mr-2 data-[orientation=vertical]:h-4" }),
5545
- /* @__PURE__ */ jsx47(Breadcrumb15, { children: /* @__PURE__ */ jsxs42(BreadcrumbList15, { children: [
5662
+ /* @__PURE__ */ jsx47(Breadcrumb15, { children: /* @__PURE__ */ jsxs41(BreadcrumbList15, { children: [
5546
5663
  /* @__PURE__ */ jsx47(BreadcrumbItem15, { children: /* @__PURE__ */ jsx47(BreadcrumbLink7, { asChild: true, children: /* @__PURE__ */ jsx47(Link10, { to: "/webhooks", children: "Webhooks" }) }) }),
5547
5664
  /* @__PURE__ */ jsx47(BreadcrumbSeparator7, {}),
5548
5665
  /* @__PURE__ */ jsx47(BreadcrumbItem15, { children: /* @__PURE__ */ jsx47(BreadcrumbPage15, { children: "Logs" }) })
5549
5666
  ] }) })
5550
5667
  ] }) }),
5551
- /* @__PURE__ */ jsxs42("div", { className: "flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 pt-0", children: [
5552
- /* @__PURE__ */ jsxs42("div", { className: "flex items-center justify-between", children: [
5553
- /* @__PURE__ */ jsxs42("div", { children: [
5668
+ /* @__PURE__ */ jsxs41("div", { className: "flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 pt-0", children: [
5669
+ /* @__PURE__ */ jsxs41("div", { className: "flex items-center justify-between", children: [
5670
+ /* @__PURE__ */ jsxs41("div", { children: [
5554
5671
  /* @__PURE__ */ jsx47("h1", { className: "text-2xl font-bold", children: "Webhook Logs" }),
5555
5672
  /* @__PURE__ */ jsx47("p", { className: "text-muted-foreground", children: "View webhook delivery history and debug issues." })
5556
5673
  ] }),
5557
- /* @__PURE__ */ jsxs42(DropdownMenu9, { children: [
5558
- /* @__PURE__ */ jsx47(DropdownMenuTrigger9, { asChild: true, children: /* @__PURE__ */ jsxs42(Button19, { variant: "outline", className: "w-[140px] justify-between", children: [
5559
- (_a = statusFilterOptions2.find((o) => o.value === statusFilter)) == null ? void 0 : _a.label,
5674
+ /* @__PURE__ */ jsxs41(DropdownMenu9, { children: [
5675
+ /* @__PURE__ */ jsx47(DropdownMenuTrigger9, { asChild: true, children: /* @__PURE__ */ jsxs41(Button19, { variant: "outline", className: "w-[140px] justify-between", children: [
5676
+ statusFilterOptions2.find((o) => o.value === statusFilter)?.label,
5560
5677
  /* @__PURE__ */ jsx47(ChevronDown4, { className: "h-4 w-4 opacity-50" })
5561
5678
  ] }) }),
5562
5679
  /* @__PURE__ */ jsx47(DropdownMenuContent9, { align: "end", className: "w-[140px]", children: statusFilterOptions2.map((option) => /* @__PURE__ */ jsx47(DropdownMenuItem9, { onClick: () => setStatusFilter(option.value), children: option.label }, option.value)) })
5563
5680
  ] })
5564
5681
  ] }),
5565
- /* @__PURE__ */ jsx47("div", { className: "rounded-md border", children: /* @__PURE__ */ jsxs42(Table9, { children: [
5566
- /* @__PURE__ */ jsx47(TableHeader9, { children: /* @__PURE__ */ jsxs42(TableRow9, { children: [
5682
+ /* @__PURE__ */ jsx47("div", { className: "rounded-md border", children: /* @__PURE__ */ jsxs41(Table9, { children: [
5683
+ /* @__PURE__ */ jsx47(TableHeader9, { children: /* @__PURE__ */ jsxs41(TableRow9, { children: [
5567
5684
  /* @__PURE__ */ jsx47(TableHead9, { className: "w-[40px] pl-4" }),
5568
5685
  /* @__PURE__ */ jsx47(TableHead9, { children: "Timestamp" }),
5569
5686
  /* @__PURE__ */ jsx47(TableHead9, { children: "Event" }),
@@ -5571,8 +5688,8 @@ function WebhooksLogsPage() {
5571
5688
  /* @__PURE__ */ jsx47(TableHead9, { children: "Status" }),
5572
5689
  /* @__PURE__ */ jsx47(TableHead9, { children: "Latency" })
5573
5690
  ] }) }),
5574
- /* @__PURE__ */ jsxs42(TableBody9, { children: [
5575
- filteredLogs.map((log) => /* @__PURE__ */ jsxs42(TableRow9, { className: "cursor-pointer hover:bg-muted/50", onClick: () => handleRowClick(log), children: [
5691
+ /* @__PURE__ */ jsxs41(TableBody9, { children: [
5692
+ filteredLogs.map((log) => /* @__PURE__ */ jsxs41(TableRow9, { className: "cursor-pointer hover:bg-muted/50", onClick: () => handleRowClick(log), children: [
5576
5693
  /* @__PURE__ */ jsx47(TableCell9, { className: "py-3 pl-4", children: /* @__PURE__ */ jsx47(StatusDot, { status: log.statusCode }) }),
5577
5694
  /* @__PURE__ */ jsx47(TableCell9, { className: "py-3 text-muted-foreground", children: formatTimestamp2(log.timestamp) }),
5578
5695
  /* @__PURE__ */ jsx47(TableCell9, { className: "py-3 font-mono text-sm", children: log.eventName }),
@@ -5580,9 +5697,9 @@ function WebhooksLogsPage() {
5580
5697
  /* @__PURE__ */ jsx47(TableCell9, { className: "py-3", children: /* @__PURE__ */ jsx47(StatusBadge, { status: log.statusCode }) }),
5581
5698
  /* @__PURE__ */ jsx47(TableCell9, { className: "py-3 text-muted-foreground", children: formatLatency2(log.latency) })
5582
5699
  ] }, log.id)),
5583
- filteredLogs.length === 0 && /* @__PURE__ */ jsx47(TableRow9, { children: /* @__PURE__ */ jsx47(TableCell9, { colSpan: 6, className: "py-16", children: /* @__PURE__ */ jsxs42("div", { className: "flex flex-col items-center justify-center gap-4 text-center", children: [
5700
+ filteredLogs.length === 0 && /* @__PURE__ */ jsx47(TableRow9, { children: /* @__PURE__ */ jsx47(TableCell9, { colSpan: 6, className: "py-16", children: /* @__PURE__ */ jsxs41("div", { className: "flex flex-col items-center justify-center gap-4 text-center", children: [
5584
5701
  /* @__PURE__ */ jsx47("div", { className: "rounded-full bg-muted p-4", children: /* @__PURE__ */ jsx47(ScrollText, { className: "h-8 w-8 text-muted-foreground" }) }),
5585
- /* @__PURE__ */ jsxs42("div", { children: [
5702
+ /* @__PURE__ */ jsxs41("div", { children: [
5586
5703
  /* @__PURE__ */ jsx47("p", { className: "font-medium", children: "No logs found" }),
5587
5704
  /* @__PURE__ */ jsx47("p", { className: "text-sm text-muted-foreground mt-1", children: "No webhook deliveries match the current filter." })
5588
5705
  ] })
@@ -5590,19 +5707,19 @@ function WebhooksLogsPage() {
5590
5707
  ] })
5591
5708
  ] }) })
5592
5709
  ] }),
5593
- /* @__PURE__ */ jsx47(Sheet2, { open: sheetOpen, onOpenChange: setSheetOpen, children: /* @__PURE__ */ jsx47(SheetContent2, { className: "w-full sm:max-w-lg overflow-y-auto", children: selectedLog && /* @__PURE__ */ jsxs42(Fragment21, { children: [
5594
- /* @__PURE__ */ jsxs42(SheetHeader2, { children: [
5710
+ /* @__PURE__ */ jsx47(Sheet2, { open: sheetOpen, onOpenChange: setSheetOpen, children: /* @__PURE__ */ jsx47(SheetContent2, { className: "w-full sm:max-w-lg overflow-y-auto", children: selectedLog && /* @__PURE__ */ jsxs41(Fragment20, { children: [
5711
+ /* @__PURE__ */ jsxs41(SheetHeader2, { children: [
5595
5712
  /* @__PURE__ */ jsx47(SheetTitle2, { className: "font-mono text-sm", children: selectedLog.eventName }),
5596
- /* @__PURE__ */ jsxs42(SheetDescription2, { className: "flex items-center gap-2 text-sm", children: [
5713
+ /* @__PURE__ */ jsxs41(SheetDescription2, { className: "flex items-center gap-2 text-sm", children: [
5597
5714
  /* @__PURE__ */ jsx47(StatusBadge, { status: selectedLog.statusCode }),
5598
5715
  /* @__PURE__ */ jsx47("span", { children: "\u2022" }),
5599
5716
  /* @__PURE__ */ jsx47("span", { children: formatLatency2(selectedLog.latency) })
5600
5717
  ] })
5601
5718
  ] }),
5602
- /* @__PURE__ */ jsxs42("div", { className: "mt-6 space-y-6 px-4", children: [
5603
- /* @__PURE__ */ jsxs42("div", { className: "space-y-1 text-sm text-muted-foreground", children: [
5719
+ /* @__PURE__ */ jsxs41("div", { className: "mt-6 space-y-6 px-4", children: [
5720
+ /* @__PURE__ */ jsxs41("div", { className: "space-y-1 text-sm text-muted-foreground", children: [
5604
5721
  /* @__PURE__ */ jsx47("p", { children: formatFullTimestamp(selectedLog.timestamp) }),
5605
- /* @__PURE__ */ jsxs42(
5722
+ /* @__PURE__ */ jsxs41(
5606
5723
  "button",
5607
5724
  {
5608
5725
  type: "button",
@@ -5615,15 +5732,15 @@ function WebhooksLogsPage() {
5615
5732
  }
5616
5733
  )
5617
5734
  ] }),
5618
- /* @__PURE__ */ jsxs42("div", { children: [
5735
+ /* @__PURE__ */ jsxs41("div", { children: [
5619
5736
  /* @__PURE__ */ jsx47("h4", { className: "text-sm font-semibold mb-2", children: "Request Payload" }),
5620
5737
  /* @__PURE__ */ jsx47(JsonViewer, { data: selectedLog.requestPayload })
5621
5738
  ] }),
5622
- /* @__PURE__ */ jsxs42("div", { children: [
5739
+ /* @__PURE__ */ jsxs41("div", { children: [
5623
5740
  /* @__PURE__ */ jsx47("h4", { className: "text-sm font-semibold mb-2", children: "Response" }),
5624
5741
  selectedLog.responseBody ? /* @__PURE__ */ jsx47("div", { className: "rounded-md border bg-muted p-4 text-sm font-mono", children: selectedLog.responseBody }) : /* @__PURE__ */ jsx47("p", { className: "text-sm text-muted-foreground", children: "No response received" })
5625
5742
  ] }),
5626
- selectedLog.statusCode >= 400 && /* @__PURE__ */ jsxs42(Button19, { onClick: handleRetry, children: [
5743
+ selectedLog.statusCode >= 400 && /* @__PURE__ */ jsxs41(Button19, { onClick: handleRetry, children: [
5627
5744
  /* @__PURE__ */ jsx47(RefreshCw2, { className: "h-4 w-4" }),
5628
5745
  "Retry Delivery"
5629
5746
  ] })
@@ -5633,14 +5750,14 @@ function WebhooksLogsPage() {
5633
5750
  }
5634
5751
 
5635
5752
  // src/developer/router.tsx
5636
- import { Fragment as Fragment22, jsx as jsx48, jsxs as jsxs43 } from "react/jsx-runtime";
5753
+ import { Fragment as Fragment21, jsx as jsx48, jsxs as jsxs42 } from "react/jsx-runtime";
5637
5754
  function isNextJs() {
5638
5755
  if (typeof window === "undefined") return false;
5639
5756
  return "__NEXT_DATA__" in window;
5640
5757
  }
5641
5758
  function UrlSync({ basePath }) {
5642
5759
  const location = useLocation2();
5643
- useEffect9(() => {
5760
+ useEffect8(() => {
5644
5761
  const normalizedBase = basePath.endsWith("/") ? basePath.slice(0, -1) : basePath;
5645
5762
  const path = location.pathname === "/" ? "" : location.pathname;
5646
5763
  const fullPath = `${normalizedBase}${path}${location.search}${location.hash}`;
@@ -5664,7 +5781,7 @@ function DashboardRouter({ basePath = "/", children }) {
5664
5781
  const useMemoryRouter = isNextJs();
5665
5782
  const initialPath = getInitialPathFromUrl(basePath);
5666
5783
  if (useMemoryRouter) {
5667
- return /* @__PURE__ */ jsxs43(MemoryRouter, { initialEntries: [initialPath], children: [
5784
+ return /* @__PURE__ */ jsxs42(MemoryRouter, { initialEntries: [initialPath], children: [
5668
5785
  /* @__PURE__ */ jsx48(UrlSync, { basePath }),
5669
5786
  children
5670
5787
  ] });
@@ -5673,19 +5790,20 @@ function DashboardRouter({ basePath = "/", children }) {
5673
5790
  }
5674
5791
  function DashboardRoutes() {
5675
5792
  const routes = useRoutes();
5676
- return /* @__PURE__ */ jsx48(Routes, { children: /* @__PURE__ */ jsxs43(Route, { element: /* @__PURE__ */ jsx48(DashboardLayout, {}), children: [
5793
+ const customRoutes = useCustomRoutes();
5794
+ return /* @__PURE__ */ jsx48(Routes, { children: /* @__PURE__ */ jsxs42(Route, { element: /* @__PURE__ */ jsx48(DashboardLayout, {}), children: [
5677
5795
  routes.overview && /* @__PURE__ */ jsx48(Route, { index: true, element: /* @__PURE__ */ jsx48(OverviewPage, {}) }),
5678
5796
  routes.requests && /* @__PURE__ */ jsx48(Route, { path: "requests", element: /* @__PURE__ */ jsx48(RequestsPage, {}) }),
5679
5797
  routes.keys && /* @__PURE__ */ jsx48(Route, { path: "keys", element: /* @__PURE__ */ jsx48(KeysPage, {}) }),
5680
5798
  routes.team && /* @__PURE__ */ jsx48(Route, { path: "team", element: /* @__PURE__ */ jsx48(TeamPage, {}) }),
5681
5799
  routes.billing && /* @__PURE__ */ jsx48(Route, { path: "billing", element: /* @__PURE__ */ jsx48(BillingPage, {}) }),
5682
- routes.settings && /* @__PURE__ */ jsxs43(Fragment22, { children: [
5800
+ routes.settings && /* @__PURE__ */ jsxs42(Fragment21, { children: [
5683
5801
  /* @__PURE__ */ jsx48(Route, { path: "settings", element: /* @__PURE__ */ jsx48(Navigate, { to: "settings/profile", replace: true }) }),
5684
5802
  /* @__PURE__ */ jsx48(Route, { path: "settings/profile", element: /* @__PURE__ */ jsx48(SettingsProfilePage, {}) }),
5685
5803
  /* @__PURE__ */ jsx48(Route, { path: "settings/security", element: /* @__PURE__ */ jsx48(SettingsSecurityPage, {}) }),
5686
5804
  /* @__PURE__ */ jsx48(Route, { path: "settings/sessions", element: /* @__PURE__ */ jsx48(SettingsSessionsPage, {}) })
5687
5805
  ] }),
5688
- routes.webhooks && /* @__PURE__ */ jsxs43(Fragment22, { children: [
5806
+ routes.webhooks && /* @__PURE__ */ jsxs42(Fragment21, { children: [
5689
5807
  /* @__PURE__ */ jsx48(Route, { path: "webhooks", element: /* @__PURE__ */ jsx48(Navigate, { to: "webhooks/endpoints", replace: true }) }),
5690
5808
  /* @__PURE__ */ jsx48(Route, { path: "webhooks/endpoints", element: /* @__PURE__ */ jsx48(WebhooksEndpointsPage, {}) }),
5691
5809
  /* @__PURE__ */ jsx48(Route, { path: "webhooks/activity", element: /* @__PURE__ */ jsx48(WebhooksActivityPage, {}) }),
@@ -5695,25 +5813,185 @@ function DashboardRoutes() {
5695
5813
  routes.database && /* @__PURE__ */ jsx48(Route, { path: "database", element: /* @__PURE__ */ jsx48(DatabasePage, {}) }),
5696
5814
  routes.integrations && /* @__PURE__ */ jsx48(Route, { path: "integrations", element: /* @__PURE__ */ jsx48(IntegrationsPage, {}) }),
5697
5815
  routes.vault && /* @__PURE__ */ jsx48(Route, { path: "vault", element: /* @__PURE__ */ jsx48(VaultPage, {}) }),
5698
- /* @__PURE__ */ jsx48(Route, { path: "*", element: /* @__PURE__ */ jsx48(Navigate, { to: "/", replace: true }) })
5816
+ customRoutes.map((route) => /* @__PURE__ */ jsx48(
5817
+ Route,
5818
+ {
5819
+ path: route.path.startsWith("/") ? route.path.slice(1) : route.path,
5820
+ index: route.index,
5821
+ element: route.element
5822
+ },
5823
+ route.path
5824
+ )),
5825
+ (() => {
5826
+ const indexRoute = customRoutes.find((r) => r.index);
5827
+ const fallbackPath = indexRoute?.path || customRoutes[0]?.path || "/";
5828
+ return /* @__PURE__ */ jsx48(Route, { path: "*", element: /* @__PURE__ */ jsx48(Navigate, { to: fallbackPath, replace: true }) });
5829
+ })()
5699
5830
  ] }) });
5700
5831
  }
5701
5832
 
5702
5833
  // src/developer/developer-dashboard.tsx
5703
5834
  import { jsx as jsx49 } from "react/jsx-runtime";
5704
- function DeveloperDashboard({ config }) {
5835
+ function propsToConfig(props) {
5836
+ const routes = {
5837
+ overview: props.routes?.overview ?? true,
5838
+ requests: props.routes?.requests ?? props.showLogs ?? props.showUsage ?? true,
5839
+ keys: props.routes?.keys ?? props.showAPIKeys ?? true,
5840
+ team: props.routes?.team ?? true,
5841
+ billing: props.routes?.billing ?? true,
5842
+ settings: props.routes?.settings ?? true,
5843
+ webhooks: props.routes?.webhooks ?? props.showWebhooks ?? false,
5844
+ database: props.routes?.database ?? false,
5845
+ integrations: props.routes?.integrations ?? false,
5846
+ vault: props.routes?.vault ?? false
5847
+ };
5848
+ const customRoutes = props.customRoutes?.map((route) => ({
5849
+ path: route.path,
5850
+ label: route.label,
5851
+ icon: route.icon ? getIconByName(route.icon) : void 0,
5852
+ element: route.element,
5853
+ group: route.group,
5854
+ order: route.order,
5855
+ index: route.index
5856
+ }));
5857
+ const identity = props.identity ?? {
5858
+ clientId: "demo",
5859
+ useMockWidgets: true,
5860
+ required: false,
5861
+ onUnauthenticated: "allow"
5862
+ };
5863
+ return {
5864
+ basePath: props.basePath ?? "/",
5865
+ branding: props.branding,
5866
+ routes,
5867
+ customRoutes,
5868
+ theme: props.theme,
5869
+ identity,
5870
+ devToken: props.devToken,
5871
+ debug: props.debug
5872
+ };
5873
+ }
5874
+ function isLegacyConfig(props) {
5875
+ return "config" in props && props.config !== void 0;
5876
+ }
5877
+ function DeveloperDashboard(props) {
5878
+ const config = isLegacyConfig(props) ? props.config : propsToConfig(props);
5705
5879
  return /* @__PURE__ */ jsx49(AppProviders, { config, children: /* @__PURE__ */ jsx49(AuthGate, { children: /* @__PURE__ */ jsx49(DashboardRouter, { basePath: config.basePath, children: /* @__PURE__ */ jsx49(DashboardRoutes, {}) }) }) });
5706
5880
  }
5707
- var export_ThemeScript = themes_exports.ThemeScript;
5708
- var export_applyThemeToElement = themes_exports.applyThemeToElement;
5709
- var export_getResolvedMode = themes_exports.getResolvedMode;
5710
- var export_getThemeCSS = themes_exports.getThemeCSS;
5711
- var export_getThemeScriptContent = themes_exports.getThemeScriptContent;
5712
- var export_isThemePreset = themes_exports.isThemePreset;
5713
- var export_themeCSS = themes_exports.themeCSS;
5714
- var export_themeNames = themes_exports.themeNames;
5715
- var export_themePresets = themes_exports.themePresets;
5716
- var export_useThemeStore = themes_exports.useThemeStore;
5881
+
5882
+ // src/developer/standalone/provider.tsx
5883
+ import { ThemeProvider as ThemeProvider2 } from "next-themes";
5884
+ import { applyThemeToElement as applyThemeToElement2 } from "@mdxui/themes";
5885
+ import { useEffect as useEffect9, useRef as useRef3 } from "react";
5886
+ import { jsx as jsx50 } from "react/jsx-runtime";
5887
+ function StandaloneProvider({ config, children }) {
5888
+ const themeMode = config?.theme?.mode ?? "system";
5889
+ const containerRef = useRef3(null);
5890
+ useEffect9(() => {
5891
+ if (containerRef.current && config?.theme?.preset) {
5892
+ const resolvedMode = config.theme.mode === "system" ? "light" : config.theme.mode ?? "light";
5893
+ applyThemeToElement2(containerRef.current, config.theme.preset, resolvedMode);
5894
+ }
5895
+ }, [config?.theme]);
5896
+ return /* @__PURE__ */ jsx50(
5897
+ ThemeProvider2,
5898
+ {
5899
+ attribute: "class",
5900
+ defaultTheme: themeMode,
5901
+ enableSystem: themeMode === "system",
5902
+ disableTransitionOnChange: true,
5903
+ children: /* @__PURE__ */ jsx50("div", { ref: containerRef, className: "standalone-provider", children })
5904
+ }
5905
+ );
5906
+ }
5907
+
5908
+ // src/developer/standalone/api-keys.tsx
5909
+ import { jsx as jsx51 } from "react/jsx-runtime";
5910
+ function StandaloneAPIKeys({
5911
+ keys,
5912
+ onCreateKey,
5913
+ onRevokeKey,
5914
+ onRenameKey,
5915
+ hideHeader = true,
5916
+ className
5917
+ }) {
5918
+ return /* @__PURE__ */ jsx51(
5919
+ KeysPage,
5920
+ {
5921
+ keys,
5922
+ onCreateKey,
5923
+ onRevokeKey,
5924
+ onRenameKey,
5925
+ hideHeader,
5926
+ className
5927
+ }
5928
+ );
5929
+ }
5930
+
5931
+ // src/developer/standalone/webhooks.tsx
5932
+ import { jsx as jsx52 } from "react/jsx-runtime";
5933
+ function StandaloneWebhooks({
5934
+ endpoints,
5935
+ onCreateEndpoint,
5936
+ onUpdateEndpoint,
5937
+ onDeleteEndpoint,
5938
+ hideHeader = true,
5939
+ className
5940
+ }) {
5941
+ return /* @__PURE__ */ jsx52(
5942
+ WebhooksEndpointsPage,
5943
+ {
5944
+ endpoints,
5945
+ onCreateEndpoint,
5946
+ onUpdateEndpoint,
5947
+ onDeleteEndpoint,
5948
+ hideHeader,
5949
+ className
5950
+ }
5951
+ );
5952
+ }
5953
+
5954
+ // src/developer/standalone/billing.tsx
5955
+ import { jsx as jsx53 } from "react/jsx-runtime";
5956
+ function StandaloneBilling({
5957
+ billingData,
5958
+ onManagePlan,
5959
+ onUpdatePaymentMethod,
5960
+ onDownloadInvoice,
5961
+ onToggleAlerts,
5962
+ hideHeader = true,
5963
+ className
5964
+ }) {
5965
+ return /* @__PURE__ */ jsx53(
5966
+ BillingPage,
5967
+ {
5968
+ billingData,
5969
+ onManagePlan,
5970
+ onUpdatePaymentMethod,
5971
+ onDownloadInvoice,
5972
+ onToggleAlerts,
5973
+ hideHeader,
5974
+ className
5975
+ }
5976
+ );
5977
+ }
5978
+
5979
+ // src/developer/standalone/team.tsx
5980
+ import { jsx as jsx54 } from "react/jsx-runtime";
5981
+ function StandaloneTeam({
5982
+ useMockWidgets,
5983
+ hideHeader = true,
5984
+ className
5985
+ }) {
5986
+ return /* @__PURE__ */ jsx54(
5987
+ TeamPage,
5988
+ {
5989
+ useMockWidgets,
5990
+ hideHeader,
5991
+ className
5992
+ }
5993
+ );
5994
+ }
5717
5995
  export {
5718
5996
  APIKeyManager,
5719
5997
  ActivityFeed,
@@ -5748,12 +6026,17 @@ export {
5748
6026
  SettingsSessionsPage,
5749
6027
  SidebarAd,
5750
6028
  SortableHeader,
6029
+ StandaloneAPIKeys,
6030
+ StandaloneBilling,
6031
+ StandaloneProvider,
6032
+ StandaloneTeam,
6033
+ StandaloneWebhooks,
5751
6034
  StatusBadge,
5752
6035
  StatusDot,
5753
6036
  TeamManager,
5754
6037
  TeamPage,
5755
6038
  TeamSwitcher,
5756
- export_ThemeScript as ThemeScript,
6039
+ ThemeScript,
5757
6040
  UserProfile,
5758
6041
  VaultDeleteDialog,
5759
6042
  VaultEmptyState,
@@ -5765,27 +6048,30 @@ export {
5765
6048
  WebhooksEndpointsPage,
5766
6049
  WebhooksEventCatalogPage,
5767
6050
  WebhooksLogsPage,
5768
- export_applyThemeToElement as applyThemeToElement,
6051
+ applyThemeToElement3 as applyThemeToElement,
6052
+ dashboardIcons,
5769
6053
  getAuthToken,
5770
6054
  getDebugStatus,
5771
6055
  getEffectiveToken,
5772
- export_getResolvedMode as getResolvedMode,
6056
+ getIconByName,
6057
+ getResolvedMode,
5773
6058
  getSDK,
5774
- export_getThemeCSS as getThemeCSS,
5775
- export_getThemeScriptContent as getThemeScriptContent,
6059
+ getThemeCSS,
6060
+ getThemeScriptContent,
5776
6061
  isAuthenticated,
5777
6062
  isDebugMode,
5778
- export_isThemePreset as isThemePreset,
6063
+ isThemePreset,
5779
6064
  setDebugMode,
5780
6065
  setDevToken,
5781
6066
  testSDKConnection,
5782
- export_themeCSS as themeCSS,
5783
- export_themeNames as themeNames,
5784
- export_themePresets as themePresets,
5785
- useAuth10 as useAuth,
6067
+ themeCSS,
6068
+ themeNames,
6069
+ themePresets,
6070
+ useAuth9 as useAuth,
5786
6071
  useCommandPalette,
6072
+ useCustomRoutes,
5787
6073
  useDashboard,
5788
6074
  useRoutes,
5789
- export_useThemeStore as useThemeStore
6075
+ useThemeStore
5790
6076
  };
5791
6077
  //# sourceMappingURL=index.js.map