@burdenoff/microfe-subscriberbot 2026.626.2 → 2026.628.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 (141) hide show
  1. package/dist/index.js +4 -4
  2. package/dist/subscriberbot/SubscriberBotRoot.js +61 -133
  3. package/dist/subscriberbot/SubscriberBotRoot.js.map +1 -1
  4. package/dist/subscriberbot/SubscriberBotRoutes.js +56 -187
  5. package/dist/subscriberbot/SubscriberBotRoutes.js.map +1 -1
  6. package/dist/subscriberbot/components/StateViews.js +49 -0
  7. package/dist/subscriberbot/components/StateViews.js.map +1 -0
  8. package/dist/subscriberbot/components/StatusBadge.js +45 -47
  9. package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
  10. package/dist/subscriberbot/context/SubscriberBotContext.js +22 -30
  11. package/dist/subscriberbot/context/SubscriberBotContext.js.map +1 -1
  12. package/dist/subscriberbot/hooks/useSubscriberBotApi.js +342 -195
  13. package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
  14. package/dist/subscriberbot/index.js +1 -1
  15. package/dist/subscriberbot/pages/DashboardPage.js +269 -0
  16. package/dist/subscriberbot/pages/DashboardPage.js.map +1 -0
  17. package/dist/subscriberbot/pages/InboxPage.js +186 -0
  18. package/dist/subscriberbot/pages/InboxPage.js.map +1 -0
  19. package/dist/subscriberbot/pages/InvoicesPage.js +211 -0
  20. package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -0
  21. package/dist/subscriberbot/pages/WorkflowsPage.js +236 -0
  22. package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -0
  23. package/dist/subscriberbot/pages/agents/AgentDetailPage.js +160 -0
  24. package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -0
  25. package/dist/subscriberbot/pages/agents/AgentNewPage.js +140 -0
  26. package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -0
  27. package/dist/subscriberbot/pages/agents/AgentsListPage.js +178 -0
  28. package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -0
  29. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +179 -0
  30. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -0
  31. package/dist/subscriberbot/pages/providers/ProviderNewPage.js +185 -0
  32. package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -0
  33. package/dist/subscriberbot/pages/providers/ProvidersListPage.js +254 -0
  34. package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -0
  35. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +306 -0
  36. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -0
  37. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +253 -0
  38. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -0
  39. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +248 -0
  40. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -0
  41. package/dist/subscriberbot/utils/formatters.js +50 -32
  42. package/dist/subscriberbot/utils/formatters.js.map +1 -1
  43. package/package.json +1 -1
  44. package/dist/subscriberbot/components/InvestmentCard.js +0 -97
  45. package/dist/subscriberbot/components/InvestmentCard.js.map +0 -1
  46. package/dist/subscriberbot/components/RatingDisplay.js +0 -35
  47. package/dist/subscriberbot/components/RatingDisplay.js.map +0 -1
  48. package/dist/subscriberbot/mocks/data.js +0 -1517
  49. package/dist/subscriberbot/mocks/data.js.map +0 -1
  50. package/dist/subscriberbot/mocks/users.js +0 -34
  51. package/dist/subscriberbot/mocks/users.js.map +0 -1
  52. package/dist/subscriberbot/pages/HomePage.js +0 -930
  53. package/dist/subscriberbot/pages/HomePage.js.map +0 -1
  54. package/dist/subscriberbot/pages/admin/AdminAnalyticsPage.js +0 -651
  55. package/dist/subscriberbot/pages/admin/AdminAnalyticsPage.js.map +0 -1
  56. package/dist/subscriberbot/pages/admin/AdminDashboard.js +0 -679
  57. package/dist/subscriberbot/pages/admin/AdminDashboard.js.map +0 -1
  58. package/dist/subscriberbot/pages/admin/AdminFinancialPage.js +0 -427
  59. package/dist/subscriberbot/pages/admin/AdminFinancialPage.js.map +0 -1
  60. package/dist/subscriberbot/pages/admin/AdminOrdersPage.js +0 -665
  61. package/dist/subscriberbot/pages/admin/AdminOrdersPage.js.map +0 -1
  62. package/dist/subscriberbot/pages/admin/AdminProfilePage.js +0 -261
  63. package/dist/subscriberbot/pages/admin/AdminProfilePage.js.map +0 -1
  64. package/dist/subscriberbot/pages/admin/AdminSettingsPage.js +0 -654
  65. package/dist/subscriberbot/pages/admin/AdminSettingsPage.js.map +0 -1
  66. package/dist/subscriberbot/pages/admin/CartManagementPage.js +0 -874
  67. package/dist/subscriberbot/pages/admin/CartManagementPage.js.map +0 -1
  68. package/dist/subscriberbot/pages/admin/UserManagementPage.js +0 -898
  69. package/dist/subscriberbot/pages/admin/UserManagementPage.js.map +0 -1
  70. package/dist/subscriberbot/pages/cart-owner/AnalyticsDashboard.js +0 -839
  71. package/dist/subscriberbot/pages/cart-owner/AnalyticsDashboard.js.map +0 -1
  72. package/dist/subscriberbot/pages/cart-owner/BusinessSettingsPage.js +0 -705
  73. package/dist/subscriberbot/pages/cart-owner/BusinessSettingsPage.js.map +0 -1
  74. package/dist/subscriberbot/pages/cart-owner/CartOwnerDashboard.js +0 -802
  75. package/dist/subscriberbot/pages/cart-owner/CartOwnerDashboard.js.map +0 -1
  76. package/dist/subscriberbot/pages/cart-owner/CartOwnerProfilePage.js +0 -891
  77. package/dist/subscriberbot/pages/cart-owner/CartOwnerProfilePage.js.map +0 -1
  78. package/dist/subscriberbot/pages/cart-owner/CartServiceConfigPage.js +0 -633
  79. package/dist/subscriberbot/pages/cart-owner/CartServiceConfigPage.js.map +0 -1
  80. package/dist/subscriberbot/pages/cart-owner/InventoryManagementPage.js +0 -910
  81. package/dist/subscriberbot/pages/cart-owner/InventoryManagementPage.js.map +0 -1
  82. package/dist/subscriberbot/pages/cart-owner/OrderManagementPage.js +0 -879
  83. package/dist/subscriberbot/pages/cart-owner/OrderManagementPage.js.map +0 -1
  84. package/dist/subscriberbot/pages/cart-owner/StaffManagementPage.js +0 -838
  85. package/dist/subscriberbot/pages/cart-owner/StaffManagementPage.js.map +0 -1
  86. package/dist/subscriberbot/pages/common/HelpSupportPage.js +0 -1323
  87. package/dist/subscriberbot/pages/common/HelpSupportPage.js.map +0 -1
  88. package/dist/subscriberbot/pages/common/NotificationCenterPage.js +0 -672
  89. package/dist/subscriberbot/pages/common/NotificationCenterPage.js.map +0 -1
  90. package/dist/subscriberbot/pages/common/SettingsPage.js +0 -973
  91. package/dist/subscriberbot/pages/common/SettingsPage.js.map +0 -1
  92. package/dist/subscriberbot/pages/customer/BookingDetailsPage.js +0 -626
  93. package/dist/subscriberbot/pages/customer/BookingDetailsPage.js.map +0 -1
  94. package/dist/subscriberbot/pages/customer/CartDetailPage.js +0 -654
  95. package/dist/subscriberbot/pages/customer/CartDetailPage.js.map +0 -1
  96. package/dist/subscriberbot/pages/customer/CartDiscoveryPage.js +0 -555
  97. package/dist/subscriberbot/pages/customer/CartDiscoveryPage.js.map +0 -1
  98. package/dist/subscriberbot/pages/customer/CheckoutPage.js +0 -529
  99. package/dist/subscriberbot/pages/customer/CheckoutPage.js.map +0 -1
  100. package/dist/subscriberbot/pages/customer/CustomerDashboard.js +0 -532
  101. package/dist/subscriberbot/pages/customer/CustomerDashboard.js.map +0 -1
  102. package/dist/subscriberbot/pages/customer/CustomerProfilePage.js +0 -630
  103. package/dist/subscriberbot/pages/customer/CustomerProfilePage.js.map +0 -1
  104. package/dist/subscriberbot/pages/customer/DirectServiceBookingPage.js +0 -633
  105. package/dist/subscriberbot/pages/customer/DirectServiceBookingPage.js.map +0 -1
  106. package/dist/subscriberbot/pages/customer/FavoritesPage.js +0 -484
  107. package/dist/subscriberbot/pages/customer/FavoritesPage.js.map +0 -1
  108. package/dist/subscriberbot/pages/customer/OrderHistoryPage.js +0 -446
  109. package/dist/subscriberbot/pages/customer/OrderHistoryPage.js.map +0 -1
  110. package/dist/subscriberbot/pages/customer/OrderTrackingPage.js +0 -394
  111. package/dist/subscriberbot/pages/customer/OrderTrackingPage.js.map +0 -1
  112. package/dist/subscriberbot/pages/customer/PaymentMethodsPage.js +0 -495
  113. package/dist/subscriberbot/pages/customer/PaymentMethodsPage.js.map +0 -1
  114. package/dist/subscriberbot/pages/customer/ReviewsPage.js +0 -613
  115. package/dist/subscriberbot/pages/customer/ReviewsPage.js.map +0 -1
  116. package/dist/subscriberbot/pages/customer/SavedAddressesPage.js +0 -450
  117. package/dist/subscriberbot/pages/customer/SavedAddressesPage.js.map +0 -1
  118. package/dist/subscriberbot/pages/investor/InvestmentDetailsPage.js +0 -886
  119. package/dist/subscriberbot/pages/investor/InvestmentDetailsPage.js.map +0 -1
  120. package/dist/subscriberbot/pages/investor/InvestmentOpportunitiesPage.js +0 -947
  121. package/dist/subscriberbot/pages/investor/InvestmentOpportunitiesPage.js.map +0 -1
  122. package/dist/subscriberbot/pages/investor/InvestorAnalyticsPage.js +0 -687
  123. package/dist/subscriberbot/pages/investor/InvestorAnalyticsPage.js.map +0 -1
  124. package/dist/subscriberbot/pages/investor/InvestorDashboard.js +0 -451
  125. package/dist/subscriberbot/pages/investor/InvestorDashboard.js.map +0 -1
  126. package/dist/subscriberbot/pages/investor/InvestorInvestmentsPage.js +0 -406
  127. package/dist/subscriberbot/pages/investor/InvestorInvestmentsPage.js.map +0 -1
  128. package/dist/subscriberbot/pages/investor/InvestorPortfolioPage.js +0 -575
  129. package/dist/subscriberbot/pages/investor/InvestorPortfolioPage.js.map +0 -1
  130. package/dist/subscriberbot/pages/investor/InvestorProfilePage.js +0 -1070
  131. package/dist/subscriberbot/pages/investor/InvestorProfilePage.js.map +0 -1
  132. package/dist/subscriberbot/pages/worker/TaskDetailsPage.js +0 -535
  133. package/dist/subscriberbot/pages/worker/TaskDetailsPage.js.map +0 -1
  134. package/dist/subscriberbot/pages/worker/WorkerDashboard.js +0 -666
  135. package/dist/subscriberbot/pages/worker/WorkerDashboard.js.map +0 -1
  136. package/dist/subscriberbot/pages/worker/WorkerOrdersPage.js +0 -681
  137. package/dist/subscriberbot/pages/worker/WorkerOrdersPage.js.map +0 -1
  138. package/dist/subscriberbot/pages/worker/WorkerProfilePage.js +0 -692
  139. package/dist/subscriberbot/pages/worker/WorkerProfilePage.js.map +0 -1
  140. package/dist/subscriberbot/pages/worker/WorkerSchedulePage.js +0 -588
  141. package/dist/subscriberbot/pages/worker/WorkerSchedulePage.js.map +0 -1
