@optifye/dashboard-core 6.11.21 → 6.11.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -2203,6 +2203,61 @@ var clearAuthSnapshot = () => {
2203
2203
  safeStorageRemoveItem(AUTH_SNAPSHOT_STORAGE_KEY);
2204
2204
  };
2205
2205
 
2206
+ // src/lib/auth/authAuditLog.ts
2207
+ var TAB_ID = typeof crypto !== "undefined" && crypto.randomUUID ? crypto.randomUUID().slice(0, 8) : Math.random().toString(36).slice(2, 10);
2208
+ var FLUSH_INTERVAL_MS = 3e4;
2209
+ var MAX_QUEUE_SIZE = 50;
2210
+ var queue = [];
2211
+ var flushTimer = null;
2212
+ var apiBaseUrl = "";
2213
+ var getAccessToken = null;
2214
+ var initAuthAuditLog = (baseUrl, tokenGetter) => {
2215
+ apiBaseUrl = baseUrl;
2216
+ getAccessToken = tokenGetter;
2217
+ if (typeof window === "undefined") return;
2218
+ if (!flushTimer) {
2219
+ flushTimer = setInterval(flushAuthAuditLog, FLUSH_INTERVAL_MS);
2220
+ window.addEventListener("visibilitychange", () => {
2221
+ if (document.visibilityState === "hidden") {
2222
+ void flushAuthAuditLog();
2223
+ }
2224
+ });
2225
+ }
2226
+ };
2227
+ var logAuthEvent = (eventType, details = {}) => {
2228
+ queue.push({
2229
+ event_type: eventType,
2230
+ tab_id: TAB_ID,
2231
+ details: {
2232
+ ...details,
2233
+ ts: (/* @__PURE__ */ new Date()).toISOString()
2234
+ }
2235
+ });
2236
+ if (queue.length >= MAX_QUEUE_SIZE) {
2237
+ void flushAuthAuditLog();
2238
+ }
2239
+ };
2240
+ var flushAuthAuditLog = async () => {
2241
+ if (queue.length === 0 || !apiBaseUrl || !getAccessToken) return;
2242
+ const events = queue.splice(0, MAX_QUEUE_SIZE);
2243
+ try {
2244
+ const token = await getAccessToken();
2245
+ if (!token) return;
2246
+ const body = JSON.stringify({ events });
2247
+ const url = `${apiBaseUrl}/api/auth/audit`;
2248
+ await fetch(url, {
2249
+ method: "POST",
2250
+ headers: {
2251
+ "Content-Type": "application/json",
2252
+ Authorization: `Bearer ${token}`
2253
+ },
2254
+ body,
2255
+ keepalive: document.visibilityState === "hidden"
2256
+ });
2257
+ } catch {
2258
+ }
2259
+ };
2260
+
2206
2261
  // src/lib/auth/session.ts
2207
2262
  var DEFAULT_MIN_VALIDITY_MS = 6e4;
2208
2263
  var refreshPromises = /* @__PURE__ */ new WeakMap();
@@ -2212,6 +2267,24 @@ var isInvalidRefreshTokenError = (error) => {
2212
2267
  if (!message.includes("refresh token")) return false;
2213
2268
  return message.includes("invalid") || message.includes("not found") || message.includes("revoked");
2214
2269
  };
