@burdenoff/microfe-adaptercloud 2026.614.1 → 2026.625.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/dist/adaptercloud/components/EmptyState.js +17 -21
  2. package/dist/adaptercloud/components/EmptyState.js.map +1 -1
  3. package/dist/adaptercloud/components/InvestmentCard.js +30 -28
  4. package/dist/adaptercloud/components/InvestmentCard.js.map +1 -1
  5. package/dist/adaptercloud/components/MetricsCard.js +21 -15
  6. package/dist/adaptercloud/components/MetricsCard.js.map +1 -1
  7. package/dist/adaptercloud/components/PageLayout.js +38 -19
  8. package/dist/adaptercloud/components/PageLayout.js.map +1 -1
  9. package/dist/adaptercloud/components/RatingDisplay.js +3 -3
  10. package/dist/adaptercloud/components/RatingDisplay.js.map +1 -1
  11. package/dist/adaptercloud/components/StatusBadge.js +36 -16
  12. package/dist/adaptercloud/components/StatusBadge.js.map +1 -1
  13. package/dist/adaptercloud/pages/HomePage.js +286 -275
  14. package/dist/adaptercloud/pages/HomePage.js.map +1 -1
  15. package/dist/adaptercloud/pages/admin/AdminAnalyticsPage.js +87 -87
  16. package/dist/adaptercloud/pages/admin/AdminAnalyticsPage.js.map +1 -1
  17. package/dist/adaptercloud/pages/admin/AdminDashboard.js +101 -101
  18. package/dist/adaptercloud/pages/admin/AdminDashboard.js.map +1 -1
  19. package/dist/adaptercloud/pages/admin/AdminFinancialPage.js +48 -48
  20. package/dist/adaptercloud/pages/admin/AdminFinancialPage.js.map +1 -1
  21. package/dist/adaptercloud/pages/admin/AdminOrdersPage.js +95 -95
  22. package/dist/adaptercloud/pages/admin/AdminOrdersPage.js.map +1 -1
  23. package/dist/adaptercloud/pages/admin/AdminProfilePage.js +34 -34
  24. package/dist/adaptercloud/pages/admin/AdminProfilePage.js.map +1 -1
  25. package/dist/adaptercloud/pages/admin/AdminSettingsPage.js +40 -40
  26. package/dist/adaptercloud/pages/admin/AdminSettingsPage.js.map +1 -1
  27. package/dist/adaptercloud/pages/admin/CartManagementPage.js +107 -107
  28. package/dist/adaptercloud/pages/admin/CartManagementPage.js.map +1 -1
  29. package/dist/adaptercloud/pages/admin/UserManagementPage.js +98 -98
  30. package/dist/adaptercloud/pages/admin/UserManagementPage.js.map +1 -1
  31. package/dist/adaptercloud/pages/cart-owner/AnalyticsDashboard.js +117 -117
  32. package/dist/adaptercloud/pages/cart-owner/AnalyticsDashboard.js.map +1 -1
  33. package/dist/adaptercloud/pages/cart-owner/BusinessSettingsPage.js +33 -33
  34. package/dist/adaptercloud/pages/cart-owner/BusinessSettingsPage.js.map +1 -1
  35. package/dist/adaptercloud/pages/cart-owner/CartOwnerDashboard.js +112 -109
  36. package/dist/adaptercloud/pages/cart-owner/CartOwnerDashboard.js.map +1 -1
  37. package/dist/adaptercloud/pages/cart-owner/CartOwnerProfilePage.js +115 -115
  38. package/dist/adaptercloud/pages/cart-owner/CartOwnerProfilePage.js.map +1 -1
  39. package/dist/adaptercloud/pages/cart-owner/CartServiceConfigPage.js +85 -85
  40. package/dist/adaptercloud/pages/cart-owner/CartServiceConfigPage.js.map +1 -1
  41. package/dist/adaptercloud/pages/cart-owner/InventoryManagementPage.js +106 -106
  42. package/dist/adaptercloud/pages/cart-owner/InventoryManagementPage.js.map +1 -1
  43. package/dist/adaptercloud/pages/cart-owner/OrderManagementPage.js +88 -88
  44. package/dist/adaptercloud/pages/cart-owner/OrderManagementPage.js.map +1 -1
  45. package/dist/adaptercloud/pages/cart-owner/StaffManagementPage.js +94 -94
  46. package/dist/adaptercloud/pages/cart-owner/StaffManagementPage.js.map +1 -1
  47. package/dist/adaptercloud/pages/common/HelpSupportPage.js +142 -142
  48. package/dist/adaptercloud/pages/common/HelpSupportPage.js.map +1 -1
  49. package/dist/adaptercloud/pages/common/NotificationCenterPage.js +67 -66
  50. package/dist/adaptercloud/pages/common/NotificationCenterPage.js.map +1 -1
  51. package/dist/adaptercloud/pages/common/SettingsPage.js +115 -115
  52. package/dist/adaptercloud/pages/common/SettingsPage.js.map +1 -1
  53. package/dist/adaptercloud/pages/customer/BookingDetailsPage.js +74 -73
  54. package/dist/adaptercloud/pages/customer/BookingDetailsPage.js.map +1 -1
  55. package/dist/adaptercloud/pages/customer/CartDetailPage.js +87 -86
  56. package/dist/adaptercloud/pages/customer/CartDetailPage.js.map +1 -1
  57. package/dist/adaptercloud/pages/customer/CartDiscoveryPage.js +66 -65
  58. package/dist/adaptercloud/pages/customer/CartDiscoveryPage.js.map +1 -1
  59. package/dist/adaptercloud/pages/customer/CheckoutPage.js +80 -80
  60. package/dist/adaptercloud/pages/customer/CheckoutPage.js.map +1 -1
  61. package/dist/adaptercloud/pages/customer/CustomerDashboard.js +88 -88
  62. package/dist/adaptercloud/pages/customer/CustomerDashboard.js.map +1 -1
  63. package/dist/adaptercloud/pages/customer/CustomerProfilePage.js +84 -84
  64. package/dist/adaptercloud/pages/customer/CustomerProfilePage.js.map +1 -1
  65. package/dist/adaptercloud/pages/customer/DirectServiceBookingPage.js +92 -91
  66. package/dist/adaptercloud/pages/customer/DirectServiceBookingPage.js.map +1 -1
  67. package/dist/adaptercloud/pages/customer/FavoritesPage.js +34 -33
  68. package/dist/adaptercloud/pages/customer/FavoritesPage.js.map +1 -1
  69. package/dist/adaptercloud/pages/customer/OrderHistoryPage.js +44 -43
  70. package/dist/adaptercloud/pages/customer/OrderHistoryPage.js.map +1 -1
  71. package/dist/adaptercloud/pages/customer/OrderTrackingPage.js +61 -60
  72. package/dist/adaptercloud/pages/customer/OrderTrackingPage.js.map +1 -1
  73. package/dist/adaptercloud/pages/customer/PaymentMethodsPage.js +58 -57
  74. package/dist/adaptercloud/pages/customer/PaymentMethodsPage.js.map +1 -1
  75. package/dist/adaptercloud/pages/customer/ReviewsPage.js +48 -47
  76. package/dist/adaptercloud/pages/customer/ReviewsPage.js.map +1 -1
  77. package/dist/adaptercloud/pages/customer/SavedAddressesPage.js +46 -45
  78. package/dist/adaptercloud/pages/customer/SavedAddressesPage.js.map +1 -1
  79. package/dist/adaptercloud/pages/investor/InvestmentDetailsPage.js +128 -128
  80. package/dist/adaptercloud/pages/investor/InvestmentDetailsPage.js.map +1 -1
  81. package/dist/adaptercloud/pages/investor/InvestmentOpportunitiesPage.js +88 -87
  82. package/dist/adaptercloud/pages/investor/InvestmentOpportunitiesPage.js.map +1 -1
  83. package/dist/adaptercloud/pages/investor/InvestorAnalyticsPage.js +88 -88
  84. package/dist/adaptercloud/pages/investor/InvestorAnalyticsPage.js.map +1 -1
  85. package/dist/adaptercloud/pages/investor/InvestorDashboard.js +62 -62
  86. package/dist/adaptercloud/pages/investor/InvestorDashboard.js.map +1 -1
  87. package/dist/adaptercloud/pages/investor/InvestorInvestmentsPage.js +39 -38
  88. package/dist/adaptercloud/pages/investor/InvestorInvestmentsPage.js.map +1 -1
  89. package/dist/adaptercloud/pages/investor/InvestorPortfolioPage.js +66 -66
  90. package/dist/adaptercloud/pages/investor/InvestorPortfolioPage.js.map +1 -1
  91. package/dist/adaptercloud/pages/investor/InvestorProfilePage.js +153 -153
  92. package/dist/adaptercloud/pages/investor/InvestorProfilePage.js.map +1 -1
  93. package/dist/adaptercloud/pages/worker/TaskDetailsPage.js +81 -80
  94. package/dist/adaptercloud/pages/worker/TaskDetailsPage.js.map +1 -1
  95. package/dist/adaptercloud/pages/worker/WorkerDashboard.js +106 -106
  96. package/dist/adaptercloud/pages/worker/WorkerDashboard.js.map +1 -1
  97. package/dist/adaptercloud/pages/worker/WorkerOrdersPage.js +73 -72
  98. package/dist/adaptercloud/pages/worker/WorkerOrdersPage.js.map +1 -1
  99. package/dist/adaptercloud/pages/worker/WorkerProfilePage.js +107 -107
  100. package/dist/adaptercloud/pages/worker/WorkerProfilePage.js.map +1 -1
  101. package/dist/adaptercloud/pages/worker/WorkerSchedulePage.js +71 -69
  102. package/dist/adaptercloud/pages/worker/WorkerSchedulePage.js.map +1 -1
  103. package/dist/adaptercloud/utils/cn.js +2 -2
  104. package/dist/node_modules/{.bun/clsx@2.1.1/node_modules/clsx → clsx}/dist/clsx.js +1 -1
  105. package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
  106. package/dist/node_modules/{.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge → tailwind-merge}/dist/bundle-mjs.js +212 -170
  107. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
  108. package/package.json +3 -3
  109. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js.map +0 -1
  110. package/dist/node_modules/.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js.map +0 -1