@@ -1,672 +0,0 @@
1
- import { useSubscriberBot as e } from "../../context/SubscriberBotContext.js";
2
- import { cn as t } from "../../utils/cn.js";
3
- import { PageLayout as n } from "../../components/PageLayout.js";
4
- import { EmptyState as r } from "../../components/EmptyState.js";
5
- import { formatRelativeTime as i } from "../../utils/formatters.js";
6
- import { useCallback as a, useMemo as o, useState as s } from "react";
7
- import { AlertCircle as c, AlertTriangle as l, ArrowUpDown as u, Bell as d, Check as f, CheckCheck as p, Clock as m, CreditCard as h, Inbox as g, MailOpen as _, Megaphone as v, RefreshCw as y, Search as b, ShoppingBag as x, Star as S, Trash2 as C, TrendingUp as w, Truck as T, UserCheck as E, Users as D, X as O } from "lucide-react";
8
- import { Fragment as k, jsx as A, jsxs as j } from "react/jsx-runtime";
9
- import { EmphasisPanel as M, PagePurpose as N } from "@burdenoff/fe-libs/ui";
10
- //#region src/subscriberbot/pages/common/NotificationCenterPage.tsx
11
- var P = [
12
- {
13
- id: "n-001",
14
- type: "order_update",
15
- title: "Order Delivered Successfully!",
16
- message: "Your order #ORD-001 from Dosa Express has been delivered. Rate your experience to help others!",
17
- priority: "medium",
18
- isRead: !1,
19
- createdAt: (/* @__PURE__ */ new Date(Date.now() - 480 * 1e3)).toISOString(),
20
- actionUrl: "/customer/order/ORD-001",
21
- actionText: "Rate Order",
22
- metadata: {
23
- orderId: "ORD-001",
24
- cartId: "FOOD-001"
25
- }
26
- },
27
- {
28
- id: "n-002",
29
- type: "payment",
30
- title: "Payment Confirmed",
31
- message: "Your payment of ₹495 for order #ORD-002 at Quick Cuts Salon has been processed successfully.",
32
- priority: "medium",
33
- isRead: !1,
34
- createdAt: (/* @__PURE__ */ new Date(Date.now() - 2100 * 1e3)).toISOString(),
35
- metadata: {
36
- orderId: "ORD-002",
37
- amount: 495
38
- }
39
- },
40
- {
41
- id: "n-003",
42
- type: "promotion",
43
- title: "20% Off Beauty Services This Weekend!",
44
- message: "Glow Beauty Services is offering 20% off on all treatments this weekend only. Don't miss out!",
45
- priority: "low",
46
- isRead: !1,
47
- createdAt: (/* @__PURE__ */ new Date(Date.now() - 7200 * 1e3)).toISOString(),
48
- actionUrl: "/customer/cart/SERV-002",
49
- actionText: "Book Now",
50
- metadata: { cartId: "SERV-002" }
51
- },
52
- {
53
- id: "n-004",
54
- type: "review",
55
- title: "New Review Response",
56
- message: "Dosa Express replied to your review: \"Thank you so much for your kind words! We hope to serve you again soon.\"",
57
- priority: "low",
58
- isRead: !1,
59
- createdAt: (/* @__PURE__ */ new Date(Date.now() - 14400 * 1e3)).toISOString(),
60
- actionUrl: "/customer/reviews",
61
- actionText: "View Reply"
62
- },
63
- {
64
- id: "n-005",
65
- type: "system",
66
- title: "App Update Available",
67
- message: "Version 2.4.0 of SubscriberBot is available with improved performance, new category filters, and bug fixes.",
68
- priority: "medium",
69
- isRead: !1,
70
- createdAt: (/* @__PURE__ */ new Date(Date.now() - 420 * 60 * 1e3)).toISOString(),
71
- actionUrl: "/settings",
72
- actionText: "Update Now"
73
- },
74
- {
75
- id: "n-006",
76
- type: "order_update",
77
- title: "Appointment Confirmed",
78
- message: "Your appointment at Quick Cuts Salon has been confirmed for tomorrow at 3:00 PM. The stylist Suresh will be serving you.",
79
- priority: "medium",
80
- isRead: !0,
81
- createdAt: (/* @__PURE__ */ new Date(Date.now() - 1440 * 60 * 1e3)).toISOString(),
82
- actionUrl: "/customer/order/ORD-002",
83
- actionText: "View Details",
84
- metadata: { orderId: "ORD-002" }
85
- },
86
- {
87
- id: "n-007",
88
- type: "investment",
89
- title: "Monthly Returns Credited",
90
- message: "You received ₹1,250 in monthly returns from your Quick Cuts Salon investment. Total portfolio value: ₹2,12,500.",
91
- priority: "medium",
92
- isRead: !0,
93
- createdAt: (/* @__PURE__ */ new Date(Date.now() - 1440 * 60 * 1e3)).toISOString(),
94
- actionUrl: "/investor/portfolio",
95
- actionText: "View Portfolio",
96
- metadata: { amount: 1250 }
97
- },
98
- {
99
- id: "n-008",
100
- type: "delivery",
101
- title: "Delivery Worker Assigned",
102
- message: "Ravi Kumar (rated 4.8) has been assigned to deliver your order from Biryani Pot. Estimated arrival: 25 minutes.",
103
- priority: "high",
104
- isRead: !0,
105
- createdAt: (/* @__PURE__ */ new Date(Date.now() - 1.5 * 24 * 60 * 60 * 1e3)).toISOString(),
106
- metadata: { orderId: "ORD-003" }
107
- },
108
- {
109
- id: "n-009",
110
- type: "alert",
111
- title: "Unusual Login Attempt Detected",
112
- message: "We detected a login attempt from a new device in Mumbai. If this was not you, please change your password immediately.",
113
- priority: "urgent",
114
- isRead: !0,
115
- createdAt: (/* @__PURE__ */ new Date(Date.now() - 2880 * 60 * 1e3)).toISOString(),
116
- actionUrl: "/settings",
117
- actionText: "Review Activity"
118
- },
119
- {
120
- id: "n-010",
121
- type: "promotion",
122
- title: "Flash Sale: Mobile Accessories",
123
- message: "Gadget Zone Brigade is running a flash sale! Up to 30% off on bluetooth headphones, cases, and chargers.",
124
- priority: "low",
125
- isRead: !0,
126
- createdAt: (/* @__PURE__ */ new Date(Date.now() - 4320 * 60 * 1e3)).toISOString(),
127
- actionUrl: "/customer/cart/RETAIL-003",
128
- actionText: "Shop Now",
129
- metadata: { cartId: "RETAIL-003" }
130
- },
131
- {
132
- id: "n-011",
133
- type: "system",
134
- title: "Scheduled Platform Maintenance",
135
- message: "Platform maintenance is scheduled for Sunday 2:00 AM - 4:00 AM IST. Some services may be briefly unavailable during this window.",
136
- priority: "high",
137
- isRead: !0,
138
- createdAt: (/* @__PURE__ */ new Date(Date.now() - 5760 * 60 * 1e3)).toISOString()
139
- },
140
- {
141
- id: "n-012",
142
- type: "account",
143
- title: "KYC Verification Complete",
144
- message: "Your KYC verification has been completed successfully. You now have full access to all platform features including investments.",
145
- priority: "medium",
146
- isRead: !0,
147
- createdAt: (/* @__PURE__ */ new Date(Date.now() - 7200 * 60 * 1e3)).toISOString()
148
- },
149
- {
150
- id: "n-013",
151
- type: "staff",
152
- title: "Staff Schedule Updated",
153
- message: "Priya Sharma has updated her availability for this week. She will be unavailable on Wednesday and Thursday.",
154
- priority: "medium",
155
- isRead: !0,
156
- createdAt: (/* @__PURE__ */ new Date(Date.now() - 8640 * 60 * 1e3)).toISOString(),
157
- actionUrl: "/owner/staff",
158
- actionText: "View Schedule"
159
- },
160
- {
161
- id: "n-014",
162
- type: "payment",
163
- title: "Refund Processed",
164
- message: "Your refund of ₹280 for order #ORD-005 has been processed. The amount will reflect in your account within 3-5 business days.",
165
- priority: "medium",
166
- isRead: !0,
167
- createdAt: (/* @__PURE__ */ new Date(Date.now() - 10080 * 60 * 1e3)).toISOString(),
168
- metadata: {
169
- orderId: "ORD-005",
170
- amount: 280
171
- }
172
- }
173
- ], F = {
174
- order_update: {
175
- icon: x,
176
- color: "text-status-info-text",
177
- bg: "bg-status-info-bg/10",
178
- label: "Order"
179
- },
180
- payment: {
181
- icon: h,
182
- color: "text-status-success-text",
183
- bg: "bg-status-success-bg/10",
184
- label: "Payment"
185
- },
186
- promotion: {
187
- icon: v,
188
- color: "text-status-warning-text",
189
- bg: "bg-status-warning-bg/10",
190
- label: "Promo"
191
- },
192
- system: {
193
- icon: c,
194
- color: "text-accent-purple",
195
- bg: "bg-accent-purple-subtle",
196
- label: "System"
197
- },
198
- review: {
199
- icon: S,
200
- color: "text-status-warning-text",
201
- bg: "bg-status-warning-bg/10",
202
- label: "Review"
203
- },
204
- staff: {
205
- icon: D,
206
- color: "text-accent-indigo",
207
- bg: "bg-accent-indigo-subtle",
208
- label: "Staff"
209
- },
210
- investment: {
211
- icon: w,
212
- color: "text-status-success-text",
213
- bg: "bg-status-success-bg/10",
214
- label: "Investment"
215
- },
216
- alert: {
217
- icon: l,
218
- color: "text-status-error-text",
219
- bg: "bg-status-error-bg/10",
220
- label: "Alert"
221
- },
222
- delivery: {
223
- icon: T,
224
- color: "text-status-info-text",
225
- bg: "bg-status-info-bg/10",
226
- label: "Delivery"
227
- },
228
- account: {
229
- icon: E,
230
- color: "text-accent-teal",
231
- bg: "bg-accent-teal-subtle",
232
- label: "Account"
233
- }
234
- }, I = {
235
- urgent: "bg-status-error-bg/20 text-status-error-text",
236
- high: "bg-status-warning-bg/20 text-status-warning-text",
237
- medium: "bg-status-info-bg/20 text-status-info-text",
238
- low: "bg-bg-sunken text-text-secondary"
239
- }, L = {
240
- urgent: "border-l-red-500",
241
- high: "border-l-orange-500",
242
- medium: "border-l-blue-500",
243
- low: "border-l-border"
244
- }, R = {
245
- urgent: 4,
246
- high: 3,
247
- medium: 2,
248
- low: 1
249
- }, z = [
250
- {
251
- id: "all",
252
- label: "All",
253
- icon: g
254
- },
255
- {
256
- id: "orders",
257
- label: "Orders",
258
- icon: x
259
- },
260
- {
261
- id: "promotions",
262
- label: "Promotions",
263
- icon: v
264
- },
265
- {
266
- id: "system",
267
- label: "System",
268
- icon: c
269
- },
270
- {
271
- id: "unread",
272
- label: "Unread",
273
- icon: d
274
- }
275
- ];
276
- function B(e) {
277
- let t = new Date(e), n = /* @__PURE__ */ new Date(), r = new Date(n.getFullYear(), n.getMonth(), n.getDate()), i = /* @__PURE__ */ new Date(r.getTime() - 1440 * 60 * 1e3);
278
- return t >= r ? "Today" : t >= i ? "Yesterday" : "Earlier";
279
- }
280
- function V(e) {
281
- let t = [], n = /* @__PURE__ */ new Map(), r = [
282
- "Today",
283
- "Yesterday",
284
- "Earlier"
285
- ];
286
- for (let t of e) {
287
- let e = B(t.createdAt);
288
- n.has(e) || n.set(e, []), n.get(e).push(t);
289
- }
290
- for (let e of r) {
291
- let r = n.get(e);
292
- r && r.length > 0 && t.push({
293
- label: e,
294
- items: r
295
- });
296
- }
297
- return t;
298
- }
299
- function H() {
300
- let { navigateTo: c } = e(), [l, h] = s(P), [g, v] = s("all"), [x, S] = s(""), [w, T] = s("recent"), [E, D] = s(!1), H = o(() => l.filter((e) => !e.isRead).length, [l]), U = o(() => l.filter((e) => e.priority === "urgent").length, [l]), W = o(() => l.filter((e) => B(e.createdAt) === "Today").length, [l]), G = o(() => {
301
- let e = /* @__PURE__ */ new Date(Date.now() - 10080 * 60 * 1e3);
302
- return l.filter((t) => new Date(t.createdAt) >= e).length;
303
- }, [l]), K = o(() => {
304
- let e = {
305
- all: 0,
306
- orders: 0,
307
- promotions: 0,
308
- system: 0,
309
- unread: 0
310
- };
311
- for (let t of l) e.all++, t.isRead || e.unread++, (t.type === "order_update" || t.type === "delivery") && e.orders++, t.type === "promotion" && e.promotions++, (t.type === "system" || t.type === "alert" || t.type === "account") && e.system++;
312
- return e;
313
- }, [l]), q = o(() => {
314
- let e = [...l];
315
- switch (g) {
316
- case "orders":
317
- e = e.filter((e) => e.type === "order_update" || e.type === "delivery");
318
- break;
319
- case "promotions":
320
- e = e.filter((e) => e.type === "promotion");
321
- break;
322
- case "system":
323
- e = e.filter((e) => e.type === "system" || e.type === "alert" || e.type === "account");
324
- break;
325
- case "unread":
326
- e = e.filter((e) => !e.isRead);
327
- break;
328
- }
329
- if (x) {
330
- let t = x.toLowerCase();
331
- e = e.filter((e) => e.title.toLowerCase().includes(t) || e.message.toLowerCase().includes(t));
332
- }
333
- switch (w) {
334
- case "recent":
335
- e.sort((e, t) => new Date(t.createdAt).getTime() - new Date(e.createdAt).getTime());
336
- break;
337
- case "priority":
338
- e.sort((e, t) => R[t.priority] - R[e.priority]);
339
- break;
340
- case "unread":
341
- e.sort((e, t) => e.isRead === t.isRead ? 0 : e.isRead ? 1 : -1);
342
- break;
343
- }
344
- return e;
345
- }, [
346
- l,
347
- g,
348
- x,
349
- w
350
- ]), J = o(() => V(q), [q]), Y = a((e) => {
351
- h((t) => t.map((t) => t.id === e ? {
352
- ...t,
353
- isRead: !0
354
- } : t));
355
- }, []), X = a(() => {
356
- h((e) => e.map((e) => ({
357
- ...e,
358
- isRead: !0
359
- })));
360
- }, []), Z = a((e) => {
361
- h((t) => t.filter((t) => t.id !== e));
362
- }, []), Q = a((e) => {
363
- e.isRead || Y(e.id), e.actionUrl && c(e.actionUrl);
364
- }, [Y, c]), $ = a(() => {
365
- window.confirm("Are you sure you want to clear all notifications?") && h([]);
366
- }, []);
367
- return /* @__PURE__ */ j(n, {
368
- title: "Notifications",
369
- description: H > 0 ? `${H} unread notification${H === 1 ? "" : "s"}` : "All caught up!",
370
- actions: /* @__PURE__ */ j("div", {
371
- className: "flex items-center gap-2",
372
- children: [l.length > 0 && /* @__PURE__ */ j("button", {
373
- type: "button",
374
- onClick: $,
375
- className: "flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-2 text-sm font-medium text-text-secondary hover:text-text-primary hover:bg-accent transition-colors",
376
- children: [/* @__PURE__ */ A(C, { className: "h-4 w-4" }), /* @__PURE__ */ A("span", {
377
- className: "hidden sm:inline",
378
- children: "Clear All"
379
- })]
380
- }), H > 0 && /* @__PURE__ */ j("button", {
381
- type: "button",
382
- onClick: X,
383
- className: "flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
384
- children: [/* @__PURE__ */ A(p, { className: "h-4 w-4" }), "Mark All Read"]
385
- })]
386
- }),
387
- children: [
388
- /* @__PURE__ */ A(N, {
389
- icon: /* @__PURE__ */ A(d, { className: "h-4 w-4" }),
390
- className: "mb-6",
391
- children: "Every update from the platform in one feed — order status changes, promotions, system alerts and more. Filter by type or unread, search for a specific alert, and mark things read or clear them once you've dealt with them. Check here first whenever something needs your attention."
392
- }),
393
- /* @__PURE__ */ j(M, {
394
- className: "grid grid-cols-2 gap-3 sm:grid-cols-5 mb-6",
395
- children: [
396
- /* @__PURE__ */ j("div", {
397
- className: "rounded-lg border border-border-seam bg-bg-surface p-3 text-center",
398
- children: [/* @__PURE__ */ A("p", {
399
- className: "text-2xl font-bold text-text-primary",
400
- children: l.length
401
- }), /* @__PURE__ */ A("p", {
402
- className: "text-xs text-text-secondary",
403
- children: "Total"
404
- })]
405
- }),
406
- /* @__PURE__ */ j("div", {
407
- className: "rounded-lg border border-status-info-border/30 bg-status-info-bg/5 p-3 text-center",
408
- children: [/* @__PURE__ */ A("p", {
409
- className: "text-2xl font-bold text-status-info-text",
410
- children: H
411
- }), /* @__PURE__ */ A("p", {
412
- className: "text-xs text-text-secondary",
413
- children: "Unread"
414
- })]
415
- }),
416
- /* @__PURE__ */ j("div", {
417
- className: "rounded-lg border border-status-error-border/30 bg-status-error-bg/5 p-3 text-center",
418
- children: [/* @__PURE__ */ A("p", {
419
- className: "text-2xl font-bold text-status-error-text",
420
- children: U
421
- }), /* @__PURE__ */ A("p", {
422
- className: "text-xs text-text-secondary",
423
- children: "Urgent"
424
- })]
425
- }),
426
- /* @__PURE__ */ j("div", {
427
- className: "rounded-lg border border-status-success-border/30 bg-status-success-bg/5 p-3 text-center",
428
- children: [/* @__PURE__ */ A("p", {
429
- className: "text-2xl font-bold text-status-success-text",
430
- children: W
431
- }), /* @__PURE__ */ A("p", {
432
- className: "text-xs text-text-secondary",
433
- children: "Today"
434
- })]
435
- }),
436
- /* @__PURE__ */ j("div", {
437
- className: "rounded-lg border border-status-warning-border/30 bg-status-warning-bg/5 p-3 text-center",
438
- children: [/* @__PURE__ */ A("p", {
439
- className: "text-2xl font-bold text-status-warning-text",
440
- children: G
441
- }), /* @__PURE__ */ A("p", {
442
- className: "text-xs text-text-secondary",
443
- children: "This Week"
444
- })]
445
- })
446
- ]
447
- }),
448
- /* @__PURE__ */ A("div", {
449
- className: "flex items-center gap-2 mb-4 overflow-x-auto pb-1",
450
- children: z.map((e) => {
451
- let n = e.icon;
452
- return /* @__PURE__ */ j("button", {
453
- type: "button",
454
- onClick: () => v(e.id),
455
- 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-seam text-text-secondary hover:text-text-primary hover:border-accent-foreground/20"),
456
- children: [
457
- /* @__PURE__ */ A(n, { className: "h-3.5 w-3.5" }),
458
- e.label,
459
- /* @__PURE__ */ A("span", {
460
- 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"),
461
- children: K[e.id]
462
- })
463
- ]
464
- }, e.id);
465
- })
466
- }),
467
- /* @__PURE__ */ j("div", {
468
- className: "flex items-center gap-3 mb-6",
469
- children: [/* @__PURE__ */ j("div", {
470
- className: "relative flex-1",
471
- children: [
472
- /* @__PURE__ */ A(b, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }),
473
- /* @__PURE__ */ A("input", {
474
- type: "text",
475
- placeholder: "Search notifications...",
476
- value: x,
477
- onChange: (e) => S(e.target.value),
478
- className: "w-full rounded-lg border border-border-seam 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)]"
479
- }),
480
- x && /* @__PURE__ */ A("button", {
481
- type: "button",
482
- onClick: () => S(""),
483
- className: "absolute right-3 top-1/2 -translate-y-1/2 text-text-secondary hover:text-text-primary",
484
- children: /* @__PURE__ */ A(O, { className: "h-4 w-4" })
485
- })
486
- ]
487
- }), /* @__PURE__ */ j("div", {
488
- className: "relative",
489
- children: [/* @__PURE__ */ j("button", {
490
- type: "button",
491
- onClick: () => D(!E),
492
- className: "flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-2.5 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
493
- children: [/* @__PURE__ */ A(u, { className: "h-4 w-4" }), /* @__PURE__ */ A("span", {
494
- className: "hidden sm:inline",
495
- children: "Sort"
496
- })]
497
- }), E && /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A("div", {
498
- className: "fixed inset-0 z-10",
499
- onClick: () => D(!1)
500
- }), /* @__PURE__ */ A("div", {
501
- className: "absolute right-0 top-full mt-1 z-20 w-44 rounded-lg border border-border-seam bg-bg-surface shadow-lg py-1",
502
- children: [
503
- {
504
- value: "recent",
505
- label: "Most Recent"
506
- },
507
- {
508
- value: "priority",
509
- label: "By Priority"
510
- },
511
- {
512
- value: "unread",
513
- label: "Unread First"
514
- }
515
- ].map((e) => /* @__PURE__ */ A("button", {
516
- type: "button",
517
- onClick: () => {
518
- T(e.value), D(!1);
519
- },
520
- 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"),
521
- children: e.label
522
- }, e.value))
523
- })] })]
524
- })]
525
- }),
526
- q.length === 0 ? /* @__PURE__ */ A(r, {
527
- illustration: "empty-notifications",
528
- icon: /* @__PURE__ */ A(d, { className: "h-12 w-12" }),
529
- title: "No notifications",
530
- 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.",
531
- action: x ? /* @__PURE__ */ A("button", {
532
- type: "button",
533
- onClick: () => S(""),
534
- className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
535
- children: "Clear Search"
536
- }) : g === "all" ? void 0 : /* @__PURE__ */ A("button", {
537
- type: "button",
538
- onClick: () => v("all"),
539
- className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
540
- children: "View All Notifications"
541
- })
542
- }) : /* @__PURE__ */ A("div", {
543
- className: "space-y-6",
544
- children: J.map((e) => /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ j("div", {
545
- className: "flex items-center gap-3 mb-2",
546
- children: [
547
- /* @__PURE__ */ A("h3", {
548
- className: "text-xs font-semibold uppercase tracking-wider text-text-secondary",
549
- children: e.label
550
- }),
551
- /* @__PURE__ */ A("div", { className: "flex-1 border-t border-border-seam" }),
552
- /* @__PURE__ */ j("span", {
553
- className: "text-xs text-text-secondary",
554
- children: [
555
- e.items.length,
556
- " notification",
557
- e.items.length === 1 ? "" : "s"
558
- ]
559
- })
560
- ]
561
- }), /* @__PURE__ */ A("div", {
562
- className: "rounded-lg border border-border-seam bg-bg-surface divide-y divide-border overflow-hidden",
563
- children: e.items.map((e) => {
564
- let n = F[e.type] ?? F.system, r = n.icon;
565
- return /* @__PURE__ */ j("div", {
566
- className: t("flex items-start gap-3 px-4 py-4 border-l-4 transition-colors", L[e.priority], !e.isRead && "bg-accent/30"),
567
- children: [
568
- /* @__PURE__ */ A("div", {
569
- className: t("flex h-10 w-10 shrink-0 items-center justify-center rounded-full", n.bg),
570
- children: /* @__PURE__ */ A(r, { className: t("h-5 w-5", n.color) })
571
- }),
572
- /* @__PURE__ */ j("div", {
573
- className: "flex-1 min-w-0",
574
- children: [
575
- /* @__PURE__ */ j("div", {
576
- className: "flex items-center gap-2 flex-wrap",
577
- children: [
578
- /* @__PURE__ */ A("h4", {
579
- className: t("text-sm text-text-primary", e.isRead ? "font-medium" : "font-semibold"),
580
- children: e.title
581
- }),
582
- !e.isRead && /* @__PURE__ */ A("span", { className: "h-2 w-2 rounded-full bg-action-primary-bg shrink-0" }),
583
- /* @__PURE__ */ A("span", {
584
- className: t("inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium", I[e.priority]),
585
- children: e.priority
586
- })
587
- ]
588
- }),
589
- /* @__PURE__ */ A("p", {
590
- className: "mt-1 text-sm text-text-secondary leading-relaxed",
591
- children: e.message
592
- }),
593
- /* @__PURE__ */ j("div", {
594
- className: "mt-2 flex items-center gap-3 flex-wrap",
595
- children: [
596
- /* @__PURE__ */ j("span", {
597
- className: "flex items-center gap-1 text-xs text-text-secondary",
598
- children: [/* @__PURE__ */ A(m, { className: "h-3 w-3" }), i(e.createdAt)]
599
- }),
600
- /* @__PURE__ */ A("span", {
601
- className: t("inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium", n.bg, n.color),
602
- children: n.label
603
- }),
604
- e.metadata?.orderId && /* @__PURE__ */ j("span", {
605
- className: "text-xs text-text-secondary",
606
- children: ["#", e.metadata.orderId]
607
- })
608
- ]
609
- }),
610
- /* @__PURE__ */ j("div", {
611
- className: "mt-3 flex items-center gap-2 flex-wrap",
612
- children: [
613
- e.actionUrl && /* @__PURE__ */ A("button", {
614
- type: "button",
615
- onClick: () => Q(e),
616
- 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",
617
- children: e.actionText ?? "View"
618
- }),
619
- !e.isRead && /* @__PURE__ */ j("button", {
620
- type: "button",
621
- onClick: () => Y(e.id),
622
- title: "Mark as read",
623
- className: "flex items-center gap-1 rounded-lg border border-border-seam px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-accent transition-colors",
624
- children: [/* @__PURE__ */ A(f, { className: "h-3 w-3" }), "Mark Read"]
625
- }),
626
- /* @__PURE__ */ j("button", {
627
- type: "button",
628
- onClick: () => Z(e.id),
629
- title: "Delete notification",
630
- className: "flex items-center gap-1 rounded-lg border border-border-seam px-3 py-1.5 text-xs font-medium text-status-error-text hover:bg-status-error-bg/10 transition-colors",
631
- children: [/* @__PURE__ */ A(C, { className: "h-3 w-3" }), "Delete"]
632
- })
633
- ]
634
- })
635
- ]
636
- }),
637
- /* @__PURE__ */ A("div", {
638
- className: "shrink-0 pt-1",
639
- children: e.isRead ? /* @__PURE__ */ A(_, { className: "h-4 w-4 text-text-secondary/40" }) : /* @__PURE__ */ A(d, { className: "h-4 w-4 text-primary" })
640
- })
641
- ]
642
- }, e.id);
643
- })
644
- })] }, e.label))
645
- }),
646
- q.length > 0 && /* @__PURE__ */ j("div", {
647
- className: "mt-6 flex items-center justify-between rounded-lg border border-border-seam bg-bg-surface px-4 py-3",
648
- children: [/* @__PURE__ */ j("p", {
649
- className: "text-sm text-text-secondary",
650
- children: [
651
- "Showing ",
652
- q.length,
653
- " of ",
654
- l.length,
655
- " notifications"
656
- ]
657
- }), g !== "all" && /* @__PURE__ */ j("button", {
658
- type: "button",
659
- onClick: () => {
660
- v("all"), S("");
661
- },
662
- className: "flex items-center gap-1.5 text-sm font-medium text-primary hover:underline",
663
- children: [/* @__PURE__ */ A(y, { className: "h-3.5 w-3.5" }), "Show All"]
664
- })]
665
- })
666
- ]
667
- });
668
- }
669
- //#endregion
670
- export { H as NotificationCenterPage };
671
-
672
- //# sourceMappingURL=NotificationCenterPage.js.map