@jmruthers/pace-core 0.5.90 → 0.5.92

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 (153) hide show
  1. package/dist/{DataTable-VIP44OB6.js → DataTable-HC5S4RKB.js} +6 -6
  2. package/dist/{PublicLoadingSpinner-BQXD1fbO.d.ts → PublicLoadingSpinner-n74JgA9h.d.ts} +59 -4
  3. package/dist/{UnifiedAuthProvider-6JRTOFPS.js → UnifiedAuthProvider-ZM7VUC45.js} +3 -3
  4. package/dist/{chunk-EWMXLDIX.js → chunk-5LAY74WM.js} +375 -284
  5. package/dist/chunk-5LAY74WM.js.map +1 -0
  6. package/dist/{chunk-G2SCPUKC.js → chunk-6WFM22A4.js} +2 -2
  7. package/dist/{chunk-AIV3VYBQ.js → chunk-AAM57AEU.js} +4 -2
  8. package/dist/chunk-AAM57AEU.js.map +1 -0
  9. package/dist/{chunk-7XBW2P7B.js → chunk-AYC2P377.js} +2 -2
  10. package/dist/{chunk-GD3ENUKD.js → chunk-AZ2QJYKU.js} +3 -3
  11. package/dist/{chunk-G2YT64FA.js → chunk-GP3HU6WS.js} +3 -3
  12. package/dist/{chunk-7NIERLC6.js → chunk-HW5BGOWB.js} +4 -4
  13. package/dist/{chunk-JDPFQV3V.js → chunk-M52CQP5W.js} +4 -4
  14. package/dist/{chunk-JQWSAYZC.js → chunk-OXFOS62D.js} +2 -2
  15. package/dist/{chunk-4DYK5KCK.js → chunk-TZXYSZT3.js} +4 -4
  16. package/dist/{chunk-XZHZYSAK.js → chunk-XIBSVWJW.js} +5 -5
  17. package/dist/components.d.ts +1 -1
  18. package/dist/components.js +10 -8
  19. package/dist/components.js.map +1 -1
  20. package/dist/hooks.js +7 -7
  21. package/dist/index.d.ts +1 -1
  22. package/dist/index.js +13 -11
  23. package/dist/index.js.map +1 -1
  24. package/dist/providers.js +2 -2
  25. package/dist/rbac/index.js +7 -7
  26. package/dist/utils.js +1 -1
  27. package/docs/api/classes/ColumnFactory.md +1 -1
  28. package/docs/api/classes/ErrorBoundary.md +1 -1
  29. package/docs/api/classes/InvalidScopeError.md +1 -1
  30. package/docs/api/classes/MissingUserContextError.md +1 -1
  31. package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
  32. package/docs/api/classes/PermissionDeniedError.md +1 -1
  33. package/docs/api/classes/PublicErrorBoundary.md +1 -1
  34. package/docs/api/classes/RBACAuditManager.md +1 -1
  35. package/docs/api/classes/RBACCache.md +1 -1
  36. package/docs/api/classes/RBACEngine.md +1 -1
  37. package/docs/api/classes/RBACError.md +1 -1
  38. package/docs/api/classes/RBACNotInitializedError.md +1 -1
  39. package/docs/api/classes/SecureSupabaseClient.md +1 -1
  40. package/docs/api/classes/StorageUtils.md +1 -1
  41. package/docs/api/enums/FileCategory.md +1 -1
  42. package/docs/api/interfaces/AggregateConfig.md +1 -1
  43. package/docs/api/interfaces/ButtonProps.md +1 -1
  44. package/docs/api/interfaces/CardProps.md +1 -1
  45. package/docs/api/interfaces/ColorPalette.md +1 -1
  46. package/docs/api/interfaces/ColorShade.md +1 -1
  47. package/docs/api/interfaces/DataAccessRecord.md +1 -1
  48. package/docs/api/interfaces/DataRecord.md +1 -1
  49. package/docs/api/interfaces/DataTableAction.md +1 -1
  50. package/docs/api/interfaces/DataTableColumn.md +1 -1
  51. package/docs/api/interfaces/DataTableProps.md +1 -1
  52. package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
  53. package/docs/api/interfaces/EmptyStateConfig.md +1 -1
  54. package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
  55. package/docs/api/interfaces/EventLogoProps.md +1 -1
  56. package/docs/api/interfaces/FileDisplayProps.md +1 -1
  57. package/docs/api/interfaces/FileMetadata.md +1 -1
  58. package/docs/api/interfaces/FileReference.md +1 -1
  59. package/docs/api/interfaces/FileSizeLimits.md +1 -1
  60. package/docs/api/interfaces/FileUploadOptions.md +1 -1
  61. package/docs/api/interfaces/FileUploadProps.md +1 -1
  62. package/docs/api/interfaces/FooterProps.md +1 -1
  63. package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
  64. package/docs/api/interfaces/InputProps.md +1 -1
  65. package/docs/api/interfaces/LabelProps.md +1 -1
  66. package/docs/api/interfaces/LoginFormProps.md +1 -1
  67. package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
  68. package/docs/api/interfaces/NavigationContextType.md +1 -1
  69. package/docs/api/interfaces/NavigationGuardProps.md +1 -1
  70. package/docs/api/interfaces/NavigationItem.md +1 -1
  71. package/docs/api/interfaces/NavigationMenuProps.md +1 -1
  72. package/docs/api/interfaces/NavigationProviderProps.md +1 -1
  73. package/docs/api/interfaces/Organisation.md +1 -1
  74. package/docs/api/interfaces/OrganisationContextType.md +1 -1
  75. package/docs/api/interfaces/OrganisationMembership.md +1 -1
  76. package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
  77. package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
  78. package/docs/api/interfaces/PaceAppLayoutProps.md +34 -21
  79. package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
  80. package/docs/api/interfaces/PageAccessRecord.md +1 -1
  81. package/docs/api/interfaces/PagePermissionContextType.md +1 -1
  82. package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
  83. package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
  84. package/docs/api/interfaces/PaletteData.md +1 -1
  85. package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
  86. package/docs/api/interfaces/ProtectedRouteProps.md +97 -0
  87. package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
  88. package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
  89. package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
  90. package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
  91. package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
  92. package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
  93. package/docs/api/interfaces/RBACConfig.md +1 -1
  94. package/docs/api/interfaces/RBACLogger.md +1 -1
  95. package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
  96. package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
  97. package/docs/api/interfaces/RouteAccessRecord.md +1 -1
  98. package/docs/api/interfaces/RouteConfig.md +1 -1
  99. package/docs/api/interfaces/SecureDataContextType.md +1 -1
  100. package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
  101. package/docs/api/interfaces/StorageConfig.md +1 -1
  102. package/docs/api/interfaces/StorageFileInfo.md +1 -1
  103. package/docs/api/interfaces/StorageFileMetadata.md +1 -1
  104. package/docs/api/interfaces/StorageListOptions.md +1 -1
  105. package/docs/api/interfaces/StorageListResult.md +1 -1
  106. package/docs/api/interfaces/StorageUploadOptions.md +1 -1
  107. package/docs/api/interfaces/StorageUploadResult.md +1 -1
  108. package/docs/api/interfaces/StorageUrlOptions.md +1 -1
  109. package/docs/api/interfaces/StyleImport.md +1 -1
  110. package/docs/api/interfaces/SwitchProps.md +1 -1
  111. package/docs/api/interfaces/ToastActionElement.md +1 -1
  112. package/docs/api/interfaces/ToastProps.md +1 -1
  113. package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
  114. package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
  115. package/docs/api/interfaces/UseEventLogoOptions.md +1 -1
  116. package/docs/api/interfaces/UseEventLogoReturn.md +1 -1
  117. package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
  118. package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
  119. package/docs/api/interfaces/UsePublicEventLogoOptions.md +1 -1
  120. package/docs/api/interfaces/UsePublicEventLogoReturn.md +1 -1
  121. package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
  122. package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
  123. package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
  124. package/docs/api/interfaces/UseResolvedScopeOptions.md +1 -1
  125. package/docs/api/interfaces/UseResolvedScopeReturn.md +1 -1
  126. package/docs/api/interfaces/UserEventAccess.md +1 -1
  127. package/docs/api/interfaces/UserMenuProps.md +1 -1
  128. package/docs/api/interfaces/UserProfile.md +1 -1
  129. package/docs/api/modules.md +43 -5
  130. package/package.json +1 -1
  131. package/src/components/EventSelector/EventSelector.tsx +19 -1
  132. package/src/components/Header/Header.tsx +52 -15
  133. package/src/components/PaceAppLayout/PaceAppLayout.tsx +4 -0
  134. package/src/components/PaceAppLayout/README.md +30 -0
  135. package/src/components/ProtectedRoute/ProtectedRoute.tsx +224 -0
  136. package/src/components/ProtectedRoute/index.ts +3 -0
  137. package/src/components/index.ts +4 -1
  138. package/src/index.ts +3 -0
  139. package/src/providers/AuthProvider.simplified.tsx +108 -14
  140. package/src/services/EventService.ts +6 -1
  141. package/dist/chunk-AIV3VYBQ.js.map +0 -1
  142. package/dist/chunk-EWMXLDIX.js.map +0 -1
  143. /package/dist/{DataTable-VIP44OB6.js.map → DataTable-HC5S4RKB.js.map} +0 -0
  144. /package/dist/{UnifiedAuthProvider-6JRTOFPS.js.map → UnifiedAuthProvider-ZM7VUC45.js.map} +0 -0
  145. /package/dist/{chunk-G2SCPUKC.js.map → chunk-6WFM22A4.js.map} +0 -0
  146. /package/dist/{chunk-7XBW2P7B.js.map → chunk-AYC2P377.js.map} +0 -0
  147. /package/dist/{chunk-GD3ENUKD.js.map → chunk-AZ2QJYKU.js.map} +0 -0
  148. /package/dist/{chunk-G2YT64FA.js.map → chunk-GP3HU6WS.js.map} +0 -0
  149. /package/dist/{chunk-7NIERLC6.js.map → chunk-HW5BGOWB.js.map} +0 -0
  150. /package/dist/{chunk-JDPFQV3V.js.map → chunk-M52CQP5W.js.map} +0 -0
  151. /package/dist/{chunk-JQWSAYZC.js.map → chunk-OXFOS62D.js.map} +0 -0
  152. /package/dist/{chunk-4DYK5KCK.js.map → chunk-TZXYSZT3.js.map} +0 -0
  153. /package/dist/{chunk-XZHZYSAK.js.map → chunk-XIBSVWJW.js.map} +0 -0
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  Alert,
3
3
  AlertDescription,
4
+ AlertTitle,
4
5
  Button,
5
6
  Card,
6
7
  CardContent,
@@ -22,7 +23,7 @@ import {
22
23
  SelectSeparator,
23
24
  SelectTrigger,
24
25
  SelectValue
25
- } from "./chunk-4DYK5KCK.js";
26
+ } from "./chunk-TZXYSZT3.js";
26
27
  import {
27
28
  isPermitted,
28
29
  isSuperAdmin
@@ -41,26 +42,28 @@ import {
41
42
  useIsPublicPage,
42
43
  usePublicEventLogo,
43
44
  usePublicPageContext
44
- } from "./chunk-JDPFQV3V.js";
45
+ } from "./chunk-M52CQP5W.js";
45
46
  import {
46
47
  useToast
47
48
  } from "./chunk-QPCAGLUS.js";
48
49
  import {
49
50
  useEvents,
50
51
  useOrganisations
51
- } from "./chunk-JQWSAYZC.js";
52
+ } from "./chunk-OXFOS62D.js";
52
53
  import {
53
54
  UnifiedAuthProvider_exports,
54
55
  init_UnifiedAuthProvider as init_UnifiedAuthProvider2
55
- } from "./chunk-7XBW2P7B.js";
56
+ } from "./chunk-AYC2P377.js";
56
57
  import {
57
58
  EventServiceContext,
58
59
  EventServiceProvider,
59
60
  init_EventServiceProvider,
60
61
  init_UnifiedAuthProvider,
62
+ init_useSessionRestoration,
61
63
  useEventService,
64
+ useSessionRestoration,
62
65
  useUnifiedAuth
63
- } from "./chunk-AIV3VYBQ.js";
66
+ } from "./chunk-AAM57AEU.js";
64
67
  import {
65
68
  LoadingSpinner
66
69
  } from "./chunk-CDQ3PX7L.js";
@@ -581,6 +584,17 @@ function EventSelector({
581
584
  if (next) {
582
585
  setSelectedEvent(next);
583
586
  if (onEventChange) onEventChange(next);
587
+ } else {
588
+ const mostRecentPast = [...events].filter((e) => {
589
+ if (!e.event_date) return false;
590
+ const eventDate = new Date(e.event_date);
591
+ const startOfEventDate = new Date(eventDate.getFullYear(), eventDate.getMonth(), eventDate.getDate()).getTime();
592
+ return startOfEventDate < startOfToday;
593
+ }).sort((a, b) => new Date(b.event_date).getTime() - new Date(a.event_date).getTime())[0];
594
+ if (mostRecentPast) {
595
+ setSelectedEvent(mostRecentPast);
596
+ if (onEventChange) onEventChange(mostRecentPast);
597
+ }
584
598
  }
585
599
  }
586
600
  }, [events, selectedEvent, setSelectedEvent, onEventChange]);
