ghost 6.21.0 → 6.21.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 (198) hide show
  1. package/components/tryghost-i18n-6.21.2.tgz +0 -0
  2. package/components/{tryghost-parse-email-address-6.21.0.tgz → tryghost-parse-email-address-6.21.2.tgz} +0 -0
  3. package/content/themes/casper/LICENSE +1 -1
  4. package/content/themes/casper/README.md +7 -2
  5. package/content/themes/casper/assets/built/casper.js +1 -2
  6. package/content/themes/casper/assets/built/casper.js.map +1 -1
  7. package/content/themes/casper/assets/built/global.css +1 -2
  8. package/content/themes/casper/assets/built/global.css.map +1 -1
  9. package/content/themes/casper/assets/built/screen.css +1 -2
  10. package/content/themes/casper/assets/built/screen.css.map +1 -1
  11. package/content/themes/casper/assets/css/global.css +4 -0
  12. package/content/themes/casper/default.hbs +5 -5
  13. package/content/themes/casper/error-404.hbs +1 -1
  14. package/content/themes/casper/error.hbs +2 -2
  15. package/content/themes/casper/gulpfile.js +13 -2
  16. package/content/themes/casper/locales/context.json +112 -0
  17. package/content/themes/casper/locales/de-CH.json +112 -0
  18. package/content/themes/casper/locales/de.json +112 -0
  19. package/content/themes/casper/locales/en.json +112 -0
  20. package/content/themes/casper/locales/fr.json +112 -0
  21. package/content/themes/casper/locales/ga.json +112 -0
  22. package/content/themes/casper/locales/gd.json +112 -0
  23. package/content/themes/casper/locales/nl.json +112 -0
  24. package/content/themes/casper/locales/pt-BR.json +112 -0
  25. package/content/themes/casper/locales/sv.json +112 -0
  26. package/content/themes/casper/locales/uk.json +112 -0
  27. package/content/themes/casper/locales/zh.json +112 -0
  28. package/content/themes/casper/package.json +12 -11
  29. package/content/themes/casper/partials/post-card.hbs +4 -4
  30. package/content/themes/casper/post.hbs +4 -4
  31. package/content/themes/casper/tag.hbs +1 -1
  32. package/content/themes/source/LICENSE +1 -1
  33. package/content/themes/source/README.md +4 -1
  34. package/content/themes/source/assets/built/screen.css +1 -2
  35. package/content/themes/source/assets/built/screen.css.map +1 -1
  36. package/content/themes/source/assets/built/source.js +1 -2
  37. package/content/themes/source/assets/built/source.js.map +1 -1
  38. package/content/themes/source/assets/css/screen.css +18 -16
  39. package/content/themes/source/default.hbs +1 -1
  40. package/content/themes/source/gulpfile.js +5 -3
  41. package/content/themes/source/locales/context.json +112 -0
  42. package/content/themes/source/locales/de-CH.json +112 -0
  43. package/content/themes/source/locales/de.json +112 -0
  44. package/content/themes/source/locales/en.json +112 -0
  45. package/content/themes/source/locales/fr.json +112 -0
  46. package/content/themes/source/locales/ga.json +112 -0
  47. package/content/themes/source/locales/gd.json +112 -0
  48. package/content/themes/source/locales/nl.json +112 -0
  49. package/content/themes/source/locales/pt-BR.json +112 -0
  50. package/content/themes/source/locales/sv.json +112 -0
  51. package/content/themes/source/locales/uk.json +112 -0
  52. package/content/themes/source/locales/zh.json +112 -0
  53. package/content/themes/source/package.json +13 -11
  54. package/content/themes/source/partials/components/featured.hbs +1 -1
  55. package/content/themes/source/partials/components/footer.hbs +1 -1
  56. package/content/themes/source/partials/components/header-content.hbs +1 -1
  57. package/content/themes/source/partials/components/navigation.hbs +5 -5
  58. package/content/themes/source/partials/components/post-list.hbs +7 -7
  59. package/content/themes/source/partials/email-subscription.hbs +5 -5
  60. package/content/themes/source/partials/lightbox.hbs +6 -6
  61. package/content/themes/source/partials/post-card.hbs +1 -1
  62. package/content/themes/source/partials/search-toggle.hbs +1 -1
  63. package/content/themes/source/post.hbs +2 -2
  64. package/core/built/admin/assets/{PolarAngleAxis-a31TecIQ.js → PolarAngleAxis-D8t9UwHk.js} +1 -1
  65. package/core/built/admin/assets/{_baseAssignValue-Dw5pcaUJ.js → _baseAssignValue-DPyNU5o6.js} +1 -1
  66. package/core/built/admin/assets/{a-large-small-Cf_hUupE.js → a-large-small-BijOKCoa.js} +1 -1
  67. package/core/built/admin/assets/admin-x-settings/admin-x-settings.js +1 -1
  68. package/core/built/admin/assets/admin-x-settings/{code-editor-view-C1ZFtR6M.mjs → code-editor-view-DJsXOcZ2.mjs} +2 -2
  69. package/core/built/admin/assets/admin-x-settings/{index-zyVbQw03.mjs → index-BnhIi5NU.mjs} +2 -2
  70. package/core/built/admin/assets/admin-x-settings/{index-D96qFjP9.mjs → index-CnwJhGbs.mjs} +2 -2
  71. package/core/built/admin/assets/admin-x-settings/{index-ILVAmH8Q.mjs → index-DaGaokMn.mjs} +1067 -1063
  72. package/core/built/admin/assets/admin-x-settings/{modals-BbDVa22r.mjs → modals-D02VJnTV.mjs} +2838 -2840
  73. package/core/built/admin/assets/{at-sign-DyMz5le1.js → at-sign-_JfhlimD.js} +1 -1
  74. package/core/built/admin/assets/{audience-BevM-Udw.js → audience-BdrhpNZ4.js} +1 -1
  75. package/core/built/admin/assets/{avatar-flipboard-DiGYhH_s.js → avatar-flipboard-BdmM8eOn.js} +1 -1
  76. package/core/built/admin/assets/{bluesky-sharing-Dj4VOEDi.js → bluesky-sharing-yeM8KkY8.js} +1 -1
  77. package/core/built/admin/assets/{chart-BDdnkPgC.js → chart-CULaDoVB.js} +1 -1
  78. package/core/built/admin/assets/{chunk.138.5c4b0d0ae3f21c9c726d.js → chunk.482.c45c97fe666cd1a6b060.js} +4 -4
  79. package/core/built/admin/assets/{chunk.524.54ba5b50c191627c46f2.js → chunk.524.7fc2692374515780e66e.js} +4 -4
  80. package/core/built/admin/assets/{chunk.582.3232d44081d84d135e3d.js → chunk.582.fd8c4fa8e637e2d5611e.js} +8 -8
  81. package/core/built/admin/assets/{code-editor-view-V0wBeYuE.js → code-editor-view-UA2xKjk1.js} +1 -1
  82. package/core/built/admin/assets/{comments-CqurDRGu.js → comments-DoNjlMYA.js} +1 -1
  83. package/core/built/admin/assets/{content-helpers-C8lVEp2H.js → content-helpers-BRzxAgjP.js} +1 -1
  84. package/core/built/admin/assets/{copy-BdseBMKx.js → copy-CbX-_mHj.js} +1 -1
  85. package/core/built/admin/assets/{data-list--5Xfh5gm.js → data-list-nZOiCWV9.js} +1 -1
  86. package/core/built/admin/assets/{deleted-feed-item-Bmxp6PAR.js → deleted-feed-item-DjkZpKDC.js} +1 -1
  87. package/core/built/admin/assets/{edit-profile-Bi-G8vrq.js → edit-profile-BY_oJrQn.js} +1 -1
  88. package/core/built/admin/assets/{empty-indicator-C1cLHSRX.js → empty-indicator-DoxAratw.js} +1 -1
  89. package/core/built/admin/assets/{en-DPpVO1wK.js → en-B9ScC5j9.js} +1 -1
  90. package/core/built/admin/assets/{feed-lCu_EJ0a.js → feed-BsgqABLQ.js} +1 -1
  91. package/core/built/admin/assets/{filters-BYYV0fmK.js → filters-CscMb_Gl.js} +1 -1
  92. package/core/built/admin/assets/{gh-chart-BYWaeEuY.js → gh-chart-GokHrG5_.js} +1 -1
  93. package/core/built/admin/assets/{ghost-565670d46ad5b30935426b5dfa95bc81.js → ghost-d1843f84a9476ccbdf2a350848ac88aa.js} +2 -2
  94. package/core/built/admin/assets/{growth-DXHnB1EQ.js → growth-CKOWA1_V.js} +1 -1
  95. package/core/built/admin/assets/{hash-tZATAzZa.js → hash-twG7-iIB.js} +1 -1
  96. package/core/built/admin/assets/{inbox-B-LuWyHY.js → inbox-BdkIJbSq.js} +1 -1
  97. package/core/built/admin/assets/{index-BDrJ3N3y.js → index-B7OzWwwP.js} +1 -1
  98. package/core/built/admin/assets/{index-B8tGZsrG.js → index-BFySh9qo.js} +1 -1
  99. package/core/built/admin/assets/{index-EiGE3Aiy.js → index-BOWUajrT.js} +1 -1
  100. package/core/built/admin/assets/{index-ig4J4RpO.js → index-BQLCImHQ.js} +1 -1
  101. package/core/built/admin/assets/{index-BmKPrbBK.js → index-C398bG84.js} +1 -1
  102. package/core/built/admin/assets/{index-BX0_v5NB.js → index-C5YCjM6z.js} +1 -1
  103. package/core/built/admin/assets/{index-DEwhVcR5.js → index-CHpxzPRR.js} +1 -1
  104. package/core/built/admin/assets/{index-CX1A5TwO.js → index-CM-iA6b-.js} +3 -3
  105. package/core/built/admin/assets/{index-9bj69FKq.js → index-CgCHCdle.js} +1 -1
  106. package/core/built/admin/assets/{index-BocVu6WC.js → index-Cw441AFq.js} +1 -1
  107. package/core/built/admin/assets/{index-jHIJgh6L.js → index-D9S88kRl.js} +1 -1
  108. package/core/built/admin/assets/{index-CqvBC0jL.js → index-DbgA2vK8.js} +1 -1
  109. package/core/built/admin/assets/{index-2H-Jp89Z.js → index-ghPdV1ln.js} +1 -1
  110. package/core/built/admin/assets/{index-BcOzgmTC.js → index-tX0pajfP.js} +1 -1
  111. package/core/built/admin/assets/{index-BxVUX0dN.js → index-upXLfQxx.js} +1 -1
  112. package/core/built/admin/assets/{koenig-lexical-BdX9U-oB.js → koenig-lexical-GZS7bHDz.js} +1 -1
  113. package/core/built/admin/assets/{kpi-card-DQ1AbLJB.js → kpi-card-B6fmS7IH.js} +1 -1
  114. package/core/built/admin/assets/{kpis-vcbQvnLh.js → kpis-B-JXQ-4C.js} +1 -1
  115. package/core/built/admin/assets/{label-CNmRJkLy.js → label-ChHoKmj0.js} +1 -1
  116. package/core/built/admin/assets/{links-BE51SJxR.js → links-DQSOljcR.js} +1 -1
  117. package/core/built/admin/assets/{list-filter-BwnQ0Xlp.js → list-filter-cWuCDOLb.js} +1 -1
  118. package/core/built/admin/assets/{loader-circle-CcLEGvsN.js → loader-circle-B5ILzHHu.js} +1 -1
  119. package/core/built/admin/assets/{lucide-react-DHFgHS1l.js → lucide-react-CM0rB7CS.js} +1 -1
  120. package/core/built/admin/assets/{main-layout-DsxBNVo-.js → main-layout-BE7vZmy0.js} +1 -1
  121. package/core/built/admin/assets/{members-3okEkvWv.js → members-C10Z_BuG.js} +1 -1
  122. package/core/built/admin/assets/{message-square-text-BkERj4f5.js → message-square-text-DVZjnBBF.js} +1 -1
  123. package/core/built/admin/assets/{minus-C6oMPJo2.js → minus-BWrVDnd-.js} +1 -1
  124. package/core/built/admin/assets/{modals-CfUec0CL.js → modals-Bx7uDUHI.js} +15 -15
  125. package/core/built/admin/assets/{moderation-DEHUqi1e.js → moderation-DwlKZoB5.js} +1 -1
  126. package/core/built/admin/assets/{newsletter-Cp-39ksw.js → newsletter-DkOl42UB.js} +1 -1
  127. package/core/built/admin/assets/{newsletters-Bj58VQa2.js → newsletters-DNt9qd4h.js} +1 -1
  128. package/core/built/admin/assets/{note-9ysQWJz6.js → note-C-BLqULD.js} +1 -1
  129. package/core/built/admin/assets/{offers-DORdeAfE.js → offers-CU0KFuyW.js} +1 -1
  130. package/core/built/admin/assets/{overview-aZmI_71o.js → overview-DAEelSKq.js} +1 -1
  131. package/core/built/admin/assets/{pagemenu-DK1tbdsq.js → pagemenu-Cr7_YYR8.js} +1 -1
  132. package/core/built/admin/assets/{post-analytics-context-D8nk51yA.js → post-analytics-context-B2ytyOU0.js} +1 -1
  133. package/core/built/admin/assets/{post-analytics-header-qh1LEasb.js → post-analytics-header-CvR25xxU.js} +1 -1
  134. package/core/built/admin/assets/{post-analytics-HdZI-1J7.js → post-analytics-qpfoP-57.js} +1 -1
  135. package/core/built/admin/assets/{post-share-modal-CvTf3PP9.js → post-share-modal-DDhiG0X4.js} +1 -1
  136. package/core/built/admin/assets/{posts-mIxckqHa.js → posts-DTy4lguT.js} +1 -1
  137. package/core/built/admin/assets/{referrers-qhD64pmp.js → referrers-BzKz9fT9.js} +1 -1
  138. package/core/built/admin/assets/{repeat-Idtsb62O.js → repeat-C_xWSLK1.js} +1 -1
  139. package/core/built/admin/assets/{reply-DXS-C-Rk.js → reply-CXnb6Juu.js} +1 -1
  140. package/core/built/admin/assets/{select-CeD8IhXy.js → select-WZUCQgjI.js} +1 -1
  141. package/core/built/admin/assets/{settings-BHfStwmS.js → settings-BC82mM6N.js} +1 -1
  142. package/core/built/admin/assets/{settings-M0QTt_tT.js → settings-EbntXZw9.js} +7 -7
  143. package/core/built/admin/assets/{sort-button-BoTFsBYE.js → sort-button-CFYf_NOQ.js} +1 -1
  144. package/core/built/admin/assets/{source-icon-opy8g_Nk.js → source-icon-xS8eeWX-.js} +1 -1
  145. package/core/built/admin/assets/{sprout-BKOFkdV8.js → sprout-CLmu2pln.js} +1 -1
  146. package/core/built/admin/assets/{square-BjZk7vJx.js → square-D0Y5-h0C.js} +1 -1
  147. package/core/built/admin/assets/{stats-DXXxmfRV.js → stats-B5O9DjYi.js} +1 -1
  148. package/core/built/admin/assets/{stats-view-D_5J0Nf7.js → stats-view-Cr6M1ycv.js} +1 -1
  149. package/core/built/admin/assets/{step-1-BcaR_MDC.js → step-1-DGbl6AAj.js} +1 -1
  150. package/core/built/admin/assets/{step-2-BR0jqEO_.js → step-2-Rf8oissi.js} +1 -1
  151. package/core/built/admin/assets/{step-3-CMPME0ky.js → step-3-tMPmbeBc.js} +1 -1
  152. package/core/built/admin/assets/{table-CwbnKMYe.js → table-CXo8NKU2.js} +1 -1
  153. package/core/built/admin/assets/{tabs-hfT89L_O.js → tabs-BMk71Tf2.js} +1 -1
  154. package/core/built/admin/assets/{tags-BSwYlj_e.js → tags-CSl0BjsA.js} +1 -1
  155. package/core/built/admin/assets/{tags-C3b5AHTm.js → tags-CqHx8i6Q.js} +1 -1
  156. package/core/built/admin/assets/{ticket-BnxPoED1.js → ticket-BtYGyQvH.js} +1 -1
  157. package/core/built/admin/assets/{tiers-DHKKzaBK.js → tiers-CPwRaPSt.js} +1 -1
  158. package/core/built/admin/assets/{toggle-group-U-Oqm2AA.js → toggle-group-QFge4qQs.js} +1 -1
  159. package/core/built/admin/assets/{topic-filter-28veMlW4.js → topic-filter-DnYtZ5e5.js} +1 -1
  160. package/core/built/admin/assets/{trash-D6TuYuIs.js → trash-B4ncKmRu.js} +1 -1
  161. package/core/built/admin/assets/{use-growth-stats-COmCRCzY.js → use-growth-stats-eFO-f1o1.js} +1 -1
  162. package/core/built/admin/assets/{use-infinite-virtual-scroll-mIEgtLoq.js → use-infinite-virtual-scroll-DTqnBtHM.js} +1 -1
  163. package/core/built/admin/assets/{use-scroll-restoration-CXVseKDj.js → use-scroll-restoration-o1DrSdlb.js} +1 -1
  164. package/core/built/admin/assets/{use-simple-pagination-5-LKveLR.js → use-simple-pagination-BsBGNcxc.js} +1 -1
  165. package/core/built/admin/assets/{user-plus-CKQ-d0d4.js → user-plus-BS8SGBmk.js} +1 -1
  166. package/core/built/admin/assets/{user-round-check-BWc7Da4S.js → user-round-check-BgOPeBFs.js} +1 -1
  167. package/core/built/admin/assets/{wallet-cards-BlDtHc6_.js → wallet-cards-Be7G77lR.js} +1 -1
  168. package/core/built/admin/assets/{web-Bvvtl44p.js → web-BNs01IAt.js} +1 -1
  169. package/core/built/admin/index.html +5 -5
  170. package/core/frontend/helpers/cancel_link.js +2 -2
  171. package/core/server/api/endpoints/authors-public.js +3 -3
  172. package/core/server/api/endpoints/files.js +2 -1
  173. package/core/server/api/endpoints/pages-public.js +3 -3
  174. package/core/server/api/endpoints/posts-public.js +3 -3
  175. package/core/server/api/endpoints/users.js +6 -2
  176. package/core/server/api/endpoints/utils/api-filter-utils.js +22 -0
  177. package/core/server/api/endpoints/utils/api-filter-utils.ts +22 -0
  178. package/core/server/lib/lexical.js +2 -1
  179. package/core/server/lib/mobiledoc.js +1 -1
  180. package/core/server/lib/request-external.js +78 -2
  181. package/core/server/services/email-service/email-templates/partials/styles.hbs +3 -1
  182. package/core/server/services/koenig/node-renderers/image-renderer.js +80 -10
  183. package/core/server/services/koenig/render-utils/srcset-attribute.js +15 -3
  184. package/core/server/services/members/members-api/controllers/router-controller.js +5 -5
  185. package/core/server/services/members/members-api/repositories/member-repository.js +1 -1
  186. package/core/server/services/members/members-api/utils/get-discount-window.js +70 -4
  187. package/core/server/services/members/members-api/utils/has-active-offer.js +10 -14
  188. package/core/server/services/oembed/oembed-service.js +9 -1
  189. package/core/server/services/offers/application/offer-mapper.js +48 -0
  190. package/core/server/services/offers/application/offers-api.js +2 -2
  191. package/core/shared/config/defaults.json +1 -1
  192. package/core/shared/labs.js +2 -1
  193. package/package.json +6 -6
  194. package/tsconfig.tsbuildinfo +1 -1
  195. package/yarn.lock +148 -16
  196. package/components/tryghost-i18n-6.21.0.tgz +0 -0
  197. package/core/server/api/endpoints/utils/public-endpoint-utils.js +0 -18
  198. package/core/server/api/endpoints/utils/public-endpoint-utils.ts +0 -17
