@mdxui/cockpit 0.2.0 → 2.1.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.
package/dist/index.js CHANGED
@@ -1,73 +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 __objRest = (source, exclude) => {
23
- var target = {};
24
- for (var prop in source)
25
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
26
- target[prop] = source[prop];
27
- if (source != null && __getOwnPropSymbols)
28
- for (var prop of __getOwnPropSymbols(source)) {
29
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
30
- target[prop] = source[prop];
31
- }
32
- return target;
33
- };
34
- var __copyProps = (to, from, except, desc) => {
35
- if (from && typeof from === "object" || typeof from === "function") {
36
- for (let key of __getOwnPropNames(from))
37
- if (!__hasOwnProp.call(to, key) && key !== except)
38
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
39
- }
40
- return to;
41
- };
42
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
43
- var __async = (__this, __arguments, generator) => {
44
- return new Promise((resolve, reject) => {
45
- var fulfilled = (value) => {
46
- try {
47
- step(generator.next(value));
48
- } catch (e) {
49
- reject(e);
50
- }
51
- };
52
- var rejected = (value) => {
53
- try {
54
- step(generator.throw(value));
55
- } catch (e) {
56
- reject(e);
57
- }
58
- };
59
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
60
- step((generator = generator.apply(__this, __arguments)).next());
61
- });
62
- };
63
-
64
1
  // src/developer/index.ts
65
2
  import { useAuth as useAuth10 } from "@workos-inc/authkit-react";
66
-
67
- // src/developer/themes/index.ts
68
- var themes_exports = {};
69
- __reExport(themes_exports, themes_star);
70
- import * as themes_star from "@mdxui/themes";
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";
71
15
 
72
16
  // src/developer/components/dashboard/activity-feed.tsx
73
17
  import { Avatar, AvatarFallback, AvatarImage } from "@mdxui/primitives/avatar";
@@ -469,7 +413,6 @@ function DataTable({
469
413
  className,
470
414
  emptyMessage = "No results found."
471
415
  }) {
472
- var _a, _b, _c;
473
416
  const [sorting, setSorting] = useState2([]);
474
417
  const [columnFilters, setColumnFilters] = useState2([]);
475
418
  const [columnVisibility, setColumnVisibility] = useState2({});
@@ -502,11 +445,8 @@ function DataTable({
502
445
  Input,
503
446
  {
504
447
  placeholder: searchPlaceholder,
505
- value: (_b = (_a = table.getColumn(searchColumn)) == null ? void 0 : _a.getFilterValue()) != null ? _b : "",
506
- onChange: (event) => {
507
- var _a2;
508
- return (_a2 = table.getColumn(searchColumn)) == null ? void 0 : _a2.setFilterValue(event.target.value);
509
- },
448
+ value: table.getColumn(searchColumn)?.getFilterValue() ?? "",
449
+ onChange: (event) => table.getColumn(searchColumn)?.setFilterValue(event.target.value),
510
450
  className: "max-w-sm"
511
451
  }
512
452
  ) }),
@@ -514,7 +454,7 @@ function DataTable({
514
454
  /* @__PURE__ */ jsx6(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx6(TableRow, { children: headerGroup.headers.map((header) => {
515
455
  return /* @__PURE__ */ jsx6(TableHead, { children: header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()) }, header.id);
516
456
  }) }, headerGroup.id)) }),
