@mdxui/auth 1.1.0 → 1.4.0

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
@@ -125,6 +125,7 @@ function IdentityProviderMinimal({
125
125
  }
126
126
 
127
127
  // src/providers/auth-gate.tsx
128
+ import { useEffect as useEffect2, useRef } from "react";
128
129
  import { useAuth } from "@workos-inc/authkit-react";
129
130
  import { Fragment, jsx as jsx3, jsxs } from "react/jsx-runtime";
130
131
  function DefaultLoadingComponent() {
@@ -157,7 +158,19 @@ function AuthGate({
157
158
  onUnauthenticated = "landing",
158
159
  redirectUrl
159
160
  }) {
160
- const { user, isLoading } = useAuth();
161
+ const { user, isLoading, signIn } = useAuth();
162
+ const signInCalled = useRef(false);
163
+ useEffect2(() => {
164
+ if (onUnauthenticated === "signIn" && !isLoading && !user && !signInCalled.current) {
165
+ signInCalled.current = true;
166
+ signIn();
167
+ }
168
+ }, [onUnauthenticated, isLoading, user, signIn]);
169
+ useEffect2(() => {
170
+ if (user) {
171
+ signInCalled.current = false;
172
+ }
173
+ }, [user]);
161
174
  if (!required) {
162
175
  return /* @__PURE__ */ jsx3(Fragment, { children });
163
176
  }
@@ -168,6 +181,8 @@ function AuthGate({
168
181
  return /* @__PURE__ */ jsx3(Fragment, { children });
169
182
  }
170
183
  switch (onUnauthenticated) {
184
+ case "signIn":
185
+ return /* @__PURE__ */ jsx3(Fragment, { children: loadingComponent ?? /* @__PURE__ */ jsx3(DefaultLoadingComponent, {}) });
171
186
  case "redirect":
172
187
  if (redirectUrl && typeof window !== "undefined") {
173
188
  window.location.href = redirectUrl;
@@ -182,56 +197,121 @@ function AuthGate({
182
197
  }
183
198
  }
184
199
 
200
+ // src/providers/vault-provider.tsx
201
+ import { createContext, useContext, useMemo } from "react";
202
+ import { jsx as jsx4 } from "react/jsx-runtime";
203
+ var VaultContext = createContext(null);
204
+ var defaultFields = [
205
+ { key: "api_key", label: "API Key", type: "password", required: true }
206
+ ];
207
+ function VaultProvider({
208
+ children,
209
+ client,
210
+ initialItems = []
211
+ }) {
212
+ const contextValue = useMemo(() => {
213
+ const getIntegrationFields = (integrationId) => {
214
+ if (client?.getIntegrationFields) {
215
+ return client.getIntegrationFields(integrationId);
216
+ }
217
+ return defaultFields;
218
+ };
219
+ return {
220
+ client: client ?? null,
221
+ items: initialItems,
222
+ loading: false,
223
+ error: null,
224
+ reload: async () => {
225
+ if (!client) {
226
+ console.warn("VaultProvider: No client provided, cannot reload");
227
+ return;
228
+ }
229
+ await client.list();
230
+ },
231
+ createItem: async (integrationId, credentials) => {
232
+ if (!client) {
233
+ throw new Error("VaultProvider: No client provided");
234
+ }
235
+ await client.create(integrationId, credentials);
236
+ },
237
+ rotateItem: async (id, credentials) => {
238
+ if (!client) {
239
+ throw new Error("VaultProvider: No client provided");
240
+ }
241
+ await client.rotate(id, credentials);
242
+ },
243
+ deleteItem: async (id) => {
244
+ if (!client) {
245
+ throw new Error("VaultProvider: No client provided");
246
+ }
247
+ await client.delete(id);
248
+ },
249
+ getIntegrationFields
250
+ };
251
+ }, [client, initialItems]);
252
+ return /* @__PURE__ */ jsx4(VaultContext.Provider, { value: contextValue, children });
253
+ }
254
+ function useVaultContext() {
255
+ const context = useContext(VaultContext);
256
+ if (!context) {
257
+ throw new Error("useVaultContext must be used within a VaultProvider");
258
+ }
259
+ return context;
260
+ }
261
+ function useVaultContextOptional() {
262
+ return useContext(VaultContext);
263
+ }
264
+
185
265
  // src/widgets/user-profile.tsx
186
266
  import { UserProfile as WorkOSUserProfile } from "@workos-inc/widgets";
187
- import { jsx as jsx4 } from "react/jsx-runtime";
267
+ import { jsx as jsx5 } from "react/jsx-runtime";
188
268
  function UserProfile({ authToken, className }) {
189
- return /* @__PURE__ */ jsx4("div", { className, children: /* @__PURE__ */ jsx4(WorkOSUserProfile, { authToken }) });
269
+ return /* @__PURE__ */ jsx5("div", { className, children: /* @__PURE__ */ jsx5(WorkOSUserProfile, { authToken }) });
190
270
  }
191
271
 
192
272
  // src/widgets/user-security.tsx
193
273
  import { UserSecurity as WorkOSUserSecurity } from "@workos-inc/widgets";
194
- import { jsx as jsx5 } from "react/jsx-runtime";
274
+ import { jsx as jsx6 } from "react/jsx-runtime";
195
275
  function UserSecurity({ authToken, className }) {
196
- return /* @__PURE__ */ jsx5("div", { className, children: /* @__PURE__ */ jsx5(WorkOSUserSecurity, { authToken }) });
276
+ return /* @__PURE__ */ jsx6("div", { className, children: /* @__PURE__ */ jsx6(WorkOSUserSecurity, { authToken }) });
197
277
  }
198
278
 
199
279
  // src/widgets/user-sessions.tsx
200
280
  import { UserSessions as WorkOSUserSessions } from "@workos-inc/widgets";
201
- import { jsx as jsx6 } from "react/jsx-runtime";
281
+ import { jsx as jsx7 } from "react/jsx-runtime";
202
282
  function UserSessions(props) {
203
283
  const { className, ...rest } = props;
204
- return /* @__PURE__ */ jsx6("div", { className, children: /* @__PURE__ */ jsx6(WorkOSUserSessions, { ...rest }) });
284
+ return /* @__PURE__ */ jsx7("div", { className, children: /* @__PURE__ */ jsx7(WorkOSUserSessions, { ...rest }) });
205
285
  }
206
286
 
207
287
  // src/widgets/api-keys.tsx
208
288
  import { ApiKeys as WorkOSApiKeys } from "@workos-inc/widgets";
209
- import { jsx as jsx7 } from "react/jsx-runtime";
289
+ import { jsx as jsx8 } from "react/jsx-runtime";
210
290
  function ApiKeys({ authToken, className }) {
211
- return /* @__PURE__ */ jsx7("div", { className, children: /* @__PURE__ */ jsx7(WorkOSApiKeys, { authToken }) });
291
+ return /* @__PURE__ */ jsx8("div", { className, children: /* @__PURE__ */ jsx8(WorkOSApiKeys, { authToken }) });
212
292
  }
213
293
 
214
294
  // src/widgets/users-management.tsx
215
295
  import { UsersManagement as WorkOSUsersManagement } from "@workos-inc/widgets";
216
- import { jsx as jsx8 } from "react/jsx-runtime";
296
+ import { jsx as jsx9 } from "react/jsx-runtime";
217
297
  function UsersManagement({
218
298
  authToken,
219
299
  organizationId: _organizationId,
220
300
  className
221
301
  }) {
222
- return /* @__PURE__ */ jsx8("div", { className, children: /* @__PURE__ */ jsx8(WorkOSUsersManagement, { authToken }) });
302
+ return /* @__PURE__ */ jsx9("div", { className, children: /* @__PURE__ */ jsx9(WorkOSUsersManagement, { authToken }) });
223
303
  }
224
304
 
225
305
  // src/widgets/pipes.tsx
226
306
  import { Pipes as WorkOSPipes } from "@workos-inc/widgets";
227
- import { jsx as jsx9 } from "react/jsx-runtime";
307
+ import { jsx as jsx10 } from "react/jsx-runtime";
228
308
  function Pipes({ authToken, className }) {
229
- return /* @__PURE__ */ jsx9("div", { className, children: /* @__PURE__ */ jsx9(WorkOSPipes, { authToken }) });
309
+ return /* @__PURE__ */ jsx10("div", { className, children: /* @__PURE__ */ jsx10(WorkOSPipes, { authToken }) });
230
310
  }
231
311
 
232
312
  // src/widgets/organization-switcher.tsx
233
313
  import { OrganizationSwitcher as WorkOSOrganizationSwitcher } from "@workos-inc/widgets";
234
- import { jsx as jsx10 } from "react/jsx-runtime";
314
+ import { jsx as jsx11 } from "react/jsx-runtime";
235
315
  function OrganizationSwitcher({
236
316
  authToken,
237
317
  switchToOrganization,
@@ -240,7 +320,7 @@ function OrganizationSwitcher({
240
320
  truncateBehavior,
241
321
  className
242
322
  }) {
243
- return /* @__PURE__ */ jsx10("div", { className, children: /* @__PURE__ */ jsx10(
323
+ return /* @__PURE__ */ jsx11("div", { className, children: /* @__PURE__ */ jsx11(
244
324
  WorkOSOrganizationSwitcher,
245
325
  {
246
326
  authToken,
@@ -252,9 +332,692 @@ function OrganizationSwitcher({
252
332
  ) });
253
333
  }
254
334
 
335
+ // src/vault/secrets-manager/secrets-manager.tsx
336
+ import {
337
+ Badge,
338
+ Button as Button2,
339
+ Card,
340
+ CardContent,
341
+ CardDescription,
342
+ CardHeader,
343
+ CardTitle,
344
+ Dialog,
345
+ DialogContent,
346
+ DialogHeader,
347
+ DialogTitle,
348
+ DialogTrigger,
349
+ Input as Input2,
350
+ Select as Select2,
351
+ SelectContent as SelectContent2,
352
+ SelectItem as SelectItem2,
353
+ SelectTrigger as SelectTrigger2,
354
+ SelectValue as SelectValue2,
355
+ Table,
356
+ TableBody,
357
+ TableCell,
358
+ TableHead,
359
+ TableHeader,
360
+ TableRow
361
+ } from "@mdxui/primitives";
362
+ import { cn } from "@mdxui/primitives/lib/utils";
363
+ import {
364
+ Copy,
365
+ Edit,
366
+ Eye,
367
+ EyeOff,
368
+ Filter,
369
+ Plus,
370
+ Search,
371
+ Trash2
372
+ } from "lucide-react";
373
+ import * as React2 from "react";
374
+ import { toast } from "sonner";
375
+
376
+ // src/vault/secrets-manager/secret-form.tsx
377
+ import {
378
+ Button,
379
+ Input,
380
+ Label,
381
+ Select,
382
+ SelectContent,
383
+ SelectItem,
384
+ SelectTrigger,
385
+ SelectValue,
386
+ Textarea
387
+ } from "@mdxui/primitives";
388
+ import * as React from "react";
389
+ import { jsx as jsx12, jsxs as jsxs2 } from "react/jsx-runtime";
390
+ function SecretForm({
391
+ secret,
392
+ environment: defaultEnvironment,
393
+ environments,
394
+ onSubmit,
395
+ onCancel
396
+ }) {
397
+ const [key, setKey] = React.useState(secret?.key || "");
398
+ const [value, setValue] = React.useState(secret?.value || "");
399
+ const [description, setDescription] = React.useState(
400
+ secret?.description || ""
401
+ );
402
+ const [environment, setEnvironment] = React.useState(
403
+ secret?.environment || defaultEnvironment
404
+ );
405
+ const handleSubmit = (e) => {
406
+ e.preventDefault();
407
+ if (!key.trim() || !value.trim()) return;
408
+ onSubmit({
409
+ key: key.trim(),
410
+ value: value.trim(),
411
+ description: description.trim() || void 0,
412
+ environment
413
+ });
414
+ };
415
+ return /* @__PURE__ */ jsxs2("form", { onSubmit: handleSubmit, className: "space-y-4", children: [
416
+ /* @__PURE__ */ jsxs2("div", { className: "space-y-2", children: [
417
+ /* @__PURE__ */ jsx12(Label, { htmlFor: "key", children: "Key *" }),
418
+ /* @__PURE__ */ jsx12(
419
+ Input,
420
+ {
421
+ id: "key",
422
+ placeholder: "DATABASE_URL",
423
+ value: key,
424
+ onChange: (e) => setKey(e.target.value.toUpperCase().replace(/[^A-Z0-9_]/g, "_")),
425
+ required: true,
426
+ autoFocus: true
427
+ }
428
+ ),
429
+ /* @__PURE__ */ jsx12("p", { className: "text-xs text-muted-foreground", children: "Use UPPER_CASE with underscores (e.g., API_KEY, DATABASE_URL)" })
430
+ ] }),
431
+ /* @__PURE__ */ jsxs2("div", { className: "space-y-2", children: [
432
+ /* @__PURE__ */ jsx12(Label, { htmlFor: "value", children: "Value *" }),
433
+ /* @__PURE__ */ jsx12(
434
+ Textarea,
435
+ {
436
+ id: "value",
437
+ placeholder: "Enter secret value",
438
+ value,
439
+ onChange: (e) => setValue(e.target.value),
440
+ rows: 3,
441
+ required: true,
442
+ className: "font-mono"
443
+ }
444
+ )
445
+ ] }),
446
+ /* @__PURE__ */ jsxs2("div", { className: "space-y-2", children: [
447
+ /* @__PURE__ */ jsx12(Label, { htmlFor: "environment", children: "Environment *" }),
448
+ /* @__PURE__ */ jsxs2(Select, { value: environment, onValueChange: setEnvironment, children: [
449
+ /* @__PURE__ */ jsx12(SelectTrigger, { id: "environment", children: /* @__PURE__ */ jsx12(SelectValue, {}) }),
450
+ /* @__PURE__ */ jsx12(SelectContent, { children: environments.map((env) => /* @__PURE__ */ jsx12(SelectItem, { value: env, children: env.charAt(0).toUpperCase() + env.slice(1) }, env)) })
451
+ ] })
452
+ ] }),
453
+ /* @__PURE__ */ jsxs2("div", { className: "space-y-2", children: [
454
+ /* @__PURE__ */ jsx12(Label, { htmlFor: "description", children: "Description" }),
455
+ /* @__PURE__ */ jsx12(
456
+ Textarea,
457
+ {
458
+ id: "description",
459
+ placeholder: "Optional description of this secret",
460
+ value: description,
461
+ onChange: (e) => setDescription(e.target.value),
462
+ rows: 2
463
+ }
464
+ )
465
+ ] }),
466
+ /* @__PURE__ */ jsxs2("div", { className: "flex justify-end gap-2", children: [
467
+ /* @__PURE__ */ jsx12(Button, { type: "button", variant: "outline", onClick: onCancel, children: "Cancel" }),
468
+ /* @__PURE__ */ jsxs2(Button, { type: "submit", disabled: !key.trim() || !value.trim(), children: [
469
+ secret ? "Update" : "Create",
470
+ " Secret"
471
+ ] })
472
+ ] })
473
+ ] });
474
+ }
475
+
476
+ // src/vault/secrets-manager/secrets-manager.tsx
477
+ import { jsx as jsx13, jsxs as jsxs3 } from "react/jsx-runtime";
478
+ function SecretsManager({
479
+ secrets: externalSecrets = [],
480
+ environments = ["development", "staging", "production"],
481
+ currentEnvironment = "development",
482
+ onEnvironmentChange,
483
+ onCreate,
484
+ onUpdate,
485
+ onDelete,
486
+ hideValues: initialHideValues = true,
487
+ editable = true,
488
+ className
489
+ }) {
490
+ const [localSecrets, setLocalSecrets] = React2.useState([]);
491
+ const [hideValues, setHideValues] = React2.useState(initialHideValues);
492
+ const [searchQuery, setSearchQuery] = React2.useState("");
493
+ const [environment, setEnvironment] = React2.useState(currentEnvironment);
494
+ const [visibleSecrets, setVisibleSecrets] = React2.useState(
495
+ /* @__PURE__ */ new Set()
496
+ );
497
+ const [editingSecret, setEditingSecret] = React2.useState(null);
498
+ const [isCreateDialogOpen, setIsCreateDialogOpen] = React2.useState(false);
499
+ const [isEditDialogOpen, setIsEditDialogOpen] = React2.useState(false);
500
+ const secrets = externalSecrets.length > 0 ? externalSecrets : localSecrets;
501
+ React2.useEffect(() => {
502
+ setEnvironment(currentEnvironment);
503
+ }, [currentEnvironment]);
504
+ const filteredSecrets = React2.useMemo(() => {
505
+ return secrets.filter((secret) => {
506
+ const matchesSearch = searchQuery ? secret.key.toLowerCase().includes(searchQuery.toLowerCase()) || secret.description?.toLowerCase().includes(searchQuery.toLowerCase()) : true;
507
+ const matchesEnvironment = environment === "all" || secret.environment === environment;
508
+ return matchesSearch && matchesEnvironment;
509
+ });
510
+ }, [secrets, searchQuery, environment]);
511
+ const handleEnvironmentChange = (newEnvironment) => {
512
+ setEnvironment(newEnvironment);
513
+ onEnvironmentChange?.(newEnvironment);
514
+ };
515
+ const handleCreate = async (secretData) => {
516
+ const newSecret = {
517
+ ...secretData,
518
+ id: crypto.randomUUID(),
519
+ createdAt: /* @__PURE__ */ new Date(),
520
+ updatedAt: /* @__PURE__ */ new Date()
521
+ };
522
+ try {
523
+ await onCreate?.(secretData);
524
+ if (externalSecrets.length === 0) {
525
+ setLocalSecrets((prev) => [...prev, newSecret]);
526
+ }
527
+ setIsCreateDialogOpen(false);
528
+ toast.success("Secret created successfully");
529
+ } catch (error) {
530
+ toast.error("Failed to create secret");
531
+ }
532
+ };
533
+ const handleUpdate = async (id, updates) => {
534
+ try {
535
+ await onUpdate?.(id, { ...updates, updatedAt: /* @__PURE__ */ new Date() });
536
+ if (externalSecrets.length === 0) {
537
+ setLocalSecrets(
538
+ (prev) => prev.map(
539
+ (secret) => secret.id === id ? { ...secret, ...updates, updatedAt: /* @__PURE__ */ new Date() } : secret
540
+ )
541
+ );
542
+ }
543
+ setIsEditDialogOpen(false);
544
+ setEditingSecret(null);
545
+ toast.success("Secret updated successfully");
546
+ } catch (error) {
547
+ toast.error("Failed to update secret");
548
+ }
549
+ };
550
+ const handleDelete = async (id) => {
551
+ if (!confirm("Are you sure you want to delete this secret?")) return;
552
+ try {
553
+ await onDelete?.(id);
554
+ if (externalSecrets.length === 0) {
555
+ setLocalSecrets((prev) => prev.filter((secret) => secret.id !== id));
556
+ }
557
+ toast.success("Secret deleted");
558
+ } catch (error) {
559
+ toast.error("Failed to delete secret");
560
+ }
561
+ };
562
+ const handleCopy = (value) => {
563
+ navigator.clipboard.writeText(value);
564
+ toast.success("Value copied to clipboard");
565
+ };
566
+ const toggleSecretVisibility = (id) => {
567
+ setVisibleSecrets((prev) => {
568
+ const next = new Set(prev);
569
+ if (next.has(id)) {
570
+ next.delete(id);
571
+ } else {
572
+ next.add(id);
573
+ }
574
+ return next;
575
+ });
576
+ };
577
+ const toggleAllVisibility = () => {
578
+ setHideValues(!hideValues);
579
+ if (!hideValues) {
580
+ setVisibleSecrets(/* @__PURE__ */ new Set());
581
+ }
582
+ };
583
+ const isSecretVisible = (id) => {
584
+ return hideValues ? visibleSecrets.has(id) : true;
585
+ };
586
+ return /* @__PURE__ */ jsxs3("div", { className: cn("space-y-4", className), children: [
587
+ /* @__PURE__ */ jsxs3(Card, { children: [
588
+ /* @__PURE__ */ jsx13(CardHeader, { children: /* @__PURE__ */ jsxs3("div", { className: "flex items-start justify-between", children: [
589
+ /* @__PURE__ */ jsxs3("div", { children: [
590
+ /* @__PURE__ */ jsx13(CardTitle, { children: "Environment Variables" }),
591
+ /* @__PURE__ */ jsx13(CardDescription, { children: "Manage your application secrets and configuration" })
592
+ ] }),
593
+ editable && /* @__PURE__ */ jsxs3(
594
+ Dialog,
595
+ {
596
+ open: isCreateDialogOpen,
597
+ onOpenChange: setIsCreateDialogOpen,
598
+ children: [
599
+ /* @__PURE__ */ jsx13(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsxs3(Button2, { children: [
600
+ /* @__PURE__ */ jsx13(Plus, { className: "mr-2 size-4" }),
601
+ "Add Secret"
602
+ ] }) }),
603
+ /* @__PURE__ */ jsxs3(DialogContent, { children: [
604
+ /* @__PURE__ */ jsx13(DialogHeader, { children: /* @__PURE__ */ jsx13(DialogTitle, { children: "Create New Secret" }) }),
605
+ /* @__PURE__ */ jsx13(
606
+ SecretForm,
607
+ {
608
+ environment,
609
+ environments,
610
+ onSubmit: handleCreate,
611
+ onCancel: () => setIsCreateDialogOpen(false)
612
+ }
613
+ )
614
+ ] })
615
+ ]
616
+ }
617
+ )
618
+ ] }) }),
619
+ /* @__PURE__ */ jsxs3(CardContent, { className: "space-y-4", children: [
620
+ /* @__PURE__ */ jsxs3("div", { className: "flex flex-wrap items-center gap-2", children: [
621
+ /* @__PURE__ */ jsxs3("div", { className: "relative flex-1", children: [
622
+ /* @__PURE__ */ jsx13(Search, { className: "absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }),
623
+ /* @__PURE__ */ jsx13(
624
+ Input2,
625
+ {
626
+ placeholder: "Search secrets...",
627
+ value: searchQuery,
628
+ onChange: (e) => setSearchQuery(e.target.value),
629
+ className: "pl-9"
630
+ }
631
+ )
632
+ ] }),
633
+ /* @__PURE__ */ jsxs3(Select2, { value: environment, onValueChange: handleEnvironmentChange, children: [
634
+ /* @__PURE__ */ jsxs3(SelectTrigger2, { className: "w-[180px]", children: [
635
+ /* @__PURE__ */ jsx13(Filter, { className: "mr-2 size-4" }),
636
+ /* @__PURE__ */ jsx13(SelectValue2, {})
637
+ ] }),
638
+ /* @__PURE__ */ jsxs3(SelectContent2, { children: [
639
+ /* @__PURE__ */ jsx13(SelectItem2, { value: "all", children: "All Environments" }),
640
+ environments.map((env) => /* @__PURE__ */ jsx13(SelectItem2, { value: env, children: env.charAt(0).toUpperCase() + env.slice(1) }, env))
641
+ ] })
642
+ ] }),
643
+ /* @__PURE__ */ jsx13(Button2, { variant: "outline", size: "icon", onClick: toggleAllVisibility, children: hideValues ? /* @__PURE__ */ jsx13(Eye, { className: "size-4" }) : /* @__PURE__ */ jsx13(EyeOff, { className: "size-4" }) })
644
+ ] }),
645
+ filteredSecrets.length > 0 ? /* @__PURE__ */ jsx13("div", { className: "rounded-md border", children: /* @__PURE__ */ jsxs3(Table, { children: [
646
+ /* @__PURE__ */ jsx13(TableHeader, { children: /* @__PURE__ */ jsxs3(TableRow, { children: [
647
+ /* @__PURE__ */ jsx13(TableHead, { children: "Key" }),
648
+ /* @__PURE__ */ jsx13(TableHead, { children: "Value" }),
649
+ /* @__PURE__ */ jsx13(TableHead, { children: "Environment" }),
650
+ /* @__PURE__ */ jsx13(TableHead, { children: "Description" }),
651
+ /* @__PURE__ */ jsx13(TableHead, { className: "w-[100px]", children: "Actions" })
652
+ ] }) }),
653
+ /* @__PURE__ */ jsx13(TableBody, { children: filteredSecrets.map((secret) => /* @__PURE__ */ jsxs3(TableRow, { children: [
654
+ /* @__PURE__ */ jsx13(TableCell, { children: /* @__PURE__ */ jsx13("code", { className: "rounded bg-muted px-2 py-1 font-mono text-sm", children: secret.key }) }),
655
+ /* @__PURE__ */ jsx13(TableCell, { children: /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2", children: [
656
+ /* @__PURE__ */ jsx13("code", { className: "flex-1 rounded bg-muted px-2 py-1 font-mono text-sm", children: isSecretVisible(secret.id) ? secret.value : "\u2022".repeat(Math.min(secret.value.length, 20)) }),
657
+ /* @__PURE__ */ jsx13(
658
+ Button2,
659
+ {
660
+ variant: "ghost",
661
+ size: "icon-sm",
662
+ onClick: () => toggleSecretVisibility(secret.id),
663
+ children: isSecretVisible(secret.id) ? /* @__PURE__ */ jsx13(EyeOff, { className: "size-4" }) : /* @__PURE__ */ jsx13(Eye, { className: "size-4" })
664
+ }
665
+ ),
666
+ /* @__PURE__ */ jsx13(
667
+ Button2,
668
+ {
669
+ variant: "ghost",
670
+ size: "icon-sm",
671
+ onClick: () => handleCopy(secret.value),
672
+ children: /* @__PURE__ */ jsx13(Copy, { className: "size-4" })
673
+ }
674
+ )
675
+ ] }) }),
676
+ /* @__PURE__ */ jsx13(TableCell, { children: /* @__PURE__ */ jsx13(Badge, { variant: "secondary", children: secret.environment }) }),
677
+ /* @__PURE__ */ jsx13(TableCell, { children: /* @__PURE__ */ jsx13("span", { className: "text-sm text-muted-foreground", children: secret.description || "-" }) }),
678
+ /* @__PURE__ */ jsx13(TableCell, { children: editable && /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-1", children: [
679
+ /* @__PURE__ */ jsx13(
680
+ Button2,
681
+ {
682
+ variant: "ghost",
683
+ size: "icon-sm",
684
+ onClick: () => {
685
+ setEditingSecret(secret);
686
+ setIsEditDialogOpen(true);
687
+ },
688
+ children: /* @__PURE__ */ jsx13(Edit, { className: "size-4" })
689
+ }
690
+ ),
691
+ /* @__PURE__ */ jsx13(
692
+ Button2,
693
+ {
694
+ variant: "ghost",
695
+ size: "icon-sm",
696
+ onClick: () => handleDelete(secret.id),
697
+ children: /* @__PURE__ */ jsx13(Trash2, { className: "size-4 text-destructive" })
698
+ }
699
+ )
700
+ ] }) })
701
+ ] }, secret.id)) })
702
+ ] }) }) : /* @__PURE__ */ jsx13("div", { className: "flex h-32 items-center justify-center rounded-md border-2 border-dashed", children: /* @__PURE__ */ jsx13("p", { className: "text-sm text-muted-foreground", children: searchQuery ? "No secrets found matching your search" : "No secrets yet. Add your first secret to get started." }) })
703
+ ] })
704
+ ] }),
705
+ editingSecret && /* @__PURE__ */ jsx13(Dialog, { open: isEditDialogOpen, onOpenChange: setIsEditDialogOpen, children: /* @__PURE__ */ jsxs3(DialogContent, { children: [
706
+ /* @__PURE__ */ jsx13(DialogHeader, { children: /* @__PURE__ */ jsx13(DialogTitle, { children: "Edit Secret" }) }),
707
+ /* @__PURE__ */ jsx13(
708
+ SecretForm,
709
+ {
710
+ secret: editingSecret,
711
+ environment,
712
+ environments,
713
+ onSubmit: (data) => handleUpdate(editingSecret.id, data),
714
+ onCancel: () => {
715
+ setIsEditDialogOpen(false);
716
+ setEditingSecret(null);
717
+ }
718
+ }
719
+ )
720
+ ] }) })
721
+ ] });
722
+ }
723
+
724
+ // src/vault/vault-delete-dialog.tsx
725
+ import {
726
+ Button as Button3,
727
+ Dialog as Dialog2,
728
+ DialogContent as DialogContent2,
729
+ DialogDescription,
730
+ DialogFooter,
731
+ DialogHeader as DialogHeader2,
732
+ DialogTitle as DialogTitle2
733
+ } from "@mdxui/primitives";
734
+ import { jsx as jsx14, jsxs as jsxs4 } from "react/jsx-runtime";
735
+ function VaultDeleteDialog({ isOpen, onClose, itemName, onConfirm }) {
736
+ return /* @__PURE__ */ jsx14(Dialog2, { open: isOpen, onOpenChange: onClose, children: /* @__PURE__ */ jsxs4(DialogContent2, { children: [
737
+ /* @__PURE__ */ jsxs4(DialogHeader2, { children: [
738
+ /* @__PURE__ */ jsx14(DialogTitle2, { children: "Delete Credentials" }),
739
+ /* @__PURE__ */ jsxs4(DialogDescription, { children: [
740
+ "Are you sure you want to delete credentials for ",
741
+ itemName,
742
+ "? This action cannot be undone."
743
+ ] })
744
+ ] }),
745
+ /* @__PURE__ */ jsxs4(DialogFooter, { children: [
746
+ /* @__PURE__ */ jsx14(Button3, { variant: "outline", onClick: onClose, children: "Cancel" }),
747
+ /* @__PURE__ */ jsx14(Button3, { variant: "destructive", onClick: onConfirm, children: "Delete" })
748
+ ] })
749
+ ] }) });
750
+ }
751
+
752
+ // src/vault/vault-empty-state.tsx
753
+ import { Button as Button4 } from "@mdxui/primitives";
754
+ import { Lock } from "lucide-react";
755
+ import { jsx as jsx15, jsxs as jsxs5 } from "react/jsx-runtime";
756
+ function VaultEmptyState({ onAddCredential }) {
757
+ return /* @__PURE__ */ jsxs5("div", { className: "flex flex-col items-center justify-center rounded-md border border-dashed py-24 px-4 text-center", children: [
758
+ /* @__PURE__ */ jsx15("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-muted mb-4", children: /* @__PURE__ */ jsx15(Lock, { className: "h-6 w-6 text-muted-foreground" }) }),
759
+ /* @__PURE__ */ jsx15("h3", { className: "text-lg font-semibold mb-2", children: "No saved credentials" }),
760
+ /* @__PURE__ */ jsx15("p", { className: "text-sm text-muted-foreground mb-6 max-w-md", children: "Add API keys and account credentials for your agents to use securely." }),
761
+ /* @__PURE__ */ jsx15(Button4, { onClick: onAddCredential, children: "Add Credential" })
762
+ ] });
763
+ }
764
+
765
+ // src/vault/vault-input-modal.tsx
766
+ import {
767
+ Button as Button5,
768
+ Dialog as Dialog3,
769
+ DialogContent as DialogContent3,
770
+ DialogFooter as DialogFooter2,
771
+ DialogHeader as DialogHeader3,
772
+ DialogTitle as DialogTitle3,
773
+ Input as Input3,
774
+ Label as Label2
775
+ } from "@mdxui/primitives";
776
+ import { Key } from "lucide-react";
777
+ import { useState as useState4 } from "react";
778
+ import { jsx as jsx16, jsxs as jsxs6 } from "react/jsx-runtime";
779
+ function VaultInputModal({
780
+ isOpen,
781
+ onClose,
782
+ mode,
783
+ integration,
784
+ onSave
785
+ }) {
786
+ const [values, setValues] = useState4({});
787
+ const [loading, setLoading] = useState4(false);
788
+ const handleSubmit = async (e) => {
789
+ e.preventDefault();
790
+ setLoading(true);
791
+ try {
792
+ await onSave(values);
793
+ setValues({});
794
+ onClose();
795
+ } catch (error) {
796
+ console.error("Failed to save credentials:", error);
797
+ } finally {
798
+ setLoading(false);
799
+ }
800
+ };
801
+ const handleClose = () => {
802
+ setValues({});
803
+ onClose();
804
+ };
805
+ if (!integration) return null;
806
+ const isValid = integration.fields.filter((f) => f.required).every((f) => values[f.key]?.trim());
807
+ return /* @__PURE__ */ jsx16(Dialog3, { open: isOpen, onOpenChange: handleClose, children: /* @__PURE__ */ jsxs6(DialogContent3, { children: [
808
+ /* @__PURE__ */ jsx16(DialogHeader3, { children: /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-3", children: [
809
+ /* @__PURE__ */ jsx16("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__ */ jsx16(
810
+ "img",
811
+ {
812
+ src: integration.logoUrl,
813
+ alt: integration.name,
814
+ width: 32,
815
+ height: 32,
816
+ className: "h-full w-full object-contain rounded-sm"
817
+ }
818
+ ) : /* @__PURE__ */ jsx16(Key, { className: "h-5 w-5 text-muted-foreground" }) }),
819
+ /* @__PURE__ */ jsxs6(DialogTitle3, { children: [
820
+ mode === "create" ? "Add" : "Rotate",
821
+ " ",
822
+ integration.name,
823
+ " Credentials"
824
+ ] })
825
+ ] }) }),
826
+ /* @__PURE__ */ jsxs6("form", { onSubmit: handleSubmit, children: [
827
+ /* @__PURE__ */ jsx16("div", { className: "grid gap-4 py-4", children: integration.fields.map((field) => /* @__PURE__ */ jsxs6("div", { className: "grid gap-2", children: [
828
+ /* @__PURE__ */ jsxs6(Label2, { htmlFor: field.key, children: [
829
+ field.label,
830
+ field.required && /* @__PURE__ */ jsx16("span", { className: "text-destructive", children: "*" })
831
+ ] }),
832
+ /* @__PURE__ */ jsx16(
833
+ Input3,
834
+ {
835
+ id: field.key,
836
+ type: field.type,
837
+ placeholder: field.placeholder,
838
+ value: values[field.key] || "",
839
+ onChange: (e) => setValues((prev) => ({
840
+ ...prev,
841
+ [field.key]: e.target.value
842
+ })),
843
+ required: field.required
844
+ }
845
+ )
846
+ ] }, field.key)) }),
847
+ /* @__PURE__ */ jsxs6(DialogFooter2, { children: [
848
+ /* @__PURE__ */ jsx16(Button5, { type: "button", variant: "outline", onClick: handleClose, children: "Cancel" }),
849
+ /* @__PURE__ */ jsx16(Button5, { type: "submit", disabled: loading || !isValid, children: loading ? "Saving..." : "Save" })
850
+ ] })
851
+ ] })
852
+ ] }) });
853
+ }
854
+
855
+ // src/vault/vault-item-card.tsx
856
+ import {
857
+ Button as Button6,
858
+ Card as Card2,
859
+ DropdownMenu,
860
+ DropdownMenuContent,
861
+ DropdownMenuItem,
862
+ DropdownMenuTrigger
863
+ } from "@mdxui/primitives";
864
+ import { Key as Key2, MoreVertical } from "lucide-react";
865
+ import { jsx as jsx17, jsxs as jsxs7 } from "react/jsx-runtime";
866
+ function formatDate(date) {
867
+ return date.toLocaleDateString("en-US", {
868
+ month: "short",
869
+ day: "numeric",
870
+ year: "numeric"
871
+ });
872
+ }
873
+ function VaultItemCard({
874
+ id,
875
+ name,
876
+ logoUrl,
877
+ createdAt,
878
+ updatedAt,
879
+ onRotate,
880
+ onDelete
881
+ }) {
882
+ const wasRotated = updatedAt.getTime() !== createdAt.getTime();
883
+ return /* @__PURE__ */ jsx17(Card2, { noPadding: true, className: "p-4", children: /* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-between", children: [
884
+ /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-3", children: [
885
+ /* @__PURE__ */ jsx17("div", { className: "flex h-10 w-10 items-center justify-center rounded-md bg-white overflow-hidden p-1 border border-border", children: logoUrl ? /* @__PURE__ */ jsx17(
886
+ "img",
887
+ {
888
+ src: logoUrl,
889
+ alt: name,
890
+ width: 32,
891
+ height: 32,
892
+ className: "h-full w-full object-contain rounded-sm"
893
+ }
894
+ ) : /* @__PURE__ */ jsx17(Key2, { className: "h-5 w-5 text-muted-foreground" }) }),
895
+ /* @__PURE__ */ jsxs7("div", { children: [
896
+ /* @__PURE__ */ jsx17("h4", { className: "text-sm font-medium", children: name }),
897
+ /* @__PURE__ */ jsx17("p", { className: "text-xs text-muted-foreground", children: wasRotated ? `Rotated: ${formatDate(updatedAt)}` : `Created: ${formatDate(createdAt)}` })
898
+ ] })
899
+ ] }),
900
+ /* @__PURE__ */ jsxs7(DropdownMenu, { children: [
901
+ /* @__PURE__ */ jsx17(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs7(Button6, { variant: "ghost", size: "icon-sm", children: [
902
+ /* @__PURE__ */ jsx17(MoreVertical, { className: "h-4 w-4" }),
903
+ /* @__PURE__ */ jsx17("span", { className: "sr-only", children: "Open menu" })
904
+ ] }) }),
905
+ /* @__PURE__ */ jsxs7(DropdownMenuContent, { align: "end", children: [
906
+ /* @__PURE__ */ jsx17(DropdownMenuItem, { onClick: () => onRotate(id), children: "Rotate" }),
907
+ /* @__PURE__ */ jsx17(
908
+ DropdownMenuItem,
909
+ {
910
+ className: "text-destructive focus:text-destructive",
911
+ onClick: () => onDelete(id),
912
+ children: "Delete"
913
+ }
914
+ )
915
+ ] })
916
+ ] })
917
+ ] }) });
918
+ }
919
+
920
+ // src/vault/vault-list.tsx
921
+ import { useState as useState5 } from "react";
922
+ import { Fragment as Fragment2, jsx as jsx18, jsxs as jsxs8 } from "react/jsx-runtime";
923
+ var defaultFields2 = [
924
+ { key: "api_key", label: "API Key", type: "password", required: true }
925
+ ];
926
+ function VaultList({
927
+ items,
928
+ onRotate,
929
+ onDelete,
930
+ onOpenAddModal,
931
+ getIntegrationFields
932
+ }) {
933
+ const [deleteDialogOpen, setDeleteDialogOpen] = useState5(false);
934
+ const [inputModalOpen, setInputModalOpen] = useState5(false);
935
+ const [selectedItem, setSelectedItem] = useState5(null);
936
+ const [modalMode, setModalMode] = useState5("create");
937
+ const handleRotate = (id) => {
938
+ const item = items.find((i) => i.id === id);
939
+ if (!item) return;
940
+ setSelectedItem(item);
941
+ setModalMode("rotate");
942
+ setInputModalOpen(true);
943
+ };
944
+ const handleDeleteClick = (id) => {
945
+ const item = items.find((i) => i.id === id);
946
+ if (!item) return;
947
+ setSelectedItem(item);
948
+ setDeleteDialogOpen(true);
949
+ };
950
+ const handleConfirmDelete = async () => {
951
+ if (!selectedItem) return;
952
+ await onDelete(selectedItem.id);
953
+ setDeleteDialogOpen(false);
954
+ setSelectedItem(null);
955
+ };
956
+ const handleSave = async (credentials) => {
957
+ if (modalMode === "rotate" && selectedItem) {
958
+ await onRotate(selectedItem.id, credentials);
959
+ }
960
+ setInputModalOpen(false);
961
+ setSelectedItem(null);
962
+ };
963
+ const getIntegrationForModal = () => {
964
+ if (!selectedItem) return void 0;
965
+ const fields = getIntegrationFields ? getIntegrationFields(selectedItem.integrationId) : defaultFields2;
966
+ return {
967
+ id: selectedItem.integrationId,
968
+ name: selectedItem.name,
969
+ logoUrl: selectedItem.logoUrl,
970
+ fields
971
+ };
972
+ };
973
+ if (items.length === 0) {
974
+ return /* @__PURE__ */ jsx18(VaultEmptyState, { onAddCredential: onOpenAddModal });
975
+ }
976
+ return /* @__PURE__ */ jsxs8(Fragment2, { children: [
977
+ /* @__PURE__ */ jsx18("div", { className: "grid gap-4 md:grid-cols-2 lg:grid-cols-3", children: items.map((item) => /* @__PURE__ */ jsx18(
978
+ VaultItemCard,
979
+ {
980
+ id: item.id,
981
+ name: item.name,
982
+ logoUrl: item.logoUrl,
983
+ createdAt: item.createdAt,
984
+ updatedAt: item.updatedAt,
985
+ onRotate: handleRotate,
986
+ onDelete: handleDeleteClick
987
+ },
988
+ item.id
989
+ )) }),
990
+ /* @__PURE__ */ jsx18(
991
+ VaultDeleteDialog,
992
+ {
993
+ isOpen: deleteDialogOpen,
994
+ onClose: () => {
995
+ setDeleteDialogOpen(false);
996
+ setSelectedItem(null);
997
+ },
998
+ itemName: selectedItem?.name || "",
999
+ onConfirm: handleConfirmDelete
1000
+ }
1001
+ ),
1002
+ /* @__PURE__ */ jsx18(
1003
+ VaultInputModal,
1004
+ {
1005
+ isOpen: inputModalOpen,
1006
+ onClose: () => {
1007
+ setInputModalOpen(false);
1008
+ setSelectedItem(null);
1009
+ },
1010
+ mode: modalMode,
1011
+ integration: getIntegrationForModal(),
1012
+ onSave: handleSave
1013
+ }
1014
+ )
1015
+ ] });
1016
+ }
1017
+
255
1018
  // src/components/sign-in-button.tsx
