ghost 5.88.1 → 5.88.2

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 (147) hide show
  1. package/components/tryghost-adapter-cache-memory-ttl-5.88.2.tgz +0 -0
  2. package/components/{tryghost-adapter-cache-redis-5.88.1.tgz → tryghost-adapter-cache-redis-5.88.2.tgz} +0 -0
  3. package/components/{tryghost-adapter-manager-5.88.1.tgz → tryghost-adapter-manager-5.88.2.tgz} +0 -0
  4. package/components/{tryghost-announcement-bar-settings-5.88.1.tgz → tryghost-announcement-bar-settings-5.88.2.tgz} +0 -0
  5. package/components/tryghost-api-framework-5.88.2.tgz +0 -0
  6. package/components/{tryghost-api-version-compatibility-service-5.88.1.tgz → tryghost-api-version-compatibility-service-5.88.2.tgz} +0 -0
  7. package/components/tryghost-audience-feedback-5.88.2.tgz +0 -0
  8. package/components/tryghost-bookshelf-repository-5.88.2.tgz +0 -0
  9. package/components/tryghost-bootstrap-socket-5.88.2.tgz +0 -0
  10. package/components/tryghost-collections-5.88.2.tgz +0 -0
  11. package/components/{tryghost-constants-5.88.1.tgz → tryghost-constants-5.88.2.tgz} +0 -0
  12. package/components/{tryghost-custom-theme-settings-service-5.88.1.tgz → tryghost-custom-theme-settings-service-5.88.2.tgz} +0 -0
  13. package/components/{tryghost-data-generator-5.88.1.tgz → tryghost-data-generator-5.88.2.tgz} +0 -0
  14. package/components/tryghost-domain-events-5.88.2.tgz +0 -0
  15. package/components/tryghost-donations-5.88.2.tgz +0 -0
  16. package/components/tryghost-dynamic-routing-events-5.88.2.tgz +0 -0
  17. package/components/{tryghost-email-addresses-5.88.1.tgz → tryghost-email-addresses-5.88.2.tgz} +0 -0
  18. package/components/{tryghost-email-analytics-provider-mailgun-5.88.1.tgz → tryghost-email-analytics-provider-mailgun-5.88.2.tgz} +0 -0
  19. package/components/tryghost-email-analytics-service-5.88.2.tgz +0 -0
  20. package/components/tryghost-email-content-generator-5.88.2.tgz +0 -0
  21. package/components/{tryghost-email-events-5.88.1.tgz → tryghost-email-events-5.88.2.tgz} +0 -0
  22. package/components/{tryghost-email-service-5.88.1.tgz → tryghost-email-service-5.88.2.tgz} +0 -0
  23. package/components/tryghost-email-suppression-list-5.88.2.tgz +0 -0
  24. package/components/tryghost-express-dynamic-redirects-5.88.2.tgz +0 -0
  25. package/components/tryghost-external-media-inliner-5.88.2.tgz +0 -0
  26. package/components/tryghost-extract-api-key-5.88.2.tgz +0 -0
  27. package/components/tryghost-ghost-5.88.2.tgz +0 -0
  28. package/components/tryghost-html-to-plaintext-5.88.2.tgz +0 -0
  29. package/components/tryghost-i18n-5.88.2.tgz +0 -0
  30. package/components/tryghost-importer-handler-content-files-5.88.2.tgz +0 -0
  31. package/components/{tryghost-importer-revue-5.88.1.tgz → tryghost-importer-revue-5.88.2.tgz} +0 -0
  32. package/components/tryghost-in-memory-repository-5.88.2.tgz +0 -0
  33. package/components/{tryghost-job-manager-5.88.1.tgz → tryghost-job-manager-5.88.2.tgz} +0 -0
  34. package/components/tryghost-link-redirects-5.88.2.tgz +0 -0
  35. package/components/tryghost-link-replacer-5.88.2.tgz +0 -0
  36. package/components/tryghost-link-tracking-5.88.2.tgz +0 -0
  37. package/components/tryghost-magic-link-5.88.2.tgz +0 -0
  38. package/components/{tryghost-mail-events-5.88.1.tgz → tryghost-mail-events-5.88.2.tgz} +0 -0
  39. package/components/{tryghost-mailgun-client-5.88.1.tgz → tryghost-mailgun-client-5.88.2.tgz} +0 -0
  40. package/components/{tryghost-member-attribution-5.88.1.tgz → tryghost-member-attribution-5.88.2.tgz} +0 -0
  41. package/components/{tryghost-member-events-5.88.1.tgz → tryghost-member-events-5.88.2.tgz} +0 -0
  42. package/components/{tryghost-members-api-5.88.1.tgz → tryghost-members-api-5.88.2.tgz} +0 -0
  43. package/components/{tryghost-members-csv-5.88.1.tgz → tryghost-members-csv-5.88.2.tgz} +0 -0
  44. package/components/tryghost-members-events-service-5.88.2.tgz +0 -0
  45. package/components/{tryghost-members-importer-5.88.1.tgz → tryghost-members-importer-5.88.2.tgz} +0 -0
  46. package/components/{tryghost-members-offers-5.88.1.tgz → tryghost-members-offers-5.88.2.tgz} +0 -0
  47. package/components/tryghost-members-payments-5.88.2.tgz +0 -0
  48. package/components/{tryghost-members-ssr-5.88.1.tgz → tryghost-members-ssr-5.88.2.tgz} +0 -0
  49. package/components/tryghost-members-stripe-service-5.88.2.tgz +0 -0
  50. package/components/tryghost-mentions-email-report-5.88.2.tgz +0 -0
  51. package/components/{tryghost-milestones-5.88.1.tgz → tryghost-milestones-5.88.2.tgz} +0 -0
  52. package/components/{tryghost-minifier-5.88.1.tgz → tryghost-minifier-5.88.2.tgz} +0 -0
  53. package/components/{tryghost-model-to-domain-event-interceptor-5.88.1.tgz → tryghost-model-to-domain-event-interceptor-5.88.2.tgz} +0 -0
  54. package/components/tryghost-mw-api-version-mismatch-5.88.2.tgz +0 -0
  55. package/components/tryghost-mw-cache-control-5.88.2.tgz +0 -0
  56. package/components/{tryghost-mw-error-handler-5.88.1.tgz → tryghost-mw-error-handler-5.88.2.tgz} +0 -0
  57. package/components/{tryghost-mw-session-from-token-5.88.1.tgz → tryghost-mw-session-from-token-5.88.2.tgz} +0 -0
  58. package/components/tryghost-mw-update-user-last-seen-5.88.2.tgz +0 -0
  59. package/components/tryghost-mw-version-match-5.88.2.tgz +0 -0
  60. package/components/tryghost-mw-vhost-5.88.2.tgz +0 -0
  61. package/components/{tryghost-nql-filter-expansions-5.88.1.tgz → tryghost-nql-filter-expansions-5.88.2.tgz} +0 -0
  62. package/components/tryghost-oembed-service-5.88.2.tgz +0 -0
  63. package/components/tryghost-package-json-5.88.2.tgz +0 -0
  64. package/components/{tryghost-post-events-5.88.1.tgz → tryghost-post-events-5.88.2.tgz} +0 -0
  65. package/components/tryghost-post-revisions-5.88.2.tgz +0 -0
  66. package/components/tryghost-posts-service-5.88.2.tgz +0 -0
  67. package/components/tryghost-recommendations-5.88.2.tgz +0 -0
  68. package/components/tryghost-referrers-5.88.2.tgz +0 -0
  69. package/components/{tryghost-security-5.88.1.tgz → tryghost-security-5.88.2.tgz} +0 -0
  70. package/components/{tryghost-session-service-5.88.1.tgz → tryghost-session-service-5.88.2.tgz} +0 -0
  71. package/components/tryghost-settings-path-manager-5.88.2.tgz +0 -0
  72. package/components/{tryghost-slack-notifications-5.88.1.tgz → tryghost-slack-notifications-5.88.2.tgz} +0 -0
  73. package/components/tryghost-staff-service-5.88.2.tgz +0 -0
  74. package/components/tryghost-stats-service-5.88.2.tgz +0 -0
  75. package/components/{tryghost-tiers-5.88.1.tgz → tryghost-tiers-5.88.2.tgz} +0 -0
  76. package/components/{tryghost-update-check-service-5.88.1.tgz → tryghost-update-check-service-5.88.2.tgz} +0 -0
  77. package/components/tryghost-verification-trigger-5.88.2.tgz +0 -0
  78. package/components/tryghost-version-notifications-data-service-5.88.2.tgz +0 -0
  79. package/components/{tryghost-webmentions-5.88.1.tgz → tryghost-webmentions-5.88.2.tgz} +0 -0
  80. package/core/built/admin/assets/admin-x-activitypub/admin-x-activitypub.js +3 -3
  81. package/core/built/admin/assets/admin-x-activitypub/{index-b4a353e7.mjs → index-d7494526.mjs} +7342 -7382
  82. package/core/built/admin/assets/admin-x-activitypub/modals-8098b85c.mjs +663 -0
  83. package/core/built/admin/assets/admin-x-demo/admin-x-demo.js +1 -1
  84. package/core/built/admin/assets/admin-x-settings/{CodeEditorView-44d3cb95.mjs → CodeEditorView-3601b44e.mjs} +2 -2
  85. package/core/built/admin/assets/admin-x-settings/admin-x-settings.js +2 -2
  86. package/core/built/admin/assets/admin-x-settings/{index-39f35680.mjs → index-0b24e982.mjs} +2 -2
  87. package/core/built/admin/assets/admin-x-settings/{index-e2574737.mjs → index-e7c4aa3c.mjs} +1340 -1320
  88. package/core/built/admin/assets/admin-x-settings/{modals-c7767943.mjs → modals-f8ab7cf2.mjs} +4 -4
  89. package/core/built/admin/assets/{chunk.524.45482d7818262de7efec.js → chunk.524.d789401ed18183e69110.js} +5 -5
  90. package/core/built/admin/assets/{chunk.582.d05e13fb3f4e246e9c1c.js → chunk.582.50a6bb6ad78373759548.js} +6 -6
  91. package/core/built/admin/assets/{ghost-3a7e6ea38d077068003416fef7d42b9f.js → ghost-a9fa385e2a92cc3686349b2dea0249d2.js} +6 -6
  92. package/core/built/admin/assets/koenig-lexical/index.css +1 -1
  93. package/core/built/admin/assets/koenig-lexical/koenig-lexical.js +9284 -9164
  94. package/core/built/admin/assets/koenig-lexical/koenig-lexical.umd.js +119 -115
  95. package/core/built/admin/index.html +3 -3
  96. package/core/frontend/helpers/comment_count.js +3 -1
  97. package/core/frontend/helpers/t.js +4 -11
  98. package/core/frontend/services/theme-engine/i18n/I18n.js +1 -1
  99. package/core/server/api/endpoints/identities.js +16 -2
  100. package/ghost.js +1 -3
  101. package/package.json +153 -153
  102. package/yarn.lock +147 -189
  103. package/components/tryghost-adapter-cache-memory-ttl-5.88.1.tgz +0 -0
  104. package/components/tryghost-api-framework-5.88.1.tgz +0 -0
  105. package/components/tryghost-audience-feedback-5.88.1.tgz +0 -0
  106. package/components/tryghost-bookshelf-repository-5.88.1.tgz +0 -0
  107. package/components/tryghost-bootstrap-socket-5.88.1.tgz +0 -0
  108. package/components/tryghost-collections-5.88.1.tgz +0 -0
  109. package/components/tryghost-domain-events-5.88.1.tgz +0 -0
  110. package/components/tryghost-donations-5.88.1.tgz +0 -0
  111. package/components/tryghost-dynamic-routing-events-5.88.1.tgz +0 -0
  112. package/components/tryghost-email-analytics-service-5.88.1.tgz +0 -0
  113. package/components/tryghost-email-content-generator-5.88.1.tgz +0 -0
  114. package/components/tryghost-email-suppression-list-5.88.1.tgz +0 -0
  115. package/components/tryghost-express-dynamic-redirects-5.88.1.tgz +0 -0
  116. package/components/tryghost-external-media-inliner-5.88.1.tgz +0 -0
  117. package/components/tryghost-extract-api-key-5.88.1.tgz +0 -0
  118. package/components/tryghost-ghost-5.88.1.tgz +0 -0
  119. package/components/tryghost-html-to-plaintext-5.88.1.tgz +0 -0
  120. package/components/tryghost-i18n-5.88.1.tgz +0 -0
  121. package/components/tryghost-importer-handler-content-files-5.88.1.tgz +0 -0
  122. package/components/tryghost-in-memory-repository-5.88.1.tgz +0 -0
  123. package/components/tryghost-link-redirects-5.88.1.tgz +0 -0
  124. package/components/tryghost-link-replacer-5.88.1.tgz +0 -0
  125. package/components/tryghost-link-tracking-5.88.1.tgz +0 -0
  126. package/components/tryghost-magic-link-5.88.1.tgz +0 -0
  127. package/components/tryghost-members-events-service-5.88.1.tgz +0 -0
  128. package/components/tryghost-members-payments-5.88.1.tgz +0 -0
  129. package/components/tryghost-members-stripe-service-5.88.1.tgz +0 -0
  130. package/components/tryghost-mentions-email-report-5.88.1.tgz +0 -0
  131. package/components/tryghost-mw-api-version-mismatch-5.88.1.tgz +0 -0
  132. package/components/tryghost-mw-cache-control-5.88.1.tgz +0 -0
  133. package/components/tryghost-mw-update-user-last-seen-5.88.1.tgz +0 -0
  134. package/components/tryghost-mw-version-match-5.88.1.tgz +0 -0
  135. package/components/tryghost-mw-vhost-5.88.1.tgz +0 -0
  136. package/components/tryghost-oembed-service-5.88.1.tgz +0 -0
  137. package/components/tryghost-package-json-5.88.1.tgz +0 -0
  138. package/components/tryghost-post-revisions-5.88.1.tgz +0 -0
  139. package/components/tryghost-posts-service-5.88.1.tgz +0 -0
  140. package/components/tryghost-recommendations-5.88.1.tgz +0 -0
  141. package/components/tryghost-referrers-5.88.1.tgz +0 -0
  142. package/components/tryghost-settings-path-manager-5.88.1.tgz +0 -0
  143. package/components/tryghost-staff-service-5.88.1.tgz +0 -0
  144. package/components/tryghost-stats-service-5.88.1.tgz +0 -0
  145. package/components/tryghost-verification-trigger-5.88.1.tgz +0 -0
  146. package/components/tryghost-version-notifications-data-service-5.88.1.tgz +0 -0
  147. package/core/built/admin/assets/admin-x-activitypub/modals-f64a65f9.mjs +0 -514
