@nice2dev/templates 1.1.10 → 1.2.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.
package/dist/index.mjs CHANGED
@@ -1,9 +1,10 @@
1
- var Y = Object.defineProperty;
2
- var _ = (s, e, t) => e in s ? Y(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
- var w = (s, e, t) => _(s, typeof e != "symbol" ? e + "" : e, t);
1
+ var X = Object.defineProperty;
2
+ var J = (s, e, t) => e in s ? X(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
+ var w = (s, e, t) => J(s, typeof e != "symbol" ? e + "" : e, t);
4
4
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
- import { createContext as W, useContext as F, useState as S, useCallback as L, useMemo as z, useEffect as X } from "react";
6
- const J = [
5
+ import { useContext as W, useState as S, useCallback as F, createContext as L, useMemo as z, useEffect as Z } from "react";
6
+ import { NtdArrowUp as N, NtdArrowDown as H, NtdDownload as ee, NtdUpload as te } from "@nice2dev/icons";
7
+ const re = [
7
8
  {
8
9
  id: "apple",
9
10
  name: "Apple",
@@ -111,7 +112,7 @@ const J = [
111
112
  fiber: 3.5
112
113
  }
113
114
  ];
114
- class Z {
115
+ class ne {
115
116
  constructor() {
116
117
  w(this, "workouts", /* @__PURE__ */ new Map());
117
118
  w(this, "meals", /* @__PURE__ */ new Map());
@@ -121,7 +122,7 @@ class Z {
121
122
  w(this, "medicationLogs", []);
122
123
  w(this, "vitals", []);
123
124
  w(this, "goals", []);
124
- w(this, "foodDatabase", [...J]);
125
+ w(this, "foodDatabase", [...re]);
125
126
  }
126
127
  /* ─────────────────────────────────────────────────────────────
127
128
  WORKOUTS
@@ -381,12 +382,12 @@ class Z {
381
382
  this.workouts.clear(), this.meals.clear(), this.sleep.clear(), this.medicalRecords.clear(), this.medications.clear(), this.medicationLogs = [], this.vitals = [], this.goals = [];
382
383
  }
383
384
  }
384
- function Ue() {
385
- return new Z();
385
+ function Ee() {
386
+ return new ne();
386
387
  }
387
- const $ = W(null);
388
- function Ne() {
389
- const s = F($);
388
+ const E = /* @__PURE__ */ L(null);
389
+ function Ve() {
390
+ const s = W(E);
390
391
  if (!s)
391
392
  throw new Error("useHealth must be used within HealthProvider");
392
393
  return s;
@@ -462,8 +463,8 @@ const h = {
462
463
  borderBottom: "1px solid #f0f0f0"
463
464
  }
464
465
  };
465
- function He({ service: s, className: e, style: t }) {
466
- const [, r] = S(0), [n, o] = S("overview"), l = L(() => r((g) => g + 1), []), d = { service: s, refresh: l }, c = [
466
+ function Oe({ service: s, className: e, style: t }) {
467
+ const [, r] = S(0), [n, o] = S("overview"), l = F(() => r((g) => g + 1), []), d = { service: s, refresh: l }, c = [
467
468
  { id: "overview", label: "Overview" },
468
469
  { id: "workouts", label: "Workouts" },
469
470
  { id: "nutrition", label: "Nutrition" },
@@ -471,7 +472,7 @@ function He({ service: s, className: e, style: t }) {
471
472
  { id: "medical", label: "Medical" },
472
473
  { id: "medications", label: "Medications" }
473
474
  ];
474
- return /* @__PURE__ */ i($.Provider, { value: d, children: /* @__PURE__ */ a("div", { className: e, style: { ...h.container, ...t }, children: [
475
+ return /* @__PURE__ */ i(E.Provider, { value: d, children: /* @__PURE__ */ a("div", { className: e, style: { ...h.container, ...t }, children: [
475
476
  /* @__PURE__ */ i("div", { style: h.sidebar, children: c.map((g) => /* @__PURE__ */ i(
476
477
  "div",
477
478
  {
@@ -487,16 +488,16 @@ function He({ service: s, className: e, style: t }) {
487
488
  g.id
488
489
  )) }),
489
490
  /* @__PURE__ */ a("div", { style: h.main, children: [
490
- n === "overview" && /* @__PURE__ */ i(ee, { service: s }),
491
- n === "workouts" && /* @__PURE__ */ i(te, { service: s, refresh: l }),
492
- n === "nutrition" && /* @__PURE__ */ i(re, { service: s }),
493
- n === "sleep" && /* @__PURE__ */ i(ne, { service: s }),
494
- n === "medical" && /* @__PURE__ */ i(ie, { service: s }),
495
- n === "medications" && /* @__PURE__ */ i(oe, { service: s, refresh: l })
491
+ n === "overview" && /* @__PURE__ */ i(ie, { service: s }),
492
+ n === "workouts" && /* @__PURE__ */ i(oe, { service: s, refresh: l }),
493
+ n === "nutrition" && /* @__PURE__ */ i(se, { service: s }),
494
+ n === "sleep" && /* @__PURE__ */ i(ae, { service: s }),
495
+ n === "medical" && /* @__PURE__ */ i(le, { service: s }),
496
+ n === "medications" && /* @__PURE__ */ i(de, { service: s, refresh: l })
496
497
  ] })
497
498
  ] }) });
498
499
  }
499
- function ee({ service: s }) {
500
+ function ie({ service: s }) {
500
501
  const e = s.getWorkoutStats(7), t = s.getSleepStats(7), r = s.getDailyNutrition(/* @__PURE__ */ new Date()), n = s.getLatestVitals(), o = s.getTodayMedicationSchedule();
501
502
  return /* @__PURE__ */ a("div", { children: [
502
503
  /* @__PURE__ */ i("h2", { style: { marginBottom: "20px" }, children: "Health Overview" }),
@@ -604,7 +605,7 @@ function ee({ service: s }) {
604
605
  ] })
605
606
  ] });
606
607
  }
607
- function te({
608
+ function oe({
608
609
  service: s,
609
610
  refresh: e
610
611
  }) {
@@ -658,7 +659,7 @@ function te({
658
659
  ] })
659
660
  ] });
660
661
  }
661
- function re({ service: s }) {
662
+ function se({ service: s }) {
662
663
  const e = s.getDailyNutrition(/* @__PURE__ */ new Date()), t = s.getMealsForDate(/* @__PURE__ */ new Date()), r = { calories: 2e3, protein: 150, carbs: 250, fat: 65 };
663
664
  return /* @__PURE__ */ a("div", { children: [
664
665
  /* @__PURE__ */ i("h2", { style: { marginBottom: "20px" }, children: "Nutrition" }),
@@ -711,7 +712,7 @@ function re({ service: s }) {
711
712
  ] })
712
713
  ] });
713
714
  }
714
- function ne({ service: s }) {
715
+ function ae({ service: s }) {
715
716
  const e = s.getSleepStats(7), t = s.getAllSleepEntries(), r = {
716
717
  poor: "#f44336",
717
718
  fair: "#ff9800",
@@ -762,7 +763,7 @@ function ne({ service: s }) {
762
763
  ] })
763
764
  ] });
764
765
  }
765
- function ie({ service: s }) {
766
+ function le({ service: s }) {
766
767
  const e = s.getAllMedicalRecords(), t = s.getUpcomingFollowUps(), r = {
767
768
  appointment: "Appt",
768
769
  "lab-result": "Lab",
@@ -803,7 +804,7 @@ function ie({ service: s }) {
803
804
  ] })
804
805
  ] });
805
806
  }
806
- function oe({
807
+ function de({
807
808
  service: s,
808
809
  refresh: e
809
810
  }) {
@@ -860,7 +861,7 @@ function oe({
860
861
  ] })
861
862
  ] });
862
863
  }
863
- const se = [
864
+ const ce = [
864
865
  { id: "income", name: "Income", icon: "dollar", color: "#4caf50" },
865
866
  { id: "salary", name: "Salary", icon: "briefcase", color: "#4caf50", parent: "income" },
866
867
  { id: "interest", name: "Interest", icon: "building", color: "#4caf50", parent: "income" },
@@ -883,14 +884,14 @@ const se = [
883
884
  { id: "transfer", name: "Transfer", icon: "shuffle", color: "#9e9e9e" },
884
885
  { id: "other", name: "Other", icon: "box", color: "#9e9e9e" }
885
886
  ];
886
- class ae {
887
+ class ue {
887
888
  constructor() {
888
889
  w(this, "accounts", /* @__PURE__ */ new Map());
889
890
  w(this, "transactions", /* @__PURE__ */ new Map());
890
891
  w(this, "budgets", /* @__PURE__ */ new Map());
891
892
  w(this, "bills", /* @__PURE__ */ new Map());
892
893
  w(this, "investments", /* @__PURE__ */ new Map());
893
- w(this, "categories", [...se]);
894
+ w(this, "categories", [...ce]);
894
895
  w(this, "netWorthHistory", []);
895
896
  }
896
897
  /* ─────────────────────────────────────────────────────────────
@@ -1178,12 +1179,12 @@ class ae {
1178
1179
  );
1179
1180
  }
1180
1181
  }
1181
- function $e() {
1182
- return new ae();
1182
+ function Ge() {
1183
+ return new ue();
1183
1184
  }
1184
- const j = W(null);
1185
- function je() {
1186
- const s = F(j);
1185
+ const V = /* @__PURE__ */ L(null);
1186
+ function qe() {
1187
+ const s = W(V);
1187
1188
  if (!s)
1188
1189
  throw new Error("usePersonalFinance must be used within PersonalFinanceProvider");
1189
1190
  return s;
@@ -1270,13 +1271,13 @@ const m = {
1270
1271
  marginTop: "8px"
1271
1272
  }
1272
1273
  };
1273
- function Ee({
1274
+ function Ke({
1274
1275
  service: s,
1275
1276
  className: e,
1276
1277
  style: t
1277
1278
  }) {
1278
- const [, r] = S(0), [n, o] = S("overview"), l = L(() => r((p) => p + 1), []), d = { service: s, refresh: l }, c = (p) => new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(p), g = s.getAllAccounts(), u = s.calculateNetWorth();
1279
- return /* @__PURE__ */ i(j.Provider, { value: d, children: /* @__PURE__ */ a("div", { className: e, style: { ...m.container, ...t }, children: [
1279
+ const [, r] = S(0), [n, o] = S("overview"), l = F(() => r((p) => p + 1), []), d = { service: s, refresh: l }, c = (p) => new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(p), g = s.getAllAccounts(), u = s.calculateNetWorth();
1280
+ return /* @__PURE__ */ i(V.Provider, { value: d, children: /* @__PURE__ */ a("div", { className: e, style: { ...m.container, ...t }, children: [
1280
1281
  /* @__PURE__ */ a("div", { style: m.sidebar, children: [
1281
1282
  /* @__PURE__ */ a("div", { style: m.netWorth, children: [
1282
1283
  /* @__PURE__ */ i("div", { style: m.netWorthLabel, children: "Net Worth" }),
@@ -1325,16 +1326,16 @@ function Ee({
1325
1326
  ] })
1326
1327
  ] }),
1327
1328
  /* @__PURE__ */ a("div", { style: m.main, children: [
1328
- n === "overview" && /* @__PURE__ */ i(le, { service: s }),
1329
- n === "accounts" && /* @__PURE__ */ i(de, { service: s, refresh: l }),
1330
- n === "transactions" && /* @__PURE__ */ i(ce, { service: s }),
1331
- n === "budgets" && /* @__PURE__ */ i(ue, { service: s }),
1332
- n === "bills" && /* @__PURE__ */ i(ge, { service: s }),
1333
- n === "investments" && /* @__PURE__ */ i(he, { service: s })
1329
+ n === "overview" && /* @__PURE__ */ i(ge, { service: s }),
1330
+ n === "accounts" && /* @__PURE__ */ i(he, { service: s, refresh: l }),
1331
+ n === "transactions" && /* @__PURE__ */ i(pe, { service: s }),
1332
+ n === "budgets" && /* @__PURE__ */ i(fe, { service: s }),
1333
+ n === "bills" && /* @__PURE__ */ i(me, { service: s }),
1334
+ n === "investments" && /* @__PURE__ */ i(ye, { service: s })
1334
1335
  ] })
1335
1336
  ] }) });
1336
1337
  }
1337
- function le({ service: s }) {
1338
+ function ge({ service: s }) {
1338
1339
  const e = (g) => new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(g), t = s.getMonthlyIncome(), r = s.getMonthlyExpenses(), n = s.getSavingsRate(), o = s.calculateBudgetStatus(), l = s.getUpcomingBills(14), d = /* @__PURE__ */ new Date(), c = s.getSpendingSummary(new Date(d.getFullYear(), d.getMonth(), 1), d);
1339
1340
  return /* @__PURE__ */ a("div", { children: [
1340
1341
  /* @__PURE__ */ i("h2", { style: { marginBottom: "20px" }, children: "Financial Overview" }),
@@ -1454,7 +1455,7 @@ function le({ service: s }) {
1454
1455
  ] })
1455
1456
  ] });
1456
1457
  }
1457
- function de({
1458
+ function he({
1458
1459
  service: s,
1459
1460
  refresh: e
1460
1461
  }) {
@@ -1495,7 +1496,7 @@ function de({
1495
1496
  })
1496
1497
  ] });
1497
1498
  }
1498
- function ce({ service: s }) {
1499
+ function pe({ service: s }) {
1499
1500
  const e = (o) => new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(o), t = s.getAllTransactions(), r = s.getAllCategories(), n = (o) => {
1500
1501
  var l;
1501
1502
  return ((l = r.find((d) => d.id === o)) == null ? void 0 : l.name) || "Uncategorized";
@@ -1524,7 +1525,7 @@ function ce({ service: s }) {
1524
1525
  ] }, o.id)) })
1525
1526
  ] });
1526
1527
  }
1527
- function ue({ service: s }) {
1528
+ function fe({ service: s }) {
1528
1529
  const e = (o) => new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(o), t = s.getAllBudgets(), r = s.getAllCategories(), n = (o) => {
1529
1530
  var l;
1530
1531
  return ((l = r.find((d) => d.id === o)) == null ? void 0 : l.name) || "Unknown";
@@ -1581,7 +1582,7 @@ function ue({ service: s }) {
1581
1582
  }) })
1582
1583
  ] });
1583
1584
  }
1584
- function ge({ service: s }) {
1585
+ function me({ service: s }) {
1585
1586
  const e = (n) => new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(n), t = s.getAllBills(), r = s.calculateMonthlyBillTotal();
1586
1587
  return /* @__PURE__ */ a("div", { children: [
1587
1588
  /* @__PURE__ */ i("h2", { style: { marginBottom: "20px" }, children: "Bills & Subscriptions" }),
@@ -1604,7 +1605,7 @@ function ge({ service: s }) {
1604
1605
  ] }, n.id)) })
1605
1606
  ] });
1606
1607
  }
1607
- function he({ service: s }) {
1608
+ function ye({ service: s }) {
1608
1609
  const e = (l) => new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(l), t = s.getAllInvestments(), r = s.calculateTotalInvestmentValue(), n = s.calculateTotalGain(), o = s.getPortfolioAllocation();
1609
1610
  return /* @__PURE__ */ a("div", { children: [
1610
1611
  /* @__PURE__ */ i("h2", { style: { marginBottom: "20px" }, children: "Investments" }),
@@ -1679,14 +1680,14 @@ function he({ service: s }) {
1679
1680
  ] })
1680
1681
  ] });
1681
1682
  }
1682
- const N = {
1683
+ const $ = {
1683
1684
  urgent: 0,
1684
1685
  high: 1,
1685
1686
  medium: 2,
1686
1687
  low: 3,
1687
1688
  none: 4
1688
1689
  };
1689
- class pe {
1690
+ class xe {
1690
1691
  constructor() {
1691
1692
  w(this, "tasks", /* @__PURE__ */ new Map());
1692
1693
  w(this, "projects", /* @__PURE__ */ new Map());
@@ -1879,7 +1880,7 @@ class pe {
1879
1880
  break;
1880
1881
  }
1881
1882
  case "priority":
1882
- d = N[o.priority] - N[l.priority];
1883
+ d = $[o.priority] - $[l.priority];
1883
1884
  break;
1884
1885
  case "createdAt":
1885
1886
  d = new Date(o.createdAt).getTime() - new Date(l.createdAt).getTime();
@@ -2062,12 +2063,12 @@ class pe {
2062
2063
  this.tasks.clear(), this.projects.clear(), this.tags.clear(), this.timeBlocks.clear();
2063
2064
  }
2064
2065
  }
2065
- function Ve() {
2066
- return new pe();
2066
+ function Qe() {
2067
+ return new xe();
2067
2068
  }
2068
- const E = W(null);
2069
- function Oe() {
2070
- const s = F(E);
2069
+ const O = /* @__PURE__ */ L(null);
2070
+ function Ye() {
2071
+ const s = W(O);
2071
2072
  if (!s)
2072
2073
  throw new Error("useTaskManager must be used within TaskManagerProvider");
2073
2074
  return s;
@@ -2194,25 +2195,25 @@ const k = {
2194
2195
  padding: "16px",
2195
2196
  overflow: "auto"
2196
2197
  }
2197
- }, H = {
2198
+ }, j = {
2198
2199
  urgent: "#f44336",
2199
2200
  high: "#ff9800",
2200
2201
  medium: "#2196f3",
2201
2202
  low: "#4caf50",
2202
2203
  none: "#e0e0e0"
2203
2204
  };
2204
- function Ge({
2205
+ function _e({
2205
2206
  service: s,
2206
2207
  className: e,
2207
2208
  style: t
2208
2209
  }) {
2209
2210
  var M;
2210
- const [, r] = S(0), [n, o] = S("inbox"), [l, d] = S(null), [c, g] = S(""), u = L(() => r((T) => T + 1), []), p = { service: s, refresh: u }, y = s.getStatistics(), f = s.getAllProjects(), b = () => {
2211
+ const [, r] = S(0), [n, o] = S("inbox"), [l, d] = S(null), [c, g] = S(""), u = F(() => r((T) => T + 1), []), p = { service: s, refresh: u }, y = s.getStatistics(), f = s.getAllProjects(), b = () => {
2211
2212
  c.trim() && (s.quickAddTask(c), g(""), u());
2212
2213
  }, D = (T, P) => {
2213
2214
  o(T), d(P ?? null);
2214
2215
  };
2215
- return /* @__PURE__ */ i(E.Provider, { value: p, children: /* @__PURE__ */ a("div", { className: e, style: { ...k.container, ...t }, children: [
2216
+ return /* @__PURE__ */ i(O.Provider, { value: p, children: /* @__PURE__ */ a("div", { className: e, style: { ...k.container, ...t }, children: [
2216
2217
  /* @__PURE__ */ a("div", { style: k.sidebar, children: [
2217
2218
  /* @__PURE__ */ a(
2218
2219
  "div",
@@ -2341,8 +2342,8 @@ function Ge({
2341
2342
  style: k.taskInput
2342
2343
  }
2343
2344
  ),
2344
- n === "matrix" ? /* @__PURE__ */ i(me, { service: s, onComplete: u }) : /* @__PURE__ */ i(
2345
- fe,
2345
+ n === "matrix" ? /* @__PURE__ */ i(ve, { service: s, onComplete: u }) : /* @__PURE__ */ i(
2346
+ be,
2346
2347
  {
2347
2348
  service: s,
2348
2349
  view: n,
@@ -2353,7 +2354,7 @@ function Ge({
2353
2354
  ] })
2354
2355
  ] }) });
2355
2356
  }
2356
- function fe({
2357
+ function be({
2357
2358
  service: s,
2358
2359
  view: e,
2359
2360
  projectId: t,
@@ -2378,9 +2379,9 @@ function fe({
2378
2379
  return [];
2379
2380
  }
2380
2381
  }, [s, e, t]);
2381
- return n.length === 0 ? /* @__PURE__ */ i("div", { style: { textAlign: "center", padding: "60px", color: "#999" }, children: /* @__PURE__ */ i("div", { children: "No tasks here!" }) }) : /* @__PURE__ */ i("div", { children: n.map((o) => /* @__PURE__ */ i(V, { task: o, service: s, onComplete: r }, o.id)) });
2382
+ return n.length === 0 ? /* @__PURE__ */ i("div", { style: { textAlign: "center", padding: "60px", color: "#999" }, children: /* @__PURE__ */ i("div", { children: "No tasks here!" }) }) : /* @__PURE__ */ i("div", { children: n.map((o) => /* @__PURE__ */ i(G, { task: o, service: s, onComplete: r }, o.id)) });
2382
2383
  }
2383
- function V({
2384
+ function G({
2384
2385
  task: s,
2385
2386
  service: e,
2386
2387
  onComplete: t
@@ -2397,7 +2398,7 @@ function V({
2397
2398
  /* @__PURE__ */ i(
2398
2399
  "div",
2399
2400
  {
2400
- style: { ...k.priorityIndicator, backgroundColor: H[s.priority] }
2401
+ style: { ...k.priorityIndicator, backgroundColor: j[s.priority] }
2401
2402
  }
2402
2403
  ),
2403
2404
  /* @__PURE__ */ i(
@@ -2406,7 +2407,7 @@ function V({
2406
2407
  onClick: r,
2407
2408
  style: {
2408
2409
  ...k.checkbox,
2409
- borderColor: H[s.priority]
2410
+ borderColor: j[s.priority]
2410
2411
  }
2411
2412
  }
2412
2413
  ),
@@ -2423,7 +2424,7 @@ function V({
2423
2424
  ] })
2424
2425
  ] });
2425
2426
  }
2426
- function me({
2427
+ function ve({
2427
2428
  service: s,
2428
2429
  onComplete: e
2429
2430
  }) {
@@ -2446,7 +2447,7 @@ function me({
2446
2447
  children: [
2447
2448
  /* @__PURE__ */ i("div", { style: { fontWeight: 600, marginBottom: "8px" }, children: o.name }),
2448
2449
  /* @__PURE__ */ i("div", { style: { fontSize: "12px", color: "#666", marginBottom: "12px" }, children: o.description }),
2449
- o.tasks.map((d) => /* @__PURE__ */ i(V, { task: d, service: s, onComplete: e }, d.id)),
2450
+ o.tasks.map((d) => /* @__PURE__ */ i(G, { task: d, service: s, onComplete: e }, d.id)),
2450
2451
  o.tasks.length === 0 && /* @__PURE__ */ i("div", { style: { color: "#999", textAlign: "center", padding: "20px" }, children: "Empty" })
2451
2452
  ]
2452
2453
  },
@@ -2454,7 +2455,7 @@ function me({
2454
2455
  );
2455
2456
  }) });
2456
2457
  }
2457
- class ye {
2458
+ class we {
2458
2459
  constructor() {
2459
2460
  w(this, "kpis", /* @__PURE__ */ new Map());
2460
2461
  w(this, "goals", /* @__PURE__ */ new Map());
@@ -2706,12 +2707,12 @@ class ye {
2706
2707
  this.kpis.clear(), this.goals.clear(), this.habits.clear(), this.moodEntries.clear();
2707
2708
  }
2708
2709
  }
2709
- function qe() {
2710
- return new ye();
2710
+ function Xe() {
2711
+ return new we();
2711
2712
  }
2712
- const O = W(null);
2713
- function Ke() {
2714
- const s = F(O);
2713
+ const q = /* @__PURE__ */ L(null);
2714
+ function Je() {
2715
+ const s = W(q);
2715
2716
  if (!s)
2716
2717
  throw new Error("useLifeDashboard must be used within LifeDashboardProvider");
2717
2718
  return s;
@@ -2806,15 +2807,15 @@ const v = {
2806
2807
  color: "#1565c0"
2807
2808
  }
2808
2809
  };
2809
- function Qe({
2810
+ function Ze({
2810
2811
  service: s,
2811
2812
  className: e,
2812
2813
  style: t
2813
2814
  }) {
2814
- const [, r] = S(0), n = L(() => {
2815
+ const [, r] = S(0), n = F(() => {
2815
2816
  r((f) => f + 1);
2816
2817
  }, []), o = { service: s, refresh: n }, l = s.generateDailyInsights(), d = s.getAllKPIs(), c = s.getTodayHabitStatus(), g = s.getActiveGoals(), u = s.getFinanceSummary(), p = s.calculateFinanceHealth(), y = (f) => new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(f);
2817
- return /* @__PURE__ */ i(O.Provider, { value: o, children: /* @__PURE__ */ a("div", { className: e, style: { ...v.dashboard, ...t }, children: [
2818
+ return /* @__PURE__ */ i(q.Provider, { value: o, children: /* @__PURE__ */ a("div", { className: e, style: { ...v.dashboard, ...t }, children: [
2818
2819
  /* @__PURE__ */ a("div", { style: v.header, children: [
2819
2820
  /* @__PURE__ */ i("div", { style: v.title, children: "Life Dashboard" }),
2820
2821
  /* @__PURE__ */ i("div", { style: { color: "#666" }, children: (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", {
@@ -2846,8 +2847,14 @@ function Qe({
2846
2847
  f.unit ? ` ${f.unit}` : "",
2847
2848
  " / ",
2848
2849
  f.targetValue,
2849
- f.trend === "up" && " ↑",
2850
- f.trend === "down" && " ↓"
2850
+ f.trend === "up" && /* @__PURE__ */ i(N, { size: 12, style: { marginLeft: 4, verticalAlign: "-1px" } }),
2851
+ f.trend === "down" && /* @__PURE__ */ i(
2852
+ H,
2853
+ {
2854
+ size: 12,
2855
+ style: { marginLeft: 4, verticalAlign: "-1px" }
2856
+ }
2857
+ )
2851
2858
  ] })
2852
2859
  ]
2853
2860
  }
@@ -2995,7 +3002,7 @@ function Qe({
2995
3002
  /* @__PURE__ */ i("div", { style: v.cardTitle, children: "Mood & Health" }),
2996
3003
  /* @__PURE__ */ a("div", { style: { display: "flex", justifyContent: "space-around", marginBottom: "20px" }, children: [
2997
3004
  /* @__PURE__ */ a("div", { style: { textAlign: "center" }, children: [
2998
- /* @__PURE__ */ i("div", { style: v.moodEmoji, children: xe(Math.round(s.getAverageMood(7))) }),
3005
+ /* @__PURE__ */ i("div", { style: v.moodEmoji, children: ke(Math.round(s.getAverageMood(7))) }),
2999
3006
  /* @__PURE__ */ i("div", { style: { fontSize: "12px", color: "#666" }, children: "Avg Mood (7d)" })
3000
3007
  ] }),
3001
3008
  /* @__PURE__ */ a("div", { style: { textAlign: "center" }, children: [
@@ -3009,7 +3016,7 @@ function Qe({
3009
3016
  s.getMoodCorrelations().slice(0, 2).map((f) => /* @__PURE__ */ a("div", { style: v.statRow, children: [
3010
3017
  /* @__PURE__ */ i("span", { children: f.factor }),
3011
3018
  /* @__PURE__ */ a("span", { style: { color: f.correlation > 0 ? "#4caf50" : "#f44336" }, children: [
3012
- f.correlation > 0 ? "↑" : "↓",
3019
+ f.correlation > 0 ? /* @__PURE__ */ i(N, { size: 12, style: { verticalAlign: "-1px" } }) : /* @__PURE__ */ i(H, { size: 12, style: { verticalAlign: "-1px" } }),
3013
3020
  " ",
3014
3021
  Math.abs(f.correlation * 100).toFixed(0),
3015
3022
  "%"
@@ -3019,7 +3026,7 @@ function Qe({
3019
3026
  ] })
3020
3027
  ] }) });
3021
3028
  }
3022
- function xe(s) {
3029
+ function ke(s) {
3023
3030
  return {
3024
3031
  1: "Very low",
3025
3032
  2: "Low",
@@ -3028,7 +3035,7 @@ function xe(s) {
3028
3035
  5: "Great"
3029
3036
  }[s] || "Neutral";
3030
3037
  }
3031
- const be = {
3038
+ const Se = {
3032
3039
  colors: {
3033
3040
  background: "#1a1a2e",
3034
3041
  surface: "#16213e",
@@ -3050,7 +3057,7 @@ const be = {
3050
3057
  },
3051
3058
  borderRadius: "8px",
3052
3059
  fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
3053
- }, ve = [
3060
+ }, Te = [
3054
3061
  { id: "name", label: "Name", sortable: !0, visible: !0 },
3055
3062
  { id: "size", label: "Size", width: "100px", sortable: !0, visible: !0 },
3056
3063
  { id: "progress", label: "Progress", width: "150px", sortable: !0, visible: !0 },
@@ -3061,9 +3068,9 @@ const be = {
3061
3068
  { id: "uploadSpeed", label: "Up", width: "100px", sortable: !0, visible: !0 },
3062
3069
  { id: "eta", label: "ETA", width: "100px", sortable: !0, visible: !0 },
3063
3070
  { id: "ratio", label: "Ratio", width: "80px", sortable: !0, visible: !0 }
3064
- ], G = W(null);
3071
+ ], K = /* @__PURE__ */ L(null);
3065
3072
  function C() {
3066
- const s = F(G);
3073
+ const s = W(K);
3067
3074
  if (!s)
3068
3075
  throw new Error("useTorrentUI must be used within TorrentUIProvider");
3069
3076
  return s;
@@ -3077,7 +3084,7 @@ function R(s, e = 2) {
3077
3084
  function U(s) {
3078
3085
  return `${R(s)}/s`;
3079
3086
  }
3080
- function we(s) {
3087
+ function De(s) {
3081
3088
  if (!s || s <= 0)
3082
3089
  return "∞";
3083
3090
  if (s < 60)
@@ -3091,10 +3098,10 @@ function we(s) {
3091
3098
  const e = Math.floor(s / 86400), t = Math.floor(s % 86400 / 3600);
3092
3099
  return `${e}d ${t}h`;
3093
3100
  }
3094
- function q(s) {
3101
+ function Q(s) {
3095
3102
  return s.toFixed(2);
3096
3103
  }
3097
- function K(s, e) {
3104
+ function Y(s, e) {
3098
3105
  switch (s) {
3099
3106
  case "downloading":
3100
3107
  return e.colors.primary;
@@ -3112,18 +3119,18 @@ function K(s, e) {
3112
3119
  return e.colors.text;
3113
3120
  }
3114
3121
  }
3115
- function ke({
3122
+ function Ce({
3116
3123
  client: s,
3117
3124
  config: e = {},
3118
3125
  children: t
3119
3126
  }) {
3120
3127
  const r = z(
3121
- () => ({ ...be, ...e.theme }),
3128
+ () => ({ ...Se, ...e.theme }),
3122
3129
  [e.theme]
3123
- ), [n, o] = S([]), [l, d] = S(null), [c, g] = S("all"), [u, p] = S(""), y = L(() => {
3130
+ ), [n, o] = S([]), [l, d] = S(null), [c, g] = S("all"), [u, p] = S(""), y = F(() => {
3124
3131
  o(s.getAllTorrents());
3125
3132
  }, [s]);
3126
- X(() => {
3133
+ Z(() => {
3127
3134
  y();
3128
3135
  const b = setInterval(y, e.refreshInterval || 1e3), D = () => y(), M = () => y();
3129
3136
  return s.on("torrent_added", D), s.on("torrent_removed", M), () => {
@@ -3143,9 +3150,9 @@ function ke({
3143
3150
  setSearchQuery: p,
3144
3151
  refresh: y
3145
3152
  };
3146
- return /* @__PURE__ */ i(G.Provider, { value: f, children: /* @__PURE__ */ i("div", { style: { fontFamily: r.fontFamily, color: r.colors.text }, children: t }) });
3153
+ return /* @__PURE__ */ i(K.Provider, { value: f, children: /* @__PURE__ */ i("div", { style: { fontFamily: r.fontFamily, color: r.colors.text }, children: t }) });
3147
3154
  }
3148
- function Se({
3155
+ function Ae({
3149
3156
  progress: s,
3150
3157
  status: e,
3151
3158
  showLabel: t = !0,
@@ -3153,7 +3160,7 @@ function Se({
3153
3160
  className: n,
3154
3161
  style: o
3155
3162
  }) {
3156
- const { theme: l } = C(), d = Math.min(100, Math.max(0, s * 100)), c = K(e, l);
3163
+ const { theme: l } = C(), d = Math.min(100, Math.max(0, s * 100)), c = Y(e, l);
3157
3164
  return /* @__PURE__ */ a(
3158
3165
  "div",
3159
3166
  {
@@ -3196,8 +3203,8 @@ function Se({
3196
3203
  }
3197
3204
  );
3198
3205
  }
3199
- function Te({ status: s, className: e, style: t }) {
3200
- const { theme: r } = C(), n = K(s, r), o = {
3206
+ function Ie({ status: s, className: e, style: t }) {
3207
+ const { theme: r } = C(), n = Y(s, r), o = {
3201
3208
  downloading: "Downloading",
3202
3209
  seeding: "Seeding",
3203
3210
  paused: "Paused",
@@ -3239,13 +3246,13 @@ function Te({ status: s, className: e, style: t }) {
3239
3246
  }
3240
3247
  );
3241
3248
  }
3242
- function De({
3249
+ function Be({
3243
3250
  onTorrentSelect: s,
3244
3251
  onTorrentDoubleClick: e,
3245
3252
  className: t,
3246
3253
  style: r
3247
3254
  }) {
3248
- const { theme: n, torrents: o, filter: l, searchQuery: d, selectedTorrent: c, setSelectedTorrent: g, config: u } = C(), [p, y] = S(u.defaultSortBy || "name"), [f, b] = S(u.defaultSortOrder || "asc"), D = u.columns || ve, M = z(() => o.filter((x) => {
3255
+ const { theme: n, torrents: o, filter: l, searchQuery: d, selectedTorrent: c, setSelectedTorrent: g, config: u } = C(), [p, y] = S(u.defaultSortBy || "name"), [f, b] = S(u.defaultSortOrder || "asc"), D = u.columns || Te, M = z(() => o.filter((x) => {
3249
3256
  if (l !== "all") {
3250
3257
  if (l === "completed") {
3251
3258
  if (x.stats.progress < 1)
@@ -3292,7 +3299,7 @@ function De({
3292
3299
  return I < B ? f === "asc" ? -1 : 1 : I > B ? f === "asc" ? 1 : -1 : 0;
3293
3300
  }), [M, p, f]), P = (x) => {
3294
3301
  p === x ? b(f === "asc" ? "desc" : "asc") : (y(x), b("asc"));
3295
- }, Q = (x) => {
3302
+ }, _ = (x) => {
3296
3303
  g(x), s == null || s(x);
3297
3304
  };
3298
3305
  return /* @__PURE__ */ a(
@@ -3331,7 +3338,7 @@ function De({
3331
3338
  },
3332
3339
  children: [
3333
3340
  x.label,
3334
- p === x.id && /* @__PURE__ */ i("span", { children: f === "asc" ? "↑" : "↓" })
3341
+ p === x.id && (f === "asc" ? /* @__PURE__ */ i(N, { size: 12 }) : /* @__PURE__ */ i(H, { size: 12 }))
3335
3342
  ]
3336
3343
  },
3337
3344
  x.id
@@ -3349,12 +3356,12 @@ function De({
3349
3356
  children: "No torrents found"
3350
3357
  }
3351
3358
  ) : T.map((x) => /* @__PURE__ */ i(
3352
- Ce,
3359
+ Me,
3353
3360
  {
3354
3361
  torrent: x,
3355
3362
  columns: D,
3356
3363
  isSelected: c === x.metadata.infoHash,
3357
- onClick: () => Q(x.metadata.infoHash),
3364
+ onClick: () => _(x.metadata.infoHash),
3358
3365
  onDoubleClick: () => e == null ? void 0 : e(x.metadata.infoHash)
3359
3366
  },
3360
3367
  x.metadata.infoHash
@@ -3363,7 +3370,7 @@ function De({
3363
3370
  }
3364
3371
  );
3365
3372
  }
3366
- function Ce({
3373
+ function Me({
3367
3374
  torrent: s,
3368
3375
  columns: e,
3369
3376
  isSelected: t,
@@ -3383,9 +3390,9 @@ function Ce({
3383
3390
  case "size":
3384
3391
  return R(l.size);
3385
3392
  case "progress":
3386
- return /* @__PURE__ */ i(Se, { progress: d.progress, status: c, height: "16px" });
3393
+ return /* @__PURE__ */ i(Ae, { progress: d.progress, status: c, height: "16px" });
3387
3394
  case "status":
3388
- return /* @__PURE__ */ i(Te, { status: c });
3395
+ return /* @__PURE__ */ i(Ie, { status: c });
3389
3396
  case "seeds":
3390
3397
  return d.seeds;
3391
3398
  case "peers":
@@ -3395,9 +3402,9 @@ function Ce({
3395
3402
  case "uploadSpeed":
3396
3403
  return d.uploadSpeed > 0 ? U(d.uploadSpeed) : "-";
3397
3404
  case "eta":
3398
- return c === "downloading" ? we(d.eta) : "-";
3405
+ return c === "downloading" ? De(d.eta) : "-";
3399
3406
  case "ratio":
3400
- return q(d.ratio);
3407
+ return Q(d.ratio);
3401
3408
  default:
3402
3409
  return "-";
3403
3410
  }
@@ -3434,7 +3441,7 @@ function Ce({
3434
3441
  }
3435
3442
  );
3436
3443
  }
3437
- function Ae({ className: s, style: e }) {
3444
+ function Re({ className: s, style: e }) {
3438
3445
  const { theme: t, filter: r, setFilter: n, searchQuery: o, setSearchQuery: l, torrents: d } = C(), c = z(() => {
3439
3446
  const u = {
3440
3447
  all: d.length,
@@ -3519,7 +3526,7 @@ function Ae({ className: s, style: e }) {
3519
3526
  }
3520
3527
  );
3521
3528
  }
3522
- function Ie({
3529
+ function Pe({
3523
3530
  infoHash: s,
3524
3531
  className: e,
3525
3532
  style: t
@@ -3571,16 +3578,16 @@ function Ie({
3571
3578
  }
3572
3579
  ),
3573
3580
  /* @__PURE__ */ a("div", { style: { padding: r.spacing.md, maxHeight: "300px", overflowY: "auto" }, children: [
3574
- o === "files" && /* @__PURE__ */ i(Be, { files: u }),
3575
- o === "peers" && /* @__PURE__ */ i(Me, { peers: p }),
3576
- o === "trackers" && /* @__PURE__ */ i(Re, { trackers: y }),
3577
- o === "info" && /* @__PURE__ */ i(Pe, { metadata: c, stats: g, addedAt: d.addedAt })
3581
+ o === "files" && /* @__PURE__ */ i(ze, { files: u }),
3582
+ o === "peers" && /* @__PURE__ */ i(We, { peers: p }),
3583
+ o === "trackers" && /* @__PURE__ */ i(Fe, { trackers: y }),
3584
+ o === "info" && /* @__PURE__ */ i(Le, { metadata: c, stats: g, addedAt: d.addedAt })
3578
3585
  ] })
3579
3586
  ]
3580
3587
  }
3581
3588
  );
3582
3589
  }
3583
- function Be({ files: s }) {
3590
+ function ze({ files: s }) {
3584
3591
  const { theme: e } = C();
3585
3592
  return /* @__PURE__ */ i("div", { style: { display: "flex", flexDirection: "column", gap: e.spacing.xs }, children: s.map((t, r) => /* @__PURE__ */ a(
3586
3593
  "div",
@@ -3606,7 +3613,7 @@ function Be({ files: s }) {
3606
3613
  r
3607
3614
  )) });
3608
3615
  }
3609
- function Me({ peers: s }) {
3616
+ function We({ peers: s }) {
3610
3617
  const { theme: e } = C();
3611
3618
  return /* @__PURE__ */ i("div", { style: { display: "flex", flexDirection: "column", gap: e.spacing.xs }, children: s.length === 0 ? /* @__PURE__ */ i("div", { style: { color: e.colors.textSecondary }, children: "No peers connected" }) : s.map((t) => /* @__PURE__ */ a(
3612
3619
  "div",
@@ -3630,11 +3637,13 @@ function Me({ peers: s }) {
3630
3637
  ] }),
3631
3638
  /* @__PURE__ */ i("span", { style: { color: e.colors.textSecondary }, children: t.client || "Unknown" }),
3632
3639
  /* @__PURE__ */ a("span", { style: { color: e.colors.success }, children: [
3633
- "↓ ",
3640
+ /* @__PURE__ */ i(ee, { size: 12, style: { verticalAlign: "-1px" } }),
3641
+ " ",
3634
3642
  U(t.downloadSpeed)
3635
3643
  ] }),
3636
3644
  /* @__PURE__ */ a("span", { style: { color: e.colors.warning }, children: [
3637
- "↑ ",
3645
+ /* @__PURE__ */ i(te, { size: 12, style: { verticalAlign: "-1px" } }),
3646
+ " ",
3638
3647
  U(t.uploadSpeed)
3639
3648
  ] }),
3640
3649
  /* @__PURE__ */ a("span", { children: [
@@ -3646,7 +3655,7 @@ function Me({ peers: s }) {
3646
3655
  t.id
3647
3656
  )) });
3648
3657
  }
3649
- function Re({ trackers: s }) {
3658
+ function Fe({ trackers: s }) {
3650
3659
  const { theme: e } = C();
3651
3660
  return /* @__PURE__ */ i("div", { style: { display: "flex", flexDirection: "column", gap: e.spacing.xs }, children: s.map((t, r) => /* @__PURE__ */ a(
3652
3661
  "div",
@@ -3684,7 +3693,7 @@ function Re({ trackers: s }) {
3684
3693
  r
3685
3694
  )) });
3686
3695
  }
3687
- function Pe({
3696
+ function Le({
3688
3697
  metadata: s,
3689
3698
  stats: e,
3690
3699
  addedAt: t
@@ -3696,7 +3705,7 @@ function Pe({
3696
3705
  { label: "Pieces", value: `${e.piecesComplete} / ${e.piecesTotal}` },
3697
3706
  { label: "Downloads", value: R(e.downloaded) },
3698
3707
  { label: "Uploaded", value: R(e.uploaded) },
3699
- { label: "Ratio", value: q(e.ratio) },
3708
+ { label: "Ratio", value: Q(e.ratio) },
3700
3709
  { label: "Availability", value: e.availability.toFixed(2) },
3701
3710
  { label: "Wasted", value: R(e.wastedBytes) },
3702
3711
  { label: "Hash Fails", value: e.hashFailures },
@@ -3721,7 +3730,7 @@ function Pe({
3721
3730
  o.label
3722
3731
  )) });
3723
3732
  }
3724
- function ze({
3733
+ function Ue({
3725
3734
  isOpen: s,
3726
3735
  onClose: e,
3727
3736
  onAdd: t,
@@ -3874,14 +3883,14 @@ function ze({
3874
3883
  }
3875
3884
  );
3876
3885
  }
3877
- function Ye({
3886
+ function et({
3878
3887
  client: s,
3879
3888
  config: e,
3880
3889
  className: t,
3881
3890
  style: r
3882
3891
  }) {
3883
3892
  const [n, o] = S(!1), [l, d] = S(null);
3884
- return /* @__PURE__ */ i(ke, { client: s, config: e, children: /* @__PURE__ */ a(
3893
+ return /* @__PURE__ */ i(Ce, { client: s, config: e, children: /* @__PURE__ */ a(
3885
3894
  "div",
3886
3895
  {
3887
3896
  className: t,
@@ -3908,11 +3917,11 @@ function Ye({
3908
3917
  children: "+ Add Torrent"
3909
3918
  }
3910
3919
  ) }),
3911
- /* @__PURE__ */ i(Ae, {}),
3912
- /* @__PURE__ */ i(De, { onTorrentSelect: d, style: { flex: 1 } }),
3913
- l && /* @__PURE__ */ i(Ie, { infoHash: l }),
3920
+ /* @__PURE__ */ i(Re, {}),
3921
+ /* @__PURE__ */ i(Be, { onTorrentSelect: d, style: { flex: 1 } }),
3922
+ l && /* @__PURE__ */ i(Pe, { infoHash: l }),
3914
3923
  /* @__PURE__ */ i(
3915
- ze,
3924
+ Ue,
3916
3925
  {
3917
3926
  isOpen: n,
3918
3927
  onClose: () => o(!1),
@@ -3924,34 +3933,34 @@ function Ye({
3924
3933
  ) });
3925
3934
  }
3926
3935
  export {
3927
- ze as AddTorrentDialog,
3928
- Ae as FilterBar,
3929
- Z as HealthService,
3930
- ye as LifeDashboardService,
3931
- He as NiceHealth,
3932
- Qe as NiceLifeDashboard,
3933
- Ee as NicePersonalFinance,
3934
- Ge as NiceTaskManager,
3935
- Ye as NiceTorrentUI,
3936
- ae as PersonalFinanceService,
3937
- Se as ProgressBar,
3938
- Te as StatusBadge,
3939
- pe as TaskManagerService,
3940
- Ie as TorrentDetails,
3941
- De as TorrentList,
3942
- ke as TorrentUIProvider,
3943
- Ue as createHealthService,
3944
- qe as createLifeDashboardService,
3945
- $e as createPersonalFinanceService,
3946
- Ve as createTaskManagerService,
3936
+ Ue as AddTorrentDialog,
3937
+ Re as FilterBar,
3938
+ ne as HealthService,
3939
+ we as LifeDashboardService,
3940
+ Oe as NiceHealth,
3941
+ Ze as NiceLifeDashboard,
3942
+ Ke as NicePersonalFinance,
3943
+ _e as NiceTaskManager,
3944
+ et as NiceTorrentUI,
3945
+ ue as PersonalFinanceService,
3946
+ Ae as ProgressBar,
3947
+ Ie as StatusBadge,
3948
+ xe as TaskManagerService,
3949
+ Pe as TorrentDetails,
3950
+ Be as TorrentList,
3951
+ Ce as TorrentUIProvider,
3952
+ Ee as createHealthService,
3953
+ Xe as createLifeDashboardService,
3954
+ Ge as createPersonalFinanceService,
3955
+ Qe as createTaskManagerService,
3947
3956
  R as formatBytes,
3948
- we as formatETA,
3949
- q as formatRatio,
3957
+ De as formatETA,
3958
+ Q as formatRatio,
3950
3959
  U as formatSpeed,
3951
- K as getStatusColor,
3952
- Ne as useHealth,
3953
- Ke as useLifeDashboard,
3954
- je as usePersonalFinance,
3955
- Oe as useTaskManager,
3960
+ Y as getStatusColor,
3961
+ Ve as useHealth,
3962
+ Je as useLifeDashboard,
3963
+ qe as usePersonalFinance,
3964
+ Ye as useTaskManager,
3956
3965
  C as useTorrentUI
3957
3966
  };