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