@burdenoff/microfe-subscriberbot 2026.1023.1 → 2026.1029.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/subscriberbot/admin/AdminDashboardPage.js +5 -5
- package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
- package/dist/subscriberbot/components/PostureOptions.d.ts +10 -0
- package/dist/subscriberbot/components/PostureOptions.d.ts.map +1 -0
- package/dist/subscriberbot/components/PostureOptions.js +20 -0
- package/dist/subscriberbot/components/PostureOptions.js.map +1 -0
- package/dist/subscriberbot/components/index.d.ts +2 -0
- package/dist/subscriberbot/components/index.d.ts.map +1 -1
- package/dist/subscriberbot/components/index.js +1 -0
- package/dist/subscriberbot/hooks/index.d.ts +1 -0
- package/dist/subscriberbot/hooks/index.d.ts.map +1 -1
- package/dist/subscriberbot/hooks/index.js +2 -1
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.d.ts +15 -0
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.d.ts.map +1 -0
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.js +13 -0
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.js.map +1 -0
- package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts.map +1 -1
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js +9 -0
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
- package/dist/subscriberbot/pages/AssetVaultPage.js +16 -16
- package/dist/subscriberbot/pages/DashboardPage.js +23 -23
- package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.js +62 -62
- package/dist/subscriberbot/pages/InsightsPage.js +14 -14
- package/dist/subscriberbot/pages/InvoicesPage.js +66 -66
- package/dist/subscriberbot/pages/WorkflowsPage.js +20 -20
- package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js +184 -182
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.js +77 -79
- package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.js +134 -133
- package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +64 -64
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js +3 -3
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js +18 -18
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +122 -89
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +6 -6
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +7 -7
- package/dist/subscriberbot/types/index.d.ts +1 -0
- package/dist/subscriberbot/types/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -4,11 +4,11 @@ import { formatCurrency as n, formatDate as r, formatEnumLabel as i, formatInter
|
|
|
4
4
|
import { StatusBadge as o } from "../../components/StatusBadge.js";
|
|
5
5
|
import { EmptyState as s } from "../../components/EmptyState.js";
|
|
6
6
|
import { Modal as c } from "../../components/Modal.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { useTr as l } from "../../hooks/useTr.js";
|
|
8
|
+
import { ErrorView as u, LoadingView as d, Section as f } from "../../components/StateViews.js";
|
|
9
|
+
import { Gauge as p, MiniProgress as m, Timeline as h } from "../../components/viz.js";
|
|
9
10
|
import "../../components/index.js";
|
|
10
|
-
import { useCancelRelationship as
|
|
11
|
-
import { useTr as T } from "../../hooks/useTr.js";
|
|
11
|
+
import { useCancelRelationship as g, useCreateAsset as _, useCreateEntitlement as v, useFileDownloadUrl as y, usePlans as b, useProviders as x, useRelationship as S, useTransitionRelationship as C, useUpdateRelationship as w, useUploadFile as T } from "../../hooks/useSubscriberBotApi.js";
|
|
12
12
|
import { useState as E } from "react";
|
|
13
13
|
import { Activity as D, ArrowLeft as O, Ban as k, CalendarClock as A, CreditCard as j, Download as M, Paperclip as N, Pause as P, Pencil as F, Play as I, Plus as L, ShieldCheck as R, Tag as ee, Wallet as te } from "lucide-react";
|
|
14
14
|
import { useParams as ne } from "react-router";
|
|
@@ -90,10 +90,10 @@ function Y(e) {
|
|
|
90
90
|
return Number.isNaN(t.getTime()) ? "" : t.toISOString().slice(0, 10);
|
|
91
91
|
}
|
|
92
92
|
function oe({ relationship: e, onClose: t }) {
|
|
93
|
-
let n =
|
|
93
|
+
let n = l(), r = w(), i = x({ pagination: {
|
|
94
94
|
limit: 100,
|
|
95
95
|
offset: 0
|
|
96
|
-
} }), [a, o] = E(e.label), [s,
|
|
96
|
+
} }), [a, o] = E(e.label), [s, u] = E(e.providerId ?? ""), [d, f] = E(e.planId ?? ""), [p, m] = E(String(e.amount ?? "")), [h, g] = E(e.currency), [_, v] = E(e.interval), [y, S] = E(Y(e.renewsAt)), [C, T] = E(e.autoRenew), [D, O] = E(e.healthScore == null ? "" : String(e.healthScore)), [k, A] = E(e.notes ?? ""), [j, M] = E(null), N = b(s || void 0), P = (() => {
|
|
97
97
|
let t = i.data?.items ?? [];
|
|
98
98
|
return e.provider && !t.some((t) => t.id === e.provider?.id) ? [e.provider, ...t] : t;
|
|
99
99
|
})(), F = N.data ?? [];
|
|
@@ -109,15 +109,15 @@ function oe({ relationship: e, onClose: t }) {
|
|
|
109
109
|
}
|
|
110
110
|
let o = {
|
|
111
111
|
label: a.trim(),
|
|
112
|
-
interval:
|
|
113
|
-
autoRenew:
|
|
114
|
-
currency:
|
|
112
|
+
interval: _,
|
|
113
|
+
autoRenew: C,
|
|
114
|
+
currency: h.trim() || "USD",
|
|
115
115
|
notes: k.trim(),
|
|
116
116
|
...s ? { providerId: s } : {},
|
|
117
|
-
...
|
|
118
|
-
...
|
|
117
|
+
...d ? { planId: d } : {},
|
|
118
|
+
...p.trim() ? { amount: Number(p) } : {},
|
|
119
119
|
...D.trim() ? { healthScore: Number(D) } : {},
|
|
120
|
-
...
|
|
120
|
+
...y ? { renewsAt: new Date(y).toISOString() } : {}
|
|
121
121
|
};
|
|
122
122
|
r.mutate({
|
|
123
123
|
id: e.id,
|
|
@@ -162,7 +162,7 @@ function oe({ relationship: e, onClose: t }) {
|
|
|
162
162
|
id: "edit-provider",
|
|
163
163
|
value: s,
|
|
164
164
|
onChange: (e) => {
|
|
165
|
-
|
|
165
|
+
u(e.target.value), f("");
|
|
166
166
|
},
|
|
167
167
|
className: H,
|
|
168
168
|
children: [/* @__PURE__ */ z("option", {
|
|
@@ -178,8 +178,8 @@ function oe({ relationship: e, onClose: t }) {
|
|
|
178
178
|
children: n("relationships.detail.editModal.planLabel", "Plan")
|
|
179
179
|
}), /* @__PURE__ */ B("select", {
|
|
180
180
|
id: "edit-plan",
|
|
181
|
-
value:
|
|
182
|
-
onChange: (e) =>
|
|
181
|
+
value: d,
|
|
182
|
+
onChange: (e) => f(e.target.value),
|
|
183
183
|
className: H,
|
|
184
184
|
disabled: !s || F.length === 0,
|
|
185
185
|
children: [/* @__PURE__ */ z("option", {
|
|
@@ -203,8 +203,8 @@ function oe({ relationship: e, onClose: t }) {
|
|
|
203
203
|
type: "number",
|
|
204
204
|
min: "0",
|
|
205
205
|
step: "0.01",
|
|
206
|
-
value:
|
|
207
|
-
onChange: (e) =>
|
|
206
|
+
value: p,
|
|
207
|
+
onChange: (e) => m(e.target.value),
|
|
208
208
|
className: H
|
|
209
209
|
})] }),
|
|
210
210
|
/* @__PURE__ */ B("div", { children: [/* @__PURE__ */ z("label", {
|
|
@@ -214,8 +214,8 @@ function oe({ relationship: e, onClose: t }) {
|
|
|
214
214
|
}), /* @__PURE__ */ z("input", {
|
|
215
215
|
id: "edit-currency",
|
|
216
216
|
type: "text",
|
|
217
|
-
value:
|
|
218
|
-
onChange: (e) =>
|
|
217
|
+
value: h,
|
|
218
|
+
onChange: (e) => g(e.target.value.toUpperCase()),
|
|
219
219
|
maxLength: 3,
|
|
220
220
|
className: H
|
|
221
221
|
})] }),
|
|
@@ -225,8 +225,8 @@ function oe({ relationship: e, onClose: t }) {
|
|
|
225
225
|
children: n("relationships.detail.editModal.intervalLabel", "Billing interval")
|
|
226
226
|
}), /* @__PURE__ */ z("select", {
|
|
227
227
|
id: "edit-interval",
|
|
228
|
-
value:
|
|
229
|
-
onChange: (e) =>
|
|
228
|
+
value: _,
|
|
229
|
+
onChange: (e) => v(e.target.value),
|
|
230
230
|
className: H,
|
|
231
231
|
children: W.map((e) => /* @__PURE__ */ z("option", {
|
|
232
232
|
value: e,
|
|
@@ -245,8 +245,8 @@ function oe({ relationship: e, onClose: t }) {
|
|
|
245
245
|
}), /* @__PURE__ */ z("input", {
|
|
246
246
|
id: "edit-renews",
|
|
247
247
|
type: "date",
|
|
248
|
-
value:
|
|
249
|
-
onChange: (e) =>
|
|
248
|
+
value: y,
|
|
249
|
+
onChange: (e) => S(e.target.value),
|
|
250
250
|
className: H
|
|
251
251
|
})] }),
|
|
252
252
|
/* @__PURE__ */ B("div", { children: [/* @__PURE__ */ z("label", {
|
|
@@ -268,8 +268,8 @@ function oe({ relationship: e, onClose: t }) {
|
|
|
268
268
|
className: "flex items-center gap-2 text-sm text-text-primary",
|
|
269
269
|
children: [/* @__PURE__ */ z("input", {
|
|
270
270
|
type: "checkbox",
|
|
271
|
-
checked:
|
|
272
|
-
onChange: (e) =>
|
|
271
|
+
checked: C,
|
|
272
|
+
onChange: (e) => T(e.target.checked),
|
|
273
273
|
className: "size-4 rounded border-border-subtle"
|
|
274
274
|
}), n("relationships.detail.editModal.autoRenews", "Auto-renews")]
|
|
275
275
|
})
|
|
@@ -306,33 +306,33 @@ function oe({ relationship: e, onClose: t }) {
|
|
|
306
306
|
});
|
|
307
307
|
}
|
|
308
308
|
function se({ relationshipId: e, onClose: t }) {
|
|
309
|
-
let n =
|
|
309
|
+
let n = l(), r = v(), [i, a] = E(""), [o, s] = E("FEATURE_ACCESS"), [u, d] = E(""), [f, p] = E(""), [m, h] = E(""), [g, _] = E(null);
|
|
310
310
|
return /* @__PURE__ */ z(c, {
|
|
311
311
|
title: n("relationships.detail.addEntitlementModal.title", "Add entitlement"),
|
|
312
312
|
onClose: t,
|
|
313
313
|
children: /* @__PURE__ */ B("form", {
|
|
314
314
|
onSubmit: (a) => {
|
|
315
|
-
if (a.preventDefault(),
|
|
316
|
-
|
|
315
|
+
if (a.preventDefault(), _(null), !i.trim()) {
|
|
316
|
+
_(n("relationships.detail.addEntitlementModal.nameRequired", "An entitlement name is required."));
|
|
317
317
|
return;
|
|
318
318
|
}
|
|
319
319
|
r.mutate({
|
|
320
320
|
relationshipId: e,
|
|
321
321
|
name: i.trim(),
|
|
322
322
|
type: o,
|
|
323
|
-
...
|
|
324
|
-
...
|
|
325
|
-
...
|
|
323
|
+
...u.trim() ? { quota: Number(u) } : {},
|
|
324
|
+
...f.trim() ? { unit: f.trim() } : {},
|
|
325
|
+
...m.trim() ? { description: m.trim() } : {}
|
|
326
326
|
}, {
|
|
327
327
|
onSuccess: () => t(),
|
|
328
|
-
onError: (e) =>
|
|
328
|
+
onError: (e) => _(e instanceof Error ? e.message : n("relationships.detail.addEntitlementModal.error", "Could not add entitlement."))
|
|
329
329
|
});
|
|
330
330
|
},
|
|
331
331
|
className: "space-y-4",
|
|
332
332
|
children: [
|
|
333
|
-
|
|
333
|
+
g && /* @__PURE__ */ z("div", {
|
|
334
334
|
className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
|
|
335
|
-
children:
|
|
335
|
+
children: g
|
|
336
336
|
}),
|
|
337
337
|
/* @__PURE__ */ B("div", { children: [/* @__PURE__ */ B("label", {
|
|
338
338
|
htmlFor: "ent-name",
|
|
@@ -379,8 +379,8 @@ function se({ relationshipId: e, onClose: t }) {
|
|
|
379
379
|
id: "ent-quota",
|
|
380
380
|
type: "number",
|
|
381
381
|
min: "0",
|
|
382
|
-
value:
|
|
383
|
-
onChange: (e) =>
|
|
382
|
+
value: u,
|
|
383
|
+
onChange: (e) => d(e.target.value),
|
|
384
384
|
placeholder: n("relationships.detail.addEntitlementModal.quotaPlaceholder", "e.g. 5"),
|
|
385
385
|
className: H
|
|
386
386
|
})] }),
|
|
@@ -391,8 +391,8 @@ function se({ relationshipId: e, onClose: t }) {
|
|
|
391
391
|
}), /* @__PURE__ */ z("input", {
|
|
392
392
|
id: "ent-unit",
|
|
393
393
|
type: "text",
|
|
394
|
-
value:
|
|
395
|
-
onChange: (e) =>
|
|
394
|
+
value: f,
|
|
395
|
+
onChange: (e) => p(e.target.value),
|
|
396
396
|
placeholder: n("relationships.detail.addEntitlementModal.unitPlaceholder", "e.g. seats, GB"),
|
|
397
397
|
className: H
|
|
398
398
|
})] })
|
|
@@ -404,8 +404,8 @@ function se({ relationshipId: e, onClose: t }) {
|
|
|
404
404
|
children: n("relationships.detail.addEntitlementModal.descriptionLabel", "Description")
|
|
405
405
|
}), /* @__PURE__ */ z("textarea", {
|
|
406
406
|
id: "ent-desc",
|
|
407
|
-
value:
|
|
408
|
-
onChange: (e) =>
|
|
407
|
+
value: m,
|
|
408
|
+
onChange: (e) => h(e.target.value),
|
|
409
409
|
rows: 2,
|
|
410
410
|
className: H
|
|
411
411
|
})] }),
|
|
@@ -428,34 +428,34 @@ function se({ relationshipId: e, onClose: t }) {
|
|
|
428
428
|
});
|
|
429
429
|
}
|
|
430
430
|
function ce({ relationshipId: e, onClose: t }) {
|
|
431
|
-
let n =
|
|
431
|
+
let n = l(), r = _(), { uploadFile: i, progress: a, isUploading: o } = T(), [s, u] = E(""), [d, f] = E("RECEIPT"), [p, m] = E(null), [h, g] = E(""), [v, y] = E(null), b = o || r.isPending;
|
|
432
432
|
return /* @__PURE__ */ z(c, {
|
|
433
433
|
title: n("relationships.detail.attachAssetModal.title", "Attach asset"),
|
|
434
434
|
onClose: t,
|
|
435
435
|
children: /* @__PURE__ */ B("form", {
|
|
436
436
|
onSubmit: async (a) => {
|
|
437
|
-
if (a.preventDefault(),
|
|
438
|
-
|
|
437
|
+
if (a.preventDefault(), y(null), !p) {
|
|
438
|
+
y(n("relationships.detail.attachAssetModal.chooseFile", "Choose a file to attach."));
|
|
439
439
|
return;
|
|
440
440
|
}
|
|
441
441
|
try {
|
|
442
|
-
let { fileId: n, fileName: a } = await i(
|
|
442
|
+
let { fileId: n, fileName: a } = await i(p);
|
|
443
443
|
await r.mutateAsync({
|
|
444
444
|
relationshipId: e,
|
|
445
445
|
name: s.trim() || a,
|
|
446
|
-
type:
|
|
446
|
+
type: d,
|
|
447
447
|
fileId: n,
|
|
448
|
-
...
|
|
448
|
+
...h ? { expiresAt: new Date(h).toISOString() } : {}
|
|
449
449
|
}), t();
|
|
450
450
|
} catch (e) {
|
|
451
|
-
|
|
451
|
+
y(e instanceof Error ? e.message : n("relationships.detail.attachAssetModal.error", "Could not attach the asset."));
|
|
452
452
|
}
|
|
453
453
|
},
|
|
454
454
|
className: "space-y-4",
|
|
455
455
|
children: [
|
|
456
|
-
|
|
456
|
+
v && /* @__PURE__ */ z("div", {
|
|
457
457
|
className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
|
|
458
|
-
children:
|
|
458
|
+
children: v
|
|
459
459
|
}),
|
|
460
460
|
/* @__PURE__ */ B("div", { children: [
|
|
461
461
|
/* @__PURE__ */ B("label", {
|
|
@@ -475,7 +475,7 @@ function ce({ relationshipId: e, onClose: t }) {
|
|
|
475
475
|
type: "file",
|
|
476
476
|
onChange: (e) => {
|
|
477
477
|
let t = e.target.files?.[0] ?? null;
|
|
478
|
-
|
|
478
|
+
m(t), t && !s.trim() && u(t.name);
|
|
479
479
|
},
|
|
480
480
|
className: "w-full text-sm text-text-secondary file:mr-3 file:rounded-lg file:border file:border-border-subtle file:bg-bg-surface file:px-3 file:py-1.5 file:text-sm file:font-medium file:text-text-primary hover:file:bg-bg-sunken"
|
|
481
481
|
}),
|
|
@@ -494,7 +494,7 @@ function ce({ relationshipId: e, onClose: t }) {
|
|
|
494
494
|
id: "asset-name",
|
|
495
495
|
type: "text",
|
|
496
496
|
value: s,
|
|
497
|
-
onChange: (e) =>
|
|
497
|
+
onChange: (e) => u(e.target.value),
|
|
498
498
|
placeholder: n("relationships.detail.attachAssetModal.namePlaceholder", "Defaults to the file name"),
|
|
499
499
|
className: H
|
|
500
500
|
})] }), /* @__PURE__ */ B("div", { children: [/* @__PURE__ */ z("label", {
|
|
@@ -503,8 +503,8 @@ function ce({ relationshipId: e, onClose: t }) {
|
|
|
503
503
|
children: n("relationships.detail.attachAssetModal.typeLabel", "Type")
|
|
504
504
|
}), /* @__PURE__ */ z("select", {
|
|
505
505
|
id: "asset-type",
|
|
506
|
-
value:
|
|
507
|
-
onChange: (e) =>
|
|
506
|
+
value: d,
|
|
507
|
+
onChange: (e) => f(e.target.value),
|
|
508
508
|
className: H,
|
|
509
509
|
children: K.map((e) => /* @__PURE__ */ z("option", {
|
|
510
510
|
value: e,
|
|
@@ -519,8 +519,8 @@ function ce({ relationshipId: e, onClose: t }) {
|
|
|
519
519
|
}), /* @__PURE__ */ z("input", {
|
|
520
520
|
id: "asset-expires",
|
|
521
521
|
type: "date",
|
|
522
|
-
value:
|
|
523
|
-
onChange: (e) =>
|
|
522
|
+
value: h,
|
|
523
|
+
onChange: (e) => g(e.target.value),
|
|
524
524
|
className: H
|
|
525
525
|
})] }),
|
|
526
526
|
o && /* @__PURE__ */ z("p", {
|
|
@@ -536,9 +536,9 @@ function ce({ relationshipId: e, onClose: t }) {
|
|
|
536
536
|
children: n("relationships.detail.attachAssetModal.cancel", "Cancel")
|
|
537
537
|
}), /* @__PURE__ */ z("button", {
|
|
538
538
|
type: "submit",
|
|
539
|
-
disabled:
|
|
539
|
+
disabled: b,
|
|
540
540
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
|
|
541
|
-
children:
|
|
541
|
+
children: b ? n("relationships.detail.attachAssetModal.attaching", "Attaching…") : n("relationships.detail.attachAssetModal.submit", "Attach asset")
|
|
542
542
|
})]
|
|
543
543
|
})
|
|
544
544
|
]
|
|
@@ -546,7 +546,7 @@ function ce({ relationshipId: e, onClose: t }) {
|
|
|
546
546
|
});
|
|
547
547
|
}
|
|
548
548
|
function le({ asset: e }) {
|
|
549
|
-
let t =
|
|
549
|
+
let t = l(), n = y(), [a, o] = E(!1);
|
|
550
550
|
return /* @__PURE__ */ B("div", {
|
|
551
551
|
className: "flex items-center justify-between gap-3 p-3",
|
|
552
552
|
children: [/* @__PURE__ */ B("div", {
|
|
@@ -590,20 +590,42 @@ function le({ asset: e }) {
|
|
|
590
590
|
})]
|
|
591
591
|
});
|
|
592
592
|
}
|
|
593
|
+
function ue({ invoice: e }) {
|
|
594
|
+
let t = l(), a = e.number ?? t("relationships.detail.invoiceRow.unnumbered", "Unnumbered invoice");
|
|
595
|
+
return /* @__PURE__ */ B("div", {
|
|
596
|
+
className: "flex items-center justify-between gap-3 p-3",
|
|
597
|
+
children: [/* @__PURE__ */ B("div", {
|
|
598
|
+
className: "flex min-w-0 items-center gap-2",
|
|
599
|
+
children: [/* @__PURE__ */ z(j, { className: "h-4 w-4 shrink-0 text-text-secondary" }), /* @__PURE__ */ B("div", {
|
|
600
|
+
className: "min-w-0",
|
|
601
|
+
children: [/* @__PURE__ */ z("p", {
|
|
602
|
+
className: "truncate text-sm font-medium text-text-primary",
|
|
603
|
+
children: a
|
|
604
|
+
}), /* @__PURE__ */ B("p", {
|
|
605
|
+
className: "text-xs text-text-secondary",
|
|
606
|
+
children: [i(e.status), e.dueDate ? ` · ${t("relationships.detail.invoiceRow.due", "due {{date}}", { date: r(e.dueDate) })}` : e.issueDate ? ` · ${r(e.issueDate)}` : ""]
|
|
607
|
+
})]
|
|
608
|
+
})]
|
|
609
|
+
}), /* @__PURE__ */ z("span", {
|
|
610
|
+
className: "shrink-0 text-sm font-medium tabular-nums text-text-primary",
|
|
611
|
+
children: n(e.total, e.currency)
|
|
612
|
+
})]
|
|
613
|
+
});
|
|
614
|
+
}
|
|
593
615
|
function X() {
|
|
594
|
-
let c =
|
|
595
|
-
if (
|
|
616
|
+
let c = l(), { id: _ } = ne(), { navigateTo: v } = e(), { data: y, isLoading: b, isError: x, refetch: w } = S(_), T = C(), M = g(), [N, P] = E(null), [I, H] = E(!1), [U, W] = E(!1), [G, K] = E(!1);
|
|
617
|
+
if (b) return /* @__PURE__ */ z(t, {
|
|
596
618
|
title: c("relationships.title", "Relationship"),
|
|
597
|
-
children: /* @__PURE__ */ z(
|
|
619
|
+
children: /* @__PURE__ */ z(d, { label: c("relationships.detail.loading", "Loading relationship…") })
|
|
598
620
|
});
|
|
599
|
-
if (
|
|
621
|
+
if (x) return /* @__PURE__ */ z(t, {
|
|
600
622
|
title: c("relationships.title", "Relationship"),
|
|
601
|
-
children: /* @__PURE__ */ z(
|
|
623
|
+
children: /* @__PURE__ */ z(u, {
|
|
602
624
|
message: c("relationships.detail.error", "Could not load this relationship."),
|
|
603
|
-
onRetry: () => void
|
|
625
|
+
onRetry: () => void w()
|
|
604
626
|
})
|
|
605
627
|
});
|
|
606
|
-
if (!
|
|
628
|
+
if (!y) return /* @__PURE__ */ z(t, {
|
|
607
629
|
title: c("relationships.title", "Relationship"),
|
|
608
630
|
children: /* @__PURE__ */ z(s, {
|
|
609
631
|
illustration: "empty-data",
|
|
@@ -611,18 +633,18 @@ function X() {
|
|
|
611
633
|
description: c("relationships.detail.notFoundDescription", "It may have been removed, or you may not have access to it."),
|
|
612
634
|
action: /* @__PURE__ */ z("button", {
|
|
613
635
|
type: "button",
|
|
614
|
-
onClick: () =>
|
|
636
|
+
onClick: () => v("/relationships"),
|
|
615
637
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
|
|
616
638
|
children: c("relationships.detail.backToRelationships", "Back to relationships")
|
|
617
639
|
})
|
|
618
640
|
})
|
|
619
641
|
});
|
|
620
|
-
let Y =
|
|
621
|
-
P(null),
|
|
642
|
+
let Y = y, X = T.isPending || M.isPending, de = (e) => {
|
|
643
|
+
P(null), T.mutate({
|
|
622
644
|
id: Y.id,
|
|
623
645
|
status: e
|
|
624
646
|
}, { onError: (e) => P(e instanceof Error ? e.message : c("relationships.detail.transitionError", "Transition failed")) });
|
|
625
|
-
},
|
|
647
|
+
}, fe = () => {
|
|
626
648
|
P(null), M.mutate(Y.id, { onError: (e) => P(e instanceof Error ? e.message : c("relationships.detail.cancelError", "Cancel failed")) });
|
|
627
649
|
}, Z = [...Y.renewalEvents ?? []].sort((e, t) => new Date(e.occursAt).getTime() - new Date(t.occursAt).getTime()).map((e) => {
|
|
628
650
|
let t = new Date(e.occursAt).getTime(), a = !Number.isNaN(t) && t > Date.now();
|
|
@@ -638,7 +660,7 @@ function X() {
|
|
|
638
660
|
}) : /* @__PURE__ */ z("span", {
|
|
639
661
|
className: "inline-flex items-center rounded-full bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary",
|
|
640
662
|
children: c("relationships.detail.autoRenewOff", "Off")
|
|
641
|
-
}),
|
|
663
|
+
}), pe = ie.filter((e) => e.status !== Y.status), $ = Y.plan?.features ?? [];
|
|
642
664
|
return /* @__PURE__ */ B(t, {
|
|
643
665
|
title: Y.label,
|
|
644
666
|
description: Y.provider?.name ?? c(q[Y.kind], i(Y.kind)),
|
|
@@ -655,7 +677,7 @@ function X() {
|
|
|
655
677
|
]
|
|
656
678
|
}), /* @__PURE__ */ B("button", {
|
|
657
679
|
type: "button",
|
|
658
|
-
onClick: () =>
|
|
680
|
+
onClick: () => v("/relationships"),
|
|
659
681
|
className: "inline-flex items-center gap-2 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
660
682
|
children: [
|
|
661
683
|
/* @__PURE__ */ z(O, { className: "h-4 w-4" }),
|
|
@@ -719,12 +741,12 @@ function X() {
|
|
|
719
741
|
]
|
|
720
742
|
}), /* @__PURE__ */ B("div", {
|
|
721
743
|
className: "flex shrink-0 flex-wrap gap-2 lg:flex-col lg:items-stretch",
|
|
722
|
-
children: [
|
|
744
|
+
children: [pe.map((e) => {
|
|
723
745
|
let t = e.icon;
|
|
724
746
|
return /* @__PURE__ */ B("button", {
|
|
725
747
|
type: "button",
|
|
726
748
|
disabled: X,
|
|
727
|
-
onClick: () =>
|
|
749
|
+
onClick: () => de(e.status),
|
|
728
750
|
className: "inline-flex items-center justify-center gap-1.5 rounded-lg border border-border-subtle bg-bg-surface px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50",
|
|
729
751
|
children: [
|
|
730
752
|
/* @__PURE__ */ z(t, { className: "h-3.5 w-3.5" }),
|
|
@@ -735,7 +757,7 @@ function X() {
|
|
|
735
757
|
}), Y.status !== "CANCELLED" && /* @__PURE__ */ B("button", {
|
|
736
758
|
type: "button",
|
|
737
759
|
disabled: X,
|
|
738
|
-
onClick:
|
|
760
|
+
onClick: fe,
|
|
739
761
|
className: "inline-flex items-center justify-center gap-1.5 rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-3 py-1.5 text-xs font-medium text-status-error-text hover:opacity-90 disabled:opacity-50",
|
|
740
762
|
children: [
|
|
741
763
|
/* @__PURE__ */ z(k, { className: "h-3.5 w-3.5" }),
|
|
@@ -838,7 +860,7 @@ function X() {
|
|
|
838
860
|
})]
|
|
839
861
|
})]
|
|
840
862
|
}),
|
|
841
|
-
/* @__PURE__ */ z(
|
|
863
|
+
/* @__PURE__ */ z(f, {
|
|
842
864
|
className: "mt-0",
|
|
843
865
|
title: c("relationships.detail.sections.entitlements", "Entitlements"),
|
|
844
866
|
description: c("relationships.detail.sections.entitlementsDescription", "What this relationship grants you"),
|
|
@@ -888,7 +910,7 @@ function X() {
|
|
|
888
910
|
className: "tabular-nums",
|
|
889
911
|
children: [Math.round(e.used / e.quota * 100), "%"]
|
|
890
912
|
})]
|
|
891
|
-
}), /* @__PURE__ */ z(
|
|
913
|
+
}), /* @__PURE__ */ z(m, {
|
|
892
914
|
value: e.used,
|
|
893
915
|
max: e.quota,
|
|
894
916
|
tone: e.used / e.quota >= .9 ? "negative" : e.used / e.quota >= .7 ? "warning" : "accent",
|
|
@@ -900,7 +922,7 @@ function X() {
|
|
|
900
922
|
})
|
|
901
923
|
})
|
|
902
924
|
}),
|
|
903
|
-
/* @__PURE__ */ z(
|
|
925
|
+
/* @__PURE__ */ z(f, {
|
|
904
926
|
className: "mt-0",
|
|
905
927
|
title: c("relationships.detail.sections.assets", "Assets"),
|
|
906
928
|
description: c("relationships.detail.sections.assetsDescription", "Invoices, contracts, licenses and credentials"),
|
|
@@ -914,15 +936,26 @@ function X() {
|
|
|
914
936
|
c("relationships.detail.sections.attachAsset", "Attach asset")
|
|
915
937
|
]
|
|
916
938
|
}),
|
|
917
|
-
children:
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
939
|
+
children: (() => {
|
|
940
|
+
let e = Y.assets ?? [], t = Y.invoices ?? [];
|
|
941
|
+
return e.length > 0 || t.length > 0 ? /* @__PURE__ */ z(V, {
|
|
942
|
+
treatment: "plain",
|
|
943
|
+
className: "divide-y divide-border-subtle p-0",
|
|
944
|
+
children: [...e.map((e) => ({
|
|
945
|
+
kind: "asset",
|
|
946
|
+
sort: new Date(e.createdAt).getTime() || 0,
|
|
947
|
+
asset: e
|
|
948
|
+
})), ...t.map((e) => ({
|
|
949
|
+
kind: "invoice",
|
|
950
|
+
sort: new Date(e.createdAt).getTime() || 0,
|
|
951
|
+
invoice: e
|
|
952
|
+
}))].sort((e, t) => t.sort - e.sort).map((e) => e.kind === "asset" ? /* @__PURE__ */ z(le, { asset: e.asset }, `a-${e.asset.id}`) : /* @__PURE__ */ z(ue, { invoice: e.invoice }, `i-${e.invoice.id}`))
|
|
953
|
+
}) : /* @__PURE__ */ z(s, {
|
|
954
|
+
illustration: "empty-data",
|
|
955
|
+
title: c("relationships.detail.empty.noAssetsTitle", "No assets attached"),
|
|
956
|
+
description: c("relationships.detail.empty.noAssetsDescription", "Attach invoices, contracts, licenses or receipts to this relationship.")
|
|
957
|
+
});
|
|
958
|
+
})()
|
|
926
959
|
}),
|
|
927
960
|
Y.notes && /* @__PURE__ */ B(V, {
|
|
928
961
|
treatment: "plain",
|
|
@@ -953,14 +986,14 @@ function X() {
|
|
|
953
986
|
children: c("relationships.detail.empty.noHealthScore", "Not scored yet. A health score appears once Subscriber Bot has enough signal.")
|
|
954
987
|
}) : /* @__PURE__ */ B("div", {
|
|
955
988
|
className: "mt-4 flex flex-col items-center",
|
|
956
|
-
children: [/* @__PURE__ */ z(
|
|
989
|
+
children: [/* @__PURE__ */ z(p, {
|
|
957
990
|
value: Y.healthScore,
|
|
958
991
|
max: 100,
|
|
959
992
|
size: 160,
|
|
960
993
|
label: c("relationships.detail.outOf100", "of 100")
|
|
961
994
|
}), /* @__PURE__ */ z("div", {
|
|
962
995
|
className: "mt-2 w-full",
|
|
963
|
-
children: /* @__PURE__ */ z(
|
|
996
|
+
children: /* @__PURE__ */ z(m, {
|
|
964
997
|
value: Y.healthScore,
|
|
965
998
|
max: 100,
|
|
966
999
|
tone: ae(Y.healthScore)
|
|
@@ -990,7 +1023,7 @@ function X() {
|
|
|
990
1023
|
title: c("relationships.detail.empty.noRenewalEventsTitle", "No renewal events"),
|
|
991
1024
|
description: c("relationships.detail.empty.noRenewalEventsDescription", "Renewals and price changes will appear here as they're detected.")
|
|
992
1025
|
})
|
|
993
|
-
}) : /* @__PURE__ */ z(
|
|
1026
|
+
}) : /* @__PURE__ */ z(h, {
|
|
994
1027
|
items: Z,
|
|
995
1028
|
className: "mt-4"
|
|
996
1029
|
})
|