@optifye/dashboard-core 5.0.0 → 6.0.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.mjs CHANGED
@@ -50,12 +50,15 @@ var DEFAULT_DATABASE_CONFIG = {
50
50
  }
51
51
  };
52
52
  var DEFAULT_ENTITY_CONFIG = {
53
- companyId: void 0,
54
- factoryId: void 0,
55
- defaultLineId: void 0,
56
- secondaryLineId: void 0,
53
+ companyId: "87ca8ebc-ef29-4543-9e12-efc526a9b669",
54
+ factoryId: "b3e44be4-730e-4276-b2ce-701c79d66ffa",
55
+ defaultLineId: "98a2287e-8d55-4020-b00d-b9940437e3e1",
56
+ secondaryLineId: "d93997bb-ecac-4478-a4a6-008d536b724c",
57
57
  factoryViewId: "factory",
58
- lineNames: {}
58
+ lineNames: {
59
+ "98a2287e-8d55-4020-b00d-b9940437e3e1": "Cell 8",
60
+ "d93997bb-ecac-4478-a4a6-008d536b724c": "Cell 7"
61
+ }
59
62
  };
60
63
  var DEFAULT_SHIFT_CONFIG = {
61
64
  dayShift: {
@@ -72,9 +75,12 @@ var DEFAULT_SHIFT_CONFIG = {
72
75
  };
73
76
  var DEFAULT_WORKSPACE_CONFIG = {
74
77
  displayNames: {
75
- "WS01": "fillin",
76
- "WS02": "Capping Station",
77
- "WS03": "Filling station"
78
+ "Cell 8 WS1": "Swaging 1",
79
+ "Cell 8 WS2": "Bond Testing 1",
80
+ "Cell 8 WS3": "QA Check 1",
81
+ "Cell 7 WS1": "Swaging 2",
82
+ "Cell 7 WS2": "Bond Testing 2",
83
+ "Cell 7 WS3": "QA Check 2"
78
84
  },
79
85
  specialWorkspaces: {
80
86
  startId: 19,
@@ -131,7 +137,8 @@ var DEFAULT_VIDEO_CONFIG = {
131
137
  useRAF: true
132
138
  }
133
139
  };
134
- var LINE_1_UUID = "910a224b-0abc-459a-babb-4c899824cfe7";
140
+ var LINE_1_UUID = "98a2287e-8d55-4020-b00d-b9940437e3e1";
141
+ var LINE_2_UUID = "d93997bb-ecac-4478-a4a6-008d536b724c";
135
142
  var DEFAULT_CONFIG = {
136
143
  apiBaseUrl: void 0,
137
144
  // No default base URL
@@ -3363,6 +3370,9 @@ var useDashboardMetrics = ({ onLineMetricsUpdate, lineId }) => {
3363
3370
  const databaseConfig = useDatabaseConfig();
3364
3371
  const dateTimeConfig = useDateTimeConfig();
3365
3372
  const shiftConfig = useShiftConfig();
3373
+ const defaultTimezone = dateTimeConfig?.defaultTimezone || "UTC";
3374
+ const configuredLineMetricsTable = databaseConfig?.tables?.lineMetrics ?? "line_metrics";
3375
+ const schema = databaseConfig?.schema ?? "public";
3366
3376
  const supabase = useSupabase();
3367
3377
  const [metrics2, setMetrics] = useState(() => getCache(lineId) || { workspaceMetrics: [], lineMetrics: [] });
3368
3378
  const [isLoading, setIsLoading] = useState(() => !getCache(lineId));
@@ -3375,9 +3385,6 @@ var useDashboardMetrics = ({ onLineMetricsUpdate, lineId }) => {
3375
3385
  () => getCompanyMetricsTableName(entityConfig.companyId, "performance_metrics"),
3376
3386
  [entityConfig.companyId]
3377
3387
  );
3378
- const configuredLineMetricsTable = databaseConfig.tables?.lineMetrics ?? "line_metrics";
3379
- const schema = databaseConfig.schema ?? "public";
3380
- const defaultTimezone = dateTimeConfig.defaultTimezone || "UTC";
3381
3388
  useEffect(() => {
3382
3389
  lineIdRef.current = lineId;
3383
3390
  const cachedData = getCache(lineId);
@@ -3387,7 +3394,7 @@ var useDashboardMetrics = ({ onLineMetricsUpdate, lineId }) => {
3387
3394
  const fetchAllMetrics = useCallback(async () => {
3388
3395
  const currentLineIdToUse = lineIdRef.current;
3389
3396
  if (!currentLineIdToUse || !supabase || isFetchingRef.current || companySpecificMetricsTable.includes("unknown_company")) {
3390
- if (!metrics2.workspaceMetrics.length && !metrics2.lineMetrics.length) setIsLoading(false);
3397
+ if (!metrics2?.workspaceMetrics?.length && !metrics2?.lineMetrics?.length) setIsLoading(false);
3391
3398
  if (companySpecificMetricsTable.includes("unknown_company") && !error) {
3392
3399
  setError({ message: "Company ID not configured for metrics table.", code: "CONFIG_ERROR" });
3393
3400
  }
@@ -3408,7 +3415,12 @@ var useDashboardMetrics = ({ onLineMetricsUpdate, lineId }) => {
3408
3415
  if (targetLineIds.length === 0) {
3409
3416
  throw new Error("No target line IDs available for fetching metrics.");
3410
3417
  }
3411
- const { data: workspaceData, error: workspaceError } = await supabase.from(companySpecificMetricsTable).select("company_id,line_id,shift_id,date,workspace_id,workspace_name,total_output,avg_pph,performance_score,avg_cycle_time,trend_score,ideal_output,efficiency,total_day_output").eq("date", operationalDate).eq("shift_id", currentShiftDetails.shiftId).in("line_id", targetLineIds);
3418
+ const isFactoryView = currentLineIdToUse === (entityConfig.factoryViewId || "factory");
3419
+ let workspaceQuery = supabase.from(companySpecificMetricsTable).select("company_id,line_id,shift_id,date,workspace_id,workspace_name,total_output,avg_pph,performance_score,avg_cycle_time,trend_score,ideal_output,efficiency,total_day_output").eq("date", operationalDate).eq("shift_id", currentShiftDetails.shiftId);
3420
+ if (!isFactoryView) {
3421
+ workspaceQuery = workspaceQuery.in("line_id", targetLineIds);
3422
+ }
3423
+ const { data: workspaceData, error: workspaceError } = await workspaceQuery;
3412
3424
  if (workspaceError) {
3413
3425
  throw workspaceError;
3414
3426
  }
@@ -3439,7 +3451,11 @@ var useDashboardMetrics = ({ onLineMetricsUpdate, lineId }) => {
3439
3451
  const wsNumB = parseInt(b.workspace_name?.replace(/[^0-9]/g, "") || "0");
3440
3452
  return wsNumA - wsNumB;
3441
3453
  });
3442
- const { data: lineData, error: lineError } = await supabase.from(configuredLineMetricsTable).select("*").eq("date", operationalDate).eq("shift_id", currentShiftDetails.shiftId).in("line_id", targetLineIds);
3454
+ let lineMetricsQuery = supabase.from(configuredLineMetricsTable).select("*").eq("date", operationalDate).eq("shift_id", currentShiftDetails.shiftId);
3455
+ if (!isFactoryView) {
3456
+ lineMetricsQuery = lineMetricsQuery.in("line_id", targetLineIds);
3457
+ }
3458
+ const { data: lineData, error: lineError } = await lineMetricsQuery;
3443
3459
  if (lineError) {
3444
3460
  throw lineError;
3445
3461
  }
@@ -3459,9 +3475,9 @@ var useDashboardMetrics = ({ onLineMetricsUpdate, lineId }) => {
3459
3475
  }
3460
3476
  }, [
3461
3477
  supabase,
3462
- metrics2.workspaceMetrics.length,
3478
+ metrics2?.workspaceMetrics?.length || 0,
3463
3479
  // To re-evaluate setIsLoading in fetchAllMetrics if called directly
3464
- metrics2.lineMetrics.length,
3480
+ metrics2?.lineMetrics?.length || 0,
3465
3481
  // To re-evaluate setIsLoading in fetchAllMetrics if called directly
3466
3482
  companySpecificMetricsTable,
3467
3483
  configuredLineMetricsTable,
@@ -3549,8 +3565,8 @@ var useDashboardMetrics = ({ onLineMetricsUpdate, lineId }) => {
3549
3565
  // Add lineId from props to re-run effect if it changes, managed by lineIdRef inside effect
3550
3566
  ]);
3551
3567
  return {
3552
- workspaceMetrics: metrics2.workspaceMetrics,
3553
- lineMetrics: metrics2.lineMetrics,
3568
+ workspaceMetrics: metrics2?.workspaceMetrics || [],
3569
+ lineMetrics: metrics2?.lineMetrics || [],
3554
3570
  isLoading,
3555
3571
  error,
3556
3572
  refetch: fetchAllMetrics
@@ -3583,6 +3599,7 @@ var setCache2 = (lineId, data) => {
3583
3599
  var useLineKPIs = ({ lineId }) => {
3584
3600
  useDashboardConfig();
3585
3601
  const entityConfig = useEntityConfig();
3602
+ const isFactoryView = lineId === (entityConfig.factoryViewId || "factory");
3586
3603
  const databaseConfig = useDatabaseConfig();
3587
3604
  const dateTimeConfig = useDateTimeConfig();
3588
3605
  const shiftConfig = useShiftConfig();
@@ -3640,7 +3657,7 @@ var useLineKPIs = ({ lineId }) => {
3640
3657
  isFetchingRef.current = false;
3641
3658
  updateQueueRef.current = false;
3642
3659
  }
3643
- }, [dashboardServiceInstance, kpis, defaultTimezone, shiftConfig, entityConfig.companyId]);
3660
+ }, [dashboardServiceInstance, kpis, defaultTimezone, shiftConfig, entityConfig.companyId, isFactoryView]);
3644
3661
  const queueUpdate = useCallback(() => {
3645
3662
  if (updateQueueRef.current) return;
3646
3663
  updateQueueRef.current = true;
@@ -3715,7 +3732,7 @@ var useLineKPIs = ({ lineId }) => {
3715
3732
  }
3716
3733
  activeChannels.forEach((ch) => supabase.removeChannel(ch).catch((err) => console.error("[useLineKPIs] Error removing KPI channel:", err)));
3717
3734
  };
3718
- }, [supabase, lineId, fetchKPIs, queueUpdate, dashboardServiceInstance, entityConfig, schema, lineMetricsTable, companySpecificMetricsTable, defaultTimezone, shiftConfig, kpis]);
3735
+ }, [supabase, lineId, fetchKPIs, queueUpdate, dashboardServiceInstance, entityConfig, schema, lineMetricsTable, companySpecificMetricsTable, defaultTimezone, shiftConfig, kpis, isFactoryView]);
3719
3736
  return {
3720
3737
  kpis,
3721
3738
  isLoading,
@@ -5151,6 +5168,120 @@ var useActiveBreaks = (lineIds) => {
5151
5168
  error
5152
5169
  };
5153
5170
  };
5171
+ var useAllWorkspaceMetrics = (options) => {
5172
+ const entityConfig = useEntityConfig();
5173
+ const databaseConfig = useDatabaseConfig();
5174
+ const dateTimeConfig = useDateTimeConfig();
5175
+ const shiftConfig = useShiftConfig();
5176
+ const supabase = useSupabase();
5177
+ const [workspaces, setWorkspaces] = useState([]);
5178
+ const [loading, setLoading] = useState(true);
5179
+ const [error, setError] = useState(null);
5180
+ const [initialized, setInitialized] = useState(false);
5181
+ const queryShiftId = useMemo(() => {
5182
+ const currentShift = getCurrentShift(
5183
+ dateTimeConfig.defaultTimezone || "Asia/Kolkata",
5184
+ shiftConfig
5185
+ );
5186
+ return options?.initialShiftId !== void 0 ? options.initialShiftId : currentShift.shiftId;
5187
+ }, [options?.initialShiftId, dateTimeConfig.defaultTimezone, shiftConfig]);
5188
+ const queryDate = useMemo(() => {
5189
+ return options?.initialDate || getOperationalDate(dateTimeConfig.defaultTimezone);
5190
+ }, [options?.initialDate, dateTimeConfig.defaultTimezone]);
5191
+ const metricsTable = useMemo(() => {
5192
+ const companyId = entityConfig.companyId;
5193
+ if (!companyId) return "";
5194
+ const metricsTablePrefix = getMetricsTablePrefix();
5195
+ return `${metricsTablePrefix}_${companyId.replace(/-/g, "_")}`;
5196
+ }, [entityConfig.companyId]);
5197
+ const schema = databaseConfig.schema ?? "public";
5198
+ const fetchWorkspaceMetrics = useCallback(async () => {
5199
+ if (!initialized) {
5200
+ setLoading(true);
5201
+ }
5202
+ setError(null);
5203
+ try {
5204
+ console.log("Fetching all workspace metrics with params:", {
5205
+ queryDate,
5206
+ queryShiftId,
5207
+ metricsTable
5208
+ });
5209
+ const { data, error: fetchError } = await supabase.from(metricsTable).select(`
5210
+ workspace_name,
5211
+ total_output,
5212
+ avg_pph,
5213
+ efficiency,
5214
+ workspace_id,
5215
+ avg_cycle_time,
5216
+ performance_score,
5217
+ trend_score,
5218
+ line_id,
5219
+ total_day_output
5220
+ `).eq("date", queryDate).eq("shift_id", queryShiftId).order("efficiency", { ascending: false });
5221
+ if (fetchError) throw fetchError;
5222
+ const transformedData = (data || []).map((item) => ({
5223
+ company_id: entityConfig.companyId || "unknown",
5224
+ line_id: item.line_id,
5225
+ shift_id: queryShiftId,
5226
+ date: queryDate,
5227
+ workspace_uuid: item.workspace_id,
5228
+ workspace_name: item.workspace_name,
5229
+ action_count: item.total_output || 0,
5230
+ pph: item.avg_pph || 0,
5231
+ performance_score: item.performance_score || 0,
5232
+ avg_cycle_time: item.avg_cycle_time || 0,
5233
+ trend: item.trend_score === 1 ? 2 : 0,
5234
+ predicted_output: 0,
5235
+ efficiency: item.efficiency || 0,
5236
+ action_threshold: item.total_day_output || 0
5237
+ }));
5238
+ setWorkspaces(transformedData);
5239
+ setInitialized(true);
5240
+ } catch (err) {
5241
+ console.error("Error fetching all workspace metrics:", err);
5242
+ setError({ message: err.message, code: err.code || "FETCH_ERROR" });
5243
+ } finally {
5244
+ setLoading(false);
5245
+ }
5246
+ }, [queryDate, queryShiftId, metricsTable, supabase, entityConfig.companyId]);
5247
+ useEffect(() => {
5248
+ if (!initialized) {
5249
+ fetchWorkspaceMetrics();
5250
+ }
5251
+ const setupSubscription = () => {
5252
+ const filter2 = `date=eq.${queryDate} AND shift_id=eq.${queryShiftId}`;
5253
+ console.log("Setting up subscription for all workspaces with filter:", filter2);
5254
+ const channel2 = supabase.channel(`all-workspace-metrics-${Date.now()}`).on(
5255
+ "postgres_changes",
5256
+ {
5257
+ event: "*",
5258
+ schema,
5259
+ table: metricsTable,
5260
+ filter: filter2
5261
+ },
5262
+ async (payload) => {
5263
+ console.log("All workspace metrics update received:", payload);
5264
+ await fetchWorkspaceMetrics();
5265
+ }
5266
+ ).subscribe();
5267
+ return channel2;
5268
+ };
5269
+ const channel = setupSubscription();
5270
+ return () => {
5271
+ if (channel) {
5272
+ supabase.removeChannel(channel);
5273
+ }
5274
+ };
5275
+ }, [queryDate, queryShiftId, metricsTable, fetchWorkspaceMetrics, initialized, supabase, schema]);
5276
+ useEffect(() => {
5277
+ setInitialized(false);
5278
+ }, [queryDate, queryShiftId]);
5279
+ const refreshWorkspaces = fetchWorkspaceMetrics;
5280
+ return useMemo(
5281
+ () => ({ workspaces, loading, error, refreshWorkspaces }),
5282
+ [workspaces, loading, error, refreshWorkspaces]
5283
+ );
5284
+ };
5154
5285
  var MAX_RETRIES = 10;
5155
5286
  var RETRY_DELAY = 500;
5156
5287
  function useNavigation(customNavigate) {
@@ -5197,8 +5328,8 @@ function useNavigation(customNavigate) {
5197
5328
  router.push("/shifts");
5198
5329
  }, [router]);
5199
5330
  const goToLeaderboard = useCallback(() => {
5200
- const lineId = entityConfig?.defaultLineId || "line-1";
5201
- router.push(`/leaderboard/${lineId}`);
5331
+ entityConfig?.defaultLineId || "line-1";
5332
+ router.push(`/leaderboard`);
5202
5333
  }, [router, entityConfig?.defaultLineId]);
5203
5334
  const goToFactoryView = useCallback(() => {
5204
5335
  router.push("/factory-view");
@@ -17338,7 +17469,8 @@ var VideoCard = React14__default.memo(({
17338
17469
  cropping,
17339
17470
  canvasFps = 30,
17340
17471
  useRAF = true,
17341
- className = ""
17472
+ className = "",
17473
+ compact = false
17342
17474
  }) => {
17343
17475
  const videoRef = useRef(null);
17344
17476
  const canvasRef = useRef(null);
@@ -17402,15 +17534,15 @@ var VideoCard = React14__default.memo(({
17402
17534
  }
17403
17535
  },
17404
17536
  children: [
17405
- isVeryLowEfficiency && /* @__PURE__ */ jsx("div", { className: "absolute top-1 left-2 z-30", children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
17537
+ isVeryLowEfficiency && /* @__PURE__ */ jsx("div", { className: `absolute ${compact ? "top-0.5 left-1" : "top-1 left-2"} z-30`, children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
17406
17538
  /* @__PURE__ */ jsx("div", { className: "absolute -inset-1 bg-red-400/50 rounded-full blur-sm animate-pulse" }),
17407
17539
  /* @__PURE__ */ jsx("div", { className: "absolute -inset-0.5 bg-red-500/30 rounded-full blur-md animate-ping [animation-duration:1.5s]" }),
17408
- /* @__PURE__ */ jsx("div", { className: "bg-[#E34329] w-5 h-5 rounded-full flex items-center justify-center text-white font-bold text-xs shadow-lg ring-2 ring-red-400/40 border border-red-400/80 animate-pulse", children: "!" })
17540
+ /* @__PURE__ */ jsx("div", { className: `bg-[#E34329] ${compact ? "w-4 h-4" : "w-5 h-5"} rounded-full flex items-center justify-center text-white font-bold ${compact ? "text-[10px]" : "text-xs"} shadow-lg ring-2 ring-red-400/40 border border-red-400/80 animate-pulse`, children: "!" })
17409
17541
  ] }) }),
17410
17542
  /* @__PURE__ */ jsxs("div", { className: "relative w-full h-full overflow-hidden bg-black", children: [
17411
17543
  /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-black z-0", children: /* @__PURE__ */ jsxs("div", { className: "animate-pulse flex flex-col items-center", children: [
17412
- /* @__PURE__ */ jsx(Camera, { className: "w-6 h-6 text-gray-500" }),
17413
- /* @__PURE__ */ jsx("span", { className: "text-xs text-gray-500 mt-1", children: "Loading..." })
17544
+ /* @__PURE__ */ jsx(Camera, { className: `${compact ? "w-4 h-4" : "w-6 h-6"} text-gray-500` }),
17545
+ /* @__PURE__ */ jsx("span", { className: `${compact ? "text-[10px]" : "text-xs"} text-gray-500 mt-1`, children: "Loading..." })
17414
17546
  ] }) }),
17415
17547
  /* @__PURE__ */ jsxs("div", { className: "absolute inset-0 z-10", children: [
17416
17548
  /* @__PURE__ */ jsx(
@@ -17433,11 +17565,11 @@ var VideoCard = React14__default.memo(({
17433
17565
  )
17434
17566
  ] }),
17435
17567
  /* @__PURE__ */ jsx("div", { className: `absolute inset-0 z-20 pointer-events-none ${efficiencyOverlayClass}` }),
17436
- /* @__PURE__ */ jsxs("div", { className: "absolute top-2 right-2 z-30 bg-black/70 backdrop-blur-sm rounded px-2 py-0.5 text-white text-xs font-semibold border border-white/10", children: [
17568
+ /* @__PURE__ */ jsxs("div", { className: `absolute ${compact ? "top-1 right-1" : "top-2 right-2"} z-30 bg-black/70 backdrop-blur-sm rounded ${compact ? "px-1.5 py-0.5" : "px-2 py-0.5"} text-white ${compact ? "text-[10px]" : "text-xs"} font-semibold border border-white/10`, children: [
17437
17569
  Math.round(workspace.efficiency),
17438
17570
  "%"
17439
17571
  ] }),
17440
- /* @__PURE__ */ jsx("div", { className: "absolute bottom-0 left-0 right-0 h-1 bg-black/50 z-30", children: /* @__PURE__ */ jsx(
17572
+ /* @__PURE__ */ jsx("div", { className: `absolute bottom-0 left-0 right-0 ${compact ? "h-0.5" : "h-1"} bg-black/50 z-30`, children: /* @__PURE__ */ jsx(
17441
17573
  "div",
17442
17574
  {
17443
17575
  className: `h-full ${efficiencyBarClass} transition-all duration-500`,
@@ -17445,22 +17577,22 @@ var VideoCard = React14__default.memo(({
17445
17577
  }
17446
17578
  ) })
17447
17579
  ] }),
17448
- /* @__PURE__ */ jsxs("div", { className: "absolute bottom-0 left-0 right-0 bg-black bg-opacity-60 p-1.5 flex justify-between items-center z-10", children: [
17580
+ /* @__PURE__ */ jsxs("div", { className: `absolute bottom-0 left-0 right-0 bg-black bg-opacity-60 ${compact ? "p-1" : "p-1.5"} flex justify-between items-center z-10`, children: [
17449
17581
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
17450
- /* @__PURE__ */ jsx(Camera, { size: 12, className: "text-white" }),
17451
- /* @__PURE__ */ jsx("p", { className: "text-white text-xs font-medium tracking-wide", children: displayName })
17582
+ /* @__PURE__ */ jsx(Camera, { size: compact ? 10 : 12, className: "text-white" }),
17583
+ /* @__PURE__ */ jsx("p", { className: `text-white ${compact ? "text-[10px]" : "text-xs"} font-medium tracking-wide`, children: displayName })
17452
17584
  ] }),
17453
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
17585
+ /* @__PURE__ */ jsxs("div", { className: `flex items-center ${compact ? "gap-1" : "gap-1.5"}`, children: [
17454
17586
  trendInfo && /* @__PURE__ */ jsx(
17455
17587
  "div",
17456
17588
  {
17457
- className: `text-lg ${trendInfo.color}`,
17589
+ className: `${compact ? "text-sm" : "text-lg"} ${trendInfo.color}`,
17458
17590
  style: { lineHeight: 1, display: "flex", alignItems: "center" },
17459
17591
  children: trendInfo.arrow
17460
17592
  }
17461
17593
  ),
17462
- /* @__PURE__ */ jsx("div", { className: "w-1.5 h-1.5 rounded-full bg-green-500" }),
17463
- /* @__PURE__ */ jsx("span", { className: "text-white text-xs", children: "Live" })
17594
+ /* @__PURE__ */ jsx("div", { className: `${compact ? "w-1 h-1" : "w-1.5 h-1.5"} rounded-full bg-green-500` }),
17595
+ /* @__PURE__ */ jsx("span", { className: `text-white ${compact ? "text-[10px]" : "text-xs"}`, children: "Live" })
17464
17596
  ] })
17465
17597
  ] })
17466
17598
  ]
@@ -17552,15 +17684,15 @@ var VideoGridView = React14__default.memo(({
17552
17684
  let bestScore = 0;
17553
17685
  const targetAspectRatio = 16 / 9;
17554
17686
  const gap = 8;
17555
- const maxCols = Math.min(count, 6);
17687
+ const maxCols = Math.min(count, selectedLine ? 6 : 12);
17556
17688
  for (let cols = 1; cols <= maxCols; cols++) {
17557
17689
  const rows = Math.ceil(count / cols);
17558
17690
  const availableWidth = containerWidth - gap * (cols - 1);
17559
17691
  const availableHeight = containerHeight - gap * (rows - 1);
17560
17692
  const cellWidth = availableWidth / cols;
17561
17693
  const cellHeight = availableHeight / rows;
17562
- const minCellWidth = containerWidth < 800 ? 120 : 150;
17563
- const minCellHeight = containerHeight < 600 ? 80 : 100;
17694
+ const minCellWidth = selectedLine ? containerWidth < 800 ? 120 : 150 : containerWidth < 800 ? 80 : 100;
17695
+ const minCellHeight = selectedLine ? containerHeight < 600 ? 80 : 100 : containerHeight < 600 ? 60 : 80;
17564
17696
  if (cellWidth < minCellWidth || cellHeight < minCellHeight) continue;
17565
17697
  const totalUsedArea = cellWidth * cellHeight * count;
17566
17698
  const totalAvailableArea = containerWidth * containerHeight;
@@ -17577,7 +17709,7 @@ var VideoGridView = React14__default.memo(({
17577
17709
  bestCols = Math.ceil(Math.sqrt(count));
17578
17710
  }
17579
17711
  setGridCols(bestCols);
17580
- }, [filteredWorkspaces.length]);
17712
+ }, [filteredWorkspaces.length, selectedLine]);
17581
17713
  useEffect(() => {
17582
17714
  calculateOptimalGrid();
17583
17715
  const handleResize = () => calculateOptimalGrid();
@@ -17668,7 +17800,8 @@ var VideoGridView = React14__default.memo(({
17668
17800
  isVeryLowEfficiency,
17669
17801
  cropping: workspaceCropping,
17670
17802
  canvasFps: canvasConfig?.fps,
17671
- useRAF: canvasConfig?.useRAF
17803
+ useRAF: canvasConfig?.useRAF,
17804
+ compact: !selectedLine
17672
17805
  }
17673
17806
  )
17674
17807
  },
@@ -21630,7 +21763,7 @@ var S3ClipsService = class {
21630
21763
  }
21631
21764
  return summary;
21632
21765
  }
21633
- const limitPerCategory = limit ? Math.min(Math.max(limit, 1), 200) : 30;
21766
+ const limitPerCategory = limit ? Math.min(Math.max(limit, 1), 1e3) : 30;
21634
21767
  const shouldFetchAll = category === "missing_quality_check" || category === "low_value";
21635
21768
  const initialFetchLimit = shouldFetchAll ? void 0 : category ? limitPerCategory * 3 : void 0;
21636
21769
  const s3Uris = await this.listS3Clips({ workspaceId, date, shiftId, maxKeys: initialFetchLimit });
@@ -23472,7 +23605,7 @@ var KPISection = memo(({
23472
23605
  });
23473
23606
  KPISection.displayName = "KPISection";
23474
23607
  var ISTTimer2 = ISTTimer_default;
23475
- var DashboardHeader = memo(({ lineTitle, className = "" }) => {
23608
+ var DashboardHeader = memo(({ lineTitle, className = "", headerControls }) => {
23476
23609
  const getShiftName = () => {
23477
23610
  const now2 = /* @__PURE__ */ new Date();
23478
23611
  const currentHour = now2.getHours();
@@ -23486,30 +23619,33 @@ var DashboardHeader = memo(({ lineTitle, className = "" }) => {
23486
23619
  return /* @__PURE__ */ jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z" }) });
23487
23620
  }
23488
23621
  };
23489
- return /* @__PURE__ */ jsxs("div", { className: `flex flex-col ${className}`, children: [
23490
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 sm:gap-2 md:gap-3", children: [
23491
- /* @__PURE__ */ jsx("h1", { className: "text-base sm:text-xl md:text-2xl lg:text-3xl font-bold text-gray-800 tracking-tight leading-none", children: lineTitle }),
23492
- /* @__PURE__ */ jsx("div", { className: "h-1 w-1 sm:h-1.5 sm:w-1.5 md:h-2 md:w-2 rounded-full bg-green-500 animate-pulse ring-1 sm:ring-2 ring-green-500/30 ring-offset-1" })
23493
- ] }),
23494
- /* @__PURE__ */ jsxs("div", { className: "mt-2 inline-flex items-center gap-3", children: [
23495
- /* @__PURE__ */ jsxs("div", { className: "text-sm font-medium text-gray-600", children: [
23496
- /* @__PURE__ */ jsx(ISTTimer2, {}),
23497
- " IST"
23622
+ return /* @__PURE__ */ jsxs("div", { className: `flex flex-row items-center justify-between w-full ${className}`, children: [
23623
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
23624
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 sm:gap-2 md:gap-3", children: [
23625
+ /* @__PURE__ */ jsx("h1", { className: "text-base sm:text-xl md:text-2xl lg:text-3xl font-bold text-gray-800 tracking-tight leading-none", children: lineTitle }),
23626
+ /* @__PURE__ */ jsx("div", { className: "h-1 w-1 sm:h-1.5 sm:w-1.5 md:h-2 md:w-2 rounded-full bg-green-500 animate-pulse ring-1 sm:ring-2 ring-green-500/30 ring-offset-1" })
23498
23627
  ] }),
23499
- /* @__PURE__ */ jsxs("div", { className: "inline-flex items-center gap-1", children: [
23500
- /* @__PURE__ */ jsx("div", { className: "text-gray-600", children: getShiftIcon() }),
23501
- /* @__PURE__ */ jsxs("span", { className: "text-sm font-medium text-gray-600", children: [
23502
- getShiftName(),
23503
- " Shift"
23628
+ /* @__PURE__ */ jsxs("div", { className: "mt-2 inline-flex items-center gap-3", children: [
23629
+ /* @__PURE__ */ jsxs("div", { className: "text-sm font-medium text-gray-600", children: [
23630
+ /* @__PURE__ */ jsx(ISTTimer2, {}),
23631
+ " IST"
23632
+ ] }),
23633
+ /* @__PURE__ */ jsxs("div", { className: "inline-flex items-center gap-1", children: [
23634
+ /* @__PURE__ */ jsx("div", { className: "text-gray-600", children: getShiftIcon() }),
23635
+ /* @__PURE__ */ jsxs("span", { className: "text-sm font-medium text-gray-600", children: [
23636
+ getShiftName(),
23637
+ " Shift"
23638
+ ] })
23504
23639
  ] })
23505
23640
  ] })
23506
- ] })
23641
+ ] }),
23642
+ headerControls && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-4", children: headerControls })
23507
23643
  ] });
23508
23644
  });
23509
23645
  DashboardHeader.displayName = "DashboardHeader";
23510
- var NoWorkspaceData = memo(({ className = "" }) => /* @__PURE__ */ jsx("div", { className: `flex h-full items-center justify-center ${className}`, children: /* @__PURE__ */ jsx("div", { className: "rounded-lg bg-white p-4 shadow-md", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2 text-gray-500", children: [
23646
+ var NoWorkspaceData = memo(({ message = "No workspace data available", className = "" }) => /* @__PURE__ */ jsx("div", { className: `flex h-full items-center justify-center ${className}`, children: /* @__PURE__ */ jsx("div", { className: "rounded-lg bg-white p-4 shadow-md", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2 text-gray-500", children: [
23511
23647
  /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-5 w-5", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z", clipRule: "evenodd" }) }),
23512
- /* @__PURE__ */ jsx("span", { children: "No workspace data available" })
23648
+ /* @__PURE__ */ jsx("span", { children: message })
23513
23649
  ] }) }) }));
23514
23650
  NoWorkspaceData.displayName = "NoWorkspaceData";
23515
23651
  var WorkspaceMonthlyDataFetcher = ({
@@ -23851,15 +23987,14 @@ var SideNavBar = memo(({
23851
23987
  }
23852
23988
  }
23853
23989
  }), [navigate, lineId]);
23854
- const handleLeaderboardClick = useCallback(() => navigate(`/leaderboard/${lineId}`, {
23990
+ const handleLeaderboardClick = useCallback(() => navigate(`/leaderboard`, {
23855
23991
  trackingEvent: {
23856
23992
  name: "Leaderboard Page Clicked",
23857
23993
  properties: {
23858
- source: "side_nav",
23859
- line_id: lineId
23994
+ source: "side_nav"
23860
23995
  }
23861
23996
  }
23862
- }), [navigate, lineId]);
23997
+ }), [navigate]);
23863
23998
  const handleKPIsClick = useCallback(() => navigate(`/kpis`, {
23864
23999
  trackingEvent: {
23865
24000
  name: "KPI Page Clicked",
@@ -27191,8 +27326,8 @@ var LoadingOverlayCmp = LoadingOverlay_default;
27191
27326
  function HomeView({
27192
27327
  defaultLineId,
27193
27328
  factoryViewId,
27194
- line1Uuid,
27195
- line2Uuid,
27329
+ lineIds: allLineIds = [],
27330
+ // Default to empty array
27196
27331
  lineNames,
27197
27332
  videoSources = {
27198
27333
  workspaceHlsUrls: {},
@@ -27201,6 +27336,7 @@ function HomeView({
27201
27336
  factoryName = "Simba Beer - Line 1"
27202
27337
  }) {
27203
27338
  const [isHydrated, setIsHydrated] = useState(false);
27339
+ const availableLineIds = useMemo(() => [factoryViewId, ...allLineIds], [factoryViewId, allLineIds]);
27204
27340
  const [selectedLineId, setSelectedLineId] = useState(defaultLineId);
27205
27341
  const [isChangingFilter, setIsChangingFilter] = useState(false);
27206
27342
  const [errorMessage, setErrorMessage] = useState(null);
@@ -27282,18 +27418,24 @@ function HomeView({
27282
27418
  setErrorMessage(null);
27283
27419
  }
27284
27420
  }, [metricsError, kpisError]);
27285
- useCallback((e) => {
27421
+ const handleLineChange = useCallback((value) => {
27286
27422
  setIsChangingFilter(true);
27287
- setSelectedLineId(e.target.value);
27423
+ setSelectedLineId(value);
27288
27424
  }, []);
27289
27425
  useEffect(() => {
27290
- if (!metricsLoading && !kpisLoading && isChangingFilter && workspaceMetrics.length > 0) {
27291
- setIsChangingFilter(false);
27426
+ if (!metricsLoading && !kpisLoading && isChangingFilter) {
27427
+ if (workspaceMetrics.length > 0 || selectedLineId === factoryViewId) {
27428
+ setIsChangingFilter(false);
27429
+ }
27292
27430
  }
27293
- }, [metricsLoading, kpisLoading, workspaceMetrics, isChangingFilter]);
27431
+ }, [metricsLoading, kpisLoading, workspaceMetrics, isChangingFilter, selectedLineId, factoryViewId]);
27294
27432
  const lineTitle = useMemo(() => {
27295
27433
  return factoryName;
27296
27434
  }, [factoryName]);
27435
+ const lineSelectorComponent = useMemo(() => /* @__PURE__ */ jsxs(Select, { onValueChange: handleLineChange, defaultValue: selectedLineId, children: [
27436
+ /* @__PURE__ */ jsx(SelectTrigger, { className: "w-full sm:w-[200px] bg-white border border-gray-200 shadow-sm rounded-md h-9 text-sm", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "Select a line" }) }),
27437
+ /* @__PURE__ */ jsx(SelectContent, { className: "z-50 bg-white shadow-lg border border-gray-200 rounded-md", children: availableLineIds.map((id3) => /* @__PURE__ */ jsx(SelectItem, { value: id3, children: lineNames[id3] || (id3 === factoryViewId ? "All Lines" : `Line ${id3.substring(0, 4)}`) }, id3)) })
27438
+ ] }), [availableLineIds, handleLineChange, selectedLineId, lineNames, factoryViewId]);
27297
27439
  const isLoading = !isHydrated || metricsLoading || kpisLoading || isChangingFilter || displayNamesLoading || !displayNamesInitialized;
27298
27440
  if (isLoading) {
27299
27441
  return /* @__PURE__ */ jsx("div", { className: "min-h-screen bg-slate-50", children: /* @__PURE__ */ jsx(LoadingPageCmp, { message: "Loading dashboard..." }) });
@@ -27307,7 +27449,7 @@ function HomeView({
27307
27449
  ] })
27308
27450
  ] }) }) });
27309
27451
  }
27310
- if ((metricsLoading || kpisLoading) && (!workspaceMetrics || workspaceMetrics.length === 0)) {
27452
+ if ((metricsLoading || kpisLoading) && (!workspaceMetrics || workspaceMetrics.length === 0) && selectedLineId !== factoryViewId) {
27311
27453
  return /* @__PURE__ */ jsx("div", { className: "min-h-screen bg-slate-50", children: /* @__PURE__ */ jsx(LoadingPageCmp, { message: "Loading metrics..." }) });
27312
27454
  }
27313
27455
  return /* @__PURE__ */ jsxs(
@@ -27318,28 +27460,36 @@ function HomeView({
27318
27460
  animate: { opacity: 1 },
27319
27461
  children: [
27320
27462
  /* @__PURE__ */ jsx(LoadingOverlayCmp, { isVisible: isChangingFilter, message: "Loading new metrics..." }),
27321
- /* @__PURE__ */ jsxs("main", { className: "flex flex-1 flex-col", children: [
27322
- /* @__PURE__ */ jsx("div", { className: "sticky top-0 z-10 sm:static bg-white shadow-sm border-b border-gray-200/80", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col sm:flex-row sm:items-center sm:justify-between px-3 sm:px-6 lg:px-8 py-1.5 sm:py-2.5", children: [
27323
- /* @__PURE__ */ jsx(DashboardHeader, { lineTitle, className: "mb-1 sm:mb-0" }),
27324
- memoizedKPIs && /* @__PURE__ */ jsx(KPISection2, { kpis: memoizedKPIs, className: "w-full sm:w-auto" })
27325
- ] }) }),
27326
- /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto sm:overflow-hidden", children: memoizedWorkspaceMetrics.length > 0 ? /* @__PURE__ */ jsx("div", { className: "h-full sm:h-full min-h-[calc(100vh-80px)] sm:min-h-0", children: React14__default.createElement(WorkspaceGrid, {
27327
- workspaces: memoizedWorkspaceMetrics,
27328
- lineNames,
27329
- factoryView: factoryViewId,
27330
- line2Uuid,
27331
- videoSources,
27332
- className: "h-full"
27333
- }) }) : /* @__PURE__ */ jsx(NoWorkspaceData, {}) })
27334
- ] }),
27335
- /* @__PURE__ */ jsx(
27336
- BreakNotificationPopup,
27337
- {
27338
- activeBreaks,
27339
- lineNames,
27340
- isVisible: !breaksLoading && !breaksError
27341
- }
27342
- )
27463
+ /* @__PURE__ */ jsxs("div", { className: "relative flex flex-1", children: [
27464
+ /* @__PURE__ */ jsxs("main", { className: "flex flex-1 flex-col", children: [
27465
+ /* @__PURE__ */ jsx("div", { className: "sticky top-0 z-30 sm:static bg-white shadow-sm border-b border-gray-200/80", children: /* @__PURE__ */ jsx("div", { className: "flex flex-col sm:flex-row sm:items-center sm:justify-between px-3 sm:px-6 lg:px-8 py-1.5 sm:py-2.5", children: /* @__PURE__ */ jsx(
27466
+ DashboardHeader,
27467
+ {
27468
+ lineTitle,
27469
+ className: "w-full",
27470
+ headerControls: memoizedKPIs ? /* @__PURE__ */ jsx(KPISection2, { kpis: memoizedKPIs, className: "w-full sm:w-auto" }) : null
27471
+ }
27472
+ ) }) }),
27473
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto sm:overflow-hidden relative", children: [
27474
+ /* @__PURE__ */ jsx("div", { className: "absolute right-3 top-2 sm:right-6 sm:top-3 z-30", children: lineSelectorComponent }),
27475
+ memoizedWorkspaceMetrics.length > 0 ? /* @__PURE__ */ jsx("div", { className: "h-full sm:h-full min-h-[calc(100vh-80px)] sm:min-h-0", children: React14__default.createElement(WorkspaceGrid, {
27476
+ workspaces: memoizedWorkspaceMetrics,
27477
+ lineNames,
27478
+ factoryView: factoryViewId,
27479
+ videoSources,
27480
+ className: "h-full"
27481
+ }) }) : /* @__PURE__ */ jsx(NoWorkspaceData, { message: "No workspace data available. Select another line or check configurations." })
27482
+ ] })
27483
+ ] }),
27484
+ /* @__PURE__ */ jsx(
27485
+ BreakNotificationPopup,
27486
+ {
27487
+ activeBreaks,
27488
+ lineNames,
27489
+ isVisible: !breaksLoading && !breaksError
27490
+ }
27491
+ )
27492
+ ] })
27343
27493
  ]
27344
27494
  }
27345
27495
  );
@@ -27503,7 +27653,7 @@ var BottomSection = memo(({
27503
27653
  "div",
27504
27654
  {
27505
27655
  className: "p-1.5 hover:bg-gray-100 rounded-lg transition-colors cursor-pointer",
27506
- onClick: () => handleNavigate && handleNavigate(`/leaderboard/${lineInfo?.line_id}`),
27656
+ onClick: () => handleNavigate && handleNavigate(`/leaderboard`),
27507
27657
  children: /* @__PURE__ */ jsx(ArrowRightIcon, { className: "w-5 h-5 text-gray-500" })
27508
27658
  }
27509
27659
  )
@@ -28602,7 +28752,7 @@ var LeaderboardDetailView = memo(({
28602
28752
  className = ""
28603
28753
  }) => {
28604
28754
  const navigation = useNavigation();
28605
- const [sortAscending, setSortAscending] = useState(true);
28755
+ const [sortAscending, setSortAscending] = useState(false);
28606
28756
  const handleSortToggle = useCallback(() => {
28607
28757
  setSortAscending(!sortAscending);
28608
28758
  }, [sortAscending]);
@@ -28618,13 +28768,15 @@ var LeaderboardDetailView = memo(({
28618
28768
  error: metricsError,
28619
28769
  refreshMetrics
28620
28770
  } = useRealtimeLineMetrics(realtimeMetricsParams);
28621
- const memoizedLineId = useMemo(() => lineId || "", [lineId]);
28622
28771
  const {
28623
28772
  workspaces,
28624
28773
  loading: workspacesLoading,
28625
28774
  error: workspacesError,
28626
28775
  refreshWorkspaces
28627
- } = useLineWorkspaceMetrics(memoizedLineId);
28776
+ } = useAllWorkspaceMetrics({
28777
+ initialDate: date,
28778
+ initialShiftId: typeof shift === "number" ? shift : typeof shift === "string" ? parseInt(shift) : void 0
28779
+ });
28628
28780
  const getShiftName = useCallback((shiftId) => {
28629
28781
  if (shiftId === void 0) return "Day";
28630
28782
  return shiftId === 0 ? "Day" : "Night";
@@ -28678,7 +28830,7 @@ var LeaderboardDetailView = memo(({
28678
28830
  });
28679
28831
  const displayName = getWorkspaceDisplayName(workspace.workspace_name);
28680
28832
  const navParams = workspace.workspace_uuid ? getWorkspaceNavigationParams(workspace.workspace_uuid, displayName) : "";
28681
- const returnToParam = `&returnTo=${encodeURIComponent(`/leaderboard/${lineId}`)}`;
28833
+ const returnToParam = `&returnTo=${encodeURIComponent(`/leaderboard`)}`;
28682
28834
  if (onWorkspaceClick) {
28683
28835
  onWorkspaceClick(workspace, rank);
28684
28836
  } else {
@@ -32161,4 +32313,4 @@ var S3Service = class {
32161
32313
  }
32162
32314
  };
32163
32315
 
32164
- export { ACTION_NAMES, AIAgentView_default as AIAgentView, AuthCallback, AuthCallbackView_default as AuthCallbackView, AuthProvider, AuthenticatedFactoryView, AuthenticatedHelpView, AuthenticatedHomeView, AuthenticatedTargetsView, BarChart, BaseHistoryCalendar, BottlenecksContent, BreakNotificationPopup, Card2 as Card, CardContent2 as CardContent, CardDescription2 as CardDescription, CardFooter2 as CardFooter, CardHeader2 as CardHeader, CardTitle2 as CardTitle, CycleTimeChart, CycleTimeOverTimeChart, 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, DashboardHeader, DashboardLayout, DashboardOverridesProvider, DashboardProvider, DateDisplay_default as DateDisplay, DateTimeDisplay, DebugAuth, DebugAuthView_default as DebugAuthView, EmptyStateMessage, FactoryView_default as FactoryView, GaugeChart, GridComponentsPlaceholder, Header, HelpView_default as HelpView, HomeView_default as HomeView, HourlyOutputChart2 as HourlyOutputChart, ISTTimer_default as ISTTimer, KPICard, KPIDetailView_default as KPIDetailView, KPIGrid, KPIHeader, KPISection, KPIsOverviewView_default as KPIsOverviewView, LINE_1_UUID, LargeOutputProgressChart, LeaderboardDetailView_default as LeaderboardDetailView, Legend6 as Legend, LineChart, LineHistoryCalendar, LineMonthlyHistory, LineMonthlyPdfGenerator, LinePdfExportButton, LinePdfGenerator, LineWhatsAppShareButton, LiveTimer, LoadingOverlay_default as LoadingOverlay, LoadingPage_default as LoadingPage, LoadingSpinner_default as LoadingSpinner, LoginPage, LoginView_default as LoginView, MainLayout, MetricCard_default as MetricCard, NoWorkspaceData, OptifyeAgentClient, OutputProgressChart, PageHeader, PieChart4 as PieChart, ProfileView_default as ProfileView, RegistryProvider, S3Service, SOPComplianceChart, SSEChatClient, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, ShiftDisplay_default as ShiftDisplay, ShiftsView_default as ShiftsView, SideNavBar, SingleVideoStream_default as SingleVideoStream, Skeleton, SlackAPI, SupabaseProvider, TargetWorkspaceGrid, TargetsView_default as TargetsView, ThreadSidebar, TimeDisplay_default as TimeDisplay, TimePickerDropdown, VideoCard, VideoGridView, VideoPreloader, WORKSPACE_POSITIONS, WhatsAppShareButton, WorkspaceCard, WorkspaceDetailView_default as WorkspaceDetailView, WorkspaceDisplayNameExample, WorkspaceGrid, WorkspaceGridItem, WorkspaceHistoryCalendar, WorkspaceMetricCards, WorkspaceMonthlyDataFetcher, WorkspaceMonthlyPdfGenerator, WorkspacePdfExportButton, WorkspacePdfGenerator, WorkspaceWhatsAppShareButton, actionService, apiUtils, authCoreService, authOTPService, authRateLimitService, checkRateLimit2 as checkRateLimit, clearAllRateLimits2 as clearAllRateLimits, clearRateLimit2 as clearRateLimit, clearS3VideoCache, clearS3VideoFromCache, clearWorkspaceDisplayNamesCache, cn, createStreamProxyHandler, createSupabaseClient, createThrottledReload, dashboardService, deleteThread, forceRefreshWorkspaceDisplayNames, formatDateInZone, formatDateTimeInZone, formatISTDate, formatIdleTime, formatTimeInZone, fromUrlFriendlyName, getAllThreadMessages, getAllWorkspaceDisplayNamesAsync, getAnonClient, getCameraNumber, getCompanyMetricsTableName, getConfigurableShortWorkspaceDisplayName, getConfigurableWorkspaceDisplayName, getCurrentShift, getCurrentTimeInZone, getDashboardHeaderTimeInZone, getDaysDifferenceInZone, getDefaultCameraStreamUrl, getDefaultTabForWorkspace, getManufacturingInsights, getMetricsTablePrefix, getOperationalDate, getS3SignedUrl, getS3VideoSrc, getShortWorkspaceDisplayName, getShortWorkspaceDisplayNameAsync, getStoredWorkspaceMappings, getThreadMessages, getUserThreads, getUserThreadsPaginated, getWorkspaceDisplayName, getWorkspaceDisplayNameAsync, getWorkspaceDisplayNamesMap, getWorkspaceFromUrl, getWorkspaceNavigationParams, identifyCoreUser, initializeCoreMixpanel, isTransitionPeriod, isValidLineInfoPayload, isValidWorkspaceDetailedMetricsPayload, isValidWorkspaceMetricsPayload, isWorkspaceDisplayNamesLoaded, isWorkspaceDisplayNamesLoading, mergeWithDefaultConfig, optifyeAgentClient, preInitializeWorkspaceDisplayNames, preloadS3Video, preloadS3VideoUrl, preloadS3VideosUrl, preloadVideoUrl, preloadVideosUrl, qualityService, realtimeService, refreshWorkspaceDisplayNames, resetCoreMixpanel, s3VideoPreloader, storeWorkspaceMapping, streamProxyConfig, throttledReloadDashboard, toUrlFriendlyName, trackCoreEvent, trackCorePageView, updateThreadTitle, useActiveBreaks, useAnalyticsConfig, useAuth, useAuthConfig, useComponentOverride, useCustomConfig, useDashboardConfig, useDashboardMetrics, useDatabaseConfig, useDateFormatter, useDateTimeConfig, useEndpointsConfig, useEntityConfig, useFactoryOverviewMetrics, useFeatureFlags, useFormatNumber, useHistoricWorkspaceMetrics, useHlsStream, useHlsStreamWithCropping, useHookOverride, useLeaderboardMetrics, useLineDetailedMetrics, useLineKPIs, useLineMetrics, useLineWorkspaceMetrics, useMessages, useMetrics, useNavigation, useOverrides, usePageOverride, useRealtimeLineMetrics, useRegistry, useShiftConfig, useShifts, useSupabase, useSupabaseClient, useTargets, useTheme, useThemeConfig, useThreads, useVideoConfig, useWorkspaceConfig, useWorkspaceDetailedMetrics, useWorkspaceDisplayName, useWorkspaceDisplayNames, useWorkspaceDisplayNamesMap, useWorkspaceMetrics, useWorkspaceNavigation, useWorkspaceOperators, videoPreloader, whatsappService, withAuth, withRegistry, workspaceService };
32316
+ export { ACTION_NAMES, AIAgentView_default as AIAgentView, AuthCallback, AuthCallbackView_default as AuthCallbackView, AuthProvider, AuthenticatedFactoryView, AuthenticatedHelpView, AuthenticatedHomeView, AuthenticatedTargetsView, BarChart, BaseHistoryCalendar, BottlenecksContent, BreakNotificationPopup, Card2 as Card, CardContent2 as CardContent, CardDescription2 as CardDescription, CardFooter2 as CardFooter, CardHeader2 as CardHeader, CardTitle2 as CardTitle, CycleTimeChart, CycleTimeOverTimeChart, 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, DashboardHeader, DashboardLayout, DashboardOverridesProvider, DashboardProvider, DateDisplay_default as DateDisplay, DateTimeDisplay, DebugAuth, DebugAuthView_default as DebugAuthView, EmptyStateMessage, FactoryView_default as FactoryView, GaugeChart, GridComponentsPlaceholder, Header, HelpView_default as HelpView, HomeView_default as HomeView, HourlyOutputChart2 as HourlyOutputChart, ISTTimer_default as ISTTimer, KPICard, KPIDetailView_default as KPIDetailView, KPIGrid, KPIHeader, KPISection, KPIsOverviewView_default as KPIsOverviewView, LINE_1_UUID, LINE_2_UUID, LargeOutputProgressChart, LeaderboardDetailView_default as LeaderboardDetailView, Legend6 as Legend, LineChart, LineHistoryCalendar, LineMonthlyHistory, LineMonthlyPdfGenerator, LinePdfExportButton, LinePdfGenerator, LineWhatsAppShareButton, LiveTimer, LoadingOverlay_default as LoadingOverlay, LoadingPage_default as LoadingPage, LoadingSpinner_default as LoadingSpinner, LoginPage, LoginView_default as LoginView, MainLayout, MetricCard_default as MetricCard, NoWorkspaceData, OptifyeAgentClient, OutputProgressChart, PageHeader, PieChart4 as PieChart, ProfileView_default as ProfileView, RegistryProvider, S3Service, SOPComplianceChart, SSEChatClient, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, ShiftDisplay_default as ShiftDisplay, ShiftsView_default as ShiftsView, SideNavBar, SingleVideoStream_default as SingleVideoStream, Skeleton, SlackAPI, SupabaseProvider, TargetWorkspaceGrid, TargetsView_default as TargetsView, ThreadSidebar, TimeDisplay_default as TimeDisplay, TimePickerDropdown, VideoCard, VideoGridView, VideoPreloader, WORKSPACE_POSITIONS, WhatsAppShareButton, WorkspaceCard, WorkspaceDetailView_default as WorkspaceDetailView, WorkspaceDisplayNameExample, WorkspaceGrid, WorkspaceGridItem, WorkspaceHistoryCalendar, WorkspaceMetricCards, WorkspaceMonthlyDataFetcher, WorkspaceMonthlyPdfGenerator, WorkspacePdfExportButton, WorkspacePdfGenerator, WorkspaceWhatsAppShareButton, actionService, apiUtils, authCoreService, authOTPService, authRateLimitService, checkRateLimit2 as checkRateLimit, clearAllRateLimits2 as clearAllRateLimits, clearRateLimit2 as clearRateLimit, clearS3VideoCache, clearS3VideoFromCache, clearWorkspaceDisplayNamesCache, cn, createStreamProxyHandler, createSupabaseClient, createThrottledReload, dashboardService, deleteThread, forceRefreshWorkspaceDisplayNames, formatDateInZone, formatDateTimeInZone, formatISTDate, formatIdleTime, formatTimeInZone, fromUrlFriendlyName, getAllThreadMessages, getAllWorkspaceDisplayNamesAsync, getAnonClient, getCameraNumber, getCompanyMetricsTableName, getConfigurableShortWorkspaceDisplayName, getConfigurableWorkspaceDisplayName, getCurrentShift, getCurrentTimeInZone, getDashboardHeaderTimeInZone, getDaysDifferenceInZone, getDefaultCameraStreamUrl, getDefaultTabForWorkspace, getManufacturingInsights, getMetricsTablePrefix, getOperationalDate, getS3SignedUrl, getS3VideoSrc, getShortWorkspaceDisplayName, getShortWorkspaceDisplayNameAsync, getStoredWorkspaceMappings, getThreadMessages, getUserThreads, getUserThreadsPaginated, getWorkspaceDisplayName, getWorkspaceDisplayNameAsync, getWorkspaceDisplayNamesMap, getWorkspaceFromUrl, getWorkspaceNavigationParams, identifyCoreUser, initializeCoreMixpanel, isTransitionPeriod, isValidLineInfoPayload, isValidWorkspaceDetailedMetricsPayload, isValidWorkspaceMetricsPayload, isWorkspaceDisplayNamesLoaded, isWorkspaceDisplayNamesLoading, mergeWithDefaultConfig, optifyeAgentClient, preInitializeWorkspaceDisplayNames, preloadS3Video, preloadS3VideoUrl, preloadS3VideosUrl, preloadVideoUrl, preloadVideosUrl, qualityService, realtimeService, refreshWorkspaceDisplayNames, resetCoreMixpanel, s3VideoPreloader, storeWorkspaceMapping, streamProxyConfig, throttledReloadDashboard, toUrlFriendlyName, trackCoreEvent, trackCorePageView, updateThreadTitle, useActiveBreaks, useAllWorkspaceMetrics, useAnalyticsConfig, useAuth, useAuthConfig, useComponentOverride, useCustomConfig, useDashboardConfig, useDashboardMetrics, useDatabaseConfig, useDateFormatter, useDateTimeConfig, useEndpointsConfig, useEntityConfig, useFactoryOverviewMetrics, useFeatureFlags, useFormatNumber, useHistoricWorkspaceMetrics, useHlsStream, useHlsStreamWithCropping, useHookOverride, useLeaderboardMetrics, useLineDetailedMetrics, useLineKPIs, useLineMetrics, useLineWorkspaceMetrics, useMessages, useMetrics, useNavigation, useOverrides, usePageOverride, useRealtimeLineMetrics, useRegistry, useShiftConfig, useShifts, useSupabase, useSupabaseClient, useTargets, useTheme, useThemeConfig, useThreads, useVideoConfig, useWorkspaceConfig, useWorkspaceDetailedMetrics, useWorkspaceDisplayName, useWorkspaceDisplayNames, useWorkspaceDisplayNamesMap, useWorkspaceMetrics, useWorkspaceNavigation, useWorkspaceOperators, videoPreloader, whatsappService, withAuth, withRegistry, workspaceService };