2270
+ var getSessionFromStorage = () => {
2271
+ if (typeof window === "undefined") return null;
2272
+ try {
2273
+ for (let i = 0; i < localStorage.length; i++) {
2274
+ const key = localStorage.key(i);
2275
+ if (key?.startsWith("sb-") && key?.endsWith("-auth-token")) {
2276
+ const raw = localStorage.getItem(key);
2277
+ if (!raw) continue;
2278
+ const parsed = JSON.parse(raw);
2279
+ if (parsed?.access_token && parsed?.refresh_token && parsed?.expires_at) {
2280
+ return parsed;
2281
+ }
2282
+ }
2283
+ }
2284
+ } catch {
2285
+ }
2286
+ return null;
2287
+ };
2215
2288
  var isSessionValid = (session, minValidityMs = 0) => {
2216
2289
  if (!session) return false;
2217
2290
  if (!session.expires_at) return true;
@@ -2268,6 +2341,18 @@ var refreshSessionSingleFlight = async (supabase) => {
2268
2341
  }
2269
2342
  const invalidRefreshToken = isInvalidRefreshTokenError(refreshError);
2270
2343
  if (invalidRefreshToken) {
2344
+ const storedSession = getSessionFromStorage();
2345
+ if (storedSession && isSessionValid(storedSession, 0)) {
2346
+ console.log("[Auth] Recovered session from localStorage after invalid refresh token (another tab refreshed)");
2347
+ try {
2348
+ await supabase.auth.setSession({
2349
+ access_token: storedSession.access_token,
2350
+ refresh_token: storedSession.refresh_token
2351
+ });
2352
+ } catch {
2353
+ }
2354
+ return { session: storedSession, error: null, invalidRefreshToken: false };
2355
+ }
2271
2356
  try {
2272
2357
  await supabase.auth.signOut({ scope: "local" });
2273
2358
  } catch (error) {
@@ -6577,7 +6662,17 @@ function captureSentryException(error, extras) {
6577
6662
  }
6578
6663
 
6579
6664
  // src/lib/services/mixpanelService.ts
6665
+ var ROOT_DASHBOARD_EVENT_NAMES = {
6666
+ operations_overview: "Operations Overview Page Clicked",
6667
+ monitor: "Live Monitor Clicked"
6668
+ };
6669
+ var MIXPANEL_EVENT_NAME_ALIASES = {
6670
+ "Operations Overview clicked": ROOT_DASHBOARD_EVENT_NAMES.operations_overview,
6671
+ "monitor page clicked": ROOT_DASHBOARD_EVENT_NAMES.monitor
6672
+ };
6673
+ var MAX_QUEUED_MIXPANEL_ACTIONS = 200;
6580
6674
  var isMixpanelInitialized = false;
6675
+ var queuedMixpanelActions = [];
6581
6676
  var currentUserProperties;
6582
6677
  var MIXPANEL_WARNING_RATE_LIMIT = {
6583
6678
  windowMs: 10 * 60 * 1e3,
@@ -6605,6 +6700,52 @@ var reportMixpanelError = (key, error, extras) => {
6605
6700
  if (!shouldReportMixpanel(key, true)) return;
6606
6701
  captureSentryException(error, { ...baseMixpanelExtras(), ...extras });
6607
6702
  };
6703
+ var normalizeCoreEventName = (eventName) => {
6704
+ const canonicalName = MIXPANEL_EVENT_NAME_ALIASES[eventName] || eventName;
6705
+ if (canonicalName !== eventName) {
6706
+ reportMixpanelWarning(`event_alias:${eventName}`, "Mixpanel event alias rewritten to canonical name", {
6707
+ operation: "track_event",
6708
+ originalEventName: eventName,
6709
+ canonicalEventName: canonicalName
6710
+ });
6711
+ }
6712
+ return canonicalName;
6713
+ };
6714
+ var queueMixpanelAction = (action) => {
6715
+ if (queuedMixpanelActions.length >= MAX_QUEUED_MIXPANEL_ACTIONS) {
6716
+ queuedMixpanelActions.shift();
6717
+ reportMixpanelWarning("queue_overflow", "Mixpanel queue overflow, dropping oldest queued action", {
6718
+ operation: "queue",
6719
+ maxQueuedActions: MAX_QUEUED_MIXPANEL_ACTIONS
6720
+ });
6721
+ }
6722
+ queuedMixpanelActions.push(action);
6723
+ };
6724
+ var flushQueuedMixpanelActions = () => {
6725
+ if (!isMixpanelInitialized || queuedMixpanelActions.length === 0) return;
6726
+ const pendingActions = queuedMixpanelActions.splice(0, queuedMixpanelActions.length);
6727
+ pendingActions.forEach((action) => {
6728
+ try {
6729
+ if (action.type === "identify") {
6730
+ mixpanel.identify(action.userId);
6731
+ if (action.userProperties) {
6732
+ mixpanel.people.set(action.userProperties);
6733
+ }
6734
+ return;
6735
+ }
6736
+ if (action.type === "page_view") {
6737
+ mixpanel.track("Page View", { page: action.pageName, ...action.properties || {} });
6738
+ return;
6739
+ }
6740
+ mixpanel.track(action.eventName, action.properties || {});
6741
+ } catch (err) {
6742
+ reportMixpanelError("flush_queued_action_failed", err, {
6743
+ operation: "flush_queue",
6744
+ actionType: action.type
6745
+ });
6746
+ }
6747
+ });
6748
+ };
6608
6749
  var initializeCoreMixpanel = (token, debugOrOptions, trackPageViewArg) => {
6609
6750
  if (!token) {
6610
6751
  console.warn("Mixpanel token not provided for initialization. Mixpanel will not be enabled.");
@@ -6662,6 +6803,7 @@ var initializeCoreMixpanel = (token, debugOrOptions, trackPageViewArg) => {
6662
6803
  try {
6663
6804
  mixpanel.init(token, initOptions);
6664
6805
  isMixpanelInitialized = true;
6806
+ flushQueuedMixpanelActions();
6665
6807
  } catch (err) {
6666
6808
  reportMixpanelError("init_failed", err, {
6667
6809
  operation: "init",
@@ -6677,7 +6819,12 @@ var initializeCoreMixpanel = (token, debugOrOptions, trackPageViewArg) => {
6677
6819
  };
6678
6820
  var trackCorePageView = (pageName, properties) => {
6679
6821
  if (!isMixpanelInitialized) {
6680
- reportMixpanelWarning("track_pageview_not_initialized", "Mixpanel not initialized: page view dropped", {
6822
+ queueMixpanelAction({
6823
+ type: "page_view",
6824
+ pageName,
6825
+ properties
6826
+ });
6827
+ reportMixpanelWarning("track_pageview_queued", "Mixpanel not initialized yet: page view queued", {
6681
6828
  operation: "track_pageview",
6682
6829
  pageName
6683
6830
  });
@@ -6693,10 +6840,20 @@ var trackCorePageView = (pageName, properties) => {
6693
6840
  }
6694
6841
  };
6695
6842
  var trackCoreEvent = (eventName, properties) => {
6843
+ const normalizedEventName = normalizeCoreEventName(eventName);
6696
6844
  if (!isMixpanelInitialized) {
6697
- reportMixpanelWarning("track_event_not_initialized", "Mixpanel not initialized: event dropped", {
6845
+ const mergedProps2 = {
6846
+ ...currentUserProperties || {},
6847
+ ...properties || {}
6848
+ };
6849
+ queueMixpanelAction({
6850
+ type: "track",
6851
+ eventName: normalizedEventName,
6852
+ properties: mergedProps2
6853
+ });
6854
+ reportMixpanelWarning("track_event_queued", "Mixpanel not initialized yet: event queued", {
6698
6855
  operation: "track_event",
6699
- eventName
6856
+ eventName: normalizedEventName
6700
6857
  });
6701
6858
  return;
6702
6859
  }
@@ -6707,11 +6864,11 @@ var trackCoreEvent = (eventName, properties) => {
6707
6864
  ...properties || {}
6708
6865
  };
6709
6866
  try {
6710
- mixpanel.track(eventName, mergedProps);
6867
+ mixpanel.track(normalizedEventName, mergedProps);
6711
6868
  } catch (err) {
6712
6869
  reportMixpanelError("track_event_failed", err, {
6713
6870
  operation: "track_event",
6714
- eventName
6871
+ eventName: normalizedEventName
6715
6872
  });
6716
6873
  }
6717
6874
  };
@@ -6762,8 +6919,14 @@ var getCoreSessionReplayUrl = () => {
6762
6919
  return null;
6763
6920
  };
6764
6921
  var identifyCoreUser = (userId, userProperties) => {
6922
+ currentUserProperties = userProperties ? { ...userProperties } : void 0;
6765
6923
  if (!isMixpanelInitialized) {
6766
- reportMixpanelWarning("identify_not_initialized", "Mixpanel not initialized: identify dropped", {
6924
+ queueMixpanelAction({
6925
+ type: "identify",
6926
+ userId,
6927
+ userProperties: currentUserProperties
6928
+ });
6929
+ reportMixpanelWarning("identify_queued", "Mixpanel not initialized yet: identify queued", {
6767
6930
  operation: "identify",
6768
6931
  userIdPresent: Boolean(userId),
6769
6932
  hasUserProperties: Boolean(userProperties)
@@ -6783,17 +6946,20 @@ var identifyCoreUser = (userId, userProperties) => {
6783
6946
  });
6784
6947
  return;
6785
6948
  }
6786
- currentUserProperties = { ...userProperties };
6949
+ currentUserProperties = userProperties ? { ...userProperties } : void 0;
6787
6950
  };
6788
6951
  var resetCoreMixpanel = () => {
6789
- if (!isMixpanelInitialized) return;
6790
- try {
6791
- mixpanel.reset();
6792
- } catch (err) {
6793
- reportMixpanelError("reset_failed", err, {
6794
- operation: "reset"
6795
- });
6952
+ if (isMixpanelInitialized) {
6953
+ try {
6954
+ mixpanel.reset();
6955
+ } catch (err) {
6956
+ reportMixpanelError("reset_failed", err, {
6957
+ operation: "reset"
6958
+ });
6959
+ }
6796
6960
  }
6961
+ currentUserProperties = void 0;
6962
+ queuedMixpanelActions.splice(0, queuedMixpanelActions.length);
6797
6963
  };
6798
6964
 
6799
6965
  // src/lib/services/sseClient.ts
@@ -10350,6 +10516,15 @@ var AuthProvider = ({ children }) => {
10350
10516
  const [error, setError] = useState(null);
10351
10517
  const [authStatus, setAuthStatus] = useState("loading");
10352
10518
  const [showOnboarding, setShowOnboarding] = useState(false);
10519
+ const auditInitRef = useRef(false);
10520
+ if (!auditInitRef.current && typeof window !== "undefined") {
10521
+ const backendUrl = process.env.NEXT_PUBLIC_BACKEND_URL || "http://localhost:8000";
10522
+ initAuthAuditLog(backendUrl, async () => {
10523
+ const { data: { session: s } } = await supabase.auth.getSession();
10524
+ return s?.access_token ?? null;
10525
+ });
10526
+ auditInitRef.current = true;
10527
+ }
10353
10528
  const isFetchingRef = useRef(false);
10354
10529
  const lastProcessedSessionRef = useRef(null);
10355
10530
  const hasAuthenticatedRef = useRef(false);
@@ -10513,6 +10688,7 @@ var AuthProvider = ({ children }) => {
10513
10688
  resetRecoveryState();
10514
10689
  if (refreshResult.invalidRefreshToken) {
10515
10690
  console.warn("[AuthContext] Refresh token invalid, redirecting to login");
10691
+ logAuthEvent("forced_logout", { reason: "invalid_refresh_token", trigger: "fetchSession" });
10516
10692
  setAuthStatus("failed");
10517
10693
  clearSessionState();
10518
10694
  await handleAuthRequired(supabase, "session_expired");
@@ -10612,6 +10788,7 @@ var AuthProvider = ({ children }) => {
10612
10788
  const signOut = useCallback(async () => {
10613
10789
  try {
10614
10790
  console.log("[AuthContext] Signing out");
10791
+ logAuthEvent("sign_out_initiated", { trigger: "user_action" });
10615
10792
  setAuthStatus("loading");
10616
10793
  resetRecoveryState();
10617
10794
  clearAuthSnapshot();
@@ -10636,6 +10813,22 @@ var AuthProvider = ({ children }) => {
10636
10813
  return;
10637
10814
  }
10638
10815
  const monitorTokenExpiry = async () => {
10816
+ const storedSession = getSessionFromStorage();
10817
+ if (storedSession && isSessionValid(storedSession, 5 * 60 * 1e3)) {
10818
+ if (storedSession.access_token !== session.access_token) {
10819
+ console.log("[AuthContext] Adopting session refreshed by another tab");
10820
+ logAuthEvent("cross_tab_refresh_adopted", { source: "monitorTokenExpiry" });
10821
+ setTrackedSession(storedSession);
10822
+ try {
10823
+ await supabase.auth.setSession({
10824
+ access_token: storedSession.access_token,
10825
+ refresh_token: storedSession.refresh_token
10826
+ });
10827
+ } catch {
10828
+ }
10829
+ }
10830
+ return;
10831
+ }
10639
10832
  const expiresAt = session.expires_at;
10640
10833
  if (!expiresAt) {
10641
10834
  console.warn("[AuthContext] Session has no expiry time");
@@ -10648,13 +10841,16 @@ var AuthProvider = ({ children }) => {
10648
10841
  console.log(`[AuthContext] Token expires in ${minutesUntilExpiry} minutes`);
10649
10842
  if (minutesUntilExpiry < 5 && timeUntilExpiry > 0) {
10650
10843
  console.warn("[AuthContext] Token expiring soon, attempting refresh...");
10844
+ logAuthEvent("token_refresh_started", { reason: "expiring_soon", minutesUntilExpiry });
10651
10845
  const refreshResult = await refreshSessionSingleFlight(supabase);
10652
10846
  if (isSessionValid(refreshResult.session, 0)) {
10653
10847
  setTrackedSession(refreshResult.session);
10848
+ logAuthEvent("token_refresh_succeeded", { expiresAt: refreshResult.session?.expires_at });
10654
10849
  console.log("[AuthContext] Token refreshed successfully");
10655
10850
  return;
10656
10851
  }
10657
10852
  if (refreshResult.invalidRefreshToken) {
10853
+ logAuthEvent("token_refresh_failed", { reason: "invalid_refresh_token", trigger: "proactive" });
10658
10854
  clearAuthSnapshot();
10659
10855
  resetRecoveryState();
10660
10856
  console.error("[AuthContext] Refresh token invalid during proactive refresh");
@@ -10663,13 +10859,16 @@ var AuthProvider = ({ children }) => {
10663
10859
  }
10664
10860
  if (timeUntilExpiry <= 0) {
10665
10861
  console.warn("[AuthContext] Token has expired, attempting refresh...");
10862
+ logAuthEvent("token_refresh_started", { reason: "expired", minutesUntilExpiry });
10666
10863
  const refreshResult = await refreshSessionSingleFlight(supabase);
10667
10864
  if (isSessionValid(refreshResult.session, 0)) {
10668
10865
  setTrackedSession(refreshResult.session);
10866
+ logAuthEvent("token_refresh_succeeded", { expiresAt: refreshResult.session?.expires_at });
10669
10867
  console.log("[AuthContext] Token refreshed after expiry");
10670
10868
  return;
10671
10869
  }
10672
10870
  if (refreshResult.invalidRefreshToken) {
10871
+ logAuthEvent("token_refresh_failed", { reason: "invalid_refresh_token", trigger: "expired" });
10673
10872
  clearAuthSnapshot();
10674
10873
  resetRecoveryState();
10675
10874
  console.error("[AuthContext] Refresh token invalid after expiry");
@@ -10721,6 +10920,29 @@ var AuthProvider = ({ children }) => {
10721
10920
  window.addEventListener("rbac:refresh-scope", handleScopeRefresh);
10722
10921
  return () => window.removeEventListener("rbac:refresh-scope", handleScopeRefresh);
10723
10922
  }, [fetchSession, session]);
10923
+ useEffect(() => {
10924
+ if (typeof window === "undefined") return;
10925
+ const handleStorageChange = (e) => {
10926
+ if (!e.key?.startsWith("sb-") || !e.key?.endsWith("-auth-token")) return;
10927
+ if (!e.newValue || !session) return;
10928
+ try {
10929
+ const stored = JSON.parse(e.newValue);
10930
+ if (stored?.access_token && stored?.refresh_token && stored?.expires_at && stored.access_token !== session.access_token) {
10931
+ console.log("[AuthContext] Cross-tab token update detected, syncing session");
10932
+ logAuthEvent("cross_tab_refresh_adopted", { source: "storage_event" });
10933
+ setTrackedSession(stored);
10934
+ supabase.auth.setSession({
10935
+ access_token: stored.access_token,
10936
+ refresh_token: stored.refresh_token
10937
+ }).catch(() => {
10938
+ });
10939
+ }
10940
+ } catch {
10941
+ }
10942
+ };
10943
+ window.addEventListener("storage", handleStorageChange);
10944
+ return () => window.removeEventListener("storage", handleStorageChange);
10945
+ }, [session, setTrackedSession, supabase]);
10724
10946
  useEffect(() => {
10725
10947
  if (typeof window === "undefined" || authStatus !== "recovering") {
10726
10948
  return;
@@ -10812,6 +11034,7 @@ var AuthProvider = ({ children }) => {
10812
11034
  }
10813
11035
  if (event === "SIGNED_OUT") {
10814
11036
  console.log("[AuthContext] User signed out");
11037
+ logAuthEvent("signed_out", { trigger: "auth_state_change" });
10815
11038
  resetRecoveryState();
10816
11039
  clearAuthSnapshot();
10817
11040
  clearSessionState();
@@ -11088,7 +11311,7 @@ function useSessionTracking(options = {}) {
11088
11311
  const trackerRef = useRef(null);
11089
11312
  const isTrackingRef = useRef(false);
11090
11313
  const initRef = useRef(false);
11091
- const getAccessToken = useCallback(async () => {
11314
+ const getAccessToken2 = useCallback(async () => {
11092
11315
  return session?.access_token || null;
11093
11316
  }, [session?.access_token]);
11094
11317
  useEffect(() => {
@@ -11096,14 +11319,14 @@ function useSessionTracking(options = {}) {
11096
11319
  return;
11097
11320
  }
11098
11321
  initRef.current = true;
11099
- const apiBaseUrl = config?.apiBaseUrl || process.env.NEXT_PUBLIC_API_BASE_URL || "";
11100
- if (!apiBaseUrl) {
11322
+ const apiBaseUrl2 = config?.apiBaseUrl || process.env.NEXT_PUBLIC_API_BASE_URL || "";
11323
+ if (!apiBaseUrl2) {
11101
11324
  console.warn("[useSessionTracking] No API base URL configured, session tracking disabled");
11102
11325
  return;
11103
11326
  }
11104
11327
  const tracker = createSessionTracker({
11105
- apiBaseUrl,
11106
- getAccessToken,
11328
+ apiBaseUrl: apiBaseUrl2,
11329
+ getAccessToken: getAccessToken2,
11107
11330
  onSessionStart: (sessionId) => {
11108
11331
  isTrackingRef.current = true;
11109
11332
  onSessionStart?.(sessionId);
@@ -11124,7 +11347,7 @@ function useSessionTracking(options = {}) {
11124
11347
  initRef.current = false;
11125
11348
  isTrackingRef.current = false;
11126
11349
  };
11127
- }, [enabled, isAuthenticated, user?.id, session?.access_token, config?.apiBaseUrl, getAccessToken, onSessionStart, onSessionEnd, user]);
11350
+ }, [enabled, isAuthenticated, user?.id, session?.access_token, config?.apiBaseUrl, getAccessToken2, onSessionStart, onSessionEnd, user]);
11128
11351
  useEffect(() => {
11129
11352
  if (!isAuthenticated && trackerRef.current && isTrackingRef.current) {
11130
11353
  trackerRef.current.endSession("logout");
@@ -19705,9 +19928,9 @@ function useUserUsage(userId, options = {}) {
19705
19928
  const [data, setData] = useState(null);
19706
19929
  const [isLoading, setIsLoading] = useState(true);
19707
19930
  const [error, setError] = useState(null);
19708
- const apiBaseUrl = config?.apiBaseUrl || process.env.NEXT_PUBLIC_API_BASE_URL || "";
19931
+ const apiBaseUrl2 = config?.apiBaseUrl || process.env.NEXT_PUBLIC_API_BASE_URL || "";
19709
19932
  const fetchData = useCallback(async () => {
19710
- if (!userId || !apiBaseUrl || !session?.access_token) {
19933
+ if (!userId || !apiBaseUrl2 || !session?.access_token) {
19711
19934
  setIsLoading(false);
19712
19935
  return;
19713
19936
  }
@@ -19717,7 +19940,7 @@ function useUserUsage(userId, options = {}) {
19717
19940
  const params = new URLSearchParams();
19718
19941
  if (startDate) params.append("start_date", startDate);
19719
19942
  if (endDate) params.append("end_date", endDate);
19720
- const url = `${apiBaseUrl}/api/usage/user/${userId}${params.toString() ? `?${params}` : ""}`;
19943
+ const url = `${apiBaseUrl2}/api/usage/user/${userId}${params.toString() ? `?${params}` : ""}`;
19721
19944
  const response = await fetch(url, {
19722
19945
  headers: {
19723
19946
  "Authorization": `Bearer ${session.access_token}`
@@ -19735,7 +19958,7 @@ function useUserUsage(userId, options = {}) {
19735
19958
  } finally {
19736
19959
  setIsLoading(false);
19737
19960
  }
19738
- }, [userId, apiBaseUrl, session?.access_token, startDate, endDate]);
19961
+ }, [userId, apiBaseUrl2, session?.access_token, startDate, endDate]);
19739
19962
  useEffect(() => {
19740
19963
  if (enabled) {
19741
19964
  fetchData();
@@ -19757,12 +19980,12 @@ function useCompanyUsersUsage(companyId, options = {}) {
19757
19980
  const [isLoading, setIsLoading] = useState(true);
19758
19981
  const [isTodayLoading, setIsTodayLoading] = useState(true);
19759
19982
  const [error, setError] = useState(null);
19760
- const apiBaseUrl = config?.apiBaseUrl || process.env.NEXT_PUBLIC_BACKEND_URL || "";
19983
+ const apiBaseUrl2 = config?.apiBaseUrl || process.env.NEXT_PUBLIC_BACKEND_URL || "";
19761
19984
  const userRole = user?.role || user?.role_level;
19762
19985
  const canAccess = userRole === "owner" || userRole === "optifye";
19763
- const isEnabled = enabled && canAccess && !!apiBaseUrl;
19986
+ const isEnabled = enabled && canAccess && !!apiBaseUrl2;
19764
19987
  const fetchOwnerReport = useCallback(async () => {
19765
- if (!apiBaseUrl || !session?.access_token || !canAccess || !isEnabled) {
19988
+ if (!apiBaseUrl2 || !session?.access_token || !canAccess || !isEnabled) {
19766
19989
  setIsLoading(false);
19767
19990
  return;
19768
19991
  }
@@ -19777,7 +20000,7 @@ function useCompanyUsersUsage(companyId, options = {}) {
19777
20000
  if (startDate) params.append("start_date", startDate);
19778
20001
  if (endDate) params.append("end_date", endDate);
19779
20002
  if (roleFilter) params.append("role_filter", roleFilter);
19780
- const url = `${apiBaseUrl}/api/usage/owner-report${params.toString() ? `?${params}` : ""}`;
20003
+ const url = `${apiBaseUrl2}/api/usage/owner-report${params.toString() ? `?${params}` : ""}`;
19781
20004
  const response = await fetch(url, {
19782
20005
  headers: {
19783
20006
  "Authorization": `Bearer ${session.access_token}`
@@ -19795,15 +20018,15 @@ function useCompanyUsersUsage(companyId, options = {}) {
19795
20018
  } finally {
19796
20019
  setIsLoading(false);
19797
20020
  }
19798
- }, [apiBaseUrl, session?.access_token, canAccess, isEnabled, startDate, endDate, roleFilter]);
20021
+ }, [apiBaseUrl2, session?.access_token, canAccess, isEnabled, startDate, endDate, roleFilter]);
19799
20022
  const fetchTodayUsage = useCallback(async () => {
19800
- if (!apiBaseUrl || !session?.access_token || !canAccess || !isEnabled) {
20023
+ if (!apiBaseUrl2 || !session?.access_token || !canAccess || !isEnabled) {
19801
20024
  setIsTodayLoading(false);
19802
20025
  return;
19803
20026
  }
19804
20027
  setIsTodayLoading(true);
19805
20028
  try {
19806
- const url = `${apiBaseUrl}/api/usage/today`;
20029
+ const url = `${apiBaseUrl2}/api/usage/today`;
19807
20030
  const response = await fetch(url, {
19808
20031
  headers: {
19809
20032
  "Authorization": `Bearer ${session.access_token}`
@@ -19819,7 +20042,7 @@ function useCompanyUsersUsage(companyId, options = {}) {
19819
20042
  } finally {
19820
20043
  setIsTodayLoading(false);
19821
20044
  }
19822
- }, [apiBaseUrl, session?.access_token, canAccess, isEnabled]);
20045
+ }, [apiBaseUrl2, session?.access_token, canAccess, isEnabled]);
19823
20046
  const fetchAll = useCallback(async () => {
19824
20047
  await Promise.all([
19825
20048
  fetchOwnerReport(),
@@ -19889,9 +20112,9 @@ function useCompanyClipsCost() {
19889
20112
  const hasFetchedOnceRef = useRef(false);
19890
20113
  const canViewClipsCost = user?.role_level === "owner" || user?.role_level === "optifye";
19891
20114
  const companyId = user?.properties?.company_id || user?.company_id || entityConfig.companyId;
19892
- const apiBaseUrl = config?.apiBaseUrl || process.env.NEXT_PUBLIC_API_BASE_URL || "";
20115
+ const apiBaseUrl2 = config?.apiBaseUrl || process.env.NEXT_PUBLIC_API_BASE_URL || "";
19893
20116
  const fetchData = useCallback(async () => {
19894
- if (!canViewClipsCost || !companyId || !supabase || !apiBaseUrl || !session?.access_token) {
20117
+ if (!canViewClipsCost || !companyId || !supabase || !apiBaseUrl2 || !session?.access_token) {
19895
20118
  setIsLoading(false);
19896
20119
  setData(null);
19897
20120
  hasFetchedOnceRef.current = false;
@@ -19903,7 +20126,7 @@ function useCompanyClipsCost() {
19903
20126
  setError(null);
19904
20127
  try {
19905
20128
  const [statsResponse, linesResult] = await Promise.all([
19906
- fetch(`${apiBaseUrl}/api/classification/company-stats?company_id=${encodeURIComponent(companyId)}`, {
20129
+ fetch(`${apiBaseUrl2}/api/classification/company-stats?company_id=${encodeURIComponent(companyId)}`, {
19907
20130
  headers: {
19908
20131
  "Authorization": `Bearer ${session.access_token}`
19909
20132
  }
@@ -19938,7 +20161,7 @@ function useCompanyClipsCost() {
19938
20161
  hasFetchedOnceRef.current = true;
19939
20162
  setIsLoading(false);
19940
20163
  }
19941
- }, [canViewClipsCost, companyId, supabase, apiBaseUrl, session?.access_token]);
20164
+ }, [canViewClipsCost, companyId, supabase, apiBaseUrl2, session?.access_token]);
19942
20165
  useEffect(() => {
19943
20166
  fetchData();
19944
20167
  }, [fetchData]);
@@ -23474,11 +23697,11 @@ function createRenderStep(runNextFrame) {
23474
23697
  */
23475
23698
  schedule: (callback, keepAlive = false, immediate = false) => {
23476
23699
  const addToCurrentFrame = immediate && isProcessing;
23477
- const queue = addToCurrentFrame ? thisFrame : nextFrame;
23700
+ const queue2 = addToCurrentFrame ? thisFrame : nextFrame;
23478
23701
  if (keepAlive)
23479
23702
  toKeepAlive.add(callback);
23480
- if (!queue.has(callback))
23481
- queue.add(callback);
23703
+ if (!queue2.has(callback))
23704
+ queue2.add(callback);
23482
23705
  return callback;
23483
23706
  },
23484
23707
  /**
@@ -52646,7 +52869,7 @@ var SideNavBar = memo$1(({
52646
52869
  transition-all duration-200 ease-out focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2`;
52647
52870
  }, [pathname]);
52648
52871
  const buildDashboardSurfaceTrackingEvent = useCallback((source, destinationPath, dashboardSurface) => ({
52649
- name: dashboardSurface === "operations_overview" ? "Operations Overview clicked" : "monitor page clicked",
52872
+ name: ROOT_DASHBOARD_EVENT_NAMES[dashboardSurface],
52650
52873
  properties: {
52651
52874
  source,
52652
52875
  destination_path: destinationPath,
@@ -53927,7 +54150,7 @@ var AwardNotificationManager = () => {
53927
54150
  const supabase = useSupabase();
53928
54151
  const { user } = useAuth();
53929
54152
  const router = useRouter();
53930
- const [queue, setQueue] = useState([]);
54153
+ const [queue2, setQueue] = useState([]);
53931
54154
  const [activeNotification, setActiveNotification] = useState(null);
53932
54155
  const lastUserIdRef = useRef(null);
53933
54156
  useEffect(() => {
@@ -53948,10 +54171,10 @@ var AwardNotificationManager = () => {
53948
54171
  loadNotifications();
53949
54172
  }, [user, supabase]);
53950
54173
  useEffect(() => {
53951
- if (!activeNotification && queue.length > 0) {
53952
- setActiveNotification(queue[0]);
54174
+ if (!activeNotification && queue2.length > 0) {
54175
+ setActiveNotification(queue2[0]);
53953
54176
  }
53954
- }, [queue, activeNotification]);
54177
+ }, [queue2, activeNotification]);
53955
54178
  const dismissActive = async () => {
53956
54179
  if (!activeNotification) return;
53957
54180
  if (!activeNotification.id.startsWith("mock-")) {
@@ -79547,4 +79770,4 @@ var streamProxyConfig = {
79547
79770
  }
79548
79771
  };
79549
79772
 
79550
- export { ACTION_FAMILIES, ACTION_NAMES, AIAgentView_default as AIAgentView, AcceptInvite, AcceptInviteView_default as AcceptInviteView, AdvancedFilterDialog, AdvancedFilterPanel, AudioService, AuthCallback, AuthCallbackView_default as AuthCallbackView, AuthProvider, AuthService, AuthenticatedBottleneckClipsView, AuthenticatedFactoryView, AuthenticatedHelpView, AuthenticatedHomeView, AuthenticatedShiftsView, AuthenticatedTargetsView, AuthenticatedTicketsView, AuthenticatedWorkspaceHealthView, AvatarUpload, AxelNotificationPopup, AxelOrb, BackButton, BackButtonMinimal, BarChart, BaseHistoryCalendar, BottleneckClipsModal, BottleneckClipsView_default as BottleneckClipsView, BottlenecksContent, BreakNotificationPopup, CachePrefetchStatus, Card2 as Card, CardContent2 as CardContent, CardDescription2 as CardDescription, CardFooter2 as CardFooter, CardHeader2 as CardHeader, CardTitle2 as CardTitle, ChangeRoleDialog, ClipFilterProvider, ClipsCostView_default as ClipsCostView, CompactWorkspaceHealthCard, ConfirmRemoveUserDialog, CongratulationsOverlay, CroppedHlsVideoPlayer, CroppedVideoPlayer, CycleTimeChart, CycleTimeOverTimeChart, DEFAULT_ANALYTICS_CONFIG, DEFAULT_AUTH_CONFIG, DEFAULT_CONFIG, DEFAULT_DATABASE_CONFIG, DEFAULT_DATE_TIME_CONFIG, DEFAULT_ENDPOINTS_CONFIG, DEFAULT_ENTITY_CONFIG, DEFAULT_HOME_VIEW_CONFIG, DEFAULT_MAP_VIEW_CONFIG, DEFAULT_SHIFT_CONFIG, DEFAULT_SHIFT_DATA, DEFAULT_THEME_CONFIG, DEFAULT_VIDEO_CONFIG, DEFAULT_WORKSPACE_CONFIG, DEFAULT_WORKSPACE_POSITIONS, DashboardHeader, DashboardLayout, DashboardOverridesProvider, DashboardProvider, DateDisplay_default as DateDisplay, DateTimeDisplay, DebugAuth, DebugAuthView_default as DebugAuthView, DetailedHealthStatus, DiagnosisVideoModal, EFFICIENCY_ON_TRACK_THRESHOLD, EmptyStateMessage, EncouragementOverlay, FactoryAssignmentDropdown, FactoryView_default as FactoryView, FileManagerFilters, FilterDialogTrigger, FirstTimeLoginDebug, FirstTimeLoginHandler, FittingTitle, GaugeChart, GridComponentsPlaceholder, HamburgerButton, Header, HealthDateShiftSelector, HealthStatusGrid, HealthStatusIndicator, HelpView_default as HelpView, HlsVideoPlayer, HomeView_default as HomeView, HourlyOutputChart2 as HourlyOutputChart, HourlyUptimeChart, ISTTimer_default as ISTTimer, IdleTimeVlmConfigProvider, ImprovementCenterView_default as ImprovementCenterView, InlineEditableText, InteractiveOnboardingTour, InvitationService, InvitationsTable, InviteUserDialog, KPICard, KPIDetailView_default as KPIDetailView, KPIGrid, KPIHeader, KPISection, KPIsOverviewView_default as KPIsOverviewView, LINE_1_UUID, LINE_2_UUID, LargeOutputProgressChart, LeaderboardDetailView_default as LeaderboardDetailView, Legend5 as Legend, LineAssignmentDropdown, LineChart, LineHistoryCalendar, LineMonthlyHistory, LineMonthlyPdfGenerator, LinePdfExportButton, LinePdfGenerator, LineWhatsAppShareButton, LinesService, LiveTimer, LoadingInline, LoadingOverlay_default as LoadingOverlay, LoadingPage_default as LoadingPage, LoadingSkeleton, LoadingState, LoginPage, LoginView_default as LoginView, Logo, MainLayout, MapGridView, MetricCard_default as MetricCard, MinimalOnboardingPopup, MobileMenuProvider, NewClipsNotification, NoWorkspaceData, OnboardingDemo, OnboardingTour, OptifyeAgentClient, OptifyeLogoLoader_default as OptifyeLogoLoader, OutputProgressChart, PageHeader, PieChart4 as PieChart, PlantHeadView_default as PlantHeadView, PlayPauseIndicator, PrefetchConfigurationError, PrefetchError, PrefetchEvents, PrefetchStatus, PrefetchTimeoutError, ProfileView_default as ProfileView, RegistryProvider, RoleBadge, S3ClipsSupabaseService as S3ClipsService, S3Service, SKUManagementView, SOPComplianceChart, SSEChatClient, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SessionTracker, SessionTrackingContext, SessionTrackingProvider, SettingsPopup, ShiftDisplay_default as ShiftDisplay, ShiftsView_default as ShiftsView, SideNavBar, SignupWithInvitation, SilentErrorBoundary, SimpleOnboardingPopup, SingleVideoStream_default as SingleVideoStream, Skeleton, SubscriptionManager, SubscriptionManagerProvider, SupabaseProvider, SupervisorDropdown_default as SupervisorDropdown, SupervisorManagementView_default as SupervisorManagementView, SupervisorService, TargetWorkspaceGrid, TargetsView_default as TargetsView, TeamManagementView_default as TeamManagementView, ThreadSidebar, TicketHistory_default as TicketHistory, TicketHistoryService, TicketsView_default as TicketsView, TimeDisplay_default as TimeDisplay, TimePickerDropdown, Timer_default as Timer, TimezoneProvider, TimezoneService, UptimeDonutChart, UptimeLineChart, UptimeMetricCards, UserAvatar, UserManagementService, UserManagementTable, UserService, UserUsageDetailModal, UserUsageStats, VideoCard, VideoGridView, VideoPlayer, VideoPreloader, WORKSPACE_POSITIONS, WhatsAppShareButton, WorkspaceCard, WorkspaceCycleTimeMetricCards, WorkspaceDetailView_default as WorkspaceDetailView, WorkspaceDisplayNameExample, WorkspaceGrid, WorkspaceGridItem, WorkspaceHealthCard, WorkspaceHealthView_default as WorkspaceHealthView, WorkspaceHistoryCalendar, WorkspaceMetricCards, WorkspaceMetricCardsImpl, WorkspaceMonthlyDataFetcher, WorkspaceMonthlyHistory, WorkspaceMonthlyPdfGenerator, WorkspacePdfExportButton, WorkspacePdfGenerator, WorkspaceWhatsAppShareButton, actionService, aggregateKPIsFromLineMetricsRows, alertsService, apiUtils, areAllLinesOnSameShift, authCoreService, authOTPService, authRateLimitService, awardsService, buildDateKey, buildKPIsFromLineMetricsRow, buildShiftGroupsKey, canRoleAccessDashboardPath, canRoleAccessTeamManagement, canRoleAssignFactories, canRoleAssignLines, canRoleChangeRole, canRoleInviteRole, canRoleManageCompany, canRoleManageTargets, canRoleManageUsers, canRoleRemoveUser, canRoleViewClipsCost, canRoleViewUsageStats, captureSentryException, captureSentryMessage, checkRateLimit2 as checkRateLimit, clearAllRateLimits2 as clearAllRateLimits, clearRateLimit2 as clearRateLimit, clearS3VideoCache, clearS3VideoFromCache, clearSentryContext, clearWorkspaceDisplayNamesCache, cn, createDefaultKPIs, createInvitationService, createLinesService, createSessionTracker, createStorageService, createStreamProxyHandler, createSupabaseClient, createSupervisorService, createThrottledReload, createUserManagementService, createUserService, dashboardService, deleteThread, fetchIdleTimeReasons, filterDataByDateKeyRange, forceRefreshWorkspaceDisplayNames, formatAwardMonth, formatDateInZone, formatDateKeyForDisplay, formatDateTimeInZone, formatDuration2 as formatDuration, formatISTDate, formatIdleTime, formatRangeLabel, formatReasonLabel, formatRelativeTime, formatTimeInZone, fromUrlFriendlyName, getActionDisplayName, getActiveShift, getAllLineDisplayNames, getAllThreadMessages, getAllWorkspaceDisplayNamesAsync, getAllWorkspaceDisplayNamesSnapshot, getAnonClient, getAssignableRoles, getAssignmentColumnLabel, getAvailableShiftIds, getAwardBadgeType, getAwardDescription, getAwardTitle, getBrowserName, getCameraNumber, getCompanyMetricsTableName, getConfigurableShortWorkspaceDisplayName, getConfigurableWorkspaceDisplayName, getConfiguredLineIds, getCoreSessionRecordingProperties, getCoreSessionReplayUrl, getCurrentShift, getCurrentShiftForLine, getCurrentTimeInZone, getCurrentWeekFullRange, getCurrentWeekToDateRange, getDashboardHeaderTimeInZone, getDateKeyFromDate, getDaysDifferenceInZone, getDefaultCameraStreamUrl, getDefaultLineId, getDefaultTabForWorkspace, getInitials, getLineDisplayName, getManufacturingInsights, getMetricsTablePrefix, getMonthKeyBounds, getMonthWeekRanges, getNextUpdateInterval, getOperationalDate, getRoleAssignmentKind, getRoleDescription, getRoleLabel, getRoleMetadata, getRoleNavPaths, getS3SignedUrl, getS3VideoSrc, getShiftData, getShiftNameById, getShiftWorkDurationSeconds, getShortShiftName, getShortWorkspaceDisplayName, getShortWorkspaceDisplayNameAsync, getStoredWorkspaceMappings, getSubscriptionManager, getThreadMessages, getUniformShiftGroup, getUserThreads, getUserThreadsPaginated, getVisibleRolesForCurrentUser, getWorkspaceDisplayName, getWorkspaceDisplayNameAsync, getWorkspaceDisplayNamesMap, getWorkspaceFromUrl, getWorkspaceNavigationParams, groupLinesByShift, hasAnyShiftData, identifyCoreUser, initializeCoreMixpanel, isEfficiencyOnTrack, isFactoryScopedRole, isFullMonthRange, isLegacyConfiguration, isLoopbackHostname, isPrefetchError, isRecentFlowVideoGridMetricMode, isSafari, isSupervisorRole, isTransitionPeriod, isUrlPermanentlyFailed, isValidFactoryViewConfiguration, isValidLineInfoPayload, isValidPrefetchParams, isValidPrefetchStatus, isValidWorkspaceDetailedMetricsPayload, isValidWorkspaceMetricsPayload, isWipGatedVideoGridMetricMode, isWorkspaceDisplayNamesLoaded, isWorkspaceDisplayNamesLoading, lineLeaderboardService, linesService, mergeWithDefaultConfig, migrateLegacyConfiguration, normalizeActionFamily, normalizeDateKeyRange, normalizeRoleLevel, normalizeVideoGridMetricMode, optifyeAgentClient, parseDateKeyToDate, parseS3Uri, preInitializeWorkspaceDisplayNames, preloadS3Video, preloadS3VideoUrl, preloadS3VideosUrl, preloadVideoUrl, preloadVideosUrl, qualityService, realtimeService, refreshWorkspaceDisplayNames, resetCoreMixpanel, resetFailedUrl, resetSubscriptionManager, s3VideoPreloader, setSentryUserContext, setSentryWorkspaceContext, shouldEnableLocalDevTestLogin, shuffleArray, simulateApiDelay, skuService, startCoreSessionRecording, stopCoreSessionRecording, storeWorkspaceMapping, streamProxyConfig, subscribeWorkspaceDisplayNames, throttledReloadDashboard, toUrlFriendlyName, trackCoreEvent, trackCorePageView, transformToChartData, updateThreadTitle, upsertWorkspaceDisplayNameInCache, useAccessControl, useActiveBreaks, useActiveLineId, useAllWorkspaceMetrics, useAnalyticsConfig, useAppTimezone, useAudioService, useAuth, useAuthConfig, useAxelNotifications, useCanSaveTargets, useClipFilter, useClipTypes, useClipTypesWithCounts, useClipsInit, useCompanyClipsCost, useCompanyHasVlmEnabledLine, useCompanyUsersUsage, useComponentOverride, useCustomConfig, useDashboardConfig, useDashboardMetrics, useDatabaseConfig, useDateFormatter, useDateTimeConfig, useDynamicShiftConfig, useEndpointsConfig, useEntityConfig, useFactoryOverviewMetrics, useFeatureFlags, useFormatNumber, useHasLineAccess, useHideMobileHeader, useHistoricWorkspaceMetrics, useHlsStream, useHlsStreamWithCropping, useHookOverride, useHourEndTimer, useHourlyTargetAchievements, useHourlyTargetMisses, useIdleTimeClipClassifications, useIdleTimeReasons, useIdleTimeVlmConfig, useKpiTrends, useLeaderboardMetrics, useLineDetailedMetrics, useLineKPIs, useLineMetrics, useLineShiftConfig, useLineSupervisor, useLineWorkspaceMetrics, useLines, useMessages, useMetrics, useMobileMenu, useMonthlyTrend, useMultiLineShiftConfigs, useNavigation, useOperationalShiftKey, useOptionalSupabase, useOverrides, usePageOverride, usePrefetchClipCounts, useRealtimeLineMetrics, useRegistry, useSKUs, useSessionKeepAlive, useSessionTracking, useSessionTrackingContext, useShiftConfig, useShiftGroups, useShifts, useSubscriptionManager, useSubscriptionManagerSafe, useSupabase, useSupabaseClient, useSupervisorsByLineIds, useTargets, useTeamManagementPermissions, useTheme, useThemeConfig, useThreads, useTicketHistory, useTimezoneContext, useUserLineAccess, useUserUsage, useVideoConfig, useWorkspaceConfig, useWorkspaceDetailedMetrics, useWorkspaceDisplayName, useWorkspaceDisplayNames, useWorkspaceDisplayNamesMap, useWorkspaceHealthById, useWorkspaceHealthLastSeen, useWorkspaceHealthStatus, useWorkspaceMetrics, useWorkspaceNavigation, useWorkspaceOperators, useWorkspaceUptimeTimeline, useWorkspaceVideoStreams, userService, videoPrefetchManager, videoPreloader, weeklyTopPerformerService, whatsappService, withAccessControl, withAuth, withRegistry, withTimezone, workspaceHealthService, workspaceService };
79773
+ export { ACTION_FAMILIES, ACTION_NAMES, AIAgentView_default as AIAgentView, AcceptInvite, AcceptInviteView_default as AcceptInviteView, AdvancedFilterDialog, AdvancedFilterPanel, AudioService, AuthCallback, AuthCallbackView_default as AuthCallbackView, AuthProvider, AuthService, AuthenticatedBottleneckClipsView, AuthenticatedFactoryView, AuthenticatedHelpView, AuthenticatedHomeView, AuthenticatedShiftsView, AuthenticatedTargetsView, AuthenticatedTicketsView, AuthenticatedWorkspaceHealthView, AvatarUpload, AxelNotificationPopup, AxelOrb, BackButton, BackButtonMinimal, BarChart, BaseHistoryCalendar, BottleneckClipsModal, BottleneckClipsView_default as BottleneckClipsView, BottlenecksContent, BreakNotificationPopup, CachePrefetchStatus, Card2 as Card, CardContent2 as CardContent, CardDescription2 as CardDescription, CardFooter2 as CardFooter, CardHeader2 as CardHeader, CardTitle2 as CardTitle, ChangeRoleDialog, ClipFilterProvider, ClipsCostView_default as ClipsCostView, CompactWorkspaceHealthCard, ConfirmRemoveUserDialog, CongratulationsOverlay, CroppedHlsVideoPlayer, CroppedVideoPlayer, CycleTimeChart, CycleTimeOverTimeChart, DEFAULT_ANALYTICS_CONFIG, DEFAULT_AUTH_CONFIG, DEFAULT_CONFIG, DEFAULT_DATABASE_CONFIG, DEFAULT_DATE_TIME_CONFIG, DEFAULT_ENDPOINTS_CONFIG, DEFAULT_ENTITY_CONFIG, DEFAULT_HOME_VIEW_CONFIG, DEFAULT_MAP_VIEW_CONFIG, DEFAULT_SHIFT_CONFIG, DEFAULT_SHIFT_DATA, DEFAULT_THEME_CONFIG, DEFAULT_VIDEO_CONFIG, DEFAULT_WORKSPACE_CONFIG, DEFAULT_WORKSPACE_POSITIONS, DashboardHeader, DashboardLayout, DashboardOverridesProvider, DashboardProvider, DateDisplay_default as DateDisplay, DateTimeDisplay, DebugAuth, DebugAuthView_default as DebugAuthView, DetailedHealthStatus, DiagnosisVideoModal, EFFICIENCY_ON_TRACK_THRESHOLD, EmptyStateMessage, EncouragementOverlay, FactoryAssignmentDropdown, FactoryView_default as FactoryView, FileManagerFilters, FilterDialogTrigger, FirstTimeLoginDebug, FirstTimeLoginHandler, FittingTitle, GaugeChart, GridComponentsPlaceholder, HamburgerButton, Header, HealthDateShiftSelector, HealthStatusGrid, HealthStatusIndicator, HelpView_default as HelpView, HlsVideoPlayer, HomeView_default as HomeView, HourlyOutputChart2 as HourlyOutputChart, HourlyUptimeChart, ISTTimer_default as ISTTimer, IdleTimeVlmConfigProvider, ImprovementCenterView_default as ImprovementCenterView, InlineEditableText, InteractiveOnboardingTour, InvitationService, InvitationsTable, InviteUserDialog, KPICard, KPIDetailView_default as KPIDetailView, KPIGrid, KPIHeader, KPISection, KPIsOverviewView_default as KPIsOverviewView, LINE_1_UUID, LINE_2_UUID, LargeOutputProgressChart, LeaderboardDetailView_default as LeaderboardDetailView, Legend5 as Legend, LineAssignmentDropdown, LineChart, LineHistoryCalendar, LineMonthlyHistory, LineMonthlyPdfGenerator, LinePdfExportButton, LinePdfGenerator, LineWhatsAppShareButton, LinesService, LiveTimer, LoadingInline, LoadingOverlay_default as LoadingOverlay, LoadingPage_default as LoadingPage, LoadingSkeleton, LoadingState, LoginPage, LoginView_default as LoginView, Logo, MainLayout, MapGridView, MetricCard_default as MetricCard, MinimalOnboardingPopup, MobileMenuProvider, NewClipsNotification, NoWorkspaceData, OnboardingDemo, OnboardingTour, OptifyeAgentClient, OptifyeLogoLoader_default as OptifyeLogoLoader, OutputProgressChart, PageHeader, PieChart4 as PieChart, PlantHeadView_default as PlantHeadView, PlayPauseIndicator, PrefetchConfigurationError, PrefetchError, PrefetchEvents, PrefetchStatus, PrefetchTimeoutError, ProfileView_default as ProfileView, ROOT_DASHBOARD_EVENT_NAMES, RegistryProvider, RoleBadge, S3ClipsSupabaseService as S3ClipsService, S3Service, SKUManagementView, SOPComplianceChart, SSEChatClient, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SessionTracker, SessionTrackingContext, SessionTrackingProvider, SettingsPopup, ShiftDisplay_default as ShiftDisplay, ShiftsView_default as ShiftsView, SideNavBar, SignupWithInvitation, SilentErrorBoundary, SimpleOnboardingPopup, SingleVideoStream_default as SingleVideoStream, Skeleton, SubscriptionManager, SubscriptionManagerProvider, SupabaseProvider, SupervisorDropdown_default as SupervisorDropdown, SupervisorManagementView_default as SupervisorManagementView, SupervisorService, TargetWorkspaceGrid, TargetsView_default as TargetsView, TeamManagementView_default as TeamManagementView, ThreadSidebar, TicketHistory_default as TicketHistory, TicketHistoryService, TicketsView_default as TicketsView, TimeDisplay_default as TimeDisplay, TimePickerDropdown, Timer_default as Timer, TimezoneProvider, TimezoneService, UptimeDonutChart, UptimeLineChart, UptimeMetricCards, UserAvatar, UserManagementService, UserManagementTable, UserService, UserUsageDetailModal, UserUsageStats, VideoCard, VideoGridView, VideoPlayer, VideoPreloader, WORKSPACE_POSITIONS, WhatsAppShareButton, WorkspaceCard, WorkspaceCycleTimeMetricCards, WorkspaceDetailView_default as WorkspaceDetailView, WorkspaceDisplayNameExample, WorkspaceGrid, WorkspaceGridItem, WorkspaceHealthCard, WorkspaceHealthView_default as WorkspaceHealthView, WorkspaceHistoryCalendar, WorkspaceMetricCards, WorkspaceMetricCardsImpl, WorkspaceMonthlyDataFetcher, WorkspaceMonthlyHistory, WorkspaceMonthlyPdfGenerator, WorkspacePdfExportButton, WorkspacePdfGenerator, WorkspaceWhatsAppShareButton, actionService, aggregateKPIsFromLineMetricsRows, alertsService, apiUtils, areAllLinesOnSameShift, authCoreService, authOTPService, authRateLimitService, awardsService, buildDateKey, buildKPIsFromLineMetricsRow, buildShiftGroupsKey, canRoleAccessDashboardPath, canRoleAccessTeamManagement, canRoleAssignFactories, canRoleAssignLines, canRoleChangeRole, canRoleInviteRole, canRoleManageCompany, canRoleManageTargets, canRoleManageUsers, canRoleRemoveUser, canRoleViewClipsCost, canRoleViewUsageStats, captureSentryException, captureSentryMessage, checkRateLimit2 as checkRateLimit, clearAllRateLimits2 as clearAllRateLimits, clearRateLimit2 as clearRateLimit, clearS3VideoCache, clearS3VideoFromCache, clearSentryContext, clearWorkspaceDisplayNamesCache, cn, createDefaultKPIs, createInvitationService, createLinesService, createSessionTracker, createStorageService, createStreamProxyHandler, createSupabaseClient, createSupervisorService, createThrottledReload, createUserManagementService, createUserService, dashboardService, deleteThread, fetchIdleTimeReasons, filterDataByDateKeyRange, forceRefreshWorkspaceDisplayNames, formatAwardMonth, formatDateInZone, formatDateKeyForDisplay, formatDateTimeInZone, formatDuration2 as formatDuration, formatISTDate, formatIdleTime, formatRangeLabel, formatReasonLabel, formatRelativeTime, formatTimeInZone, fromUrlFriendlyName, getActionDisplayName, getActiveShift, getAllLineDisplayNames, getAllThreadMessages, getAllWorkspaceDisplayNamesAsync, getAllWorkspaceDisplayNamesSnapshot, getAnonClient, getAssignableRoles, getAssignmentColumnLabel, getAvailableShiftIds, getAwardBadgeType, getAwardDescription, getAwardTitle, getBrowserName, getCameraNumber, getCompanyMetricsTableName, getConfigurableShortWorkspaceDisplayName, getConfigurableWorkspaceDisplayName, getConfiguredLineIds, getCoreSessionRecordingProperties, getCoreSessionReplayUrl, getCurrentShift, getCurrentShiftForLine, getCurrentTimeInZone, getCurrentWeekFullRange, getCurrentWeekToDateRange, getDashboardHeaderTimeInZone, getDateKeyFromDate, getDaysDifferenceInZone, getDefaultCameraStreamUrl, getDefaultLineId, getDefaultTabForWorkspace, getInitials, getLineDisplayName, getManufacturingInsights, getMetricsTablePrefix, getMonthKeyBounds, getMonthWeekRanges, getNextUpdateInterval, getOperationalDate, getRoleAssignmentKind, getRoleDescription, getRoleLabel, getRoleMetadata, getRoleNavPaths, getS3SignedUrl, getS3VideoSrc, getShiftData, getShiftNameById, getShiftWorkDurationSeconds, getShortShiftName, getShortWorkspaceDisplayName, getShortWorkspaceDisplayNameAsync, getStoredWorkspaceMappings, getSubscriptionManager, getThreadMessages, getUniformShiftGroup, getUserThreads, getUserThreadsPaginated, getVisibleRolesForCurrentUser, getWorkspaceDisplayName, getWorkspaceDisplayNameAsync, getWorkspaceDisplayNamesMap, getWorkspaceFromUrl, getWorkspaceNavigationParams, groupLinesByShift, hasAnyShiftData, identifyCoreUser, initializeCoreMixpanel, isEfficiencyOnTrack, isFactoryScopedRole, isFullMonthRange, isLegacyConfiguration, isLoopbackHostname, isPrefetchError, isRecentFlowVideoGridMetricMode, isSafari, isSupervisorRole, isTransitionPeriod, isUrlPermanentlyFailed, isValidFactoryViewConfiguration, isValidLineInfoPayload, isValidPrefetchParams, isValidPrefetchStatus, isValidWorkspaceDetailedMetricsPayload, isValidWorkspaceMetricsPayload, isWipGatedVideoGridMetricMode, isWorkspaceDisplayNamesLoaded, isWorkspaceDisplayNamesLoading, lineLeaderboardService, linesService, mergeWithDefaultConfig, migrateLegacyConfiguration, normalizeActionFamily, normalizeDateKeyRange, normalizeRoleLevel, normalizeVideoGridMetricMode, optifyeAgentClient, parseDateKeyToDate, parseS3Uri, preInitializeWorkspaceDisplayNames, preloadS3Video, preloadS3VideoUrl, preloadS3VideosUrl, preloadVideoUrl, preloadVideosUrl, qualityService, realtimeService, refreshWorkspaceDisplayNames, resetCoreMixpanel, resetFailedUrl, resetSubscriptionManager, s3VideoPreloader, setSentryUserContext, setSentryWorkspaceContext, shouldEnableLocalDevTestLogin, shuffleArray, simulateApiDelay, skuService, startCoreSessionRecording, stopCoreSessionRecording, storeWorkspaceMapping, streamProxyConfig, subscribeWorkspaceDisplayNames, throttledReloadDashboard, toUrlFriendlyName, trackCoreEvent, trackCorePageView, transformToChartData, updateThreadTitle, upsertWorkspaceDisplayNameInCache, useAccessControl, useActiveBreaks, useActiveLineId, useAllWorkspaceMetrics, useAnalyticsConfig, useAppTimezone, useAudioService, useAuth, useAuthConfig, useAxelNotifications, useCanSaveTargets, useClipFilter, useClipTypes, useClipTypesWithCounts, useClipsInit, useCompanyClipsCost, useCompanyHasVlmEnabledLine, useCompanyUsersUsage, useComponentOverride, useCustomConfig, useDashboardConfig, useDashboardMetrics, useDatabaseConfig, useDateFormatter, useDateTimeConfig, useDynamicShiftConfig, useEndpointsConfig, useEntityConfig, useFactoryOverviewMetrics, useFeatureFlags, useFormatNumber, useHasLineAccess, useHideMobileHeader, useHistoricWorkspaceMetrics, useHlsStream, useHlsStreamWithCropping, useHookOverride, useHourEndTimer, useHourlyTargetAchievements, useHourlyTargetMisses, useIdleTimeClipClassifications, useIdleTimeReasons, useIdleTimeVlmConfig, useKpiTrends, useLeaderboardMetrics, useLineDetailedMetrics, useLineKPIs, useLineMetrics, useLineShiftConfig, useLineSupervisor, useLineWorkspaceMetrics, useLines, useMessages, useMetrics, useMobileMenu, useMonthlyTrend, useMultiLineShiftConfigs, useNavigation, useOperationalShiftKey, useOptionalSupabase, useOverrides, usePageOverride, usePrefetchClipCounts, useRealtimeLineMetrics, useRegistry, useSKUs, useSessionKeepAlive, useSessionTracking, useSessionTrackingContext, useShiftConfig, useShiftGroups, useShifts, useSubscriptionManager, useSubscriptionManagerSafe, useSupabase, useSupabaseClient, useSupervisorsByLineIds, useTargets, useTeamManagementPermissions, useTheme, useThemeConfig, useThreads, useTicketHistory, useTimezoneContext, useUserLineAccess, useUserUsage, useVideoConfig, useWorkspaceConfig, useWorkspaceDetailedMetrics, useWorkspaceDisplayName, useWorkspaceDisplayNames, useWorkspaceDisplayNamesMap, useWorkspaceHealthById, useWorkspaceHealthLastSeen, useWorkspaceHealthStatus, useWorkspaceMetrics, useWorkspaceNavigation, useWorkspaceOperators, useWorkspaceUptimeTimeline, useWorkspaceVideoStreams, userService, videoPrefetchManager, videoPreloader, weeklyTopPerformerService, whatsappService, withAccessControl, withAuth, withRegistry, withTimezone, workspaceHealthService, workspaceService };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optifye/dashboard-core",
3
- "version": "6.11.21",
3
+ "version": "6.11.23",
4
4
  "description": "Reusable UI & logic for Optifye dashboard",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",