ghost 5.93.0 → 5.94.0

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.
Files changed (141) hide show
  1. package/components/{tryghost-adapter-cache-memory-ttl-5.93.0.tgz → tryghost-adapter-cache-memory-ttl-5.94.0.tgz} +0 -0
  2. package/components/tryghost-adapter-cache-redis-5.94.0.tgz +0 -0
  3. package/components/{tryghost-adapter-manager-5.93.0.tgz → tryghost-adapter-manager-5.94.0.tgz} +0 -0
  4. package/components/{tryghost-announcement-bar-settings-5.93.0.tgz → tryghost-announcement-bar-settings-5.94.0.tgz} +0 -0
  5. package/components/{tryghost-api-framework-5.93.0.tgz → tryghost-api-framework-5.94.0.tgz} +0 -0
  6. package/components/{tryghost-api-version-compatibility-service-5.93.0.tgz → tryghost-api-version-compatibility-service-5.94.0.tgz} +0 -0
  7. package/components/tryghost-audience-feedback-5.94.0.tgz +0 -0
  8. package/components/tryghost-bookshelf-repository-5.94.0.tgz +0 -0
  9. package/components/{tryghost-bootstrap-socket-5.93.0.tgz → tryghost-bootstrap-socket-5.94.0.tgz} +0 -0
  10. package/components/{tryghost-collections-5.93.0.tgz → tryghost-collections-5.94.0.tgz} +0 -0
  11. package/components/tryghost-constants-5.94.0.tgz +0 -0
  12. package/components/{tryghost-custom-theme-settings-service-5.93.0.tgz → tryghost-custom-theme-settings-service-5.94.0.tgz} +0 -0
  13. package/components/{tryghost-data-generator-5.93.0.tgz → tryghost-data-generator-5.94.0.tgz} +0 -0
  14. package/components/{tryghost-domain-events-5.93.0.tgz → tryghost-domain-events-5.94.0.tgz} +0 -0
  15. package/components/tryghost-donations-5.94.0.tgz +0 -0
  16. package/components/tryghost-dynamic-routing-events-5.94.0.tgz +0 -0
  17. package/components/{tryghost-email-addresses-5.93.0.tgz → tryghost-email-addresses-5.94.0.tgz} +0 -0
  18. package/components/tryghost-email-analytics-provider-mailgun-5.94.0.tgz +0 -0
  19. package/components/tryghost-email-analytics-service-5.94.0.tgz +0 -0
  20. package/components/{tryghost-email-content-generator-5.93.0.tgz → tryghost-email-content-generator-5.94.0.tgz} +0 -0
  21. package/components/tryghost-email-events-5.94.0.tgz +0 -0
  22. package/components/tryghost-email-service-5.94.0.tgz +0 -0
  23. package/components/tryghost-email-suppression-list-5.94.0.tgz +0 -0
  24. package/components/tryghost-express-dynamic-redirects-5.94.0.tgz +0 -0
  25. package/components/tryghost-external-media-inliner-5.94.0.tgz +0 -0
  26. package/components/tryghost-extract-api-key-5.94.0.tgz +0 -0
  27. package/components/tryghost-ghost-5.94.0.tgz +0 -0
  28. package/components/tryghost-html-to-plaintext-5.94.0.tgz +0 -0
  29. package/components/tryghost-i18n-5.94.0.tgz +0 -0
  30. package/components/tryghost-importer-handler-content-files-5.94.0.tgz +0 -0
  31. package/components/{tryghost-importer-revue-5.93.0.tgz → tryghost-importer-revue-5.94.0.tgz} +0 -0
  32. package/components/tryghost-in-memory-repository-5.94.0.tgz +0 -0
  33. package/components/{tryghost-job-manager-5.93.0.tgz → tryghost-job-manager-5.94.0.tgz} +0 -0
  34. package/components/{tryghost-link-redirects-5.93.0.tgz → tryghost-link-redirects-5.94.0.tgz} +0 -0
  35. package/components/tryghost-link-replacer-5.94.0.tgz +0 -0
  36. package/components/{tryghost-link-tracking-5.93.0.tgz → tryghost-link-tracking-5.94.0.tgz} +0 -0
  37. package/components/{tryghost-magic-link-5.93.0.tgz → tryghost-magic-link-5.94.0.tgz} +0 -0
  38. package/components/{tryghost-mail-events-5.93.0.tgz → tryghost-mail-events-5.94.0.tgz} +0 -0
  39. package/components/tryghost-mailgun-client-5.94.0.tgz +0 -0
  40. package/components/{tryghost-member-attribution-5.93.0.tgz → tryghost-member-attribution-5.94.0.tgz} +0 -0
  41. package/components/{tryghost-member-events-5.93.0.tgz → tryghost-member-events-5.94.0.tgz} +0 -0
  42. package/components/{tryghost-members-api-5.93.0.tgz → tryghost-members-api-5.94.0.tgz} +0 -0
  43. package/components/{tryghost-members-csv-5.93.0.tgz → tryghost-members-csv-5.94.0.tgz} +0 -0
  44. package/components/{tryghost-members-events-service-5.93.0.tgz → tryghost-members-events-service-5.94.0.tgz} +0 -0
  45. package/components/{tryghost-members-importer-5.93.0.tgz → tryghost-members-importer-5.94.0.tgz} +0 -0
  46. package/components/{tryghost-members-offers-5.93.0.tgz → tryghost-members-offers-5.94.0.tgz} +0 -0
  47. package/components/tryghost-members-payments-5.94.0.tgz +0 -0
  48. package/components/{tryghost-members-ssr-5.93.0.tgz → tryghost-members-ssr-5.94.0.tgz} +0 -0
  49. package/components/{tryghost-members-stripe-service-5.93.0.tgz → tryghost-members-stripe-service-5.94.0.tgz} +0 -0
  50. package/components/tryghost-mentions-email-report-5.94.0.tgz +0 -0
  51. package/components/{tryghost-milestones-5.93.0.tgz → tryghost-milestones-5.94.0.tgz} +0 -0
  52. package/components/tryghost-minifier-5.94.0.tgz +0 -0
  53. package/components/{tryghost-model-to-domain-event-interceptor-5.93.0.tgz → tryghost-model-to-domain-event-interceptor-5.94.0.tgz} +0 -0
  54. package/components/tryghost-mw-api-version-mismatch-5.94.0.tgz +0 -0
  55. package/components/{tryghost-mw-cache-control-5.93.0.tgz → tryghost-mw-cache-control-5.94.0.tgz} +0 -0
  56. package/components/tryghost-mw-error-handler-5.94.0.tgz +0 -0
  57. package/components/{tryghost-mw-session-from-token-5.93.0.tgz → tryghost-mw-session-from-token-5.94.0.tgz} +0 -0
  58. package/components/tryghost-mw-update-user-last-seen-5.94.0.tgz +0 -0
  59. package/components/tryghost-mw-version-match-5.94.0.tgz +0 -0
  60. package/components/tryghost-mw-vhost-5.94.0.tgz +0 -0
  61. package/components/tryghost-nql-filter-expansions-5.94.0.tgz +0 -0
  62. package/components/tryghost-oembed-service-5.94.0.tgz +0 -0
  63. package/components/tryghost-package-json-5.94.0.tgz +0 -0
  64. package/components/{tryghost-post-events-5.93.0.tgz → tryghost-post-events-5.94.0.tgz} +0 -0
  65. package/components/{tryghost-post-revisions-5.93.0.tgz → tryghost-post-revisions-5.94.0.tgz} +0 -0
  66. package/components/{tryghost-posts-service-5.93.0.tgz → tryghost-posts-service-5.94.0.tgz} +0 -0
  67. package/components/{tryghost-recommendations-5.93.0.tgz → tryghost-recommendations-5.94.0.tgz} +0 -0
  68. package/components/{tryghost-referrers-5.93.0.tgz → tryghost-referrers-5.94.0.tgz} +0 -0
  69. package/components/{tryghost-security-5.93.0.tgz → tryghost-security-5.94.0.tgz} +0 -0
  70. package/components/tryghost-session-service-5.94.0.tgz +0 -0
  71. package/components/{tryghost-settings-path-manager-5.93.0.tgz → tryghost-settings-path-manager-5.94.0.tgz} +0 -0
  72. package/components/tryghost-slack-notifications-5.94.0.tgz +0 -0
  73. package/components/{tryghost-staff-service-5.93.0.tgz → tryghost-staff-service-5.94.0.tgz} +0 -0
  74. package/components/tryghost-stats-service-5.94.0.tgz +0 -0
  75. package/components/tryghost-tiers-5.94.0.tgz +0 -0
  76. package/components/tryghost-update-check-service-5.94.0.tgz +0 -0
  77. package/components/{tryghost-verification-trigger-5.93.0.tgz → tryghost-verification-trigger-5.94.0.tgz} +0 -0
  78. package/components/{tryghost-version-notifications-data-service-5.93.0.tgz → tryghost-version-notifications-data-service-5.94.0.tgz} +0 -0
  79. package/components/tryghost-webmentions-5.94.0.tgz +0 -0
  80. package/core/app.js +22 -0
  81. package/core/built/admin/assets/admin-x-activitypub/admin-x-activitypub.js +2 -2
  82. package/core/built/admin/assets/admin-x-activitypub/{index-5eac6af1.mjs → index-51277f76.mjs} +3000 -2661
  83. package/core/built/admin/assets/admin-x-activitypub/modals-c85985ad.mjs +815 -0
  84. package/core/built/admin/assets/{chunk.524.b8e3b4aa87fcd581b137.js → chunk.524.b9da8e9c62fc112baf2b.js} +5 -5
  85. package/core/built/admin/assets/{chunk.582.a3c9ecefa2618454961c.js → chunk.582.27ddbcbd7a6e7a439db8.js} +6 -6
  86. package/core/built/admin/assets/{chunk.217.2bd17b550359ea58831b.js → chunk.785.78610bd253a9e2419ec9.js} +27 -20
  87. package/core/built/admin/assets/{ghost-9767eb06282ff32f4c204945b30f2ee5.js → ghost-535088daf62c8cbea78a012bb6bbafc6.js} +866 -827
  88. package/core/built/admin/assets/ghost-d1c51d3a2d840dda5aa7b4ffe6057756.css +1 -0
  89. package/core/built/admin/assets/ghost-dark-98b3a7e593292a7cb410609e17727a3c.css +1 -0
  90. package/core/built/admin/assets/koenig-lexical/koenig-lexical.js +201 -194
  91. package/core/built/admin/assets/koenig-lexical/koenig-lexical.umd.js +25 -25
  92. package/core/built/admin/assets/{vendor-bff75d127fcf4a75c8a83b473bdb308f.js → vendor-649dc64bfd9ecc1bd7361b53680dfdc2.js} +19 -17
  93. package/core/built/admin/index.html +6 -6
  94. package/core/server/data/migrations/versions/5.94/2024-09-03-20-09-40-null-analytics-jobs-timings.js +20 -0
  95. package/core/server/services/email-analytics/EmailAnalyticsServiceWrapper.js +49 -11
  96. package/core/server/services/email-analytics/lib/queries.js +154 -30
  97. package/core/server/services/oembed/service.js +2 -1
  98. package/package.json +150 -150
  99. package/yarn.lock +38 -38
  100. package/components/tryghost-adapter-cache-redis-5.93.0.tgz +0 -0
  101. package/components/tryghost-audience-feedback-5.93.0.tgz +0 -0
  102. package/components/tryghost-bookshelf-repository-5.93.0.tgz +0 -0
  103. package/components/tryghost-constants-5.93.0.tgz +0 -0
  104. package/components/tryghost-donations-5.93.0.tgz +0 -0
  105. package/components/tryghost-dynamic-routing-events-5.93.0.tgz +0 -0
  106. package/components/tryghost-email-analytics-provider-mailgun-5.93.0.tgz +0 -0
  107. package/components/tryghost-email-analytics-service-5.93.0.tgz +0 -0
  108. package/components/tryghost-email-events-5.93.0.tgz +0 -0
  109. package/components/tryghost-email-service-5.93.0.tgz +0 -0
  110. package/components/tryghost-email-suppression-list-5.93.0.tgz +0 -0
  111. package/components/tryghost-express-dynamic-redirects-5.93.0.tgz +0 -0
  112. package/components/tryghost-external-media-inliner-5.93.0.tgz +0 -0
  113. package/components/tryghost-extract-api-key-5.93.0.tgz +0 -0
  114. package/components/tryghost-ghost-5.93.0.tgz +0 -0
  115. package/components/tryghost-html-to-plaintext-5.93.0.tgz +0 -0
  116. package/components/tryghost-i18n-5.93.0.tgz +0 -0
  117. package/components/tryghost-importer-handler-content-files-5.93.0.tgz +0 -0
  118. package/components/tryghost-in-memory-repository-5.93.0.tgz +0 -0
  119. package/components/tryghost-link-replacer-5.93.0.tgz +0 -0
  120. package/components/tryghost-mailgun-client-5.93.0.tgz +0 -0
  121. package/components/tryghost-members-payments-5.93.0.tgz +0 -0
  122. package/components/tryghost-mentions-email-report-5.93.0.tgz +0 -0
  123. package/components/tryghost-minifier-5.93.0.tgz +0 -0
  124. package/components/tryghost-mw-api-version-mismatch-5.93.0.tgz +0 -0
  125. package/components/tryghost-mw-error-handler-5.93.0.tgz +0 -0
  126. package/components/tryghost-mw-update-user-last-seen-5.93.0.tgz +0 -0
  127. package/components/tryghost-mw-version-match-5.93.0.tgz +0 -0
  128. package/components/tryghost-mw-vhost-5.93.0.tgz +0 -0
  129. package/components/tryghost-nql-filter-expansions-5.93.0.tgz +0 -0
  130. package/components/tryghost-oembed-service-5.93.0.tgz +0 -0
  131. package/components/tryghost-package-json-5.93.0.tgz +0 -0
  132. package/components/tryghost-session-service-5.93.0.tgz +0 -0
  133. package/components/tryghost-slack-notifications-5.93.0.tgz +0 -0
  134. package/components/tryghost-stats-service-5.93.0.tgz +0 -0
  135. package/components/tryghost-tiers-5.93.0.tgz +0 -0
  136. package/components/tryghost-update-check-service-5.93.0.tgz +0 -0
  137. package/components/tryghost-webmentions-5.93.0.tgz +0 -0
  138. package/core/built/admin/assets/admin-x-activitypub/modals-62a088d9.mjs +0 -965
  139. package/core/built/admin/assets/ghost-8c20f019d522f17d318e799568924958.css +0 -1
  140. package/core/built/admin/assets/ghost-dark-b27530aaada81101d641ff1ca5f5df6b.css +0 -1
  141. /package/core/built/admin/assets/{chunk.217.2bd17b550359ea58831b.js.LICENSE.txt → chunk.785.78610bd253a9e2419ec9.js.LICENSE.txt} +0 -0
