@burdenoff/microfe-timecampus 2026.1206.1 → 2026.1206.2
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/timecampus/components/DateFields.d.ts +53 -0
- package/dist/timecampus/components/DateFields.js +87 -0
- package/dist/timecampus/components/DateFields.js.map +1 -0
- package/dist/timecampus/components/dateFieldValues.d.ts +39 -0
- package/dist/timecampus/components/dateFieldValues.js +49 -0
- package/dist/timecampus/components/dateFieldValues.js.map +1 -0
- package/dist/timecampus/pages/email-tracking/EmailTrackingPage.js +112 -111
- package/dist/timecampus/pages/email-tracking/EmailTrackingPage.js.map +1 -1
- package/dist/timecampus/pages/expense-tracking/ExpenseTrackingPage.js +65 -65
- package/dist/timecampus/pages/expense-tracking/ExpenseTrackingPage.js.map +1 -1
- package/dist/timecampus/pages/focus/FocusProtectionPage.js +250 -253
- package/dist/timecampus/pages/focus/FocusProtectionPage.js.map +1 -1
- package/dist/timecampus/pages/invoicing/InvoicingPage.js +259 -258
- package/dist/timecampus/pages/invoicing/InvoicingPage.js.map +1 -1
- package/dist/timecampus/pages/lifetime/FiniteLifePage.js +103 -103
- package/dist/timecampus/pages/lifetime/FiniteLifePage.js.map +1 -1
- package/dist/timecampus/pages/lifetime/LifeTimelinePage.js +38 -38
- package/dist/timecampus/pages/lifetime/LifeTimelinePage.js.map +1 -1
- package/dist/timecampus/pages/location-tracking/LocationTrackingPage.js +218 -216
- package/dist/timecampus/pages/location-tracking/LocationTrackingPage.js.map +1 -1
- package/dist/timecampus/pages/meetings/ActionItemFormModal.js +64 -63
- package/dist/timecampus/pages/meetings/ActionItemFormModal.js.map +1 -1
- package/dist/timecampus/pages/meetings/MeetingCreatePage.js +54 -54
- package/dist/timecampus/pages/meetings/MeetingCreatePage.js.map +1 -1
- package/dist/timecampus/pages/meetings/MeetingFormModal.js +98 -96
- package/dist/timecampus/pages/meetings/MeetingFormModal.js.map +1 -1
- package/dist/timecampus/pages/pomodoro/PomodoroPage.js +150 -149
- package/dist/timecampus/pages/pomodoro/PomodoroPage.js.map +1 -1
- package/dist/timecampus/pages/projects/TasksPage.js +183 -182
- package/dist/timecampus/pages/projects/TasksPage.js.map +1 -1
- package/dist/timecampus/pages/resource-planning/ResourcePlanningPage.js +346 -351
- package/dist/timecampus/pages/resource-planning/ResourcePlanningPage.js.map +1 -1
- package/dist/timecampus/pages/time/TimeEntriesPage.js +129 -127
- package/dist/timecampus/pages/time/TimeEntriesPage.js.map +1 -1
- package/dist/timecampus/pages/time-approval/SubmitTimesheetModal.js +46 -47
- package/dist/timecampus/pages/time-approval/SubmitTimesheetModal.js.map +1 -1
- package/dist/timecampus/pages/timeline/TimelinePage.js +231 -231
- package/dist/timecampus/pages/timeline/TimelinePage.js.map +1 -1
- package/package.json +1 -1
|
@@ -12,31 +12,32 @@ import { BarsChart as te } from "../../components/charts/BarsChart.js";
|
|
|
12
12
|
import { DonutChart as ne } from "../../components/charts/DonutChart.js";
|
|
13
13
|
import { ProgressMeter as re } from "../../components/charts/ProgressMeter.js";
|
|
14
14
|
import { useTimeCampus as ie } from "../../providers/TimeCampusProvider.js";
|
|
15
|
-
import {
|
|
15
|
+
import { useCreateLocationEntryMutation as ae, useDeleteLocationEntryMutation as oe, useGetLocationStatsQuery as se, useListGeofencesQuery as ce, useListLocationEntriesQuery as le } from "../../../generated/wspace-operations.js";
|
|
16
|
+
import { DEFAULT_MAP_CENTER as u, formatCoordinates as ue, isValidCoordinate as d, parseStrictNumber as f, roundCoordinate as p, validateLocationEntryForm as de } from "../../components/maps/locationGeometry.js";
|
|
16
17
|
import { LocationGeofenceMap as m } from "../../components/maps/LocationGeofenceMap.js";
|
|
17
|
-
import {
|
|
18
|
-
import { useMemo as
|
|
19
|
-
import { Building2 as fe, Clock as pe, Layers as me, MapPin as
|
|
20
|
-
import { Fragment as
|
|
18
|
+
import { DateTimeField as h } from "../../components/DateFields.js";
|
|
19
|
+
import { useMemo as g, useState as _ } from "react";
|
|
20
|
+
import { Building2 as fe, Clock as pe, Layers as me, MapPin as v, Plus as he, Route as ge, Satellite as _e, Trash2 as ve } from "lucide-react";
|
|
21
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
21
22
|
// src/timecampus/pages/location-tracking/LocationTrackingPage.tsx
|
|
22
|
-
var
|
|
23
|
+
var S = 25, C = "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus", w = {
|
|
23
24
|
address: "",
|
|
24
25
|
latitude: String(u[0]),
|
|
25
26
|
longitude: String(u[1]),
|
|
26
27
|
startTime: "",
|
|
27
28
|
endTime: ""
|
|
28
29
|
};
|
|
29
|
-
function
|
|
30
|
+
function T(e, t) {
|
|
30
31
|
return e instanceof Error && e.message.trim() ? e.message : t;
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
-
let { currentUser:
|
|
34
|
-
limit:
|
|
33
|
+
function E() {
|
|
34
|
+
let { currentUser: E } = ie(), { data: D, loading: O, error: ye, refetch: k, fetchMore: be } = le({ variables: { pagination: {
|
|
35
|
+
limit: S,
|
|
35
36
|
offset: 0
|
|
36
|
-
} } }), { data:
|
|
37
|
+
} } }), { data: xe, loading: Se, error: Ce, refetch: A } = se(), { data: j } = ce({ variables: { pagination: {
|
|
37
38
|
limit: 50,
|
|
38
39
|
offset: 0
|
|
39
|
-
} } }), [
|
|
40
|
+
} } }), [we, { loading: M }] = ae(), [Te, { loading: N }] = oe(), [Ee, P] = _(!1), [F, I] = _(w), [L, R] = _({}), [z, B] = _(null), [V, H] = _(null), [U, W] = _(null), [G, De] = _(!0), [K, Oe] = _(!0), [q, J] = _(!1), Y = g(() => D?.locationEntries?.items ?? [], [D?.locationEntries?.items]), ke = D?.locationEntries?.hasMore ?? !1, X = xe?.locationStats, Z = g(() => (j?.geofences?.items ?? []).map((e) => ({
|
|
40
41
|
id: e.id,
|
|
41
42
|
name: e.name,
|
|
42
43
|
latitude: e.latitude,
|
|
@@ -45,7 +46,7 @@ function w() {
|
|
|
45
46
|
isActive: e.isActive,
|
|
46
47
|
trigger: e.trigger,
|
|
47
48
|
address: e.address
|
|
48
|
-
})), [
|
|
49
|
+
})), [j?.geofences?.items]), Ae = g(() => Y.map((e) => ({
|
|
49
50
|
id: e.id,
|
|
50
51
|
latitude: e.latitude,
|
|
51
52
|
longitude: e.longitude,
|
|
@@ -55,72 +56,72 @@ function w() {
|
|
|
55
56
|
duration: e.duration,
|
|
56
57
|
accuracy: e.accuracy,
|
|
57
58
|
geofenceId: e.geofenceId
|
|
58
|
-
})), [
|
|
59
|
-
let e = f(
|
|
59
|
+
})), [Y]), je = g(() => {
|
|
60
|
+
let e = f(F.latitude), t = f(F.longitude);
|
|
60
61
|
return e === null || t === null || !d(e, t) ? null : {
|
|
61
62
|
latitude: e,
|
|
62
63
|
longitude: t
|
|
63
64
|
};
|
|
64
|
-
}, [
|
|
65
|
+
}, [F.latitude, F.longitude]), Me = Y.filter((e) => e.geofenceId).length, Ne = Y.length - Me, Pe = [{
|
|
65
66
|
name: "Geofenced",
|
|
66
|
-
value:
|
|
67
|
+
value: Me
|
|
67
68
|
}, {
|
|
68
69
|
name: "Manual",
|
|
69
70
|
value: Ne
|
|
70
|
-
}],
|
|
71
|
-
for (let e of
|
|
71
|
+
}], Fe = Y.reduce((e, t) => Math.max(e, t.duration ?? 0), 0), Q = /* @__PURE__ */ new Map();
|
|
72
|
+
for (let e of Y) {
|
|
72
73
|
if (!e.duration) continue;
|
|
73
74
|
let t = e.address?.trim() || "Unknown location";
|
|
74
75
|
Q.set(t, (Q.get(t) ?? 0) + e.duration);
|
|
75
76
|
}
|
|
76
|
-
let
|
|
77
|
+
let Ie = Array.from(Q.entries()).map(([e, t]) => ({
|
|
77
78
|
location: e,
|
|
78
79
|
hours: t / 3600
|
|
79
|
-
})).sort((e, t) => t.hours - e.hours).slice(0, 6),
|
|
80
|
-
let e = /* @__PURE__ */ new Date(), t = (/* @__PURE__ */ new Date(e.getTime() - e.getTimezoneOffset() * 6e4)).toISOString().slice(0, 16), n =
|
|
81
|
-
|
|
82
|
-
...
|
|
80
|
+
})).sort((e, t) => t.hours - e.hours).slice(0, 6), Le = () => {
|
|
81
|
+
let e = /* @__PURE__ */ new Date(), t = (/* @__PURE__ */ new Date(e.getTime() - e.getTimezoneOffset() * 6e4)).toISOString().slice(0, 16), n = Y.find((e) => d(e.latitude, e.longitude));
|
|
82
|
+
R({}), B(null), I({
|
|
83
|
+
...w,
|
|
83
84
|
latitude: String(p(n ? n.latitude : u[0])),
|
|
84
85
|
longitude: String(p(n ? n.longitude : u[1])),
|
|
85
86
|
startTime: t
|
|
86
|
-
}),
|
|
87
|
-
},
|
|
88
|
-
if (
|
|
89
|
-
let e =
|
|
90
|
-
if (!e.valid || !e.parsed)
|
|
87
|
+
}), P(!0);
|
|
88
|
+
}, Re = async () => {
|
|
89
|
+
if (B(null), !E?.id) return;
|
|
90
|
+
let e = de(F);
|
|
91
|
+
if (!e.valid || !e.parsed) R(e.errors);
|
|
91
92
|
else {
|
|
92
|
-
|
|
93
|
+
R({});
|
|
93
94
|
try {
|
|
94
|
-
let t = (await
|
|
95
|
-
userId:
|
|
95
|
+
let t = (await we({ variables: { input: {
|
|
96
|
+
userId: E.id,
|
|
96
97
|
latitude: e.parsed.latitude,
|
|
97
98
|
longitude: e.parsed.longitude,
|
|
98
|
-
address:
|
|
99
|
+
address: F.address.trim() || void 0,
|
|
99
100
|
startTime: e.parsed.startTimeIso,
|
|
100
101
|
endTime: e.parsed.endTimeIso,
|
|
101
102
|
duration: e.parsed.durationSeconds
|
|
102
103
|
} } })).data?.createLocationEntry?.id ?? null;
|
|
103
|
-
t &&
|
|
104
|
+
t && W(t), P(!1), await Promise.all([k(), A()]);
|
|
104
105
|
} catch (e) {
|
|
105
|
-
|
|
106
|
+
B(T(e, "Failed to add location entry. Check values and permissions, then try again."));
|
|
106
107
|
}
|
|
107
108
|
}
|
|
108
|
-
},
|
|
109
|
-
if (
|
|
110
|
-
|
|
109
|
+
}, ze = async () => {
|
|
110
|
+
if (V) {
|
|
111
|
+
B(null);
|
|
111
112
|
try {
|
|
112
|
-
await
|
|
113
|
+
await Te({ variables: { id: V.id } }), U === V.id && W(null), H(null), await Promise.all([k(), A()]);
|
|
113
114
|
} catch (e) {
|
|
114
|
-
|
|
115
|
+
B(T(e, "Failed to delete location entry.")), H(null);
|
|
115
116
|
}
|
|
116
117
|
}
|
|
117
|
-
},
|
|
118
|
-
|
|
118
|
+
}, Be = async () => {
|
|
119
|
+
J(!0);
|
|
119
120
|
try {
|
|
120
|
-
await
|
|
121
|
+
await be({
|
|
121
122
|
variables: { pagination: {
|
|
122
|
-
limit:
|
|
123
|
-
offset:
|
|
123
|
+
limit: S,
|
|
124
|
+
offset: Y.length
|
|
124
125
|
} },
|
|
125
126
|
updateQuery: (e, { fetchMoreResult: t }) => t ? { locationEntries: {
|
|
126
127
|
...t.locationEntries,
|
|
@@ -128,133 +129,133 @@ function w() {
|
|
|
128
129
|
} } : e
|
|
129
130
|
});
|
|
130
131
|
} finally {
|
|
131
|
-
|
|
132
|
+
J(!1);
|
|
132
133
|
}
|
|
133
|
-
}, $ = /* @__PURE__ */
|
|
134
|
+
}, $ = /* @__PURE__ */ x("button", {
|
|
134
135
|
type: "button",
|
|
135
|
-
onClick:
|
|
136
|
+
onClick: Le,
|
|
136
137
|
className: "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
137
|
-
children: [/* @__PURE__ */
|
|
138
|
+
children: [/* @__PURE__ */ b(he, { className: "h-4 w-4" }), "Add Location Entry"]
|
|
138
139
|
});
|
|
139
|
-
return
|
|
140
|
+
return O && Se ? /* @__PURE__ */ b(e, {
|
|
140
141
|
title: "Location Tracking",
|
|
141
142
|
description: "Track work locations and productivity",
|
|
142
|
-
children: /* @__PURE__ */
|
|
143
|
+
children: /* @__PURE__ */ b(i, {
|
|
143
144
|
variant: "list",
|
|
144
145
|
count: 4
|
|
145
146
|
})
|
|
146
|
-
}) :
|
|
147
|
+
}) : ye && Ce ? /* @__PURE__ */ b(e, {
|
|
147
148
|
title: "Location Tracking",
|
|
148
149
|
description: "Track work locations and productivity",
|
|
149
|
-
children: /* @__PURE__ */
|
|
150
|
+
children: /* @__PURE__ */ b("div", {
|
|
150
151
|
role: "alert",
|
|
151
152
|
className: "rounded-lg border border-status-error-border bg-status-error-bgSubtle p-4 text-sm text-status-error-text",
|
|
152
153
|
children: "Failed to load location data. Please try again later."
|
|
153
154
|
})
|
|
154
|
-
}) : /* @__PURE__ */
|
|
155
|
+
}) : /* @__PURE__ */ x(e, {
|
|
155
156
|
title: "Location Tracking",
|
|
156
157
|
description: "Track work locations and productivity",
|
|
157
158
|
purpose: "See where work actually happens — office, home, client sites — and how long you spend at each, so you can verify on-site time, support field teams, and back up location-based billing.",
|
|
158
159
|
actions: $,
|
|
159
160
|
children: [
|
|
160
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ x("div", {
|
|
161
162
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
162
163
|
children: [
|
|
163
|
-
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ b(t, {
|
|
164
165
|
featured: !0,
|
|
165
166
|
title: "Total Locations",
|
|
166
|
-
value: String(
|
|
167
|
-
icon: /* @__PURE__ */ v
|
|
167
|
+
value: String(X?.totalLocations ?? 0),
|
|
168
|
+
icon: /* @__PURE__ */ b(v, { className: "h-5 w-5" })
|
|
168
169
|
}),
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
+
/* @__PURE__ */ b(t, {
|
|
170
171
|
title: "Unique Addresses",
|
|
171
|
-
value: String(
|
|
172
|
-
icon: /* @__PURE__ */
|
|
172
|
+
value: String(X?.uniqueAddresses ?? 0),
|
|
173
|
+
icon: /* @__PURE__ */ b(fe, { className: "h-5 w-5" })
|
|
173
174
|
}),
|
|
174
|
-
/* @__PURE__ */
|
|
175
|
+
/* @__PURE__ */ b(t, {
|
|
175
176
|
title: "Most Frequent",
|
|
176
|
-
value:
|
|
177
|
+
value: X?.mostFrequentLocation ?? "N/A"
|
|
177
178
|
}),
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ b(t, {
|
|
179
180
|
title: "Total Duration",
|
|
180
|
-
value: s((
|
|
181
|
-
icon: /* @__PURE__ */
|
|
181
|
+
value: s((X?.totalDuration ?? 0) / 3600),
|
|
182
|
+
icon: /* @__PURE__ */ b(pe, { className: "h-5 w-5" }),
|
|
182
183
|
description: "Tracked time"
|
|
183
184
|
})
|
|
184
185
|
]
|
|
185
186
|
}),
|
|
186
|
-
/* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ x("div", {
|
|
187
188
|
className: "mt-6",
|
|
188
|
-
children: [/* @__PURE__ */
|
|
189
|
+
children: [/* @__PURE__ */ x("div", {
|
|
189
190
|
className: "mb-3 flex flex-wrap items-center justify-between gap-2",
|
|
190
|
-
children: [/* @__PURE__ */
|
|
191
|
+
children: [/* @__PURE__ */ x("div", {
|
|
191
192
|
className: "min-w-0",
|
|
192
|
-
children: [/* @__PURE__ */
|
|
193
|
+
children: [/* @__PURE__ */ b("h2", {
|
|
193
194
|
className: "text-base font-semibold text-text-primary",
|
|
194
195
|
children: "Location History Map"
|
|
195
|
-
}), /* @__PURE__ */
|
|
196
|
+
}), /* @__PURE__ */ x("p", {
|
|
196
197
|
className: "text-xs text-text-secondary",
|
|
197
198
|
children: [
|
|
198
|
-
|
|
199
|
+
Y.length,
|
|
199
200
|
" tracked point",
|
|
200
|
-
|
|
201
|
-
|
|
201
|
+
Y.length === 1 ? "" : "s",
|
|
202
|
+
Z.length > 0 ? ` · ${Z.length} workspace geofence${Z.length === 1 ? "" : "s"}` : ""
|
|
202
203
|
]
|
|
203
204
|
})]
|
|
204
|
-
}), /* @__PURE__ */
|
|
205
|
+
}), /* @__PURE__ */ x("div", {
|
|
205
206
|
className: "flex flex-wrap items-center gap-2",
|
|
206
|
-
children: [/* @__PURE__ */
|
|
207
|
+
children: [/* @__PURE__ */ x("button", {
|
|
207
208
|
type: "button",
|
|
208
|
-
"aria-pressed":
|
|
209
|
-
onClick: () =>
|
|
210
|
-
className: o("inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
211
|
-
children: [/* @__PURE__ */
|
|
212
|
-
}), /* @__PURE__ */
|
|
209
|
+
"aria-pressed": G,
|
|
210
|
+
onClick: () => De((e) => !e),
|
|
211
|
+
className: o("inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus", G ? "border-action-primary-bg bg-action-primary-bg/10 text-text-primary" : "border-border-subtle bg-bg-surface text-text-secondary hover:bg-bg-sunken"),
|
|
212
|
+
children: [/* @__PURE__ */ b(me, { className: "h-3.5 w-3.5" }), "Geofences"]
|
|
213
|
+
}), /* @__PURE__ */ x("button", {
|
|
213
214
|
type: "button",
|
|
214
|
-
"aria-pressed":
|
|
215
|
-
onClick: () =>
|
|
216
|
-
className: o("inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
217
|
-
children: [/* @__PURE__ */
|
|
215
|
+
"aria-pressed": K,
|
|
216
|
+
onClick: () => Oe((e) => !e),
|
|
217
|
+
className: o("inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus", K ? "border-action-primary-bg bg-action-primary-bg/10 text-text-primary" : "border-border-subtle bg-bg-surface text-text-secondary hover:bg-bg-sunken"),
|
|
218
|
+
children: [/* @__PURE__ */ b(ge, { className: "h-3.5 w-3.5" }), "Path"]
|
|
218
219
|
})]
|
|
219
220
|
})]
|
|
220
|
-
}), /* @__PURE__ */
|
|
221
|
-
geofences:
|
|
222
|
-
locationEntries:
|
|
223
|
-
selectedLocationId:
|
|
224
|
-
onSelectLocation: (e) =>
|
|
225
|
-
showGeofences:
|
|
226
|
-
showLocationPath:
|
|
221
|
+
}), /* @__PURE__ */ b(m, {
|
|
222
|
+
geofences: Z,
|
|
223
|
+
locationEntries: Ae,
|
|
224
|
+
selectedLocationId: U,
|
|
225
|
+
onSelectLocation: (e) => W(e),
|
|
226
|
+
showGeofences: G,
|
|
227
|
+
showLocationPath: K,
|
|
227
228
|
heightClassName: "h-[300px] sm:h-[380px] lg:h-[440px]",
|
|
228
229
|
ariaLabel: "Location history and geofence overlays map",
|
|
229
230
|
testId: "location-tracking-map"
|
|
230
231
|
})]
|
|
231
232
|
}),
|
|
232
|
-
|
|
233
|
+
Y.length === 0 && !O ? /* @__PURE__ */ b("div", {
|
|
233
234
|
className: "mt-6",
|
|
234
|
-
children: /* @__PURE__ */
|
|
235
|
+
children: /* @__PURE__ */ b(r, {
|
|
235
236
|
illustration: "empty-data",
|
|
236
237
|
title: "No location entries found",
|
|
237
238
|
description: "With location tracking enabled, the places you work from will show up here and on the map above. You can also add an entry manually.",
|
|
238
239
|
action: $
|
|
239
240
|
})
|
|
240
|
-
}) : /* @__PURE__ */ y
|
|
241
|
-
/* @__PURE__ */
|
|
241
|
+
}) : /* @__PURE__ */ x(y, { children: [
|
|
242
|
+
/* @__PURE__ */ x("div", {
|
|
242
243
|
className: "mt-6 grid grid-cols-1 gap-4 lg:grid-cols-2",
|
|
243
|
-
children: [/* @__PURE__ */
|
|
244
|
+
children: [/* @__PURE__ */ b(l, {
|
|
244
245
|
title: "Tracking source",
|
|
245
246
|
description: "How your loaded entries were captured",
|
|
246
|
-
children: /* @__PURE__ */
|
|
247
|
+
children: /* @__PURE__ */ b(ne, {
|
|
247
248
|
data: Pe,
|
|
248
249
|
centerLabel: "Entries",
|
|
249
|
-
centerValue:
|
|
250
|
+
centerValue: Y.length,
|
|
250
251
|
ariaLabel: "Geofenced vs manual location entries",
|
|
251
252
|
emptyLabel: "No entries to summarize yet"
|
|
252
253
|
})
|
|
253
|
-
}), /* @__PURE__ */
|
|
254
|
+
}), /* @__PURE__ */ b(l, {
|
|
254
255
|
title: "Time by location",
|
|
255
256
|
description: "Hours logged across your loaded entries",
|
|
256
|
-
children: /* @__PURE__ */
|
|
257
|
-
data:
|
|
257
|
+
children: /* @__PURE__ */ b(te, {
|
|
258
|
+
data: Ie,
|
|
258
259
|
xKey: "location",
|
|
259
260
|
orientation: "horizontal",
|
|
260
261
|
series: [{
|
|
@@ -268,69 +269,69 @@ function w() {
|
|
|
268
269
|
})
|
|
269
270
|
})]
|
|
270
271
|
}),
|
|
271
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ b("div", {
|
|
272
273
|
className: "mt-6 space-y-3",
|
|
273
|
-
children:
|
|
274
|
-
let t = !!e.geofenceId, r = e.duration ?? 0, i = e.id ===
|
|
275
|
-
return /* @__PURE__ */
|
|
274
|
+
children: Y.map((e) => {
|
|
275
|
+
let t = !!e.geofenceId, r = e.duration ?? 0, i = e.id === U;
|
|
276
|
+
return /* @__PURE__ */ x("div", {
|
|
276
277
|
className: o("rounded-xl border bg-gloss-card p-4 shadow-pop transition-colors hover:bg-bg-sunken/50", i ? "border-action-primary-bg" : "border-border-seam"),
|
|
277
|
-
children: [/* @__PURE__ */
|
|
278
|
+
children: [/* @__PURE__ */ x("div", {
|
|
278
279
|
className: "flex items-start justify-between gap-4",
|
|
279
|
-
children: [/* @__PURE__ */
|
|
280
|
+
children: [/* @__PURE__ */ x("button", {
|
|
280
281
|
type: "button",
|
|
281
|
-
onClick: () =>
|
|
282
|
+
onClick: () => W(e.id),
|
|
282
283
|
className: "flex min-w-0 flex-1 items-start gap-3 text-start focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
283
|
-
children: [/* @__PURE__ */
|
|
284
|
+
children: [/* @__PURE__ */ b("span", {
|
|
284
285
|
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg/10 text-primary",
|
|
285
|
-
children:
|
|
286
|
-
}), /* @__PURE__ */
|
|
286
|
+
children: b(t ? _e : v, { className: "h-5 w-5" })
|
|
287
|
+
}), /* @__PURE__ */ x("div", {
|
|
287
288
|
className: "min-w-0",
|
|
288
|
-
children: [/* @__PURE__ */
|
|
289
|
+
children: [/* @__PURE__ */ b("p", {
|
|
289
290
|
className: "truncate text-sm font-medium text-text-primary",
|
|
290
291
|
children: e.address ?? "Unknown Location"
|
|
291
|
-
}), /* @__PURE__ */
|
|
292
|
+
}), /* @__PURE__ */ x("div", {
|
|
292
293
|
className: "mt-1 flex flex-wrap items-center gap-2 text-xs text-text-secondary",
|
|
293
294
|
children: [
|
|
294
|
-
/* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ b(n, {
|
|
295
296
|
label: t ? "Geofenced" : "Manual",
|
|
296
297
|
variant: t ? "info" : "muted"
|
|
297
298
|
}),
|
|
298
|
-
/* @__PURE__ */
|
|
299
|
-
/* @__PURE__ */
|
|
299
|
+
/* @__PURE__ */ b("span", { children: ee(e.startTime) }),
|
|
300
|
+
/* @__PURE__ */ x("span", {
|
|
300
301
|
className: "text-text-muted",
|
|
301
302
|
children: [c(e.startTime), e.endTime ? ` – ${c(e.endTime)}` : ""]
|
|
302
303
|
}),
|
|
303
|
-
d(e.latitude, e.longitude) && /* @__PURE__ */
|
|
304
|
+
d(e.latitude, e.longitude) && /* @__PURE__ */ b("span", {
|
|
304
305
|
className: "font-mono text-[11px] text-text-muted",
|
|
305
|
-
children:
|
|
306
|
+
children: ue(e.latitude, e.longitude)
|
|
306
307
|
})
|
|
307
308
|
]
|
|
308
309
|
})]
|
|
309
310
|
})]
|
|
310
|
-
}), /* @__PURE__ */
|
|
311
|
+
}), /* @__PURE__ */ x("div", {
|
|
311
312
|
className: "flex items-center gap-3",
|
|
312
|
-
children: [/* @__PURE__ */
|
|
313
|
+
children: [/* @__PURE__ */ x("div", {
|
|
313
314
|
className: "text-end",
|
|
314
|
-
children: [/* @__PURE__ */
|
|
315
|
+
children: [/* @__PURE__ */ b("p", {
|
|
315
316
|
className: "text-sm font-semibold tabular-nums text-text-primary",
|
|
316
317
|
children: e.duration ? s(e.duration / 3600) : "Active"
|
|
317
|
-
}), /* @__PURE__ */
|
|
318
|
+
}), /* @__PURE__ */ b("p", {
|
|
318
319
|
className: "text-xs text-text-secondary",
|
|
319
320
|
children: "duration"
|
|
320
321
|
})]
|
|
321
|
-
}), /* @__PURE__ */
|
|
322
|
+
}), /* @__PURE__ */ b("button", {
|
|
322
323
|
type: "button",
|
|
323
|
-
onClick: () =>
|
|
324
|
+
onClick: () => H(e),
|
|
324
325
|
"aria-label": "Delete entry",
|
|
325
326
|
className: "rounded-md border border-border-subtle p-1.5 text-status-error-text hover:bg-status-error-bgSubtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
326
|
-
children: /* @__PURE__ */
|
|
327
|
+
children: /* @__PURE__ */ b(ve, { className: "h-4 w-4" })
|
|
327
328
|
})]
|
|
328
329
|
})]
|
|
329
|
-
}), e.duration &&
|
|
330
|
+
}), e.duration && Fe > 0 ? /* @__PURE__ */ b("div", {
|
|
330
331
|
className: "mt-3",
|
|
331
|
-
children: /* @__PURE__ */
|
|
332
|
+
children: /* @__PURE__ */ b(re, {
|
|
332
333
|
value: r,
|
|
333
|
-
max:
|
|
334
|
+
max: Fe,
|
|
334
335
|
tone: "success",
|
|
335
336
|
showValue: !1,
|
|
336
337
|
size: "sm"
|
|
@@ -339,58 +340,58 @@ function w() {
|
|
|
339
340
|
}, e.id);
|
|
340
341
|
})
|
|
341
342
|
}),
|
|
342
|
-
|
|
343
|
+
ke && /* @__PURE__ */ b("div", {
|
|
343
344
|
className: "mt-6 flex justify-center",
|
|
344
|
-
children: /* @__PURE__ */
|
|
345
|
+
children: /* @__PURE__ */ b("button", {
|
|
345
346
|
type: "button",
|
|
346
|
-
onClick: () => void
|
|
347
|
-
disabled:
|
|
347
|
+
onClick: () => void Be(),
|
|
348
|
+
disabled: q,
|
|
348
349
|
className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50 disabled:opacity-50",
|
|
349
|
-
children:
|
|
350
|
+
children: q ? "Loading..." : "Load more"
|
|
350
351
|
})
|
|
351
352
|
})
|
|
352
353
|
] }),
|
|
353
|
-
/* @__PURE__ */
|
|
354
|
-
open:
|
|
355
|
-
onClose: () =>
|
|
354
|
+
/* @__PURE__ */ x(a, {
|
|
355
|
+
open: Ee,
|
|
356
|
+
onClose: () => P(!1),
|
|
356
357
|
title: "Add Location Entry",
|
|
357
358
|
description: "Click the map to place a pin or enter coordinates manually. Only you and people you share with can see this.",
|
|
358
359
|
size: "xl",
|
|
359
|
-
footer: /* @__PURE__ */ y
|
|
360
|
+
footer: /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("button", {
|
|
360
361
|
type: "button",
|
|
361
|
-
onClick: () =>
|
|
362
|
+
onClick: () => P(!1),
|
|
362
363
|
className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50",
|
|
363
364
|
children: "Cancel"
|
|
364
|
-
}), /* @__PURE__ */
|
|
365
|
+
}), /* @__PURE__ */ b("button", {
|
|
365
366
|
type: "button",
|
|
366
|
-
onClick: () => void
|
|
367
|
-
disabled:
|
|
367
|
+
onClick: () => void Re(),
|
|
368
|
+
disabled: M || !E?.id,
|
|
368
369
|
className: "rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50",
|
|
369
|
-
children:
|
|
370
|
+
children: M ? "Saving..." : "Add Entry"
|
|
370
371
|
})] }),
|
|
371
372
|
children: [
|
|
372
|
-
|
|
373
|
+
z && /* @__PURE__ */ b("div", {
|
|
373
374
|
role: "alert",
|
|
374
375
|
className: "mb-4 rounded-lg border border-status-error-border bg-status-error-bgSubtle p-3 text-sm text-status-error-text",
|
|
375
|
-
children:
|
|
376
|
+
children: z
|
|
376
377
|
}),
|
|
377
|
-
!
|
|
378
|
+
!E?.id && /* @__PURE__ */ b("div", {
|
|
378
379
|
className: "mb-4 rounded-lg border border-status-warning-border bg-status-warning-bgSubtle p-3 text-sm text-status-warning-text",
|
|
379
380
|
children: "You must be signed in to add a location entry."
|
|
380
381
|
}),
|
|
381
|
-
/* @__PURE__ */
|
|
382
|
+
/* @__PURE__ */ x("div", {
|
|
382
383
|
className: "space-y-4",
|
|
383
384
|
children: [
|
|
384
|
-
/* @__PURE__ */
|
|
385
|
-
geofences:
|
|
386
|
-
draftPoint:
|
|
385
|
+
/* @__PURE__ */ b(m, {
|
|
386
|
+
geofences: Z,
|
|
387
|
+
draftPoint: je,
|
|
387
388
|
interactiveMode: "pick-point",
|
|
388
389
|
onPickPoint: ({ latitude: e, longitude: t }) => {
|
|
389
|
-
|
|
390
|
+
I((n) => ({
|
|
390
391
|
...n,
|
|
391
392
|
latitude: String(p(e)),
|
|
392
393
|
longitude: String(p(t))
|
|
393
|
-
})),
|
|
394
|
+
})), R((e) => ({
|
|
394
395
|
...e,
|
|
395
396
|
latitude: void 0,
|
|
396
397
|
longitude: void 0
|
|
@@ -400,138 +401,139 @@ function w() {
|
|
|
400
401
|
ariaLabel: "Pick location coordinates on map",
|
|
401
402
|
testId: "location-entry-picker-map"
|
|
402
403
|
}),
|
|
403
|
-
/* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
|
|
404
405
|
htmlFor: "loc-address",
|
|
405
406
|
className: "block text-sm font-medium text-text-primary",
|
|
406
407
|
children: "Address (optional)"
|
|
407
|
-
}), /* @__PURE__ */
|
|
408
|
+
}), /* @__PURE__ */ b("input", {
|
|
408
409
|
id: "loc-address",
|
|
409
410
|
type: "text",
|
|
410
411
|
placeholder: "e.g. Client site, San Francisco",
|
|
411
|
-
value:
|
|
412
|
-
onChange: (e) =>
|
|
413
|
-
...
|
|
412
|
+
value: F.address,
|
|
413
|
+
onChange: (e) => I({
|
|
414
|
+
...F,
|
|
414
415
|
address: e.target.value
|
|
415
416
|
}),
|
|
416
|
-
className:
|
|
417
|
+
className: C
|
|
417
418
|
})] }),
|
|
418
|
-
/* @__PURE__ */
|
|
419
|
+
/* @__PURE__ */ x("div", {
|
|
419
420
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
420
|
-
children: [/* @__PURE__ */
|
|
421
|
-
/* @__PURE__ */
|
|
421
|
+
children: [/* @__PURE__ */ x("div", { children: [
|
|
422
|
+
/* @__PURE__ */ b("label", {
|
|
422
423
|
htmlFor: "loc-lat",
|
|
423
424
|
className: "block text-sm font-medium text-text-primary",
|
|
424
425
|
children: "Latitude"
|
|
425
426
|
}),
|
|
426
|
-
/* @__PURE__ */
|
|
427
|
+
/* @__PURE__ */ b("input", {
|
|
427
428
|
id: "loc-lat",
|
|
428
429
|
type: "number",
|
|
429
430
|
step: "any",
|
|
430
431
|
min: -90,
|
|
431
432
|
max: 90,
|
|
432
433
|
placeholder: "37.774900",
|
|
433
|
-
value:
|
|
434
|
+
value: F.latitude,
|
|
434
435
|
onChange: (e) => {
|
|
435
|
-
|
|
436
|
-
...
|
|
436
|
+
I({
|
|
437
|
+
...F,
|
|
437
438
|
latitude: e.target.value
|
|
438
|
-
}),
|
|
439
|
+
}), R((e) => ({
|
|
439
440
|
...e,
|
|
440
441
|
latitude: void 0
|
|
441
442
|
}));
|
|
442
443
|
},
|
|
443
|
-
className:
|
|
444
|
+
className: C
|
|
444
445
|
}),
|
|
445
|
-
|
|
446
|
+
L.latitude && /* @__PURE__ */ b("p", {
|
|
446
447
|
role: "alert",
|
|
447
448
|
className: "mt-1 text-xs text-status-error-text",
|
|
448
|
-
children:
|
|
449
|
+
children: L.latitude
|
|
449
450
|
})
|
|
450
|
-
] }), /* @__PURE__ */
|
|
451
|
-
/* @__PURE__ */
|
|
451
|
+
] }), /* @__PURE__ */ x("div", { children: [
|
|
452
|
+
/* @__PURE__ */ b("label", {
|
|
452
453
|
htmlFor: "loc-lng",
|
|
453
454
|
className: "block text-sm font-medium text-text-primary",
|
|
454
455
|
children: "Longitude"
|
|
455
456
|
}),
|
|
456
|
-
/* @__PURE__ */
|
|
457
|
+
/* @__PURE__ */ b("input", {
|
|
457
458
|
id: "loc-lng",
|
|
458
459
|
type: "number",
|
|
459
460
|
step: "any",
|
|
460
461
|
min: -180,
|
|
461
462
|
max: 180,
|
|
462
463
|
placeholder: "-122.419400",
|
|
463
|
-
value:
|
|
464
|
+
value: F.longitude,
|
|
464
465
|
onChange: (e) => {
|
|
465
|
-
|
|
466
|
-
...
|
|
466
|
+
I({
|
|
467
|
+
...F,
|
|
467
468
|
longitude: e.target.value
|
|
468
|
-
}),
|
|
469
|
+
}), R((e) => ({
|
|
469
470
|
...e,
|
|
470
471
|
longitude: void 0
|
|
471
472
|
}));
|
|
472
473
|
},
|
|
473
|
-
className:
|
|
474
|
+
className: C
|
|
474
475
|
}),
|
|
475
|
-
|
|
476
|
+
L.longitude && /* @__PURE__ */ b("p", {
|
|
476
477
|
role: "alert",
|
|
477
478
|
className: "mt-1 text-xs text-status-error-text",
|
|
478
|
-
children:
|
|
479
|
+
children: L.longitude
|
|
479
480
|
})
|
|
480
481
|
] })]
|
|
481
482
|
}),
|
|
482
|
-
/* @__PURE__ */
|
|
483
|
+
/* @__PURE__ */ x("div", {
|
|
483
484
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
484
|
-
children: [/* @__PURE__ */
|
|
485
|
-
/* @__PURE__ */
|
|
485
|
+
children: [/* @__PURE__ */ x("div", { children: [
|
|
486
|
+
/* @__PURE__ */ b("label", {
|
|
486
487
|
htmlFor: "loc-start",
|
|
487
488
|
className: "block text-sm font-medium text-text-primary",
|
|
488
489
|
children: "Start Time"
|
|
489
490
|
}),
|
|
490
|
-
/* @__PURE__ */
|
|
491
|
+
/* @__PURE__ */ b(h, {
|
|
491
492
|
id: "loc-start",
|
|
492
|
-
|
|
493
|
-
value: N.startTime,
|
|
493
|
+
value: F.startTime,
|
|
494
494
|
onChange: (e) => {
|
|
495
|
-
|
|
496
|
-
...
|
|
497
|
-
startTime: e
|
|
498
|
-
}),
|
|
495
|
+
I({
|
|
496
|
+
...F,
|
|
497
|
+
startTime: e
|
|
498
|
+
}), R((e) => ({
|
|
499
499
|
...e,
|
|
500
500
|
startTime: void 0
|
|
501
501
|
}));
|
|
502
502
|
},
|
|
503
|
-
|
|
503
|
+
label: "Start time",
|
|
504
|
+
step: 5
|
|
504
505
|
}),
|
|
505
|
-
|
|
506
|
+
L.startTime && /* @__PURE__ */ b("p", {
|
|
506
507
|
role: "alert",
|
|
507
508
|
className: "mt-1 text-xs text-status-error-text",
|
|
508
|
-
children:
|
|
509
|
+
children: L.startTime
|
|
509
510
|
})
|
|
510
|
-
] }), /* @__PURE__ */
|
|
511
|
-
/* @__PURE__ */
|
|
511
|
+
] }), /* @__PURE__ */ x("div", { children: [
|
|
512
|
+
/* @__PURE__ */ b("label", {
|
|
512
513
|
htmlFor: "loc-end",
|
|
513
514
|
className: "block text-sm font-medium text-text-primary",
|
|
514
515
|
children: "End Time (optional)"
|
|
515
516
|
}),
|
|
516
|
-
/* @__PURE__ */
|
|
517
|
+
/* @__PURE__ */ b(h, {
|
|
517
518
|
id: "loc-end",
|
|
518
|
-
|
|
519
|
-
value: N.endTime,
|
|
519
|
+
value: F.endTime,
|
|
520
520
|
onChange: (e) => {
|
|
521
|
-
|
|
522
|
-
...
|
|
523
|
-
endTime: e
|
|
524
|
-
}),
|
|
521
|
+
I({
|
|
522
|
+
...F,
|
|
523
|
+
endTime: e
|
|
524
|
+
}), R((e) => ({
|
|
525
525
|
...e,
|
|
526
526
|
endTime: void 0
|
|
527
527
|
}));
|
|
528
528
|
},
|
|
529
|
-
|
|
529
|
+
label: "End time",
|
|
530
|
+
step: 5,
|
|
531
|
+
clearable: !0
|
|
530
532
|
}),
|
|
531
|
-
|
|
533
|
+
L.endTime && /* @__PURE__ */ b("p", {
|
|
532
534
|
role: "alert",
|
|
533
535
|
className: "mt-1 text-xs text-status-error-text",
|
|
534
|
-
children:
|
|
536
|
+
children: L.endTime
|
|
535
537
|
})
|
|
536
538
|
] })]
|
|
537
539
|
})
|
|
@@ -539,28 +541,28 @@ function w() {
|
|
|
539
541
|
})
|
|
540
542
|
]
|
|
541
543
|
}),
|
|
542
|
-
/* @__PURE__ */
|
|
543
|
-
open:
|
|
544
|
-
onClose: () =>
|
|
544
|
+
/* @__PURE__ */ b(a, {
|
|
545
|
+
open: V !== null,
|
|
546
|
+
onClose: () => H(null),
|
|
545
547
|
title: "Delete Location Entry",
|
|
546
548
|
description: "This action cannot be undone.",
|
|
547
|
-
footer: /* @__PURE__ */ y
|
|
549
|
+
footer: /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("button", {
|
|
548
550
|
type: "button",
|
|
549
|
-
onClick: () =>
|
|
551
|
+
onClick: () => H(null),
|
|
550
552
|
className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50",
|
|
551
553
|
children: "Cancel"
|
|
552
|
-
}), /* @__PURE__ */
|
|
554
|
+
}), /* @__PURE__ */ b("button", {
|
|
553
555
|
type: "button",
|
|
554
|
-
onClick: () => void
|
|
555
|
-
disabled:
|
|
556
|
+
onClick: () => void ze(),
|
|
557
|
+
disabled: N,
|
|
556
558
|
className: "rounded-md bg-status-error-bgSubtle px-4 py-2 text-sm font-medium text-status-error-text hover:bg-status-error-bgSubtle/70 disabled:opacity-50",
|
|
557
|
-
children:
|
|
559
|
+
children: N ? "Deleting..." : "Delete"
|
|
558
560
|
})] }),
|
|
559
|
-
children: /* @__PURE__ */
|
|
561
|
+
children: /* @__PURE__ */ x("p", {
|
|
560
562
|
className: "text-sm text-text-secondary",
|
|
561
563
|
children: [
|
|
562
564
|
"Are you sure you want to delete this location entry",
|
|
563
|
-
|
|
565
|
+
V?.address ? ` at ${V.address}` : "",
|
|
564
566
|
"?"
|
|
565
567
|
]
|
|
566
568
|
})
|
|
@@ -568,6 +570,6 @@ function w() {
|
|
|
568
570
|
]
|
|
569
571
|
});
|
|
570
572
|
}
|
|
571
|
-
export {
|
|
573
|
+
export { E as LocationTrackingPage };
|
|
572
574
|
|
|
573
575
|
//# sourceMappingURL=LocationTrackingPage.js.map
|