@jmruthers/pace-core 0.5.94 → 0.5.95

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.
Files changed (122) hide show
  1. package/dist/{DataTable-CHX2EFO3.js → DataTable-XENXNMCP.js} +2 -2
  2. package/dist/{PublicLoadingSpinner-BWUD6bLU.d.ts → PublicLoadingSpinner-B84QWsvB.d.ts} +8 -1
  3. package/dist/{chunk-PRM6EYO3.js → chunk-EPKHU5SS.js} +17 -8
  4. package/dist/{chunk-PRM6EYO3.js.map → chunk-EPKHU5SS.js.map} +1 -1
  5. package/dist/{chunk-O6GASC4Q.js → chunk-V5CTX4FR.js} +267 -182
  6. package/dist/chunk-V5CTX4FR.js.map +1 -0
  7. package/dist/components.d.ts +1 -1
  8. package/dist/components.js +2 -2
  9. package/dist/index.d.ts +1 -1
  10. package/dist/index.js +2 -2
  11. package/dist/utils.js +1 -1
  12. package/docs/api/classes/ColumnFactory.md +1 -1
  13. package/docs/api/classes/ErrorBoundary.md +1 -1
  14. package/docs/api/classes/InvalidScopeError.md +1 -1
  15. package/docs/api/classes/MissingUserContextError.md +1 -1
  16. package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
  17. package/docs/api/classes/PermissionDeniedError.md +1 -1
  18. package/docs/api/classes/PublicErrorBoundary.md +1 -1
  19. package/docs/api/classes/RBACAuditManager.md +1 -1
  20. package/docs/api/classes/RBACCache.md +1 -1
  21. package/docs/api/classes/RBACEngine.md +1 -1
  22. package/docs/api/classes/RBACError.md +1 -1
  23. package/docs/api/classes/RBACNotInitializedError.md +1 -1
  24. package/docs/api/classes/SecureSupabaseClient.md +1 -1
  25. package/docs/api/classes/StorageUtils.md +1 -1
  26. package/docs/api/enums/FileCategory.md +1 -1
  27. package/docs/api/interfaces/AggregateConfig.md +1 -1
  28. package/docs/api/interfaces/ButtonProps.md +1 -1
  29. package/docs/api/interfaces/CardProps.md +1 -1
  30. package/docs/api/interfaces/ColorPalette.md +1 -1
  31. package/docs/api/interfaces/ColorShade.md +1 -1
  32. package/docs/api/interfaces/DataAccessRecord.md +1 -1
  33. package/docs/api/interfaces/DataRecord.md +1 -1
  34. package/docs/api/interfaces/DataTableAction.md +1 -1
  35. package/docs/api/interfaces/DataTableColumn.md +1 -1
  36. package/docs/api/interfaces/DataTableProps.md +1 -1
  37. package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
  38. package/docs/api/interfaces/EmptyStateConfig.md +1 -1
  39. package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
  40. package/docs/api/interfaces/EventLogoProps.md +1 -1
  41. package/docs/api/interfaces/FileDisplayProps.md +37 -11
  42. package/docs/api/interfaces/FileMetadata.md +1 -1
  43. package/docs/api/interfaces/FileReference.md +1 -1
  44. package/docs/api/interfaces/FileSizeLimits.md +1 -1
  45. package/docs/api/interfaces/FileUploadOptions.md +1 -1
  46. package/docs/api/interfaces/FileUploadProps.md +1 -1
  47. package/docs/api/interfaces/FooterProps.md +1 -1
  48. package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
  49. package/docs/api/interfaces/InputProps.md +1 -1
  50. package/docs/api/interfaces/LabelProps.md +1 -1
  51. package/docs/api/interfaces/LoginFormProps.md +1 -1
  52. package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
  53. package/docs/api/interfaces/NavigationContextType.md +1 -1
  54. package/docs/api/interfaces/NavigationGuardProps.md +1 -1
  55. package/docs/api/interfaces/NavigationItem.md +1 -1
  56. package/docs/api/interfaces/NavigationMenuProps.md +1 -1
  57. package/docs/api/interfaces/NavigationProviderProps.md +1 -1
  58. package/docs/api/interfaces/Organisation.md +1 -1
  59. package/docs/api/interfaces/OrganisationContextType.md +1 -1
  60. package/docs/api/interfaces/OrganisationMembership.md +1 -1
  61. package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
  62. package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
  63. package/docs/api/interfaces/PaceAppLayoutProps.md +1 -1
  64. package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
  65. package/docs/api/interfaces/PageAccessRecord.md +1 -1
  66. package/docs/api/interfaces/PagePermissionContextType.md +1 -1
  67. package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
  68. package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
  69. package/docs/api/interfaces/PaletteData.md +1 -1
  70. package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
  71. package/docs/api/interfaces/ProtectedRouteProps.md +1 -1
  72. package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
  73. package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
  74. package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
  75. package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
  76. package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
  77. package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
  78. package/docs/api/interfaces/RBACConfig.md +1 -1
  79. package/docs/api/interfaces/RBACLogger.md +1 -1
  80. package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
  81. package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
  82. package/docs/api/interfaces/RouteAccessRecord.md +1 -1
  83. package/docs/api/interfaces/RouteConfig.md +1 -1
  84. package/docs/api/interfaces/SecureDataContextType.md +1 -1
  85. package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
  86. package/docs/api/interfaces/StorageConfig.md +1 -1
  87. package/docs/api/interfaces/StorageFileInfo.md +1 -1
  88. package/docs/api/interfaces/StorageFileMetadata.md +1 -1
  89. package/docs/api/interfaces/StorageListOptions.md +1 -1
  90. package/docs/api/interfaces/StorageListResult.md +1 -1
  91. package/docs/api/interfaces/StorageUploadOptions.md +1 -1
  92. package/docs/api/interfaces/StorageUploadResult.md +1 -1
  93. package/docs/api/interfaces/StorageUrlOptions.md +1 -1
  94. package/docs/api/interfaces/StyleImport.md +1 -1
  95. package/docs/api/interfaces/SwitchProps.md +1 -1
  96. package/docs/api/interfaces/ToastActionElement.md +1 -1
  97. package/docs/api/interfaces/ToastProps.md +1 -1
  98. package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
  99. package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
  100. package/docs/api/interfaces/UseEventLogoOptions.md +1 -1
  101. package/docs/api/interfaces/UseEventLogoReturn.md +1 -1
  102. package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
  103. package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
  104. package/docs/api/interfaces/UsePublicEventLogoOptions.md +1 -1
  105. package/docs/api/interfaces/UsePublicEventLogoReturn.md +1 -1
  106. package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
  107. package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
  108. package/docs/api/interfaces/UsePublicFileDisplayOptions.md +1 -1
  109. package/docs/api/interfaces/UsePublicFileDisplayReturn.md +1 -1
  110. package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
  111. package/docs/api/interfaces/UseResolvedScopeOptions.md +1 -1
  112. package/docs/api/interfaces/UseResolvedScopeReturn.md +1 -1
  113. package/docs/api/interfaces/UserEventAccess.md +1 -1
  114. package/docs/api/interfaces/UserMenuProps.md +1 -1
  115. package/docs/api/interfaces/UserProfile.md +1 -1
  116. package/docs/api/modules.md +3 -3
  117. package/package.json +1 -1
  118. package/src/components/DataTable/components/DataTableCore.tsx +27 -9
  119. package/src/components/FileDisplay/FileDisplay.tsx +189 -147
  120. package/src/hooks/useFileUrl.ts +130 -0
  121. package/dist/chunk-O6GASC4Q.js.map +0 -1
  122. /package/dist/{DataTable-CHX2EFO3.js.map → DataTable-XENXNMCP.js.map} +0 -0