@@ -0,0 +1,663 @@
1
+ import { u as he, a as xe, c as n, j as s, H as X, b as fe, d as oe, e as be, f as B, g as z, B as K, h as we, N as E, S as ge, s as ye, i as ve, n as re, p as ke, k as je, l as Fe, m as se, o as Me, q as Y, r as D, A as G, t as Re, L as ie, v as ae, w as le, x as ce } from "./index-d7494526.mjs";
2
+ const Ce = ({
3
+ type: o = "text",
4
+ inputRef: t,
5
+ title: e,
6
+ hideTitle: r,
7
+ value: a,
8
+ error: i,
9
+ placeholder: u,
10
+ rightPlaceholder: c,
11
+ hint: l,
12
+ onChange: h,
13
+ onFocus: x,
14
+ onBlur: w,
15
+ clearBg: k = !1,
16
+ className: j = "",
17
+ maxLength: F,
18
+ containerClassName: U = "",
19
+ hintClassName: y = "",
20
+ unstyled: f = !1,
21
+ disabled: S,
22
+ ...M
23
+ }) => {
24
+ const T = he(), { setFocusState: H } = xe(), _ = (C) => {
25
+ x == null || x(C), H(!0);
26
+ }, I = (C) => {
27
+ w == null || w(C), H(!1);
28
+ }, $ = n(
29
+ "relative order-2 flex w-full items-center",
30
+ e && !r && "mt-1.5"
31
+ ), q = !f && n(
32
+ "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",
33
+ i ? "border-red bg-white dark:bg-grey-925" : "border-transparent bg-grey-150 dark:bg-grey-900",
34
+ S && "bg-grey-50 peer-hover:bg-grey-50 dark:bg-grey-950 dark:peer-hover:bg-grey-950"
35
+ ), R = !f && n(
36
+ "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",
37
+ S ? "cursor-not-allowed text-grey-600 opacity-60 dark:text-grey-800" : "dark:text-white",
38
+ c ? "w-0 grow rounded-l-lg" : "rounded-lg",
39
+ j
40
+ ), P = !f && n(
41
+ "z-[1] order-3 rounded-r-lg",
42
+ c ? typeof c == "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"
43
+ );
44
+ let v = /* @__PURE__ */ s.jsx(s.Fragment, {});
45
+ const Q = /* @__PURE__ */ s.jsx(
46
+ "input",
47
+ {
48
+ ref: t,
49
+ className: R || j,
50
+ disabled: S,
51
+ id: T,
52
+ maxLength: F,
53
+ placeholder: u,
54
+ type: o,
55
+ value: a,
56
+ onBlur: I,
57
+ onChange: h,
58
+ onFocus: _,
59
+ ...M
60
+ }
61
+ );
62
+ return v = /* @__PURE__ */ s.jsxs("div", { className: $, children: [
63
+ Q,
64
+ !f && !k && /* @__PURE__ */ s.jsx("div", { className: q || "" }),
65
+ c && /* @__PURE__ */ s.jsx("span", { className: P || "", children: c })
66
+ ] }), y = n(
67
+ "order-3",
68
+ y
69
+ ), U = n(
70
+ "flex flex-col",
71
+ U
72
+ ), e || l ? /* @__PURE__ */ s.jsxs("div", { className: U, children: [
73
+ v,
74
+ e && /* @__PURE__ */ s.jsx(X, { className: r ? "sr-only" : "order-1", htmlFor: T, useLabelTag: !0, children: e }),
75
+ l && /* @__PURE__ */ s.jsx(fe, { className: y, color: i ? "red" : "default", children: l })
76
+ ] }) : v;
77
+ }, Le = ({
78
+ shiftY: o,
79
+ footerBgColorClass: t = "bg-white dark:bg-black",
80
+ contentBgColorClass: e = "bg-white dark:bg-black",
81
+ height: r = 96,
82
+ children: a
83
+ }) => {
84
+ const i = n(
85
+ "w-100 sticky bottom-[-24px] z-[297] m-0 box-border p-0"
86
+ ), u = o ? `calc(${o} - 24px)` : "-24px", c = `${r + 24}px`, l = n(
87
+ "sticky z-[298] block h-[24px]",
88
+ e
89
+ ), h = "0", x = n(
90
+ "sticky z-[299] mb-[-24px] flex items-center justify-between",
91
+ "h-[96px]",
92
+ t
93
+ ), w = "0", k = `${r}px`, j = "sticky mx-2 block h-[24px] rounded-full shadow-[0_0_0_1px_rgba(0,0,0,.025),0_-8px_16px_-3px_rgba(0,0,0,.08)]", F = o ? `calc(${o} + ${r - 24}px)` : `${r - 24}px`;
94
+ return /* @__PURE__ */ s.jsxs(
95
+ "div",
96
+ {
97
+ className: i,
98
+ style: {
99
+ bottom: u,
100
+ height: c
101
+ },
102
+ children: [
103
+ /* @__PURE__ */ s.jsx(
104
+ "div",
105
+ {
106
+ className: l,
107
+ style: {
108
+ bottom: h
109
+ }
110
+ }
111
+ ),
112
+ /* @__PURE__ */ s.jsx(
113
+ "div",
114
+ {
115
+ className: x,
116
+ style: {
117
+ bottom: w,
118
+ height: k
119
+ },
120
+ children: a
121
+ }
122
+ ),
123
+ /* @__PURE__ */ s.jsx(
124
+ "div",
125
+ {
126
+ className: j,
127
+ style: {
128
+ bottom: F
129
+ }
130
+ }
131
+ )
132
+ ]
133
+ }
134
+ );
135
+ };
136
+ function ne(o, t, e = {}) {
137
+ o ? E.show(Ue, {
138
+ title: "Are you sure you want to leave this page?",
139
+ prompt: /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
140
+ /* @__PURE__ */ s.jsx("p", { children: "Hey there! It looks like you didn't save the changes you made." }),
141
+ /* @__PURE__ */ s.jsx("p", { children: "Save before you go!" })
142
+ ] }),
143
+ okLabel: "Leave",
144
+ cancelLabel: "Stay",
145
+ okColor: "red",
146
+ onOk: (r) => {
147
+ t(), r == null || r.remove();
148
+ },
149
+ ...e
150
+ }) : t();
151
+ }
152
+ const Ne = "bg-[rgba(98,109,121,0.2)] backdrop-blur-[3px]", V = ({
153
+ size: o = "md",
154
+ width: t,
155
+ height: e,
156
+ testId: r,
157
+ title: a,
158
+ okLabel: i = "OK",
159
+ okLoading: u = !1,
160
+ cancelLabel: c = "Cancel",
161
+ footer: l,
162
+ header: h,
163
+ leftButtonProps: x,
164
+ buttonsDisabled: w,
165
+ okDisabled: k,
166
+ padding: j = !0,
167
+ onOk: F,
168
+ okColor: U = "black",
169
+ onCancel: y,
170
+ topRightContent: f,
171
+ hideXOnMobile: S = !1,
172
+ afterClose: M,
173
+ children: T,
174
+ backDrop: H = !0,
175
+ backDropClick: _ = !0,
176
+ stickyFooter: I = !1,
177
+ stickyHeader: $ = !1,
178
+ scrolling: q = !0,
179
+ dirty: R = !1,
180
+ animate: P = !0,
181
+ formSheet: v = !1,
182
+ enableCMDS: Q = !0
183
+ }) => {
184
+ const C = oe(), { setGlobalDirtyState: ee } = be(), [te, de] = B(!1);
185
+ z(() => {
186
+ ee(R);
187
+ }, [R, ee]), z(() => {
188
+ const g = (L) => {
189
+ L.key === "Escape" && (document.activeElement && document.activeElement instanceof HTMLElement && document.activeElement.blur(), setTimeout(() => {
190
+ y ? y() : ne(R, () => {
191
+ C.remove(), M == null || M();
192
+ });
193
+ }), L.stopPropagation());
194
+ };
195
+ return document.addEventListener("keydown", g), () => {
196
+ document.removeEventListener("keydown", g);
197
+ };
198
+ }, [C, R, M, y]), z(() => {
199
+ const g = setTimeout(() => {
200
+ de(!0);
201
+ }, 250);
202
+ return () => clearTimeout(g);
203
+ }, []), z(() => {
204
+ if (F) {
205
+ const g = (L) => {
206
+ (L.metaKey || L.ctrlKey) && L.key === "s" && (L.preventDefault(), F());
207
+ };
208
+ if (Q)
209
+ return window.addEventListener("keydown", g), () => {
210
+ window.removeEventListener("keydown", g);
211
+ };
212
+ }
213
+ });
214
+ const W = [];
215
+ let O;
216
+ const J = () => {
217
+ ne(R, () => {
218
+ C.remove(), M == null || M();
219
+ });
220
+ };
221
+ l || (c && W.push({
222
+ key: "cancel-modal",
223
+ label: c,
224
+ color: "outline",
225
+ onClick: y || (() => {
226
+ J();
227
+ }),
228
+ disabled: w
229
+ }), i && W.push({
230
+ key: "ok-modal",
231
+ label: i,
232
+ color: U,
233
+ className: "min-w-[80px]",
234
+ onClick: F,
235
+ disabled: w || k,
236
+ loading: u
237
+ }));
238
+ let m = n(
239
+ "relative z-50 mx-auto flex max-h-[100%] w-full flex-col justify-between overflow-x-hidden bg-white dark:bg-black",
240
+ o !== "bleed" && "rounded",
241
+ v ? "shadow-md" : "shadow-xl",
242
+ P && !v && !te && "animate-modal-in",
243
+ v && !te && "animate-modal-in-reverse",
244
+ q ? "overflow-y-auto" : "overflow-y-hidden"
245
+ ), p = n(
246
+ "fixed inset-0 z-[1000] h-[100vh] w-[100vw]"
247
+ ), b = "", d = n(
248
+ !f || f === "close" ? "" : "flex items-center justify-between gap-5"
249
+ );
250
+ switch ($ && (d = n(
251
+ d,
252
+ "sticky top-0 z-[200] -mb-4 bg-white !pb-4 dark:bg-black"
253
+ )), o) {
254
+ case "sm":
255
+ m = n(
256
+ m,
257
+ "max-w-[480px]"
258
+ ), p = n(
259
+ p,
260
+ "p-4 md:p-[8vmin]"
261
+ ), b = "p-8", d = n(
262
+ d,
263
+ "-inset-x-8"
264
+ );
265
+ break;
266
+ case "md":
267
+ m = n(
268
+ m,
269
+ "max-w-[720px]"
270
+ ), p = n(
271
+ p,
272
+ "p-4 md:p-[8vmin]"
273
+ ), b = "p-8", d = n(
274
+ d,
275
+ "-inset-x-8"
276
+ );
277
+ break;
278
+ case "lg":
279
+ m = n(
280
+ m,
281
+ "max-w-[1020px]"
282
+ ), p = n(
283
+ p,
284
+ "p-4 md:p-[4vmin]"
285
+ ), b = "p-7", d = n(
286
+ d,
287
+ "-inset-x-8"
288
+ );
289
+ break;
290
+ case "xl":
291
+ m = n(
292
+ m,
293
+ "max-w-[1240px]0"
294
+ ), p = n(
295
+ p,
296
+ "p-4 md:p-[3vmin]"
297
+ ), b = "p-10", d = n(
298
+ d,
299
+ "-inset-x-10 -top-10"
300
+ );
301
+ break;
302
+ case "full":
303
+ m = n(
304
+ m,
305
+ "h-full"
306
+ ), p = n(
307
+ p,
308
+ "p-4 md:p-[3vmin]"
309
+ ), b = "p-10", d = n(
310
+ d,
311
+ "-inset-x-10"
312
+ );
313
+ break;
314
+ case "bleed":
315
+ m = n(
316
+ m,
317
+ "h-full"
318
+ ), b = "p-10", d = n(
319
+ d,
320
+ "-inset-x-10"
321
+ );
322
+ break;
323
+ default:
324
+ p = n(
325
+ p,
326
+ "p-4 md:p-[8vmin]"
327
+ ), b = "p-8", d = n(
328
+ d,
329
+ "-inset-x-8"
330
+ );
331
+ break;
332
+ }
333
+ j || (b = "p-0"), m = n(
334
+ m
335
+ ), d = n(
336
+ d,
337
+ b,
338
+ "pb-0"
339
+ ), O = n(
340
+ b,
341
+ "py-0"
342
+ ), p = n(
343
+ p,
344
+ "max-[800px]:!pb-20"
345
+ );
346
+ const me = n(
347
+ `${b} ${I ? "py-6" : ""}`,
348
+ "flex w-full items-center justify-between"
349
+ );
350
+ O = n(
351
+ O,
352
+ (o === "full" || o === "bleed" || e === "full" || typeof e == "number") && "grow"
353
+ );
354
+ const pe = (g) => {
355
+ g.target === g.currentTarget && _ && J();
356
+ }, A = {};
357
+ typeof t == "number" ? (A.width = "100%", A.maxWidth = t + "px") : t === "full" && (m = n(
358
+ m,
359
+ "w-full"
360
+ )), typeof e == "number" ? (A.height = "100%", A.maxHeight = e + "px") : e === "full" && (m = n(
361
+ m,
362
+ "h-full"
363
+ ));
364
+ let N;
365
+ return l ? N = l : l === !1 ? O += " pb-0 " : N = /* @__PURE__ */ s.jsxs("div", { className: me, children: [
366
+ /* @__PURE__ */ s.jsx("div", { children: x && /* @__PURE__ */ s.jsx(K, { ...x }) }),
367
+ /* @__PURE__ */ s.jsx("div", { className: "flex gap-3", children: /* @__PURE__ */ s.jsx(we, { buttons: W }) })
368
+ ] }), N = I ? /* @__PURE__ */ s.jsx(Le, { height: 84, children: N }) : /* @__PURE__ */ s.jsx(s.Fragment, { children: N }), /* @__PURE__ */ s.jsxs("div", { className: p, id: "modal-backdrop", onMouseDown: pe, children: [
369
+ /* @__PURE__ */ s.jsx("div", { className: n(
370
+ "pointer-events-none fixed inset-0 z-0",
371
+ H && !v && Ne,
372
+ v && "bg-[rgba(98,109,121,0.08)]"
373
+ ) }),
374
+ /* @__PURE__ */ s.jsxs("section", { className: m, "data-testid": r, style: A, children: [
375
+ h === !1 ? "" : !f || f === "close" ? /* @__PURE__ */ s.jsxs("header", { className: d, children: [
376
+ a && /* @__PURE__ */ s.jsx(X, { level: 3, children: a }),
377
+ /* @__PURE__ */ s.jsx("div", { className: `${f !== "close" && "md:!invisible md:!hidden"} ${S && "hidden"} absolute right-6 top-6`, children: /* @__PURE__ */ s.jsx(K, { className: "-m-2 cursor-pointer p-2 opacity-50 hover:opacity-100", icon: "close", iconColorClass: "text-black dark:text-white", size: "sm", testId: "close-modal", unstyled: !0, onClick: J }) })
378
+ ] }) : /* @__PURE__ */ s.jsxs("header", { className: d, children: [
379
+ a && /* @__PURE__ */ s.jsx(X, { level: 3, children: a }),
380
+ f
381
+ ] }),
382
+ /* @__PURE__ */ s.jsx("div", { className: O, children: T }),
383
+ N
384
+ ] })
385
+ ] });
386
+ }, Ee = ({
387
+ title: o = "Are you sure?",
388
+ prompt: t,
389
+ cancelLabel: e = "Cancel",
390
+ okLabel: r = "OK",
391
+ okRunningLabel: a = "...",
392
+ okColor: i = "black",
393
+ onCancel: u,
394
+ onOk: c,
395
+ customFooter: l,
396
+ formSheet: h = !0
397
+ }) => {
398
+ const x = oe(), [w, k] = B("");
399
+ return /* @__PURE__ */ s.jsx(
400
+ V,
401
+ {
402
+ backDropClick: !1,
403
+ buttonsDisabled: w === "running",
404
+ cancelLabel: e,
405
+ footer: l,
406
+ formSheet: h,
407
+ okColor: i,
408
+ okLabel: w === "running" ? a : r,
409
+ testId: "confirmation-modal",
410
+ title: o,
411
+ width: 540,
412
+ onCancel: u,
413
+ onOk: async () => {
414
+ k("running");
415
+ try {
416
+ await (c == null ? void 0 : c(x));
417
+ } catch (j) {
418
+ console.error("Unhandled Promise Rejection. Make sure you catch errors in your onOk handler.", j);
419
+ }
420
+ k("");
421
+ },
422
+ children: /* @__PURE__ */ s.jsx("div", { className: "py-4 leading-9", children: t })
423
+ }
424
+ );
425
+ }, Ue = E.create(Ee);
426
+ class Se extends ge {
427
+ constructor(t, e) {
428
+ super(), this.client = t, this.setOptions(e), this.bindMethods(), this.updateResult();
429
+ }
430
+ bindMethods() {
431
+ this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this);
432
+ }
433
+ setOptions(t) {
434
+ var e;
435
+ const r = this.options;
436
+ this.options = this.client.defaultMutationOptions(t), ye(r, this.options) || this.client.getMutationCache().notify({
437
+ type: "observerOptionsUpdated",
438
+ mutation: this.currentMutation,
439
+ observer: this
440
+ }), (e = this.currentMutation) == null || e.setOptions(this.options);
441
+ }
442
+ onUnsubscribe() {
443
+ if (!this.hasListeners()) {
444
+ var t;
445
+ (t = this.currentMutation) == null || t.removeObserver(this);
446
+ }
447
+ }
448
+ onMutationUpdate(t) {
449
+ this.updateResult();
450
+ const e = {
451
+ listeners: !0
452
+ };
453
+ t.type === "success" ? e.onSuccess = !0 : t.type === "error" && (e.onError = !0), this.notify(e);
454
+ }
455
+ getCurrentResult() {
456
+ return this.currentResult;
457
+ }
458
+ reset() {
459
+ this.currentMutation = void 0, this.updateResult(), this.notify({
460
+ listeners: !0
461
+ });
462
+ }
463
+ mutate(t, e) {
464
+ return this.mutateOptions = e, this.currentMutation && this.currentMutation.removeObserver(this), this.currentMutation = this.client.getMutationCache().build(this.client, {
465
+ ...this.options,
466
+ variables: typeof t < "u" ? t : this.options.variables
467
+ }), this.currentMutation.addObserver(this), this.currentMutation.execute();
468
+ }
469
+ updateResult() {
470
+ const t = this.currentMutation ? this.currentMutation.state : ve(), e = {
471
+ ...t,
472
+ isLoading: t.status === "loading",
473
+ isSuccess: t.status === "success",
474
+ isError: t.status === "error",
475
+ isIdle: t.status === "idle",
476
+ mutate: this.mutate,
477
+ reset: this.reset
478
+ };
479
+ this.currentResult = e;
480
+ }
481
+ notify(t) {
482
+ re.batch(() => {
483
+ if (this.mutateOptions && this.hasListeners()) {
484
+ if (t.onSuccess) {
485
+ var e, r, a, i;
486
+ (e = (r = this.mutateOptions).onSuccess) == null || e.call(r, this.currentResult.data, this.currentResult.variables, this.currentResult.context), (a = (i = this.mutateOptions).onSettled) == null || a.call(i, this.currentResult.data, null, this.currentResult.variables, this.currentResult.context);
487
+ } else if (t.onError) {
488
+ var u, c, l, h;
489
+ (u = (c = this.mutateOptions).onError) == null || u.call(c, this.currentResult.error, this.currentResult.variables, this.currentResult.context), (l = (h = this.mutateOptions).onSettled) == null || l.call(h, void 0, this.currentResult.error, this.currentResult.variables, this.currentResult.context);
490
+ }
491
+ }
492
+ t.listeners && this.listeners.forEach(({
493
+ listener: x
494
+ }) => {
495
+ x(this.currentResult);
496
+ });
497
+ });
498
+ }
499
+ }
500
+ function ue(o, t, e) {
501
+ const r = ke(o, t, e), a = je({
502
+ context: r.context
503
+ }), [i] = B(() => new Se(a, r));
504
+ z(() => {
505
+ i.setOptions(r);
506
+ }, [i, r]);
507
+ const u = Fe(se((l) => i.subscribe(re.batchCalls(l)), [i]), () => i.getCurrentResult(), () => i.getCurrentResult()), c = se((l, h) => {
508
+ i.mutate(l, h).catch(Oe);
509
+ }, [i]);
510
+ if (u.error && Me(i.options.useErrorBoundary, [u.error]))
511
+ throw u.error;
512
+ return {
513
+ ...u,
514
+ mutate: c,
515
+ mutateAsync: u.mutate
516
+ };
517
+ }
518
+ function Oe() {
519
+ }
520
+ function Ae(o, t, e) {
521
+ var c;
522
+ const a = (c = D().data) == null ? void 0 : c.site, i = (a == null ? void 0 : a.url) ?? window.location.origin, u = new G(
523
+ new URL(i),
524
+ new URL("/ghost/api/admin/identities/", window.location.origin),
525
+ o
526
+ );
527
+ return ue({
528
+ async mutationFn(l) {
529
+ return u.follow(l);
530
+ },
531
+ onSuccess: t,
532
+ onError: e
533
+ });
534
+ }
535
+ const ze = E.create(() => {
536
+ const { updateRoute: o } = Y(), t = E.useModal(), [e, r] = B(""), [a, i] = B(null);
537
+ async function u() {
538
+ Re({
539
+ message: "Site followed",
540
+ type: "success"
541
+ }), t.remove(), o("");
542
+ }
543
+ async function c() {
544
+ i(a);
545
+ }
546
+ const l = Ae("index", u, c);
547
+ return /* @__PURE__ */ s.jsx(
548
+ V,
549
+ {
550
+ afterClose: () => {
551
+ l.reset(), o("");
552
+ },
553
+ cancelLabel: "Cancel",
554
+ okLabel: "Follow",
555
+ size: "sm",
556
+ title: "Follow a Ghost site",
557
+ onOk: () => l.mutate(e),
558
+ children: /* @__PURE__ */ s.jsx("div", { className: "mt-3 flex flex-col gap-4", children: /* @__PURE__ */ s.jsx(
559
+ Ce,
560
+ {
561
+ autoFocus: !0,
562
+ error: !!a,
563
+ hint: a,
564
+ placeholder: "@username@hostname",
565
+ title: "Profile name",
566
+ value: e,
567
+ "data-test-new-follower": !0,
568
+ onChange: (h) => r(h.target.value)
569
+ }
570
+ ) })
571
+ }
572
+ );
573
+ });
574
+ function Z(o) {
575
+ if (!o.preferredUsername || !o.id)
576
+ return "@unknown@unknown";
577
+ try {
578
+ return `@${o.preferredUsername}@${new URL(o.id).hostname}`;
579
+ } catch {
580
+ return "@unknown@unknown";
581
+ }
582
+ }
583
+ function Be(o) {
584
+ var i;
585
+ const e = (i = D().data) == null ? void 0 : i.site, r = (e == null ? void 0 : e.url) ?? window.location.origin, a = new G(
586
+ new URL(r),
587
+ new URL("/ghost/api/admin/identities/", window.location.origin),
588
+ o
589
+ );
590
+ return ce({
591
+ queryKey: [`followers:${o}`],
592
+ async queryFn() {
593
+ return a.getFollowers();
594
+ }
595
+ });
596
+ }
597
+ function Te(o) {
598
+ var i;
599
+ const e = (i = D().data) == null ? void 0 : i.site, r = (e == null ? void 0 : e.url) ?? window.location.origin, a = new G(
600
+ new URL(r),
601
+ new URL("/ghost/api/admin/identities/", window.location.origin),
602
+ o
603
+ );
604
+ return ue({
605
+ async mutationFn(u) {
606
+ return a.follow(u);
607
+ }
608
+ });
609
+ }
610
+ const He = ({}) => {
611
+ const { updateRoute: o } = Y(), t = Te("index"), { data: e = [] } = Be("index"), r = Array.isArray(e) ? e : [e];
612
+ return /* @__PURE__ */ s.jsx(
613
+ V,
614
+ {
615
+ afterClose: () => {
616
+ t.reset(), o("");
617
+ },
618
+ cancelLabel: "",
619
+ footer: !1,
620
+ okLabel: "",
621
+ size: "md",
622
+ title: "Followers",
623
+ topRightContent: "close",
624
+ children: /* @__PURE__ */ s.jsx("div", { className: "mt-3 flex flex-col gap-4 pb-12", children: /* @__PURE__ */ s.jsx(ie, { children: r.map((a) => /* @__PURE__ */ s.jsx(ae, { action: /* @__PURE__ */ s.jsx(K, { color: "grey", label: "Follow back", link: !0, onClick: () => t.mutate(Z(a)) }), avatar: /* @__PURE__ */ s.jsx(le, { image: a.icon, size: "sm" }), detail: Z(a), id: "list-item", title: a.name })) }) })
625
+ }
626
+ );
627
+ }, Ie = E.create(He);
628
+ function qe(o) {
629
+ var i;
630
+ const e = (i = D().data) == null ? void 0 : i.site, r = (e == null ? void 0 : e.url) ?? window.location.origin, a = new G(
631
+ new URL(r),
632
+ new URL("/ghost/api/admin/identities/", window.location.origin),
633
+ o
634
+ );
635
+ return ce({
636
+ queryKey: [`following:${o}`],
637
+ async queryFn() {
638
+ return a.getFollowing();
639
+ }
640
+ });
641
+ }
642
+ const Ke = ({}) => {
643
+ const { updateRoute: o } = Y(), { data: t = [] } = qe("index"), e = Array.isArray(t) ? t : [t];
644
+ return /* @__PURE__ */ s.jsx(
645
+ V,
646
+ {
647
+ afterClose: () => {
648
+ o("");
649
+ },
650
+ cancelLabel: "",
651
+ footer: !1,
652
+ okLabel: "",
653
+ size: "md",
654
+ title: "Following",
655
+ topRightContent: "close",
656
+ children: /* @__PURE__ */ s.jsx("div", { className: "mt-3 flex flex-col gap-4 pb-12", children: /* @__PURE__ */ s.jsx(ie, { children: e.map((r) => /* @__PURE__ */ s.jsx(ae, { action: /* @__PURE__ */ s.jsx(K, { color: "grey", label: "Unfollow", link: !0 }), avatar: /* @__PURE__ */ s.jsx(le, { image: r.icon, size: "sm" }), detail: Z(r), id: "list-item", title: r.name })) }) })
657
+ }
658
+ );
659
+ }, De = E.create(Ke), Ve = { FollowSite: ze, ViewFollowing: De, ViewFollowers: Ie };
660
+ export {
661
+ Ve as default
662
+ };
663
+ //# sourceMappingURL=modals-8098b85c.mjs.map