@@ -1123,6 +1137,7 @@ var NavigationMenu = React9.forwardRef(({
1123
1137
  NavigationMenu.displayName = "NavigationMenu";
1124
1138
 
1125
1139
  // src/components/Header/Header.tsx
1140
+ import { Link } from "react-router-dom";
1126
1141
  import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
1127
1142
  function Header({
1128
1143
  logoUrl,
@@ -1138,20 +1153,35 @@ function Header({
1138
1153
  showEventSelector = true,
1139
1154
  showUserMenu = true,
1140
1155
  currentPath,
1141
- onNavigate
1156
+ onNavigate,
1157
+ logoHref
1142
1158
  }) {
1143
1159
  return /* @__PURE__ */ jsx12("header", { className: cn(
1144
1160
  "w-full border-b border-main-200 h-16 shadow-sm bg-main-100 ",
1145
1161
  className
1146
1162
  ), 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: [
1147
- logo ? logo : logoUrl ? /* @__PURE__ */ jsx12(
1163
+ logo ? logoHref ? /* @__PURE__ */ jsx12(Link, { to: logoHref, className: "cursor-pointer hover:opacity-80 transition-opacity", children: logo }) : logo : logoUrl ? logoHref ? /* @__PURE__ */ jsx12(Link, { to: logoHref, className: "cursor-pointer hover:opacity-80 transition-opacity", children: /* @__PURE__ */ jsx12(
1164
+ "img",
1165
+ {
1166
+ src: logoUrl,
1167
+ alt: logoAlt || "Logo",
1168
+ className: "h-[2.15rem] w-auto max-w-[200px] object-contain rounded-md shadow-md bg-transparent"
1169
+ }
1170
+ ) }) : /* @__PURE__ */ jsx12(
1148
1171
  "img",
1149
1172
  {
1150
1173
  src: logoUrl,
1151
1174
  alt: logoAlt || "Logo",
1152
1175
  className: "h-[2.15rem] w-auto max-w-[200px] object-contain rounded-md shadow-md bg-transparent"
1153
1176
  }
1154
- ) : /* @__PURE__ */ jsx12(
1177
+ ) : logoHref ? /* @__PURE__ */ jsx12(Link, { to: logoHref, className: "cursor-pointer hover:opacity-80 transition-opacity", children: /* @__PURE__ */ jsx12(
1178
+ "img",
1179
+ {
1180
+ 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",
1181
+ alt: logoAlt || "Logo",
1182
+ className: "h-8 w-8 shadow-md"
1183
+ }
1184
+ ) }) : /* @__PURE__ */ jsx12(
1155
1185
  "img",
1156
1186
  {
1157
1187
  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",
@@ -1227,6 +1257,7 @@ function PaceAppLayout({
1227
1257
  showEventSelector,
1228
1258
  headerActions,
1229
1259
  customLogo,
1260
+ logoHref = "/dashboard",
1230
1261
  customUserMenu,
1231
1262
  headerClassName,
1232
1263
  showUserMenu = true,
@@ -1416,7 +1447,7 @@ function PaceAppLayout({
1416
1447
  }
1417
1448
  }
1418
1449
  if (hasAccess && currentRoute.roles && currentRoute.roles.length > 0 && user?.id) {
1419
- const { useUnifiedAuth: useUnifiedAuth2 } = await import("./UnifiedAuthProvider-6JRTOFPS.js");
1450
+ const { useUnifiedAuth: useUnifiedAuth2 } = await import("./UnifiedAuthProvider-ZM7VUC45.js");
1420
1451
  hasAccess = true;
1421
1452
  }
1422
1453
  if (!isMounted) return;
@@ -1500,6 +1531,7 @@ function PaceAppLayout({
1500
1531
  logo: customLogo || void 0,
1501
1532
  logoUrl: !customLogo ? `/${appName.toLowerCase()}_logo_wide.svg` : void 0,
1502
1533
  logoAlt: `${appName} Logo`,
1534
+ logoHref,
1503
1535
  navItems: filteredMenuItems,
1504
1536
  actions: headerActions,
1505
1537
  userMenu: customUserMenu,
@@ -1658,9 +1690,104 @@ var PaceLoginPage = ({
1658
1690
  ] });
1659
1691
  };
1660
1692
 
1693
+ // src/components/SessionRestorationLoader.tsx
1694
+ import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
1695
+ var SessionRestorationLoader = ({
1696
+ message = "Restoring session..."
1697
+ }) => {
1698
+ return /* @__PURE__ */ jsxs12(
1699
+ "div",
1700
+ {
1701
+ style: {
1702
+ display: "flex",
1703
+ flexDirection: "column",
1704
+ alignItems: "center",
1705
+ justifyContent: "center",
1706
+ height: "100vh",
1707
+ width: "100%",
1708
+ gap: "1rem",
1709
+ textAlign: "center",
1710
+ padding: "1rem",
1711
+ background: "var(--background, transparent)"
1712
+ },
1713
+ children: [
1714
+ /* @__PURE__ */ jsx16(LoadingSpinner, { size: "lg" }),
1715
+ /* @__PURE__ */ jsx16(
1716
+ "div",
1717
+ {
1718
+ style: {
1719
+ fontSize: "0.95rem",
1720
+ color: "var(--muted-foreground, #6b7280)"
1721
+ },
1722
+ children: message
1723
+ }
1724
+ )
1725
+ ]
1726
+ }
1727
+ );
1728
+ };
1729
+
1730
+ // src/components/ProtectedRoute/ProtectedRoute.tsx
1731
+ init_UnifiedAuthProvider();
1732
+ init_useSessionRestoration();
1733
+ import { useMemo as useMemo6 } from "react";
1734
+ import { Navigate, Outlet as Outlet2 } from "react-router-dom";
1735
+ import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
1736
+ function ProtectedRoute({
1737
+ requireEvent = true,
1738
+ allowSuperAdminBypass = false,
1739
+ noEventsFallback,
1740
+ loadingFallback,
1741
+ loginPath = "/login"
1742
+ }) {
1743
+ const { isAuthenticated, isLoading } = useUnifiedAuth();
1744
+ const { selectedEvent, events, isLoading: eventLoading } = useEvents();
1745
+ const sessionRestoration = useSessionRestoration();
1746
+ const isRestoringSession = useMemo6(() => {
1747
+ return sessionRestoration.isRestoring && !sessionRestoration.restorationComplete && !sessionRestoration.restorationError && !sessionRestoration.hasTimedOut;
1748
+ }, [
1749
+ sessionRestoration.isRestoring,
1750
+ sessionRestoration.restorationComplete,
1751
+ sessionRestoration.restorationError,
1752
+ sessionRestoration.hasTimedOut
1753
+ ]);
1754
+ if (isRestoringSession) {
1755
+ return /* @__PURE__ */ jsx17(SessionRestorationLoader, {});
1756
+ }
1757
+ if (isLoading && !sessionRestoration.hasTimedOut) {
1758
+ return loadingFallback || /* @__PURE__ */ jsx17("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: "100vh" }, children: /* @__PURE__ */ jsx17(LoadingSpinner, {}) });
1759
+ }
1760
+ if (!isAuthenticated) {
1761
+ if (sessionRestoration.hasTimedOut || sessionRestoration.restorationError) {
1762
+ console.warn("[ProtectedRoute] Session restoration failed, redirecting to login", {
1763
+ timedOut: sessionRestoration.hasTimedOut,
1764
+ error: sessionRestoration.restorationError?.message
1765
+ });
1766
+ }
1767
+ return /* @__PURE__ */ jsx17(Navigate, { to: loginPath, replace: true });
1768
+ }
1769
+ if (!requireEvent) {
1770
+ return /* @__PURE__ */ jsx17(Outlet2, {});
1771
+ }
1772
+ if (eventLoading) {
1773
+ return /* @__PURE__ */ jsx17(Outlet2, {});
1774
+ }
1775
+ if (!events || events.length === 0) {
1776
+ return noEventsFallback || /* @__PURE__ */ jsx17("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "100vh", padding: "2rem" }, children: /* @__PURE__ */ jsxs13(Alert, { variant: "destructive", className: "max-w-md", children: [
1777
+ /* @__PURE__ */ jsx17(AlertTitle, { children: "No Events Available" }),
1778
+ /* @__PURE__ */ jsx17(AlertDescription, { children: "You don't have access to any events. Please contact your administrator if you believe this is an error." })
1779
+ ] }) });
1780
+ }
1781
+ if (!selectedEvent) {
1782
+ console.debug("[ProtectedRoute] Events available but none selected - allowing render so selector is visible");
1783
+ return /* @__PURE__ */ jsx17(Outlet2, {});
1784
+ }
1785
+ return /* @__PURE__ */ jsx17(Outlet2, {});
1786
+ }
1787
+
1661
1788
  // src/components/ErrorBoundary/ErrorBoundary.tsx
1662
1789
  import { Component } from "react";
1663
- import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
1790
+ import { jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
1664
1791
  var ErrorBoundary = class extends Component {
1665
1792
  constructor(props) {
1666
1793
  super(props);
@@ -1733,22 +1860,22 @@ var ErrorBoundary = class extends Component {
1733
1860
  if (fallback) {
1734
1861
  return fallback;
1735
1862
  }
1736
- return /* @__PURE__ */ jsx16(
1863
+ return /* @__PURE__ */ jsx18(
1737
1864
  "div",
1738
1865
  {
1739
1866
  role: "alert",
1740
1867
  className: "p-6 bg-destructive/10 border border-destructive/20 rounded-lg",
1741
1868
  "data-error-boundary": errorId,
1742
- children: /* @__PURE__ */ jsxs12("div", { className: "flex items-start gap-3", children: [
1743
- /* @__PURE__ */ jsx16("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx16("svg", { className: "w-5 h-5 text-destructive", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx16("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" }) }) }),
1744
- /* @__PURE__ */ jsxs12("div", { className: "flex-1 min-w-0", children: [
1745
- /* @__PURE__ */ jsxs12("h3", { className: "text-destructive", children: [
1869
+ children: /* @__PURE__ */ jsxs14("div", { className: "flex items-start gap-3", children: [
1870
+ /* @__PURE__ */ jsx18("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx18("svg", { className: "w-5 h-5 text-destructive", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx18("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" }) }) }),
1871
+ /* @__PURE__ */ jsxs14("div", { className: "flex-1 min-w-0", children: [
1872
+ /* @__PURE__ */ jsxs14("h3", { className: "text-destructive", children: [
1746
1873
  "Error in ",
1747
1874
  componentName
1748
1875
  ] }),
1749
- /* @__PURE__ */ jsx16("p", { className: "text-destructive/80", children: this.state.error?.message || "An unexpected error occurred." }),
1750
- enableRetry && retryCount < maxRetries && /* @__PURE__ */ jsxs12("div", { className: "flex gap-3 mb-4", children: [
1751
- /* @__PURE__ */ jsxs12(
1876
+ /* @__PURE__ */ jsx18("p", { className: "text-destructive/80", children: this.state.error?.message || "An unexpected error occurred." }),
1877
+ enableRetry && retryCount < maxRetries && /* @__PURE__ */ jsxs14("div", { className: "flex gap-3 mb-4", children: [
1878
+ /* @__PURE__ */ jsxs14(
1752
1879
  "button",
1753
1880
  {
1754
1881
  onClick: this.handleRetry,
@@ -1762,7 +1889,7 @@ var ErrorBoundary = class extends Component {
1762
1889
  ]
1763
1890
  }
1764
1891
  ),
1765
- /* @__PURE__ */ jsx16(
1892
+ /* @__PURE__ */ jsx18(
1766
1893
  "button",
1767
1894
  {
1768
1895
  onClick: () => window.location.reload(),
@@ -1771,9 +1898,9 @@ var ErrorBoundary = class extends Component {
1771
1898
  }
1772
1899
  )
1773
1900
  ] }),
1774
- retryCount >= maxRetries && /* @__PURE__ */ jsxs12("div", { className: "mb-4 p-3 bg-acc-50 border border-acc-200 rounded-md", children: [
1775
- /* @__PURE__ */ jsx16("p", { className: "text-acc-800", children: "Maximum retry attempts reached. Please reload the page or contact support." }),
1776
- /* @__PURE__ */ jsx16(
1901
+ retryCount >= maxRetries && /* @__PURE__ */ jsxs14("div", { className: "mb-4 p-3 bg-acc-50 border border-acc-200 rounded-md", children: [
1902
+ /* @__PURE__ */ jsx18("p", { className: "text-acc-800", children: "Maximum retry attempts reached. Please reload the page or contact support." }),
1903
+ /* @__PURE__ */ jsx18(
1777
1904
  "button",
1778
1905
  {
1779
1906
  onClick: () => window.location.reload(),
@@ -1782,14 +1909,14 @@ var ErrorBoundary = class extends Component {
1782
1909
  }
1783
1910
  )
1784
1911
  ] }),
1785
- import.meta.env.MODE === "development" && this.state.error && /* @__PURE__ */ jsxs12("details", { className: "text-sm text-destructive/70", children: [
1786
- /* @__PURE__ */ jsx16("summary", { className: "cursor-pointer font-medium mb-2", children: "Error Details (Development)" }),
1787
- /* @__PURE__ */ jsxs12("div", { className: "bg-destructive/5 p-3 rounded border", children: [
1788
- /* @__PURE__ */ jsxs12("p", { className: "font-mono", children: [
1912
+ import.meta.env.MODE === "development" && this.state.error && /* @__PURE__ */ jsxs14("details", { className: "text-sm text-destructive/70", children: [
1913
+ /* @__PURE__ */ jsx18("summary", { className: "cursor-pointer font-medium mb-2", children: "Error Details (Development)" }),
1914
+ /* @__PURE__ */ jsxs14("div", { className: "bg-destructive/5 p-3 rounded border", children: [
1915
+ /* @__PURE__ */ jsxs14("p", { className: "font-mono", children: [
1789
1916
  "Error ID: ",
1790
1917
  errorId
1791
1918
  ] }),
1792
- /* @__PURE__ */ jsxs12("pre", { className: "whitespace-pre-wrap text-xs overflow-auto max-h-32", children: [
1919
+ /* @__PURE__ */ jsxs14("pre", { className: "whitespace-pre-wrap text-xs overflow-auto max-h-32", children: [
1793
1920
  this.state.error.toString(),
1794
1921
  this.state.errorInfo?.componentStack
1795
1922
  ] })
@@ -1804,48 +1931,11 @@ var ErrorBoundary = class extends Component {
1804
1931
  }
1805
1932
  };
1806
1933
 
1807
- // src/components/SessionRestorationLoader.tsx
1808
- import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
1809
- var SessionRestorationLoader = ({
1810
- message = "Restoring session..."
1811
- }) => {
1812
- return /* @__PURE__ */ jsxs13(
1813
- "div",
1814
- {
1815
- style: {
1816
- display: "flex",
1817
- flexDirection: "column",
1818
- alignItems: "center",
1819
- justifyContent: "center",
1820
- height: "100vh",
1821
- width: "100%",
1822
- gap: "1rem",
1823
- textAlign: "center",
1824
- padding: "1rem",
1825
- background: "var(--background, transparent)"
1826
- },
1827
- children: [
1828
- /* @__PURE__ */ jsx17(LoadingSpinner, { size: "lg" }),
1829
- /* @__PURE__ */ jsx17(
1830
- "div",
1831
- {
1832
- style: {
1833
- fontSize: "0.95rem",
1834
- color: "var(--muted-foreground, #6b7280)"
1835
- },
1836
- children: message
1837
- }
1838
- )
1839
- ]
1840
- }
1841
- );
1842
- };
1843
-
1844
1934
  // src/components/OrganisationSelector/OrganisationSelector.tsx
1845
1935
  import { useState as useState7, useCallback as useCallback4 } from "react";
1846
1936
  init_OrganisationProvider();
1847
1937
  import { RefreshCw as RefreshCw2, AlertCircle as AlertCircle2, Building2, Shield } from "lucide-react";
1848
- import { jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
1938
+ import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
1849
1939
  function OrganisationSelector({
1850
1940
  placeholder = "Select organisation",
1851
1941
  className,
@@ -1909,21 +1999,21 @@ function OrganisationSelector({
1909
1999
  }
1910
2000
  }, [refreshOrganisations]);
1911
2001
  if (orgLoading) {
1912
- return /* @__PURE__ */ jsxs14("div", { className: `flex items-center gap-2 ${className}`, children: [
1913
- /* @__PURE__ */ jsx18(LoadingSpinner, { size: "sm" }),
1914
- /* @__PURE__ */ jsx18("span", { className: "text-sm text-muted-foreground", children: compact ? "Loading..." : "Loading organisations..." })
2002
+ return /* @__PURE__ */ jsxs15("div", { className: `flex items-center gap-2 ${className}`, children: [
2003
+ /* @__PURE__ */ jsx19(LoadingSpinner, { size: "sm" }),
2004
+ /* @__PURE__ */ jsx19("span", { className: "text-sm text-muted-foreground", children: compact ? "Loading..." : "Loading organisations..." })
1915
2005
  ] });
1916
2006
  }
1917
2007
  if (orgError) {
1918
- return /* @__PURE__ */ jsxs14("div", { className: `space-y-2 ${className}`, children: [
1919
- /* @__PURE__ */ jsxs14(Alert, { variant: "destructive", children: [
1920
- /* @__PURE__ */ jsx18(AlertCircle2, { className: "h-4 w-4" }),
1921
- /* @__PURE__ */ jsxs14(AlertDescription, { children: [
2008
+ return /* @__PURE__ */ jsxs15("div", { className: `space-y-2 ${className}`, children: [
2009
+ /* @__PURE__ */ jsxs15(Alert, { variant: "destructive", children: [
2010
+ /* @__PURE__ */ jsx19(AlertCircle2, { className: "h-4 w-4" }),
2011
+ /* @__PURE__ */ jsxs15(AlertDescription, { children: [
1922
2012
  "Failed to load organisations: ",
1923
2013
  orgError.message
1924
2014
  ] })
1925
2015
  ] }),
1926
- showRetryButton && /* @__PURE__ */ jsxs14(
2016
+ showRetryButton && /* @__PURE__ */ jsxs15(
1927
2017
  Button,
1928
2018
  {
1929
2019
  variant: "outline",
@@ -1932,7 +2022,7 @@ function OrganisationSelector({
1932
2022
  disabled: isLoading,
1933
2023
  className: "w-full",
1934
2024
  children: [
1935
- /* @__PURE__ */ jsx18(RefreshCw2, { className: `h-4 w-4 mr-2 ${isLoading ? "animate-spin" : ""}` }),
2025
+ /* @__PURE__ */ jsx19(RefreshCw2, { className: `h-4 w-4 mr-2 ${isLoading ? "animate-spin" : ""}` }),
1936
2026
  "Retry"
1937
2027
  ]
1938
2028
  }
@@ -1941,12 +2031,12 @@ function OrganisationSelector({
1941
2031
  }
1942
2032
  if (organisations.length === 0) {
1943
2033
  if (showNoOrganisationsMessage) {
1944
- return /* @__PURE__ */ jsxs14("div", { className: `space-y-2 ${className}`, children: [
1945
- /* @__PURE__ */ jsxs14(Alert, { children: [
1946
- /* @__PURE__ */ jsx18(Building2, { className: "h-4 w-4" }),
1947
- /* @__PURE__ */ jsx18(AlertDescription, { children: "No organisations available. Please contact your administrator to be added to an organisation." })
2034
+ return /* @__PURE__ */ jsxs15("div", { className: `space-y-2 ${className}`, children: [
2035
+ /* @__PURE__ */ jsxs15(Alert, { children: [
2036
+ /* @__PURE__ */ jsx19(Building2, { className: "h-4 w-4" }),
2037
+ /* @__PURE__ */ jsx19(AlertDescription, { children: "No organisations available. Please contact your administrator to be added to an organisation." })
1948
2038
  ] }),
1949
- showRetryButton && /* @__PURE__ */ jsxs14(
2039
+ showRetryButton && /* @__PURE__ */ jsxs15(
1950
2040
  Button,
1951
2041
  {
1952
2042
  variant: "outline",
@@ -1955,7 +2045,7 @@ function OrganisationSelector({
1955
2045
  disabled: isLoading,
1956
2046
  className: "w-full",
1957
2047
  children: [
1958
- /* @__PURE__ */ jsx18(RefreshCw2, { className: `h-4 w-4 mr-2 ${isLoading ? "animate-spin" : ""}` }),
2048
+ /* @__PURE__ */ jsx19(RefreshCw2, { className: `h-4 w-4 mr-2 ${isLoading ? "animate-spin" : ""}` }),
1959
2049
  "Check Again"
1960
2050
  ]
1961
2051
  }
@@ -1964,42 +2054,42 @@ function OrganisationSelector({
1964
2054
  }
1965
2055
  return null;
1966
2056
  }
1967
- const switchErrorDisplay = switchError && /* @__PURE__ */ jsxs14(Alert, { variant: "destructive", className: "mt-2", children: [
1968
- /* @__PURE__ */ jsx18(AlertCircle2, { className: "h-4 w-4" }),
1969
- /* @__PURE__ */ jsx18(AlertDescription, { children: switchError })
2057
+ const switchErrorDisplay = switchError && /* @__PURE__ */ jsxs15(Alert, { variant: "destructive", className: "mt-2", children: [
2058
+ /* @__PURE__ */ jsx19(AlertCircle2, { className: "h-4 w-4" }),
2059
+ /* @__PURE__ */ jsx19(AlertDescription, { children: switchError })
1970
2060
  ] });
1971
- return /* @__PURE__ */ jsxs14("div", { className: `space-y-2 ${className}`, children: [
1972
- /* @__PURE__ */ jsxs14(
2061
+ return /* @__PURE__ */ jsxs15("div", { className: `space-y-2 ${className}`, children: [
2062
+ /* @__PURE__ */ jsxs15(
1973
2063
  Select,
1974
2064
  {
1975
2065
  value: selectedOrganisation?.id || "",
1976
2066
  onValueChange: handleOrganisationChange,
1977
2067
  disabled: disabled || isLoading || !selectedOrganisation,
1978
2068
  children: [
1979
- /* @__PURE__ */ jsx18(SelectTrigger, { className: `${isLoading ? "opacity-50" : ""}`, children: /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2", children: [
1980
- isLoading ? /* @__PURE__ */ jsx18(LoadingSpinner, { size: "sm" }) : /* @__PURE__ */ jsx18(Building2, { className: "h-4 w-4 text-muted-foreground" }),
1981
- /* @__PURE__ */ jsx18(SelectValue, { placeholder })
2069
+ /* @__PURE__ */ jsx19(SelectTrigger, { className: `${isLoading ? "opacity-50" : ""}`, children: /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2", children: [
2070
+ isLoading ? /* @__PURE__ */ jsx19(LoadingSpinner, { size: "sm" }) : /* @__PURE__ */ jsx19(Building2, { className: "h-4 w-4 text-muted-foreground" }),
2071
+ /* @__PURE__ */ jsx19(SelectValue, { placeholder })
1982
2072
  ] }) }),
1983
- /* @__PURE__ */ jsx18(SelectContent, { children: organisations.map((org) => {
2073
+ /* @__PURE__ */ jsx19(SelectContent, { children: organisations.map((org) => {
1984
2074
  const userRole = getUserRole(org.id);
1985
2075
  const hasAccess = validateOrganisationAccess(org.id);
1986
- return /* @__PURE__ */ jsx18(
2076
+ return /* @__PURE__ */ jsx19(
1987
2077
  SelectItem,
1988
2078
  {
1989
2079
  value: org.id,
1990
2080
  disabled: !hasAccess,
1991
2081
  className: !hasAccess ? "opacity-50" : "",
1992
- children: /* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between w-full", children: [
1993
- /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2", children: [
1994
- /* @__PURE__ */ jsx18(Building2, { className: "h-4 w-4" }),
1995
- /* @__PURE__ */ jsxs14("div", { className: "flex flex-col", children: [
1996
- /* @__PURE__ */ jsx18("span", { className: "font-medium", children: org.display_name }),
1997
- !compact && org.description && /* @__PURE__ */ jsx18("span", { className: "text-xs text-muted-foreground truncate max-w-40", children: org.description })
2082
+ children: /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between w-full", children: [
2083
+ /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2", children: [
2084
+ /* @__PURE__ */ jsx19(Building2, { className: "h-4 w-4" }),
2085
+ /* @__PURE__ */ jsxs15("div", { className: "flex flex-col", children: [
2086
+ /* @__PURE__ */ jsx19("span", { className: "font-medium", children: org.display_name }),
2087
+ !compact && org.description && /* @__PURE__ */ jsx19("span", { className: "text-xs text-muted-foreground truncate max-w-40", children: org.description })
1998
2088
  ] })
1999
2089
  ] }),
2000
- showRole && /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-1 ml-4", children: [
2001
- /* @__PURE__ */ jsx18(Shield, { className: "h-3 w-3 text-muted-foreground" }),
2002
- /* @__PURE__ */ jsx18("span", { className: "text-xs text-muted-foreground capitalize", children: userRole?.replace("_", " ") || "No Role" })
2090
+ showRole && /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-1 ml-4", children: [
2091
+ /* @__PURE__ */ jsx19(Shield, { className: "h-3 w-3 text-muted-foreground" }),
2092
+ /* @__PURE__ */ jsx19("span", { className: "text-xs text-muted-foreground capitalize", children: userRole?.replace("_", " ") || "No Role" })
2003
2093
  ] })
2004
2094
  ] })
2005
2095
  },
@@ -2016,7 +2106,7 @@ function OrganisationSelector({
2016
2106
  // src/components/PasswordReset/PasswordResetForm.tsx
2017
2107
  import { useState as useState8 } from "react";
2018
2108
  init_UnifiedAuthProvider2();
2019
- import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
2109
+ import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
2020
2110
  function PasswordResetForm({
2021
2111
  onSuccess,
2022
2112
  onError,
@@ -2057,13 +2147,13 @@ function PasswordResetForm({
2057
2147
  setError(null);
2058
2148
  };
2059
2149
  if (isSuccess) {
2060
- return /* @__PURE__ */ jsx19("div", { className: cn("", className), role: "form", children: /* @__PURE__ */ jsxs15("div", { className: "space-y-4 text-center", children: [
2061
- /* @__PURE__ */ jsx19("h2", { children: "Check your email" }),
2062
- /* @__PURE__ */ jsxs15("p", { className: "text-sec-600", children: [
2150
+ return /* @__PURE__ */ jsx20("div", { className: cn("", className), role: "form", children: /* @__PURE__ */ jsxs16("div", { className: "space-y-4 text-center", children: [
2151
+ /* @__PURE__ */ jsx20("h2", { children: "Check your email" }),
2152
+ /* @__PURE__ */ jsxs16("p", { className: "text-sec-600", children: [
2063
2153
  "We have sent a password reset link to ",
2064
2154
  email
2065
2155
  ] }),
2066
- /* @__PURE__ */ jsx19(
2156
+ /* @__PURE__ */ jsx20(
2067
2157
  Button,
2068
2158
  {
2069
2159
  variant: "outline",
@@ -2074,15 +2164,15 @@ function PasswordResetForm({
2074
2164
  )
2075
2165
  ] }) });
2076
2166
  }
2077
- return /* @__PURE__ */ jsx19("div", { className: cn("", className), role: "form", children: /* @__PURE__ */ jsxs15("div", { className: "space-y-4", children: [
2078
- /* @__PURE__ */ jsxs15("div", { className: "space-y-2", children: [
2079
- /* @__PURE__ */ jsx19("h2", { children: "Reset Password" }),
2080
- /* @__PURE__ */ jsx19("p", { className: "text-sec-600", children: "Enter your email address and we'll send you a reset link." })
2167
+ return /* @__PURE__ */ jsx20("div", { className: cn("", className), role: "form", children: /* @__PURE__ */ jsxs16("div", { className: "space-y-4", children: [
2168
+ /* @__PURE__ */ jsxs16("div", { className: "space-y-2", children: [
2169
+ /* @__PURE__ */ jsx20("h2", { children: "Reset Password" }),
2170
+ /* @__PURE__ */ jsx20("p", { className: "text-sec-600", children: "Enter your email address and we'll send you a reset link." })
2081
2171
  ] }),
2082
- /* @__PURE__ */ jsxs15("form", { onSubmit: handleSubmit, className: "space-y-4", children: [
2083
- /* @__PURE__ */ jsxs15("div", { className: "space-y-2", children: [
2084
- /* @__PURE__ */ jsx19(Label, { htmlFor: "email", children: "Email Address" }),
2085
- /* @__PURE__ */ jsx19(
2172
+ /* @__PURE__ */ jsxs16("form", { onSubmit: handleSubmit, className: "space-y-4", children: [
2173
+ /* @__PURE__ */ jsxs16("div", { className: "space-y-2", children: [
2174
+ /* @__PURE__ */ jsx20(Label, { htmlFor: "email", children: "Email Address" }),
2175
+ /* @__PURE__ */ jsx20(
2086
2176
  Input,
2087
2177
  {
2088
2178
  id: "email",
@@ -2095,8 +2185,8 @@ function PasswordResetForm({
2095
2185
  }
2096
2186
  )
2097
2187
  ] }),
2098
- error && /* @__PURE__ */ jsx19("div", { className: "text-sm text-destructive", role: "alert", children: error }),
2099
- /* @__PURE__ */ jsx19(
2188
+ error && /* @__PURE__ */ jsx20("div", { className: "text-sm text-destructive", role: "alert", children: error }),
2189
+ /* @__PURE__ */ jsx20(
2100
2190
  Button,
2101
2191
  {
2102
2192
  type: "submit",
@@ -2110,7 +2200,7 @@ function PasswordResetForm({
2110
2200
  }
2111
2201
 
2112
2202
  // src/hooks/useFileReference.ts
2113
- import { useState as useState9, useCallback as useCallback5, useEffect as useEffect5, useRef as useRef2, useMemo as useMemo6 } from "react";
2203
+ import { useState as useState9, useCallback as useCallback5, useEffect as useEffect5, useRef as useRef2, useMemo as useMemo7 } from "react";
2114
2204
 
2115
2205
  // src/utils/file-reference.ts
2116
2206
  init_organisationContext();
@@ -2412,7 +2502,7 @@ async function uploadFileWithReference(supabase, options, file) {
2412
2502
  function useFileReference(supabase) {
2413
2503
  const [isLoading, setIsLoading] = useState9(false);
2414
2504
  const [error, setError] = useState9(null);
2415
- const service = useMemo6(() => createFileReferenceService(supabase), [supabase]);
2505
+ const service = useMemo7(() => createFileReferenceService(supabase), [supabase]);
2416
2506
  const uploadFile2 = useCallback5(async (options, file) => {
2417
2507
  setIsLoading(true);
2418
2508
  setError(null);
@@ -2745,7 +2835,7 @@ function useFilesByCategory(supabase, table_name, record_id, category, organisat
2745
2835
  }
2746
2836
 
2747
2837
  // src/components/FileUpload/FileUpload.tsx
2748
- import { useState as useState10, useCallback as useCallback6, useRef as useRef3, useEffect as useEffect6, useMemo as useMemo7 } from "react";
2838
+ import { useState as useState10, useCallback as useCallback6, useRef as useRef3, useEffect as useEffect6, useMemo as useMemo8 } from "react";
2749
2839
 
2750
2840
  // src/utils/appIdResolver.ts
2751
2841
  async function getAppId(supabase, appName) {
@@ -2787,7 +2877,7 @@ var CachedAppIdResolver = class {
2787
2877
  var cachedAppIdResolver = new CachedAppIdResolver();
2788
2878
 
2789
2879
  // src/components/FileUpload/FileUpload.tsx
2790
- import { Fragment as Fragment5, jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
2880
+ import { Fragment as Fragment5, jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
2791
2881
  function FileUpload({
2792
2882
  supabase,
2793
2883
  table_name,
@@ -2851,12 +2941,12 @@ function FileUpload({
2851
2941
  };
2852
2942
  resolveAppId();
2853
2943
  }, [app_id, supabase]);
2854
- const isUploading = useMemo7(() => {
2944
+ const isUploading = useMemo8(() => {
2855
2945
  return uploadStates.size > 0 && Array.from(uploadStates.values()).some(
2856
2946
  (state) => state.progress.status === "uploading" || state.progress.status === "processing"
2857
2947
  );
2858
2948
  }, [uploadStates]);
2859
- const isDisabled = useMemo7(() => {
2949
+ const isDisabled = useMemo8(() => {
2860
2950
  return disabled || isUploading || isResolvingAppId || !resolvedAppId;
2861
2951
  }, [disabled, isUploading, isResolvingAppId, resolvedAppId]);
2862
2952
  const generatePreview = useCallback6((file) => {
@@ -3116,8 +3206,8 @@ function FileUpload({
3116
3206
  };
3117
3207
  const dragClasses = isDragging ? "border-main-500 bg-main-50" : "border-sec-300 hover:border-sec-400";
3118
3208
  const disabledClasses = isDisabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:bg-sec-50";
3119
- return /* @__PURE__ */ jsxs16("div", { className: `space-y-4 ${className}`, children: [
3120
- /* @__PURE__ */ jsxs16(
3209
+ return /* @__PURE__ */ jsxs17("div", { className: `space-y-4 ${className}`, children: [
3210
+ /* @__PURE__ */ jsxs17(
3121
3211
  "div",
3122
3212
  {
3123
3213
  className: `relative border-2 border-dashed rounded-lg p-6 text-center transition-colors ${dragClasses} ${disabledClasses}`,
@@ -3126,8 +3216,8 @@ function FileUpload({
3126
3216
  onDrop: handleDrop,
3127
3217
  onClick: !isDisabled ? handleClick : void 0,
3128
3218
  children: [
3129
- children || /* @__PURE__ */ jsxs16("div", { className: "space-y-2", children: [
3130
- /* @__PURE__ */ jsx20(
3219
+ children || /* @__PURE__ */ jsxs17("div", { className: "space-y-2", children: [
3220
+ /* @__PURE__ */ jsx21(
3131
3221
  "input",
3132
3222
  {
3133
3223
  ref: fileInputRef,
@@ -3140,55 +3230,55 @@ function FileUpload({
3140
3230
  "data-testid": "file-input"
3141
3231
  }
3142
3232
  ),
3143
- /* @__PURE__ */ jsx20("div", { className: "text-sec-600", children: isResolvingAppId ? "Resolving app configuration..." : isDragging ? "Drop files here..." : /* @__PURE__ */ jsxs16(Fragment5, { children: [
3144
- /* @__PURE__ */ jsx20("span", { className: "font-medium", children: "Click to upload" }),
3233
+ /* @__PURE__ */ jsx21("div", { className: "text-sec-600", children: isResolvingAppId ? "Resolving app configuration..." : isDragging ? "Drop files here..." : /* @__PURE__ */ jsxs17(Fragment5, { children: [
3234
+ /* @__PURE__ */ jsx21("span", { className: "font-medium", children: "Click to upload" }),
3145
3235
  " ",
3146
3236
  "or drag and drop"
3147
3237
  ] }) }),
3148
- /* @__PURE__ */ jsxs16("div", { className: "text-sm text-sec-500", children: [
3238
+ /* @__PURE__ */ jsxs17("div", { className: "text-sm text-sec-500", children: [
3149
3239
  !isResolvingAppId && accept !== "*/*" && `Accepted formats: ${accept}`,
3150
3240
  !isResolvingAppId && maxSize && ` \u2022 Max size: ${Math.round(maxSize / 1024 / 1024)}MB`,
3151
3241
  !isResolvingAppId && multiple && " \u2022 Multiple files allowed"
3152
3242
  ] })
3153
3243
  ] }),
3154
- 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" }) })
3244
+ isUploading && !showProgress && /* @__PURE__ */ jsx21("div", { className: "absolute inset-0 bg-white bg-opacity-75 flex items-center justify-center", children: /* @__PURE__ */ jsx21("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-main-500" }) })
3155
3245
  ]
3156
3246
  }
3157
3247
  ),
3158
- showProgress && uploadStates.size > 0 && /* @__PURE__ */ jsx20("div", { className: "space-y-2", children: Array.from(uploadStates.entries()).map(([fileId, uploadState]) => {
3248
+ showProgress && uploadStates.size > 0 && /* @__PURE__ */ jsx21("div", { className: "space-y-2", children: Array.from(uploadStates.entries()).map(([fileId, uploadState]) => {
3159
3249
  const { file, progress, preview, result } = uploadState;
3160
3250
  const isError = progress.status === "error";
3161
3251
  const isCompleted = progress.status === "completed";
3162
3252
  const isUploading2 = progress.status === "uploading" || progress.status === "processing";
3163
- return /* @__PURE__ */ jsxs16(
3253
+ return /* @__PURE__ */ jsxs17(
3164
3254
  "div",
3165
3255
  {
3166
3256
  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"}`,
3167
3257
  children: [
3168
- /* @__PURE__ */ jsx20("div", { className: "flex-shrink-0", children: preview ? /* @__PURE__ */ jsx20(
3258
+ /* @__PURE__ */ jsx21("div", { className: "flex-shrink-0", children: preview ? /* @__PURE__ */ jsx21(
3169
3259
  "img",
3170
3260
  {
3171
3261
  src: preview,
3172
3262
  alt: file.name,
3173
3263
  className: "w-12 h-12 object-cover rounded"
3174
3264
  }
3175
- ) : /* @__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}" }) }) }),
3176
- /* @__PURE__ */ jsxs16("div", { className: "flex-1 min-w-0", children: [
3177
- /* @__PURE__ */ jsx20("div", { className: "font-medium text-sec-900 truncate", children: file.name }),
3178
- /* @__PURE__ */ jsxs16("div", { className: "text-sm text-sec-500", children: [
3265
+ ) : /* @__PURE__ */ jsx21("div", { className: "w-12 h-12 flex items-center justify-center bg-sec-200 rounded", children: /* @__PURE__ */ jsx21("span", { className: "text-2xl", children: "\u{1F4C4}" }) }) }),
3266
+ /* @__PURE__ */ jsxs17("div", { className: "flex-1 min-w-0", children: [
3267
+ /* @__PURE__ */ jsx21("div", { className: "font-medium text-sec-900 truncate", children: file.name }),
3268
+ /* @__PURE__ */ jsxs17("div", { className: "text-sm text-sec-500", children: [
3179
3269
  formatFileSize(file.size),
3180
3270
  isCompleted && result && " \u2022 Uploaded",
3181
3271
  isError && progress.error && ` \u2022 ${progress.error}`
3182
3272
  ] }),
3183
- showProgress && (isUploading2 || isError) && /* @__PURE__ */ jsxs16("div", { className: "mt-2", children: [
3184
- /* @__PURE__ */ jsx20("div", { className: "w-full bg-sec-200 rounded-full h-2", children: /* @__PURE__ */ jsx20(
3273
+ showProgress && (isUploading2 || isError) && /* @__PURE__ */ jsxs17("div", { className: "mt-2", children: [
3274
+ /* @__PURE__ */ jsx21("div", { className: "w-full bg-sec-200 rounded-full h-2", children: /* @__PURE__ */ jsx21(
3185
3275
  "div",
3186
3276
  {
3187
3277
  className: `h-2 rounded-full transition-all duration-300 ${isError ? "bg-acc-500" : "bg-main-500"}`,
3188
3278
  style: { width: `${progress.percentage}%` }
3189
3279
  }
3190
3280
  ) }),
3191
- isUploading2 && /* @__PURE__ */ jsxs16("div", { className: "text-xs text-sec-500 mt-1", children: [
3281
+ isUploading2 && /* @__PURE__ */ jsxs17("div", { className: "text-xs text-sec-500 mt-1", children: [
3192
3282
  progress.percentage,
3193
3283
  "% \u2022 ",
3194
3284
  formatFileSize(progress.loaded),
@@ -3197,24 +3287,24 @@ function FileUpload({
3197
3287
  ] })
3198
3288
  ] })
3199
3289
  ] }),
3200
- /* @__PURE__ */ jsxs16("div", { className: "flex-shrink-0", children: [
3201
- isCompleted && /* @__PURE__ */ jsx20("span", { className: "text-success-500 text-xl", children: "\u2713" }),
3202
- isError && /* @__PURE__ */ jsx20("span", { className: "text-acc-500 text-xl", children: "\u2715" }),
3203
- isUploading2 && /* @__PURE__ */ jsx20("div", { className: "animate-spin rounded-full h-5 w-5 border-b-2 border-main-500" })
3290
+ /* @__PURE__ */ jsxs17("div", { className: "flex-shrink-0", children: [
3291
+ isCompleted && /* @__PURE__ */ jsx21("span", { className: "text-success-500 text-xl", children: "\u2713" }),
3292
+ isError && /* @__PURE__ */ jsx21("span", { className: "text-acc-500 text-xl", children: "\u2715" }),
3293
+ isUploading2 && /* @__PURE__ */ jsx21("div", { className: "animate-spin rounded-full h-5 w-5 border-b-2 border-main-500" })
3204
3294
  ] })
3205
3295
  ]
3206
3296
  },
3207
3297
  fileId
3208
3298
  );
3209
3299
  }) }),
3210
- appIdError && /* @__PURE__ */ jsx20("div", { className: "p-3 bg-acc-50 border border-acc-200 rounded-lg text-sm text-acc-600", children: appIdError }),
3211
- error && /* @__PURE__ */ jsx20("div", { className: "p-3 bg-acc-50 border border-acc-200 rounded-lg text-sm text-acc-600", children: error })
3300
+ appIdError && /* @__PURE__ */ jsx21("div", { className: "p-3 bg-acc-50 border border-acc-200 rounded-lg text-sm text-acc-600", children: appIdError }),
3301
+ error && /* @__PURE__ */ jsx21("div", { className: "p-3 bg-acc-50 border border-acc-200 rounded-lg text-sm text-acc-600", children: error })
3212
3302
  ] });
3213
3303
  }
3214
3304
 
3215
3305
  // src/components/FileDisplay/FileDisplay.tsx
3216
3306
  import { useState as useState11, useEffect as useEffect7, useRef as useRef4 } from "react";
3217
- import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
3307
+ import { jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
3218
3308
  function FileDisplay({
3219
3309
  supabase,
3220
3310
  table_name,
@@ -3348,15 +3438,15 @@ function FileDisplay({
3348
3438
  return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
3349
3439
  };
3350
3440
  if (isLoading) {
3351
- 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" }) });
3441
+ 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" }) });
3352
3442
  }
3353
3443
  if (error) {
3354
- return /* @__PURE__ */ jsxs17("div", { className: `p-4 bg-acc-50 border border-acc-200 rounded-lg ${className}`, children: [
3355
- /* @__PURE__ */ jsxs17("div", { className: "text-acc-600", children: [
3444
+ return /* @__PURE__ */ jsxs18("div", { className: `p-4 bg-acc-50 border border-acc-200 rounded-lg ${className}`, children: [
3445
+ /* @__PURE__ */ jsxs18("div", { className: "text-acc-600", children: [
3356
3446
  "Error loading file: ",
3357
3447
  error
3358
3448
  ] }),
3359
- /* @__PURE__ */ jsx21(
3449
+ /* @__PURE__ */ jsx22(
3360
3450
  "button",
3361
3451
  {
3362
3452
  onClick: clearError,
@@ -3367,16 +3457,16 @@ function FileDisplay({
3367
3457
  ] });
3368
3458
  }
3369
3459
  if (fileCount === 0) {
3370
- return /* @__PURE__ */ jsxs17("div", { className: `text-sec-500 text-center p-4 ${className}`, children: [
3460
+ return /* @__PURE__ */ jsxs18("div", { className: `text-sec-500 text-center p-4 ${className}`, children: [
3371
3461
  "No files found",
3372
3462
  children
3373
3463
  ] });
3374
3464
  }
3375
3465
  if (category && fileReference) {
3376
3466
  const isImage = fileReference.file_metadata.fileType?.startsWith("image/");
3377
- return /* @__PURE__ */ jsxs17("div", { className: `space-y-2 ${className}`, children: [
3378
- isImage && fileUrl && !imageError ? /* @__PURE__ */ jsxs17("div", { className: "relative", children: [
3379
- /* @__PURE__ */ jsx21(
3467
+ return /* @__PURE__ */ jsxs18("div", { className: `space-y-2 ${className}`, children: [
3468
+ isImage && fileUrl && !imageError ? /* @__PURE__ */ jsxs18("div", { className: "relative", children: [
3469
+ /* @__PURE__ */ jsx22(
3380
3470
  "img",
3381
3471
  {
3382
3472
  src: fileUrl,
@@ -3385,7 +3475,7 @@ function FileDisplay({
3385
3475
  onError: handleImageError
3386
3476
  }
3387
3477
  ),
3388
- showDelete && /* @__PURE__ */ jsx21(
3478
+ showDelete && /* @__PURE__ */ jsx22(
3389
3479
  "button",
3390
3480
  {
3391
3481
  onClick: handleDelete,
@@ -3395,16 +3485,16 @@ function FileDisplay({
3395
3485
  children: "\xD7"
3396
3486
  }
3397
3487
  )
3398
- ] }) : /* @__PURE__ */ jsxs17("div", { className: "flex items-center space-x-3 p-3 bg-sec-50 rounded-lg border border-sec-200", children: [
3399
- /* @__PURE__ */ jsx21("span", { className: "text-2xl", children: getFileIcon(fileReference.file_metadata.fileType || "") }),
3400
- /* @__PURE__ */ jsxs17("div", { className: "flex-1 min-w-0", children: [
3401
- /* @__PURE__ */ jsx21("div", { className: "font-medium text-sec-900 truncate", children: fileReference.file_metadata.fileName || "Unknown file" }),
3402
- /* @__PURE__ */ jsxs17("div", { className: "text-sm text-sec-500", children: [
3488
+ ] }) : /* @__PURE__ */ jsxs18("div", { className: "flex items-center space-x-3 p-3 bg-sec-50 rounded-lg border border-sec-200", children: [
3489
+ /* @__PURE__ */ jsx22("span", { className: "text-2xl", children: getFileIcon(fileReference.file_metadata.fileType || "") }),
3490
+ /* @__PURE__ */ jsxs18("div", { className: "flex-1 min-w-0", children: [
3491
+ /* @__PURE__ */ jsx22("div", { className: "font-medium text-sec-900 truncate", children: fileReference.file_metadata.fileName || "Unknown file" }),
3492
+ /* @__PURE__ */ jsxs18("div", { className: "text-sm text-sec-500", children: [
3403
3493
  fileReference.file_metadata.fileSize && formatFileSize(fileReference.file_metadata.fileSize),
3404
3494
  fileReference.file_metadata.fileType && ` \u2022 ${fileReference.file_metadata.fileType}`
3405
3495
  ] })
3406
3496
  ] }),
3407
- showDelete && /* @__PURE__ */ jsx21(
3497
+ showDelete && /* @__PURE__ */ jsx22(
3408
3498
  "button",
3409
3499
  {
3410
3500
  onClick: handleDelete,
@@ -3418,14 +3508,14 @@ function FileDisplay({
3418
3508
  children
3419
3509
  ] });
3420
3510
  }
3421
- return /* @__PURE__ */ jsxs17("div", { className: `space-y-2 ${className}`, children: [
3511
+ return /* @__PURE__ */ jsxs18("div", { className: `space-y-2 ${className}`, children: [
3422
3512
  fileReferences.map((fileRef) => {
3423
3513
  const isImage = fileRef.file_metadata.fileType?.startsWith("image/");
3424
3514
  const fileUrl2 = fileUrls.get(fileRef.id) || null;
3425
3515
  const isLoadingUrl = loadingUrls.has(fileRef.id);
3426
3516
  const canDownload = !isImage && fileUrl2;
3427
- return /* @__PURE__ */ jsxs17("div", { className: "flex items-center space-x-3 p-3 bg-sec-50 rounded-lg border border-sec-200", children: [
3428
- isLoadingUrl ? /* @__PURE__ */ jsx21("div", { className: "w-12 h-12 flex items-center justify-center", children: /* @__PURE__ */ jsx21("div", { className: "animate-spin rounded-full h-6 w-6 border-b-2 border-main-500" }) }) : isImage && fileUrl2 ? /* @__PURE__ */ jsx21(
3517
+ return /* @__PURE__ */ jsxs18("div", { className: "flex items-center space-x-3 p-3 bg-sec-50 rounded-lg border border-sec-200", children: [
3518
+ 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(
3429
3519
  "img",
3430
3520
  {
3431
3521
  src: fileUrl2,
@@ -3433,17 +3523,17 @@ function FileDisplay({
3433
3523
  className: "w-12 h-12 object-cover rounded",
3434
3524
  onError: handleImageError
3435
3525
  }
3436
- ) : /* @__PURE__ */ jsx21("span", { className: "text-2xl", children: getFileIcon(fileRef.file_metadata.fileType || "") }),
3437
- /* @__PURE__ */ jsxs17("div", { className: "flex-1 min-w-0", children: [
3438
- /* @__PURE__ */ jsx21("div", { className: "font-medium text-sec-900 truncate", children: fileRef.file_metadata.fileName || "Unknown file" }),
3439
- /* @__PURE__ */ jsxs17("div", { className: "text-sm text-sec-500", children: [
3526
+ ) : /* @__PURE__ */ jsx22("span", { className: "text-2xl", children: getFileIcon(fileRef.file_metadata.fileType || "") }),
3527
+ /* @__PURE__ */ jsxs18("div", { className: "flex-1 min-w-0", children: [
3528
+ /* @__PURE__ */ jsx22("div", { className: "font-medium text-sec-900 truncate", children: fileRef.file_metadata.fileName || "Unknown file" }),
3529
+ /* @__PURE__ */ jsxs18("div", { className: "text-sm text-sec-500", children: [
3440
3530
  fileRef.file_metadata.fileSize && formatFileSize(fileRef.file_metadata.fileSize),
3441
3531
  fileRef.file_metadata.fileType && ` \u2022 ${fileRef.file_metadata.fileType}`,
3442
3532
  fileRef.file_metadata.category && ` \u2022 ${fileRef.file_metadata.category}`
3443
3533
  ] })
3444
3534
  ] }),
3445
- /* @__PURE__ */ jsxs17("div", { className: "flex items-center space-x-2", children: [
3446
- canDownload && /* @__PURE__ */ jsx21(
3535
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-center space-x-2", children: [
3536
+ canDownload && /* @__PURE__ */ jsx22(
3447
3537
  "a",
3448
3538
  {
3449
3539
  href: fileRef.file_path,
@@ -3453,7 +3543,7 @@ function FileDisplay({
3453
3543
  children: "\u2193"
3454
3544
  }
3455
3545
  ),
3456
- showDelete && /* @__PURE__ */ jsx21(
3546
+ showDelete && /* @__PURE__ */ jsx22(
3457
3547
  "button",
3458
3548
  {
3459
3549
  onClick: () => deleteFile2(true),
@@ -3470,7 +3560,7 @@ function FileDisplay({
3470
3560
  }
3471
3561
 
3472
3562
  // src/hooks/useEventLogo.ts
3473
- import { useState as useState12, useEffect as useEffect8, useCallback as useCallback8, useMemo as useMemo8 } from "react";
3563
+ import { useState as useState12, useEffect as useEffect8, useCallback as useCallback8, useMemo as useMemo9 } from "react";
3474
3564
  function defaultGenerateFallbackText(eventName) {
3475
3565
  if (!eventName) return "EV";
3476
3566
  return eventName.split(" ").map((word) => word.charAt(0).toUpperCase()).join("").substring(0, 3);
@@ -3502,7 +3592,7 @@ function useEventLogo(supabase, eventId, eventName, organisationId, options = {}
3502
3592
  const [logoUrl, setLogoUrl] = useState12(null);
3503
3593
  const [isLoading, setIsLoading] = useState12(false);
3504
3594
  const [error, setError] = useState12(null);
3505
- const fallbackText = useMemo8(() => {
3595
+ const fallbackText = useMemo9(() => {
3506
3596
  return eventName ? generateFallbackText(eventName) : "EV";
3507
3597
  }, [eventName, generateFallbackText]);
3508
3598
  const fetchLogo = useCallback8(async () => {
@@ -3630,9 +3720,9 @@ function getEventLogoCacheStats() {
3630
3720
  }
3631
3721
 
3632
3722
  // src/components/Table/Table.tsx
3633
- import * as React18 from "react";
3634
- import { jsx as jsx22 } from "react/jsx-runtime";
3635
- var Table = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
3723
+ import * as React19 from "react";
3724
+ import { jsx as jsx23 } from "react/jsx-runtime";
3725
+ var Table = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
3636
3726
  "table",
3637
3727
  {
3638
3728
  ref,
@@ -3641,9 +3731,9 @@ var Table = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
3641
3731
  }
3642
3732
  ));
3643
3733
  Table.displayName = "Table";
3644
- var TableHeader = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
3734
+ var TableHeader = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
3645
3735
  TableHeader.displayName = "TableHeader";
3646
- var TableBody = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
3736
+ var TableBody = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
3647
3737
  "tbody",
3648
3738
  {
3649
3739
  ref,
@@ -3652,7 +3742,7 @@ var TableBody = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE_
3652
3742
  }
3653
3743
  ));
3654
3744
  TableBody.displayName = "TableBody";
3655
- var TableFooter = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
3745
+ var TableFooter = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
3656
3746
  "tfoot",
3657
3747
  {
3658
3748
  ref,
@@ -3664,7 +3754,7 @@ var TableFooter = React18.forwardRef(({ className, ...props }, ref) => /* @__PUR
3664
3754
  }
3665
3755
  ));
3666
3756
  TableFooter.displayName = "TableFooter";
3667
- var TableRow = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
3757
+ var TableRow = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
3668
3758
  "tr",
3669
3759
  {
3670
3760
  ref,
@@ -3676,7 +3766,7 @@ var TableRow = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__
3676
3766
  }
3677
3767
  ));
3678
3768
  TableRow.displayName = "TableRow";
3679
- var TableHead = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
3769
+ var TableHead = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
3680
3770
  "th",
3681
3771
  {
3682
3772
  ref,
@@ -3688,7 +3778,7 @@ var TableHead = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE_
3688
3778
  }
3689
3779
  ));
3690
3780
  TableHead.displayName = "TableHead";
3691
- var TableCell = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
3781
+ var TableCell = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
3692
3782
  "td",
3693
3783
  {
3694
3784
  ref,
@@ -3697,7 +3787,7 @@ var TableCell = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE_
3697
3787
  }
3698
3788
  ));
3699
3789
  TableCell.displayName = "TableCell";
3700
- var TableCaption = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
3790
+ var TableCaption = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
3701
3791
  "caption",
3702
3792
  {
3703
3793
  ref,
@@ -3708,9 +3798,9 @@ var TableCaption = React18.forwardRef(({ className, ...props }, ref) => /* @__PU
3708
3798
  TableCaption.displayName = "TableCaption";
3709
3799
 
3710
3800
  // src/components/PublicLayout/EventLogo.tsx
3711
- import { useMemo as useMemo9, useContext } from "react";
3801
+ import { useMemo as useMemo10, useContext } from "react";
3712
3802
  init_UnifiedAuthProvider();
3713
- import { jsx as jsx23 } from "react/jsx-runtime";
3803
+ import { jsx as jsx24 } from "react/jsx-runtime";
3714
3804
  var sizeClasses = {
3715
3805
  xs: "h-4 w-4 text-xs",
3716
3806
  sm: "h-6 w-6 text-sm",
@@ -3741,7 +3831,7 @@ function EventLogoPublic({
3741
3831
  const hasValidOrganisationId = organisationId && uuidRegex.test(organisationId);
3742
3832
  if (!supabase) {
3743
3833
  const effectiveSize = size || "md";
3744
- return /* @__PURE__ */ jsx23("div", { className: `${sizeClasses[effectiveSize]} ${className}`.trim(), title: `${eventName} logo (Supabase not configured)`, children: eventName ? defaultGenerateFallbackText2(eventName) : "EV" });
3834
+ return /* @__PURE__ */ jsx24("div", { className: `${sizeClasses[effectiveSize]} ${className}`.trim(), title: `${eventName} logo (Supabase not configured)`, children: eventName ? defaultGenerateFallbackText2(eventName) : "EV" });
3745
3835
  }
3746
3836
  const {
3747
3837
  logoUrl,
@@ -3759,36 +3849,36 @@ function EventLogoPublic({
3759
3849
  supabase
3760
3850
  }
3761
3851
  );
3762
- const sizeClass = useMemo9(() => sizeClasses[size || "md"], [size]);
3763
- const combinedClasses = useMemo9(() => {
3852
+ const sizeClass = useMemo10(() => sizeClasses[size || "md"], [size]);
3853
+ const combinedClasses = useMemo10(() => {
3764
3854
  const baseClasses = "flex items-center justify-center bg-gray-100 text-gray-600 font-semibold rounded";
3765
3855
  return `${baseClasses} ${sizeClass} ${className}`.trim();
3766
3856
  }, [sizeClass, className]);
3767
3857
  if (!hasValidOrganisationId && !isLoading && !logoUrl && showFallback) {
3768
- return /* @__PURE__ */ jsx23("div", { className: combinedClasses, title: `${eventName} logo (invalid organisation ID)`, children: fallbackText });
3858
+ return /* @__PURE__ */ jsx24("div", { className: combinedClasses, title: `${eventName} logo (invalid organisation ID)`, children: fallbackText });
3769
3859
  }
3770
3860
  if (isLoading) {
3771
3861
  if (LoadingComponent) {
3772
- return /* @__PURE__ */ jsx23(LoadingComponent, {});
3862
+ return /* @__PURE__ */ jsx24(LoadingComponent, {});
3773
3863
  }
3774
- return /* @__PURE__ */ jsx23("div", { className: `${combinedClasses} animate-pulse`, children: /* @__PURE__ */ jsx23("div", { className: "w-3/4 h-3/4 bg-gray-300 rounded" }) });
3864
+ return /* @__PURE__ */ jsx24("div", { className: `${combinedClasses} animate-pulse`, children: /* @__PURE__ */ jsx24("div", { className: "w-3/4 h-3/4 bg-gray-300 rounded" }) });
3775
3865
  }
3776
3866
  if (error) {
3777
3867
  if (ErrorComponent) {
3778
- return /* @__PURE__ */ jsx23(ErrorComponent, { error });
3868
+ return /* @__PURE__ */ jsx24(ErrorComponent, { error });
3779
3869
  }
3780
3870
  if (showFallback) {
3781
- return /* @__PURE__ */ jsx23("div", { className: combinedClasses, title: `${eventName} (logo unavailable)`, children: fallbackText });
3871
+ return /* @__PURE__ */ jsx24("div", { className: combinedClasses, title: `${eventName} (logo unavailable)`, children: fallbackText });
3782
3872
  }
3783
3873
  return null;
3784
3874
  }
3785
3875
  if (!logoUrl) {
3786
3876
  if (showFallback) {
3787
- return /* @__PURE__ */ jsx23("div", { className: combinedClasses, title: `${eventName} logo`, children: fallbackText });
3877
+ return /* @__PURE__ */ jsx24("div", { className: combinedClasses, title: `${eventName} logo`, children: fallbackText });
3788
3878
  }
3789
3879
  return null;
3790
3880
  }
3791
- return /* @__PURE__ */ jsx23(
3881
+ return /* @__PURE__ */ jsx24(
3792
3882
  "img",
3793
3883
  {
3794
3884
  src: logoUrl,
@@ -3823,7 +3913,7 @@ function EventLogoAuthenticated({
3823
3913
  const hasValidOrganisationId = organisationId && uuidRegex.test(organisationId);
3824
3914
  if (!supabase) {
3825
3915
  const effectiveSize = size || "md";
3826
- return /* @__PURE__ */ jsx23("div", { className: `${sizeClasses[effectiveSize]} ${className}`.trim(), title: `${eventName} logo (Supabase not configured)`, children: eventName ? defaultGenerateFallbackText2(eventName) : "EV" });
3916
+ return /* @__PURE__ */ jsx24("div", { className: `${sizeClasses[effectiveSize]} ${className}`.trim(), title: `${eventName} logo (Supabase not configured)`, children: eventName ? defaultGenerateFallbackText2(eventName) : "EV" });
3827
3917
  }
3828
3918
  const {
3829
3919
  logoUrl,
@@ -3840,36 +3930,36 @@ function EventLogoAuthenticated({
3840
3930
  generateFallbackText
3841
3931
  }
3842
3932
  );
3843
- const sizeClass = useMemo9(() => sizeClasses[size || "md"], [size]);
3844
- const combinedClasses = useMemo9(() => {
3933
+ const sizeClass = useMemo10(() => sizeClasses[size || "md"], [size]);
3934
+ const combinedClasses = useMemo10(() => {
3845
3935
  const baseClasses = "flex items-center justify-center bg-gray-100 text-gray-600 font-semibold rounded";
3846
3936
  return `${baseClasses} ${sizeClass} ${className}`.trim();
3847
3937
  }, [sizeClass, className]);
3848
3938
  if (!hasValidOrganisationId && !isLoading && !logoUrl && showFallback) {
3849
- return /* @__PURE__ */ jsx23("div", { className: combinedClasses, title: `${eventName} logo (invalid organisation ID)`, children: fallbackText });
3939
+ return /* @__PURE__ */ jsx24("div", { className: combinedClasses, title: `${eventName} logo (invalid organisation ID)`, children: fallbackText });
3850
3940
  }
3851
3941
  if (isLoading) {
3852
3942
  if (LoadingComponent) {
3853
- return /* @__PURE__ */ jsx23(LoadingComponent, {});
3943
+ return /* @__PURE__ */ jsx24(LoadingComponent, {});
3854
3944
  }
3855
- return /* @__PURE__ */ jsx23("div", { className: `${combinedClasses} animate-pulse`, children: /* @__PURE__ */ jsx23("div", { className: "w-3/4 h-3/4 bg-gray-300 rounded" }) });
3945
+ return /* @__PURE__ */ jsx24("div", { className: `${combinedClasses} animate-pulse`, children: /* @__PURE__ */ jsx24("div", { className: "w-3/4 h-3/4 bg-gray-300 rounded" }) });
3856
3946
  }
3857
3947
  if (error) {
3858
3948
  if (ErrorComponent) {
3859
- return /* @__PURE__ */ jsx23(ErrorComponent, { error });
3949
+ return /* @__PURE__ */ jsx24(ErrorComponent, { error });
3860
3950
  }
3861
3951
  if (showFallback) {
3862
- return /* @__PURE__ */ jsx23("div", { className: combinedClasses, title: `${eventName} (logo unavailable)`, children: fallbackText });
3952
+ return /* @__PURE__ */ jsx24("div", { className: combinedClasses, title: `${eventName} (logo unavailable)`, children: fallbackText });
3863
3953
  }
3864
3954
  return null;
3865
3955
  }
3866
3956
  if (!logoUrl) {
3867
3957
  if (showFallback) {
3868
- return /* @__PURE__ */ jsx23("div", { className: combinedClasses, title: `${eventName} logo`, children: fallbackText });
3958
+ return /* @__PURE__ */ jsx24("div", { className: combinedClasses, title: `${eventName} logo`, children: fallbackText });
3869
3959
  }
3870
3960
  return null;
3871
3961
  }
3872
- return /* @__PURE__ */ jsx23(
3962
+ return /* @__PURE__ */ jsx24(
3873
3963
  "img",
3874
3964
  {
3875
3965
  src: logoUrl,
@@ -3901,7 +3991,7 @@ function EventLogo({
3901
3991
  }) {
3902
3992
  const isPublicPage = useIsPublicPage();
3903
3993
  if (isPublicPage) {
3904
- return /* @__PURE__ */ jsx23(
3994
+ return /* @__PURE__ */ jsx24(
3905
3995
  EventLogoPublic,
3906
3996
  {
3907
3997
  eventId,
@@ -3917,7 +4007,7 @@ function EventLogo({
3917
4007
  }
3918
4008
  );
3919
4009
  }
3920
- return /* @__PURE__ */ jsx23(
4010
+ return /* @__PURE__ */ jsx24(
3921
4011
  EventLogoAuthenticated,
3922
4012
  {
3923
4013
  eventId,
@@ -3934,7 +4024,7 @@ function EventLogo({
3934
4024
  );
3935
4025
  }
3936
4026
  function EventLogoCompact(props) {
3937
- return /* @__PURE__ */ jsx23(
4027
+ return /* @__PURE__ */ jsx24(
3938
4028
  EventLogo,
3939
4029
  {
3940
4030
  ...props,
@@ -3944,7 +4034,7 @@ function EventLogoCompact(props) {
3944
4034
  );
3945
4035
  }
3946
4036
  function EventLogoLarge(props) {
3947
- return /* @__PURE__ */ jsx23(
4037
+ return /* @__PURE__ */ jsx24(
3948
4038
  EventLogo,
3949
4039
  {
3950
4040
  ...props,
@@ -3955,7 +4045,7 @@ function EventLogoLarge(props) {
3955
4045
  }
3956
4046
 
3957
4047
  // src/components/PublicLayout/PublicPageHeader.tsx
3958
- import { Fragment as Fragment6, jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
4048
+ import { Fragment as Fragment6, jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
3959
4049
  function PublicPageHeader({
3960
4050
  event,
3961
4051
  eventCode,
@@ -3970,10 +4060,10 @@ function PublicPageHeader({
3970
4060
  }) {
3971
4061
  const { appName } = useAppConfig();
3972
4062
  const headerClasses = `bg-white border-b border-gray-200 ${className}`.trim();
3973
- return /* @__PURE__ */ jsx24("header", { className: headerClasses, children: /* @__PURE__ */ jsxs18("div", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto", children: [
3974
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between py-4", children: [
3975
- showAppLogo && /* @__PURE__ */ jsx24("div", { className: "flex-shrink-0", children: customAppLogo || /* @__PURE__ */ jsxs18("div", { className: "flex items-center", children: [
3976
- /* @__PURE__ */ jsx24(
4063
+ return /* @__PURE__ */ jsx25("header", { className: headerClasses, children: /* @__PURE__ */ jsxs19("div", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto", children: [
4064
+ /* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between py-4", children: [
4065
+ showAppLogo && /* @__PURE__ */ jsx25("div", { className: "flex-shrink-0", children: customAppLogo || /* @__PURE__ */ jsxs19("div", { className: "flex items-center", children: [
4066
+ /* @__PURE__ */ jsx25(
3977
4067
  "img",
3978
4068
  {
3979
4069
  className: "h-8 w-auto",
@@ -3981,9 +4071,9 @@ function PublicPageHeader({
3981
4071
  alt: appName
3982
4072
  }
3983
4073
  ),
3984
- /* @__PURE__ */ jsx24("span", { className: "ml-2 text-lg font-semibold text-gray-900", children: appName })
4074
+ /* @__PURE__ */ jsx25("span", { className: "ml-2 text-lg font-semibold text-gray-900", children: appName })
3985
4075
  ] }) }),
3986
- showEventLogo && event && /* @__PURE__ */ jsx24("div", { className: "flex-shrink-0", children: customEventLogo || /* @__PURE__ */ jsx24(
4076
+ showEventLogo && event && /* @__PURE__ */ jsx25("div", { className: "flex-shrink-0", children: customEventLogo || /* @__PURE__ */ jsx25(
3987
4077
  EventLogo,
3988
4078
  {
3989
4079
  eventId: event.event_id,
@@ -3994,22 +4084,22 @@ function PublicPageHeader({
3994
4084
  }
3995
4085
  ) })
3996
4086
  ] }),
3997
- /* @__PURE__ */ jsx24("div", { className: "pb-4", children: /* @__PURE__ */ jsxs18("div", { className: "text-center", children: [
3998
- event && /* @__PURE__ */ jsxs18(Fragment6, { children: [
3999
- /* @__PURE__ */ jsx24("h1", { className: "text-3xl font-bold text-gray-900 mb-2", children: event.event_name }),
4000
- event.event_venue && /* @__PURE__ */ jsx24("p", { className: "text-md text-gray-500 mb-4", children: event.event_venue })
4087
+ /* @__PURE__ */ jsx25("div", { className: "pb-4", children: /* @__PURE__ */ jsxs19("div", { className: "text-center", children: [
4088
+ event && /* @__PURE__ */ jsxs19(Fragment6, { children: [
4089
+ /* @__PURE__ */ jsx25("h1", { className: "text-3xl font-bold text-gray-900 mb-2", children: event.event_name }),
4090
+ event.event_venue && /* @__PURE__ */ jsx25("p", { className: "text-md text-gray-500 mb-4", children: event.event_venue })
4001
4091
  ] }),
4002
- title && /* @__PURE__ */ jsxs18("div", { className: "mt-6", children: [
4003
- /* @__PURE__ */ jsx24("h2", { className: "text-2xl font-semibold text-gray-800 mb-2", children: title }),
4004
- description && /* @__PURE__ */ jsx24("p", { className: "text-lg text-gray-600 max-w-3xl mx-auto", children: description })
4092
+ title && /* @__PURE__ */ jsxs19("div", { className: "mt-6", children: [
4093
+ /* @__PURE__ */ jsx25("h2", { className: "text-2xl font-semibold text-gray-800 mb-2", children: title }),
4094
+ description && /* @__PURE__ */ jsx25("p", { className: "text-lg text-gray-600 max-w-3xl mx-auto", children: description })
4005
4095
  ] }),
4006
- children && /* @__PURE__ */ jsx24("div", { className: "mt-4", children })
4096
+ children && /* @__PURE__ */ jsx25("div", { className: "mt-4", children })
4007
4097
  ] }) })
4008
4098
  ] }) });
4009
4099
  }
4010
4100
 
4011
4101
  // src/components/PublicLayout/PublicPageFooter.tsx
4012
- import { Fragment as Fragment7, jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
4102
+ import { Fragment as Fragment7, jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
4013
4103
  function PublicPageFooter({
4014
4104
  event,
4015
4105
  companyName = "Solvera Solutions Pty Ltd",
@@ -4021,16 +4111,16 @@ function PublicPageFooter({
4021
4111
  children
4022
4112
  }) {
4023
4113
  const copyrightText = copyright || `\xA9 Copyright 2022\u2013${year} all rights reserved, ${companyName}.`;
4024
- return /* @__PURE__ */ jsx25("footer", { className: cn("mt-8 py-6 flex justify-center border-t border-border bg-main-100", className), children: /* @__PURE__ */ jsxs19("section", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto text-center", children: [
4025
- logo && /* @__PURE__ */ jsx25("img", { src: logo, alt: "Logo", className: "h-8 w-auto" }),
4026
- children && /* @__PURE__ */ jsx25(Fragment7, { children }),
4027
- /* @__PURE__ */ jsx25("span", { className: "text-muted-foreground", children: copyrightText }),
4028
- 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)) })
4114
+ return /* @__PURE__ */ jsx26("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: [
4115
+ logo && /* @__PURE__ */ jsx26("img", { src: logo, alt: "Logo", className: "h-8 w-auto" }),
4116
+ children && /* @__PURE__ */ jsx26(Fragment7, { children }),
4117
+ /* @__PURE__ */ jsx26("span", { className: "text-muted-foreground", children: copyrightText }),
4118
+ links && links.length > 0 && /* @__PURE__ */ jsx26("ul", { className: "flex gap-4 mt-2 md:mt-0", children: links.map((link, index) => /* @__PURE__ */ jsx26("li", { children: /* @__PURE__ */ jsx26("a", { href: link.href, className: "text-muted-foreground hover:text-foreground", children: link.label }) }, index)) })
4029
4119
  ] }) });
4030
4120
  }
4031
4121
 
4032
4122
  // src/components/PublicLayout/PublicLoadingSpinner.tsx
4033
- import { jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
4123
+ import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
4034
4124
  var sizeClasses2 = {
4035
4125
  sm: "h-4 w-4",
4036
4126
  md: "h-8 w-8",
@@ -4047,8 +4137,8 @@ function PublicLoadingSpinner({
4047
4137
  }) {
4048
4138
  const sizeClass = sizeClasses2[size];
4049
4139
  const displayMessage = customMessage || message;
4050
- const content = /* @__PURE__ */ jsxs20("div", { className: `flex flex-col items-center ${className}`, children: [
4051
- showLogo && /* @__PURE__ */ jsx26("div", { className: "mb-4", children: /* @__PURE__ */ jsx26(
4140
+ const content = /* @__PURE__ */ jsxs21("div", { className: `flex flex-col items-center ${className}`, children: [
4141
+ showLogo && /* @__PURE__ */ jsx27("div", { className: "mb-4", children: /* @__PURE__ */ jsx27(
4052
4142
  "img",
4053
4143
  {
4054
4144
  className: "h-8 w-auto",
@@ -4056,8 +4146,8 @@ function PublicLoadingSpinner({
4056
4146
  alt: "PACE Core"
4057
4147
  }
4058
4148
  ) }),
4059
- /* @__PURE__ */ jsxs20("div", { className: "relative", children: [
4060
- /* @__PURE__ */ jsx26(
4149
+ /* @__PURE__ */ jsxs21("div", { className: "relative", children: [
4150
+ /* @__PURE__ */ jsx27(
4061
4151
  "div",
4062
4152
  {
4063
4153
  className: `${sizeClass} border-2 border-gray-200 border-t-blue-600 rounded-full animate-spin`,
@@ -4065,12 +4155,12 @@ function PublicLoadingSpinner({
4065
4155
  "aria-label": "Loading"
4066
4156
  }
4067
4157
  ),
4068
- /* @__PURE__ */ jsx26("span", { className: "sr-only", children: displayMessage })
4158
+ /* @__PURE__ */ jsx27("span", { className: "sr-only", children: displayMessage })
4069
4159
  ] }),
4070
- displayMessage && /* @__PURE__ */ jsx26("p", { className: "mt-4 text-sm text-gray-600 text-center", children: displayMessage })
4160
+ displayMessage && /* @__PURE__ */ jsx27("p", { className: "mt-4 text-sm text-gray-600 text-center", children: displayMessage })
4071
4161
  ] });
4072
4162
  if (centered) {
4073
- return /* @__PURE__ */ jsx26("div", { className: "min-h-screen bg-white flex items-center justify-center", children: /* @__PURE__ */ jsx26("div", { className: "max-w-md mx-auto px-4", children: content }) });
4163
+ return /* @__PURE__ */ jsx27("div", { className: "min-h-screen bg-white flex items-center justify-center", children: /* @__PURE__ */ jsx27("div", { className: "max-w-md mx-auto px-4", children: content }) });
4074
4164
  }
4075
4165
  return content;
4076
4166
  }
@@ -4079,8 +4169,8 @@ function PublicLoadingSpinnerFullPage({
4079
4169
  eventName,
4080
4170
  className = ""
4081
4171
  }) {
4082
- return /* @__PURE__ */ jsx26("div", { className: `min-h-screen bg-white flex items-center justify-center ${className}`, children: /* @__PURE__ */ jsxs20("div", { className: "max-w-md mx-auto text-center px-4", children: [
4083
- /* @__PURE__ */ jsx26("div", { className: "mb-8", children: /* @__PURE__ */ jsx26(
4172
+ return /* @__PURE__ */ jsx27("div", { className: `min-h-screen bg-white flex items-center justify-center ${className}`, children: /* @__PURE__ */ jsxs21("div", { className: "max-w-md mx-auto text-center px-4", children: [
4173
+ /* @__PURE__ */ jsx27("div", { className: "mb-8", children: /* @__PURE__ */ jsx27(
4084
4174
  "img",
4085
4175
  {
4086
4176
  className: "h-12 w-auto mx-auto",
@@ -4088,8 +4178,8 @@ function PublicLoadingSpinnerFullPage({
4088
4178
  alt: "PACE Core"
4089
4179
  }
4090
4180
  ) }),
4091
- eventName && /* @__PURE__ */ jsx26("h1", { className: "text-2xl font-bold text-gray-900 mb-4", children: eventName }),
4092
- /* @__PURE__ */ jsx26("div", { className: "relative mb-6", children: /* @__PURE__ */ jsx26(
4181
+ eventName && /* @__PURE__ */ jsx27("h1", { className: "text-2xl font-bold text-gray-900 mb-4", children: eventName }),
4182
+ /* @__PURE__ */ jsx27("div", { className: "relative mb-6", children: /* @__PURE__ */ jsx27(
4093
4183
  "div",
4094
4184
  {
4095
4185
  className: "h-12 w-12 border-4 border-gray-200 border-t-blue-600 rounded-full animate-spin mx-auto",
@@ -4097,11 +4187,11 @@ function PublicLoadingSpinnerFullPage({
4097
4187
  "aria-label": "Loading"
4098
4188
  }
4099
4189
  ) }),
4100
- /* @__PURE__ */ jsx26("p", { className: "text-lg text-gray-600", children: message }),
4101
- /* @__PURE__ */ jsxs20("div", { className: "mt-4 flex justify-center space-x-1", children: [
4102
- /* @__PURE__ */ jsx26("div", { className: "h-2 w-2 bg-blue-600 rounded-full animate-bounce", style: { animationDelay: "0ms" } }),
4103
- /* @__PURE__ */ jsx26("div", { className: "h-2 w-2 bg-blue-600 rounded-full animate-bounce", style: { animationDelay: "150ms" } }),
4104
- /* @__PURE__ */ jsx26("div", { className: "h-2 w-2 bg-blue-600 rounded-full animate-bounce", style: { animationDelay: "300ms" } })
4190
+ /* @__PURE__ */ jsx27("p", { className: "text-lg text-gray-600", children: message }),
4191
+ /* @__PURE__ */ jsxs21("div", { className: "mt-4 flex justify-center space-x-1", children: [
4192
+ /* @__PURE__ */ jsx27("div", { className: "h-2 w-2 bg-blue-600 rounded-full animate-bounce", style: { animationDelay: "0ms" } }),
4193
+ /* @__PURE__ */ jsx27("div", { className: "h-2 w-2 bg-blue-600 rounded-full animate-bounce", style: { animationDelay: "150ms" } }),
4194
+ /* @__PURE__ */ jsx27("div", { className: "h-2 w-2 bg-blue-600 rounded-full animate-bounce", style: { animationDelay: "300ms" } })
4105
4195
  ] })
4106
4196
  ] }) });
4107
4197
  }
@@ -4109,7 +4199,7 @@ function PublicLoadingSkeleton({
4109
4199
  lines = 3,
4110
4200
  className = ""
4111
4201
  }) {
4112
- return /* @__PURE__ */ jsx26("div", { className: `animate-pulse ${className}`, children: Array.from({ length: lines }).map((_, index) => /* @__PURE__ */ jsx26(
4202
+ return /* @__PURE__ */ jsx27("div", { className: `animate-pulse ${className}`, children: Array.from({ length: lines }).map((_, index) => /* @__PURE__ */ jsx27(
4113
4203
  "div",
4114
4204
  {
4115
4205
  className: `h-4 bg-gray-200 rounded mb-2 ${index === lines - 1 ? "w-3/4" : "w-full"}`
@@ -4119,8 +4209,8 @@ function PublicLoadingSkeleton({
4119
4209
  }
4120
4210
 
4121
4211
  // src/components/PublicLayout/PublicPageLayout.tsx
4122
- import { useMemo as useMemo10 } from "react";
4123
- import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
4212
+ import { useMemo as useMemo11 } from "react";
4213
+ import { jsx as jsx28, jsxs as jsxs22 } from "react/jsx-runtime";
4124
4214
  function PublicPageLayout({
4125
4215
  eventCode,
4126
4216
  children,
@@ -4137,22 +4227,22 @@ function PublicPageLayout({
4137
4227
  const error = null;
4138
4228
  const refetch = async () => {
4139
4229
  };
4140
- const layoutClasses = useMemo10(() => {
4230
+ const layoutClasses = useMemo11(() => {
4141
4231
  const baseClasses = "min-h-screen bg-white flex flex-col";
4142
4232
  return `${baseClasses} ${className}`.trim();
4143
4233
  }, [className]);
4144
4234
  if (isLoading) {
4145
- return /* @__PURE__ */ jsx27("div", { className: layoutClasses, children: /* @__PURE__ */ jsx27("div", { className: "flex-1 flex items-center justify-center", children: /* @__PURE__ */ jsx27(LoadingFallback, {}) }) });
4235
+ return /* @__PURE__ */ jsx28("div", { className: layoutClasses, children: /* @__PURE__ */ jsx28("div", { className: "flex-1 flex items-center justify-center", children: /* @__PURE__ */ jsx28(LoadingFallback, {}) }) });
4146
4236
  }
4147
4237
  if (error && showValidationErrors) {
4148
- return /* @__PURE__ */ jsx27("div", { className: layoutClasses, children: /* @__PURE__ */ jsx27("div", { className: "flex-1 flex items-center justify-center", children: ErrorFallback ? /* @__PURE__ */ jsx27(ErrorFallback, { error, retry: refetch }) : /* @__PURE__ */ jsxs21("div", { className: "text-center p-8", children: [
4149
- /* @__PURE__ */ jsx27("h1", { className: "text-2xl font-bold text-gray-900 mb-4", children: "Event Not Found" }),
4150
- /* @__PURE__ */ jsxs21("p", { className: "text-gray-600 mb-6", children: [
4238
+ return /* @__PURE__ */ jsx28("div", { className: layoutClasses, children: /* @__PURE__ */ jsx28("div", { className: "flex-1 flex items-center justify-center", children: ErrorFallback ? /* @__PURE__ */ jsx28(ErrorFallback, { error, retry: refetch }) : /* @__PURE__ */ jsxs22("div", { className: "text-center p-8", children: [
4239
+ /* @__PURE__ */ jsx28("h1", { className: "text-2xl font-bold text-gray-900 mb-4", children: "Event Not Found" }),
4240
+ /* @__PURE__ */ jsxs22("p", { className: "text-gray-600 mb-6", children: [
4151
4241
  'The event code "',
4152
4242
  eventCode,
4153
4243
  '" is invalid or the event is not available for public viewing.'
4154
4244
  ] }),
4155
- /* @__PURE__ */ jsx27(
4245
+ /* @__PURE__ */ jsx28(
4156
4246
  "button",
4157
4247
  {
4158
4248
  onClick: refetch,
@@ -4163,10 +4253,10 @@ function PublicPageLayout({
4163
4253
  ] }) }) });
4164
4254
  }
4165
4255
  if (!event) {
4166
- return /* @__PURE__ */ jsx27("div", { className: layoutClasses, children: /* @__PURE__ */ jsx27("div", { className: "flex-1 flex items-center justify-center", children: /* @__PURE__ */ jsxs21("div", { className: "text-center p-8", children: [
4167
- /* @__PURE__ */ jsx27("h1", { className: "text-2xl font-bold text-gray-900 mb-4", children: "Event Not Available" }),
4168
- /* @__PURE__ */ jsx27("p", { className: "text-gray-600 mb-6", children: "This event is not available for public viewing." }),
4169
- /* @__PURE__ */ jsx27(
4256
+ return /* @__PURE__ */ jsx28("div", { className: layoutClasses, children: /* @__PURE__ */ jsx28("div", { className: "flex-1 flex items-center justify-center", children: /* @__PURE__ */ jsxs22("div", { className: "text-center p-8", children: [
4257
+ /* @__PURE__ */ jsx28("h1", { className: "text-2xl font-bold text-gray-900 mb-4", children: "Event Not Available" }),
4258
+ /* @__PURE__ */ jsx28("p", { className: "text-gray-600 mb-6", children: "This event is not available for public viewing." }),
4259
+ /* @__PURE__ */ jsx28(
4170
4260
  "button",
4171
4261
  {
4172
4262
  onClick: refetch,
@@ -4176,16 +4266,16 @@ function PublicPageLayout({
4176
4266
  )
4177
4267
  ] }) }) });
4178
4268
  }
4179
- return /* @__PURE__ */ jsx27(PublicErrorBoundary, { children: /* @__PURE__ */ jsxs21("div", { className: layoutClasses, children: [
4180
- customHeader || /* @__PURE__ */ jsx27(
4269
+ return /* @__PURE__ */ jsx28(PublicErrorBoundary, { children: /* @__PURE__ */ jsxs22("div", { className: layoutClasses, children: [
4270
+ customHeader || /* @__PURE__ */ jsx28(
4181
4271
  PublicPageHeader,
4182
4272
  {
4183
4273
  event,
4184
4274
  eventCode
4185
4275
  }
4186
4276
  ),
4187
- /* @__PURE__ */ jsx27("main", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children }),
4188
- showFooter && (customFooter || /* @__PURE__ */ jsx27(PublicPageFooter, { event }))
4277
+ /* @__PURE__ */ jsx28("main", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children }),
4278
+ showFooter && (customFooter || /* @__PURE__ */ jsx28(PublicPageFooter, { event }))
4189
4279
  ] }) });
4190
4280
  }
4191
4281
  function usePublicPageContext2() {
@@ -4203,7 +4293,7 @@ function usePublicPageContext2() {
4203
4293
 
4204
4294
  // src/components/PublicLayout/PublicPageDebugger.tsx
4205
4295
  import { useEffect as useEffect9 } from "react";
4206
- import { jsx as jsx28, jsxs as jsxs22 } from "react/jsx-runtime";
4296
+ import { jsx as jsx29, jsxs as jsxs23 } from "react/jsx-runtime";
4207
4297
  function PublicPageDebugger({ enabled = true, label = "PublicPage" }) {
4208
4298
  useEffect9(() => {
4209
4299
  if (!enabled) return;
@@ -4246,7 +4336,7 @@ function PublicPageDebugger({ enabled = true, label = "PublicPage" }) {
4246
4336
  };
4247
4337
  }, [enabled, label]);
4248
4338
  if (!enabled) return null;
4249
- return /* @__PURE__ */ jsxs22("div", { style: {
4339
+ return /* @__PURE__ */ jsxs23("div", { style: {
4250
4340
  position: "fixed",
4251
4341
  top: 0,
4252
4342
  right: 0,
@@ -4257,14 +4347,14 @@ function PublicPageDebugger({ enabled = true, label = "PublicPage" }) {
4257
4347
  zIndex: 9999,
4258
4348
  fontFamily: "monospace"
4259
4349
  }, children: [
4260
- /* @__PURE__ */ jsx28("div", { children: "Public Page Debugger" }),
4261
- /* @__PURE__ */ jsx28("div", { children: "Check console for context analysis" })
4350
+ /* @__PURE__ */ jsx29("div", { children: "Public Page Debugger" }),
4351
+ /* @__PURE__ */ jsx29("div", { children: "Check console for context analysis" })
4262
4352
  ] });
4263
4353
  }
4264
4354
 
4265
4355
  // src/components/PublicLayout/PublicPageDiagnostic.tsx
4266
4356
  import { useEffect as useEffect10, useState as useState13 } from "react";
4267
- import { jsx as jsx29, jsxs as jsxs23 } from "react/jsx-runtime";
4357
+ import { jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
4268
4358
  function PublicPageDiagnostic({ enabled = true, label = "PublicPage" }) {
4269
4359
  const [diagnostics, setDiagnostics] = useState13({
4270
4360
  hasPublicPageContext: false,
@@ -4345,7 +4435,7 @@ function PublicPageDiagnostic({ enabled = true, label = "PublicPage" }) {
4345
4435
  runDiagnostics();
4346
4436
  }, [enabled, label]);
4347
4437
  if (!enabled) return null;
4348
- return /* @__PURE__ */ jsxs23("div", { style: {
4438
+ return /* @__PURE__ */ jsxs24("div", { style: {
4349
4439
  position: "fixed",
4350
4440
  top: 0,
4351
4441
  left: 0,
@@ -4358,38 +4448,38 @@ function PublicPageDiagnostic({ enabled = true, label = "PublicPage" }) {
4358
4448
  maxWidth: "300px",
4359
4449
  borderRadius: "0 0 8px 0"
4360
4450
  }, children: [
4361
- /* @__PURE__ */ jsx29("div", { style: { fontWeight: "bold", marginBottom: "8px" }, children: "\u{1F50D} Public Page Diagnostics" }),
4362
- /* @__PURE__ */ jsxs23("div", { children: [
4451
+ /* @__PURE__ */ jsx30("div", { style: { fontWeight: "bold", marginBottom: "8px" }, children: "\u{1F50D} Public Page Diagnostics" }),
4452
+ /* @__PURE__ */ jsxs24("div", { children: [
4363
4453
  "Public Context: ",
4364
4454
  diagnostics.hasPublicPageContext ? "\u2705" : "\u274C"
4365
4455
  ] }),
4366
- /* @__PURE__ */ jsxs23("div", { children: [
4456
+ /* @__PURE__ */ jsxs24("div", { children: [
4367
4457
  "Auth Context: ",
4368
4458
  diagnostics.hasAuthContext ? "\u274C BAD" : "\u2705 GOOD"
4369
4459
  ] }),
4370
- /* @__PURE__ */ jsxs23("div", { children: [
4460
+ /* @__PURE__ */ jsxs24("div", { children: [
4371
4461
  "Org Context: ",
4372
4462
  diagnostics.hasOrgContext ? "\u274C BAD" : "\u2705 GOOD"
4373
4463
  ] }),
4374
- /* @__PURE__ */ jsxs23("div", { children: [
4464
+ /* @__PURE__ */ jsxs24("div", { children: [
4375
4465
  "Event Context: ",
4376
4466
  diagnostics.hasEventContext ? "\u274C BAD" : "\u2705 GOOD"
4377
4467
  ] }),
4378
- /* @__PURE__ */ jsxs23("div", { children: [
4468
+ /* @__PURE__ */ jsxs24("div", { children: [
4379
4469
  "Env Vars: ",
4380
4470
  diagnostics.hasEnvironmentVars ? "\u2705" : "\u274C"
4381
4471
  ] }),
4382
- /* @__PURE__ */ jsxs23("div", { children: [
4472
+ /* @__PURE__ */ jsxs24("div", { children: [
4383
4473
  "Route Params: ",
4384
4474
  diagnostics.routeParams ? "\u2705" : "\u274C"
4385
4475
  ] }),
4386
- /* @__PURE__ */ jsx29("div", { style: { marginTop: "8px", fontSize: "10px", opacity: 0.8 }, children: "Check console for detailed analysis" })
4476
+ /* @__PURE__ */ jsx30("div", { style: { marginTop: "8px", fontSize: "10px", opacity: 0.8 }, children: "Check console for detailed analysis" })
4387
4477
  ] });
4388
4478
  }
4389
4479
 
4390
4480
  // src/components/PublicLayout/PublicPageContextChecker.tsx
4391
4481
  import { useEffect as useEffect11 } from "react";
4392
- import { jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
4482
+ import { jsx as jsx31, jsxs as jsxs25 } from "react/jsx-runtime";
4393
4483
  function PublicPageContextChecker({ enabled = true, label = "PublicPage" }) {
4394
4484
  useEffect11(() => {
4395
4485
  if (!enabled) return;
@@ -4453,7 +4543,7 @@ function PublicPageContextChecker({ enabled = true, label = "PublicPage" }) {
4453
4543
  console.groupEnd();
4454
4544
  }, [enabled, label]);
4455
4545
  if (!enabled) return null;
4456
- return /* @__PURE__ */ jsxs24("div", { style: {
4546
+ return /* @__PURE__ */ jsxs25("div", { style: {
4457
4547
  position: "fixed",
4458
4548
  top: 0,
4459
4549
  left: 0,
@@ -4467,9 +4557,9 @@ function PublicPageContextChecker({ enabled = true, label = "PublicPage" }) {
4467
4557
  borderRadius: "0 0 8px 0",
4468
4558
  border: "2px solid #dc2626"
4469
4559
  }, children: [
4470
- /* @__PURE__ */ jsx30("div", { style: { fontWeight: "bold", marginBottom: "8px" }, children: "\u{1F6A8} PUBLIC PAGE CONTEXT CHECK" }),
4471
- /* @__PURE__ */ jsx30("div", { children: "Check console for authentication context analysis" }),
4472
- /* @__PURE__ */ jsx30("div", { style: { marginTop: "8px", fontSize: "10px", opacity: 0.9 }, children: "If you see \u274C errors in console, your public page is inside auth context!" })
4560
+ /* @__PURE__ */ jsx31("div", { style: { fontWeight: "bold", marginBottom: "8px" }, children: "\u{1F6A8} PUBLIC PAGE CONTEXT CHECK" }),
4561
+ /* @__PURE__ */ jsx31("div", { children: "Check console for authentication context analysis" }),
4562
+ /* @__PURE__ */ jsx31("div", { style: { marginTop: "8px", fontSize: "10px", opacity: 0.9 }, children: "If you see \u274C errors in console, your public page is inside auth context!" })
4473
4563
  ] });
4474
4564
  }
4475
4565
 
@@ -4499,8 +4589,9 @@ export {
4499
4589
  Footer,
4500
4590
  PaceAppLayout,
4501
4591
  PaceLoginPage,
4502
- ErrorBoundary,
4503
4592
  SessionRestorationLoader,
4593
+ ProtectedRoute,
4594
+ ErrorBoundary,
4504
4595
  OrganisationSelector,
4505
4596
  PasswordResetForm,
4506
4597
  useFileReference,
@@ -4534,4 +4625,4 @@ export {
4534
4625
  PublicPageDiagnostic,
4535
4626
  PublicPageContextChecker
4536
4627
  };
4537
- //# sourceMappingURL=chunk-EWMXLDIX.js.map
4628
+ //# sourceMappingURL=chunk-5LAY74WM.js.map