@jmruthers/pace-core 0.5.126 → 0.5.127
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/{DataTable-6FN7XDXA.js → DataTable-QZH6SEUM.js} +6 -6
- package/dist/{PublicLoadingSpinner-CaoRbHvJ.d.ts → PublicLoadingSpinner-qqvM-NUe.d.ts} +34 -21
- package/dist/{UnifiedAuthProvider-6C47WIML.js → UnifiedAuthProvider-CQDZRJIS.js} +3 -3
- package/dist/{chunk-ZBLK676C.js → chunk-3CG5L6RN.js} +1 -19
- package/dist/chunk-3CG5L6RN.js.map +1 -0
- package/dist/{chunk-35ZDPMBM.js → chunk-BYXRHAIF.js} +3 -3
- package/dist/{chunk-IJOZZOGT.js → chunk-CQZU6TFE.js} +5 -5
- package/dist/{chunk-C43QIDN3.js → chunk-CTJRBUX2.js} +2 -2
- package/dist/{chunk-ESJTIADP.js → chunk-F64FFPOZ.js} +5 -15
- package/dist/{chunk-ESJTIADP.js.map → chunk-F64FFPOZ.js.map} +1 -1
- package/dist/{chunk-QXGLU2O5.js → chunk-JDBO5NCG.js} +249 -132
- package/dist/chunk-JDBO5NCG.js.map +1 -0
- package/dist/{chunk-4MXVZVNS.js → chunk-TGIY2AR2.js} +2 -2
- package/dist/{chunk-R4CRQUJJ.js → chunk-TMUNK34W.js} +428 -446
- package/dist/chunk-TMUNK34W.js.map +1 -0
- package/dist/{chunk-XN6GWKMV.js → chunk-VZ5OR6HD.js} +161 -14
- package/dist/chunk-VZ5OR6HD.js.map +1 -0
- package/dist/{chunk-QWNJCQXZ.js → chunk-ZV77RZMU.js} +2 -2
- package/dist/{chunk-NZGLXZGP.js → chunk-ZYZCRSBD.js} +3 -54
- package/dist/chunk-ZYZCRSBD.js.map +1 -0
- package/dist/components.d.ts +1 -1
- package/dist/components.js +9 -9
- package/dist/hooks.js +7 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -12
- package/dist/providers.js +2 -2
- package/dist/rbac/index.js +7 -7
- package/dist/utils.js +1 -1
- package/docs/api/classes/ColumnFactory.md +1 -1
- package/docs/api/classes/ErrorBoundary.md +1 -1
- package/docs/api/classes/InvalidScopeError.md +1 -1
- package/docs/api/classes/MissingUserContextError.md +1 -1
- package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
- package/docs/api/classes/PermissionDeniedError.md +1 -1
- package/docs/api/classes/PublicErrorBoundary.md +1 -1
- package/docs/api/classes/RBACAuditManager.md +1 -1
- package/docs/api/classes/RBACCache.md +1 -1
- package/docs/api/classes/RBACEngine.md +1 -1
- package/docs/api/classes/RBACError.md +1 -1
- package/docs/api/classes/RBACNotInitializedError.md +1 -1
- package/docs/api/classes/SecureSupabaseClient.md +1 -1
- package/docs/api/classes/StorageUtils.md +1 -1
- package/docs/api/enums/FileCategory.md +1 -1
- package/docs/api/interfaces/AggregateConfig.md +1 -1
- package/docs/api/interfaces/ButtonProps.md +1 -1
- package/docs/api/interfaces/CardProps.md +1 -1
- package/docs/api/interfaces/ColorPalette.md +1 -1
- package/docs/api/interfaces/ColorShade.md +1 -1
- package/docs/api/interfaces/DataAccessRecord.md +1 -1
- package/docs/api/interfaces/DataRecord.md +1 -1
- package/docs/api/interfaces/DataTableAction.md +1 -1
- package/docs/api/interfaces/DataTableColumn.md +1 -1
- package/docs/api/interfaces/DataTableProps.md +1 -1
- package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
- package/docs/api/interfaces/EmptyStateConfig.md +1 -1
- package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
- package/docs/api/interfaces/EventAppRoleData.md +1 -1
- package/docs/api/interfaces/FileDisplayProps.md +1 -1
- package/docs/api/interfaces/FileMetadata.md +1 -1
- package/docs/api/interfaces/FileReference.md +1 -1
- package/docs/api/interfaces/FileSizeLimits.md +1 -1
- package/docs/api/interfaces/FileUploadOptions.md +1 -1
- package/docs/api/interfaces/FileUploadProps.md +1 -1
- package/docs/api/interfaces/FooterProps.md +1 -1
- package/docs/api/interfaces/GrantEventAppRoleParams.md +1 -1
- package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
- package/docs/api/interfaces/InputProps.md +1 -1
- package/docs/api/interfaces/LabelProps.md +1 -1
- package/docs/api/interfaces/LoginFormProps.md +1 -1
- package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
- package/docs/api/interfaces/NavigationContextType.md +1 -1
- package/docs/api/interfaces/NavigationGuardProps.md +1 -1
- package/docs/api/interfaces/NavigationItem.md +1 -1
- package/docs/api/interfaces/NavigationMenuProps.md +1 -1
- package/docs/api/interfaces/NavigationProviderProps.md +1 -1
- package/docs/api/interfaces/Organisation.md +1 -1
- package/docs/api/interfaces/OrganisationContextType.md +1 -1
- package/docs/api/interfaces/OrganisationMembership.md +1 -1
- package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
- package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
- package/docs/api/interfaces/PaceAppLayoutProps.md +1 -1
- package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
- package/docs/api/interfaces/PageAccessRecord.md +1 -1
- package/docs/api/interfaces/PagePermissionContextType.md +1 -1
- package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
- package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
- package/docs/api/interfaces/PaletteData.md +1 -1
- package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
- package/docs/api/interfaces/ProtectedRouteProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
- package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
- package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
- package/docs/api/interfaces/PublicPageHeaderProps.md +10 -62
- package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
- package/docs/api/interfaces/RBACConfig.md +1 -1
- package/docs/api/interfaces/RBACLogger.md +1 -1
- package/docs/api/interfaces/RevokeEventAppRoleParams.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
- package/docs/api/interfaces/RoleManagementResult.md +1 -1
- package/docs/api/interfaces/RouteAccessRecord.md +1 -1
- package/docs/api/interfaces/RouteConfig.md +1 -1
- package/docs/api/interfaces/SecureDataContextType.md +1 -1
- package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
- package/docs/api/interfaces/StorageConfig.md +1 -1
- package/docs/api/interfaces/StorageFileInfo.md +1 -1
- package/docs/api/interfaces/StorageFileMetadata.md +1 -1
- package/docs/api/interfaces/StorageListOptions.md +1 -1
- package/docs/api/interfaces/StorageListResult.md +1 -1
- package/docs/api/interfaces/StorageUploadOptions.md +1 -1
- package/docs/api/interfaces/StorageUploadResult.md +1 -1
- package/docs/api/interfaces/StorageUrlOptions.md +1 -1
- package/docs/api/interfaces/StyleImport.md +1 -1
- package/docs/api/interfaces/SwitchProps.md +1 -1
- package/docs/api/interfaces/ToastActionElement.md +1 -1
- package/docs/api/interfaces/ToastProps.md +1 -1
- package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
- package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
- package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
- package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
- package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
- package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
- package/docs/api/interfaces/UsePublicFileDisplayOptions.md +1 -1
- package/docs/api/interfaces/UsePublicFileDisplayReturn.md +1 -1
- package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeOptions.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeReturn.md +1 -1
- package/docs/api/interfaces/UserEventAccess.md +1 -1
- package/docs/api/interfaces/UserMenuProps.md +1 -1
- package/docs/api/interfaces/UserProfile.md +1 -1
- package/docs/api/modules.md +46 -28
- package/docs/architecture/rpc-function-standards.md +39 -5
- package/package.json +1 -1
- package/src/components/Button/Button.tsx +1 -1
- package/src/components/DataTable/components/ImportModal.tsx +134 -2
- package/src/components/Dialog/Dialog.tsx +0 -13
- package/src/components/FileDisplay/FileDisplay.tsx +76 -0
- package/src/components/Header/Header.tsx +5 -0
- package/src/components/PaceAppLayout/PaceAppLayout.tsx +12 -39
- package/src/components/PublicLayout/PublicPageFooter.tsx +1 -1
- package/src/components/PublicLayout/PublicPageHeader.tsx +69 -128
- package/src/components/PublicLayout/PublicPageLayout.tsx +4 -4
- package/src/components/PublicLayout/PublicPageProvider.tsx +12 -3
- package/src/components/PublicLayout/__tests__/PublicPageFooter.test.tsx +1 -1
- package/src/components/PublicLayout/__tests__/PublicPageHeader.test.tsx +3 -18
- package/src/hooks/__tests__/useAppConfig.unit.test.ts +3 -1
- package/src/hooks/__tests__/usePermissionCache.unit.test.ts +11 -5
- package/src/hooks/__tests__/usePublicRouteParams.unit.test.ts +8 -7
- package/src/hooks/__tests__/useSecureDataAccess.unit.test.tsx +41 -46
- package/src/hooks/public/usePublicFileDisplay.ts +176 -7
- package/src/hooks/public/usePublicRouteParams.ts +0 -12
- package/src/hooks/useAppConfig.ts +15 -6
- package/src/hooks/usePermissionCache.test.ts +12 -4
- package/src/hooks/usePermissionCache.ts +3 -19
- package/src/hooks/useSecureDataAccess.ts +0 -63
- package/src/services/EventService.ts +0 -19
- package/dist/chunk-NZGLXZGP.js.map +0 -1
- package/dist/chunk-QXGLU2O5.js.map +0 -1
- package/dist/chunk-R4CRQUJJ.js.map +0 -1
- package/dist/chunk-XN6GWKMV.js.map +0 -1
- package/dist/chunk-ZBLK676C.js.map +0 -1
- /package/dist/{DataTable-6FN7XDXA.js.map → DataTable-QZH6SEUM.js.map} +0 -0
- /package/dist/{UnifiedAuthProvider-6C47WIML.js.map → UnifiedAuthProvider-CQDZRJIS.js.map} +0 -0
- /package/dist/{chunk-35ZDPMBM.js.map → chunk-BYXRHAIF.js.map} +0 -0
- /package/dist/{chunk-IJOZZOGT.js.map → chunk-CQZU6TFE.js.map} +0 -0
- /package/dist/{chunk-C43QIDN3.js.map → chunk-CTJRBUX2.js.map} +0 -0
- /package/dist/{chunk-4MXVZVNS.js.map → chunk-TGIY2AR2.js.map} +0 -0
- /package/dist/{chunk-QWNJCQXZ.js.map → chunk-ZV77RZMU.js.map} +0 -0
|
@@ -25,13 +25,13 @@ import {
|
|
|
25
25
|
SelectSeparator,
|
|
26
26
|
SelectTrigger,
|
|
27
27
|
SelectValue
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-JDBO5NCG.js";
|
|
29
29
|
import {
|
|
30
30
|
useCan,
|
|
31
31
|
usePermissions,
|
|
32
32
|
useRBAC,
|
|
33
33
|
useResolvedScope
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-BYXRHAIF.js";
|
|
35
35
|
import {
|
|
36
36
|
isSuperAdmin
|
|
37
37
|
} from "./chunk-WP5I5GLN.js";
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
useIsPublicPage,
|
|
51
51
|
usePublicFileDisplay,
|
|
52
52
|
usePublicPageContext
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-VZ5OR6HD.js";
|
|
54
54
|
import {
|
|
55
55
|
useToast
|
|
56
56
|
} from "./chunk-GKHF54DI.js";
|
|
@@ -58,11 +58,11 @@ import {
|
|
|
58
58
|
init_useOrganisations,
|
|
59
59
|
useEvents,
|
|
60
60
|
useOrganisations
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-TGIY2AR2.js";
|
|
62
62
|
import {
|
|
63
63
|
UnifiedAuthProvider_exports,
|
|
64
64
|
init_UnifiedAuthProvider as init_UnifiedAuthProvider2
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-CTJRBUX2.js";
|
|
66
66
|
import {
|
|
67
67
|
EventServiceContext,
|
|
68
68
|
EventServiceProvider,
|
|
@@ -72,7 +72,7 @@ import {
|
|
|
72
72
|
useEventService,
|
|
73
73
|
useSessionRestoration,
|
|
74
74
|
useUnifiedAuth
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-3CG5L6RN.js";
|
|
76
76
|
import {
|
|
77
77
|
LoadingSpinner
|
|
78
78
|
} from "./chunk-CDQ3PX7L.js";
|
|
@@ -258,42 +258,13 @@ var Switch = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
258
258
|
));
|
|
259
259
|
Switch.displayName = SwitchPrimitive.Root.displayName;
|
|
260
260
|
|
|
261
|
-
// src/components/Progress/Progress.tsx
|
|
262
|
-
import * as React4 from "react";
|
|
263
|
-
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
264
|
-
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
265
|
-
var Progress = React4.forwardRef(({ className, value, max = 100, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
266
|
-
ProgressPrimitive.Root,
|
|
267
|
-
{
|
|
268
|
-
ref,
|
|
269
|
-
className: cn(
|
|
270
|
-
"relative h-2 w-full overflow-hidden rounded-full bg-primary/20",
|
|
271
|
-
className
|
|
272
|
-
),
|
|
273
|
-
...props,
|
|
274
|
-
value,
|
|
275
|
-
max,
|
|
276
|
-
"aria-valuenow": value,
|
|
277
|
-
"aria-valuemax": max,
|
|
278
|
-
"aria-valuemin": 0,
|
|
279
|
-
children: /* @__PURE__ */ jsx4(
|
|
280
|
-
ProgressPrimitive.Indicator,
|
|
281
|
-
{
|
|
282
|
-
className: "h-full w-full flex-1 bg-primary transition-all",
|
|
283
|
-
style: { transform: `translateX(-${100 - (value || 0)}%)` }
|
|
284
|
-
}
|
|
285
|
-
)
|
|
286
|
-
}
|
|
287
|
-
));
|
|
288
|
-
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
289
|
-
|
|
290
261
|
// src/components/Toast/Toast.tsx
|
|
291
|
-
import * as
|
|
262
|
+
import * as React4 from "react";
|
|
292
263
|
import * as ToastPrimitives from "@radix-ui/react-toast";
|
|
293
264
|
import { X } from "lucide-react";
|
|
294
|
-
import { jsx as
|
|
265
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
295
266
|
var ToastProvider = ToastPrimitives.Provider;
|
|
296
|
-
var ToastViewport =
|
|
267
|
+
var ToastViewport = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
297
268
|
ToastPrimitives.Viewport,
|
|
298
269
|
{
|
|
299
270
|
ref,
|
|
@@ -306,8 +277,8 @@ var ToastViewport = React5.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
306
277
|
}
|
|
307
278
|
));
|
|
308
279
|
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
|
|
309
|
-
var Toast =
|
|
310
|
-
return /* @__PURE__ */
|
|
280
|
+
var Toast = React4.forwardRef(({ className, ...props }, ref) => {
|
|
281
|
+
return /* @__PURE__ */ jsx4(
|
|
311
282
|
ToastPrimitives.Root,
|
|
312
283
|
{
|
|
313
284
|
ref,
|
|
@@ -321,7 +292,7 @@ var Toast = React5.forwardRef(({ className, ...props }, ref) => {
|
|
|
321
292
|
);
|
|
322
293
|
});
|
|
323
294
|
Toast.displayName = ToastPrimitives.Root.displayName;
|
|
324
|
-
var ToastAction =
|
|
295
|
+
var ToastAction = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
325
296
|
ToastPrimitives.Action,
|
|
326
297
|
{
|
|
327
298
|
ref,
|
|
@@ -334,7 +305,7 @@ var ToastAction = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
334
305
|
}
|
|
335
306
|
));
|
|
336
307
|
ToastAction.displayName = ToastPrimitives.Action.displayName;
|
|
337
|
-
var ToastClose =
|
|
308
|
+
var ToastClose = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
338
309
|
ToastPrimitives.Close,
|
|
339
310
|
{
|
|
340
311
|
ref,
|
|
@@ -345,11 +316,11 @@ var ToastClose = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
345
316
|
),
|
|
346
317
|
"toast-close": "",
|
|
347
318
|
...props,
|
|
348
|
-
children: /* @__PURE__ */
|
|
319
|
+
children: /* @__PURE__ */ jsx4(X, { className: "h-4 w-4" })
|
|
349
320
|
}
|
|
350
321
|
));
|
|
351
322
|
ToastClose.displayName = ToastPrimitives.Close.displayName;
|
|
352
|
-
var ToastTitle =
|
|
323
|
+
var ToastTitle = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
353
324
|
ToastPrimitives.Title,
|
|
354
325
|
{
|
|
355
326
|
ref,
|
|
@@ -359,7 +330,7 @@ var ToastTitle = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
359
330
|
}
|
|
360
331
|
));
|
|
361
332
|
ToastTitle.displayName = ToastPrimitives.Title.displayName;
|
|
362
|
-
var ToastDescription =
|
|
333
|
+
var ToastDescription = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
363
334
|
ToastPrimitives.Description,
|
|
364
335
|
{
|
|
365
336
|
ref,
|
|
@@ -372,14 +343,14 @@ ToastDescription.displayName = ToastPrimitives.Description.displayName;
|
|
|
372
343
|
function Toaster() {
|
|
373
344
|
const { toasts } = useToast();
|
|
374
345
|
return /* @__PURE__ */ jsxs2(ToastProvider, { "data-testid": "toast-provider", children: [
|
|
375
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ jsx4(ToastViewport, {}),
|
|
376
347
|
toasts.map((toast) => {
|
|
377
348
|
const { id, title, description, action, dismiss, duration, ...toastProps } = toast;
|
|
378
349
|
return /* @__PURE__ */ jsxs2(Toast, { ...toastProps, duration, children: [
|
|
379
|
-
title && /* @__PURE__ */
|
|
380
|
-
description && /* @__PURE__ */
|
|
350
|
+
title && /* @__PURE__ */ jsx4(ToastTitle, { children: title }),
|
|
351
|
+
description && /* @__PURE__ */ jsx4(ToastDescription, { children: description }),
|
|
381
352
|
action && action,
|
|
382
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ jsx4(ToastClose, { onClick: dismiss })
|
|
383
354
|
] }, id);
|
|
384
355
|
})
|
|
385
356
|
] });
|
|
@@ -388,7 +359,7 @@ function Toaster() {
|
|
|
388
359
|
// src/components/Form/Form.tsx
|
|
389
360
|
import { useForm, FormProvider } from "react-hook-form";
|
|
390
361
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
391
|
-
import { jsx as
|
|
362
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
392
363
|
function Form({
|
|
393
364
|
schema,
|
|
394
365
|
defaultValues,
|
|
@@ -404,13 +375,13 @@ function Form({
|
|
|
404
375
|
mode
|
|
405
376
|
});
|
|
406
377
|
const handleSubmit = methods.handleSubmit(onSubmit, onError);
|
|
407
|
-
return /* @__PURE__ */
|
|
378
|
+
return /* @__PURE__ */ jsx5(FormProvider, { ...methods, children: /* @__PURE__ */ jsx5("form", { onSubmit: handleSubmit, className: cn("space-y-4", className), children: typeof children === "function" ? children(methods) : children }) });
|
|
408
379
|
}
|
|
409
380
|
|
|
410
381
|
// src/components/LoginForm/LoginForm.tsx
|
|
411
|
-
import
|
|
412
|
-
import { jsx as
|
|
413
|
-
var LoginForm =
|
|
382
|
+
import React5, { useState, useCallback, useMemo } from "react";
|
|
383
|
+
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
384
|
+
var LoginForm = React5.memo(({
|
|
414
385
|
onSignIn,
|
|
415
386
|
onSuccess,
|
|
416
387
|
onError,
|
|
@@ -451,15 +422,15 @@ var LoginForm = React6.memo(({
|
|
|
451
422
|
}, [onSignUp]);
|
|
452
423
|
const displayTitle = useMemo(() => title || (appName ? `Sign in to ${appName}` : "Sign In"), [title, appName]);
|
|
453
424
|
const displaySubtitle = useMemo(() => subtitle || "Enter your credentials to continue.", [subtitle]);
|
|
454
|
-
return /* @__PURE__ */
|
|
425
|
+
return /* @__PURE__ */ jsx6(Card, { className: cn("w-full max-w-md mx-auto", className), children: /* @__PURE__ */ jsxs3("form", { onSubmit: handleSubmit, "data-testid": "login-form", children: [
|
|
455
426
|
/* @__PURE__ */ jsxs3(CardHeader, { className: "space-y-1", children: [
|
|
456
|
-
/* @__PURE__ */
|
|
457
|
-
/* @__PURE__ */
|
|
427
|
+
/* @__PURE__ */ jsx6(CardTitle, { className: "text-2xl text-center", children: displayTitle }),
|
|
428
|
+
/* @__PURE__ */ jsx6(CardDescription, { className: "text-center", children: displaySubtitle })
|
|
458
429
|
] }),
|
|
459
430
|
/* @__PURE__ */ jsxs3(CardContent, { className: "space-y-4", children: [
|
|
460
|
-
error && /* @__PURE__ */
|
|
461
|
-
/* @__PURE__ */
|
|
462
|
-
/* @__PURE__ */
|
|
431
|
+
error && /* @__PURE__ */ jsx6(Alert, { variant: "destructive", children: /* @__PURE__ */ jsx6(AlertDescription, { children: error }) }),
|
|
432
|
+
/* @__PURE__ */ jsx6(Label, { htmlFor: "email", children: "Email" }),
|
|
433
|
+
/* @__PURE__ */ jsx6(
|
|
463
434
|
Input,
|
|
464
435
|
{
|
|
465
436
|
id: "email",
|
|
@@ -471,8 +442,8 @@ var LoginForm = React6.memo(({
|
|
|
471
442
|
disabled: isLoading
|
|
472
443
|
}
|
|
473
444
|
),
|
|
474
|
-
/* @__PURE__ */
|
|
475
|
-
/* @__PURE__ */
|
|
445
|
+
/* @__PURE__ */ jsx6(Label, { htmlFor: "password", children: "Password" }),
|
|
446
|
+
/* @__PURE__ */ jsx6(
|
|
476
447
|
Input,
|
|
477
448
|
{
|
|
478
449
|
id: "password",
|
|
@@ -486,7 +457,7 @@ var LoginForm = React6.memo(({
|
|
|
486
457
|
)
|
|
487
458
|
] }),
|
|
488
459
|
/* @__PURE__ */ jsxs3(CardFooter, { className: "flex flex-col space-y-4", children: [
|
|
489
|
-
/* @__PURE__ */
|
|
460
|
+
/* @__PURE__ */ jsx6(
|
|
490
461
|
Button,
|
|
491
462
|
{
|
|
492
463
|
type: "submit",
|
|
@@ -495,7 +466,7 @@ var LoginForm = React6.memo(({
|
|
|
495
466
|
children: isLoading ? "Signing in..." : "Sign In"
|
|
496
467
|
}
|
|
497
468
|
),
|
|
498
|
-
showSignUp && (onSignUp ? /* @__PURE__ */
|
|
469
|
+
showSignUp && (onSignUp ? /* @__PURE__ */ jsx6("div", { className: "text-sm text-center text-muted-foreground", children: /* @__PURE__ */ jsx6(
|
|
499
470
|
"button",
|
|
500
471
|
{
|
|
501
472
|
type: "button",
|
|
@@ -506,7 +477,7 @@ var LoginForm = React6.memo(({
|
|
|
506
477
|
) }) : /* @__PURE__ */ jsxs3("p", { className: "text-center text-muted-foreground", children: [
|
|
507
478
|
"Don't have an account?",
|
|
508
479
|
" ",
|
|
509
|
-
/* @__PURE__ */
|
|
480
|
+
/* @__PURE__ */ jsx6("a", { href: "/signup", className: "text-primary hover:underline", children: "Sign up" })
|
|
510
481
|
] }))
|
|
511
482
|
] })
|
|
512
483
|
] }) });
|
|
@@ -515,7 +486,7 @@ var LoginForm = React6.memo(({
|
|
|
515
486
|
// src/components/EventSelector/EventSelector.tsx
|
|
516
487
|
import { RefreshCw, AlertCircle, Lock, Calendar, Star } from "lucide-react";
|
|
517
488
|
import { useEffect, useMemo as useMemo2 } from "react";
|
|
518
|
-
import { jsx as
|
|
489
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
519
490
|
function EventSelector({
|
|
520
491
|
placeholder = "Select an event",
|
|
521
492
|
className,
|
|
@@ -611,15 +582,15 @@ function EventSelector({
|
|
|
611
582
|
}, [events, selectedEvent, setSelectedEvent, onEventChange, isLoading]);
|
|
612
583
|
if (isLoading) {
|
|
613
584
|
return /* @__PURE__ */ jsxs4("div", { className: `flex items-center gap-2 ${className}`, children: [
|
|
614
|
-
/* @__PURE__ */
|
|
615
|
-
/* @__PURE__ */
|
|
585
|
+
/* @__PURE__ */ jsx7(LoadingSpinner, { size: "sm" }),
|
|
586
|
+
/* @__PURE__ */ jsx7("span", { className: "text-sm text-muted-foreground", children: "Loading events..." })
|
|
616
587
|
] });
|
|
617
588
|
}
|
|
618
589
|
if (error) {
|
|
619
|
-
return /* @__PURE__ */
|
|
620
|
-
/* @__PURE__ */
|
|
590
|
+
return /* @__PURE__ */ jsx7("div", { className, children: /* @__PURE__ */ jsxs4(Alert, { variant: "destructive", children: [
|
|
591
|
+
/* @__PURE__ */ jsx7(Lock, { className: "h-4 w-4" }),
|
|
621
592
|
/* @__PURE__ */ jsxs4(AlertDescription, { className: "flex items-center justify-between", children: [
|
|
622
|
-
/* @__PURE__ */
|
|
593
|
+
/* @__PURE__ */ jsx7("span", { children: error.message }),
|
|
623
594
|
showRetryButton && /* @__PURE__ */ jsxs4(
|
|
624
595
|
Button,
|
|
625
596
|
{
|
|
@@ -628,7 +599,7 @@ function EventSelector({
|
|
|
628
599
|
onClick: handleRetry,
|
|
629
600
|
className: "ml-2",
|
|
630
601
|
children: [
|
|
631
|
-
/* @__PURE__ */
|
|
602
|
+
/* @__PURE__ */ jsx7(RefreshCw, { className: "h-3 w-3 mr-1" }),
|
|
632
603
|
"Retry"
|
|
633
604
|
]
|
|
634
605
|
}
|
|
@@ -638,10 +609,10 @@ function EventSelector({
|
|
|
638
609
|
}
|
|
639
610
|
if (events.length === 0) {
|
|
640
611
|
if (showNoEventsMessage) {
|
|
641
|
-
return /* @__PURE__ */
|
|
642
|
-
/* @__PURE__ */
|
|
612
|
+
return /* @__PURE__ */ jsx7("div", { className, children: /* @__PURE__ */ jsxs4(Alert, { variant: "inline", children: [
|
|
613
|
+
/* @__PURE__ */ jsx7(AlertCircle, { className: "h-4 w-4 text-acc-700" }),
|
|
643
614
|
/* @__PURE__ */ jsxs4(AlertDescription, { className: "flex items-center justify-between", children: [
|
|
644
|
-
/* @__PURE__ */
|
|
615
|
+
/* @__PURE__ */ jsx7("span", { children: "No events available." }),
|
|
645
616
|
showRetryButton && /* @__PURE__ */ jsxs4(
|
|
646
617
|
Button,
|
|
647
618
|
{
|
|
@@ -650,7 +621,7 @@ function EventSelector({
|
|
|
650
621
|
onClick: handleRetry,
|
|
651
622
|
className: "ml-2",
|
|
652
623
|
children: [
|
|
653
|
-
/* @__PURE__ */
|
|
624
|
+
/* @__PURE__ */ jsx7(RefreshCw, { className: "h-3 w-3 mr-1" }),
|
|
654
625
|
"Refresh"
|
|
655
626
|
]
|
|
656
627
|
}
|
|
@@ -667,34 +638,34 @@ function EventSelector({
|
|
|
667
638
|
onValueChange: handleValueChange,
|
|
668
639
|
className,
|
|
669
640
|
children: [
|
|
670
|
-
/* @__PURE__ */
|
|
671
|
-
/* @__PURE__ */
|
|
672
|
-
/* @__PURE__ */
|
|
641
|
+
/* @__PURE__ */ jsx7(SelectTrigger, { className: "text-left", variant: "outline", children: /* @__PURE__ */ jsx7(SelectValue, { placeholder, children: selectedEvent && /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
|
|
642
|
+
/* @__PURE__ */ jsx7(Calendar, { className: "h-4 w-4 flex-shrink-0" }),
|
|
643
|
+
/* @__PURE__ */ jsx7("span", { className: "truncate", children: selectedEvent.event_name || selectedEvent.name }),
|
|
673
644
|
selectedEvent.event_date && /* @__PURE__ */ jsxs4("span", { className: "text-xs text-muted-foreground flex-shrink-0", children: [
|
|
674
645
|
"(",
|
|
675
646
|
formatEventDate(selectedEvent.event_date),
|
|
676
647
|
")"
|
|
677
648
|
] })
|
|
678
649
|
] }) }) }),
|
|
679
|
-
/* @__PURE__ */
|
|
650
|
+
/* @__PURE__ */ jsx7(SelectContent, { children: sortedEvents.map((event) => {
|
|
680
651
|
const isNext = isNextEvent(event);
|
|
681
652
|
const isSelected = selectedEvent && (selectedEvent.event_id === event.event_id || selectedEvent.id === event.id);
|
|
682
|
-
return /* @__PURE__ */
|
|
653
|
+
return /* @__PURE__ */ jsx7(
|
|
683
654
|
SelectItem,
|
|
684
655
|
{
|
|
685
656
|
value: event.event_id || event.id,
|
|
686
657
|
className: "flex items-center justify-between",
|
|
687
658
|
children: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2 w-full", children: [
|
|
688
|
-
showNextEventIndicator && isNext && /* @__PURE__ */
|
|
659
|
+
showNextEventIndicator && isNext && /* @__PURE__ */ jsx7(Star, { className: "h-3 w-3 text-acc-500" }),
|
|
689
660
|
/* @__PURE__ */ jsxs4("div", { className: "flex-1", children: [
|
|
690
661
|
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
|
|
691
|
-
/* @__PURE__ */
|
|
692
|
-
isSelected && /* @__PURE__ */
|
|
662
|
+
/* @__PURE__ */ jsx7("span", { className: isSelected ? "font-semibold" : "", children: event.event_name || event.name }),
|
|
663
|
+
isSelected && /* @__PURE__ */ jsx7("span", { className: "text-xs bg-primary text-primary-foreground px-1 rounded", children: "Current" })
|
|
693
664
|
] }),
|
|
694
665
|
showEventDetails && event.event_date && /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
695
|
-
/* @__PURE__ */
|
|
696
|
-
/* @__PURE__ */
|
|
697
|
-
showNextEventIndicator && isNext && /* @__PURE__ */
|
|
666
|
+
/* @__PURE__ */ jsx7(Calendar, { className: "h-3 w-3" }),
|
|
667
|
+
/* @__PURE__ */ jsx7("span", { children: formatEventDate(event.event_date) }),
|
|
668
|
+
showNextEventIndicator && isNext && /* @__PURE__ */ jsx7("span", { className: "text-acc-600 font-medium", children: "(Next)" })
|
|
698
669
|
] }),
|
|
699
670
|
showEventDetails && event.event_venue && /* @__PURE__ */ jsxs4("div", { className: "text-xs text-muted-foreground", children: [
|
|
700
671
|
"\u{1F4CD} ",
|
|
@@ -713,7 +684,7 @@ function EventSelector({
|
|
|
713
684
|
|
|
714
685
|
// src/components/PasswordReset/PasswordChangeForm.tsx
|
|
715
686
|
import { useState as useState2 } from "react";
|
|
716
|
-
import { jsx as
|
|
687
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
717
688
|
function PasswordChangeForm({ onSubmit, className }) {
|
|
718
689
|
const [newPassword, setNewPassword] = useState2("");
|
|
719
690
|
const [confirmPassword, setConfirmPassword] = useState2("");
|
|
@@ -743,10 +714,10 @@ function PasswordChangeForm({ onSubmit, className }) {
|
|
|
743
714
|
}
|
|
744
715
|
};
|
|
745
716
|
return /* @__PURE__ */ jsxs5("form", { onSubmit: handleSubmit, className: cn("space-y-4", className), children: [
|
|
746
|
-
error && /* @__PURE__ */
|
|
717
|
+
error && /* @__PURE__ */ jsx8("div", { role: "alert", children: error }),
|
|
747
718
|
/* @__PURE__ */ jsxs5("div", { className: "space-y-2", children: [
|
|
748
|
-
/* @__PURE__ */
|
|
749
|
-
/* @__PURE__ */
|
|
719
|
+
/* @__PURE__ */ jsx8(Label, { htmlFor: "new-password", children: "New Password" }),
|
|
720
|
+
/* @__PURE__ */ jsx8(
|
|
750
721
|
Input,
|
|
751
722
|
{
|
|
752
723
|
id: "new-password",
|
|
@@ -759,8 +730,8 @@ function PasswordChangeForm({ onSubmit, className }) {
|
|
|
759
730
|
)
|
|
760
731
|
] }),
|
|
761
732
|
/* @__PURE__ */ jsxs5("div", { className: "space-y-2", children: [
|
|
762
|
-
/* @__PURE__ */
|
|
763
|
-
/* @__PURE__ */
|
|
733
|
+
/* @__PURE__ */ jsx8(Label, { htmlFor: "confirm-password", children: "Confirm Password" }),
|
|
734
|
+
/* @__PURE__ */ jsx8(
|
|
764
735
|
Input,
|
|
765
736
|
{
|
|
766
737
|
id: "confirm-password",
|
|
@@ -772,7 +743,7 @@ function PasswordChangeForm({ onSubmit, className }) {
|
|
|
772
743
|
}
|
|
773
744
|
)
|
|
774
745
|
] }),
|
|
775
|
-
/* @__PURE__ */
|
|
746
|
+
/* @__PURE__ */ jsx8(
|
|
776
747
|
Button,
|
|
777
748
|
{
|
|
778
749
|
type: "submit",
|
|
@@ -785,10 +756,10 @@ function PasswordChangeForm({ onSubmit, className }) {
|
|
|
785
756
|
}
|
|
786
757
|
|
|
787
758
|
// src/components/UserMenu/UserMenu.tsx
|
|
788
|
-
import
|
|
759
|
+
import React7, { useCallback as useCallback2, useMemo as useMemo3, useState as useState3 } from "react";
|
|
789
760
|
import { ChevronDown, LogOut, KeyRound } from "lucide-react";
|
|
790
|
-
import { jsx as
|
|
791
|
-
var UserMenu =
|
|
761
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
762
|
+
var UserMenu = React7.memo(function UserMenu2({
|
|
792
763
|
user,
|
|
793
764
|
onSignOut,
|
|
794
765
|
onChangePassword,
|
|
@@ -813,34 +784,34 @@ var UserMenu = React8.memo(function UserMenu2({
|
|
|
813
784
|
}
|
|
814
785
|
return /* @__PURE__ */ jsxs6(Dialog, { open: isPasswordDialogOpen, onOpenChange: setPasswordDialogOpen, children: [
|
|
815
786
|
/* @__PURE__ */ jsxs6(Select, { className, children: [
|
|
816
|
-
/* @__PURE__ */
|
|
787
|
+
/* @__PURE__ */ jsx9(SelectTrigger, { asChild: true, children: /* @__PURE__ */ jsxs6(Button, { variant: "outline", className: "flex items-center gap-2", "aria-label": userInfo.displayName, children: [
|
|
817
788
|
showAvatar && /* @__PURE__ */ jsxs6(Avatar, { className: "size-7", children: [
|
|
818
|
-
/* @__PURE__ */
|
|
819
|
-
/* @__PURE__ */
|
|
789
|
+
/* @__PURE__ */ jsx9(AvatarImage, { src: userInfo.avatarUrl, alt: userInfo.displayName }),
|
|
790
|
+
/* @__PURE__ */ jsx9(AvatarFallback, { children: userInfo.initial })
|
|
820
791
|
] }),
|
|
821
|
-
/* @__PURE__ */
|
|
822
|
-
/* @__PURE__ */
|
|
792
|
+
/* @__PURE__ */ jsx9("span", { children: userInfo.displayName }),
|
|
793
|
+
/* @__PURE__ */ jsx9(ChevronDown, { className: "h-4 w-4" })
|
|
823
794
|
] }) }),
|
|
824
795
|
/* @__PURE__ */ jsxs6(SelectContent, { children: [
|
|
825
|
-
/* @__PURE__ */
|
|
826
|
-
/* @__PURE__ */
|
|
827
|
-
/* @__PURE__ */
|
|
796
|
+
/* @__PURE__ */ jsx9(SelectLabel, { className: "font-normal", children: /* @__PURE__ */ jsxs6("div", { className: "flex flex-col space-y-1", children: [
|
|
797
|
+
/* @__PURE__ */ jsx9("p", { className: "font-medium", children: userInfo.displayName }),
|
|
798
|
+
/* @__PURE__ */ jsx9("p", { className: "text-muted-foreground", children: userInfo.email })
|
|
828
799
|
] }) }),
|
|
829
|
-
/* @__PURE__ */
|
|
830
|
-
/* @__PURE__ */
|
|
831
|
-
/* @__PURE__ */
|
|
832
|
-
/* @__PURE__ */
|
|
800
|
+
/* @__PURE__ */ jsx9(SelectSeparator, {}),
|
|
801
|
+
/* @__PURE__ */ jsx9(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsxs6(SelectItem, { value: "change-password", children: [
|
|
802
|
+
/* @__PURE__ */ jsx9(KeyRound, { className: "mr-2 h-4 w-4" }),
|
|
803
|
+
/* @__PURE__ */ jsx9("span", { children: "Change Password" })
|
|
833
804
|
] }) }),
|
|
834
805
|
/* @__PURE__ */ jsxs6(SelectItem, { value: "sign-out", onClick: handleSignOut, children: [
|
|
835
|
-
/* @__PURE__ */
|
|
836
|
-
/* @__PURE__ */
|
|
806
|
+
/* @__PURE__ */ jsx9(LogOut, { className: "mr-2 h-4 w-4" }),
|
|
807
|
+
/* @__PURE__ */ jsx9("span", { children: "Sign out" })
|
|
837
808
|
] })
|
|
838
809
|
] })
|
|
839
810
|
] }),
|
|
840
|
-
/* @__PURE__ */
|
|
811
|
+
/* @__PURE__ */ jsx9(DialogOverlay, {}),
|
|
841
812
|
/* @__PURE__ */ jsxs6(DialogContent, { className, children: [
|
|
842
|
-
/* @__PURE__ */
|
|
843
|
-
/* @__PURE__ */
|
|
813
|
+
/* @__PURE__ */ jsx9(DialogHeader, { children: /* @__PURE__ */ jsx9(DialogTitle, { children: "Change Password" }) }),
|
|
814
|
+
/* @__PURE__ */ jsx9(
|
|
844
815
|
PasswordChangeForm,
|
|
845
816
|
{
|
|
846
817
|
onSubmit: async ({ newPassword, confirmPassword }) => {
|
|
@@ -858,7 +829,7 @@ var UserMenu = React8.memo(function UserMenu2({
|
|
|
858
829
|
] })
|
|
859
830
|
] });
|
|
860
831
|
});
|
|
861
|
-
var UserMenuLoading =
|
|
832
|
+
var UserMenuLoading = React7.memo(function UserMenuLoading2() {
|
|
862
833
|
return /* @__PURE__ */ jsxs6("div", { className: "relative inline-block text-left", children: [
|
|
863
834
|
/* @__PURE__ */ jsxs6(
|
|
864
835
|
"button",
|
|
@@ -867,23 +838,23 @@ var UserMenuLoading = React8.memo(function UserMenuLoading2() {
|
|
|
867
838
|
disabled: true,
|
|
868
839
|
className: "flex items-center space-x-2 px-3 py-2 text-sm font-medium text-muted-foreground bg-muted border border-input rounded-md",
|
|
869
840
|
children: [
|
|
870
|
-
/* @__PURE__ */
|
|
871
|
-
/* @__PURE__ */
|
|
872
|
-
/* @__PURE__ */
|
|
841
|
+
/* @__PURE__ */ jsx9("div", { className: "w-6 h-6 rounded-full bg-muted animate-pulse" }),
|
|
842
|
+
/* @__PURE__ */ jsx9("span", { className: "truncate max-w-[150px]", children: "Loading..." }),
|
|
843
|
+
/* @__PURE__ */ jsx9(ChevronDown, { className: "w-4 h-4 text-muted-foreground" })
|
|
873
844
|
]
|
|
874
845
|
}
|
|
875
846
|
),
|
|
876
|
-
/* @__PURE__ */
|
|
847
|
+
/* @__PURE__ */ jsx9("div", { role: "status", "aria-label": "Loading user menu", "aria-live": "polite", className: "w-6 h-6 rounded-full bg-muted animate-pulse" })
|
|
877
848
|
] });
|
|
878
849
|
});
|
|
879
850
|
UserMenu.Loading = UserMenuLoading;
|
|
880
851
|
|
|
881
852
|
// src/components/NavigationMenu/NavigationMenu.tsx
|
|
882
|
-
import * as
|
|
853
|
+
import * as React8 from "react";
|
|
883
854
|
import { ChevronDown as ChevronDown2 } from "lucide-react";
|
|
884
855
|
init_UnifiedAuthProvider2();
|
|
885
|
-
import { jsx as
|
|
886
|
-
var NavigationMenu =
|
|
856
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
857
|
+
var NavigationMenu = React8.forwardRef(({
|
|
887
858
|
items,
|
|
888
859
|
mode = "dropdown",
|
|
889
860
|
currentPath,
|
|
@@ -901,8 +872,8 @@ var NavigationMenu = React9.forwardRef(({
|
|
|
901
872
|
filterByPermissions = true,
|
|
902
873
|
...props
|
|
903
874
|
}, ref) => {
|
|
904
|
-
const [expandedItems, setExpandedItems] =
|
|
905
|
-
const buttonRef =
|
|
875
|
+
const [expandedItems, setExpandedItems] = React8.useState(/* @__PURE__ */ new Set());
|
|
876
|
+
const buttonRef = React8.useRef(null);
|
|
906
877
|
let authContext = null;
|
|
907
878
|
try {
|
|
908
879
|
authContext = useUnifiedAuth();
|
|
@@ -923,7 +894,7 @@ var NavigationMenu = React9.forwardRef(({
|
|
|
923
894
|
selectedOrganisationId: selectedOrganisation?.id || null,
|
|
924
895
|
selectedEventId: selectedEvent?.event_id || null
|
|
925
896
|
});
|
|
926
|
-
const stableScopeRef =
|
|
897
|
+
const stableScopeRef = React8.useRef({
|
|
927
898
|
organisationId: "",
|
|
928
899
|
eventId: void 0,
|
|
929
900
|
appId: void 0
|
|
@@ -954,8 +925,8 @@ var NavigationMenu = React9.forwardRef(({
|
|
|
954
925
|
userId,
|
|
955
926
|
stableScope
|
|
956
927
|
);
|
|
957
|
-
const previousFilteredItemsRef =
|
|
958
|
-
const filteredItems =
|
|
928
|
+
const previousFilteredItemsRef = React8.useRef([]);
|
|
929
|
+
const filteredItems = React8.useMemo(() => {
|
|
959
930
|
if (filterByPermissions) {
|
|
960
931
|
if (!authContext || !rbacContext || scopeLoading || !resolvedScope?.organisationId) {
|
|
961
932
|
return [];
|
|
@@ -1094,7 +1065,7 @@ var NavigationMenu = React9.forwardRef(({
|
|
|
1094
1065
|
resolvedScope,
|
|
1095
1066
|
auditLog
|
|
1096
1067
|
]);
|
|
1097
|
-
|
|
1068
|
+
React8.useEffect(() => {
|
|
1098
1069
|
if (auditLog && authContext) {
|
|
1099
1070
|
console.log("[NavigationMenu] Navigation access attempt:", {
|
|
1100
1071
|
itemId: "navigation-menu",
|
|
@@ -1228,7 +1199,7 @@ var NavigationMenu = React9.forwardRef(({
|
|
|
1228
1199
|
const hasChildren = item.children && item.children.length > 0;
|
|
1229
1200
|
const isExpanded = expandedItems.has(item.id);
|
|
1230
1201
|
const itemIsActive = isActiveItem(item);
|
|
1231
|
-
return /* @__PURE__ */
|
|
1202
|
+
return /* @__PURE__ */ jsx10("li", { role: "none", children: hasChildren ? /* @__PURE__ */ jsxs7("div", { children: [
|
|
1232
1203
|
/* @__PURE__ */ jsxs7(
|
|
1233
1204
|
"button",
|
|
1234
1205
|
{
|
|
@@ -1238,21 +1209,21 @@ var NavigationMenu = React9.forwardRef(({
|
|
|
1238
1209
|
"aria-controls": `submenu-${item.id}`,
|
|
1239
1210
|
"aria-current": itemIsActive ? "page" : void 0,
|
|
1240
1211
|
children: [
|
|
1241
|
-
/* @__PURE__ */
|
|
1242
|
-
/* @__PURE__ */
|
|
1212
|
+
/* @__PURE__ */ jsx10("span", { children: item.label }),
|
|
1213
|
+
/* @__PURE__ */ jsx10(ChevronDown2, { "aria-hidden": "true" })
|
|
1243
1214
|
]
|
|
1244
1215
|
}
|
|
1245
1216
|
),
|
|
1246
|
-
isExpanded && item.children && /* @__PURE__ */
|
|
1217
|
+
isExpanded && item.children && /* @__PURE__ */ jsx10(
|
|
1247
1218
|
"ul",
|
|
1248
1219
|
{
|
|
1249
1220
|
id: `submenu-${item.id}`,
|
|
1250
1221
|
role: "menu",
|
|
1251
1222
|
"aria-label": `${item.label} submenu`,
|
|
1252
|
-
children: item.children.map((child) => /* @__PURE__ */
|
|
1223
|
+
children: item.children.map((child) => /* @__PURE__ */ jsx10(React8.Fragment, { children: renderHierarchicalItem(child, level + 1) }, child.id))
|
|
1253
1224
|
}
|
|
1254
1225
|
)
|
|
1255
|
-
] }) : /* @__PURE__ */
|
|
1226
|
+
] }) : /* @__PURE__ */ jsx10(
|
|
1256
1227
|
"a",
|
|
1257
1228
|
{
|
|
1258
1229
|
href: item.href || "#",
|
|
@@ -1277,19 +1248,19 @@ var NavigationMenu = React9.forwardRef(({
|
|
|
1277
1248
|
className,
|
|
1278
1249
|
"data-testid": "navigation-menu-root",
|
|
1279
1250
|
children: [
|
|
1280
|
-
/* @__PURE__ */
|
|
1251
|
+
/* @__PURE__ */ jsx10(
|
|
1281
1252
|
SelectTrigger,
|
|
1282
1253
|
{
|
|
1283
1254
|
ref: buttonRef,
|
|
1284
1255
|
disabled,
|
|
1285
1256
|
"aria-label": buttonText,
|
|
1286
1257
|
"data-testid": "navigation-menu-trigger",
|
|
1287
|
-
children: /* @__PURE__ */
|
|
1258
|
+
children: /* @__PURE__ */ jsx10(SelectValue, { placeholder: buttonText })
|
|
1288
1259
|
}
|
|
1289
1260
|
),
|
|
1290
|
-
/* @__PURE__ */
|
|
1261
|
+
/* @__PURE__ */ jsx10(SelectContent, { children: filteredItems.map((item) => {
|
|
1291
1262
|
const isActive = isActiveItem(item);
|
|
1292
|
-
return /* @__PURE__ */
|
|
1263
|
+
return /* @__PURE__ */ jsx10(
|
|
1293
1264
|
SelectItem,
|
|
1294
1265
|
{
|
|
1295
1266
|
value: item.id,
|
|
@@ -1304,14 +1275,14 @@ var NavigationMenu = React9.forwardRef(({
|
|
|
1304
1275
|
}
|
|
1305
1276
|
);
|
|
1306
1277
|
}
|
|
1307
|
-
return /* @__PURE__ */
|
|
1278
|
+
return /* @__PURE__ */ jsx10(
|
|
1308
1279
|
"nav",
|
|
1309
1280
|
{
|
|
1310
1281
|
ref,
|
|
1311
1282
|
className,
|
|
1312
1283
|
"aria-label": navigationLabel,
|
|
1313
1284
|
...props,
|
|
1314
|
-
children: /* @__PURE__ */
|
|
1285
|
+
children: /* @__PURE__ */ jsx10("ul", { role: "menubar", children: filteredItems.map((item) => /* @__PURE__ */ jsx10(React8.Fragment, { children: renderHierarchicalItem(item, 0) }, item.id)) })
|
|
1315
1286
|
}
|
|
1316
1287
|
);
|
|
1317
1288
|
});
|
|
@@ -1319,7 +1290,7 @@ NavigationMenu.displayName = "NavigationMenu";
|
|
|
1319
1290
|
|
|
1320
1291
|
// src/components/Header/Header.tsx
|
|
1321
1292
|
import { Link } from "react-router-dom";
|
|
1322
|
-
import { jsx as
|
|
1293
|
+
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1323
1294
|
function Header({
|
|
1324
1295
|
logoUrl,
|
|
1325
1296
|
logoAlt = "Logo",
|
|
@@ -1337,32 +1308,32 @@ function Header({
|
|
|
1337
1308
|
onNavigate,
|
|
1338
1309
|
logoHref
|
|
1339
1310
|
}) {
|
|
1340
|
-
return /* @__PURE__ */
|
|
1311
|
+
return /* @__PURE__ */ jsx11("header", { className: cn(
|
|
1341
1312
|
"w-full border-b border-main-200 h-16 shadow-sm bg-main-100 ",
|
|
1342
1313
|
className
|
|
1343
1314
|
), role: "banner", children: /* @__PURE__ */ jsxs8("nav", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto grid grid-cols-[auto_auto_1fr_auto] gap-4 h-full items-center", children: [
|
|
1344
|
-
logo ? logoHref ? /* @__PURE__ */
|
|
1315
|
+
logo ? logoHref ? /* @__PURE__ */ jsx11(Link, { to: logoHref, className: "cursor-pointer hover:opacity-80 transition-opacity", children: logo }) : logo : logoUrl ? logoHref ? /* @__PURE__ */ jsx11(Link, { to: logoHref, className: "cursor-pointer hover:opacity-80 transition-opacity", children: /* @__PURE__ */ jsx11(
|
|
1345
1316
|
"img",
|
|
1346
1317
|
{
|
|
1347
1318
|
src: logoUrl,
|
|
1348
1319
|
alt: logoAlt || "Logo",
|
|
1349
1320
|
className: "h-[2.15rem] w-auto max-w-[200px] object-contain rounded-md shadow-md bg-transparent"
|
|
1350
1321
|
}
|
|
1351
|
-
) }) : /* @__PURE__ */
|
|
1322
|
+
) }) : /* @__PURE__ */ jsx11(
|
|
1352
1323
|
"img",
|
|
1353
1324
|
{
|
|
1354
1325
|
src: logoUrl,
|
|
1355
1326
|
alt: logoAlt || "Logo",
|
|
1356
1327
|
className: "h-[2.15rem] w-auto max-w-[200px] object-contain rounded-md shadow-md bg-transparent"
|
|
1357
1328
|
}
|
|
1358
|
-
) : logoHref ? /* @__PURE__ */
|
|
1329
|
+
) : logoHref ? /* @__PURE__ */ jsx11(Link, { to: logoHref, className: "cursor-pointer hover:opacity-80 transition-opacity", children: /* @__PURE__ */ jsx11(
|
|
1359
1330
|
"img",
|
|
1360
1331
|
{
|
|
1361
1332
|
src: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' fill='%23000'/%3E%3Ctext x='16' y='20' text-anchor='middle' fill='white' font-family='Arial' font-size='14' font-weight='bold'%3EL%3C/text%3E%3C/svg%3E",
|
|
1362
1333
|
alt: logoAlt || "Logo",
|
|
1363
1334
|
className: "h-8 w-8 shadow-md"
|
|
1364
1335
|
}
|
|
1365
|
-
) }) : /* @__PURE__ */
|
|
1336
|
+
) }) : /* @__PURE__ */ jsx11(
|
|
1366
1337
|
"img",
|
|
1367
1338
|
{
|
|
1368
1339
|
src: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' fill='%23000'/%3E%3Ctext x='16' y='20' text-anchor='middle' fill='white' font-family='Arial' font-size='14' font-weight='bold'%3EL%3C/text%3E%3C/svg%3E",
|
|
@@ -1370,7 +1341,7 @@ function Header({
|
|
|
1370
1341
|
className: "h-8 w-8 shadow-md"
|
|
1371
1342
|
}
|
|
1372
1343
|
),
|
|
1373
|
-
navItems && navItems.length > 0 && /* @__PURE__ */
|
|
1344
|
+
navItems && navItems.length > 0 && /* @__PURE__ */ jsx11(
|
|
1374
1345
|
NavigationMenu,
|
|
1375
1346
|
{
|
|
1376
1347
|
items: navItems,
|
|
@@ -1380,16 +1351,16 @@ function Header({
|
|
|
1380
1351
|
className: "w-48"
|
|
1381
1352
|
}
|
|
1382
1353
|
),
|
|
1383
|
-
showEventSelector ? /* @__PURE__ */
|
|
1354
|
+
showEventSelector ? /* @__PURE__ */ jsx11(
|
|
1384
1355
|
EventSelector,
|
|
1385
1356
|
{
|
|
1386
1357
|
placeholder: "Select event",
|
|
1387
1358
|
className: "justify-self-end w-96",
|
|
1388
1359
|
"data-testid": "event-selector"
|
|
1389
1360
|
}
|
|
1390
|
-
) : /* @__PURE__ */
|
|
1361
|
+
) : /* @__PURE__ */ jsx11("del", { className: "justify-self-end invisible", children: "Event Selector N/A" }),
|
|
1391
1362
|
actions,
|
|
1392
|
-
showUserMenu && (userMenu ? userMenu : /* @__PURE__ */
|
|
1363
|
+
showUserMenu && (userMenu ? userMenu : /* @__PURE__ */ jsx11(
|
|
1393
1364
|
UserMenu,
|
|
1394
1365
|
{
|
|
1395
1366
|
user: user || null,
|
|
@@ -1402,8 +1373,8 @@ function Header({
|
|
|
1402
1373
|
}
|
|
1403
1374
|
|
|
1404
1375
|
// src/components/Footer/Footer.tsx
|
|
1405
|
-
import
|
|
1406
|
-
import { Fragment as Fragment3, jsx as
|
|
1376
|
+
import React9 from "react";
|
|
1377
|
+
import { Fragment as Fragment3, jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1407
1378
|
var FooterComponent = ({
|
|
1408
1379
|
companyName = "Solvera Solutions Pty Ltd",
|
|
1409
1380
|
year = (/* @__PURE__ */ new Date()).getFullYear(),
|
|
@@ -1414,15 +1385,15 @@ var FooterComponent = ({
|
|
|
1414
1385
|
children
|
|
1415
1386
|
}) => {
|
|
1416
1387
|
const copyrightText = copyright || `\xA9 Copyright 2022\u2013${year} all rights reserved, ${companyName}.`;
|
|
1417
|
-
return /* @__PURE__ */
|
|
1418
|
-
logo && /* @__PURE__ */
|
|
1419
|
-
children && /* @__PURE__ */
|
|
1420
|
-
/* @__PURE__ */
|
|
1421
|
-
links && links.length > 0 && /* @__PURE__ */
|
|
1388
|
+
return /* @__PURE__ */ jsx12("footer", { className: cn("mt-8 py-6 flex justify-center border-t border-border bg-main-100", className), children: /* @__PURE__ */ jsxs9("section", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto text-center", children: [
|
|
1389
|
+
logo && /* @__PURE__ */ jsx12("img", { src: logo, alt: "Logo", className: "h-8 w-auto" }),
|
|
1390
|
+
children && /* @__PURE__ */ jsx12(Fragment3, { children }),
|
|
1391
|
+
/* @__PURE__ */ jsx12("span", { className: "text-muted-foreground", children: copyrightText }),
|
|
1392
|
+
links && links.length > 0 && /* @__PURE__ */ jsx12("ul", { className: "flex gap-4 mt-2 md:mt-0", children: links.map((link, index) => /* @__PURE__ */ jsx12("li", { children: /* @__PURE__ */ jsx12("a", { href: link.href, className: "text-muted-foreground hover:text-foreground", children: link.label }) }, index)) })
|
|
1422
1393
|
] }) });
|
|
1423
1394
|
};
|
|
1424
1395
|
FooterComponent.displayName = "Footer";
|
|
1425
|
-
var Footer =
|
|
1396
|
+
var Footer = React9.memo(FooterComponent);
|
|
1426
1397
|
Footer.displayName = "Footer";
|
|
1427
1398
|
|
|
1428
1399
|
// src/components/PaceAppLayout/PaceAppLayout.tsx
|
|
@@ -1430,7 +1401,7 @@ init_UnifiedAuthProvider2();
|
|
|
1430
1401
|
init_useOrganisations();
|
|
1431
1402
|
import { useState as useState5, useEffect as useEffect3, useMemo as useMemo5 } from "react";
|
|
1432
1403
|
import { Outlet, useNavigate, useLocation } from "react-router-dom";
|
|
1433
|
-
import { Fragment as Fragment4, jsx as
|
|
1404
|
+
import { Fragment as Fragment4, jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1434
1405
|
var EMPTY_PAGE_ID_MAPPING = {};
|
|
1435
1406
|
var EMPTY_ROUTE_PERMISSIONS = {};
|
|
1436
1407
|
function PaceAppLayout({
|
|
@@ -1528,16 +1499,6 @@ function PaceAppLayout({
|
|
|
1528
1499
|
if (isCheckingPermission) {
|
|
1529
1500
|
return;
|
|
1530
1501
|
}
|
|
1531
|
-
if (auditLog) {
|
|
1532
|
-
console.log(`[PaceAppLayout] Page access attempt:`, {
|
|
1533
|
-
pageName: currentPageId,
|
|
1534
|
-
operation: currentRoutePermission,
|
|
1535
|
-
userId: user?.id,
|
|
1536
|
-
allowed: can,
|
|
1537
|
-
strictMode,
|
|
1538
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1539
|
-
});
|
|
1540
|
-
}
|
|
1541
1502
|
if (strictMode && !can) {
|
|
1542
1503
|
console.error(`[PaceAppLayout] STRICT MODE VIOLATION: User attempted to access protected page without permission`, {
|
|
1543
1504
|
pageName: currentPageId,
|
|
@@ -1605,15 +1566,6 @@ function PaceAppLayout({
|
|
|
1605
1566
|
const permission = routePermissions[item.href] || defaultPermission;
|
|
1606
1567
|
const fullPermission = permission.includes(":") ? permission : pageId ? `${permission}:page.${pageId}` : permission;
|
|
1607
1568
|
const hasAccess = permissionMap["*"] === true || permissionMap[fullPermission] === true;
|
|
1608
|
-
if (auditLog) {
|
|
1609
|
-
console.log(`[PaceAppLayout] Navigation filtering:`, {
|
|
1610
|
-
item: item.label,
|
|
1611
|
-
href: item.href,
|
|
1612
|
-
pageId,
|
|
1613
|
-
permission: fullPermission,
|
|
1614
|
-
hasAccess
|
|
1615
|
-
});
|
|
1616
|
-
}
|
|
1617
1569
|
return { item, hasAccess };
|
|
1618
1570
|
});
|
|
1619
1571
|
if (!isMounted) return;
|
|
@@ -1669,7 +1621,7 @@ function PaceAppLayout({
|
|
|
1669
1621
|
}
|
|
1670
1622
|
}
|
|
1671
1623
|
if (hasAccess && currentRoute.roles && currentRoute.roles.length > 0 && user?.id) {
|
|
1672
|
-
const { useUnifiedAuth: useUnifiedAuth2 } = await import("./UnifiedAuthProvider-
|
|
1624
|
+
const { useUnifiedAuth: useUnifiedAuth2 } = await import("./UnifiedAuthProvider-CQDZRJIS.js");
|
|
1673
1625
|
hasAccess = true;
|
|
1674
1626
|
}
|
|
1675
1627
|
if (!isMounted) return;
|
|
@@ -1693,17 +1645,6 @@ function PaceAppLayout({
|
|
|
1693
1645
|
navigate(fallbackRoute, { replace: true });
|
|
1694
1646
|
return;
|
|
1695
1647
|
}
|
|
1696
|
-
if (auditLog) {
|
|
1697
|
-
console.log(`[PaceAppLayout] Route access attempt:`, {
|
|
1698
|
-
route: currentPath,
|
|
1699
|
-
userId: user?.id,
|
|
1700
|
-
allowed: hasAccess,
|
|
1701
|
-
permissions: currentRoute.permissions,
|
|
1702
|
-
roles: currentRoute.roles,
|
|
1703
|
-
accessLevel: currentRoute.accessLevel,
|
|
1704
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1705
|
-
});
|
|
1706
|
-
}
|
|
1707
1648
|
};
|
|
1708
1649
|
checkRouteAccess();
|
|
1709
1650
|
return () => {
|
|
@@ -1721,31 +1662,31 @@ function PaceAppLayout({
|
|
|
1721
1662
|
return result || { error: null };
|
|
1722
1663
|
};
|
|
1723
1664
|
if (enforcePermissions && isCheckingPermission) {
|
|
1724
|
-
return /* @__PURE__ */
|
|
1725
|
-
/* @__PURE__ */
|
|
1726
|
-
/* @__PURE__ */
|
|
1665
|
+
return /* @__PURE__ */ jsx13("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsxs10("div", { className: "text-center", children: [
|
|
1666
|
+
/* @__PURE__ */ jsx13("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-sec-900 mx-auto mb-4" }),
|
|
1667
|
+
/* @__PURE__ */ jsx13("p", { className: "text-sec-600", children: "Checking permissions..." })
|
|
1727
1668
|
] }) });
|
|
1728
1669
|
}
|
|
1729
1670
|
if (enforcePermissions && permissionError) {
|
|
1730
|
-
return /* @__PURE__ */
|
|
1731
|
-
/* @__PURE__ */
|
|
1732
|
-
/* @__PURE__ */
|
|
1733
|
-
/* @__PURE__ */
|
|
1671
|
+
return /* @__PURE__ */ jsx13("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsxs10("div", { className: "text-center", children: [
|
|
1672
|
+
/* @__PURE__ */ jsx13("h2", { className: "text-xl font-semibold text-acc-600 mb-2", children: "Permission Error" }),
|
|
1673
|
+
/* @__PURE__ */ jsx13("p", { className: "text-sec-600 mb-4", children: permissionError.message }),
|
|
1674
|
+
/* @__PURE__ */ jsx13(Button, { onClick: () => navigate("/"), children: "Go Home" })
|
|
1734
1675
|
] }) });
|
|
1735
1676
|
}
|
|
1736
1677
|
if (enforcePermissions && hasPermission === false) {
|
|
1737
1678
|
if (enforcePagePermissions && pagePermissionFallback) {
|
|
1738
|
-
return /* @__PURE__ */
|
|
1679
|
+
return /* @__PURE__ */ jsx13(Fragment4, { children: pagePermissionFallback });
|
|
1739
1680
|
}
|
|
1740
1681
|
if (permissionFallback) {
|
|
1741
|
-
return /* @__PURE__ */
|
|
1682
|
+
return /* @__PURE__ */ jsx13(Fragment4, { children: permissionFallback });
|
|
1742
1683
|
}
|
|
1743
|
-
return /* @__PURE__ */
|
|
1744
|
-
/* @__PURE__ */
|
|
1745
|
-
/* @__PURE__ */
|
|
1684
|
+
return /* @__PURE__ */ jsx13("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsxs10("div", { className: "text-center", children: [
|
|
1685
|
+
/* @__PURE__ */ jsx13("h2", { className: "text-xl font-semibold text-acc-600 mb-2", children: "Access Denied" }),
|
|
1686
|
+
/* @__PURE__ */ jsx13("p", { className: "text-sec-600 mb-4", children: "You don't have permission to access this page." }),
|
|
1746
1687
|
/* @__PURE__ */ jsxs10("div", { className: "flex gap-2 justify-center", children: [
|
|
1747
|
-
/* @__PURE__ */
|
|
1748
|
-
/* @__PURE__ */
|
|
1688
|
+
/* @__PURE__ */ jsx13(Button, { onClick: () => navigate("/"), children: "Go Home" }),
|
|
1689
|
+
/* @__PURE__ */ jsx13(
|
|
1749
1690
|
Button,
|
|
1750
1691
|
{
|
|
1751
1692
|
variant: "outline",
|
|
@@ -1760,7 +1701,7 @@ function PaceAppLayout({
|
|
|
1760
1701
|
] }) });
|
|
1761
1702
|
}
|
|
1762
1703
|
return /* @__PURE__ */ jsxs10(Fragment4, { children: [
|
|
1763
|
-
/* @__PURE__ */
|
|
1704
|
+
/* @__PURE__ */ jsx13(
|
|
1764
1705
|
Header,
|
|
1765
1706
|
{
|
|
1766
1707
|
logo: customLogo || void 0,
|
|
@@ -1784,8 +1725,8 @@ function PaceAppLayout({
|
|
|
1784
1725
|
className: headerClassName || "sticky top-0 z-[40] w-full"
|
|
1785
1726
|
}
|
|
1786
1727
|
),
|
|
1787
|
-
/* @__PURE__ */
|
|
1788
|
-
/* @__PURE__ */
|
|
1728
|
+
/* @__PURE__ */ jsx13("main", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children: /* @__PURE__ */ jsx13(Outlet, {}) }),
|
|
1729
|
+
/* @__PURE__ */ jsx13(Footer, {})
|
|
1789
1730
|
] });
|
|
1790
1731
|
}
|
|
1791
1732
|
|
|
@@ -1793,7 +1734,7 @@ function PaceAppLayout({
|
|
|
1793
1734
|
import { useEffect as useEffect4, useState as useState6, useContext } from "react";
|
|
1794
1735
|
import { useNavigate as useNavigate2, useLocation as useLocation2 } from "react-router-dom";
|
|
1795
1736
|
init_EventServiceProvider();
|
|
1796
|
-
import { jsx as
|
|
1737
|
+
import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1797
1738
|
var PaceLoginPage = ({
|
|
1798
1739
|
appName = "Pace",
|
|
1799
1740
|
onSuccessRedirectPath = "/",
|
|
@@ -1925,7 +1866,7 @@ var PaceLoginPage = ({
|
|
|
1925
1866
|
}
|
|
1926
1867
|
};
|
|
1927
1868
|
return /* @__PURE__ */ jsxs11("main", { className: "min-h-screen grid mx-auto w-fit content-center justify-items-center gap-y-8", "aria-label": `${appName} Login Page`, children: [
|
|
1928
|
-
/* @__PURE__ */
|
|
1869
|
+
/* @__PURE__ */ jsx14(
|
|
1929
1870
|
"img",
|
|
1930
1871
|
{
|
|
1931
1872
|
src: `/${appName.toLowerCase()}_logo_square.svg`,
|
|
@@ -1933,7 +1874,7 @@ var PaceLoginPage = ({
|
|
|
1933
1874
|
className: "h-48"
|
|
1934
1875
|
}
|
|
1935
1876
|
),
|
|
1936
|
-
/* @__PURE__ */
|
|
1877
|
+
/* @__PURE__ */ jsx14(
|
|
1937
1878
|
LoginForm,
|
|
1938
1879
|
{
|
|
1939
1880
|
className: "w-md",
|
|
@@ -1947,15 +1888,15 @@ var PaceLoginPage = ({
|
|
|
1947
1888
|
),
|
|
1948
1889
|
(() => {
|
|
1949
1890
|
const benign = !!(authError && (authError.name === "AuthSessionMissingError" || /Auth session missing/i.test(authError.message)));
|
|
1950
|
-
return authError && !benign ? /* @__PURE__ */
|
|
1891
|
+
return authError && !benign ? /* @__PURE__ */ jsx14("em", { className: "mt-4 text-destructive text-center", children: authError.message }) : null;
|
|
1951
1892
|
})(),
|
|
1952
|
-
accessError && /* @__PURE__ */
|
|
1953
|
-
isCheckingAccess && /* @__PURE__ */
|
|
1893
|
+
accessError && /* @__PURE__ */ jsx14("em", { className: "mt-4 text-destructive text-center", children: accessError }),
|
|
1894
|
+
isCheckingAccess && /* @__PURE__ */ jsx14("em", { className: "mt-4 text-muted-foreground text-center", children: "Checking permissions..." })
|
|
1954
1895
|
] });
|
|
1955
1896
|
};
|
|
1956
1897
|
|
|
1957
1898
|
// src/components/SessionRestorationLoader.tsx
|
|
1958
|
-
import { jsx as
|
|
1899
|
+
import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1959
1900
|
var SessionRestorationLoader = ({
|
|
1960
1901
|
message = "Restoring session..."
|
|
1961
1902
|
}) => {
|
|
@@ -1975,8 +1916,8 @@ var SessionRestorationLoader = ({
|
|
|
1975
1916
|
background: "var(--background, transparent)"
|
|
1976
1917
|
},
|
|
1977
1918
|
children: [
|
|
1978
|
-
/* @__PURE__ */
|
|
1979
|
-
/* @__PURE__ */
|
|
1919
|
+
/* @__PURE__ */ jsx15(LoadingSpinner, { size: "lg" }),
|
|
1920
|
+
/* @__PURE__ */ jsx15(
|
|
1980
1921
|
"div",
|
|
1981
1922
|
{
|
|
1982
1923
|
style: {
|
|
@@ -1996,7 +1937,7 @@ init_UnifiedAuthProvider();
|
|
|
1996
1937
|
init_useSessionRestoration();
|
|
1997
1938
|
import { useMemo as useMemo6 } from "react";
|
|
1998
1939
|
import { Navigate, Outlet as Outlet2 } from "react-router-dom";
|
|
1999
|
-
import { jsx as
|
|
1940
|
+
import { jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2000
1941
|
function ProtectedRoute({
|
|
2001
1942
|
requireEvent = true,
|
|
2002
1943
|
allowSuperAdminBypass = false,
|
|
@@ -2016,13 +1957,13 @@ function ProtectedRoute({
|
|
|
2016
1957
|
sessionRestoration.hasTimedOut
|
|
2017
1958
|
]);
|
|
2018
1959
|
if (isRestoringSession) {
|
|
2019
|
-
return /* @__PURE__ */
|
|
1960
|
+
return /* @__PURE__ */ jsx16(SessionRestorationLoader, {});
|
|
2020
1961
|
}
|
|
2021
1962
|
if (requireEvent && eventLoading) {
|
|
2022
|
-
return /* @__PURE__ */
|
|
1963
|
+
return /* @__PURE__ */ jsx16(Outlet2, {});
|
|
2023
1964
|
}
|
|
2024
1965
|
if (authLoading && !sessionRestoration.hasTimedOut) {
|
|
2025
|
-
return loadingFallback || /* @__PURE__ */
|
|
1966
|
+
return loadingFallback || /* @__PURE__ */ jsx16("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: "100vh" }, children: /* @__PURE__ */ jsx16(LoadingSpinner, {}) });
|
|
2026
1967
|
}
|
|
2027
1968
|
if (!isAuthenticated) {
|
|
2028
1969
|
if (sessionRestoration.hasTimedOut || sessionRestoration.restorationError) {
|
|
@@ -2031,27 +1972,27 @@ function ProtectedRoute({
|
|
|
2031
1972
|
error: sessionRestoration.restorationError?.message
|
|
2032
1973
|
});
|
|
2033
1974
|
}
|
|
2034
|
-
return /* @__PURE__ */
|
|
1975
|
+
return /* @__PURE__ */ jsx16(Navigate, { to: loginPath, replace: true });
|
|
2035
1976
|
}
|
|
2036
1977
|
if (!requireEvent) {
|
|
2037
|
-
return /* @__PURE__ */
|
|
1978
|
+
return /* @__PURE__ */ jsx16(Outlet2, {});
|
|
2038
1979
|
}
|
|
2039
1980
|
if (!events || events.length === 0) {
|
|
2040
|
-
return noEventsFallback || /* @__PURE__ */
|
|
2041
|
-
/* @__PURE__ */
|
|
2042
|
-
/* @__PURE__ */
|
|
1981
|
+
return noEventsFallback || /* @__PURE__ */ jsx16("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "100vh", padding: "2rem" }, children: /* @__PURE__ */ jsxs13(Alert, { variant: "destructive", className: "max-w-md", children: [
|
|
1982
|
+
/* @__PURE__ */ jsx16(AlertTitle, { children: "No Events Available" }),
|
|
1983
|
+
/* @__PURE__ */ jsx16(AlertDescription, { children: "You don't have access to any events. Please contact your administrator if you believe this is an error." })
|
|
2043
1984
|
] }) });
|
|
2044
1985
|
}
|
|
2045
1986
|
if (!selectedEvent) {
|
|
2046
1987
|
console.debug("[ProtectedRoute] Events available but none selected - allowing render so selector is visible");
|
|
2047
|
-
return /* @__PURE__ */
|
|
1988
|
+
return /* @__PURE__ */ jsx16(Outlet2, {});
|
|
2048
1989
|
}
|
|
2049
|
-
return /* @__PURE__ */
|
|
1990
|
+
return /* @__PURE__ */ jsx16(Outlet2, {});
|
|
2050
1991
|
}
|
|
2051
1992
|
|
|
2052
1993
|
// src/components/ErrorBoundary/ErrorBoundary.tsx
|
|
2053
1994
|
import { Component } from "react";
|
|
2054
|
-
import { jsx as
|
|
1995
|
+
import { jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2055
1996
|
var ErrorBoundary = class extends Component {
|
|
2056
1997
|
constructor(props) {
|
|
2057
1998
|
super(props);
|
|
@@ -2124,20 +2065,20 @@ var ErrorBoundary = class extends Component {
|
|
|
2124
2065
|
if (fallback) {
|
|
2125
2066
|
return fallback;
|
|
2126
2067
|
}
|
|
2127
|
-
return /* @__PURE__ */
|
|
2068
|
+
return /* @__PURE__ */ jsx17(
|
|
2128
2069
|
"div",
|
|
2129
2070
|
{
|
|
2130
2071
|
role: "alert",
|
|
2131
2072
|
className: "p-6 bg-destructive/10 border border-destructive/20 rounded-lg",
|
|
2132
2073
|
"data-error-boundary": errorId,
|
|
2133
2074
|
children: /* @__PURE__ */ jsxs14("div", { className: "flex items-start gap-3", children: [
|
|
2134
|
-
/* @__PURE__ */
|
|
2075
|
+
/* @__PURE__ */ jsx17("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx17("svg", { className: "w-5 h-5 text-destructive", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx17("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z", clipRule: "evenodd" }) }) }),
|
|
2135
2076
|
/* @__PURE__ */ jsxs14("div", { className: "flex-1 min-w-0", children: [
|
|
2136
2077
|
/* @__PURE__ */ jsxs14("h3", { className: "text-destructive", children: [
|
|
2137
2078
|
"Error in ",
|
|
2138
2079
|
componentName
|
|
2139
2080
|
] }),
|
|
2140
|
-
/* @__PURE__ */
|
|
2081
|
+
/* @__PURE__ */ jsx17("p", { className: "text-destructive/80", children: this.state.error?.message || "An unexpected error occurred." }),
|
|
2141
2082
|
enableRetry && retryCount < maxRetries && /* @__PURE__ */ jsxs14("div", { className: "flex gap-3 mb-4", children: [
|
|
2142
2083
|
/* @__PURE__ */ jsxs14(
|
|
2143
2084
|
"button",
|
|
@@ -2153,7 +2094,7 @@ var ErrorBoundary = class extends Component {
|
|
|
2153
2094
|
]
|
|
2154
2095
|
}
|
|
2155
2096
|
),
|
|
2156
|
-
/* @__PURE__ */
|
|
2097
|
+
/* @__PURE__ */ jsx17(
|
|
2157
2098
|
"button",
|
|
2158
2099
|
{
|
|
2159
2100
|
onClick: () => window.location.reload(),
|
|
@@ -2163,8 +2104,8 @@ var ErrorBoundary = class extends Component {
|
|
|
2163
2104
|
)
|
|
2164
2105
|
] }),
|
|
2165
2106
|
retryCount >= maxRetries && /* @__PURE__ */ jsxs14("div", { className: "mb-4 p-3 bg-acc-50 border border-acc-200 rounded-md", children: [
|
|
2166
|
-
/* @__PURE__ */
|
|
2167
|
-
/* @__PURE__ */
|
|
2107
|
+
/* @__PURE__ */ jsx17("p", { className: "text-acc-800", children: "Maximum retry attempts reached. Please reload the page or contact support." }),
|
|
2108
|
+
/* @__PURE__ */ jsx17(
|
|
2168
2109
|
"button",
|
|
2169
2110
|
{
|
|
2170
2111
|
onClick: () => window.location.reload(),
|
|
@@ -2174,7 +2115,7 @@ var ErrorBoundary = class extends Component {
|
|
|
2174
2115
|
)
|
|
2175
2116
|
] }),
|
|
2176
2117
|
import.meta.env.MODE === "development" && this.state.error && /* @__PURE__ */ jsxs14("details", { className: "text-sm text-destructive/70", children: [
|
|
2177
|
-
/* @__PURE__ */
|
|
2118
|
+
/* @__PURE__ */ jsx17("summary", { className: "cursor-pointer font-medium mb-2", children: "Error Details (Development)" }),
|
|
2178
2119
|
/* @__PURE__ */ jsxs14("div", { className: "bg-destructive/5 p-3 rounded border", children: [
|
|
2179
2120
|
/* @__PURE__ */ jsxs14("p", { className: "font-mono", children: [
|
|
2180
2121
|
"Error ID: ",
|
|
@@ -2199,7 +2140,7 @@ var ErrorBoundary = class extends Component {
|
|
|
2199
2140
|
import { useState as useState7, useCallback as useCallback4 } from "react";
|
|
2200
2141
|
init_OrganisationProvider();
|
|
2201
2142
|
import { RefreshCw as RefreshCw2, AlertCircle as AlertCircle2, Building2, Shield } from "lucide-react";
|
|
2202
|
-
import { jsx as
|
|
2143
|
+
import { jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2203
2144
|
function OrganisationSelector({
|
|
2204
2145
|
placeholder = "Select organisation",
|
|
2205
2146
|
className,
|
|
@@ -2264,14 +2205,14 @@ function OrganisationSelector({
|
|
|
2264
2205
|
}, [refreshOrganisations]);
|
|
2265
2206
|
if (orgLoading) {
|
|
2266
2207
|
return /* @__PURE__ */ jsxs15("div", { className: `flex items-center gap-2 ${className}`, children: [
|
|
2267
|
-
/* @__PURE__ */
|
|
2268
|
-
/* @__PURE__ */
|
|
2208
|
+
/* @__PURE__ */ jsx18(LoadingSpinner, { size: "sm" }),
|
|
2209
|
+
/* @__PURE__ */ jsx18("span", { className: "text-sm text-muted-foreground", children: compact ? "Loading..." : "Loading organisations..." })
|
|
2269
2210
|
] });
|
|
2270
2211
|
}
|
|
2271
2212
|
if (orgError) {
|
|
2272
2213
|
return /* @__PURE__ */ jsxs15("div", { className: `space-y-2 ${className}`, children: [
|
|
2273
2214
|
/* @__PURE__ */ jsxs15(Alert, { variant: "destructive", children: [
|
|
2274
|
-
/* @__PURE__ */
|
|
2215
|
+
/* @__PURE__ */ jsx18(AlertCircle2, { className: "h-4 w-4" }),
|
|
2275
2216
|
/* @__PURE__ */ jsxs15(AlertDescription, { children: [
|
|
2276
2217
|
"Failed to load organisations: ",
|
|
2277
2218
|
orgError.message
|
|
@@ -2286,7 +2227,7 @@ function OrganisationSelector({
|
|
|
2286
2227
|
disabled: isLoading,
|
|
2287
2228
|
className: "w-full",
|
|
2288
2229
|
children: [
|
|
2289
|
-
/* @__PURE__ */
|
|
2230
|
+
/* @__PURE__ */ jsx18(RefreshCw2, { className: `h-4 w-4 mr-2 ${isLoading ? "animate-spin" : ""}` }),
|
|
2290
2231
|
"Retry"
|
|
2291
2232
|
]
|
|
2292
2233
|
}
|
|
@@ -2297,8 +2238,8 @@ function OrganisationSelector({
|
|
|
2297
2238
|
if (showNoOrganisationsMessage) {
|
|
2298
2239
|
return /* @__PURE__ */ jsxs15("div", { className: `space-y-2 ${className}`, children: [
|
|
2299
2240
|
/* @__PURE__ */ jsxs15(Alert, { children: [
|
|
2300
|
-
/* @__PURE__ */
|
|
2301
|
-
/* @__PURE__ */
|
|
2241
|
+
/* @__PURE__ */ jsx18(Building2, { className: "h-4 w-4" }),
|
|
2242
|
+
/* @__PURE__ */ jsx18(AlertDescription, { children: "No organisations available. Please contact your administrator to be added to an organisation." })
|
|
2302
2243
|
] }),
|
|
2303
2244
|
showRetryButton && /* @__PURE__ */ jsxs15(
|
|
2304
2245
|
Button,
|
|
@@ -2309,7 +2250,7 @@ function OrganisationSelector({
|
|
|
2309
2250
|
disabled: isLoading,
|
|
2310
2251
|
className: "w-full",
|
|
2311
2252
|
children: [
|
|
2312
|
-
/* @__PURE__ */
|
|
2253
|
+
/* @__PURE__ */ jsx18(RefreshCw2, { className: `h-4 w-4 mr-2 ${isLoading ? "animate-spin" : ""}` }),
|
|
2313
2254
|
"Check Again"
|
|
2314
2255
|
]
|
|
2315
2256
|
}
|
|
@@ -2319,8 +2260,8 @@ function OrganisationSelector({
|
|
|
2319
2260
|
return null;
|
|
2320
2261
|
}
|
|
2321
2262
|
const switchErrorDisplay = switchError && /* @__PURE__ */ jsxs15(Alert, { variant: "destructive", className: "mt-2", children: [
|
|
2322
|
-
/* @__PURE__ */
|
|
2323
|
-
/* @__PURE__ */
|
|
2263
|
+
/* @__PURE__ */ jsx18(AlertCircle2, { className: "h-4 w-4" }),
|
|
2264
|
+
/* @__PURE__ */ jsx18(AlertDescription, { children: switchError })
|
|
2324
2265
|
] });
|
|
2325
2266
|
return /* @__PURE__ */ jsxs15("div", { className: `space-y-2 ${className}`, children: [
|
|
2326
2267
|
/* @__PURE__ */ jsxs15(
|
|
@@ -2330,14 +2271,14 @@ function OrganisationSelector({
|
|
|
2330
2271
|
onValueChange: handleOrganisationChange,
|
|
2331
2272
|
disabled: disabled || isLoading || !selectedOrganisation,
|
|
2332
2273
|
children: [
|
|
2333
|
-
/* @__PURE__ */
|
|
2334
|
-
isLoading ? /* @__PURE__ */
|
|
2335
|
-
/* @__PURE__ */
|
|
2274
|
+
/* @__PURE__ */ jsx18(SelectTrigger, { className: `${isLoading ? "opacity-50" : ""}`, children: /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2", children: [
|
|
2275
|
+
isLoading ? /* @__PURE__ */ jsx18(LoadingSpinner, { size: "sm" }) : /* @__PURE__ */ jsx18(Building2, { className: "h-4 w-4 text-muted-foreground" }),
|
|
2276
|
+
/* @__PURE__ */ jsx18(SelectValue, { placeholder })
|
|
2336
2277
|
] }) }),
|
|
2337
|
-
/* @__PURE__ */
|
|
2278
|
+
/* @__PURE__ */ jsx18(SelectContent, { children: organisations.map((org) => {
|
|
2338
2279
|
const userRole = getUserRole(org.id);
|
|
2339
2280
|
const hasAccess = validateOrganisationAccess(org.id);
|
|
2340
|
-
return /* @__PURE__ */
|
|
2281
|
+
return /* @__PURE__ */ jsx18(
|
|
2341
2282
|
SelectItem,
|
|
2342
2283
|
{
|
|
2343
2284
|
value: org.id,
|
|
@@ -2345,15 +2286,15 @@ function OrganisationSelector({
|
|
|
2345
2286
|
className: !hasAccess ? "opacity-50" : "",
|
|
2346
2287
|
children: /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between w-full", children: [
|
|
2347
2288
|
/* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2", children: [
|
|
2348
|
-
/* @__PURE__ */
|
|
2289
|
+
/* @__PURE__ */ jsx18(Building2, { className: "h-4 w-4" }),
|
|
2349
2290
|
/* @__PURE__ */ jsxs15("div", { className: "flex flex-col", children: [
|
|
2350
|
-
/* @__PURE__ */
|
|
2351
|
-
!compact && org.description && /* @__PURE__ */
|
|
2291
|
+
/* @__PURE__ */ jsx18("span", { className: "font-medium", children: org.display_name }),
|
|
2292
|
+
!compact && org.description && /* @__PURE__ */ jsx18("span", { className: "text-xs text-muted-foreground truncate max-w-40", children: org.description })
|
|
2352
2293
|
] })
|
|
2353
2294
|
] }),
|
|
2354
2295
|
showRole && /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-1 ml-4", children: [
|
|
2355
|
-
/* @__PURE__ */
|
|
2356
|
-
/* @__PURE__ */
|
|
2296
|
+
/* @__PURE__ */ jsx18(Shield, { className: "h-3 w-3 text-muted-foreground" }),
|
|
2297
|
+
/* @__PURE__ */ jsx18("span", { className: "text-xs text-muted-foreground capitalize", children: userRole?.replace("_", " ") || "No Role" })
|
|
2357
2298
|
] })
|
|
2358
2299
|
] })
|
|
2359
2300
|
},
|
|
@@ -2370,7 +2311,7 @@ function OrganisationSelector({
|
|
|
2370
2311
|
// src/components/PasswordReset/PasswordResetForm.tsx
|
|
2371
2312
|
import { useState as useState8 } from "react";
|
|
2372
2313
|
init_UnifiedAuthProvider2();
|
|
2373
|
-
import { jsx as
|
|
2314
|
+
import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2374
2315
|
function PasswordResetForm({
|
|
2375
2316
|
onSuccess,
|
|
2376
2317
|
onError,
|
|
@@ -2411,13 +2352,13 @@ function PasswordResetForm({
|
|
|
2411
2352
|
setError(null);
|
|
2412
2353
|
};
|
|
2413
2354
|
if (isSuccess) {
|
|
2414
|
-
return /* @__PURE__ */
|
|
2415
|
-
/* @__PURE__ */
|
|
2355
|
+
return /* @__PURE__ */ jsx19("div", { className: cn("", className), role: "form", children: /* @__PURE__ */ jsxs16("div", { className: "space-y-4 text-center", children: [
|
|
2356
|
+
/* @__PURE__ */ jsx19("h2", { children: "Check your email" }),
|
|
2416
2357
|
/* @__PURE__ */ jsxs16("p", { className: "text-sec-600", children: [
|
|
2417
2358
|
"We have sent a password reset link to ",
|
|
2418
2359
|
email
|
|
2419
2360
|
] }),
|
|
2420
|
-
/* @__PURE__ */
|
|
2361
|
+
/* @__PURE__ */ jsx19(
|
|
2421
2362
|
Button,
|
|
2422
2363
|
{
|
|
2423
2364
|
variant: "outline",
|
|
@@ -2428,15 +2369,15 @@ function PasswordResetForm({
|
|
|
2428
2369
|
)
|
|
2429
2370
|
] }) });
|
|
2430
2371
|
}
|
|
2431
|
-
return /* @__PURE__ */
|
|
2372
|
+
return /* @__PURE__ */ jsx19("div", { className: cn("", className), role: "form", children: /* @__PURE__ */ jsxs16("div", { className: "space-y-4", children: [
|
|
2432
2373
|
/* @__PURE__ */ jsxs16("div", { className: "space-y-2", children: [
|
|
2433
|
-
/* @__PURE__ */
|
|
2434
|
-
/* @__PURE__ */
|
|
2374
|
+
/* @__PURE__ */ jsx19("h2", { children: "Reset Password" }),
|
|
2375
|
+
/* @__PURE__ */ jsx19("p", { className: "text-sec-600", children: "Enter your email address and we'll send you a reset link." })
|
|
2435
2376
|
] }),
|
|
2436
2377
|
/* @__PURE__ */ jsxs16("form", { onSubmit: handleSubmit, className: "space-y-4", children: [
|
|
2437
2378
|
/* @__PURE__ */ jsxs16("div", { className: "space-y-2", children: [
|
|
2438
|
-
/* @__PURE__ */
|
|
2439
|
-
/* @__PURE__ */
|
|
2379
|
+
/* @__PURE__ */ jsx19(Label, { htmlFor: "email", children: "Email Address" }),
|
|
2380
|
+
/* @__PURE__ */ jsx19(
|
|
2440
2381
|
Input,
|
|
2441
2382
|
{
|
|
2442
2383
|
id: "email",
|
|
@@ -2449,8 +2390,8 @@ function PasswordResetForm({
|
|
|
2449
2390
|
}
|
|
2450
2391
|
)
|
|
2451
2392
|
] }),
|
|
2452
|
-
error && /* @__PURE__ */
|
|
2453
|
-
/* @__PURE__ */
|
|
2393
|
+
error && /* @__PURE__ */ jsx19("div", { className: "text-sm text-destructive", role: "alert", children: error }),
|
|
2394
|
+
/* @__PURE__ */ jsx19(
|
|
2454
2395
|
Button,
|
|
2455
2396
|
{
|
|
2456
2397
|
type: "submit",
|
|
@@ -2843,7 +2784,7 @@ var CachedAppIdResolver = class {
|
|
|
2843
2784
|
var cachedAppIdResolver = new CachedAppIdResolver();
|
|
2844
2785
|
|
|
2845
2786
|
// src/components/FileUpload/FileUpload.tsx
|
|
2846
|
-
import { Fragment as Fragment5, jsx as
|
|
2787
|
+
import { Fragment as Fragment5, jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2847
2788
|
function FileUpload({
|
|
2848
2789
|
supabase,
|
|
2849
2790
|
table_name,
|
|
@@ -3176,7 +3117,7 @@ function FileUpload({
|
|
|
3176
3117
|
onClick: !isDisabled ? handleClick : void 0,
|
|
3177
3118
|
children: [
|
|
3178
3119
|
children || /* @__PURE__ */ jsxs17("div", { className: "space-y-2", children: [
|
|
3179
|
-
/* @__PURE__ */
|
|
3120
|
+
/* @__PURE__ */ jsx20(
|
|
3180
3121
|
"input",
|
|
3181
3122
|
{
|
|
3182
3123
|
ref: fileInputRef,
|
|
@@ -3189,8 +3130,8 @@ function FileUpload({
|
|
|
3189
3130
|
"data-testid": "file-input"
|
|
3190
3131
|
}
|
|
3191
3132
|
),
|
|
3192
|
-
/* @__PURE__ */
|
|
3193
|
-
/* @__PURE__ */
|
|
3133
|
+
/* @__PURE__ */ jsx20("div", { className: "text-sec-600", children: isResolvingAppId ? "Resolving app configuration..." : isDragging ? "Drop files here..." : /* @__PURE__ */ jsxs17(Fragment5, { children: [
|
|
3134
|
+
/* @__PURE__ */ jsx20("span", { className: "font-medium", children: "Click to upload" }),
|
|
3194
3135
|
" ",
|
|
3195
3136
|
"or drag and drop"
|
|
3196
3137
|
] }) }),
|
|
@@ -3200,11 +3141,11 @@ function FileUpload({
|
|
|
3200
3141
|
!isResolvingAppId && multiple && " \u2022 Multiple files allowed"
|
|
3201
3142
|
] })
|
|
3202
3143
|
] }),
|
|
3203
|
-
isUploading && !showProgress && /* @__PURE__ */
|
|
3144
|
+
isUploading && !showProgress && /* @__PURE__ */ jsx20("div", { className: "absolute inset-0 bg-white bg-opacity-75 flex items-center justify-center", children: /* @__PURE__ */ jsx20("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-main-500" }) })
|
|
3204
3145
|
]
|
|
3205
3146
|
}
|
|
3206
3147
|
),
|
|
3207
|
-
showProgress && uploadStates.size > 0 && /* @__PURE__ */
|
|
3148
|
+
showProgress && uploadStates.size > 0 && /* @__PURE__ */ jsx20("div", { className: "space-y-2", children: Array.from(uploadStates.entries()).map(([fileId, uploadState]) => {
|
|
3208
3149
|
const { file, progress, preview, result } = uploadState;
|
|
3209
3150
|
const isError = progress.status === "error";
|
|
3210
3151
|
const isCompleted = progress.status === "completed";
|
|
@@ -3214,23 +3155,23 @@ function FileUpload({
|
|
|
3214
3155
|
{
|
|
3215
3156
|
className: `flex items-center space-x-3 p-3 rounded-lg border ${isError ? "bg-acc-50 border-acc-200" : isCompleted ? "bg-success-50 border-success-200" : "bg-sec-50 border-sec-200"}`,
|
|
3216
3157
|
children: [
|
|
3217
|
-
/* @__PURE__ */
|
|
3158
|
+
/* @__PURE__ */ jsx20("div", { className: "flex-shrink-0", children: preview ? /* @__PURE__ */ jsx20(
|
|
3218
3159
|
"img",
|
|
3219
3160
|
{
|
|
3220
3161
|
src: preview,
|
|
3221
3162
|
alt: file.name,
|
|
3222
3163
|
className: "w-12 h-12 object-cover rounded"
|
|
3223
3164
|
}
|
|
3224
|
-
) : /* @__PURE__ */
|
|
3165
|
+
) : /* @__PURE__ */ jsx20("div", { className: "w-12 h-12 flex items-center justify-center bg-sec-200 rounded", children: /* @__PURE__ */ jsx20("span", { className: "text-2xl", children: "\u{1F4C4}" }) }) }),
|
|
3225
3166
|
/* @__PURE__ */ jsxs17("div", { className: "flex-1 min-w-0", children: [
|
|
3226
|
-
/* @__PURE__ */
|
|
3167
|
+
/* @__PURE__ */ jsx20("div", { className: "font-medium text-sec-900 truncate", children: file.name }),
|
|
3227
3168
|
/* @__PURE__ */ jsxs17("div", { className: "text-sm text-sec-500", children: [
|
|
3228
3169
|
formatFileSize(file.size),
|
|
3229
3170
|
isCompleted && result && " \u2022 Uploaded",
|
|
3230
3171
|
isError && progress.error && ` \u2022 ${progress.error}`
|
|
3231
3172
|
] }),
|
|
3232
3173
|
showProgress && (isUploading2 || isError) && /* @__PURE__ */ jsxs17("div", { className: "mt-2", children: [
|
|
3233
|
-
/* @__PURE__ */
|
|
3174
|
+
/* @__PURE__ */ jsx20("div", { className: "w-full bg-sec-200 rounded-full h-2", children: /* @__PURE__ */ jsx20(
|
|
3234
3175
|
"div",
|
|
3235
3176
|
{
|
|
3236
3177
|
className: `h-2 rounded-full transition-all duration-300 ${isError ? "bg-acc-500" : "bg-main-500"}`,
|
|
@@ -3247,17 +3188,17 @@ function FileUpload({
|
|
|
3247
3188
|
] })
|
|
3248
3189
|
] }),
|
|
3249
3190
|
/* @__PURE__ */ jsxs17("div", { className: "flex-shrink-0", children: [
|
|
3250
|
-
isCompleted && /* @__PURE__ */
|
|
3251
|
-
isError && /* @__PURE__ */
|
|
3252
|
-
isUploading2 && /* @__PURE__ */
|
|
3191
|
+
isCompleted && /* @__PURE__ */ jsx20("span", { className: "text-success-500 text-xl", children: "\u2713" }),
|
|
3192
|
+
isError && /* @__PURE__ */ jsx20("span", { className: "text-acc-500 text-xl", children: "\u2715" }),
|
|
3193
|
+
isUploading2 && /* @__PURE__ */ jsx20("div", { className: "animate-spin rounded-full h-5 w-5 border-b-2 border-main-500" })
|
|
3253
3194
|
] })
|
|
3254
3195
|
]
|
|
3255
3196
|
},
|
|
3256
3197
|
fileId
|
|
3257
3198
|
);
|
|
3258
3199
|
}) }),
|
|
3259
|
-
appIdError && /* @__PURE__ */
|
|
3260
|
-
error && /* @__PURE__ */
|
|
3200
|
+
appIdError && /* @__PURE__ */ jsx20("div", { className: "p-3 bg-acc-50 border border-acc-200 rounded-lg text-sm text-acc-600", children: appIdError }),
|
|
3201
|
+
error && /* @__PURE__ */ jsx20("div", { className: "p-3 bg-acc-50 border border-acc-200 rounded-lg text-sm text-acc-600", children: error })
|
|
3261
3202
|
] });
|
|
3262
3203
|
}
|
|
3263
3204
|
|
|
@@ -3336,7 +3277,7 @@ function useFileUrl(fileReference, options) {
|
|
|
3336
3277
|
|
|
3337
3278
|
// src/components/FileDisplay/FileDisplay.tsx
|
|
3338
3279
|
init_UnifiedAuthProvider();
|
|
3339
|
-
import { Fragment as Fragment6, jsx as
|
|
3280
|
+
import { Fragment as Fragment6, jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3340
3281
|
var fallbackSizeClasses = {
|
|
3341
3282
|
xs: "h-4 w-4 text-xs",
|
|
3342
3283
|
sm: "h-6 w-6 text-sm",
|
|
@@ -3443,17 +3384,17 @@ function FileDisplayContent({
|
|
|
3443
3384
|
};
|
|
3444
3385
|
if (error) {
|
|
3445
3386
|
if (ErrorComponent) {
|
|
3446
|
-
return /* @__PURE__ */
|
|
3387
|
+
return /* @__PURE__ */ jsx21(ErrorComponent, { error, retry: clearError });
|
|
3447
3388
|
}
|
|
3448
3389
|
if (showFallback) {
|
|
3449
|
-
return /* @__PURE__ */
|
|
3390
|
+
return /* @__PURE__ */ jsx21("div", { className: fallbackClasses, title: "File unavailable", children: computedFallbackText });
|
|
3450
3391
|
}
|
|
3451
3392
|
return /* @__PURE__ */ jsxs18("div", { className: `p-4 bg-acc-50 border border-acc-200 rounded-lg ${className}`, children: [
|
|
3452
3393
|
/* @__PURE__ */ jsxs18("div", { className: "text-acc-600", children: [
|
|
3453
3394
|
"Error loading file: ",
|
|
3454
3395
|
error instanceof Error ? error.message : String(error)
|
|
3455
3396
|
] }),
|
|
3456
|
-
clearError && /* @__PURE__ */
|
|
3397
|
+
clearError && /* @__PURE__ */ jsx21(
|
|
3457
3398
|
"button",
|
|
3458
3399
|
{
|
|
3459
3400
|
onClick: clearError,
|
|
@@ -3483,20 +3424,20 @@ function FileDisplayContent({
|
|
|
3483
3424
|
}
|
|
3484
3425
|
if (isLoading) {
|
|
3485
3426
|
if (LoadingComponent) {
|
|
3486
|
-
return /* @__PURE__ */
|
|
3427
|
+
return /* @__PURE__ */ jsx21(LoadingComponent, {});
|
|
3487
3428
|
}
|
|
3488
|
-
return /* @__PURE__ */
|
|
3429
|
+
return /* @__PURE__ */ jsx21("div", { className: `flex items-center justify-center p-4 ${className}`, children: /* @__PURE__ */ jsx21("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-main-500" }) });
|
|
3489
3430
|
}
|
|
3490
3431
|
if ((category || displayOnly) && fileReference) {
|
|
3491
3432
|
const isImage = fileReference.file_metadata.fileType?.startsWith("image/");
|
|
3492
3433
|
if (displayOnly && isImage && !showDelete) {
|
|
3493
3434
|
if (imageError && showFallback) {
|
|
3494
|
-
return /* @__PURE__ */
|
|
3435
|
+
return /* @__PURE__ */ jsx21("div", { className: fallbackClasses, title: fileReference.file_metadata.fileName || "File", children: computedFallbackText });
|
|
3495
3436
|
}
|
|
3496
3437
|
if (!fileUrl) {
|
|
3497
|
-
return /* @__PURE__ */
|
|
3438
|
+
return /* @__PURE__ */ jsx21("div", { className: `bg-sec-100 rounded animate-pulse ${className || "max-w-full h-48"}`, children: /* @__PURE__ */ jsx21("div", { className: "w-full h-full flex items-center justify-center", children: /* @__PURE__ */ jsx21("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-main-500" }) }) });
|
|
3498
3439
|
}
|
|
3499
|
-
return /* @__PURE__ */
|
|
3440
|
+
return /* @__PURE__ */ jsx21(
|
|
3500
3441
|
"img",
|
|
3501
3442
|
{
|
|
3502
3443
|
src: fileUrl,
|
|
@@ -3507,11 +3448,11 @@ function FileDisplayContent({
|
|
|
3507
3448
|
);
|
|
3508
3449
|
}
|
|
3509
3450
|
if (displayOnly && showFallback && (!fileUrl || imageError || !isImage)) {
|
|
3510
|
-
return /* @__PURE__ */
|
|
3451
|
+
return /* @__PURE__ */ jsx21("div", { className: fallbackClasses, title: fileReference.file_metadata.fileName || "File", children: computedFallbackText });
|
|
3511
3452
|
}
|
|
3512
3453
|
return /* @__PURE__ */ jsxs18("div", { className: `space-y-2 ${className}`, children: [
|
|
3513
3454
|
isImage && fileUrl && !imageError ? /* @__PURE__ */ jsxs18("div", { className: "relative", children: [
|
|
3514
|
-
/* @__PURE__ */
|
|
3455
|
+
/* @__PURE__ */ jsx21(
|
|
3515
3456
|
"img",
|
|
3516
3457
|
{
|
|
3517
3458
|
src: fileUrl,
|
|
@@ -3521,7 +3462,7 @@ function FileDisplayContent({
|
|
|
3521
3462
|
}
|
|
3522
3463
|
),
|
|
3523
3464
|
showDelete && /* @__PURE__ */ jsxs18(Fragment6, { children: [
|
|
3524
|
-
/* @__PURE__ */
|
|
3465
|
+
/* @__PURE__ */ jsx21(
|
|
3525
3466
|
"button",
|
|
3526
3467
|
{
|
|
3527
3468
|
onClick: handleDeleteClick,
|
|
@@ -3531,29 +3472,29 @@ function FileDisplayContent({
|
|
|
3531
3472
|
children: "\xD7"
|
|
3532
3473
|
}
|
|
3533
3474
|
),
|
|
3534
|
-
/* @__PURE__ */
|
|
3535
|
-
/* @__PURE__ */
|
|
3536
|
-
/* @__PURE__ */
|
|
3475
|
+
/* @__PURE__ */ jsx21(Dialog, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: /* @__PURE__ */ jsxs18(DialogContent, { size: "sm", children: [
|
|
3476
|
+
/* @__PURE__ */ jsx21(DialogHeader, { children: /* @__PURE__ */ jsx21(DialogTitle, { children: "Confirm Delete" }) }),
|
|
3477
|
+
/* @__PURE__ */ jsx21(DialogBody, { children: /* @__PURE__ */ jsx21("p", { children: "Are you sure you want to delete this file? This action cannot be undone." }) }),
|
|
3537
3478
|
/* @__PURE__ */ jsxs18(DialogFooter, { children: [
|
|
3538
|
-
/* @__PURE__ */
|
|
3539
|
-
/* @__PURE__ */
|
|
3479
|
+
/* @__PURE__ */ jsx21(Button, { variant: "outline", onClick: () => setDeleteDialogOpen(false), children: "Cancel" }),
|
|
3480
|
+
/* @__PURE__ */ jsx21(Button, { variant: "destructive", onClick: handleDeleteConfirm, children: "Delete" })
|
|
3540
3481
|
] })
|
|
3541
3482
|
] }) })
|
|
3542
3483
|
] })
|
|
3543
3484
|
] }) : isImage && imageError && showFallback ? (
|
|
3544
3485
|
// Show fallback when image fails to load and fallback is enabled
|
|
3545
|
-
/* @__PURE__ */
|
|
3486
|
+
/* @__PURE__ */ jsx21("div", { className: fallbackClasses, title: fileReference.file_metadata.fileName || "File", children: computedFallbackText })
|
|
3546
3487
|
) : /* @__PURE__ */ jsxs18("div", { className: "flex items-center space-x-3 p-3 bg-sec-50 rounded-lg border border-sec-200", children: [
|
|
3547
|
-
/* @__PURE__ */
|
|
3488
|
+
/* @__PURE__ */ jsx21("span", { className: "text-2xl", children: getFileIcon(fileReference.file_metadata.fileType || "") }),
|
|
3548
3489
|
/* @__PURE__ */ jsxs18("div", { className: "flex-1 min-w-0", children: [
|
|
3549
|
-
/* @__PURE__ */
|
|
3490
|
+
/* @__PURE__ */ jsx21("div", { className: "font-medium text-sec-900 truncate", children: fileReference.file_metadata.fileName || "Unknown file" }),
|
|
3550
3491
|
/* @__PURE__ */ jsxs18("div", { className: "text-sm text-sec-500", children: [
|
|
3551
3492
|
fileReference.file_metadata.fileSize && formatFileSize(fileReference.file_metadata.fileSize),
|
|
3552
3493
|
fileReference.file_metadata.fileType && ` \u2022 ${fileReference.file_metadata.fileType}`
|
|
3553
3494
|
] })
|
|
3554
3495
|
] }),
|
|
3555
3496
|
showDelete && /* @__PURE__ */ jsxs18(Fragment6, { children: [
|
|
3556
|
-
/* @__PURE__ */
|
|
3497
|
+
/* @__PURE__ */ jsx21(
|
|
3557
3498
|
"button",
|
|
3558
3499
|
{
|
|
3559
3500
|
onClick: handleDeleteClick,
|
|
@@ -3563,12 +3504,12 @@ function FileDisplayContent({
|
|
|
3563
3504
|
children: "\xD7"
|
|
3564
3505
|
}
|
|
3565
3506
|
),
|
|
3566
|
-
/* @__PURE__ */
|
|
3567
|
-
/* @__PURE__ */
|
|
3568
|
-
/* @__PURE__ */
|
|
3507
|
+
/* @__PURE__ */ jsx21(Dialog, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: /* @__PURE__ */ jsxs18(DialogContent, { size: "sm", children: [
|
|
3508
|
+
/* @__PURE__ */ jsx21(DialogHeader, { children: /* @__PURE__ */ jsx21(DialogTitle, { children: "Confirm Delete" }) }),
|
|
3509
|
+
/* @__PURE__ */ jsx21(DialogBody, { children: /* @__PURE__ */ jsx21("p", { children: "Are you sure you want to delete this file? This action cannot be undone." }) }),
|
|
3569
3510
|
/* @__PURE__ */ jsxs18(DialogFooter, { children: [
|
|
3570
|
-
/* @__PURE__ */
|
|
3571
|
-
/* @__PURE__ */
|
|
3511
|
+
/* @__PURE__ */ jsx21(Button, { variant: "outline", onClick: () => setDeleteDialogOpen(false), children: "Cancel" }),
|
|
3512
|
+
/* @__PURE__ */ jsx21(Button, { variant: "destructive", onClick: handleDeleteConfirm, children: "Delete" })
|
|
3572
3513
|
] })
|
|
3573
3514
|
] }) })
|
|
3574
3515
|
] })
|
|
@@ -3582,7 +3523,7 @@ function FileDisplayContent({
|
|
|
3582
3523
|
const fileUrl2 = internalFileUrls.get(fileRef.id) || null;
|
|
3583
3524
|
const canDownload = !isImage && fileUrl2;
|
|
3584
3525
|
return /* @__PURE__ */ jsxs18("div", { className: "flex items-center space-x-3 p-3 bg-sec-50 rounded-lg border border-sec-200", children: [
|
|
3585
|
-
isImage && fileUrl2 ? /* @__PURE__ */
|
|
3526
|
+
isImage && fileUrl2 ? /* @__PURE__ */ jsx21(
|
|
3586
3527
|
"img",
|
|
3587
3528
|
{
|
|
3588
3529
|
src: fileUrl2,
|
|
@@ -3590,9 +3531,9 @@ function FileDisplayContent({
|
|
|
3590
3531
|
className: "w-12 h-12 object-cover rounded",
|
|
3591
3532
|
onError: handleImageError
|
|
3592
3533
|
}
|
|
3593
|
-
) : /* @__PURE__ */
|
|
3534
|
+
) : /* @__PURE__ */ jsx21("span", { className: "text-2xl", children: getFileIcon(fileRef.file_metadata.fileType || "") }),
|
|
3594
3535
|
/* @__PURE__ */ jsxs18("div", { className: "flex-1 min-w-0", children: [
|
|
3595
|
-
/* @__PURE__ */
|
|
3536
|
+
/* @__PURE__ */ jsx21("div", { className: "font-medium text-sec-900 truncate", children: fileRef.file_metadata.fileName || "Unknown file" }),
|
|
3596
3537
|
/* @__PURE__ */ jsxs18("div", { className: "text-sm text-sec-500", children: [
|
|
3597
3538
|
fileRef.file_metadata.fileSize && formatFileSize(fileRef.file_metadata.fileSize),
|
|
3598
3539
|
fileRef.file_metadata.fileType && ` \u2022 ${fileRef.file_metadata.fileType}`,
|
|
@@ -3600,7 +3541,7 @@ function FileDisplayContent({
|
|
|
3600
3541
|
] })
|
|
3601
3542
|
] }),
|
|
3602
3543
|
/* @__PURE__ */ jsxs18("div", { className: "flex items-center space-x-2", children: [
|
|
3603
|
-
canDownload && /* @__PURE__ */
|
|
3544
|
+
canDownload && /* @__PURE__ */ jsx21(
|
|
3604
3545
|
"a",
|
|
3605
3546
|
{
|
|
3606
3547
|
href: fileRef.file_path,
|
|
@@ -3610,7 +3551,7 @@ function FileDisplayContent({
|
|
|
3610
3551
|
children: "\u2193"
|
|
3611
3552
|
}
|
|
3612
3553
|
),
|
|
3613
|
-
showDelete && onDelete && /* @__PURE__ */
|
|
3554
|
+
showDelete && onDelete && /* @__PURE__ */ jsx21(
|
|
3614
3555
|
"button",
|
|
3615
3556
|
{
|
|
3616
3557
|
onClick: handleDeleteClick,
|
|
@@ -3644,8 +3585,48 @@ function FileDisplayPublic({
|
|
|
3644
3585
|
}) {
|
|
3645
3586
|
const publicPageContext = useContext2(PublicPageContext);
|
|
3646
3587
|
const supabase = publicPageContext?.supabase ?? null;
|
|
3588
|
+
console.log("[FileDisplayPublic] Supabase Client Context:", {
|
|
3589
|
+
hasPublicPageContext: !!publicPageContext,
|
|
3590
|
+
hasSupabaseClient: !!supabase,
|
|
3591
|
+
supabaseUrl: publicPageContext?.environment?.supabaseUrl || "not available",
|
|
3592
|
+
hasAnonKey: !!publicPageContext?.environment?.supabaseKey,
|
|
3593
|
+
hasAuth: !!supabase?.auth,
|
|
3594
|
+
organisation_id,
|
|
3595
|
+
table_name,
|
|
3596
|
+
record_id,
|
|
3597
|
+
category,
|
|
3598
|
+
context: "public_page_anonymous_user",
|
|
3599
|
+
note: "Public pages use anonymous Supabase client (no user session)"
|
|
3600
|
+
});
|
|
3647
3601
|
if (!supabase) {
|
|
3648
|
-
|
|
3602
|
+
if (showFallback) {
|
|
3603
|
+
return /* @__PURE__ */ jsx21(
|
|
3604
|
+
FileDisplayContent,
|
|
3605
|
+
{
|
|
3606
|
+
isLoading: false,
|
|
3607
|
+
error: null,
|
|
3608
|
+
fileUrl: null,
|
|
3609
|
+
fileReference: null,
|
|
3610
|
+
fileReferences: [],
|
|
3611
|
+
fileUrls: /* @__PURE__ */ new Map(),
|
|
3612
|
+
fileCount: 0,
|
|
3613
|
+
category,
|
|
3614
|
+
displayOnly,
|
|
3615
|
+
showDelete: false,
|
|
3616
|
+
className,
|
|
3617
|
+
children,
|
|
3618
|
+
onDelete: void 0,
|
|
3619
|
+
organisation_id,
|
|
3620
|
+
loadingComponent,
|
|
3621
|
+
errorComponent,
|
|
3622
|
+
showFallback,
|
|
3623
|
+
generateFallbackText,
|
|
3624
|
+
fallbackText,
|
|
3625
|
+
fallbackSize
|
|
3626
|
+
}
|
|
3627
|
+
);
|
|
3628
|
+
}
|
|
3629
|
+
return /* @__PURE__ */ jsx21("div", { className: `text-sec-500 text-center p-4 ${className}`, children: "Supabase client not available in public context" });
|
|
3649
3630
|
}
|
|
3650
3631
|
const {
|
|
3651
3632
|
fileUrl,
|
|
@@ -3663,6 +3644,33 @@ function FileDisplayPublic({
|
|
|
3663
3644
|
category,
|
|
3664
3645
|
{ supabase }
|
|
3665
3646
|
);
|
|
3647
|
+
if (error) {
|
|
3648
|
+
console.error("[FileDisplayPublic] Error fetching file:", {
|
|
3649
|
+
table_name,
|
|
3650
|
+
record_id,
|
|
3651
|
+
organisation_id,
|
|
3652
|
+
category,
|
|
3653
|
+
error: error.message,
|
|
3654
|
+
errorStack: error.stack
|
|
3655
|
+
});
|
|
3656
|
+
}
|
|
3657
|
+
if (fileUrl && !isLoading && !error) {
|
|
3658
|
+
console.log("[FileDisplayPublic] File loaded successfully:", {
|
|
3659
|
+
table_name,
|
|
3660
|
+
record_id,
|
|
3661
|
+
category,
|
|
3662
|
+
fileUrl: fileUrl.substring(0, 50) + "..."
|
|
3663
|
+
// Truncate URL for logging
|
|
3664
|
+
});
|
|
3665
|
+
}
|
|
3666
|
+
if (!isLoading && !error && !fileUrl && !fileReference) {
|
|
3667
|
+
console.log("[FileDisplayPublic] No file found (will show fallback if enabled):", {
|
|
3668
|
+
table_name,
|
|
3669
|
+
record_id,
|
|
3670
|
+
category,
|
|
3671
|
+
showFallback
|
|
3672
|
+
});
|
|
3673
|
+
}
|
|
3666
3674
|
const handleDelete = async () => {
|
|
3667
3675
|
};
|
|
3668
3676
|
let finalFileReference = fileReference;
|
|
@@ -3679,7 +3687,7 @@ function FileDisplayPublic({
|
|
|
3679
3687
|
finalFileCount = 1;
|
|
3680
3688
|
finalFileUrl = fileUrls.get(targetFile.id) || null;
|
|
3681
3689
|
}
|
|
3682
|
-
return /* @__PURE__ */
|
|
3690
|
+
return /* @__PURE__ */ jsx21(
|
|
3683
3691
|
FileDisplayContent,
|
|
3684
3692
|
{
|
|
3685
3693
|
isLoading,
|
|
@@ -3723,7 +3731,7 @@ function FileDisplayAuthenticated({
|
|
|
3723
3731
|
}) {
|
|
3724
3732
|
const { supabase } = useUnifiedAuth();
|
|
3725
3733
|
if (!supabase) {
|
|
3726
|
-
return /* @__PURE__ */
|
|
3734
|
+
return /* @__PURE__ */ jsx21("div", { className: `text-sec-500 text-center p-4 ${className}`, children: "Supabase client not available in authenticated context" });
|
|
3727
3735
|
}
|
|
3728
3736
|
const {
|
|
3729
3737
|
fileUrl,
|
|
@@ -3781,7 +3789,7 @@ function FileDisplayAuthenticated({
|
|
|
3781
3789
|
finalError = error || displayOnlyFileUrlHook.error;
|
|
3782
3790
|
}
|
|
3783
3791
|
}
|
|
3784
|
-
return /* @__PURE__ */
|
|
3792
|
+
return /* @__PURE__ */ jsx21(
|
|
3785
3793
|
FileDisplayContent,
|
|
3786
3794
|
{
|
|
3787
3795
|
isLoading: finalIsLoading,
|
|
@@ -3826,7 +3834,7 @@ function FileDisplay({
|
|
|
3826
3834
|
}) {
|
|
3827
3835
|
const isPublicPage = useIsPublicPage();
|
|
3828
3836
|
if (isPublicPage) {
|
|
3829
|
-
return /* @__PURE__ */
|
|
3837
|
+
return /* @__PURE__ */ jsx21(
|
|
3830
3838
|
FileDisplayPublic,
|
|
3831
3839
|
{
|
|
3832
3840
|
table_name,
|
|
@@ -3846,7 +3854,7 @@ function FileDisplay({
|
|
|
3846
3854
|
}
|
|
3847
3855
|
);
|
|
3848
3856
|
}
|
|
3849
|
-
return /* @__PURE__ */
|
|
3857
|
+
return /* @__PURE__ */ jsx21(
|
|
3850
3858
|
FileDisplayAuthenticated,
|
|
3851
3859
|
{
|
|
3852
3860
|
table_name,
|
|
@@ -3868,9 +3876,9 @@ function FileDisplay({
|
|
|
3868
3876
|
}
|
|
3869
3877
|
|
|
3870
3878
|
// src/components/Table/Table.tsx
|
|
3871
|
-
import * as
|
|
3872
|
-
import { jsx as
|
|
3873
|
-
var Table =
|
|
3879
|
+
import * as React18 from "react";
|
|
3880
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
3881
|
+
var Table = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
3874
3882
|
"table",
|
|
3875
3883
|
{
|
|
3876
3884
|
ref,
|
|
@@ -3879,9 +3887,9 @@ var Table = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
3879
3887
|
}
|
|
3880
3888
|
));
|
|
3881
3889
|
Table.displayName = "Table";
|
|
3882
|
-
var TableHeader =
|
|
3890
|
+
var TableHeader = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
3883
3891
|
TableHeader.displayName = "TableHeader";
|
|
3884
|
-
var TableBody =
|
|
3892
|
+
var TableBody = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
3885
3893
|
"tbody",
|
|
3886
3894
|
{
|
|
3887
3895
|
ref,
|
|
@@ -3890,7 +3898,7 @@ var TableBody = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
3890
3898
|
}
|
|
3891
3899
|
));
|
|
3892
3900
|
TableBody.displayName = "TableBody";
|
|
3893
|
-
var TableFooter =
|
|
3901
|
+
var TableFooter = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
3894
3902
|
"tfoot",
|
|
3895
3903
|
{
|
|
3896
3904
|
ref,
|
|
@@ -3902,7 +3910,7 @@ var TableFooter = React19.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
3902
3910
|
}
|
|
3903
3911
|
));
|
|
3904
3912
|
TableFooter.displayName = "TableFooter";
|
|
3905
|
-
var TableRow =
|
|
3913
|
+
var TableRow = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
3906
3914
|
"tr",
|
|
3907
3915
|
{
|
|
3908
3916
|
ref,
|
|
@@ -3914,7 +3922,7 @@ var TableRow = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
3914
3922
|
}
|
|
3915
3923
|
));
|
|
3916
3924
|
TableRow.displayName = "TableRow";
|
|
3917
|
-
var TableHead =
|
|
3925
|
+
var TableHead = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
3918
3926
|
"th",
|
|
3919
3927
|
{
|
|
3920
3928
|
ref,
|
|
@@ -3926,7 +3934,7 @@ var TableHead = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
3926
3934
|
}
|
|
3927
3935
|
));
|
|
3928
3936
|
TableHead.displayName = "TableHead";
|
|
3929
|
-
var TableCell =
|
|
3937
|
+
var TableCell = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
3930
3938
|
"td",
|
|
3931
3939
|
{
|
|
3932
3940
|
ref,
|
|
@@ -3935,7 +3943,7 @@ var TableCell = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
3935
3943
|
}
|
|
3936
3944
|
));
|
|
3937
3945
|
TableCell.displayName = "TableCell";
|
|
3938
|
-
var TableCaption =
|
|
3946
|
+
var TableCaption = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
3939
3947
|
"caption",
|
|
3940
3948
|
{
|
|
3941
3949
|
ref,
|
|
@@ -3946,8 +3954,7 @@ var TableCaption = React19.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
3946
3954
|
TableCaption.displayName = "TableCaption";
|
|
3947
3955
|
|
|
3948
3956
|
// src/components/PublicLayout/PublicPageHeader.tsx
|
|
3949
|
-
import {
|
|
3950
|
-
import { Fragment as Fragment7, jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3957
|
+
import { Fragment as Fragment7, jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3951
3958
|
function PublicPageHeader({
|
|
3952
3959
|
event,
|
|
3953
3960
|
eventCode,
|
|
@@ -3957,91 +3964,67 @@ function PublicPageHeader({
|
|
|
3957
3964
|
showAppLogo = true,
|
|
3958
3965
|
className = "",
|
|
3959
3966
|
children,
|
|
3960
|
-
|
|
3961
|
-
customEventLogo,
|
|
3962
|
-
logoUrl,
|
|
3963
|
-
logoAlt,
|
|
3964
|
-
logoHref
|
|
3967
|
+
customEventLogo
|
|
3965
3968
|
}) {
|
|
3966
3969
|
const { appName } = useAppConfig();
|
|
3967
3970
|
return /* @__PURE__ */ jsxs19("header", { className: cn(
|
|
3968
|
-
" px-
|
|
3971
|
+
"w-full px-[max(0rem,calc((100vw-var(--app-width))/2-0.5rem))] grid grid-cols-[auto_1fr_auto] place-items-center gap-2",
|
|
3969
3972
|
className
|
|
3970
3973
|
), children: [
|
|
3971
|
-
showAppLogo &&
|
|
3972
|
-
"img",
|
|
3973
|
-
{
|
|
3974
|
-
className: "max-w-36 object-contain row-span-2",
|
|
3975
|
-
src: logoUrl,
|
|
3976
|
-
alt: logoAlt || appName
|
|
3977
|
-
}
|
|
3978
|
-
) }) : /* @__PURE__ */ jsx24(
|
|
3979
|
-
"img",
|
|
3980
|
-
{
|
|
3981
|
-
className: "max-w-36 object-contain row-span-2",
|
|
3982
|
-
src: logoUrl,
|
|
3983
|
-
alt: logoAlt || appName
|
|
3984
|
-
}
|
|
3985
|
-
) : appName ? logoHref ? /* @__PURE__ */ jsx24(Link2, { to: logoHref, className: "cursor-pointer hover:opacity-80 transition-opacity", children: /* @__PURE__ */ jsx24(
|
|
3986
|
-
"img",
|
|
3987
|
-
{
|
|
3988
|
-
className: "max-w-36 object-contain row-span-2",
|
|
3989
|
-
src: `/${appName.toLowerCase()}_logo_wide.svg`,
|
|
3990
|
-
alt: logoAlt || appName
|
|
3991
|
-
}
|
|
3992
|
-
) }) : /* @__PURE__ */ jsx24(
|
|
3974
|
+
showAppLogo && appName && /* @__PURE__ */ jsx23(
|
|
3993
3975
|
"img",
|
|
3994
3976
|
{
|
|
3995
|
-
className: "max-w-36 object-contain row-span-2",
|
|
3977
|
+
className: "ml-4 max-w-36 object-contain row-span-2",
|
|
3996
3978
|
src: `/${appName.toLowerCase()}_logo_wide.svg`,
|
|
3997
|
-
alt:
|
|
3979
|
+
alt: appName
|
|
3998
3980
|
}
|
|
3999
|
-
)
|
|
4000
|
-
"img",
|
|
4001
|
-
{
|
|
4002
|
-
src: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' fill='%23000'/%3E%3Ctext x='16' y='20' text-anchor='middle' fill='white' font-family='Arial' font-size='14' font-weight='bold'%3EL%3C/text%3E%3C/svg%3E",
|
|
4003
|
-
alt: logoAlt || "Logo",
|
|
4004
|
-
className: "max-w-36 object-contain row-span-2"
|
|
4005
|
-
}
|
|
4006
|
-
) }) : /* @__PURE__ */ jsx24(
|
|
4007
|
-
"img",
|
|
4008
|
-
{
|
|
4009
|
-
src: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' fill='%23000'/%3E%3Ctext x='16' y='20' text-anchor='middle' fill='white' font-family='Arial' font-size='14' font-weight='bold'%3EL%3C/text%3E%3C/svg%3E",
|
|
4010
|
-
alt: logoAlt || "Logo",
|
|
4011
|
-
className: "max-w-36 object-contain row-span-2"
|
|
4012
|
-
}
|
|
4013
|
-
) }),
|
|
3981
|
+
),
|
|
4014
3982
|
event && /* @__PURE__ */ jsxs19(Fragment7, { children: [
|
|
4015
|
-
/* @__PURE__ */
|
|
4016
|
-
showEventLogo && event && /* @__PURE__ */
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
3983
|
+
/* @__PURE__ */ jsx23("h1", { children: event.event_name }),
|
|
3984
|
+
showEventLogo && event && /* @__PURE__ */ jsx23(Fragment7, { children: customEventLogo || /* @__PURE__ */ jsxs19(Fragment7, { children: [
|
|
3985
|
+
(() => {
|
|
3986
|
+
console.log("[PublicPageHeader] Organisation ID Derivation Chain:", {
|
|
3987
|
+
eventCode,
|
|
3988
|
+
eventId: event.event_id,
|
|
3989
|
+
eventName: event.event_name,
|
|
3990
|
+
organisationId: event.organisation_id,
|
|
3991
|
+
organisationIdType: typeof event.organisation_id,
|
|
3992
|
+
organisationIdValid: !!event.organisation_id && event.organisation_id !== "",
|
|
3993
|
+
derivation: "URL \u2192 eventCode \u2192 usePublicEvent \u2192 event.organisation_id \u2192 FileDisplay",
|
|
3994
|
+
note: "Organisation ID is derived from event data fetched using event code from URL"
|
|
3995
|
+
});
|
|
3996
|
+
return null;
|
|
3997
|
+
})(),
|
|
3998
|
+
/* @__PURE__ */ jsx23(
|
|
3999
|
+
FileDisplay,
|
|
4000
|
+
{
|
|
4001
|
+
table_name: "event",
|
|
4002
|
+
record_id: event.event_id,
|
|
4003
|
+
organisation_id: event.organisation_id,
|
|
4004
|
+
category: "event_logos" /* EVENT_LOGOS */,
|
|
4005
|
+
displayOnly: true,
|
|
4006
|
+
showFallback: true,
|
|
4007
|
+
fallbackSize: "md",
|
|
4008
|
+
className: "mr-4 max-w-36 row-span-2",
|
|
4009
|
+
generateFallbackText: (fileName) => {
|
|
4010
|
+
if (!event.event_name) return "EV";
|
|
4011
|
+
return event.event_name.split(/[\s\-_]+/).map((word) => word.charAt(0).toUpperCase()).join("").substring(0, 3);
|
|
4012
|
+
}
|
|
4030
4013
|
}
|
|
4031
|
-
|
|
4032
|
-
) }),
|
|
4033
|
-
event.event_venue && /* @__PURE__ */
|
|
4014
|
+
)
|
|
4015
|
+
] }) }),
|
|
4016
|
+
event.event_venue && /* @__PURE__ */ jsx23("h4", { children: event.event_venue })
|
|
4034
4017
|
] }),
|
|
4035
4018
|
title && /* @__PURE__ */ jsxs19(Fragment7, { children: [
|
|
4036
|
-
/* @__PURE__ */
|
|
4037
|
-
description && /* @__PURE__ */
|
|
4019
|
+
/* @__PURE__ */ jsx23("h1", { children: title }),
|
|
4020
|
+
description && /* @__PURE__ */ jsx23("p", { className: "text-lg text-sec-600 max-w-3xl mx-auto", children: description })
|
|
4038
4021
|
] }),
|
|
4039
|
-
children && /* @__PURE__ */
|
|
4022
|
+
children && /* @__PURE__ */ jsx23(Fragment7, { children })
|
|
4040
4023
|
] });
|
|
4041
4024
|
}
|
|
4042
4025
|
|
|
4043
4026
|
// src/components/PublicLayout/PublicPageFooter.tsx
|
|
4044
|
-
import { Fragment as Fragment8, jsx as
|
|
4027
|
+
import { Fragment as Fragment8, jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4045
4028
|
function PublicPageFooter({
|
|
4046
4029
|
event,
|
|
4047
4030
|
companyName = "Solvera Solutions Pty Ltd",
|
|
@@ -4053,16 +4036,16 @@ function PublicPageFooter({
|
|
|
4053
4036
|
children
|
|
4054
4037
|
}) {
|
|
4055
4038
|
const copyrightText = copyright || `\xA9 Copyright 2022\u2013${year} all rights reserved, ${companyName}.`;
|
|
4056
|
-
return /* @__PURE__ */
|
|
4057
|
-
logo && /* @__PURE__ */
|
|
4058
|
-
children && /* @__PURE__ */
|
|
4059
|
-
/* @__PURE__ */
|
|
4060
|
-
links && links.length > 0 && /* @__PURE__ */
|
|
4039
|
+
return /* @__PURE__ */ jsx24("footer", { className: cn("mt-8 py-6 flex justify-center", className), children: /* @__PURE__ */ jsxs20("section", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto text-center", children: [
|
|
4040
|
+
logo && /* @__PURE__ */ jsx24("img", { src: logo, alt: "Logo", className: "h-8 w-auto" }),
|
|
4041
|
+
children && /* @__PURE__ */ jsx24(Fragment8, { children }),
|
|
4042
|
+
/* @__PURE__ */ jsx24("span", { className: "text-muted-foreground", children: copyrightText }),
|
|
4043
|
+
links && links.length > 0 && /* @__PURE__ */ jsx24("ul", { className: "flex gap-4 mt-2 md:mt-0", children: links.map((link, index) => /* @__PURE__ */ jsx24("li", { children: /* @__PURE__ */ jsx24("a", { href: link.href, className: "text-muted-foreground hover:text-foreground", children: link.label }) }, index)) })
|
|
4061
4044
|
] }) });
|
|
4062
4045
|
}
|
|
4063
4046
|
|
|
4064
4047
|
// src/components/PublicLayout/PublicLoadingSpinner.tsx
|
|
4065
|
-
import { jsx as
|
|
4048
|
+
import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4066
4049
|
var sizeClasses = {
|
|
4067
4050
|
sm: "h-4 w-4",
|
|
4068
4051
|
md: "h-8 w-8",
|
|
@@ -4080,7 +4063,7 @@ function PublicLoadingSpinner({
|
|
|
4080
4063
|
const sizeClass = sizeClasses[size];
|
|
4081
4064
|
const displayMessage = customMessage || message;
|
|
4082
4065
|
const content = /* @__PURE__ */ jsxs21("div", { className: cn("flex flex-col items-center", className), children: [
|
|
4083
|
-
showLogo && /* @__PURE__ */
|
|
4066
|
+
showLogo && /* @__PURE__ */ jsx25("div", { className: "mb-4", children: /* @__PURE__ */ jsx25(
|
|
4084
4067
|
"img",
|
|
4085
4068
|
{
|
|
4086
4069
|
className: "h-8 w-auto",
|
|
@@ -4089,7 +4072,7 @@ function PublicLoadingSpinner({
|
|
|
4089
4072
|
}
|
|
4090
4073
|
) }),
|
|
4091
4074
|
/* @__PURE__ */ jsxs21("div", { className: "relative", children: [
|
|
4092
|
-
/* @__PURE__ */
|
|
4075
|
+
/* @__PURE__ */ jsx25(
|
|
4093
4076
|
"div",
|
|
4094
4077
|
{
|
|
4095
4078
|
className: cn(
|
|
@@ -4100,12 +4083,12 @@ function PublicLoadingSpinner({
|
|
|
4100
4083
|
"aria-label": "Loading"
|
|
4101
4084
|
}
|
|
4102
4085
|
),
|
|
4103
|
-
/* @__PURE__ */
|
|
4086
|
+
/* @__PURE__ */ jsx25("span", { className: "sr-only", children: displayMessage })
|
|
4104
4087
|
] }),
|
|
4105
|
-
displayMessage && /* @__PURE__ */
|
|
4088
|
+
displayMessage && /* @__PURE__ */ jsx25("p", { className: "mt-4 text-sm text-sec-600 text-center", children: displayMessage })
|
|
4106
4089
|
] });
|
|
4107
4090
|
if (centered) {
|
|
4108
|
-
return /* @__PURE__ */
|
|
4091
|
+
return /* @__PURE__ */ jsx25("div", { className: "min-h-screen bg-background flex items-center justify-center", children: /* @__PURE__ */ jsx25("div", { className: "max-w-md mx-auto px-4", children: content }) });
|
|
4109
4092
|
}
|
|
4110
4093
|
return content;
|
|
4111
4094
|
}
|
|
@@ -4114,11 +4097,11 @@ function PublicLoadingSpinnerFullPage({
|
|
|
4114
4097
|
eventName,
|
|
4115
4098
|
className = ""
|
|
4116
4099
|
}) {
|
|
4117
|
-
return /* @__PURE__ */
|
|
4100
|
+
return /* @__PURE__ */ jsx25("div", { className: cn(
|
|
4118
4101
|
"min-h-screen bg-background flex items-center justify-center",
|
|
4119
4102
|
className
|
|
4120
4103
|
), children: /* @__PURE__ */ jsxs21("div", { className: "max-w-md mx-auto text-center px-4", children: [
|
|
4121
|
-
/* @__PURE__ */
|
|
4104
|
+
/* @__PURE__ */ jsx25("div", { className: "mb-8", children: /* @__PURE__ */ jsx25(
|
|
4122
4105
|
"img",
|
|
4123
4106
|
{
|
|
4124
4107
|
className: "h-12 w-auto mx-auto",
|
|
@@ -4126,8 +4109,8 @@ function PublicLoadingSpinnerFullPage({
|
|
|
4126
4109
|
alt: "PACE Core"
|
|
4127
4110
|
}
|
|
4128
4111
|
) }),
|
|
4129
|
-
eventName && /* @__PURE__ */
|
|
4130
|
-
/* @__PURE__ */
|
|
4112
|
+
eventName && /* @__PURE__ */ jsx25("h1", { className: "text-2xl font-bold text-sec-900 mb-4", children: eventName }),
|
|
4113
|
+
/* @__PURE__ */ jsx25("div", { className: "relative mb-6", children: /* @__PURE__ */ jsx25(
|
|
4131
4114
|
"div",
|
|
4132
4115
|
{
|
|
4133
4116
|
className: "h-12 w-12 border-4 border-sec-200 border-t-main-600 rounded-full animate-spin mx-auto",
|
|
@@ -4135,11 +4118,11 @@ function PublicLoadingSpinnerFullPage({
|
|
|
4135
4118
|
"aria-label": "Loading"
|
|
4136
4119
|
}
|
|
4137
4120
|
) }),
|
|
4138
|
-
/* @__PURE__ */
|
|
4121
|
+
/* @__PURE__ */ jsx25("p", { className: "text-lg text-sec-600", children: message }),
|
|
4139
4122
|
/* @__PURE__ */ jsxs21("div", { className: "mt-4 flex justify-center space-x-1", children: [
|
|
4140
|
-
/* @__PURE__ */
|
|
4141
|
-
/* @__PURE__ */
|
|
4142
|
-
/* @__PURE__ */
|
|
4123
|
+
/* @__PURE__ */ jsx25("div", { className: "h-2 w-2 bg-main-600 rounded-full animate-bounce", style: { animationDelay: "0ms" } }),
|
|
4124
|
+
/* @__PURE__ */ jsx25("div", { className: "h-2 w-2 bg-main-600 rounded-full animate-bounce", style: { animationDelay: "150ms" } }),
|
|
4125
|
+
/* @__PURE__ */ jsx25("div", { className: "h-2 w-2 bg-main-600 rounded-full animate-bounce", style: { animationDelay: "300ms" } })
|
|
4143
4126
|
] })
|
|
4144
4127
|
] }) });
|
|
4145
4128
|
}
|
|
@@ -4147,7 +4130,7 @@ function PublicLoadingSkeleton({
|
|
|
4147
4130
|
lines = 3,
|
|
4148
4131
|
className = ""
|
|
4149
4132
|
}) {
|
|
4150
|
-
return /* @__PURE__ */
|
|
4133
|
+
return /* @__PURE__ */ jsx25("div", { className: cn("animate-pulse", className), children: Array.from({ length: lines }).map((_, index) => /* @__PURE__ */ jsx25(
|
|
4151
4134
|
"div",
|
|
4152
4135
|
{
|
|
4153
4136
|
className: cn(
|
|
@@ -4160,7 +4143,7 @@ function PublicLoadingSkeleton({
|
|
|
4160
4143
|
}
|
|
4161
4144
|
|
|
4162
4145
|
// src/components/PublicLayout/PublicPageLayout.tsx
|
|
4163
|
-
import { Fragment as Fragment9, jsx as
|
|
4146
|
+
import { Fragment as Fragment9, jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4164
4147
|
function PublicPageLayout({
|
|
4165
4148
|
eventCode,
|
|
4166
4149
|
children,
|
|
@@ -4182,7 +4165,7 @@ function PublicPageLayout({
|
|
|
4182
4165
|
});
|
|
4183
4166
|
if (isLoading) {
|
|
4184
4167
|
if (LoadingFallback === PublicLoadingSpinner) {
|
|
4185
|
-
return /* @__PURE__ */
|
|
4168
|
+
return /* @__PURE__ */ jsx26(
|
|
4186
4169
|
PublicLoadingSpinner,
|
|
4187
4170
|
{
|
|
4188
4171
|
className: "items-center justify-center",
|
|
@@ -4190,39 +4173,39 @@ function PublicPageLayout({
|
|
|
4190
4173
|
}
|
|
4191
4174
|
);
|
|
4192
4175
|
}
|
|
4193
|
-
return /* @__PURE__ */
|
|
4176
|
+
return /* @__PURE__ */ jsx26(LoadingFallback, {});
|
|
4194
4177
|
}
|
|
4195
4178
|
if (error && showValidationErrors) {
|
|
4196
4179
|
if (ErrorFallback) {
|
|
4197
|
-
return /* @__PURE__ */
|
|
4180
|
+
return /* @__PURE__ */ jsx26(ErrorFallback, { error, retry: handleRefetch });
|
|
4198
4181
|
}
|
|
4199
|
-
return /* @__PURE__ */
|
|
4200
|
-
/* @__PURE__ */
|
|
4182
|
+
return /* @__PURE__ */ jsxs22("main", { className: "flex flex-col items-center justify-center px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children: [
|
|
4183
|
+
/* @__PURE__ */ jsx26("h1", { children: "Event Not Found" }),
|
|
4201
4184
|
/* @__PURE__ */ jsxs22("p", { children: [
|
|
4202
4185
|
'The event code "',
|
|
4203
4186
|
eventCode,
|
|
4204
4187
|
'" is invalid or the event is not available for public viewing.'
|
|
4205
4188
|
] }),
|
|
4206
|
-
/* @__PURE__ */
|
|
4207
|
-
] })
|
|
4189
|
+
/* @__PURE__ */ jsx26(Button, { onClick: handleRefetch, children: "Try Again" })
|
|
4190
|
+
] });
|
|
4208
4191
|
}
|
|
4209
4192
|
if (!event && showValidationErrors) {
|
|
4210
|
-
return /* @__PURE__ */
|
|
4211
|
-
/* @__PURE__ */
|
|
4212
|
-
/* @__PURE__ */
|
|
4213
|
-
handleRefetch && /* @__PURE__ */
|
|
4214
|
-
] })
|
|
4193
|
+
return /* @__PURE__ */ jsxs22("main", { className: "flex flex-col items-center justify-center px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children: [
|
|
4194
|
+
/* @__PURE__ */ jsx26("h1", { children: "Event Not Available" }),
|
|
4195
|
+
/* @__PURE__ */ jsx26("p", { children: "This event is not available for public viewing." }),
|
|
4196
|
+
handleRefetch && /* @__PURE__ */ jsx26(Button, { onClick: handleRefetch, children: "Try Again" })
|
|
4197
|
+
] });
|
|
4215
4198
|
}
|
|
4216
|
-
return /* @__PURE__ */
|
|
4217
|
-
customHeader || /* @__PURE__ */
|
|
4199
|
+
return /* @__PURE__ */ jsx26(PublicErrorBoundary, { children: /* @__PURE__ */ jsxs22(Fragment9, { children: [
|
|
4200
|
+
customHeader || /* @__PURE__ */ jsx26(
|
|
4218
4201
|
PublicPageHeader,
|
|
4219
4202
|
{
|
|
4220
4203
|
event: event || void 0,
|
|
4221
4204
|
eventCode
|
|
4222
4205
|
}
|
|
4223
4206
|
),
|
|
4224
|
-
/* @__PURE__ */
|
|
4225
|
-
showFooter && event && (customFooter || /* @__PURE__ */
|
|
4207
|
+
/* @__PURE__ */ jsx26("main", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children }),
|
|
4208
|
+
showFooter && event && (customFooter || /* @__PURE__ */ jsx26(PublicPageFooter, { event }))
|
|
4226
4209
|
] }) });
|
|
4227
4210
|
}
|
|
4228
4211
|
function usePublicPageContext2() {
|
|
@@ -4240,7 +4223,7 @@ function usePublicPageContext2() {
|
|
|
4240
4223
|
|
|
4241
4224
|
// src/components/PublicLayout/PublicPageDebugger.tsx
|
|
4242
4225
|
import { useEffect as useEffect9 } from "react";
|
|
4243
|
-
import { jsx as
|
|
4226
|
+
import { jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4244
4227
|
function PublicPageDebugger({ enabled = true, label = "PublicPage" }) {
|
|
4245
4228
|
useEffect9(() => {
|
|
4246
4229
|
if (!enabled) return;
|
|
@@ -4294,14 +4277,14 @@ function PublicPageDebugger({ enabled = true, label = "PublicPage" }) {
|
|
|
4294
4277
|
zIndex: 9999,
|
|
4295
4278
|
fontFamily: "monospace"
|
|
4296
4279
|
}, children: [
|
|
4297
|
-
/* @__PURE__ */
|
|
4298
|
-
/* @__PURE__ */
|
|
4280
|
+
/* @__PURE__ */ jsx27("div", { children: "Public Page Debugger" }),
|
|
4281
|
+
/* @__PURE__ */ jsx27("div", { children: "Check console for context analysis" })
|
|
4299
4282
|
] });
|
|
4300
4283
|
}
|
|
4301
4284
|
|
|
4302
4285
|
// src/components/PublicLayout/PublicPageDiagnostic.tsx
|
|
4303
4286
|
import { useEffect as useEffect10, useState as useState13 } from "react";
|
|
4304
|
-
import { jsx as
|
|
4287
|
+
import { jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
4305
4288
|
function PublicPageDiagnostic({ enabled = true, label = "PublicPage" }) {
|
|
4306
4289
|
const [diagnostics, setDiagnostics] = useState13({
|
|
4307
4290
|
hasPublicPageContext: false,
|
|
@@ -4395,7 +4378,7 @@ function PublicPageDiagnostic({ enabled = true, label = "PublicPage" }) {
|
|
|
4395
4378
|
maxWidth: "300px",
|
|
4396
4379
|
borderRadius: "0 0 8px 0"
|
|
4397
4380
|
}, children: [
|
|
4398
|
-
/* @__PURE__ */
|
|
4381
|
+
/* @__PURE__ */ jsx28("div", { style: { fontWeight: "bold", marginBottom: "8px" }, children: "\u{1F50D} Public Page Diagnostics" }),
|
|
4399
4382
|
/* @__PURE__ */ jsxs24("div", { children: [
|
|
4400
4383
|
"Public Context: ",
|
|
4401
4384
|
diagnostics.hasPublicPageContext ? "\u2705" : "\u274C"
|
|
@@ -4420,13 +4403,13 @@ function PublicPageDiagnostic({ enabled = true, label = "PublicPage" }) {
|
|
|
4420
4403
|
"Route Params: ",
|
|
4421
4404
|
diagnostics.routeParams ? "\u2705" : "\u274C"
|
|
4422
4405
|
] }),
|
|
4423
|
-
/* @__PURE__ */
|
|
4406
|
+
/* @__PURE__ */ jsx28("div", { style: { marginTop: "8px", fontSize: "10px", opacity: 0.8 }, children: "Check console for detailed analysis" })
|
|
4424
4407
|
] });
|
|
4425
4408
|
}
|
|
4426
4409
|
|
|
4427
4410
|
// src/components/PublicLayout/PublicPageContextChecker.tsx
|
|
4428
4411
|
import { useEffect as useEffect11 } from "react";
|
|
4429
|
-
import { jsx as
|
|
4412
|
+
import { jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
4430
4413
|
function PublicPageContextChecker({ enabled = true, label = "PublicPage" }) {
|
|
4431
4414
|
useEffect11(() => {
|
|
4432
4415
|
if (!enabled) return;
|
|
@@ -4504,9 +4487,9 @@ function PublicPageContextChecker({ enabled = true, label = "PublicPage" }) {
|
|
|
4504
4487
|
borderRadius: "0 0 8px 0",
|
|
4505
4488
|
border: "2px solid #dc2626"
|
|
4506
4489
|
}, children: [
|
|
4507
|
-
/* @__PURE__ */
|
|
4508
|
-
/* @__PURE__ */
|
|
4509
|
-
/* @__PURE__ */
|
|
4490
|
+
/* @__PURE__ */ jsx29("div", { style: { fontWeight: "bold", marginBottom: "8px" }, children: "\u{1F6A8} PUBLIC PAGE CONTEXT CHECK" }),
|
|
4491
|
+
/* @__PURE__ */ jsx29("div", { children: "Check console for authentication context analysis" }),
|
|
4492
|
+
/* @__PURE__ */ jsx29("div", { style: { marginTop: "8px", fontSize: "10px", opacity: 0.9 }, children: "If you see \u274C errors in console, your public page is inside auth context!" })
|
|
4510
4493
|
] });
|
|
4511
4494
|
}
|
|
4512
4495
|
|
|
@@ -4517,7 +4500,6 @@ export {
|
|
|
4517
4500
|
AvatarImage,
|
|
4518
4501
|
AvatarFallback,
|
|
4519
4502
|
Switch,
|
|
4520
|
-
Progress,
|
|
4521
4503
|
ToastProvider,
|
|
4522
4504
|
ToastViewport,
|
|
4523
4505
|
Toast,
|
|
@@ -4566,4 +4548,4 @@ export {
|
|
|
4566
4548
|
PublicPageDiagnostic,
|
|
4567
4549
|
PublicPageContextChecker
|
|
4568
4550
|
};
|
|
4569
|
-
//# sourceMappingURL=chunk-
|
|
4551
|
+
//# sourceMappingURL=chunk-TMUNK34W.js.map
|