@@ -1 +1 @@
1
- import{I as T,J as F,K as _,M as E,r as d,N as V,O as W,b as H,j as e,L as R,Q as $,R as k,T as b,U as j,P as J,V as v,h as K,A as O,S as l,B as i,W as c}from"./index-CX1A5TwO.js";import{T as Q,a as q,b as w,c as f}from"./tabs-hfT89L_O.js";import"./index-BX0_v5NB.js";import"./lucide-react-DHFgHS1l.js";import"./a-large-small-Cf_hUupE.js";import"./wallet-cards-BlDtHc6_.js";import"./list-filter-BwnQ0Xlp.js";import"./ticket-BnxPoED1.js";import"./at-sign-DyMz5le1.js";import"./loader-circle-CcLEGvsN.js";import"./message-square-text-BkERj4f5.js";import"./copy-BdseBMKx.js";import"./hash-tZATAzZa.js";import"./inbox-B-LuWyHY.js";import"./user-plus-CKQ-d0d4.js";import"./minus-C6oMPJo2.js";import"./tags-C3b5AHTm.js";import"./square-BjZk7vJx.js";import"./user-round-check-BWc7Da4S.js";import"./repeat-Idtsb62O.js";import"./reply-DXS-C-Rk.js";import"./sprout-BKOFkdV8.js";import"./trash-D6TuYuIs.js";const je=()=>{const{data:N,isLoading:o}=T("index"),{data:g,isLoading:n}=F("index"),m=o?Array(5).fill({apId:"",name:"",handle:"",avatarUrl:""}):N?.pages.flatMap(s=>s.accounts)??[],u=n?Array(5).fill({apId:"",name:""}):g?.pages.flatMap(s=>s.domains)??[],U=_("index"),I=E("index"),[M,x]=d.useState(new Set),B=V("index"),D=W("index"),[S,h]=d.useState(new Set),[p,r]=d.useState(null),y=H(),A=s=>{x(t=>{const a=new Set([...t]);return a.add(s.apId),a}),I.mutate(s),c.success("User unblocked")},L=s=>{x(t=>{const a=new Set([...t]);return a.delete(s.apId),a}),U.mutate(s),c.success("User blocked")},C=s=>{h(t=>{const a=new Set([...t]);return a.add(s.url),a}),D.mutate({url:s.url}),c.success("Domain unblocked")},P=s=>{h(t=>{const a=new Set([...t]);return a.delete(s.url),a}),B.mutate({url:s.url}),c.success("Domain blocked")};return e.jsx(R,{children:e.jsxs("div",{className:"mx-auto max-w-[620px] py-[min(4vh,48px)]",children:[e.jsx("div",{className:"flex items-center justify-between gap-8",children:e.jsx($,{children:"Moderation"})}),e.jsx("div",{className:"mt-6",children:e.jsxs(Q,{defaultValue:"blocked_users",variant:"underline",children:[e.jsxs(q,{children:[e.jsx(w,{value:"blocked_users",children:"Blocked users"}),e.jsx(w,{value:"blocked_domains",children:"Blocked domains"})]}),e.jsx(f,{className:"mt-2",value:"blocked_users",children:!o&&m.length===0?e.jsxs(k,{children:[e.jsx(b,{children:e.jsx(j,{})}),e.jsx("div",{className:"mt-2 flex max-w-[400px] flex-col items-center gap-1 text-center",children:e.jsx("p",{children:"When you block someone, they won't be able to follow you or interact with your content on the social web."})})]}):m.map((s,t)=>e.jsx(J,{actor:s,isCurrentUser:!0,children:e.jsx("div",{children:e.jsxs(v,{onClick:o?void 0:()=>K(s.handle,y),children:[e.jsx(O,{author:{icon:{url:s.avatarUrl},name:s.name,handle:s.handle}}),e.jsxs("div",{className:"flex min-w-0 flex-col",children:[e.jsx("span",{className:"block truncate font-semibold text-black dark:text-white",children:o?e.jsx(l,{className:"w-24"}):s.name}),e.jsx("span",{className:"block truncate text-sm text-gray-600",children:o?e.jsx(l,{className:"w-40"}):s.handle})]}),M.has(s.apId)?e.jsx(i,{className:"ml-auto min-w-[90px] text-red hover:!bg-red/5 hover:text-red-400",variant:"outline",onClick:a=>{a.stopPropagation(),L(s)},children:"Block"}):o?e.jsx("div",{className:"ml-auto w-16",children:e.jsx(l,{})}):e.jsx(i,{className:"ml-auto min-w-[90px]",variant:"destructive",onClick:a=>{a.stopPropagation(),A(s)},onMouseEnter:()=>r(s.apId),onMouseLeave:()=>r(null),children:p===s.apId?"Unblock":"Blocked"})]})})},s.apId?s.apId:`loading-${t}`))}),e.jsx(f,{className:"mt-[11px]",value:"blocked_domains",children:!n&&u.length===0?e.jsxs(k,{children:[e.jsx(b,{children:e.jsx(j,{})}),e.jsx("div",{className:"mt-2 flex max-w-[400px] flex-col items-center gap-1 text-center",children:e.jsx("p",{children:"When you block a domain, all users from that domain won't be able to follow you or interact with your content."})})]}):u.map((s,t)=>e.jsxs(v,{children:[e.jsx("div",{className:"flex min-w-0 flex-col",children:e.jsx("span",{className:"block truncate font-semibold text-black dark:text-white",children:n?e.jsx(l,{className:"w-48"}):new URL(s.url).hostname})}),S.has(s.url)?e.jsx(i,{className:"ml-auto min-w-[90px] text-red hover:!bg-red/5 hover:text-red-400",variant:"outline",onClick:()=>P(s),children:"Block"}):n?e.jsx("div",{className:"ml-auto w-16",children:e.jsx(l,{})}):e.jsx(i,{className:"ml-auto min-w-[90px]",variant:"destructive",onClick:()=>C(s),onMouseEnter:()=>r(s.url),onMouseLeave:()=>r(null),children:p===s.url?"Unblock":"Blocked"})]},s.url?s.url:`loading-${t}`))})]})})]})})};export{je as default};
1
+ import{I as T,J as F,K as _,M as E,r as d,N as V,O as W,b as H,j as e,L as R,Q as $,R as k,T as b,U as j,P as J,V as v,h as K,A as O,S as l,B as i,W as c}from"./index-CM-iA6b-.js";import{T as Q,a as q,b as w,c as f}from"./tabs-BMk71Tf2.js";import"./index-C5YCjM6z.js";import"./lucide-react-CM0rB7CS.js";import"./a-large-small-BijOKCoa.js";import"./wallet-cards-Be7G77lR.js";import"./list-filter-cWuCDOLb.js";import"./ticket-BtYGyQvH.js";import"./at-sign-_JfhlimD.js";import"./loader-circle-B5ILzHHu.js";import"./message-square-text-DVZjnBBF.js";import"./copy-CbX-_mHj.js";import"./hash-twG7-iIB.js";import"./inbox-BdkIJbSq.js";import"./user-plus-BS8SGBmk.js";import"./minus-BWrVDnd-.js";import"./tags-CqHx8i6Q.js";import"./square-D0Y5-h0C.js";import"./user-round-check-BgOPeBFs.js";import"./repeat-C_xWSLK1.js";import"./reply-CXnb6Juu.js";import"./sprout-CLmu2pln.js";import"./trash-B4ncKmRu.js";const je=()=>{const{data:N,isLoading:o}=T("index"),{data:g,isLoading:n}=F("index"),m=o?Array(5).fill({apId:"",name:"",handle:"",avatarUrl:""}):N?.pages.flatMap(s=>s.accounts)??[],u=n?Array(5).fill({apId:"",name:""}):g?.pages.flatMap(s=>s.domains)??[],U=_("index"),I=E("index"),[M,x]=d.useState(new Set),B=V("index"),D=W("index"),[S,h]=d.useState(new Set),[p,r]=d.useState(null),y=H(),A=s=>{x(t=>{const a=new Set([...t]);return a.add(s.apId),a}),I.mutate(s),c.success("User unblocked")},L=s=>{x(t=>{const a=new Set([...t]);return a.delete(s.apId),a}),U.mutate(s),c.success("User blocked")},C=s=>{h(t=>{const a=new Set([...t]);return a.add(s.url),a}),D.mutate({url:s.url}),c.success("Domain unblocked")},P=s=>{h(t=>{const a=new Set([...t]);return a.delete(s.url),a}),B.mutate({url:s.url}),c.success("Domain blocked")};return e.jsx(R,{children:e.jsxs("div",{className:"mx-auto max-w-[620px] py-[min(4vh,48px)]",children:[e.jsx("div",{className:"flex items-center justify-between gap-8",children:e.jsx($,{children:"Moderation"})}),e.jsx("div",{className:"mt-6",children:e.jsxs(Q,{defaultValue:"blocked_users",variant:"underline",children:[e.jsxs(q,{children:[e.jsx(w,{value:"blocked_users",children:"Blocked users"}),e.jsx(w,{value:"blocked_domains",children:"Blocked domains"})]}),e.jsx(f,{className:"mt-2",value:"blocked_users",children:!o&&m.length===0?e.jsxs(k,{children:[e.jsx(b,{children:e.jsx(j,{})}),e.jsx("div",{className:"mt-2 flex max-w-[400px] flex-col items-center gap-1 text-center",children:e.jsx("p",{children:"When you block someone, they won't be able to follow you or interact with your content on the social web."})})]}):m.map((s,t)=>e.jsx(J,{actor:s,isCurrentUser:!0,children:e.jsx("div",{children:e.jsxs(v,{onClick:o?void 0:()=>K(s.handle,y),children:[e.jsx(O,{author:{icon:{url:s.avatarUrl},name:s.name,handle:s.handle}}),e.jsxs("div",{className:"flex min-w-0 flex-col",children:[e.jsx("span",{className:"block truncate font-semibold text-black dark:text-white",children:o?e.jsx(l,{className:"w-24"}):s.name}),e.jsx("span",{className:"block truncate text-sm text-gray-600",children:o?e.jsx(l,{className:"w-40"}):s.handle})]}),M.has(s.apId)?e.jsx(i,{className:"ml-auto min-w-[90px] text-red hover:!bg-red/5 hover:text-red-400",variant:"outline",onClick:a=>{a.stopPropagation(),L(s)},children:"Block"}):o?e.jsx("div",{className:"ml-auto w-16",children:e.jsx(l,{})}):e.jsx(i,{className:"ml-auto min-w-[90px]",variant:"destructive",onClick:a=>{a.stopPropagation(),A(s)},onMouseEnter:()=>r(s.apId),onMouseLeave:()=>r(null),children:p===s.apId?"Unblock":"Blocked"})]})})},s.apId?s.apId:`loading-${t}`))}),e.jsx(f,{className:"mt-[11px]",value:"blocked_domains",children:!n&&u.length===0?e.jsxs(k,{children:[e.jsx(b,{children:e.jsx(j,{})}),e.jsx("div",{className:"mt-2 flex max-w-[400px] flex-col items-center gap-1 text-center",children:e.jsx("p",{children:"When you block a domain, all users from that domain won't be able to follow you or interact with your content."})})]}):u.map((s,t)=>e.jsxs(v,{children:[e.jsx("div",{className:"flex min-w-0 flex-col",children:e.jsx("span",{className:"block truncate font-semibold text-black dark:text-white",children:n?e.jsx(l,{className:"w-48"}):new URL(s.url).hostname})}),S.has(s.url)?e.jsx(i,{className:"ml-auto min-w-[90px] text-red hover:!bg-red/5 hover:text-red-400",variant:"outline",onClick:()=>P(s),children:"Block"}):n?e.jsx("div",{className:"ml-auto w-16",children:e.jsx(l,{})}):e.jsx(i,{className:"ml-auto min-w-[90px]",variant:"destructive",onClick:()=>C(s),onMouseEnter:()=>r(s.url),onMouseLeave:()=>r(null),children:p===s.url?"Unblock":"Blocked"})]},s.url?s.url:`loading-${t}`))})]})})]})})};export{je as default};
@@ -1 +1 @@
1
- import{aa as Re,r,u as Se,aT as re,j as e,an as N,aW as ne,aV as K,bQ as le,cx as ee,bH as _e,bJ as Fe,cy as Te,cz as Ae,cA as $e,B as q,aY as ze,aU as Ee,ao as E,cb as Me,C as De}from"./index-CX1A5TwO.js";import{C as Y,a as Q,b as J,h as X,c as _,i as ce}from"./pagemenu-DK1tbdsq.js";import{u as oe,S as de,a as me,b as pe,c as ue}from"./use-simple-pagination-5-LKveLR.js";import{T as Ie,a as Ue,b as se}from"./tabs-hfT89L_O.js";import{d as Ve,e as Be,f as We}from"./lucide-react-DHFgHS1l.js";import{a as Oe,P as He}from"./wallet-cards-BlDtHc6_.js";import{K as U,d as V,a as B,b as W,c as O}from"./kpi-card-DQ1AbLJB.js";import{P as Ge,a as Ke}from"./post-analytics-header-qh1LEasb.js";import{D as qe,a as Ye,b as Qe,c as Je,d as Xe,e as Ze,f as es,g as ss}from"./data-list--5Xfh5gm.js";import{a as ts,u as as,p as is,g as H,N as G}from"./links-BE51SJxR.js";import{u as rs}from"./post-analytics-context-D8nk51yA.js";import{h as ns}from"./post-helpers-gInwAwEv.js";import{f as ls,g as cs}from"./stats-DXXxmfRV.js";import{g as te}from"./posts-mIxckqHa.js";import"./index-BX0_v5NB.js";import"./a-large-small-Cf_hUupE.js";import"./list-filter-BwnQ0Xlp.js";import"./ticket-BnxPoED1.js";import"./at-sign-DyMz5le1.js";import"./loader-circle-CcLEGvsN.js";import"./message-square-text-BkERj4f5.js";import"./copy-BdseBMKx.js";import"./hash-tZATAzZa.js";import"./inbox-B-LuWyHY.js";import"./user-plus-CKQ-d0d4.js";import"./minus-C6oMPJo2.js";import"./tags-C3b5AHTm.js";import"./square-BjZk7vJx.js";import"./user-round-check-BWc7Da4S.js";import"./repeat-Idtsb62O.js";import"./reply-DXS-C-Rk.js";import"./sprout-BKOFkdV8.js";import"./trash-D6TuYuIs.js";import"./post-share-modal-CvTf3PP9.js";import"./get-site-timezone-BDBAcjmq.js";import"./chart-BDdnkPgC.js";import"./_baseAssignValue-Dw5pcaUJ.js";import"./PolarAngleAxis-a31TecIQ.js";const os="FeedbackResponseType",ds=Re({dataType:os,path:s=>`/feedback/${s}/`}),ms=(s,a)=>{const{data:c,isLoading:o,error:x}=ds(s,{searchParams:{limit:"50",...a!==void 0?{score:a.toString()}:{}}});return{feedback:r.useMemo(()=>c?.feedback?c.feedback:[],[c]),isLoading:o,error:x}},ps=({feedbackStats:s})=>{const{postId:a}=Se(),c=re(),[o,x]=r.useState("positive"),n=9,f=o==="positive"?1:0,{feedback:F,isLoading:L}=ms(a||"",f),{totalPages:k,paginatedData:i,nextPage:v,previousPage:R,hasNextPage:C,hasPreviousPage:l}=oe({data:F,itemsPerPage:n}),g=L;return e.jsxs(Y,{children:[e.jsxs(Q,{className:"pb-5",children:[e.jsx(J,{children:"Feedback"}),e.jsx(X,{children:"What did your readers think?"})]}),s.totalFeedback>0?e.jsxs(_,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(Ie,{className:"pb-3",defaultValue:"positive",value:o,variant:"button",onValueChange:d=>x(d),children:e.jsxs(Ue,{className:"gap-1",children:[e.jsx(se,{className:"h-7",value:"positive",children:e.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[e.jsx(Ve,{size:14,strokeWidth:1.25}),e.jsx("span",{className:"hidden font-medium sm:!visible sm:!inline",children:"More like this"}),e.jsx("span",{className:"font-semibold tracking-tight",children:N(s.positiveFeedback/s.totalFeedback)})]})}),e.jsx(se,{className:"h-7",value:"negative",children:e.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[e.jsx(Be,{size:14,strokeWidth:1.25}),e.jsx("span",{className:"hidden font-medium sm:!visible sm:!inline",children:"Less like this"}),e.jsx("span",{className:"font-semibold tracking-tight",children:N(s.negativeFeedback/s.totalFeedback)})]})})]})}),e.jsx(ne,{className:"mb-3 mr-2 lg:hidden xl:!visible xl:!block",children:"Date"})]}),e.jsx(K,{}),g?e.jsx(le,{className:"mt-3",lines:3}):i&&i.length>0?e.jsx("div",{className:"flex w-full flex-col py-3",children:i.map(d=>e.jsxs("div",{className:"flex h-10 w-full items-center justify-between gap-3 rounded-sm border-none px-2 text-sm hover:cursor-pointer hover:bg-accent",onClick:()=>{c(`/members/${d.member.id}`,{crossApp:!0})},children:[e.jsxs("div",{className:"flex items-center gap-2 font-medium",children:[e.jsxs(_e,{className:"size-7",children:[d.member?.avatar_image&&e.jsx("img",{className:"absolute aspect-square size-full",src:d.member?.avatar_image}),e.jsx(Fe,{className:"text-white",style:{backgroundColor:`${Ae(ee(d.member),75,55)}`},children:Te(d.member)})]}),ee(d.member)]}),e.jsx("div",{className:"whitespace-nowrap text-muted-foreground",children:$e(d.created_at)})]},d.id))}):e.jsx("div",{className:"flex h-full items-center justify-center py-8 text-center text-sm text-muted-foreground",children:e.jsxs("div",{children:["No ",o==="positive"?"positive":"negative"," feedback yet"]})})]}):e.jsxs(_,{className:"flex grow flex-col items-center justify-center text-center text-sm text-muted-foreground",children:[e.jsx("div",{children:"No members have given feedback yet"}),e.jsx("div",{children:"When someone does, you'll see their response here."})]}),s.totalFeedback>0&&e.jsx(ce,{className:"grow-0",children:e.jsxs("div",{className:"flex w-full items-center justify-between gap-3",children:[e.jsxs(q,{variant:"outline",onClick:()=>{const d=`(feedback.post_id:'${a}'+feedback.score:1)`,m=`(feedback.post_id:'${a}'+feedback.score:0)`,y=`${encodeURIComponent(d)}&post=${a}`,h=`${encodeURIComponent(m)}&post=${a}`;c(`/members?filter=${o==="positive"?y:h}`,{crossApp:!0})},children:["View all",e.jsx(Oe,{})]}),k>1&&e.jsx(de,{className:"pb-0",children:e.jsxs(me,{children:[e.jsx(pe,{disabled:!l,onClick:R}),e.jsx(ue,{disabled:!C,onClick:v})]})})]})})]})},us=()=>{const{mutateAsync:s,isLoading:a}=ts();return{editLinks:s,isEditLinksLoading:a}},xs=s=>{const{data:a,isLoading:c}=te(s),{data:o,isLoading:x}=te(s,{searchParams:{include:"count.positive_feedback,count.negative_feedback"}}),n=r.useMemo(()=>a?.posts[0],[a]),f=r.useMemo(()=>o?.posts[0],[o]),F=r.useMemo(()=>n?{sent:n.email?.email_count||0,opened:n.email?.opened_count||0,clicked:n.count?.clicks||0,openedRate:n.email?.opened_count?n.email.opened_count/n.email.email_count:0,clickedRate:n.count?.clicks&&n.email?.email_count?n.count.clicks/n.email.email_count:0}:{sent:0,opened:0,clicked:0,openedRate:0,clickedRate:0},[n]),L=r.useMemo(()=>{if(!f?.count)return{positiveFeedback:0,negativeFeedback:0,totalFeedback:0};const p=f.count.positive_feedback||0,w=f.count.negative_feedback||0,j=p+w;return{positiveFeedback:p,negativeFeedback:w,totalFeedback:j}},[f]),k=r.useMemo(()=>n?.newsletter?.id,[n]),{data:i,isLoading:v}=ls({searchParams:k?{newsletter_id:k}:{},enabled:!!k}),R=r.useMemo(()=>i?.stats?i.stats.map(p=>p.post_id):[],[i]),{data:C,isLoading:l}=cs({searchParams:k&&R.length>0?{newsletter_id:k,post_ids:R.join(",")}:{},enabled:!!k&&R.length>0}),g=r.useMemo(()=>{if(!i?.stats)return;const p=i.stats,w=C?.stats||[],j=new Map;w.forEach(b=>{j.set(b.post_id,b)});const S=p.map(b=>{const z=j.get(b.post_id);return{...b,total_clicks:z?.total_clicks||0,click_rate:z?.click_rate||0}});return{...i,stats:S}},[i,C]),d=v||l,{data:m,isLoading:y,refetch:h}=as({searchParams:{filter:`post_id:'${s}'`}}),T=r.useMemo(()=>{if(!g||!g.stats)return{openRate:0,clickRate:0};const p=g.stats;if(p.length===0)return{openRate:0,clickRate:0};const w=p.reduce((S,b)=>S+(b.open_rate||0),0),j=p.reduce((S,b)=>S+(b.click_rate||0),0);return{openRate:Number((w/p.length).toFixed(2)),clickRate:Number((j/p.length).toFixed(2))}},[g]),M=r.useMemo(()=>is(m),[m]),D=r.useMemo(()=>({openedRate:T.openRate,clickedRate:T.clickRate}),[T]);return{post:n,stats:F,feedbackStats:L,averageStats:D,topLinks:M,refetchTopLinks:h,isLoading:c||x||d||y}},gs=({breakpoints:s={sm:1080,md:1280,lg:1360}}={})=>{const[a,c]=r.useState("md");return r.useEffect(()=>{const o=()=>{const x=window.innerWidth;x<s.sm?c("sm"):x<s.md?c("md"):c("lg")};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[s]),{chartSize:a,isSmall:a==="sm",isMedium:a==="md",isLarge:a==="lg"}},ae=()=>e.jsx("div",{className:"absolute -right-4 top-1/2 z-10 hidden size-8 -translate-y-1/2 items-center justify-center rounded-full border bg-background text-muted-foreground md:!visible md:!flex",children:e.jsx(De,{className:"ml-0.5",size:16,strokeWidth:1.5})}),ie=({dataColor:s,value:a,avgValue:c})=>e.jsxs("div",{className:"absolute left-1/2 top-6 z-50 flex w-[200px] -translate-x-1/2 flex-col items-stretch gap-1.5 rounded-md bg-background px-4 py-2 text-sm opacity-0 shadow-md transition-all group-hover/block:top-3 group-hover/block:opacity-100",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx("div",{className:"size-2 rounded-full bg-chart-blue opacity-50",style:{backgroundColor:s}}),"This newsletter"]}),e.jsx("div",{className:"text-right font-mono",children:a})]}),e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx("div",{className:"size-2 rounded-full bg-chart-gray opacity-80"}),"Average"]}),e.jsx("div",{className:"text-right font-mono",children:c})]})]}),et=()=>{const s=re(),[a,c]=r.useState(null),[o,x]=r.useState(""),n=r.useRef(null),f=r.useRef(null),F=10,{chartSize:L}=gs(),{appSettings:k}=ze(),{emailTrackClicks:i,emailTrackOpens:v}=k?.analytics||{},{post:R,isPostLoading:C,postId:l}=rs(),g=R,d=ns(g);r.useEffect(()=>{!C&&!d&&s(`/posts/analytics/${l}`)},[s,l,C,d]);const{stats:m,averageStats:y,topLinks:h,isLoading:T,refetchTopLinks:M}=xs(l),{editLinks:D}=us(),p=r.useMemo(()=>{if(!g?.count)return{positiveFeedback:0,negativeFeedback:0,totalFeedback:0};const t=g.count.positive_feedback||0,u=g.count.negative_feedback||0,P=t+u;return{positiveFeedback:t,negativeFeedback:u,totalFeedback:P}},[g]),w=r.useMemo(()=>g?.newsletter?.feedback_enabled===!0,[g]),j=r.useMemo(()=>p.totalFeedback>0?!0:w,[p.totalFeedback,w]),S=t=>{const u=H(h,t);u&&(c(t),x(u.link.to))},b=()=>{if(!a)return;const t=H(h,a);if(!t)return;const u=o.trim();if(u===""||u===t.link.to){c(null),x("");return}D({originalUrl:t.link.originalTo,editedUrl:o,postId:l},{onSuccess:()=>{c(null),x(""),M()}})},{totalPages:z,paginatedData:xe,nextPage:ge,previousPage:he,hasNextPage:be,hasPreviousPage:fe}=oe({data:h,itemsPerPage:F});r.useEffect(()=>{if(a&&n.current){n.current.focus();const t=H(h,a),u=P=>{f.current&&!f.current.contains(P.target)&&o===t?.link.to&&(c(null),x(""))};return document.addEventListener("mousedown",u),()=>{document.removeEventListener("mousedown",u)}}},[a,o,h]);const I=T||C,ke=[{datatype:"Sent",value:1,fill:"url(#gradientPurple)",color:"hsl(var(--chart-purple))"}],ve={percentage:{label:"O"},Average:{label:"Average"},"This newsletter":{label:"This newsletter"}},je=[{datatype:"Average",value:y.openedRate,fill:"url(#gradientGray)",color:"hsl(var(--chart-gray))"},{datatype:"This newsletter",value:m.openedRate,fill:"url(#gradientBlue)",color:"hsl(var(--chart-blue))"}],Ne={percentage:{label:"Opened"},Average:{label:"Average"},"This newsletter":{label:"This newsletter"}},we=[{datatype:"Average",value:y.clickedRate,fill:"url(#gradientGray)",color:"hsl(var(--chart-gray))"},{datatype:"This newsletter",value:m.clickedRate,fill:"url(#gradientTeal)",color:"hsl(var(--chart-teal))"}],Ce={percentage:{label:"Clicked"},Average:{label:"Average"},"This newsletter":{label:"This newsletter"}};let A="grid-cols-3",$="aspect-[16/10] w-full max-w-[320px] sm:aspect-[2/1] md:aspect-[10/14] md:max-w-none lg:aspect-square";return(!i||!v)&&(A="grid-cols-2",$="aspect-[16/10] w-full max-w-[320px] sm:aspect-[2/1] md:aspect-square md:max-w-none lg:aspect-[15/10]"),!i&&!v&&(A="grid-cols-1",$="aspect-square w-full sm:aspect-[16/10] md:max-w-[320px] md:max-h-[320px] lg:aspect-[12/10]"),e.jsxs(e.Fragment,{children:[e.jsx(Ge,{currentTab:"Newsletter"}),e.jsx(Ke,{children:e.jsxs("div",{className:`grid grid-cols-1 gap-6 ${j&&i&&"lg:grid-cols-2"}`,children:[e.jsxs(Y,{className:j&&i?"lg:col-span-2":"",children:[e.jsxs(Q,{className:"hidden",children:[e.jsx(J,{children:"Newsletters"}),e.jsx(X,{children:"How did this post perform"})]}),I?e.jsx(_,{className:"h-[25vw] p-6",children:e.jsx(Ee,{})}):e.jsxs(_,{className:"p-0",children:[e.jsxs("div",{className:`grid ${A} items-stretch border-b`,children:[e.jsxs(U,{className:"group relative isolate grow p-3 md:px-6 md:py-5",children:[e.jsx(V,{onClick:()=>{const t=new URLSearchParams({filterParam:`emails.post_id:${l}`,postAnalytics:l});s(`/members?${t.toString()}`,{crossApp:!0})},children:"View members →"}),e.jsxs(B,{onClick:()=>{const t=new URLSearchParams({filterParam:`emails.post_id:${l}`,postAnalytics:l});s(`/members?${t.toString()}`,{crossApp:!0})},children:[e.jsx("div",{className:"ml-0.5 size-[9px] rounded-full bg-chart-purple !text-sm opacity-50 lg:text-base"}),"Sent"]}),e.jsx(W,{children:e.jsx(O,{className:"text-xl leading-none sm:text-2xl md:text-[2.6rem]",children:E(m.sent)})})]}),v&&e.jsxs(U,{className:"p-3 md:px-6 md:py-5",children:[e.jsx(V,{onClick:()=>{const t=new URLSearchParams({filterParam:`opened_emails.post_id:${l}`,postAnalytics:l});s(`/members?${t.toString()}`,{crossApp:!0})},children:"View members →"}),e.jsxs(B,{onClick:()=>{const t=new URLSearchParams({filterParam:`opened_emails.post_id:${l}`,postAnalytics:l});s(`/members?${t.toString()}`,{crossApp:!0})},children:[e.jsx("div",{className:"ml-0.5 size-[9px] rounded-full bg-chart-blue !text-sm opacity-50 lg:text-base"}),"Opened"]}),e.jsx(W,{children:e.jsx(O,{className:"text-xl leading-none sm:text-2xl md:text-[2.6rem]",children:E(m.opened)})})]}),i&&e.jsxs(U,{className:"group relative isolate grow p-3 md:px-6 md:py-5",children:[e.jsx(V,{onClick:()=>{const t=new URLSearchParams({filterParam:`clicked_links.post_id:${l}`,postAnalytics:l});s(`/members?${t.toString()}`,{crossApp:!0})},children:"View members →"}),e.jsxs(B,{onClick:()=>{const t=new URLSearchParams({filterParam:`clicked_links.post_id:${l}`,postAnalytics:l});s(`/members?${t.toString()}`,{crossApp:!0})},children:[e.jsx("div",{className:"ml-0.5 size-[9px] rounded-full bg-chart-teal !text-sm opacity-50 lg:text-base"}),"Clicked"]}),e.jsx(W,{children:e.jsx(O,{className:"text-xl leading-none sm:text-2xl md:text-[2.6rem]",children:E(m.clicked)})})]})]}),e.jsxs("div",{className:`$ mx-auto grid grid-cols-1 items-center justify-center gap-4 transition-all md:gap-0 ${A==="grid-cols-2"&&"md:grid-cols-2"} ${A==="grid-cols-3"&&"md:grid-cols-3"}`,children:[e.jsxs("div",{className:`relative border-r-0 px-6 ${(v||i)&&"md:border-r"}`,children:[e.jsx(G,{className:$,config:ve,data:ke,percentageLabel:"Sent",percentageValue:N(1),size:L,tooltip:!1}),(v||i)&&e.jsx(ae,{})]}),v&&e.jsxs("div",{className:`group/block relative border-r-0 px-6 transition-all hover:bg-muted/25 ${i&&"md:border-r"}`,children:[e.jsx(ie,{avgValue:N(y.openedRate),dataColor:"hsl(var(--chart-blue))",value:N(m.openedRate)}),e.jsx(G,{className:$,config:Ne,data:je,percentageLabel:"Open rate",percentageValue:N(m.openedRate),size:L,tooltip:!1}),i&&e.jsx(ae,{})]}),i&&e.jsxs("div",{className:"group/block relative px-6 transition-all hover:bg-muted/25",children:[e.jsx(ie,{avgValue:N(y.clickedRate),dataColor:"hsl(var(--chart-teal))",value:N(m.clickedRate)}),e.jsx(G,{className:$,config:Ce,data:we,percentageLabel:"Click rate",percentageValue:N(m.clickedRate),size:L,tooltip:!1})]})]})]})]}),j&&e.jsx(ps,{feedbackStats:p}),i&&e.jsxs(Y,{className:"group/datalist overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between p-6",children:[e.jsxs(Q,{className:"p-0",children:[e.jsx(J,{children:"Newsletter clicks"}),e.jsx(X,{children:"Which links resonated with your readers"})]}),e.jsx(ne,{className:"mr-2",children:"Members"})]}),I?e.jsxs(_,{className:"p-6 pt-0",children:[e.jsx(K,{}),e.jsx(le,{className:"mt-6"})]}):e.jsxs(_,{className:"pb-0",children:[e.jsx(K,{}),h.length>0?e.jsx(qe,{className:"",children:e.jsx(Ye,{children:xe?.map(t=>{const u=m.clicked>0?t.count/m.clicked:0,P=t.link.link_id,Z=t.link.title,ye=t.link.to,Pe=t.link.edited;return e.jsxs(Qe,{children:[a!==P&&e.jsx(Je,{style:{width:`${u?Math.round(u*100):0}%`}}),e.jsx(Xe,{className:"w-full",children:a===P?e.jsxs("div",{ref:f,className:"flex w-full items-center gap-2",children:[e.jsx(Me,{ref:n,className:"z-50 h-7 w-full border-border bg-background text-sm",value:o,onChange:Le=>x(Le.target.value)}),e.jsx(q,{size:"sm",onClick:b,children:"Update"})]}):e.jsxs(e.Fragment,{children:[e.jsx(q,{className:"mr-2 shrink-0 bg-background",size:"sm",variant:"outline",onClick:()=>S(P),children:e.jsx(He,{})}),e.jsx("a",{className:"block truncate font-medium hover:underline",href:ye,rel:"noreferrer",target:"_blank",title:Z,children:Z}),Pe&&e.jsx("span",{className:"ml-1 text-gray-500",children:"(edited)"})]})}),e.jsxs(Ze,{children:[e.jsx(es,{children:E(t.count||0)}),e.jsx(ss,{children:N(u)})]})]},P)})})}):e.jsx("div",{className:"py-20 text-center text-sm text-gray-700",children:"You have no links in your post."})]}),!I&&h.length>1&&e.jsx(ce,{children:e.jsxs("div",{className:"flex w-full items-start justify-between gap-3",children:[e.jsxs("div",{className:"mt-2 flex items-start gap-2 pl-4 text-sm text-green",children:[e.jsx(We,{size:20,strokeWidth:1.5}),"Sent a broken link? You can update it!"]}),z>1&&e.jsx(de,{className:"pb-0",children:e.jsxs(me,{children:[e.jsx(pe,{disabled:!fe,onClick:he}),e.jsx(ue,{disabled:!be,onClick:ge})]})})]})})]})]})})]})};export{et as default};
1
+ import{aa as Re,r,u as Se,aT as re,j as e,an as N,aW as ne,aV as K,bQ as le,cx as ee,bH as _e,bJ as Fe,cy as Te,cz as Ae,cA as $e,B as q,aY as ze,aU as Ee,ao as E,cb as Me,C as De}from"./index-CM-iA6b-.js";import{C as Y,a as Q,b as J,h as X,c as _,i as ce}from"./pagemenu-Cr7_YYR8.js";import{u as oe,S as de,a as me,b as pe,c as ue}from"./use-simple-pagination-BsBGNcxc.js";import{T as Ie,a as Ue,b as se}from"./tabs-BMk71Tf2.js";import{d as Ve,e as Be,f as We}from"./lucide-react-CM0rB7CS.js";import{a as Oe,P as He}from"./wallet-cards-Be7G77lR.js";import{K as U,d as V,a as B,b as W,c as O}from"./kpi-card-B6fmS7IH.js";import{P as Ge,a as Ke}from"./post-analytics-header-CvR25xxU.js";import{D as qe,a as Ye,b as Qe,c as Je,d as Xe,e as Ze,f as es,g as ss}from"./data-list-nZOiCWV9.js";import{a as ts,u as as,p as is,g as H,N as G}from"./links-DQSOljcR.js";import{u as rs}from"./post-analytics-context-B2ytyOU0.js";import{h as ns}from"./post-helpers-gInwAwEv.js";import{f as ls,g as cs}from"./stats-B5O9DjYi.js";import{g as te}from"./posts-DTy4lguT.js";import"./index-C5YCjM6z.js";import"./a-large-small-BijOKCoa.js";import"./list-filter-cWuCDOLb.js";import"./ticket-BtYGyQvH.js";import"./at-sign-_JfhlimD.js";import"./loader-circle-B5ILzHHu.js";import"./message-square-text-DVZjnBBF.js";import"./copy-CbX-_mHj.js";import"./hash-twG7-iIB.js";import"./inbox-BdkIJbSq.js";import"./user-plus-BS8SGBmk.js";import"./minus-BWrVDnd-.js";import"./tags-CqHx8i6Q.js";import"./square-D0Y5-h0C.js";import"./user-round-check-BgOPeBFs.js";import"./repeat-C_xWSLK1.js";import"./reply-CXnb6Juu.js";import"./sprout-CLmu2pln.js";import"./trash-B4ncKmRu.js";import"./post-share-modal-DDhiG0X4.js";import"./get-site-timezone-BDBAcjmq.js";import"./chart-CULaDoVB.js";import"./_baseAssignValue-DPyNU5o6.js";import"./PolarAngleAxis-D8t9UwHk.js";const os="FeedbackResponseType",ds=Re({dataType:os,path:s=>`/feedback/${s}/`}),ms=(s,a)=>{const{data:c,isLoading:o,error:x}=ds(s,{searchParams:{limit:"50",...a!==void 0?{score:a.toString()}:{}}});return{feedback:r.useMemo(()=>c?.feedback?c.feedback:[],[c]),isLoading:o,error:x}},ps=({feedbackStats:s})=>{const{postId:a}=Se(),c=re(),[o,x]=r.useState("positive"),n=9,f=o==="positive"?1:0,{feedback:F,isLoading:L}=ms(a||"",f),{totalPages:k,paginatedData:i,nextPage:v,previousPage:R,hasNextPage:C,hasPreviousPage:l}=oe({data:F,itemsPerPage:n}),g=L;return e.jsxs(Y,{children:[e.jsxs(Q,{className:"pb-5",children:[e.jsx(J,{children:"Feedback"}),e.jsx(X,{children:"What did your readers think?"})]}),s.totalFeedback>0?e.jsxs(_,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(Ie,{className:"pb-3",defaultValue:"positive",value:o,variant:"button",onValueChange:d=>x(d),children:e.jsxs(Ue,{className:"gap-1",children:[e.jsx(se,{className:"h-7",value:"positive",children:e.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[e.jsx(Ve,{size:14,strokeWidth:1.25}),e.jsx("span",{className:"hidden font-medium sm:!visible sm:!inline",children:"More like this"}),e.jsx("span",{className:"font-semibold tracking-tight",children:N(s.positiveFeedback/s.totalFeedback)})]})}),e.jsx(se,{className:"h-7",value:"negative",children:e.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[e.jsx(Be,{size:14,strokeWidth:1.25}),e.jsx("span",{className:"hidden font-medium sm:!visible sm:!inline",children:"Less like this"}),e.jsx("span",{className:"font-semibold tracking-tight",children:N(s.negativeFeedback/s.totalFeedback)})]})})]})}),e.jsx(ne,{className:"mb-3 mr-2 lg:hidden xl:!visible xl:!block",children:"Date"})]}),e.jsx(K,{}),g?e.jsx(le,{className:"mt-3",lines:3}):i&&i.length>0?e.jsx("div",{className:"flex w-full flex-col py-3",children:i.map(d=>e.jsxs("div",{className:"flex h-10 w-full items-center justify-between gap-3 rounded-sm border-none px-2 text-sm hover:cursor-pointer hover:bg-accent",onClick:()=>{c(`/members/${d.member.id}`,{crossApp:!0})},children:[e.jsxs("div",{className:"flex items-center gap-2 font-medium",children:[e.jsxs(_e,{className:"size-7",children:[d.member?.avatar_image&&e.jsx("img",{className:"absolute aspect-square size-full",src:d.member?.avatar_image}),e.jsx(Fe,{className:"text-white",style:{backgroundColor:`${Ae(ee(d.member),75,55)}`},children:Te(d.member)})]}),ee(d.member)]}),e.jsx("div",{className:"whitespace-nowrap text-muted-foreground",children:$e(d.created_at)})]},d.id))}):e.jsx("div",{className:"flex h-full items-center justify-center py-8 text-center text-sm text-muted-foreground",children:e.jsxs("div",{children:["No ",o==="positive"?"positive":"negative"," feedback yet"]})})]}):e.jsxs(_,{className:"flex grow flex-col items-center justify-center text-center text-sm text-muted-foreground",children:[e.jsx("div",{children:"No members have given feedback yet"}),e.jsx("div",{children:"When someone does, you'll see their response here."})]}),s.totalFeedback>0&&e.jsx(ce,{className:"grow-0",children:e.jsxs("div",{className:"flex w-full items-center justify-between gap-3",children:[e.jsxs(q,{variant:"outline",onClick:()=>{const d=`(feedback.post_id:'${a}'+feedback.score:1)`,m=`(feedback.post_id:'${a}'+feedback.score:0)`,y=`${encodeURIComponent(d)}&post=${a}`,h=`${encodeURIComponent(m)}&post=${a}`;c(`/members?filter=${o==="positive"?y:h}`,{crossApp:!0})},children:["View all",e.jsx(Oe,{})]}),k>1&&e.jsx(de,{className:"pb-0",children:e.jsxs(me,{children:[e.jsx(pe,{disabled:!l,onClick:R}),e.jsx(ue,{disabled:!C,onClick:v})]})})]})})]})},us=()=>{const{mutateAsync:s,isLoading:a}=ts();return{editLinks:s,isEditLinksLoading:a}},xs=s=>{const{data:a,isLoading:c}=te(s),{data:o,isLoading:x}=te(s,{searchParams:{include:"count.positive_feedback,count.negative_feedback"}}),n=r.useMemo(()=>a?.posts[0],[a]),f=r.useMemo(()=>o?.posts[0],[o]),F=r.useMemo(()=>n?{sent:n.email?.email_count||0,opened:n.email?.opened_count||0,clicked:n.count?.clicks||0,openedRate:n.email?.opened_count?n.email.opened_count/n.email.email_count:0,clickedRate:n.count?.clicks&&n.email?.email_count?n.count.clicks/n.email.email_count:0}:{sent:0,opened:0,clicked:0,openedRate:0,clickedRate:0},[n]),L=r.useMemo(()=>{if(!f?.count)return{positiveFeedback:0,negativeFeedback:0,totalFeedback:0};const p=f.count.positive_feedback||0,w=f.count.negative_feedback||0,j=p+w;return{positiveFeedback:p,negativeFeedback:w,totalFeedback:j}},[f]),k=r.useMemo(()=>n?.newsletter?.id,[n]),{data:i,isLoading:v}=ls({searchParams:k?{newsletter_id:k}:{},enabled:!!k}),R=r.useMemo(()=>i?.stats?i.stats.map(p=>p.post_id):[],[i]),{data:C,isLoading:l}=cs({searchParams:k&&R.length>0?{newsletter_id:k,post_ids:R.join(",")}:{},enabled:!!k&&R.length>0}),g=r.useMemo(()=>{if(!i?.stats)return;const p=i.stats,w=C?.stats||[],j=new Map;w.forEach(b=>{j.set(b.post_id,b)});const S=p.map(b=>{const z=j.get(b.post_id);return{...b,total_clicks:z?.total_clicks||0,click_rate:z?.click_rate||0}});return{...i,stats:S}},[i,C]),d=v||l,{data:m,isLoading:y,refetch:h}=as({searchParams:{filter:`post_id:'${s}'`}}),T=r.useMemo(()=>{if(!g||!g.stats)return{openRate:0,clickRate:0};const p=g.stats;if(p.length===0)return{openRate:0,clickRate:0};const w=p.reduce((S,b)=>S+(b.open_rate||0),0),j=p.reduce((S,b)=>S+(b.click_rate||0),0);return{openRate:Number((w/p.length).toFixed(2)),clickRate:Number((j/p.length).toFixed(2))}},[g]),M=r.useMemo(()=>is(m),[m]),D=r.useMemo(()=>({openedRate:T.openRate,clickedRate:T.clickRate}),[T]);return{post:n,stats:F,feedbackStats:L,averageStats:D,topLinks:M,refetchTopLinks:h,isLoading:c||x||d||y}},gs=({breakpoints:s={sm:1080,md:1280,lg:1360}}={})=>{const[a,c]=r.useState("md");return r.useEffect(()=>{const o=()=>{const x=window.innerWidth;x<s.sm?c("sm"):x<s.md?c("md"):c("lg")};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[s]),{chartSize:a,isSmall:a==="sm",isMedium:a==="md",isLarge:a==="lg"}},ae=()=>e.jsx("div",{className:"absolute -right-4 top-1/2 z-10 hidden size-8 -translate-y-1/2 items-center justify-center rounded-full border bg-background text-muted-foreground md:!visible md:!flex",children:e.jsx(De,{className:"ml-0.5",size:16,strokeWidth:1.5})}),ie=({dataColor:s,value:a,avgValue:c})=>e.jsxs("div",{className:"absolute left-1/2 top-6 z-50 flex w-[200px] -translate-x-1/2 flex-col items-stretch gap-1.5 rounded-md bg-background px-4 py-2 text-sm opacity-0 shadow-md transition-all group-hover/block:top-3 group-hover/block:opacity-100",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx("div",{className:"size-2 rounded-full bg-chart-blue opacity-50",style:{backgroundColor:s}}),"This newsletter"]}),e.jsx("div",{className:"text-right font-mono",children:a})]}),e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx("div",{className:"size-2 rounded-full bg-chart-gray opacity-80"}),"Average"]}),e.jsx("div",{className:"text-right font-mono",children:c})]})]}),et=()=>{const s=re(),[a,c]=r.useState(null),[o,x]=r.useState(""),n=r.useRef(null),f=r.useRef(null),F=10,{chartSize:L}=gs(),{appSettings:k}=ze(),{emailTrackClicks:i,emailTrackOpens:v}=k?.analytics||{},{post:R,isPostLoading:C,postId:l}=rs(),g=R,d=ns(g);r.useEffect(()=>{!C&&!d&&s(`/posts/analytics/${l}`)},[s,l,C,d]);const{stats:m,averageStats:y,topLinks:h,isLoading:T,refetchTopLinks:M}=xs(l),{editLinks:D}=us(),p=r.useMemo(()=>{if(!g?.count)return{positiveFeedback:0,negativeFeedback:0,totalFeedback:0};const t=g.count.positive_feedback||0,u=g.count.negative_feedback||0,P=t+u;return{positiveFeedback:t,negativeFeedback:u,totalFeedback:P}},[g]),w=r.useMemo(()=>g?.newsletter?.feedback_enabled===!0,[g]),j=r.useMemo(()=>p.totalFeedback>0?!0:w,[p.totalFeedback,w]),S=t=>{const u=H(h,t);u&&(c(t),x(u.link.to))},b=()=>{if(!a)return;const t=H(h,a);if(!t)return;const u=o.trim();if(u===""||u===t.link.to){c(null),x("");return}D({originalUrl:t.link.originalTo,editedUrl:o,postId:l},{onSuccess:()=>{c(null),x(""),M()}})},{totalPages:z,paginatedData:xe,nextPage:ge,previousPage:he,hasNextPage:be,hasPreviousPage:fe}=oe({data:h,itemsPerPage:F});r.useEffect(()=>{if(a&&n.current){n.current.focus();const t=H(h,a),u=P=>{f.current&&!f.current.contains(P.target)&&o===t?.link.to&&(c(null),x(""))};return document.addEventListener("mousedown",u),()=>{document.removeEventListener("mousedown",u)}}},[a,o,h]);const I=T||C,ke=[{datatype:"Sent",value:1,fill:"url(#gradientPurple)",color:"hsl(var(--chart-purple))"}],ve={percentage:{label:"O"},Average:{label:"Average"},"This newsletter":{label:"This newsletter"}},je=[{datatype:"Average",value:y.openedRate,fill:"url(#gradientGray)",color:"hsl(var(--chart-gray))"},{datatype:"This newsletter",value:m.openedRate,fill:"url(#gradientBlue)",color:"hsl(var(--chart-blue))"}],Ne={percentage:{label:"Opened"},Average:{label:"Average"},"This newsletter":{label:"This newsletter"}},we=[{datatype:"Average",value:y.clickedRate,fill:"url(#gradientGray)",color:"hsl(var(--chart-gray))"},{datatype:"This newsletter",value:m.clickedRate,fill:"url(#gradientTeal)",color:"hsl(var(--chart-teal))"}],Ce={percentage:{label:"Clicked"},Average:{label:"Average"},"This newsletter":{label:"This newsletter"}};let A="grid-cols-3",$="aspect-[16/10] w-full max-w-[320px] sm:aspect-[2/1] md:aspect-[10/14] md:max-w-none lg:aspect-square";return(!i||!v)&&(A="grid-cols-2",$="aspect-[16/10] w-full max-w-[320px] sm:aspect-[2/1] md:aspect-square md:max-w-none lg:aspect-[15/10]"),!i&&!v&&(A="grid-cols-1",$="aspect-square w-full sm:aspect-[16/10] md:max-w-[320px] md:max-h-[320px] lg:aspect-[12/10]"),e.jsxs(e.Fragment,{children:[e.jsx(Ge,{currentTab:"Newsletter"}),e.jsx(Ke,{children:e.jsxs("div",{className:`grid grid-cols-1 gap-6 ${j&&i&&"lg:grid-cols-2"}`,children:[e.jsxs(Y,{className:j&&i?"lg:col-span-2":"",children:[e.jsxs(Q,{className:"hidden",children:[e.jsx(J,{children:"Newsletters"}),e.jsx(X,{children:"How did this post perform"})]}),I?e.jsx(_,{className:"h-[25vw] p-6",children:e.jsx(Ee,{})}):e.jsxs(_,{className:"p-0",children:[e.jsxs("div",{className:`grid ${A} items-stretch border-b`,children:[e.jsxs(U,{className:"group relative isolate grow p-3 md:px-6 md:py-5",children:[e.jsx(V,{onClick:()=>{const t=new URLSearchParams({filterParam:`emails.post_id:${l}`,postAnalytics:l});s(`/members?${t.toString()}`,{crossApp:!0})},children:"View members →"}),e.jsxs(B,{onClick:()=>{const t=new URLSearchParams({filterParam:`emails.post_id:${l}`,postAnalytics:l});s(`/members?${t.toString()}`,{crossApp:!0})},children:[e.jsx("div",{className:"ml-0.5 size-[9px] rounded-full bg-chart-purple !text-sm opacity-50 lg:text-base"}),"Sent"]}),e.jsx(W,{children:e.jsx(O,{className:"text-xl leading-none sm:text-2xl md:text-[2.6rem]",children:E(m.sent)})})]}),v&&e.jsxs(U,{className:"p-3 md:px-6 md:py-5",children:[e.jsx(V,{onClick:()=>{const t=new URLSearchParams({filterParam:`opened_emails.post_id:${l}`,postAnalytics:l});s(`/members?${t.toString()}`,{crossApp:!0})},children:"View members →"}),e.jsxs(B,{onClick:()=>{const t=new URLSearchParams({filterParam:`opened_emails.post_id:${l}`,postAnalytics:l});s(`/members?${t.toString()}`,{crossApp:!0})},children:[e.jsx("div",{className:"ml-0.5 size-[9px] rounded-full bg-chart-blue !text-sm opacity-50 lg:text-base"}),"Opened"]}),e.jsx(W,{children:e.jsx(O,{className:"text-xl leading-none sm:text-2xl md:text-[2.6rem]",children:E(m.opened)})})]}),i&&e.jsxs(U,{className:"group relative isolate grow p-3 md:px-6 md:py-5",children:[e.jsx(V,{onClick:()=>{const t=new URLSearchParams({filterParam:`clicked_links.post_id:${l}`,postAnalytics:l});s(`/members?${t.toString()}`,{crossApp:!0})},children:"View members →"}),e.jsxs(B,{onClick:()=>{const t=new URLSearchParams({filterParam:`clicked_links.post_id:${l}`,postAnalytics:l});s(`/members?${t.toString()}`,{crossApp:!0})},children:[e.jsx("div",{className:"ml-0.5 size-[9px] rounded-full bg-chart-teal !text-sm opacity-50 lg:text-base"}),"Clicked"]}),e.jsx(W,{children:e.jsx(O,{className:"text-xl leading-none sm:text-2xl md:text-[2.6rem]",children:E(m.clicked)})})]})]}),e.jsxs("div",{className:`$ mx-auto grid grid-cols-1 items-center justify-center gap-4 transition-all md:gap-0 ${A==="grid-cols-2"&&"md:grid-cols-2"} ${A==="grid-cols-3"&&"md:grid-cols-3"}`,children:[e.jsxs("div",{className:`relative border-r-0 px-6 ${(v||i)&&"md:border-r"}`,children:[e.jsx(G,{className:$,config:ve,data:ke,percentageLabel:"Sent",percentageValue:N(1),size:L,tooltip:!1}),(v||i)&&e.jsx(ae,{})]}),v&&e.jsxs("div",{className:`group/block relative border-r-0 px-6 transition-all hover:bg-muted/25 ${i&&"md:border-r"}`,children:[e.jsx(ie,{avgValue:N(y.openedRate),dataColor:"hsl(var(--chart-blue))",value:N(m.openedRate)}),e.jsx(G,{className:$,config:Ne,data:je,percentageLabel:"Open rate",percentageValue:N(m.openedRate),size:L,tooltip:!1}),i&&e.jsx(ae,{})]}),i&&e.jsxs("div",{className:"group/block relative px-6 transition-all hover:bg-muted/25",children:[e.jsx(ie,{avgValue:N(y.clickedRate),dataColor:"hsl(var(--chart-teal))",value:N(m.clickedRate)}),e.jsx(G,{className:$,config:Ce,data:we,percentageLabel:"Click rate",percentageValue:N(m.clickedRate),size:L,tooltip:!1})]})]})]})]}),j&&e.jsx(ps,{feedbackStats:p}),i&&e.jsxs(Y,{className:"group/datalist overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between p-6",children:[e.jsxs(Q,{className:"p-0",children:[e.jsx(J,{children:"Newsletter clicks"}),e.jsx(X,{children:"Which links resonated with your readers"})]}),e.jsx(ne,{className:"mr-2",children:"Members"})]}),I?e.jsxs(_,{className:"p-6 pt-0",children:[e.jsx(K,{}),e.jsx(le,{className:"mt-6"})]}):e.jsxs(_,{className:"pb-0",children:[e.jsx(K,{}),h.length>0?e.jsx(qe,{className:"",children:e.jsx(Ye,{children:xe?.map(t=>{const u=m.clicked>0?t.count/m.clicked:0,P=t.link.link_id,Z=t.link.title,ye=t.link.to,Pe=t.link.edited;return e.jsxs(Qe,{children:[a!==P&&e.jsx(Je,{style:{width:`${u?Math.round(u*100):0}%`}}),e.jsx(Xe,{className:"w-full",children:a===P?e.jsxs("div",{ref:f,className:"flex w-full items-center gap-2",children:[e.jsx(Me,{ref:n,className:"z-50 h-7 w-full border-border bg-background text-sm",value:o,onChange:Le=>x(Le.target.value)}),e.jsx(q,{size:"sm",onClick:b,children:"Update"})]}):e.jsxs(e.Fragment,{children:[e.jsx(q,{className:"mr-2 shrink-0 bg-background",size:"sm",variant:"outline",onClick:()=>S(P),children:e.jsx(He,{})}),e.jsx("a",{className:"block truncate font-medium hover:underline",href:ye,rel:"noreferrer",target:"_blank",title:Z,children:Z}),Pe&&e.jsx("span",{className:"ml-1 text-gray-500",children:"(edited)"})]})}),e.jsxs(Ze,{children:[e.jsx(es,{children:E(t.count||0)}),e.jsx(ss,{children:N(u)})]})]},P)})})}):e.jsx("div",{className:"py-20 text-center text-sm text-gray-700",children:"You have no links in your post."})]}),!I&&h.length>1&&e.jsx(ce,{children:e.jsxs("div",{className:"flex w-full items-start justify-between gap-3",children:[e.jsxs("div",{className:"mt-2 flex items-start gap-2 pl-4 text-sm text-green",children:[e.jsx(We,{size:20,strokeWidth:1.5}),"Sent a broken link? You can update it!"]}),z>1&&e.jsx(de,{className:"pb-0",children:e.jsxs(me,{children:[e.jsx(pe,{disabled:!fe,onClick:he}),e.jsx(ue,{disabled:!be,onClick:ge})]})})]})})]})]})})]})};export{et as default};
@@ -1 +1 @@
1
- import{aj as p,ab as n,ad as u,ae as i}from"./index-CX1A5TwO.js";const a="NewslettersResponseType",d=a,l=p({dataType:a,path:"/newsletters/",defaultSearchParams:{include:"count.active_members,count.posts",limit:"50"},defaultNextPageParams:(e,t)=>{var s;return{...t,page:(((s=e.meta)==null?void 0:s.pagination.next)||1).toString()}},returnData:e=>{const{pages:t}=e,s=t.flatMap(o=>o.newsletters),r=t[t.length-1].meta;return{newsletters:s,meta:r,isEnd:r?r.pagination.pages===r.pagination.page:!0}}}),m=n({method:"POST",path:()=>"/newsletters/",body:({opt_in_existing:e,...t})=>({newsletters:[t]}),searchParams:e=>({opt_in_existing:e.opt_in_existing.toString(),include:"count.active_members,count.posts"}),updateQueries:{dataType:a,emberUpdateType:"createOrUpdate",update:u("newsletters")}}),w=n({method:"PUT",path:e=>`/newsletters/${e.id}/`,body:e=>({newsletters:[e]}),defaultSearchParams:{include:"count.active_members,count.posts"},updateQueries:{dataType:a,emberUpdateType:"createOrUpdate",update:i("newsletters")}}),g=n({method:"PUT",path:()=>"/newsletters/verifications/",body:({token:e})=>({token:e}),defaultSearchParams:{include:"count.active_members,count.posts"},updateQueries:{dataType:a,emberUpdateType:"createOrUpdate",update:i("newsletters")}});export{m as a,w as b,g as c,d as n,l as u};
1
+ import{aj as p,ab as n,ad as u,ae as i}from"./index-CM-iA6b-.js";const a="NewslettersResponseType",d=a,l=p({dataType:a,path:"/newsletters/",defaultSearchParams:{include:"count.active_members,count.posts",limit:"50"},defaultNextPageParams:(e,t)=>{var s;return{...t,page:(((s=e.meta)==null?void 0:s.pagination.next)||1).toString()}},returnData:e=>{const{pages:t}=e,s=t.flatMap(o=>o.newsletters),r=t[t.length-1].meta;return{newsletters:s,meta:r,isEnd:r?r.pagination.pages===r.pagination.page:!0}}}),m=n({method:"POST",path:()=>"/newsletters/",body:({opt_in_existing:e,...t})=>({newsletters:[t]}),searchParams:e=>({opt_in_existing:e.opt_in_existing.toString(),include:"count.active_members,count.posts"}),updateQueries:{dataType:a,emberUpdateType:"createOrUpdate",update:u("newsletters")}}),w=n({method:"PUT",path:e=>`/newsletters/${e.id}/`,body:e=>({newsletters:[e]}),defaultSearchParams:{include:"count.active_members,count.posts"},updateQueries:{dataType:a,emberUpdateType:"createOrUpdate",update:i("newsletters")}}),g=n({method:"PUT",path:()=>"/newsletters/verifications/",body:({token:e})=>({token:e}),defaultSearchParams:{include:"count.active_members,count.posts"},updateQueries:{dataType:a,emberUpdateType:"createOrUpdate",update:i("newsletters")}});export{m as a,w as b,g as c,d as n,l as u};
@@ -1 +1 @@
1
- import{u as Z,a as _,r as a,b as G,j as e,L as N,S as r,E as ee,c as te,P as se,A as ne,g as ae,d as oe,h as le,F as j,e as ce,i as y,f as ie}from"./index-CX1A5TwO.js";import{u as re,D as de,A as ue,S as A}from"./deleted-feed-item-Bmxp6PAR.js";import{H as xe}from"./hash-tZATAzZa.js";import"./trash-D6TuYuIs.js";const C=()=>e.jsx("div",{className:"h-px w-full bg-gray-200 dark:bg-gray-950"}),Ce=()=>{const{postId:$}=Z(),{canGoBack:R}=_(),[U,z]=a.useState(new Set),[B,T]=a.useState(new Set),[k,S]=a.useState(new Set),[p,P]=a.useState(!1),H=a.useRef(null),w=a.useRef(null),d=a.useRef(null),v=a.useRef(null),m=G(),{threadParents:u,post:n,processedReplies:E,isLoading:I,loadMoreChildren:D,loadMoreChildReplies:F,hasMoreChildren:b,hasMoreChildReplies:f}=re(decodeURIComponent($??""),{includeAncestors:!0}),o=n?.object,V=o?.replyCount??0,[L,q]=a.useState(!1);if(a.useEffect(()=>{w.current&&u.length>0&&!L&&(w.current.scrollIntoView({behavior:"instant",block:"start"}),q(!0))},[u,L]),a.useEffect(()=>{d.current&&d.current.disconnect();const t=document.querySelector("[data-scrollable-container]");if(t)return d.current=new IntersectionObserver(async l=>{if(l[0].isIntersecting&&b&&!p){P(!0);try{await D()}catch(s){console.error("Failed to load more top-level replies:",s)}finally{P(!1)}}},{root:t,rootMargin:"200px"}),v.current&&d.current.observe(v.current),()=>{d.current&&d.current.disconnect()}},[b,p,D]),I)return e.jsx(N,{children:e.jsxs("div",{className:"mx-auto flex max-w-[620px] flex-col items-center gap-3 pt-9 lg:px-8",children:[e.jsxs("div",{className:"flex w-full items-center gap-3",children:[e.jsx(r,{className:"size-10 rounded-full"}),e.jsxs("div",{className:"grow pt-1",children:[e.jsx(r,{className:"w-24"}),e.jsx(r,{className:"w-3/5"})]})]}),e.jsxs("div",{className:"mb-7 w-full",children:[e.jsx(r,{}),e.jsx(r,{className:"w-4/5"}),e.jsx(r,{})]}),e.jsx(C,{}),e.jsxs("div",{className:"flex w-full items-center gap-3 py-3",children:[e.jsx(r,{className:"block size-full",containerClassName:"size-10 rounded-full overflow-hidden"}),e.jsxs("div",{children:[e.jsx(r,{className:"w-52"}),e.jsx(r,{className:"w-28"})]})]}),e.jsx(C,{})]})});if(!n)return e.jsx(N,{children:e.jsx("div",{className:"mx-auto mt-4 flex w-full max-w-[620px] flex-col items-center",children:e.jsxs(ee,{children:[e.jsx(te,{children:e.jsx(xe,{})}),e.jsx("div",{children:"Error loading note."})]})})});function g(){}function O(t){z(l=>{const s=new Set(l);return s.has(t)?s.delete(t):(s.add(t),T(c=>{const x=new Set(c);return x.add(t),x})),s})}async function W(t,l){if(!k.has(t)){S(s=>new Set(s).add(t));try{F&&await F(l)}catch(s){console.error("Failed to load more replies for chain:",s)}finally{S(s=>{const c=new Set(s);return c.delete(t),c})}}}return e.jsx(N,{children:e.jsx("div",{className:"mx-auto flex h-full max-w-[620px] flex-col",children:e.jsx("div",{className:"relative flex-1",children:e.jsx("div",{className:"grow overflow-y-auto",children:e.jsxs("div",{className:"mx-auto px-8 pb-10 pt-5 max-lg:px-0",children:[!u.length&&e.jsx(se,{actor:n.actor,isCurrentUser:n.object.authored,children:e.jsxs("div",{className:`col-[2/3] mx-auto flex w-full cursor-pointer items-center gap-3 ${R?"pt-10 max-md:pt-5":"pt-5"}`,children:[e.jsx("div",{className:"relative z-10",children:e.jsx(ne,{author:n.actor,showFollowButton:!n.object.authored&&!n.actor.followedByMe})}),e.jsxs("div",{className:"relative z-10 flex w-full min-w-0 cursor-pointer flex-col overflow-visible text-[1.5rem]",onClick:t=>{le(n.actor,m,t)},children:[e.jsx("div",{className:"flex w-full",children:e.jsx("span",{className:"min-w-0 truncate whitespace-nowrap font-semibold hover:underline",children:n.actor.name})}),e.jsxs("div",{className:"flex w-full",children:[e.jsx("span",{className:'truncate text-gray-700 after:mx-1 after:font-normal after:text-gray-700 after:content-["·"]',children:ae(n.actor)}),e.jsx("span",{className:"text-gray-700",children:oe(o,!o.authored)})]})]})]})}),u.map(t=>t.object.type==="Tombstone"?e.jsx(de,{last:!1}):e.jsx(j,{actor:t.actor,allowDelete:!1,commentCount:t.object.replyCount??0,last:!1,layout:"reply",likeCount:t.object.likeCount??0,object:t.object,repostCount:t.object.repostCount??0,type:"Note",onClick:()=>{m(`/${t.object.type==="Article"?"reader":"notes"}/${encodeURIComponent(t.object.id)}`)}})),e.jsx("div",{ref:w,className:`${R?"scroll-mt-[12px]":"scroll-mt-[124px]"}`,children:e.jsxs("div",{className:`${u.length>0&&"min-h-[calc(100vh-52px)]"}`,children:[e.jsx(j,{actor:n.actor,allowDelete:!1,commentCount:V,last:!0,layout:"modal",likeCount:o.likeCount??0,object:o,repostCount:o.repostCount,showHeader:u.length>0,showStats:!0,type:"Note"}),e.jsx(ue,{object:o}),e.jsx(C,{}),e.jsxs("div",{ref:H,children:[E.map((t,l)=>{const s=l===E.length-1,c=t.mainReply.id,x=U.has(c),J=B.has(c),K=k.has(c),h=t.chain.length>0;return e.jsxs(ce.Fragment,{children:[e.jsx(j,{actor:t.mainReply.actor,allowDelete:t.mainReply.object.authored,commentCount:t.mainReply.object.replyCount??0,isChainParent:h,isPending:y(t.mainReply.id),last:!h,layout:"reply",likeCount:t.mainReply.object.likeCount??0,object:t.mainReply.object,parentId:o.id,repostCount:t.mainReply.object.repostCount??0,type:"Note",onClick:()=>{m(`/notes/${encodeURIComponent(t.mainReply.id)}`)},onDelete:g}),h&&t.chain[0]&&e.jsx(j,{actor:t.chain[0].actor,allowDelete:t.chain[0].object.authored,commentCount:t.chain[0].object.replyCount??0,isChainContinuation:!0,isPending:y(t.chain[0].id),last:t.chain.length===1,layout:"reply",likeCount:t.chain[0].object.likeCount??0,object:t.chain[0].object,parentId:o.id,repostCount:t.chain[0].object.repostCount??0,type:"Note",onClick:()=>{m(`/notes/${encodeURIComponent(t.chain[0].id)}`)},onDelete:g},t.chain[0].id),h&&x&&t.chain.slice(1).map((i,Q)=>{const M=Q===t.chain.slice(1).length-1,X=f&&f(l),Y=M&&X;return e.jsx(j,{actor:i.actor,allowDelete:i.object.authored,commentCount:i.object.replyCount??0,isChainContinuation:!0,isPending:y(i.id),last:M&&!Y,layout:"reply",likeCount:i.object.likeCount??0,object:i.object,parentId:o.id,repostCount:i.object.repostCount??0,type:"Note",onClick:()=>{m(`/notes/${encodeURIComponent(i.id)}`)},onDelete:g},i.id)}),h&&t.chain.length>1&&!x&&e.jsx(A,{variant:"expand",onClick:()=>O(c)}),h&&x&&J&&f&&f(l)&&e.jsx(A,{loading:K,variant:"loadMore",onClick:()=>W(c,l)}),!s&&e.jsx(C,{})]},t.mainReply.id)}),p&&e.jsx("div",{className:"flex flex-col items-center justify-center text-center",children:e.jsx(ie,{size:"md"})})]}),b&&e.jsx("div",{ref:v,className:"h-1"})]})})]})})})})})};export{Ce as default};
1
+ import{u as Z,a as _,r as a,b as G,j as e,L as N,S as r,E as ee,c as te,P as se,A as ne,g as ae,d as oe,h as le,F as j,e as ce,i as y,f as ie}from"./index-CM-iA6b-.js";import{u as re,D as de,A as ue,S as A}from"./deleted-feed-item-DjkZpKDC.js";import{H as xe}from"./hash-twG7-iIB.js";import"./trash-B4ncKmRu.js";const C=()=>e.jsx("div",{className:"h-px w-full bg-gray-200 dark:bg-gray-950"}),Ce=()=>{const{postId:$}=Z(),{canGoBack:R}=_(),[U,z]=a.useState(new Set),[B,T]=a.useState(new Set),[k,S]=a.useState(new Set),[p,P]=a.useState(!1),H=a.useRef(null),w=a.useRef(null),d=a.useRef(null),v=a.useRef(null),m=G(),{threadParents:u,post:n,processedReplies:E,isLoading:I,loadMoreChildren:D,loadMoreChildReplies:F,hasMoreChildren:b,hasMoreChildReplies:f}=re(decodeURIComponent($??""),{includeAncestors:!0}),o=n?.object,V=o?.replyCount??0,[L,q]=a.useState(!1);if(a.useEffect(()=>{w.current&&u.length>0&&!L&&(w.current.scrollIntoView({behavior:"instant",block:"start"}),q(!0))},[u,L]),a.useEffect(()=>{d.current&&d.current.disconnect();const t=document.querySelector("[data-scrollable-container]");if(t)return d.current=new IntersectionObserver(async l=>{if(l[0].isIntersecting&&b&&!p){P(!0);try{await D()}catch(s){console.error("Failed to load more top-level replies:",s)}finally{P(!1)}}},{root:t,rootMargin:"200px"}),v.current&&d.current.observe(v.current),()=>{d.current&&d.current.disconnect()}},[b,p,D]),I)return e.jsx(N,{children:e.jsxs("div",{className:"mx-auto flex max-w-[620px] flex-col items-center gap-3 pt-9 lg:px-8",children:[e.jsxs("div",{className:"flex w-full items-center gap-3",children:[e.jsx(r,{className:"size-10 rounded-full"}),e.jsxs("div",{className:"grow pt-1",children:[e.jsx(r,{className:"w-24"}),e.jsx(r,{className:"w-3/5"})]})]}),e.jsxs("div",{className:"mb-7 w-full",children:[e.jsx(r,{}),e.jsx(r,{className:"w-4/5"}),e.jsx(r,{})]}),e.jsx(C,{}),e.jsxs("div",{className:"flex w-full items-center gap-3 py-3",children:[e.jsx(r,{className:"block size-full",containerClassName:"size-10 rounded-full overflow-hidden"}),e.jsxs("div",{children:[e.jsx(r,{className:"w-52"}),e.jsx(r,{className:"w-28"})]})]}),e.jsx(C,{})]})});if(!n)return e.jsx(N,{children:e.jsx("div",{className:"mx-auto mt-4 flex w-full max-w-[620px] flex-col items-center",children:e.jsxs(ee,{children:[e.jsx(te,{children:e.jsx(xe,{})}),e.jsx("div",{children:"Error loading note."})]})})});function g(){}function O(t){z(l=>{const s=new Set(l);return s.has(t)?s.delete(t):(s.add(t),T(c=>{const x=new Set(c);return x.add(t),x})),s})}async function W(t,l){if(!k.has(t)){S(s=>new Set(s).add(t));try{F&&await F(l)}catch(s){console.error("Failed to load more replies for chain:",s)}finally{S(s=>{const c=new Set(s);return c.delete(t),c})}}}return e.jsx(N,{children:e.jsx("div",{className:"mx-auto flex h-full max-w-[620px] flex-col",children:e.jsx("div",{className:"relative flex-1",children:e.jsx("div",{className:"grow overflow-y-auto",children:e.jsxs("div",{className:"mx-auto px-8 pb-10 pt-5 max-lg:px-0",children:[!u.length&&e.jsx(se,{actor:n.actor,isCurrentUser:n.object.authored,children:e.jsxs("div",{className:`col-[2/3] mx-auto flex w-full cursor-pointer items-center gap-3 ${R?"pt-10 max-md:pt-5":"pt-5"}`,children:[e.jsx("div",{className:"relative z-10",children:e.jsx(ne,{author:n.actor,showFollowButton:!n.object.authored&&!n.actor.followedByMe})}),e.jsxs("div",{className:"relative z-10 flex w-full min-w-0 cursor-pointer flex-col overflow-visible text-[1.5rem]",onClick:t=>{le(n.actor,m,t)},children:[e.jsx("div",{className:"flex w-full",children:e.jsx("span",{className:"min-w-0 truncate whitespace-nowrap font-semibold hover:underline",children:n.actor.name})}),e.jsxs("div",{className:"flex w-full",children:[e.jsx("span",{className:'truncate text-gray-700 after:mx-1 after:font-normal after:text-gray-700 after:content-["·"]',children:ae(n.actor)}),e.jsx("span",{className:"text-gray-700",children:oe(o,!o.authored)})]})]})]})}),u.map(t=>t.object.type==="Tombstone"?e.jsx(de,{last:!1}):e.jsx(j,{actor:t.actor,allowDelete:!1,commentCount:t.object.replyCount??0,last:!1,layout:"reply",likeCount:t.object.likeCount??0,object:t.object,repostCount:t.object.repostCount??0,type:"Note",onClick:()=>{m(`/${t.object.type==="Article"?"reader":"notes"}/${encodeURIComponent(t.object.id)}`)}})),e.jsx("div",{ref:w,className:`${R?"scroll-mt-[12px]":"scroll-mt-[124px]"}`,children:e.jsxs("div",{className:`${u.length>0&&"min-h-[calc(100vh-52px)]"}`,children:[e.jsx(j,{actor:n.actor,allowDelete:!1,commentCount:V,last:!0,layout:"modal",likeCount:o.likeCount??0,object:o,repostCount:o.repostCount,showHeader:u.length>0,showStats:!0,type:"Note"}),e.jsx(ue,{object:o}),e.jsx(C,{}),e.jsxs("div",{ref:H,children:[E.map((t,l)=>{const s=l===E.length-1,c=t.mainReply.id,x=U.has(c),J=B.has(c),K=k.has(c),h=t.chain.length>0;return e.jsxs(ce.Fragment,{children:[e.jsx(j,{actor:t.mainReply.actor,allowDelete:t.mainReply.object.authored,commentCount:t.mainReply.object.replyCount??0,isChainParent:h,isPending:y(t.mainReply.id),last:!h,layout:"reply",likeCount:t.mainReply.object.likeCount??0,object:t.mainReply.object,parentId:o.id,repostCount:t.mainReply.object.repostCount??0,type:"Note",onClick:()=>{m(`/notes/${encodeURIComponent(t.mainReply.id)}`)},onDelete:g}),h&&t.chain[0]&&e.jsx(j,{actor:t.chain[0].actor,allowDelete:t.chain[0].object.authored,commentCount:t.chain[0].object.replyCount??0,isChainContinuation:!0,isPending:y(t.chain[0].id),last:t.chain.length===1,layout:"reply",likeCount:t.chain[0].object.likeCount??0,object:t.chain[0].object,parentId:o.id,repostCount:t.chain[0].object.repostCount??0,type:"Note",onClick:()=>{m(`/notes/${encodeURIComponent(t.chain[0].id)}`)},onDelete:g},t.chain[0].id),h&&x&&t.chain.slice(1).map((i,Q)=>{const M=Q===t.chain.slice(1).length-1,X=f&&f(l),Y=M&&X;return e.jsx(j,{actor:i.actor,allowDelete:i.object.authored,commentCount:i.object.replyCount??0,isChainContinuation:!0,isPending:y(i.id),last:M&&!Y,layout:"reply",likeCount:i.object.likeCount??0,object:i.object,parentId:o.id,repostCount:i.object.repostCount??0,type:"Note",onClick:()=>{m(`/notes/${encodeURIComponent(i.id)}`)},onDelete:g},i.id)}),h&&t.chain.length>1&&!x&&e.jsx(A,{variant:"expand",onClick:()=>O(c)}),h&&x&&J&&f&&f(l)&&e.jsx(A,{loading:K,variant:"loadMore",onClick:()=>W(c,l)}),!s&&e.jsx(C,{})]},t.mainReply.id)}),p&&e.jsx("div",{className:"flex flex-col items-center justify-center text-center",children:e.jsx(ie,{size:"md"})})]}),b&&e.jsx("div",{ref:v,className:"h-1"})]})})]})})})})})};export{Ce as default};
@@ -1 +1 @@
1
- import{aa as r,ab as s,ac as t,ad as f,ae as o,af as d}from"./index-CX1A5TwO.js";const a="OffersResponseType",p=()=>{const e=d();return()=>e.invalidateQueries([a])},c=t({dataType:a,path:"/offers/",defaultSearchParams:{}}),n=r({dataType:a,path:e=>`/offers/${e}/`}),i=s({method:"PUT",path:e=>`/offers/${e.id}/`,body:e=>({offers:[e]}),updateQueries:{dataType:a,emberUpdateType:"createOrUpdate",update:o("offers")}}),y=s({method:"POST",path:()=>"/offers/",body:e=>({offers:[e]}),updateQueries:{dataType:a,emberUpdateType:"createOrUpdate",update:f("offers")}});export{n as a,y as b,i as c,p as d,c as u};
1
+ import{aa as r,ab as s,ac as t,ad as f,ae as o,af as d}from"./index-CM-iA6b-.js";const a="OffersResponseType",p=()=>{const e=d();return()=>e.invalidateQueries([a])},c=t({dataType:a,path:"/offers/",defaultSearchParams:{}}),n=r({dataType:a,path:e=>`/offers/${e}/`}),i=s({method:"PUT",path:e=>`/offers/${e.id}/`,body:e=>({offers:[e]}),updateQueries:{dataType:a,emberUpdateType:"createOrUpdate",update:o("offers")}}),y=s({method:"POST",path:()=>"/offers/",body:e=>({offers:[e]}),updateQueries:{dataType:a,emberUpdateType:"createOrUpdate",update:f("offers")}});export{n as a,y as b,i as c,p as d,c as u};
@@ -1 +1 @@
1
- import{u as Y,aT as A,r as h,j as e,B as V,aU as E,an as C,aV as D,aW as X,ai as re,ao as f,aX as F,aY as ie,aZ as le,ak as oe,al as U,a_ as ne,S as q}from"./index-CX1A5TwO.js";import{u as ce,c as de,D as me}from"./growth-DXHnB1EQ.js";import{K as L,a as S,b as _,c as T}from"./kpi-card-DQ1AbLJB.js";import{C as K,a as O,b as P,c as y,K as R,d as I,e as M,u as Q}from"./pagemenu-DK1tbdsq.js";import{D as pe,a as he,b as xe,c as ue,d as ge,e as je,f as fe,g as ve}from"./data-list--5Xfh5gm.js";import{u as be,p as Ne,N as ye,c as we}from"./links-BE51SJxR.js";import{M as ke}from"./user-plus-CKQ-d0d4.js";import{P as Ce,a as Le}from"./post-analytics-header-qh1LEasb.js";import{S as Se,K as _e}from"./kpis-vcbQvnLh.js";import{E as Te}from"./empty-indicator-C1cLHSRX.js";import{G as De}from"./gh-chart-BYWaeEuY.js";import{u as Z,S as Re}from"./post-analytics-context-D8nk51yA.js";import{h as Ie,i as Me}from"./post-helpers-gInwAwEv.js";import{S as Ae}from"./sprout-BKOFkdV8.js";import"./wallet-cards-BlDtHc6_.js";import"./source-icon-opy8g_Nk.js";import"./source-utils-B1S3ZHA2.js";import"./table-CwbnKMYe.js";import"./currency-fEUUCkj0.js";import"./stats-DXXxmfRV.js";import"./chart-BDdnkPgC.js";import"./_baseAssignValue-Dw5pcaUJ.js";import"./PolarAngleAxis-a31TecIQ.js";import"./post-share-modal-CvTf3PP9.js";import"./get-site-timezone-BDBAcjmq.js";import"./posts-mIxckqHa.js";import"./trash-D6TuYuIs.js";import"./lucide-react-DHFgHS1l.js";import"./a-large-small-Cf_hUupE.js";import"./list-filter-BwnQ0Xlp.js";import"./ticket-BnxPoED1.js";import"./at-sign-DyMz5le1.js";import"./loader-circle-CcLEGvsN.js";import"./message-square-text-BkERj4f5.js";import"./copy-BdseBMKx.js";import"./hash-tZATAzZa.js";import"./inbox-B-LuWyHY.js";import"./minus-C6oMPJo2.js";import"./tags-C3b5AHTm.js";import"./square-BjZk7vJx.js";import"./user-round-check-BWc7Da4S.js";import"./repeat-Idtsb62O.js";import"./reply-DXS-C-Rk.js";import"./tabs-hfT89L_O.js";import"./index-BX0_v5NB.js";const Ve=({post:o,isNewsletterStatsLoading:c,isWebShown:x})=>{const{postId:s}=Y(),a=A(),t=h.useMemo(()=>{const l=o.email?.opened_count||0,r=o.email?.email_count||0,p=o.count?.clicks||0;return{opened:l,clicked:p,openedRate:r>0?l/r:0,clickedRate:r>0?p/r:0,sent:r}},[o]),{data:m}=be({searchParams:{filter:`post_id:'${s}'`}}),u=h.useMemo(()=>Ne(m),[m]),g=[{datatype:"Clicked",value:t.clickedRate,fill:"url(#gradientTeal)",color:"hsl(var(--chart-teal))"},{datatype:"Opened",value:t.openedRate,fill:"url(#gradientBlue)",color:"hsl(var(--chart-blue))"}],n={percentage:{label:"Opened"},Average:{label:"Clicked"},"This newsletter":{label:"Opened"}},i=o.email_only||!x;return e.jsxs(K,{className:`group/datalist overflow-hidden ${i&&"col-span-2"}`,children:[e.jsxs("div",{className:"relative flex items-center justify-between gap-6",children:[e.jsx(O,{children:e.jsxs(P,{className:"flex items-center gap-1.5 text-lg",children:[e.jsx(ke,{size:16,strokeWidth:1.5}),"Newsletter performance"]})}),e.jsx(V,{className:"absolute right-6 translate-x-10 opacity-0 transition-all duration-300 group-hover/datalist:translate-x-0 group-hover/datalist:opacity-100",size:"sm",variant:"outline",onClick:()=>{a(`/posts/analytics/${s}/newsletter`)},children:"View more"})]}),c?e.jsx(y,{children:e.jsx("div",{className:"mx-auto flex min-h-[250px] items-center justify-center xl:size-full",children:e.jsx(E,{})})}):e.jsxs(y,{className:`${i&&"grid grid-cols-2"}`,children:[e.jsxs("div",{className:`${i&&"border-r pr-6"}`,children:[e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsx(R,{className:"group relative flex grow flex-row items-start justify-between gap-5 border-none px-0 pt-0",children:e.jsxs("div",{className:"flex grow flex-col gap-1.5 border-none pb-0",children:[e.jsx(I,{color:"hsl(var(--chart-blue))",children:"Open rate"}),e.jsx(M,{value:C(t.openedRate)})]})}),e.jsx(R,{className:"group relative flex grow flex-row items-start justify-between gap-5 border-none px-0 pt-0",children:e.jsxs("div",{className:"flex grow flex-col gap-1.5 border-none pb-0",children:[e.jsx(I,{color:"hsl(var(--chart-teal))",children:"Click rate"}),e.jsx(M,{value:C(t.clickedRate)})]})})]}),!i&&e.jsx(D,{}),e.jsx("div",{className:"mx-auto my-6 h-[240px]",children:e.jsx(ye,{className:"pointer-events-none aspect-square h-[240px]",config:n,data:g,tooltip:!1})})]}),e.jsxs("div",{className:`${i&&"pl-6"}`,children:[!i&&e.jsx(D,{}),e.jsxs("div",{className:i?"":"pt-3",children:[e.jsxs("div",{className:`flex items-center justify-between gap-3 ${i?"pb-3":"py-3"}`,children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:"Top clicked links in this email"}),e.jsx(X,{children:"Members"})]}),u.length>0?e.jsx(pe,{className:"",children:e.jsx(he,{children:u.slice(0,i?10:5).map(l=>{const r=t.clicked>0?l.count/t.clicked:0;return e.jsxs(xe,{children:[e.jsx(ue,{style:{width:`${r?Math.round(r*100):0}%`}}),e.jsx(ge,{children:e.jsxs("div",{className:"flex items-center space-x-2 overflow-hidden",children:[e.jsx(re,{className:"shrink-0 text-muted-foreground",size:16,strokeWidth:1.5}),e.jsx("a",{className:"block truncate font-medium hover:underline",href:l.link.to,rel:"noreferrer",target:"_blank",title:l.link.to,children:we(l.link.to,!0)})]})}),e.jsxs(je,{children:[e.jsx(fe,{children:f(l.count||0)}),e.jsx(ve,{children:C(r)})]})]},l.link.link_id)})})}):e.jsx("div",{className:"py-20 text-center text-sm text-gray-700",children:"You have no links in your post."})]})]})]})]})},Ee=({chartData:o,range:c,isLoading:x,visitors:s,sourcesData:a,isNewsletterShown:t=!0})=>{const{postId:m}=Y(),u=A(),{data:g}=Z(),n=g?.url,i=g?.icon,l=h.useMemo(()=>a?a.reduce((r,p)=>r+Number(p.visits||0),0):0,[a]);return e.jsx(e.Fragment,{children:e.jsxs(K,{className:`group/datalist overflow-hidden ${!t&&"col-span-2"}`,"data-testid":"web-performance",children:[e.jsxs("div",{className:"relative flex items-center justify-between gap-6",children:[e.jsx(O,{children:e.jsxs(P,{className:"flex items-center gap-1.5 text-lg",children:[e.jsx(F,{size:16,strokeWidth:1.5}),"Web performance"]})}),e.jsx(V,{className:"absolute right-6 translate-x-10 opacity-0 transition-all duration-300 group-hover/datalist:translate-x-0 group-hover/datalist:opacity-100",size:"sm",variant:"outline",onClick:()=>{u(`/posts/analytics/${m}/web`)},children:"View more"})]}),e.jsxs(y,{children:[e.jsxs("div",{children:[e.jsx(R,{className:"group relative flex grow flex-row items-start justify-between gap-5 border-none px-0 pt-0","data-testid":"unique-visitors",children:e.jsxs("div",{className:"flex grow flex-col gap-1.5 border-none pb-0",children:[e.jsx(I,{color:"hsl(var(--chart-blue))",children:"Unique visitors"}),e.jsx(M,{value:f(s)})]})}),e.jsx(D,{}),e.jsx("div",{className:"max-h-[288px] py-6 [&_.recharts-cartesian-axis-tick-value]:fill-gray-500",children:x?e.jsx("div",{className:"flex h-[16vw] min-h-[240px] items-center justify-center",children:e.jsx(E,{})}):e.jsx(De,{className:"aspect-auto h-[240px] w-full",color:"hsl(var(--chart-blue))",data:o||[],id:"visitors",range:c,syncId:"overview-charts"})})]}),t&&e.jsxs("div",{className:t?"border-t pt-3":"-mt-3",children:[e.jsx("div",{children:e.jsxs("div",{className:"flex items-center justify-between gap-3 py-3",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:"How readers found this post"}),e.jsx(X,{children:"Visitors"})]})}),a&&a.length>0?e.jsx(Se,{data:a,range:c,siteIcon:i,siteUrl:n,tableOnly:!0,topSourcesLimit:5,totalVisitors:l}):e.jsx(Te,{className:"h-full py-10",description:"Once someone visits this post, sources will show here",title:"No visitors since you published this post",children:e.jsx(F,{strokeWidth:1.5})})]})]})]})})},_s=()=>{const o=A(),{statsConfig:c,isLoading:x,post:s,isPostLoading:a,postId:t}=Z(),{totals:m,isLoading:u,currencySymbol:g}=ce(t),{appSettings:n}=ie(),{emailTrackClicks:i,emailTrackOpens:l}=n?.analytics||{},r=h.useMemo(()=>s?.published_at?le(s.published_at):Re.ALL_TIME.value,[s?.published_at]),{startDate:p,endDate:z,timezone:$}=oe(r),W=h.useMemo(()=>{const d={site_uuid:c?.id||"",date_from:U(p),date_to:U(z),timezone:$,post_uuid:""};return!a&&s?.uuid?{...d,post_uuid:s.uuid}:d},[a,s,c?.id,p,z,$]),{data:v,loading:G}=Q({endpoint:"api_kpis",statsConfig:c||{id:""},params:W}),J=h.useMemo(()=>v?.length?v.reduce((d,j)=>{const H=Number(j.visits);return d+(isNaN(H)?0:H)},0):0,[v]),b=_e.visits,ee=ne(v||[],r,b.dataKey,"sum")?.map(d=>{const j=Number(d[b.dataKey]);return{date:String(d.date),value:j,formattedValue:b.formatter(j),label:b.label}}),{data:se,loading:ae}=Q({endpoint:"api_top_sources",statsConfig:c||{id:""},params:W}),B=x||u||a||G,te=a||x||G,w=Ie(s)&&l&&i,k=!s?.email_only&&n?.analytics.webAnalytics,N=n?.analytics.membersTrackSources;return h.useEffect(()=>{!a&&s&&Me(s)&&!n?.analytics.webAnalytics&&N&&o(`/posts/analytics/${t}/growth`,{replace:!0})},[a,s,n?.analytics.webAnalytics,o,t,N]),a?e.jsx(E,{}):e.jsxs(e.Fragment,{children:[e.jsx(Ce,{currentTab:"Overview"}),e.jsx(Le,{children:e.jsxs("div",{className:"flex flex-col gap-6 lg:grid lg:grid-cols-2",children:[k&&e.jsx(Ee,{chartData:ee,isLoading:te||B||ae,isNewsletterShown:w,range:r,sourcesData:se,visitors:J}),w&&e.jsx(Ve,{isNewsletterStatsLoading:a,isWebShown:k,post:s}),N&&e.jsxs(K,{className:"group col-span-2 overflow-hidden p-0","data-testid":"growth",children:[e.jsxs("div",{className:"relative flex items-center justify-between gap-6",children:[e.jsx(O,{children:e.jsxs(P,{className:"flex items-center gap-1.5 text-lg",children:[e.jsx(Ae,{size:16,strokeWidth:1.5}),"Growth"]})}),e.jsx(V,{className:"absolute right-6 translate-x-10 opacity-0 transition-all duration-200 group-hover:translate-x-0 group-hover:opacity-100",size:"sm",variant:"outline",onClick:()=>{o(`/posts/analytics/${t}/growth`)},children:"View more"})]}),e.jsx(y,{className:"flex flex-col gap-6 px-0 md:grid md:grid-cols-3 md:items-stretch md:gap-0",children:B?Array.from({length:3},(d,j)=>e.jsxs("div",{className:"h-[98px] gap-1 border-r px-6 py-5 last:border-r-0",children:[e.jsx(q,{className:"w-2/3"}),e.jsx(q,{className:"h-7 w-12"})]},j)):e.jsxs(e.Fragment,{children:[e.jsxs(L,{className:"grow gap-1 py-0",children:[e.jsx(S,{children:"Free members"}),e.jsx(_,{children:e.jsx(T,{className:"text-[2.2rem]",children:f(m?.free_members||0)})})]}),n?.paidMembersEnabled&&e.jsxs(e.Fragment,{children:[e.jsxs(L,{className:"grow gap-1 py-0",children:[e.jsx(S,{children:"Paid members"}),e.jsx(_,{children:e.jsx(T,{className:"text-[2.2rem]",children:f(m?.paid_members||0)})})]}),e.jsxs(L,{className:"grow gap-1 py-0",children:[e.jsx(S,{children:"MRR impact"}),e.jsx(_,{children:e.jsxs(T,{className:"text-[2.2rem]",children:[g,f(de(m?.mrr||0))]})})]})]})]})})]}),!k&&!w&&!N&&e.jsx(me,{className:"col-span-2 py-20"})]})})]})};export{_s as default};
1
+ import{u as Y,aT as A,r as h,j as e,B as V,aU as E,an as C,aV as D,aW as X,ai as re,ao as f,aX as F,aY as ie,aZ as le,ak as oe,al as U,a_ as ne,S as q}from"./index-CM-iA6b-.js";import{u as ce,c as de,D as me}from"./growth-CKOWA1_V.js";import{K as L,a as S,b as _,c as T}from"./kpi-card-B6fmS7IH.js";import{C as K,a as O,b as P,c as y,K as R,d as I,e as M,u as Q}from"./pagemenu-Cr7_YYR8.js";import{D as pe,a as he,b as xe,c as ue,d as ge,e as je,f as fe,g as ve}from"./data-list-nZOiCWV9.js";import{u as be,p as Ne,N as ye,c as we}from"./links-DQSOljcR.js";import{M as ke}from"./user-plus-BS8SGBmk.js";import{P as Ce,a as Le}from"./post-analytics-header-CvR25xxU.js";import{S as Se,K as _e}from"./kpis-B-JXQ-4C.js";import{E as Te}from"./empty-indicator-DoxAratw.js";import{G as De}from"./gh-chart-GokHrG5_.js";import{u as Z,S as Re}from"./post-analytics-context-B2ytyOU0.js";import{h as Ie,i as Me}from"./post-helpers-gInwAwEv.js";import{S as Ae}from"./sprout-CLmu2pln.js";import"./wallet-cards-Be7G77lR.js";import"./source-icon-xS8eeWX-.js";import"./source-utils-B1S3ZHA2.js";import"./table-CXo8NKU2.js";import"./currency-fEUUCkj0.js";import"./stats-B5O9DjYi.js";import"./chart-CULaDoVB.js";import"./_baseAssignValue-DPyNU5o6.js";import"./PolarAngleAxis-D8t9UwHk.js";import"./post-share-modal-DDhiG0X4.js";import"./get-site-timezone-BDBAcjmq.js";import"./posts-DTy4lguT.js";import"./trash-B4ncKmRu.js";import"./lucide-react-CM0rB7CS.js";import"./a-large-small-BijOKCoa.js";import"./list-filter-cWuCDOLb.js";import"./ticket-BtYGyQvH.js";import"./at-sign-_JfhlimD.js";import"./loader-circle-B5ILzHHu.js";import"./message-square-text-DVZjnBBF.js";import"./copy-CbX-_mHj.js";import"./hash-twG7-iIB.js";import"./inbox-BdkIJbSq.js";import"./minus-BWrVDnd-.js";import"./tags-CqHx8i6Q.js";import"./square-D0Y5-h0C.js";import"./user-round-check-BgOPeBFs.js";import"./repeat-C_xWSLK1.js";import"./reply-CXnb6Juu.js";import"./tabs-BMk71Tf2.js";import"./index-C5YCjM6z.js";const Ve=({post:o,isNewsletterStatsLoading:c,isWebShown:x})=>{const{postId:s}=Y(),a=A(),t=h.useMemo(()=>{const l=o.email?.opened_count||0,r=o.email?.email_count||0,p=o.count?.clicks||0;return{opened:l,clicked:p,openedRate:r>0?l/r:0,clickedRate:r>0?p/r:0,sent:r}},[o]),{data:m}=be({searchParams:{filter:`post_id:'${s}'`}}),u=h.useMemo(()=>Ne(m),[m]),g=[{datatype:"Clicked",value:t.clickedRate,fill:"url(#gradientTeal)",color:"hsl(var(--chart-teal))"},{datatype:"Opened",value:t.openedRate,fill:"url(#gradientBlue)",color:"hsl(var(--chart-blue))"}],n={percentage:{label:"Opened"},Average:{label:"Clicked"},"This newsletter":{label:"Opened"}},i=o.email_only||!x;return e.jsxs(K,{className:`group/datalist overflow-hidden ${i&&"col-span-2"}`,children:[e.jsxs("div",{className:"relative flex items-center justify-between gap-6",children:[e.jsx(O,{children:e.jsxs(P,{className:"flex items-center gap-1.5 text-lg",children:[e.jsx(ke,{size:16,strokeWidth:1.5}),"Newsletter performance"]})}),e.jsx(V,{className:"absolute right-6 translate-x-10 opacity-0 transition-all duration-300 group-hover/datalist:translate-x-0 group-hover/datalist:opacity-100",size:"sm",variant:"outline",onClick:()=>{a(`/posts/analytics/${s}/newsletter`)},children:"View more"})]}),c?e.jsx(y,{children:e.jsx("div",{className:"mx-auto flex min-h-[250px] items-center justify-center xl:size-full",children:e.jsx(E,{})})}):e.jsxs(y,{className:`${i&&"grid grid-cols-2"}`,children:[e.jsxs("div",{className:`${i&&"border-r pr-6"}`,children:[e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsx(R,{className:"group relative flex grow flex-row items-start justify-between gap-5 border-none px-0 pt-0",children:e.jsxs("div",{className:"flex grow flex-col gap-1.5 border-none pb-0",children:[e.jsx(I,{color:"hsl(var(--chart-blue))",children:"Open rate"}),e.jsx(M,{value:C(t.openedRate)})]})}),e.jsx(R,{className:"group relative flex grow flex-row items-start justify-between gap-5 border-none px-0 pt-0",children:e.jsxs("div",{className:"flex grow flex-col gap-1.5 border-none pb-0",children:[e.jsx(I,{color:"hsl(var(--chart-teal))",children:"Click rate"}),e.jsx(M,{value:C(t.clickedRate)})]})})]}),!i&&e.jsx(D,{}),e.jsx("div",{className:"mx-auto my-6 h-[240px]",children:e.jsx(ye,{className:"pointer-events-none aspect-square h-[240px]",config:n,data:g,tooltip:!1})})]}),e.jsxs("div",{className:`${i&&"pl-6"}`,children:[!i&&e.jsx(D,{}),e.jsxs("div",{className:i?"":"pt-3",children:[e.jsxs("div",{className:`flex items-center justify-between gap-3 ${i?"pb-3":"py-3"}`,children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:"Top clicked links in this email"}),e.jsx(X,{children:"Members"})]}),u.length>0?e.jsx(pe,{className:"",children:e.jsx(he,{children:u.slice(0,i?10:5).map(l=>{const r=t.clicked>0?l.count/t.clicked:0;return e.jsxs(xe,{children:[e.jsx(ue,{style:{width:`${r?Math.round(r*100):0}%`}}),e.jsx(ge,{children:e.jsxs("div",{className:"flex items-center space-x-2 overflow-hidden",children:[e.jsx(re,{className:"shrink-0 text-muted-foreground",size:16,strokeWidth:1.5}),e.jsx("a",{className:"block truncate font-medium hover:underline",href:l.link.to,rel:"noreferrer",target:"_blank",title:l.link.to,children:we(l.link.to,!0)})]})}),e.jsxs(je,{children:[e.jsx(fe,{children:f(l.count||0)}),e.jsx(ve,{children:C(r)})]})]},l.link.link_id)})})}):e.jsx("div",{className:"py-20 text-center text-sm text-gray-700",children:"You have no links in your post."})]})]})]})]})},Ee=({chartData:o,range:c,isLoading:x,visitors:s,sourcesData:a,isNewsletterShown:t=!0})=>{const{postId:m}=Y(),u=A(),{data:g}=Z(),n=g?.url,i=g?.icon,l=h.useMemo(()=>a?a.reduce((r,p)=>r+Number(p.visits||0),0):0,[a]);return e.jsx(e.Fragment,{children:e.jsxs(K,{className:`group/datalist overflow-hidden ${!t&&"col-span-2"}`,"data-testid":"web-performance",children:[e.jsxs("div",{className:"relative flex items-center justify-between gap-6",children:[e.jsx(O,{children:e.jsxs(P,{className:"flex items-center gap-1.5 text-lg",children:[e.jsx(F,{size:16,strokeWidth:1.5}),"Web performance"]})}),e.jsx(V,{className:"absolute right-6 translate-x-10 opacity-0 transition-all duration-300 group-hover/datalist:translate-x-0 group-hover/datalist:opacity-100",size:"sm",variant:"outline",onClick:()=>{u(`/posts/analytics/${m}/web`)},children:"View more"})]}),e.jsxs(y,{children:[e.jsxs("div",{children:[e.jsx(R,{className:"group relative flex grow flex-row items-start justify-between gap-5 border-none px-0 pt-0","data-testid":"unique-visitors",children:e.jsxs("div",{className:"flex grow flex-col gap-1.5 border-none pb-0",children:[e.jsx(I,{color:"hsl(var(--chart-blue))",children:"Unique visitors"}),e.jsx(M,{value:f(s)})]})}),e.jsx(D,{}),e.jsx("div",{className:"max-h-[288px] py-6 [&_.recharts-cartesian-axis-tick-value]:fill-gray-500",children:x?e.jsx("div",{className:"flex h-[16vw] min-h-[240px] items-center justify-center",children:e.jsx(E,{})}):e.jsx(De,{className:"aspect-auto h-[240px] w-full",color:"hsl(var(--chart-blue))",data:o||[],id:"visitors",range:c,syncId:"overview-charts"})})]}),t&&e.jsxs("div",{className:t?"border-t pt-3":"-mt-3",children:[e.jsx("div",{children:e.jsxs("div",{className:"flex items-center justify-between gap-3 py-3",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:"How readers found this post"}),e.jsx(X,{children:"Visitors"})]})}),a&&a.length>0?e.jsx(Se,{data:a,range:c,siteIcon:i,siteUrl:n,tableOnly:!0,topSourcesLimit:5,totalVisitors:l}):e.jsx(Te,{className:"h-full py-10",description:"Once someone visits this post, sources will show here",title:"No visitors since you published this post",children:e.jsx(F,{strokeWidth:1.5})})]})]})]})})},_s=()=>{const o=A(),{statsConfig:c,isLoading:x,post:s,isPostLoading:a,postId:t}=Z(),{totals:m,isLoading:u,currencySymbol:g}=ce(t),{appSettings:n}=ie(),{emailTrackClicks:i,emailTrackOpens:l}=n?.analytics||{},r=h.useMemo(()=>s?.published_at?le(s.published_at):Re.ALL_TIME.value,[s?.published_at]),{startDate:p,endDate:z,timezone:$}=oe(r),W=h.useMemo(()=>{const d={site_uuid:c?.id||"",date_from:U(p),date_to:U(z),timezone:$,post_uuid:""};return!a&&s?.uuid?{...d,post_uuid:s.uuid}:d},[a,s,c?.id,p,z,$]),{data:v,loading:G}=Q({endpoint:"api_kpis",statsConfig:c||{id:""},params:W}),J=h.useMemo(()=>v?.length?v.reduce((d,j)=>{const H=Number(j.visits);return d+(isNaN(H)?0:H)},0):0,[v]),b=_e.visits,ee=ne(v||[],r,b.dataKey,"sum")?.map(d=>{const j=Number(d[b.dataKey]);return{date:String(d.date),value:j,formattedValue:b.formatter(j),label:b.label}}),{data:se,loading:ae}=Q({endpoint:"api_top_sources",statsConfig:c||{id:""},params:W}),B=x||u||a||G,te=a||x||G,w=Ie(s)&&l&&i,k=!s?.email_only&&n?.analytics.webAnalytics,N=n?.analytics.membersTrackSources;return h.useEffect(()=>{!a&&s&&Me(s)&&!n?.analytics.webAnalytics&&N&&o(`/posts/analytics/${t}/growth`,{replace:!0})},[a,s,n?.analytics.webAnalytics,o,t,N]),a?e.jsx(E,{}):e.jsxs(e.Fragment,{children:[e.jsx(Ce,{currentTab:"Overview"}),e.jsx(Le,{children:e.jsxs("div",{className:"flex flex-col gap-6 lg:grid lg:grid-cols-2",children:[k&&e.jsx(Ee,{chartData:ee,isLoading:te||B||ae,isNewsletterShown:w,range:r,sourcesData:se,visitors:J}),w&&e.jsx(Ve,{isNewsletterStatsLoading:a,isWebShown:k,post:s}),N&&e.jsxs(K,{className:"group col-span-2 overflow-hidden p-0","data-testid":"growth",children:[e.jsxs("div",{className:"relative flex items-center justify-between gap-6",children:[e.jsx(O,{children:e.jsxs(P,{className:"flex items-center gap-1.5 text-lg",children:[e.jsx(Ae,{size:16,strokeWidth:1.5}),"Growth"]})}),e.jsx(V,{className:"absolute right-6 translate-x-10 opacity-0 transition-all duration-200 group-hover:translate-x-0 group-hover:opacity-100",size:"sm",variant:"outline",onClick:()=>{o(`/posts/analytics/${t}/growth`)},children:"View more"})]}),e.jsx(y,{className:"flex flex-col gap-6 px-0 md:grid md:grid-cols-3 md:items-stretch md:gap-0",children:B?Array.from({length:3},(d,j)=>e.jsxs("div",{className:"h-[98px] gap-1 border-r px-6 py-5 last:border-r-0",children:[e.jsx(q,{className:"w-2/3"}),e.jsx(q,{className:"h-7 w-12"})]},j)):e.jsxs(e.Fragment,{children:[e.jsxs(L,{className:"grow gap-1 py-0",children:[e.jsx(S,{children:"Free members"}),e.jsx(_,{children:e.jsx(T,{className:"text-[2.2rem]",children:f(m?.free_members||0)})})]}),n?.paidMembersEnabled&&e.jsxs(e.Fragment,{children:[e.jsxs(L,{className:"grow gap-1 py-0",children:[e.jsx(S,{children:"Paid members"}),e.jsx(_,{children:e.jsx(T,{className:"text-[2.2rem]",children:f(m?.paid_members||0)})})]}),e.jsxs(L,{className:"grow gap-1 py-0",children:[e.jsx(S,{children:"MRR impact"}),e.jsx(_,{children:e.jsxs(T,{className:"text-[2.2rem]",children:[g,f(de(m?.mrr||0))]})})]})]})]})})]}),!k&&!w&&!N&&e.jsx(me,{className:"col-span-2 py-20"})]})})]})};export{_s as default};
@@ -1,4 +1,4 @@
1
- import{r as bt,e as ea,ey as BL,ez as VL,eA as Nm,aN as zL,j as Lt,z as pe,ap as lh,aq as GL,b1 as FL,ar as HL,B as Xw,b2 as WL,b3 as UL,b5 as YL}from"./index-CX1A5TwO.js";import{T as $L}from"./wallet-cards-BlDtHc6_.js";/*! *****************************************************************************
1
+ import{r as bt,e as ea,ey as BL,ez as VL,eA as Nm,aN as zL,j as Lt,z as pe,ap as lh,aq as GL,b1 as FL,ar as HL,B as Xw,b2 as WL,b3 as UL,b5 as YL}from"./index-CM-iA6b-.js";import{T as $L}from"./wallet-cards-Be7G77lR.js";/*! *****************************************************************************
2
2
  Copyright (c) Microsoft Corporation.
3
3
 
4
4
  Permission to use, copy, modify, and/or distribute this software for any
@@ -1 +1 @@
1
- import{r as c,u as v,aK as p,aL as y,aM as h,aN as D,j as C}from"./index-CX1A5TwO.js";import{u as I}from"./posts-mIxckqHa.js";const N={TODAY:{name:"Today",value:1},LAST_7_DAYS:{name:"Last 7 days",value:7},LAST_30_DAYS:{name:"Last 30 days",value:31},LAST_90_DAYS:{name:"Last 90 days",value:91},YEAR_TO_DATE:{name:"Year to date",value:366},LAST_12_MONTHS:{name:"Last 12 months",value:372},ALL_TIME:{name:"All time",value:1e3}},U={US:"United States",TWN:"Taiwan",TW:"Taiwan",CN:"China","mobile-ios":"iOS","mobile-android":"Android",macos:"macOS","google.com":"Google","ghost.org":"Ghost","bing.com":"Bing","bsky.app":"Bluesky","yahoo.com":"Yahoo","duckduckgo.com":"DuckDuckGo"},x=["NULL","ᴺᵁᴸᴸ","","Others","Other"],t={PUBLIC:1,FREE:2,PAID:4},Y=t.PUBLIC|t.FREE|t.PAID,G=[{name:"Public visitors",value:"undefined",bit:t.PUBLIC},{name:"Free members",value:"free",bit:t.FREE},{name:"Paid members",value:"paid",bit:t.PAID}],m=c.createContext(void 0),k=()=>{const o=c.useContext(m);if(!o)throw new Error("useGlobalData must be used within a PostAnalyticsProvider");return o},w=({children:o})=>{const{postId:a}=v();if(!a)throw new Error("Post ID is required for PostAnalyticsProvider");const e=p(),s=y(),[g,A]=c.useState(N.LAST_30_DAYS.value),d=h(),n=!!e.data?.config?.stats,i=D({enabled:n}),{data:{posts:[S]}={posts:[]},isLoading:L}=I({searchParams:{filter:`id:${a}`,include:"email,authors,tags,tiers,count.clicks,count.signups,count.paid_conversions,count.positive_feedback,count.negative_feedback,newsletter"}}),u=[e,s,d],T=u.map(r=>r.error).find(Boolean),_=n?i.error:null,l=T||_,b=u.some(r=>r.isLoading),E=n?i.isLoading:!1,P=b||E;if(l)throw l;const f=s.data?.site?{url:s.data.site.url,icon:s.data.site.icon,title:s.data.site.title}:void 0;return C.jsx(m.Provider,{value:{data:e.data?.config,site:f,statsConfig:e.data?.config?.stats,tinybirdToken:i.token,isLoading:P,range:g,setRange:A,settings:d.data?.settings||[],postId:a,post:S,isPostLoading:L},children:o})},R=Object.freeze(Object.defineProperty({__proto__:null,default:w,useGlobalData:k},Symbol.toStringTag,{value:"Module"}));export{Y as A,N as S,x as U,U as a,G as b,t as c,R as p,k as u};
1
+ import{r as c,u as v,aK as p,aL as y,aM as h,aN as D,j as C}from"./index-CM-iA6b-.js";import{u as I}from"./posts-DTy4lguT.js";const N={TODAY:{name:"Today",value:1},LAST_7_DAYS:{name:"Last 7 days",value:7},LAST_30_DAYS:{name:"Last 30 days",value:31},LAST_90_DAYS:{name:"Last 90 days",value:91},YEAR_TO_DATE:{name:"Year to date",value:366},LAST_12_MONTHS:{name:"Last 12 months",value:372},ALL_TIME:{name:"All time",value:1e3}},U={US:"United States",TWN:"Taiwan",TW:"Taiwan",CN:"China","mobile-ios":"iOS","mobile-android":"Android",macos:"macOS","google.com":"Google","ghost.org":"Ghost","bing.com":"Bing","bsky.app":"Bluesky","yahoo.com":"Yahoo","duckduckgo.com":"DuckDuckGo"},x=["NULL","ᴺᵁᴸᴸ","","Others","Other"],t={PUBLIC:1,FREE:2,PAID:4},Y=t.PUBLIC|t.FREE|t.PAID,G=[{name:"Public visitors",value:"undefined",bit:t.PUBLIC},{name:"Free members",value:"free",bit:t.FREE},{name:"Paid members",value:"paid",bit:t.PAID}],m=c.createContext(void 0),k=()=>{const o=c.useContext(m);if(!o)throw new Error("useGlobalData must be used within a PostAnalyticsProvider");return o},w=({children:o})=>{const{postId:a}=v();if(!a)throw new Error("Post ID is required for PostAnalyticsProvider");const e=p(),s=y(),[g,A]=c.useState(N.LAST_30_DAYS.value),d=h(),n=!!e.data?.config?.stats,i=D({enabled:n}),{data:{posts:[S]}={posts:[]},isLoading:L}=I({searchParams:{filter:`id:${a}`,include:"email,authors,tags,tiers,count.clicks,count.signups,count.paid_conversions,count.positive_feedback,count.negative_feedback,newsletter"}}),u=[e,s,d],T=u.map(r=>r.error).find(Boolean),_=n?i.error:null,l=T||_,b=u.some(r=>r.isLoading),E=n?i.isLoading:!1,P=b||E;if(l)throw l;const f=s.data?.site?{url:s.data.site.url,icon:s.data.site.icon,title:s.data.site.title}:void 0;return C.jsx(m.Provider,{value:{data:e.data?.config,site:f,statsConfig:e.data?.config?.stats,tinybirdToken:i.token,isLoading:P,range:g,setRange:A,settings:d.data?.settings||[],postId:a,post:S,isPostLoading:L},children:o})},R=Object.freeze(Object.defineProperty({__proto__:null,default:w,useGlobalData:k},Symbol.toStringTag,{value:"Module"}));export{Y as A,N as S,x as U,U as a,G as b,t as c,R as p,k as u};
@@ -1 +1 @@
1
- import{r as l,j as e,z as d,a$ as W,C as I,aT as z,aY as U,b0 as V,ao as H,B as D,b1 as F,ar as Y,b2 as X,b3 as q,b4 as k,b5 as g,y as J,b6 as K,b7 as Q,b8 as j,b9 as w,aX as Z,a1 as ee,a2 as se,a3 as ae,a4 as te,a5 as re,a6 as ie,a7 as le,a8 as ne}from"./index-CX1A5TwO.js";import{f as oe,N as ce,P as de,g as u}from"./pagemenu-DK1tbdsq.js";import{P as me}from"./post-share-modal-CvTf3PP9.js";import{u as ue}from"./post-analytics-context-D8nk51yA.js";import{g as pe}from"./get-site-timezone-BDBAcjmq.js";import{i as C,h as xe,a as he,b as be}from"./post-helpers-gInwAwEv.js";import{a as fe}from"./posts-mIxckqHa.js";import{S as ge,P as je,G as we}from"./wallet-cards-BlDtHc6_.js";import{T as ye}from"./trash-D6TuYuIs.js";import{M as ve}from"./user-plus-CKQ-d0d4.js";import{S as Ne}from"./sprout-BKOFkdV8.js";const P=l.forwardRef(({...t},r)=>e.jsx("nav",{ref:r,"aria-label":"breadcrumb",...t}));P.displayName="Breadcrumb";const S=l.forwardRef(({className:t,...r},a)=>e.jsx("ol",{ref:a,className:d("flex flex-wrap items-center gap-1.5 break-words text-sm font-medium text-muted-foreground sm:gap-2.5 h-[34px]",t),...r}));S.displayName="BreadcrumbList";const p=l.forwardRef(({className:t,...r},a)=>e.jsx("li",{ref:a,className:d("inline-flex items-center gap-1.5",t),...r}));p.displayName="BreadcrumbItem";const y=l.forwardRef(({asChild:t,className:r,...a},x)=>{const i=t?W:"a";return e.jsx(i,{ref:x,className:d("inline-flex items-center gap-1 transition-colors hover:text-foreground",r),...a})});y.displayName="BreadcrumbLink";const B=l.forwardRef(({className:t,...r},a)=>e.jsx("span",{ref:a,"aria-current":"page","aria-disabled":"true",className:d("font-medium text-foreground",t),role:"link",...r}));B.displayName="BreadcrumbPage";const T=({children:t,className:r,...a})=>e.jsx("li",{"aria-hidden":"true",className:d("[&>svg]:w-3.5 [&>svg]:h-3.5",r),role:"presentation",...a,children:t??e.jsx(I,{})});T.displayName="BreadcrumbSeparator";const Ee=({children:t,className:r,...a})=>e.jsx("section",{className:d("flex gap-6 flex-col py-8 size-full grow",r),...a,children:t}),Le=({currentTab:t,children:r})=>{const a=z(),{fromAnalytics:x,appSettings:i}=U(),{mutateAsync:_}=fe(),$=V(),[M,h]=l.useState(!1),[O,b]=l.useState(!1),{settings:E,site:v,statsConfig:L,post:s,isPostLoading:f,postId:o}=ue(),c=pe(E),{activeVisitors:N,isLoading:A}=oe({postUuid:s?.uuid,statsConfig:L,enabled:i?.analytics?.webAnalytics??!1}),m=l.useMemo(()=>{if(!s)return[];const n=[];return C(s)&&!i?.analytics.webAnalytics||(n.push("Overview"),!s.email_only&&i?.analytics.webAnalytics&&n.push("Web")),xe(s)&&n.push("Newsletter"),i?.analytics.membersTrackSources&&n.push("Growth"),n},[s,i?.analytics.webAnalytics,i?.analytics.membersTrackSources]),R=()=>{s&&h(!0)},G=async()=>{if(s)try{await _(o),h(!1),a("/posts/",{crossApp:!0})}catch(n){$(n)}};return e.jsxs(e.Fragment,{children:[e.jsx("header",{className:"z-50 -mx-8 bg-white/70 backdrop-blur-md dark:bg-black",children:e.jsx("div",{className:"relative flex min-h-[102px] w-full items-start justify-between gap-5 px-8 pb-0 pt-8","data-header":"header",children:e.jsxs("div",{className:"flex w-full flex-col gap-5",children:[e.jsxs("div",{className:"flex w-full flex-col justify-between md:flex-row md:items-center",children:[e.jsx(P,{children:e.jsxs(S,{children:[x?e.jsx(p,{children:e.jsx(y,{className:"cursor-pointer leading-[24px]",onClick:()=>a("/analytics/",{crossApp:!0}),children:"Analytics"})}):e.jsx(p,{children:e.jsx(y,{className:"cursor-pointer leading-[24px]",onClick:()=>a("/posts/",{crossApp:!0}),children:"Posts"})}),e.jsx(T,{}),e.jsx(p,{children:e.jsx(B,{className:"leading-[24px]",children:"Post analytics"})})]})}),e.jsxs("div",{className:"flex w-full items-center gap-2 md:w-auto",children:[i?.analytics.webAnalytics&&!s?.email_only&&e.jsx("div",{className:"mr-3 flex grow items-center gap-2 text-sm md:grow-0",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",title:"Active readers in the last 5 minutes · Updates every 60 seconds",children:[e.jsxs("span",{className:"text-sm",children:[A?"":H(N)," reading now"]}),e.jsx("div",{className:`size-2 rounded-full ${A?"animate-pulse bg-muted":N?"bg-green-500":"border border-muted-foreground"}`})]})}),!f&&e.jsxs(e.Fragment,{children:[!s?.email_only&&e.jsx(me,{author:s?.authors?.[0]?.name||"",description:"",faviconURL:v?.icon||"",featureImageURL:s?.feature_image,open:O,postExcerpt:s?.excerpt||"",postTitle:s?.title,postURL:s?.url,siteTitle:v?.title||"",onClose:()=>b(!1),onOpenChange:b,children:e.jsxs(D,{variant:"outline",onClick:()=>b(!0),children:[e.jsx(ge,{})," Share"]})}),e.jsxs(F,{children:[e.jsx(Y,{asChild:!0,children:e.jsx(D,{variant:"outline",children:e.jsx(X,{})})}),e.jsxs(q,{align:"end",children:[e.jsxs(k,{children:[e.jsx(g,{asChild:!0,children:e.jsxs("a",{href:s?.url,rel:"noopener noreferrer",target:"_blank",children:[e.jsx(J,{}),"View in browser"]})}),e.jsxs(g,{onClick:()=>{a(`/editor/post/${o}`,{crossApp:!0})},children:[e.jsx(je,{}),"Edit post"]})]}),e.jsx(K,{}),e.jsx(k,{children:e.jsxs(g,{className:"text-destructive focus:text-destructive",onClick:R,children:[e.jsx(ye,{}),"Delete post"]})})]})]})]})]})]}),!f&&e.jsxs("div",{className:"flex items-start gap-6 md:items-center",children:[s?.feature_image&&e.jsx("div",{className:"aspect-[16/10] w-full max-w-[100px] rounded-md bg-cover bg-center md:max-w-[132px]",style:{backgroundImage:`url(${s.feature_image})`}}),e.jsxs("div",{children:[e.jsx(Q,{className:"-ml-px max-w-[920px] indent-0 text-xl md:min-h-[35px] md:text-3xl md:leading-[1.2em]","data-header":"header-title",children:s?.title}),s?.published_at&&e.jsxs("div",{className:"mt-0.5 flex items-center justify-start text-sm leading-[1.65em] text-muted-foreground",children:[he(s)&&`Sent on ${j(s.published_at,c)} at ${w(s.published_at,c)}`,C(s)&&`Published on your site on ${j(s.published_at,c)} at ${w(s.published_at,c)}`,be(s)&&`Published and sent on ${j(s.published_at,c)} at ${w(s.published_at,c)}`]})]})]})]})})}),e.jsxs(ce,{className:"sticky top-0 z-50 -mb-8 transform-gpu flex-col items-start gap-y-0 border-none bg-white/70 py-8 backdrop-blur-md lg:flex-row lg:items-center dark:bg-black",children:[!f&&e.jsxs(de,{className:"min-h-[34px]",defaultValue:t,responsive:!0,children:[m.includes("Overview")&&e.jsxs(u,{value:"Overview",onClick:()=>{a(`/posts/analytics/${o}`)},children:[e.jsx(we,{}),"Overview"]}),m.includes("Web")&&e.jsxs(u,{value:"Web",onClick:()=>{a(`/posts/analytics/${o}/web`)},children:[e.jsx(Z,{}),"Web traffic"]}),m.includes("Newsletter")&&e.jsxs(u,{value:"Newsletter",onClick:()=>{a(`/posts/analytics/${o}/newsletter`)},children:[e.jsx(ve,{}),"Newsletter"]}),m.includes("Growth")&&e.jsxs(u,{value:"Growth",onClick:()=>{a(`/posts/analytics/${o}/growth`)},children:[e.jsx(Ne,{}),"Growth"]})]}),r]}),e.jsx(ee,{open:M,onOpenChange:h,children:e.jsxs(se,{children:[e.jsxs(ae,{children:[e.jsx(te,{children:"Are you sure you want to delete this post?"}),e.jsxs(re,{children:[`You're about to delete "`,e.jsx("strong",{children:s?.title}),'". This is permanent! We warned you, k?']})]}),e.jsxs(ie,{children:[e.jsx(le,{children:"Cancel"}),e.jsx(ne,{className:"hover:bg-red-700 bg-red-600 text-white",onClick:G,children:"Delete"})]})]})})]})};export{Le as P,Ee as a};
1
+ import{r as l,j as e,z as d,a$ as W,C as I,aT as z,aY as U,b0 as V,ao as H,B as D,b1 as F,ar as Y,b2 as X,b3 as q,b4 as k,b5 as g,y as J,b6 as K,b7 as Q,b8 as j,b9 as w,aX as Z,a1 as ee,a2 as se,a3 as ae,a4 as te,a5 as re,a6 as ie,a7 as le,a8 as ne}from"./index-CM-iA6b-.js";import{f as oe,N as ce,P as de,g as u}from"./pagemenu-Cr7_YYR8.js";import{P as me}from"./post-share-modal-DDhiG0X4.js";import{u as ue}from"./post-analytics-context-B2ytyOU0.js";import{g as pe}from"./get-site-timezone-BDBAcjmq.js";import{i as C,h as xe,a as he,b as be}from"./post-helpers-gInwAwEv.js";import{a as fe}from"./posts-DTy4lguT.js";import{S as ge,P as je,G as we}from"./wallet-cards-Be7G77lR.js";import{T as ye}from"./trash-B4ncKmRu.js";import{M as ve}from"./user-plus-BS8SGBmk.js";import{S as Ne}from"./sprout-CLmu2pln.js";const P=l.forwardRef(({...t},r)=>e.jsx("nav",{ref:r,"aria-label":"breadcrumb",...t}));P.displayName="Breadcrumb";const S=l.forwardRef(({className:t,...r},a)=>e.jsx("ol",{ref:a,className:d("flex flex-wrap items-center gap-1.5 break-words text-sm font-medium text-muted-foreground sm:gap-2.5 h-[34px]",t),...r}));S.displayName="BreadcrumbList";const p=l.forwardRef(({className:t,...r},a)=>e.jsx("li",{ref:a,className:d("inline-flex items-center gap-1.5",t),...r}));p.displayName="BreadcrumbItem";const y=l.forwardRef(({asChild:t,className:r,...a},x)=>{const i=t?W:"a";return e.jsx(i,{ref:x,className:d("inline-flex items-center gap-1 transition-colors hover:text-foreground",r),...a})});y.displayName="BreadcrumbLink";const B=l.forwardRef(({className:t,...r},a)=>e.jsx("span",{ref:a,"aria-current":"page","aria-disabled":"true",className:d("font-medium text-foreground",t),role:"link",...r}));B.displayName="BreadcrumbPage";const T=({children:t,className:r,...a})=>e.jsx("li",{"aria-hidden":"true",className:d("[&>svg]:w-3.5 [&>svg]:h-3.5",r),role:"presentation",...a,children:t??e.jsx(I,{})});T.displayName="BreadcrumbSeparator";const Ee=({children:t,className:r,...a})=>e.jsx("section",{className:d("flex gap-6 flex-col py-8 size-full grow",r),...a,children:t}),Le=({currentTab:t,children:r})=>{const a=z(),{fromAnalytics:x,appSettings:i}=U(),{mutateAsync:_}=fe(),$=V(),[M,h]=l.useState(!1),[O,b]=l.useState(!1),{settings:E,site:v,statsConfig:L,post:s,isPostLoading:f,postId:o}=ue(),c=pe(E),{activeVisitors:N,isLoading:A}=oe({postUuid:s?.uuid,statsConfig:L,enabled:i?.analytics?.webAnalytics??!1}),m=l.useMemo(()=>{if(!s)return[];const n=[];return C(s)&&!i?.analytics.webAnalytics||(n.push("Overview"),!s.email_only&&i?.analytics.webAnalytics&&n.push("Web")),xe(s)&&n.push("Newsletter"),i?.analytics.membersTrackSources&&n.push("Growth"),n},[s,i?.analytics.webAnalytics,i?.analytics.membersTrackSources]),R=()=>{s&&h(!0)},G=async()=>{if(s)try{await _(o),h(!1),a("/posts/",{crossApp:!0})}catch(n){$(n)}};return e.jsxs(e.Fragment,{children:[e.jsx("header",{className:"z-50 -mx-8 bg-white/70 backdrop-blur-md dark:bg-black",children:e.jsx("div",{className:"relative flex min-h-[102px] w-full items-start justify-between gap-5 px-8 pb-0 pt-8","data-header":"header",children:e.jsxs("div",{className:"flex w-full flex-col gap-5",children:[e.jsxs("div",{className:"flex w-full flex-col justify-between md:flex-row md:items-center",children:[e.jsx(P,{children:e.jsxs(S,{children:[x?e.jsx(p,{children:e.jsx(y,{className:"cursor-pointer leading-[24px]",onClick:()=>a("/analytics/",{crossApp:!0}),children:"Analytics"})}):e.jsx(p,{children:e.jsx(y,{className:"cursor-pointer leading-[24px]",onClick:()=>a("/posts/",{crossApp:!0}),children:"Posts"})}),e.jsx(T,{}),e.jsx(p,{children:e.jsx(B,{className:"leading-[24px]",children:"Post analytics"})})]})}),e.jsxs("div",{className:"flex w-full items-center gap-2 md:w-auto",children:[i?.analytics.webAnalytics&&!s?.email_only&&e.jsx("div",{className:"mr-3 flex grow items-center gap-2 text-sm md:grow-0",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",title:"Active readers in the last 5 minutes · Updates every 60 seconds",children:[e.jsxs("span",{className:"text-sm",children:[A?"":H(N)," reading now"]}),e.jsx("div",{className:`size-2 rounded-full ${A?"animate-pulse bg-muted":N?"bg-green-500":"border border-muted-foreground"}`})]})}),!f&&e.jsxs(e.Fragment,{children:[!s?.email_only&&e.jsx(me,{author:s?.authors?.[0]?.name||"",description:"",faviconURL:v?.icon||"",featureImageURL:s?.feature_image,open:O,postExcerpt:s?.excerpt||"",postTitle:s?.title,postURL:s?.url,siteTitle:v?.title||"",onClose:()=>b(!1),onOpenChange:b,children:e.jsxs(D,{variant:"outline",onClick:()=>b(!0),children:[e.jsx(ge,{})," Share"]})}),e.jsxs(F,{children:[e.jsx(Y,{asChild:!0,children:e.jsx(D,{variant:"outline",children:e.jsx(X,{})})}),e.jsxs(q,{align:"end",children:[e.jsxs(k,{children:[e.jsx(g,{asChild:!0,children:e.jsxs("a",{href:s?.url,rel:"noopener noreferrer",target:"_blank",children:[e.jsx(J,{}),"View in browser"]})}),e.jsxs(g,{onClick:()=>{a(`/editor/post/${o}`,{crossApp:!0})},children:[e.jsx(je,{}),"Edit post"]})]}),e.jsx(K,{}),e.jsx(k,{children:e.jsxs(g,{className:"text-destructive focus:text-destructive",onClick:R,children:[e.jsx(ye,{}),"Delete post"]})})]})]})]})]})]}),!f&&e.jsxs("div",{className:"flex items-start gap-6 md:items-center",children:[s?.feature_image&&e.jsx("div",{className:"aspect-[16/10] w-full max-w-[100px] rounded-md bg-cover bg-center md:max-w-[132px]",style:{backgroundImage:`url(${s.feature_image})`}}),e.jsxs("div",{children:[e.jsx(Q,{className:"-ml-px max-w-[920px] indent-0 text-xl md:min-h-[35px] md:text-3xl md:leading-[1.2em]","data-header":"header-title",children:s?.title}),s?.published_at&&e.jsxs("div",{className:"mt-0.5 flex items-center justify-start text-sm leading-[1.65em] text-muted-foreground",children:[he(s)&&`Sent on ${j(s.published_at,c)} at ${w(s.published_at,c)}`,C(s)&&`Published on your site on ${j(s.published_at,c)} at ${w(s.published_at,c)}`,be(s)&&`Published and sent on ${j(s.published_at,c)} at ${w(s.published_at,c)}`]})]})]})]})})}),e.jsxs(ce,{className:"sticky top-0 z-50 -mb-8 transform-gpu flex-col items-start gap-y-0 border-none bg-white/70 py-8 backdrop-blur-md lg:flex-row lg:items-center dark:bg-black",children:[!f&&e.jsxs(de,{className:"min-h-[34px]",defaultValue:t,responsive:!0,children:[m.includes("Overview")&&e.jsxs(u,{value:"Overview",onClick:()=>{a(`/posts/analytics/${o}`)},children:[e.jsx(we,{}),"Overview"]}),m.includes("Web")&&e.jsxs(u,{value:"Web",onClick:()=>{a(`/posts/analytics/${o}/web`)},children:[e.jsx(Z,{}),"Web traffic"]}),m.includes("Newsletter")&&e.jsxs(u,{value:"Newsletter",onClick:()=>{a(`/posts/analytics/${o}/newsletter`)},children:[e.jsx(ve,{}),"Newsletter"]}),m.includes("Growth")&&e.jsxs(u,{value:"Growth",onClick:()=>{a(`/posts/analytics/${o}/growth`)},children:[e.jsx(Ne,{}),"Growth"]})]}),r]}),e.jsx(ee,{open:M,onOpenChange:h,children:e.jsxs(se,{children:[e.jsxs(ae,{children:[e.jsx(te,{children:"Are you sure you want to delete this post?"}),e.jsxs(re,{children:[`You're about to delete "`,e.jsx("strong",{children:s?.title}),'". This is permanent! We warned you, k?']})]}),e.jsxs(ie,{children:[e.jsx(le,{children:"Cancel"}),e.jsx(ne,{className:"hover:bg-red-700 bg-red-600 text-white",onClick:G,children:"Delete"})]})]})})]})};export{Le as P,Ee as a};
@@ -1 +1 @@
1
- import{j as u,r as l,e as i,aS as D}from"./index-CX1A5TwO.js";import{M as E}from"./main-layout-DsxBNVo-.js";import{P as M}from"./post-share-modal-CvTf3PP9.js";import{u as b}from"./posts-mIxckqHa.js";import{u as j}from"./post-analytics-context-D8nk51yA.js";const C=({children:a})=>u.jsx(E,{children:u.jsx("div",{className:"grid w-full grow",children:u.jsx("div",{className:"flex h-full flex-col px-8",children:a})})}),_=()=>{const[a,r]=l.useState(!1),[p,d]=l.useState(null),[n,h]=l.useState(null),{site:f}=j(),{data:y}=b({searchParams:p?{filter:`id:${p.id}`,include:"authors,newsletter,email"}:{},enabled:!!p}),{data:g}=b({searchParams:{filter:"status:[published,sent]",limit:"1",fields:"id"},enabled:!!p}),e=y?.posts?.[0],P=s=>`${s.toLocaleString()} subscriber${s!==1?"s":""}`,S=s=>new Date(s).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}),w=s=>s?.map(o=>o.name).join(", ")||"",x=(s,o)=>s.length<=o?s:s.substring(0,o).trim()+"…",T=l.useMemo(()=>{if(!e)return null;const s=!!n,o=()=>{const t=[];if(e.email_only?t.push("Your email was sent to"):e.email?.email_count?t.push("Your post was published on your site and sent to"):t.push("Your post was published on your site"),e.email?.email_count){const m=P(e.email.email_count);t.push(" "),t.push(i.createElement("strong",{key:"subscriber-count"},m)),e.newsletter?.name&&(t.push(" of "),t.push(i.createElement("strong",{key:"newsletter-name"},e.newsletter.name))),t.push(",")}if(e.published_at){const m=new Date(e.published_at);m.toDateString()===new Date().toDateString()?(t.push(" "),t.push(i.createElement("strong",{key:"today"},"today"))):(t.push(" on "),t.push(i.createElement("strong",{key:"date"},m.toLocaleDateString("en-US",{month:"long",day:"numeric"})))),t.push(" at "),t.push(i.createElement("strong",{key:"time"},S(e.published_at)))}return t.push("."),i.createElement("span",{},...t)},c=()=>{r(!1),d(null),h(null)};return{open:a,onOpenChange:t=>{t||c()},emailOnly:e.email_only,postURL:e.url||"",primaryTitle:"Boom! It's out there.",secondaryTitle:s&&n?`That's ${n.toLocaleString()} post${n!==1?"s":""} published.`:"Spread the word!",description:o(),featureImageURL:e.feature_image||"",postTitle:e.title||"",postExcerpt:x(e.excerpt||"",100),faviconURL:f?.icon||"",siteTitle:f?.title||"",author:w(e.authors),onClose:c}},[e,a,n,f?.title]);return l.useEffect(()=>{const s=()=>{try{const c=localStorage.getItem("ghost-last-published-post");if(c){const t=JSON.parse(c);d(t),r(!0),localStorage.removeItem("ghost-last-published-post")}}catch{}};s();const o=setTimeout(s,100);return()=>clearTimeout(o)},[]),l.useEffect(()=>{g?.meta?.pagination?.total&&h(g.meta.pagination.total)},[g]),{isModalOpen:a,post:e,postCount:n,showPostCount:!!n,closeModal:()=>{r(!1),d(null),h(null)},modalProps:T}},v=()=>{const{isModalOpen:a,modalProps:r}=_();return u.jsxs(C,{children:[u.jsx(D,{}),a&&r&&u.jsx(M,{...r})]})};export{v as default};
1
+ import{j as u,r as l,e as i,aS as D}from"./index-CM-iA6b-.js";import{M as E}from"./main-layout-BE7vZmy0.js";import{P as M}from"./post-share-modal-DDhiG0X4.js";import{u as b}from"./posts-DTy4lguT.js";import{u as j}from"./post-analytics-context-B2ytyOU0.js";const C=({children:a})=>u.jsx(E,{children:u.jsx("div",{className:"grid w-full grow",children:u.jsx("div",{className:"flex h-full flex-col px-8",children:a})})}),_=()=>{const[a,r]=l.useState(!1),[p,d]=l.useState(null),[n,h]=l.useState(null),{site:f}=j(),{data:y}=b({searchParams:p?{filter:`id:${p.id}`,include:"authors,newsletter,email"}:{},enabled:!!p}),{data:g}=b({searchParams:{filter:"status:[published,sent]",limit:"1",fields:"id"},enabled:!!p}),e=y?.posts?.[0],P=s=>`${s.toLocaleString()} subscriber${s!==1?"s":""}`,S=s=>new Date(s).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}),w=s=>s?.map(o=>o.name).join(", ")||"",x=(s,o)=>s.length<=o?s:s.substring(0,o).trim()+"…",T=l.useMemo(()=>{if(!e)return null;const s=!!n,o=()=>{const t=[];if(e.email_only?t.push("Your email was sent to"):e.email?.email_count?t.push("Your post was published on your site and sent to"):t.push("Your post was published on your site"),e.email?.email_count){const m=P(e.email.email_count);t.push(" "),t.push(i.createElement("strong",{key:"subscriber-count"},m)),e.newsletter?.name&&(t.push(" of "),t.push(i.createElement("strong",{key:"newsletter-name"},e.newsletter.name))),t.push(",")}if(e.published_at){const m=new Date(e.published_at);m.toDateString()===new Date().toDateString()?(t.push(" "),t.push(i.createElement("strong",{key:"today"},"today"))):(t.push(" on "),t.push(i.createElement("strong",{key:"date"},m.toLocaleDateString("en-US",{month:"long",day:"numeric"})))),t.push(" at "),t.push(i.createElement("strong",{key:"time"},S(e.published_at)))}return t.push("."),i.createElement("span",{},...t)},c=()=>{r(!1),d(null),h(null)};return{open:a,onOpenChange:t=>{t||c()},emailOnly:e.email_only,postURL:e.url||"",primaryTitle:"Boom! It's out there.",secondaryTitle:s&&n?`That's ${n.toLocaleString()} post${n!==1?"s":""} published.`:"Spread the word!",description:o(),featureImageURL:e.feature_image||"",postTitle:e.title||"",postExcerpt:x(e.excerpt||"",100),faviconURL:f?.icon||"",siteTitle:f?.title||"",author:w(e.authors),onClose:c}},[e,a,n,f?.title]);return l.useEffect(()=>{const s=()=>{try{const c=localStorage.getItem("ghost-last-published-post");if(c){const t=JSON.parse(c);d(t),r(!0),localStorage.removeItem("ghost-last-published-post")}}catch{}};s();const o=setTimeout(s,100);return()=>clearTimeout(o)},[]),l.useEffect(()=>{g?.meta?.pagination?.total&&h(g.meta.pagination.total)},[g]),{isModalOpen:a,post:e,postCount:n,showPostCount:!!n,closeModal:()=>{r(!1),d(null),h(null)},modalProps:T}},v=()=>{const{isModalOpen:a,modalProps:r}=_();return u.jsxs(C,{children:[u.jsx(D,{}),a&&r&&u.jsx(M,{...r})]})};export{v as default};
@@ -1 +1 @@
1
- import{r as k,j as e,D as w,t as N,v as C,B as t,X as z,w as y,x as H,ag as $,$ as M,ah as D,a0 as P,ai as V}from"./index-CX1A5TwO.js";const I=({emailOnly:x=!1,postURL:s="",primaryTitle:m="Your post is published.",secondaryTitle:p="Spread the word!",description:a="",featureImageURL:i="",postTitle:r="",postExcerpt:n="",faviconURL:f="",siteTitle:g="",author:j="",onClose:c=()=>{},children:u,...v})=>{const[o,d]=k.useState(!1),_=async()=>{try{await navigator.clipboard.writeText(s),d(!0),setTimeout(()=>d(!1),2e3)}catch{}},h=encodeURIComponent(r),l=encodeURIComponent(s),b=encodeURIComponent(`${r} ${s}`);return e.jsxs(w,{...v,children:[e.jsx(N,{className:"cursor-pointer",asChild:!0,children:u}),e.jsxs(C,{className:"max-h-[calc(100vh-16vmin)] max-w-[540px] overflow-y-auto p-8",children:[e.jsx("div",{className:"sticky top-0 ml-auto size-0",children:e.jsx(t,{className:"absolute -right-5 -top-5 cursor-pointer p-2 text-muted-foreground hover:text-foreground [&_svg]:!size-6",size:"lg",variant:"link",onClick:c,children:e.jsx(z,{size:24,strokeWidth:1})})}),e.jsxs(y,{className:"relative -mt-5",children:[e.jsxs(H,{className:"text-3xl font-bold leading-[1.15em]",children:[e.jsx("span",{className:"text-green-500",children:m}),e.jsx("br",{}),e.jsx("span",{children:p})]}),a&&e.jsx($,{className:"mb-0 pb-0 pt-1 text-lg text-foreground",children:a})]}),e.jsxs("a",{className:"flex flex-col items-stretch overflow-hidden rounded-md border transition-all hover:border-muted-foreground/40",href:s,rel:"noopener noreferrer",target:"_blank",children:[i&&e.jsx("div",{className:"aspect-video bg-cover bg-center",style:{backgroundImage:`url(${i})`}}),e.jsxs("div",{className:"p-6 pt-5",children:[e.jsx(M,{children:r}),n&&e.jsx("p",{children:n}),e.jsxs("div",{className:"mt-2 flex items-start gap-2",children:[e.jsx("div",{className:"mt-0.5 size-4 bg-cover bg-center",style:{backgroundImage:`url(${f})`}}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("strong",{children:g}),e.jsx("span",{children:"•"}),e.jsx("span",{children:j})]})]})]})]}),e.jsx(D,{className:"justify-between gap-6",children:x?e.jsx(t,{className:"cursor-pointer",type:"submit",onClick:c,children:"Close"}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("a",{className:"flex h-[34px] w-14 items-center justify-center rounded-sm bg-muted px-3 hover:bg-muted-foreground/20 [&_svg]:h-4",href:`https://twitter.com/intent/tweet?text=${h}%0A${l}`,rel:"noopener noreferrer",target:"_blank",children:e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:e.jsx("path",{className:"social-x_svg__x",d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})}),e.jsx("a",{className:"flex h-[34px] w-14 items-center justify-center rounded-sm bg-muted px-3 hover:bg-muted-foreground/20 [&_svg]:h-4",href:`https://threads.net/intent/post?text=${b}`,rel:"noopener noreferrer",target:"_blank",children:e.jsxs("svg",{fill:"none",viewBox:"0 0 18 18",children:[e.jsx("g",{clipPath:"url(#social-threads_svg__clip0_351_18008)",children:e.jsx("path",{d:"M13.033 8.38a5.924 5.924 0 00-.223-.102c-.13-2.418-1.452-3.802-3.67-3.816h-.03c-1.327 0-2.43.566-3.11 1.597l1.22.837c.507-.77 1.304-.934 1.89-.934h.02c.73.004 1.282.217 1.639.63.26.302.433.72.519 1.245a9.334 9.334 0 00-2.097-.101c-2.109.121-3.465 1.351-3.374 3.06.047.868.478 1.614 1.216 2.1.624.413 1.428.614 2.263.568 1.103-.06 1.969-.48 2.572-1.25.459-.585.749-1.342.877-2.296.526.317.915.735 1.13 1.236.366.854.387 2.255-.756 3.398-1.003 1.002-2.207 1.435-4.028 1.448-2.02-.015-3.547-.663-4.54-1.925-.93-1.182-1.41-2.89-1.428-5.075.018-2.185.498-3.893 1.428-5.075.993-1.262 2.52-1.91 4.54-1.925 2.034.015 3.588.666 4.62 1.934.505.622.886 1.405 1.137 2.317l1.43-.382c-.305-1.122-.784-2.09-1.436-2.892C13.52 1.35 11.587.517 9.096.5h-.01C6.6.517 4.689 1.354 3.404 2.986 2.262 4.44 1.672 6.46 1.652 8.994v.012c.02 2.534.61 4.555 1.752 6.008C4.69 16.646 6.6 17.483 9.086 17.5h.01c2.21-.015 3.768-.594 5.051-1.876 1.68-1.678 1.629-3.78 1.075-5.07-.397-.927-1.154-1.678-2.189-2.175zm-3.816 3.587c-.924.052-1.884-.363-1.932-1.252-.035-.659.47-1.394 1.99-1.482a8.9 8.9 0 01.512-.014c.552 0 1.068.053 1.538.156-.175 2.187-1.203 2.542-2.108 2.592z",fill:"#000"})}),e.jsx("defs",{children:e.jsx("clipPath",{id:"social-threads_svg__clip0_351_18008",children:e.jsx("path",{d:"M0 0h17v17H0z",fill:"#fff",transform:"translate(.5 .5)"})})})]})}),e.jsx("a",{className:"flex h-[34px] w-14 items-center justify-center rounded-sm bg-muted px-3 hover:bg-muted-foreground/20 [&_svg]:h-4",href:`https://www.facebook.com/sharer/sharer.php?u=${l}`,rel:"noopener noreferrer",target:"_blank",children:e.jsxs("svg",{fill:"none",viewBox:"0 0 40 40",children:[e.jsx("title",{children:"social-facebook"}),e.jsx("path",{className:"social-facebook_svg__fb",d:"M20 40.004c11.046 0 20-8.955 20-20 0-11.046-8.954-20-20-20s-20 8.954-20 20c0 11.045 8.954 20 20 20z",fill:"#1977f3"}),e.jsx("path",{d:"M27.785 25.785l.886-5.782h-5.546V16.25c0-1.58.773-3.125 3.26-3.125h2.522V8.204s-2.29-.39-4.477-.39c-4.568 0-7.555 2.767-7.555 7.781v4.408h-5.08v5.782h5.08v13.976a20.08 20.08 0 003.125.242c1.063 0 2.107-.085 3.125-.242V25.785h4.66z",fill:"#fff"})]})}),e.jsx("a",{className:"flex h-[34px] w-14 items-center justify-center rounded-sm bg-muted px-3 hover:bg-muted-foreground/20 [&_svg]:h-4",href:`http://www.linkedin.com/shareArticle?mini=true&title=${h}&url=${l}`,rel:"noopener noreferrer",target:"_blank",children:e.jsxs("svg",{fill:"none",viewBox:"0 0 16 16",children:[e.jsxs("g",{clipPath:"url(#social-linkedin_svg__clip0_537_833)",children:[e.jsx("path",{className:"social-linkedin_svg__linkedin",clipRule:"evenodd",d:"M1.778 16h12.444c.982 0 1.778-.796 1.778-1.778V1.778C16 .796 15.204 0 14.222 0H1.778C.796 0 0 .796 0 1.778v12.444C0 15.204.796 16 1.778 16z",fill:"#007ebb",fillRule:"evenodd"}),e.jsx("path",{clipRule:"evenodd",d:"M13.778 13.778h-2.374V9.734c0-1.109-.421-1.729-1.299-1.729-.955 0-1.453.645-1.453 1.729v4.044H6.363V6.074h2.289v1.038s.688-1.273 2.322-1.273c1.634 0 2.804.997 2.804 3.061v4.878zM3.634 5.065c-.78 0-1.411-.636-1.411-1.421s.631-1.422 1.41-1.422c.78 0 1.411.637 1.411 1.422 0 .785-.631 1.421-1.41 1.421zm-1.182 8.713h2.386V6.074H2.452v7.704z",fill:"#fff",fillRule:"evenodd"})]}),e.jsx("defs",{children:e.jsx("clipPath",{id:"social-linkedin_svg__clip0_537_833",children:e.jsx("path",{d:"M0 0h16v16H0z",fill:"#fff"})})})]})})]}),e.jsxs(t,{className:"!ml-0 grow cursor-pointer",disabled:!s,type:"button",onClick:_,children:[o?e.jsx(P,{}):e.jsx(V,{}),o?"Copied!":"Copy link"]})]})})]})]})};export{I as P};
1
+ import{r as k,j as e,D as w,t as N,v as C,B as t,X as z,w as y,x as H,ag as $,$ as M,ah as D,a0 as P,ai as V}from"./index-CM-iA6b-.js";const I=({emailOnly:x=!1,postURL:s="",primaryTitle:m="Your post is published.",secondaryTitle:p="Spread the word!",description:a="",featureImageURL:i="",postTitle:r="",postExcerpt:n="",faviconURL:f="",siteTitle:g="",author:j="",onClose:c=()=>{},children:u,...v})=>{const[o,d]=k.useState(!1),_=async()=>{try{await navigator.clipboard.writeText(s),d(!0),setTimeout(()=>d(!1),2e3)}catch{}},h=encodeURIComponent(r),l=encodeURIComponent(s),b=encodeURIComponent(`${r} ${s}`);return e.jsxs(w,{...v,children:[e.jsx(N,{className:"cursor-pointer",asChild:!0,children:u}),e.jsxs(C,{className:"max-h-[calc(100vh-16vmin)] max-w-[540px] overflow-y-auto p-8",children:[e.jsx("div",{className:"sticky top-0 ml-auto size-0",children:e.jsx(t,{className:"absolute -right-5 -top-5 cursor-pointer p-2 text-muted-foreground hover:text-foreground [&_svg]:!size-6",size:"lg",variant:"link",onClick:c,children:e.jsx(z,{size:24,strokeWidth:1})})}),e.jsxs(y,{className:"relative -mt-5",children:[e.jsxs(H,{className:"text-3xl font-bold leading-[1.15em]",children:[e.jsx("span",{className:"text-green-500",children:m}),e.jsx("br",{}),e.jsx("span",{children:p})]}),a&&e.jsx($,{className:"mb-0 pb-0 pt-1 text-lg text-foreground",children:a})]}),e.jsxs("a",{className:"flex flex-col items-stretch overflow-hidden rounded-md border transition-all hover:border-muted-foreground/40",href:s,rel:"noopener noreferrer",target:"_blank",children:[i&&e.jsx("div",{className:"aspect-video bg-cover bg-center",style:{backgroundImage:`url(${i})`}}),e.jsxs("div",{className:"p-6 pt-5",children:[e.jsx(M,{children:r}),n&&e.jsx("p",{children:n}),e.jsxs("div",{className:"mt-2 flex items-start gap-2",children:[e.jsx("div",{className:"mt-0.5 size-4 bg-cover bg-center",style:{backgroundImage:`url(${f})`}}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("strong",{children:g}),e.jsx("span",{children:"•"}),e.jsx("span",{children:j})]})]})]})]}),e.jsx(D,{className:"justify-between gap-6",children:x?e.jsx(t,{className:"cursor-pointer",type:"submit",onClick:c,children:"Close"}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("a",{className:"flex h-[34px] w-14 items-center justify-center rounded-sm bg-muted px-3 hover:bg-muted-foreground/20 [&_svg]:h-4",href:`https://twitter.com/intent/tweet?text=${h}%0A${l}`,rel:"noopener noreferrer",target:"_blank",children:e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:e.jsx("path",{className:"social-x_svg__x",d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})}),e.jsx("a",{className:"flex h-[34px] w-14 items-center justify-center rounded-sm bg-muted px-3 hover:bg-muted-foreground/20 [&_svg]:h-4",href:`https://threads.net/intent/post?text=${b}`,rel:"noopener noreferrer",target:"_blank",children:e.jsxs("svg",{fill:"none",viewBox:"0 0 18 18",children:[e.jsx("g",{clipPath:"url(#social-threads_svg__clip0_351_18008)",children:e.jsx("path",{d:"M13.033 8.38a5.924 5.924 0 00-.223-.102c-.13-2.418-1.452-3.802-3.67-3.816h-.03c-1.327 0-2.43.566-3.11 1.597l1.22.837c.507-.77 1.304-.934 1.89-.934h.02c.73.004 1.282.217 1.639.63.26.302.433.72.519 1.245a9.334 9.334 0 00-2.097-.101c-2.109.121-3.465 1.351-3.374 3.06.047.868.478 1.614 1.216 2.1.624.413 1.428.614 2.263.568 1.103-.06 1.969-.48 2.572-1.25.459-.585.749-1.342.877-2.296.526.317.915.735 1.13 1.236.366.854.387 2.255-.756 3.398-1.003 1.002-2.207 1.435-4.028 1.448-2.02-.015-3.547-.663-4.54-1.925-.93-1.182-1.41-2.89-1.428-5.075.018-2.185.498-3.893 1.428-5.075.993-1.262 2.52-1.91 4.54-1.925 2.034.015 3.588.666 4.62 1.934.505.622.886 1.405 1.137 2.317l1.43-.382c-.305-1.122-.784-2.09-1.436-2.892C13.52 1.35 11.587.517 9.096.5h-.01C6.6.517 4.689 1.354 3.404 2.986 2.262 4.44 1.672 6.46 1.652 8.994v.012c.02 2.534.61 4.555 1.752 6.008C4.69 16.646 6.6 17.483 9.086 17.5h.01c2.21-.015 3.768-.594 5.051-1.876 1.68-1.678 1.629-3.78 1.075-5.07-.397-.927-1.154-1.678-2.189-2.175zm-3.816 3.587c-.924.052-1.884-.363-1.932-1.252-.035-.659.47-1.394 1.99-1.482a8.9 8.9 0 01.512-.014c.552 0 1.068.053 1.538.156-.175 2.187-1.203 2.542-2.108 2.592z",fill:"#000"})}),e.jsx("defs",{children:e.jsx("clipPath",{id:"social-threads_svg__clip0_351_18008",children:e.jsx("path",{d:"M0 0h17v17H0z",fill:"#fff",transform:"translate(.5 .5)"})})})]})}),e.jsx("a",{className:"flex h-[34px] w-14 items-center justify-center rounded-sm bg-muted px-3 hover:bg-muted-foreground/20 [&_svg]:h-4",href:`https://www.facebook.com/sharer/sharer.php?u=${l}`,rel:"noopener noreferrer",target:"_blank",children:e.jsxs("svg",{fill:"none",viewBox:"0 0 40 40",children:[e.jsx("title",{children:"social-facebook"}),e.jsx("path",{className:"social-facebook_svg__fb",d:"M20 40.004c11.046 0 20-8.955 20-20 0-11.046-8.954-20-20-20s-20 8.954-20 20c0 11.045 8.954 20 20 20z",fill:"#1977f3"}),e.jsx("path",{d:"M27.785 25.785l.886-5.782h-5.546V16.25c0-1.58.773-3.125 3.26-3.125h2.522V8.204s-2.29-.39-4.477-.39c-4.568 0-7.555 2.767-7.555 7.781v4.408h-5.08v5.782h5.08v13.976a20.08 20.08 0 003.125.242c1.063 0 2.107-.085 3.125-.242V25.785h4.66z",fill:"#fff"})]})}),e.jsx("a",{className:"flex h-[34px] w-14 items-center justify-center rounded-sm bg-muted px-3 hover:bg-muted-foreground/20 [&_svg]:h-4",href:`http://www.linkedin.com/shareArticle?mini=true&title=${h}&url=${l}`,rel:"noopener noreferrer",target:"_blank",children:e.jsxs("svg",{fill:"none",viewBox:"0 0 16 16",children:[e.jsxs("g",{clipPath:"url(#social-linkedin_svg__clip0_537_833)",children:[e.jsx("path",{className:"social-linkedin_svg__linkedin",clipRule:"evenodd",d:"M1.778 16h12.444c.982 0 1.778-.796 1.778-1.778V1.778C16 .796 15.204 0 14.222 0H1.778C.796 0 0 .796 0 1.778v12.444C0 15.204.796 16 1.778 16z",fill:"#007ebb",fillRule:"evenodd"}),e.jsx("path",{clipRule:"evenodd",d:"M13.778 13.778h-2.374V9.734c0-1.109-.421-1.729-1.299-1.729-.955 0-1.453.645-1.453 1.729v4.044H6.363V6.074h2.289v1.038s.688-1.273 2.322-1.273c1.634 0 2.804.997 2.804 3.061v4.878zM3.634 5.065c-.78 0-1.411-.636-1.411-1.421s.631-1.422 1.41-1.422c.78 0 1.411.637 1.411 1.422 0 .785-.631 1.421-1.41 1.421zm-1.182 8.713h2.386V6.074H2.452v7.704z",fill:"#fff",fillRule:"evenodd"})]}),e.jsx("defs",{children:e.jsx("clipPath",{id:"social-linkedin_svg__clip0_537_833",children:e.jsx("path",{d:"M0 0h16v16H0z",fill:"#fff"})})})]})})]}),e.jsxs(t,{className:"!ml-0 grow cursor-pointer",disabled:!s,type:"button",onClick:_,children:[o?e.jsx(P,{}):e.jsx(V,{}),o?"Copied!":"Copy link"]})]})})]})]})};export{I as P};
@@ -1 +1 @@
1
- import{ac as e,ab as o,aa as a}from"./index-CX1A5TwO.js";const t="PostsResponseType",r=e({dataType:t,path:"/posts/"}),c=a({dataType:t,path:s=>`/posts/${s}/`}),n=e({dataType:t,path:"/posts/export/"}),u=o({method:"DELETE",path:s=>`/posts/${s}/`});export{u as a,n as b,c as g,r as u};
1
+ import{ac as e,ab as o,aa as a}from"./index-CM-iA6b-.js";const t="PostsResponseType",r=e({dataType:t,path:"/posts/"}),c=a({dataType:t,path:s=>`/posts/${s}/`}),n=e({dataType:t,path:"/posts/export/"}),u=o({method:"DELETE",path:s=>`/posts/${s}/`});export{u as a,n as b,c as g,r as u};
@@ -1 +1 @@
1
- import{ac as e}from"./index-CX1A5TwO.js";const r="ReferrerHistoryResponseType",t=e({dataType:r,path:"/stats/referrers/"}),o=e({dataType:"TopSourcesGrowthResponseType",path:"/stats/top-sources-growth"});export{t as a,o as u};
1
+ import{ac as e}from"./index-CM-iA6b-.js";const r="ReferrerHistoryResponseType",t=e({dataType:r,path:"/stats/referrers/"}),o=e({dataType:"TopSourcesGrowthResponseType",path:"/stats/top-sources-growth"});export{t as a,o as u};
@@ -1,4 +1,4 @@
1
- import{aC as e}from"./index-CX1A5TwO.js";/**
1
+ import{aC as e}from"./index-CM-iA6b-.js";/**
2
2
  * @license lucide-react v0.553.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{aC as e}from"./index-CX1A5TwO.js";/**
1
+ import{aC as e}from"./index-CM-iA6b-.js";/**
2
2
  * @license lucide-react v0.553.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{r as o,ba as Pe,as as mt,at as Te,j as r,bb as ht,au as vt,av as be,bc as gt,aG as L,bd as G,aw as j,aH as xt,be as St,bf as wt,aA as N,bg as yt,aD as Re,bh as Ct,bi as bt,bj as It,bk as Tt,bl as Nt,bm as Pt,bn as Rt,bo as Et,bp as _t,z as $,bq as Ee,br as jt,a0 as Mt}from"./index-CX1A5TwO.js";import{C as At}from"./message-square-text-BkERj4f5.js";function Ne(t,[n,e]){return Math.min(e,Math.max(n,t))}var Ot=[" ","Enter","ArrowUp","ArrowDown"],Dt=[" ","Enter"],Q="Select",[ie,de,Lt]=gt(Q),[oe]=vt(Q,[Lt,Pe]),ue=Pe(),[kt,Y]=oe(Q),[Bt,Vt]=oe(Q),_e=t=>{const{__scopeSelect:n,children:e,open:l,defaultOpen:a,onOpenChange:u,value:s,defaultValue:c,onValueChange:i,dir:f,name:g,autoComplete:w,disabled:P,required:I,form:C}=t,d=ue(n),[h,x]=o.useState(null),[m,v]=o.useState(null),[F,M]=o.useState(!1),ne=mt(f),[R,O]=Te({prop:l,defaultProp:a??!1,onChange:u,caller:Q}),[W,X]=Te({prop:s,defaultProp:c,onChange:i,caller:Q}),k=o.useRef(null),B=h?C||!!h.closest("form"):!0,[K,V]=o.useState(new Set),H=Array.from(K).map(E=>E.props.value).join(";");return r.jsx(ht,{...d,children:r.jsxs(kt,{required:I,scope:n,trigger:h,onTriggerChange:x,valueNode:m,onValueNodeChange:v,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:be(),value:W,onValueChange:X,open:R,onOpenChange:O,dir:ne,triggerPointerDownPosRef:k,disabled:P,children:[r.jsx(ie.Provider,{scope:n,children:r.jsx(Bt,{scope:t.__scopeSelect,onNativeOptionAdd:o.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:o.useCallback(E=>{V(D=>{const U=new Set(D);return U.delete(E),U})},[]),children:e})}),B?r.jsxs(tt,{"aria-hidden":!0,required:I,tabIndex:-1,name:g,autoComplete:w,value:W,onChange:E=>X(E.target.value),disabled:P,form:C,children:[W===void 0?r.jsx("option",{value:""}):null,Array.from(K)]},H):null]})})};_e.displayName=Q;var je="SelectTrigger",Me=o.forwardRef((t,n)=>{const{__scopeSelect:e,disabled:l=!1,...a}=t,u=ue(e),s=Y(je,e),c=s.disabled||l,i=L(n,s.onTriggerChange),f=de(e),g=o.useRef("touch"),[w,P,I]=nt(d=>{const h=f().filter(v=>!v.disabled),x=h.find(v=>v.value===s.value),m=rt(h,d,x);m!==void 0&&s.onValueChange(m.value)}),C=d=>{c||(s.onOpenChange(!0),I()),d&&(s.triggerPointerDownPosRef.current={x:Math.round(d.pageX),y:Math.round(d.pageY)})};return r.jsx(wt,{asChild:!0,...u,children:r.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":ot(s.value)?"":void 0,...a,ref:i,onClick:N(a.onClick,d=>{d.currentTarget.focus(),g.current!=="mouse"&&C(d)}),onPointerDown:N(a.onPointerDown,d=>{g.current=d.pointerType;const h=d.target;h.hasPointerCapture(d.pointerId)&&h.releasePointerCapture(d.pointerId),d.button===0&&d.ctrlKey===!1&&d.pointerType==="mouse"&&(C(d),d.preventDefault())}),onKeyDown:N(a.onKeyDown,d=>{const h=w.current!=="";!(d.ctrlKey||d.altKey||d.metaKey)&&d.key.length===1&&P(d.key),!(h&&d.key===" ")&&Ot.includes(d.key)&&(C(),d.preventDefault())})})})});Me.displayName=je;var Ae="SelectValue",Oe=o.forwardRef((t,n)=>{const{__scopeSelect:e,className:l,style:a,children:u,placeholder:s="",...c}=t,i=Y(Ae,e),{onValueNodeHasChildrenChange:f}=i,g=u!==void 0,w=L(n,i.onValueNodeChange);return G(()=>{f(g)},[f,g]),r.jsx(j.span,{...c,ref:w,style:{pointerEvents:"none"},children:ot(i.value)?r.jsx(r.Fragment,{children:s}):u})});Oe.displayName=Ae;var Ht="SelectIcon",De=o.forwardRef((t,n)=>{const{__scopeSelect:e,children:l,...a}=t;return r.jsx(j.span,{"aria-hidden":!0,...a,ref:n,children:l||"▼"})});De.displayName=Ht;var Ut="SelectPortal",Le=t=>r.jsx(yt,{asChild:!0,...t});Le.displayName=Ut;var ee="SelectContent",ke=o.forwardRef((t,n)=>{const e=Y(ee,t.__scopeSelect),[l,a]=o.useState();if(G(()=>{a(new DocumentFragment)},[]),!e.open){const u=l;return u?Re.createPortal(r.jsx(Be,{scope:t.__scopeSelect,children:r.jsx(ie.Slot,{scope:t.__scopeSelect,children:r.jsx("div",{children:t.children})})}),u):null}return r.jsx(Ve,{...t,ref:n})});ke.displayName=ee;var A=10,[Be,q]=oe(ee),Ft="SelectContentImpl",Wt=Nt("SelectContent.RemoveScroll"),Ve=o.forwardRef((t,n)=>{const{__scopeSelect:e,position:l="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:u,onPointerDownOutside:s,side:c,sideOffset:i,align:f,alignOffset:g,arrowPadding:w,collisionBoundary:P,collisionPadding:I,sticky:C,hideWhenDetached:d,avoidCollisions:h,...x}=t,m=Y(ee,e),[v,F]=o.useState(null),[M,ne]=o.useState(null),R=L(n,p=>F(p)),[O,W]=o.useState(null),[X,k]=o.useState(null),B=de(e),[K,V]=o.useState(!1),H=o.useRef(!1);o.useEffect(()=>{if(v)return bt(v)},[v]),It();const E=o.useCallback(p=>{const[b,..._]=B().map(T=>T.ref.current),[S]=_.slice(-1),y=document.activeElement;for(const T of p)if(T===y||(T?.scrollIntoView({block:"nearest"}),T===b&&M&&(M.scrollTop=0),T===S&&M&&(M.scrollTop=M.scrollHeight),T?.focus(),document.activeElement!==y))return},[B,M]),D=o.useCallback(()=>E([O,v]),[E,O,v]);o.useEffect(()=>{K&&D()},[K,D]);const{onOpenChange:U,triggerPointerDownPosRef:z}=m;o.useEffect(()=>{if(v){let p={x:0,y:0};const b=S=>{p={x:Math.abs(Math.round(S.pageX)-(z.current?.x??0)),y:Math.abs(Math.round(S.pageY)-(z.current?.y??0))}},_=S=>{p.x<=10&&p.y<=10?S.preventDefault():v.contains(S.target)||U(!1),document.removeEventListener("pointermove",b),z.current=null};return z.current!==null&&(document.addEventListener("pointermove",b),document.addEventListener("pointerup",_,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",b),document.removeEventListener("pointerup",_,{capture:!0})}}},[v,U,z]),o.useEffect(()=>{const p=()=>U(!1);return window.addEventListener("blur",p),window.addEventListener("resize",p),()=>{window.removeEventListener("blur",p),window.removeEventListener("resize",p)}},[U]);const[pe,ae]=nt(p=>{const b=B().filter(y=>!y.disabled),_=b.find(y=>y.ref.current===document.activeElement),S=rt(b,p,_);S&&setTimeout(()=>S.ref.current.focus())}),fe=o.useCallback((p,b,_)=>{const S=!H.current&&!_;(m.value!==void 0&&m.value===b||S)&&(W(p),S&&(H.current=!0))},[m.value]),me=o.useCallback(()=>v?.focus(),[v]),te=o.useCallback((p,b,_)=>{const S=!H.current&&!_;(m.value!==void 0&&m.value===b||S)&&k(p)},[m.value]),le=l==="popper"?xe:He,re=le===xe?{side:c,sideOffset:i,align:f,alignOffset:g,arrowPadding:w,collisionBoundary:P,collisionPadding:I,sticky:C,hideWhenDetached:d,avoidCollisions:h}:{};return r.jsx(Be,{scope:e,content:v,viewport:M,onViewportChange:ne,itemRefCallback:fe,selectedItem:O,onItemLeave:me,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:X,position:l,isPositioned:K,searchRef:pe,children:r.jsx(Tt,{as:Wt,allowPinchZoom:!0,children:r.jsx(Pt,{asChild:!0,trapped:m.open,onMountAutoFocus:p=>{p.preventDefault()},onUnmountAutoFocus:N(a,p=>{m.trigger?.focus({preventScroll:!0}),p.preventDefault()}),children:r.jsx(Rt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:s,onFocusOutside:p=>p.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:r.jsx(le,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:p=>p.preventDefault(),...x,...re,onPlaced:()=>V(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:N(x.onKeyDown,p=>{const b=p.ctrlKey||p.altKey||p.metaKey;if(p.key==="Tab"&&p.preventDefault(),!b&&p.key.length===1&&ae(p.key),["ArrowUp","ArrowDown","Home","End"].includes(p.key)){let S=B().filter(y=>!y.disabled).map(y=>y.ref.current);if(["ArrowUp","End"].includes(p.key)&&(S=S.slice().reverse()),["ArrowUp","ArrowDown"].includes(p.key)){const y=p.target,T=S.indexOf(y);S=S.slice(T+1)}setTimeout(()=>E(S)),p.preventDefault()}})})})})})})});Ve.displayName=Ft;var Kt="SelectItemAlignedPosition",He=o.forwardRef((t,n)=>{const{__scopeSelect:e,onPlaced:l,...a}=t,u=Y(ee,e),s=q(ee,e),[c,i]=o.useState(null),[f,g]=o.useState(null),w=L(n,R=>g(R)),P=de(e),I=o.useRef(!1),C=o.useRef(!0),{viewport:d,selectedItem:h,selectedItemText:x,focusSelectedItem:m}=s,v=o.useCallback(()=>{if(u.trigger&&u.valueNode&&c&&f&&d&&h&&x){const R=u.trigger.getBoundingClientRect(),O=f.getBoundingClientRect(),W=u.valueNode.getBoundingClientRect(),X=x.getBoundingClientRect();if(u.dir!=="rtl"){const y=X.left-O.left,T=W.left-y,Z=R.left-T,J=R.width+Z,he=Math.max(J,O.width),ve=window.innerWidth-A,ge=Ne(T,[A,Math.max(A,ve-he)]);c.style.minWidth=J+"px",c.style.left=ge+"px"}else{const y=O.right-X.right,T=window.innerWidth-W.right-y,Z=window.innerWidth-R.right-T,J=R.width+Z,he=Math.max(J,O.width),ve=window.innerWidth-A,ge=Ne(T,[A,Math.max(A,ve-he)]);c.style.minWidth=J+"px",c.style.right=ge+"px"}const k=P(),B=window.innerHeight-A*2,K=d.scrollHeight,V=window.getComputedStyle(f),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),U=parseInt(V.paddingBottom,10),z=H+E+K+U+D,pe=Math.min(h.offsetHeight*5,z),ae=window.getComputedStyle(d),fe=parseInt(ae.paddingTop,10),me=parseInt(ae.paddingBottom,10),te=R.top+R.height/2-A,le=B-te,re=h.offsetHeight/2,p=h.offsetTop+re,b=H+E+p,_=z-b;if(b<=te){const y=k.length>0&&h===k[k.length-1].ref.current;c.style.bottom="0px";const T=f.clientHeight-d.offsetTop-d.offsetHeight,Z=Math.max(le,re+(y?me:0)+T+D),J=b+Z;c.style.height=J+"px"}else{const y=k.length>0&&h===k[0].ref.current;c.style.top="0px";const Z=Math.max(te,H+d.offsetTop+(y?fe:0)+re)+_;c.style.height=Z+"px",d.scrollTop=b-te+d.offsetTop}c.style.margin=`${A}px 0`,c.style.minHeight=pe+"px",c.style.maxHeight=B+"px",l?.(),requestAnimationFrame(()=>I.current=!0)}},[P,u.trigger,u.valueNode,c,f,d,h,x,u.dir,l]);G(()=>v(),[v]);const[F,M]=o.useState();G(()=>{f&&M(window.getComputedStyle(f).zIndex)},[f]);const ne=o.useCallback(R=>{R&&C.current===!0&&(v(),m?.(),C.current=!1)},[v,m]);return r.jsx(Gt,{scope:e,contentWrapper:c,shouldExpandOnScrollRef:I,onScrollButtonChange:ne,children:r.jsx("div",{ref:i,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:r.jsx(j.div,{...a,ref:w,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});He.displayName=Kt;var zt="SelectPopperPosition",xe=o.forwardRef((t,n)=>{const{__scopeSelect:e,align:l="start",collisionPadding:a=A,...u}=t,s=ue(e);return r.jsx(Et,{...s,...u,ref:n,align:l,collisionPadding:a,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});xe.displayName=zt;var[Gt,Ie]=oe(ee,{}),Se="SelectViewport",Ue=o.forwardRef((t,n)=>{const{__scopeSelect:e,nonce:l,...a}=t,u=q(Se,e),s=Ie(Se,e),c=L(n,u.onViewportChange),i=o.useRef(0);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),r.jsx(ie.Slot,{scope:e,children:r.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:N(a.onScroll,f=>{const g=f.currentTarget,{contentWrapper:w,shouldExpandOnScrollRef:P}=s;if(P?.current&&w){const I=Math.abs(i.current-g.scrollTop);if(I>0){const C=window.innerHeight-A*2,d=parseFloat(w.style.minHeight),h=parseFloat(w.style.height),x=Math.max(d,h);if(x<C){const m=x+I,v=Math.min(C,m),F=m-v;w.style.height=v+"px",w.style.bottom==="0px"&&(g.scrollTop=F>0?F:0,w.style.justifyContent="flex-end")}}}i.current=g.scrollTop})})})]})});Ue.displayName=Se;var Fe="SelectGroup",[$t,Yt]=oe(Fe),We=o.forwardRef((t,n)=>{const{__scopeSelect:e,...l}=t,a=be();return r.jsx($t,{scope:e,id:a,children:r.jsx(j.div,{role:"group","aria-labelledby":a,...l,ref:n})})});We.displayName=Fe;var Ke="SelectLabel",ze=o.forwardRef((t,n)=>{const{__scopeSelect:e,...l}=t,a=Yt(Ke,e);return r.jsx(j.div,{id:a.id,...l,ref:n})});ze.displayName=Ke;var ce="SelectItem",[qt,Ge]=oe(ce),$e=o.forwardRef((t,n)=>{const{__scopeSelect:e,value:l,disabled:a=!1,textValue:u,...s}=t,c=Y(ce,e),i=q(ce,e),f=c.value===l,[g,w]=o.useState(u??""),[P,I]=o.useState(!1),C=L(n,m=>i.itemRefCallback?.(m,l,a)),d=be(),h=o.useRef("touch"),x=()=>{a||(c.onValueChange(l),c.onOpenChange(!1))};if(l==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return r.jsx(qt,{scope:e,value:l,disabled:a,textId:d,isSelected:f,onItemTextChange:o.useCallback(m=>{w(v=>v||(m?.textContent??"").trim())},[]),children:r.jsx(ie.ItemSlot,{scope:e,value:l,disabled:a,textValue:g,children:r.jsx(j.div,{role:"option","aria-labelledby":d,"data-highlighted":P?"":void 0,"aria-selected":f&&P,"data-state":f?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...s,ref:C,onFocus:N(s.onFocus,()=>I(!0)),onBlur:N(s.onBlur,()=>I(!1)),onClick:N(s.onClick,()=>{h.current!=="mouse"&&x()}),onPointerUp:N(s.onPointerUp,()=>{h.current==="mouse"&&x()}),onPointerDown:N(s.onPointerDown,m=>{h.current=m.pointerType}),onPointerMove:N(s.onPointerMove,m=>{h.current=m.pointerType,a?i.onItemLeave?.():h.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&i.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,m=>{i.searchRef?.current!==""&&m.key===" "||(Dt.includes(m.key)&&x(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ce;var se="SelectItemText",Ye=o.forwardRef((t,n)=>{const{__scopeSelect:e,className:l,style:a,...u}=t,s=Y(se,e),c=q(se,e),i=Ge(se,e),f=Vt(se,e),[g,w]=o.useState(null),P=L(n,x=>w(x),i.onItemTextChange,x=>c.itemTextRefCallback?.(x,i.value,i.disabled)),I=g?.textContent,C=o.useMemo(()=>r.jsx("option",{value:i.value,disabled:i.disabled,children:I},i.value),[i.disabled,i.value,I]),{onNativeOptionAdd:d,onNativeOptionRemove:h}=f;return G(()=>(d(C),()=>h(C)),[d,h,C]),r.jsxs(r.Fragment,{children:[r.jsx(j.span,{id:i.textId,...u,ref:P}),i.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Re.createPortal(u.children,s.valueNode):null]})});Ye.displayName=se;var qe="SelectItemIndicator",Xe=o.forwardRef((t,n)=>{const{__scopeSelect:e,...l}=t;return Ge(qe,e).isSelected?r.jsx(j.span,{"aria-hidden":!0,...l,ref:n}):null});Xe.displayName=qe;var we="SelectScrollUpButton",Ze=o.forwardRef((t,n)=>{const e=q(we,t.__scopeSelect),l=Ie(we,t.__scopeSelect),[a,u]=o.useState(!1),s=L(n,l.onScrollButtonChange);return G(()=>{if(e.viewport&&e.isPositioned){let c=function(){const f=i.scrollTop>0;u(f)};const i=e.viewport;return c(),i.addEventListener("scroll",c),()=>i.removeEventListener("scroll",c)}},[e.viewport,e.isPositioned]),a?r.jsx(Qe,{...t,ref:s,onAutoScroll:()=>{const{viewport:c,selectedItem:i}=e;c&&i&&(c.scrollTop=c.scrollTop-i.offsetHeight)}}):null});Ze.displayName=we;var ye="SelectScrollDownButton",Je=o.forwardRef((t,n)=>{const e=q(ye,t.__scopeSelect),l=Ie(ye,t.__scopeSelect),[a,u]=o.useState(!1),s=L(n,l.onScrollButtonChange);return G(()=>{if(e.viewport&&e.isPositioned){let c=function(){const f=i.scrollHeight-i.clientHeight,g=Math.ceil(i.scrollTop)<f;u(g)};const i=e.viewport;return c(),i.addEventListener("scroll",c),()=>i.removeEventListener("scroll",c)}},[e.viewport,e.isPositioned]),a?r.jsx(Qe,{...t,ref:s,onAutoScroll:()=>{const{viewport:c,selectedItem:i}=e;c&&i&&(c.scrollTop=c.scrollTop+i.offsetHeight)}}):null});Je.displayName=ye;var Qe=o.forwardRef((t,n)=>{const{__scopeSelect:e,onAutoScroll:l,...a}=t,u=q("SelectScrollButton",e),s=o.useRef(null),c=de(e),i=o.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return o.useEffect(()=>()=>i(),[i]),G(()=>{c().find(g=>g.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),r.jsx(j.div,{"aria-hidden":!0,...a,ref:n,style:{flexShrink:0,...a.style},onPointerDown:N(a.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(l,50))}),onPointerMove:N(a.onPointerMove,()=>{u.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(l,50))}),onPointerLeave:N(a.onPointerLeave,()=>{i()})})}),Xt="SelectSeparator",et=o.forwardRef((t,n)=>{const{__scopeSelect:e,...l}=t;return r.jsx(j.div,{"aria-hidden":!0,...l,ref:n})});et.displayName=Xt;var Ce="SelectArrow",Zt=o.forwardRef((t,n)=>{const{__scopeSelect:e,...l}=t,a=ue(e),u=Y(Ce,e),s=q(Ce,e);return u.open&&s.position==="popper"?r.jsx(_t,{...a,...l,ref:n}):null});Zt.displayName=Ce;var Jt="SelectBubbleInput",tt=o.forwardRef(({__scopeSelect:t,value:n,...e},l)=>{const a=o.useRef(null),u=L(l,a),s=xt(n);return o.useEffect(()=>{const c=a.current;if(!c)return;const i=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(i,"value").set;if(s!==n&&g){const w=new Event("change",{bubbles:!0});g.call(c,n),c.dispatchEvent(w)}},[s,n]),r.jsx(j.select,{...e,style:{...St,...e.style},ref:u,defaultValue:n})});tt.displayName=Jt;function ot(t){return t===""||t===void 0}function nt(t){const n=Ct(t),e=o.useRef(""),l=o.useRef(0),a=o.useCallback(s=>{const c=e.current+s;n(c),(function i(f){e.current=f,window.clearTimeout(l.current),f!==""&&(l.current=window.setTimeout(()=>i(""),1e3))})(c)},[n]),u=o.useCallback(()=>{e.current="",window.clearTimeout(l.current)},[]);return o.useEffect(()=>()=>window.clearTimeout(l.current),[]),[e,a,u]}function rt(t,n,e){const a=n.length>1&&Array.from(n).every(f=>f===n[0])?n[0]:n,u=e?t.indexOf(e):-1;let s=Qt(t,Math.max(u,0));a.length===1&&(s=s.filter(f=>f!==e));const i=s.find(f=>f.textValue.toLowerCase().startsWith(a.toLowerCase()));return i!==e?i:void 0}function Qt(t,n){return t.map((e,l)=>t[(n+l)%t.length])}var eo=_e,st=Me,to=Oe,oo=De,no=Le,at=ke,ro=Ue,so=We,lt=ze,ct=$e,ao=Ye,lo=Xe,it=Ze,dt=Je,ut=et;const vo=eo,go=so,xo=to,co=o.forwardRef(({className:t,children:n,...e},l)=>r.jsxs(st,{ref:l,className:$("flex h-[34px] w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent hover:bg-accent px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...e,children:[n,r.jsx(oo,{asChild:!0,children:r.jsx(Ee,{className:"-mr-0.5 ml-1 size-4 opacity-50"})})]}));co.displayName=st.displayName;const pt=o.forwardRef(({className:t,...n},e)=>r.jsx(it,{ref:e,className:$("flex cursor-default items-center justify-center py-1",t),...n,children:r.jsx(At,{className:"size-4"})}));pt.displayName=it.displayName;const ft=o.forwardRef(({className:t,...n},e)=>r.jsx(dt,{ref:e,className:$("flex cursor-default items-center justify-center py-1",t),...n,children:r.jsx(Ee,{className:"size-4"})}));ft.displayName=dt.displayName;const io=o.forwardRef(({className:t,children:n,position:e="popper",...l},a)=>r.jsx(no,{children:r.jsx("div",{className:jt,children:r.jsxs(at,{ref:a,className:$("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",e==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:e,...l,children:[r.jsx(pt,{}),r.jsx(ro,{className:$("p-1",e==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),r.jsx(ft,{})]})})}));io.displayName=at.displayName;const uo=o.forwardRef(({className:t,...n},e)=>r.jsx(lt,{ref:e,className:$("px-2 py-1.5 text-sm font-semibold",t),...n}));uo.displayName=lt.displayName;const po=o.forwardRef(({className:t,children:n,...e},l)=>r.jsxs(ct,{ref:l,className:$("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...e,children:[r.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:r.jsx(lo,{children:r.jsx(Mt,{className:"size-4"})})}),r.jsx(ao,{children:n})]}));po.displayName=ct.displayName;const fo=o.forwardRef(({className:t,...n},e)=>r.jsx(ut,{ref:e,className:$("-mx-1 my-1 h-px bg-muted",t),...n}));fo.displayName=ut.displayName;export{vo as S,co as a,xo as b,io as c,go as d,uo as e,po as f};
1
+ import{r as o,ba as Pe,as as mt,at as Te,j as r,bb as ht,au as vt,av as be,bc as gt,aG as L,bd as G,aw as j,aH as xt,be as St,bf as wt,aA as N,bg as yt,aD as Re,bh as Ct,bi as bt,bj as It,bk as Tt,bl as Nt,bm as Pt,bn as Rt,bo as Et,bp as _t,z as $,bq as Ee,br as jt,a0 as Mt}from"./index-CM-iA6b-.js";import{C as At}from"./message-square-text-DVZjnBBF.js";function Ne(t,[n,e]){return Math.min(e,Math.max(n,t))}var Ot=[" ","Enter","ArrowUp","ArrowDown"],Dt=[" ","Enter"],Q="Select",[ie,de,Lt]=gt(Q),[oe]=vt(Q,[Lt,Pe]),ue=Pe(),[kt,Y]=oe(Q),[Bt,Vt]=oe(Q),_e=t=>{const{__scopeSelect:n,children:e,open:l,defaultOpen:a,onOpenChange:u,value:s,defaultValue:c,onValueChange:i,dir:f,name:g,autoComplete:w,disabled:P,required:I,form:C}=t,d=ue(n),[h,x]=o.useState(null),[m,v]=o.useState(null),[F,M]=o.useState(!1),ne=mt(f),[R,O]=Te({prop:l,defaultProp:a??!1,onChange:u,caller:Q}),[W,X]=Te({prop:s,defaultProp:c,onChange:i,caller:Q}),k=o.useRef(null),B=h?C||!!h.closest("form"):!0,[K,V]=o.useState(new Set),H=Array.from(K).map(E=>E.props.value).join(";");return r.jsx(ht,{...d,children:r.jsxs(kt,{required:I,scope:n,trigger:h,onTriggerChange:x,valueNode:m,onValueNodeChange:v,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:be(),value:W,onValueChange:X,open:R,onOpenChange:O,dir:ne,triggerPointerDownPosRef:k,disabled:P,children:[r.jsx(ie.Provider,{scope:n,children:r.jsx(Bt,{scope:t.__scopeSelect,onNativeOptionAdd:o.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:o.useCallback(E=>{V(D=>{const U=new Set(D);return U.delete(E),U})},[]),children:e})}),B?r.jsxs(tt,{"aria-hidden":!0,required:I,tabIndex:-1,name:g,autoComplete:w,value:W,onChange:E=>X(E.target.value),disabled:P,form:C,children:[W===void 0?r.jsx("option",{value:""}):null,Array.from(K)]},H):null]})})};_e.displayName=Q;var je="SelectTrigger",Me=o.forwardRef((t,n)=>{const{__scopeSelect:e,disabled:l=!1,...a}=t,u=ue(e),s=Y(je,e),c=s.disabled||l,i=L(n,s.onTriggerChange),f=de(e),g=o.useRef("touch"),[w,P,I]=nt(d=>{const h=f().filter(v=>!v.disabled),x=h.find(v=>v.value===s.value),m=rt(h,d,x);m!==void 0&&s.onValueChange(m.value)}),C=d=>{c||(s.onOpenChange(!0),I()),d&&(s.triggerPointerDownPosRef.current={x:Math.round(d.pageX),y:Math.round(d.pageY)})};return r.jsx(wt,{asChild:!0,...u,children:r.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":ot(s.value)?"":void 0,...a,ref:i,onClick:N(a.onClick,d=>{d.currentTarget.focus(),g.current!=="mouse"&&C(d)}),onPointerDown:N(a.onPointerDown,d=>{g.current=d.pointerType;const h=d.target;h.hasPointerCapture(d.pointerId)&&h.releasePointerCapture(d.pointerId),d.button===0&&d.ctrlKey===!1&&d.pointerType==="mouse"&&(C(d),d.preventDefault())}),onKeyDown:N(a.onKeyDown,d=>{const h=w.current!=="";!(d.ctrlKey||d.altKey||d.metaKey)&&d.key.length===1&&P(d.key),!(h&&d.key===" ")&&Ot.includes(d.key)&&(C(),d.preventDefault())})})})});Me.displayName=je;var Ae="SelectValue",Oe=o.forwardRef((t,n)=>{const{__scopeSelect:e,className:l,style:a,children:u,placeholder:s="",...c}=t,i=Y(Ae,e),{onValueNodeHasChildrenChange:f}=i,g=u!==void 0,w=L(n,i.onValueNodeChange);return G(()=>{f(g)},[f,g]),r.jsx(j.span,{...c,ref:w,style:{pointerEvents:"none"},children:ot(i.value)?r.jsx(r.Fragment,{children:s}):u})});Oe.displayName=Ae;var Ht="SelectIcon",De=o.forwardRef((t,n)=>{const{__scopeSelect:e,children:l,...a}=t;return r.jsx(j.span,{"aria-hidden":!0,...a,ref:n,children:l||"▼"})});De.displayName=Ht;var Ut="SelectPortal",Le=t=>r.jsx(yt,{asChild:!0,...t});Le.displayName=Ut;var ee="SelectContent",ke=o.forwardRef((t,n)=>{const e=Y(ee,t.__scopeSelect),[l,a]=o.useState();if(G(()=>{a(new DocumentFragment)},[]),!e.open){const u=l;return u?Re.createPortal(r.jsx(Be,{scope:t.__scopeSelect,children:r.jsx(ie.Slot,{scope:t.__scopeSelect,children:r.jsx("div",{children:t.children})})}),u):null}return r.jsx(Ve,{...t,ref:n})});ke.displayName=ee;var A=10,[Be,q]=oe(ee),Ft="SelectContentImpl",Wt=Nt("SelectContent.RemoveScroll"),Ve=o.forwardRef((t,n)=>{const{__scopeSelect:e,position:l="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:u,onPointerDownOutside:s,side:c,sideOffset:i,align:f,alignOffset:g,arrowPadding:w,collisionBoundary:P,collisionPadding:I,sticky:C,hideWhenDetached:d,avoidCollisions:h,...x}=t,m=Y(ee,e),[v,F]=o.useState(null),[M,ne]=o.useState(null),R=L(n,p=>F(p)),[O,W]=o.useState(null),[X,k]=o.useState(null),B=de(e),[K,V]=o.useState(!1),H=o.useRef(!1);o.useEffect(()=>{if(v)return bt(v)},[v]),It();const E=o.useCallback(p=>{const[b,..._]=B().map(T=>T.ref.current),[S]=_.slice(-1),y=document.activeElement;for(const T of p)if(T===y||(T?.scrollIntoView({block:"nearest"}),T===b&&M&&(M.scrollTop=0),T===S&&M&&(M.scrollTop=M.scrollHeight),T?.focus(),document.activeElement!==y))return},[B,M]),D=o.useCallback(()=>E([O,v]),[E,O,v]);o.useEffect(()=>{K&&D()},[K,D]);const{onOpenChange:U,triggerPointerDownPosRef:z}=m;o.useEffect(()=>{if(v){let p={x:0,y:0};const b=S=>{p={x:Math.abs(Math.round(S.pageX)-(z.current?.x??0)),y:Math.abs(Math.round(S.pageY)-(z.current?.y??0))}},_=S=>{p.x<=10&&p.y<=10?S.preventDefault():v.contains(S.target)||U(!1),document.removeEventListener("pointermove",b),z.current=null};return z.current!==null&&(document.addEventListener("pointermove",b),document.addEventListener("pointerup",_,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",b),document.removeEventListener("pointerup",_,{capture:!0})}}},[v,U,z]),o.useEffect(()=>{const p=()=>U(!1);return window.addEventListener("blur",p),window.addEventListener("resize",p),()=>{window.removeEventListener("blur",p),window.removeEventListener("resize",p)}},[U]);const[pe,ae]=nt(p=>{const b=B().filter(y=>!y.disabled),_=b.find(y=>y.ref.current===document.activeElement),S=rt(b,p,_);S&&setTimeout(()=>S.ref.current.focus())}),fe=o.useCallback((p,b,_)=>{const S=!H.current&&!_;(m.value!==void 0&&m.value===b||S)&&(W(p),S&&(H.current=!0))},[m.value]),me=o.useCallback(()=>v?.focus(),[v]),te=o.useCallback((p,b,_)=>{const S=!H.current&&!_;(m.value!==void 0&&m.value===b||S)&&k(p)},[m.value]),le=l==="popper"?xe:He,re=le===xe?{side:c,sideOffset:i,align:f,alignOffset:g,arrowPadding:w,collisionBoundary:P,collisionPadding:I,sticky:C,hideWhenDetached:d,avoidCollisions:h}:{};return r.jsx(Be,{scope:e,content:v,viewport:M,onViewportChange:ne,itemRefCallback:fe,selectedItem:O,onItemLeave:me,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:X,position:l,isPositioned:K,searchRef:pe,children:r.jsx(Tt,{as:Wt,allowPinchZoom:!0,children:r.jsx(Pt,{asChild:!0,trapped:m.open,onMountAutoFocus:p=>{p.preventDefault()},onUnmountAutoFocus:N(a,p=>{m.trigger?.focus({preventScroll:!0}),p.preventDefault()}),children:r.jsx(Rt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:s,onFocusOutside:p=>p.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:r.jsx(le,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:p=>p.preventDefault(),...x,...re,onPlaced:()=>V(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:N(x.onKeyDown,p=>{const b=p.ctrlKey||p.altKey||p.metaKey;if(p.key==="Tab"&&p.preventDefault(),!b&&p.key.length===1&&ae(p.key),["ArrowUp","ArrowDown","Home","End"].includes(p.key)){let S=B().filter(y=>!y.disabled).map(y=>y.ref.current);if(["ArrowUp","End"].includes(p.key)&&(S=S.slice().reverse()),["ArrowUp","ArrowDown"].includes(p.key)){const y=p.target,T=S.indexOf(y);S=S.slice(T+1)}setTimeout(()=>E(S)),p.preventDefault()}})})})})})})});Ve.displayName=Ft;var Kt="SelectItemAlignedPosition",He=o.forwardRef((t,n)=>{const{__scopeSelect:e,onPlaced:l,...a}=t,u=Y(ee,e),s=q(ee,e),[c,i]=o.useState(null),[f,g]=o.useState(null),w=L(n,R=>g(R)),P=de(e),I=o.useRef(!1),C=o.useRef(!0),{viewport:d,selectedItem:h,selectedItemText:x,focusSelectedItem:m}=s,v=o.useCallback(()=>{if(u.trigger&&u.valueNode&&c&&f&&d&&h&&x){const R=u.trigger.getBoundingClientRect(),O=f.getBoundingClientRect(),W=u.valueNode.getBoundingClientRect(),X=x.getBoundingClientRect();if(u.dir!=="rtl"){const y=X.left-O.left,T=W.left-y,Z=R.left-T,J=R.width+Z,he=Math.max(J,O.width),ve=window.innerWidth-A,ge=Ne(T,[A,Math.max(A,ve-he)]);c.style.minWidth=J+"px",c.style.left=ge+"px"}else{const y=O.right-X.right,T=window.innerWidth-W.right-y,Z=window.innerWidth-R.right-T,J=R.width+Z,he=Math.max(J,O.width),ve=window.innerWidth-A,ge=Ne(T,[A,Math.max(A,ve-he)]);c.style.minWidth=J+"px",c.style.right=ge+"px"}const k=P(),B=window.innerHeight-A*2,K=d.scrollHeight,V=window.getComputedStyle(f),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),U=parseInt(V.paddingBottom,10),z=H+E+K+U+D,pe=Math.min(h.offsetHeight*5,z),ae=window.getComputedStyle(d),fe=parseInt(ae.paddingTop,10),me=parseInt(ae.paddingBottom,10),te=R.top+R.height/2-A,le=B-te,re=h.offsetHeight/2,p=h.offsetTop+re,b=H+E+p,_=z-b;if(b<=te){const y=k.length>0&&h===k[k.length-1].ref.current;c.style.bottom="0px";const T=f.clientHeight-d.offsetTop-d.offsetHeight,Z=Math.max(le,re+(y?me:0)+T+D),J=b+Z;c.style.height=J+"px"}else{const y=k.length>0&&h===k[0].ref.current;c.style.top="0px";const Z=Math.max(te,H+d.offsetTop+(y?fe:0)+re)+_;c.style.height=Z+"px",d.scrollTop=b-te+d.offsetTop}c.style.margin=`${A}px 0`,c.style.minHeight=pe+"px",c.style.maxHeight=B+"px",l?.(),requestAnimationFrame(()=>I.current=!0)}},[P,u.trigger,u.valueNode,c,f,d,h,x,u.dir,l]);G(()=>v(),[v]);const[F,M]=o.useState();G(()=>{f&&M(window.getComputedStyle(f).zIndex)},[f]);const ne=o.useCallback(R=>{R&&C.current===!0&&(v(),m?.(),C.current=!1)},[v,m]);return r.jsx(Gt,{scope:e,contentWrapper:c,shouldExpandOnScrollRef:I,onScrollButtonChange:ne,children:r.jsx("div",{ref:i,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:r.jsx(j.div,{...a,ref:w,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});He.displayName=Kt;var zt="SelectPopperPosition",xe=o.forwardRef((t,n)=>{const{__scopeSelect:e,align:l="start",collisionPadding:a=A,...u}=t,s=ue(e);return r.jsx(Et,{...s,...u,ref:n,align:l,collisionPadding:a,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});xe.displayName=zt;var[Gt,Ie]=oe(ee,{}),Se="SelectViewport",Ue=o.forwardRef((t,n)=>{const{__scopeSelect:e,nonce:l,...a}=t,u=q(Se,e),s=Ie(Se,e),c=L(n,u.onViewportChange),i=o.useRef(0);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),r.jsx(ie.Slot,{scope:e,children:r.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:N(a.onScroll,f=>{const g=f.currentTarget,{contentWrapper:w,shouldExpandOnScrollRef:P}=s;if(P?.current&&w){const I=Math.abs(i.current-g.scrollTop);if(I>0){const C=window.innerHeight-A*2,d=parseFloat(w.style.minHeight),h=parseFloat(w.style.height),x=Math.max(d,h);if(x<C){const m=x+I,v=Math.min(C,m),F=m-v;w.style.height=v+"px",w.style.bottom==="0px"&&(g.scrollTop=F>0?F:0,w.style.justifyContent="flex-end")}}}i.current=g.scrollTop})})})]})});Ue.displayName=Se;var Fe="SelectGroup",[$t,Yt]=oe(Fe),We=o.forwardRef((t,n)=>{const{__scopeSelect:e,...l}=t,a=be();return r.jsx($t,{scope:e,id:a,children:r.jsx(j.div,{role:"group","aria-labelledby":a,...l,ref:n})})});We.displayName=Fe;var Ke="SelectLabel",ze=o.forwardRef((t,n)=>{const{__scopeSelect:e,...l}=t,a=Yt(Ke,e);return r.jsx(j.div,{id:a.id,...l,ref:n})});ze.displayName=Ke;var ce="SelectItem",[qt,Ge]=oe(ce),$e=o.forwardRef((t,n)=>{const{__scopeSelect:e,value:l,disabled:a=!1,textValue:u,...s}=t,c=Y(ce,e),i=q(ce,e),f=c.value===l,[g,w]=o.useState(u??""),[P,I]=o.useState(!1),C=L(n,m=>i.itemRefCallback?.(m,l,a)),d=be(),h=o.useRef("touch"),x=()=>{a||(c.onValueChange(l),c.onOpenChange(!1))};if(l==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return r.jsx(qt,{scope:e,value:l,disabled:a,textId:d,isSelected:f,onItemTextChange:o.useCallback(m=>{w(v=>v||(m?.textContent??"").trim())},[]),children:r.jsx(ie.ItemSlot,{scope:e,value:l,disabled:a,textValue:g,children:r.jsx(j.div,{role:"option","aria-labelledby":d,"data-highlighted":P?"":void 0,"aria-selected":f&&P,"data-state":f?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...s,ref:C,onFocus:N(s.onFocus,()=>I(!0)),onBlur:N(s.onBlur,()=>I(!1)),onClick:N(s.onClick,()=>{h.current!=="mouse"&&x()}),onPointerUp:N(s.onPointerUp,()=>{h.current==="mouse"&&x()}),onPointerDown:N(s.onPointerDown,m=>{h.current=m.pointerType}),onPointerMove:N(s.onPointerMove,m=>{h.current=m.pointerType,a?i.onItemLeave?.():h.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&i.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,m=>{i.searchRef?.current!==""&&m.key===" "||(Dt.includes(m.key)&&x(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ce;var se="SelectItemText",Ye=o.forwardRef((t,n)=>{const{__scopeSelect:e,className:l,style:a,...u}=t,s=Y(se,e),c=q(se,e),i=Ge(se,e),f=Vt(se,e),[g,w]=o.useState(null),P=L(n,x=>w(x),i.onItemTextChange,x=>c.itemTextRefCallback?.(x,i.value,i.disabled)),I=g?.textContent,C=o.useMemo(()=>r.jsx("option",{value:i.value,disabled:i.disabled,children:I},i.value),[i.disabled,i.value,I]),{onNativeOptionAdd:d,onNativeOptionRemove:h}=f;return G(()=>(d(C),()=>h(C)),[d,h,C]),r.jsxs(r.Fragment,{children:[r.jsx(j.span,{id:i.textId,...u,ref:P}),i.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Re.createPortal(u.children,s.valueNode):null]})});Ye.displayName=se;var qe="SelectItemIndicator",Xe=o.forwardRef((t,n)=>{const{__scopeSelect:e,...l}=t;return Ge(qe,e).isSelected?r.jsx(j.span,{"aria-hidden":!0,...l,ref:n}):null});Xe.displayName=qe;var we="SelectScrollUpButton",Ze=o.forwardRef((t,n)=>{const e=q(we,t.__scopeSelect),l=Ie(we,t.__scopeSelect),[a,u]=o.useState(!1),s=L(n,l.onScrollButtonChange);return G(()=>{if(e.viewport&&e.isPositioned){let c=function(){const f=i.scrollTop>0;u(f)};const i=e.viewport;return c(),i.addEventListener("scroll",c),()=>i.removeEventListener("scroll",c)}},[e.viewport,e.isPositioned]),a?r.jsx(Qe,{...t,ref:s,onAutoScroll:()=>{const{viewport:c,selectedItem:i}=e;c&&i&&(c.scrollTop=c.scrollTop-i.offsetHeight)}}):null});Ze.displayName=we;var ye="SelectScrollDownButton",Je=o.forwardRef((t,n)=>{const e=q(ye,t.__scopeSelect),l=Ie(ye,t.__scopeSelect),[a,u]=o.useState(!1),s=L(n,l.onScrollButtonChange);return G(()=>{if(e.viewport&&e.isPositioned){let c=function(){const f=i.scrollHeight-i.clientHeight,g=Math.ceil(i.scrollTop)<f;u(g)};const i=e.viewport;return c(),i.addEventListener("scroll",c),()=>i.removeEventListener("scroll",c)}},[e.viewport,e.isPositioned]),a?r.jsx(Qe,{...t,ref:s,onAutoScroll:()=>{const{viewport:c,selectedItem:i}=e;c&&i&&(c.scrollTop=c.scrollTop+i.offsetHeight)}}):null});Je.displayName=ye;var Qe=o.forwardRef((t,n)=>{const{__scopeSelect:e,onAutoScroll:l,...a}=t,u=q("SelectScrollButton",e),s=o.useRef(null),c=de(e),i=o.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return o.useEffect(()=>()=>i(),[i]),G(()=>{c().find(g=>g.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),r.jsx(j.div,{"aria-hidden":!0,...a,ref:n,style:{flexShrink:0,...a.style},onPointerDown:N(a.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(l,50))}),onPointerMove:N(a.onPointerMove,()=>{u.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(l,50))}),onPointerLeave:N(a.onPointerLeave,()=>{i()})})}),Xt="SelectSeparator",et=o.forwardRef((t,n)=>{const{__scopeSelect:e,...l}=t;return r.jsx(j.div,{"aria-hidden":!0,...l,ref:n})});et.displayName=Xt;var Ce="SelectArrow",Zt=o.forwardRef((t,n)=>{const{__scopeSelect:e,...l}=t,a=ue(e),u=Y(Ce,e),s=q(Ce,e);return u.open&&s.position==="popper"?r.jsx(_t,{...a,...l,ref:n}):null});Zt.displayName=Ce;var Jt="SelectBubbleInput",tt=o.forwardRef(({__scopeSelect:t,value:n,...e},l)=>{const a=o.useRef(null),u=L(l,a),s=xt(n);return o.useEffect(()=>{const c=a.current;if(!c)return;const i=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(i,"value").set;if(s!==n&&g){const w=new Event("change",{bubbles:!0});g.call(c,n),c.dispatchEvent(w)}},[s,n]),r.jsx(j.select,{...e,style:{...St,...e.style},ref:u,defaultValue:n})});tt.displayName=Jt;function ot(t){return t===""||t===void 0}function nt(t){const n=Ct(t),e=o.useRef(""),l=o.useRef(0),a=o.useCallback(s=>{const c=e.current+s;n(c),(function i(f){e.current=f,window.clearTimeout(l.current),f!==""&&(l.current=window.setTimeout(()=>i(""),1e3))})(c)},[n]),u=o.useCallback(()=>{e.current="",window.clearTimeout(l.current)},[]);return o.useEffect(()=>()=>window.clearTimeout(l.current),[]),[e,a,u]}function rt(t,n,e){const a=n.length>1&&Array.from(n).every(f=>f===n[0])?n[0]:n,u=e?t.indexOf(e):-1;let s=Qt(t,Math.max(u,0));a.length===1&&(s=s.filter(f=>f!==e));const i=s.find(f=>f.textValue.toLowerCase().startsWith(a.toLowerCase()));return i!==e?i:void 0}function Qt(t,n){return t.map((e,l)=>t[(n+l)%t.length])}var eo=_e,st=Me,to=Oe,oo=De,no=Le,at=ke,ro=Ue,so=We,lt=ze,ct=$e,ao=Ye,lo=Xe,it=Ze,dt=Je,ut=et;const vo=eo,go=so,xo=to,co=o.forwardRef(({className:t,children:n,...e},l)=>r.jsxs(st,{ref:l,className:$("flex h-[34px] w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent hover:bg-accent px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...e,children:[n,r.jsx(oo,{asChild:!0,children:r.jsx(Ee,{className:"-mr-0.5 ml-1 size-4 opacity-50"})})]}));co.displayName=st.displayName;const pt=o.forwardRef(({className:t,...n},e)=>r.jsx(it,{ref:e,className:$("flex cursor-default items-center justify-center py-1",t),...n,children:r.jsx(At,{className:"size-4"})}));pt.displayName=it.displayName;const ft=o.forwardRef(({className:t,...n},e)=>r.jsx(dt,{ref:e,className:$("flex cursor-default items-center justify-center py-1",t),...n,children:r.jsx(Ee,{className:"size-4"})}));ft.displayName=dt.displayName;const io=o.forwardRef(({className:t,children:n,position:e="popper",...l},a)=>r.jsx(no,{children:r.jsx("div",{className:jt,children:r.jsxs(at,{ref:a,className:$("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",e==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:e,...l,children:[r.jsx(pt,{}),r.jsx(ro,{className:$("p-1",e==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),r.jsx(ft,{})]})})}));io.displayName=at.displayName;const uo=o.forwardRef(({className:t,...n},e)=>r.jsx(lt,{ref:e,className:$("px-2 py-1.5 text-sm font-semibold",t),...n}));uo.displayName=lt.displayName;const po=o.forwardRef(({className:t,children:n,...e},l)=>r.jsxs(ct,{ref:l,className:$("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...e,children:[r.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:r.jsx(lo,{children:r.jsx(Mt,{className:"size-4"})})}),r.jsx(ao,{children:n})]}));po.displayName=ct.displayName;const fo=o.forwardRef(({className:t,...n},e)=>r.jsx(ut,{ref:e,className:$("-mx-1 my-1 h-px bg-muted",t),...n}));fo.displayName=ut.displayName;export{vo as S,co as a,xo as b,io as c,go as d,uo as e,po as f};
@@ -1 +1 @@
1
- import{r as f,b as p,j as e,H as u,D as b,t as m,B as v,v as y,w as N,x as k,C as j,y as S,z as C,G as E}from"./index-CX1A5TwO.js";import{E as w}from"./edit-profile-Bi-G8vrq.js";const P=({account:s,className:r=""})=>{const[h,t]=f.useState(!1),a=p();return e.jsxs("div",{className:`flex flex-col ${r}`,children:[e.jsx(g,{}),e.jsxs(d,{children:[e.jsxs(c,{children:[e.jsx(o,{children:"Account"}),e.jsx(l,{children:"Edit your profile information and account details"})]}),e.jsxs(b,{open:h,onOpenChange:t,children:[e.jsx(m,{children:e.jsx(x,{children:e.jsx(v,{variant:"secondary",children:"Edit profile"})})}),e.jsxs(y,{onOpenAutoFocus:n=>n.preventDefault(),children:[e.jsx(N,{children:e.jsx(k,{children:"Profile settings"})}),s&&e.jsx(w,{account:s,setIsEditingProfile:t})]})]})]}),e.jsxs(d,{withHover:!0,onClick:()=>a("/preferences/moderation"),children:[e.jsxs(c,{children:[e.jsx(o,{children:"Moderation"}),e.jsx(l,{children:"Manage blocked users and domains"})]}),e.jsx(x,{className:"flex items-center gap-2",children:e.jsx(j,{size:20})})]}),e.jsxs(d,{withHover:!0,onClick:()=>a("/preferences/bluesky-sharing"),children:[e.jsxs(c,{children:[e.jsx(o,{children:"Bluesky sharing"}),e.jsx(l,{children:"Share content directly on Bluesky"})]}),e.jsxs(x,{className:"flex items-center gap-2",children:[s?.blueskyEnabled?e.jsx("span",{className:"font-medium text-black",children:"On"}):e.jsx("span",{children:"Off"}),e.jsx(j,{size:20})]})]}),e.jsx(g,{}),e.jsxs(d,{href:"https://ghost.org/help/social-web/",withHover:!0,children:[e.jsxs(c,{children:[e.jsx(o,{children:"Help"}),e.jsx(l,{children:"Social web guides and support resources"})]}),e.jsx(x,{children:e.jsx(S,{size:18})})]})]})},o=u,l=({children:s,className:r=""})=>e.jsx("span",{className:`text-sm text-gray-700 ${r}`,children:s}),c=({children:s,className:r=""})=>e.jsx("div",{className:`relative flex flex-col gap-0.5 ${r}`,children:s}),x=({children:s,className:r=""})=>e.jsx("div",{className:`relative text-gray-500 ${r}`,children:s}),d=({children:s,className:r="",withHover:h=!1,to:t,href:a,onClick:n})=>{const i=C("flex items-center justify-between py-3 gap-4",h?"relative cursor-pointer before:absolute before:inset-x-[-16px] before:inset-y-[-1px] before:rounded-md before:bg-gray-50 before:opacity-0 before:transition-opacity before:will-change-[opacity] hover:z-10 hover:cursor-pointer hover:border-b-transparent hover:before:opacity-100 dark:before:bg-gray-950":"",r);return t?e.jsx(E,{className:i,to:t,children:s}):a?e.jsx("a",{className:i,href:a,rel:"noreferrer",target:"_blank",children:s}):n?e.jsx("div",{className:i,role:"button",tabIndex:0,onClick:n,children:s}):e.jsx("div",{className:i,children:s})},g=()=>e.jsx("hr",{className:"my-3 h-px border-0 bg-gray-200 dark:bg-gray-950"});export{P as S,x as a};
1
+ import{r as f,b as p,j as e,H as u,D as b,t as m,B as v,v as y,w as N,x as k,C as j,y as S,z as C,G as E}from"./index-CM-iA6b-.js";import{E as w}from"./edit-profile-BY_oJrQn.js";const P=({account:s,className:r=""})=>{const[h,t]=f.useState(!1),a=p();return e.jsxs("div",{className:`flex flex-col ${r}`,children:[e.jsx(g,{}),e.jsxs(d,{children:[e.jsxs(c,{children:[e.jsx(o,{children:"Account"}),e.jsx(l,{children:"Edit your profile information and account details"})]}),e.jsxs(b,{open:h,onOpenChange:t,children:[e.jsx(m,{children:e.jsx(x,{children:e.jsx(v,{variant:"secondary",children:"Edit profile"})})}),e.jsxs(y,{onOpenAutoFocus:n=>n.preventDefault(),children:[e.jsx(N,{children:e.jsx(k,{children:"Profile settings"})}),s&&e.jsx(w,{account:s,setIsEditingProfile:t})]})]})]}),e.jsxs(d,{withHover:!0,onClick:()=>a("/preferences/moderation"),children:[e.jsxs(c,{children:[e.jsx(o,{children:"Moderation"}),e.jsx(l,{children:"Manage blocked users and domains"})]}),e.jsx(x,{className:"flex items-center gap-2",children:e.jsx(j,{size:20})})]}),e.jsxs(d,{withHover:!0,onClick:()=>a("/preferences/bluesky-sharing"),children:[e.jsxs(c,{children:[e.jsx(o,{children:"Bluesky sharing"}),e.jsx(l,{children:"Share content directly on Bluesky"})]}),e.jsxs(x,{className:"flex items-center gap-2",children:[s?.blueskyEnabled?e.jsx("span",{className:"font-medium text-black",children:"On"}):e.jsx("span",{children:"Off"}),e.jsx(j,{size:20})]})]}),e.jsx(g,{}),e.jsxs(d,{href:"https://ghost.org/help/social-web/",withHover:!0,children:[e.jsxs(c,{children:[e.jsx(o,{children:"Help"}),e.jsx(l,{children:"Social web guides and support resources"})]}),e.jsx(x,{children:e.jsx(S,{size:18})})]})]})},o=u,l=({children:s,className:r=""})=>e.jsx("span",{className:`text-sm text-gray-700 ${r}`,children:s}),c=({children:s,className:r=""})=>e.jsx("div",{className:`relative flex flex-col gap-0.5 ${r}`,children:s}),x=({children:s,className:r=""})=>e.jsx("div",{className:`relative text-gray-500 ${r}`,children:s}),d=({children:s,className:r="",withHover:h=!1,to:t,href:a,onClick:n})=>{const i=C("flex items-center justify-between py-3 gap-4",h?"relative cursor-pointer before:absolute before:inset-x-[-16px] before:inset-y-[-1px] before:rounded-md before:bg-gray-50 before:opacity-0 before:transition-opacity before:will-change-[opacity] hover:z-10 hover:cursor-pointer hover:border-b-transparent hover:before:opacity-100 dark:before:bg-gray-950":"",r);return t?e.jsx(E,{className:i,to:t,children:s}):a?e.jsx("a",{className:i,href:a,rel:"noreferrer",target:"_blank",children:s}):n?e.jsx("div",{className:i,role:"button",tabIndex:0,onClick:n,children:s}):e.jsx("div",{className:i,children:s})},g=()=>e.jsx("hr",{className:"my-3 h-px border-0 bg-gray-200 dark:bg-gray-950"});export{P as S,x as a};