256
1019
  import { useAuth as useAuth2 } from "@workos-inc/authkit-react";
257
- import { jsx as jsx11 } from "react/jsx-runtime";
1020
+ import { jsx as jsx19 } from "react/jsx-runtime";
258
1021
  function SignInButton({
259
1022
  children = "Sign In",
260
1023
  onSignIn,
@@ -267,7 +1030,7 @@ function SignInButton({
267
1030
  onSignIn?.();
268
1031
  signIn();
269
1032
  };
270
- return /* @__PURE__ */ jsx11(
1033
+ return /* @__PURE__ */ jsx19(
271
1034
  "button",
272
1035
  {
273
1036
  type: "button",
@@ -282,7 +1045,7 @@ function SignInButton({
282
1045
 
283
1046
  // src/components/sign-out-button.tsx
284
1047
  import { useAuth as useAuth3 } from "@workos-inc/authkit-react";
285
- import { jsx as jsx12 } from "react/jsx-runtime";
1048
+ import { jsx as jsx20 } from "react/jsx-runtime";
286
1049
  function SignOutButton({
287
1050
  children = "Sign Out",
288
1051
  onSignOut,
@@ -295,7 +1058,7 @@ function SignOutButton({
295
1058
  onSignOut?.();
296
1059
  signOut();
297
1060
  };
298
- return /* @__PURE__ */ jsx12(
1061
+ return /* @__PURE__ */ jsx20(
299
1062
  "button",
300
1063
  {
301
1064
  type: "button",
@@ -310,7 +1073,7 @@ function SignOutButton({
310
1073
 
311
1074
  // src/components/user-menu.tsx
312
1075
  import { useAuth as useAuth4 } from "@workos-inc/authkit-react";
313
- import { jsx as jsx13, jsxs as jsxs2 } from "react/jsx-runtime";
1076
+ import { jsx as jsx21, jsxs as jsxs9 } from "react/jsx-runtime";
314
1077
  function getInitials(name) {
315
1078
  if (!name) return "?";
316
1079
  const parts = name.trim().split(/\s+/);
@@ -320,7 +1083,7 @@ function getInitials(name) {
320
1083
  function UserMenu({ renderTrigger, renderMenu, className }) {
321
1084
  const { user, signOut, isLoading } = useAuth4();
322
1085
  if (isLoading) {
323
- return /* @__PURE__ */ jsx13("div", { className, children: /* @__PURE__ */ jsx13("div", { className: "flex items-center gap-2 p-2", children: /* @__PURE__ */ jsx13("div", { className: "h-8 w-8 animate-pulse rounded-full bg-muted" }) }) });
1086
+ return /* @__PURE__ */ jsx21("div", { className, children: /* @__PURE__ */ jsx21("div", { className: "flex items-center gap-2 p-2", children: /* @__PURE__ */ jsx21("div", { className: "h-8 w-8 animate-pulse rounded-full bg-muted" }) }) });
324
1087
  }
325
1088
  if (!user) {
326
1089
  return null;
@@ -332,8 +1095,8 @@ function UserMenu({ renderTrigger, renderMenu, className }) {
332
1095
  const triggerProps = { user, displayName, initials };
333
1096
  const menuProps = { user, displayName, initials, signOut };
334
1097
  if (!renderTrigger && !renderMenu) {
335
- return /* @__PURE__ */ jsx13("div", { className, children: /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2 p-2", children: [
336
- /* @__PURE__ */ jsx13("div", { className: "h-8 w-8 rounded-full bg-muted flex items-center justify-center text-sm font-medium", children: user.profilePictureUrl ? /* @__PURE__ */ jsx13(
1098
+ return /* @__PURE__ */ jsx21("div", { className, children: /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-2 p-2", children: [
1099
+ /* @__PURE__ */ jsx21("div", { className: "h-8 w-8 rounded-full bg-muted flex items-center justify-center text-sm font-medium", children: user.profilePictureUrl ? /* @__PURE__ */ jsx21(
337
1100
  "img",
338
1101
  {
339
1102
  src: user.profilePictureUrl,
@@ -341,11 +1104,11 @@ function UserMenu({ renderTrigger, renderMenu, className }) {
341
1104
  className: "h-full w-full rounded-full object-cover"
342
1105
  }
343
1106
  ) : initials }),
344
- /* @__PURE__ */ jsxs2("div", { className: "text-sm", children: [
345
- /* @__PURE__ */ jsx13("p", { className: "font-medium", children: displayName }),
346
- /* @__PURE__ */ jsx13("p", { className: "text-muted-foreground text-xs", children: user.email })
1107
+ /* @__PURE__ */ jsxs9("div", { className: "text-sm", children: [
1108
+ /* @__PURE__ */ jsx21("p", { className: "font-medium", children: displayName }),
1109
+ /* @__PURE__ */ jsx21("p", { className: "text-muted-foreground text-xs", children: user.email })
347
1110
  ] }),
348
- /* @__PURE__ */ jsx13(
1111
+ /* @__PURE__ */ jsx21(
349
1112
  "button",
350
1113
  {
351
1114
  type: "button",
@@ -356,7 +1119,7 @@ function UserMenu({ renderTrigger, renderMenu, className }) {
356
1119
  )
357
1120
  ] }) });
358
1121
  }
359
- return /* @__PURE__ */ jsxs2("div", { className, children: [
1122
+ return /* @__PURE__ */ jsxs9("div", { className, children: [
360
1123
  renderTrigger?.(triggerProps),
361
1124
  renderMenu?.(menuProps)
362
1125
  ] });
@@ -365,7 +1128,7 @@ function UserMenu({ renderTrigger, renderMenu, className }) {
365
1128
  // src/components/team-switcher.tsx
366
1129
  import { useAuth as useAuth5 } from "@workos-inc/authkit-react";
367
1130
  import { OrganizationSwitcher as OrganizationSwitcher2 } from "@workos-inc/widgets";
368
- import { jsx as jsx14 } from "react/jsx-runtime";
1131
+ import { jsx as jsx22 } from "react/jsx-runtime";
369
1132
  function TeamSwitcher({
370
1133
  renderWrapper,
371
1134
  renderNoOrganization,
@@ -380,7 +1143,7 @@ function TeamSwitcher({
380
1143
  }) => {
381
1144
  return switchToOrganization({ organizationId: organizationId2 });
382
1145
  };
383
- const widget = /* @__PURE__ */ jsx14("div", { className: `organization-switcher-wrapper ${className ?? ""}`, children: /* @__PURE__ */ jsx14(
1146
+ const widget = /* @__PURE__ */ jsx22("div", { className: `organization-switcher-wrapper ${className ?? ""}`, children: /* @__PURE__ */ jsx22(
384
1147
  OrganizationSwitcher2,
385
1148
  {
386
1149
  authToken: getAccessToken,
@@ -394,15 +1157,15 @@ function TeamSwitcher({
394
1157
  import { useAuth as useAuth6 } from "@workos-inc/authkit-react";
395
1158
 
396
1159
  // src/hooks/use-widget-token.ts
397
- import { useCallback, useEffect as useEffect2, useState as useState2 } from "react";
1160
+ import { useCallback, useEffect as useEffect4, useState as useState6 } from "react";
398
1161
  function useWidgetToken({
399
1162
  widget,
400
1163
  organizationId,
401
1164
  endpoint = "/api/workos/widget-token"
402
1165
  }) {
403
- const [token, setToken] = useState2(null);
404
- const [loading, setLoading] = useState2(true);
405
- const [error, setError] = useState2(null);
1166
+ const [token, setToken] = useState6(null);
1167
+ const [loading, setLoading] = useState6(true);
1168
+ const [error, setError] = useState6(null);
406
1169
  const fetchToken = useCallback(async () => {
407
1170
  try {
408
1171
  setLoading(true);
@@ -423,12 +1186,77 @@ function useWidgetToken({
423
1186
  setLoading(false);
424
1187
  }
425
1188
  }, [widget, organizationId, endpoint]);
426
- useEffect2(() => {
1189
+ useEffect4(() => {
427
1190
  fetchToken();
428
1191
  }, [fetchToken]);
429
1192
  return { token, loading, error, refetch: fetchToken };
430
1193
  }
431
1194
 
1195
+ // src/hooks/use-vault.ts
1196
+ import { useCallback as useCallback2, useMemo as useMemo3 } from "react";
1197
+ function useVault() {
1198
+ const context = useVaultContext();
1199
+ const findItem = useCallback2(
1200
+ (id) => {
1201
+ return context.items.find((item) => item.id === id);
1202
+ },
1203
+ [context.items]
1204
+ );
1205
+ const findByIntegration = useCallback2(
1206
+ (integrationId) => {
1207
+ return context.items.filter((item) => item.integrationId === integrationId);
1208
+ },
1209
+ [context.items]
1210
+ );
1211
+ return useMemo3(
1212
+ () => ({
1213
+ items: context.items,
1214
+ loading: context.loading,
1215
+ error: context.error,
1216
+ isConnected: context.client !== null,
1217
+ reload: context.reload,
1218
+ create: context.createItem,
1219
+ rotate: context.rotateItem,
1220
+ remove: context.deleteItem,
1221
+ getIntegrationFields: context.getIntegrationFields,
1222
+ findItem,
1223
+ findByIntegration
1224
+ }),
1225
+ [context, findItem, findByIntegration]
1226
+ );
1227
+ }
1228
+ function useVaultOptional() {
1229
+ const context = useVaultContextOptional();
1230
+ const findItem = useCallback2(
1231
+ (id) => {
1232
+ return context?.items.find((item) => item.id === id);
1233
+ },
1234
+ [context?.items]
1235
+ );
1236
+ const findByIntegration = useCallback2(
1237
+ (integrationId) => {
1238
+ return context?.items.filter((item) => item.integrationId === integrationId) ?? [];
1239
+ },
1240
+ [context?.items]
1241
+ );
1242
+ if (!context) {
1243
+ return null;
1244
+ }
1245
+ return {
1246
+ items: context.items,
1247
+ loading: context.loading,
1248
+ error: context.error,
1249
+ isConnected: context.client !== null,
1250
+ reload: context.reload,
1251
+ create: context.createItem,
1252
+ rotate: context.rotateItem,
1253
+ remove: context.deleteItem,
1254
+ getIntegrationFields: context.getIntegrationFields,
1255
+ findItem,
1256
+ findByIntegration
1257
+ };
1258
+ }
1259
+
432
1260
  // src/schemas/auth-user.ts
433
1261
  import { z } from "zod";
434
1262
  import { UserIdentitySchema } from "mdxui/zod";
@@ -495,7 +1323,7 @@ var IdentityProviderPropsSchema = z4.object({
495
1323
  redirectUri: z4.string().url().optional().describe("Redirect URI after authentication")
496
1324
  /** Note: onRedirectCallback and children are React-specific, not in schema */
497
1325
  });
498
- var UnauthenticatedActionSchema = z4.enum(["landing", "redirect", "allow"]);
1326
+ var UnauthenticatedActionSchema = z4.enum(["landing", "redirect", "allow", "signIn"]);
499
1327
  var AuthGatePropsSchema = z4.object({
500
1328
  /** Whether authentication is required (default: true) */
501
1329
  required: z4.boolean().optional().describe("Whether authentication is required"),
@@ -553,27 +1381,790 @@ var UseWidgetTokenResultSchema = z5.object({
553
1381
  error: z5.string().nullable().describe("Error message if fetch failed")
554
1382
  /** Note: refetch function is React-specific, not in schema */
555
1383
  });
1384
+
1385
+ // src/shell/config-context.tsx
1386
+ import { createContext as createContext2, useContext as useContext2, useMemo as useMemo4 } from "react";
1387
+
1388
+ // src/shell/route-presets.ts
1389
+ import { Key as Key3, Monitor, Plug, Shield, User, Users } from "lucide-react";
1390
+
1391
+ // src/shell/components/breadcrumbs.tsx
1392
+ import { WebLink } from "@mdxui/navigation/web";
1393
+ import {
1394
+ Breadcrumb,
1395
+ BreadcrumbEllipsis,
1396
+ BreadcrumbItem,
1397
+ BreadcrumbLink,
1398
+ BreadcrumbList,
1399
+ BreadcrumbPage,
1400
+ BreadcrumbSeparator
1401
+ } from "@mdxui/primitives/breadcrumb";
1402
+ import {
1403
+ DropdownMenu as DropdownMenu2,
1404
+ DropdownMenuContent as DropdownMenuContent2,
1405
+ DropdownMenuItem as DropdownMenuItem2,
1406
+ DropdownMenuTrigger as DropdownMenuTrigger2
1407
+ } from "@mdxui/primitives/dropdown-menu";
1408
+ import * as React3 from "react";
1409
+ import { jsx as jsx23, jsxs as jsxs10 } from "react/jsx-runtime";
1410
+ function DefaultLink({ href, children, className }) {
1411
+ return /* @__PURE__ */ jsx23(WebLink, { to: href, className, children });
1412
+ }
1413
+ function Breadcrumbs({
1414
+ items,
1415
+ LinkComponent = DefaultLink,
1416
+ className,
1417
+ maxItems = 4,
1418
+ separator
1419
+ }) {
1420
+ if (!items || items.length === 0) {
1421
+ return null;
1422
+ }
1423
+ const shouldCollapse = items.length > maxItems;
1424
+ const visibleItems = shouldCollapse ? [items[0], ...items.slice(-(maxItems - 1))] : items;
1425
+ const hiddenItems = shouldCollapse ? items.slice(1, -(maxItems - 1)) : [];
1426
+ return /* @__PURE__ */ jsx23(Breadcrumb, { className, children: /* @__PURE__ */ jsx23(BreadcrumbList, { children: visibleItems.map((item, index) => {
1427
+ const isLast = index === visibleItems.length - 1;
1428
+ const isFirst = index === 0;
1429
+ if (shouldCollapse && isFirst) {
1430
+ return /* @__PURE__ */ jsxs10(React3.Fragment, { children: [
1431
+ /* @__PURE__ */ jsx23(BreadcrumbItem, { children: item.href ? /* @__PURE__ */ jsx23(BreadcrumbLink, { asChild: true, children: /* @__PURE__ */ jsx23(LinkComponent, { href: item.href, children: item.label }) }) : /* @__PURE__ */ jsx23(BreadcrumbPage, { children: item.label }) }),
1432
+ /* @__PURE__ */ jsx23(BreadcrumbSeparator, { children: separator }),
1433
+ /* @__PURE__ */ jsx23(BreadcrumbItem, { children: /* @__PURE__ */ jsxs10(DropdownMenu2, { children: [
1434
+ /* @__PURE__ */ jsx23(
1435
+ DropdownMenuTrigger2,
1436
+ {
1437
+ className: "flex items-center gap-1 hover:text-foreground",
1438
+ "aria-label": "Show hidden breadcrumbs",
1439
+ children: /* @__PURE__ */ jsx23(BreadcrumbEllipsis, { className: "size-4" })
1440
+ }
1441
+ ),
1442
+ /* @__PURE__ */ jsx23(DropdownMenuContent2, { align: "start", children: hiddenItems.map((hiddenItem) => /* @__PURE__ */ jsx23(DropdownMenuItem2, { asChild: true, children: /* @__PURE__ */ jsx23(LinkComponent, { href: hiddenItem.href || "#", children: hiddenItem.label }) }, hiddenItem.label)) })
1443
+ ] }) }),
1444
+ /* @__PURE__ */ jsx23(BreadcrumbSeparator, { children: separator })
1445
+ ] }, item.label);
1446
+ }
1447
+ return /* @__PURE__ */ jsxs10(React3.Fragment, { children: [
1448
+ /* @__PURE__ */ jsx23(BreadcrumbItem, { children: isLast ? /* @__PURE__ */ jsx23(BreadcrumbPage, { children: item.label }) : item.href ? /* @__PURE__ */ jsx23(BreadcrumbLink, { asChild: true, children: /* @__PURE__ */ jsx23(LinkComponent, { href: item.href, children: item.label }) }) : /* @__PURE__ */ jsx23(BreadcrumbPage, { children: item.label }) }),
1449
+ !isLast && /* @__PURE__ */ jsx23(BreadcrumbSeparator, { children: separator })
1450
+ ] }, item.label);
1451
+ }) }) });
1452
+ }
1453
+ Breadcrumbs.displayName = "Breadcrumbs";
1454
+
1455
+ // src/shell/components/sidebar-org-switcher.tsx
1456
+ import { jsx as jsx24, jsxs as jsxs11 } from "react/jsx-runtime";
1457
+ function SidebarOrgSwitcher() {
1458
+ const branding = useAuthShellBranding();
1459
+ return /* @__PURE__ */ jsx24(
1460
+ TeamSwitcher,
1461
+ {
1462
+ renderNoOrganization: () => /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2 px-2", children: [
1463
+ branding.logo && /* @__PURE__ */ jsx24("div", { className: "flex-shrink-0", children: branding.logo }),
1464
+ /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-0.5 leading-none", children: [
1465
+ /* @__PURE__ */ jsx24("span", { className: "font-semibold", children: branding.name }),
1466
+ branding.tagline && /* @__PURE__ */ jsx24("span", { className: "text-xs text-muted-foreground", children: branding.tagline })
1467
+ ] })
1468
+ ] })
1469
+ }
1470
+ );
1471
+ }
1472
+
1473
+ // src/shell/components/widget-error-boundary.tsx
1474
+ import { Component } from "react";
1475
+ import { jsx as jsx25, jsxs as jsxs12 } from "react/jsx-runtime";
1476
+ var widgetErrorMessages = {
1477
+ profile: "Your profile is camera shy right now...",
1478
+ security: "Security settings are being extra secure (maybe too secure)...",
1479
+ sessions: "Your sessions are having a session of their own...",
1480
+ "api-keys": "Your API keys are playing hide and seek...",
1481
+ team: "Your team members wandered off for a moment...",
1482
+ integrations: "Your integrations are having connection issues (ironic, we know)..."
1483
+ };
1484
+ var uppercaseWords = /* @__PURE__ */ new Set(["api", "sso", "mfa", "oauth", "jwt", "url", "id"]);
1485
+ function formatWidgetName(widgetName) {
1486
+ return widgetName.split("-").map((word) => {
1487
+ const lower = word.toLowerCase();
1488
+ if (uppercaseWords.has(lower)) {
1489
+ return word.toUpperCase();
1490
+ }
1491
+ return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
1492
+ }).join(" ");
1493
+ }
1494
+ function getErrorMessage(widgetName) {
1495
+ if (!widgetName) {
1496
+ return "Something went wrong loading this widget.";
1497
+ }
1498
+ const knownMessage = widgetErrorMessages[widgetName];
1499
+ if (knownMessage) {
1500
+ return knownMessage;
1501
+ }
1502
+ return `Something went wrong loading your ${formatWidgetName(widgetName)}...`;
1503
+ }
1504
+ var WidgetErrorBoundary = class extends Component {
1505
+ constructor(props) {
1506
+ super(props);
1507
+ this.state = { hasError: false };
1508
+ }
1509
+ static getDerivedStateFromError(error) {
1510
+ return { hasError: true, error };
1511
+ }
1512
+ componentDidCatch(error, errorInfo) {
1513
+ console.error("[WidgetErrorBoundary] Widget error:", error, errorInfo);
1514
+ }
1515
+ render() {
1516
+ if (this.state.hasError) {
1517
+ if (this.props.fallback) {
1518
+ return this.props.fallback;
1519
+ }
1520
+ const message = getErrorMessage(this.props.widgetName);
1521
+ return /* @__PURE__ */ jsxs12("div", { className: "flex flex-col items-center justify-center gap-2 rounded-[var(--radius-md)] border border-dashed py-12", children: [
1522
+ /* @__PURE__ */ jsx25("p", { className: "text-muted-foreground text-sm", children: message }),
1523
+ /* @__PURE__ */ jsx25("p", { className: "text-muted-foreground/60 text-xs", children: "Try refreshing the page." })
1524
+ ] });
1525
+ }
1526
+ return this.props.children;
1527
+ }
1528
+ };
1529
+
1530
+ // src/shell/pages/profile-page.tsx
1531
+ import { jsx as jsx26, jsxs as jsxs13 } from "react/jsx-runtime";
1532
+ function ProfilePage() {
1533
+ const { user, getAccessToken, isLoading } = useAuth6();
1534
+ if (isLoading) {
1535
+ return /* @__PURE__ */ jsx26("div", { className: "flex items-center justify-center py-12 text-muted-foreground", children: "Loading..." });
1536
+ }
1537
+ if (!user) {
1538
+ return /* @__PURE__ */ jsxs13("div", { className: "container max-w-4xl py-8", children: [
1539
+ /* @__PURE__ */ jsxs13("div", { className: "mb-8", children: [
1540
+ /* @__PURE__ */ jsx26("h1", { className: "text-2xl font-semibold tracking-tight", children: "Profile" }),
1541
+ /* @__PURE__ */ jsx26("p", { className: "text-muted-foreground", children: "Manage your account information" })
1542
+ ] }),
1543
+ /* @__PURE__ */ jsx26("div", { className: "flex items-center justify-center rounded-[var(--radius-md)] border border-dashed py-24", children: /* @__PURE__ */ jsx26("p", { className: "text-muted-foreground text-sm", children: "Please sign in to view your profile." }) })
1544
+ ] });
1545
+ }
1546
+ return /* @__PURE__ */ jsxs13("div", { className: "container max-w-4xl py-8", children: [
1547
+ /* @__PURE__ */ jsxs13("div", { className: "mb-8", children: [
1548
+ /* @__PURE__ */ jsx26("h1", { className: "text-2xl font-semibold tracking-tight", children: "Profile" }),
1549
+ /* @__PURE__ */ jsx26("p", { className: "text-muted-foreground", children: "Manage your account information" })
1550
+ ] }),
1551
+ /* @__PURE__ */ jsx26(WidgetErrorBoundary, { widgetName: "profile", children: /* @__PURE__ */ jsx26(UserProfile, { authToken: getAccessToken }) })
1552
+ ] });
1553
+ }
1554
+
1555
+ // src/shell/pages/security-page.tsx
1556
+ import { jsx as jsx27, jsxs as jsxs14 } from "react/jsx-runtime";
1557
+ function SecurityPage() {
1558
+ const { user, getAccessToken, isLoading } = useAuth6();
1559
+ if (isLoading) {
1560
+ return /* @__PURE__ */ jsx27("div", { className: "flex items-center justify-center py-12 text-muted-foreground", children: "Loading..." });
1561
+ }
1562
+ if (!user) {
1563
+ return /* @__PURE__ */ jsxs14("div", { className: "container max-w-4xl py-8", children: [
1564
+ /* @__PURE__ */ jsxs14("div", { className: "mb-8", children: [
1565
+ /* @__PURE__ */ jsx27("h1", { className: "text-2xl font-semibold tracking-tight", children: "Security" }),
1566
+ /* @__PURE__ */ jsx27("p", { className: "text-muted-foreground", children: "Manage your password and authentication settings" })
1567
+ ] }),
1568
+ /* @__PURE__ */ jsx27("div", { className: "flex items-center justify-center rounded-[var(--radius-md)] border border-dashed py-24", children: /* @__PURE__ */ jsx27("p", { className: "text-muted-foreground text-sm", children: "Please sign in to manage your security settings." }) })
1569
+ ] });
1570
+ }
1571
+ return /* @__PURE__ */ jsxs14("div", { className: "container max-w-4xl py-8", children: [
1572
+ /* @__PURE__ */ jsxs14("div", { className: "mb-8", children: [
1573
+ /* @__PURE__ */ jsx27("h1", { className: "text-2xl font-semibold tracking-tight", children: "Security" }),
1574
+ /* @__PURE__ */ jsx27("p", { className: "text-muted-foreground", children: "Manage your password and authentication settings" })
1575
+ ] }),
1576
+ /* @__PURE__ */ jsx27(WidgetErrorBoundary, { widgetName: "security", children: /* @__PURE__ */ jsx27(UserSecurity, { authToken: getAccessToken }) })
1577
+ ] });
1578
+ }
1579
+
1580
+ // src/shell/pages/sessions-page.tsx
1581
+ import { jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
1582
+ function SessionsPage() {
1583
+ const { user, getAccessToken, isLoading } = useAuth6();
1584
+ if (isLoading) {
1585
+ return /* @__PURE__ */ jsx28("div", { className: "flex items-center justify-center py-12 text-muted-foreground", children: "Loading..." });
1586
+ }
1587
+ if (!user) {
1588
+ return /* @__PURE__ */ jsxs15("div", { className: "container max-w-4xl py-8", children: [
1589
+ /* @__PURE__ */ jsxs15("div", { className: "mb-8", children: [
1590
+ /* @__PURE__ */ jsx28("h1", { className: "text-2xl font-semibold tracking-tight", children: "Sessions" }),
1591
+ /* @__PURE__ */ jsx28("p", { className: "text-muted-foreground", children: "View and manage your active sessions" })
1592
+ ] }),
1593
+ /* @__PURE__ */ jsx28("div", { className: "flex items-center justify-center rounded-[var(--radius-md)] border border-dashed py-24", children: /* @__PURE__ */ jsx28("p", { className: "text-muted-foreground text-sm", children: "Please sign in to view your sessions." }) })
1594
+ ] });
1595
+ }
1596
+ return /* @__PURE__ */ jsxs15("div", { className: "container max-w-4xl py-8", children: [
1597
+ /* @__PURE__ */ jsxs15("div", { className: "mb-8", children: [
1598
+ /* @__PURE__ */ jsx28("h1", { className: "text-2xl font-semibold tracking-tight", children: "Sessions" }),
1599
+ /* @__PURE__ */ jsx28("p", { className: "text-muted-foreground", children: "View and manage your active sessions" })
1600
+ ] }),
1601
+ /* @__PURE__ */ jsx28(WidgetErrorBoundary, { widgetName: "sessions", children: /* @__PURE__ */ jsx28(UserSessions, { authToken: getAccessToken }) })
1602
+ ] });
1603
+ }
1604
+
1605
+ // src/shell/pages/api-keys-page.tsx
1606
+ import { jsx as jsx29, jsxs as jsxs16 } from "react/jsx-runtime";
1607
+ function ApiKeysPage() {
1608
+ const { user, getAccessToken, isLoading } = useAuth6();
1609
+ if (isLoading) {
1610
+ return /* @__PURE__ */ jsx29("div", { className: "flex items-center justify-center py-12 text-muted-foreground", children: "Loading..." });
1611
+ }
1612
+ if (!user) {
1613
+ return /* @__PURE__ */ jsxs16("div", { className: "container max-w-4xl py-8", children: [
1614
+ /* @__PURE__ */ jsxs16("div", { className: "mb-8", children: [
1615
+ /* @__PURE__ */ jsx29("h1", { className: "text-2xl font-semibold tracking-tight", children: "API Keys" }),
1616
+ /* @__PURE__ */ jsx29("p", { className: "text-muted-foreground", children: "Create and manage your API keys" })
1617
+ ] }),
1618
+ /* @__PURE__ */ jsx29("div", { className: "flex items-center justify-center rounded-[var(--radius-md)] border border-dashed py-24", children: /* @__PURE__ */ jsx29("p", { className: "text-muted-foreground text-sm", children: "Please sign in to manage your API keys." }) })
1619
+ ] });
1620
+ }
1621
+ return /* @__PURE__ */ jsxs16("div", { className: "container max-w-4xl py-8", children: [
1622
+ /* @__PURE__ */ jsxs16("div", { className: "mb-8", children: [
1623
+ /* @__PURE__ */ jsx29("h1", { className: "text-2xl font-semibold tracking-tight", children: "API Keys" }),
1624
+ /* @__PURE__ */ jsx29("p", { className: "text-muted-foreground", children: "Create and manage your API keys" })
1625
+ ] }),
1626
+ /* @__PURE__ */ jsx29(WidgetErrorBoundary, { widgetName: "api-keys", children: /* @__PURE__ */ jsx29(ApiKeys, { authToken: getAccessToken }) })
1627
+ ] });
1628
+ }
1629
+
1630
+ // src/shell/pages/team-page.tsx
1631
+ import { jsx as jsx30, jsxs as jsxs17 } from "react/jsx-runtime";
1632
+ function TeamPage() {
1633
+ const { user, getAccessToken, isLoading, organizationId, permissions } = useAuth6();
1634
+ const hasOrganization = !!organizationId;
1635
+ const canManageTeam = hasOrganization && permissions?.includes("widgets:users-table:manage");
1636
+ if (isLoading) {
1637
+ return /* @__PURE__ */ jsx30("div", { className: "flex items-center justify-center py-12 text-muted-foreground", children: "Loading..." });
1638
+ }
1639
+ if (!user) {
1640
+ return /* @__PURE__ */ jsxs17("div", { className: "container max-w-4xl py-8", children: [
1641
+ /* @__PURE__ */ jsxs17("div", { className: "mb-8", children: [
1642
+ /* @__PURE__ */ jsx30("h1", { className: "text-2xl font-semibold tracking-tight", children: "Team" }),
1643
+ /* @__PURE__ */ jsx30("p", { className: "text-muted-foreground", children: "Manage your team members and invitations" })
1644
+ ] }),
1645
+ /* @__PURE__ */ jsx30("div", { className: "flex items-center justify-center rounded-[var(--radius-md)] border border-dashed py-24", children: /* @__PURE__ */ jsx30("p", { className: "text-muted-foreground text-sm", children: "Please sign in to manage your team." }) })
1646
+ ] });
1647
+ }
1648
+ if (!hasOrganization) {
1649
+ return /* @__PURE__ */ jsxs17("div", { className: "container max-w-4xl py-8", children: [
1650
+ /* @__PURE__ */ jsxs17("div", { className: "mb-8", children: [
1651
+ /* @__PURE__ */ jsx30("h1", { className: "text-2xl font-semibold tracking-tight", children: "Team" }),
1652
+ /* @__PURE__ */ jsx30("p", { className: "text-muted-foreground", children: "Manage your team members and invitations" })
1653
+ ] }),
1654
+ /* @__PURE__ */ jsx30("div", { className: "flex items-center justify-center rounded-[var(--radius-md)] border border-dashed py-24", children: /* @__PURE__ */ jsx30("p", { className: "text-muted-foreground text-sm", children: "You need to be part of an organization to manage team members." }) })
1655
+ ] });
1656
+ }
1657
+ if (!canManageTeam) {
1658
+ return /* @__PURE__ */ jsxs17("div", { className: "container max-w-4xl py-8", children: [
1659
+ /* @__PURE__ */ jsxs17("div", { className: "mb-8", children: [
1660
+ /* @__PURE__ */ jsx30("h1", { className: "text-2xl font-semibold tracking-tight", children: "Team" }),
1661
+ /* @__PURE__ */ jsx30("p", { className: "text-muted-foreground", children: "Manage your team members and invitations" })
1662
+ ] }),
1663
+ /* @__PURE__ */ jsx30("div", { className: "flex items-center justify-center rounded-[var(--radius-md)] border border-dashed py-24", children: /* @__PURE__ */ jsx30("p", { className: "text-muted-foreground text-sm", children: "You need admin permissions to manage team members." }) })
1664
+ ] });
1665
+ }
1666
+ return /* @__PURE__ */ jsxs17("div", { className: "container max-w-4xl py-8", children: [
1667
+ /* @__PURE__ */ jsxs17("div", { className: "mb-8", children: [
1668
+ /* @__PURE__ */ jsx30("h1", { className: "text-2xl font-semibold tracking-tight", children: "Team" }),
1669
+ /* @__PURE__ */ jsx30("p", { className: "text-muted-foreground", children: "Manage your team members and invitations" })
1670
+ ] }),
1671
+ /* @__PURE__ */ jsx30(WidgetErrorBoundary, { widgetName: "team", children: /* @__PURE__ */ jsx30(UsersManagement, { authToken: getAccessToken }) })
1672
+ ] });
1673
+ }
1674
+
1675
+ // src/shell/pages/integrations-page.tsx
1676
+ import { jsx as jsx31, jsxs as jsxs18 } from "react/jsx-runtime";
1677
+ function IntegrationsPage() {
1678
+ const { user, getAccessToken, isLoading } = useAuth6();
1679
+ if (isLoading) {
1680
+ return /* @__PURE__ */ jsx31("div", { className: "flex items-center justify-center py-12 text-muted-foreground", children: "Loading..." });
1681
+ }
1682
+ if (!user) {
1683
+ return /* @__PURE__ */ jsxs18("div", { className: "container max-w-4xl py-8", children: [
1684
+ /* @__PURE__ */ jsxs18("div", { className: "mb-8", children: [
1685
+ /* @__PURE__ */ jsx31("h1", { className: "text-2xl font-semibold tracking-tight", children: "Integrations" }),
1686
+ /* @__PURE__ */ jsx31("p", { className: "text-muted-foreground", children: "Connect and manage third-party services" })
1687
+ ] }),
1688
+ /* @__PURE__ */ jsx31("div", { className: "flex items-center justify-center rounded-[var(--radius-md)] border border-dashed py-24", children: /* @__PURE__ */ jsx31("p", { className: "text-muted-foreground text-sm", children: "Please sign in to manage your integrations." }) })
1689
+ ] });
1690
+ }
1691
+ return /* @__PURE__ */ jsxs18("div", { className: "container max-w-4xl py-8", children: [
1692
+ /* @__PURE__ */ jsxs18("div", { className: "mb-8", children: [
1693
+ /* @__PURE__ */ jsx31("h1", { className: "text-2xl font-semibold tracking-tight", children: "Integrations" }),
1694
+ /* @__PURE__ */ jsx31("p", { className: "text-muted-foreground", children: "Connect and manage third-party services" })
1695
+ ] }),
1696
+ /* @__PURE__ */ jsx31(WidgetErrorBoundary, { widgetName: "integrations", children: /* @__PURE__ */ jsx31(Pipes, { authToken: getAccessToken }) })
1697
+ ] });
1698
+ }
1699
+
1700
+ // src/shell/route-presets.ts
1701
+ var defaultGroups = [
1702
+ { id: "main", order: 0 },
1703
+ { id: "account", label: "Account", order: 10 },
1704
+ { id: "developer", label: "Developer", order: 20 },
1705
+ { id: "admin", label: "Admin", order: 30 }
1706
+ ];
1707
+ var accountRoutes = [
1708
+ {
1709
+ key: "profile",
1710
+ path: "/profile",
1711
+ label: "Profile",
1712
+ group: "account",
1713
+ icon: User,
1714
+ component: ProfilePage,
1715
+ enabled: true,
1716
+ public: false
1717
+ },
1718
+ {
1719
+ key: "security",
1720
+ path: "/security",
1721
+ label: "Security",
1722
+ group: "account",
1723
+ icon: Shield,
1724
+ component: SecurityPage,
1725
+ enabled: true,
1726
+ public: false
1727
+ },
1728
+ {
1729
+ key: "sessions",
1730
+ path: "/sessions",
1731
+ label: "Sessions",
1732
+ group: "account",
1733
+ icon: Monitor,
1734
+ component: SessionsPage,
1735
+ enabled: true,
1736
+ public: false
1737
+ }
1738
+ ];
1739
+ var developerRoutes = [
1740
+ {
1741
+ key: "api-keys",
1742
+ path: "/api-keys",
1743
+ label: "API Keys",
1744
+ group: "developer",
1745
+ icon: Key3,
1746
+ component: ApiKeysPage,
1747
+ enabled: true,
1748
+ public: false
1749
+ }
1750
+ ];
1751
+ var adminRoutes = [
1752
+ {
1753
+ key: "team",
1754
+ path: "/team",
1755
+ label: "Team",
1756
+ group: "admin",
1757
+ icon: Users,
1758
+ component: TeamPage,
1759
+ enabled: true,
1760
+ public: false
1761
+ }
1762
+ ];
1763
+ var integrationRoutes = [
1764
+ {
1765
+ key: "integrations",
1766
+ path: "/integrations",
1767
+ label: "Integrations",
1768
+ group: "developer",
1769
+ icon: Plug,
1770
+ component: IntegrationsPage,
1771
+ enabled: true,
1772
+ public: false
1773
+ }
1774
+ ];
1775
+ var defaultRoutes = [
1776
+ ...accountRoutes,
1777
+ ...developerRoutes,
1778
+ ...adminRoutes
1779
+ ];
1780
+
1781
+ // src/shell/config-context.tsx
1782
+ import { jsx as jsx32 } from "react/jsx-runtime";
1783
+ var AuthShellConfigContext = createContext2(null);
1784
+ function AuthShellConfigProvider({ config, children }) {
1785
+ const value = useMemo4(() => {
1786
+ const routes = config.routes ?? defaultRoutes;
1787
+ const enabledRoutes = routes.filter((route) => route.enabled !== false);
1788
+ const groups = [...config.groups ?? defaultGroups].sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
1789
+ const routesByGroup = /* @__PURE__ */ new Map();
1790
+ for (const group of groups) {
1791
+ routesByGroup.set(group.id, []);
1792
+ }
1793
+ for (const route of enabledRoutes) {
1794
+ const groupId = route.group ?? "main";
1795
+ const groupRoutes = routesByGroup.get(groupId) ?? [];
1796
+ groupRoutes.push(route);
1797
+ routesByGroup.set(groupId, groupRoutes);
1798
+ }
1799
+ for (const [groupId, routes2] of routesByGroup) {
1800
+ routesByGroup.set(
1801
+ groupId,
1802
+ routes2.sort((a, b) => (a.order ?? 0) - (b.order ?? 0))
1803
+ );
1804
+ }
1805
+ return {
1806
+ config,
1807
+ routes: enabledRoutes,
1808
+ routesByGroup,
1809
+ groups,
1810
+ branding: config.branding,
1811
+ basePath: config.basePath ?? ""
1812
+ };
1813
+ }, [config]);
1814
+ return /* @__PURE__ */ jsx32(AuthShellConfigContext.Provider, { value, children });
1815
+ }
1816
+ function useAuthShellConfig() {
1817
+ const context = useContext2(AuthShellConfigContext);
1818
+ if (!context) {
1819
+ throw new Error("useAuthShellConfig must be used within AuthShellConfigProvider");
1820
+ }
1821
+ return context;
1822
+ }
1823
+ function useAuthShellRoutes() {
1824
+ const { routes } = useAuthShellConfig();
1825
+ return routes;
1826
+ }
1827
+ function useAuthShellRoutesByGroup() {
1828
+ const { routesByGroup, groups } = useAuthShellConfig();
1829
+ return { routesByGroup, groups };
1830
+ }
1831
+ function useAuthShellBranding() {
1832
+ const { branding } = useAuthShellConfig();
1833
+ return branding;
1834
+ }
1835
+ function useAuthShellFullPath() {
1836
+ const { basePath } = useAuthShellConfig();
1837
+ return useMemo4(() => {
1838
+ return (path) => {
1839
+ if (!basePath) return path;
1840
+ if (path === "/") return basePath || "/";
1841
+ return `${basePath}${path}`;
1842
+ };
1843
+ }, [basePath]);
1844
+ }
1845
+
1846
+ // src/shell/auth-shell.tsx
1847
+ import { Separator } from "@mdxui/primitives/separator";
1848
+ import {
1849
+ SidebarInset,
1850
+ SidebarProvider,
1851
+ SidebarTrigger
1852
+ } from "@mdxui/primitives/sidebar";
1853
+ import { Toaster } from "@mdxui/primitives/sonner";
1854
+
1855
+ // src/shell/auth-shell-nav.tsx
1856
+ import { useAuth as useAuth7 } from "@workos-inc/authkit-react";
1857
+ import { useIsActive, WebLink as WebLink2 } from "@mdxui/navigation/web";
1858
+ import {
1859
+ Sidebar,
1860
+ SidebarContent,
1861
+ SidebarFooter,
1862
+ SidebarGroup,
1863
+ SidebarGroupContent,
1864
+ SidebarGroupLabel,
1865
+ SidebarHeader,
1866
+ SidebarMenu,
1867
+ SidebarMenuButton,
1868
+ SidebarMenuItem,
1869
+ SidebarRail
1870
+ } from "@mdxui/primitives/sidebar";
1871
+ import { SidebarUser } from "@mdxui/primitives/sidebar-user";
1872
+ import { Fragment as Fragment4, jsx as jsx33, jsxs as jsxs19 } from "react/jsx-runtime";
1873
+ function NavItem({ route, getFullPath }) {
1874
+ const fullPath = getFullPath(route.path);
1875
+ const isActive = useIsActive(fullPath, { partial: fullPath !== "/" });
1876
+ const Icon = route.icon;
1877
+ return /* @__PURE__ */ jsx33(SidebarMenuItem, { children: /* @__PURE__ */ jsx33(SidebarMenuButton, { asChild: true, isActive, tooltip: route.label, children: /* @__PURE__ */ jsxs19(WebLink2, { to: fullPath, children: [
1878
+ Icon && /* @__PURE__ */ jsx33(Icon, { className: "size-4" }),
1879
+ /* @__PURE__ */ jsx33("span", { children: route.label })
1880
+ ] }) }) });
1881
+ }
1882
+ function BrandingHeader({ headerContent }) {
1883
+ const branding = useAuthShellBranding();
1884
+ if (headerContent) {
1885
+ return /* @__PURE__ */ jsx33(Fragment4, { children: headerContent });
1886
+ }
1887
+ return /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2 px-2", children: [
1888
+ branding.logo && /* @__PURE__ */ jsx33("div", { className: "flex-shrink-0", children: branding.logo }),
1889
+ /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-0.5 leading-none", children: [
1890
+ /* @__PURE__ */ jsx33("span", { className: "font-semibold", children: branding.name }),
1891
+ branding.tagline && /* @__PURE__ */ jsx33("span", { className: "text-xs text-muted-foreground", children: branding.tagline })
1892
+ ] })
1893
+ ] });
1894
+ }
1895
+ function DefaultUserMenu() {
1896
+ const { user, signOut } = useAuth7();
1897
+ if (!user) return null;
1898
+ const displayName = user.firstName ? `${user.firstName}${user.lastName ? ` ${user.lastName}` : ""}` : user.email ?? "User";
1899
+ return /* @__PURE__ */ jsx33(
1900
+ SidebarUser,
1901
+ {
1902
+ user: {
1903
+ name: displayName,
1904
+ email: user.email ?? "",
1905
+ avatar: user.profilePictureUrl ?? void 0
1906
+ },
1907
+ onSignOut: () => signOut()
1908
+ }
1909
+ );
1910
+ }
1911
+ function AuthShellNav({ headerContent, userMenu, className }) {
1912
+ const { routesByGroup, groups } = useAuthShellRoutesByGroup();
1913
+ const getFullPath = useAuthShellFullPath();
1914
+ return /* @__PURE__ */ jsxs19(Sidebar, { collapsible: "icon", className, children: [
1915
+ /* @__PURE__ */ jsx33(SidebarHeader, { children: /* @__PURE__ */ jsx33(BrandingHeader, { headerContent }) }),
1916
+ /* @__PURE__ */ jsx33(SidebarContent, { children: groups.map((group) => {
1917
+ const routes = routesByGroup.get(group.id);
1918
+ if (!routes || routes.length === 0) return null;
1919
+ return /* @__PURE__ */ jsxs19(SidebarGroup, { children: [
1920
+ group.label && /* @__PURE__ */ jsx33(SidebarGroupLabel, { children: group.label }),
1921
+ /* @__PURE__ */ jsx33(SidebarGroupContent, { children: /* @__PURE__ */ jsx33(SidebarMenu, { children: routes.map((route) => /* @__PURE__ */ jsx33(NavItem, { route, getFullPath }, route.key)) }) })
1922
+ ] }, group.id);
1923
+ }) }),
1924
+ /* @__PURE__ */ jsx33(SidebarFooter, { children: userMenu ?? /* @__PURE__ */ jsx33(DefaultUserMenu, {}) }),
1925
+ /* @__PURE__ */ jsx33(SidebarRail, {})
1926
+ ] });
1927
+ }
1928
+
1929
+ // src/shell/auth-shell.tsx
1930
+ import { jsx as jsx34, jsxs as jsxs20 } from "react/jsx-runtime";
1931
+ function DefaultHeader({
1932
+ breadcrumbs,
1933
+ headerContent
1934
+ }) {
1935
+ return /* @__PURE__ */ jsxs20("header", { className: "relative flex h-16 shrink-0 items-center gap-2 border-b bg-background transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: [
1936
+ /* @__PURE__ */ jsxs20("div", { className: "z-10 flex shrink-0 items-center gap-2 bg-background px-4", children: [
1937
+ /* @__PURE__ */ jsx34(SidebarTrigger, { className: "-ml-1" }),
1938
+ /* @__PURE__ */ jsx34(Separator, { orientation: "vertical", className: "mr-2 h-4" }),
1939
+ breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx34(Breadcrumbs, { items: breadcrumbs })
1940
+ ] }),
1941
+ headerContent && /* @__PURE__ */ jsx34("div", { className: "flex flex-1 items-center px-4 xl:absolute xl:inset-0 xl:justify-center", children: /* @__PURE__ */ jsx34("div", { className: "w-full max-w-md", children: headerContent }) })
1942
+ ] });
1943
+ }
1944
+ function AuthShell({
1945
+ children,
1946
+ sidebarHeaderContent,
1947
+ headerContent,
1948
+ breadcrumbs
1949
+ }) {
1950
+ const { config } = useAuthShellConfig();
1951
+ const { identity, auth } = config;
1952
+ return /* @__PURE__ */ jsxs20(
1953
+ AuthGate,
1954
+ {
1955
+ required: identity.required ?? auth?.requireAuth ?? true,
1956
+ onUnauthenticated: identity.onUnauthenticated ?? auth?.onUnauthenticated ?? "landing",
1957
+ loadingComponent: identity.loadingComponent,
1958
+ landingComponent: identity.landingComponent,
1959
+ children: [
1960
+ /* @__PURE__ */ jsxs20(SidebarProvider, { children: [
1961
+ /* @__PURE__ */ jsx34(AuthShellNav, { headerContent: sidebarHeaderContent }),
1962
+ /* @__PURE__ */ jsxs20(SidebarInset, { children: [
1963
+ /* @__PURE__ */ jsx34(DefaultHeader, { breadcrumbs, headerContent }),
1964
+ /* @__PURE__ */ jsx34("main", { className: "flex-1 overflow-auto p-4", children })
1965
+ ] })
1966
+ ] }),
1967
+ /* @__PURE__ */ jsx34(Toaster, {})
1968
+ ]
1969
+ }
1970
+ );
1971
+ }
1972
+
1973
+ // src/shell/auth-app.tsx
1974
+ import { useMemo as useMemo5 } from "react";
1975
+ import { ThemeProvider } from "next-themes";
1976
+ import { createWebRouter, RouterProvider, WebOutlet } from "@mdxui/navigation/web";
1977
+
1978
+ // src/shell/env-config.ts
1979
+ function getEnvVar(key) {
1980
+ if (typeof import.meta !== "undefined" && import.meta.env) {
1981
+ return import.meta.env[key];
1982
+ }
1983
+ if (typeof process !== "undefined" && process.env) {
1984
+ return process.env[key];
1985
+ }
1986
+ return void 0;
1987
+ }
1988
+ function getEnvConfig() {
1989
+ const clientId = getEnvVar("VITE_WORKOS_CLIENT_ID");
1990
+ const redirectUri = getEnvVar("VITE_WORKOS_REDIRECT_URI");
1991
+ const apiHostname = getEnvVar("VITE_WORKOS_API_HOSTNAME");
1992
+ const devModeStr = getEnvVar("VITE_WORKOS_DEV_MODE");
1993
+ const appName = getEnvVar("VITE_APP_NAME");
1994
+ const appTagline = getEnvVar("VITE_APP_TAGLINE");
1995
+ const identity = clientId ? {
1996
+ clientId,
1997
+ ...redirectUri && { redirectUri },
1998
+ ...apiHostname && { apiHostname },
1999
+ ...devModeStr && { devMode: devModeStr === "true" }
2000
+ } : void 0;
2001
+ const branding = appName ? {
2002
+ name: appName,
2003
+ ...appTagline && { tagline: appTagline }
2004
+ } : void 0;
2005
+ return {
2006
+ ...identity && { identity },
2007
+ ...branding && { branding }
2008
+ };
2009
+ }
2010
+ function mergeWithEnvConfig(config) {
2011
+ const envConfig = getEnvConfig();
2012
+ const branding = {
2013
+ name: config?.branding?.name ?? envConfig.branding?.name ?? "App",
2014
+ ...config?.branding?.logo && { logo: config.branding.logo },
2015
+ ...config?.branding?.logoCollapsed && { logoCollapsed: config.branding.logoCollapsed },
2016
+ tagline: config?.branding?.tagline ?? envConfig.branding?.tagline
2017
+ };
2018
+ const envIdentity = envConfig.identity;
2019
+ const configIdentity = config?.identity;
2020
+ if (!envIdentity?.clientId && !configIdentity?.clientId) {
2021
+ throw new Error(
2022
+ "AuthApp: Missing clientId. Either provide config.identity.clientId or set VITE_WORKOS_CLIENT_ID environment variable."
2023
+ );
2024
+ }
2025
+ const identity = {
2026
+ clientId: configIdentity?.clientId ?? envIdentity?.clientId ?? "",
2027
+ ...configIdentity?.redirectUri ?? envIdentity?.redirectUri ? { redirectUri: configIdentity?.redirectUri ?? envIdentity?.redirectUri } : {},
2028
+ ...configIdentity?.apiHostname ?? envIdentity?.apiHostname ? { apiHostname: configIdentity?.apiHostname ?? envIdentity?.apiHostname } : {},
2029
+ ...configIdentity?.devMode ?? envIdentity?.devMode ? { devMode: configIdentity?.devMode ?? envIdentity?.devMode } : {},
2030
+ ...configIdentity?.required !== void 0 ? { required: configIdentity.required } : {},
2031
+ ...configIdentity?.onUnauthenticated ? { onUnauthenticated: configIdentity.onUnauthenticated } : {},
2032
+ ...configIdentity?.landingComponent ? { landingComponent: configIdentity.landingComponent } : {},
2033
+ ...configIdentity?.loadingComponent ? { loadingComponent: configIdentity.loadingComponent } : {}
2034
+ };
2035
+ return {
2036
+ branding,
2037
+ identity,
2038
+ ...config?.basePath && { basePath: config.basePath },
2039
+ ...config?.theme && { theme: config.theme },
2040
+ ...config?.auth && { auth: config.auth },
2041
+ ...config?.groups && { groups: config.groups },
2042
+ ...config?.routes && { routes: config.routes }
2043
+ };
2044
+ }
2045
+
2046
+ // src/shell/auth-app.tsx
2047
+ import { jsx as jsx35 } from "react/jsx-runtime";
2048
+ function AuthAppProvider({ config, children }) {
2049
+ const resolvedConfig = useMemo5(() => mergeWithEnvConfig(config), [config]);
2050
+ const { identity, theme } = resolvedConfig;
2051
+ return /* @__PURE__ */ jsx35(
2052
+ ThemeProvider,
2053
+ {
2054
+ attribute: "class",
2055
+ defaultTheme: theme?.mode ?? "system",
2056
+ enableSystem: true,
2057
+ disableTransitionOnChange: true,
2058
+ children: /* @__PURE__ */ jsx35(AuthShellConfigProvider, { config: resolvedConfig, children: /* @__PURE__ */ jsx35(
2059
+ IdentityProvider,
2060
+ {
2061
+ clientId: identity.clientId,
2062
+ apiHostname: identity.apiHostname,
2063
+ devMode: identity.devMode,
2064
+ redirectUri: identity.redirectUri,
2065
+ children
2066
+ }
2067
+ ) })
2068
+ }
2069
+ );
2070
+ }
2071
+ function convertRoutesToConfig(routes, basePath) {
2072
+ const config = {};
2073
+ for (const route of routes) {
2074
+ if (route.enabled === false) continue;
2075
+ const fullPath = basePath ? `${basePath}${route.path}` : route.path;
2076
+ config[route.key] = {
2077
+ path: fullPath,
2078
+ component: route.component,
2079
+ meta: {
2080
+ label: route.label,
2081
+ icon: route.icon,
2082
+ group: route.group,
2083
+ public: route.public,
2084
+ requiredRoles: route.requiredRoles,
2085
+ requiredPermissions: route.requiredPermissions
2086
+ }
2087
+ };
2088
+ }
2089
+ return config;
2090
+ }
2091
+ function createRootLayout(headerContent, sidebarHeaderContent) {
2092
+ const resolvedSidebarContent = sidebarHeaderContent ?? /* @__PURE__ */ jsx35(SidebarOrgSwitcher, {});
2093
+ return function RootLayout() {
2094
+ return /* @__PURE__ */ jsx35(AuthShell, { headerContent, sidebarHeaderContent: resolvedSidebarContent, children: /* @__PURE__ */ jsx35(WebOutlet, {}) });
2095
+ };
2096
+ }
2097
+ function AuthApp({ config, headerContent, sidebarHeaderContent }) {
2098
+ const mergedConfig = useMemo5(() => mergeWithEnvConfig(config), [config]);
2099
+ const routes = mergedConfig.routes ?? defaultRoutes;
2100
+ const groups = mergedConfig.groups ?? defaultGroups;
2101
+ const resolvedConfig = useMemo5(
2102
+ () => ({ ...mergedConfig, routes, groups }),
2103
+ [mergedConfig, routes, groups]
2104
+ );
2105
+ const router = useMemo5(() => {
2106
+ const routeConfig = convertRoutesToConfig(routes, mergedConfig.basePath);
2107
+ const RootLayout = createRootLayout(headerContent, sidebarHeaderContent);
2108
+ return createWebRouter(routeConfig, {
2109
+ rootComponent: RootLayout,
2110
+ basepath: mergedConfig.basePath || void 0
2111
+ });
2112
+ }, [routes, mergedConfig.basePath, headerContent, sidebarHeaderContent]);
2113
+ return /* @__PURE__ */ jsx35(AuthAppProvider, { config: resolvedConfig, children: /* @__PURE__ */ jsx35(RouterProvider, { router }) });
2114
+ }
2115
+ function AuthAppWithChildren({
2116
+ config,
2117
+ headerContent,
2118
+ sidebarHeaderContent,
2119
+ children
2120
+ }) {
2121
+ const mergedConfig = useMemo5(() => mergeWithEnvConfig(config), [config]);
2122
+ const routes = mergedConfig.routes ?? defaultRoutes;
2123
+ const groups = mergedConfig.groups ?? defaultGroups;
2124
+ const resolvedConfig = useMemo5(
2125
+ () => ({ ...mergedConfig, routes, groups }),
2126
+ [mergedConfig, routes, groups]
2127
+ );
2128
+ const resolvedSidebarContent = sidebarHeaderContent ?? /* @__PURE__ */ jsx35(SidebarOrgSwitcher, {});
2129
+ return /* @__PURE__ */ jsx35(AuthAppProvider, { config: resolvedConfig, children: /* @__PURE__ */ jsx35(AuthShell, { headerContent, sidebarHeaderContent: resolvedSidebarContent, children }) });
2130
+ }
556
2131
  export {
557
2132
  ApiKeys,
2133
+ ApiKeysPage,
558
2134
  AppearanceSchema,
2135
+ AuthApp,
2136
+ AuthAppProvider,
2137
+ AuthAppWithChildren,
559
2138
  AuthGate,
560
2139
  AuthGatePropsSchema,
561
2140
  AuthOrganizationSchema,
562
2141
  AuthSessionSchema,
2142
+ AuthShell,
2143
+ AuthShellConfigProvider,
2144
+ AuthShellNav,
563
2145
  AuthTokenSchema,
564
2146
  AuthUserSchema,
565
2147
  BaseWidgetPropsSchema,
2148
+ Breadcrumbs,
566
2149
  IdentityProvider,
567
2150
  IdentityProviderMinimal,
568
2151
  IdentityProviderPropsSchema,
569
2152
  ImpersonatorSchema,
2153
+ IntegrationsPage,
570
2154
  OrganizationSwitcher,
571
2155
  OrganizationWidgetPropsSchema,
572
2156
  Pipes,
2157
+ ProfilePage,
573
2158
  RadiusSchema,
574
2159
  ScalingSchema,
2160
+ SecretForm,
2161
+ SecretsManager,
2162
+ SecurityPage,
2163
+ SessionsPage,
2164
+ SidebarOrgSwitcher,
575
2165
  SignInButton,
576
2166
  SignOutButton,
2167
+ TeamPage,
577
2168
  TeamSwitcher,
578
2169
  UnauthenticatedActionSchema,
579
2170
  UseWidgetTokenOptionsSchema,
@@ -583,10 +2174,34 @@ export {
583
2174
  UserSecurity,
584
2175
  UserSessions,
585
2176
  UsersManagement,
2177
+ VaultDeleteDialog,
2178
+ VaultEmptyState,
2179
+ VaultInputModal,
2180
+ VaultItemCard,
2181
+ VaultList,
2182
+ VaultProvider,
2183
+ WidgetErrorBoundary,
586
2184
  WidgetsProvider,
587
2185
  WidgetsProviderPropsSchema,
2186
+ accountRoutes,
2187
+ adminRoutes,
2188
+ defaultGroups,
2189
+ defaultRoutes,
2190
+ developerRoutes,
2191
+ getEnvConfig,
2192
+ integrationRoutes,
2193
+ mergeWithEnvConfig,
588
2194
  useAuth6 as useAuth,
2195
+ useAuthShellBranding,
2196
+ useAuthShellConfig,
2197
+ useAuthShellFullPath,
2198
+ useAuthShellRoutes,
2199
+ useAuthShellRoutesByGroup,
589
2200
  useThemeDetection,
2201
+ useVault,
2202
+ useVaultContext,
2203
+ useVaultContextOptional,
2204
+ useVaultOptional,
590
2205
  useWidgetToken
591
2206
  };
592
2207
  //# sourceMappingURL=index.js.map