@@ -1,965 +0,0 @@
1
- import { c as A, j as i, u as $, a as se, b as B, d as M, e as Oe, f as Ue, g as E, R as De, h as R, C as U, i as T, k as ie, F as Be, l as V, m as W, n as Te, o as ze, H as z, p as qe, P as X, q as le, S as He, r as ce, s as Ke, t as Ge, v as Qe, w as de, x as Je, y as Ze, z as We, A as Xe, N as q, B as Y, M as ee, D as H, E as K, G as Ye, I as ue, J, K as fe } from "./index-5eac6af1.mjs";
2
- const me = ({ children: e, color: r, className: t, ...n }) => {
3
- if (!e)
4
- return null;
5
- let s = "text-grey-700 dark:text-grey-600";
6
- switch (r) {
7
- case "red":
8
- s = "text-red dark:text-red-500";
9
- break;
10
- case "green":
11
- s = "text-green dark:text-green-500";
12
- break;
13
- }
14
- return t = A(
15
- "mt-1 inline-block text-xs",
16
- s,
17
- t
18
- ), /* @__PURE__ */ i.jsx("span", { className: t, ...n, children: e });
19
- };
20
- function _() {
21
- return _ = Object.assign ? Object.assign.bind() : function(e) {
22
- for (var r = 1; r < arguments.length; r++) {
23
- var t = arguments[r];
24
- for (var n in t)
25
- Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
26
- }
27
- return e;
28
- }, _.apply(this, arguments);
29
- }
30
- function D(e, r, { checkForDefaultPrevented: t = !0 } = {}) {
31
- return function(s) {
32
- if (e == null || e(s), t === !1 || !s.defaultPrevented)
33
- return r == null ? void 0 : r(s);
34
- };
35
- }
36
- function et(e, r) {
37
- typeof e == "function" ? e(r) : e != null && (e.current = r);
38
- }
39
- function ve(...e) {
40
- return (r) => e.forEach(
41
- (t) => et(t, r)
42
- );
43
- }
44
- function he(...e) {
45
- return $(ve(...e), e);
46
- }
47
- function tt(e, r = []) {
48
- let t = [];
49
- function n(o, l) {
50
- const a = /* @__PURE__ */ se(l), c = t.length;
51
- t = [
52
- ...t,
53
- l
54
- ];
55
- function f(g) {
56
- const { scope: p, children: y, ...C } = g, w = (p == null ? void 0 : p[e][c]) || a, F = B(
57
- () => C,
58
- Object.values(C)
59
- );
60
- return /* @__PURE__ */ M(w.Provider, {
61
- value: F
62
- }, y);
63
- }
64
- function b(g, p) {
65
- const y = (p == null ? void 0 : p[e][c]) || a, C = Oe(y);
66
- if (C)
67
- return C;
68
- if (l !== void 0)
69
- return l;
70
- throw new Error(`\`${g}\` must be used within \`${o}\``);
71
- }
72
- return f.displayName = o + "Provider", [
73
- f,
74
- b
75
- ];
76
- }
77
- const s = () => {
78
- const o = t.map((l) => /* @__PURE__ */ se(l));
79
- return function(a) {
80
- const c = (a == null ? void 0 : a[e]) || o;
81
- return B(
82
- () => ({
83
- [`__scope${e}`]: {
84
- ...a,
85
- [e]: c
86
- }
87
- }),
88
- [
89
- a,
90
- c
91
- ]
92
- );
93
- };
94
- };
95
- return s.scopeName = e, [
96
- n,
97
- rt(s, ...r)
98
- ];
99
- }
100
- function rt(...e) {
101
- const r = e[0];
102
- if (e.length === 1)
103
- return r;
104
- const t = () => {
105
- const n = e.map(
106
- (s) => ({
107
- useScope: s(),
108
- scopeName: s.scopeName
109
- })
110
- );
111
- return function(o) {
112
- const l = n.reduce((a, { useScope: c, scopeName: f }) => {
113
- const g = c(o)[`__scope${f}`];
114
- return {
115
- ...a,
116
- ...g
117
- };
118
- }, {});
119
- return B(
120
- () => ({
121
- [`__scope${r.scopeName}`]: l
122
- }),
123
- [
124
- l
125
- ]
126
- );
127
- };
128
- };
129
- return t.scopeName = r.scopeName, t;
130
- }
131
- const nt = globalThis != null && globalThis.document ? Ue : () => {
132
- }, st = De["useId".toString()] || (() => {
133
- });
134
- let ot = 0;
135
- function at(e) {
136
- const [r, t] = E(st());
137
- return nt(() => {
138
- e || t(
139
- (n) => n ?? String(ot++)
140
- );
141
- }, [
142
- e
143
- ]), e || (r ? `radix-${r}` : "");
144
- }
145
- const pe = /* @__PURE__ */ R((e, r) => {
146
- const { children: t, ...n } = e, s = U.toArray(t), o = s.find(lt);
147
- if (o) {
148
- const l = o.props.children, a = s.map((c) => c === o ? U.count(l) > 1 ? U.only(null) : /* @__PURE__ */ T(l) ? l.props.children : null : c);
149
- return /* @__PURE__ */ M(Z, _({}, n, {
150
- ref: r
151
- }), /* @__PURE__ */ T(l) ? /* @__PURE__ */ ie(l, void 0, a) : null);
152
- }
153
- return /* @__PURE__ */ M(Z, _({}, n, {
154
- ref: r
155
- }), t);
156
- });
157
- pe.displayName = "Slot";
158
- const Z = /* @__PURE__ */ R((e, r) => {
159
- const { children: t, ...n } = e;
160
- return /* @__PURE__ */ T(t) ? /* @__PURE__ */ ie(t, {
161
- ...ct(n, t.props),
162
- ref: r ? ve(r, t.ref) : t.ref
163
- }) : U.count(t) > 1 ? U.only(null) : null;
164
- });
165
- Z.displayName = "SlotClone";
166
- const it = ({ children: e }) => /* @__PURE__ */ M(Be, null, e);
167
- function lt(e) {
168
- return /* @__PURE__ */ T(e) && e.type === it;
169
- }
170
- function ct(e, r) {
171
- const t = {
172
- ...r
173
- };
174
- for (const n in r) {
175
- const s = e[n], o = r[n];
176
- /^on[A-Z]/.test(n) ? s && o ? t[n] = (...a) => {
177
- o(...a), s(...a);
178
- } : s && (t[n] = s) : n === "style" ? t[n] = {
179
- ...s,
180
- ...o
181
- } : n === "className" && (t[n] = [
182
- s,
183
- o
184
- ].filter(Boolean).join(" "));
185
- }
186
- return {
187
- ...e,
188
- ...t
189
- };
190
- }
191
- const dt = [
192
- "a",
193
- "button",
194
- "div",
195
- "form",
196
- "h2",
197
- "h3",
198
- "img",
199
- "input",
200
- "label",
201
- "li",
202
- "nav",
203
- "ol",
204
- "p",
205
- "span",
206
- "svg",
207
- "ul"
208
- ], te = dt.reduce((e, r) => {
209
- const t = /* @__PURE__ */ R((n, s) => {
210
- const { asChild: o, ...l } = n, a = o ? pe : r;
211
- return V(() => {
212
- window[Symbol.for("radix-ui")] = !0;
213
- }, []), /* @__PURE__ */ M(a, _({}, l, {
214
- ref: s
215
- }));
216
- });
217
- return t.displayName = `Primitive.${r}`, {
218
- ...e,
219
- [r]: t
220
- };
221
- }, {}), [re, Zt] = tt("Form"), ge = "Form", [ut, xe] = re(ge), [ft, mt] = re(ge), vt = /* @__PURE__ */ R((e, r) => {
222
- const { __scopeForm: t, onClearServerErrors: n = () => {
223
- }, ...s } = e, o = W(null), l = he(r, o), [a, c] = E({}), f = $(
224
- (u) => a[u],
225
- [
226
- a
227
- ]
228
- ), b = $(
229
- (u, m) => c((v) => {
230
- var h;
231
- return {
232
- ...v,
233
- [u]: {
234
- ...(h = v[u]) !== null && h !== void 0 ? h : {},
235
- ...m
236
- }
237
- };
238
- }),
239
- []
240
- ), g = $((u) => {
241
- c(
242
- (m) => ({
243
- ...m,
244
- [u]: void 0
245
- })
246
- ), d(
247
- (m) => ({
248
- ...m,
249
- [u]: {}
250
- })
251
- );
252
- }, []), [p, y] = E({}), C = $((u) => {
253
- var m;
254
- return (m = p[u]) !== null && m !== void 0 ? m : [];
255
- }, [
256
- p
257
- ]), w = $((u, m) => {
258
- y((v) => {
259
- var h;
260
- return {
261
- ...v,
262
- [u]: [
263
- ...(h = v[u]) !== null && h !== void 0 ? h : [],
264
- m
265
- ]
266
- };
267
- });
268
- }, []), F = $((u, m) => {
269
- y((v) => {
270
- var h;
271
- return {
272
- ...v,
273
- [u]: ((h = v[u]) !== null && h !== void 0 ? h : []).filter(
274
- (L) => L.id !== m
275
- )
276
- };
277
- });
278
- }, []), [S, d] = E({}), x = $((u) => {
279
- var m;
280
- return (m = S[u]) !== null && m !== void 0 ? m : {};
281
- }, [
282
- S
283
- ]), j = $((u, m) => {
284
- d((v) => {
285
- var h;
286
- return {
287
- ...v,
288
- [u]: {
289
- ...(h = v[u]) !== null && h !== void 0 ? h : {},
290
- ...m
291
- }
292
- };
293
- });
294
- }, []), [I, k] = E({}), O = $((u, m) => {
295
- k((v) => {
296
- const h = new Set(v[u]).add(m);
297
- return {
298
- ...v,
299
- [u]: h
300
- };
301
- });
302
- }, []), P = $((u, m) => {
303
- k((v) => {
304
- const h = new Set(v[u]);
305
- return h.delete(m), {
306
- ...v,
307
- [u]: h
308
- };
309
- });
310
- }, []), N = $((u) => {
311
- var m;
312
- return Array.from((m = I[u]) !== null && m !== void 0 ? m : []).join(" ") || void 0;
313
- }, [
314
- I
315
- ]);
316
- return /* @__PURE__ */ M(ut, {
317
- scope: t,
318
- getFieldValidity: f,
319
- onFieldValidityChange: b,
320
- getFieldCustomMatcherEntries: C,
321
- onFieldCustomMatcherEntryAdd: w,
322
- onFieldCustomMatcherEntryRemove: F,
323
- getFieldCustomErrors: x,
324
- onFieldCustomErrorsChange: j,
325
- onFieldValiditionClear: g
326
- }, /* @__PURE__ */ M(ft, {
327
- scope: t,
328
- onFieldMessageIdAdd: O,
329
- onFieldMessageIdRemove: P,
330
- getFieldDescription: N
331
- }, /* @__PURE__ */ M(te.form, _({}, s, {
332
- ref: l,
333
- onInvalid: D(e.onInvalid, (u) => {
334
- const m = be(u.currentTarget);
335
- m === u.target && m.focus(), u.preventDefault();
336
- }),
337
- onSubmit: D(e.onSubmit, n, {
338
- checkForDefaultPrevented: !1
339
- }),
340
- onReset: D(e.onReset, n)
341
- }))));
342
- }), $e = "FormField", [ht, pt] = re($e), gt = /* @__PURE__ */ R((e, r) => {
343
- const { __scopeForm: t, name: n, serverInvalid: s = !1, ...o } = e, a = xe($e, t).getFieldValidity(n), c = at();
344
- return /* @__PURE__ */ M(ht, {
345
- scope: t,
346
- id: c,
347
- name: n,
348
- serverInvalid: s
349
- }, /* @__PURE__ */ M(te.div, _({
350
- "data-valid": ye(a, s),
351
- "data-invalid": Ce(a, s)
352
- }, o, {
353
- ref: r
354
- })));
355
- }), G = "FormControl", xt = /* @__PURE__ */ R((e, r) => {
356
- const { __scopeForm: t, ...n } = e, s = xe(G, t), o = pt(G, t), l = mt(G, t), a = W(null), c = he(r, a), f = n.name || o.name, b = n.id || o.id, g = s.getFieldCustomMatcherEntries(f), { onFieldValidityChange: p, onFieldCustomErrorsChange: y, onFieldValiditionClear: C } = s, w = $(async (d) => {
357
- if (jt(d.validity)) {
358
- const v = Q(d.validity);
359
- p(f, v);
360
- return;
361
- }
362
- const x = d.form ? new FormData(d.form) : new FormData(), j = [
363
- d.value,
364
- x
365
- ], I = [], k = [];
366
- g.forEach((v) => {
367
- Ct(v, j) ? k.push(v) : wt(v) && I.push(v);
368
- });
369
- const O = I.map(({ id: v, match: h }) => [
370
- v,
371
- h(...j)
372
- ]), P = Object.fromEntries(O), N = Object.values(P).some(Boolean), u = N;
373
- d.setCustomValidity(u ? oe : "");
374
- const m = Q(d.validity);
375
- if (p(f, m), y(f, P), !N && k.length > 0) {
376
- const v = k.map(
377
- ({ id: Ne, match: Ve }) => Ve(...j).then(
378
- (Pe) => [
379
- Ne,
380
- Pe
381
- ]
382
- )
383
- ), h = await Promise.all(v), L = Object.fromEntries(h), Le = Object.values(L).some(Boolean);
384
- d.setCustomValidity(Le ? oe : "");
385
- const _e = Q(d.validity);
386
- p(f, _e), y(f, L);
387
- }
388
- }, [
389
- g,
390
- f,
391
- y,
392
- p
393
- ]);
394
- V(() => {
395
- const d = a.current;
396
- if (d) {
397
- const x = () => w(d);
398
- return d.addEventListener("change", x), () => d.removeEventListener("change", x);
399
- }
400
- }, [
401
- w
402
- ]);
403
- const F = $(() => {
404
- const d = a.current;
405
- d && (d.setCustomValidity(""), C(f));
406
- }, [
407
- f,
408
- C
409
- ]);
410
- V(() => {
411
- var d;
412
- const x = (d = a.current) === null || d === void 0 ? void 0 : d.form;
413
- if (x)
414
- return x.addEventListener("reset", F), () => x.removeEventListener("reset", F);
415
- }, [
416
- F
417
- ]), V(() => {
418
- const d = a.current, x = d == null ? void 0 : d.closest("form");
419
- if (x && o.serverInvalid) {
420
- const j = be(x);
421
- j === d && j.focus();
422
- }
423
- }, [
424
- o.serverInvalid
425
- ]);
426
- const S = s.getFieldValidity(f);
427
- return /* @__PURE__ */ M(te.input, _({
428
- "data-valid": ye(S, o.serverInvalid),
429
- "data-invalid": Ce(S, o.serverInvalid),
430
- "aria-invalid": o.serverInvalid ? !0 : void 0,
431
- "aria-describedby": l.getFieldDescription(f),
432
- title: ""
433
- }, n, {
434
- ref: c,
435
- id: b,
436
- name: f,
437
- onInvalid: D(e.onInvalid, (d) => {
438
- const x = d.currentTarget;
439
- w(x);
440
- }),
441
- onChange: D(e.onChange, (d) => {
442
- F();
443
- })
444
- }));
445
- }), oe = "This value is not valid";
446
- function Q(e) {
447
- const r = {};
448
- for (const t in e)
449
- r[t] = e[t];
450
- return r;
451
- }
452
- function $t(e) {
453
- return e instanceof HTMLElement;
454
- }
455
- function bt(e) {
456
- return "validity" in e;
457
- }
458
- function yt(e) {
459
- return bt(e) && (e.validity.valid === !1 || e.getAttribute("aria-invalid") === "true");
460
- }
461
- function be(e) {
462
- const r = e.elements, [t] = Array.from(r).filter($t).filter(yt);
463
- return t;
464
- }
465
- function Ct(e, r) {
466
- return e.match.constructor.name === "AsyncFunction" || Ft(e.match, r);
467
- }
468
- function wt(e) {
469
- return e.match.constructor.name === "Function";
470
- }
471
- function Ft(e, r) {
472
- return e(...r) instanceof Promise;
473
- }
474
- function jt(e) {
475
- let r = !1;
476
- for (const t in e) {
477
- const n = t;
478
- if (n !== "valid" && n !== "customError" && e[n]) {
479
- r = !0;
480
- break;
481
- }
482
- }
483
- return r;
484
- }
485
- function ye(e, r) {
486
- if ((e == null ? void 0 : e.valid) === !0 && !r)
487
- return !0;
488
- }
489
- function Ce(e, r) {
490
- if ((e == null ? void 0 : e.valid) === !1 || r)
491
- return !0;
492
- }
493
- const ae = vt, Et = gt, Mt = xt, St = ({
494
- type: e = "text",
495
- inputRef: r,
496
- title: t,
497
- hideTitle: n,
498
- value: s,
499
- error: o,
500
- placeholder: l,
501
- rightPlaceholder: a,
502
- hint: c,
503
- onChange: f,
504
- onFocus: b,
505
- onBlur: g,
506
- clearBg: p = !1,
507
- className: y = "",
508
- maxLength: C,
509
- containerClassName: w = "",
510
- hintClassName: F = "",
511
- unstyled: S = !1,
512
- disabled: d,
513
- ...x
514
- }) => {
515
- const j = Te(), { setFocusState: I } = ze(), k = (L) => {
516
- b == null || b(L), I(!0);
517
- }, O = (L) => {
518
- g == null || g(L), I(!1);
519
- }, P = A(
520
- "relative order-2 flex w-full items-center",
521
- t && !n && "mt-1.5"
522
- ), N = !S && A(
523
- "absolute inset-0 rounded-lg border text-grey-300 transition-colors peer-hover:bg-grey-100 peer-focus:border-green peer-focus:bg-white peer-focus:shadow-[0_0_0_2px_rgba(48,207,67,.25)] dark:peer-hover:bg-grey-925 dark:peer-focus:bg-grey-950",
524
- o ? "border-red bg-white dark:bg-grey-925" : "border-transparent bg-grey-150 dark:bg-grey-900",
525
- d && "bg-grey-50 peer-hover:bg-grey-50 dark:bg-grey-950 dark:peer-hover:bg-grey-950"
526
- ), u = !S && A(
527
- "peer z-[1] order-2 h-9 w-full bg-transparent px-3 py-1.5 text-sm placeholder:text-grey-500 dark:placeholder:text-grey-700 md:h-[38px] md:py-2 md:text-md",
528
- d ? "cursor-not-allowed text-grey-600 opacity-60 dark:text-grey-800" : "dark:text-white",
529
- a ? "w-0 grow rounded-l-lg" : "rounded-lg",
530
- y
531
- ), m = !S && A(
532
- "z-[1] order-3 rounded-r-lg",
533
- a ? typeof a == "string" ? "flex h-8 items-center py-1 pr-3 text-right text-sm text-grey-500 md:h-9 md:text-base" : "h-9 pr-1" : "pr-2"
534
- );
535
- let v = /* @__PURE__ */ i.jsx(i.Fragment, {});
536
- const h = /* @__PURE__ */ i.jsx(
537
- "input",
538
- {
539
- ref: r,
540
- className: u || y,
541
- disabled: d,
542
- id: j,
543
- maxLength: C,
544
- placeholder: l,
545
- type: e,
546
- value: s,
547
- onBlur: O,
548
- onChange: f,
549
- onFocus: k,
550
- ...x
551
- }
552
- );
553
- return v = /* @__PURE__ */ i.jsx(Et, { name: j, asChild: !0, children: /* @__PURE__ */ i.jsxs("div", { className: P, children: [
554
- /* @__PURE__ */ i.jsx(Mt, { asChild: !0, children: h }),
555
- !S && !p && /* @__PURE__ */ i.jsx("div", { className: N || "" }),
556
- a && /* @__PURE__ */ i.jsx("span", { className: m || "", children: a })
557
- ] }) }), F = A(
558
- "order-3",
559
- F
560
- ), w = A(
561
- "flex flex-col",
562
- w
563
- ), t || c ? /* @__PURE__ */ i.jsx(ae, { asChild: !0, children: /* @__PURE__ */ i.jsxs("div", { className: w, children: [
564
- v,
565
- t && /* @__PURE__ */ i.jsx(z, { className: n ? "sr-only" : "order-1", htmlFor: j, useLabelTag: !0, children: t }),
566
- c && /* @__PURE__ */ i.jsx(me, { className: F, color: o ? "red" : "default", children: c })
567
- ] }) }) : /* @__PURE__ */ i.jsx(ae, { asChild: !0, children: v });
568
- };
569
- function At(e) {
570
- const r = W(e);
571
- return V(() => {
572
- r.current = e;
573
- }), B(() => (...t) => {
574
- var n;
575
- return (n = r.current) == null ? void 0 : n.call(r, ...t);
576
- }, []);
577
- }
578
- var ne = "Avatar", [Rt, Wt] = qe(ne), [It, we] = Rt(ne), Fe = R(
579
- (e, r) => {
580
- const { __scopeAvatar: t, ...n } = e, [s, o] = E("idle");
581
- return /* @__PURE__ */ i.jsx(
582
- It,
583
- {
584
- scope: t,
585
- imageLoadingStatus: s,
586
- onImageLoadingStatusChange: o,
587
- children: /* @__PURE__ */ i.jsx(X.span, { ...n, ref: r })
588
- }
589
- );
590
- }
591
- );
592
- Fe.displayName = ne;
593
- var je = "AvatarImage", Ee = R(
594
- (e, r) => {
595
- const { __scopeAvatar: t, src: n, onLoadingStatusChange: s = () => {
596
- }, ...o } = e, l = we(je, t), a = kt(n), c = At((f) => {
597
- s(f), l.onImageLoadingStatusChange(f);
598
- });
599
- return le(() => {
600
- a !== "idle" && c(a);
601
- }, [a, c]), a === "loaded" ? /* @__PURE__ */ i.jsx(X.img, { ...o, ref: r, src: n }) : null;
602
- }
603
- );
604
- Ee.displayName = je;
605
- var Me = "AvatarFallback", Se = R(
606
- (e, r) => {
607
- const { __scopeAvatar: t, delayMs: n, ...s } = e, o = we(Me, t), [l, a] = E(n === void 0);
608
- return V(() => {
609
- if (n !== void 0) {
610
- const c = window.setTimeout(() => a(!0), n);
611
- return () => window.clearTimeout(c);
612
- }
613
- }, [n]), l && o.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ i.jsx(X.span, { ...s, ref: r }) : null;
614
- }
615
- );
616
- Se.displayName = Me;
617
- function kt(e) {
618
- const [r, t] = E("idle");
619
- return le(() => {
620
- if (!e) {
621
- t("error");
622
- return;
623
- }
624
- let n = !0;
625
- const s = new window.Image(), o = (l) => () => {
626
- n && t(l);
627
- };
628
- return t("loading"), s.onload = o("loaded"), s.onerror = o("error"), s.src = e, () => {
629
- n = !1;
630
- };
631
- }, [e]), r;
632
- }
633
- var Lt = Fe, _t = Ee, Nt = Se;
634
- const Ae = ({ image: e, label: r, labelColor: t, bgColor: n, size: s, className: o }) => {
635
- let l = "", a = " -mb-2 ";
636
- switch (s) {
637
- case "sm":
638
- l = " w-7 h-7 text-sm ";
639
- break;
640
- case "lg":
641
- l = " w-12 h-12 text-xl ";
642
- break;
643
- case "xl":
644
- l = " w-16 h-16 text-2xl ", a = " -mb-3 ";
645
- break;
646
- case "2xl":
647
- l = " w-20 h-20 text-2xl ", a = " -mb-3 ";
648
- break;
649
- default:
650
- l = " w-10 h-10 text-md ";
651
- break;
652
- }
653
- return /* @__PURE__ */ i.jsxs(Lt, { className: `relative inline-flex select-none items-center justify-center overflow-hidden rounded-full align-middle ${l}`, children: [
654
- e ? /* @__PURE__ */ i.jsx(_t, { className: `absolute z-20 h-full w-full object-cover ${o && o}`, src: e }) : /* @__PURE__ */ i.jsx("span", { className: `${t && `text-${t}`} relative z-10 inline-flex h-full w-full items-center justify-center p-2 font-semibold ${o && o}`, style: n ? { backgroundColor: n } : {}, children: r }),
655
- /* @__PURE__ */ i.jsx(Nt, { asChild: !0, children: /* @__PURE__ */ i.jsx(He, { className: `${a} absolute z-0 h-full w-full text-grey-300` }) })
656
- ] });
657
- }, Vt = ({
658
- title: e,
659
- titleSize: r = "sm",
660
- actions: t,
661
- titleSeparator: n
662
- }) => {
663
- let s;
664
- if (e) {
665
- const o = r === "sm" ? /* @__PURE__ */ i.jsx(z, { grey: !0, level: 6, children: e }) : /* @__PURE__ */ i.jsx(z, { level: 5, children: e });
666
- s = t ? /* @__PURE__ */ i.jsxs("div", { className: "flex items-end justify-between gap-2", children: [
667
- o,
668
- t
669
- ] }) : o;
670
- }
671
- return s || n ? /* @__PURE__ */ i.jsxs("div", { className: "flex flex-col items-stretch gap-1", children: [
672
- s,
673
- n && /* @__PURE__ */ i.jsx(ce, {})
674
- ] }) : /* @__PURE__ */ i.jsx(i.Fragment, {});
675
- }, Re = ({
676
- title: e,
677
- titleSeparator: r = !0,
678
- titleSize: t = "sm",
679
- children: n,
680
- actions: s,
681
- hint: o,
682
- hintSeparator: l = !0,
683
- borderTop: a,
684
- pageTitle: c,
685
- className: f
686
- }) => {
687
- const b = A(
688
- (a || c) && "border-t border-grey-300",
689
- c && "mt-5",
690
- f
691
- );
692
- return /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
693
- c && /* @__PURE__ */ i.jsx(z, { children: c }),
694
- /* @__PURE__ */ i.jsxs("section", { className: b, children: [
695
- e && /* @__PURE__ */ i.jsx(Vt, { actions: s, title: e, titleSeparator: !c && r && !a, titleSize: t }),
696
- /* @__PURE__ */ i.jsx("div", { className: "flex flex-col", children: n }),
697
- o && /* @__PURE__ */ i.jsxs("div", { className: "-mt-px", children: [
698
- l && /* @__PURE__ */ i.jsx(ce, {}),
699
- /* @__PURE__ */ i.jsx(me, { children: o })
700
- ] })
701
- ] })
702
- ] });
703
- }, Ie = ({
704
- id: e,
705
- title: r,
706
- detail: t,
707
- action: n,
708
- hideActions: s,
709
- avatar: o,
710
- className: l,
711
- testId: a,
712
- separator: c = !0,
713
- bgOnHover: f = !0,
714
- paddingRight: b = !0,
715
- onClick: g,
716
- children: p
717
- }) => {
718
- const y = (w) => {
719
- g == null || g(w);
720
- }, C = A(
721
- "group/list-item flex items-center justify-between",
722
- f && "hover:bg-gradient-to-r hover:from-white hover:to-grey-50 dark:hover:from-black dark:hover:to-grey-950",
723
- c ? "border-b border-grey-100 last-of-type:border-b-transparent hover:border-grey-200 dark:border-grey-900 dark:hover:border-grey-800" : "border-y border-transparent hover:border-grey-200 first-of-type:hover:border-t-transparent dark:hover:border-grey-800",
724
- l
725
- );
726
- return /* @__PURE__ */ i.jsxs("div", { className: C, "data-testid": a, children: [
727
- p || /* @__PURE__ */ i.jsxs("div", { className: `flex grow items-center gap-3 ${g && "cursor-pointer"}`, onClick: y, children: [
728
- o && o,
729
- /* @__PURE__ */ i.jsxs("div", { className: "flex grow flex-col py-3 pr-6", id: e, children: [
730
- /* @__PURE__ */ i.jsx("span", { children: r }),
731
- t && /* @__PURE__ */ i.jsx("span", { className: "text-xs text-grey-700", children: t })
732
- ] })
733
- ] }),
734
- n && /* @__PURE__ */ i.jsx("div", { className: `visible py-3 md:pl-6 ${b && "md:pr-6"} ${s ? "group-hover/list-item:visible md:invisible" : ""}`, children: n })
735
- ] });
736
- };
737
- class Pt extends Ke {
738
- constructor(r, t) {
739
- super(), this.client = r, this.setOptions(t), this.bindMethods(), this.updateResult();
740
- }
741
- bindMethods() {
742
- this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this);
743
- }
744
- setOptions(r) {
745
- var t;
746
- const n = this.options;
747
- this.options = this.client.defaultMutationOptions(r), Ge(n, this.options) || this.client.getMutationCache().notify({
748
- type: "observerOptionsUpdated",
749
- mutation: this.currentMutation,
750
- observer: this
751
- }), (t = this.currentMutation) == null || t.setOptions(this.options);
752
- }
753
- onUnsubscribe() {
754
- if (!this.hasListeners()) {
755
- var r;
756
- (r = this.currentMutation) == null || r.removeObserver(this);
757
- }
758
- }
759
- onMutationUpdate(r) {
760
- this.updateResult();
761
- const t = {
762
- listeners: !0
763
- };
764
- r.type === "success" ? t.onSuccess = !0 : r.type === "error" && (t.onError = !0), this.notify(t);
765
- }
766
- getCurrentResult() {
767
- return this.currentResult;
768
- }
769
- reset() {
770
- this.currentMutation = void 0, this.updateResult(), this.notify({
771
- listeners: !0
772
- });
773
- }
774
- mutate(r, t) {
775
- return this.mutateOptions = t, this.currentMutation && this.currentMutation.removeObserver(this), this.currentMutation = this.client.getMutationCache().build(this.client, {
776
- ...this.options,
777
- variables: typeof r < "u" ? r : this.options.variables
778
- }), this.currentMutation.addObserver(this), this.currentMutation.execute();
779
- }
780
- updateResult() {
781
- const r = this.currentMutation ? this.currentMutation.state : Qe(), t = {
782
- ...r,
783
- isLoading: r.status === "loading",
784
- isSuccess: r.status === "success",
785
- isError: r.status === "error",
786
- isIdle: r.status === "idle",
787
- mutate: this.mutate,
788
- reset: this.reset
789
- };
790
- this.currentResult = t;
791
- }
792
- notify(r) {
793
- de.batch(() => {
794
- if (this.mutateOptions && this.hasListeners()) {
795
- if (r.onSuccess) {
796
- var t, n, s, o;
797
- (t = (n = this.mutateOptions).onSuccess) == null || t.call(n, this.currentResult.data, this.currentResult.variables, this.currentResult.context), (s = (o = this.mutateOptions).onSettled) == null || s.call(o, this.currentResult.data, null, this.currentResult.variables, this.currentResult.context);
798
- } else if (r.onError) {
799
- var l, a, c, f;
800
- (l = (a = this.mutateOptions).onError) == null || l.call(a, this.currentResult.error, this.currentResult.variables, this.currentResult.context), (c = (f = this.mutateOptions).onSettled) == null || c.call(f, void 0, this.currentResult.error, this.currentResult.variables, this.currentResult.context);
801
- }
802
- }
803
- r.listeners && this.listeners.forEach(({
804
- listener: b
805
- }) => {
806
- b(this.currentResult);
807
- });
808
- });
809
- }
810
- }
811
- function ke(e, r, t) {
812
- const n = Je(e, r, t), s = Ze({
813
- context: n.context
814
- }), [o] = E(() => new Pt(s, n));
815
- V(() => {
816
- o.setOptions(n);
817
- }, [o, n]);
818
- const l = We($((c) => o.subscribe(de.batchCalls(c)), [o]), () => o.getCurrentResult(), () => o.getCurrentResult()), a = $((c, f) => {
819
- o.mutate(c, f).catch(Ot);
820
- }, [o]);
821
- if (l.error && Xe(o.options.useErrorBoundary, [l.error]))
822
- throw l.error;
823
- return {
824
- ...l,
825
- mutate: a,
826
- mutateAsync: l.mutate
827
- };
828
- }
829
- function Ot() {
830
- }
831
- function Ut(e, r, t) {
832
- var a;
833
- const s = (a = H().data) == null ? void 0 : a.site, o = (s == null ? void 0 : s.url) ?? window.location.origin, l = new K(
834
- new URL(o),
835
- new URL("/ghost/api/admin/identities/", window.location.origin),
836
- e
837
- );
838
- return ke({
839
- async mutationFn(c) {
840
- return l.follow(c);
841
- },
842
- onSuccess: r,
843
- onError: t
844
- });
845
- }
846
- const Dt = q.create(() => {
847
- const { updateRoute: e } = Y(), r = q.useModal(), [t, n] = E(""), [s, o] = E(null);
848
- async function l() {
849
- Ye({
850
- message: "Site followed",
851
- type: "success"
852
- }), r.remove(), e("");
853
- }
854
- async function a() {
855
- o(s);
856
- }
857
- const c = Ut("index", l, a);
858
- return /* @__PURE__ */ i.jsx(
859
- ee,
860
- {
861
- afterClose: () => {
862
- c.reset(), e("");
863
- },
864
- cancelLabel: "Cancel",
865
- okLabel: "Follow",
866
- size: "sm",
867
- title: "Follow a Ghost site",
868
- onOk: () => c.mutate(t),
869
- children: /* @__PURE__ */ i.jsx("div", { className: "mt-3 flex flex-col gap-4", children: /* @__PURE__ */ i.jsx(
870
- St,
871
- {
872
- autoFocus: !0,
873
- error: !!s,
874
- hint: s,
875
- placeholder: "@username@hostname",
876
- title: "Profile name",
877
- value: t,
878
- "data-test-new-follower": !0,
879
- onChange: (f) => n(f.target.value)
880
- }
881
- ) })
882
- }
883
- );
884
- });
885
- function Bt(e) {
886
- var o;
887
- const t = (o = H().data) == null ? void 0 : o.site, n = (t == null ? void 0 : t.url) ?? window.location.origin, s = new K(
888
- new URL(n),
889
- new URL("/ghost/api/admin/identities/", window.location.origin),
890
- e
891
- );
892
- return fe({
893
- queryKey: [`followers:${e}`],
894
- async queryFn() {
895
- return s.getFollowers();
896
- }
897
- });
898
- }
899
- function Tt(e) {
900
- var o;
901
- const t = (o = H().data) == null ? void 0 : o.site, n = (t == null ? void 0 : t.url) ?? window.location.origin, s = new K(
902
- new URL(n),
903
- new URL("/ghost/api/admin/identities/", window.location.origin),
904
- e
905
- );
906
- return ke({
907
- async mutationFn(l) {
908
- return s.follow(l);
909
- }
910
- });
911
- }
912
- const zt = ({}) => {
913
- const { updateRoute: e } = Y(), r = Tt("index"), { data: t = [] } = Bt("index"), n = Array.isArray(t) ? t : [t];
914
- return /* @__PURE__ */ i.jsx(
915
- ee,
916
- {
917
- afterClose: () => {
918
- r.reset(), e("profile");
919
- },
920
- cancelLabel: "",
921
- footer: !1,
922
- okLabel: "",
923
- size: "md",
924
- title: "Followers",
925
- topRightContent: "close",
926
- children: /* @__PURE__ */ i.jsx("div", { className: "mt-3 flex flex-col gap-4 pb-12", children: /* @__PURE__ */ i.jsx(Re, { children: n.map((s) => /* @__PURE__ */ i.jsx(Ie, { action: /* @__PURE__ */ i.jsx(ue, { color: "grey", label: "Follow back", link: !0, onClick: () => r.mutate(J(s)) }), avatar: /* @__PURE__ */ i.jsx(Ae, { image: s.icon, size: "sm" }), detail: J(s), id: "list-item", title: s.name })) }) })
927
- }
928
- );
929
- }, qt = q.create(zt);
930
- function Ht(e) {
931
- var o;
932
- const t = (o = H().data) == null ? void 0 : o.site, n = (t == null ? void 0 : t.url) ?? window.location.origin, s = new K(
933
- new URL(n),
934
- new URL("/ghost/api/admin/identities/", window.location.origin),
935
- e
936
- );
937
- return fe({
938
- queryKey: [`following:${e}`],
939
- async queryFn() {
940
- return s.getFollowing();
941
- }
942
- });
943
- }
944
- const Kt = ({}) => {
945
- const { updateRoute: e } = Y(), { data: r = [] } = Ht("index"), t = Array.isArray(r) ? r : [r];
946
- return /* @__PURE__ */ i.jsx(
947
- ee,
948
- {
949
- afterClose: () => {
950
- e("profile");
951
- },
952
- cancelLabel: "",
953
- footer: !1,
954
- okLabel: "",
955
- size: "md",
956
- title: "Following",
957
- topRightContent: "close",
958
- children: /* @__PURE__ */ i.jsx("div", { className: "mt-3 flex flex-col gap-4 pb-12", children: /* @__PURE__ */ i.jsx(Re, { children: t.map((n) => /* @__PURE__ */ i.jsx(Ie, { action: /* @__PURE__ */ i.jsx(ue, { color: "grey", label: "Unfollow", link: !0 }), avatar: /* @__PURE__ */ i.jsx(Ae, { image: n.icon, size: "sm" }), detail: J(n), id: "list-item", title: n.name })) }) })
959
- }
960
- );
961
- }, Gt = q.create(Kt), Xt = { FollowSite: Dt, ViewFollowing: Gt, ViewFollowers: qt };
962
- export {
963
- Xt as default
964
- };
965
- //# sourceMappingURL=modals-62a088d9.mjs.map