517
- /* @__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 }) }) })
518
458
  ] }) }),
519
459
  paginated && /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between px-2", children: [
520
460
  /* @__PURE__ */ jsx6("div", { className: "flex-1 text-sm text-muted-foreground", children: table.getFilteredSelectedRowModel().rows.length > 0 && /* @__PURE__ */ jsxs5("span", { children: [
@@ -751,6 +691,7 @@ import { createContext, useContext, useMemo } from "react";
751
691
  // src/developer/hooks/use-theme-loader.ts
752
692
  import { useTheme } from "next-themes";
753
693
  import { useEffect as useEffect2, useRef } from "react";
694
+ import { applyThemeToElement } from "@mdxui/themes";
754
695
  function useThemeLoader(preset) {
755
696
  const { resolvedTheme } = useTheme();
756
697
  const currentPresetRef = useRef(void 0);
@@ -759,7 +700,7 @@ function useThemeLoader(preset) {
759
700
  if (!preset || !resolvedTheme) return;
760
701
  if (preset === currentPresetRef.current && resolvedTheme === currentModeRef.current) return;
761
702
  const mode = resolvedTheme === "dark" ? "dark" : "light";
762
- (0, themes_exports.applyThemeToElement)(document.documentElement, preset, mode);
703
+ applyThemeToElement(document.documentElement, preset, mode);
763
704
  currentPresetRef.current = preset;
764
705
  currentModeRef.current = resolvedTheme;
765
706
  }, [preset, resolvedTheme]);
@@ -813,6 +754,7 @@ var defaultConfig = {
813
754
  logo: void 0
814
755
  },
815
756
  routes: defaultRoutes,
757
+ customRoutes: [],
816
758
  theme: {
817
759
  preset: "cyan",
818
760
  mode: "system",
@@ -825,15 +767,19 @@ import { jsx as jsx9 } from "react/jsx-runtime";
825
767
  var DashboardContext = createContext(null);
826
768
  function DashboardProvider({ config, children }) {
827
769
  const value = useMemo(() => {
828
- const mergedConfig = __spreadProps(__spreadValues(__spreadValues({}, defaultConfig), config), {
829
- branding: __spreadValues(__spreadValues({}, defaultConfig.branding), config.branding),
830
- routes: __spreadValues(__spreadValues({}, defaultRoutes), config.routes),
831
- theme: __spreadValues(__spreadValues({}, defaultConfig.theme), config.theme),
832
- identity: __spreadValues(__spreadValues({}, defaultIdentity), config.identity)
833
- });
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
+ };
834
779
  return {
835
780
  config: mergedConfig,
836
781
  routes: mergedConfig.routes,
782
+ customRoutes: mergedConfig.customRoutes,
837
783
  basePath: mergedConfig.basePath
838
784
  };
839
785
  }, [config]);
@@ -852,6 +798,10 @@ function useRoutes() {
852
798
  const { routes } = useDashboard();
853
799
  return routes;
854
800
  }
801
+ function useCustomRoutes() {
802
+ const { customRoutes } = useDashboard();
803
+ return customRoutes;
804
+ }
855
805
 
856
806
  // src/developer/components/ui/sidebar-ad.tsx
857
807
  import { useSidebar } from "@mdxui/primitives/sidebar";
@@ -866,7 +816,7 @@ function SidebarAd({ headline, description, ctaText, ctaHref, onCtaClick, dismis
866
816
  if (state === "collapsed") return null;
867
817
  const handleDismiss = () => {
868
818
  setIsDismissed(true);
869
- onDismiss == null ? void 0 : onDismiss();
819
+ onDismiss?.();
870
820
  };
871
821
  const handleCtaClick = () => {
872
822
  if (onCtaClick) {
@@ -971,8 +921,19 @@ function NavUser({ user, onSignOut }) {
971
921
  // src/developer/components/layout/dashboard-layout.tsx
972
922
  import { Fragment as Fragment2, jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
973
923
  function useNavItems() {
974
- const { routes } = useDashboard();
924
+ const { routes, customRoutes } = useDashboard();
975
925
  const items = [];
926
+ const customRouteToNavItem = (route) => ({
927
+ title: route.label,
928
+ url: route.path.startsWith("/") ? route.path : `/${route.path}`,
929
+ icon: route.icon
930
+ });
931
+ const sortedCustomRoutes = [...customRoutes].sort((a, b) => {
932
+ return (a.order ?? 100) - (b.order ?? 100);
933
+ });
934
+ const mainRoutes = sortedCustomRoutes.filter((r) => r.group === "main" || r.group === void 0);
935
+ const secondaryRoutes = sortedCustomRoutes.filter((r) => r.group === "secondary");
936
+ const adminRoutes = sortedCustomRoutes.filter((r) => r.group === "admin");
976
937
  if (routes.overview) {
977
938
  items.push({
978
939
  title: "Overview",
@@ -1012,7 +973,13 @@ function useNavItems() {
1012
973
  items.push({
1013
974
  title: "Webhooks",
1014
975
  url: "/webhooks",
1015
- icon: Webhook
976
+ icon: Webhook,
977
+ items: [
978
+ { title: "Endpoints", url: "/webhooks/endpoints" },
979
+ { title: "Activity", url: "/webhooks/activity" },
980
+ { title: "Logs", url: "/webhooks/logs" },
981
+ { title: "Event Catalog", url: "/webhooks/event-catalog" }
982
+ ]
1016
983
  });
1017
984
  }
1018
985
  if (routes.database) {
@@ -1036,24 +1003,37 @@ function useNavItems() {
1036
1003
  icon: Lock
1037
1004
  });
1038
1005
  }
1006
+ for (const route of mainRoutes) {
1007
+ items.push(customRouteToNavItem(route));
1008
+ }
1009
+ for (const route of secondaryRoutes) {
1010
+ items.push(customRouteToNavItem(route));
1011
+ }
1039
1012
  if (routes.settings) {
1040
1013
  items.push({
1041
1014
  title: "Settings",
1042
1015
  url: "/settings",
1043
- icon: Settings
1016
+ icon: Settings,
1017
+ items: [
1018
+ { title: "Profile", url: "/settings/profile" },
1019
+ { title: "Security", url: "/settings/security" },
1020
+ { title: "Sessions", url: "/settings/sessions" }
1021
+ ]
1044
1022
  });
1045
1023
  }
1024
+ for (const route of adminRoutes) {
1025
+ items.push(customRouteToNavItem(route));
1026
+ }
1046
1027
  return items;
1047
1028
  }
1048
1029
  function DashboardLayout() {
1049
- var _a;
1050
1030
  const { user, signOut } = useAuth2();
1051
1031
  const navItems = useNavItems();
1052
1032
  const navUser = user ? {
1053
1033
  id: user.id,
1054
1034
  name: user.firstName && user.lastName ? `${user.firstName} ${user.lastName}` : user.email,
1055
1035
  email: user.email,
1056
- avatar: (_a = user.profilePictureUrl) != null ? _a : void 0
1036
+ avatar: user.profilePictureUrl ?? void 0
1057
1037
  } : null;
1058
1038
  return /* @__PURE__ */ jsx14(
1059
1039
  DashboardShell,
@@ -1091,14 +1071,13 @@ function FeatureCard({ icon, title, description }) {
1091
1071
  ] });
1092
1072
  }
1093
1073
  function LandingPage() {
1094
- var _a, _b, _c;
1095
1074
  const { signIn } = useAuth3();
1096
1075
  const { config } = useDashboard();
1097
- const brandName = (_b = (_a = config.branding) == null ? void 0 : _a.name) != null ? _b : "Dashboard";
1076
+ const brandName = config.branding?.name ?? "Dashboard";
1098
1077
  return /* @__PURE__ */ jsxs11("div", { className: "min-h-screen bg-background flex flex-col", children: [
1099
1078
  /* @__PURE__ */ jsx15("header", { className: "border-b", children: /* @__PURE__ */ jsxs11("div", { className: "container mx-auto px-4 h-16 flex items-center justify-between", children: [
1100
1079
  /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", children: [
1101
- (_c = config.branding) == null ? void 0 : _c.logo,
1080
+ config.branding?.logo,
1102
1081
  /* @__PURE__ */ jsx15("span", { className: "font-semibold text-lg", children: brandName })
1103
1082
  ] }),
1104
1083
  /* @__PURE__ */ jsxs11(Button2, { onClick: () => signIn(), children: [
@@ -1182,11 +1161,11 @@ function JsonViewer({ data, className }) {
1182
1161
  theme
1183
1162
  }).then(setHtml);
1184
1163
  }, [jsonString, resolvedTheme]);
1185
- const handleCopy = () => __async(null, null, function* () {
1186
- yield navigator.clipboard.writeText(jsonString);
1164
+ const handleCopy = async () => {
1165
+ await navigator.clipboard.writeText(jsonString);
1187
1166
  setCopied(true);
1188
1167
  setTimeout(() => setCopied(false), 2e3);
1189
- });
1168
+ };
1190
1169
  return /* @__PURE__ */ jsxs12("div", { className: cn5("relative rounded-md border bg-muted", className), children: [
1191
1170
  /* @__PURE__ */ jsx16(
1192
1171
  "button",
@@ -1322,11 +1301,11 @@ function VaultInputModal({
1322
1301
  }) {
1323
1302
  const [values, setValues] = useState5({});
1324
1303
  const [loading, setLoading] = useState5(false);
1325
- const handleSubmit = (e) => __async(null, null, function* () {
1304
+ const handleSubmit = async (e) => {
1326
1305
  e.preventDefault();
1327
1306
  setLoading(true);
1328
1307
  try {
1329
- yield onSave(values);
1308
+ await onSave(values);
1330
1309
  setValues({});
1331
1310
  onClose();
1332
1311
  } catch (error) {
@@ -1334,16 +1313,13 @@ function VaultInputModal({
1334
1313
  } finally {
1335
1314
  setLoading(false);
1336
1315
  }
1337
- });
1316
+ };
1338
1317
  const handleClose = () => {
1339
1318
  setValues({});
1340
1319
  onClose();
1341
1320
  };
1342
1321
  if (!integration) return null;
1343
- const isValid = integration.fields.filter((f) => f.required).every((f) => {
1344
- var _a;
1345
- return (_a = values[f.key]) == null ? void 0 : _a.trim();
1346
- });
1322
+ const isValid = integration.fields.filter((f) => f.required).every((f) => values[f.key]?.trim());
1347
1323
  return /* @__PURE__ */ jsx20(Dialog3, { open: isOpen, onOpenChange: handleClose, children: /* @__PURE__ */ jsxs16(DialogContent3, { children: [
1348
1324
  /* @__PURE__ */ jsx20(DialogHeader2, { children: /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-3", children: [
1349
1325
  /* @__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(
@@ -1376,7 +1352,8 @@ function VaultInputModal({
1376
1352
  type: field.type,
1377
1353
  placeholder: field.placeholder,
1378
1354
  value: values[field.key] || "",
1379
- onChange: (e) => setValues((prev) => __spreadProps(__spreadValues({}, prev), {
1355
+ onChange: (e) => setValues((prev) => ({
1356
+ ...prev,
1380
1357
  [field.key]: e.target.value
1381
1358
  })),
1382
1359
  required: field.required
@@ -1557,19 +1534,19 @@ function VaultList({ items, onRotate, onDelete, onOpenAddModal }) {
1557
1534
  setSelectedItem(item);
1558
1535
  setDeleteDialogOpen(true);
1559
1536
  };
1560
- const handleConfirmDelete = () => __async(null, null, function* () {
1537
+ const handleConfirmDelete = async () => {
1561
1538
  if (!selectedItem) return;
1562
- yield onDelete(selectedItem.id);
1539
+ await onDelete(selectedItem.id);
1563
1540
  setDeleteDialogOpen(false);
1564
1541
  setSelectedItem(null);
1565
- });
1566
- const handleSave = (credentials) => __async(null, null, function* () {
1542
+ };
1543
+ const handleSave = async (credentials) => {
1567
1544
  if (modalMode === "rotate" && selectedItem) {
1568
- yield onRotate(selectedItem.id, credentials);
1545
+ await onRotate(selectedItem.id, credentials);
1569
1546
  }
1570
1547
  setInputModalOpen(false);
1571
1548
  setSelectedItem(null);
1572
- });
1549
+ };
1573
1550
  const getIntegrationForModal = () => {
1574
1551
  if (!selectedItem) return void 0;
1575
1552
  const fields = integrationFields[selectedItem.integrationId] || integrationFields.default;
@@ -1605,7 +1582,7 @@ function VaultList({ items, onRotate, onDelete, onOpenAddModal }) {
1605
1582
  setDeleteDialogOpen(false);
1606
1583
  setSelectedItem(null);
1607
1584
  },
1608
- itemName: (selectedItem == null ? void 0 : selectedItem.name) || "",
1585
+ itemName: selectedItem?.name || "",
1609
1586
  onConfirm: handleConfirmDelete
1610
1587
  }
1611
1588
  ),
@@ -1636,9 +1613,9 @@ import { Table as Table2, TableBody as TableBody2, TableCell as TableCell2, Tabl
1636
1613
  import { Mail, MoreHorizontal, Plus, Shield as Shield2, User } from "lucide-react";
1637
1614
  import { jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
1638
1615
  var mockUsers = [
1639
- { id: "1", name: "John Doe", email: "john@example.com", role: "Admin", avatar: "", status: "Active" },
1640
- { id: "2", name: "Jane Smith", email: "jane@example.com", role: "Member", avatar: "", status: "Active" },
1641
- { id: "3", name: "Bob Johnson", email: "bob@example.com", role: "Member", avatar: "", status: "Pending" }
1616
+ { id: "1", name: "John Doe", email: "john@example.com.ai", role: "Admin", avatar: "", status: "Active" },
1617
+ { id: "2", name: "Jane Smith", email: "jane@example.com.ai", role: "Member", avatar: "", status: "Active" },
1618
+ { id: "3", name: "Bob Johnson", email: "bob@example.com.ai", role: "Member", avatar: "", status: "Pending" }
1642
1619
  ];
1643
1620
  var mockSessions = [
1644
1621
  { id: "1", device: "Chrome on macOS", location: "San Francisco, CA", lastActive: "Now", current: true },
@@ -1712,7 +1689,7 @@ function MockUserProfile() {
1712
1689
  ] }),
1713
1690
  /* @__PURE__ */ jsxs19("div", { className: "space-y-2", children: [
1714
1691
  /* @__PURE__ */ jsx23(Label2, { htmlFor: "email", children: "Email" }),
1715
- /* @__PURE__ */ jsx23(Input3, { id: "email", type: "email", defaultValue: "john@example.com", disabled: true })
1692
+ /* @__PURE__ */ jsx23(Input3, { id: "email", type: "email", defaultValue: "john@example.com.ai", disabled: true })
1716
1693
  ] }),
1717
1694
  /* @__PURE__ */ jsx23(Button7, { children: "Save Changes" })
1718
1695
  ] })
@@ -1837,20 +1814,14 @@ function SettingsPage({ sections, children }) {
1837
1814
  ] }),
1838
1815
  /* @__PURE__ */ jsx24(Separator, {}),
1839
1816
  /* @__PURE__ */ jsxs20(Tabs, { value: activeTab, onValueChange: (value) => setActiveTab(value), className: "space-y-6", children: [
1840
- /* @__PURE__ */ jsx24(TabsList, { className: "grid w-full grid-cols-2 sm:grid-cols-3 lg:grid-cols-7 gap-2", children: activeSections.map((section) => {
1841
- var _a;
1842
- return /* @__PURE__ */ jsx24(TabsTrigger, { value: section, children: ((_a = sectionMeta[section]) == null ? void 0 : _a.title) || section }, section);
1843
- }) }),
1844
- activeSections.map((section, index) => {
1845
- var _a, _b;
1846
- return /* @__PURE__ */ jsx24(TabsContent, { value: section, className: "space-y-6", children: /* @__PURE__ */ jsxs20(Card8, { children: [
1847
- /* @__PURE__ */ jsxs20(CardHeader7, { children: [
1848
- /* @__PURE__ */ jsx24(CardTitle7, { children: ((_a = sectionMeta[section]) == null ? void 0 : _a.title) || section }),
1849
- /* @__PURE__ */ jsx24(CardDescription6, { children: ((_b = sectionMeta[section]) == null ? void 0 : _b.description) || `Manage your ${section} settings` })
1850
- ] }),
1851
- /* @__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" }) })
1852
- ] }) }, section);
1853
- })
1817
+ /* @__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)) }),
1818
+ activeSections.map((section, index) => /* @__PURE__ */ jsx24(TabsContent, { value: section, className: "space-y-6", children: /* @__PURE__ */ jsxs20(Card8, { children: [
1819
+ /* @__PURE__ */ jsxs20(CardHeader7, { children: [
1820
+ /* @__PURE__ */ jsx24(CardTitle7, { children: sectionMeta[section]?.title || section }),
1821
+ /* @__PURE__ */ jsx24(CardDescription6, { children: sectionMeta[section]?.description || `Manage your ${section} settings` })
1822
+ ] }),
1823
+ /* @__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" }) })
1824
+ ] }) }, section))
1854
1825
  ] })
1855
1826
  ] });
1856
1827
  }
@@ -1865,19 +1836,18 @@ import { Label as Label3 } from "@mdxui/primitives/label";
1865
1836
  import { User as User2, Mail as Mail2, Upload } from "lucide-react";
1866
1837
  import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
1867
1838
  function UserProfile({ user, onUpdate, readonly = false }) {
1868
- var _a, _b;
1869
1839
  const [formData, setFormData] = React2.useState({
1870
- firstName: (user == null ? void 0 : user.firstName) || ((_a = user == null ? void 0 : user.name) == null ? void 0 : _a.split(" ")[0]) || "",
1871
- lastName: (user == null ? void 0 : user.lastName) || ((_b = user == null ? void 0 : user.name) == null ? void 0 : _b.split(" ").slice(1).join(" ")) || "",
1872
- email: (user == null ? void 0 : user.email) || "",
1873
- avatar: (user == null ? void 0 : user.avatar) || ""
1840
+ firstName: user?.firstName || user?.name?.split(" ")[0] || "",
1841
+ lastName: user?.lastName || user?.name?.split(" ").slice(1).join(" ") || "",
1842
+ email: user?.email || "",
1843
+ avatar: user?.avatar || ""
1874
1844
  });
1875
1845
  const handleSubmit = (e) => {
1876
1846
  e.preventDefault();
1877
- onUpdate == null ? void 0 : onUpdate(formData);
1847
+ onUpdate?.(formData);
1878
1848
  };
1879
1849
  const handleChange = (field, value) => {
1880
- setFormData((prev) => __spreadProps(__spreadValues({}, prev), { [field]: value }));
1850
+ setFormData((prev) => ({ ...prev, [field]: value }));
1881
1851
  };
1882
1852
  const getInitials = () => {
1883
1853
  const first = formData.firstName[0] || "";
@@ -1946,7 +1916,7 @@ function UserProfile({ user, onUpdate, readonly = false }) {
1946
1916
  type: "email",
1947
1917
  value: formData.email,
1948
1918
  onChange: (e) => handleChange("email", e.target.value),
1949
- placeholder: "john@example.com",
1919
+ placeholder: "john@example.com.ai",
1950
1920
  disabled: true
1951
1921
  }
1952
1922
  ),
@@ -2030,14 +2000,14 @@ function APIKeyManager({
2030
2000
  return next;
2031
2001
  });
2032
2002
  };
2033
- const copyToClipboard = (text, label) => __async(null, null, function* () {
2003
+ const copyToClipboard = async (text, label) => {
2034
2004
  try {
2035
- yield navigator.clipboard.writeText(text);
2005
+ await navigator.clipboard.writeText(text);
2036
2006
  toast.success(`${label} copied to clipboard`);
2037
2007
  } catch (err) {
2038
2008
  toast.error("Failed to copy to clipboard");
2039
2009
  }
2040
- });
2010
+ };
2041
2011
  const handleCreateKey = () => {
2042
2012
  if (!newKeyName.trim()) {
2043
2013
  toast.error("Please enter a key name");
@@ -2249,7 +2219,7 @@ function TeamManager({
2249
2219
  {
2250
2220
  id: "1",
2251
2221
  name: "John Doe",
2252
- email: "john@example.com",
2222
+ email: "john@example.com.ai",
2253
2223
  role: "owner",
2254
2224
  avatar: "",
2255
2225
  status: "active",
@@ -2258,7 +2228,7 @@ function TeamManager({
2258
2228
  {
2259
2229
  id: "2",
2260
2230
  name: "Jane Smith",
2261
- email: "jane@example.com",
2231
+ email: "jane@example.com.ai",
2262
2232
  role: "admin",
2263
2233
  avatar: "",
2264
2234
  status: "active",
@@ -2267,7 +2237,7 @@ function TeamManager({
2267
2237
  {
2268
2238
  id: "3",
2269
2239
  name: "Bob Johnson",
2270
- email: "bob@example.com",
2240
+ email: "bob@example.com.ai",
2271
2241
  role: "member",
2272
2242
  avatar: "",
2273
2243
  status: "pending",
@@ -2300,14 +2270,14 @@ function TeamManager({
2300
2270
  const handleRoleChange = (memberId, newRole) => {
2301
2271
  setMembers(
2302
2272
  members.map(
2303
- (m) => m.id === memberId ? __spreadProps(__spreadValues({}, m), { role: newRole }) : m
2273
+ (m) => m.id === memberId ? { ...m, role: newRole } : m
2304
2274
  )
2305
2275
  );
2306
2276
  toast2.success("Member role updated");
2307
2277
  };
2308
2278
  const handleRemoveMember = (memberId) => {
2309
2279
  const member = members.find((m) => m.id === memberId);
2310
- if ((member == null ? void 0 : member.role) === "owner") {
2280
+ if (member?.role === "owner") {
2311
2281
  toast2.error("Cannot remove the workspace owner");
2312
2282
  return;
2313
2283
  }
@@ -2376,7 +2346,7 @@ function TeamManager({
2376
2346
  type: "email",
2377
2347
  value: inviteEmail,
2378
2348
  onChange: (e) => setInviteEmail(e.target.value),
2379
- placeholder: "colleague@example.com"
2349
+ placeholder: "colleague@example.com.ai"
2380
2350
  }
2381
2351
  )
2382
2352
  ] }),
@@ -2597,7 +2567,7 @@ function Billing({
2597
2567
  };
2598
2568
  const handleRemovePaymentMethod = (methodId) => {
2599
2569
  const method = paymentMethods.find((pm) => pm.id === methodId);
2600
- if (method == null ? void 0 : method.isDefault) {
2570
+ if (method?.isDefault) {
2601
2571
  toast3.error("Cannot remove default payment method");
2602
2572
  return;
2603
2573
  }
@@ -2606,7 +2576,8 @@ function Billing({
2606
2576
  };
2607
2577
  const handleSetDefaultPaymentMethod = (methodId) => {
2608
2578
  setPaymentMethods(
2609
- paymentMethods.map((pm) => __spreadProps(__spreadValues({}, pm), {
2579
+ paymentMethods.map((pm) => ({
2580
+ ...pm,
2610
2581
  isDefault: pm.id === methodId
2611
2582
  }))
2612
2583
  );
@@ -2822,6 +2793,29 @@ function Billing({
2822
2793
  ] });
2823
2794
  }
2824
2795
 
2796
+ // src/developer/lib/icons.ts
2797
+ import * as LucideIcons from "lucide-react";
2798
+ function getIconByName(name) {
2799
+ const icons = LucideIcons;
2800
+ const icon = icons[name];
2801
+ if (icon && typeof icon === "function") {
2802
+ return icon;
2803
+ }
2804
+ return void 0;
2805
+ }
2806
+ var dashboardIcons = {
2807
+ overview: "BarChart3",
2808
+ requests: "Activity",
2809
+ keys: "Key",
2810
+ team: "Users",
2811
+ billing: "CreditCard",
2812
+ settings: "Settings",
2813
+ webhooks: "Webhook",
2814
+ database: "Database",
2815
+ integrations: "Puzzle",
2816
+ vault: "Lock"
2817
+ };
2818
+
2825
2819
  // src/developer/providers/app-providers.tsx
2826
2820
  import { ThemeProvider } from "next-themes";
2827
2821
  import { useEffect as useEffect6 } from "react";
@@ -2891,7 +2885,6 @@ function clearAuth() {
2891
2885
  }
2892
2886
  var apiBaseUrl = "/api";
2893
2887
  function getDebugStatus() {
2894
- var _a;
2895
2888
  const effectiveToken = getEffectiveToken();
2896
2889
  return {
2897
2890
  isAuthenticated: currentToken !== null,
@@ -2899,30 +2892,28 @@ function getDebugStatus() {
2899
2892
  hasEffectiveToken: effectiveToken !== null,
2900
2893
  hasSDK: sdkInstance !== null,
2901
2894
  tokenSource: currentToken ? "auth" : devToken ? "dev" : "none",
2902
- tokenLength: (_a = effectiveToken == null ? void 0 : effectiveToken.length) != null ? _a : 0,
2895
+ tokenLength: effectiveToken?.length ?? 0,
2903
2896
  tokenPreview: effectiveToken ? `${effectiveToken.slice(0, 20)}...${effectiveToken.slice(-10)}` : null,
2904
2897
  debugMode,
2905
2898
  apiBaseUrl
2906
2899
  };
2907
2900
  }
2908
- function testSDKConnection() {
2909
- return __async(this, null, function* () {
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 = yield 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
- }
2925
- });
2901
+ async function testSDKConnection() {
2902
+ const status = getDebugStatus();
2903
+ console.log("[Platform SDK] Testing connection...", status);
2904
+ if (!sdkInstance) {
2905
+ console.error("[Platform SDK] No SDK instance - not authenticated and no dev token");
2906
+ return { success: false, error: "No SDK instance", status };
2907
+ }
2908
+ try {
2909
+ console.log("[Platform SDK] Calling api.APIKeys.list()...");
2910
+ const result = await sdkInstance.api.APIKeys.list();
2911
+ console.log("[Platform SDK] Connection successful!", { result });
2912
+ return { success: true, result, status };
2913
+ } catch (error) {
2914
+ console.error("[Platform SDK] Connection failed:", error);
2915
+ return { success: false, error, status };
2916
+ }
2926
2917
  }
2927
2918
  if (typeof window !== "undefined") {
2928
2919
  ;
@@ -2985,10 +2976,9 @@ function IdentityWidgetsWrapper({ children }) {
2985
2976
  );
2986
2977
  }
2987
2978
  function IdentityProvider({ children }) {
2988
- var _a, _b;
2989
2979
  const { config } = useDashboard();
2990
2980
  const { identity } = config;
2991
- const redirectUri = (_b = identity.redirectUri) != null ? _b : typeof window !== "undefined" ? `${window.location.origin}${(_a = config.basePath) != null ? _a : "/"}` : void 0;
2981
+ const redirectUri = identity.redirectUri ?? (typeof window !== "undefined" ? `${window.location.origin}${config.basePath ?? "/"}` : void 0);
2992
2982
  const onRedirectCallback = () => {
2993
2983
  if (typeof window !== "undefined") {
2994
2984
  const url = new URL(window.location.href);
@@ -3036,20 +3026,18 @@ import { Fragment as Fragment5, jsx as jsx30, jsxs as jsxs25 } from "react/jsx-r
3036
3026
  function AuthSync({ children }) {
3037
3027
  const { user, getAccessToken } = useAuth4();
3038
3028
  useEffect5(() => {
3039
- function syncToken() {
3040
- return __async(this, null, function* () {
3041
- if (user) {
3042
- try {
3043
- const token = yield getAccessToken();
3044
- setAuthToken(token);
3045
- } catch (e) {
3046
- clearAuth();
3047
- }
3048
- } else {
3029
+ async function syncToken() {
3030
+ if (user) {
3031
+ try {
3032
+ const token = await getAccessToken();
3033
+ setAuthToken(token);
3034
+ } catch {
3049
3035
  clearAuth();
3050
- queryClient.clear();
3051
3036
  }
3052
- });
3037
+ } else {
3038
+ clearAuth();
3039
+ queryClient.clear();
3040
+ }
3053
3041
  }
3054
3042
  syncToken();
3055
3043
  }, [user, getAccessToken]);
@@ -3076,8 +3064,7 @@ function SDKInitializer({ config }) {
3076
3064
  return null;
3077
3065
  }
3078
3066
  function AppProviders({ config, children }) {
3079
- var _a, _b;
3080
- const themeMode = (_b = (_a = config.theme) == null ? void 0 : _a.mode) != null ? _b : "system";
3067
+ const themeMode = config.theme?.mode ?? "system";
3081
3068
  return /* @__PURE__ */ jsx31(
3082
3069
  ThemeProvider,
3083
3070
  {
@@ -3097,12 +3084,11 @@ function AppProviders({ config, children }) {
3097
3084
  import { useAuth as useAuth5 } from "@workos-inc/authkit-react";
3098
3085
  import { Fragment as Fragment6, jsx as jsx32, jsxs as jsxs27 } from "react/jsx-runtime";
3099
3086
  function AuthGate({ children }) {
3100
- var _a, _b;
3101
3087
  const { config } = useDashboard();
3102
3088
  const { user, isLoading } = useAuth5();
3103
3089
  const { identity } = config;
3104
- const required = (_a = identity.required) != null ? _a : true;
3105
- const onUnauthenticated = (_b = identity.onUnauthenticated) != null ? _b : "landing";
3090
+ const required = identity.required ?? true;
3091
+ const onUnauthenticated = identity.onUnauthenticated ?? "landing";
3106
3092
  if (!required) {
3107
3093
  return /* @__PURE__ */ jsx32(Fragment6, { children });
3108
3094
  }
@@ -3738,26 +3724,76 @@ function getUsageColor(percentage) {
3738
3724
  if (percentage >= 75) return "bg-yellow-500";
3739
3725
  return "";
3740
3726
  }
3741
- function BillingPage() {
3742
- const [alertsEnabled, setAlertsEnabled] = useState13(mockBillingData.billingAlerts.enabled);
3743
- const handleDownloadInvoice = (invoiceNumber) => {
3744
- toast4.success("Invoice downloaded", {
3745
- description: `${invoiceNumber} has been downloaded.`
3746
- });
3727
+ function BillingPage({
3728
+ billingData: initialBillingData,
3729
+ onManagePlan,
3730
+ onUpdatePaymentMethod,
3731
+ onDownloadInvoice,
3732
+ onToggleAlerts,
3733
+ hideHeader = false,
3734
+ className
3735
+ } = {}) {
3736
+ const billingData = initialBillingData ?? mockBillingData;
3737
+ const [alertsEnabled, setAlertsEnabled] = useState13(billingData.billingAlerts.enabled);
3738
+ const handleManagePlan = async () => {
3739
+ if (onManagePlan) {
3740
+ try {
3741
+ await onManagePlan();
3742
+ } catch {
3743
+ toast4.error("Failed to open plan management");
3744
+ }
3745
+ } else {
3746
+ toast4.info("Plan management would open here");
3747
+ }
3748
+ };
3749
+ const handleUpdatePaymentMethod = async () => {
3750
+ if (onUpdatePaymentMethod) {
3751
+ try {
3752
+ await onUpdatePaymentMethod();
3753
+ } catch {
3754
+ toast4.error("Failed to update payment method");
3755
+ }
3756
+ } else {
3757
+ toast4.info("Payment method update would open here");
3758
+ }
3759
+ };
3760
+ const handleDownloadInvoice = async (invoiceId, invoiceNumber) => {
3761
+ if (onDownloadInvoice) {
3762
+ try {
3763
+ await onDownloadInvoice(invoiceId);
3764
+ toast4.success("Invoice downloaded", {
3765
+ description: `${invoiceNumber} has been downloaded.`
3766
+ });
3767
+ } catch {
3768
+ toast4.error("Failed to download invoice");
3769
+ }
3770
+ } else {
3771
+ toast4.success("Invoice downloaded", {
3772
+ description: `${invoiceNumber} has been downloaded.`
3773
+ });
3774
+ }
3747
3775
  };
3748
- const handleAlertsToggle = (enabled) => {
3776
+ const handleAlertsToggle = async (enabled) => {
3777
+ if (onToggleAlerts) {
3778
+ try {
3779
+ await onToggleAlerts(enabled);
3780
+ } catch {
3781
+ toast4.error("Failed to update alert settings");
3782
+ return;
3783
+ }
3784
+ }
3749
3785
  setAlertsEnabled(enabled);
3750
3786
  toast4.success(enabled ? "Billing alerts enabled" : "Billing alerts disabled", {
3751
- description: enabled ? `You'll be notified when usage reaches ${mockBillingData.billingAlerts.threshold}%.` : "You won't receive usage alerts."
3787
+ description: enabled ? `You'll be notified when usage reaches ${billingData.billingAlerts.threshold}%.` : "You won't receive usage alerts."
3752
3788
  });
3753
3789
  };
3754
3790
  return /* @__PURE__ */ jsxs28(Fragment7, { children: [
3755
- /* @__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: [
3791
+ !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__ */ jsxs28("div", { className: "flex items-center gap-2 px-4", children: [
3756
3792
  /* @__PURE__ */ jsx33(SidebarTrigger, { className: "-ml-1" }),
3757
3793
  /* @__PURE__ */ jsx33(Separator3, { orientation: "vertical", className: "mr-2 data-[orientation=vertical]:h-4" }),
3758
3794
  /* @__PURE__ */ jsx33(Breadcrumb, { children: /* @__PURE__ */ jsx33(BreadcrumbList, { children: /* @__PURE__ */ jsx33(BreadcrumbItem, { children: /* @__PURE__ */ jsx33(BreadcrumbPage, { children: "Billing" }) }) }) })
3759
3795
  ] }) }),
3760
- /* @__PURE__ */ jsxs28("div", { className: "flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 pt-0", children: [
3796
+ /* @__PURE__ */ jsxs28("div", { className: `flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 ${hideHeader ? "" : "pt-0"} ${className ?? ""}`, children: [
3761
3797
  /* @__PURE__ */ jsx33("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsxs28("div", { children: [
3762
3798
  /* @__PURE__ */ jsx33("h1", { className: "text-2xl font-bold", children: "Billing" }),
3763
3799
  /* @__PURE__ */ jsx33("p", { className: "text-muted-foreground", children: "Manage your subscription and billing information." })
@@ -3767,28 +3803,28 @@ function BillingPage() {
3767
3803
  /* @__PURE__ */ jsxs28(CardHeader12, { children: [
3768
3804
  /* @__PURE__ */ jsxs28("div", { className: "flex items-center justify-between", children: [
3769
3805
  /* @__PURE__ */ jsx33(CardTitle12, { children: "Current Plan" }),
3770
- /* @__PURE__ */ jsx33(Badge6, { variant: mockBillingData.status === "active" ? "default" : "secondary", children: mockBillingData.status })
3806
+ /* @__PURE__ */ jsx33(Badge6, { variant: billingData.status === "active" ? "default" : "secondary", children: billingData.status })
3771
3807
  ] }),
3772
3808
  /* @__PURE__ */ jsxs28(CardDescription11, { children: [
3773
3809
  "Renews",
3774
3810
  " ",
3775
- new Date(mockBillingData.renewalDate).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" })
3811
+ new Date(billingData.renewalDate).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" })
3776
3812
  ] })
3777
3813
  ] }),
3778
3814
  /* @__PURE__ */ jsxs28(CardContent12, { className: "space-y-4", children: [
3779
3815
  /* @__PURE__ */ jsxs28("div", { className: "flex items-baseline gap-2", children: [
3780
- /* @__PURE__ */ jsx33("p", { className: "text-3xl font-bold", children: mockBillingData.plan }),
3816
+ /* @__PURE__ */ jsx33("p", { className: "text-3xl font-bold", children: billingData.plan }),
3781
3817
  /* @__PURE__ */ jsxs28("p", { className: "text-lg text-muted-foreground", children: [
3782
3818
  "$",
3783
- mockBillingData.planPrice.toFixed(0),
3819
+ billingData.planPrice.toFixed(0),
3784
3820
  "/mo"
3785
3821
  ] })
3786
3822
  ] }),
3787
- /* @__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: [
3823
+ /* @__PURE__ */ jsx33("div", { className: "space-y-2", children: billingData.planFeatures.map((feature) => /* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
3788
3824
  /* @__PURE__ */ jsx33(Check2, { className: "h-4 w-4 text-primary" }),
3789
3825
  feature
3790
3826
  ] }, feature)) }),
3791
- /* @__PURE__ */ jsx33(Button12, { variant: "outline", size: "sm", className: "w-full", children: "Manage Plan" })
3827
+ /* @__PURE__ */ jsx33(Button12, { variant: "outline", size: "sm", className: "w-full", onClick: handleManagePlan, children: "Manage Plan" })
3792
3828
  ] })
3793
3829
  ] }),
3794
3830
  /* @__PURE__ */ jsxs28(Card13, { children: [
@@ -3796,7 +3832,7 @@ function BillingPage() {
3796
3832
  /* @__PURE__ */ jsxs28(CardContent12, { className: "space-y-1", children: [
3797
3833
  /* @__PURE__ */ jsxs28("p", { className: "text-3xl font-bold", children: [
3798
3834
  "$",
3799
- mockBillingData.totalSpend.toFixed(2)
3835
+ billingData.totalSpend.toFixed(2)
3800
3836
  ] }),
3801
3837
  /* @__PURE__ */ jsx33("p", { className: "text-sm text-muted-foreground", children: "This billing period" })
3802
3838
  ] })
@@ -3808,7 +3844,7 @@ function BillingPage() {
3808
3844
  /* @__PURE__ */ jsx33(CardTitle12, { children: "Usage Breakdown" }),
3809
3845
  /* @__PURE__ */ jsx33(CardDescription11, { children: "Resource usage for the current billing period" })
3810
3846
  ] }),
3811
- /* @__PURE__ */ jsx33(CardContent12, { className: "space-y-6", children: mockBillingData.usageBreakdown.map((item) => {
3847
+ /* @__PURE__ */ jsx33(CardContent12, { className: "space-y-6", children: billingData.usageBreakdown.map((item) => {
3812
3848
  const percentage = getUsagePercentage(item.usage, item.limit);
3813
3849
  const colorClass = getUsageColor(percentage);
3814
3850
  return /* @__PURE__ */ jsxs28("div", { className: "space-y-2", children: [
@@ -3844,23 +3880,23 @@ function BillingPage() {
3844
3880
  /* @__PURE__ */ jsxs28(CardContent12, { className: "space-y-3", children: [
3845
3881
  /* @__PURE__ */ jsxs28("div", { className: "flex items-center justify-between p-3 border rounded-md", children: [
3846
3882
  /* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-3", children: [
3847
- /* @__PURE__ */ jsx33("div", { className: "h-8 w-12 bg-muted rounded flex items-center justify-center text-xs font-medium", children: mockBillingData.paymentMethod.brand }),
3883
+ /* @__PURE__ */ jsx33("div", { className: "h-8 w-12 bg-muted rounded flex items-center justify-center text-xs font-medium", children: billingData.paymentMethod.brand }),
3848
3884
  /* @__PURE__ */ jsxs28("div", { children: [
3849
3885
  /* @__PURE__ */ jsxs28("p", { className: "font-medium text-sm", children: [
3850
3886
  "\u2022\u2022\u2022\u2022 ",
3851
- mockBillingData.paymentMethod.last4
3887
+ billingData.paymentMethod.last4
3852
3888
  ] }),
3853
3889
  /* @__PURE__ */ jsxs28("p", { className: "text-xs text-muted-foreground", children: [
3854
3890
  "Expires ",
3855
- mockBillingData.paymentMethod.expiryMonth,
3891
+ billingData.paymentMethod.expiryMonth,
3856
3892
  "/",
3857
- mockBillingData.paymentMethod.expiryYear
3893
+ billingData.paymentMethod.expiryYear
3858
3894
  ] })
3859
3895
  ] })
3860
3896
  ] }),
3861
3897
  /* @__PURE__ */ jsx33(Badge6, { variant: "secondary", className: "text-xs", children: "Default" })
3862
3898
  ] }),
3863
- /* @__PURE__ */ jsx33(Button12, { variant: "outline", size: "sm", className: "w-full", children: "Update" })
3899
+ /* @__PURE__ */ jsx33(Button12, { variant: "outline", size: "sm", className: "w-full", onClick: handleUpdatePaymentMethod, children: "Update" })
3864
3900
  ] })
3865
3901
  ] }),
3866
3902
  /* @__PURE__ */ jsxs28(Card13, { children: [
@@ -3873,7 +3909,7 @@ function BillingPage() {
3873
3909
  /* @__PURE__ */ jsx33(Label7, { htmlFor: "alerts", className: "text-sm", children: "Usage alerts" }),
3874
3910
  /* @__PURE__ */ jsxs28("p", { className: "text-xs text-muted-foreground", children: [
3875
3911
  "Notify at ",
3876
- mockBillingData.billingAlerts.threshold,
3912
+ billingData.billingAlerts.threshold,
3877
3913
  "% usage"
3878
3914
  ] })
3879
3915
  ] }),
@@ -3886,7 +3922,7 @@ function BillingPage() {
3886
3922
  /* @__PURE__ */ jsx33(Receipt, { className: "h-5 w-5" }),
3887
3923
  "Invoice History"
3888
3924
  ] }) }),
3889
- /* @__PURE__ */ jsx33(CardContent12, { children: mockBillingData.invoices.length > 0 ? /* @__PURE__ */ jsxs28(Table6, { children: [
3925
+ /* @__PURE__ */ jsx33(CardContent12, { children: billingData.invoices.length > 0 ? /* @__PURE__ */ jsxs28(Table6, { children: [
3890
3926
  /* @__PURE__ */ jsx33(TableHeader6, { children: /* @__PURE__ */ jsxs28(TableRow6, { children: [
3891
3927
  /* @__PURE__ */ jsx33(TableHead6, { className: "pl-4", children: "Invoice" }),
3892
3928
  /* @__PURE__ */ jsx33(TableHead6, { children: "Date" }),
@@ -3894,7 +3930,7 @@ function BillingPage() {
3894
3930
  /* @__PURE__ */ jsx33(TableHead6, { children: "Status" }),
3895
3931
  /* @__PURE__ */ jsx33(TableHead6, { className: "w-[80px]" })
3896
3932
  ] }) }),
3897
- /* @__PURE__ */ jsx33(TableBody6, { children: mockBillingData.invoices.map((invoice) => /* @__PURE__ */ jsxs28(TableRow6, { children: [
3933
+ /* @__PURE__ */ jsx33(TableBody6, { children: billingData.invoices.map((invoice) => /* @__PURE__ */ jsxs28(TableRow6, { children: [
3898
3934
  /* @__PURE__ */ jsx33(TableCell6, { className: "py-4 pl-4 font-mono text-sm", children: invoice.invoiceNumber }),
3899
3935
  /* @__PURE__ */ jsx33(TableCell6, { className: "py-4", children: formatRelativeDate(invoice.date) }),
3900
3936
  /* @__PURE__ */ jsxs28(TableCell6, { className: "py-4 font-medium", children: [
@@ -3902,7 +3938,7 @@ function BillingPage() {
3902
3938
  invoice.amount.toFixed(2)
3903
3939
  ] }),
3904
3940
  /* @__PURE__ */ jsx33(TableCell6, { className: "py-4", children: /* @__PURE__ */ jsx33(Badge6, { variant: invoice.status === "paid" ? "default" : "secondary", children: invoice.status }) }),
3905
- /* @__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" }) }) })
3941
+ /* @__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" }) }) })
3906
3942
  ] }, invoice.id)) })
3907
3943
  ] }) : /* @__PURE__ */ jsxs28("div", { className: "flex flex-col items-center justify-center gap-4 py-16 text-center", children: [
3908
3944
  /* @__PURE__ */ jsx33("div", { className: "rounded-full bg-muted p-4", children: /* @__PURE__ */ jsx33(FileText2, { className: "h-8 w-8 text-muted-foreground" }) }),
@@ -4027,8 +4063,15 @@ function StatusIndicator({ status }) {
4027
4063
  /* @__PURE__ */ jsx36("span", { className: "text-sm", children: label })
4028
4064
  ] });
4029
4065
  }
4030
- function KeysPage() {
4031
- const [keys, setKeys] = useState14(mockApiKeys);
4066
+ function KeysPage({
4067
+ keys: initialKeys,
4068
+ onCreateKey,
4069
+ onRevokeKey,
4070
+ onRenameKey,
4071
+ hideHeader = false,
4072
+ className
4073
+ } = {}) {
4074
+ const [keys, setKeys] = useState14(initialKeys ?? mockApiKeys);
4032
4075
  const [newKeyName, setNewKeyName] = useState14("");
4033
4076
  const [newlyCreatedKey, setNewlyCreatedKey] = useState14(null);
4034
4077
  const [createDialogOpen, setCreateDialogOpen] = useState14(false);
@@ -4039,23 +4082,52 @@ function KeysPage() {
4039
4082
  const [renameValue, setRenameValue] = useState14("");
4040
4083
  const [copiedKeyId, setCopiedKeyId] = useState14(null);
4041
4084
  const [newKeyCopied, setNewKeyCopied] = useState14(false);
4042
- const handleCreateKey = () => {
4043
- const newKey = {
4044
- id: String(Date.now()),
4045
- name: newKeyName || "Untitled Key",
4046
- key: `sk_live_${Math.random().toString(36).substring(2, 15)}${Math.random().toString(36).substring(2, 15)}`,
4047
- created: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
4048
- lastUsed: null,
4049
- status: "never_used"
4050
- };
4051
- setKeys([...keys, newKey]);
4052
- setNewlyCreatedKey(newKey.key);
4085
+ const handleCreateKey = async () => {
4086
+ const name = newKeyName || "Untitled Key";
4087
+ if (onCreateKey) {
4088
+ try {
4089
+ const result = await onCreateKey(name);
4090
+ const newKey = {
4091
+ id: result.id,
4092
+ name,
4093
+ key: result.key,
4094
+ created: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
4095
+ lastUsed: null,
4096
+ status: "never_used"
4097
+ };
4098
+ setKeys([...keys, newKey]);
4099
+ setNewlyCreatedKey(result.key);
4100
+ } catch {
4101
+ toast5.error("Failed to create API key");
4102
+ return;
4103
+ }
4104
+ } else {
4105
+ const newKey = {
4106
+ id: String(Date.now()),
4107
+ name,
4108
+ key: `sk_live_${Math.random().toString(36).substring(2, 15)}${Math.random().toString(36).substring(2, 15)}`,
4109
+ created: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
4110
+ lastUsed: null,
4111
+ status: "never_used"
4112
+ };
4113
+ setKeys([...keys, newKey]);
4114
+ setNewlyCreatedKey(newKey.key);
4115
+ }
4053
4116
  setNewKeyName("");
4054
4117
  };
4055
- const handleRevokeKey = () => {
4118
+ const handleRevokeKey = async () => {
4056
4119
  if (keyToRevoke) {
4057
4120
  const keyName = keyToRevoke.name;
4058
- setKeys(keys.filter((k) => k.id !== keyToRevoke.id));
4121
+ const keyId = keyToRevoke.id;
4122
+ if (onRevokeKey) {
4123
+ try {
4124
+ await onRevokeKey(keyId);
4125
+ } catch {
4126
+ toast5.error("Failed to revoke API key");
4127
+ return;
4128
+ }
4129
+ }
4130
+ setKeys(keys.filter((k) => k.id !== keyId));
4059
4131
  setKeyToRevoke(null);
4060
4132
  setRevokeDialogOpen(false);
4061
4133
  toast5.success("API key revoked", {
@@ -4063,10 +4135,19 @@ function KeysPage() {
4063
4135
  });
4064
4136
  }
4065
4137
  };
4066
- const handleRenameKey = () => {
4138
+ const handleRenameKey = async () => {
4067
4139
  if (keyToRename && renameValue.trim()) {
4068
4140
  const newName = renameValue.trim();
4069
- setKeys(keys.map((k) => k.id === keyToRename.id ? __spreadProps(__spreadValues({}, k), { name: newName }) : k));
4141
+ const keyId = keyToRename.id;
4142
+ if (onRenameKey) {
4143
+ try {
4144
+ await onRenameKey(keyId, newName);
4145
+ } catch {
4146
+ toast5.error("Failed to rename API key");
4147
+ return;
4148
+ }
4149
+ }
4150
+ setKeys(keys.map((k) => k.id === keyId ? { ...k, name: newName } : k));
4070
4151
  setKeyToRename(null);
4071
4152
  setRenameDialogOpen(false);
4072
4153
  setRenameValue("");
@@ -4075,15 +4156,15 @@ function KeysPage() {
4075
4156
  });
4076
4157
  }
4077
4158
  };
4078
- const handleCopyNewKey = () => __async(null, null, function* () {
4159
+ const handleCopyNewKey = async () => {
4079
4160
  if (newlyCreatedKey) {
4080
- yield navigator.clipboard.writeText(newlyCreatedKey);
4161
+ await navigator.clipboard.writeText(newlyCreatedKey);
4081
4162
  setNewKeyCopied(true);
4082
4163
  setCopiedKeyId("new");
4083
4164
  setTimeout(() => setCopiedKeyId(null), 2e3);
4084
4165
  toast5.success("API key copied to clipboard");
4085
4166
  }
4086
- });
4167
+ };
4087
4168
  const closeCreateDialog = () => {
4088
4169
  setCreateDialogOpen(false);
4089
4170
  setNewlyCreatedKey(null);
@@ -4100,12 +4181,12 @@ function KeysPage() {
4100
4181
  setRevokeDialogOpen(true);
4101
4182
  };
4102
4183
  return /* @__PURE__ */ jsxs31(Fragment10, { children: [
4103
- /* @__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: [
4184
+ !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__ */ jsxs31("div", { className: "flex items-center gap-2 px-4", children: [
4104
4185
  /* @__PURE__ */ jsx36(SidebarTrigger4, { className: "-ml-1" }),
4105
4186
  /* @__PURE__ */ jsx36(Separator6, { orientation: "vertical", className: "mr-2 data-[orientation=vertical]:h-4" }),
4106
4187
  /* @__PURE__ */ jsx36(Breadcrumb4, { children: /* @__PURE__ */ jsx36(BreadcrumbList4, { children: /* @__PURE__ */ jsx36(BreadcrumbItem4, { children: /* @__PURE__ */ jsx36(BreadcrumbPage4, { children: "API Keys" }) }) }) })
4107
4188
  ] }) }),
4108
- /* @__PURE__ */ jsxs31("div", { className: "flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 pt-0", children: [
4189
+ /* @__PURE__ */ jsxs31("div", { className: `flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 ${hideHeader ? "" : "pt-0"} ${className ?? ""}`, children: [
4109
4190
  /* @__PURE__ */ jsxs31("div", { className: "flex items-center justify-between", children: [
4110
4191
  /* @__PURE__ */ jsxs31("div", { children: [
4111
4192
  /* @__PURE__ */ jsx36("h1", { className: "text-2xl font-bold", children: "API Keys" }),
@@ -4219,7 +4300,7 @@ function KeysPage() {
4219
4300
  /* @__PURE__ */ jsx36(DialogTitle6, { children: "Revoke API Key" }),
4220
4301
  /* @__PURE__ */ jsxs31(DialogDescription5, { children: [
4221
4302
  'Are you sure you want to revoke "',
4222
- keyToRevoke == null ? void 0 : keyToRevoke.name,
4303
+ keyToRevoke?.name,
4223
4304
  '"? This action cannot be undone.'
4224
4305
  ] })
4225
4306
  ] }),
@@ -4288,7 +4369,6 @@ function EmptyState() {
4288
4369
  ] });
4289
4370
  }
4290
4371
  function OverviewPage() {
4291
- var _a, _b, _c, _d;
4292
4372
  const [selectedPeriod, setSelectedPeriod] = useState15("30d");
4293
4373
  const [isLoading, setIsLoading] = useState15(true);
4294
4374
  const [stats, setStats] = useState15(null);
@@ -4311,7 +4391,7 @@ function OverviewPage() {
4311
4391
  setIsLoading(true);
4312
4392
  setSelectedPeriod(period);
4313
4393
  };
4314
- const selectedLabel = (_a = timePeriodOptions.find((opt) => opt.value === selectedPeriod)) == null ? void 0 : _a.label;
4394
+ const selectedLabel = timePeriodOptions.find((opt) => opt.value === selectedPeriod)?.label;
4315
4395
  return /* @__PURE__ */ jsxs32(Fragment11, { children: [
4316
4396
  /* @__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: [
4317
4397
  /* @__PURE__ */ jsx37(SidebarTrigger5, { className: "-ml-1" }),
@@ -4341,7 +4421,7 @@ function OverviewPage() {
4341
4421
  ] }),
4342
4422
  /* @__PURE__ */ jsx37(CardContent14, { children: /* @__PURE__ */ jsxs32("div", { className: "flex items-end justify-between", children: [
4343
4423
  /* @__PURE__ */ jsxs32("div", { children: [
4344
- /* @__PURE__ */ jsx37("div", { className: "text-2xl font-bold", children: (_b = stats == null ? void 0 : stats.totalRequests.toLocaleString()) != null ? _b : "\u2014" }),
4424
+ /* @__PURE__ */ jsx37("div", { className: "text-2xl font-bold", children: stats?.totalRequests.toLocaleString() ?? "\u2014" }),
4345
4425
  /* @__PURE__ */ jsx37("p", { className: "text-xs text-muted-foreground", children: selectedLabel })
4346
4426
  ] }),
4347
4427
  /* @__PURE__ */ jsx37(Sparkline, { data: usageData.slice(-7).map((d) => ({ value: d.requests })), color: "var(--chart-1)" })
@@ -4356,7 +4436,7 @@ function OverviewPage() {
4356
4436
  /* @__PURE__ */ jsxs32("div", { children: [
4357
4437
  /* @__PURE__ */ jsxs32("div", { className: "text-2xl font-bold", children: [
4358
4438
  "$",
4359
- (_c = stats == null ? void 0 : stats.totalCost.toFixed(2)) != null ? _c : "\u2014"
4439
+ stats?.totalCost.toFixed(2) ?? "\u2014"
4360
4440
  ] }),
4361
4441
  /* @__PURE__ */ jsx37("p", { className: "text-xs text-muted-foreground", children: selectedLabel })
4362
4442
  ] }),
@@ -4370,7 +4450,7 @@ function OverviewPage() {
4370
4450
  ] }),
4371
4451
  /* @__PURE__ */ jsx37(CardContent14, { children: /* @__PURE__ */ jsxs32("div", { className: "flex items-end justify-between", children: [
4372
4452
  /* @__PURE__ */ jsxs32("div", { children: [
4373
- /* @__PURE__ */ jsx37("div", { className: "text-2xl font-bold", children: (_d = stats == null ? void 0 : stats.errorCount) != null ? _d : "\u2014" }),
4453
+ /* @__PURE__ */ jsx37("div", { className: "text-2xl font-bold", children: stats?.errorCount ?? "\u2014" }),
4374
4454
  /* @__PURE__ */ jsx37("p", { className: "text-xs text-muted-foreground", children: "Failed requests" })
4375
4455
  ] }),
4376
4456
  /* @__PURE__ */ jsx37(
@@ -4476,7 +4556,6 @@ function formatCost(cost) {
4476
4556
  return `$${cost.toFixed(3)}`;
4477
4557
  }
4478
4558
  function RequestsPage() {
4479
- var _a;
4480
4559
  const [statusFilter, setStatusFilter] = useState16("all");
4481
4560
  const [selectedRequest, setSelectedRequest] = useState16(null);
4482
4561
  const [sheetOpen, setSheetOpen] = useState16(false);
@@ -4505,7 +4584,7 @@ function RequestsPage() {
4505
4584
  ] }),
4506
4585
  /* @__PURE__ */ jsxs33(DropdownMenu6, { children: [
4507
4586
  /* @__PURE__ */ jsx38(DropdownMenuTrigger6, { asChild: true, children: /* @__PURE__ */ jsxs33(Button15, { variant: "outline", className: "w-[160px] justify-between", children: [
4508
- (_a = statusFilterOptions.find((o) => o.value === statusFilter)) == null ? void 0 : _a.label,
4587
+ statusFilterOptions.find((o) => o.value === statusFilter)?.label,
4509
4588
  /* @__PURE__ */ jsx38(ChevronDown2, { className: "h-4 w-4 opacity-50" })
4510
4589
  ] }) }),
4511
4590
  /* @__PURE__ */ jsx38(DropdownMenuContent6, { align: "end", className: "w-[160px]", children: statusFilterOptions.map((option) => /* @__PURE__ */ jsx38(DropdownMenuItem6, { onClick: () => setStatusFilter(option.value), children: option.label }, option.value)) })
@@ -4580,9 +4659,8 @@ import { UserProfile as UserProfile2 } from "@workos-inc/widgets";
4580
4659
  import { Link as Link4 } from "react-router-dom";
4581
4660
  import { Fragment as Fragment13, jsx as jsx39, jsxs as jsxs34 } from "react/jsx-runtime";
4582
4661
  function SettingsProfilePage() {
4583
- var _a, _b;
4584
4662
  const { config } = useDashboard();
4585
- const useMockWidgets = (_b = (_a = config.identity) == null ? void 0 : _a.useMockWidgets) != null ? _b : false;
4663
+ const useMockWidgets = config.identity?.useMockWidgets ?? false;
4586
4664
  const { user, getAccessToken, isLoading } = useAuth6();
4587
4665
  return /* @__PURE__ */ jsxs34(Fragment13, { children: [
4588
4666
  /* @__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: [
@@ -4614,18 +4692,16 @@ import { useEffect as useEffect8, useRef as useRef2, useState as useState17 } fr
4614
4692
  import { Link as Link5 } from "react-router-dom";
4615
4693
  import { Fragment as Fragment14, jsx as jsx40, jsxs as jsxs35 } from "react/jsx-runtime";
4616
4694
  function SettingsSecurityPage() {
4617
- var _a, _b;
4618
4695
  const { config } = useDashboard();
4619
- const useMockWidgets = (_b = (_a = config.identity) == null ? void 0 : _a.useMockWidgets) != null ? _b : false;
4696
+ const useMockWidgets = config.identity?.useMockWidgets ?? false;
4620
4697
  const { user, getAccessToken, isLoading } = useAuth7();
4621
4698
  const [isEmpty, setIsEmpty] = useState17(false);
4622
4699
  const containerRef = useRef2(null);
4623
4700
  useEffect8(() => {
4624
4701
  if (useMockWidgets || isLoading || !user) return;
4625
4702
  const timer = setTimeout(() => {
4626
- var _a2;
4627
4703
  if (containerRef.current) {
4628
- const content = (_a2 = containerRef.current.textContent) == null ? void 0 : _a2.trim();
4704
+ const content = containerRef.current.textContent?.trim();
4629
4705
  const hasVisibleContent = containerRef.current.querySelector('button, input, [role="button"]');
4630
4706
  if (!content && !hasVisibleContent) {
4631
4707
  setIsEmpty(true);
@@ -4663,9 +4739,8 @@ import { UserSessions } from "@workos-inc/widgets";
4663
4739
  import { Link as Link6 } from "react-router-dom";
4664
4740
  import { Fragment as Fragment15, jsx as jsx41, jsxs as jsxs36 } from "react/jsx-runtime";
4665
4741
  function SettingsSessionsPage() {
4666
- var _a, _b;
4667
4742
  const { config } = useDashboard();
4668
- const useMockWidgets = (_b = (_a = config.identity) == null ? void 0 : _a.useMockWidgets) != null ? _b : false;
4743
+ const useMockWidgets = config.identity?.useMockWidgets ?? false;
4669
4744
  const { user, getAccessToken, isLoading } = useAuth8();
4670
4745
  return /* @__PURE__ */ jsxs36(Fragment15, { children: [
4671
4746
  /* @__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,21 +4769,31 @@ import { SidebarTrigger as SidebarTrigger10 } from "@mdxui/primitives/sidebar";
4694
4769
  import { useAuth as useAuth9 } from "@workos-inc/authkit-react";
4695
4770
  import { UsersManagement } from "@workos-inc/widgets";
4696
4771
  import { Fragment as Fragment16, jsx as jsx42, jsxs as jsxs37 } from "react/jsx-runtime";
4697
- function TeamPage() {
4698
- var _a, _b;
4699
- const { config } = useDashboard();
4700
- const useMockWidgets = (_b = (_a = config.identity) == null ? void 0 : _a.useMockWidgets) != null ? _b : false;
4772
+ function TeamPage({
4773
+ useMockWidgets: useMockWidgetsProp,
4774
+ hideHeader = false,
4775
+ className
4776
+ } = {}) {
4777
+ let useMockWidgets = useMockWidgetsProp;
4778
+ try {
4779
+ const { config } = useDashboard();
4780
+ if (useMockWidgets === void 0) {
4781
+ useMockWidgets = config.identity?.useMockWidgets ?? false;
4782
+ }
4783
+ } catch {
4784
+ useMockWidgets = useMockWidgetsProp ?? false;
4785
+ }
4701
4786
  const { user, getAccessToken, isLoading, organizationId, permissions } = useAuth9();
4702
4787
  const hasOrganization = !!organizationId;
4703
- const canManageTeam = hasOrganization && (permissions == null ? void 0 : permissions.includes("widgets:users-table:manage"));
4788
+ const canManageTeam = hasOrganization && permissions?.includes("widgets:users-table:manage");
4704
4789
  const loading = !useMockWidgets && isLoading;
4705
4790
  return /* @__PURE__ */ jsxs37(Fragment16, { children: [
4706
- /* @__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: [
4791
+ !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__ */ jsxs37("div", { className: "flex items-center gap-2 px-4", children: [
4707
4792
  /* @__PURE__ */ jsx42(SidebarTrigger10, { className: "-ml-1" }),
4708
4793
  /* @__PURE__ */ jsx42(Separator12, { orientation: "vertical", className: "mr-2 data-[orientation=vertical]:h-4" }),
4709
4794
  /* @__PURE__ */ jsx42(Breadcrumb10, { children: /* @__PURE__ */ jsx42(BreadcrumbList10, { children: /* @__PURE__ */ jsx42(BreadcrumbItem10, { children: /* @__PURE__ */ jsx42(BreadcrumbPage10, { children: "Team" }) }) }) })
4710
4795
  ] }) }),
4711
- /* @__PURE__ */ jsxs37("div", { className: "flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 pt-0", children: [
4796
+ /* @__PURE__ */ jsxs37("div", { className: `flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 ${hideHeader ? "" : "pt-0"} ${className ?? ""}`, children: [
4712
4797
  /* @__PURE__ */ jsxs37("div", { children: [
4713
4798
  /* @__PURE__ */ jsx42("h1", { className: "text-2xl font-bold", children: "Team" }),
4714
4799
  /* @__PURE__ */ jsx42("p", { className: "text-muted-foreground", children: "Manage your team members and their permissions." })
@@ -4744,7 +4829,7 @@ function VaultPage() {
4744
4829
  setPendingIntegration(pendingCredentialRequest);
4745
4830
  setAddModalOpen(true);
4746
4831
  };
4747
- const handleAdd = (credentials) => __async(null, null, function* () {
4832
+ const handleAdd = async (credentials) => {
4748
4833
  if (!pendingIntegration) return;
4749
4834
  const newItem = {
4750
4835
  id: Date.now().toString(),
@@ -4756,21 +4841,21 @@ function VaultPage() {
4756
4841
  };
4757
4842
  setItems((prev) => [...prev, newItem]);
4758
4843
  toast6.success(`${pendingIntegration.name} credentials added successfully`);
4759
- });
4844
+ };
4760
4845
  const handleCloseAddModal = () => {
4761
4846
  setAddModalOpen(false);
4762
4847
  setPendingIntegration(null);
4763
4848
  };
4764
- const handleRotate = (id, credentials) => __async(null, null, function* () {
4849
+ const handleRotate = async (id, credentials) => {
4765
4850
  const item = items.find((i) => i.id === id);
4766
- setItems((prev) => prev.map((i) => i.id === id ? __spreadProps(__spreadValues({}, i), { updatedAt: /* @__PURE__ */ new Date() }) : i));
4767
- toast6.success(`${(item == null ? void 0 : item.name) || "Credentials"} rotated successfully`);
4768
- });
4769
- const handleDelete = (id) => __async(null, null, function* () {
4851
+ setItems((prev) => prev.map((i) => i.id === id ? { ...i, updatedAt: /* @__PURE__ */ new Date() } : i));
4852
+ toast6.success(`${item?.name || "Credentials"} rotated successfully`);
4853
+ };
4854
+ const handleDelete = async (id) => {
4770
4855
  const item = items.find((i) => i.id === id);
4771
4856
  setItems((prev) => prev.filter((i) => i.id !== id));
4772
- toast6.success(`${(item == null ? void 0 : item.name) || "Credentials"} deleted successfully`);
4773
- });
4857
+ toast6.success(`${item?.name || "Credentials"} deleted successfully`);
4858
+ };
4774
4859
  return /* @__PURE__ */ jsxs38(Fragment17, { children: [
4775
4860
  /* @__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: [
4776
4861
  /* @__PURE__ */ jsx43(SidebarTrigger11, { className: "-ml-1" }),
@@ -4847,7 +4932,6 @@ var periodMultipliers = {
4847
4932
  "30d": 30
4848
4933
  };
4849
4934
  function WebhooksActivityPage() {
4850
- var _a;
4851
4935
  const [period, setPeriod] = useState19("7d");
4852
4936
  const multiplier = periodMultipliers[period];
4853
4937
  const activity = {
@@ -4855,7 +4939,8 @@ function WebhooksActivityPage() {
4855
4939
  failed: Math.round(mockWebhookActivity.failed * multiplier),
4856
4940
  pending: mockWebhookActivity.pending,
4857
4941
  successRate: mockWebhookActivity.successRate,
4858
- endpointsWithIssues: mockWebhookActivity.endpointsWithIssues.map((ep) => __spreadProps(__spreadValues({}, ep), {
4942
+ endpointsWithIssues: mockWebhookActivity.endpointsWithIssues.map((ep) => ({
4943
+ ...ep,
4859
4944
  failures: Math.round(ep.failures * multiplier)
4860
4945
  }))
4861
4946
  };
@@ -4878,7 +4963,7 @@ function WebhooksActivityPage() {
4878
4963
  ] }),
4879
4964
  /* @__PURE__ */ jsxs39(DropdownMenu7, { children: [
4880
4965
  /* @__PURE__ */ jsx44(DropdownMenuTrigger7, { asChild: true, children: /* @__PURE__ */ jsxs39(Button17, { variant: "outline", className: "w-[160px] justify-between", children: [
4881
- (_a = periodOptions.find((o) => o.value === period)) == null ? void 0 : _a.label,
4966
+ periodOptions.find((o) => o.value === period)?.label,
4882
4967
  /* @__PURE__ */ jsx44(ChevronDown3, { className: "h-4 w-4 opacity-50" })
4883
4968
  ] }) }),
4884
4969
  /* @__PURE__ */ jsx44(DropdownMenuContent7, { align: "end", className: "w-[160px]", children: periodOptions.map((option) => /* @__PURE__ */ jsx44(DropdownMenuItem7, { onClick: () => setPeriod(option.value), children: option.label }, option.value)) })
@@ -5038,8 +5123,15 @@ var eventsByCategory = mockWebhookEvents.reduce((acc, event) => {
5038
5123
  acc[event.category].push(event);
5039
5124
  return acc;
5040
5125
  }, {});
5041
- function WebhooksEndpointsPage() {
5042
- const [endpoints, setEndpoints] = useState20(mockWebhookEndpoints);
5126
+ function WebhooksEndpointsPage({
5127
+ endpoints: initialEndpoints,
5128
+ onCreateEndpoint,
5129
+ onUpdateEndpoint,
5130
+ onDeleteEndpoint,
5131
+ hideHeader = false,
5132
+ className
5133
+ } = {}) {
5134
+ const [endpoints, setEndpoints] = useState20(initialEndpoints ?? mockWebhookEndpoints);
5043
5135
  const [createDialogOpen, setCreateDialogOpen] = useState20(false);
5044
5136
  const [editDialogOpen, setEditDialogOpen] = useState20(false);
5045
5137
  const [deleteDialogOpen, setDeleteDialogOpen] = useState20(false);
@@ -5053,29 +5145,57 @@ function WebhooksEndpointsPage() {
5053
5145
  setFormEvents([]);
5054
5146
  setFormEnabled(true);
5055
5147
  };
5056
- const handleCreate = () => {
5057
- const newEndpoint = {
5058
- id: `ep_${Date.now()}`,
5059
- url: formUrl,
5060
- events: formEvents,
5061
- lastDelivery: null,
5062
- status: formEnabled ? "active" : "disabled",
5063
- secret: `whsec_${Math.random().toString(36).substring(2, 15)}`,
5064
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
5065
- failureCount: 0
5066
- };
5067
- setEndpoints([...endpoints, newEndpoint]);
5148
+ const handleCreate = async () => {
5149
+ if (onCreateEndpoint) {
5150
+ try {
5151
+ const result = await onCreateEndpoint({ url: formUrl, events: formEvents, enabled: formEnabled });
5152
+ const newEndpoint = {
5153
+ id: result.id,
5154
+ url: formUrl,
5155
+ events: formEvents,
5156
+ lastDelivery: null,
5157
+ status: formEnabled ? "active" : "disabled",
5158
+ secret: result.secret,
5159
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
5160
+ failureCount: 0
5161
+ };
5162
+ setEndpoints([...endpoints, newEndpoint]);
5163
+ } catch {
5164
+ toast7.error("Failed to create endpoint");
5165
+ return;
5166
+ }
5167
+ } else {
5168
+ const newEndpoint = {
5169
+ id: `ep_${Date.now()}`,
5170
+ url: formUrl,
5171
+ events: formEvents,
5172
+ lastDelivery: null,
5173
+ status: formEnabled ? "active" : "disabled",
5174
+ secret: `whsec_${Math.random().toString(36).substring(2, 15)}`,
5175
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
5176
+ failureCount: 0
5177
+ };
5178
+ setEndpoints([...endpoints, newEndpoint]);
5179
+ }
5068
5180
  setCreateDialogOpen(false);
5069
5181
  resetForm();
5070
5182
  toast7.success("Endpoint created", {
5071
5183
  description: "Your webhook endpoint has been created successfully."
5072
5184
  });
5073
5185
  };
5074
- const handleEdit = () => {
5186
+ const handleEdit = async () => {
5075
5187
  if (!selectedEndpoint) return;
5188
+ if (onUpdateEndpoint) {
5189
+ try {
5190
+ await onUpdateEndpoint(selectedEndpoint.id, { url: formUrl, events: formEvents, enabled: formEnabled });
5191
+ } catch {
5192
+ toast7.error("Failed to update endpoint");
5193
+ return;
5194
+ }
5195
+ }
5076
5196
  setEndpoints(
5077
5197
  endpoints.map(
5078
- (ep) => ep.id === selectedEndpoint.id ? __spreadProps(__spreadValues({}, ep), { url: formUrl, events: formEvents, status: formEnabled ? "active" : "disabled" }) : ep
5198
+ (ep) => ep.id === selectedEndpoint.id ? { ...ep, url: formUrl, events: formEvents, status: formEnabled ? "active" : "disabled" } : ep
5079
5199
  )
5080
5200
  );
5081
5201
  setEditDialogOpen(false);
@@ -5085,8 +5205,16 @@ function WebhooksEndpointsPage() {
5085
5205
  description: "Your webhook endpoint has been updated successfully."
5086
5206
  });
5087
5207
  };
5088
- const handleDelete = () => {
5208
+ const handleDelete = async () => {
5089
5209
  if (!selectedEndpoint) return;
5210
+ if (onDeleteEndpoint) {
5211
+ try {
5212
+ await onDeleteEndpoint(selectedEndpoint.id);
5213
+ } catch {
5214
+ toast7.error("Failed to delete endpoint");
5215
+ return;
5216
+ }
5217
+ }
5090
5218
  setEndpoints(endpoints.filter((ep) => ep.id !== selectedEndpoint.id));
5091
5219
  setDeleteDialogOpen(false);
5092
5220
  setSelectedEndpoint(null);
@@ -5105,12 +5233,12 @@ function WebhooksEndpointsPage() {
5105
5233
  setSelectedEndpoint(endpoint);
5106
5234
  setDeleteDialogOpen(true);
5107
5235
  };
5108
- const handleCopySecret = (endpoint) => __async(null, null, function* () {
5109
- yield navigator.clipboard.writeText(endpoint.secret);
5236
+ const handleCopySecret = async (endpoint) => {
5237
+ await navigator.clipboard.writeText(endpoint.secret);
5110
5238
  setCopiedSecret(endpoint.id);
5111
5239
  setTimeout(() => setCopiedSecret(null), 2e3);
5112
5240
  toast7.success("Secret copied to clipboard");
5113
- });
5241
+ };
5114
5242
  const toggleEvent = (eventName) => {
5115
5243
  if (formEvents.includes(eventName)) {
5116
5244
  setFormEvents(formEvents.filter((e) => e !== eventName));
@@ -5119,7 +5247,7 @@ function WebhooksEndpointsPage() {
5119
5247
  }
5120
5248
  };
5121
5249
  return /* @__PURE__ */ jsxs40(Fragment19, { children: [
5122
- /* @__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: [
5250
+ !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__ */ jsxs40("div", { className: "flex items-center gap-2 px-4", children: [
5123
5251
  /* @__PURE__ */ jsx45(SidebarTrigger13, { className: "-ml-1" }),
5124
5252
  /* @__PURE__ */ jsx45(Separator15, { orientation: "vertical", className: "mr-2 data-[orientation=vertical]:h-4" }),
5125
5253
  /* @__PURE__ */ jsx45(Breadcrumb13, { children: /* @__PURE__ */ jsxs40(BreadcrumbList13, { children: [
@@ -5128,7 +5256,7 @@ function WebhooksEndpointsPage() {
5128
5256
  /* @__PURE__ */ jsx45(BreadcrumbItem13, { children: /* @__PURE__ */ jsx45(BreadcrumbPage13, { children: "Endpoints" }) })
5129
5257
  ] }) })
5130
5258
  ] }) }),
5131
- /* @__PURE__ */ jsxs40("div", { className: "flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 pt-0", children: [
5259
+ /* @__PURE__ */ jsxs40("div", { className: `flex flex-1 flex-col gap-4 px-4 sm:px-16 py-4 ${hideHeader ? "" : "pt-0"} ${className ?? ""}`, children: [
5132
5260
  /* @__PURE__ */ jsxs40("div", { className: "flex items-center justify-between", children: [
5133
5261
  /* @__PURE__ */ jsxs40("div", { children: [
5134
5262
  /* @__PURE__ */ jsx45("h1", { className: "text-2xl font-bold", children: "Endpoints" }),
@@ -5152,7 +5280,7 @@ function WebhooksEndpointsPage() {
5152
5280
  Input9,
5153
5281
  {
5154
5282
  id: "url",
5155
- placeholder: "https://api.example.com/webhooks",
5283
+ placeholder: "https://api.example.com.ai/webhooks",
5156
5284
  value: formUrl,
5157
5285
  onChange: (e) => setFormUrl(e.target.value)
5158
5286
  }
@@ -5306,7 +5434,7 @@ function WebhooksEndpointsPage() {
5306
5434
  Input9,
5307
5435
  {
5308
5436
  id: "edit-url",
5309
- placeholder: "https://api.example.com/webhooks",
5437
+ placeholder: "https://api.example.com.ai/webhooks",
5310
5438
  value: formUrl,
5311
5439
  onChange: (e) => setFormUrl(e.target.value)
5312
5440
  }
@@ -5524,7 +5652,6 @@ function formatLatency2(ms) {
5524
5652
  return `${ms}ms`;
5525
5653
  }
5526
5654
  function WebhooksLogsPage() {
5527
- var _a;
5528
5655
  const [statusFilter, setStatusFilter] = useState22("all");
5529
5656
  const [selectedLog, setSelectedLog] = useState22(null);
5530
5657
  const [sheetOpen, setSheetOpen] = useState22(false);
@@ -5539,11 +5666,11 @@ function WebhooksLogsPage() {
5539
5666
  setSheetOpen(true);
5540
5667
  setCopiedUrl(false);
5541
5668
  };
5542
- const handleCopyUrl = (url) => __async(null, null, function* () {
5543
- yield navigator.clipboard.writeText(url);
5669
+ const handleCopyUrl = async (url) => {
5670
+ await navigator.clipboard.writeText(url);
5544
5671
  setCopiedUrl(true);
5545
5672
  setTimeout(() => setCopiedUrl(false), 2e3);
5546
- });
5673
+ };
5547
5674
  const handleRetry = () => {
5548
5675
  toast8.success("Webhook retry triggered", {
5549
5676
  description: "The webhook delivery will be retried shortly."
@@ -5568,7 +5695,7 @@ function WebhooksLogsPage() {
5568
5695
  ] }),
5569
5696
  /* @__PURE__ */ jsxs42(DropdownMenu9, { children: [
5570
5697
  /* @__PURE__ */ jsx47(DropdownMenuTrigger9, { asChild: true, children: /* @__PURE__ */ jsxs42(Button19, { variant: "outline", className: "w-[140px] justify-between", children: [
5571
- (_a = statusFilterOptions2.find((o) => o.value === statusFilter)) == null ? void 0 : _a.label,
5698
+ statusFilterOptions2.find((o) => o.value === statusFilter)?.label,
5572
5699
  /* @__PURE__ */ jsx47(ChevronDown4, { className: "h-4 w-4 opacity-50" })
5573
5700
  ] }) }),
5574
5701
  /* @__PURE__ */ jsx47(DropdownMenuContent9, { align: "end", className: "w-[140px]", children: statusFilterOptions2.map((option) => /* @__PURE__ */ jsx47(DropdownMenuItem9, { onClick: () => setStatusFilter(option.value), children: option.label }, option.value)) })
@@ -5685,6 +5812,7 @@ function DashboardRouter({ basePath = "/", children }) {
5685
5812
  }
5686
5813
  function DashboardRoutes() {
5687
5814
  const routes = useRoutes();
5815
+ const customRoutes = useCustomRoutes();
5688
5816
  return /* @__PURE__ */ jsx48(Routes, { children: /* @__PURE__ */ jsxs43(Route, { element: /* @__PURE__ */ jsx48(DashboardLayout, {}), children: [
5689
5817
  routes.overview && /* @__PURE__ */ jsx48(Route, { index: true, element: /* @__PURE__ */ jsx48(OverviewPage, {}) }),
5690
5818
  routes.requests && /* @__PURE__ */ jsx48(Route, { path: "requests", element: /* @__PURE__ */ jsx48(RequestsPage, {}) }),
@@ -5707,49 +5835,210 @@ function DashboardRoutes() {
5707
5835
  routes.database && /* @__PURE__ */ jsx48(Route, { path: "database", element: /* @__PURE__ */ jsx48(DatabasePage, {}) }),
5708
5836
  routes.integrations && /* @__PURE__ */ jsx48(Route, { path: "integrations", element: /* @__PURE__ */ jsx48(IntegrationsPage, {}) }),
5709
5837
  routes.vault && /* @__PURE__ */ jsx48(Route, { path: "vault", element: /* @__PURE__ */ jsx48(VaultPage, {}) }),
5710
- /* @__PURE__ */ jsx48(Route, { path: "*", element: /* @__PURE__ */ jsx48(Navigate, { to: "/", replace: true }) })
5838
+ customRoutes.map((route) => /* @__PURE__ */ jsx48(
5839
+ Route,
5840
+ {
5841
+ path: route.path.startsWith("/") ? route.path.slice(1) : route.path,
5842
+ index: route.index,
5843
+ element: route.element
5844
+ },
5845
+ route.path
5846
+ )),
5847
+ (() => {
5848
+ const indexRoute = customRoutes.find((r) => r.index);
5849
+ const fallbackPath = indexRoute?.path || customRoutes[0]?.path || "/";
5850
+ return /* @__PURE__ */ jsx48(Route, { path: "*", element: /* @__PURE__ */ jsx48(Navigate, { to: fallbackPath, replace: true }) });
5851
+ })()
5711
5852
  ] }) });
5712
5853
  }
5713
5854
 
5714
5855
  // src/developer/developer-dashboard.tsx
5715
5856
  import { jsx as jsx49 } from "react/jsx-runtime";
5716
- function DeveloperDashboard({ config }) {
5857
+ function propsToConfig(props) {
5858
+ const routes = {
5859
+ overview: props.routes?.overview ?? true,
5860
+ requests: props.routes?.requests ?? props.showLogs ?? props.showUsage ?? true,
5861
+ keys: props.routes?.keys ?? props.showAPIKeys ?? true,
5862
+ team: props.routes?.team ?? true,
5863
+ billing: props.routes?.billing ?? true,
5864
+ settings: props.routes?.settings ?? true,
5865
+ webhooks: props.routes?.webhooks ?? props.showWebhooks ?? false,
5866
+ database: props.routes?.database ?? false,
5867
+ integrations: props.routes?.integrations ?? false,
5868
+ vault: props.routes?.vault ?? false
5869
+ };
5870
+ const customRoutes = props.customRoutes?.map((route) => ({
5871
+ path: route.path,
5872
+ label: route.label,
5873
+ icon: route.icon ? getIconByName(route.icon) : void 0,
5874
+ element: route.element,
5875
+ group: route.group,
5876
+ order: route.order,
5877
+ index: route.index
5878
+ }));
5879
+ const identity = props.identity ?? {
5880
+ clientId: "demo",
5881
+ useMockWidgets: true,
5882
+ required: false,
5883
+ onUnauthenticated: "allow"
5884
+ };
5885
+ return {
5886
+ basePath: props.basePath ?? "/",
5887
+ branding: props.branding,
5888
+ routes,
5889
+ customRoutes,
5890
+ theme: props.theme,
5891
+ identity,
5892
+ devToken: props.devToken,
5893
+ debug: props.debug
5894
+ };
5895
+ }
5896
+ function isLegacyConfig(props) {
5897
+ return "config" in props && props.config !== void 0;
5898
+ }
5899
+ function DeveloperDashboard(props) {
5900
+ const config = isLegacyConfig(props) ? props.config : propsToConfig(props);
5717
5901
  return /* @__PURE__ */ jsx49(AppProviders, { config, children: /* @__PURE__ */ jsx49(AuthGate, { children: /* @__PURE__ */ jsx49(DashboardRouter, { basePath: config.basePath, children: /* @__PURE__ */ jsx49(DashboardRoutes, {}) }) }) });
5718
5902
  }
5719
5903
 
5904
+ // src/developer/standalone/provider.tsx
5905
+ import { ThemeProvider as ThemeProvider2 } from "next-themes";
5906
+ import { applyThemeToElement as applyThemeToElement2 } from "@mdxui/themes";
5907
+ import { useEffect as useEffect10, useRef as useRef3 } from "react";
5908
+ import { jsx as jsx50 } from "react/jsx-runtime";
5909
+ function StandaloneProvider({ config, children }) {
5910
+ const themeMode = config?.theme?.mode ?? "system";
5911
+ const containerRef = useRef3(null);
5912
+ useEffect10(() => {
5913
+ if (containerRef.current && config?.theme?.preset) {
5914
+ const resolvedMode = config.theme.mode === "system" ? "light" : config.theme.mode ?? "light";
5915
+ applyThemeToElement2(containerRef.current, config.theme.preset, resolvedMode);
5916
+ }
5917
+ }, [config?.theme]);
5918
+ return /* @__PURE__ */ jsx50(
5919
+ ThemeProvider2,
5920
+ {
5921
+ attribute: "class",
5922
+ defaultTheme: themeMode,
5923
+ enableSystem: themeMode === "system",
5924
+ disableTransitionOnChange: true,
5925
+ children: /* @__PURE__ */ jsx50("div", { ref: containerRef, className: "standalone-provider", children })
5926
+ }
5927
+ );
5928
+ }
5929
+
5930
+ // src/developer/standalone/api-keys.tsx
5931
+ import { jsx as jsx51 } from "react/jsx-runtime";
5932
+ function StandaloneAPIKeys({
5933
+ keys,
5934
+ onCreateKey,
5935
+ onRevokeKey,
5936
+ onRenameKey,
5937
+ hideHeader = true,
5938
+ className
5939
+ }) {
5940
+ return /* @__PURE__ */ jsx51(
5941
+ KeysPage,
5942
+ {
5943
+ keys,
5944
+ onCreateKey,
5945
+ onRevokeKey,
5946
+ onRenameKey,
5947
+ hideHeader,
5948
+ className
5949
+ }
5950
+ );
5951
+ }
5952
+
5953
+ // src/developer/standalone/webhooks.tsx
5954
+ import { jsx as jsx52 } from "react/jsx-runtime";
5955
+ function StandaloneWebhooks({
5956
+ endpoints,
5957
+ onCreateEndpoint,
5958
+ onUpdateEndpoint,
5959
+ onDeleteEndpoint,
5960
+ hideHeader = true,
5961
+ className
5962
+ }) {
5963
+ return /* @__PURE__ */ jsx52(
5964
+ WebhooksEndpointsPage,
5965
+ {
5966
+ endpoints,
5967
+ onCreateEndpoint,
5968
+ onUpdateEndpoint,
5969
+ onDeleteEndpoint,
5970
+ hideHeader,
5971
+ className
5972
+ }
5973
+ );
5974
+ }
5975
+
5976
+ // src/developer/standalone/billing.tsx
5977
+ import { jsx as jsx53 } from "react/jsx-runtime";
5978
+ function StandaloneBilling({
5979
+ billingData,
5980
+ onManagePlan,
5981
+ onUpdatePaymentMethod,
5982
+ onDownloadInvoice,
5983
+ onToggleAlerts,
5984
+ hideHeader = true,
5985
+ className
5986
+ }) {
5987
+ return /* @__PURE__ */ jsx53(
5988
+ BillingPage,
5989
+ {
5990
+ billingData,
5991
+ onManagePlan,
5992
+ onUpdatePaymentMethod,
5993
+ onDownloadInvoice,
5994
+ onToggleAlerts,
5995
+ hideHeader,
5996
+ className
5997
+ }
5998
+ );
5999
+ }
6000
+
6001
+ // src/developer/standalone/team.tsx
6002
+ import { jsx as jsx54 } from "react/jsx-runtime";
6003
+ function StandaloneTeam({
6004
+ useMockWidgets,
6005
+ hideHeader = true,
6006
+ className
6007
+ }) {
6008
+ return /* @__PURE__ */ jsx54(
6009
+ TeamPage,
6010
+ {
6011
+ useMockWidgets,
6012
+ hideHeader,
6013
+ className
6014
+ }
6015
+ );
6016
+ }
6017
+
5720
6018
  // src/auth/auth-layout.tsx
5721
6019
  import { cn as cn8 } from "@mdxui/primitives/lib/utils";
5722
- import { jsx as jsx50, jsxs as jsxs44 } from "react/jsx-runtime";
5723
- function AuthLayout(_a) {
5724
- var _b = _a, {
5725
- className,
5726
- children,
5727
- title,
5728
- subtitle,
5729
- logo,
5730
- backgroundImage,
5731
- showTestimonial = false,
5732
- testimonial
5733
- } = _b, props = __objRest(_b, [
5734
- "className",
5735
- "children",
5736
- "title",
5737
- "subtitle",
5738
- "logo",
5739
- "backgroundImage",
5740
- "showTestimonial",
5741
- "testimonial"
5742
- ]);
5743
- return /* @__PURE__ */ jsxs44("div", __spreadProps(__spreadValues({ className: cn8("min-h-screen w-full lg:grid lg:grid-cols-2", className) }, props), { children: [
5744
- /* @__PURE__ */ jsx50("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsxs44("div", { className: "mx-auto w-full max-w-[400px] space-y-8 px-4", children: [
5745
- logo && /* @__PURE__ */ jsx50("div", { className: "flex justify-center", children: logo }),
6020
+ import { jsx as jsx55, jsxs as jsxs44 } from "react/jsx-runtime";
6021
+ function AuthLayout({
6022
+ className,
6023
+ children,
6024
+ title,
6025
+ subtitle,
6026
+ logo,
6027
+ backgroundImage,
6028
+ showTestimonial = false,
6029
+ testimonial,
6030
+ ...props
6031
+ }) {
6032
+ return /* @__PURE__ */ jsxs44("div", { className: cn8("min-h-screen w-full lg:grid lg:grid-cols-2", className), ...props, children: [
6033
+ /* @__PURE__ */ jsx55("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsxs44("div", { className: "mx-auto w-full max-w-[400px] space-y-8 px-4", children: [
6034
+ logo && /* @__PURE__ */ jsx55("div", { className: "flex justify-center", children: logo }),
5746
6035
  (title || subtitle) && /* @__PURE__ */ jsxs44("div", { className: "space-y-2 text-center", children: [
5747
- title && /* @__PURE__ */ jsx50("h1", { className: "text-3xl font-bold tracking-tight", children: title }),
5748
- subtitle && /* @__PURE__ */ jsx50("p", { className: "text-muted-foreground text-sm", children: subtitle })
6036
+ title && /* @__PURE__ */ jsx55("h1", { className: "text-3xl font-bold tracking-tight", children: title }),
6037
+ subtitle && /* @__PURE__ */ jsx55("p", { className: "text-muted-foreground text-sm", children: subtitle })
5749
6038
  ] }),
5750
- /* @__PURE__ */ jsx50("div", { children })
6039
+ /* @__PURE__ */ jsx55("div", { children })
5751
6040
  ] }) }),
5752
- /* @__PURE__ */ jsx50(
6041
+ /* @__PURE__ */ jsx55(
5753
6042
  "div",
5754
6043
  {
5755
6044
  className: "bg-muted hidden lg:block",
@@ -5758,14 +6047,14 @@ function AuthLayout(_a) {
5758
6047
  backgroundSize: "cover",
5759
6048
  backgroundPosition: "center"
5760
6049
  } : void 0,
5761
- children: showTestimonial && testimonial && !backgroundImage && /* @__PURE__ */ jsx50("div", { className: "flex h-full items-center justify-center p-12", children: /* @__PURE__ */ jsx50("div", { className: "max-w-md space-y-6", children: /* @__PURE__ */ jsxs44("blockquote", { className: "space-y-4", children: [
6050
+ children: showTestimonial && testimonial && !backgroundImage && /* @__PURE__ */ jsx55("div", { className: "flex h-full items-center justify-center p-12", children: /* @__PURE__ */ jsx55("div", { className: "max-w-md space-y-6", children: /* @__PURE__ */ jsxs44("blockquote", { className: "space-y-4", children: [
5762
6051
  /* @__PURE__ */ jsxs44("p", { className: "text-lg font-medium leading-relaxed", children: [
5763
6052
  '"',
5764
6053
  testimonial.quote,
5765
6054
  '"'
5766
6055
  ] }),
5767
6056
  /* @__PURE__ */ jsxs44("footer", { className: "flex items-center gap-3", children: [
5768
- testimonial.avatar && /* @__PURE__ */ jsx50(
6057
+ testimonial.avatar && /* @__PURE__ */ jsx55(
5769
6058
  "img",
5770
6059
  {
5771
6060
  src: testimonial.avatar,
@@ -5774,19 +6063,19 @@ function AuthLayout(_a) {
5774
6063
  }
5775
6064
  ),
5776
6065
  /* @__PURE__ */ jsxs44("div", { children: [
5777
- /* @__PURE__ */ jsx50("div", { className: "font-semibold", children: testimonial.author }),
5778
- /* @__PURE__ */ jsx50("div", { className: "text-muted-foreground text-sm", children: testimonial.role })
6066
+ /* @__PURE__ */ jsx55("div", { className: "font-semibold", children: testimonial.author }),
6067
+ /* @__PURE__ */ jsx55("div", { className: "text-muted-foreground text-sm", children: testimonial.role })
5779
6068
  ] })
5780
6069
  ] })
5781
6070
  ] }) }) })
5782
6071
  }
5783
6072
  )
5784
- ] }));
6073
+ ] });
5785
6074
  }
5786
6075
 
5787
6076
  // src/auth/login-page.tsx
5788
6077
  import { LoginForm } from "@mdxui/primitives/auth/login-form";
5789
- import { jsx as jsx51 } from "react/jsx-runtime";
6078
+ import { jsx as jsx56 } from "react/jsx-runtime";
5790
6079
  function LoginPage({
5791
6080
  onSubmit,
5792
6081
  onOAuthClick,
@@ -5805,7 +6094,7 @@ function LoginPage({
5805
6094
  showTestimonial = false,
5806
6095
  testimonial
5807
6096
  }) {
5808
- return /* @__PURE__ */ jsx51(
6097
+ return /* @__PURE__ */ jsx56(
5809
6098
  AuthLayout,
5810
6099
  {
5811
6100
  logo,
@@ -5814,7 +6103,7 @@ function LoginPage({
5814
6103
  backgroundImage,
5815
6104
  showTestimonial,
5816
6105
  testimonial,
5817
- children: /* @__PURE__ */ jsx51(
6106
+ children: /* @__PURE__ */ jsx56(
5818
6107
  LoginForm,
5819
6108
  {
5820
6109
  onSubmit,
@@ -5835,7 +6124,7 @@ function LoginPage({
5835
6124
 
5836
6125
  // src/auth/signup-page.tsx
5837
6126
  import { SignupForm } from "@mdxui/primitives/auth/signup-form";
5838
- import { jsx as jsx52 } from "react/jsx-runtime";
6127
+ import { jsx as jsx57 } from "react/jsx-runtime";
5839
6128
  function SignupPage({
5840
6129
  onSubmit,
5841
6130
  onOAuthClick,
@@ -5852,7 +6141,7 @@ function SignupPage({
5852
6141
  showTestimonial = false,
5853
6142
  testimonial
5854
6143
  }) {
5855
- return /* @__PURE__ */ jsx52(
6144
+ return /* @__PURE__ */ jsx57(
5856
6145
  AuthLayout,
5857
6146
  {
5858
6147
  logo,
@@ -5861,7 +6150,7 @@ function SignupPage({
5861
6150
  backgroundImage,
5862
6151
  showTestimonial,
5863
6152
  testimonial,
5864
- children: /* @__PURE__ */ jsx52(
6153
+ children: /* @__PURE__ */ jsx57(
5865
6154
  SignupForm,
5866
6155
  {
5867
6156
  onSubmit,
@@ -5880,7 +6169,7 @@ function SignupPage({
5880
6169
 
5881
6170
  // src/auth/password-reset-page.tsx
5882
6171
  import { PasswordResetForm } from "@mdxui/primitives/auth/password-reset-form";
5883
- import { jsx as jsx53 } from "react/jsx-runtime";
6172
+ import { jsx as jsx58 } from "react/jsx-runtime";
5884
6173
  function PasswordResetPage({
5885
6174
  mode = "request",
5886
6175
  onRequestSubmit,
@@ -5896,14 +6185,14 @@ function PasswordResetPage({
5896
6185
  }) {
5897
6186
  const defaultTitle = mode === "request" ? "Reset your password" : "Create new password";
5898
6187
  const defaultSubtitle = mode === "request" ? "We'll send you a link to reset your password" : "Enter your new password below";
5899
- return /* @__PURE__ */ jsx53(
6188
+ return /* @__PURE__ */ jsx58(
5900
6189
  AuthLayout,
5901
6190
  {
5902
6191
  logo,
5903
6192
  title: title || defaultTitle,
5904
6193
  subtitle: subtitle || defaultSubtitle,
5905
6194
  backgroundImage,
5906
- children: /* @__PURE__ */ jsx53(
6195
+ children: /* @__PURE__ */ jsx58(
5907
6196
  PasswordResetForm,
5908
6197
  {
5909
6198
  mode,
@@ -5921,7 +6210,7 @@ function PasswordResetPage({
5921
6210
 
5922
6211
  // src/auth/otp-page.tsx
5923
6212
  import { OTPInputForm } from "@mdxui/primitives/auth/otp-input";
5924
- import { jsx as jsx54 } from "react/jsx-runtime";
6213
+ import { jsx as jsx59 } from "react/jsx-runtime";
5925
6214
  function OTPPage({
5926
6215
  onSubmit,
5927
6216
  onResend,
@@ -5935,7 +6224,7 @@ function OTPPage({
5935
6224
  description,
5936
6225
  backgroundImage
5937
6226
  }) {
5938
- return /* @__PURE__ */ jsx54(AuthLayout, { logo, backgroundImage, children: /* @__PURE__ */ jsx54(
6227
+ return /* @__PURE__ */ jsx59(AuthLayout, { logo, backgroundImage, children: /* @__PURE__ */ jsx59(
5939
6228
  OTPInputForm,
5940
6229
  {
5941
6230
  onSubmit,
@@ -5953,7 +6242,7 @@ function OTPPage({
5953
6242
  // src/auth/onboarding-page.tsx
5954
6243
  import { OnboardingWizard } from "@mdxui/primitives/auth/onboarding-wizard";
5955
6244
  import { cn as cn9 } from "@mdxui/primitives/lib/utils";
5956
- import { jsx as jsx55, jsxs as jsxs45 } from "react/jsx-runtime";
6245
+ import { jsx as jsx60, jsxs as jsxs45 } from "react/jsx-runtime";
5957
6246
  function OnboardingPage({
5958
6247
  steps,
5959
6248
  onComplete,
@@ -5966,9 +6255,9 @@ function OnboardingPage({
5966
6255
  showProgress = true,
5967
6256
  className
5968
6257
  }) {
5969
- return /* @__PURE__ */ jsx55("div", { className: cn9("flex min-h-screen items-center justify-center p-4", className), children: /* @__PURE__ */ jsxs45("div", { className: "w-full space-y-8", children: [
5970
- logo && /* @__PURE__ */ jsx55("div", { className: "flex justify-center", children: logo }),
5971
- /* @__PURE__ */ jsx55(
6258
+ return /* @__PURE__ */ jsx60("div", { className: cn9("flex min-h-screen items-center justify-center p-4", className), children: /* @__PURE__ */ jsxs45("div", { className: "w-full space-y-8", children: [
6259
+ logo && /* @__PURE__ */ jsx60("div", { className: "flex justify-center", children: logo }),
6260
+ /* @__PURE__ */ jsx60(
5972
6261
  OnboardingWizard,
5973
6262
  {
5974
6263
  steps,
@@ -5983,16 +6272,20 @@ function OnboardingPage({
5983
6272
  )
5984
6273
  ] }) });
5985
6274
  }
5986
- var export_ThemeScript = themes_exports.ThemeScript;
5987
- var export_applyThemeToElement = themes_exports.applyThemeToElement;
5988
- var export_getResolvedMode = themes_exports.getResolvedMode;
5989
- var export_getThemeCSS = themes_exports.getThemeCSS;
5990
- var export_getThemeScriptContent = themes_exports.getThemeScriptContent;
5991
- var export_isThemePreset = themes_exports.isThemePreset;
5992
- var export_themeCSS = themes_exports.themeCSS;
5993
- var export_themeNames = themes_exports.themeNames;
5994
- var export_themePresets = themes_exports.themePresets;
5995
- var export_useThemeStore = themes_exports.useThemeStore;
6275
+
6276
+ // src/index.ts
6277
+ var components = {
6278
+ // Layout Components
6279
+ App: DeveloperDashboard,
6280
+ Shell: DashboardLayout,
6281
+ Dashboard: OverviewPage,
6282
+ Settings: SettingsPage,
6283
+ // Pre-built Features
6284
+ DeveloperDashboard,
6285
+ APIKeys: APIKeyManager,
6286
+ Team: TeamManager,
6287
+ Billing
6288
+ };
5996
6289
  export {
5997
6290
  APIKeyManager,
5998
6291
  ActivityFeed,
@@ -6034,12 +6327,17 @@ export {
6034
6327
  SidebarAd,
6035
6328
  SignupPage,
6036
6329
  SortableHeader,
6330
+ StandaloneAPIKeys,
6331
+ StandaloneBilling,
6332
+ StandaloneProvider,
6333
+ StandaloneTeam,
6334
+ StandaloneWebhooks,
6037
6335
  StatusBadge,
6038
6336
  StatusDot,
6039
6337
  TeamManager,
6040
6338
  TeamPage,
6041
6339
  TeamSwitcher,
6042
- export_ThemeScript as ThemeScript,
6340
+ ThemeScript,
6043
6341
  UserProfile,
6044
6342
  VaultDeleteDialog,
6045
6343
  VaultEmptyState,
@@ -6051,27 +6349,31 @@ export {
6051
6349
  WebhooksEndpointsPage,
6052
6350
  WebhooksEventCatalogPage,
6053
6351
  WebhooksLogsPage,
6054
- export_applyThemeToElement as applyThemeToElement,
6352
+ applyThemeToElement3 as applyThemeToElement,
6353
+ components,
6354
+ dashboardIcons,
6055
6355
  getAuthToken,
6056
6356
  getDebugStatus,
6057
6357
  getEffectiveToken,
6058
- export_getResolvedMode as getResolvedMode,
6358
+ getIconByName,
6359
+ getResolvedMode,
6059
6360
  getSDK,
6060
- export_getThemeCSS as getThemeCSS,
6061
- export_getThemeScriptContent as getThemeScriptContent,
6361
+ getThemeCSS,
6362
+ getThemeScriptContent,
6062
6363
  isAuthenticated,
6063
6364
  isDebugMode,
6064
- export_isThemePreset as isThemePreset,
6365
+ isThemePreset,
6065
6366
  setDebugMode,
6066
6367
  setDevToken,
6067
6368
  testSDKConnection,
6068
- export_themeCSS as themeCSS,
6069
- export_themeNames as themeNames,
6070
- export_themePresets as themePresets,
6369
+ themeCSS,
6370
+ themeNames,
6371
+ themePresets,
6071
6372
  useAuth10 as useAuth,
6072
6373
  useCommandPalette,
6374
+ useCustomRoutes,
6073
6375
  useDashboard,
6074
6376
  useRoutes,
6075
- export_useThemeStore as useThemeStore
6377
+ useThemeStore
6076
6378
  };
6077
6379
  //# sourceMappingURL=index.js.map