@burdenoff/microfe-subscriberbot 2026.1030.1 → 2026.1030.3
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/SubscriberBotRoutes.d.ts.map +1 -1
- package/dist/subscriberbot/SubscriberBotRoutes.js +16 -8
- package/dist/subscriberbot/SubscriberBotRoutes.js.map +1 -1
- package/dist/subscriberbot/components/StatusBadge.d.ts.map +1 -1
- package/dist/subscriberbot/components/StatusBadge.js +6 -1
- package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
- package/dist/subscriberbot/components/decisions/DecisionBanners.d.ts +11 -0
- package/dist/subscriberbot/components/decisions/DecisionBanners.d.ts.map +1 -0
- package/dist/subscriberbot/components/decisions/DecisionBanners.js +62 -0
- package/dist/subscriberbot/components/decisions/DecisionBanners.js.map +1 -0
- package/dist/subscriberbot/components/decisions/DecisionCard.d.ts +22 -0
- package/dist/subscriberbot/components/decisions/DecisionCard.d.ts.map +1 -0
- package/dist/subscriberbot/components/decisions/DecisionCard.js +316 -0
- package/dist/subscriberbot/components/decisions/DecisionCard.js.map +1 -0
- package/dist/subscriberbot/components/decisions/decisionModel.d.ts +51 -0
- package/dist/subscriberbot/components/decisions/decisionModel.d.ts.map +1 -0
- package/dist/subscriberbot/components/decisions/decisionModel.js +139 -0
- package/dist/subscriberbot/components/decisions/decisionModel.js.map +1 -0
- package/dist/subscriberbot/components/decisions/index.d.ts +9 -0
- package/dist/subscriberbot/components/decisions/index.d.ts.map +1 -0
- package/dist/subscriberbot/components/decisions/index.js +3 -0
- package/dist/subscriberbot/hooks/index.d.ts +1 -1
- package/dist/subscriberbot/hooks/index.d.ts.map +1 -1
- package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts +19 -2
- package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts.map +1 -1
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js +103 -38
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts +7 -0
- package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js +280 -175
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts +12 -0
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts.map +1 -0
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js +180 -0
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js.map +1 -0
- package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts +13 -0
- package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts.map +1 -0
- package/dist/subscriberbot/pages/decisions/DecisionsPage.js +154 -0
- package/dist/subscriberbot/pages/decisions/DecisionsPage.js.map +1 -0
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +338 -316
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
- package/dist/subscriberbot/types/index.d.ts +66 -1
- package/dist/subscriberbot/types/index.d.ts.map +1 -1
- package/dist/subscriberbot/utils/pageContext.d.ts +1 -0
- package/dist/subscriberbot/utils/pageContext.d.ts.map +1 -1
- package/dist/subscriberbot/utils/pageContext.js +2 -0
- package/dist/subscriberbot/utils/pageContext.js.map +1 -1
- package/package.json +1 -1
|
@@ -8,14 +8,17 @@ import { useTr as l } from "../../hooks/useTr.js";
|
|
|
8
8
|
import { ErrorView as u, LoadingView as d, Section as f } from "../../components/StateViews.js";
|
|
9
9
|
import { Gauge as p, MiniProgress as m, Timeline as h } from "../../components/viz.js";
|
|
10
10
|
import "../../components/index.js";
|
|
11
|
-
import { useCancelRelationship as g, useCreateAsset as _, useCreateEntitlement as v,
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
11
|
+
import { useCancelRelationship as g, useCreateAsset as _, useCreateEntitlement as v, useDecisions as y, useFileDownloadUrl as b, useInvoices as x, usePlans as S, useProviders as C, useRelationship as w, useTransitionRelationship as T, useUpdateRelationship as E, useUploadFile as D } from "../../hooks/useSubscriberBotApi.js";
|
|
12
|
+
import { DecisionCard as O } from "../../components/decisions/DecisionCard.js";
|
|
13
|
+
import { AiDisclaimer as k } from "../../components/decisions/DecisionBanners.js";
|
|
14
|
+
import "../../components/decisions/index.js";
|
|
15
|
+
import { useState as A } from "react";
|
|
16
|
+
import { Activity as j, ArrowLeft as M, Ban as N, CalendarClock as P, CreditCard as F, Download as I, Paperclip as L, Pause as R, Pencil as ee, Play as z, Plus as B, ShieldCheck as te, Tag as ne, Wallet as re } from "lucide-react";
|
|
17
|
+
import { useParams as ie } from "react-router";
|
|
18
|
+
import { Fragment as ae, jsx as V, jsxs as H } from "react/jsx-runtime";
|
|
19
|
+
import { GlassCard as U } from "@burdenoff/fe-libs/ui";
|
|
17
20
|
//#region src/subscriberbot/pages/relationships/RelationshipDetailPage.tsx
|
|
18
|
-
var
|
|
21
|
+
var W = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", G = "mb-1 block text-xs font-medium text-text-secondary", K = [
|
|
19
22
|
"MONTHLY",
|
|
20
23
|
"YEARLY",
|
|
21
24
|
"QUARTERLY",
|
|
@@ -24,14 +27,14 @@ var H = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 t
|
|
|
24
27
|
"USAGE_BASED",
|
|
25
28
|
"LIFETIME",
|
|
26
29
|
"FREE"
|
|
27
|
-
],
|
|
30
|
+
], q = [
|
|
28
31
|
"FEATURE_ACCESS",
|
|
29
32
|
"SEAT",
|
|
30
33
|
"USAGE_QUOTA",
|
|
31
34
|
"CONTENT",
|
|
32
35
|
"DISCOUNT",
|
|
33
36
|
"SUPPORT_TIER"
|
|
34
|
-
],
|
|
37
|
+
], J = [
|
|
35
38
|
"RECEIPT",
|
|
36
39
|
"INVOICE",
|
|
37
40
|
"CONTRACT",
|
|
@@ -40,7 +43,7 @@ var H = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 t
|
|
|
40
43
|
"CERTIFICATE",
|
|
41
44
|
"WARRANTY",
|
|
42
45
|
"DOMAIN"
|
|
43
|
-
],
|
|
46
|
+
], Y = {
|
|
44
47
|
SUBSCRIPTION: "relationships.kinds.subscription",
|
|
45
48
|
MEMBERSHIP: "relationships.kinds.membership",
|
|
46
49
|
LICENSE: "relationships.kinds.license",
|
|
@@ -49,59 +52,59 @@ var H = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 t
|
|
|
49
52
|
RECURRING_PAYMENT: "relationships.kinds.recurringPayment",
|
|
50
53
|
ENROLLMENT: "relationships.kinds.enrollment",
|
|
51
54
|
TRIAL: "relationships.kinds.trial"
|
|
52
|
-
},
|
|
55
|
+
}, oe = [
|
|
53
56
|
{
|
|
54
57
|
status: "ACTIVE",
|
|
55
58
|
labelKey: "relationships.detail.actions.activate",
|
|
56
59
|
defaultLabel: "Activate",
|
|
57
|
-
icon:
|
|
60
|
+
icon: z
|
|
58
61
|
},
|
|
59
62
|
{
|
|
60
63
|
status: "PAUSED",
|
|
61
64
|
labelKey: "relationships.detail.actions.pause",
|
|
62
65
|
defaultLabel: "Pause",
|
|
63
|
-
icon:
|
|
66
|
+
icon: R
|
|
64
67
|
},
|
|
65
68
|
{
|
|
66
69
|
status: "EXPIRED",
|
|
67
70
|
labelKey: "relationships.detail.actions.markExpired",
|
|
68
71
|
defaultLabel: "Mark expired",
|
|
69
|
-
icon:
|
|
72
|
+
icon: N
|
|
70
73
|
}
|
|
71
74
|
];
|
|
72
|
-
function
|
|
73
|
-
return /* @__PURE__ */
|
|
75
|
+
function X({ label: e, value: t }) {
|
|
76
|
+
return /* @__PURE__ */ H("div", {
|
|
74
77
|
className: "flex items-center justify-between gap-3 border-b border-border-subtle/60 py-2.5 last:border-0 last:pb-0",
|
|
75
|
-
children: [/* @__PURE__ */
|
|
78
|
+
children: [/* @__PURE__ */ V("span", {
|
|
76
79
|
className: "shrink-0 text-sm text-text-secondary",
|
|
77
80
|
children: e
|
|
78
|
-
}), /* @__PURE__ */
|
|
81
|
+
}), /* @__PURE__ */ V("span", {
|
|
79
82
|
className: "min-w-0 truncate text-right text-sm font-medium text-text-primary",
|
|
80
83
|
children: t
|
|
81
84
|
})]
|
|
82
85
|
});
|
|
83
86
|
}
|
|
84
|
-
function
|
|
87
|
+
function se(e) {
|
|
85
88
|
return e == null ? "accent" : e >= 66 ? "positive" : e >= 33 ? "warning" : "negative";
|
|
86
89
|
}
|
|
87
|
-
function
|
|
90
|
+
function ce(e) {
|
|
88
91
|
if (!e) return "";
|
|
89
92
|
let t = new Date(e);
|
|
90
93
|
return Number.isNaN(t.getTime()) ? "" : t.toISOString().slice(0, 10);
|
|
91
94
|
}
|
|
92
|
-
function
|
|
93
|
-
let n = l(), r =
|
|
95
|
+
function le({ relationship: e, onClose: t }) {
|
|
96
|
+
let n = l(), r = E(), i = C({ pagination: {
|
|
94
97
|
limit: 100,
|
|
95
98
|
offset: 0
|
|
96
|
-
} }), [a, o] =
|
|
99
|
+
} }), [a, o] = A(e.label), [s, u] = A(e.providerId ?? ""), [d, f] = A(e.planId ?? ""), [p, m] = A(String(e.amount ?? "")), [h, g] = A(e.currency), [_, v] = A(e.interval), [y, b] = A(ce(e.renewsAt)), [x, w] = A(e.autoRenew), [T, D] = A(e.healthScore == null ? "" : String(e.healthScore)), [O, k] = A(e.notes ?? ""), [j, M] = A(null), N = S(s || void 0), P = (() => {
|
|
97
100
|
let t = i.data?.items ?? [];
|
|
98
101
|
return e.provider && !t.some((t) => t.id === e.provider?.id) ? [e.provider, ...t] : t;
|
|
99
102
|
})(), F = N.data ?? [];
|
|
100
|
-
return /* @__PURE__ */
|
|
103
|
+
return /* @__PURE__ */ V(c, {
|
|
101
104
|
title: n("relationships.detail.editModal.title", "Edit relationship"),
|
|
102
105
|
onClose: t,
|
|
103
106
|
maxWidthClassName: "max-w-2xl",
|
|
104
|
-
children: /* @__PURE__ */
|
|
107
|
+
children: /* @__PURE__ */ H("form", {
|
|
105
108
|
onSubmit: (i) => {
|
|
106
109
|
if (i.preventDefault(), M(null), !a.trim()) {
|
|
107
110
|
M(n("relationships.detail.editModal.labelRequired", "A label is required."));
|
|
@@ -110,13 +113,13 @@ function oe({ relationship: e, onClose: t }) {
|
|
|
110
113
|
let o = {
|
|
111
114
|
label: a.trim(),
|
|
112
115
|
interval: _,
|
|
113
|
-
autoRenew:
|
|
116
|
+
autoRenew: x,
|
|
114
117
|
currency: h.trim() || "USD",
|
|
115
|
-
notes:
|
|
118
|
+
notes: O.trim(),
|
|
116
119
|
...s ? { providerId: s } : {},
|
|
117
120
|
...d ? { planId: d } : {},
|
|
118
121
|
...p.trim() ? { amount: Number(p) } : {},
|
|
119
|
-
...
|
|
122
|
+
...T.trim() ? { healthScore: Number(T) } : {},
|
|
120
123
|
...y ? { renewsAt: new Date(y).toISOString() } : {}
|
|
121
124
|
};
|
|
122
125
|
r.mutate({
|
|
@@ -129,172 +132,172 @@ function oe({ relationship: e, onClose: t }) {
|
|
|
129
132
|
},
|
|
130
133
|
className: "space-y-4",
|
|
131
134
|
children: [
|
|
132
|
-
j && /* @__PURE__ */
|
|
135
|
+
j && /* @__PURE__ */ V("div", {
|
|
133
136
|
className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
|
|
134
137
|
children: j
|
|
135
138
|
}),
|
|
136
|
-
/* @__PURE__ */
|
|
139
|
+
/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ H("label", {
|
|
137
140
|
htmlFor: "edit-label",
|
|
138
|
-
className:
|
|
141
|
+
className: G,
|
|
139
142
|
children: [
|
|
140
143
|
n("relationships.detail.editModal.labelLabel", "Label"),
|
|
141
144
|
" ",
|
|
142
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ V("span", {
|
|
143
146
|
className: "text-status-error-text",
|
|
144
147
|
children: "*"
|
|
145
148
|
})
|
|
146
149
|
]
|
|
147
|
-
}), /* @__PURE__ */
|
|
150
|
+
}), /* @__PURE__ */ V("input", {
|
|
148
151
|
id: "edit-label",
|
|
149
152
|
type: "text",
|
|
150
153
|
value: a,
|
|
151
154
|
onChange: (e) => o(e.target.value),
|
|
152
|
-
className:
|
|
155
|
+
className: W,
|
|
153
156
|
required: !0
|
|
154
157
|
})] }),
|
|
155
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ H("div", {
|
|
156
159
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
157
|
-
children: [/* @__PURE__ */
|
|
160
|
+
children: [/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
|
|
158
161
|
htmlFor: "edit-provider",
|
|
159
|
-
className:
|
|
162
|
+
className: G,
|
|
160
163
|
children: n("relationships.detail.editModal.providerLabel", "Provider")
|
|
161
|
-
}), /* @__PURE__ */
|
|
164
|
+
}), /* @__PURE__ */ H("select", {
|
|
162
165
|
id: "edit-provider",
|
|
163
166
|
value: s,
|
|
164
167
|
onChange: (e) => {
|
|
165
168
|
u(e.target.value), f("");
|
|
166
169
|
},
|
|
167
|
-
className:
|
|
168
|
-
children: [/* @__PURE__ */
|
|
170
|
+
className: W,
|
|
171
|
+
children: [/* @__PURE__ */ V("option", {
|
|
169
172
|
value: "",
|
|
170
173
|
children: n("relationships.detail.editModal.providerNone", "— None —")
|
|
171
|
-
}), P.map((e) => /* @__PURE__ */
|
|
174
|
+
}), P.map((e) => /* @__PURE__ */ V("option", {
|
|
172
175
|
value: e.id,
|
|
173
176
|
children: e.name
|
|
174
177
|
}, e.id))]
|
|
175
|
-
})] }), /* @__PURE__ */
|
|
178
|
+
})] }), /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
|
|
176
179
|
htmlFor: "edit-plan",
|
|
177
|
-
className:
|
|
180
|
+
className: G,
|
|
178
181
|
children: n("relationships.detail.editModal.planLabel", "Plan")
|
|
179
|
-
}), /* @__PURE__ */
|
|
182
|
+
}), /* @__PURE__ */ H("select", {
|
|
180
183
|
id: "edit-plan",
|
|
181
184
|
value: d,
|
|
182
185
|
onChange: (e) => f(e.target.value),
|
|
183
|
-
className:
|
|
186
|
+
className: W,
|
|
184
187
|
disabled: !s || F.length === 0,
|
|
185
|
-
children: [/* @__PURE__ */
|
|
188
|
+
children: [/* @__PURE__ */ V("option", {
|
|
186
189
|
value: "",
|
|
187
190
|
children: n("relationships.detail.editModal.planNone", "— None —")
|
|
188
|
-
}), F.map((e) => /* @__PURE__ */
|
|
191
|
+
}), F.map((e) => /* @__PURE__ */ V("option", {
|
|
189
192
|
value: e.id,
|
|
190
193
|
children: e.name
|
|
191
194
|
}, e.id))]
|
|
192
195
|
})] })]
|
|
193
196
|
}),
|
|
194
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ H("div", {
|
|
195
198
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
196
199
|
children: [
|
|
197
|
-
/* @__PURE__ */
|
|
200
|
+
/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
|
|
198
201
|
htmlFor: "edit-amount",
|
|
199
|
-
className:
|
|
202
|
+
className: G,
|
|
200
203
|
children: n("relationships.detail.editModal.amountLabel", "Amount")
|
|
201
|
-
}), /* @__PURE__ */
|
|
204
|
+
}), /* @__PURE__ */ V("input", {
|
|
202
205
|
id: "edit-amount",
|
|
203
206
|
type: "number",
|
|
204
207
|
min: "0",
|
|
205
208
|
step: "0.01",
|
|
206
209
|
value: p,
|
|
207
210
|
onChange: (e) => m(e.target.value),
|
|
208
|
-
className:
|
|
211
|
+
className: W
|
|
209
212
|
})] }),
|
|
210
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
|
|
211
214
|
htmlFor: "edit-currency",
|
|
212
|
-
className:
|
|
215
|
+
className: G,
|
|
213
216
|
children: n("relationships.detail.editModal.currencyLabel", "Currency")
|
|
214
|
-
}), /* @__PURE__ */
|
|
217
|
+
}), /* @__PURE__ */ V("input", {
|
|
215
218
|
id: "edit-currency",
|
|
216
219
|
type: "text",
|
|
217
220
|
value: h,
|
|
218
221
|
onChange: (e) => g(e.target.value.toUpperCase()),
|
|
219
222
|
maxLength: 3,
|
|
220
|
-
className:
|
|
223
|
+
className: W
|
|
221
224
|
})] }),
|
|
222
|
-
/* @__PURE__ */
|
|
225
|
+
/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
|
|
223
226
|
htmlFor: "edit-interval",
|
|
224
|
-
className:
|
|
227
|
+
className: G,
|
|
225
228
|
children: n("relationships.detail.editModal.intervalLabel", "Billing interval")
|
|
226
|
-
}), /* @__PURE__ */
|
|
229
|
+
}), /* @__PURE__ */ V("select", {
|
|
227
230
|
id: "edit-interval",
|
|
228
231
|
value: _,
|
|
229
232
|
onChange: (e) => v(e.target.value),
|
|
230
|
-
className:
|
|
231
|
-
children:
|
|
233
|
+
className: W,
|
|
234
|
+
children: K.map((e) => /* @__PURE__ */ V("option", {
|
|
232
235
|
value: e,
|
|
233
236
|
children: e.replace(/_/g, " ")
|
|
234
237
|
}, e))
|
|
235
238
|
})] })
|
|
236
239
|
]
|
|
237
240
|
}),
|
|
238
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ H("div", {
|
|
239
242
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
240
243
|
children: [
|
|
241
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
|
|
242
245
|
htmlFor: "edit-renews",
|
|
243
|
-
className:
|
|
246
|
+
className: G,
|
|
244
247
|
children: n("relationships.detail.editModal.renewsOnLabel", "Renews on")
|
|
245
|
-
}), /* @__PURE__ */
|
|
248
|
+
}), /* @__PURE__ */ V("input", {
|
|
246
249
|
id: "edit-renews",
|
|
247
250
|
type: "date",
|
|
248
251
|
value: y,
|
|
249
|
-
onChange: (e) =>
|
|
250
|
-
className:
|
|
252
|
+
onChange: (e) => b(e.target.value),
|
|
253
|
+
className: W
|
|
251
254
|
})] }),
|
|
252
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
|
|
253
256
|
htmlFor: "edit-health",
|
|
254
|
-
className:
|
|
257
|
+
className: G,
|
|
255
258
|
children: n("relationships.detail.editModal.healthScoreLabel", "Health score (0–100)")
|
|
256
|
-
}), /* @__PURE__ */
|
|
259
|
+
}), /* @__PURE__ */ V("input", {
|
|
257
260
|
id: "edit-health",
|
|
258
261
|
type: "number",
|
|
259
262
|
min: "0",
|
|
260
263
|
max: "100",
|
|
261
|
-
value:
|
|
262
|
-
onChange: (e) =>
|
|
263
|
-
className:
|
|
264
|
+
value: T,
|
|
265
|
+
onChange: (e) => D(e.target.value),
|
|
266
|
+
className: W
|
|
264
267
|
})] }),
|
|
265
|
-
/* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ V("div", {
|
|
266
269
|
className: "flex items-end",
|
|
267
|
-
children: /* @__PURE__ */
|
|
270
|
+
children: /* @__PURE__ */ H("label", {
|
|
268
271
|
className: "flex items-center gap-2 text-sm text-text-primary",
|
|
269
|
-
children: [/* @__PURE__ */
|
|
272
|
+
children: [/* @__PURE__ */ V("input", {
|
|
270
273
|
type: "checkbox",
|
|
271
|
-
checked:
|
|
272
|
-
onChange: (e) =>
|
|
274
|
+
checked: x,
|
|
275
|
+
onChange: (e) => w(e.target.checked),
|
|
273
276
|
className: "size-4 rounded border-border-subtle"
|
|
274
277
|
}), n("relationships.detail.editModal.autoRenews", "Auto-renews")]
|
|
275
278
|
})
|
|
276
279
|
})
|
|
277
280
|
]
|
|
278
281
|
}),
|
|
279
|
-
/* @__PURE__ */
|
|
282
|
+
/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
|
|
280
283
|
htmlFor: "edit-notes",
|
|
281
|
-
className:
|
|
284
|
+
className: G,
|
|
282
285
|
children: n("relationships.detail.editModal.notesLabel", "Notes")
|
|
283
|
-
}), /* @__PURE__ */
|
|
286
|
+
}), /* @__PURE__ */ V("textarea", {
|
|
284
287
|
id: "edit-notes",
|
|
285
|
-
value:
|
|
286
|
-
onChange: (e) =>
|
|
288
|
+
value: O,
|
|
289
|
+
onChange: (e) => k(e.target.value),
|
|
287
290
|
rows: 3,
|
|
288
|
-
className:
|
|
291
|
+
className: W
|
|
289
292
|
})] }),
|
|
290
|
-
/* @__PURE__ */
|
|
293
|
+
/* @__PURE__ */ H("div", {
|
|
291
294
|
className: "flex justify-end gap-3",
|
|
292
|
-
children: [/* @__PURE__ */
|
|
295
|
+
children: [/* @__PURE__ */ V("button", {
|
|
293
296
|
type: "button",
|
|
294
297
|
onClick: t,
|
|
295
298
|
className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
296
299
|
children: n("relationships.detail.editModal.cancel", "Cancel")
|
|
297
|
-
}), /* @__PURE__ */
|
|
300
|
+
}), /* @__PURE__ */ V("button", {
|
|
298
301
|
type: "submit",
|
|
299
302
|
disabled: r.isPending,
|
|
300
303
|
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",
|
|
@@ -305,12 +308,12 @@ function oe({ relationship: e, onClose: t }) {
|
|
|
305
308
|
})
|
|
306
309
|
});
|
|
307
310
|
}
|
|
308
|
-
function
|
|
309
|
-
let n = l(), r = v(), [i, a] =
|
|
310
|
-
return /* @__PURE__ */
|
|
311
|
+
function ue({ relationshipId: e, onClose: t }) {
|
|
312
|
+
let n = l(), r = v(), [i, a] = A(""), [o, s] = A("FEATURE_ACCESS"), [u, d] = A(""), [f, p] = A(""), [m, h] = A(""), [g, _] = A(null);
|
|
313
|
+
return /* @__PURE__ */ V(c, {
|
|
311
314
|
title: n("relationships.detail.addEntitlementModal.title", "Add entitlement"),
|
|
312
315
|
onClose: t,
|
|
313
|
-
children: /* @__PURE__ */
|
|
316
|
+
children: /* @__PURE__ */ H("form", {
|
|
314
317
|
onSubmit: (a) => {
|
|
315
318
|
if (a.preventDefault(), _(null), !i.trim()) {
|
|
316
319
|
_(n("relationships.detail.addEntitlementModal.nameRequired", "An entitlement name is required."));
|
|
@@ -330,93 +333,93 @@ function se({ relationshipId: e, onClose: t }) {
|
|
|
330
333
|
},
|
|
331
334
|
className: "space-y-4",
|
|
332
335
|
children: [
|
|
333
|
-
g && /* @__PURE__ */
|
|
336
|
+
g && /* @__PURE__ */ V("div", {
|
|
334
337
|
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
338
|
children: g
|
|
336
339
|
}),
|
|
337
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ H("label", {
|
|
338
341
|
htmlFor: "ent-name",
|
|
339
|
-
className:
|
|
342
|
+
className: G,
|
|
340
343
|
children: [
|
|
341
344
|
n("relationships.detail.addEntitlementModal.nameLabel", "Name"),
|
|
342
345
|
" ",
|
|
343
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ V("span", {
|
|
344
347
|
className: "text-status-error-text",
|
|
345
348
|
children: "*"
|
|
346
349
|
})
|
|
347
350
|
]
|
|
348
|
-
}), /* @__PURE__ */
|
|
351
|
+
}), /* @__PURE__ */ V("input", {
|
|
349
352
|
id: "ent-name",
|
|
350
353
|
type: "text",
|
|
351
354
|
value: i,
|
|
352
355
|
onChange: (e) => a(e.target.value),
|
|
353
356
|
placeholder: n("relationships.detail.addEntitlementModal.namePlaceholder", "e.g. Seats, API calls, Priority support"),
|
|
354
|
-
className:
|
|
357
|
+
className: W,
|
|
355
358
|
required: !0
|
|
356
359
|
})] }),
|
|
357
|
-
/* @__PURE__ */
|
|
360
|
+
/* @__PURE__ */ H("div", {
|
|
358
361
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
359
362
|
children: [
|
|
360
|
-
/* @__PURE__ */
|
|
363
|
+
/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
|
|
361
364
|
htmlFor: "ent-type",
|
|
362
|
-
className:
|
|
365
|
+
className: G,
|
|
363
366
|
children: n("relationships.detail.addEntitlementModal.typeLabel", "Type")
|
|
364
|
-
}), /* @__PURE__ */
|
|
367
|
+
}), /* @__PURE__ */ V("select", {
|
|
365
368
|
id: "ent-type",
|
|
366
369
|
value: o,
|
|
367
370
|
onChange: (e) => s(e.target.value),
|
|
368
|
-
className:
|
|
369
|
-
children:
|
|
371
|
+
className: W,
|
|
372
|
+
children: q.map((e) => /* @__PURE__ */ V("option", {
|
|
370
373
|
value: e,
|
|
371
374
|
children: e.replace(/_/g, " ")
|
|
372
375
|
}, e))
|
|
373
376
|
})] }),
|
|
374
|
-
/* @__PURE__ */
|
|
377
|
+
/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
|
|
375
378
|
htmlFor: "ent-quota",
|
|
376
|
-
className:
|
|
379
|
+
className: G,
|
|
377
380
|
children: n("relationships.detail.addEntitlementModal.quotaLabel", "Quota")
|
|
378
|
-
}), /* @__PURE__ */
|
|
381
|
+
}), /* @__PURE__ */ V("input", {
|
|
379
382
|
id: "ent-quota",
|
|
380
383
|
type: "number",
|
|
381
384
|
min: "0",
|
|
382
385
|
value: u,
|
|
383
386
|
onChange: (e) => d(e.target.value),
|
|
384
387
|
placeholder: n("relationships.detail.addEntitlementModal.quotaPlaceholder", "e.g. 5"),
|
|
385
|
-
className:
|
|
388
|
+
className: W
|
|
386
389
|
})] }),
|
|
387
|
-
/* @__PURE__ */
|
|
390
|
+
/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
|
|
388
391
|
htmlFor: "ent-unit",
|
|
389
|
-
className:
|
|
392
|
+
className: G,
|
|
390
393
|
children: n("relationships.detail.addEntitlementModal.unitLabel", "Unit")
|
|
391
|
-
}), /* @__PURE__ */
|
|
394
|
+
}), /* @__PURE__ */ V("input", {
|
|
392
395
|
id: "ent-unit",
|
|
393
396
|
type: "text",
|
|
394
397
|
value: f,
|
|
395
398
|
onChange: (e) => p(e.target.value),
|
|
396
399
|
placeholder: n("relationships.detail.addEntitlementModal.unitPlaceholder", "e.g. seats, GB"),
|
|
397
|
-
className:
|
|
400
|
+
className: W
|
|
398
401
|
})] })
|
|
399
402
|
]
|
|
400
403
|
}),
|
|
401
|
-
/* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
|
|
402
405
|
htmlFor: "ent-desc",
|
|
403
|
-
className:
|
|
406
|
+
className: G,
|
|
404
407
|
children: n("relationships.detail.addEntitlementModal.descriptionLabel", "Description")
|
|
405
|
-
}), /* @__PURE__ */
|
|
408
|
+
}), /* @__PURE__ */ V("textarea", {
|
|
406
409
|
id: "ent-desc",
|
|
407
410
|
value: m,
|
|
408
411
|
onChange: (e) => h(e.target.value),
|
|
409
412
|
rows: 2,
|
|
410
|
-
className:
|
|
413
|
+
className: W
|
|
411
414
|
})] }),
|
|
412
|
-
/* @__PURE__ */
|
|
415
|
+
/* @__PURE__ */ H("div", {
|
|
413
416
|
className: "flex justify-end gap-3",
|
|
414
|
-
children: [/* @__PURE__ */
|
|
417
|
+
children: [/* @__PURE__ */ V("button", {
|
|
415
418
|
type: "button",
|
|
416
419
|
onClick: t,
|
|
417
420
|
className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
418
421
|
children: n("relationships.detail.addEntitlementModal.cancel", "Cancel")
|
|
419
|
-
}), /* @__PURE__ */
|
|
422
|
+
}), /* @__PURE__ */ V("button", {
|
|
420
423
|
type: "submit",
|
|
421
424
|
disabled: r.isPending,
|
|
422
425
|
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",
|
|
@@ -427,12 +430,12 @@ function se({ relationshipId: e, onClose: t }) {
|
|
|
427
430
|
})
|
|
428
431
|
});
|
|
429
432
|
}
|
|
430
|
-
function
|
|
431
|
-
let n = l(), r = _(), { uploadFile: i, progress: a, isUploading: o } =
|
|
432
|
-
return /* @__PURE__ */
|
|
433
|
+
function de({ relationshipId: e, onClose: t }) {
|
|
434
|
+
let n = l(), r = _(), { uploadFile: i, progress: a, isUploading: o } = D(), [s, u] = A(""), [d, f] = A("RECEIPT"), [p, m] = A(null), [h, g] = A(""), [v, y] = A(null), b = o || r.isPending;
|
|
435
|
+
return /* @__PURE__ */ V(c, {
|
|
433
436
|
title: n("relationships.detail.attachAssetModal.title", "Attach asset"),
|
|
434
437
|
onClose: t,
|
|
435
|
-
children: /* @__PURE__ */
|
|
438
|
+
children: /* @__PURE__ */ H("form", {
|
|
436
439
|
onSubmit: async (a) => {
|
|
437
440
|
if (a.preventDefault(), y(null), !p) {
|
|
438
441
|
y(n("relationships.detail.attachAssetModal.chooseFile", "Choose a file to attach."));
|
|
@@ -453,24 +456,24 @@ function ce({ relationshipId: e, onClose: t }) {
|
|
|
453
456
|
},
|
|
454
457
|
className: "space-y-4",
|
|
455
458
|
children: [
|
|
456
|
-
v && /* @__PURE__ */
|
|
459
|
+
v && /* @__PURE__ */ V("div", {
|
|
457
460
|
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
461
|
children: v
|
|
459
462
|
}),
|
|
460
|
-
/* @__PURE__ */
|
|
461
|
-
/* @__PURE__ */
|
|
463
|
+
/* @__PURE__ */ H("div", { children: [
|
|
464
|
+
/* @__PURE__ */ H("label", {
|
|
462
465
|
htmlFor: "asset-file",
|
|
463
|
-
className:
|
|
466
|
+
className: G,
|
|
464
467
|
children: [
|
|
465
468
|
n("relationships.detail.attachAssetModal.fileLabel", "File"),
|
|
466
469
|
" ",
|
|
467
|
-
/* @__PURE__ */
|
|
470
|
+
/* @__PURE__ */ V("span", {
|
|
468
471
|
className: "text-status-error-text",
|
|
469
472
|
children: "*"
|
|
470
473
|
})
|
|
471
474
|
]
|
|
472
475
|
}),
|
|
473
|
-
/* @__PURE__ */
|
|
476
|
+
/* @__PURE__ */ V("input", {
|
|
474
477
|
id: "asset-file",
|
|
475
478
|
type: "file",
|
|
476
479
|
onChange: (e) => {
|
|
@@ -479,62 +482,62 @@ function ce({ relationshipId: e, onClose: t }) {
|
|
|
479
482
|
},
|
|
480
483
|
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
484
|
}),
|
|
482
|
-
/* @__PURE__ */
|
|
485
|
+
/* @__PURE__ */ V("p", {
|
|
483
486
|
className: "mt-1 text-xs text-text-secondary",
|
|
484
487
|
children: n("relationships.detail.attachAssetModal.fileHint", "Stored securely in files — only a reference is kept here.")
|
|
485
488
|
})
|
|
486
489
|
] }),
|
|
487
|
-
/* @__PURE__ */
|
|
490
|
+
/* @__PURE__ */ H("div", {
|
|
488
491
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
489
|
-
children: [/* @__PURE__ */
|
|
492
|
+
children: [/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
|
|
490
493
|
htmlFor: "asset-name",
|
|
491
|
-
className:
|
|
494
|
+
className: G,
|
|
492
495
|
children: n("relationships.detail.attachAssetModal.nameLabel", "Name")
|
|
493
|
-
}), /* @__PURE__ */
|
|
496
|
+
}), /* @__PURE__ */ V("input", {
|
|
494
497
|
id: "asset-name",
|
|
495
498
|
type: "text",
|
|
496
499
|
value: s,
|
|
497
500
|
onChange: (e) => u(e.target.value),
|
|
498
501
|
placeholder: n("relationships.detail.attachAssetModal.namePlaceholder", "Defaults to the file name"),
|
|
499
|
-
className:
|
|
500
|
-
})] }), /* @__PURE__ */
|
|
502
|
+
className: W
|
|
503
|
+
})] }), /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
|
|
501
504
|
htmlFor: "asset-type",
|
|
502
|
-
className:
|
|
505
|
+
className: G,
|
|
503
506
|
children: n("relationships.detail.attachAssetModal.typeLabel", "Type")
|
|
504
|
-
}), /* @__PURE__ */
|
|
507
|
+
}), /* @__PURE__ */ V("select", {
|
|
505
508
|
id: "asset-type",
|
|
506
509
|
value: d,
|
|
507
510
|
onChange: (e) => f(e.target.value),
|
|
508
|
-
className:
|
|
509
|
-
children:
|
|
511
|
+
className: W,
|
|
512
|
+
children: J.map((e) => /* @__PURE__ */ V("option", {
|
|
510
513
|
value: e,
|
|
511
514
|
children: e.replace(/_/g, " ")
|
|
512
515
|
}, e))
|
|
513
516
|
})] })]
|
|
514
517
|
}),
|
|
515
|
-
/* @__PURE__ */
|
|
518
|
+
/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
|
|
516
519
|
htmlFor: "asset-expires",
|
|
517
|
-
className:
|
|
520
|
+
className: G,
|
|
518
521
|
children: n("relationships.detail.attachAssetModal.expiresOnLabel", "Expires on")
|
|
519
|
-
}), /* @__PURE__ */
|
|
522
|
+
}), /* @__PURE__ */ V("input", {
|
|
520
523
|
id: "asset-expires",
|
|
521
524
|
type: "date",
|
|
522
525
|
value: h,
|
|
523
526
|
onChange: (e) => g(e.target.value),
|
|
524
|
-
className:
|
|
527
|
+
className: W
|
|
525
528
|
})] }),
|
|
526
|
-
o && /* @__PURE__ */
|
|
529
|
+
o && /* @__PURE__ */ V("p", {
|
|
527
530
|
className: "text-xs text-text-secondary",
|
|
528
531
|
children: n("relationships.detail.attachAssetModal.uploading", "Uploading… {{progress}}%", { progress: a })
|
|
529
532
|
}),
|
|
530
|
-
/* @__PURE__ */
|
|
533
|
+
/* @__PURE__ */ H("div", {
|
|
531
534
|
className: "flex justify-end gap-3",
|
|
532
|
-
children: [/* @__PURE__ */
|
|
535
|
+
children: [/* @__PURE__ */ V("button", {
|
|
533
536
|
type: "button",
|
|
534
537
|
onClick: t,
|
|
535
538
|
className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
536
539
|
children: n("relationships.detail.attachAssetModal.cancel", "Cancel")
|
|
537
|
-
}), /* @__PURE__ */
|
|
540
|
+
}), /* @__PURE__ */ V("button", {
|
|
538
541
|
type: "submit",
|
|
539
542
|
disabled: b,
|
|
540
543
|
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",
|
|
@@ -545,28 +548,28 @@ function ce({ relationshipId: e, onClose: t }) {
|
|
|
545
548
|
})
|
|
546
549
|
});
|
|
547
550
|
}
|
|
548
|
-
function
|
|
549
|
-
let t = l(), n =
|
|
550
|
-
return /* @__PURE__ */
|
|
551
|
+
function fe({ asset: e }) {
|
|
552
|
+
let t = l(), n = b(), [a, o] = A(!1);
|
|
553
|
+
return /* @__PURE__ */ H("div", {
|
|
551
554
|
className: "flex items-center justify-between gap-3 p-3",
|
|
552
|
-
children: [/* @__PURE__ */
|
|
555
|
+
children: [/* @__PURE__ */ H("div", {
|
|
553
556
|
className: "flex min-w-0 items-center gap-2",
|
|
554
|
-
children: [/* @__PURE__ */
|
|
557
|
+
children: [/* @__PURE__ */ V(L, { className: "h-4 w-4 shrink-0 text-text-secondary" }), /* @__PURE__ */ H("div", {
|
|
555
558
|
className: "min-w-0",
|
|
556
|
-
children: [/* @__PURE__ */
|
|
559
|
+
children: [/* @__PURE__ */ V("p", {
|
|
557
560
|
className: "truncate text-sm font-medium text-text-primary",
|
|
558
561
|
children: e.name
|
|
559
|
-
}), /* @__PURE__ */
|
|
562
|
+
}), /* @__PURE__ */ V("p", {
|
|
560
563
|
className: "text-xs text-text-secondary",
|
|
561
564
|
children: i(e.type)
|
|
562
565
|
})]
|
|
563
566
|
})]
|
|
564
|
-
}), /* @__PURE__ */
|
|
567
|
+
}), /* @__PURE__ */ H("div", {
|
|
565
568
|
className: "flex shrink-0 items-center gap-3",
|
|
566
|
-
children: [e.expiresAt && /* @__PURE__ */
|
|
569
|
+
children: [e.expiresAt && /* @__PURE__ */ V("span", {
|
|
567
570
|
className: "text-xs text-text-secondary",
|
|
568
571
|
children: t("relationships.detail.assetRow.expires", "Expires {{date}}", { date: r(e.expiresAt) })
|
|
569
|
-
}), e.file?.id && /* @__PURE__ */
|
|
572
|
+
}), e.file?.id && /* @__PURE__ */ H("button", {
|
|
570
573
|
type: "button",
|
|
571
574
|
onClick: async () => {
|
|
572
575
|
if (e.file?.id) {
|
|
@@ -582,7 +585,7 @@ function le({ asset: e }) {
|
|
|
582
585
|
disabled: a,
|
|
583
586
|
className: "inline-flex items-center gap-1 rounded-lg border border-border-subtle px-2.5 py-1 text-xs font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50",
|
|
584
587
|
children: [
|
|
585
|
-
/* @__PURE__ */
|
|
588
|
+
/* @__PURE__ */ V(I, { className: "h-3.5 w-3.5" }),
|
|
586
589
|
" ",
|
|
587
590
|
a ? t("relationships.detail.assetRow.opening", "Opening…") : t("relationships.detail.assetRow.download", "Download")
|
|
588
591
|
]
|
|
@@ -590,48 +593,57 @@ function le({ asset: e }) {
|
|
|
590
593
|
})]
|
|
591
594
|
});
|
|
592
595
|
}
|
|
593
|
-
function
|
|
596
|
+
function pe({ invoice: e }) {
|
|
594
597
|
let t = l(), a = e.number ?? t("relationships.detail.invoiceRow.unnumbered", "Unnumbered invoice");
|
|
595
|
-
return /* @__PURE__ */
|
|
598
|
+
return /* @__PURE__ */ H("div", {
|
|
596
599
|
className: "flex items-center justify-between gap-3 p-3",
|
|
597
|
-
children: [/* @__PURE__ */
|
|
600
|
+
children: [/* @__PURE__ */ H("div", {
|
|
598
601
|
className: "flex min-w-0 items-center gap-2",
|
|
599
|
-
children: [/* @__PURE__ */
|
|
602
|
+
children: [/* @__PURE__ */ V(F, { className: "h-4 w-4 shrink-0 text-text-secondary" }), /* @__PURE__ */ H("div", {
|
|
600
603
|
className: "min-w-0",
|
|
601
|
-
children: [/* @__PURE__ */
|
|
604
|
+
children: [/* @__PURE__ */ V("p", {
|
|
602
605
|
className: "truncate text-sm font-medium text-text-primary",
|
|
603
606
|
children: a
|
|
604
|
-
}), /* @__PURE__ */
|
|
607
|
+
}), /* @__PURE__ */ H("p", {
|
|
605
608
|
className: "text-xs text-text-secondary",
|
|
606
609
|
children: [i(e.status), e.dueDate ? ` · ${t("relationships.detail.invoiceRow.due", "due {{date}}", { date: r(e.dueDate) })}` : e.issueDate ? ` · ${r(e.issueDate)}` : ""]
|
|
607
610
|
})]
|
|
608
611
|
})]
|
|
609
|
-
}), /* @__PURE__ */
|
|
612
|
+
}), /* @__PURE__ */ V("span", {
|
|
610
613
|
className: "shrink-0 text-sm font-medium tabular-nums text-text-primary",
|
|
611
614
|
children: n(e.total, e.currency)
|
|
612
615
|
})]
|
|
613
616
|
});
|
|
614
617
|
}
|
|
615
|
-
function
|
|
616
|
-
let c = l(), { id: _ } =
|
|
617
|
-
|
|
618
|
+
function Z() {
|
|
619
|
+
let c = l(), { id: _ } = ie(), { navigateTo: v } = e(), { data: b, isLoading: S, isError: C, refetch: E } = w(_), D = T(), I = g(), [L, R] = A(null), [z, W] = A(!1), [G, K] = A(!1), [q, J] = A(!1), ce = x({
|
|
620
|
+
relationshipId: _,
|
|
621
|
+
pagination: {
|
|
622
|
+
limit: 50,
|
|
623
|
+
offset: 0
|
|
624
|
+
}
|
|
625
|
+
}, { enabled: !!_ }), Z = y({
|
|
626
|
+
relationshipId: _,
|
|
627
|
+
status: "PROPOSED"
|
|
628
|
+
}, { enabled: !!_ });
|
|
629
|
+
if (S) return /* @__PURE__ */ V(t, {
|
|
618
630
|
title: c("relationships.title", "Relationship"),
|
|
619
|
-
children: /* @__PURE__ */
|
|
631
|
+
children: /* @__PURE__ */ V(d, { label: c("relationships.detail.loading", "Loading relationship…") })
|
|
620
632
|
});
|
|
621
|
-
if (
|
|
633
|
+
if (C) return /* @__PURE__ */ V(t, {
|
|
622
634
|
title: c("relationships.title", "Relationship"),
|
|
623
|
-
children: /* @__PURE__ */
|
|
635
|
+
children: /* @__PURE__ */ V(u, {
|
|
624
636
|
message: c("relationships.detail.error", "Could not load this relationship."),
|
|
625
|
-
onRetry: () => void
|
|
637
|
+
onRetry: () => void E()
|
|
626
638
|
})
|
|
627
639
|
});
|
|
628
|
-
if (!
|
|
640
|
+
if (!b) return /* @__PURE__ */ V(t, {
|
|
629
641
|
title: c("relationships.title", "Relationship"),
|
|
630
|
-
children: /* @__PURE__ */
|
|
642
|
+
children: /* @__PURE__ */ V(s, {
|
|
631
643
|
illustration: "empty-data",
|
|
632
644
|
title: c("relationships.detail.notFoundTitle", "Relationship not found"),
|
|
633
645
|
description: c("relationships.detail.notFoundDescription", "It may have been removed, or you may not have access to it."),
|
|
634
|
-
action: /* @__PURE__ */
|
|
646
|
+
action: /* @__PURE__ */ V("button", {
|
|
635
647
|
type: "button",
|
|
636
648
|
onClick: () => v("/relationships"),
|
|
637
649
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
|
|
@@ -639,128 +651,128 @@ function X() {
|
|
|
639
651
|
})
|
|
640
652
|
})
|
|
641
653
|
});
|
|
642
|
-
let
|
|
643
|
-
|
|
644
|
-
id:
|
|
654
|
+
let Q = b, $ = D.isPending || I.isPending, me = (e) => {
|
|
655
|
+
R(null), D.mutate({
|
|
656
|
+
id: Q.id,
|
|
645
657
|
status: e
|
|
646
|
-
}, { onError: (e) =>
|
|
647
|
-
},
|
|
648
|
-
|
|
649
|
-
},
|
|
658
|
+
}, { onError: (e) => R(e instanceof Error ? e.message : c("relationships.detail.transitionError", "Transition failed")) });
|
|
659
|
+
}, he = () => {
|
|
660
|
+
R(null), I.mutate(Q.id, { onError: (e) => R(e instanceof Error ? e.message : c("relationships.detail.cancelError", "Cancel failed")) });
|
|
661
|
+
}, ge = [...Q.renewalEvents ?? []].sort((e, t) => new Date(e.occursAt).getTime() - new Date(t.occursAt).getTime()).map((e) => {
|
|
650
662
|
let t = new Date(e.occursAt).getTime(), a = !Number.isNaN(t) && t > Date.now();
|
|
651
663
|
return {
|
|
652
664
|
title: i(e.eventType),
|
|
653
665
|
sub: `${r(e.occursAt)}${e.detail ? ` · ${e.detail}` : ""}`,
|
|
654
|
-
meta: e.amount == null ? void 0 : n(e.amount, e.currency ??
|
|
666
|
+
meta: e.amount == null ? void 0 : n(e.amount, e.currency ?? Q.currency),
|
|
655
667
|
tone: a ? "warning" : "muted"
|
|
656
668
|
};
|
|
657
|
-
}),
|
|
669
|
+
}), _e = Q.autoRenew ? /* @__PURE__ */ V("span", {
|
|
658
670
|
className: "inline-flex items-center rounded-full bg-status-success-bg-subtle px-2 py-0.5 text-xs font-medium text-status-success-text",
|
|
659
671
|
children: c("relationships.detail.autoRenewOn", "On")
|
|
660
|
-
}) : /* @__PURE__ */
|
|
672
|
+
}) : /* @__PURE__ */ V("span", {
|
|
661
673
|
className: "inline-flex items-center rounded-full bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary",
|
|
662
674
|
children: c("relationships.detail.autoRenewOff", "Off")
|
|
663
|
-
}),
|
|
664
|
-
return /* @__PURE__ */
|
|
665
|
-
title:
|
|
666
|
-
description:
|
|
667
|
-
actions: /* @__PURE__ */
|
|
675
|
+
}), ve = oe.filter((e) => e.status !== Q.status), ye = Q.plan?.features ?? [];
|
|
676
|
+
return /* @__PURE__ */ H(t, {
|
|
677
|
+
title: Q.label,
|
|
678
|
+
description: Q.provider?.name ?? c(Y[Q.kind], i(Q.kind)),
|
|
679
|
+
actions: /* @__PURE__ */ H("div", {
|
|
668
680
|
className: "flex items-center gap-2",
|
|
669
|
-
children: [/* @__PURE__ */
|
|
681
|
+
children: [/* @__PURE__ */ H("button", {
|
|
670
682
|
type: "button",
|
|
671
|
-
onClick: () =>
|
|
683
|
+
onClick: () => W(!0),
|
|
672
684
|
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",
|
|
673
685
|
children: [
|
|
674
|
-
/* @__PURE__ */
|
|
686
|
+
/* @__PURE__ */ V(ee, { className: "h-4 w-4" }),
|
|
675
687
|
" ",
|
|
676
688
|
c("relationships.detail.edit", "Edit")
|
|
677
689
|
]
|
|
678
|
-
}), /* @__PURE__ */
|
|
690
|
+
}), /* @__PURE__ */ H("button", {
|
|
679
691
|
type: "button",
|
|
680
692
|
onClick: () => v("/relationships"),
|
|
681
693
|
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",
|
|
682
694
|
children: [
|
|
683
|
-
/* @__PURE__ */
|
|
695
|
+
/* @__PURE__ */ V(M, { className: "h-4 w-4" }),
|
|
684
696
|
" ",
|
|
685
697
|
c("relationships.detail.back", "Back")
|
|
686
698
|
]
|
|
687
699
|
})]
|
|
688
700
|
}),
|
|
689
701
|
children: [
|
|
690
|
-
/* @__PURE__ */
|
|
702
|
+
/* @__PURE__ */ V(U, {
|
|
691
703
|
treatment: "glass",
|
|
692
704
|
glow: !0,
|
|
693
705
|
className: "p-5 sm:p-6",
|
|
694
|
-
children: /* @__PURE__ */
|
|
706
|
+
children: /* @__PURE__ */ H("div", {
|
|
695
707
|
className: "flex flex-col gap-5 lg:flex-row lg:items-start lg:justify-between",
|
|
696
|
-
children: [/* @__PURE__ */
|
|
708
|
+
children: [/* @__PURE__ */ H("div", {
|
|
697
709
|
className: "min-w-0",
|
|
698
710
|
children: [
|
|
699
|
-
/* @__PURE__ */
|
|
711
|
+
/* @__PURE__ */ V("p", {
|
|
700
712
|
className: "text-xs font-medium uppercase tracking-wide text-text-secondary",
|
|
701
|
-
children: c(
|
|
713
|
+
children: c(Y[Q.kind], i(Q.kind))
|
|
702
714
|
}),
|
|
703
|
-
/* @__PURE__ */
|
|
715
|
+
/* @__PURE__ */ H("div", {
|
|
704
716
|
className: "mt-2 flex flex-wrap items-center gap-3",
|
|
705
|
-
children: [/* @__PURE__ */
|
|
717
|
+
children: [/* @__PURE__ */ H("span", {
|
|
706
718
|
className: "text-3xl font-bold tabular-nums text-text-primary",
|
|
707
|
-
children: [n(
|
|
719
|
+
children: [n(Q.amount, Q.currency), /* @__PURE__ */ V("span", {
|
|
708
720
|
className: "text-base font-normal text-text-secondary",
|
|
709
|
-
children: a(
|
|
721
|
+
children: a(Q.interval)
|
|
710
722
|
})]
|
|
711
|
-
}), /* @__PURE__ */
|
|
723
|
+
}), /* @__PURE__ */ V(o, { status: Q.status })]
|
|
712
724
|
}),
|
|
713
|
-
/* @__PURE__ */
|
|
725
|
+
/* @__PURE__ */ H("div", {
|
|
714
726
|
className: "mt-2 flex flex-wrap items-center gap-x-4 gap-y-1 text-sm text-text-secondary",
|
|
715
727
|
children: [
|
|
716
|
-
/* @__PURE__ */
|
|
728
|
+
/* @__PURE__ */ H("span", {
|
|
717
729
|
className: "inline-flex items-center gap-1.5",
|
|
718
|
-
children: [/* @__PURE__ */
|
|
730
|
+
children: [/* @__PURE__ */ V(P, { className: "h-3.5 w-3.5" }), Q.renewsAt ? c("relationships.detail.renews", "Renews {{date}}", { date: r(Q.renewsAt) }) : c("relationships.detail.noRenewalScheduled", "No renewal scheduled")]
|
|
719
731
|
}),
|
|
720
|
-
/* @__PURE__ */
|
|
732
|
+
/* @__PURE__ */ H("span", {
|
|
721
733
|
className: "inline-flex items-center gap-1.5",
|
|
722
|
-
children: [/* @__PURE__ */
|
|
734
|
+
children: [/* @__PURE__ */ V(te, { className: "h-3.5 w-3.5" }), i(Q.discoverySource)]
|
|
723
735
|
}),
|
|
724
|
-
/* @__PURE__ */
|
|
736
|
+
/* @__PURE__ */ H("span", {
|
|
725
737
|
className: "inline-flex items-center gap-1.5",
|
|
726
738
|
children: [
|
|
727
739
|
c("relationships.detail.autoRenew", "Auto-renew"),
|
|
728
740
|
" ",
|
|
729
|
-
|
|
741
|
+
_e
|
|
730
742
|
]
|
|
731
743
|
})
|
|
732
744
|
]
|
|
733
745
|
}),
|
|
734
|
-
|
|
746
|
+
Q.tags.length > 0 && /* @__PURE__ */ H("div", {
|
|
735
747
|
className: "mt-3 flex flex-wrap items-center gap-2",
|
|
736
|
-
children: [/* @__PURE__ */
|
|
748
|
+
children: [/* @__PURE__ */ V(ne, { className: "h-3.5 w-3.5 text-text-secondary" }), Q.tags.map((e) => /* @__PURE__ */ V("span", {
|
|
737
749
|
className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs text-text-secondary",
|
|
738
750
|
children: e
|
|
739
751
|
}, e))]
|
|
740
752
|
})
|
|
741
753
|
]
|
|
742
|
-
}), /* @__PURE__ */
|
|
754
|
+
}), /* @__PURE__ */ H("div", {
|
|
743
755
|
className: "flex shrink-0 flex-wrap gap-2 lg:flex-col lg:items-stretch",
|
|
744
|
-
children: [
|
|
756
|
+
children: [ve.map((e) => {
|
|
745
757
|
let t = e.icon;
|
|
746
|
-
return /* @__PURE__ */
|
|
758
|
+
return /* @__PURE__ */ H("button", {
|
|
747
759
|
type: "button",
|
|
748
|
-
disabled:
|
|
749
|
-
onClick: () =>
|
|
760
|
+
disabled: $,
|
|
761
|
+
onClick: () => me(e.status),
|
|
750
762
|
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",
|
|
751
763
|
children: [
|
|
752
|
-
/* @__PURE__ */
|
|
764
|
+
/* @__PURE__ */ V(t, { className: "h-3.5 w-3.5" }),
|
|
753
765
|
" ",
|
|
754
766
|
c(e.labelKey, e.defaultLabel)
|
|
755
767
|
]
|
|
756
768
|
}, e.status);
|
|
757
|
-
}),
|
|
769
|
+
}), Q.status !== "CANCELLED" && /* @__PURE__ */ H("button", {
|
|
758
770
|
type: "button",
|
|
759
|
-
disabled:
|
|
760
|
-
onClick:
|
|
771
|
+
disabled: $,
|
|
772
|
+
onClick: he,
|
|
761
773
|
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",
|
|
762
774
|
children: [
|
|
763
|
-
/* @__PURE__ */
|
|
775
|
+
/* @__PURE__ */ V(N, { className: "h-3.5 w-3.5" }),
|
|
764
776
|
" ",
|
|
765
777
|
c("relationships.detail.actions.cancel", "Cancel")
|
|
766
778
|
]
|
|
@@ -768,149 +780,159 @@ function X() {
|
|
|
768
780
|
})]
|
|
769
781
|
})
|
|
770
782
|
}),
|
|
771
|
-
|
|
783
|
+
L && /* @__PURE__ */ V("div", {
|
|
772
784
|
className: "mt-4 rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
|
|
773
|
-
children:
|
|
785
|
+
children: L
|
|
774
786
|
}),
|
|
775
|
-
/* @__PURE__ */
|
|
787
|
+
/* @__PURE__ */ H("div", {
|
|
776
788
|
className: "mt-6 grid grid-cols-1 gap-4 lg:grid-cols-3",
|
|
777
|
-
children: [/* @__PURE__ */
|
|
789
|
+
children: [/* @__PURE__ */ H("div", {
|
|
778
790
|
className: "space-y-4 lg:col-span-2",
|
|
779
791
|
children: [
|
|
780
|
-
/* @__PURE__ */
|
|
792
|
+
/* @__PURE__ */ H("div", {
|
|
781
793
|
className: "grid grid-cols-1 gap-4 md:grid-cols-2",
|
|
782
|
-
children: [/* @__PURE__ */
|
|
794
|
+
children: [/* @__PURE__ */ H(U, {
|
|
783
795
|
treatment: "metric",
|
|
784
796
|
className: "p-5",
|
|
785
797
|
children: [
|
|
786
|
-
/* @__PURE__ */
|
|
798
|
+
/* @__PURE__ */ H("div", {
|
|
787
799
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
788
800
|
children: [
|
|
789
|
-
/* @__PURE__ */
|
|
801
|
+
/* @__PURE__ */ V(F, { className: "h-4 w-4 text-text-secondary" }),
|
|
790
802
|
" ",
|
|
791
803
|
c("relationships.detail.sections.planPricing", "Plan & pricing")
|
|
792
804
|
]
|
|
793
805
|
}),
|
|
794
|
-
/* @__PURE__ */
|
|
806
|
+
/* @__PURE__ */ H("div", {
|
|
795
807
|
className: "mt-3",
|
|
796
808
|
children: [
|
|
797
|
-
/* @__PURE__ */
|
|
809
|
+
/* @__PURE__ */ V(X, {
|
|
798
810
|
label: c("relationships.detail.info.plan", "Plan"),
|
|
799
|
-
value:
|
|
811
|
+
value: Q.plan?.name ?? "—"
|
|
800
812
|
}),
|
|
801
|
-
/* @__PURE__ */
|
|
813
|
+
/* @__PURE__ */ V(X, {
|
|
802
814
|
label: c("relationships.detail.info.price", "Price"),
|
|
803
|
-
value: /* @__PURE__ */
|
|
815
|
+
value: /* @__PURE__ */ H(ae, { children: [n(Q.amount, Q.currency), /* @__PURE__ */ V("span", {
|
|
804
816
|
className: "font-normal text-text-secondary",
|
|
805
|
-
children: a(
|
|
817
|
+
children: a(Q.interval)
|
|
806
818
|
})] })
|
|
807
819
|
}),
|
|
808
|
-
/* @__PURE__ */
|
|
820
|
+
/* @__PURE__ */ V(X, {
|
|
809
821
|
label: c("relationships.detail.info.billingInterval", "Billing interval"),
|
|
810
|
-
value: i(
|
|
822
|
+
value: i(Q.interval)
|
|
811
823
|
}),
|
|
812
|
-
/* @__PURE__ */
|
|
824
|
+
/* @__PURE__ */ V(X, {
|
|
813
825
|
label: c("relationships.detail.info.provider", "Provider"),
|
|
814
|
-
value:
|
|
826
|
+
value: Q.provider?.name ?? "—"
|
|
815
827
|
})
|
|
816
828
|
]
|
|
817
829
|
}),
|
|
818
|
-
|
|
830
|
+
ye.length > 0 && /* @__PURE__ */ V("div", {
|
|
819
831
|
className: "mt-3 flex flex-wrap gap-1.5",
|
|
820
|
-
children:
|
|
832
|
+
children: ye.map((e) => /* @__PURE__ */ V("span", {
|
|
821
833
|
className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs text-text-secondary",
|
|
822
834
|
children: e
|
|
823
835
|
}, e))
|
|
824
836
|
})
|
|
825
837
|
]
|
|
826
|
-
}), /* @__PURE__ */
|
|
838
|
+
}), /* @__PURE__ */ H(U, {
|
|
827
839
|
treatment: "metric",
|
|
828
840
|
className: "p-5",
|
|
829
|
-
children: [/* @__PURE__ */
|
|
841
|
+
children: [/* @__PURE__ */ H("div", {
|
|
830
842
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
831
843
|
children: [
|
|
832
|
-
/* @__PURE__ */
|
|
844
|
+
/* @__PURE__ */ V(re, { className: "h-4 w-4 text-text-secondary" }),
|
|
833
845
|
" ",
|
|
834
846
|
c("relationships.detail.sections.paymentBilling", "Payment & billing")
|
|
835
847
|
]
|
|
836
|
-
}), /* @__PURE__ */
|
|
848
|
+
}), /* @__PURE__ */ H("div", {
|
|
837
849
|
className: "mt-3",
|
|
838
850
|
children: [
|
|
839
|
-
/* @__PURE__ */
|
|
851
|
+
/* @__PURE__ */ V(X, {
|
|
840
852
|
label: c("relationships.detail.info.currency", "Currency"),
|
|
841
|
-
value:
|
|
853
|
+
value: Q.currency
|
|
842
854
|
}),
|
|
843
|
-
/* @__PURE__ */
|
|
855
|
+
/* @__PURE__ */ V(X, {
|
|
844
856
|
label: c("relationships.detail.info.autoRenew", "Auto-renew"),
|
|
845
|
-
value:
|
|
857
|
+
value: _e
|
|
846
858
|
}),
|
|
847
|
-
/* @__PURE__ */
|
|
859
|
+
/* @__PURE__ */ V(X, {
|
|
848
860
|
label: c("relationships.detail.info.nextRenewal", "Next renewal"),
|
|
849
|
-
value:
|
|
861
|
+
value: Q.renewsAt ? r(Q.renewsAt) : "—"
|
|
850
862
|
}),
|
|
851
|
-
/* @__PURE__ */
|
|
863
|
+
/* @__PURE__ */ V(X, {
|
|
852
864
|
label: c("relationships.detail.info.started", "Started"),
|
|
853
|
-
value:
|
|
865
|
+
value: Q.startedAt ? r(Q.startedAt) : "—"
|
|
854
866
|
}),
|
|
855
|
-
|
|
867
|
+
Q.trialEndsAt && /* @__PURE__ */ V(X, {
|
|
856
868
|
label: c("relationships.detail.info.trialEnds", "Trial ends"),
|
|
857
|
-
value: r(
|
|
869
|
+
value: r(Q.trialEndsAt)
|
|
858
870
|
})
|
|
859
871
|
]
|
|
860
872
|
})]
|
|
861
873
|
})]
|
|
862
874
|
}),
|
|
863
|
-
/* @__PURE__ */
|
|
875
|
+
(Z.data?.items.length ?? 0) > 0 && /* @__PURE__ */ H(f, {
|
|
876
|
+
className: "mt-0",
|
|
877
|
+
title: c("relationships.detail.sections.aiRecommendations", "AI recommendations"),
|
|
878
|
+
description: c("relationships.detail.sections.aiRecommendationsDescription", "Open recommendations about this subscription. You can also make any of these changes by hand above."),
|
|
879
|
+
children: [/* @__PURE__ */ V(k, { className: "mb-3" }), /* @__PURE__ */ V("div", {
|
|
880
|
+
className: "grid grid-cols-1 gap-3",
|
|
881
|
+
"data-testid": "relationship-decisions",
|
|
882
|
+
children: Z.data?.items.map((e) => /* @__PURE__ */ V(O, { decision: e }, e.id))
|
|
883
|
+
})]
|
|
884
|
+
}),
|
|
885
|
+
/* @__PURE__ */ V(f, {
|
|
864
886
|
className: "mt-0",
|
|
865
887
|
title: c("relationships.detail.sections.entitlements", "Entitlements"),
|
|
866
888
|
description: c("relationships.detail.sections.entitlementsDescription", "What this relationship grants you"),
|
|
867
|
-
action: /* @__PURE__ */
|
|
889
|
+
action: /* @__PURE__ */ H("button", {
|
|
868
890
|
type: "button",
|
|
869
|
-
onClick: () =>
|
|
891
|
+
onClick: () => K(!0),
|
|
870
892
|
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
|
|
871
893
|
children: [
|
|
872
|
-
/* @__PURE__ */
|
|
894
|
+
/* @__PURE__ */ V(B, { className: "h-3.5 w-3.5" }),
|
|
873
895
|
" ",
|
|
874
896
|
c("relationships.detail.sections.addEntitlement", "Add entitlement")
|
|
875
897
|
]
|
|
876
898
|
}),
|
|
877
|
-
children: !
|
|
899
|
+
children: !Q.entitlements || Q.entitlements.length === 0 ? /* @__PURE__ */ V(s, {
|
|
878
900
|
illustration: "empty-data",
|
|
879
901
|
title: c("relationships.detail.empty.noEntitlementsTitle", "No entitlements"),
|
|
880
902
|
description: c("relationships.detail.empty.noEntitlementsDescription", "Entitlements (seats, quotas, feature access) will appear here.")
|
|
881
|
-
}) : /* @__PURE__ */
|
|
903
|
+
}) : /* @__PURE__ */ V("div", {
|
|
882
904
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
|
|
883
|
-
children:
|
|
905
|
+
children: Q.entitlements.map((e) => {
|
|
884
906
|
let t = e.quota != null && e.quota > 0;
|
|
885
|
-
return /* @__PURE__ */
|
|
907
|
+
return /* @__PURE__ */ H(U, {
|
|
886
908
|
treatment: "plain",
|
|
887
909
|
className: "p-4",
|
|
888
910
|
children: [
|
|
889
|
-
/* @__PURE__ */
|
|
911
|
+
/* @__PURE__ */ H("div", {
|
|
890
912
|
className: "flex items-start justify-between gap-2",
|
|
891
|
-
children: [/* @__PURE__ */
|
|
913
|
+
children: [/* @__PURE__ */ V("p", {
|
|
892
914
|
className: "min-w-0 truncate text-sm font-medium text-text-primary",
|
|
893
915
|
children: e.name
|
|
894
|
-
}), /* @__PURE__ */
|
|
916
|
+
}), /* @__PURE__ */ V(o, { status: e.isActive ? "ACTIVE" : "DISABLED" })]
|
|
895
917
|
}),
|
|
896
|
-
/* @__PURE__ */
|
|
918
|
+
/* @__PURE__ */ V("p", {
|
|
897
919
|
className: "mt-1 text-xs text-text-secondary",
|
|
898
920
|
children: i(e.type)
|
|
899
921
|
}),
|
|
900
|
-
t && /* @__PURE__ */
|
|
922
|
+
t && /* @__PURE__ */ H("div", {
|
|
901
923
|
className: "mt-3",
|
|
902
|
-
children: [/* @__PURE__ */
|
|
924
|
+
children: [/* @__PURE__ */ H("div", {
|
|
903
925
|
className: "flex items-center justify-between text-xs text-text-secondary",
|
|
904
|
-
children: [/* @__PURE__ */
|
|
926
|
+
children: [/* @__PURE__ */ H("span", { children: [
|
|
905
927
|
e.used,
|
|
906
928
|
" / ",
|
|
907
929
|
e.quota,
|
|
908
930
|
e.unit ? ` ${e.unit}` : ""
|
|
909
|
-
] }), /* @__PURE__ */
|
|
931
|
+
] }), /* @__PURE__ */ H("span", {
|
|
910
932
|
className: "tabular-nums",
|
|
911
933
|
children: [Math.round(e.used / e.quota * 100), "%"]
|
|
912
934
|
})]
|
|
913
|
-
}), /* @__PURE__ */
|
|
935
|
+
}), /* @__PURE__ */ V(m, {
|
|
914
936
|
value: e.used,
|
|
915
937
|
max: e.quota,
|
|
916
938
|
tone: e.used / e.quota >= .9 ? "negative" : e.used / e.quota >= .7 ? "warning" : "accent",
|
|
@@ -922,23 +944,23 @@ function X() {
|
|
|
922
944
|
})
|
|
923
945
|
})
|
|
924
946
|
}),
|
|
925
|
-
/* @__PURE__ */
|
|
947
|
+
/* @__PURE__ */ V(f, {
|
|
926
948
|
className: "mt-0",
|
|
927
949
|
title: c("relationships.detail.sections.assets", "Assets"),
|
|
928
950
|
description: c("relationships.detail.sections.assetsDescription", "Invoices, contracts, licenses and credentials"),
|
|
929
|
-
action: /* @__PURE__ */
|
|
951
|
+
action: /* @__PURE__ */ H("button", {
|
|
930
952
|
type: "button",
|
|
931
|
-
onClick: () =>
|
|
953
|
+
onClick: () => J(!0),
|
|
932
954
|
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
|
|
933
955
|
children: [
|
|
934
|
-
/* @__PURE__ */
|
|
956
|
+
/* @__PURE__ */ V(B, { className: "h-3.5 w-3.5" }),
|
|
935
957
|
" ",
|
|
936
958
|
c("relationships.detail.sections.attachAsset", "Attach asset")
|
|
937
959
|
]
|
|
938
960
|
}),
|
|
939
961
|
children: (() => {
|
|
940
|
-
let e =
|
|
941
|
-
return e.length > 0 || t.length > 0 ? /* @__PURE__ */
|
|
962
|
+
let e = Q.assets ?? [], t = ce.data?.items ?? [];
|
|
963
|
+
return e.length > 0 || t.length > 0 ? /* @__PURE__ */ V(U, {
|
|
942
964
|
treatment: "plain",
|
|
943
965
|
className: "divide-y divide-border-subtle p-0",
|
|
944
966
|
children: [...e.map((e) => ({
|
|
@@ -949,104 +971,104 @@ function X() {
|
|
|
949
971
|
kind: "invoice",
|
|
950
972
|
sort: new Date(e.createdAt).getTime() || 0,
|
|
951
973
|
invoice: e
|
|
952
|
-
}))].sort((e, t) => t.sort - e.sort).map((e) => e.kind === "asset" ? /* @__PURE__ */
|
|
953
|
-
}) : /* @__PURE__ */
|
|
974
|
+
}))].sort((e, t) => t.sort - e.sort).map((e) => e.kind === "asset" ? /* @__PURE__ */ V(fe, { asset: e.asset }, `a-${e.asset.id}`) : /* @__PURE__ */ V(pe, { invoice: e.invoice }, `i-${e.invoice.id}`))
|
|
975
|
+
}) : /* @__PURE__ */ V(s, {
|
|
954
976
|
illustration: "empty-data",
|
|
955
977
|
title: c("relationships.detail.empty.noAssetsTitle", "No assets attached"),
|
|
956
978
|
description: c("relationships.detail.empty.noAssetsDescription", "Attach invoices, contracts, licenses or receipts to this relationship.")
|
|
957
979
|
});
|
|
958
980
|
})()
|
|
959
981
|
}),
|
|
960
|
-
|
|
982
|
+
Q.notes && /* @__PURE__ */ H(U, {
|
|
961
983
|
treatment: "plain",
|
|
962
984
|
className: "p-4",
|
|
963
|
-
children: [/* @__PURE__ */
|
|
985
|
+
children: [/* @__PURE__ */ V("p", {
|
|
964
986
|
className: "text-xs font-medium text-text-secondary",
|
|
965
987
|
children: c("relationships.detail.sections.notes", "Notes")
|
|
966
|
-
}), /* @__PURE__ */
|
|
988
|
+
}), /* @__PURE__ */ V("p", {
|
|
967
989
|
className: "mt-1 whitespace-pre-wrap text-sm text-text-primary",
|
|
968
|
-
children:
|
|
990
|
+
children: Q.notes
|
|
969
991
|
})]
|
|
970
992
|
})
|
|
971
993
|
]
|
|
972
|
-
}), /* @__PURE__ */
|
|
994
|
+
}), /* @__PURE__ */ H("div", {
|
|
973
995
|
className: "space-y-4",
|
|
974
|
-
children: [/* @__PURE__ */
|
|
996
|
+
children: [/* @__PURE__ */ H(U, {
|
|
975
997
|
treatment: "metric",
|
|
976
998
|
className: "p-5",
|
|
977
|
-
children: [/* @__PURE__ */
|
|
999
|
+
children: [/* @__PURE__ */ H("div", {
|
|
978
1000
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
979
1001
|
children: [
|
|
980
|
-
/* @__PURE__ */
|
|
1002
|
+
/* @__PURE__ */ V(j, { className: "h-4 w-4 text-text-secondary" }),
|
|
981
1003
|
" ",
|
|
982
1004
|
c("relationships.detail.sections.healthScore", "Health score")
|
|
983
1005
|
]
|
|
984
|
-
}),
|
|
1006
|
+
}), Q.healthScore == null ? /* @__PURE__ */ V("p", {
|
|
985
1007
|
className: "mt-4 text-sm text-text-secondary",
|
|
986
1008
|
children: c("relationships.detail.empty.noHealthScore", "Not scored yet. A health score appears once Subscriber Bot has enough signal.")
|
|
987
|
-
}) : /* @__PURE__ */
|
|
1009
|
+
}) : /* @__PURE__ */ H("div", {
|
|
988
1010
|
className: "mt-4 flex flex-col items-center",
|
|
989
|
-
children: [/* @__PURE__ */
|
|
990
|
-
value:
|
|
1011
|
+
children: [/* @__PURE__ */ V(p, {
|
|
1012
|
+
value: Q.healthScore,
|
|
991
1013
|
max: 100,
|
|
992
1014
|
size: 160,
|
|
993
1015
|
label: c("relationships.detail.outOf100", "of 100")
|
|
994
|
-
}), /* @__PURE__ */
|
|
1016
|
+
}), /* @__PURE__ */ V("div", {
|
|
995
1017
|
className: "mt-2 w-full",
|
|
996
|
-
children: /* @__PURE__ */
|
|
997
|
-
value:
|
|
1018
|
+
children: /* @__PURE__ */ V(m, {
|
|
1019
|
+
value: Q.healthScore,
|
|
998
1020
|
max: 100,
|
|
999
|
-
tone:
|
|
1021
|
+
tone: se(Q.healthScore)
|
|
1000
1022
|
})
|
|
1001
1023
|
})]
|
|
1002
1024
|
})]
|
|
1003
|
-
}), /* @__PURE__ */
|
|
1025
|
+
}), /* @__PURE__ */ H(U, {
|
|
1004
1026
|
treatment: "metric",
|
|
1005
1027
|
className: "p-5",
|
|
1006
1028
|
children: [
|
|
1007
|
-
/* @__PURE__ */
|
|
1029
|
+
/* @__PURE__ */ H("div", {
|
|
1008
1030
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
1009
1031
|
children: [
|
|
1010
|
-
/* @__PURE__ */
|
|
1032
|
+
/* @__PURE__ */ V(P, { className: "h-4 w-4 text-text-secondary" }),
|
|
1011
1033
|
" ",
|
|
1012
1034
|
c("relationships.detail.sections.renewalTimeline", "Renewal timeline")
|
|
1013
1035
|
]
|
|
1014
1036
|
}),
|
|
1015
|
-
/* @__PURE__ */
|
|
1037
|
+
/* @__PURE__ */ V("p", {
|
|
1016
1038
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
1017
1039
|
children: c("relationships.detail.sections.renewalTimelineDescription", "Detected renewals and price changes")
|
|
1018
1040
|
}),
|
|
1019
|
-
|
|
1041
|
+
ge.length === 0 ? /* @__PURE__ */ V("div", {
|
|
1020
1042
|
className: "mt-4",
|
|
1021
|
-
children: /* @__PURE__ */
|
|
1043
|
+
children: /* @__PURE__ */ V(s, {
|
|
1022
1044
|
illustration: "empty-calendar",
|
|
1023
1045
|
title: c("relationships.detail.empty.noRenewalEventsTitle", "No renewal events"),
|
|
1024
1046
|
description: c("relationships.detail.empty.noRenewalEventsDescription", "Renewals and price changes will appear here as they're detected.")
|
|
1025
1047
|
})
|
|
1026
|
-
}) : /* @__PURE__ */
|
|
1027
|
-
items:
|
|
1048
|
+
}) : /* @__PURE__ */ V(h, {
|
|
1049
|
+
items: ge,
|
|
1028
1050
|
className: "mt-4"
|
|
1029
1051
|
})
|
|
1030
1052
|
]
|
|
1031
1053
|
})]
|
|
1032
1054
|
})]
|
|
1033
1055
|
}),
|
|
1034
|
-
|
|
1035
|
-
relationship:
|
|
1036
|
-
onClose: () => H(!1)
|
|
1037
|
-
}),
|
|
1038
|
-
U && /* @__PURE__ */ z(se, {
|
|
1039
|
-
relationshipId: Y.id,
|
|
1056
|
+
z && /* @__PURE__ */ V(le, {
|
|
1057
|
+
relationship: Q,
|
|
1040
1058
|
onClose: () => W(!1)
|
|
1041
1059
|
}),
|
|
1042
|
-
G && /* @__PURE__ */
|
|
1043
|
-
relationshipId:
|
|
1060
|
+
G && /* @__PURE__ */ V(ue, {
|
|
1061
|
+
relationshipId: Q.id,
|
|
1044
1062
|
onClose: () => K(!1)
|
|
1063
|
+
}),
|
|
1064
|
+
q && /* @__PURE__ */ V(de, {
|
|
1065
|
+
relationshipId: Q.id,
|
|
1066
|
+
onClose: () => J(!1)
|
|
1045
1067
|
})
|
|
1046
1068
|
]
|
|
1047
1069
|
});
|
|
1048
1070
|
}
|
|
1049
1071
|
//#endregion
|
|
1050
|
-
export {
|
|
1072
|
+
export { Z as RelationshipDetailPage };
|
|
1051
1073
|
|
|
1052
1074
|
//# sourceMappingURL=RelationshipDetailPage.js.map
|