@@ -172,69 +172,69 @@ var M = [
172
172
  ], N = {
173
173
  order_update: {
174
174
  icon: x,
175
- color: "text-blue-600 dark:text-blue-400",
176
- bg: "bg-blue-500/10",
175
+ color: "text-accent-blue",
176
+ bg: "bg-accent-blue-subtle/10",
177
177
  label: "Order"
178
178
  },
179
179
  payment: {
180
180
  icon: h,
181
- color: "text-green-600 dark:text-green-400",
182
- bg: "bg-green-500/10",
181
+ color: "text-status-success-text",
182
+ bg: "bg-status-success-bg-subtle/10",
183
183
  label: "Payment"
184
184
  },
185
185
  promotion: {
186
186
  icon: v,
187
- color: "text-orange-600 dark:text-orange-400",
188
- bg: "bg-orange-500/10",
187
+ color: "text-accent-orange",
188
+ bg: "bg-accent-orange-subtle/10",
189
189
  label: "Promo"
190
190
  },
191
191
  system: {
192
192
  icon: c,
193
- color: "text-purple-600 dark:text-purple-400",
194
- bg: "bg-purple-500/10",
193
+ color: "text-accent-purple",
194
+ bg: "bg-accent-purple-subtle/10",
195
195
  label: "System"
196
196
  },
197
197
  review: {
198
198
  icon: S,
199
- color: "text-yellow-600 dark:text-yellow-400",
200
- bg: "bg-yellow-500/10",
199
+ color: "text-status-warning-text",
200
+ bg: "bg-status-warning-bg-subtle/10",
201
201
  label: "Review"
202
202
  },
203
203
  staff: {
204
204
  icon: D,
205
- color: "text-indigo-600 dark:text-indigo-400",
206
- bg: "bg-indigo-500/10",
205
+ color: "text-accent-indigo",
206
+ bg: "bg-accent-indigo-subtle/10",
207
207
  label: "Staff"
208
208
  },
209
209
  investment: {
210
210
  icon: w,
211
- color: "text-emerald-600 dark:text-emerald-400",
212
- bg: "bg-emerald-500/10",
211
+ color: "text-status-success-text",
212
+ bg: "bg-status-success-bg-subtle/10",
213
213
  label: "Investment"
214
214
  },
215
215
  alert: {
216
216
  icon: l,
217
- color: "text-red-600 dark:text-red-400",
218
- bg: "bg-red-500/10",
217
+ color: "text-status-error-text",
218
+ bg: "bg-status-error-bg-subtle/10",
219
219
  label: "Alert"
220
220
  },
221
221
  delivery: {
222
222
  icon: T,
223
- color: "text-cyan-600 dark:text-cyan-400",
224
- bg: "bg-cyan-500/10",
223
+ color: "text-accent-cyan",
224
+ bg: "bg-accent-cyan-subtle/10",
225
225
  label: "Delivery"
226
226
  },
227
227
  account: {
228
228
  icon: E,
229
- color: "text-teal-600 dark:text-teal-400",
230
- bg: "bg-teal-500/10",
229
+ color: "text-accent-teal",
230
+ bg: "bg-accent-teal-subtle/10",
231
231
  label: "Account"
232
232
  }
233
233
  }, P = {
234
- urgent: "bg-red-500/20 text-red-600 dark:text-red-400",
235
- high: "bg-orange-500/20 text-orange-600 dark:text-orange-400",
236
- medium: "bg-blue-500/20 text-blue-600 dark:text-blue-400",
237
- low: "bg-muted text-muted-foreground"
234
+ urgent: "bg-status-error-bg-subtle/20 text-status-error-text",
235
+ high: "bg-accent-orange-subtle/20 text-accent-orange",
236
+ medium: "bg-accent-blue-subtle/20 text-accent-blue",
237
+ low: "bg-bg-sunken text-text-secondary"
238
238
  }, F = {
239
239
  urgent: "border-l-red-500",
240
240
  high: "border-l-orange-500",
@@ -371,7 +371,7 @@ function B() {
371
371
  children: [l.length > 0 && /* @__PURE__ */ j("button", {
372
372
  type: "button",
373
373
  onClick: Z,
374
- className: "flex items-center gap-1.5 rounded-lg border border-border px-3 py-2 text-sm font-medium text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",
374
+ className: "flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-secondary hover:text-text-primary hover:bg-accent transition-colors",
375
375
  children: [/* @__PURE__ */ A(C, { className: "h-4 w-4" }), /* @__PURE__ */ A("span", {
376
376
  className: "hidden sm:inline",
377
377
  children: "Clear All"
@@ -379,7 +379,7 @@ function B() {
379
379
  }), B > 0 && /* @__PURE__ */ j("button", {
380
380
  type: "button",
381
381
  onClick: J,
382
- className: "flex items-center gap-1.5 rounded-lg border border-border px-3 py-2 text-sm font-medium text-foreground hover:bg-accent transition-colors",
382
+ className: "flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
383
383
  children: [/* @__PURE__ */ A(p, { className: "h-4 w-4" }), "Mark All Read"]
384
384
  })]
385
385
  }),
@@ -388,52 +388,52 @@ function B() {
388
388
  className: "grid grid-cols-2 gap-3 sm:grid-cols-5 mb-6",
389
389
  children: [
390
390
  /* @__PURE__ */ j("div", {
391
- className: "rounded-lg border border-border bg-card p-3 text-center",
391
+ className: "rounded-lg border border-border-subtle bg-bg-surface p-3 text-center",
392
392
  children: [/* @__PURE__ */ A("p", {
393
- className: "text-2xl font-bold text-foreground",
393
+ className: "text-2xl font-bold text-text-primary",
394
394
  children: l.length
395
395
  }), /* @__PURE__ */ A("p", {
396
- className: "text-xs text-muted-foreground",
396
+ className: "text-xs text-text-secondary",
397
397
  children: "Total"
398
398
  })]
399
399
  }),
400
400
  /* @__PURE__ */ j("div", {
401
- className: "rounded-lg border border-blue-500/30 bg-blue-500/5 p-3 text-center",
401
+ className: "rounded-lg border border-accent-blue-subtle/30 bg-accent-blue-subtle/5 p-3 text-center",
402
402
  children: [/* @__PURE__ */ A("p", {
403
- className: "text-2xl font-bold text-blue-600 dark:text-blue-400",
403
+ className: "text-2xl font-bold text-accent-blue",
404
404
  children: B
405
405
  }), /* @__PURE__ */ A("p", {
406
- className: "text-xs text-muted-foreground",
406
+ className: "text-xs text-text-secondary",
407
407
  children: "Unread"
408
408
  })]
409
409
  }),
410
410
  /* @__PURE__ */ j("div", {
411
- className: "rounded-lg border border-red-500/30 bg-red-500/5 p-3 text-center",
411
+ className: "rounded-lg border border-status-error-border/30 bg-status-error-bg-subtle/5 p-3 text-center",
412
412
  children: [/* @__PURE__ */ A("p", {
413
- className: "text-2xl font-bold text-red-600 dark:text-red-400",
413
+ className: "text-2xl font-bold text-status-error-text",
414
414
  children: V
415
415
  }), /* @__PURE__ */ A("p", {
416
- className: "text-xs text-muted-foreground",
416
+ className: "text-xs text-text-secondary",
417
417
  children: "Urgent"
418
418
  })]
419
419
  }),
420
420
  /* @__PURE__ */ j("div", {
421
- className: "rounded-lg border border-green-500/30 bg-green-500/5 p-3 text-center",
421
+ className: "rounded-lg border border-status-success-border/30 bg-status-success-bg-subtle/5 p-3 text-center",
422
422
  children: [/* @__PURE__ */ A("p", {
423
- className: "text-2xl font-bold text-green-600 dark:text-green-400",
423
+ className: "text-2xl font-bold text-status-success-text",
424
424
  children: H
425
425
  }), /* @__PURE__ */ A("p", {
426
- className: "text-xs text-muted-foreground",
426
+ className: "text-xs text-text-secondary",
427
427
  children: "Today"
428
428
  })]
429
429
  }),
430
430
  /* @__PURE__ */ j("div", {
431
- className: "rounded-lg border border-yellow-500/30 bg-yellow-500/5 p-3 text-center",
431
+ className: "rounded-lg border border-status-warning-border/30 bg-status-warning-bg-subtle/5 p-3 text-center",
432
432
  children: [/* @__PURE__ */ A("p", {
433
- className: "text-2xl font-bold text-yellow-600 dark:text-yellow-400",
433
+ className: "text-2xl font-bold text-status-warning-text",
434
434
  children: U
435
435
  }), /* @__PURE__ */ A("p", {
436
- className: "text-xs text-muted-foreground",
436
+ className: "text-xs text-text-secondary",
437
437
  children: "This Week"
438
438
  })]
439
439
  })
@@ -446,12 +446,12 @@ function B() {
446
446
  return /* @__PURE__ */ j("button", {
447
447
  type: "button",
448
448
  onClick: () => v(e.id),
449
- className: t("flex items-center gap-1.5 whitespace-nowrap rounded-full border px-3 py-1.5 text-sm font-medium transition-colors", g === e.id ? "border-primary bg-primary/10 text-foreground" : "border-border text-muted-foreground hover:text-foreground hover:border-accent-foreground/20"),
449
+ className: t("flex items-center gap-1.5 whitespace-nowrap rounded-full border px-3 py-1.5 text-sm font-medium transition-colors", g === e.id ? "border-primary bg-action-primary-bg/10 text-text-primary" : "border-border-subtle text-text-secondary hover:text-text-primary hover:border-accent-foreground/20"),
450
450
  children: [
451
451
  /* @__PURE__ */ A(n, { className: "h-3.5 w-3.5" }),
452
452
  e.label,
453
453
  /* @__PURE__ */ A("span", {
454
- className: t("inline-flex h-5 min-w-[20px] items-center justify-center rounded-full px-1 text-xs", g === e.id ? "bg-primary text-primary-foreground" : "bg-muted text-muted-foreground"),
454
+ className: t("inline-flex h-5 min-w-[20px] items-center justify-center rounded-full px-1 text-xs", g === e.id ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-sunken text-text-secondary"),
455
455
  children: W[e.id]
456
456
  })
457
457
  ]
@@ -463,18 +463,18 @@ function B() {
463
463
  children: [/* @__PURE__ */ j("div", {
464
464
  className: "relative flex-1",
465
465
  children: [
466
- /* @__PURE__ */ A(b, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
466
+ /* @__PURE__ */ A(b, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }),
467
467
  /* @__PURE__ */ A("input", {
468
468
  type: "text",
469
469
  placeholder: "Search notifications...",
470
470
  value: x,
471
471
  onChange: (e) => S(e.target.value),
472
- className: "w-full rounded-lg border border-border bg-card py-2.5 pl-10 pr-9 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
472
+ className: "w-full rounded-lg border border-border-subtle bg-bg-surface py-2.5 pl-10 pr-9 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
473
473
  }),
474
474
  x && /* @__PURE__ */ A("button", {
475
475
  type: "button",
476
476
  onClick: () => S(""),
477
- className: "absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",
477
+ className: "absolute right-3 top-1/2 -translate-y-1/2 text-text-secondary hover:text-text-primary",
478
478
  children: /* @__PURE__ */ A(O, { className: "h-4 w-4" })
479
479
  })
480
480
  ]
@@ -483,7 +483,7 @@ function B() {
483
483
  children: [/* @__PURE__ */ j("button", {
484
484
  type: "button",
485
485
  onClick: () => D(!E),
486
- className: "flex items-center gap-1.5 rounded-lg border border-border px-3 py-2.5 text-sm font-medium text-foreground hover:bg-accent transition-colors",
486
+ className: "flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-2.5 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
487
487
  children: [/* @__PURE__ */ A(u, { className: "h-4 w-4" }), /* @__PURE__ */ A("span", {
488
488
  className: "hidden sm:inline",
489
489
  children: "Sort"
@@ -492,7 +492,7 @@ function B() {
492
492
  className: "fixed inset-0 z-10",
493
493
  onClick: () => D(!1)
494
494
  }), /* @__PURE__ */ A("div", {
495
- className: "absolute right-0 top-full mt-1 z-20 w-44 rounded-lg border border-border bg-card shadow-lg py-1",
495
+ className: "absolute right-0 top-full mt-1 z-20 w-44 rounded-lg border border-border-subtle bg-bg-surface shadow-lg py-1",
496
496
  children: [
497
497
  {
498
498
  value: "recent",
@@ -511,25 +511,26 @@ function B() {
511
511
  onClick: () => {
512
512
  T(e.value), D(!1);
513
513
  },
514
- className: t("w-full text-left px-3 py-2 text-sm transition-colors", w === e.value ? "bg-primary/10 text-foreground font-medium" : "text-muted-foreground hover:bg-accent hover:text-foreground"),
514
+ className: t("w-full text-left px-3 py-2 text-sm transition-colors", w === e.value ? "bg-action-primary-bg/10 text-text-primary font-medium" : "text-text-secondary hover:bg-accent hover:text-text-primary"),
515
515
  children: e.label
516
516
  }, e.value))
517
517
  })] })]
518
518
  })]
519
519
  }),
520
520
  G.length === 0 ? /* @__PURE__ */ A(r, {
521
+ illustration: "empty-notifications",
521
522
  icon: /* @__PURE__ */ A(d, { className: "h-12 w-12" }),
522
523
  title: "No notifications",
523
524
  description: x ? "No notifications match your search. Try different keywords." : g === "unread" ? "You're all caught up! No unread notifications." : "No notifications in this category yet.",
524
525
  action: x ? /* @__PURE__ */ A("button", {
525
526
  type: "button",
526
527
  onClick: () => S(""),
527
- className: "rounded-lg border border-border px-4 py-2 text-sm font-medium text-foreground hover:bg-accent transition-colors",
528
+ className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
528
529
  children: "Clear Search"
529
530
  }) : g === "all" ? void 0 : /* @__PURE__ */ A("button", {
530
531
  type: "button",
531
532
  onClick: () => v("all"),
532
- className: "rounded-lg border border-border px-4 py-2 text-sm font-medium text-foreground hover:bg-accent transition-colors",
533
+ className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
533
534
  children: "View All Notifications"
534
535
  })
535
536
  }) : /* @__PURE__ */ A("div", {
@@ -538,12 +539,12 @@ function B() {
538
539
  className: "flex items-center gap-3 mb-2",
539
540
  children: [
540
541
  /* @__PURE__ */ A("h3", {
541
- className: "text-xs font-semibold uppercase tracking-wider text-muted-foreground",
542
+ className: "text-xs font-semibold uppercase tracking-wider text-text-secondary",
542
543
  children: e.label
543
544
  }),
544
- /* @__PURE__ */ A("div", { className: "flex-1 border-t border-border" }),
545
+ /* @__PURE__ */ A("div", { className: "flex-1 border-t border-border-subtle" }),
545
546
  /* @__PURE__ */ j("span", {
546
- className: "text-xs text-muted-foreground",
547
+ className: "text-xs text-text-secondary",
547
548
  children: [
548
549
  e.items.length,
549
550
  " notification",
@@ -552,7 +553,7 @@ function B() {
552
553
  })
553
554
  ]
554
555
  }), /* @__PURE__ */ A("div", {
555
- className: "rounded-lg border border-border bg-card divide-y divide-border overflow-hidden",
556
+ className: "rounded-lg border border-border-subtle bg-bg-surface divide-y divide-border overflow-hidden",
556
557
  children: e.items.map((e) => {
557
558
  let n = N[e.type] ?? N.system, r = n.icon;
558
559
  return /* @__PURE__ */ j("div", {
@@ -569,10 +570,10 @@ function B() {
569
570
  className: "flex items-center gap-2 flex-wrap",
570
571
  children: [
571
572
  /* @__PURE__ */ A("h4", {
572
- className: t("text-sm text-foreground", e.isRead ? "font-medium" : "font-semibold"),
573
+ className: t("text-sm text-text-primary", e.isRead ? "font-medium" : "font-semibold"),
573
574
  children: e.title
574
575
  }),
575
- !e.isRead && /* @__PURE__ */ A("span", { className: "h-2 w-2 rounded-full bg-primary shrink-0" }),
576
+ !e.isRead && /* @__PURE__ */ A("span", { className: "h-2 w-2 rounded-full bg-action-primary-bg shrink-0" }),
576
577
  /* @__PURE__ */ A("span", {
577
578
  className: t("inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium", P[e.priority]),
578
579
  children: e.priority
@@ -580,14 +581,14 @@ function B() {
580
581
  ]
581
582
  }),
582
583
  /* @__PURE__ */ A("p", {
583
- className: "mt-1 text-sm text-muted-foreground leading-relaxed",
584
+ className: "mt-1 text-sm text-text-secondary leading-relaxed",
584
585
  children: e.message
585
586
  }),
586
587
  /* @__PURE__ */ j("div", {
587
588
  className: "mt-2 flex items-center gap-3 flex-wrap",
588
589
  children: [
589
590
  /* @__PURE__ */ j("span", {
590
- className: "flex items-center gap-1 text-xs text-muted-foreground",
591
+ className: "flex items-center gap-1 text-xs text-text-secondary",
591
592
  children: [/* @__PURE__ */ A(m, { className: "h-3 w-3" }), i(e.createdAt)]
592
593
  }),
593
594
  /* @__PURE__ */ A("span", {
@@ -595,7 +596,7 @@ function B() {
595
596
  children: n.label
596
597
  }),
597
598
  e.metadata?.orderId && /* @__PURE__ */ j("span", {
598
- className: "text-xs text-muted-foreground",
599
+ className: "text-xs text-text-secondary",
599
600
  children: ["#", e.metadata.orderId]
600
601
  })
601
602
  ]
@@ -606,21 +607,21 @@ function B() {
606
607
  e.actionUrl && /* @__PURE__ */ A("button", {
607
608
  type: "button",
608
609
  onClick: () => X(e),
609
- className: "rounded-lg bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 transition-colors",
610
+ className: "rounded-lg bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors",
610
611
  children: e.actionText ?? "View"
611
612
  }),
612
613
  !e.isRead && /* @__PURE__ */ j("button", {
613
614
  type: "button",
614
615
  onClick: () => q(e.id),
615
616
  title: "Mark as read",
616
- className: "flex items-center gap-1 rounded-lg border border-border px-3 py-1.5 text-xs font-medium text-foreground hover:bg-accent transition-colors",
617
+ className: "flex items-center gap-1 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-accent transition-colors",
617
618
  children: [/* @__PURE__ */ A(f, { className: "h-3 w-3" }), "Mark Read"]
618
619
  }),
619
620
  /* @__PURE__ */ j("button", {
620
621
  type: "button",
621
622
  onClick: () => Y(e.id),
622
623
  title: "Delete notification",
623
- className: "flex items-center gap-1 rounded-lg border border-border px-3 py-1.5 text-xs font-medium text-destructive hover:bg-destructive/10 transition-colors",
624
+ className: "flex items-center gap-1 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-status-error-text hover:bg-status-error-bg/10 transition-colors",
624
625
  children: [/* @__PURE__ */ A(C, { className: "h-3 w-3" }), "Delete"]
625
626
  })
626
627
  ]
@@ -629,7 +630,7 @@ function B() {
629
630
  }),
630
631
  /* @__PURE__ */ A("div", {
631
632
  className: "shrink-0 pt-1",
632
- children: e.isRead ? /* @__PURE__ */ A(_, { className: "h-4 w-4 text-muted-foreground/40" }) : /* @__PURE__ */ A(d, { className: "h-4 w-4 text-primary" })
633
+ children: e.isRead ? /* @__PURE__ */ A(_, { className: "h-4 w-4 text-text-secondary/40" }) : /* @__PURE__ */ A(d, { className: "h-4 w-4 text-primary" })
633
634
  })
634
635
  ]
635
636
  }, e.id);
@@ -637,9 +638,9 @@ function B() {
637
638
  })] }, e.label))
638
639
  }),
639
640
  G.length > 0 && /* @__PURE__ */ j("div", {
640
- className: "mt-6 flex items-center justify-between rounded-lg border border-border bg-card px-4 py-3",
641
+ className: "mt-6 flex items-center justify-between rounded-lg border border-border-subtle bg-bg-surface px-4 py-3",
641
642
  children: [/* @__PURE__ */ j("p", {
642
- className: "text-sm text-muted-foreground",
643
+ className: "text-sm text-text-secondary",
643
644
  children: [
644
645
  "Showing ",
645
646
  G.length,
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationCenterPage.js","names":[],"sources":["../../../../src/adaptercloud/pages/common/NotificationCenterPage.tsx"],"sourcesContent":["/**\n * Notification Center Page\n * @module adaptercloud/pages/common\n *\n * Full-featured notification center with tab filters (All, Orders,\n * Promotions, System, Unread), date grouping (Today, Yesterday, Earlier),\n * mark-as-read / mark-all-as-read, delete notification, search,\n * type/priority badges, action buttons, stats overview, and empty states.\n */\n\nimport { useState, useMemo, useCallback } from 'react';\nimport {\n Bell,\n ShoppingBag,\n TrendingUp,\n Star,\n AlertCircle,\n CheckCircle2,\n CreditCard,\n Users,\n AlertTriangle,\n Megaphone,\n Check,\n CheckCheck,\n Trash2,\n Search,\n X,\n MailOpen,\n Clock,\n Truck,\n UserCheck,\n Inbox,\n RefreshCw,\n SlidersHorizontal,\n ArrowUpDown,\n} from 'lucide-react';\nimport { PageLayout } from '../../components/PageLayout';\nimport { EmptyState } from '../../components/EmptyState';\nimport { useAdapterCloud } from '../../context/AdapterCloudContext';\nimport { cn } from '../../utils/cn';\nimport { formatRelativeTime } from '../../utils/formatters';\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\ntype NotificationType =\n | 'order_update'\n | 'payment'\n | 'promotion'\n | 'system'\n | 'review'\n | 'staff'\n | 'investment'\n | 'alert'\n | 'delivery'\n | 'account';\n\ntype NotificationPriority = 'low' | 'medium' | 'high' | 'urgent';\n\ntype TabId = 'all' | 'orders' | 'promotions' | 'system' | 'unread';\n\ntype SortOption = 'recent' | 'priority' | 'unread';\n\ninterface Notification {\n id: string;\n type: NotificationType;\n title: string;\n message: string;\n priority: NotificationPriority;\n isRead: boolean;\n createdAt: string;\n actionUrl?: string;\n actionText?: string;\n metadata?: {\n orderId?: string;\n cartId?: string;\n amount?: number;\n };\n}\n\n// ---------------------------------------------------------------------------\n// Mock notifications (14 items, rich variety)\n// ---------------------------------------------------------------------------\n\nconst initialNotifications: Notification[] = [\n {\n id: 'n-001',\n type: 'order_update',\n title: 'Order Delivered Successfully!',\n message:\n 'Your order #ORD-001 from Dosa Express has been delivered. Rate your experience to help others!',\n priority: 'medium',\n isRead: false,\n createdAt: new Date(Date.now() - 8 * 60 * 1000).toISOString(),\n actionUrl: '/customer/order/ORD-001',\n actionText: 'Rate Order',\n metadata: { orderId: 'ORD-001', cartId: 'FOOD-001' },\n },\n {\n id: 'n-002',\n type: 'payment',\n title: 'Payment Confirmed',\n message:\n 'Your payment of \\u20B9495 for order #ORD-002 at Quick Cuts Salon has been processed successfully.',\n priority: 'medium',\n isRead: false,\n createdAt: new Date(Date.now() - 35 * 60 * 1000).toISOString(),\n metadata: { orderId: 'ORD-002', amount: 495 },\n },\n {\n id: 'n-003',\n type: 'promotion',\n title: '20% Off Beauty Services This Weekend!',\n message:\n \"Glow Beauty Services is offering 20% off on all treatments this weekend only. Don't miss out!\",\n priority: 'low',\n isRead: false,\n createdAt: new Date(Date.now() - 2 * 60 * 60 * 1000).toISOString(),\n actionUrl: '/customer/cart/SERV-002',\n actionText: 'Book Now',\n metadata: { cartId: 'SERV-002' },\n },\n {\n id: 'n-004',\n type: 'review',\n title: 'New Review Response',\n message:\n 'Dosa Express replied to your review: \"Thank you so much for your kind words! We hope to serve you again soon.\"',\n priority: 'low',\n isRead: false,\n createdAt: new Date(Date.now() - 4 * 60 * 60 * 1000).toISOString(),\n actionUrl: '/customer/reviews',\n actionText: 'View Reply',\n },\n {\n id: 'n-005',\n type: 'system',\n title: 'App Update Available',\n message:\n 'Version 2.4.0 of AdapterCloud is available with improved performance, new category filters, and bug fixes.',\n priority: 'medium',\n isRead: false,\n createdAt: new Date(Date.now() - 7 * 60 * 60 * 1000).toISOString(),\n actionUrl: '/settings',\n actionText: 'Update Now',\n },\n {\n id: 'n-006',\n type: 'order_update',\n title: 'Appointment Confirmed',\n message:\n 'Your appointment at Quick Cuts Salon has been confirmed for tomorrow at 3:00 PM. The stylist Suresh will be serving you.',\n priority: 'medium',\n isRead: true,\n createdAt: new Date(Date.now() - 1 * 24 * 60 * 60 * 1000).toISOString(),\n actionUrl: '/customer/order/ORD-002',\n actionText: 'View Details',\n metadata: { orderId: 'ORD-002' },\n },\n {\n id: 'n-007',\n type: 'investment',\n title: 'Monthly Returns Credited',\n message:\n 'You received \\u20B91,250 in monthly returns from your Quick Cuts Salon investment. Total portfolio value: \\u20B92,12,500.',\n priority: 'medium',\n isRead: true,\n createdAt: new Date(Date.now() - 1 * 24 * 60 * 60 * 1000).toISOString(),\n actionUrl: '/investor/portfolio',\n actionText: 'View Portfolio',\n metadata: { amount: 1250 },\n },\n {\n id: 'n-008',\n type: 'delivery',\n title: 'Delivery Worker Assigned',\n message:\n 'Ravi Kumar (rated 4.8) has been assigned to deliver your order from Biryani Pot. Estimated arrival: 25 minutes.',\n priority: 'high',\n isRead: true,\n createdAt: new Date(Date.now() - 1.5 * 24 * 60 * 60 * 1000).toISOString(),\n metadata: { orderId: 'ORD-003' },\n },\n {\n id: 'n-009',\n type: 'alert',\n title: 'Unusual Login Attempt Detected',\n message:\n 'We detected a login attempt from a new device in Mumbai. If this was not you, please change your password immediately.',\n priority: 'urgent',\n isRead: true,\n createdAt: new Date(Date.now() - 2 * 24 * 60 * 60 * 1000).toISOString(),\n actionUrl: '/settings',\n actionText: 'Review Activity',\n },\n {\n id: 'n-010',\n type: 'promotion',\n title: 'Flash Sale: Mobile Accessories',\n message:\n 'Gadget Zone Brigade is running a flash sale! Up to 30% off on bluetooth headphones, cases, and chargers.',\n priority: 'low',\n isRead: true,\n createdAt: new Date(Date.now() - 3 * 24 * 60 * 60 * 1000).toISOString(),\n actionUrl: '/customer/cart/RETAIL-003',\n actionText: 'Shop Now',\n metadata: { cartId: 'RETAIL-003' },\n },\n {\n id: 'n-011',\n type: 'system',\n title: 'Scheduled Platform Maintenance',\n message:\n 'Platform maintenance is scheduled for Sunday 2:00 AM - 4:00 AM IST. Some services may be briefly unavailable during this window.',\n priority: 'high',\n isRead: true,\n createdAt: new Date(Date.now() - 4 * 24 * 60 * 60 * 1000).toISOString(),\n },\n {\n id: 'n-012',\n type: 'account',\n title: 'KYC Verification Complete',\n message:\n 'Your KYC verification has been completed successfully. You now have full access to all platform features including investments.',\n priority: 'medium',\n isRead: true,\n createdAt: new Date(Date.now() - 5 * 24 * 60 * 60 * 1000).toISOString(),\n },\n {\n id: 'n-013',\n type: 'staff',\n title: 'Staff Schedule Updated',\n message:\n 'Priya Sharma has updated her availability for this week. She will be unavailable on Wednesday and Thursday.',\n priority: 'medium',\n isRead: true,\n createdAt: new Date(Date.now() - 6 * 24 * 60 * 60 * 1000).toISOString(),\n actionUrl: '/owner/staff',\n actionText: 'View Schedule',\n },\n {\n id: 'n-014',\n type: 'payment',\n title: 'Refund Processed',\n message:\n 'Your refund of \\u20B9280 for order #ORD-005 has been processed. The amount will reflect in your account within 3-5 business days.',\n priority: 'medium',\n isRead: true,\n createdAt: new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString(),\n metadata: { orderId: 'ORD-005', amount: 280 },\n },\n];\n\n// ---------------------------------------------------------------------------\n// Type icon/color configuration\n// ---------------------------------------------------------------------------\n\nconst typeConfig: Record<string, { icon: typeof Bell; color: string; bg: string; label: string }> =\n {\n order_update: {\n icon: ShoppingBag,\n color: 'text-blue-600 dark:text-blue-400',\n bg: 'bg-blue-500/10',\n label: 'Order',\n },\n payment: {\n icon: CreditCard,\n color: 'text-green-600 dark:text-green-400',\n bg: 'bg-green-500/10',\n label: 'Payment',\n },\n promotion: {\n icon: Megaphone,\n color: 'text-orange-600 dark:text-orange-400',\n bg: 'bg-orange-500/10',\n label: 'Promo',\n },\n system: {\n icon: AlertCircle,\n color: 'text-purple-600 dark:text-purple-400',\n bg: 'bg-purple-500/10',\n label: 'System',\n },\n review: {\n icon: Star,\n color: 'text-yellow-600 dark:text-yellow-400',\n bg: 'bg-yellow-500/10',\n label: 'Review',\n },\n staff: {\n icon: Users,\n color: 'text-indigo-600 dark:text-indigo-400',\n bg: 'bg-indigo-500/10',\n label: 'Staff',\n },\n investment: {\n icon: TrendingUp,\n color: 'text-emerald-600 dark:text-emerald-400',\n bg: 'bg-emerald-500/10',\n label: 'Investment',\n },\n alert: {\n icon: AlertTriangle,\n color: 'text-red-600 dark:text-red-400',\n bg: 'bg-red-500/10',\n label: 'Alert',\n },\n delivery: {\n icon: Truck,\n color: 'text-cyan-600 dark:text-cyan-400',\n bg: 'bg-cyan-500/10',\n label: 'Delivery',\n },\n account: {\n icon: UserCheck,\n color: 'text-teal-600 dark:text-teal-400',\n bg: 'bg-teal-500/10',\n label: 'Account',\n },\n };\n\n// ---------------------------------------------------------------------------\n// Priority styling\n// ---------------------------------------------------------------------------\n\nconst priorityStyles: Record<NotificationPriority, string> = {\n urgent: 'bg-red-500/20 text-red-600 dark:text-red-400',\n high: 'bg-orange-500/20 text-orange-600 dark:text-orange-400',\n medium: 'bg-blue-500/20 text-blue-600 dark:text-blue-400',\n low: 'bg-muted text-muted-foreground',\n};\n\nconst priorityBorderColors: Record<NotificationPriority, string> = {\n urgent: 'border-l-red-500',\n high: 'border-l-orange-500',\n medium: 'border-l-blue-500',\n low: 'border-l-border',\n};\n\nconst priorityOrder: Record<NotificationPriority, number> = {\n urgent: 4,\n high: 3,\n medium: 2,\n low: 1,\n};\n\n// ---------------------------------------------------------------------------\n// Tab definitions\n// ---------------------------------------------------------------------------\n\nconst tabs: { id: TabId; label: string; icon: typeof Bell }[] = [\n { id: 'all', label: 'All', icon: Inbox },\n { id: 'orders', label: 'Orders', icon: ShoppingBag },\n { id: 'promotions', label: 'Promotions', icon: Megaphone },\n { id: 'system', label: 'System', icon: AlertCircle },\n { id: 'unread', label: 'Unread', icon: Bell },\n];\n\n// ---------------------------------------------------------------------------\n// Date grouping helpers\n// ---------------------------------------------------------------------------\n\nfunction getDateGroup(dateStr: string): string {\n const date = new Date(dateStr);\n const now = new Date();\n const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());\n const yesterday = new Date(today.getTime() - 24 * 60 * 60 * 1000);\n\n if (date >= today) return 'Today';\n if (date >= yesterday) return 'Yesterday';\n return 'Earlier';\n}\n\nfunction groupByDate(items: Notification[]): { label: string; items: Notification[] }[] {\n const groups: { label: string; items: Notification[] }[] = [];\n const map = new Map<string, Notification[]>();\n const order = ['Today', 'Yesterday', 'Earlier'];\n\n for (const n of items) {\n const group = getDateGroup(n.createdAt);\n if (!map.has(group)) map.set(group, []);\n map.get(group)!.push(n);\n }\n\n for (const label of order) {\n const items = map.get(label);\n if (items && items.length > 0) {\n groups.push({ label, items });\n }\n }\n\n return groups;\n}\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\nexport function NotificationCenterPage() {\n const { navigateTo } = useAdapterCloud();\n const [notifications, setNotifications] = useState<Notification[]>(initialNotifications);\n const [activeTab, setActiveTab] = useState<TabId>('all');\n const [searchQuery, setSearchQuery] = useState('');\n const [sortBy, setSortBy] = useState<SortOption>('recent');\n const [showSortMenu, setShowSortMenu] = useState(false);\n\n // ---------------------------------------------------------------------------\n // Derived counts\n // ---------------------------------------------------------------------------\n\n const unreadCount = useMemo(() => notifications.filter((n) => !n.isRead).length, [notifications]);\n\n const urgentCount = useMemo(\n () => notifications.filter((n) => n.priority === 'urgent').length,\n [notifications]\n );\n\n const todayCount = useMemo(\n () => notifications.filter((n) => getDateGroup(n.createdAt) === 'Today').length,\n [notifications]\n );\n\n const thisWeekCount = useMemo(() => {\n const weekAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000);\n return notifications.filter((n) => new Date(n.createdAt) >= weekAgo).length;\n }, [notifications]);\n\n const tabCounts = useMemo(() => {\n const counts: Record<TabId, number> = {\n all: 0,\n orders: 0,\n promotions: 0,\n system: 0,\n unread: 0,\n };\n for (const n of notifications) {\n counts.all++;\n if (!n.isRead) counts.unread++;\n if (n.type === 'order_update' || n.type === 'delivery') counts.orders++;\n if (n.type === 'promotion') counts.promotions++;\n if (n.type === 'system' || n.type === 'alert' || n.type === 'account') counts.system++;\n }\n return counts;\n }, [notifications]);\n\n // ---------------------------------------------------------------------------\n // Filtered & sorted list\n // ---------------------------------------------------------------------------\n\n const filteredNotifications = useMemo(() => {\n let list = [...notifications];\n\n // Tab filter\n switch (activeTab) {\n case 'orders':\n list = list.filter((n) => n.type === 'order_update' || n.type === 'delivery');\n break;\n case 'promotions':\n list = list.filter((n) => n.type === 'promotion');\n break;\n case 'system':\n list = list.filter(\n (n) => n.type === 'system' || n.type === 'alert' || n.type === 'account'\n );\n break;\n case 'unread':\n list = list.filter((n) => !n.isRead);\n break;\n }\n\n // Search filter\n if (searchQuery) {\n const q = searchQuery.toLowerCase();\n list = list.filter(\n (n) => n.title.toLowerCase().includes(q) || n.message.toLowerCase().includes(q)\n );\n }\n\n // Sort\n switch (sortBy) {\n case 'recent':\n list.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());\n break;\n case 'priority':\n list.sort((a, b) => priorityOrder[b.priority] - priorityOrder[a.priority]);\n break;\n case 'unread':\n list.sort((a, b) => (a.isRead === b.isRead ? 0 : a.isRead ? 1 : -1));\n break;\n }\n\n return list;\n }, [notifications, activeTab, searchQuery, sortBy]);\n\n // Grouped by date\n const grouped = useMemo(() => groupByDate(filteredNotifications), [filteredNotifications]);\n\n // ---------------------------------------------------------------------------\n // Actions\n // ---------------------------------------------------------------------------\n\n const markAsRead = useCallback((id: string) => {\n setNotifications((prev) => prev.map((n) => (n.id === id ? { ...n, isRead: true } : n)));\n }, []);\n\n const markAllAsRead = useCallback(() => {\n setNotifications((prev) => prev.map((n) => ({ ...n, isRead: true })));\n }, []);\n\n const deleteNotification = useCallback((id: string) => {\n setNotifications((prev) => prev.filter((n) => n.id !== id));\n }, []);\n\n const handleAction = useCallback(\n (notif: Notification) => {\n if (!notif.isRead) markAsRead(notif.id);\n if (notif.actionUrl) navigateTo(notif.actionUrl);\n },\n [markAsRead, navigateTo]\n );\n\n const clearAll = useCallback(() => {\n if (window.confirm('Are you sure you want to clear all notifications?')) {\n setNotifications([]);\n }\n }, []);\n\n // ---------------------------------------------------------------------------\n // Render\n // ---------------------------------------------------------------------------\n\n return (\n <PageLayout\n title=\"Notifications\"\n description={\n unreadCount > 0\n ? `${unreadCount} unread notification${unreadCount !== 1 ? 's' : ''}`\n : 'All caught up!'\n }\n actions={\n <div className=\"flex items-center gap-2\">\n {notifications.length > 0 && (\n <button\n type=\"button\"\n onClick={clearAll}\n className=\"flex items-center gap-1.5 rounded-lg border border-border px-3 py-2 text-sm font-medium text-muted-foreground hover:text-foreground hover:bg-accent transition-colors\"\n >\n <Trash2 className=\"h-4 w-4\" />\n <span className=\"hidden sm:inline\">Clear All</span>\n </button>\n )}\n {unreadCount > 0 && (\n <button\n type=\"button\"\n onClick={markAllAsRead}\n className=\"flex items-center gap-1.5 rounded-lg border border-border px-3 py-2 text-sm font-medium text-foreground hover:bg-accent transition-colors\"\n >\n <CheckCheck className=\"h-4 w-4\" />\n Mark All Read\n </button>\n )}\n </div>\n }\n >\n {/* ---- Stats Overview ---- */}\n <div className=\"grid grid-cols-2 gap-3 sm:grid-cols-5 mb-6\">\n <div className=\"rounded-lg border border-border bg-card p-3 text-center\">\n <p className=\"text-2xl font-bold text-foreground\">{notifications.length}</p>\n <p className=\"text-xs text-muted-foreground\">Total</p>\n </div>\n <div className=\"rounded-lg border border-blue-500/30 bg-blue-500/5 p-3 text-center\">\n <p className=\"text-2xl font-bold text-blue-600 dark:text-blue-400\">{unreadCount}</p>\n <p className=\"text-xs text-muted-foreground\">Unread</p>\n </div>\n <div className=\"rounded-lg border border-red-500/30 bg-red-500/5 p-3 text-center\">\n <p className=\"text-2xl font-bold text-red-600 dark:text-red-400\">{urgentCount}</p>\n <p className=\"text-xs text-muted-foreground\">Urgent</p>\n </div>\n <div className=\"rounded-lg border border-green-500/30 bg-green-500/5 p-3 text-center\">\n <p className=\"text-2xl font-bold text-green-600 dark:text-green-400\">{todayCount}</p>\n <p className=\"text-xs text-muted-foreground\">Today</p>\n </div>\n <div className=\"rounded-lg border border-yellow-500/30 bg-yellow-500/5 p-3 text-center\">\n <p className=\"text-2xl font-bold text-yellow-600 dark:text-yellow-400\">{thisWeekCount}</p>\n <p className=\"text-xs text-muted-foreground\">This Week</p>\n </div>\n </div>\n\n {/* ---- Tabs ---- */}\n <div className=\"flex items-center gap-2 mb-4 overflow-x-auto pb-1\">\n {tabs.map((tab) => {\n const TabIcon = tab.icon;\n return (\n <button\n key={tab.id}\n type=\"button\"\n onClick={() => setActiveTab(tab.id)}\n className={cn(\n 'flex items-center gap-1.5 whitespace-nowrap rounded-full border px-3 py-1.5 text-sm font-medium transition-colors',\n activeTab === tab.id\n ? 'border-primary bg-primary/10 text-foreground'\n : 'border-border text-muted-foreground hover:text-foreground hover:border-accent-foreground/20'\n )}\n >\n <TabIcon className=\"h-3.5 w-3.5\" />\n {tab.label}\n <span\n className={cn(\n 'inline-flex h-5 min-w-[20px] items-center justify-center rounded-full px-1 text-xs',\n activeTab === tab.id\n ? 'bg-primary text-primary-foreground'\n : 'bg-muted text-muted-foreground'\n )}\n >\n {tabCounts[tab.id]}\n </span>\n </button>\n );\n })}\n </div>\n\n {/* ---- Search & Sort ---- */}\n <div className=\"flex items-center gap-3 mb-6\">\n <div className=\"relative flex-1\">\n <Search className=\"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground\" />\n <input\n type=\"text\"\n placeholder=\"Search notifications...\"\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n className=\"w-full rounded-lg border border-border bg-card py-2.5 pl-10 pr-9 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring\"\n />\n {searchQuery && (\n <button\n type=\"button\"\n onClick={() => setSearchQuery('')}\n className=\"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n )}\n </div>\n\n {/* Sort dropdown */}\n <div className=\"relative\">\n <button\n type=\"button\"\n onClick={() => setShowSortMenu(!showSortMenu)}\n className=\"flex items-center gap-1.5 rounded-lg border border-border px-3 py-2.5 text-sm font-medium text-foreground hover:bg-accent transition-colors\"\n >\n <ArrowUpDown className=\"h-4 w-4\" />\n <span className=\"hidden sm:inline\">Sort</span>\n </button>\n {showSortMenu && (\n <>\n {/* Backdrop */}\n <div className=\"fixed inset-0 z-10\" onClick={() => setShowSortMenu(false)} />\n <div className=\"absolute right-0 top-full mt-1 z-20 w-44 rounded-lg border border-border bg-card shadow-lg py-1\">\n {(\n [\n { value: 'recent', label: 'Most Recent' },\n { value: 'priority', label: 'By Priority' },\n { value: 'unread', label: 'Unread First' },\n ] as const\n ).map((opt) => (\n <button\n key={opt.value}\n type=\"button\"\n onClick={() => {\n setSortBy(opt.value);\n setShowSortMenu(false);\n }}\n className={cn(\n 'w-full text-left px-3 py-2 text-sm transition-colors',\n sortBy === opt.value\n ? 'bg-primary/10 text-foreground font-medium'\n : 'text-muted-foreground hover:bg-accent hover:text-foreground'\n )}\n >\n {opt.label}\n </button>\n ))}\n </div>\n </>\n )}\n </div>\n </div>\n\n {/* ---- Notification List ---- */}\n {filteredNotifications.length === 0 ? (\n <EmptyState\n icon={<Bell className=\"h-12 w-12\" />}\n title=\"No notifications\"\n description={\n searchQuery\n ? 'No notifications match your search. Try different keywords.'\n : activeTab === 'unread'\n ? \"You're all caught up! No unread notifications.\"\n : 'No notifications in this category yet.'\n }\n action={\n searchQuery ? (\n <button\n type=\"button\"\n onClick={() => setSearchQuery('')}\n className=\"rounded-lg border border-border px-4 py-2 text-sm font-medium text-foreground hover:bg-accent transition-colors\"\n >\n Clear Search\n </button>\n ) : activeTab !== 'all' ? (\n <button\n type=\"button\"\n onClick={() => setActiveTab('all')}\n className=\"rounded-lg border border-border px-4 py-2 text-sm font-medium text-foreground hover:bg-accent transition-colors\"\n >\n View All Notifications\n </button>\n ) : undefined\n }\n />\n ) : (\n <div className=\"space-y-6\">\n {grouped.map((group) => (\n <div key={group.label}>\n {/* Date group header */}\n <div className=\"flex items-center gap-3 mb-2\">\n <h3 className=\"text-xs font-semibold uppercase tracking-wider text-muted-foreground\">\n {group.label}\n </h3>\n <div className=\"flex-1 border-t border-border\" />\n <span className=\"text-xs text-muted-foreground\">\n {group.items.length} notification{group.items.length !== 1 ? 's' : ''}\n </span>\n </div>\n\n {/* Notification cards */}\n <div className=\"rounded-lg border border-border bg-card divide-y divide-border overflow-hidden\">\n {group.items.map((notif) => {\n const config = typeConfig[notif.type] ?? typeConfig.system;\n const NotifIcon = config.icon;\n\n return (\n <div\n key={notif.id}\n className={cn(\n 'flex items-start gap-3 px-4 py-4 border-l-4 transition-colors',\n priorityBorderColors[notif.priority],\n !notif.isRead && 'bg-accent/30'\n )}\n >\n {/* Type icon */}\n <div\n className={cn(\n 'flex h-10 w-10 shrink-0 items-center justify-center rounded-full',\n config.bg\n )}\n >\n <NotifIcon className={cn('h-5 w-5', config.color)} />\n </div>\n\n {/* Content */}\n <div className=\"flex-1 min-w-0\">\n {/* Title row */}\n <div className=\"flex items-center gap-2 flex-wrap\">\n <h4\n className={cn(\n 'text-sm text-foreground',\n !notif.isRead ? 'font-semibold' : 'font-medium'\n )}\n >\n {notif.title}\n </h4>\n {!notif.isRead && (\n <span className=\"h-2 w-2 rounded-full bg-primary shrink-0\" />\n )}\n <span\n className={cn(\n 'inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium',\n priorityStyles[notif.priority]\n )}\n >\n {notif.priority}\n </span>\n </div>\n\n {/* Message */}\n <p className=\"mt-1 text-sm text-muted-foreground leading-relaxed\">\n {notif.message}\n </p>\n\n {/* Metadata row */}\n <div className=\"mt-2 flex items-center gap-3 flex-wrap\">\n <span className=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Clock className=\"h-3 w-3\" />\n {formatRelativeTime(notif.createdAt)}\n </span>\n <span\n className={cn(\n 'inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium',\n config.bg,\n config.color\n )}\n >\n {config.label}\n </span>\n {notif.metadata?.orderId && (\n <span className=\"text-xs text-muted-foreground\">\n #{notif.metadata.orderId}\n </span>\n )}\n </div>\n\n {/* Action buttons row */}\n <div className=\"mt-3 flex items-center gap-2 flex-wrap\">\n {notif.actionUrl && (\n <button\n type=\"button\"\n onClick={() => handleAction(notif)}\n className=\"rounded-lg bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 transition-colors\"\n >\n {notif.actionText ?? 'View'}\n </button>\n )}\n {!notif.isRead && (\n <button\n type=\"button\"\n onClick={() => markAsRead(notif.id)}\n title=\"Mark as read\"\n className=\"flex items-center gap-1 rounded-lg border border-border px-3 py-1.5 text-xs font-medium text-foreground hover:bg-accent transition-colors\"\n >\n <Check className=\"h-3 w-3\" />\n Mark Read\n </button>\n )}\n <button\n type=\"button\"\n onClick={() => deleteNotification(notif.id)}\n title=\"Delete notification\"\n className=\"flex items-center gap-1 rounded-lg border border-border px-3 py-1.5 text-xs font-medium text-destructive hover:bg-destructive/10 transition-colors\"\n >\n <Trash2 className=\"h-3 w-3\" />\n Delete\n </button>\n </div>\n </div>\n\n {/* Read/unread indicator */}\n <div className=\"shrink-0 pt-1\">\n {notif.isRead ? (\n <MailOpen className=\"h-4 w-4 text-muted-foreground/40\" />\n ) : (\n <Bell className=\"h-4 w-4 text-primary\" />\n )}\n </div>\n </div>\n );\n })}\n </div>\n </div>\n ))}\n </div>\n )}\n\n {/* ---- Footer summary ---- */}\n {filteredNotifications.length > 0 && (\n <div className=\"mt-6 flex items-center justify-between rounded-lg border border-border bg-card px-4 py-3\">\n <p className=\"text-sm text-muted-foreground\">\n Showing {filteredNotifications.length} of {notifications.length} notifications\n </p>\n {activeTab !== 'all' && (\n <button\n type=\"button\"\n onClick={() => {\n setActiveTab('all');\n setSearchQuery('');\n }}\n className=\"flex items-center gap-1.5 text-sm font-medium text-primary hover:underline\"\n >\n <RefreshCw className=\"h-3.5 w-3.5\" />\n Show All\n </button>\n )}\n </div>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;AAqFA,IAAM,IAAuC;CAC3C;EACE,IAAI;EACJ,MAAM;EACN,OAAO;EACP,SACE;EACF,UAAU;EACV,QAAQ;EACR,4BAAW,IAAI,KAAK,KAAK,KAAK,GAAG,MAAS,IAAK,EAAC,aAAa;EAC7D,WAAW;EACX,YAAY;EACZ,UAAU;GAAE,SAAS;GAAW,QAAQ;GAAY;EACrD;CACD;EACE,IAAI;EACJ,MAAM;EACN,OAAO;EACP,SACE;EACF,UAAU;EACV,QAAQ;EACR,4BAAW,IAAI,KAAK,KAAK,KAAK,GAAG,OAAU,IAAK,EAAC,aAAa;EAC9D,UAAU;GAAE,SAAS;GAAW,QAAQ;GAAK;EAC9C;CACD;EACE,IAAI;EACJ,MAAM;EACN,OAAO;EACP,SACE;EACF,UAAU;EACV,QAAQ;EACR,4BAAW,IAAI,KAAK,KAAK,KAAK,GAAG,OAAc,IAAK,EAAC,aAAa;EAClE,WAAW;EACX,YAAY;EACZ,UAAU,EAAE,QAAQ,YAAY;EACjC;CACD;EACE,IAAI;EACJ,MAAM;EACN,OAAO;EACP,SACE;EACF,UAAU;EACV,QAAQ;EACR,4BAAW,IAAI,KAAK,KAAK,KAAK,GAAG,QAAc,IAAK,EAAC,aAAa;EAClE,WAAW;EACX,YAAY;EACb;CACD;EACE,IAAI;EACJ,MAAM;EACN,OAAO;EACP,SACE;EACF,UAAU;EACV,QAAQ;EACR,4BAAW,IAAI,KAAK,KAAK,KAAK,GAAG,MAAS,KAAK,IAAK,EAAC,aAAa;EAClE,WAAW;EACX,YAAY;EACb;CACD;EACE,IAAI;EACJ,MAAM;EACN,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,kBAAC,GAAD,EAAU,WAAU,oCAAqC,CAAA,GAEzD,kBAAC,GAAD,EAAM,WAAU,wBAAyB,CAAA;SAEvC,CAAA;QACF;SA/GC,EAAM,GA+GP;OAER;KACE,CAAA,CACF,EAAA,EAvII,EAAM,MAuIV,CACN;IACE,CAAA;GAIP,EAAsB,SAAS,KAC9B,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,KAAD;KAAG,WAAU;eAAb;MAA6C;MAClC,EAAsB;MAAO;MAAK,EAAc;MAAO;MAC9D;QACH,MAAc,SACb,kBAAC,UAAD;KACE,MAAK;KACL,eAAe;AAEb,MADA,EAAa,MAAM,EACnB,EAAe,GAAG;;KAEpB,WAAU;eANZ,CAQE,kBAAC,GAAD,EAAW,WAAU,eAAgB,CAAA,EAAA,WAE9B;OAEP;;GAEG"}
1
+ {"version":3,"file":"NotificationCenterPage.js","names":[],"sources":["../../../../src/adaptercloud/pages/common/NotificationCenterPage.tsx"],"sourcesContent":["/**\n * Notification Center Page\n * @module adaptercloud/pages/common\n *\n * Full-featured notification center with tab filters (All, Orders,\n * Promotions, System, Unread), date grouping (Today, Yesterday, Earlier),\n * mark-as-read / mark-all-as-read, delete notification, search,\n * type/priority badges, action buttons, stats overview, and empty states.\n */\n\nimport { useState, useMemo, useCallback } from'react';\nimport {\n Bell,\n ShoppingBag,\n TrendingUp,\n Star,\n AlertCircle,\n CheckCircle2,\n CreditCard,\n Users,\n AlertTriangle,\n Megaphone,\n Check,\n CheckCheck,\n Trash2,\n Search,\n X,\n MailOpen,\n Clock,\n Truck,\n UserCheck,\n Inbox,\n RefreshCw,\n SlidersHorizontal,\n ArrowUpDown,\n} from'lucide-react';\nimport { PageLayout } from'../../components/PageLayout';\nimport { EmptyState } from'../../components/EmptyState';\nimport { useAdapterCloud } from'../../context/AdapterCloudContext';\nimport { cn } from'../../utils/cn';\nimport { formatRelativeTime } from'../../utils/formatters';\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\ntype NotificationType =\n | 'order_update'\n | 'payment'\n | 'promotion'\n | 'system'\n | 'review'\n | 'staff'\n | 'investment'\n | 'alert'\n | 'delivery'\n | 'account';\n\ntype NotificationPriority = 'low' | 'medium' | 'high' | 'urgent';\n\ntype TabId = 'all' | 'orders' | 'promotions' | 'system' | 'unread';\n\ntype SortOption = 'recent' | 'priority' | 'unread';\n\ninterface Notification {\n id: string;\n type: NotificationType;\n title: string;\n message: string;\n priority: NotificationPriority;\n isRead: boolean;\n createdAt: string;\n actionUrl?: string;\n actionText?: string;\n metadata?: {\n orderId?: string;\n cartId?: string;\n amount?: number;\n };\n}\n\n// ---------------------------------------------------------------------------\n// Mock notifications (14 items, rich variety)\n// ---------------------------------------------------------------------------\n\nconst initialNotifications: Notification[] = [\n {\n id: 'n-001',\n type: 'order_update',\n title: 'Order Delivered Successfully!',\n message:\n 'Your order #ORD-001 from Dosa Express has been delivered. Rate your experience to help others!',\n priority: 'medium',\n isRead: false,\n createdAt: new Date(Date.now() - 8 * 60 * 1000).toISOString(),\n actionUrl: '/customer/order/ORD-001',\n actionText: 'Rate Order',\n metadata: { orderId: 'ORD-001', cartId: 'FOOD-001' },\n },\n {\n id: 'n-002',\n type: 'payment',\n title: 'Payment Confirmed',\n message:\n 'Your payment of \\u20B9495 for order #ORD-002 at Quick Cuts Salon has been processed successfully.',\n priority: 'medium',\n isRead: false,\n createdAt: new Date(Date.now() - 35 * 60 * 1000).toISOString(),\n metadata: { orderId: 'ORD-002', amount: 495 },\n },\n {\n id: 'n-003',\n type: 'promotion',\n title: '20% Off Beauty Services This Weekend!',\n message:\n \"Glow Beauty Services is offering 20% off on all treatments this weekend only. Don't miss out!\",\n priority: 'low',\n isRead: false,\n createdAt: new Date(Date.now() - 2 * 60 * 60 * 1000).toISOString(),\n actionUrl: '/customer/cart/SERV-002',\n actionText: 'Book Now',\n metadata: { cartId: 'SERV-002' },\n },\n {\n id: 'n-004',\n type: 'review',\n title: 'New Review Response',\n message:\n 'Dosa Express replied to your review: \"Thank you so much for your kind words! We hope to serve you again soon.\"',\n priority: 'low',\n isRead: false,\n createdAt: new Date(Date.now() - 4 * 60 * 60 * 1000).toISOString(),\n actionUrl: '/customer/reviews',\n actionText: 'View Reply',\n },\n {\n id: 'n-005',\n type: 'system',\n title: 'App Update Available',\n message:\n 'Version 2.4.0 of AdapterCloud is available with improved performance, new category filters, and bug fixes.',\n priority: 'medium',\n isRead: false,\n createdAt: new Date(Date.now() - 7 * 60 * 60 * 1000).toISOString(),\n actionUrl: '/settings',\n actionText: 'Update Now',\n },\n {\n id: 'n-006',\n type: 'order_update',\n title: 'Appointment Confirmed',\n message:\n 'Your appointment at Quick Cuts Salon has been confirmed for tomorrow at 3:00 PM. The stylist Suresh will be serving you.',\n priority: 'medium',\n isRead: true,\n createdAt: new Date(Date.now() - 1 * 24 * 60 * 60 * 1000).toISOString(),\n actionUrl: '/customer/order/ORD-002',\n actionText: 'View Details',\n metadata: { orderId: 'ORD-002' },\n },\n {\n id: 'n-007',\n type: 'investment',\n title: 'Monthly Returns Credited',\n message:\n 'You received \\u20B91,250 in monthly returns from your Quick Cuts Salon investment. Total portfolio value: \\u20B92,12,500.',\n priority: 'medium',\n isRead: true,\n createdAt: new Date(Date.now() - 1 * 24 * 60 * 60 * 1000).toISOString(),\n actionUrl: '/investor/portfolio',\n actionText: 'View Portfolio',\n metadata: { amount: 1250 },\n },\n {\n id: 'n-008',\n type: 'delivery',\n title: 'Delivery Worker Assigned',\n message:\n 'Ravi Kumar (rated 4.8) has been assigned to deliver your order from Biryani Pot. Estimated arrival: 25 minutes.',\n priority: 'high',\n isRead: true,\n createdAt: new Date(Date.now() - 1.5 * 24 * 60 * 60 * 1000).toISOString(),\n metadata: { orderId: 'ORD-003' },\n },\n {\n id: 'n-009',\n type: 'alert',\n title: 'Unusual Login Attempt Detected',\n message:\n 'We detected a login attempt from a new device in Mumbai. If this was not you, please change your password immediately.',\n priority: 'urgent',\n isRead: true,\n createdAt: new Date(Date.now() - 2 * 24 * 60 * 60 * 1000).toISOString(),\n actionUrl: '/settings',\n actionText: 'Review Activity',\n },\n {\n id: 'n-010',\n type: 'promotion',\n title: 'Flash Sale: Mobile Accessories',\n message:\n 'Gadget Zone Brigade is running a flash sale! Up to 30% off on bluetooth headphones, cases, and chargers.',\n priority: 'low',\n isRead: true,\n createdAt: new Date(Date.now() - 3 * 24 * 60 * 60 * 1000).toISOString(),\n actionUrl: '/customer/cart/RETAIL-003',\n actionText: 'Shop Now',\n metadata: { cartId: 'RETAIL-003' },\n },\n {\n id: 'n-011',\n type: 'system',\n title: 'Scheduled Platform Maintenance',\n message:\n 'Platform maintenance is scheduled for Sunday 2:00 AM - 4:00 AM IST. Some services may be briefly unavailable during this window.',\n priority: 'high',\n isRead: true,\n createdAt: new Date(Date.now() - 4 * 24 * 60 * 60 * 1000).toISOString(),\n },\n {\n id: 'n-012',\n type: 'account',\n title: 'KYC Verification Complete',\n message:\n 'Your KYC verification has been completed successfully. You now have full access to all platform features including investments.',\n priority: 'medium',\n isRead: true,\n createdAt: new Date(Date.now() - 5 * 24 * 60 * 60 * 1000).toISOString(),\n },\n {\n id: 'n-013',\n type: 'staff',\n title: 'Staff Schedule Updated',\n message:\n 'Priya Sharma has updated her availability for this week. She will be unavailable on Wednesday and Thursday.',\n priority: 'medium',\n isRead: true,\n createdAt: new Date(Date.now() - 6 * 24 * 60 * 60 * 1000).toISOString(),\n actionUrl: '/owner/staff',\n actionText: 'View Schedule',\n },\n {\n id: 'n-014',\n type: 'payment',\n title: 'Refund Processed',\n message:\n 'Your refund of \\u20B9280 for order #ORD-005 has been processed. The amount will reflect in your account within 3-5 business days.',\n priority: 'medium',\n isRead: true,\n createdAt: new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString(),\n metadata: { orderId: 'ORD-005', amount: 280 },\n },\n];\n\n// ---------------------------------------------------------------------------\n// Type icon/color configuration\n// ---------------------------------------------------------------------------\n\nconst typeConfig: Record<string, { icon: typeof Bell; color: string; bg: string; label: string }> =\n {\n order_update: {\n icon: ShoppingBag,\n color: 'text-accent-blue',\n bg: 'bg-accent-blue-subtle/10',\n label: 'Order',\n },\n payment: {\n icon: CreditCard,\n color: 'text-status-success-text',\n bg: 'bg-status-success-bg-subtle/10',\n label: 'Payment',\n },\n promotion: {\n icon: Megaphone,\n color: 'text-accent-orange',\n bg: 'bg-accent-orange-subtle/10',\n label: 'Promo',\n },\n system: {\n icon: AlertCircle,\n color: 'text-accent-purple',\n bg: 'bg-accent-purple-subtle/10',\n label: 'System',\n },\n review: {\n icon: Star,\n color: 'text-status-warning-text',\n bg: 'bg-status-warning-bg-subtle/10',\n label: 'Review',\n },\n staff: {\n icon: Users,\n color: 'text-accent-indigo',\n bg: 'bg-accent-indigo-subtle/10',\n label: 'Staff',\n },\n investment: {\n icon: TrendingUp,\n color: 'text-status-success-text',\n bg: 'bg-status-success-bg-subtle/10',\n label: 'Investment',\n },\n alert: {\n icon: AlertTriangle,\n color: 'text-status-error-text',\n bg: 'bg-status-error-bg-subtle/10',\n label: 'Alert',\n },\n delivery: {\n icon: Truck,\n color: 'text-accent-cyan',\n bg: 'bg-accent-cyan-subtle/10',\n label: 'Delivery',\n },\n account: {\n icon: UserCheck,\n color: 'text-accent-teal',\n bg: 'bg-accent-teal-subtle/10',\n label: 'Account',\n },\n };\n\n// ---------------------------------------------------------------------------\n// Priority styling\n// ---------------------------------------------------------------------------\n\nconst priorityStyles: Record<NotificationPriority, string> = {\n urgent: 'bg-status-error-bg-subtle/20 text-status-error-text',\n high: 'bg-accent-orange-subtle/20 text-accent-orange',\n medium: 'bg-accent-blue-subtle/20 text-accent-blue',\n low: 'bg-bg-sunken text-text-secondary',\n};\n\nconst priorityBorderColors: Record<NotificationPriority, string> = {\n urgent: 'border-l-red-500',\n high: 'border-l-orange-500',\n medium: 'border-l-blue-500',\n low: 'border-l-border',\n};\n\nconst priorityOrder: Record<NotificationPriority, number> = {\n urgent: 4,\n high: 3,\n medium: 2,\n low: 1,\n};\n\n// ---------------------------------------------------------------------------\n// Tab definitions\n// ---------------------------------------------------------------------------\n\nconst tabs: { id: TabId; label: string; icon: typeof Bell }[] = [\n { id: 'all', label: 'All', icon: Inbox },\n { id: 'orders', label: 'Orders', icon: ShoppingBag },\n { id: 'promotions', label: 'Promotions', icon: Megaphone },\n { id: 'system', label: 'System', icon: AlertCircle },\n { id: 'unread', label: 'Unread', icon: Bell },\n];\n\n// ---------------------------------------------------------------------------\n// Date grouping helpers\n// ---------------------------------------------------------------------------\n\nfunction getDateGroup(dateStr: string): string {\n const date = new Date(dateStr);\n const now = new Date();\n const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());\n const yesterday = new Date(today.getTime() - 24 * 60 * 60 * 1000);\n\n if (date >= today) return'Today';\n if (date >= yesterday) return'Yesterday';\n return'Earlier';\n}\n\nfunction groupByDate(items: Notification[]): { label: string; items: Notification[] }[] {\n const groups: { label: string; items: Notification[] }[] = [];\n const map = new Map<string, Notification[]>();\n const order = ['Today', 'Yesterday', 'Earlier'];\n\n for (const n of items) {\n const group = getDateGroup(n.createdAt);\n if (!map.has(group)) map.set(group, []);\n map.get(group)!.push(n);\n }\n\n for (const label of order) {\n const items = map.get(label);\n if (items && items.length > 0) {\n groups.push({ label, items });\n }\n }\n\n return groups;\n}\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\nexport function NotificationCenterPage() {\n const { navigateTo } = useAdapterCloud();\n const [notifications, setNotifications] = useState<Notification[]>(initialNotifications);\n const [activeTab, setActiveTab] = useState<TabId>('all');\n const [searchQuery, setSearchQuery] = useState('');\n const [sortBy, setSortBy] = useState<SortOption>('recent');\n const [showSortMenu, setShowSortMenu] = useState(false);\n\n // ---------------------------------------------------------------------------\n // Derived counts\n // ---------------------------------------------------------------------------\n\n const unreadCount = useMemo(() => notifications.filter((n) => !n.isRead).length, [notifications]);\n\n const urgentCount = useMemo(\n () => notifications.filter((n) => n.priority === 'urgent').length,\n [notifications]\n );\n\n const todayCount = useMemo(\n () => notifications.filter((n) => getDateGroup(n.createdAt) === 'Today').length,\n [notifications]\n );\n\n const thisWeekCount = useMemo(() => {\n const weekAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000);\n return notifications.filter((n) => new Date(n.createdAt) >= weekAgo).length;\n }, [notifications]);\n\n const tabCounts = useMemo(() => {\n const counts: Record<TabId, number> = {\n all: 0,\n orders: 0,\n promotions: 0,\n system: 0,\n unread: 0,\n };\n for (const n of notifications) {\n counts.all++;\n if (!n.isRead) counts.unread++;\n if (n.type === 'order_update' || n.type === 'delivery') counts.orders++;\n if (n.type === 'promotion') counts.promotions++;\n if (n.type === 'system' || n.type === 'alert' || n.type === 'account') counts.system++;\n }\n return counts;\n }, [notifications]);\n\n // ---------------------------------------------------------------------------\n // Filtered & sorted list\n // ---------------------------------------------------------------------------\n\n const filteredNotifications = useMemo(() => {\n let list = [...notifications];\n\n // Tab filter\n switch (activeTab) {\n case'orders':\n list = list.filter((n) => n.type === 'order_update' || n.type === 'delivery');\n break;\n case'promotions':\n list = list.filter((n) => n.type === 'promotion');\n break;\n case'system':\n list = list.filter(\n (n) => n.type === 'system' || n.type === 'alert' || n.type === 'account'\n );\n break;\n case'unread':\n list = list.filter((n) => !n.isRead);\n break;\n }\n\n // Search filter\n if (searchQuery) {\n const q = searchQuery.toLowerCase();\n list = list.filter(\n (n) => n.title.toLowerCase().includes(q) || n.message.toLowerCase().includes(q)\n );\n }\n\n // Sort\n switch (sortBy) {\n case'recent':\n list.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());\n break;\n case'priority':\n list.sort((a, b) => priorityOrder[b.priority] - priorityOrder[a.priority]);\n break;\n case'unread':\n list.sort((a, b) => (a.isRead === b.isRead ? 0 : a.isRead ? 1 : -1));\n break;\n }\n\n return list;\n }, [notifications, activeTab, searchQuery, sortBy]);\n\n // Grouped by date\n const grouped = useMemo(() => groupByDate(filteredNotifications), [filteredNotifications]);\n\n // ---------------------------------------------------------------------------\n // Actions\n // ---------------------------------------------------------------------------\n\n const markAsRead = useCallback((id: string) => {\n setNotifications((prev) => prev.map((n) => (n.id === id ? { ...n, isRead: true } : n)));\n }, []);\n\n const markAllAsRead = useCallback(() => {\n setNotifications((prev) => prev.map((n) => ({ ...n, isRead: true })));\n }, []);\n\n const deleteNotification = useCallback((id: string) => {\n setNotifications((prev) => prev.filter((n) => n.id !== id));\n }, []);\n\n const handleAction = useCallback(\n (notif: Notification) => {\n if (!notif.isRead) markAsRead(notif.id);\n if (notif.actionUrl) navigateTo(notif.actionUrl);\n },\n [markAsRead, navigateTo]\n );\n\n const clearAll = useCallback(() => {\n if (window.confirm('Are you sure you want to clear all notifications?')) {\n setNotifications([]);\n }\n }, []);\n\n // ---------------------------------------------------------------------------\n // Render\n // ---------------------------------------------------------------------------\n\n return (\n <PageLayout\n title=\"Notifications\"\n description={\n unreadCount > 0\n ? `${unreadCount} unread notification${unreadCount !== 1 ? 's' : ''}`\n : 'All caught up!'\n }\n actions={\n <div className=\"flex items-center gap-2\">\n {notifications.length > 0 && (\n <button\n type=\"button\"\n onClick={clearAll}\n className=\"flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-secondary hover:text-text-primary hover:bg-accent transition-colors\"\n >\n <Trash2 className=\"h-4 w-4\" />\n <span className=\"hidden sm:inline\">Clear All</span>\n </button>\n )}\n {unreadCount > 0 && (\n <button\n type=\"button\"\n onClick={markAllAsRead}\n className=\"flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n <CheckCheck className=\"h-4 w-4\" />\n Mark All Read\n </button>\n )}\n </div>\n }\n >\n {/* ---- Stats Overview ---- */}\n <div className=\"grid grid-cols-2 gap-3 sm:grid-cols-5 mb-6\">\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-3 text-center\">\n <p className=\"text-2xl font-bold text-text-primary\">{notifications.length}</p>\n <p className=\"text-xs text-text-secondary\">Total</p>\n </div>\n <div className=\"rounded-lg border border-accent-blue-subtle/30 bg-accent-blue-subtle/5 p-3 text-center\">\n <p className=\"text-2xl font-bold text-accent-blue\">{unreadCount}</p>\n <p className=\"text-xs text-text-secondary\">Unread</p>\n </div>\n <div className=\"rounded-lg border border-status-error-border/30 bg-status-error-bg-subtle/5 p-3 text-center\">\n <p className=\"text-2xl font-bold text-status-error-text\">{urgentCount}</p>\n <p className=\"text-xs text-text-secondary\">Urgent</p>\n </div>\n <div className=\"rounded-lg border border-status-success-border/30 bg-status-success-bg-subtle/5 p-3 text-center\">\n <p className=\"text-2xl font-bold text-status-success-text\">{todayCount}</p>\n <p className=\"text-xs text-text-secondary\">Today</p>\n </div>\n <div className=\"rounded-lg border border-status-warning-border/30 bg-status-warning-bg-subtle/5 p-3 text-center\">\n <p className=\"text-2xl font-bold text-status-warning-text\">{thisWeekCount}</p>\n <p className=\"text-xs text-text-secondary\">This Week</p>\n </div>\n </div>\n\n {/* ---- Tabs ---- */}\n <div className=\"flex items-center gap-2 mb-4 overflow-x-auto pb-1\">\n {tabs.map((tab) => {\n const TabIcon = tab.icon;\n return (\n <button\n key={tab.id}\n type=\"button\"\n onClick={() => setActiveTab(tab.id)}\n className={cn(\n 'flex items-center gap-1.5 whitespace-nowrap rounded-full border px-3 py-1.5 text-sm font-medium transition-colors',\n activeTab === tab.id\n ? 'border-primary bg-action-primary-bg/10 text-text-primary'\n : 'border-border-subtle text-text-secondary hover:text-text-primary hover:border-accent-foreground/20'\n )}\n >\n <TabIcon className=\"h-3.5 w-3.5\" />\n {tab.label}\n <span\n className={cn(\n 'inline-flex h-5 min-w-[20px] items-center justify-center rounded-full px-1 text-xs',\n activeTab === tab.id\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'bg-bg-sunken text-text-secondary'\n )}\n >\n {tabCounts[tab.id]}\n </span>\n </button>\n );\n })}\n </div>\n\n {/* ---- Search & Sort ---- */}\n <div className=\"flex items-center gap-3 mb-6\">\n <div className=\"relative flex-1\">\n <Search className=\"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary\" />\n <input\n type=\"text\"\n placeholder=\"Search notifications...\"\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface py-2.5 pl-10 pr-9 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n {searchQuery && (\n <button\n type=\"button\"\n onClick={() => setSearchQuery('')}\n className=\"absolute right-3 top-1/2 -translate-y-1/2 text-text-secondary hover:text-text-primary\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n )}\n </div>\n\n {/* Sort dropdown */}\n <div className=\"relative\">\n <button\n type=\"button\"\n onClick={() => setShowSortMenu(!showSortMenu)}\n className=\"flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-2.5 text-sm font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n <ArrowUpDown className=\"h-4 w-4\" />\n <span className=\"hidden sm:inline\">Sort</span>\n </button>\n {showSortMenu && (\n <>\n {/* Backdrop */}\n <div className=\"fixed inset-0 z-10\" onClick={() => setShowSortMenu(false)} />\n <div className=\"absolute right-0 top-full mt-1 z-20 w-44 rounded-lg border border-border-subtle bg-bg-surface shadow-lg py-1\">\n {(\n [\n { value: 'recent', label: 'Most Recent' },\n { value: 'priority', label: 'By Priority' },\n { value: 'unread', label: 'Unread First' },\n ] as const\n ).map((opt) => (\n <button\n key={opt.value}\n type=\"button\"\n onClick={() => {\n setSortBy(opt.value);\n setShowSortMenu(false);\n }}\n className={cn(\n 'w-full text-left px-3 py-2 text-sm transition-colors',\n sortBy === opt.value\n ? 'bg-action-primary-bg/10 text-text-primary font-medium'\n : 'text-text-secondary hover:bg-accent hover:text-text-primary'\n )}\n >\n {opt.label}\n </button>\n ))}\n </div>\n </>\n )}\n </div>\n </div>\n\n {/* ---- Notification List ---- */}\n {filteredNotifications.length === 0 ? (\n <EmptyState\n illustration=\"empty-notifications\"\n icon={<Bell className=\"h-12 w-12\" />}\n title=\"No notifications\"\n description={\n searchQuery\n ? 'No notifications match your search. Try different keywords.'\n : activeTab === 'unread'\n ? \"You're all caught up! No unread notifications.\"\n : 'No notifications in this category yet.'\n }\n action={\n searchQuery ? (\n <button\n type=\"button\"\n onClick={() => setSearchQuery('')}\n className=\"rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n Clear Search\n </button>\n ) : activeTab !== 'all' ? (\n <button\n type=\"button\"\n onClick={() => setActiveTab('all')}\n className=\"rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n View All Notifications\n </button>\n ) : undefined\n }\n />\n ) : (\n <div className=\"space-y-6\">\n {grouped.map((group) => (\n <div key={group.label}>\n {/* Date group header */}\n <div className=\"flex items-center gap-3 mb-2\">\n <h3 className=\"text-xs font-semibold uppercase tracking-wider text-text-secondary\">\n {group.label}\n </h3>\n <div className=\"flex-1 border-t border-border-subtle\" />\n <span className=\"text-xs text-text-secondary\">\n {group.items.length} notification{group.items.length !== 1 ? 's' : ''}\n </span>\n </div>\n\n {/* Notification cards */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface divide-y divide-border overflow-hidden\">\n {group.items.map((notif) => {\n const config = typeConfig[notif.type] ?? typeConfig.system;\n const NotifIcon = config.icon;\n\n return (\n <div\n key={notif.id}\n className={cn(\n 'flex items-start gap-3 px-4 py-4 border-l-4 transition-colors',\n priorityBorderColors[notif.priority],\n !notif.isRead && 'bg-accent/30'\n )}\n >\n {/* Type icon */}\n <div\n className={cn(\n 'flex h-10 w-10 shrink-0 items-center justify-center rounded-full',\n config.bg\n )}\n >\n <NotifIcon className={cn('h-5 w-5', config.color)} />\n </div>\n\n {/* Content */}\n <div className=\"flex-1 min-w-0\">\n {/* Title row */}\n <div className=\"flex items-center gap-2 flex-wrap\">\n <h4\n className={cn(\n 'text-sm text-text-primary',\n !notif.isRead ? 'font-semibold' : 'font-medium'\n )}\n >\n {notif.title}\n </h4>\n {!notif.isRead && (\n <span className=\"h-2 w-2 rounded-full bg-action-primary-bg shrink-0\" />\n )}\n <span\n className={cn(\n 'inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium',\n priorityStyles[notif.priority]\n )}\n >\n {notif.priority}\n </span>\n </div>\n\n {/* Message */}\n <p className=\"mt-1 text-sm text-text-secondary leading-relaxed\">\n {notif.message}\n </p>\n\n {/* Metadata row */}\n <div className=\"mt-2 flex items-center gap-3 flex-wrap\">\n <span className=\"flex items-center gap-1 text-xs text-text-secondary\">\n <Clock className=\"h-3 w-3\" />\n {formatRelativeTime(notif.createdAt)}\n </span>\n <span\n className={cn(\n 'inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium',\n config.bg,\n config.color\n )}\n >\n {config.label}\n </span>\n {notif.metadata?.orderId && (\n <span className=\"text-xs text-text-secondary\">\n #{notif.metadata.orderId}\n </span>\n )}\n </div>\n\n {/* Action buttons row */}\n <div className=\"mt-3 flex items-center gap-2 flex-wrap\">\n {notif.actionUrl && (\n <button\n type=\"button\"\n onClick={() => handleAction(notif)}\n className=\"rounded-lg bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors\"\n >\n {notif.actionText ?? 'View'}\n </button>\n )}\n {!notif.isRead && (\n <button\n type=\"button\"\n onClick={() => markAsRead(notif.id)}\n title=\"Mark as read\"\n className=\"flex items-center gap-1 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n <Check className=\"h-3 w-3\" />\n Mark Read\n </button>\n )}\n <button\n type=\"button\"\n onClick={() => deleteNotification(notif.id)}\n title=\"Delete notification\"\n className=\"flex items-center gap-1 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-status-error-text hover:bg-status-error-bg/10 transition-colors\"\n >\n <Trash2 className=\"h-3 w-3\" />\n Delete\n </button>\n </div>\n </div>\n\n {/* Read/unread indicator */}\n <div className=\"shrink-0 pt-1\">\n {notif.isRead ? (\n <MailOpen className=\"h-4 w-4 text-text-secondary/40\" />\n ) : (\n <Bell className=\"h-4 w-4 text-primary\" />\n )}\n </div>\n </div>\n );\n })}\n </div>\n </div>\n ))}\n </div>\n )}\n\n {/* ---- Footer summary ---- */}\n {filteredNotifications.length > 0 && (\n <div className=\"mt-6 flex items-center justify-between rounded-lg border border-border-subtle bg-bg-surface px-4 py-3\">\n <p className=\"text-sm text-text-secondary\">\n Showing {filteredNotifications.length} of {notifications.length} notifications\n </p>\n {activeTab !== 'all' && (\n <button\n type=\"button\"\n onClick={() => {\n setActiveTab('all');\n setSearchQuery('');\n }}\n className=\"flex items-center gap-1.5 text-sm font-medium text-primary hover:underline\"\n >\n <RefreshCw className=\"h-3.5 w-3.5\" />\n Show All\n </button>\n )}\n </div>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;AAqFA,IAAM,IAAuC;CAC3C;EACE,IAAI;EACJ,MAAM;EACN,OAAO;EACP,SACE;EACF,UAAU;EACV,QAAQ;EACR,4BAAW,IAAI,KAAK,KAAK,KAAK,GAAG,MAAS,IAAK,EAAC,aAAa;EAC7D,WAAW;EACX,YAAY;EACZ,UAAU;GAAE,SAAS;GAAW,QAAQ;GAAY;EACrD;CACD;EACE,IAAI;EACJ,MAAM;EACN,OAAO;EACP,SACE;EACF,UAAU;EACV,QAAQ;EACR,4BAAW,IAAI,KAAK,KAAK,KAAK,GAAG,OAAU,IAAK,EAAC,aAAa;EAC9D,UAAU;GAAE,SAAS;GAAW,QAAQ;GAAK;EAC9C;CACD;EACE,IAAI;EACJ,MAAM;EACN,OAAO;EACP,SACE;EACF,UAAU;EACV,QAAQ;EACR,4BAAW,IAAI,KAAK,KAAK,KAAK,GAAG,OAAc,IAAK,EAAC,aAAa;EAClE,WAAW;EACX,YAAY;EACZ,UAAU,EAAE,QAAQ,YAAY;EACjC;CACD;EACE,I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