@burdenoff/microfe-hookmovies 2026.706.2 → 2026.706.4
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/hookmovies/HookMoviesRoutes.js +54 -6
- package/dist/hookmovies/HookMoviesRoutes.js.map +1 -1
- package/dist/hookmovies/components/index.js +1 -1
- package/dist/hookmovies/context/HookMoviesContext.js +64 -40
- package/dist/hookmovies/context/HookMoviesContext.js.map +1 -1
- package/dist/hookmovies/hooks/useHookMoviesApi.js +592 -134
- package/dist/hookmovies/hooks/useHookMoviesApi.js.map +1 -1
- package/dist/hookmovies/pages/HomePage.js +211 -139
- package/dist/hookmovies/pages/HomePage.js.map +1 -1
- package/dist/hookmovies/pages/ai/ConciergePage.js +330 -0
- package/dist/hookmovies/pages/ai/ConciergePage.js.map +1 -0
- package/dist/hookmovies/pages/analytics/AnalyticsPage.js +450 -0
- package/dist/hookmovies/pages/analytics/AnalyticsPage.js.map +1 -0
- package/dist/hookmovies/pages/analytics/PayoutsPage.js +499 -0
- package/dist/hookmovies/pages/analytics/PayoutsPage.js.map +1 -0
- package/dist/hookmovies/pages/auditions/AuditionDetailPage.js +223 -140
- package/dist/hookmovies/pages/auditions/AuditionDetailPage.js.map +1 -1
- package/dist/hookmovies/pages/auditions/AuditionsPage.js +161 -83
- package/dist/hookmovies/pages/auditions/AuditionsPage.js.map +1 -1
- package/dist/hookmovies/pages/catalog/PeoplePage.js +177 -103
- package/dist/hookmovies/pages/catalog/PeoplePage.js.map +1 -1
- package/dist/hookmovies/pages/catalog/StudiosPage.js +191 -108
- package/dist/hookmovies/pages/catalog/StudiosPage.js.map +1 -1
- package/dist/hookmovies/pages/catalog/TitleDetailPage.js +744 -622
- package/dist/hookmovies/pages/catalog/TitleDetailPage.js.map +1 -1
- package/dist/hookmovies/pages/catalog/TitlesPage.js +218 -138
- package/dist/hookmovies/pages/catalog/TitlesPage.js.map +1 -1
- package/dist/hookmovies/pages/commerce/CheckoutPage.js +430 -0
- package/dist/hookmovies/pages/commerce/CheckoutPage.js.map +1 -0
- package/dist/hookmovies/pages/consumer/DiscoveryPage.js +21 -21
- package/dist/hookmovies/pages/consumer/HooksPage.js +5 -5
- package/dist/hookmovies/pages/consumer/TitleViewPage.js +32 -32
- package/dist/hookmovies/pages/consumer/TitleViewPage.js.map +1 -1
- package/dist/hookmovies/pages/developer/DevPortalPage.js +815 -0
- package/dist/hookmovies/pages/developer/DevPortalPage.js.map +1 -0
- package/dist/hookmovies/pages/distribution/RightsWindowsPage.js +235 -162
- package/dist/hookmovies/pages/distribution/RightsWindowsPage.js.map +1 -1
- package/dist/hookmovies/pages/engagement/ReviewsPage.js +201 -143
- package/dist/hookmovies/pages/engagement/ReviewsPage.js.map +1 -1
- package/dist/hookmovies/pages/library/EntitlementsPage.js +447 -221
- package/dist/hookmovies/pages/library/EntitlementsPage.js.map +1 -1
- package/dist/hookmovies/pages/library/ListsPage.js +243 -167
- package/dist/hookmovies/pages/library/ListsPage.js.map +1 -1
- package/dist/hookmovies/pages/live/LivePage.js +608 -0
- package/dist/hookmovies/pages/live/LivePage.js.map +1 -0
- package/dist/hookmovies/pages/localization/LocalizationPage.js +656 -0
- package/dist/hookmovies/pages/localization/LocalizationPage.js.map +1 -0
- package/dist/hookmovies/pages/onboarding/OnboardingPage.js +366 -0
- package/dist/hookmovies/pages/onboarding/OnboardingPage.js.map +1 -0
- package/dist/hookmovies/pages/productions/ProductionDetailPage.js +265 -179
- package/dist/hookmovies/pages/productions/ProductionDetailPage.js.map +1 -1
- package/dist/hookmovies/pages/productions/ProductionsPage.js +264 -71
- package/dist/hookmovies/pages/productions/ProductionsPage.js.map +1 -1
- package/dist/hookmovies/pages/social/ProfilesPage.js +701 -0
- package/dist/hookmovies/pages/social/ProfilesPage.js.map +1 -0
- package/dist/hookmovies/pages/social/WatchPartyListPage.js +281 -0
- package/dist/hookmovies/pages/social/WatchPartyListPage.js.map +1 -0
- package/dist/hookmovies/pages/social/WatchPartyRoomPage.js +567 -0
- package/dist/hookmovies/pages/social/WatchPartyRoomPage.js.map +1 -0
- package/dist/hookmovies/pages/trust/ModerationPage.js +320 -0
- package/dist/hookmovies/pages/trust/ModerationPage.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,288 +1,514 @@
|
|
|
1
1
|
import { useHookMovies as e } from "../../context/HookMoviesContext.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
2
|
+
import { cn as t } from "../../utils/cn.js";
|
|
3
|
+
import { PageLayout as n } from "../../components/PageLayout.js";
|
|
4
|
+
import { MetricsCard as r } from "../../components/MetricsCard.js";
|
|
5
|
+
import { StatusBadge as i } from "../../components/StatusBadge.js";
|
|
6
|
+
import { useGrantEntitlement as a, useMyEntitlements as ee, useRevokeEntitlement as te, useTitles as ne } from "../../hooks/useHookMoviesApi.js";
|
|
7
|
+
import { formatDate as o, formatEnumLabel as s } from "../../utils/formatters.js";
|
|
8
|
+
import { EmptyState as re } from "../../components/EmptyState.js";
|
|
9
|
+
import { ErrorState as c, LoadingState as ie } from "../../components/StateViews.js";
|
|
10
|
+
import { useEffect as l, useMemo as u, useRef as ae, useState as d } from "react";
|
|
11
|
+
import { CalendarClock as oe, Clock as se, Film as f, Globe as ce, PlayCircle as p, Plus as le, Ticket as m, X as ue, XCircle as h } from "lucide-react";
|
|
12
|
+
import { Fragment as de, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
13
|
+
import { GlassCard as v } from "@burdenoff/fe-libs/ui";
|
|
12
14
|
//#region src/hookmovies/pages/library/EntitlementsPage.tsx
|
|
13
|
-
var
|
|
15
|
+
var fe = [
|
|
14
16
|
"FREE_AVOD",
|
|
15
17
|
"SVOD",
|
|
16
18
|
"TVOD_RENT",
|
|
17
19
|
"TVOD_BUY",
|
|
18
20
|
"PPV",
|
|
19
21
|
"FAST"
|
|
20
|
-
],
|
|
22
|
+
], y = [
|
|
21
23
|
"SUBSCRIPTION",
|
|
22
24
|
"PURCHASE",
|
|
23
25
|
"RENTAL",
|
|
24
26
|
"PROMO",
|
|
25
27
|
"FREE"
|
|
26
|
-
],
|
|
27
|
-
|
|
28
|
+
], b = {
|
|
29
|
+
SUBSCRIPTION: "bg-accent-blue-subtle text-accent-blue",
|
|
30
|
+
PURCHASE: "bg-accent-teal-subtle text-accent-teal",
|
|
31
|
+
RENTAL: "bg-accent-purple-subtle text-accent-purple",
|
|
32
|
+
PROMO: "bg-accent-indigo-subtle text-accent-indigo",
|
|
33
|
+
FREE: "bg-bg-sunken text-text-secondary"
|
|
34
|
+
}, x = "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)]", S = "mb-1.5 block text-xs font-medium text-text-secondary", pe = 1440 * 60 * 1e3, C = ({ title: e }) => /* @__PURE__ */ _("div", {
|
|
35
|
+
className: "relative flex h-11 w-8 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border-seam bg-gradient-to-br from-bg-sunken to-bg-surface",
|
|
36
|
+
children: [/* @__PURE__ */ g("span", {
|
|
37
|
+
className: "text-sm font-semibold text-text-secondary",
|
|
38
|
+
children: e.trim().charAt(0).toUpperCase() || "?"
|
|
39
|
+
}), /* @__PURE__ */ g(f, {
|
|
40
|
+
className: "absolute bottom-0.5 right-0.5 h-2.5 w-2.5 text-text-muted",
|
|
41
|
+
"aria-hidden": "true"
|
|
42
|
+
})]
|
|
43
|
+
}), w = ({ source: e }) => /* @__PURE__ */ g("span", {
|
|
44
|
+
className: t("inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium uppercase tracking-wide", b[e]),
|
|
45
|
+
children: s(e)
|
|
46
|
+
}), T = () => {
|
|
47
|
+
let { navigateTo: t, currentUser: f } = e(), { data: b, isLoading: T, isError: E, refetch: me } = ee(), D = te(), O = a(), [k, A] = d(!1), [j, M] = d(""), N = ne({}, {
|
|
28
48
|
limit: 200,
|
|
29
49
|
offset: 0
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
50
|
+
}, j), [P, F] = d(""), [I, L] = d(f?.id ?? ""), [R, z] = d("SVOD"), [B, V] = d("SUBSCRIPTION"), [H, U] = d(""), [W, G] = d(""), [K, q] = d(null), [J, Y] = d(null), X = ae(null), Z = u(() => b ?? [], [b]), Q = u(() => {
|
|
51
|
+
let e = Date.now(), t = 0, n = 0;
|
|
52
|
+
for (let r of Z) if (r.status === "ACTIVE" && (t += 1, r.expiresAt)) {
|
|
53
|
+
let t = new Date(r.expiresAt).getTime() - e;
|
|
54
|
+
t > 0 && t <= 30 * pe && (n += 1);
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
total: Z.length,
|
|
58
|
+
active: t,
|
|
59
|
+
expiringSoon: n
|
|
60
|
+
};
|
|
61
|
+
}, [Z]);
|
|
62
|
+
l(() => {
|
|
63
|
+
if (!k) return;
|
|
64
|
+
let e = (e) => {
|
|
65
|
+
e.key === "Escape" && !O.isPending && A(!1);
|
|
66
|
+
};
|
|
67
|
+
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
68
|
+
}, [k, O.isPending]), l(() => {
|
|
69
|
+
k && X.current?.focus();
|
|
70
|
+
}, [k]);
|
|
71
|
+
let he = () => {
|
|
72
|
+
F(""), L(f?.id ?? ""), z("SVOD"), V("SUBSCRIPTION"), U(""), G(""), M(""), q(null);
|
|
73
|
+
}, ge = async (e) => {
|
|
74
|
+
if (e.preventDefault(), q(null), !P) {
|
|
75
|
+
q("Select a title.");
|
|
35
76
|
return;
|
|
36
77
|
}
|
|
37
|
-
if (!
|
|
38
|
-
|
|
78
|
+
if (!I.trim()) {
|
|
79
|
+
q("A user id is required.");
|
|
39
80
|
return;
|
|
40
81
|
}
|
|
41
82
|
let t = {
|
|
42
|
-
titleId:
|
|
43
|
-
userId:
|
|
44
|
-
mode:
|
|
45
|
-
source:
|
|
46
|
-
territory:
|
|
47
|
-
expiresAt:
|
|
83
|
+
titleId: P,
|
|
84
|
+
userId: I.trim(),
|
|
85
|
+
mode: R,
|
|
86
|
+
source: B,
|
|
87
|
+
territory: H.trim() ? H.trim().toUpperCase() : void 0,
|
|
88
|
+
expiresAt: W ? new Date(W).toISOString() : void 0
|
|
48
89
|
};
|
|
49
90
|
try {
|
|
50
|
-
await
|
|
91
|
+
await O.mutateAsync(t), he(), A(!1);
|
|
51
92
|
} catch (e) {
|
|
52
|
-
|
|
93
|
+
q(e instanceof Error ? e.message : "Failed to grant entitlement");
|
|
53
94
|
}
|
|
54
|
-
},
|
|
55
|
-
|
|
95
|
+
}, $ = async (e) => {
|
|
96
|
+
Y(null);
|
|
56
97
|
try {
|
|
57
|
-
await
|
|
98
|
+
await D.mutateAsync(e);
|
|
58
99
|
} catch (e) {
|
|
59
|
-
|
|
100
|
+
Y(e instanceof Error ? e.message : "Failed to revoke entitlement");
|
|
60
101
|
}
|
|
61
102
|
};
|
|
62
|
-
return /* @__PURE__ */
|
|
103
|
+
return /* @__PURE__ */ _(n, {
|
|
63
104
|
title: "My Entitlements",
|
|
64
105
|
description: "What you can watch right now",
|
|
65
106
|
purpose: "Your computed right to watch each title — from subscriptions, purchases, rentals, or promos. Entitlements derive from plan and rights windows.",
|
|
66
|
-
actions: /* @__PURE__ */
|
|
107
|
+
actions: /* @__PURE__ */ _("button", {
|
|
67
108
|
type: "button",
|
|
68
|
-
onClick: () =>
|
|
109
|
+
onClick: () => A(!0),
|
|
69
110
|
className: "inline-flex items-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 transition-opacity",
|
|
70
|
-
children: [/* @__PURE__ */
|
|
111
|
+
children: [/* @__PURE__ */ g(le, { className: "h-4 w-4" }), "Grant Entitlement"]
|
|
71
112
|
}),
|
|
72
113
|
children: [
|
|
73
|
-
|
|
114
|
+
J && /* @__PURE__ */ g("div", {
|
|
74
115
|
className: "mb-4 rounded-lg border border-status-error-border bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
|
|
75
|
-
children:
|
|
116
|
+
children: J
|
|
76
117
|
}),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}),
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
})
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}),
|
|
100
|
-
/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
|
|
101
|
-
htmlFor: "grant-title-search",
|
|
102
|
-
className: C,
|
|
103
|
-
children: "Search titles"
|
|
104
|
-
}), /* @__PURE__ */ _("input", {
|
|
105
|
-
id: "grant-title-search",
|
|
106
|
-
type: "text",
|
|
107
|
-
value: P,
|
|
108
|
-
onChange: (e) => F(e.target.value),
|
|
109
|
-
placeholder: "Filter titles by name…",
|
|
110
|
-
className: S
|
|
111
|
-
})] }),
|
|
112
|
-
/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
|
|
113
|
-
htmlFor: "grant-title",
|
|
114
|
-
className: C,
|
|
115
|
-
children: "Title *"
|
|
116
|
-
}), /* @__PURE__ */ v("select", {
|
|
117
|
-
id: "grant-title",
|
|
118
|
-
value: L,
|
|
119
|
-
onChange: (e) => R(e.target.value),
|
|
120
|
-
className: S,
|
|
121
|
-
required: !0,
|
|
122
|
-
children: [/* @__PURE__ */ _("option", {
|
|
123
|
-
value: "",
|
|
124
|
-
children: I.isLoading ? "Loading titles…" : "Select a title…"
|
|
125
|
-
}), (I.data?.items ?? []).map((e) => /* @__PURE__ */ _("option", {
|
|
126
|
-
value: e.id,
|
|
127
|
-
children: e.title
|
|
128
|
-
}, e.id))]
|
|
129
|
-
})] }),
|
|
130
|
-
/* @__PURE__ */ v("div", { children: [
|
|
131
|
-
/* @__PURE__ */ _("label", {
|
|
132
|
-
htmlFor: "grant-user",
|
|
133
|
-
className: C,
|
|
134
|
-
children: "User ID *"
|
|
135
|
-
}),
|
|
136
|
-
/* @__PURE__ */ _("input", {
|
|
137
|
-
id: "grant-user",
|
|
138
|
-
type: "text",
|
|
139
|
-
value: z,
|
|
140
|
-
onChange: (e) => B(e.target.value),
|
|
141
|
-
placeholder: "User id to grant access to",
|
|
142
|
-
className: S,
|
|
143
|
-
required: !0
|
|
144
|
-
}),
|
|
145
|
-
/* @__PURE__ */ _("p", {
|
|
146
|
-
className: "mt-1 text-[11px] text-text-secondary",
|
|
147
|
-
children: "Defaults to your own id. Change it to grant access to another user."
|
|
148
|
-
})
|
|
149
|
-
] }),
|
|
150
|
-
/* @__PURE__ */ v("div", {
|
|
151
|
-
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
152
|
-
children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
|
|
153
|
-
htmlFor: "grant-mode",
|
|
154
|
-
className: C,
|
|
155
|
-
children: "Monetization Mode *"
|
|
156
|
-
}), /* @__PURE__ */ _("select", {
|
|
157
|
-
id: "grant-mode",
|
|
158
|
-
value: V,
|
|
159
|
-
onChange: (e) => H(e.target.value),
|
|
160
|
-
className: S,
|
|
161
|
-
required: !0,
|
|
162
|
-
children: b.map((e) => /* @__PURE__ */ _("option", {
|
|
163
|
-
value: e,
|
|
164
|
-
children: c(e)
|
|
165
|
-
}, e))
|
|
166
|
-
})] }), /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
|
|
167
|
-
htmlFor: "grant-source",
|
|
168
|
-
className: C,
|
|
169
|
-
children: "Source"
|
|
170
|
-
}), /* @__PURE__ */ _("select", {
|
|
171
|
-
id: "grant-source",
|
|
172
|
-
value: U,
|
|
173
|
-
onChange: (e) => W(e.target.value),
|
|
174
|
-
className: S,
|
|
175
|
-
children: x.map((e) => /* @__PURE__ */ _("option", {
|
|
176
|
-
value: e,
|
|
177
|
-
children: c(e)
|
|
178
|
-
}, e))
|
|
179
|
-
})] })]
|
|
180
|
-
}),
|
|
181
|
-
/* @__PURE__ */ v("div", {
|
|
182
|
-
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
183
|
-
children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
|
|
184
|
-
htmlFor: "grant-territory",
|
|
185
|
-
className: C,
|
|
186
|
-
children: "Territory (ISO code, optional)"
|
|
187
|
-
}), /* @__PURE__ */ _("input", {
|
|
188
|
-
id: "grant-territory",
|
|
189
|
-
type: "text",
|
|
190
|
-
value: G,
|
|
191
|
-
onChange: (e) => K(e.target.value),
|
|
192
|
-
placeholder: "US",
|
|
193
|
-
className: S
|
|
194
|
-
})] }), /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
|
|
195
|
-
htmlFor: "grant-expires",
|
|
196
|
-
className: C,
|
|
197
|
-
children: "Expires At (optional)"
|
|
198
|
-
}), /* @__PURE__ */ _("input", {
|
|
199
|
-
id: "grant-expires",
|
|
200
|
-
type: "date",
|
|
201
|
-
value: q,
|
|
202
|
-
onChange: (e) => J(e.target.value),
|
|
203
|
-
className: S
|
|
204
|
-
})] })]
|
|
205
|
-
}),
|
|
206
|
-
/* @__PURE__ */ _("button", {
|
|
207
|
-
type: "submit",
|
|
208
|
-
disabled: j.isPending,
|
|
209
|
-
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 transition-opacity",
|
|
210
|
-
children: j.isPending ? "Granting…" : "Grant Entitlement"
|
|
211
|
-
})
|
|
212
|
-
]
|
|
213
|
-
})]
|
|
118
|
+
!T && !E && Z.length > 0 && /* @__PURE__ */ _("div", {
|
|
119
|
+
className: "mb-6 grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
120
|
+
children: [
|
|
121
|
+
/* @__PURE__ */ g(r, {
|
|
122
|
+
icon: /* @__PURE__ */ g(p, { className: "h-5 w-5" }),
|
|
123
|
+
value: Q.active,
|
|
124
|
+
label: "Active entitlements",
|
|
125
|
+
className: "p-4 sm:p-5"
|
|
126
|
+
}),
|
|
127
|
+
/* @__PURE__ */ g(r, {
|
|
128
|
+
icon: /* @__PURE__ */ g(oe, { className: "h-5 w-5" }),
|
|
129
|
+
value: Q.expiringSoon,
|
|
130
|
+
label: "Expiring within 30 days",
|
|
131
|
+
className: "p-4 sm:p-5"
|
|
132
|
+
}),
|
|
133
|
+
/* @__PURE__ */ g(r, {
|
|
134
|
+
icon: /* @__PURE__ */ g(m, { className: "h-5 w-5" }),
|
|
135
|
+
value: Q.total,
|
|
136
|
+
label: "Total entitlements",
|
|
137
|
+
className: "p-4 sm:p-5"
|
|
138
|
+
})
|
|
139
|
+
]
|
|
214
140
|
}),
|
|
215
|
-
|
|
216
|
-
icon: /* @__PURE__ */
|
|
141
|
+
T ? /* @__PURE__ */ g(ie, { label: "Loading entitlements…" }) : E ? /* @__PURE__ */ g(c, { onRetry: () => void me() }) : Z.length === 0 ? /* @__PURE__ */ g(re, {
|
|
142
|
+
icon: /* @__PURE__ */ g(m, { className: "h-12 w-12" }),
|
|
217
143
|
title: "No entitlements yet",
|
|
218
144
|
description: "You don't have any active watch rights. Grant an entitlement above, or browse the catalog to find something to watch.",
|
|
219
|
-
action: /* @__PURE__ */
|
|
145
|
+
action: /* @__PURE__ */ g("button", {
|
|
220
146
|
type: "button",
|
|
221
|
-
onClick: () =>
|
|
147
|
+
onClick: () => t("catalog/titles"),
|
|
222
148
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 transition-opacity",
|
|
223
149
|
children: "Browse Catalog"
|
|
224
150
|
})
|
|
225
|
-
}) : /* @__PURE__ */ _(
|
|
226
|
-
|
|
227
|
-
|
|
151
|
+
}) : /* @__PURE__ */ _(de, { children: [/* @__PURE__ */ g(v, {
|
|
152
|
+
treatment: "glass",
|
|
153
|
+
className: "hidden overflow-hidden border-border-seam p-0 md:block",
|
|
154
|
+
children: /* @__PURE__ */ g("div", {
|
|
155
|
+
className: "overflow-x-auto",
|
|
156
|
+
children: /* @__PURE__ */ _("table", {
|
|
157
|
+
className: "w-full min-w-[720px] border-collapse text-sm",
|
|
158
|
+
children: [/* @__PURE__ */ g("thead", { children: /* @__PURE__ */ _("tr", {
|
|
159
|
+
className: "border-b border-border-seam text-left text-xs font-medium uppercase tracking-wide text-text-secondary",
|
|
160
|
+
children: [
|
|
161
|
+
/* @__PURE__ */ g("th", {
|
|
162
|
+
scope: "col",
|
|
163
|
+
className: "px-5 py-3 font-medium",
|
|
164
|
+
children: "Title"
|
|
165
|
+
}),
|
|
166
|
+
/* @__PURE__ */ g("th", {
|
|
167
|
+
scope: "col",
|
|
168
|
+
className: "px-5 py-3 font-medium",
|
|
169
|
+
children: "Source"
|
|
170
|
+
}),
|
|
171
|
+
/* @__PURE__ */ g("th", {
|
|
172
|
+
scope: "col",
|
|
173
|
+
className: "px-5 py-3 font-medium",
|
|
174
|
+
children: "Monetization"
|
|
175
|
+
}),
|
|
176
|
+
/* @__PURE__ */ g("th", {
|
|
177
|
+
scope: "col",
|
|
178
|
+
className: "px-5 py-3 font-medium",
|
|
179
|
+
children: "Territory"
|
|
180
|
+
}),
|
|
181
|
+
/* @__PURE__ */ g("th", {
|
|
182
|
+
scope: "col",
|
|
183
|
+
className: "px-5 py-3 font-medium",
|
|
184
|
+
children: "Expires"
|
|
185
|
+
}),
|
|
186
|
+
/* @__PURE__ */ g("th", {
|
|
187
|
+
scope: "col",
|
|
188
|
+
className: "px-5 py-3 font-medium",
|
|
189
|
+
children: "Status"
|
|
190
|
+
}),
|
|
191
|
+
/* @__PURE__ */ g("th", {
|
|
192
|
+
scope: "col",
|
|
193
|
+
className: "px-5 py-3 text-right font-medium",
|
|
194
|
+
children: "Actions"
|
|
195
|
+
})
|
|
196
|
+
]
|
|
197
|
+
}) }), /* @__PURE__ */ g("tbody", { children: Z.map((e) => /* @__PURE__ */ _("tr", {
|
|
198
|
+
className: "border-b border-border-seam/60 last:border-0 transition-colors hover:bg-bg-sunken/50",
|
|
199
|
+
children: [
|
|
200
|
+
/* @__PURE__ */ g("td", {
|
|
201
|
+
className: "px-5 py-3",
|
|
202
|
+
children: /* @__PURE__ */ _("div", {
|
|
203
|
+
className: "flex items-center gap-3",
|
|
204
|
+
children: [/* @__PURE__ */ g(C, { title: e.title?.title ?? "Title" }), /* @__PURE__ */ g("button", {
|
|
205
|
+
type: "button",
|
|
206
|
+
onClick: () => t(`catalog/titles/${e.titleId}`),
|
|
207
|
+
className: "line-clamp-2 max-w-[16rem] text-left font-medium text-text-primary hover:text-action-primary-bg transition-colors",
|
|
208
|
+
children: e.title?.title ?? "Title"
|
|
209
|
+
})]
|
|
210
|
+
})
|
|
211
|
+
}),
|
|
212
|
+
/* @__PURE__ */ g("td", {
|
|
213
|
+
className: "px-5 py-3",
|
|
214
|
+
children: /* @__PURE__ */ g(w, { source: e.source })
|
|
215
|
+
}),
|
|
216
|
+
/* @__PURE__ */ g("td", {
|
|
217
|
+
className: "px-5 py-3 text-text-secondary",
|
|
218
|
+
children: s(e.mode)
|
|
219
|
+
}),
|
|
220
|
+
/* @__PURE__ */ g("td", {
|
|
221
|
+
className: "px-5 py-3 text-text-secondary",
|
|
222
|
+
children: e.territory ? e.territory : /* @__PURE__ */ g("span", {
|
|
223
|
+
className: "text-text-muted",
|
|
224
|
+
children: "—"
|
|
225
|
+
})
|
|
226
|
+
}),
|
|
227
|
+
/* @__PURE__ */ g("td", {
|
|
228
|
+
className: "px-5 py-3 text-text-secondary",
|
|
229
|
+
children: e.expiresAt ? o(e.expiresAt, {
|
|
230
|
+
hour: void 0,
|
|
231
|
+
minute: void 0
|
|
232
|
+
}) : /* @__PURE__ */ g("span", {
|
|
233
|
+
className: "text-text-muted",
|
|
234
|
+
children: "No expiry"
|
|
235
|
+
})
|
|
236
|
+
}),
|
|
237
|
+
/* @__PURE__ */ g("td", {
|
|
238
|
+
className: "px-5 py-3",
|
|
239
|
+
children: /* @__PURE__ */ g(i, { status: e.status })
|
|
240
|
+
}),
|
|
241
|
+
/* @__PURE__ */ g("td", {
|
|
242
|
+
className: "px-5 py-3",
|
|
243
|
+
children: /* @__PURE__ */ _("div", {
|
|
244
|
+
className: "flex items-center justify-end gap-2",
|
|
245
|
+
children: [/* @__PURE__ */ _("button", {
|
|
246
|
+
type: "button",
|
|
247
|
+
onClick: () => t(`catalog/titles/${e.titleId}`),
|
|
248
|
+
className: "inline-flex items-center gap-1 rounded-lg bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:opacity-90 transition-opacity",
|
|
249
|
+
children: [/* @__PURE__ */ g(p, { className: "h-3.5 w-3.5" }), "Watch"]
|
|
250
|
+
}), e.status === "ACTIVE" && /* @__PURE__ */ _("button", {
|
|
251
|
+
type: "button",
|
|
252
|
+
disabled: D.isPending,
|
|
253
|
+
onClick: () => void $(e.id),
|
|
254
|
+
className: "inline-flex items-center gap-1 rounded-lg border border-border-seam px-3 py-1.5 text-xs font-medium text-text-secondary hover:border-status-error-border hover:text-status-error-text disabled:opacity-50 transition-colors",
|
|
255
|
+
children: [/* @__PURE__ */ g(h, { className: "h-3.5 w-3.5" }), "Revoke"]
|
|
256
|
+
})]
|
|
257
|
+
})
|
|
258
|
+
})
|
|
259
|
+
]
|
|
260
|
+
}, e.id)) })]
|
|
261
|
+
})
|
|
262
|
+
})
|
|
263
|
+
}), /* @__PURE__ */ g("div", {
|
|
264
|
+
className: "grid grid-cols-1 gap-4 md:hidden",
|
|
265
|
+
children: Z.map((e) => /* @__PURE__ */ _(v, {
|
|
228
266
|
treatment: "metric",
|
|
229
267
|
className: "flex flex-col border-border-seam p-4",
|
|
230
268
|
children: [
|
|
231
|
-
/* @__PURE__ */
|
|
232
|
-
className: "flex items-start
|
|
233
|
-
children: [/* @__PURE__ */ _("button", {
|
|
234
|
-
type: "button",
|
|
235
|
-
onClick: () => w(`catalog/titles/${e.titleId}`),
|
|
236
|
-
className: "line-clamp-2 text-left text-sm font-semibold text-text-primary hover:text-action-primary-bg transition-colors",
|
|
237
|
-
children: e.title?.title ?? "Title"
|
|
238
|
-
}), /* @__PURE__ */ _(n, { status: e.status })]
|
|
239
|
-
}),
|
|
240
|
-
/* @__PURE__ */ v("div", {
|
|
241
|
-
className: "mt-2 flex flex-wrap items-center gap-1.5 text-xs text-text-secondary",
|
|
269
|
+
/* @__PURE__ */ _("div", {
|
|
270
|
+
className: "flex items-start gap-3",
|
|
242
271
|
children: [
|
|
243
|
-
/* @__PURE__ */
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
272
|
+
/* @__PURE__ */ g(C, { title: e.title?.title ?? "Title" }),
|
|
273
|
+
/* @__PURE__ */ _("div", {
|
|
274
|
+
className: "min-w-0 flex-1",
|
|
275
|
+
children: [/* @__PURE__ */ g("button", {
|
|
276
|
+
type: "button",
|
|
277
|
+
onClick: () => t(`catalog/titles/${e.titleId}`),
|
|
278
|
+
className: "line-clamp-2 text-left text-sm font-semibold text-text-primary hover:text-action-primary-bg transition-colors",
|
|
279
|
+
children: e.title?.title ?? "Title"
|
|
280
|
+
}), /* @__PURE__ */ _("div", {
|
|
281
|
+
className: "mt-1.5 flex flex-wrap items-center gap-1.5",
|
|
282
|
+
children: [/* @__PURE__ */ g(w, { source: e.source }), /* @__PURE__ */ g("span", {
|
|
283
|
+
className: "rounded-full bg-bg-sunken px-2 py-0.5 text-[11px] text-text-secondary",
|
|
284
|
+
children: s(e.mode)
|
|
285
|
+
})]
|
|
286
|
+
})]
|
|
250
287
|
}),
|
|
251
|
-
|
|
252
|
-
className: "rounded-full bg-bg-sunken px-2 py-0.5",
|
|
253
|
-
children: e.territory
|
|
254
|
-
})
|
|
288
|
+
/* @__PURE__ */ g(i, { status: e.status })
|
|
255
289
|
]
|
|
256
290
|
}),
|
|
257
|
-
|
|
258
|
-
className: "mt-2
|
|
259
|
-
children: [
|
|
260
|
-
|
|
261
|
-
|
|
291
|
+
/* @__PURE__ */ _("dl", {
|
|
292
|
+
className: "mt-3 grid grid-cols-2 gap-x-4 gap-y-2 text-xs",
|
|
293
|
+
children: [/* @__PURE__ */ _("div", {
|
|
294
|
+
className: "flex items-center gap-1.5 text-text-secondary",
|
|
295
|
+
children: [
|
|
296
|
+
/* @__PURE__ */ g(ce, {
|
|
297
|
+
className: "h-3.5 w-3.5 text-text-muted",
|
|
298
|
+
"aria-hidden": "true"
|
|
299
|
+
}),
|
|
300
|
+
/* @__PURE__ */ g("dt", {
|
|
301
|
+
className: "sr-only",
|
|
302
|
+
children: "Territory"
|
|
303
|
+
}),
|
|
304
|
+
/* @__PURE__ */ g("dd", { children: e.territory ? e.territory : "Worldwide" })
|
|
305
|
+
]
|
|
306
|
+
}), /* @__PURE__ */ _("div", {
|
|
307
|
+
className: "flex items-center gap-1.5 text-text-secondary",
|
|
308
|
+
children: [
|
|
309
|
+
/* @__PURE__ */ g(se, {
|
|
310
|
+
className: "h-3.5 w-3.5 text-text-muted",
|
|
311
|
+
"aria-hidden": "true"
|
|
312
|
+
}),
|
|
313
|
+
/* @__PURE__ */ g("dt", {
|
|
314
|
+
className: "sr-only",
|
|
315
|
+
children: "Expires"
|
|
316
|
+
}),
|
|
317
|
+
/* @__PURE__ */ g("dd", { children: e.expiresAt ? o(e.expiresAt, {
|
|
318
|
+
hour: void 0,
|
|
319
|
+
minute: void 0
|
|
320
|
+
}) : "No expiry" })
|
|
321
|
+
]
|
|
262
322
|
})]
|
|
263
323
|
}),
|
|
264
|
-
/* @__PURE__ */
|
|
265
|
-
className: "mt-
|
|
266
|
-
children: [/* @__PURE__ */
|
|
324
|
+
/* @__PURE__ */ _("div", {
|
|
325
|
+
className: "mt-4 flex items-center gap-2",
|
|
326
|
+
children: [/* @__PURE__ */ _("button", {
|
|
267
327
|
type: "button",
|
|
268
|
-
onClick: () =>
|
|
328
|
+
onClick: () => t(`catalog/titles/${e.titleId}`),
|
|
269
329
|
className: "inline-flex flex-1 items-center justify-center gap-1 rounded-lg bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:opacity-90 transition-opacity",
|
|
270
|
-
children: [/* @__PURE__ */
|
|
271
|
-
}), e.status === "ACTIVE" && /* @__PURE__ */
|
|
330
|
+
children: [/* @__PURE__ */ g(p, { className: "h-3.5 w-3.5" }), "Watch"]
|
|
331
|
+
}), e.status === "ACTIVE" && /* @__PURE__ */ _("button", {
|
|
272
332
|
type: "button",
|
|
273
|
-
disabled:
|
|
274
|
-
onClick: () => void
|
|
275
|
-
className: "inline-flex items-center gap-1 rounded-lg border border-border-seam px-3 py-1.5 text-xs font-medium text-text-secondary hover:text-status-error-text disabled:opacity-50 transition-colors",
|
|
276
|
-
children: [/* @__PURE__ */
|
|
333
|
+
disabled: D.isPending,
|
|
334
|
+
onClick: () => void $(e.id),
|
|
335
|
+
className: "inline-flex items-center gap-1 rounded-lg border border-border-seam px-3 py-1.5 text-xs font-medium text-text-secondary hover:border-status-error-border hover:text-status-error-text disabled:opacity-50 transition-colors",
|
|
336
|
+
children: [/* @__PURE__ */ g(h, { className: "h-3.5 w-3.5" }), "Revoke"]
|
|
277
337
|
})]
|
|
278
338
|
})
|
|
279
339
|
]
|
|
280
340
|
}, e.id))
|
|
341
|
+
})] }),
|
|
342
|
+
k && /* @__PURE__ */ _("div", {
|
|
343
|
+
className: "fixed inset-0 z-50 flex justify-end",
|
|
344
|
+
role: "dialog",
|
|
345
|
+
"aria-modal": "true",
|
|
346
|
+
"aria-labelledby": "grant-drawer-title",
|
|
347
|
+
children: [/* @__PURE__ */ g("button", {
|
|
348
|
+
type: "button",
|
|
349
|
+
"aria-label": "Close grant form",
|
|
350
|
+
onClick: () => A(!1),
|
|
351
|
+
className: "absolute inset-0 h-full w-full cursor-default bg-bg-canvas/70 backdrop-blur-sm"
|
|
352
|
+
}), /* @__PURE__ */ _("div", {
|
|
353
|
+
className: "relative z-10 flex h-full w-full max-w-md flex-col border-l border-border-seam bg-bg-surface shadow-2xl",
|
|
354
|
+
children: [/* @__PURE__ */ _("div", {
|
|
355
|
+
className: "flex items-center justify-between border-b border-border-seam px-5 py-4",
|
|
356
|
+
children: [/* @__PURE__ */ _("div", {
|
|
357
|
+
className: "flex items-center gap-2",
|
|
358
|
+
children: [/* @__PURE__ */ g("span", {
|
|
359
|
+
className: "flex h-8 w-8 items-center justify-center rounded-lg bg-action-primary-bg-subtle text-action-primary-bg",
|
|
360
|
+
children: /* @__PURE__ */ g(m, { className: "h-4 w-4" })
|
|
361
|
+
}), /* @__PURE__ */ g("h2", {
|
|
362
|
+
id: "grant-drawer-title",
|
|
363
|
+
className: "text-sm font-semibold text-text-primary",
|
|
364
|
+
children: "Grant Entitlement"
|
|
365
|
+
})]
|
|
366
|
+
}), /* @__PURE__ */ g("button", {
|
|
367
|
+
type: "button",
|
|
368
|
+
onClick: () => A(!1),
|
|
369
|
+
"aria-label": "Close grant form",
|
|
370
|
+
className: "rounded-md p-1 text-text-secondary hover:bg-bg-sunken hover:text-text-primary transition-colors",
|
|
371
|
+
children: /* @__PURE__ */ g(ue, { className: "h-4 w-4" })
|
|
372
|
+
})]
|
|
373
|
+
}), /* @__PURE__ */ _("form", {
|
|
374
|
+
onSubmit: ge,
|
|
375
|
+
className: "flex flex-1 flex-col overflow-y-auto",
|
|
376
|
+
children: [/* @__PURE__ */ _("div", {
|
|
377
|
+
className: "flex-1 space-y-4 px-5 py-5",
|
|
378
|
+
children: [
|
|
379
|
+
K && /* @__PURE__ */ g("div", {
|
|
380
|
+
className: "rounded-lg border border-status-error-border bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
|
|
381
|
+
children: K
|
|
382
|
+
}),
|
|
383
|
+
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
|
|
384
|
+
htmlFor: "grant-title-search",
|
|
385
|
+
className: S,
|
|
386
|
+
children: "Search titles"
|
|
387
|
+
}), /* @__PURE__ */ g("input", {
|
|
388
|
+
ref: X,
|
|
389
|
+
id: "grant-title-search",
|
|
390
|
+
type: "text",
|
|
391
|
+
value: j,
|
|
392
|
+
onChange: (e) => M(e.target.value),
|
|
393
|
+
placeholder: "Filter titles by name…",
|
|
394
|
+
className: x
|
|
395
|
+
})] }),
|
|
396
|
+
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
|
|
397
|
+
htmlFor: "grant-title",
|
|
398
|
+
className: S,
|
|
399
|
+
children: "Title *"
|
|
400
|
+
}), /* @__PURE__ */ _("select", {
|
|
401
|
+
id: "grant-title",
|
|
402
|
+
value: P,
|
|
403
|
+
onChange: (e) => F(e.target.value),
|
|
404
|
+
className: x,
|
|
405
|
+
required: !0,
|
|
406
|
+
children: [/* @__PURE__ */ g("option", {
|
|
407
|
+
value: "",
|
|
408
|
+
children: N.isLoading ? "Loading titles…" : "Select a title…"
|
|
409
|
+
}), (N.data?.items ?? []).map((e) => /* @__PURE__ */ g("option", {
|
|
410
|
+
value: e.id,
|
|
411
|
+
children: e.title
|
|
412
|
+
}, e.id))]
|
|
413
|
+
})] }),
|
|
414
|
+
/* @__PURE__ */ _("div", { children: [
|
|
415
|
+
/* @__PURE__ */ g("label", {
|
|
416
|
+
htmlFor: "grant-user",
|
|
417
|
+
className: S,
|
|
418
|
+
children: "User ID *"
|
|
419
|
+
}),
|
|
420
|
+
/* @__PURE__ */ g("input", {
|
|
421
|
+
id: "grant-user",
|
|
422
|
+
type: "text",
|
|
423
|
+
value: I,
|
|
424
|
+
onChange: (e) => L(e.target.value),
|
|
425
|
+
placeholder: "User id to grant access to",
|
|
426
|
+
className: x,
|
|
427
|
+
required: !0
|
|
428
|
+
}),
|
|
429
|
+
/* @__PURE__ */ g("p", {
|
|
430
|
+
className: "mt-1 text-[11px] text-text-secondary",
|
|
431
|
+
children: "Defaults to your own id. Change it to grant access to another user."
|
|
432
|
+
})
|
|
433
|
+
] }),
|
|
434
|
+
/* @__PURE__ */ _("div", {
|
|
435
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
436
|
+
children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
|
|
437
|
+
htmlFor: "grant-mode",
|
|
438
|
+
className: S,
|
|
439
|
+
children: "Monetization Mode *"
|
|
440
|
+
}), /* @__PURE__ */ g("select", {
|
|
441
|
+
id: "grant-mode",
|
|
442
|
+
value: R,
|
|
443
|
+
onChange: (e) => z(e.target.value),
|
|
444
|
+
className: x,
|
|
445
|
+
required: !0,
|
|
446
|
+
children: fe.map((e) => /* @__PURE__ */ g("option", {
|
|
447
|
+
value: e,
|
|
448
|
+
children: s(e)
|
|
449
|
+
}, e))
|
|
450
|
+
})] }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
|
|
451
|
+
htmlFor: "grant-source",
|
|
452
|
+
className: S,
|
|
453
|
+
children: "Source"
|
|
454
|
+
}), /* @__PURE__ */ g("select", {
|
|
455
|
+
id: "grant-source",
|
|
456
|
+
value: B,
|
|
457
|
+
onChange: (e) => V(e.target.value),
|
|
458
|
+
className: x,
|
|
459
|
+
children: y.map((e) => /* @__PURE__ */ g("option", {
|
|
460
|
+
value: e,
|
|
461
|
+
children: s(e)
|
|
462
|
+
}, e))
|
|
463
|
+
})] })]
|
|
464
|
+
}),
|
|
465
|
+
/* @__PURE__ */ _("div", {
|
|
466
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
467
|
+
children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
|
|
468
|
+
htmlFor: "grant-territory",
|
|
469
|
+
className: S,
|
|
470
|
+
children: "Territory (ISO code, optional)"
|
|
471
|
+
}), /* @__PURE__ */ g("input", {
|
|
472
|
+
id: "grant-territory",
|
|
473
|
+
type: "text",
|
|
474
|
+
value: H,
|
|
475
|
+
onChange: (e) => U(e.target.value),
|
|
476
|
+
placeholder: "US",
|
|
477
|
+
className: x
|
|
478
|
+
})] }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
|
|
479
|
+
htmlFor: "grant-expires",
|
|
480
|
+
className: S,
|
|
481
|
+
children: "Expires At (optional)"
|
|
482
|
+
}), /* @__PURE__ */ g("input", {
|
|
483
|
+
id: "grant-expires",
|
|
484
|
+
type: "date",
|
|
485
|
+
value: W,
|
|
486
|
+
onChange: (e) => G(e.target.value),
|
|
487
|
+
className: x
|
|
488
|
+
})] })]
|
|
489
|
+
})
|
|
490
|
+
]
|
|
491
|
+
}), /* @__PURE__ */ _("div", {
|
|
492
|
+
className: "flex items-center justify-end gap-2 border-t border-border-seam bg-bg-surface px-5 py-4",
|
|
493
|
+
children: [/* @__PURE__ */ g("button", {
|
|
494
|
+
type: "button",
|
|
495
|
+
onClick: () => A(!1),
|
|
496
|
+
className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-secondary hover:text-text-primary transition-colors",
|
|
497
|
+
children: "Cancel"
|
|
498
|
+
}), /* @__PURE__ */ g("button", {
|
|
499
|
+
type: "submit",
|
|
500
|
+
disabled: O.isPending,
|
|
501
|
+
className: "inline-flex items-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50 transition-opacity",
|
|
502
|
+
children: O.isPending ? "Granting…" : "Grant Entitlement"
|
|
503
|
+
})]
|
|
504
|
+
})]
|
|
505
|
+
})]
|
|
506
|
+
})]
|
|
281
507
|
})
|
|
282
508
|
]
|
|
283
509
|
});
|
|
284
510
|
};
|
|
285
511
|
//#endregion
|
|
286
|
-
export {
|
|
512
|
+
export { T as EntitlementsPage };
|
|
287
513
|
|
|
288
514
|
//# sourceMappingURL=EntitlementsPage.js.map
|