@optifye/dashboard-core 6.6.13 → 6.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -166,6 +166,8 @@ interface DashboardConfig {
166
166
  skuConfig?: SKUConfig;
167
167
  supervisorConfig?: SupervisorConfig;
168
168
  clipsConfig?: ClipsConfig;
169
+ ticketsConfig?: TicketsConfig;
170
+ mapViewConfig?: MapViewConfig;
169
171
  /** Feature flags or other arbitrary app-specific config values */
170
172
  featureFlags?: Record<string, boolean>;
171
173
  /** Generic object to allow any other custom config values needed by the app or overrides */
@@ -183,6 +185,7 @@ interface DatabaseConfig {
183
185
  shiftConfigurations?: string;
184
186
  qualityMetrics?: string;
185
187
  skus?: string;
188
+ workspace_health?: string;
186
189
  };
187
190
  }
188
191
  interface EntityConfig {
@@ -340,6 +343,30 @@ interface ClipsConfig {
340
343
  /** Enable/disable clips tab in workspace detail view */
341
344
  enabled: boolean;
342
345
  }
346
+ interface TicketsConfig {
347
+ /** Enable/disable tickets page and notifications */
348
+ enabled: boolean;
349
+ }
350
+ interface WorkspacePosition {
351
+ /** Workspace ID/name (e.g., 'WS01', 'WS11') */
352
+ id: string;
353
+ /** X coordinate as percentage (0-100) from left */
354
+ x: number;
355
+ /** Y coordinate as percentage (0-100) from top */
356
+ y: number;
357
+ /** Optional section identifier for grouping */
358
+ section?: string;
359
+ /** Optional size variant for rendering */
360
+ size?: 'default' | 'conveyor' | 'large';
361
+ }
362
+ interface MapViewConfig {
363
+ /** Enable/disable 2D map view toggle */
364
+ enabled: boolean;
365
+ /** Custom workspace positions for the factory floor */
366
+ workspacePositions?: WorkspacePosition[];
367
+ /** Grid container aspect ratio (width:height, default: 16:9) */
368
+ aspectRatio?: number;
369
+ }
343
370
 
344
371
  interface BasePerformanceMetric {
345
372
  id: string;
@@ -401,6 +428,13 @@ interface AuthUser {
401
428
  role_level?: 'owner' | 'plant_head' | 'supervisor' | 'optifye';
402
429
  company_id?: string;
403
430
  first_login_completed?: boolean;
431
+ properties?: {
432
+ company_id?: string;
433
+ access_level?: 'company' | 'factory' | 'line';
434
+ factory_ids?: string[];
435
+ line_ids?: string[];
436
+ [key: string]: any;
437
+ } | null;
404
438
  }
405
439
 
406
440
  /**
@@ -1829,6 +1863,17 @@ declare function useFeatureFlags(): Record<string, boolean>;
1829
1863
  declare function useCustomConfig(): Record<string, unknown>;
1830
1864
  declare function useVideoConfig(): VideoConfig;
1831
1865
 
1866
+ /**
1867
+ * Simplified Auth Context using backend session endpoint
1868
+ *
1869
+ * Key improvements:
1870
+ * - Single API call to backend instead of multiple Supabase queries
1871
+ * - No race conditions
1872
+ * - No timeout promises
1873
+ * - Simpler event handling
1874
+ * - Better error recovery
1875
+ */
1876
+
1832
1877
  interface AuthContextType {
1833
1878
  session: Session | null;
1834
1879
  user: AuthUser | null;
@@ -2209,32 +2254,70 @@ declare const useLineWorkspaceMetrics: (lineId: string, options?: UseLineWorkspa
2209
2254
  refreshWorkspaces: () => Promise<void>;
2210
2255
  };
2211
2256
 
2257
+ /**
2258
+ * Historical metrics data for a workspace
2259
+ * Matches WorkspaceDetailedMetrics structure for compatibility
2260
+ */
2261
+ interface HistoricWorkspaceMetrics {
2262
+ workspace_id: string;
2263
+ workspace_name: string;
2264
+ line_id: string;
2265
+ line_name: string;
2266
+ company_id: string;
2267
+ company_name: string;
2268
+ date: string;
2269
+ shift_id: number;
2270
+ shift_type: string;
2271
+ total_output: number;
2272
+ target_output: number;
2273
+ total_actions: number;
2274
+ avg_pph: number;
2275
+ pph_threshold: number;
2276
+ efficiency: number;
2277
+ avg_efficiency: number;
2278
+ avg_cycle_time: number;
2279
+ ideal_cycle_time: number;
2280
+ idle_time?: number;
2281
+ output_hourly?: number[];
2282
+ idle_time_hourly?: Record<string, string[]>;
2283
+ hourly_action_counts: number[];
2284
+ shift_start: string;
2285
+ shift_end: string;
2286
+ action_name: string;
2287
+ workspace_rank: number;
2288
+ total_workspaces: number;
2289
+ ideal_output_until_now: number;
2290
+ output_difference: number;
2291
+ performance_score?: number;
2292
+ compliance_efficiency?: number;
2293
+ sop_check?: Record<string, number>;
2294
+ }
2212
2295
  /**
2213
2296
  * @hook useHistoricWorkspaceMetrics
2214
- * @summary Fetches historic detailed metrics for a specific workspace, date, and shift.
2297
+ * @summary Fetches historical performance metrics for a specific workspace, date, and shift
2215
2298
  *
2216
- * @description This hook retrieves detailed performance data for a given workspace from a
2217
- * specific past date and shift. It's designed for looking up historical records rather than
2218
- * real-time data. The `hourly_action_counts` are animated on the initial successful fetch.
2219
- * This hook relies on the `DashboardService` for data retrieval.
2299
+ * @description This hook retrieves metrics for a single date/shift combination,
2300
+ * typically used for viewing historical performance data.
2220
2301
  *
2221
- * @param {string} workspaceId - The unique identifier of the workspace.
2222
- * @param {string} date - The specific date (YYYY-MM-DD) for which to fetch metrics. This is required.
2223
- * @param {number} inputShiftId - The specific shift ID for which to fetch metrics. This is required.
2302
+ * @param {string} workspaceId - The workspace UUID
2303
+ * @param {string} date - Date (YYYY-MM-DD)
2304
+ * @param {number} [shiftId] - Optional shift ID (0=all, 1=day, 2=night)
2224
2305
  *
2225
- * @returns {object} An object containing:
2226
- * @returns {WorkspaceDetailedMetrics | null} metrics - The historic detailed metrics for the workspace, or null if not loaded/found or if parameters are missing.
2227
- * @returns {boolean} isLoading - True if metrics are currently being fetched, false otherwise.
2228
- * @returns {MetricsError | null} error - An error object if fetching failed, null otherwise.
2229
- * @returns {() => Promise<void>} refetch - A function to manually trigger a refetch of the historic metrics (note: animation currently does not re-run on manual refetch).
2306
+ * @returns {object} Object containing:
2307
+ * - metrics: Historical workspace metrics
2308
+ * - isLoading: Loading state
2309
+ * - error: Error state
2310
+ * - refetch: Function to manually refetch data
2230
2311
  *
2231
2312
  * @example
2232
- * const { metrics, isLoading, error } = useHistoricWorkspaceMetrics('ws-001', '2023-10-15', 1);
2233
- * if (isLoading) return <p>Loading historic data...</p>;
2234
- * if (error) return <p>Error: {error.message}</p>;
2313
+ * const { metrics, isLoading, error } = useHistoricWorkspaceMetrics(
2314
+ * 'workspace-123',
2315
+ * '2025-10-16',
2316
+ * 0
2317
+ * );
2235
2318
  */
2236
- declare const useHistoricWorkspaceMetrics: (workspaceId: string, date?: string, inputShiftId?: number) => {
2237
- metrics: WorkspaceDetailedMetrics | null;
2319
+ declare const useHistoricWorkspaceMetrics: (workspaceId: string, date: string, shiftId?: number) => {
2320
+ metrics: HistoricWorkspaceMetrics | null;
2238
2321
  isLoading: boolean;
2239
2322
  error: MetricsError | null;
2240
2323
  refetch: () => Promise<void>;
@@ -2280,53 +2363,44 @@ declare const useLineDetailedMetrics: (lineIdFromProp: string) => {
2280
2363
  };
2281
2364
 
2282
2365
  /**
2283
- * Represents a single entry in the workspace performance leaderboard
2366
+ * Leaderboard entry representing a workspace's performance ranking
2284
2367
  */
2285
2368
  interface LeaderboardEntry {
2369
+ workspace_id: string;
2286
2370
  workspace_name: string;
2287
- total_output: number;
2288
- avg_pph: number;
2371
+ line_id: string;
2289
2372
  efficiency: number;
2290
- workspace_id: string;
2373
+ total_output: number;
2374
+ target_output: number;
2375
+ performance_score: number;
2291
2376
  rank: number;
2292
- [key: string]: any;
2293
2377
  }
2294
2378
  /**
2295
2379
  * @hook useLeaderboardMetrics
2296
- * @summary Fetches and subscribes to top-performing workspaces for a specific production line.
2380
+ * @summary Fetches leaderboard metrics showing top/bottom performing workspaces
2297
2381
  *
2298
- * @description This hook retrieves a ranked list of workspaces based on efficiency for a given
2299
- * production line. It establishes real-time subscriptions to update the leaderboard when changes
2300
- * occur in the database. The data is automatically refreshed at regular intervals (1 minute).
2382
+ * @description This hook retrieves workspace rankings based on performance metrics
2383
+ * for a specific date and shift. The backend API already exists at `/api/dashboard/leaderboard`.
2301
2384
  *
2302
- * @param {string} lineId - The unique identifier of the production line to fetch metrics for.
2303
- * @param {number} [topCount=10] - The number of top performers to retrieve.
2385
+ * @param {string} [date] - Optional date (YYYY-MM-DD), defaults to current operational date
2386
+ * @param {number} [shiftId] - Optional shift ID, defaults to current shift
2387
+ * @param {number} [limit] - Optional limit for results, defaults to 10
2388
+ * @param {'top' | 'bottom' | 'all'} [filter] - Filter type, defaults to 'all'
2304
2389
  *
2305
- * @returns {object} An object containing:
2306
- * @returns {LeaderboardEntry[]} topPerformers - Array of ranked workspace entries, sorted by efficiency.
2307
- * @returns {boolean} isLoading - True if metrics are currently being fetched, false otherwise.
2308
- * @returns {MetricsError | null} error - An error object if fetching failed, null otherwise.
2309
- * @returns {() => Promise<void>} refetch - A function to manually trigger a refetch of the leaderboard.
2390
+ * @returns {object} Object containing:
2391
+ * - leaderboard: Array of leaderboard entries
2392
+ * - isLoading: Loading state
2393
+ * - error: Error state
2394
+ * - refetch: Function to manually refetch data
2310
2395
  *
2311
2396
  * @example
2312
- * const { topPerformers, isLoading, error } = useLeaderboardMetrics('line-123', 5);
2313
- * if (isLoading) return <p>Loading leaderboard...</p>;
2314
- * if (error) return <p>Error: {error.message}</p>;
2315
- * return (
2316
- * <div>
2317
- * <h2>Top Performers</h2>
2318
- * <ul>
2319
- * {topPerformers.map(entry => (
2320
- * <li key={entry.workspace_id}>
2321
- * {entry.rank}. {entry.workspace_name} - Efficiency: {entry.efficiency}%
2322
- * </li>
2323
- * ))}
2324
- * </ul>
2325
- * </div>
2326
- * );
2397
+ * const { leaderboard, isLoading, error } = useLeaderboardMetrics();
2398
+ * if (isLoading) return <div>Loading...</div>;
2399
+ * if (error) return <div>Error: {error.message}</div>;
2400
+ * return <LeaderboardTable data={leaderboard} />;
2327
2401
  */
2328
- declare const useLeaderboardMetrics: (lineId: string, topCount?: number) => {
2329
- topPerformers: LeaderboardEntry[];
2402
+ declare const useLeaderboardMetrics: (date?: string, shiftId?: number, limit?: number, filter?: "top" | "bottom" | "all") => {
2403
+ leaderboard: LeaderboardEntry[];
2330
2404
  isLoading: boolean;
2331
2405
  error: MetricsError | null;
2332
2406
  refetch: () => Promise<void>;
@@ -2766,69 +2840,50 @@ interface UseMessagesResult {
2766
2840
  declare function useMessages(threadId: string | undefined): UseMessagesResult;
2767
2841
 
2768
2842
  /**
2769
- * @interface FactoryOverviewData
2770
- * @description Represents aggregated overview metrics for the entire factory.
2771
- * This is a placeholder and should align with the actual data available or calculated.
2772
- * @property {string} [company_id] - Identifier of the company.
2773
- * @property {string} [factoryId] - Identifier of the factory.
2774
- * @property {string} date - The operational date for which these metrics apply (YYYY-MM-DD).
2775
- * @property {string | number} shiftId - The shift identifier for which these metrics apply.
2776
- * @property {number} totalOutput - Total output from all lines/workspaces in the factory.
2777
- * @property {number} overallEfficiency - Average efficiency across the factory.
2778
- * @property {number} totalWorkspacesActive - Number of workspaces that were active or reporting data.
2779
- * @property {number} totalLinesActive - Number of production lines that were active.
2780
- * @property {number} [alertsCritical] - Number of critical alerts in the factory.
2781
- * @property {string} [lastUpdated] - Timestamp of when this overview was last generated/updated.
2782
- */
2783
- interface FactoryOverviewData {
2784
- company_id?: string;
2785
- factoryId?: string;
2786
- date: string;
2787
- shiftId: string | number;
2788
- totalOutput: number;
2789
- overallEfficiency: number;
2790
- totalWorkspacesActive: number;
2791
- totalLinesActive: number;
2792
- alertsCritical?: number;
2793
- lastUpdated?: string;
2794
- }
2795
- /**
2796
- * @typedef UseFactoryOverviewOptions
2797
- * @description Options for fetching factory overview metrics.
2798
- * @property {string} [date] - Specific date (YYYY-MM-DD) to fetch overview for. Defaults to current operational date.
2799
- * @property {string | number} [shiftId] - Specific shift ID. Defaults to current operational shift.
2800
- * @property {string} [factoryId] - Specific factory ID, if the system supports multiple factories under one company config and this data is available per factory.
2843
+ * Factory overview metrics aggregated across all lines
2801
2844
  */
2802
- interface UseFactoryOverviewOptions {
2803
- date?: string;
2804
- shiftId?: string | number;
2805
- factoryId?: string;
2845
+ interface FactoryOverviewMetrics {
2846
+ total_lines: number;
2847
+ total_workspaces: number;
2848
+ total_output: number;
2849
+ target_output: number;
2850
+ average_efficiency: number;
2851
+ underperforming_workspaces: number;
2852
+ avg_pph: number;
2853
+ avg_cycle_time: number;
2854
+ lines: Array<{
2855
+ line_id: string;
2856
+ line_name: string;
2857
+ efficiency: number;
2858
+ output: number;
2859
+ target: number;
2860
+ status: 'good' | 'warning' | 'critical';
2861
+ }>;
2806
2862
  }
2807
2863
  /**
2808
2864
  * @hook useFactoryOverviewMetrics
2809
- * @summary Fetches aggregated overview metrics for the factory.
2810
- * @description This hook retrieves factory-level summary data (e.g., total output, overall efficiency)
2811
- * for a given date and shift (defaulting to current operational date/shift).
2812
- * It fetches from a table, which defaults to "factory_daily_summary".
2813
- * To make the table name configurable, `databaseConfig.tables.factoryOverviewMetrics` would need to be defined in `DashboardConfig`.
2814
- * Filters are applied for `companyId` (from `entityConfig`) and optionally `factoryId` if provided and supported.
2815
- * This initial version does not implement real-time subscriptions and assumes a pre-aggregated data source (one row per company/factory/date/shift).
2816
- * For more complex calculations from raw data, a dedicated DashboardService method would be more appropriate.
2865
+ * @summary Fetches aggregated factory-wide metrics across all configured lines
2817
2866
  *
2818
- * @param {UseFactoryOverviewOptions} [options] - Optional parameters to specify date, shift, or factoryId.
2867
+ * @description This hook retrieves factory-level overview showing performance
2868
+ * across all production lines. The backend API already exists at `/api/dashboard/factory-overview`.
2819
2869
  *
2820
- * @returns {{ factoryOverview: FactoryOverviewData | null; isLoading: boolean; error: MetricsError | null; refetch: () => Promise<void> }}
2821
- * An object containing the factory overview data, loading state, error state, and a refetch function.
2870
+ * @param {string} [date] - Optional date (YYYY-MM-DD), defaults to current operational date
2871
+ * @param {number} [shiftId] - Optional shift ID, defaults to current shift
2872
+ *
2873
+ * @returns {object} Object containing:
2874
+ * - metrics: Factory overview metrics
2875
+ * - isLoading: Loading state
2876
+ * - error: Error state
2877
+ * - refetch: Function to manually refetch data
2822
2878
  *
2823
2879
  * @example
2824
- * const { factoryOverview, isLoading } = useFactoryOverviewMetrics();
2825
- * if (isLoading) return <p>Loading factory overview...</p>;
2826
- * if (factoryOverview) {
2827
- * // Render overview
2828
- * }
2880
+ * const { metrics, isLoading, error } = useFactoryOverviewMetrics();
2881
+ * if (isLoading) return <div>Loading...</div>;
2882
+ * if (error) return <div>Error: {error.message}</div>;
2883
+ * return <FactoryOverview data={metrics} />;
2829
2884
  */
2830
- declare const useFactoryOverviewMetrics: (options?: UseFactoryOverviewOptions) => {
2831
- factoryOverview: FactoryOverviewData | null;
2885
+ declare const useFactoryOverviewMetrics: (date?: string, shiftId?: number) => {
2886
+ metrics: FactoryOverviewMetrics | null;
2832
2887
  isLoading: boolean;
2833
2888
  error: MetricsError | null;
2834
2889
  refetch: () => Promise<void>;
@@ -2994,7 +3049,8 @@ declare const useSKUs: (companyId: string) => UseSKUsReturn;
2994
3049
 
2995
3050
  /**
2996
3051
  * Hook to check if the current user can save targets
2997
- * TEMPORARILY DISABLED: All users can save targets
3052
+ * Only owner, plant_head, and optifye roles can save targets
3053
+ * Supervisors have read-only access
2998
3054
  */
2999
3055
  declare const useCanSaveTargets: () => boolean;
3000
3056
 
@@ -3019,7 +3075,18 @@ interface CreateTicketData {
3019
3075
  user_email: string;
3020
3076
  company_id: string;
3021
3077
  }
3078
+ /**
3079
+ * Service for managing support ticket history (now using backend APIs)
3080
+ */
3022
3081
  declare class TicketHistoryService {
3082
+ /**
3083
+ * Helper: Get JWT token for backend API calls
3084
+ */
3085
+ private static getAuthToken;
3086
+ /**
3087
+ * Helper: Get backend URL
3088
+ */
3089
+ private static getBackendUrl;
3023
3090
  /**
3024
3091
  * Create a new support ticket in history
3025
3092
  */
@@ -3261,6 +3328,49 @@ declare function useClipTypesWithCounts(workspaceId: string, date: string, shift
3261
3328
  counts: Record<string, number>;
3262
3329
  };
3263
3330
 
3331
+ interface UseLineShiftConfigResult {
3332
+ /** The shift configuration for the line, or null if not loaded */
3333
+ shiftConfig: ShiftConfig | null;
3334
+ /** Whether the hook is loading data */
3335
+ isLoading: boolean;
3336
+ /** Error message if any */
3337
+ error: string | null;
3338
+ }
3339
+ /**
3340
+ * Custom hook to fetch shift configuration from line_operating_hours table
3341
+ * Supports real-time updates via Supabase subscriptions
3342
+ *
3343
+ * @param lineId - The line UUID to fetch shift config for
3344
+ * @param fallbackConfig - Optional fallback config to use if DB query fails
3345
+ * @returns Shift configuration with loading and error states
3346
+ */
3347
+ declare const useLineShiftConfig: (lineId?: string, fallbackConfig?: ShiftConfig) => UseLineShiftConfigResult;
3348
+
3349
+ interface UseDynamicShiftConfigResult {
3350
+ /** The final shift configuration (DB data with static fallback) */
3351
+ shiftConfig: ShiftConfig;
3352
+ /** Whether the shift config is being loaded from database */
3353
+ isLoading: boolean;
3354
+ /** Error message if any */
3355
+ error: string | null;
3356
+ /** Whether the config came from database (true) or fallback (false) */
3357
+ isFromDatabase: boolean;
3358
+ }
3359
+ /**
3360
+ * Hook that provides shift configuration with intelligent fallback
3361
+ *
3362
+ * Priority order:
3363
+ * 1. Database (line_operating_hours) - if available for the line
3364
+ * 2. Static config from DashboardConfig - as fallback
3365
+ *
3366
+ * This hook automatically switches between database and fallback based on
3367
+ * data availability and provides real-time updates when shift config changes.
3368
+ *
3369
+ * @param lineId - The line UUID to fetch shift config for (optional)
3370
+ * @returns Shift configuration with loading state and source indicator
3371
+ */
3372
+ declare const useDynamicShiftConfig: (lineId?: string) => UseDynamicShiftConfigResult;
3373
+
3264
3374
  /**
3265
3375
  * Interface for navigation method used across packages
3266
3376
  * Abstracts navigation implementation details from components
@@ -3295,6 +3405,20 @@ interface LineNavigationParams {
3295
3405
  shift?: string | number;
3296
3406
  tab?: string;
3297
3407
  }
3408
+ /**
3409
+ * @interface BottleneckClipsNavigationParams
3410
+ * @description Defines the parameters for navigating to the bottleneck clips view.
3411
+ * @property {string} workspaceId - The unique identifier of the workspace.
3412
+ * @property {string} [workspaceName] - Optional display name for the workspace.
3413
+ * @property {string} [date] - Optional ISO date string (YYYY-MM-DD) to specify the context date.
3414
+ * @property {string | number} [shift] - Optional shift ID or identifier for the context.
3415
+ */
3416
+ interface BottleneckClipsNavigationParams {
3417
+ workspaceId: string;
3418
+ workspaceName?: string;
3419
+ date?: string;
3420
+ shift?: string | number;
3421
+ }
3298
3422
  /**
3299
3423
  * @typedef EntityConfigShape
3300
3424
  * @description Shape of the entityConfig object expected from useDashboardConfig.
@@ -3360,6 +3484,7 @@ declare function useNavigation(customNavigate?: NavigationMethod): {
3360
3484
  goToLeaderboard: () => void;
3361
3485
  goToFactoryView: () => void;
3362
3486
  goToProfile: () => void;
3487
+ goToBottleneckClips: ({ workspaceId, workspaceName, date, shift }: BottleneckClipsNavigationParams) => void;
3363
3488
  navigate: NavigationMethod;
3364
3489
  };
3365
3490
 
@@ -3404,30 +3529,44 @@ declare function useWorkspaceNavigation(): {
3404
3529
  }) => WorkspaceNavigationParams;
3405
3530
  };
3406
3531
 
3407
- interface UseWorkspaceHealthOptions extends HealthFilterOptions {
3408
- enableRealtime?: boolean;
3409
- refreshInterval?: number;
3410
- }
3411
- interface UseWorkspaceHealthReturn {
3412
- workspaces: WorkspaceHealthWithStatus[];
3413
- summary: HealthSummary | null;
3414
- loading: boolean;
3415
- error: Error | null;
3416
- refetch: () => Promise<void>;
3417
- }
3418
- declare function useWorkspaceHealth(options?: UseWorkspaceHealthOptions): UseWorkspaceHealthReturn;
3532
+ /**
3533
+ * Options for workspace health monitoring
3534
+ */
3419
3535
  interface UseWorkspaceHealthByIdOptions {
3420
3536
  enableRealtime?: boolean;
3421
3537
  refreshInterval?: number;
3422
3538
  }
3423
- interface UseWorkspaceHealthByIdReturn {
3539
+ /**
3540
+ * @hook useWorkspaceHealthById
3541
+ * @summary Monitors workspace heartbeat and health status in real-time
3542
+ *
3543
+ * @description This hook retrieves workspace health data from the workspace_health table
3544
+ * which tracks heartbeats and connectivity status. It supports real-time subscriptions
3545
+ * for live monitoring.
3546
+ *
3547
+ * @param {string} workspaceId - The workspace UUID to monitor
3548
+ * @param {UseWorkspaceHealthByIdOptions} [options] - Optional configuration
3549
+ * @param {boolean} [options.enableRealtime=false] - Enable real-time subscriptions
3550
+ * @param {number} [options.refreshInterval] - Auto-refresh interval in milliseconds
3551
+ *
3552
+ * @returns {object} Object containing:
3553
+ * - workspace: WorkspaceHealth data or null
3554
+ * - loading: Loading state
3555
+ * - error: Error state
3556
+ * - refetch: Function to manually refetch data
3557
+ *
3558
+ * @example
3559
+ * const { workspace, loading, error } = useWorkspaceHealthById('workspace-123', {
3560
+ * enableRealtime: true,
3561
+ * refreshInterval: 30000
3562
+ * });
3563
+ */
3564
+ declare const useWorkspaceHealthById: (workspaceId: string, options?: UseWorkspaceHealthByIdOptions) => {
3424
3565
  workspace: WorkspaceHealthWithStatus | null;
3425
- metrics: HealthMetrics | null;
3426
3566
  loading: boolean;
3427
- error: Error | null;
3567
+ error: MetricsError | null;
3428
3568
  refetch: () => Promise<void>;
3429
- }
3430
- declare function useWorkspaceHealthById(workspaceId: string, options?: UseWorkspaceHealthByIdOptions): UseWorkspaceHealthByIdReturn;
3569
+ };
3431
3570
 
3432
3571
  /**
3433
3572
  * @typedef {object} DateTimeConfigShape
@@ -3504,6 +3643,210 @@ interface AccessControlReturn {
3504
3643
  */
3505
3644
  declare function useAccessControl(): AccessControlReturn;
3506
3645
 
3646
+ /**
3647
+ * Company user with role and assignment details
3648
+ */
3649
+ interface CompanyUserWithDetails {
3650
+ user_id: string;
3651
+ email: string;
3652
+ role_level: 'owner' | 'plant_head' | 'supervisor' | 'optifye';
3653
+ first_login_completed: boolean;
3654
+ created_at: string;
3655
+ properties: {
3656
+ company_id?: string;
3657
+ access_level?: 'company' | 'factory' | 'line';
3658
+ factory_ids?: string[];
3659
+ line_ids?: string[];
3660
+ invited_by?: string;
3661
+ assigned_via?: string;
3662
+ [key: string]: any;
3663
+ } | null;
3664
+ assigned_lines?: string[];
3665
+ assigned_factories?: string[];
3666
+ }
3667
+ /**
3668
+ * Input for updating user role
3669
+ */
3670
+ interface UpdateUserRoleInput {
3671
+ user_id: string;
3672
+ new_role: 'owner' | 'plant_head' | 'supervisor' | 'optifye';
3673
+ updated_by: string;
3674
+ }
3675
+ /**
3676
+ * Input for assigning user to lines
3677
+ */
3678
+ interface AssignUserToLinesInput {
3679
+ user_id: string;
3680
+ line_ids: string[];
3681
+ assigned_by: string;
3682
+ }
3683
+ /**
3684
+ * Input for assigning user to factories
3685
+ */
3686
+ interface AssignUserToFactoriesInput {
3687
+ user_id: string;
3688
+ factory_ids: string[];
3689
+ assigned_by: string;
3690
+ }
3691
+ /**
3692
+ * Service for managing users in the system (now using backend APIs)
3693
+ */
3694
+ declare class UserManagementService {
3695
+ private supabase;
3696
+ constructor(supabase: SupabaseClient$1);
3697
+ /**
3698
+ * Helper: Get JWT token for backend API calls
3699
+ */
3700
+ private getAuthToken;
3701
+ /**
3702
+ * Helper: Get backend URL
3703
+ */
3704
+ private getBackendUrl;
3705
+ /**
3706
+ * Get all users for a company
3707
+ * @param companyId - Company ID
3708
+ * @param roleFilter - Optional filter by role
3709
+ * @returns Promise<CompanyUserWithDetails[]>
3710
+ */
3711
+ getCompanyUsers(companyId: string, roleFilter?: 'owner' | 'plant_head' | 'supervisor'): Promise<CompanyUserWithDetails[]>;
3712
+ /**
3713
+ * Get ALL users across all companies (optifye role only)
3714
+ * This method bypasses company filtering and returns all users in the system
3715
+ * @param roleFilter - Optional filter by role
3716
+ * @returns Promise<CompanyUserWithDetails[]>
3717
+ */
3718
+ getAllUsers(roleFilter?: 'owner' | 'plant_head' | 'supervisor' | 'optifye'): Promise<CompanyUserWithDetails[]>;
3719
+ /**
3720
+ * Get users for a specific factory (plant head view)
3721
+ * Returns only supervisors assigned to lines in this factory
3722
+ * @param factoryId - Factory ID
3723
+ * @returns Promise<CompanyUserWithDetails[]>
3724
+ */
3725
+ getFactoryUsers(factoryId: string): Promise<CompanyUserWithDetails[]>;
3726
+ /**
3727
+ * Update a user's role
3728
+ * @param input - Update role input
3729
+ */
3730
+ updateUserRole(input: UpdateUserRoleInput): Promise<void>;
3731
+ /**
3732
+ * Assign a user to lines
3733
+ * @param input - Assign to lines input
3734
+ */
3735
+ assignUserToLines(input: AssignUserToLinesInput): Promise<void>;
3736
+ /**
3737
+ * Assign a user to factories
3738
+ * @param input - Assign to factories input
3739
+ */
3740
+ assignUserToFactories(input: AssignUserToFactoriesInput): Promise<void>;
3741
+ /**
3742
+ * Get user statistics for a company
3743
+ * @param companyId - Company ID
3744
+ * @returns Promise with user counts by role
3745
+ */
3746
+ getUserStats(companyId: string): Promise<{
3747
+ total: number;
3748
+ owners: number;
3749
+ plant_heads: number;
3750
+ supervisors: number;
3751
+ }>;
3752
+ /**
3753
+ * Get user statistics across all companies (optifye role only)
3754
+ * @returns Promise with global user counts by role
3755
+ */
3756
+ getAllUserStats(): Promise<{
3757
+ total: number;
3758
+ owners: number;
3759
+ plant_heads: number;
3760
+ supervisors: number;
3761
+ optifye: number;
3762
+ }>;
3763
+ /**
3764
+ * Deactivate a user
3765
+ * @param input - Deactivation input
3766
+ */
3767
+ deactivateUser(input: {
3768
+ user_id: string;
3769
+ deactivated_by: string;
3770
+ }): Promise<void>;
3771
+ /**
3772
+ * Reactivate a user
3773
+ * @param input - Reactivation input
3774
+ */
3775
+ reactivateUser(input: {
3776
+ user_id: string;
3777
+ reactivated_by: string;
3778
+ }): Promise<void>;
3779
+ }
3780
+ /**
3781
+ * Factory function to create UserManagementService
3782
+ */
3783
+ declare const createUserManagementService: (supabase: SupabaseClient$1) => UserManagementService;
3784
+
3785
+ interface TeamManagementPermissions {
3786
+ canAssignLines: (targetUser: CompanyUserWithDetails) => boolean;
3787
+ canAssignFactories: (targetUser: CompanyUserWithDetails) => boolean;
3788
+ canChangeRole: (targetUser: CompanyUserWithDetails) => boolean;
3789
+ canRemoveUser: (targetUser: CompanyUserWithDetails) => boolean;
3790
+ availableRolesToAssign: () => Array<'owner' | 'plant_head' | 'supervisor' | 'optifye'>;
3791
+ canInviteRole: (role: string) => boolean;
3792
+ getAssignmentColumnName: (targetUser: CompanyUserWithDetails) => string;
3793
+ showAssignmentColumn: () => boolean;
3794
+ }
3795
+ /**
3796
+ * Hook for team management permissions
3797
+ * Centralizes all permission logic for managing users
3798
+ */
3799
+ declare function useTeamManagementPermissions(): TeamManagementPermissions;
3800
+
3801
+ /**
3802
+ * Hook to get the user's accessible lines based on their role
3803
+ *
3804
+ * For supervisors: Returns their assigned lines from properties.line_id
3805
+ * For plant heads: Returns lines from their assigned factories
3806
+ * For owners/optifye: Returns all provided lines
3807
+ *
3808
+ * This ensures supervisors can only access their assigned lines
3809
+ */
3810
+ declare function useUserLineAccess(configLineIds?: string[]): {
3811
+ accessibleLineIds: string[];
3812
+ defaultLineId: string | undefined;
3813
+ user: AuthUser | null;
3814
+ };
3815
+ /**
3816
+ * Hook to get the current active lineId
3817
+ * Considers:
3818
+ * 1. URL query parameter (lineId)
3819
+ * 2. User's default line (for supervisors)
3820
+ * 3. Config default
3821
+ */
3822
+ declare function useActiveLineId(queryLineId?: string | null, configLineIds?: string[]): string | undefined;
3823
+ /**
3824
+ * Hook to check if user has access to a specific line
3825
+ */
3826
+ declare function useHasLineAccess(lineId: string | undefined, configLineIds?: string[]): boolean;
3827
+
3828
+ interface LineSupervisor {
3829
+ userId: string;
3830
+ email: string;
3831
+ displayName: string;
3832
+ }
3833
+ interface UseLineSupervisorReturn {
3834
+ supervisorName: string | null;
3835
+ supervisor: LineSupervisor | null;
3836
+ isLoading: boolean;
3837
+ error: Error | null;
3838
+ }
3839
+ /**
3840
+ * Hook to fetch and subscribe to supervisor assignments for a given line
3841
+ *
3842
+ * Queries the user_roles table to find supervisors assigned to the specified line.
3843
+ * The assignment is stored in properties.line_id as a JSONB array.
3844
+ *
3845
+ * @param lineId - The UUID of the line to fetch supervisor for
3846
+ * @returns Supervisor information including name, loading state, and error
3847
+ */
3848
+ declare function useLineSupervisor(lineId: string | undefined): UseLineSupervisorReturn;
3849
+
3507
3850
  declare const actionService: {
3508
3851
  getActionsByName(actionNames: string[], companyIdInput?: string): Promise<Action[]>;
3509
3852
  };
@@ -3664,9 +4007,113 @@ declare const authCoreService: {
3664
4007
  fetchCoreUserProfile(supabase: SupabaseClient$1, user: User, profileTable: string, roleColumn?: string): Promise<Partial<AuthUser>>;
3665
4008
  };
3666
4009
 
4010
+ /**
4011
+ * Centralized Auth Service
4012
+ *
4013
+ * Handles all backend auth API calls for enriched user data
4014
+ * Single source of truth for user session state
4015
+ */
4016
+
4017
+ interface EnrichedUserProfile {
4018
+ full_name?: string;
4019
+ phone_number?: string;
4020
+ first_login_completed: boolean;
4021
+ is_active: boolean;
4022
+ created_at?: string;
4023
+ }
4024
+ interface CompanyInfo {
4025
+ id: string;
4026
+ name: string;
4027
+ created_at?: string;
4028
+ }
4029
+ interface LineAssignment {
4030
+ line_id: string;
4031
+ line_name: string;
4032
+ }
4033
+ interface FactoryAssignment {
4034
+ factory_id: string;
4035
+ factory_name: string;
4036
+ }
4037
+ interface UserPermissions {
4038
+ can_manage_users: boolean;
4039
+ can_view_all_lines: boolean;
4040
+ can_manage_targets: boolean;
4041
+ can_access_help_desk: boolean;
4042
+ can_manage_company: boolean;
4043
+ is_supervisor: boolean;
4044
+ is_plant_head: boolean;
4045
+ is_owner: boolean;
4046
+ is_optifye_admin: boolean;
4047
+ }
4048
+ interface EnrichedUser {
4049
+ user_id: string;
4050
+ email: string;
4051
+ authenticated: boolean;
4052
+ profile: EnrichedUserProfile;
4053
+ role: string;
4054
+ company_id?: string;
4055
+ company?: CompanyInfo;
4056
+ line_assignments?: LineAssignment[];
4057
+ factory_assignments?: FactoryAssignment[];
4058
+ permissions: UserPermissions;
4059
+ profile_incomplete?: boolean;
4060
+ message?: string;
4061
+ }
4062
+ interface PermissionsResponse {
4063
+ user_id: string;
4064
+ role: string;
4065
+ company_id?: string;
4066
+ permissions: UserPermissions;
4067
+ }
4068
+ declare class AuthService {
4069
+ private static backendUrl;
4070
+ /**
4071
+ * Fetch enriched user session from backend
4072
+ * This is your SINGLE call to get ALL auth data
4073
+ *
4074
+ * @param accessToken - JWT token from Supabase
4075
+ * @returns Complete user session with profile, permissions, and assignments
4076
+ */
4077
+ static getSession(accessToken: string): Promise<EnrichedUser>;
4078
+ /**
4079
+ * Quick validation check without full profile fetch
4080
+ * Use this for lightweight auth checks
4081
+ *
4082
+ * @param accessToken - JWT token from Supabase
4083
+ * @returns Boolean indicating if session is valid
4084
+ */
4085
+ static validateSession(accessToken: string): Promise<boolean>;
4086
+ /**
4087
+ * Get just permissions (lightweight call)
4088
+ * Faster than full session fetch
4089
+ *
4090
+ * @param accessToken - JWT token from Supabase
4091
+ * @returns User permissions and role
4092
+ */
4093
+ static getPermissions(accessToken: string): Promise<PermissionsResponse>;
4094
+ /**
4095
+ * Convert EnrichedUser (backend format) to AuthUser (frontend format)
4096
+ * Ensures backward compatibility with existing code
4097
+ */
4098
+ static toAuthUser(enrichedUser: EnrichedUser): AuthUser;
4099
+ }
4100
+
4101
+ /**
4102
+ * Authentication OTP Service
4103
+ *
4104
+ * SECURITY: This service implements invitation-only authentication
4105
+ * - shouldCreateUser: false prevents auto-account creation
4106
+ * - Requires Supabase "Disable Signup" setting to be enabled
4107
+ * - Only existing users can receive OTP codes
4108
+ */
3667
4109
  declare const authOTPService: {
3668
4110
  /**
3669
4111
  * Send OTP to user's email
4112
+ *
4113
+ * SECURITY NOTES:
4114
+ * - Only sends OTP to EXISTING users (shouldCreateUser: false)
4115
+ * - New users MUST use invitation signup flow
4116
+ * - Prevents unauthorized account creation
3670
4117
  */
3671
4118
  sendOTP(supabase: SupabaseClient$1, email: string): Promise<{
3672
4119
  error: AuthError | null;
@@ -3981,9 +4428,10 @@ declare class SupervisorService {
3981
4428
  getActiveSupervisors(companyId: string): Promise<Supervisor[]>;
3982
4429
  /**
3983
4430
  * Assign a supervisor to a line
3984
- * This is a mock implementation - in production, this would update the database
4431
+ * Updates the supervisor's user_roles.properties to include the line in their line_id array
4432
+ * Note: The database uses 'line_id' (singular) not 'line_ids' (plural)
3985
4433
  * @param lineId - The line ID
3986
- * @param supervisorId - The supervisor ID to assign
4434
+ * @param supervisorId - The supervisor ID to assign (undefined to remove assignment)
3987
4435
  * @returns Promise<boolean> - Success status
3988
4436
  */
3989
4437
  assignSupervisorToLine(lineId: string, supervisorId?: string): Promise<boolean>;
@@ -4019,24 +4467,25 @@ interface CompanyUser {
4019
4467
  updatedAt?: string;
4020
4468
  }
4021
4469
  /**
4022
- * Service for managing user data from the database
4470
+ * Service for managing user data (now using backend APIs)
4023
4471
  */
4024
4472
  declare class UserService {
4025
4473
  private supabase;
4026
4474
  constructor(supabase: SupabaseClient$1);
4027
4475
  /**
4028
- * Fetch all users mapped to a specific company
4029
- * @param companyId - The company ID to fetch users for
4030
- * @returns Promise<CompanyUser[]> - Array of users in the company
4476
+ * Helper: Get JWT token for backend API calls
4031
4477
  */
4032
- getUsersByCompanyId(companyId: string): Promise<CompanyUser[]>;
4478
+ private getAuthToken;
4033
4479
  /**
4034
- * Fallback method to fetch users by company ID using basic queries
4035
- * Gets real user emails from the database
4480
+ * Helper: Get backend URL
4481
+ */
4482
+ private getBackendUrl;
4483
+ /**
4484
+ * Fetch all users mapped to a specific company
4036
4485
  * @param companyId - The company ID to fetch users for
4037
4486
  * @returns Promise<CompanyUser[]> - Array of users in the company
4038
4487
  */
4039
- private getUsersByCompanyIdFallback;
4488
+ getUsersByCompanyId(companyId: string): Promise<CompanyUser[]>;
4040
4489
  /**
4041
4490
  * Check if a user is mapped to a specific company
4042
4491
  * @param userId - The user ID to check
@@ -4097,6 +4546,112 @@ declare class TimezoneService {
4097
4546
  clearCacheEntry(key: string): void;
4098
4547
  }
4099
4548
 
4549
+ /**
4550
+ * User invitation data structure
4551
+ */
4552
+ interface UserInvitation {
4553
+ id: string;
4554
+ email: string;
4555
+ company_id: string;
4556
+ role_level: 'owner' | 'plant_head' | 'supervisor';
4557
+ invited_by: string;
4558
+ invitation_token: string;
4559
+ expires_at: string;
4560
+ accepted_at: string | null;
4561
+ created_at: string;
4562
+ updated_at: string;
4563
+ invitation_message: string | null;
4564
+ line_ids?: string[];
4565
+ factory_ids?: string[];
4566
+ }
4567
+ /**
4568
+ * Invitation with additional details for display
4569
+ */
4570
+ interface InvitationWithDetails extends UserInvitation {
4571
+ company_name: string;
4572
+ invited_by_email: string;
4573
+ seconds_until_expiry: number;
4574
+ is_expired: boolean;
4575
+ }
4576
+ /**
4577
+ * Input for creating a new invitation
4578
+ */
4579
+ interface CreateInvitationInput {
4580
+ email: string;
4581
+ company_id: string;
4582
+ role_level: 'plant_head' | 'supervisor';
4583
+ invited_by: string;
4584
+ invitation_message?: string;
4585
+ line_ids?: string[];
4586
+ factory_ids?: string[];
4587
+ }
4588
+ /**
4589
+ * Service for managing user invitations
4590
+ */
4591
+ declare class InvitationService {
4592
+ private supabase;
4593
+ constructor(supabase: SupabaseClient$1);
4594
+ /**
4595
+ * Create a new user invitation
4596
+ * @param input - Invitation details
4597
+ * @returns Promise<UserInvitation>
4598
+ */
4599
+ createInvitation(input: CreateInvitationInput): Promise<UserInvitation>;
4600
+ /**
4601
+ * Get all invitations for a company
4602
+ * @param companyId - Company ID
4603
+ * @param includeAccepted - Whether to include accepted invitations
4604
+ * @returns Promise<InvitationWithDetails[]>
4605
+ */
4606
+ getCompanyInvitations(companyId: string, includeAccepted?: boolean): Promise<InvitationWithDetails[]>;
4607
+ /**
4608
+ * Get pending invitations for current user (invitations they sent)
4609
+ * @param userId - User ID of the inviter
4610
+ * @returns Promise<InvitationWithDetails[]>
4611
+ */
4612
+ getMyInvitations(userId: string): Promise<InvitationWithDetails[]>;
4613
+ /**
4614
+ * Resend an invitation email
4615
+ * Calls the send-invitation-email Edge Function
4616
+ * @param invitationId - Invitation ID to resend
4617
+ */
4618
+ resendInvitation(invitationId: string): Promise<void>;
4619
+ /**
4620
+ * Cancel a pending invitation
4621
+ * @param invitationId - Invitation ID to cancel
4622
+ */
4623
+ cancelInvitation(invitationId: string): Promise<void>;
4624
+ /**
4625
+ * Validate an invitation token (for signup page)
4626
+ * @param token - Invitation token
4627
+ * @returns Promise<UserInvitation | null>
4628
+ */
4629
+ validateInvitationToken(token: string): Promise<InvitationWithDetails | null>;
4630
+ /**
4631
+ * Get invitation statistics for a company
4632
+ * @param companyId - Company ID
4633
+ * @returns Promise with counts
4634
+ */
4635
+ getInvitationStats(companyId: string): Promise<{
4636
+ pending: number;
4637
+ expired: number;
4638
+ accepted: number;
4639
+ }>;
4640
+ /**
4641
+ * Accept an invitation (mark as accepted)
4642
+ * This is called after user successfully creates their account
4643
+ * @param invitationId - Invitation ID
4644
+ * @param userId - User ID who accepted the invitation
4645
+ */
4646
+ acceptInvitation(invitationId: string, userId: string): Promise<void>;
4647
+ }
4648
+ /**
4649
+ * Create an invitation service instance
4650
+ * @param supabase - Supabase client instance
4651
+ * @returns InvitationService instance
4652
+ */
4653
+ declare const createInvitationService: (supabase: SupabaseClient$1) => InvitationService;
4654
+
4100
4655
  /**
4101
4656
  * Helper object for making authenticated API requests using Supabase auth token.
4102
4657
  * Assumes endpoints are relative to the apiBaseUrl configured in DashboardConfig.
@@ -4521,6 +5076,23 @@ declare function migrateLegacyConfiguration(entityConfig: EntityConfig): EntityC
4521
5076
  */
4522
5077
  declare function isValidFactoryViewConfiguration(entityConfig: EntityConfig): boolean;
4523
5078
 
5079
+ /**
5080
+ * Browser detection utilities
5081
+ */
5082
+ /**
5083
+ * Detect if current browser is Safari
5084
+ * Checks for Safari-specific markers while excluding Chrome/Edge
5085
+ *
5086
+ * @returns true if browser is Safari (desktop or iOS), false otherwise
5087
+ */
5088
+ declare function isSafari(): boolean;
5089
+ /**
5090
+ * Get browser name for logging
5091
+ *
5092
+ * @returns Browser name string
5093
+ */
5094
+ declare function getBrowserName(): string;
5095
+
4524
5096
  /**
4525
5097
  * Format idle time from seconds to a human-readable format
4526
5098
  * @param idleTimeInSeconds - Idle time in seconds
@@ -4580,6 +5152,20 @@ declare const AuthCallback: React.FC<AuthCallbackProps>;
4580
5152
 
4581
5153
  declare const DebugAuth: React__default.FC;
4582
5154
 
5155
+ interface SignupWithInvitationProps {
5156
+ token: string;
5157
+ onSignupComplete?: () => void;
5158
+ onNavigateToLogin?: () => void;
5159
+ }
5160
+ declare const SignupWithInvitation: React__default.FC<SignupWithInvitationProps>;
5161
+
5162
+ interface AcceptInviteProps {
5163
+ token: string;
5164
+ onSuccess?: (email: string) => void;
5165
+ onError?: (error: string) => void;
5166
+ }
5167
+ declare const AcceptInvite: React__default.FC<AcceptInviteProps>;
5168
+
4583
5169
  interface BarChartDataItem {
4584
5170
  name: string;
4585
5171
  [key: string]: string | number | undefined;
@@ -4819,11 +5405,32 @@ interface AxelSuggestion {
4819
5405
  title: string;
4820
5406
  /** Detailed message from Axel */
4821
5407
  message: string;
4822
- /** Type of suggestion (improvement, alert, insight) */
4823
- type: 'improvement' | 'alert' | 'insight';
5408
+ /** Type of suggestion (improvement, alert, insight, bottleneck_triage) */
5409
+ type: 'improvement' | 'alert' | 'insight' | 'bottleneck_triage';
4824
5410
  /** Priority level */
4825
5411
  priority: 'high' | 'medium' | 'low';
5412
+ /** Optional action button configuration */
5413
+ action?: {
5414
+ label: string;
5415
+ onClick: () => void;
5416
+ };
5417
+ /** Optional workstation ID for bottleneck_triage notifications */
5418
+ workstationId?: string;
4826
5419
  }
5420
+ /**
5421
+ * Hook to fetch and manage Axel notifications
5422
+ * @param autoFetch - Whether to automatically fetch notifications on mount (default: true)
5423
+ * @param refreshInterval - Interval in milliseconds to refresh notifications (default: 5 minutes)
5424
+ */
5425
+ declare function useAxelNotifications(autoFetch?: boolean, refreshInterval?: number): {
5426
+ notifications: AxelSuggestion[];
5427
+ currentNotification: AxelSuggestion | null;
5428
+ isLoading: boolean;
5429
+ error: Error | null;
5430
+ fetchNotifications: () => Promise<void>;
5431
+ nextNotification: () => void;
5432
+ dismissCurrentNotification: () => void;
5433
+ };
4827
5434
  interface AxelNotificationPopupProps {
4828
5435
  /** Current suggestion to display */
4829
5436
  suggestion: AxelSuggestion | null;
@@ -4842,6 +5449,70 @@ interface AxelNotificationPopupProps {
4842
5449
  */
4843
5450
  declare const AxelNotificationPopup: React__default.FC<AxelNotificationPopupProps>;
4844
5451
 
5452
+ interface DiagnosisOption$1 {
5453
+ id: string;
5454
+ name: string;
5455
+ display_name: string;
5456
+ description?: string;
5457
+ }
5458
+ interface BottleneckClipsModalProps {
5459
+ /** Whether the modal is open */
5460
+ isOpen: boolean;
5461
+ /** Callback when modal is closed */
5462
+ onClose: () => void;
5463
+ /** Workspace ID to display clips for */
5464
+ workspaceId: string;
5465
+ /** Workspace name for display */
5466
+ workspaceName: string;
5467
+ /** Date for clips (YYYY-MM-DD format) */
5468
+ date: string;
5469
+ /** Shift ID */
5470
+ shift: number;
5471
+ /** Total output for the workspace */
5472
+ totalOutput?: number;
5473
+ /** Optional ticket ID to filter clips by specific ticket */
5474
+ ticketId?: string;
5475
+ /** Optional diagnosis options from backend */
5476
+ diagnosisOptions?: DiagnosisOption$1[];
5477
+ /** Optional callback when diagnosis is selected */
5478
+ onDiagnosisSelect?: (diagnosisId: string) => void;
5479
+ }
5480
+ /**
5481
+ * BottleneckClipsModal - Full-screen modal overlay showing bottleneck diagnosis clips
5482
+ * Displays on top of the home page with blurred backdrop
5483
+ */
5484
+ declare const BottleneckClipsModal: React__default.FC<BottleneckClipsModalProps>;
5485
+
5486
+ /**
5487
+ * DiagnosisVideoModal - Plays 15-minute bottleneck diagnosis clips
5488
+ *
5489
+ * This component fetches a clip from the clips table and plays it using
5490
+ * the existing video player infrastructure. The backend automatically
5491
+ * generates these clips when bottleneck tickets are created.
5492
+ *
5493
+ * Flow:
5494
+ * 1. Fetch clip from clips table using clip_id
5495
+ * 2. Extract M3U8 playlist from clip.playlist field
5496
+ * 3. Transform S3 URLs to CloudFront URLs
5497
+ * 4. Create blob URL for playlist
5498
+ * 5. Play using CroppedVideoPlayer (supports byte-range HLS)
5499
+ */
5500
+ interface DiagnosisOption {
5501
+ id: string;
5502
+ name: string;
5503
+ display_name: string;
5504
+ description?: string;
5505
+ }
5506
+ interface DiagnosisVideoModalProps {
5507
+ clipId: string | null;
5508
+ ticketNumber?: string;
5509
+ ticketId?: string;
5510
+ diagnosisOptions?: DiagnosisOption[];
5511
+ onDiagnosisSelect?: (diagnosisId: string) => void;
5512
+ onClose: () => void;
5513
+ }
5514
+ declare function DiagnosisVideoModal({ clipId, ticketNumber, ticketId, diagnosisOptions, onDiagnosisSelect, onClose }: DiagnosisVideoModalProps): react_jsx_runtime.JSX.Element;
5515
+
4845
5516
  interface BaseHistoryCalendarProps {
4846
5517
  dailyData: Record<string, DaySummaryData>;
4847
5518
  displayMonth: Date;
@@ -4906,6 +5577,7 @@ declare const EncouragementOverlay: React__default.FC<EncouragementOverlayProps>
4906
5577
  interface ShiftDisplayProps {
4907
5578
  className?: string;
4908
5579
  variant?: 'default' | 'enhanced';
5580
+ lineId?: string;
4909
5581
  }
4910
5582
  declare const ShiftDisplay: React__default.FC<ShiftDisplayProps>;
4911
5583
 
@@ -5370,6 +6042,20 @@ interface BottlenecksContentProps {
5370
6042
  * Total output from workspace metrics for cycle completion adjustment
5371
6043
  */
5372
6044
  totalOutput?: number;
6045
+ /**
6046
+ * Optional custom content to replace the video counter (1/34)
6047
+ */
6048
+ customCounterContent?: React.ReactNode;
6049
+ /**
6050
+ * Triage mode - shows clips in direct tile view for last 15 minutes (cycle completions + idle time)
6051
+ * Used for the bottleneck diagnosis popup
6052
+ */
6053
+ triageMode?: boolean;
6054
+ /**
6055
+ * Optional ticket ID to filter clips for a specific ticket
6056
+ * When provided, only shows clips associated with this ticket
6057
+ */
6058
+ ticketId?: string;
5373
6059
  }
5374
6060
  /**
5375
6061
  * Filter type for bottleneck clips - expanded for new video types
@@ -5401,7 +6087,28 @@ interface ClipCounts {
5401
6087
  */
5402
6088
  declare const BottlenecksContent: React__default.FC<BottlenecksContentProps>;
5403
6089
 
5404
- interface WorkspacePosition {
6090
+ declare const DEFAULT_WORKSPACE_POSITIONS: WorkspacePosition[];
6091
+ declare const WORKSPACE_POSITIONS: WorkspacePosition[];
6092
+
6093
+ interface WorkspaceGridProps {
6094
+ workspaces: WorkspaceMetrics[];
6095
+ isPdfMode?: boolean;
6096
+ customWorkspacePositions?: typeof DEFAULT_WORKSPACE_POSITIONS;
6097
+ lineNames?: Record<string, string>;
6098
+ factoryView?: string;
6099
+ line2Uuid?: string;
6100
+ className?: string;
6101
+ videoSources?: {
6102
+ defaultHlsUrl?: string;
6103
+ workspaceHlsUrls?: Record<string, string>;
6104
+ mp4VideoMapping?: Record<string, string>;
6105
+ };
6106
+ onWorkspaceHover?: (workspaceId: string) => void;
6107
+ onWorkspaceHoverEnd?: (workspaceId: string) => void;
6108
+ }
6109
+ declare const WorkspaceGrid: React__default.FC<WorkspaceGridProps>;
6110
+
6111
+ interface WorkspaceGridPosition {
5405
6112
  id: string;
5406
6113
  x: number;
5407
6114
  y: number;
@@ -5425,7 +6132,7 @@ interface WorkspaceGridItemProps {
5425
6132
  shift_id: number;
5426
6133
  date: string;
5427
6134
  };
5428
- position: WorkspacePosition;
6135
+ position: WorkspaceGridPosition;
5429
6136
  isBottleneck?: boolean;
5430
6137
  isLowEfficiency?: boolean;
5431
6138
  isVeryLowEfficiency?: boolean;
@@ -5434,33 +6141,12 @@ interface WorkspaceGridItemProps {
5434
6141
  declare const Legend: () => react_jsx_runtime.JSX.Element;
5435
6142
  declare const WorkspaceGridItem: React__default.FC<WorkspaceGridItemProps>;
5436
6143
 
5437
- declare const DEFAULT_WORKSPACE_POSITIONS: WorkspacePosition[];
5438
- declare const WORKSPACE_POSITIONS: WorkspacePosition[];
5439
-
5440
- interface WorkspaceGridProps {
5441
- workspaces: WorkspaceMetrics[];
5442
- isPdfMode?: boolean;
5443
- customWorkspacePositions?: typeof DEFAULT_WORKSPACE_POSITIONS;
5444
- lineNames?: Record<string, string>;
5445
- factoryView?: string;
5446
- line2Uuid?: string;
5447
- className?: string;
5448
- videoSources?: {
5449
- defaultHlsUrl?: string;
5450
- workspaceHlsUrls?: Record<string, string>;
5451
- mp4VideoMapping?: Record<string, string>;
5452
- };
5453
- onWorkspaceHover?: (workspaceId: string) => void;
5454
- onWorkspaceHoverEnd?: (workspaceId: string) => void;
5455
- }
5456
- declare const WorkspaceGrid: React__default.FC<WorkspaceGridProps>;
5457
-
5458
6144
  interface TargetWorkspaceGridProps {
5459
6145
  lineId: string;
5460
6146
  selectedWorkspaces: string[];
5461
6147
  onWorkspaceSelect: (workspaceId: string) => void;
5462
6148
  previouslyAssignedWorkspaces?: string[];
5463
- positions: WorkspacePosition[];
6149
+ positions: WorkspaceGridPosition[];
5464
6150
  lineNames?: Record<string, string>;
5465
6151
  className?: string;
5466
6152
  }
@@ -5482,6 +6168,18 @@ interface VideoGridViewProps {
5482
6168
  */
5483
6169
  declare const VideoGridView: React__default.FC<VideoGridViewProps>;
5484
6170
 
6171
+ interface MapGridViewProps {
6172
+ workspaces: WorkspaceMetrics[];
6173
+ className?: string;
6174
+ onWorkspaceHover?: (workspaceId: string) => void;
6175
+ onWorkspaceHoverEnd?: (workspaceId: string) => void;
6176
+ }
6177
+ /**
6178
+ * MapGridView component - 2D factory floor map view with workspace positions
6179
+ * Shows workspaces in their physical factory layout with performance metrics overlaid
6180
+ */
6181
+ declare const MapGridView: React__default.FC<MapGridViewProps>;
6182
+
5485
6183
  interface VideoCardProps {
5486
6184
  workspace: WorkspaceMetrics;
5487
6185
  hlsUrl: string;
@@ -5656,11 +6354,12 @@ interface DashboardHeaderProps {
5656
6354
  lineTitle: string;
5657
6355
  className?: string;
5658
6356
  headerControls?: React__default.ReactNode;
6357
+ lineId?: string;
5659
6358
  }
5660
6359
  /**
5661
6360
  * Header component for dashboard pages with title and timer
5662
6361
  */
5663
- declare const DashboardHeader: React__default.MemoExoticComponent<({ lineTitle, className, headerControls }: DashboardHeaderProps) => react_jsx_runtime.JSX.Element>;
6362
+ declare const DashboardHeader: React__default.MemoExoticComponent<({ lineTitle, className, headerControls, lineId }: DashboardHeaderProps) => react_jsx_runtime.JSX.Element>;
5664
6363
 
5665
6364
  interface NoWorkspaceDataProps {
5666
6365
  message?: string;
@@ -6257,6 +6956,13 @@ declare const InteractiveOnboardingTour: React__default.FC<InteractiveOnboarding
6257
6956
  */
6258
6957
  declare const OnboardingDemo: React__default.FC;
6259
6958
 
6959
+ type AcceptInviteViewProps = AcceptInviteProps;
6960
+ /**
6961
+ * Accept Invite View - wrapper for the AcceptInvite component
6962
+ * This handles the invitation acceptance flow when users click the invite link
6963
+ */
6964
+ declare const AcceptInviteView: React__default.FC<AcceptInviteViewProps>;
6965
+
6260
6966
  /**
6261
6967
  * AI Agent Chat View
6262
6968
  *
@@ -6423,6 +7129,7 @@ interface KPIsOverviewViewProps {
6423
7129
  className?: string;
6424
7130
  onBackClick?: () => void;
6425
7131
  backLinkUrl?: string;
7132
+ lineIds?: string[];
6426
7133
  }
6427
7134
  declare const KPIsOverviewView: React__default.FC<KPIsOverviewViewProps>;
6428
7135
 
@@ -6602,6 +7309,43 @@ interface SupervisorManagementViewProps {
6602
7309
  }
6603
7310
  declare const SupervisorManagementView: React__default.FC<SupervisorManagementViewProps>;
6604
7311
 
7312
+ interface TeamManagementViewProps {
7313
+ onNavigate?: (path: string) => void;
7314
+ onBack?: () => void;
7315
+ className?: string;
7316
+ }
7317
+ declare const TeamManagementView: React__default.FC<TeamManagementViewProps>;
7318
+
7319
+ interface BottleneckClipsViewProps {
7320
+ /** Workspace ID to display clips for */
7321
+ workspaceId?: string;
7322
+ /** Workspace name for display */
7323
+ workspaceName?: string;
7324
+ /** Date for clips (YYYY-MM-DD format) */
7325
+ date?: string;
7326
+ /** Shift ID */
7327
+ shift?: number;
7328
+ /** Total output for the workspace */
7329
+ totalOutput?: number;
7330
+ }
7331
+ /**
7332
+ * BottleneckClipsView - Shows clips from the last 15 minutes for bottleneck diagnosis
7333
+ * This is essentially the clips page with a 15-minute filter applied
7334
+ */
7335
+ declare function BottleneckClipsView({ workspaceId: propWorkspaceId, workspaceName: propWorkspaceName, date: propDate, shift: propShift, totalOutput: propTotalOutput, }: BottleneckClipsViewProps): React__default.ReactNode;
7336
+ declare const AuthenticatedBottleneckClipsView: React__default.NamedExoticComponent<BottleneckClipsViewProps>;
7337
+
7338
+ interface TicketsViewProps {
7339
+ companyId?: string;
7340
+ lineId?: string;
7341
+ }
7342
+ /**
7343
+ * TicketsView - Kanban-style ticket management for owners
7344
+ * Shows tickets in two stages: Pending and Diagnosed
7345
+ */
7346
+ declare function TicketsView({ companyId, lineId }: TicketsViewProps): React__default.ReactNode;
7347
+ declare const AuthenticatedTicketsView: React__default.NamedExoticComponent<TicketsViewProps>;
7348
+
6605
7349
  type CoreComponents = {
6606
7350
  Card: any;
6607
7351
  CardHeader: any;
@@ -6612,6 +7356,7 @@ type CoreComponents = {
6612
7356
  Button: any;
6613
7357
  HourlyOutputChart: any;
6614
7358
  VideoGridView: any;
7359
+ MapGridView: any;
6615
7360
  WorkspaceMetricCards: any;
6616
7361
  };
6617
7362
  declare const useRegistry: () => CoreComponents;
@@ -6635,6 +7380,7 @@ declare const DEFAULT_THEME_CONFIG: ThemeConfig;
6635
7380
  declare const DEFAULT_ANALYTICS_CONFIG: AnalyticsConfig;
6636
7381
  declare const DEFAULT_AUTH_CONFIG: AuthConfig;
6637
7382
  declare const DEFAULT_VIDEO_CONFIG: VideoConfig;
7383
+ declare const DEFAULT_MAP_VIEW_CONFIG: MapViewConfig;
6638
7384
  declare const LINE_1_UUID = "98a2287e-8d55-4020-b00d-b9940437e3e1";
6639
7385
  declare const LINE_2_UUID = "d93997bb-ecac-4478-a4a6-008d536b724c";
6640
7386
  declare const DEFAULT_CONFIG: Omit<DashboardConfig, 'supabaseUrl' | 'supabaseKey'>;
@@ -6819,4 +7565,4 @@ interface ThreadSidebarProps {
6819
7565
  }
6820
7566
  declare const ThreadSidebar: React__default.FC<ThreadSidebarProps>;
6821
7567
 
6822
- export { ACTION_NAMES, AIAgentView, type AccessControlReturn, type Action, type ActionName, type ActionService, type ActionThreshold, type ActiveBreak, AdvancedFilterDialog, AdvancedFilterPanel, type AnalyticsConfig, AudioService, AuthCallback, type AuthCallbackProps, AuthCallbackView, type AuthCallbackViewProps, type AuthConfig, AuthProvider, type AuthUser, AuthenticatedFactoryView, AuthenticatedHelpView, AuthenticatedHomeView, AuthenticatedShiftsView, AuthenticatedTargetsView, AuthenticatedWorkspaceHealthView, AxelNotificationPopup, type AxelNotificationPopupProps, type AxelSuggestion, BackButton, BackButtonMinimal, BarChart, type BarChartDataItem, type BarChartProps, type BarProps, BaseHistoryCalendar, type BaseHistoryCalendarProps, type BaseLineMetric, type BasePerformanceMetric, type BottleneckFilterType, type BottleneckVideo, type BottleneckVideoData, BottlenecksContent, type BottlenecksContentProps, type BreadcrumbItem, type Break, BreakNotificationPopup, type BreakNotificationPopupProps, type BreakRowProps, type CacheEntryWithPrefetch, CachePrefetchStatus, type CachePrefetchStatusCallback, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type ChatMessage, type ChatThread, type CleanupFunction, type ClipCounts, type ClipCountsWithIndex, ClipFilterProvider, type ClipFilterState, type ClipsConfig, CompactWorkspaceHealthCard, type CompanyUser, type ComponentOverride, CongratulationsOverlay, type CongratulationsOverlayProps, type CoreComponents, type CropConfig, CroppedVideoPlayer, type CroppedVideoPlayerProps, type CurrentShiftResult, CycleTimeChart, type CycleTimeChartProps, CycleTimeOverTimeChart, type CycleTimeOverTimeChartProps, DEFAULT_ANALYTICS_CONFIG, DEFAULT_AUTH_CONFIG, DEFAULT_CONFIG, DEFAULT_DATABASE_CONFIG, DEFAULT_DATE_TIME_CONFIG, DEFAULT_ENDPOINTS_CONFIG, DEFAULT_ENTITY_CONFIG, DEFAULT_SHIFT_CONFIG, DEFAULT_THEME_CONFIG, DEFAULT_VIDEO_CONFIG, DEFAULT_WORKSPACE_CONFIG, DEFAULT_WORKSPACE_POSITIONS, type DashboardConfig, DashboardHeader, type DashboardKPIs, DashboardLayout, type DashboardLayoutProps, DashboardOverridesProvider, DashboardProvider, type DashboardService, type DatabaseConfig, DateDisplay, type DateTimeConfig, DateTimeDisplay, type DateTimeDisplayProps, type DayHistoryData, type DaySummaryData, DebugAuth, DebugAuthView, DetailedHealthStatus, EmptyStateMessage, type EmptyStateMessageProps, EncouragementOverlay, type EndpointsConfig, type EntityConfig, type ErrorCallback$1 as ErrorCallback, type ExtendedCacheMetrics, type FactoryOverviewData, FactoryView, type FactoryViewProps, FileManagerFilters, FileManagerFilters as FileManagerFiltersProps, FilterDialogTrigger, FirstTimeLoginDebug, FirstTimeLoginHandler, type FormatNumberOptions, type FullyIndexedCallback$1 as FullyIndexedCallback, GaugeChart, type GaugeChartProps, GridComponentsPlaceholder, HamburgerButton, type HamburgerButtonProps, Header, type HeaderProps, type HealthAlertConfig, type HealthAlertHistory, type HealthFilterOptions, type HealthMetrics, type HealthStatus, HealthStatusGrid, HealthStatusIndicator, type HealthSummary, HelpView, type HelpViewProps, type HistoryCalendarProps, HomeView, type HookOverride, type HourlyAchievement, HourlyOutputChart, type HourlyOutputChartProps, type HourlyPerformance, type IPrefetchManager, type ISTDateProps, ISTTimer, type ISTTimerProps, InlineEditableText, InteractiveOnboardingTour, KPICard, type KPICardProps, KPIDetailViewWithDisplayNames as KPIDetailView, type KPIDetailViewProps, KPIGrid, type KPIGridProps, KPIHeader, type KPIHeaderProps, KPISection, type KPITrend, KPIsOverviewView, type KPIsOverviewViewProps, LINE_1_UUID, LINE_2_UUID, LargeOutputProgressChart, type LargeOutputProgressChartProps, LeaderboardDetailViewWithDisplayNames as LeaderboardDetailView, type LeaderboardDetailViewProps, type LeaderboardEntry, Legend, type Line$1 as Line, LineChart, type LineChartDataItem, type LineChartProps, type LineDetails, type LineDisplayData, LineHistoryCalendar, type LineHistoryCalendarProps, type LineInfo, type LineMetrics, LineMonthlyHistory, type LineMonthlyHistoryProps, type LineMonthlyMetric, LineMonthlyPdfGenerator, type LineMonthlyPdfGeneratorProps, type LineNavigationParams, LinePdfExportButton, type LinePdfExportButtonProps, LinePdfGenerator, type LinePdfGeneratorProps, type LineProps, type LineShiftConfig, type LineSnapshot, type LineThreshold, LineWhatsAppShareButton, type LineWhatsAppShareProps, LinesService, LiveTimer, LoadingInline, LoadingInline as LoadingInlineProps, LoadingOverlay, LoadingPage, LoadingSkeleton, LoadingSkeleton as LoadingSkeletonProps, LoadingState, LoadingState as LoadingStateProps, LoginPage, type LoginPageProps, LoginView, type LoginViewProps, MainLayout, type MainLayoutProps, type Metric, MetricCard, type MetricCardProps$1 as MetricCardProps, type MetricsError, MinimalOnboardingPopup, type NavItem, type NavItemTrackingEvent, type NavigationMethod, NewClipsNotification, type NewClipsNotificationProps, NoWorkspaceData, OnboardingDemo, OnboardingTour, type OperatorData, type OperatorInfo, OptifyeAgentClient, type OptifyeAgentContext, type OptifyeAgentRequest, type OptifyeAgentResponse, OptifyeLogoLoader, OutputProgressChart, type OutputProgressChartProps, type OverridesMap, type OverviewLineMetric, type OverviewWorkspaceMetric, PageHeader, type PageHeaderProps, type PageOverride, PieChart, type PieChartProps, type PoorPerformingWorkspace, PrefetchConfigurationError, PrefetchError, PrefetchEvents, type PrefetchKey, type PrefetchManagerConfig, type PrefetchManagerStats, type PrefetchOptions, type PrefetchParams$1 as PrefetchParams, type PrefetchRequest, type PrefetchResult, PrefetchStatus$1 as PrefetchStatus, type PrefetchStatusResult, type PrefetchSubscriptionCallbacks, PrefetchTimeoutError, type ProfileMenuItem, ProfileView, type QualityMetric, type QualityOverview, type QualityService, type RateLimitOptions, type RateLimitResult, type RealtimeService, RegistryProvider, type RenderReadyCallback$1 as RenderReadyCallback, type RoutePath, type S3ClipsAPIParams, S3ClipsSupabaseService as S3ClipsService, type S3Config, type S3ListObjectsParams, S3Service, type S3ServiceConfig, type SKU, type SKUConfig, type SKUCreateInput, type SKUListProps, SKUManagementView, type SKUModalProps, type SKUSelectorProps, type SKUUpdateInput, type SOPCategory$1 as SOPCategory, SOPComplianceChart, type SOPComplianceChartProps, SSEChatClient, type SSEEvent, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, type ShiftConfig, type ShiftConfiguration, type ShiftConfigurationRecord, type ShiftData$3 as ShiftData, ShiftDisplay, type ShiftHistoryData, type ShiftHoursMap, type ShiftPanelProps, type ShiftSummaryData, type ShiftTime, ShiftsView, type ShiftsViewProps, SideNavBar, type SideNavBarProps, type SimpleLine, SimpleOnboardingPopup, SingleVideoStream, type SingleVideoStreamProps, Skeleton, type StatusChangeCallback$1 as StatusChangeCallback, type StreamProxyConfig, type SubscriberId, SubscriptionManager, SubscriptionManagerProvider, type SupabaseClient, SupabaseProvider, type Supervisor, type SupervisorAssignment, type SupervisorConfig, SupervisorDropdown, type SupervisorDropdownProps, type SupervisorManagementData, SupervisorManagementView, type SupervisorManagementViewProps, SupervisorService, type Target, TargetWorkspaceGrid, type TargetWorkspaceGridProps, TargetsViewWithDisplayNames as TargetsView, type TargetsViewProps, type ThemeColorValue, type ThemeConfig, ThreadSidebar, TicketHistory, TicketHistoryService, TimeDisplay, TimePickerDropdown, Timer, TimezoneProvider, TimezoneService, type TrackingEventProperties, type TrendDirection, type UnderperformingWorkspace, type UnderperformingWorkspaces, type UptimeDetails, type UseActiveBreaksResult, type UseClipTypesResult, type UseDashboardMetricsProps, type UseFactoryOverviewOptions, type UseFormatNumberResult, type UseMessagesResult, type UsePrefetchClipCountsOptions$1 as UsePrefetchClipCountsOptions, type UsePrefetchClipCountsResult$1 as UsePrefetchClipCountsResult, type UseRealtimeLineMetricsProps, type UseTargetsOptions, type UseThreadsResult, type UseTicketHistoryReturn, type UseWorkspaceOperatorsOptions, type UserProfileConfig, type UserRole, UserService, VideoCard, type VideoConfig, type VideoCroppingConfig, type VideoCroppingRect, VideoGridView, type VideoIndex, type VideoIndexEntry, type VideoMetadata, VideoPlayer, type VideoPlayerEventData, type VideoPlayerProps, type VideoPlayerRef, VideoPreloader, type VideoSeverity, type VideoSummary, type VideoType, WORKSPACE_POSITIONS, type WhatsAppSendResult, WhatsAppShareButton, type WhatsAppShareButtonProps, type WhatsappService, type Workspace, type WorkspaceActionUpdate, WorkspaceCard, type WorkspaceCardProps, type WorkspaceConfig, WrappedComponent as WorkspaceDetailView, type WorkspaceDetailedMetrics, WorkspaceDisplayNameExample, WorkspaceGrid, WorkspaceGridItem, type WorkspaceGridItemProps, type WorkspaceHealth, WorkspaceHealthCard, type WorkspaceHealthInfo, _default as WorkspaceHealthView, type WorkspaceHealthWithStatus, WorkspaceHistoryCalendar, WorkspaceMetricCards, WorkspaceMetricCardsImpl, type WorkspaceMetricCardsProps, type WorkspaceMetrics, WorkspaceMonthlyDataFetcher, type WorkspaceMonthlyDataFetcherProps, WorkspaceMonthlyHistory, type WorkspaceMonthlyMetric, WorkspaceMonthlyPdfGenerator, type WorkspaceMonthlyPdfGeneratorProps, type WorkspaceNavigationParams, WorkspacePdfExportButton, type WorkspacePdfExportButtonProps, WorkspacePdfGenerator, type WorkspacePdfGeneratorProps, type WorkspacePosition, type WorkspaceQualityData, type WorkspaceUrlMapping, WorkspaceWhatsAppShareButton, type WorkspaceWhatsAppShareProps, actionService, apiUtils, authCoreService, authOTPService, authRateLimitService, checkRateLimit, clearAllRateLimits, clearRateLimit, clearS3VideoCache, clearS3VideoFromCache, clearWorkspaceDisplayNamesCache, cn, createLinesService, createStreamProxyHandler, createSupabaseClient, createSupervisorService, createThrottledReload, createUserService, dashboardService, deleteThread, forceRefreshWorkspaceDisplayNames, formatDateInZone, formatDateTimeInZone, formatISTDate, formatIdleTime, formatTimeInZone, fromUrlFriendlyName, getAllLineDisplayNames, getAllThreadMessages, getAllWorkspaceDisplayNamesAsync, getAnonClient, getCameraNumber, getCompanyMetricsTableName, getConfigurableShortWorkspaceDisplayName, getConfigurableWorkspaceDisplayName, getConfiguredLineIds, getCoreSessionRecordingProperties, getCoreSessionReplayUrl, getCurrentShift, getCurrentTimeInZone, getDashboardHeaderTimeInZone, getDaysDifferenceInZone, getDefaultCameraStreamUrl, getDefaultLineId, getDefaultTabForWorkspace, getLineDisplayName, getManufacturingInsights, getMetricsTablePrefix, getOperationalDate, getS3SignedUrl, getS3VideoSrc, getShortWorkspaceDisplayName, getShortWorkspaceDisplayNameAsync, getStoredWorkspaceMappings, getSubscriptionManager, getThreadMessages, getUserThreads, getUserThreadsPaginated, getWorkspaceDisplayName, getWorkspaceDisplayNameAsync, getWorkspaceDisplayNamesMap, getWorkspaceFromUrl, getWorkspaceNavigationParams, identifyCoreUser, initializeCoreMixpanel, isLegacyConfiguration, isPrefetchError, isTransitionPeriod, isUrlPermanentlyFailed, isValidFactoryViewConfiguration, isValidLineInfoPayload, isValidPrefetchParams, isValidPrefetchStatus, isValidWorkspaceDetailedMetricsPayload, isValidWorkspaceMetricsPayload, isWorkspaceDisplayNamesLoaded, isWorkspaceDisplayNamesLoading, linesService, mergeWithDefaultConfig, migrateLegacyConfiguration, optifyeAgentClient, parseS3Uri, preInitializeWorkspaceDisplayNames, preloadS3Video, preloadS3VideoUrl, preloadS3VideosUrl, preloadVideoUrl, preloadVideosUrl, qualityService, realtimeService, refreshWorkspaceDisplayNames, resetCoreMixpanel, resetFailedUrl, resetSubscriptionManager, s3VideoPreloader, shuffleArray, simulateApiDelay, skuService, startCoreSessionRecording, stopCoreSessionRecording, storeWorkspaceMapping, streamProxyConfig, throttledReloadDashboard, toUrlFriendlyName, trackCoreEvent, trackCorePageView, updateThreadTitle, useAccessControl, useActiveBreaks, useAllWorkspaceMetrics, useAnalyticsConfig, useAppTimezone, useAudioService, useAuth, useAuthConfig, useCanSaveTargets, useClipFilter, useClipTypes, useClipTypesWithCounts, useComponentOverride, useCustomConfig, useDashboardConfig, useDashboardMetrics, useDatabaseConfig, useDateFormatter, useDateTimeConfig, useEndpointsConfig, useEntityConfig, useFactoryOverviewMetrics, useFeatureFlags, useFormatNumber, useHistoricWorkspaceMetrics, useHlsStream, useHlsStreamWithCropping, useHookOverride, useHourEndTimer, useHourlyTargetAchievements, useHourlyTargetMisses, useLeaderboardMetrics, useLineDetailedMetrics, useLineKPIs, useLineMetrics, useLineWorkspaceMetrics, useMessages, useMetrics, useNavigation, useOverrides, usePageOverride, usePrefetchClipCounts, useRealtimeLineMetrics, useRegistry, useSKUs, useShiftConfig, useShifts, useSubscriptionManager, useSubscriptionManagerSafe, useSupabase, useSupabaseClient, useTargets, useTheme, useThemeConfig, useThreads, useTicketHistory, useTimezoneContext, useVideoConfig, useWorkspaceConfig, useWorkspaceDetailedMetrics, useWorkspaceDisplayName, useWorkspaceDisplayNames, useWorkspaceDisplayNamesMap, useWorkspaceHealth, useWorkspaceHealthById, useWorkspaceMetrics, useWorkspaceNavigation, useWorkspaceOperators, userService, videoPrefetchManager, videoPreloader, whatsappService, withAccessControl, withAuth, withRegistry, withTimezone, workspaceHealthService, workspaceService };
7568
+ export { ACTION_NAMES, AIAgentView, AcceptInvite, type AcceptInviteProps, AcceptInviteView, type AcceptInviteViewProps, type AccessControlReturn, type Action, type ActionName, type ActionService, type ActionThreshold, type ActiveBreak, AdvancedFilterDialog, AdvancedFilterPanel, type AnalyticsConfig, type AssignUserToFactoriesInput, type AssignUserToLinesInput, AudioService, AuthCallback, type AuthCallbackProps, AuthCallbackView, type AuthCallbackViewProps, type AuthConfig, AuthProvider, AuthService, type AuthUser, AuthenticatedBottleneckClipsView, AuthenticatedFactoryView, AuthenticatedHelpView, AuthenticatedHomeView, AuthenticatedShiftsView, AuthenticatedTargetsView, AuthenticatedTicketsView, AuthenticatedWorkspaceHealthView, AxelNotificationPopup, type AxelNotificationPopupProps, type AxelSuggestion, BackButton, BackButtonMinimal, BarChart, type BarChartDataItem, type BarChartProps, type BarProps, BaseHistoryCalendar, type BaseHistoryCalendarProps, type BaseLineMetric, type BasePerformanceMetric, BottleneckClipsModal, type BottleneckClipsModalProps, type BottleneckClipsNavigationParams, BottleneckClipsView, type BottleneckClipsViewProps, type BottleneckFilterType, type BottleneckVideo, type BottleneckVideoData, BottlenecksContent, type BottlenecksContentProps, type BreadcrumbItem, type Break, BreakNotificationPopup, type BreakNotificationPopupProps, type BreakRowProps, type CacheEntryWithPrefetch, CachePrefetchStatus, type CachePrefetchStatusCallback, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type ChatMessage, type ChatThread, type CleanupFunction, type ClipCounts, type ClipCountsWithIndex, ClipFilterProvider, type ClipFilterState, type ClipsConfig, CompactWorkspaceHealthCard, type CompanyUser, type CompanyUserWithDetails, type ComponentOverride, CongratulationsOverlay, type CongratulationsOverlayProps, type CoreComponents, type CreateInvitationInput, type CropConfig, CroppedVideoPlayer, type CroppedVideoPlayerProps, type CurrentShiftResult, CycleTimeChart, type CycleTimeChartProps, CycleTimeOverTimeChart, type CycleTimeOverTimeChartProps, DEFAULT_ANALYTICS_CONFIG, DEFAULT_AUTH_CONFIG, DEFAULT_CONFIG, DEFAULT_DATABASE_CONFIG, DEFAULT_DATE_TIME_CONFIG, DEFAULT_ENDPOINTS_CONFIG, DEFAULT_ENTITY_CONFIG, DEFAULT_MAP_VIEW_CONFIG, DEFAULT_SHIFT_CONFIG, DEFAULT_THEME_CONFIG, DEFAULT_VIDEO_CONFIG, DEFAULT_WORKSPACE_CONFIG, DEFAULT_WORKSPACE_POSITIONS, type DashboardConfig, DashboardHeader, type DashboardKPIs, DashboardLayout, type DashboardLayoutProps, DashboardOverridesProvider, DashboardProvider, type DashboardService, type DatabaseConfig, DateDisplay, type DateTimeConfig, DateTimeDisplay, type DateTimeDisplayProps, type DayHistoryData, type DaySummaryData, DebugAuth, DebugAuthView, DetailedHealthStatus, type DiagnosisOption$1 as DiagnosisOption, DiagnosisVideoModal, EmptyStateMessage, type EmptyStateMessageProps, EncouragementOverlay, type EndpointsConfig, type EntityConfig, type ErrorCallback$1 as ErrorCallback, type ExtendedCacheMetrics, type FactoryOverviewMetrics, FactoryView, type FactoryViewProps, FileManagerFilters, FileManagerFilters as FileManagerFiltersProps, FilterDialogTrigger, FirstTimeLoginDebug, FirstTimeLoginHandler, type FormatNumberOptions, type FullyIndexedCallback$1 as FullyIndexedCallback, GaugeChart, type GaugeChartProps, GridComponentsPlaceholder, HamburgerButton, type HamburgerButtonProps, Header, type HeaderProps, type HealthAlertConfig, type HealthAlertHistory, type HealthFilterOptions, type HealthMetrics, type HealthStatus, HealthStatusGrid, HealthStatusIndicator, type HealthSummary, HelpView, type HelpViewProps, type HistoricWorkspaceMetrics, type HistoryCalendarProps, HomeView, type HookOverride, type HourlyAchievement, HourlyOutputChart, type HourlyOutputChartProps, type HourlyPerformance, type IPrefetchManager, type ISTDateProps, ISTTimer, type ISTTimerProps, InlineEditableText, InteractiveOnboardingTour, InvitationService, type InvitationWithDetails, KPICard, type KPICardProps, KPIDetailViewWithDisplayNames as KPIDetailView, type KPIDetailViewProps, KPIGrid, type KPIGridProps, KPIHeader, type KPIHeaderProps, KPISection, type KPITrend, KPIsOverviewView, type KPIsOverviewViewProps, LINE_1_UUID, LINE_2_UUID, LargeOutputProgressChart, type LargeOutputProgressChartProps, LeaderboardDetailViewWithDisplayNames as LeaderboardDetailView, type LeaderboardDetailViewProps, type LeaderboardEntry, Legend, type Line$1 as Line, LineChart, type LineChartDataItem, type LineChartProps, type LineDetails, type LineDisplayData, LineHistoryCalendar, type LineHistoryCalendarProps, type LineInfo, type LineMetrics, LineMonthlyHistory, type LineMonthlyHistoryProps, type LineMonthlyMetric, LineMonthlyPdfGenerator, type LineMonthlyPdfGeneratorProps, type LineNavigationParams, LinePdfExportButton, type LinePdfExportButtonProps, LinePdfGenerator, type LinePdfGeneratorProps, type LineProps, type LineShiftConfig, type LineSnapshot, type LineThreshold, LineWhatsAppShareButton, type LineWhatsAppShareProps, LinesService, LiveTimer, LoadingInline, LoadingInline as LoadingInlineProps, LoadingOverlay, LoadingPage, LoadingSkeleton, LoadingSkeleton as LoadingSkeletonProps, LoadingState, LoadingState as LoadingStateProps, LoginPage, type LoginPageProps, LoginView, type LoginViewProps, MainLayout, type MainLayoutProps, MapGridView, type MapViewConfig, type Metric, MetricCard, type MetricCardProps$1 as MetricCardProps, type MetricsError, MinimalOnboardingPopup, type NavItem, type NavItemTrackingEvent, type NavigationMethod, NewClipsNotification, type NewClipsNotificationProps, NoWorkspaceData, OnboardingDemo, OnboardingTour, type OperatorData, type OperatorInfo, OptifyeAgentClient, type OptifyeAgentContext, type OptifyeAgentRequest, type OptifyeAgentResponse, OptifyeLogoLoader, OutputProgressChart, type OutputProgressChartProps, type OverridesMap, type OverviewLineMetric, type OverviewWorkspaceMetric, PageHeader, type PageHeaderProps, type PageOverride, PieChart, type PieChartProps, type PoorPerformingWorkspace, PrefetchConfigurationError, PrefetchError, PrefetchEvents, type PrefetchKey, type PrefetchManagerConfig, type PrefetchManagerStats, type PrefetchOptions, type PrefetchParams$1 as PrefetchParams, type PrefetchRequest, type PrefetchResult, PrefetchStatus$1 as PrefetchStatus, type PrefetchStatusResult, type PrefetchSubscriptionCallbacks, PrefetchTimeoutError, type ProfileMenuItem, ProfileView, type QualityMetric, type QualityOverview, type QualityService, type RateLimitOptions, type RateLimitResult, type RealtimeService, RegistryProvider, type RenderReadyCallback$1 as RenderReadyCallback, type RoutePath, type S3ClipsAPIParams, S3ClipsSupabaseService as S3ClipsService, type S3Config, type S3ListObjectsParams, S3Service, type S3ServiceConfig, type SKU, type SKUConfig, type SKUCreateInput, type SKUListProps, SKUManagementView, type SKUModalProps, type SKUSelectorProps, type SKUUpdateInput, type SOPCategory$1 as SOPCategory, SOPComplianceChart, type SOPComplianceChartProps, SSEChatClient, type SSEEvent, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, type ShiftConfig, type ShiftConfiguration, type ShiftConfigurationRecord, type ShiftData$3 as ShiftData, ShiftDisplay, type ShiftHistoryData, type ShiftHoursMap, type ShiftPanelProps, type ShiftSummaryData, type ShiftTime, ShiftsView, type ShiftsViewProps, SideNavBar, type SideNavBarProps, SignupWithInvitation, type SignupWithInvitationProps, type SimpleLine, SimpleOnboardingPopup, SingleVideoStream, type SingleVideoStreamProps, Skeleton, type StatusChangeCallback$1 as StatusChangeCallback, type StreamProxyConfig, type SubscriberId, SubscriptionManager, SubscriptionManagerProvider, type SupabaseClient, SupabaseProvider, type Supervisor, type SupervisorAssignment, type SupervisorConfig, SupervisorDropdown, type SupervisorDropdownProps, type SupervisorManagementData, SupervisorManagementView, type SupervisorManagementViewProps, SupervisorService, type Target, TargetWorkspaceGrid, type TargetWorkspaceGridProps, TargetsViewWithDisplayNames as TargetsView, type TargetsViewProps, type TeamManagementPermissions, TeamManagementView, type TeamManagementViewProps, type ThemeColorValue, type ThemeConfig, ThreadSidebar, TicketHistory, TicketHistoryService, type TicketsConfig, TicketsView, type TicketsViewProps, TimeDisplay, TimePickerDropdown, Timer, TimezoneProvider, TimezoneService, type TrackingEventProperties, type TrendDirection, type UnderperformingWorkspace, type UnderperformingWorkspaces, type UpdateUserRoleInput, type UptimeDetails, type UseActiveBreaksResult, type UseClipTypesResult, type UseDashboardMetricsProps, type UseDynamicShiftConfigResult, type UseFormatNumberResult, type UseLineShiftConfigResult, type UseMessagesResult, type UsePrefetchClipCountsOptions$1 as UsePrefetchClipCountsOptions, type UsePrefetchClipCountsResult$1 as UsePrefetchClipCountsResult, type UseRealtimeLineMetricsProps, type UseTargetsOptions, type UseThreadsResult, type UseTicketHistoryReturn, type UseWorkspaceHealthByIdOptions, type UseWorkspaceOperatorsOptions, type UserInvitation, UserManagementService, type UserProfileConfig, type UserRole, UserService, VideoCard, type VideoConfig, type VideoCroppingConfig, type VideoCroppingRect, VideoGridView, type VideoIndex, type VideoIndexEntry, type VideoMetadata, VideoPlayer, type VideoPlayerEventData, type VideoPlayerProps, type VideoPlayerRef, VideoPreloader, type VideoSeverity, type VideoSummary, type VideoType, WORKSPACE_POSITIONS, type WhatsAppSendResult, WhatsAppShareButton, type WhatsAppShareButtonProps, type WhatsappService, type Workspace, type WorkspaceActionUpdate, WorkspaceCard, type WorkspaceCardProps, type WorkspaceConfig, WrappedComponent as WorkspaceDetailView, type WorkspaceDetailedMetrics, WorkspaceDisplayNameExample, WorkspaceGrid, WorkspaceGridItem, type WorkspaceGridItemProps, type WorkspaceGridPosition, type WorkspaceHealth, WorkspaceHealthCard, type WorkspaceHealthInfo, _default as WorkspaceHealthView, type WorkspaceHealthWithStatus, WorkspaceHistoryCalendar, WorkspaceMetricCards, WorkspaceMetricCardsImpl, type WorkspaceMetricCardsProps, type WorkspaceMetrics, WorkspaceMonthlyDataFetcher, type WorkspaceMonthlyDataFetcherProps, WorkspaceMonthlyHistory, type WorkspaceMonthlyMetric, WorkspaceMonthlyPdfGenerator, type WorkspaceMonthlyPdfGeneratorProps, type WorkspaceNavigationParams, WorkspacePdfExportButton, type WorkspacePdfExportButtonProps, WorkspacePdfGenerator, type WorkspacePdfGeneratorProps, type WorkspacePosition, type WorkspaceQualityData, type WorkspaceUrlMapping, WorkspaceWhatsAppShareButton, type WorkspaceWhatsAppShareProps, actionService, apiUtils, authCoreService, authOTPService, authRateLimitService, checkRateLimit, clearAllRateLimits, clearRateLimit, clearS3VideoCache, clearS3VideoFromCache, clearWorkspaceDisplayNamesCache, cn, createInvitationService, createLinesService, createStreamProxyHandler, createSupabaseClient, createSupervisorService, createThrottledReload, createUserManagementService, createUserService, dashboardService, deleteThread, forceRefreshWorkspaceDisplayNames, formatDateInZone, formatDateTimeInZone, formatISTDate, formatIdleTime, formatTimeInZone, fromUrlFriendlyName, getAllLineDisplayNames, getAllThreadMessages, getAllWorkspaceDisplayNamesAsync, getAnonClient, getBrowserName, getCameraNumber, getCompanyMetricsTableName, getConfigurableShortWorkspaceDisplayName, getConfigurableWorkspaceDisplayName, getConfiguredLineIds, getCoreSessionRecordingProperties, getCoreSessionReplayUrl, getCurrentShift, getCurrentTimeInZone, getDashboardHeaderTimeInZone, getDaysDifferenceInZone, getDefaultCameraStreamUrl, getDefaultLineId, getDefaultTabForWorkspace, getLineDisplayName, getManufacturingInsights, getMetricsTablePrefix, getOperationalDate, getS3SignedUrl, getS3VideoSrc, getShortWorkspaceDisplayName, getShortWorkspaceDisplayNameAsync, getStoredWorkspaceMappings, getSubscriptionManager, getThreadMessages, getUserThreads, getUserThreadsPaginated, getWorkspaceDisplayName, getWorkspaceDisplayNameAsync, getWorkspaceDisplayNamesMap, getWorkspaceFromUrl, getWorkspaceNavigationParams, identifyCoreUser, initializeCoreMixpanel, isLegacyConfiguration, isPrefetchError, isSafari, isTransitionPeriod, isUrlPermanentlyFailed, isValidFactoryViewConfiguration, isValidLineInfoPayload, isValidPrefetchParams, isValidPrefetchStatus, isValidWorkspaceDetailedMetricsPayload, isValidWorkspaceMetricsPayload, isWorkspaceDisplayNamesLoaded, isWorkspaceDisplayNamesLoading, linesService, mergeWithDefaultConfig, migrateLegacyConfiguration, optifyeAgentClient, parseS3Uri, preInitializeWorkspaceDisplayNames, preloadS3Video, preloadS3VideoUrl, preloadS3VideosUrl, preloadVideoUrl, preloadVideosUrl, qualityService, realtimeService, refreshWorkspaceDisplayNames, resetCoreMixpanel, resetFailedUrl, resetSubscriptionManager, s3VideoPreloader, shuffleArray, simulateApiDelay, skuService, startCoreSessionRecording, stopCoreSessionRecording, storeWorkspaceMapping, streamProxyConfig, throttledReloadDashboard, toUrlFriendlyName, trackCoreEvent, trackCorePageView, updateThreadTitle, useAccessControl, useActiveBreaks, useActiveLineId, useAllWorkspaceMetrics, useAnalyticsConfig, useAppTimezone, useAudioService, useAuth, useAuthConfig, useAxelNotifications, useCanSaveTargets, useClipFilter, useClipTypes, useClipTypesWithCounts, useComponentOverride, useCustomConfig, useDashboardConfig, useDashboardMetrics, useDatabaseConfig, useDateFormatter, useDateTimeConfig, useDynamicShiftConfig, useEndpointsConfig, useEntityConfig, useFactoryOverviewMetrics, useFeatureFlags, useFormatNumber, useHasLineAccess, useHistoricWorkspaceMetrics, useHlsStream, useHlsStreamWithCropping, useHookOverride, useHourEndTimer, useHourlyTargetAchievements, useHourlyTargetMisses, useLeaderboardMetrics, useLineDetailedMetrics, useLineKPIs, useLineMetrics, useLineShiftConfig, useLineSupervisor, useLineWorkspaceMetrics, useMessages, useMetrics, useNavigation, useOverrides, usePageOverride, usePrefetchClipCounts, useRealtimeLineMetrics, useRegistry, useSKUs, useShiftConfig, useShifts, useSubscriptionManager, useSubscriptionManagerSafe, useSupabase, useSupabaseClient, useTargets, useTeamManagementPermissions, useTheme, useThemeConfig, useThreads, useTicketHistory, useTimezoneContext, useUserLineAccess, useVideoConfig, useWorkspaceConfig, useWorkspaceDetailedMetrics, useWorkspaceDisplayName, useWorkspaceDisplayNames, useWorkspaceDisplayNamesMap, useWorkspaceHealthById, useWorkspaceMetrics, useWorkspaceNavigation, useWorkspaceOperators, userService, videoPrefetchManager, videoPreloader, whatsappService, withAccessControl, withAuth, withRegistry, withTimezone, workspaceHealthService, workspaceService };