@@ -10,7 +10,9 @@ import {
10
10
  CardHeader,
11
11
  CardTitle,
12
12
  Dialog,
13
+ DialogBody,
13
14
  DialogContent,
15
+ DialogFooter,
14
16
  DialogHeader,
15
17
  DialogOverlay,
16
18
  DialogTitle,
@@ -23,7 +25,7 @@ import {
23
25
  SelectSeparator,
24
26
  SelectTrigger,
25
27
  SelectValue
26
- } from "./chunk-PRM6EYO3.js";
28
+ } from "./chunk-EPKHU5SS.js";
27
29
  import {
28
30
  isPermitted,
29
31
  isSuperAdmin
@@ -3002,9 +3004,81 @@ function FileUpload({
3002
3004
  }
3003
3005
 
3004
3006
  // src/components/FileDisplay/FileDisplay.tsx
3005
- import { useState as useState11, useEffect as useEffect7, useRef as useRef4, useContext } from "react";
3007
+ import { useState as useState12, useEffect as useEffect8, useRef as useRef5, useContext } from "react";
3008
+
3009
+ // src/hooks/useFileUrl.ts
3010
+ import { useState as useState11, useEffect as useEffect7, useCallback as useCallback7, useRef as useRef4 } from "react";
3011
+ function useFileUrl(fileReference, options) {
3012
+ const { organisation_id, supabase, autoLoad = true } = options;
3013
+ const [url, setUrl] = useState11(null);
3014
+ const [isLoading, setIsLoading] = useState11(false);
3015
+ const [error, setError] = useState11(null);
3016
+ const fileReferenceIdRef = useRef4(null);
3017
+ const loadUrl = useCallback7(async () => {
3018
+ if (!fileReference) {
3019
+ setUrl(null);
3020
+ setIsLoading(false);
3021
+ setError(null);
3022
+ return;
3023
+ }
3024
+ if (isLoading || url && fileReferenceIdRef.current === fileReference.id) {
3025
+ return;
3026
+ }
3027
+ setIsLoading(true);
3028
+ setError(null);
3029
+ fileReferenceIdRef.current = fileReference.id;
3030
+ try {
3031
+ let generatedUrl = null;
3032
+ if (fileReference.is_public) {
3033
+ generatedUrl = getPublicUrl(supabase, fileReference.file_path, true);
3034
+ } else {
3035
+ const signedUrlResult = await getSignedUrl(supabase, fileReference.file_path, {
3036
+ appName: "file-reference",
3037
+ orgId: organisation_id,
3038
+ expiresIn: 3600
3039
+ });
3040
+ generatedUrl = signedUrlResult?.url || null;
3041
+ }
3042
+ setUrl(generatedUrl);
3043
+ setError(null);
3044
+ } catch (err) {
3045
+ const error2 = err instanceof Error ? err : new Error("Failed to generate file URL");
3046
+ setError(error2);
3047
+ setUrl(null);
3048
+ console.error("[useFileUrl] Error generating URL:", error2);
3049
+ } finally {
3050
+ setIsLoading(false);
3051
+ }
3052
+ }, [fileReference, supabase, organisation_id, isLoading, url]);
3053
+ const clear = useCallback7(() => {
3054
+ setUrl(null);
3055
+ setError(null);
3056
+ setIsLoading(false);
3057
+ fileReferenceIdRef.current = null;
3058
+ }, []);
3059
+ useEffect7(() => {
3060
+ if (autoLoad) {
3061
+ if (fileReferenceIdRef.current !== fileReference?.id) {
3062
+ setUrl(null);
3063
+ setError(null);
3064
+ }
3065
+ if (fileReference && !url && !isLoading) {
3066
+ loadUrl();
3067
+ }
3068
+ }
3069
+ }, [fileReference?.id, autoLoad, loadUrl, url, isLoading]);
3070
+ return {
3071
+ url,
3072
+ isLoading,
3073
+ error,
3074
+ loadUrl,
3075
+ clear
3076
+ };
3077
+ }
3078
+
3079
+ // src/components/FileDisplay/FileDisplay.tsx
3006
3080
  init_UnifiedAuthProvider();
3007
- import { jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
3081
+ import { Fragment as Fragment6, jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
3008
3082
  function FileDisplayContent({
3009
3083
  isLoading,
3010
3084
  error,
@@ -3022,17 +3096,20 @@ function FileDisplayContent({
3022
3096
  clearError,
3023
3097
  supabase,
3024
3098
  organisation_id,
3025
- loadingUrls = /* @__PURE__ */ new Set()
3099
+ loadingUrls = /* @__PURE__ */ new Set(),
3100
+ loadingComponent: LoadingComponent,
3101
+ errorComponent: ErrorComponent
3026
3102
  }) {
3027
- const [imageError, setImageError] = useState11(false);
3028
- const [internalFileUrls, setInternalFileUrls] = useState11(new Map(fileUrls));
3029
- const loadedFilesRef = useRef4(/* @__PURE__ */ new Set());
3030
- const loadingUrlsRef = useRef4(new Set(loadingUrls));
3031
- const fileReferencesRef = useRef4([]);
3032
- useEffect7(() => {
3103
+ const [imageError, setImageError] = useState12(false);
3104
+ const [internalFileUrls, setInternalFileUrls] = useState12(new Map(fileUrls));
3105
+ const [deleteDialogOpen, setDeleteDialogOpen] = useState12(false);
3106
+ const loadedFilesRef = useRef5(/* @__PURE__ */ new Set());
3107
+ const loadingUrlsRef = useRef5(new Set(loadingUrls));
3108
+ const fileReferencesRef = useRef5([]);
3109
+ useEffect8(() => {
3033
3110
  setInternalFileUrls(new Map(fileUrls));
3034
3111
  }, [fileUrls]);
3035
- useEffect7(() => {
3112
+ useEffect8(() => {
3036
3113
  const currentIds = fileReferences.map((f) => f.id).join(",");
3037
3114
  const prevIds = fileReferencesRef.current.map((f) => f.id).join(",");
3038
3115
  if (currentIds !== prevIds) {
@@ -3041,7 +3118,7 @@ function FileDisplayContent({
3041
3118
  setInternalFileUrls(/* @__PURE__ */ new Map());
3042
3119
  }
3043
3120
  }, [fileReferences]);
3044
- useEffect7(() => {
3121
+ useEffect8(() => {
3045
3122
  if (!supabase || category || fileReferences.length === 0) return;
3046
3123
  const loadFileUrls = async () => {
3047
3124
  const urlsToLoad = fileReferences.filter((fileRef) => {
@@ -3079,13 +3156,15 @@ function FileDisplayContent({
3079
3156
  };
3080
3157
  loadFileUrls();
3081
3158
  }, [category, fileReferences.map((f) => f.id).join(","), supabase, organisation_id]);
3082
- const handleDelete = async () => {
3083
- if (window.confirm("Are you sure you want to delete this file?")) {
3084
- if (onDelete) {
3085
- await onDelete();
3086
- }
3087
- setImageError(false);
3159
+ const handleDeleteClick = () => {
3160
+ setDeleteDialogOpen(true);
3161
+ };
3162
+ const handleDeleteConfirm = async () => {
3163
+ setDeleteDialogOpen(false);
3164
+ if (onDelete) {
3165
+ await onDelete();
3088
3166
  }
3167
+ setImageError(false);
3089
3168
  };
3090
3169
  const handleImageError = () => {
3091
3170
  setImageError(true);
@@ -3108,9 +3187,15 @@ function FileDisplayContent({
3108
3187
  return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
3109
3188
  };
3110
3189
  if (isLoading) {
3190
+ if (LoadingComponent) {
3191
+ return /* @__PURE__ */ jsx22(LoadingComponent, {});
3192
+ }
3111
3193
  return /* @__PURE__ */ jsx22("div", { className: `flex items-center justify-center p-4 ${className}`, children: /* @__PURE__ */ jsx22("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-main-500" }) });
3112
3194
  }
3113
3195
  if (error) {
3196
+ if (ErrorComponent) {
3197
+ return /* @__PURE__ */ jsx22(ErrorComponent, { error, retry: clearError });
3198
+ }
3114
3199
  return /* @__PURE__ */ jsxs18("div", { className: `p-4 bg-acc-50 border border-acc-200 rounded-lg ${className}`, children: [
3115
3200
  /* @__PURE__ */ jsxs18("div", { className: "text-acc-600", children: [
3116
3201
  "Error loading file: ",
@@ -3134,7 +3219,10 @@ function FileDisplayContent({
3134
3219
  }
3135
3220
  if ((category || displayOnly) && fileReference) {
3136
3221
  const isImage = fileReference.file_metadata.fileType?.startsWith("image/");
3137
- if (displayOnly && isImage && fileUrl && !imageError && !showDelete) {
3222
+ if (displayOnly && isImage && !imageError && !showDelete) {
3223
+ if (!fileUrl) {
3224
+ return /* @__PURE__ */ jsx22("div", { className: `bg-sec-100 rounded animate-pulse ${className || "max-w-full h-48"}`, children: /* @__PURE__ */ jsx22("div", { className: "w-full h-full flex items-center justify-center", children: /* @__PURE__ */ jsx22("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-main-500" }) }) });
3225
+ }
3138
3226
  return /* @__PURE__ */ jsx22(
3139
3227
  "img",
3140
3228
  {
@@ -3156,16 +3244,26 @@ function FileDisplayContent({
3156
3244
  onError: handleImageError
3157
3245
  }
3158
3246
  ),
3159
- showDelete && /* @__PURE__ */ jsx22(
3160
- "button",
3161
- {
3162
- onClick: handleDelete,
3163
- className: "absolute top-2 right-2 bg-acc-500 text-white rounded-full w-6 h-6 flex items-center justify-center text-sm hover:bg-acc-600",
3164
- title: "Delete file",
3165
- "aria-label": "Delete file",
3166
- children: "\xD7"
3167
- }
3168
- )
3247
+ showDelete && /* @__PURE__ */ jsxs18(Fragment6, { children: [
3248
+ /* @__PURE__ */ jsx22(
3249
+ "button",
3250
+ {
3251
+ onClick: handleDeleteClick,
3252
+ className: "absolute top-2 right-2 bg-acc-500 text-white rounded-full w-6 h-6 flex items-center justify-center text-sm hover:bg-acc-600",
3253
+ title: "Delete file",
3254
+ "aria-label": "Delete file",
3255
+ children: "\xD7"
3256
+ }
3257
+ ),
3258
+ /* @__PURE__ */ jsx22(Dialog, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: /* @__PURE__ */ jsxs18(DialogContent, { size: "sm", children: [
3259
+ /* @__PURE__ */ jsx22(DialogHeader, { children: /* @__PURE__ */ jsx22(DialogTitle, { children: "Confirm Delete" }) }),
3260
+ /* @__PURE__ */ jsx22(DialogBody, { children: /* @__PURE__ */ jsx22("p", { children: "Are you sure you want to delete this file? This action cannot be undone." }) }),
3261
+ /* @__PURE__ */ jsxs18(DialogFooter, { children: [
3262
+ /* @__PURE__ */ jsx22(Button, { variant: "outline", onClick: () => setDeleteDialogOpen(false), children: "Cancel" }),
3263
+ /* @__PURE__ */ jsx22(Button, { variant: "destructive", onClick: handleDeleteConfirm, children: "Delete" })
3264
+ ] })
3265
+ ] }) })
3266
+ ] })
3169
3267
  ] }) : /* @__PURE__ */ jsxs18("div", { className: "flex items-center space-x-3 p-3 bg-sec-50 rounded-lg border border-sec-200", children: [
3170
3268
  /* @__PURE__ */ jsx22("span", { className: "text-2xl", children: getFileIcon(fileReference.file_metadata.fileType || "") }),
3171
3269
  /* @__PURE__ */ jsxs18("div", { className: "flex-1 min-w-0", children: [
@@ -3175,16 +3273,26 @@ function FileDisplayContent({
3175
3273
  fileReference.file_metadata.fileType && ` \u2022 ${fileReference.file_metadata.fileType}`
3176
3274
  ] })
3177
3275
  ] }),
3178
- showDelete && /* @__PURE__ */ jsx22(
3179
- "button",
3180
- {
3181
- onClick: handleDelete,
3182
- className: "text-acc-500 hover:text-acc-700 p-1",
3183
- title: "Delete file",
3184
- "aria-label": "Delete file",
3185
- children: "\xD7"
3186
- }
3187
- )
3276
+ showDelete && /* @__PURE__ */ jsxs18(Fragment6, { children: [
3277
+ /* @__PURE__ */ jsx22(
3278
+ "button",
3279
+ {
3280
+ onClick: handleDeleteClick,
3281
+ className: "text-acc-500 hover:text-acc-700 p-1",
3282
+ title: "Delete file",
3283
+ "aria-label": "Delete file",
3284
+ children: "\xD7"
3285
+ }
3286
+ ),
3287
+ /* @__PURE__ */ jsx22(Dialog, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: /* @__PURE__ */ jsxs18(DialogContent, { size: "sm", children: [
3288
+ /* @__PURE__ */ jsx22(DialogHeader, { children: /* @__PURE__ */ jsx22(DialogTitle, { children: "Confirm Delete" }) }),
3289
+ /* @__PURE__ */ jsx22(DialogBody, { children: /* @__PURE__ */ jsx22("p", { children: "Are you sure you want to delete this file? This action cannot be undone." }) }),
3290
+ /* @__PURE__ */ jsxs18(DialogFooter, { children: [
3291
+ /* @__PURE__ */ jsx22(Button, { variant: "outline", onClick: () => setDeleteDialogOpen(false), children: "Cancel" }),
3292
+ /* @__PURE__ */ jsx22(Button, { variant: "destructive", onClick: handleDeleteConfirm, children: "Delete" })
3293
+ ] })
3294
+ ] }) })
3295
+ ] })
3188
3296
  ] }),
3189
3297
  children
3190
3298
  ] });
@@ -3196,7 +3304,7 @@ function FileDisplayContent({
3196
3304
  const isLoadingUrl = loadingUrlsRef.current.has(fileRef.id);
3197
3305
  const canDownload = !isImage && fileUrl2;
3198
3306
  return /* @__PURE__ */ jsxs18("div", { className: "flex items-center space-x-3 p-3 bg-sec-50 rounded-lg border border-sec-200", children: [
3199
- isLoadingUrl ? /* @__PURE__ */ jsx22("div", { className: "w-12 h-12 flex items-center justify-center", children: /* @__PURE__ */ jsx22("div", { className: "animate-spin rounded-full h-6 w-6 border-b-2 border-main-500" }) }) : isImage && fileUrl2 ? /* @__PURE__ */ jsx22(
3307
+ isLoadingUrl ? /* @__PURE__ */ jsx22("div", { className: "w-12 h-12 flex items-center justify-center bg-sec-100 rounded animate-pulse", children: /* @__PURE__ */ jsx22("div", { className: "animate-spin rounded-full h-6 w-6 border-b-2 border-main-500" }) }) : isImage && fileUrl2 ? /* @__PURE__ */ jsx22(
3200
3308
  "img",
3201
3309
  {
3202
3310
  src: fileUrl2,
@@ -3227,11 +3335,10 @@ function FileDisplayContent({
3227
3335
  showDelete && onDelete && /* @__PURE__ */ jsx22(
3228
3336
  "button",
3229
3337
  {
3230
- onClick: () => {
3231
- onDelete();
3232
- },
3338
+ onClick: handleDeleteClick,
3233
3339
  className: "text-acc-500 hover:text-acc-700 p-1",
3234
3340
  title: "Delete file",
3341
+ "aria-label": "Delete file",
3235
3342
  children: "\xD7"
3236
3343
  }
3237
3344
  )
@@ -3251,7 +3358,9 @@ function FileDisplayBackwardsCompat({
3251
3358
  showUpload = false,
3252
3359
  showDelete = false,
3253
3360
  className = "",
3254
- children
3361
+ children,
3362
+ loadingComponent,
3363
+ errorComponent
3255
3364
  }) {
3256
3365
  const {
3257
3366
  isLoading: isLoadingForRecord,
@@ -3272,35 +3381,27 @@ function FileDisplayBackwardsCompat({
3272
3381
  isLoading: isLoadingCategory,
3273
3382
  error: errorCategory
3274
3383
  } = useFileReference(supabase);
3275
- const [categoryFileReference, setCategoryFileReference] = useState11(null);
3276
- const [categoryFileUrl, setCategoryFileUrl] = useState11(null);
3277
- const [categoryFileReferences, setCategoryFileReferences] = useState11([]);
3278
- const [displayOnlyFileReference, setDisplayOnlyFileReference] = useState11(null);
3279
- const [displayOnlyFileUrl, setDisplayOnlyFileUrl] = useState11(null);
3280
- useEffect7(() => {
3384
+ const [categoryFileReferences, setCategoryFileReferences] = useState12([]);
3385
+ const categoryFileReference = categoryFileReferences[0] || null;
3386
+ const categoryFileUrlHook = useFileUrl(categoryFileReference, {
3387
+ supabase,
3388
+ organisation_id,
3389
+ autoLoad: !!categoryFileReference
3390
+ });
3391
+ const [displayOnlyFileReference, setDisplayOnlyFileReference] = useState12(null);
3392
+ const displayOnlyFileUrlHook = useFileUrl(displayOnlyFileReference, {
3393
+ supabase,
3394
+ organisation_id,
3395
+ autoLoad: !!displayOnlyFileReference
3396
+ });
3397
+ useEffect8(() => {
3281
3398
  if (category) {
3282
3399
  const loadCategoryFiles = async () => {
3283
3400
  try {
3284
3401
  const files = await getFilesByCategory(table_name, record_id, category, organisation_id);
3285
3402
  setCategoryFileReferences(files);
3286
- if (files.length > 0) {
3287
- const firstFile = files[0];
3288
- setCategoryFileReference(firstFile);
3289
- let url = null;
3290
- if (firstFile.is_public) {
3291
- url = getPublicUrl(supabase, firstFile.file_path, true);
3292
- } else {
3293
- const signedUrlResult = await getSignedUrl(supabase, firstFile.file_path, {
3294
- appName: "file-reference",
3295
- orgId: organisation_id,
3296
- expiresIn: 3600
3297
- });
3298
- url = signedUrlResult?.url || null;
3299
- }
3300
- setCategoryFileUrl(url);
3301
- } else {
3302
- setCategoryFileReference(null);
3303
- setCategoryFileUrl(null);
3403
+ if (files.length === 0) {
3404
+ setCategoryFileReferences([]);
3304
3405
  }
3305
3406
  } catch (err) {
3306
3407
  console.error("[FileDisplayBackwardsCompat] Error loading files by category:", err);
@@ -3308,57 +3409,33 @@ function FileDisplayBackwardsCompat({
3308
3409
  };
3309
3410
  loadCategoryFiles();
3310
3411
  } else {
3311
- setCategoryFileReference(null);
3312
- setCategoryFileUrl(null);
3313
3412
  setCategoryFileReferences([]);
3314
3413
  }
3315
3414
  }, [category, table_name, record_id, organisation_id, supabase, getFilesByCategory]);
3316
- useEffect7(() => {
3415
+ useEffect8(() => {
3317
3416
  if (!category) {
3318
3417
  loadFileCount();
3319
3418
  loadFileReferences();
3320
3419
  }
3321
3420
  }, [loadFileCount, loadFileReferences, category]);
3322
- useEffect7(() => {
3421
+ useEffect8(() => {
3323
3422
  if (!category && fileReference) {
3324
3423
  loadFileUrl();
3325
3424
  }
3326
3425
  }, [category, fileReference, loadFileUrl]);
3327
- useEffect7(() => {
3426
+ useEffect8(() => {
3328
3427
  if (displayOnly && !category && fileReferences.length > 0) {
3329
- const loadDisplayOnlyFile = async () => {
3330
- try {
3331
- const imageFiles = fileReferences.filter(
3332
- (f) => f.file_metadata.fileType?.startsWith("image/")
3333
- );
3334
- const targetFile = imageFiles.length > 0 ? imageFiles[0] : fileReferences[0];
3335
- setDisplayOnlyFileReference(targetFile);
3336
- let url = null;
3337
- if (targetFile.is_public) {
3338
- url = getPublicUrl(supabase, targetFile.file_path, true);
3339
- } else {
3340
- const signedUrlResult = await getSignedUrl(supabase, targetFile.file_path, {
3341
- appName: "file-reference",
3342
- orgId: organisation_id,
3343
- expiresIn: 3600
3344
- });
3345
- url = signedUrlResult?.url || null;
3346
- }
3347
- setDisplayOnlyFileUrl(url);
3348
- } catch (err) {
3349
- console.error("[FileDisplayBackwardsCompat] Error loading displayOnly file:", err);
3350
- }
3351
- };
3352
- loadDisplayOnlyFile();
3353
- } else if (!displayOnly || category) {
3428
+ const imageFiles = fileReferences.filter(
3429
+ (f) => f.file_metadata.fileType?.startsWith("image/")
3430
+ );
3431
+ const targetFile = imageFiles.length > 0 ? imageFiles[0] : fileReferences[0];
3432
+ setDisplayOnlyFileReference(targetFile);
3433
+ } else {
3354
3434
  setDisplayOnlyFileReference(null);
3355
- setDisplayOnlyFileUrl(null);
3356
3435
  }
3357
- }, [displayOnly, category, fileReferences, supabase, organisation_id]);
3436
+ }, [displayOnly, category, fileReferences]);
3358
3437
  const handleDelete = async () => {
3359
- if (window.confirm("Are you sure you want to delete this file?")) {
3360
- await deleteFile(true);
3361
- }
3438
+ await deleteFile(true);
3362
3439
  };
3363
3440
  let finalFileReference = null;
3364
3441
  let finalFileUrl = null;
@@ -3368,18 +3445,18 @@ function FileDisplayBackwardsCompat({
3368
3445
  let finalError = null;
3369
3446
  if (category) {
3370
3447
  finalFileReference = categoryFileReference;
3371
- finalFileUrl = categoryFileUrl;
3448
+ finalFileUrl = categoryFileUrlHook.url;
3372
3449
  finalFileReferences = categoryFileReferences;
3373
3450
  finalFileCount = categoryFileReferences.length;
3374
- finalIsLoading = isLoadingCategory;
3375
- finalError = errorCategory;
3451
+ finalIsLoading = isLoadingCategory || categoryFileUrlHook.isLoading;
3452
+ finalError = errorCategory || categoryFileUrlHook.error;
3376
3453
  } else if (displayOnly) {
3377
3454
  finalFileReference = displayOnlyFileReference;
3378
- finalFileUrl = displayOnlyFileUrl;
3455
+ finalFileUrl = displayOnlyFileUrlHook.url;
3379
3456
  finalFileReferences = displayOnlyFileReference ? [displayOnlyFileReference] : [];
3380
3457
  finalFileCount = displayOnlyFileReference ? 1 : 0;
3381
- finalIsLoading = isLoadingForRecord;
3382
- finalError = errorForRecord;
3458
+ finalIsLoading = isLoadingForRecord || displayOnlyFileUrlHook.isLoading;
3459
+ finalError = errorForRecord || displayOnlyFileUrlHook.error;
3383
3460
  } else {
3384
3461
  finalFileReference = fileReference;
3385
3462
  finalFileUrl = fileUrl;
@@ -3407,7 +3484,9 @@ function FileDisplayBackwardsCompat({
3407
3484
  clearError,
3408
3485
  supabase,
3409
3486
  organisation_id,
3410
- loadingUrls: /* @__PURE__ */ new Set()
3487
+ loadingUrls: /* @__PURE__ */ new Set(),
3488
+ loadingComponent,
3489
+ errorComponent
3411
3490
  }
3412
3491
  );
3413
3492
  }
@@ -3420,7 +3499,9 @@ function FileDisplayPublic({
3420
3499
  showUpload = false,
3421
3500
  showDelete = false,
3422
3501
  className = "",
3423
- children
3502
+ children,
3503
+ loadingComponent,
3504
+ errorComponent
3424
3505
  }) {
3425
3506
  const publicPageContext = useContext(PublicPageContext);
3426
3507
  const supabase = publicPageContext?.supabase ?? null;
@@ -3477,7 +3558,9 @@ function FileDisplayPublic({
3477
3558
  children,
3478
3559
  onDelete: showDelete ? handleDelete : void 0,
3479
3560
  supabase,
3480
- organisation_id
3561
+ organisation_id,
3562
+ loadingComponent,
3563
+ errorComponent
3481
3564
  }
3482
3565
  );
3483
3566
  }
@@ -3490,7 +3573,9 @@ function FileDisplayAuthenticated({
3490
3573
  showUpload = false,
3491
3574
  showDelete = false,
3492
3575
  className = "",
3493
- children
3576
+ children,
3577
+ loadingComponent,
3578
+ errorComponent
3494
3579
  }) {
3495
3580
  const { supabase } = useUnifiedAuth();
3496
3581
  if (!supabase) {
@@ -3512,44 +3597,28 @@ function FileDisplayAuthenticated({
3512
3597
  category,
3513
3598
  { supabase }
3514
3599
  );
3515
- const [displayOnlyFileReference, setDisplayOnlyFileReference] = useState11(null);
3516
- const [displayOnlyFileUrl, setDisplayOnlyFileUrl] = useState11(null);
3517
- useEffect7(() => {
3600
+ const [displayOnlyFileReference, setDisplayOnlyFileReference] = useState12(null);
3601
+ const displayOnlyFileUrlFromMap = displayOnlyFileReference ? fileUrls.get(displayOnlyFileReference.id) : null;
3602
+ const displayOnlyFileUrlHook = useFileUrl(
3603
+ displayOnlyFileReference && !displayOnlyFileUrlFromMap ? displayOnlyFileReference : null,
3604
+ {
3605
+ supabase,
3606
+ organisation_id,
3607
+ autoLoad: !displayOnlyFileUrlFromMap && !!displayOnlyFileReference
3608
+ }
3609
+ );
3610
+ const displayOnlyFileUrl = displayOnlyFileUrlFromMap || displayOnlyFileUrlHook.url;
3611
+ useEffect8(() => {
3518
3612
  if (displayOnly && !category && fileReferences.length > 0) {
3519
- const loadDisplayOnlyFile = async () => {
3520
- try {
3521
- const imageFiles = fileReferences.filter(
3522
- (f) => f.file_metadata.fileType?.startsWith("image/")
3523
- );
3524
- const targetFile = imageFiles.length > 0 ? imageFiles[0] : fileReferences[0];
3525
- setDisplayOnlyFileReference(targetFile);
3526
- const existingUrl = fileUrls.get(targetFile.id);
3527
- if (existingUrl) {
3528
- setDisplayOnlyFileUrl(existingUrl);
3529
- return;
3530
- }
3531
- let url = null;
3532
- if (targetFile.is_public) {
3533
- url = getPublicUrl(supabase, targetFile.file_path, true);
3534
- } else {
3535
- const signedUrlResult = await getSignedUrl(supabase, targetFile.file_path, {
3536
- appName: "file-reference",
3537
- orgId: organisation_id,
3538
- expiresIn: 3600
3539
- });
3540
- url = signedUrlResult?.url || null;
3541
- }
3542
- setDisplayOnlyFileUrl(url);
3543
- } catch (err) {
3544
- console.error("[FileDisplayAuthenticated] Error loading displayOnly file:", err);
3545
- }
3546
- };
3547
- loadDisplayOnlyFile();
3548
- } else if (!displayOnly || category) {
3613
+ const imageFiles = fileReferences.filter(
3614
+ (f) => f.file_metadata.fileType?.startsWith("image/")
3615
+ );
3616
+ const targetFile = imageFiles.length > 0 ? imageFiles[0] : fileReferences[0];
3617
+ setDisplayOnlyFileReference(targetFile);
3618
+ } else {
3549
3619
  setDisplayOnlyFileReference(null);
3550
- setDisplayOnlyFileUrl(null);
3551
3620
  }
3552
- }, [displayOnly, category, fileReferences, fileUrls, supabase, organisation_id]);
3621
+ }, [displayOnly, category, fileReferences, fileUrls]);
3553
3622
  const handleDelete = async () => {
3554
3623
  console.warn("[FileDisplay] Delete operation needs to be implemented via FileReferenceService");
3555
3624
  };
@@ -3557,17 +3626,23 @@ function FileDisplayAuthenticated({
3557
3626
  let finalFileUrl = fileUrl;
3558
3627
  let finalFileReferences = fileReferences;
3559
3628
  let finalFileCount = fileCount;
3629
+ let finalIsLoading = isLoading;
3630
+ let finalError = error;
3560
3631
  if (displayOnly && !category) {
3561
3632
  finalFileReference = displayOnlyFileReference;
3562
3633
  finalFileUrl = displayOnlyFileUrl;
3563
3634
  finalFileReferences = displayOnlyFileReference ? [displayOnlyFileReference] : [];
3564
3635
  finalFileCount = displayOnlyFileReference ? 1 : 0;
3636
+ if (!displayOnlyFileUrlFromMap) {
3637
+ finalIsLoading = isLoading || displayOnlyFileUrlHook.isLoading;
3638
+ finalError = error || displayOnlyFileUrlHook.error;
3639
+ }
3565
3640
  }
3566
3641
  return /* @__PURE__ */ jsx22(
3567
3642
  FileDisplayContent,
3568
3643
  {
3569
- isLoading,
3570
- error,
3644
+ isLoading: finalIsLoading,
3645
+ error: finalError,
3571
3646
  fileUrl: finalFileUrl,
3572
3647
  fileReference: finalFileReference,
3573
3648
  fileReferences: finalFileReferences,
@@ -3580,7 +3655,9 @@ function FileDisplayAuthenticated({
3580
3655
  children,
3581
3656
  onDelete: showDelete ? handleDelete : void 0,
3582
3657
  supabase,
3583
- organisation_id
3658
+ organisation_id,
3659
+ loadingComponent,
3660
+ errorComponent
3584
3661
  }
3585
3662
  );
3586
3663
  }
@@ -3594,7 +3671,9 @@ function FileDisplay({
3594
3671
  showUpload = false,
3595
3672
  showDelete = false,
3596
3673
  className = "",
3597
- children
3674
+ children,
3675
+ loadingComponent,
3676
+ errorComponent
3598
3677
  }) {
3599
3678
  if (supabase) {
3600
3679
  return /* @__PURE__ */ jsx22(
@@ -3609,7 +3688,9 @@ function FileDisplay({
3609
3688
  showUpload,
3610
3689
  showDelete,
3611
3690
  className,
3612
- children
3691
+ children,
3692
+ loadingComponent,
3693
+ errorComponent
3613
3694
  }
3614
3695
  );
3615
3696
  }
@@ -3626,7 +3707,9 @@ function FileDisplay({
3626
3707
  showUpload,
3627
3708
  showDelete,
3628
3709
  className,
3629
- children
3710
+ children,
3711
+ loadingComponent,
3712
+ errorComponent
3630
3713
  }
3631
3714
  );
3632
3715
  }
@@ -3641,13 +3724,15 @@ function FileDisplay({
3641
3724
  showUpload,
3642
3725
  showDelete,
3643
3726
  className,
3644
- children
3727
+ children,
3728
+ loadingComponent,
3729
+ errorComponent
3645
3730
  }
3646
3731
  );
3647
3732
  }
3648
3733
 
3649
3734
  // src/hooks/useEventLogo.ts
3650
- import { useState as useState12, useEffect as useEffect8, useCallback as useCallback8, useMemo as useMemo9 } from "react";
3735
+ import { useState as useState13, useEffect as useEffect9, useCallback as useCallback9, useMemo as useMemo10 } from "react";
3651
3736
  function defaultGenerateFallbackText(eventName) {
3652
3737
  if (!eventName) return "EV";
3653
3738
  return eventName.split(" ").map((word) => word.charAt(0).toUpperCase()).join("").substring(0, 3);
@@ -3676,13 +3761,13 @@ function useEventLogo(supabase, eventId, eventName, organisationId, options = {}
3676
3761
  validateImage = true,
3677
3762
  generateFallbackText = defaultGenerateFallbackText
3678
3763
  } = options;
3679
- const [logoUrl, setLogoUrl] = useState12(null);
3680
- const [isLoading, setIsLoading] = useState12(false);
3681
- const [error, setError] = useState12(null);
3682
- const fallbackText = useMemo9(() => {
3764
+ const [logoUrl, setLogoUrl] = useState13(null);
3765
+ const [isLoading, setIsLoading] = useState13(false);
3766
+ const [error, setError] = useState13(null);
3767
+ const fallbackText = useMemo10(() => {
3683
3768
  return eventName ? generateFallbackText(eventName) : "EV";
3684
3769
  }, [eventName, generateFallbackText]);
3685
- const fetchLogo = useCallback8(async () => {
3770
+ const fetchLogo = useCallback9(async () => {
3686
3771
  if (!eventId || !organisationId || !supabase) {
3687
3772
  setLogoUrl(null);
3688
3773
  setIsLoading(false);
@@ -3766,7 +3851,7 @@ function useEventLogo(supabase, eventId, eventName, organisationId, options = {}
3766
3851
  setIsLoading(false);
3767
3852
  }
3768
3853
  }, [eventId, organisationId, supabase, cacheTtl, enableCache, validateImage, generateFallbackText]);
3769
- useEffect8(() => {
3854
+ useEffect9(() => {
3770
3855
  if (eventId && organisationId && supabase) {
3771
3856
  fetchLogo();
3772
3857
  } else {
@@ -3775,7 +3860,7 @@ function useEventLogo(supabase, eventId, eventName, organisationId, options = {}
3775
3860
  setError(null);
3776
3861
  }
3777
3862
  }, [eventId, organisationId, supabase, cacheTtl, enableCache, validateImage, generateFallbackText]);
3778
- const refetch = useCallback8(async () => {
3863
+ const refetch = useCallback9(async () => {
3779
3864
  if (!eventId || !organisationId || !supabase) return;
3780
3865
  if (enableCache) {
3781
3866
  const cacheKey = `event_logo_${eventId}_${organisationId}`;
@@ -3885,7 +3970,7 @@ var TableCaption = React19.forwardRef(({ className, ...props }, ref) => /* @__PU
3885
3970
  TableCaption.displayName = "TableCaption";
3886
3971
 
3887
3972
  // src/components/PublicLayout/PublicPageHeader.tsx
3888
- import { Fragment as Fragment6, jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
3973
+ import { Fragment as Fragment7, jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
3889
3974
  function PublicPageHeader({
3890
3975
  event,
3891
3976
  eventCode,
@@ -3925,7 +4010,7 @@ function PublicPageHeader({
3925
4010
  ) })
3926
4011
  ] }),
3927
4012
  /* @__PURE__ */ jsx24("div", { className: "pb-4", children: /* @__PURE__ */ jsxs19("div", { className: "text-center", children: [
3928
- event && /* @__PURE__ */ jsxs19(Fragment6, { children: [
4013
+ event && /* @__PURE__ */ jsxs19(Fragment7, { children: [
3929
4014
  /* @__PURE__ */ jsx24("h1", { className: "text-3xl font-bold text-gray-900 mb-2", children: event.event_name }),
3930
4015
  event.event_venue && /* @__PURE__ */ jsx24("p", { className: "text-md text-gray-500 mb-4", children: event.event_venue })
3931
4016
  ] }),
@@ -3939,7 +4024,7 @@ function PublicPageHeader({
3939
4024
  }
3940
4025
 
3941
4026
  // src/components/PublicLayout/PublicPageFooter.tsx
3942
- import { Fragment as Fragment7, jsx as jsx25, jsxs as jsxs20 } from "react/jsx-runtime";
4027
+ import { Fragment as Fragment8, jsx as jsx25, jsxs as jsxs20 } from "react/jsx-runtime";
3943
4028
  function PublicPageFooter({
3944
4029
  event,
3945
4030
  companyName = "Solvera Solutions Pty Ltd",
@@ -3953,7 +4038,7 @@ function PublicPageFooter({
3953
4038
  const copyrightText = copyright || `\xA9 Copyright 2022\u2013${year} all rights reserved, ${companyName}.`;
3954
4039
  return /* @__PURE__ */ jsx25("footer", { className: cn("mt-8 py-6 flex justify-center border-t border-border bg-main-100", className), children: /* @__PURE__ */ jsxs20("section", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto text-center", children: [
3955
4040
  logo && /* @__PURE__ */ jsx25("img", { src: logo, alt: "Logo", className: "h-8 w-auto" }),
3956
- children && /* @__PURE__ */ jsx25(Fragment7, { children }),
4041
+ children && /* @__PURE__ */ jsx25(Fragment8, { children }),
3957
4042
  /* @__PURE__ */ jsx25("span", { className: "text-muted-foreground", children: copyrightText }),
3958
4043
  links && links.length > 0 && /* @__PURE__ */ jsx25("ul", { className: "flex gap-4 mt-2 md:mt-0", children: links.map((link, index) => /* @__PURE__ */ jsx25("li", { children: /* @__PURE__ */ jsx25("a", { href: link.href, className: "text-muted-foreground hover:text-foreground", children: link.label }) }, index)) })
3959
4044
  ] }) });
@@ -4049,7 +4134,7 @@ function PublicLoadingSkeleton({
4049
4134
  }
4050
4135
 
4051
4136
  // src/components/PublicLayout/PublicPageLayout.tsx
4052
- import { useMemo as useMemo10 } from "react";
4137
+ import { useMemo as useMemo11 } from "react";
4053
4138
  import { jsx as jsx27, jsxs as jsxs22 } from "react/jsx-runtime";
4054
4139
  function PublicPageLayout({
4055
4140
  eventCode,
@@ -4067,7 +4152,7 @@ function PublicPageLayout({
4067
4152
  const error = null;
4068
4153
  const refetch = async () => {
4069
4154
  };
4070
- const layoutClasses = useMemo10(() => {
4155
+ const layoutClasses = useMemo11(() => {
4071
4156
  const baseClasses = "min-h-screen bg-white flex flex-col";
4072
4157
  return `${baseClasses} ${className}`.trim();
4073
4158
  }, [className]);
@@ -4132,10 +4217,10 @@ function usePublicPageContext2() {
4132
4217
  }
4133
4218
 
4134
4219
  // src/components/PublicLayout/PublicPageDebugger.tsx
4135
- import { useEffect as useEffect9 } from "react";
4220
+ import { useEffect as useEffect10 } from "react";
4136
4221
  import { jsx as jsx28, jsxs as jsxs23 } from "react/jsx-runtime";
4137
4222
  function PublicPageDebugger({ enabled = true, label = "PublicPage" }) {
4138
- useEffect9(() => {
4223
+ useEffect10(() => {
4139
4224
  if (!enabled) return;
4140
4225
  console.log(`[${label}] Component mounted`);
4141
4226
  try {
@@ -4193,10 +4278,10 @@ function PublicPageDebugger({ enabled = true, label = "PublicPage" }) {
4193
4278
  }
4194
4279
 
4195
4280
  // src/components/PublicLayout/PublicPageDiagnostic.tsx
4196
- import { useEffect as useEffect10, useState as useState13 } from "react";
4281
+ import { useEffect as useEffect11, useState as useState14 } from "react";
4197
4282
  import { jsx as jsx29, jsxs as jsxs24 } from "react/jsx-runtime";
4198
4283
  function PublicPageDiagnostic({ enabled = true, label = "PublicPage" }) {
4199
- const [diagnostics, setDiagnostics] = useState13({
4284
+ const [diagnostics, setDiagnostics] = useState14({
4200
4285
  hasPublicPageContext: false,
4201
4286
  hasAuthContext: false,
4202
4287
  hasOrgContext: false,
@@ -4204,7 +4289,7 @@ function PublicPageDiagnostic({ enabled = true, label = "PublicPage" }) {
4204
4289
  hasEnvironmentVars: false,
4205
4290
  routeParams: null
4206
4291
  });
4207
- useEffect10(() => {
4292
+ useEffect11(() => {
4208
4293
  if (!enabled) return;
4209
4294
  const runDiagnostics = () => {
4210
4295
  const newDiagnostics = {
@@ -4318,10 +4403,10 @@ function PublicPageDiagnostic({ enabled = true, label = "PublicPage" }) {
4318
4403
  }
4319
4404
 
4320
4405
  // src/components/PublicLayout/PublicPageContextChecker.tsx
4321
- import { useEffect as useEffect11 } from "react";
4406
+ import { useEffect as useEffect12 } from "react";
4322
4407
  import { jsx as jsx30, jsxs as jsxs25 } from "react/jsx-runtime";
4323
4408
  function PublicPageContextChecker({ enabled = true, label = "PublicPage" }) {
4324
- useEffect11(() => {
4409
+ useEffect12(() => {
4325
4410
  if (!enabled) return;
4326
4411
  console.group(`\u{1F6A8} [${label}] PUBLIC PAGE CONTEXT CHECK`);
4327
4412
  try {
@@ -4404,7 +4489,7 @@ function PublicPageContextChecker({ enabled = true, label = "PublicPage" }) {
4404
4489
  }
4405
4490
 
4406
4491
  // src/components/PublicLayout/EventLogo.tsx
4407
- import { useMemo as useMemo11, useContext as useContext2 } from "react";
4492
+ import { useMemo as useMemo12, useContext as useContext2 } from "react";
4408
4493
  init_UnifiedAuthProvider();
4409
4494
  import { jsx as jsx31 } from "react/jsx-runtime";
4410
4495
  var sizeClasses2 = {
@@ -4455,8 +4540,8 @@ function EventLogoPublic({
4455
4540
  supabase
4456
4541
  }
4457
4542
  );
4458
- const sizeClass = useMemo11(() => sizeClasses2[size || "md"], [size]);
4459
- const combinedClasses = useMemo11(() => {
4543
+ const sizeClass = useMemo12(() => sizeClasses2[size || "md"], [size]);
4544
+ const combinedClasses = useMemo12(() => {
4460
4545
  const baseClasses = "flex items-center justify-center bg-gray-100 text-gray-600 font-semibold rounded";
4461
4546
  return `${baseClasses} ${sizeClass} ${className}`.trim();
4462
4547
  }, [sizeClass, className]);
@@ -4537,8 +4622,8 @@ function EventLogoAuthenticated({
4537
4622
  generateFallbackText
4538
4623
  }
4539
4624
  );
4540
- const sizeClass = useMemo11(() => sizeClasses2[size || "md"], [size]);
4541
- const combinedClasses = useMemo11(() => {
4625
+ const sizeClass = useMemo12(() => sizeClasses2[size || "md"], [size]);
4626
+ const combinedClasses = useMemo12(() => {
4542
4627
  const baseClasses = "flex items-center justify-center bg-gray-100 text-gray-600 font-semibold rounded";
4543
4628
  return `${baseClasses} ${sizeClass} ${className}`.trim();
4544
4629
  }, [sizeClass, className]);
@@ -4714,4 +4799,4 @@ export {
4714
4799
  EventLogoCompact,
4715
4800
  EventLogoLarge
4716
4801
  };
4717
- //# sourceMappingURL=chunk-O6GASC4Q.js.map
4802
+ //# sourceMappingURL=chunk-V5CTX4FR.js.map