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