ghost 6.18.2 → 6.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/tryghost-i18n-6.19.0.tgz +0 -0
- package/components/tryghost-parse-email-address-6.19.0.tgz +0 -0
- package/core/built/admin/assets/{PolarAngleAxis-DALH8FDm.js → PolarAngleAxis-CGprvq8M.js} +1 -1
- package/core/built/admin/assets/{_baseAssignValue-D_UsvJRN.js → _baseAssignValue-Bwn07Ln5.js} +1 -1
- package/core/built/admin/assets/{a-large-small-DVyx4GMu.js → a-large-small-p58xibEK.js} +1 -1
- package/core/built/admin/assets/admin-x-settings/admin-x-settings.js +1 -1
- package/core/built/admin/assets/admin-x-settings/{code-editor-view-DBrulgE8.mjs → code-editor-view-DCKvO1TY.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/{index-DgGwb1L-.mjs → index-BxWVtVnD.mjs} +6 -6
- package/core/built/admin/assets/admin-x-settings/{index-Cypgljb3.mjs → index-DyZIONe1.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/{index-CsGHbqSU.mjs → index-HfMJcj2U.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/{modals-rdo7i0D3.mjs → modals-CIiqfKY0.mjs} +7593 -7509
- package/core/built/admin/assets/{at-sign-CGNkBrZS.js → at-sign-BZPuAx5m.js} +1 -1
- package/core/built/admin/assets/audience-Cy9gLIa9.js +1 -0
- package/core/built/admin/assets/{avatar-flipboard-jqr9Aapd.js → avatar-flipboard-CLmWb5Xn.js} +1 -1
- package/core/built/admin/assets/{bluesky-sharing-C2749SVt.js → bluesky-sharing-BHt0oiii.js} +1 -1
- package/core/built/admin/assets/{chart-BAQCVPCH.js → chart--RFLGIL4.js} +1 -1
- package/core/built/admin/assets/{chunk.524.428356d01feabbc7b932.js → chunk.524.5c5c3f3273a86d1d9913.js} +7 -7
- package/core/built/admin/assets/{chunk.582.b8b41ba720f49d724992.js → chunk.582.e6c787cdf7e6de7819e0.js} +9 -9
- package/core/built/admin/assets/{code-editor-view-YNhJ1w71.js → code-editor-view-BW9y0JXN.js} +1 -1
- package/core/built/admin/assets/comments-C_lilDBp.js +1 -0
- package/core/built/admin/assets/content-helpers-BOnQQADZ.js +1 -0
- package/core/built/admin/assets/{copy-CNsHZEFR.js → copy-Bi7VpgPR.js} +1 -1
- package/core/built/admin/assets/{data-list-Dn5MkmyD.js → data-list-Bu3jzs1s.js} +1 -1
- package/core/built/admin/assets/{deleted-feed-item-Dmm_clMl.js → deleted-feed-item-B-doIIKc.js} +1 -1
- package/core/built/admin/assets/{edit-profile-BLSdtROQ.js → edit-profile-ZBdjFfvL.js} +1 -1
- package/core/built/admin/assets/{empty-indicator-C2Z0dddU.js → empty-indicator-C6BBh99D.js} +1 -1
- package/core/built/admin/assets/{en-DuTkaMAI.js → en-C7eSFQRw.js} +1 -1
- package/core/built/admin/assets/{feed-B4Xp4C2J.js → feed-CAioauwD.js} +1 -1
- package/core/built/admin/assets/{filters-gnOx5Z45.js → filters-DEKF0tIB.js} +1 -1
- package/core/built/admin/assets/{gh-chart-B2aWYkGg.js → gh-chart-D9KI0_sO.js} +1 -1
- package/core/built/admin/assets/{ghost-29f8f3c80e41126ba5e3c52ad5727e8a.js → ghost-6bff5c535ef015b0ed9421ceb6c699a7.js} +220 -211
- package/core/built/admin/assets/{growth-BysawIWe.js → growth-C6XGchvT.js} +1 -1
- package/core/built/admin/assets/{hash-j3sh-UI3.js → hash-DFhnGHId.js} +1 -1
- package/core/built/admin/assets/{inbox-1cUdr8Mm.js → inbox-p-Y5uScT.js} +1 -1
- package/core/built/admin/assets/{index-BVoBTlp_.js → index--VlvGKWi.js} +1 -1
- package/core/built/admin/assets/{index-DGBK5k9H.js → index-3uU4zg_6.js} +1 -1
- package/core/built/admin/assets/index-4ZkTY34B.css +1 -0
- package/core/built/admin/assets/{index-BhY_SbGB.js → index-BWnrLoWI.js} +1 -1
- package/core/built/admin/assets/{index-I9n711UW.js → index-BzU2odQq.js} +1 -1
- package/core/built/admin/assets/{index-mhojl7aD.js → index-CIZ_upe2.js} +1 -1
- package/core/built/admin/assets/{index-WjY3mGep.js → index-CS4XqyC-.js} +2 -2
- package/core/built/admin/assets/{index-BgrwCpgw.js → index-D17PEsUB.js} +1 -1
- package/core/built/admin/assets/{index-B8G0f0hb.js → index-DCTdAEHx.js} +3 -3
- package/core/built/admin/assets/{index-DarAAzVH.js → index-FPf-AERu.js} +1 -1
- package/core/built/admin/assets/index-JmqyGBro.js +1 -0
- package/core/built/admin/assets/{index-DKAlEWM4.js → index-LyfDjTto.js} +1 -1
- package/core/built/admin/assets/index-S62-c8TV.js +13 -0
- package/core/built/admin/assets/{index-D8CXbJm4.js → index-Wx8_AGZX.js} +1 -1
- package/core/built/admin/assets/{index-CkAUXgAi.js → index-jAidr8jI.js} +1 -1
- package/core/built/admin/assets/{index-Dz8eTtOq.js → index-lPLmWtv0.js} +1 -1
- package/core/built/admin/assets/koenig-lexical/index.css +1 -1
- package/core/built/admin/assets/koenig-lexical/koenig-lexical.js +1853 -1863
- package/core/built/admin/assets/koenig-lexical/koenig-lexical.umd.js +94 -94
- package/core/built/admin/assets/{koenig-lexical-coiS9dIC.js → koenig-lexical-CWnkYKQt.js} +77 -77
- package/core/built/admin/assets/{kpi-card-BEFHo2gr.js → kpi-card-B5UaJgOT.js} +1 -1
- package/core/built/admin/assets/{kpis-D-gz-lUk.js → kpis-Cc2RxnvZ.js} +1 -1
- package/core/built/admin/assets/{label-BvlHzzcJ.js → label-CW7Kmp9w.js} +1 -1
- package/core/built/admin/assets/{links-tdJvBrsT.js → links-wWNc9Uat.js} +1 -1
- package/core/built/admin/assets/{list-filter-DPE4Xj2T.js → list-filter-3EF6cVg-.js} +1 -1
- package/core/built/admin/assets/{lucide-react-ClQ3Iy7l.js → lucide-react-DtMIZssr.js} +214 -214
- package/core/built/admin/assets/{main-layout-DY96wK-_.js → main-layout-BFYhCrLn.js} +1 -1
- package/core/built/admin/assets/{message-square-text-Dd1XS5-H.js → message-square-text-BDZtUW-2.js} +1 -1
- package/core/built/admin/assets/{minus-CyEc3BE5.js → minus-CSphShdJ.js} +1 -1
- package/core/built/admin/assets/modals-CDWP04Iy.js +77 -0
- package/core/built/admin/assets/{moderation-B0fdmlig.js → moderation-qcng2_lB.js} +1 -1
- package/core/built/admin/assets/{newsletter-Byg3ARa5.js → newsletter-R-IYcV4M.js} +1 -1
- package/core/built/admin/assets/{newsletters-DbH39vgA.js → newsletters-BB4e24i1.js} +1 -1
- package/core/built/admin/assets/{note-Cwy-rIAF.js → note-B_bpRX66.js} +1 -1
- package/core/built/admin/assets/overview-Nh-IoP-v.js +1 -0
- package/core/built/admin/assets/{pagemenu-CkzsZrHC.js → pagemenu-Cd45frnF.js} +1 -1
- package/core/built/admin/assets/{post-analytics-context-BLkup0Xh.js → post-analytics-context-BST4bzps.js} +1 -1
- package/core/built/admin/assets/post-analytics-header-DAZPp6M8.js +1 -0
- package/core/built/admin/assets/{post-analytics-aA-nG9Fq.js → post-analytics-jHZOhQ8L.js} +1 -1
- package/core/built/admin/assets/{post-share-modal-CkvJtrRw.js → post-share-modal-D1JQfuYx.js} +1 -1
- package/core/built/admin/assets/posts/{comments-Bn_vn_sb.mjs → comments-C0ntS6jH.mjs} +678 -692
- package/core/built/admin/assets/posts/{dialog-CKPcMrj7.mjs → dialog-CXEmd-rC.mjs} +3 -3
- package/core/built/admin/assets/posts/{empty-indicator-kkrhP6K_.mjs → empty-indicator-CY1NEQZt.mjs} +2 -2
- package/core/built/admin/assets/posts/{filters-DHsxxy0F.mjs → filters-CWWDQAf0.mjs} +6 -6
- package/core/built/admin/assets/posts/{growth-D7ACh-oR.mjs → growth-DUnL-W24.mjs} +20 -19
- package/core/built/admin/assets/posts/{heading-BrKVbOxA.mjs → heading-DZWin3nG.mjs} +2 -2
- package/core/built/admin/assets/posts/{hooks-BBEMuLiW.mjs → hooks-DQYjPsLg.mjs} +2 -2
- package/core/built/admin/assets/posts/{index-C0rRguZx.mjs → index-BiGQFQkQ.mjs} +9 -9
- package/core/built/admin/assets/posts/{kpis-1o524OIK.mjs → kpis-DNnkyd0U.mjs} +10 -10
- package/core/built/admin/assets/posts/{links-JpeATx1f.mjs → links-D3nSZFlJ.mjs} +4 -4
- package/core/built/admin/assets/posts/{loading-indicator-BHAmSf8j.mjs → loading-indicator-CZQmPRvv.mjs} +3 -3
- package/core/built/admin/assets/posts/{main-layout-BTItAOQE.mjs → main-layout-D5WnaGr4.mjs} +2 -2
- package/core/built/admin/assets/posts/{newsletter-CQdsCEHv.mjs → newsletter-C5eikVBq.mjs} +13 -13
- package/core/built/admin/assets/posts/{overview-sYh4JN1D.mjs → overview-C5mCMPJY.mjs} +113 -112
- package/core/built/admin/assets/posts/{post-analytics-DtLt2SWx.mjs → post-analytics-Cc2NCQis.mjs} +6 -6
- package/core/built/admin/assets/posts/{post-analytics-context-CB1yM9fk.mjs → post-analytics-context-qXWjDzSt.mjs} +44 -41
- package/core/built/admin/assets/posts/{post-analytics-header-BYaWuL9W.mjs → post-analytics-header-QGsYyvhA.mjs} +11 -11
- package/core/built/admin/assets/posts/{post-share-modal-V0HTOBaf.mjs → post-share-modal-B9Q7FJsH.mjs} +4 -4
- package/core/built/admin/assets/posts/posts-C2SKGLoU.mjs +17 -0
- package/core/built/admin/assets/posts/posts.js +1 -1
- package/core/built/admin/assets/posts/{search-CLjC37AT.mjs → search-C8k0TFkh.mjs} +2 -2
- package/core/built/admin/assets/posts/{separator-KNoTIaJx.mjs → separator-CJnnsW1a.mjs} +5 -5
- package/core/built/admin/assets/posts/{sheet-DBg_SCDt.mjs → sheet-HDzKgNHc.mjs} +3 -3
- package/core/built/admin/assets/posts/{skeleton-DvsoolWu.mjs → skeleton-BlZGKNzB.mjs} +3 -3
- package/core/built/admin/assets/posts/{source-icon-OmRaTU2G.mjs → source-icon-DjBIjtaY.mjs} +3 -3
- package/core/built/admin/assets/posts/{stats-BC2DzntY.mjs → stats-BRVHejqx.mjs} +4 -4
- package/core/built/admin/assets/posts/{table-CxX9OKAj.mjs → table-D7AEpPWL.mjs} +2 -2
- package/core/built/admin/assets/posts/{tabs-B1jw7cBi.mjs → tabs-RcpmzDgr.mjs} +10 -10
- package/core/built/admin/assets/posts/{tags-BitrLT_j.mjs → tags-8k1xw8R8.mjs} +2 -2
- package/core/built/admin/assets/posts/{tags-BBilTo1a.mjs → tags-DNY2rBlf.mjs} +11 -11
- package/core/built/admin/assets/posts/{use-infinite-virtual-scroll-DaijA1ao.mjs → use-infinite-virtual-scroll-CMiIpcDA.mjs} +3 -3
- package/core/built/admin/assets/posts/{web-CKmyC4Xj.mjs → web-BCl5J6bB.mjs} +15 -15
- package/core/built/admin/assets/{posts-DDkuYoN7.js → posts-DFiJPOft.js} +1 -1
- package/core/built/admin/assets/{repeat-B-SL0yPM.js → repeat-Smml9n0k.js} +1 -1
- package/core/built/admin/assets/{reply-BdCPoUQ9.js → reply-CooY4lmk.js} +1 -1
- package/core/built/admin/assets/{select-C7aNW8QS.js → select-WwMsbBbg.js} +1 -1
- package/core/built/admin/assets/{settings-D-dhma2e.js → settings-CQEhPDQU.js} +4 -4
- package/core/built/admin/assets/{settings-Bzy1GNfD.js → settings-CxWtvcUf.js} +1 -1
- package/core/built/admin/assets/{sort-button-Dv8vjh13.js → sort-button-DFr8vezl.js} +1 -1
- package/core/built/admin/assets/{source-icon-DTz4isLK.js → source-icon-VpYWpwYb.js} +1 -1
- package/core/built/admin/assets/{sprout-BwLQTzMf.js → sprout-DRqlFJSK.js} +1 -1
- package/core/built/admin/assets/{square-YF1YE9ex.js → square-CwHQ9sJ2.js} +1 -1
- package/core/built/admin/assets/stats/audience-Caf7BjaU.mjs +269 -0
- package/core/built/admin/assets/stats/{url-helpers-Drq3xg0l.mjs → content-helpers-MbtAvUJh.mjs} +83 -106
- package/core/built/admin/assets/stats/{index-CcCyLMxL.mjs → index-BGqKbF1D.mjs} +8 -8
- package/core/built/admin/assets/stats/{index-DXU2rE9t.mjs → index-BTjfXOi6.mjs} +30 -30
- package/core/built/admin/assets/stats/{index-K7ASx7EG.mjs → index-ChjIxhHy.mjs} +5 -5
- package/core/built/admin/assets/stats/{index-D5mlMG4l.mjs → index-DMkZbbZs.mjs} +14 -14
- package/core/built/admin/assets/stats/{index-CUuQaROI.mjs → index-wT0OIw_N.mjs} +355 -335
- package/core/built/admin/assets/stats/{sort-button-CELUx6Zp.mjs → sort-button-B8n8fYMi.mjs} +23 -23
- package/core/built/admin/assets/stats/{stats-d_u_in4l.mjs → stats-CGH-0JNs.mjs} +120 -119
- package/core/built/admin/assets/stats/stats.js +1 -1
- package/core/built/admin/assets/stats/{tabs-3wLZsy0v.mjs → tabs-EQCUj3Y9.mjs} +19 -19
- package/core/built/admin/assets/stats/{use-growth-stats-28Sr42va.mjs → use-growth-stats--CIfag21.mjs} +3 -3
- package/core/built/admin/assets/{stats-C5ad0fgQ.js → stats-lnFiOQZx.js} +1 -1
- package/core/built/admin/assets/{stats-view-BvkxPYNX.js → stats-view-BJVawuIv.js} +1 -1
- package/core/built/admin/assets/{step-1-D7_s-D99.js → step-1-Bx8MiQVF.js} +1 -1
- package/core/built/admin/assets/{step-2-B94Yf7FF.js → step-2-CLLXppER.js} +1 -1
- package/core/built/admin/assets/{step-3-DswXYYf4.js → step-3-C5WrQe8u.js} +2 -2
- package/core/built/admin/assets/{table-D30IXfUP.js → table-2waWpIF5.js} +1 -1
- package/core/built/admin/assets/{tabs-CjNdfW0y.js → tabs-CBD0hW8V.js} +1 -1
- package/core/built/admin/assets/{tags-B0ux9_dT.js → tags-Bgw5Hrb5.js} +1 -1
- package/core/built/admin/assets/{tags-PGeGAafJ.js → tags-CKrBptuC.js} +1 -1
- package/core/built/admin/assets/{tiers-BaXK0JoI.js → tiers-CO-pz1FX.js} +1 -1
- package/core/built/admin/assets/{toggle-group-DdY8HF3Y.js → toggle-group-BXAZzvJ9.js} +1 -1
- package/core/built/admin/assets/{topic-filter-Boh22uGD.js → topic-filter-U3qUH2P_.js} +1 -1
- package/core/built/admin/assets/{trash-D7ZWrnDq.js → trash-CJY1Wro_.js} +1 -1
- package/core/built/admin/assets/{use-growth-stats-Bg0nE0WG.js → use-growth-stats-BrLZI7da.js} +1 -1
- package/core/built/admin/assets/{use-infinite-virtual-scroll-DoeI5IY-.js → use-infinite-virtual-scroll-CiRn3kpz.js} +2 -2
- package/core/built/admin/assets/{use-simple-pagination-BJzBULR3.js → use-simple-pagination-CskJ0MDP.js} +1 -1
- package/core/built/admin/assets/{user-round-check-BLc3L-ei.js → user-round-check-zOuzV3OS.js} +1 -1
- package/core/built/admin/assets/{wallet-cards-xX4QZik7.js → wallet-cards-ddLuIN-b.js} +1 -1
- package/core/built/admin/assets/{web-DQ2qBymm.js → web-CGbkZWn3.js} +1 -1
- package/core/built/admin/index.html +6 -5
- package/core/frontend/services/theme-engine/i18n/i18n.js +9 -14
- package/core/server/api/endpoints/settings-public.js +3 -1
- package/core/server/api/endpoints/utils/serializers/input/settings.js +6 -1
- package/core/server/data/migrations/versions/6.19/2026-02-10-12-00-00-add-transistor-portal-settings.js +39 -0
- package/core/server/data/schema/default-settings/default-settings.json +28 -0
- package/core/server/data/schema/schema.js +2 -2
- package/core/server/data/seeders/importers/offers-importer.js +2 -2
- package/core/server/data/tinybird/endpoints/api_top_pages_router.pipe +28 -0
- package/core/server/data/tinybird/endpoints/api_top_pages_v3.pipe +8 -4
- package/core/server/data/tinybird/tests/api_top_pages_router.yaml +74 -0
- package/core/server/services/comments/comments-service-emails.js +1 -4
- package/core/server/services/email-service/email-templates/partials/styles.hbs +43 -0
- package/core/server/services/koenig/node-renderers/transistor-renderer.js +23 -17
- package/core/server/services/members/members-api/repositories/member-repository.js +30 -6
- package/core/server/services/members/members-api/services/next-payment-calculator.js +28 -20
- package/core/server/services/members/members-api/services/payments-service.js +1 -1
- package/core/server/services/members/members-api/utils/add-calendar-months.js +49 -0
- package/core/server/services/offers/application/offer-mapper.js +2 -2
- package/core/server/services/offers/domain/models/offer-amount.js +16 -0
- package/core/server/services/offers/domain/models/offer-duration.js +3 -4
- package/core/server/services/offers/domain/models/offer-type.js +5 -3
- package/core/server/services/offers/domain/models/offer.js +8 -1
- package/core/server/services/staff/staff-service-emails.js +2 -0
- package/core/server/services/stripe/stripe-api.js +19 -0
- package/core/shared/config/defaults.json +1 -1
- package/core/shared/labs.js +0 -1
- package/core/shared/settings-cache/cache-manager.js +8 -0
- package/core/shared/settings-cache/public.js +5 -0
- package/package.json +5 -5
- package/yarn.lock +4 -4
- package/components/tryghost-i18n-6.18.2.tgz +0 -0
- package/components/tryghost-parse-email-address-6.18.2.tgz +0 -0
- package/core/built/admin/assets/audience-CJHVR7kD.js +0 -1
- package/core/built/admin/assets/comments-CPd_iCc3.js +0 -1
- package/core/built/admin/assets/index-B2yksBz4.js +0 -13
- package/core/built/admin/assets/index-Cl_EPbQ2.js +0 -1
- package/core/built/admin/assets/index-D_sGUCda.css +0 -1
- package/core/built/admin/assets/modals-C06GcVIm.js +0 -77
- package/core/built/admin/assets/overview-CVMLGrVt.js +0 -1
- package/core/built/admin/assets/post-analytics-header-D9srAPT5.js +0 -1
- package/core/built/admin/assets/posts/posts-DeQT3knv.mjs +0 -21
- package/core/built/admin/assets/stats/audience-BWqU7WWT.mjs +0 -245
- package/core/built/admin/assets/url-helpers-mt6MBIi0.js +0 -1
|
@@ -1,145 +1,145 @@
|
|
|
1
|
-
import { o as L, j as e, u as
|
|
2
|
-
import { u as
|
|
3
|
-
import { c as
|
|
4
|
-
import { u as
|
|
5
|
-
import { u as
|
|
6
|
-
import { e as
|
|
7
|
-
import { a as
|
|
8
|
-
import { H as
|
|
9
|
-
import { M as
|
|
10
|
-
import { c as
|
|
11
|
-
import { L as
|
|
12
|
-
import { E as
|
|
13
|
-
import { S as
|
|
14
|
-
var
|
|
15
|
-
function
|
|
1
|
+
import { o as L, j as e, u as T, p as w, b as I, n as P, V as we, F as ns, G as H, H as Q, J as _e, K as as, a as E, q as B, Q as A, v as G, e as is, _ as ie, $ as os } from "./index-BiGQFQkQ.mjs";
|
|
2
|
+
import { u as ls, F as cs, T as te, a as re, b as ne, d as ae, c as ds } from "./filters-CWWDQAf0.mjs";
|
|
3
|
+
import { c as Y, b as X, a as ms, d as us } from "./hooks-DQYjPsLg.mjs";
|
|
4
|
+
import { u as hs, g as ps } from "./posts-C2SKGLoU.mjs";
|
|
5
|
+
import { u as fs, U as oe, g as xs, D as bs, b as gs, E as js, d as vs, e as W, h as Cs, S as ys } from "./separator-CJnnsW1a.mjs";
|
|
6
|
+
import { e as Ns, i as ks, b as le, a as ws, F as _s, f as Ss, C as Ps, g as Se, D as ce, M as Ts, H as Pe, R as Rs, d as Te, E as Re, h as Le } from "./search-C8k0TFkh.mjs";
|
|
7
|
+
import { a as Ls, C as Es, X as Is, k as de, m as me, n as ue, o as he, p as $s, q as pe } from "./dialog-CXEmd-rC.mjs";
|
|
8
|
+
import { H as ve, g as Ms, u as Ds } from "./use-infinite-virtual-scroll-CMiIpcDA.mjs";
|
|
9
|
+
import { M as Fs } from "./main-layout-D5WnaGr4.mjs";
|
|
10
|
+
import { c as zs, P as fe, u as Os, b as Ee, e as Ce, h as Hs, B as S, C as Bs } from "./heading-DZWin3nG.mjs";
|
|
11
|
+
import { L as U } from "./loading-indicator-CZQmPRvv.mjs";
|
|
12
|
+
import { E as Ie } from "./empty-indicator-CY1NEQZt.mjs";
|
|
13
|
+
import { S as As, b as Us, c as Vs, d as qs } from "./sheet-HDzKgNHc.mjs";
|
|
14
|
+
var Z = "Checkbox", [Ws] = zs(Z), [Qs, xe] = Ws(Z);
|
|
15
|
+
function Ks(s) {
|
|
16
16
|
const {
|
|
17
17
|
__scopeCheckbox: t,
|
|
18
18
|
checked: r,
|
|
19
|
-
children:
|
|
19
|
+
children: a,
|
|
20
20
|
defaultChecked: n,
|
|
21
|
-
disabled:
|
|
22
|
-
form:
|
|
23
|
-
name:
|
|
24
|
-
onCheckedChange:
|
|
21
|
+
disabled: i,
|
|
22
|
+
form: o,
|
|
23
|
+
name: l,
|
|
24
|
+
onCheckedChange: c,
|
|
25
25
|
required: d,
|
|
26
26
|
value: u = "on",
|
|
27
27
|
// @ts-expect-error
|
|
28
28
|
internal_do_not_use_render: m
|
|
29
|
-
} = s, [
|
|
29
|
+
} = s, [x, p] = Os({
|
|
30
30
|
prop: r,
|
|
31
31
|
defaultProp: n ?? !1,
|
|
32
|
-
onChange:
|
|
33
|
-
caller:
|
|
34
|
-
}), [
|
|
32
|
+
onChange: c,
|
|
33
|
+
caller: Z
|
|
34
|
+
}), [f, j] = T(null), [g, v] = T(null), b = w(!1), y = f ? !!o || !!f.closest("form") : (
|
|
35
35
|
// We set this to true by default so that events bubble to forms without JS (SSR)
|
|
36
36
|
!0
|
|
37
|
-
),
|
|
38
|
-
checked:
|
|
39
|
-
disabled:
|
|
40
|
-
setChecked:
|
|
41
|
-
control:
|
|
42
|
-
setControl:
|
|
43
|
-
name:
|
|
44
|
-
form:
|
|
37
|
+
), C = {
|
|
38
|
+
checked: x,
|
|
39
|
+
disabled: i,
|
|
40
|
+
setChecked: p,
|
|
41
|
+
control: f,
|
|
42
|
+
setControl: j,
|
|
43
|
+
name: l,
|
|
44
|
+
form: o,
|
|
45
45
|
value: u,
|
|
46
|
-
hasConsumerStoppedPropagationRef:
|
|
46
|
+
hasConsumerStoppedPropagationRef: b,
|
|
47
47
|
required: d,
|
|
48
48
|
defaultChecked: $(n) ? !1 : n,
|
|
49
|
-
isFormControl:
|
|
50
|
-
bubbleInput:
|
|
51
|
-
setBubbleInput:
|
|
49
|
+
isFormControl: y,
|
|
50
|
+
bubbleInput: g,
|
|
51
|
+
setBubbleInput: v
|
|
52
52
|
};
|
|
53
53
|
return /* @__PURE__ */ e.jsx(
|
|
54
|
-
|
|
54
|
+
Qs,
|
|
55
55
|
{
|
|
56
56
|
scope: t,
|
|
57
|
-
...
|
|
58
|
-
children:
|
|
57
|
+
...C,
|
|
58
|
+
children: Gs(m) ? m(C) : a
|
|
59
59
|
}
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
|
-
var
|
|
63
|
-
({ __scopeCheckbox: s, onKeyDown: t, onClick: r, ...
|
|
62
|
+
var $e = "CheckboxTrigger", Me = L(
|
|
63
|
+
({ __scopeCheckbox: s, onKeyDown: t, onClick: r, ...a }, n) => {
|
|
64
64
|
const {
|
|
65
|
-
control:
|
|
66
|
-
value:
|
|
67
|
-
disabled:
|
|
68
|
-
checked:
|
|
65
|
+
control: i,
|
|
66
|
+
value: o,
|
|
67
|
+
disabled: l,
|
|
68
|
+
checked: c,
|
|
69
69
|
required: d,
|
|
70
70
|
setControl: u,
|
|
71
71
|
setChecked: m,
|
|
72
|
-
hasConsumerStoppedPropagationRef:
|
|
73
|
-
isFormControl:
|
|
74
|
-
bubbleInput:
|
|
75
|
-
} = xe(
|
|
76
|
-
return
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
79
|
-
const
|
|
80
|
-
return
|
|
72
|
+
hasConsumerStoppedPropagationRef: x,
|
|
73
|
+
isFormControl: p,
|
|
74
|
+
bubbleInput: f
|
|
75
|
+
} = xe($e, s), j = Ee(n, u), g = w(c);
|
|
76
|
+
return I(() => {
|
|
77
|
+
const v = i == null ? void 0 : i.form;
|
|
78
|
+
if (v) {
|
|
79
|
+
const b = () => m(g.current);
|
|
80
|
+
return v.addEventListener("reset", b), () => v.removeEventListener("reset", b);
|
|
81
81
|
}
|
|
82
|
-
}, [
|
|
82
|
+
}, [i, m]), /* @__PURE__ */ e.jsx(
|
|
83
83
|
fe.button,
|
|
84
84
|
{
|
|
85
85
|
type: "button",
|
|
86
86
|
role: "checkbox",
|
|
87
|
-
"aria-checked": $(
|
|
87
|
+
"aria-checked": $(c) ? "mixed" : c,
|
|
88
88
|
"aria-required": d,
|
|
89
|
-
"data-state":
|
|
90
|
-
"data-disabled":
|
|
91
|
-
disabled:
|
|
92
|
-
value:
|
|
93
|
-
...
|
|
94
|
-
ref:
|
|
95
|
-
onKeyDown:
|
|
96
|
-
|
|
89
|
+
"data-state": He(c),
|
|
90
|
+
"data-disabled": l ? "" : void 0,
|
|
91
|
+
disabled: l,
|
|
92
|
+
value: o,
|
|
93
|
+
...a,
|
|
94
|
+
ref: j,
|
|
95
|
+
onKeyDown: Ce(t, (v) => {
|
|
96
|
+
v.key === "Enter" && v.preventDefault();
|
|
97
97
|
}),
|
|
98
|
-
onClick:
|
|
99
|
-
m((
|
|
98
|
+
onClick: Ce(r, (v) => {
|
|
99
|
+
m((b) => $(b) ? !0 : !b), f && p && (x.current = v.isPropagationStopped(), x.current || v.stopPropagation());
|
|
100
100
|
})
|
|
101
101
|
}
|
|
102
102
|
);
|
|
103
103
|
}
|
|
104
104
|
);
|
|
105
|
-
|
|
105
|
+
Me.displayName = $e;
|
|
106
106
|
var be = L(
|
|
107
107
|
(s, t) => {
|
|
108
108
|
const {
|
|
109
109
|
__scopeCheckbox: r,
|
|
110
|
-
name:
|
|
110
|
+
name: a,
|
|
111
111
|
checked: n,
|
|
112
|
-
defaultChecked:
|
|
113
|
-
required:
|
|
114
|
-
disabled:
|
|
115
|
-
value:
|
|
112
|
+
defaultChecked: i,
|
|
113
|
+
required: o,
|
|
114
|
+
disabled: l,
|
|
115
|
+
value: c,
|
|
116
116
|
onCheckedChange: d,
|
|
117
117
|
form: u,
|
|
118
118
|
...m
|
|
119
119
|
} = s;
|
|
120
120
|
return /* @__PURE__ */ e.jsx(
|
|
121
|
-
|
|
121
|
+
Ks,
|
|
122
122
|
{
|
|
123
123
|
__scopeCheckbox: r,
|
|
124
124
|
checked: n,
|
|
125
|
-
defaultChecked:
|
|
126
|
-
disabled:
|
|
127
|
-
required:
|
|
125
|
+
defaultChecked: i,
|
|
126
|
+
disabled: l,
|
|
127
|
+
required: o,
|
|
128
128
|
onCheckedChange: d,
|
|
129
|
-
name:
|
|
129
|
+
name: a,
|
|
130
130
|
form: u,
|
|
131
|
-
value:
|
|
132
|
-
internal_do_not_use_render: ({ isFormControl:
|
|
131
|
+
value: c,
|
|
132
|
+
internal_do_not_use_render: ({ isFormControl: x }) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
133
133
|
/* @__PURE__ */ e.jsx(
|
|
134
|
-
|
|
134
|
+
Me,
|
|
135
135
|
{
|
|
136
136
|
...m,
|
|
137
137
|
ref: t,
|
|
138
138
|
__scopeCheckbox: r
|
|
139
139
|
}
|
|
140
140
|
),
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
x && /* @__PURE__ */ e.jsx(
|
|
142
|
+
Oe,
|
|
143
143
|
{
|
|
144
144
|
__scopeCheckbox: r
|
|
145
145
|
}
|
|
@@ -149,19 +149,19 @@ var be = L(
|
|
|
149
149
|
);
|
|
150
150
|
}
|
|
151
151
|
);
|
|
152
|
-
be.displayName =
|
|
153
|
-
var
|
|
152
|
+
be.displayName = Z;
|
|
153
|
+
var De = "CheckboxIndicator", Fe = L(
|
|
154
154
|
(s, t) => {
|
|
155
|
-
const { __scopeCheckbox: r, forceMount:
|
|
155
|
+
const { __scopeCheckbox: r, forceMount: a, ...n } = s, i = xe(De, r);
|
|
156
156
|
return /* @__PURE__ */ e.jsx(
|
|
157
|
-
|
|
157
|
+
Ls,
|
|
158
158
|
{
|
|
159
|
-
present:
|
|
159
|
+
present: a || $(i.checked) || i.checked === !0,
|
|
160
160
|
children: /* @__PURE__ */ e.jsx(
|
|
161
161
|
fe.span,
|
|
162
162
|
{
|
|
163
|
-
"data-state":
|
|
164
|
-
"data-disabled":
|
|
163
|
+
"data-state": He(i.checked),
|
|
164
|
+
"data-disabled": i.disabled ? "" : void 0,
|
|
165
165
|
...n,
|
|
166
166
|
ref: t,
|
|
167
167
|
style: { pointerEvents: "none", ...s.style }
|
|
@@ -171,52 +171,52 @@ var ze = "CheckboxIndicator", Oe = L(
|
|
|
171
171
|
);
|
|
172
172
|
}
|
|
173
173
|
);
|
|
174
|
-
|
|
175
|
-
var
|
|
174
|
+
Fe.displayName = De;
|
|
175
|
+
var ze = "CheckboxBubbleInput", Oe = L(
|
|
176
176
|
({ __scopeCheckbox: s, ...t }, r) => {
|
|
177
177
|
const {
|
|
178
|
-
control:
|
|
178
|
+
control: a,
|
|
179
179
|
hasConsumerStoppedPropagationRef: n,
|
|
180
|
-
checked:
|
|
181
|
-
defaultChecked:
|
|
182
|
-
required:
|
|
183
|
-
disabled:
|
|
180
|
+
checked: i,
|
|
181
|
+
defaultChecked: o,
|
|
182
|
+
required: l,
|
|
183
|
+
disabled: c,
|
|
184
184
|
name: d,
|
|
185
185
|
value: u,
|
|
186
186
|
form: m,
|
|
187
|
-
bubbleInput:
|
|
188
|
-
setBubbleInput:
|
|
189
|
-
} = xe(
|
|
190
|
-
|
|
191
|
-
const
|
|
192
|
-
if (!
|
|
193
|
-
const
|
|
194
|
-
|
|
187
|
+
bubbleInput: x,
|
|
188
|
+
setBubbleInput: p
|
|
189
|
+
} = xe(ze, s), f = Ee(r, p), j = ls(i), g = fs(a);
|
|
190
|
+
I(() => {
|
|
191
|
+
const b = x;
|
|
192
|
+
if (!b) return;
|
|
193
|
+
const y = window.HTMLInputElement.prototype, k = Object.getOwnPropertyDescriptor(
|
|
194
|
+
y,
|
|
195
195
|
"checked"
|
|
196
|
-
).set,
|
|
197
|
-
if (
|
|
198
|
-
const
|
|
199
|
-
|
|
196
|
+
).set, h = !n.current;
|
|
197
|
+
if (j !== i && k) {
|
|
198
|
+
const R = new Event("click", { bubbles: h });
|
|
199
|
+
b.indeterminate = $(i), k.call(b, $(i) ? !1 : i), b.dispatchEvent(R);
|
|
200
200
|
}
|
|
201
|
-
}, [
|
|
202
|
-
const
|
|
201
|
+
}, [x, j, i, n]);
|
|
202
|
+
const v = w($(i) ? !1 : i);
|
|
203
203
|
return /* @__PURE__ */ e.jsx(
|
|
204
204
|
fe.input,
|
|
205
205
|
{
|
|
206
206
|
type: "checkbox",
|
|
207
207
|
"aria-hidden": !0,
|
|
208
|
-
defaultChecked:
|
|
209
|
-
required:
|
|
210
|
-
disabled:
|
|
208
|
+
defaultChecked: o ?? v.current,
|
|
209
|
+
required: l,
|
|
210
|
+
disabled: c,
|
|
211
211
|
name: d,
|
|
212
212
|
value: u,
|
|
213
213
|
form: m,
|
|
214
214
|
...t,
|
|
215
215
|
tabIndex: -1,
|
|
216
|
-
ref:
|
|
216
|
+
ref: f,
|
|
217
217
|
style: {
|
|
218
218
|
...t.style,
|
|
219
|
-
...
|
|
219
|
+
...g,
|
|
220
220
|
position: "absolute",
|
|
221
221
|
pointerEvents: "none",
|
|
222
222
|
opacity: 0,
|
|
@@ -230,17 +230,17 @@ var Be = "CheckboxBubbleInput", He = L(
|
|
|
230
230
|
);
|
|
231
231
|
}
|
|
232
232
|
);
|
|
233
|
-
|
|
234
|
-
function
|
|
233
|
+
Oe.displayName = ze;
|
|
234
|
+
function Gs(s) {
|
|
235
235
|
return typeof s == "function";
|
|
236
236
|
}
|
|
237
237
|
function $(s) {
|
|
238
238
|
return s === "indeterminate";
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function He(s) {
|
|
241
241
|
return $(s) ? "indeterminate" : s ? "checked" : "unchecked";
|
|
242
242
|
}
|
|
243
|
-
const
|
|
243
|
+
const Ys = we(
|
|
244
244
|
"inline-flex items-center rounded-sm border px-1.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
245
245
|
{
|
|
246
246
|
variants: {
|
|
@@ -257,82 +257,82 @@ const Zs = Se(
|
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
259
|
);
|
|
260
|
-
function
|
|
261
|
-
return /* @__PURE__ */ e.jsx("div", { className:
|
|
260
|
+
function Xs({ className: s, variant: t, ...r }) {
|
|
261
|
+
return /* @__PURE__ */ e.jsx("div", { className: P(Ys({ variant: t }), s), ...r });
|
|
262
262
|
}
|
|
263
|
-
const
|
|
263
|
+
const Be = L(({ className: s, ...t }, r) => /* @__PURE__ */ e.jsx(
|
|
264
264
|
be,
|
|
265
265
|
{
|
|
266
266
|
ref: r,
|
|
267
|
-
className:
|
|
267
|
+
className: P(
|
|
268
268
|
"grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
|
|
269
269
|
s
|
|
270
270
|
),
|
|
271
271
|
...t,
|
|
272
272
|
children: /* @__PURE__ */ e.jsx(
|
|
273
|
-
|
|
273
|
+
Fe,
|
|
274
274
|
{
|
|
275
|
-
className:
|
|
276
|
-
children: /* @__PURE__ */ e.jsx(
|
|
275
|
+
className: P("grid place-content-center text-current"),
|
|
276
|
+
children: /* @__PURE__ */ e.jsx(Es, { className: "size-4" })
|
|
277
277
|
}
|
|
278
278
|
)
|
|
279
279
|
}
|
|
280
280
|
));
|
|
281
|
-
|
|
282
|
-
var
|
|
283
|
-
function
|
|
281
|
+
Be.displayName = be.displayName;
|
|
282
|
+
var Zs = Symbol.for("react.lazy"), K = ns[" use ".trim().toString()];
|
|
283
|
+
function Js(s) {
|
|
284
284
|
return typeof s == "object" && s !== null && "then" in s;
|
|
285
285
|
}
|
|
286
|
-
function
|
|
287
|
-
return s != null && typeof s == "object" && "$$typeof" in s && s.$$typeof ===
|
|
286
|
+
function Ae(s) {
|
|
287
|
+
return s != null && typeof s == "object" && "$$typeof" in s && s.$$typeof === Zs && "_payload" in s && Js(s._payload);
|
|
288
288
|
}
|
|
289
289
|
// @__NO_SIDE_EFFECTS__
|
|
290
|
-
function
|
|
291
|
-
const t = /* @__PURE__ */
|
|
292
|
-
let { children:
|
|
293
|
-
|
|
294
|
-
const
|
|
295
|
-
if (
|
|
296
|
-
const d =
|
|
297
|
-
return /* @__PURE__ */ e.jsx(t, { ...
|
|
290
|
+
function et(s) {
|
|
291
|
+
const t = /* @__PURE__ */ st(s), r = L((a, n) => {
|
|
292
|
+
let { children: i, ...o } = a;
|
|
293
|
+
Ae(i) && typeof K == "function" && (i = K(i._payload));
|
|
294
|
+
const l = H.toArray(i), c = l.find(rt);
|
|
295
|
+
if (c) {
|
|
296
|
+
const d = c.props.children, u = l.map((m) => m === c ? H.count(d) > 1 ? H.only(null) : Q(d) ? d.props.children : null : m);
|
|
297
|
+
return /* @__PURE__ */ e.jsx(t, { ...o, ref: n, children: Q(d) ? _e(d, void 0, u) : null });
|
|
298
298
|
}
|
|
299
|
-
return /* @__PURE__ */ e.jsx(t, { ...
|
|
299
|
+
return /* @__PURE__ */ e.jsx(t, { ...o, ref: n, children: i });
|
|
300
300
|
});
|
|
301
301
|
return r.displayName = `${s}.Slot`, r;
|
|
302
302
|
}
|
|
303
303
|
// @__NO_SIDE_EFFECTS__
|
|
304
|
-
function
|
|
305
|
-
const t = L((r,
|
|
306
|
-
let { children: n, ...
|
|
307
|
-
if (
|
|
308
|
-
const
|
|
309
|
-
return n.type !==
|
|
304
|
+
function st(s) {
|
|
305
|
+
const t = L((r, a) => {
|
|
306
|
+
let { children: n, ...i } = r;
|
|
307
|
+
if (Ae(n) && typeof K == "function" && (n = K(n._payload)), Q(n)) {
|
|
308
|
+
const o = at(n), l = nt(i, n.props);
|
|
309
|
+
return n.type !== as && (l.ref = a ? Hs(a, o) : o), _e(n, l);
|
|
310
310
|
}
|
|
311
|
-
return
|
|
311
|
+
return H.count(n) > 1 ? H.only(null) : null;
|
|
312
312
|
});
|
|
313
313
|
return t.displayName = `${s}.SlotClone`, t;
|
|
314
314
|
}
|
|
315
|
-
var
|
|
316
|
-
function
|
|
317
|
-
return
|
|
315
|
+
var tt = Symbol("radix.slottable");
|
|
316
|
+
function rt(s) {
|
|
317
|
+
return Q(s) && typeof s.type == "function" && "__radixId" in s.type && s.type.__radixId === tt;
|
|
318
318
|
}
|
|
319
|
-
function
|
|
319
|
+
function nt(s, t) {
|
|
320
320
|
const r = { ...t };
|
|
321
|
-
for (const
|
|
322
|
-
const n = s[
|
|
323
|
-
/^on[A-Z]/.test(
|
|
324
|
-
const
|
|
325
|
-
return n(...
|
|
326
|
-
} : n && (r[
|
|
321
|
+
for (const a in t) {
|
|
322
|
+
const n = s[a], i = t[a];
|
|
323
|
+
/^on[A-Z]/.test(a) ? n && i ? r[a] = (...l) => {
|
|
324
|
+
const c = i(...l);
|
|
325
|
+
return n(...l), c;
|
|
326
|
+
} : n && (r[a] = n) : a === "style" ? r[a] = { ...n, ...i } : a === "className" && (r[a] = [n, i].filter(Boolean).join(" "));
|
|
327
327
|
}
|
|
328
328
|
return { ...s, ...r };
|
|
329
329
|
}
|
|
330
|
-
function
|
|
331
|
-
var
|
|
332
|
-
let t = (
|
|
330
|
+
function at(s) {
|
|
331
|
+
var a, n;
|
|
332
|
+
let t = (a = Object.getOwnPropertyDescriptor(s.props, "ref")) == null ? void 0 : a.get, r = t && "isReactWarning" in t && t.isReactWarning;
|
|
333
333
|
return r ? s.ref : (t = (n = Object.getOwnPropertyDescriptor(s, "ref")) == null ? void 0 : n.get, r = t && "isReactWarning" in t && t.isReactWarning, r ? s.props.ref : s.props.ref || s.ref);
|
|
334
334
|
}
|
|
335
|
-
var
|
|
335
|
+
var it = [
|
|
336
336
|
"a",
|
|
337
337
|
"button",
|
|
338
338
|
"div",
|
|
@@ -350,14 +350,14 @@ var lt = [
|
|
|
350
350
|
"span",
|
|
351
351
|
"svg",
|
|
352
352
|
"ul"
|
|
353
|
-
],
|
|
354
|
-
const r = /* @__PURE__ */
|
|
355
|
-
const { asChild:
|
|
356
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e.jsx(
|
|
353
|
+
], ot = it.reduce((s, t) => {
|
|
354
|
+
const r = /* @__PURE__ */ et(`Primitive.${t}`), a = L((n, i) => {
|
|
355
|
+
const { asChild: o, ...l } = n, c = o ? r : t;
|
|
356
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e.jsx(c, { ...l, ref: i });
|
|
357
357
|
});
|
|
358
|
-
return
|
|
359
|
-
}, {}),
|
|
360
|
-
|
|
358
|
+
return a.displayName = `Primitive.${t}`, { ...s, [t]: a };
|
|
359
|
+
}, {}), lt = "Label", Ue = L((s, t) => /* @__PURE__ */ e.jsx(
|
|
360
|
+
ot.label,
|
|
361
361
|
{
|
|
362
362
|
...s,
|
|
363
363
|
ref: t,
|
|
@@ -367,26 +367,26 @@ var lt = [
|
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
));
|
|
370
|
-
|
|
371
|
-
var
|
|
372
|
-
const
|
|
370
|
+
Ue.displayName = lt;
|
|
371
|
+
var Ve = Ue;
|
|
372
|
+
const ct = we(
|
|
373
373
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
374
|
-
),
|
|
375
|
-
|
|
374
|
+
), qe = L(({ className: s, ...t }, r) => /* @__PURE__ */ e.jsx(
|
|
375
|
+
Ve,
|
|
376
376
|
{
|
|
377
377
|
ref: r,
|
|
378
|
-
className:
|
|
378
|
+
className: P(ct(), s),
|
|
379
379
|
...t
|
|
380
380
|
}
|
|
381
381
|
));
|
|
382
|
-
|
|
383
|
-
const
|
|
384
|
-
dataType:
|
|
382
|
+
qe.displayName = Ve.displayName;
|
|
383
|
+
const dt = ({ children: s, className: t, ...r }) => /* @__PURE__ */ e.jsx("section", { className: P("flex gap-6 flex-col p-4 lg:p-8 size-full grow", t), ...r, children: s }), We = "MembersResponseType", mt = ms({
|
|
384
|
+
dataType: We,
|
|
385
385
|
path: "/members/"
|
|
386
|
-
}),
|
|
387
|
-
dataType:
|
|
386
|
+
}), ut = Y({
|
|
387
|
+
dataType: We,
|
|
388
388
|
path: (s) => `/members/${s}/`
|
|
389
|
-
}),
|
|
389
|
+
}), ht = X({
|
|
390
390
|
method: "POST",
|
|
391
391
|
path: ({ id: s }) => `/members/${s}/commenting/disable`,
|
|
392
392
|
body: ({ reason: s, hideComments: t }) => ({
|
|
@@ -396,7 +396,7 @@ const ut = ({ children: s, className: t, ...r }) => /* @__PURE__ */ e.jsx("secti
|
|
|
396
396
|
invalidateQueries: {
|
|
397
397
|
dataType: "CommentsResponseType"
|
|
398
398
|
}
|
|
399
|
-
}),
|
|
399
|
+
}), pt = X({
|
|
400
400
|
method: "POST",
|
|
401
401
|
path: ({ id: s }) => `/members/${s}/commenting/enable`,
|
|
402
402
|
body: () => ({}),
|
|
@@ -404,104 +404,104 @@ const ut = ({ children: s, className: t, ...r }) => /* @__PURE__ */ e.jsx("secti
|
|
|
404
404
|
dataType: "CommentsResponseType"
|
|
405
405
|
}
|
|
406
406
|
});
|
|
407
|
-
function
|
|
407
|
+
function ye({
|
|
408
408
|
knownItems: s,
|
|
409
409
|
useSearch: t,
|
|
410
410
|
useGetById: r,
|
|
411
|
-
filters:
|
|
411
|
+
filters: a,
|
|
412
412
|
filterFieldName: n,
|
|
413
|
-
searchFieldName:
|
|
414
|
-
toOption:
|
|
413
|
+
searchFieldName: i,
|
|
414
|
+
toOption: o
|
|
415
415
|
}) {
|
|
416
|
-
const [
|
|
417
|
-
const
|
|
418
|
-
return
|
|
419
|
-
}, [
|
|
420
|
-
enabled:
|
|
416
|
+
const [l, c] = T(""), { data: d, isLoading: u } = t(l), m = E(() => {
|
|
417
|
+
const b = a.find((y) => y.field === n);
|
|
418
|
+
return b != null && b.values[0] ? String(b.values[0]) : "";
|
|
419
|
+
}, [a, n]), x = E(() => !m || s.some((y) => y.id === m) ? !1 : !((d == null ? void 0 : d[i]) ?? []).some((y) => y.id === m), [m, s, d, i]), { data: p, isLoading: f } = r(m || "", {
|
|
420
|
+
enabled: x,
|
|
421
421
|
defaultErrorHandler: !1
|
|
422
|
-
}),
|
|
422
|
+
}), j = u || f, g = B((b) => o(b), [o]);
|
|
423
423
|
return {
|
|
424
|
-
options:
|
|
424
|
+
options: E(() => {
|
|
425
425
|
var k;
|
|
426
|
-
const
|
|
427
|
-
for (const
|
|
428
|
-
|
|
429
|
-
for (const
|
|
430
|
-
|
|
431
|
-
const
|
|
432
|
-
return
|
|
433
|
-
}, [s, d,
|
|
434
|
-
isLoading:
|
|
435
|
-
searchValue:
|
|
436
|
-
onSearchChange:
|
|
426
|
+
const b = (d == null ? void 0 : d[i]) ?? [], y = {};
|
|
427
|
+
for (const h of s)
|
|
428
|
+
y[h.id] = g(h);
|
|
429
|
+
for (const h of b)
|
|
430
|
+
y[h.id] = g(h);
|
|
431
|
+
const C = (k = p == null ? void 0 : p[i]) == null ? void 0 : k[0];
|
|
432
|
+
return C != null && C.id && (y[C.id] = g(C)), m && !(m in y) && (y[m] = { value: m, label: `ID: ${m}` }), Object.values(y);
|
|
433
|
+
}, [s, d, i, p, m, g]),
|
|
434
|
+
isLoading: j,
|
|
435
|
+
searchValue: l,
|
|
436
|
+
onSearchChange: c
|
|
437
437
|
};
|
|
438
438
|
}
|
|
439
|
-
function
|
|
440
|
-
var n = this,
|
|
441
|
-
|
|
442
|
-
var
|
|
439
|
+
function ft(s, t, r, a) {
|
|
440
|
+
var n = this, i = w(null), o = w(0), l = w(0), c = w(null), d = w([]), u = w(), m = w(), x = w(s), p = w(!0);
|
|
441
|
+
x.current = s;
|
|
442
|
+
var f = typeof window < "u", j = !t && t !== 0 && f;
|
|
443
443
|
if (typeof s != "function") throw new TypeError("Expected a function");
|
|
444
444
|
t = +t || 0;
|
|
445
|
-
var
|
|
446
|
-
|
|
447
|
-
return
|
|
448
|
-
|
|
445
|
+
var g = !!(r = r || {}).leading, v = !("trailing" in r) || !!r.trailing, b = "maxWait" in r, y = "debounceOnServer" in r && !!r.debounceOnServer, C = b ? Math.max(+r.maxWait || 0, t) : null;
|
|
446
|
+
I(function() {
|
|
447
|
+
return p.current = !0, function() {
|
|
448
|
+
p.current = !1;
|
|
449
449
|
};
|
|
450
450
|
}, []);
|
|
451
|
-
var k =
|
|
452
|
-
var
|
|
453
|
-
var
|
|
454
|
-
return d.current = u.current = null,
|
|
455
|
-
},
|
|
456
|
-
|
|
457
|
-
},
|
|
458
|
-
if (!
|
|
459
|
-
var
|
|
460
|
-
return !
|
|
461
|
-
},
|
|
462
|
-
return
|
|
463
|
-
},
|
|
464
|
-
var
|
|
465
|
-
if (
|
|
466
|
-
if (
|
|
467
|
-
var
|
|
468
|
-
|
|
451
|
+
var k = E(function() {
|
|
452
|
+
var h = function(N) {
|
|
453
|
+
var _ = d.current, D = u.current;
|
|
454
|
+
return d.current = u.current = null, o.current = N, l.current = l.current || N, m.current = x.current.apply(D, _);
|
|
455
|
+
}, R = function(N, _) {
|
|
456
|
+
j && cancelAnimationFrame(c.current), c.current = j ? requestAnimationFrame(N) : setTimeout(N, _);
|
|
457
|
+
}, ee = function(N) {
|
|
458
|
+
if (!p.current) return !1;
|
|
459
|
+
var _ = N - i.current;
|
|
460
|
+
return !i.current || _ >= t || _ < 0 || b && N - o.current >= C;
|
|
461
|
+
}, O = function(N) {
|
|
462
|
+
return c.current = null, v && d.current ? h(N) : (d.current = u.current = null, m.current);
|
|
463
|
+
}, F = function N() {
|
|
464
|
+
var _ = Date.now();
|
|
465
|
+
if (g && l.current === o.current && V(), ee(_)) return O(_);
|
|
466
|
+
if (p.current) {
|
|
467
|
+
var D = t - (_ - i.current), q = b ? Math.min(D, C - (_ - o.current)) : D;
|
|
468
|
+
R(N, q);
|
|
469
469
|
}
|
|
470
|
-
},
|
|
471
|
-
|
|
472
|
-
},
|
|
473
|
-
if (
|
|
474
|
-
var N = Date.now(),
|
|
475
|
-
if (d.current = [].slice.call(arguments), u.current = n,
|
|
476
|
-
if (!
|
|
477
|
-
if (
|
|
470
|
+
}, V = function() {
|
|
471
|
+
a && a({});
|
|
472
|
+
}, M = function() {
|
|
473
|
+
if (f || y) {
|
|
474
|
+
var N = Date.now(), _ = ee(N);
|
|
475
|
+
if (d.current = [].slice.call(arguments), u.current = n, i.current = N, _) {
|
|
476
|
+
if (!c.current && p.current) return o.current = i.current, R(F, t), g ? h(i.current) : m.current;
|
|
477
|
+
if (b) return R(F, t), h(i.current);
|
|
478
478
|
}
|
|
479
|
-
return
|
|
479
|
+
return c.current || R(F, t), m.current;
|
|
480
480
|
}
|
|
481
481
|
};
|
|
482
|
-
return
|
|
483
|
-
var N =
|
|
484
|
-
N && (
|
|
485
|
-
},
|
|
486
|
-
return !!
|
|
487
|
-
},
|
|
488
|
-
return
|
|
489
|
-
},
|
|
490
|
-
}, [
|
|
482
|
+
return M.cancel = function() {
|
|
483
|
+
var N = c.current;
|
|
484
|
+
N && (j ? cancelAnimationFrame(c.current) : clearTimeout(c.current)), o.current = 0, d.current = i.current = u.current = c.current = null, N && a && a({});
|
|
485
|
+
}, M.isPending = function() {
|
|
486
|
+
return !!c.current;
|
|
487
|
+
}, M.flush = function() {
|
|
488
|
+
return c.current ? O(Date.now()) : m.current;
|
|
489
|
+
}, M;
|
|
490
|
+
}, [g, b, t, C, v, j, f, y, a]);
|
|
491
491
|
return k;
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function xt(s, t) {
|
|
494
494
|
return s === t;
|
|
495
495
|
}
|
|
496
|
-
function
|
|
497
|
-
var
|
|
498
|
-
n.current =
|
|
499
|
-
}, [
|
|
500
|
-
return
|
|
496
|
+
function Qe(s, t, r) {
|
|
497
|
+
var a = xt, n = w(s), i = T({})[1], o = ft(B(function(c) {
|
|
498
|
+
n.current = c, i({});
|
|
499
|
+
}, [i]), t, r, i), l = w(s);
|
|
500
|
+
return a(l.current, s) || (o(s), l.current = s), [n.current, o];
|
|
501
501
|
}
|
|
502
|
-
function
|
|
503
|
-
const [t] =
|
|
504
|
-
return
|
|
502
|
+
function bt(s) {
|
|
503
|
+
const [t] = Qe(s, 200);
|
|
504
|
+
return mt({
|
|
505
505
|
searchParams: {
|
|
506
506
|
...t && { search: t },
|
|
507
507
|
limit: "100",
|
|
@@ -509,9 +509,9 @@ function jt(s) {
|
|
|
509
509
|
}
|
|
510
510
|
});
|
|
511
511
|
}
|
|
512
|
-
function
|
|
513
|
-
const [t] =
|
|
514
|
-
return
|
|
512
|
+
function gt(s) {
|
|
513
|
+
const [t] = Qe(s, 200), r = t ? `title:~'${t.replace(/'/g, "\\'")}'` : "";
|
|
514
|
+
return hs({
|
|
515
515
|
searchParams: {
|
|
516
516
|
...r && { filter: r },
|
|
517
517
|
limit: "100",
|
|
@@ -520,16 +520,16 @@ function vt(s) {
|
|
|
520
520
|
}
|
|
521
521
|
});
|
|
522
522
|
}
|
|
523
|
-
const
|
|
523
|
+
const jt = ({
|
|
524
524
|
knownPosts: s,
|
|
525
525
|
knownMembers: t,
|
|
526
526
|
filters: r,
|
|
527
|
-
onFiltersChange:
|
|
527
|
+
onFiltersChange: a
|
|
528
528
|
}) => {
|
|
529
|
-
const n =
|
|
529
|
+
const n = ye({
|
|
530
530
|
knownItems: s,
|
|
531
|
-
useSearch:
|
|
532
|
-
useGetById:
|
|
531
|
+
useSearch: gt,
|
|
532
|
+
useGetById: ps,
|
|
533
533
|
searchFieldName: "posts",
|
|
534
534
|
filters: r,
|
|
535
535
|
filterFieldName: "post",
|
|
@@ -537,10 +537,10 @@ const Ct = ({
|
|
|
537
537
|
value: d.id,
|
|
538
538
|
label: d.title || "(Untitled)"
|
|
539
539
|
})
|
|
540
|
-
}),
|
|
540
|
+
}), i = ye({
|
|
541
541
|
knownItems: t,
|
|
542
|
-
useSearch:
|
|
543
|
-
useGetById:
|
|
542
|
+
useSearch: bt,
|
|
543
|
+
useGetById: ut,
|
|
544
544
|
searchFieldName: "members",
|
|
545
545
|
filters: r,
|
|
546
546
|
filterFieldName: "author",
|
|
@@ -549,17 +549,17 @@ const Ct = ({
|
|
|
549
549
|
label: d.name || "Unknown name",
|
|
550
550
|
detail: d.email ?? "(Unknown email)"
|
|
551
551
|
})
|
|
552
|
-
}),
|
|
552
|
+
}), o = E(
|
|
553
553
|
() => [
|
|
554
554
|
{
|
|
555
555
|
key: "author",
|
|
556
556
|
label: "Author",
|
|
557
557
|
type: "select",
|
|
558
558
|
icon: /* @__PURE__ */ e.jsx(oe, { className: "size-4" }),
|
|
559
|
-
options:
|
|
560
|
-
isLoading:
|
|
561
|
-
onSearchChange:
|
|
562
|
-
searchValue:
|
|
559
|
+
options: i.options,
|
|
560
|
+
isLoading: i.options.length === 0 && i.isLoading,
|
|
561
|
+
onSearchChange: i.onSearchChange,
|
|
562
|
+
searchValue: i.searchValue,
|
|
563
563
|
searchable: !0,
|
|
564
564
|
className: "w-80",
|
|
565
565
|
popoverContentClassName: "w-80",
|
|
@@ -572,7 +572,7 @@ const Ct = ({
|
|
|
572
572
|
key: "post",
|
|
573
573
|
label: "Post",
|
|
574
574
|
type: "select",
|
|
575
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
575
|
+
icon: /* @__PURE__ */ e.jsx(Ns, { className: "size-4" }),
|
|
576
576
|
options: n.options,
|
|
577
577
|
isLoading: n.options.length === 0 && n.isLoading,
|
|
578
578
|
onSearchChange: n.onSearchChange,
|
|
@@ -589,7 +589,7 @@ const Ct = ({
|
|
|
589
589
|
key: "body",
|
|
590
590
|
label: "Text",
|
|
591
591
|
type: "text",
|
|
592
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
592
|
+
icon: /* @__PURE__ */ e.jsx(ks, { className: "size-4" }),
|
|
593
593
|
placeholder: "Search comment text...",
|
|
594
594
|
operators: [
|
|
595
595
|
{ value: "contains", label: "contains" },
|
|
@@ -603,7 +603,7 @@ const Ct = ({
|
|
|
603
603
|
key: "status",
|
|
604
604
|
label: "Status",
|
|
605
605
|
type: "select",
|
|
606
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
606
|
+
icon: /* @__PURE__ */ e.jsx(xs, { className: "size-4" }),
|
|
607
607
|
options: [
|
|
608
608
|
{ value: "published", label: "Published" },
|
|
609
609
|
{ value: "hidden", label: "Hidden" }
|
|
@@ -634,7 +634,7 @@ const Ct = ({
|
|
|
634
634
|
label: "Date",
|
|
635
635
|
type: "date",
|
|
636
636
|
className: "w-full max-w-32",
|
|
637
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
637
|
+
icon: /* @__PURE__ */ e.jsx(ws, { className: "size-4" }),
|
|
638
638
|
operators: [
|
|
639
639
|
{ value: "is", label: "is" },
|
|
640
640
|
{ value: "before", label: "before" },
|
|
@@ -642,92 +642,92 @@ const Ct = ({
|
|
|
642
642
|
]
|
|
643
643
|
}
|
|
644
644
|
],
|
|
645
|
-
[n,
|
|
646
|
-
),
|
|
645
|
+
[n, i]
|
|
646
|
+
), l = r.length > 0, c = P(
|
|
647
647
|
"flex flex-row",
|
|
648
|
-
!
|
|
649
|
-
|
|
648
|
+
!l && "[grid-area:actions] pt-5 justify-start sm:justify-end sm:pt-0",
|
|
649
|
+
l && "col-start-1 col-end-4 row-start-3 pt-5"
|
|
650
650
|
);
|
|
651
|
-
return /* @__PURE__ */ e.jsx("div", { className:
|
|
652
|
-
|
|
651
|
+
return /* @__PURE__ */ e.jsx("div", { className: c, children: /* @__PURE__ */ e.jsx(
|
|
652
|
+
cs,
|
|
653
653
|
{
|
|
654
|
-
addButtonIcon:
|
|
655
|
-
addButtonText:
|
|
654
|
+
addButtonIcon: l ? /* @__PURE__ */ e.jsx(_s, {}) : /* @__PURE__ */ e.jsx(Ss, {}),
|
|
655
|
+
addButtonText: l ? "Add filter" : "Filter",
|
|
656
656
|
allowMultiple: !1,
|
|
657
|
-
className: `[&>button]:order-last ${
|
|
657
|
+
className: `[&>button]:order-last ${l ? "[&>button]:border-none" : "w-auto"}`,
|
|
658
658
|
clearButtonClassName: "font-normal text-muted-foreground",
|
|
659
|
-
clearButtonIcon: /* @__PURE__ */ e.jsx(
|
|
659
|
+
clearButtonIcon: /* @__PURE__ */ e.jsx(Is, {}),
|
|
660
660
|
clearButtonText: "Clear",
|
|
661
|
-
fields:
|
|
661
|
+
fields: o,
|
|
662
662
|
filters: r,
|
|
663
663
|
keyboardShortcut: "f",
|
|
664
|
-
popoverAlign:
|
|
665
|
-
showClearButton:
|
|
664
|
+
popoverAlign: l ? "start" : "end",
|
|
665
|
+
showClearButton: l,
|
|
666
666
|
showSearchInput: !1,
|
|
667
|
-
onChange:
|
|
667
|
+
onChange: a
|
|
668
668
|
}
|
|
669
669
|
) });
|
|
670
|
-
},
|
|
671
|
-
/* @__PURE__ */ e.jsx(
|
|
670
|
+
}, vt = ({ children: s }) => /* @__PURE__ */ e.jsxs(ve, { className: "relative !pb-6 md:sticky", variant: "inline-nav", children: [
|
|
671
|
+
/* @__PURE__ */ e.jsx(ve.Title, { children: "Comments" }),
|
|
672
672
|
s
|
|
673
|
-
] }),
|
|
674
|
-
function
|
|
673
|
+
] }), Ct = ({ children: s }) => /* @__PURE__ */ e.jsx(Fs, { children: /* @__PURE__ */ e.jsx("div", { className: "grid w-full grow", children: /* @__PURE__ */ e.jsx("div", { className: "flex h-full flex-col", "data-testid": "comments-page", children: s }) }) });
|
|
674
|
+
function yt({ onClick: s, expanded: t }) {
|
|
675
675
|
return /* @__PURE__ */ e.jsxs(
|
|
676
|
-
|
|
676
|
+
S,
|
|
677
677
|
{
|
|
678
678
|
className: "shrink-0 gap-0.5 self-start p-0 text-base hover:bg-transparent",
|
|
679
679
|
variant: "ghost",
|
|
680
680
|
onClick: s,
|
|
681
681
|
children: [
|
|
682
682
|
t ? "Show less" : "Show more",
|
|
683
|
-
t ? /* @__PURE__ */ e.jsx(
|
|
683
|
+
t ? /* @__PURE__ */ e.jsx(Ps, {}) : /* @__PURE__ */ e.jsx(Bs, {})
|
|
684
684
|
]
|
|
685
685
|
}
|
|
686
686
|
);
|
|
687
687
|
}
|
|
688
|
-
function
|
|
689
|
-
const t =
|
|
690
|
-
return
|
|
688
|
+
function Ke({ item: s }) {
|
|
689
|
+
const t = w(null), [r, a] = T(!1), [n, i] = T(!1);
|
|
690
|
+
return I(() => {
|
|
691
691
|
if (n)
|
|
692
692
|
return;
|
|
693
|
-
const
|
|
694
|
-
t.current &&
|
|
693
|
+
const o = () => {
|
|
694
|
+
t.current && a(t.current.scrollHeight > t.current.clientHeight);
|
|
695
695
|
};
|
|
696
|
-
return
|
|
696
|
+
return o(), window.addEventListener("resize", o), () => window.removeEventListener("resize", o);
|
|
697
697
|
}, [s.html, n]), /* @__PURE__ */ e.jsx("div", { className: "mt-1 flex flex-col gap-2", children: /* @__PURE__ */ e.jsxs("div", { className: `flex max-w-full flex-col items-start ${s.status === "hidden" && "opacity-50"}`, children: [
|
|
698
698
|
/* @__PURE__ */ e.jsx(
|
|
699
699
|
"div",
|
|
700
700
|
{
|
|
701
701
|
dangerouslySetInnerHTML: { __html: s.html || "" },
|
|
702
702
|
ref: t,
|
|
703
|
-
className:
|
|
703
|
+
className: P(
|
|
704
704
|
"prose flex-1 text-base max-w-[80ch] balance leading-[1.5em] [&_*]:leading-[1.5em] [&_*]:text-base [&_*]:font-normal [&_blockquote]:border-l-[3px] [&_blockquote]:border-foreground [&_blockquote]:p-0 [&_blockquote]:pl-3 [&_blockquote_p]:mt-0 [&_a]:underline",
|
|
705
705
|
n ? "-mb-1 [&_p]:mb-[0.85em]" : "line-clamp-2 [&_p]:m-0 [&_blockquote+p]:mt-1 mb-1"
|
|
706
706
|
)
|
|
707
707
|
}
|
|
708
708
|
),
|
|
709
|
-
r && /* @__PURE__ */ e.jsx(
|
|
709
|
+
r && /* @__PURE__ */ e.jsx(yt, { expanded: n, onClick: () => i(!n) })
|
|
710
710
|
] }) });
|
|
711
711
|
}
|
|
712
|
-
const
|
|
713
|
-
dataType:
|
|
712
|
+
const J = "CommentsResponseType", Nt = us({
|
|
713
|
+
dataType: J,
|
|
714
714
|
path: "/comments/",
|
|
715
715
|
defaultNextPageParams: (s, t) => {
|
|
716
|
-
var r,
|
|
716
|
+
var r, a;
|
|
717
717
|
return (r = s.meta) != null && r.pagination.next ? {
|
|
718
718
|
...t,
|
|
719
|
-
page: (((
|
|
719
|
+
page: (((a = s.meta) == null ? void 0 : a.pagination.next) || 1).toString()
|
|
720
720
|
} : void 0;
|
|
721
721
|
},
|
|
722
722
|
returnData: (s) => {
|
|
723
|
-
const { pages: t } = s, r = t.flatMap((n) => n.comments),
|
|
723
|
+
const { pages: t } = s, r = t.flatMap((n) => n.comments), a = t[t.length - 1].meta;
|
|
724
724
|
return {
|
|
725
725
|
comments: r,
|
|
726
|
-
meta:
|
|
727
|
-
isEnd:
|
|
726
|
+
meta: a,
|
|
727
|
+
isEnd: a ? a.pagination.pages === a.pagination.page : !0
|
|
728
728
|
};
|
|
729
729
|
}
|
|
730
|
-
}),
|
|
730
|
+
}), Ge = (s) => Nt({
|
|
731
731
|
...s,
|
|
732
732
|
searchParams: {
|
|
733
733
|
limit: "100",
|
|
@@ -735,7 +735,7 @@ const ee = "CommentsResponseType", wt = ps({
|
|
|
735
735
|
include: "member,post,parent",
|
|
736
736
|
...s == null ? void 0 : s.searchParams
|
|
737
737
|
}
|
|
738
|
-
}),
|
|
738
|
+
}), Ye = X({
|
|
739
739
|
method: "PUT",
|
|
740
740
|
path: ({ id: s }) => `/comments/${s}/`,
|
|
741
741
|
body: ({ id: s }) => ({
|
|
@@ -745,9 +745,9 @@ const ee = "CommentsResponseType", wt = ps({
|
|
|
745
745
|
}]
|
|
746
746
|
}),
|
|
747
747
|
invalidateQueries: {
|
|
748
|
-
dataType:
|
|
748
|
+
dataType: J
|
|
749
749
|
}
|
|
750
|
-
}),
|
|
750
|
+
}), Xe = X({
|
|
751
751
|
method: "PUT",
|
|
752
752
|
path: ({ id: s }) => `/comments/${s}/`,
|
|
753
753
|
body: ({ id: s }) => ({
|
|
@@ -757,18 +757,18 @@ const ee = "CommentsResponseType", wt = ps({
|
|
|
757
757
|
}]
|
|
758
758
|
}),
|
|
759
759
|
invalidateQueries: {
|
|
760
|
-
dataType:
|
|
760
|
+
dataType: J
|
|
761
761
|
}
|
|
762
|
-
}),
|
|
763
|
-
dataType:
|
|
762
|
+
}), kt = Y({
|
|
763
|
+
dataType: J,
|
|
764
764
|
path: (s) => `/comments/${s}/`,
|
|
765
765
|
defaultSearchParams: {
|
|
766
766
|
include: "member,post,count.replies,count.direct_replies,count.likes,count.reports,parent,in_reply_to"
|
|
767
767
|
}
|
|
768
|
-
}),
|
|
768
|
+
}), wt = Y({
|
|
769
769
|
dataType: "CommentReportsResponseType",
|
|
770
770
|
path: (s) => `/comments/${s}/reports/`
|
|
771
|
-
}),
|
|
771
|
+
}), _t = (s, t) => wt(s, { ...t }), St = Y({
|
|
772
772
|
dataType: "CommentLikesResponseType",
|
|
773
773
|
path: (s) => `/comments/${s}/likes/`,
|
|
774
774
|
defaultSearchParams: {
|
|
@@ -776,7 +776,7 @@ const ee = "CommentsResponseType", wt = ps({
|
|
|
776
776
|
limit: "100",
|
|
777
777
|
order: "created_at desc"
|
|
778
778
|
}
|
|
779
|
-
}),
|
|
779
|
+
}), Pt = (s, t) => St(s, { ...t }), Tt = (s, t) => Ge({
|
|
780
780
|
...t,
|
|
781
781
|
searchParams: {
|
|
782
782
|
filter: `(parent_id:${s}+in_reply_to_id:null),in_reply_to_id:${s}`,
|
|
@@ -785,17 +785,17 @@ const ee = "CommentsResponseType", wt = ps({
|
|
|
785
785
|
limit: "100"
|
|
786
786
|
}
|
|
787
787
|
});
|
|
788
|
-
function
|
|
789
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
788
|
+
function z({ avatarImage: s, memberId: t, isHidden: r, className: a }) {
|
|
789
|
+
return /* @__PURE__ */ e.jsxs("div", { className: P(
|
|
790
790
|
"relative flex size-6 min-w-6 items-center justify-center overflow-hidden rounded-full bg-accent md:size-8 md:min-w-8",
|
|
791
791
|
r && "opacity-50",
|
|
792
|
-
|
|
792
|
+
a
|
|
793
793
|
), children: [
|
|
794
794
|
t && s && /* @__PURE__ */ e.jsx("div", { className: "absolute inset-0", children: /* @__PURE__ */ e.jsx("img", { alt: "Member avatar", src: s }) }),
|
|
795
795
|
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(oe, { className: "!size-3 text-muted-foreground md:!size-4", size: 12 }) })
|
|
796
796
|
] });
|
|
797
797
|
}
|
|
798
|
-
function
|
|
798
|
+
function Rt(s) {
|
|
799
799
|
const t = new Date(s);
|
|
800
800
|
return new Intl.DateTimeFormat("en-US", {
|
|
801
801
|
month: "short",
|
|
@@ -805,34 +805,34 @@ function It(s) {
|
|
|
805
805
|
minute: "numeric"
|
|
806
806
|
}).format(t).replace(/(\d+),(\s+\d{4})/, "$1$2");
|
|
807
807
|
}
|
|
808
|
-
function
|
|
808
|
+
function Ze({
|
|
809
809
|
memberName: s,
|
|
810
810
|
memberId: t,
|
|
811
811
|
createdAt: r,
|
|
812
|
-
isHidden:
|
|
812
|
+
isHidden: a,
|
|
813
813
|
canComment: n,
|
|
814
|
-
onAuthorClick:
|
|
815
|
-
postTitle:
|
|
816
|
-
onPostClick:
|
|
817
|
-
className:
|
|
814
|
+
onAuthorClick: i,
|
|
815
|
+
postTitle: o,
|
|
816
|
+
onPostClick: l,
|
|
817
|
+
className: c
|
|
818
818
|
}) {
|
|
819
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
820
|
-
/* @__PURE__ */ e.jsxs("div", { className:
|
|
819
|
+
return /* @__PURE__ */ e.jsxs("div", { className: P("flex items-baseline gap-4", c), children: [
|
|
820
|
+
/* @__PURE__ */ e.jsxs("div", { className: P(
|
|
821
821
|
"mb-1 flex min-w-0 items-center gap-x-1 text-sm",
|
|
822
|
-
|
|
822
|
+
a && "opacity-50"
|
|
823
823
|
), children: [
|
|
824
|
-
/* @__PURE__ */ e.jsx("div", { className: "whitespace-nowrap", children: t &&
|
|
825
|
-
|
|
824
|
+
/* @__PURE__ */ e.jsx("div", { className: "whitespace-nowrap", children: t && i ? /* @__PURE__ */ e.jsx(
|
|
825
|
+
S,
|
|
826
826
|
{
|
|
827
827
|
className: "flex h-auto items-center gap-1.5 truncate p-0 font-semibold text-primary hover:opacity-70",
|
|
828
828
|
variant: "link",
|
|
829
|
-
onClick:
|
|
829
|
+
onClick: i,
|
|
830
830
|
children: s || "Unknown"
|
|
831
831
|
}
|
|
832
832
|
) : /* @__PURE__ */ e.jsx("span", { className: "block truncate font-semibold", children: s || "Unknown" }) }),
|
|
833
833
|
n === !1 && /* @__PURE__ */ e.jsx(te, { children: /* @__PURE__ */ e.jsxs(re, { children: [
|
|
834
834
|
/* @__PURE__ */ e.jsx(ne, { asChild: !0, children: /* @__PURE__ */ e.jsx("span", { "data-testid": "commenting-disabled-indicator", children: /* @__PURE__ */ e.jsx(
|
|
835
|
-
|
|
835
|
+
Se,
|
|
836
836
|
{
|
|
837
837
|
className: "size-3.5 text-muted-foreground"
|
|
838
838
|
}
|
|
@@ -841,129 +841,125 @@ function es({
|
|
|
841
841
|
] }) }),
|
|
842
842
|
/* @__PURE__ */ e.jsx(ce, { className: "shrink-0 text-muted-foreground/50", size: 16 }),
|
|
843
843
|
/* @__PURE__ */ e.jsx("div", { className: "shrink-0 whitespace-nowrap", children: r && /* @__PURE__ */ e.jsx(te, { children: /* @__PURE__ */ e.jsxs(re, { children: [
|
|
844
|
-
/* @__PURE__ */ e.jsx(ne, { asChild: !0, children: /* @__PURE__ */ e.jsx("span", { className: "cursor-default text-sm text-muted-foreground", children:
|
|
845
|
-
/* @__PURE__ */ e.jsx(ae, { children:
|
|
844
|
+
/* @__PURE__ */ e.jsx(ne, { asChild: !0, children: /* @__PURE__ */ e.jsx("span", { className: "cursor-default text-sm text-muted-foreground", children: A(r) }) }),
|
|
845
|
+
/* @__PURE__ */ e.jsx(ae, { children: Rt(r) })
|
|
846
846
|
] }) }) }),
|
|
847
|
-
|
|
847
|
+
o && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
848
848
|
/* @__PURE__ */ e.jsx("div", { className: "shrink-0 text-muted-foreground", children: "on" }),
|
|
849
|
-
/* @__PURE__ */ e.jsx("div", { className: "min-w-0 truncate", children:
|
|
850
|
-
|
|
849
|
+
/* @__PURE__ */ e.jsx("div", { className: "min-w-0 truncate", children: l ? /* @__PURE__ */ e.jsx(
|
|
850
|
+
S,
|
|
851
851
|
{
|
|
852
852
|
className: "block h-auto w-full cursor-pointer truncate p-0 text-left font-medium text-gray-800 hover:opacity-70 dark:text-gray-400",
|
|
853
853
|
variant: "link",
|
|
854
|
-
onClick:
|
|
855
|
-
children:
|
|
854
|
+
onClick: l,
|
|
855
|
+
children: o
|
|
856
856
|
}
|
|
857
|
-
) : /* @__PURE__ */ e.jsx("span", { className: "font-medium text-gray-800 dark:text-gray-400", children:
|
|
857
|
+
) : /* @__PURE__ */ e.jsx("span", { className: "font-medium text-gray-800 dark:text-gray-400", children: o }) })
|
|
858
858
|
] })
|
|
859
859
|
] }),
|
|
860
|
-
|
|
860
|
+
a && /* @__PURE__ */ e.jsx(Xs, { variant: "secondary", children: "Hidden" })
|
|
861
861
|
] });
|
|
862
862
|
}
|
|
863
|
-
function
|
|
863
|
+
function Lt({
|
|
864
864
|
open: s,
|
|
865
865
|
memberName: t,
|
|
866
866
|
onOpenChange: r,
|
|
867
|
-
onConfirm:
|
|
867
|
+
onConfirm: a
|
|
868
868
|
}) {
|
|
869
|
-
const [n,
|
|
870
|
-
|
|
871
|
-
},
|
|
872
|
-
|
|
869
|
+
const [n, i] = T(!1), o = (c) => {
|
|
870
|
+
c || i(!1), r(c);
|
|
871
|
+
}, l = () => {
|
|
872
|
+
a(n), i(!1);
|
|
873
873
|
};
|
|
874
|
-
return /* @__PURE__ */ e.jsx(de, { open: s, onOpenChange:
|
|
874
|
+
return /* @__PURE__ */ e.jsx(de, { open: s, onOpenChange: o, children: /* @__PURE__ */ e.jsxs(me, { className: "gap-5", children: [
|
|
875
875
|
/* @__PURE__ */ e.jsxs(ue, { children: [
|
|
876
876
|
/* @__PURE__ */ e.jsx(he, { children: "Disable comments" }),
|
|
877
|
-
/* @__PURE__ */ e.jsxs(
|
|
877
|
+
/* @__PURE__ */ e.jsxs($s, { children: [
|
|
878
878
|
t || "This member",
|
|
879
879
|
" won't be able to comment in the future. You can re-enable commenting anytime."
|
|
880
880
|
] })
|
|
881
881
|
] }),
|
|
882
882
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
883
883
|
/* @__PURE__ */ e.jsx(
|
|
884
|
-
|
|
884
|
+
Be,
|
|
885
885
|
{
|
|
886
886
|
checked: n,
|
|
887
887
|
id: "hide-comments",
|
|
888
|
-
onCheckedChange: (
|
|
888
|
+
onCheckedChange: (c) => i(c === !0)
|
|
889
889
|
}
|
|
890
890
|
),
|
|
891
|
-
/* @__PURE__ */ e.jsx(
|
|
891
|
+
/* @__PURE__ */ e.jsx(qe, { htmlFor: "hide-comments", children: "Hide all previous comments" })
|
|
892
892
|
] }),
|
|
893
893
|
/* @__PURE__ */ e.jsxs(pe, { children: [
|
|
894
|
-
/* @__PURE__ */ e.jsx(
|
|
895
|
-
/* @__PURE__ */ e.jsx(
|
|
894
|
+
/* @__PURE__ */ e.jsx(S, { variant: "outline", onClick: () => o(!1), children: "Cancel" }),
|
|
895
|
+
/* @__PURE__ */ e.jsx(S, { onClick: l, children: "Disable comments" })
|
|
896
896
|
] })
|
|
897
897
|
] }) });
|
|
898
898
|
}
|
|
899
|
-
function
|
|
900
|
-
comment: s
|
|
901
|
-
commentPermalinksEnabled: t
|
|
899
|
+
function Je({
|
|
900
|
+
comment: s
|
|
902
901
|
}) {
|
|
903
|
-
const { mutate:
|
|
904
|
-
|
|
905
|
-
id:
|
|
906
|
-
reason: `Disabled from comment ${
|
|
907
|
-
hideComments:
|
|
908
|
-
}),
|
|
909
|
-
},
|
|
910
|
-
|
|
902
|
+
const { mutate: t } = ht(), { mutate: r } = pt(), [a, n] = T(!1), { id: i, post: o, member: l } = s, c = o == null ? void 0 : o.url, d = l == null ? void 0 : l.id, u = l == null ? void 0 : l.can_comment, m = (p) => {
|
|
903
|
+
d && (t({
|
|
904
|
+
id: d,
|
|
905
|
+
reason: `Disabled from comment ${i}`,
|
|
906
|
+
hideComments: p
|
|
907
|
+
}), n(!1));
|
|
908
|
+
}, x = () => {
|
|
909
|
+
d && r({ id: d });
|
|
911
910
|
};
|
|
912
911
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
913
|
-
/* @__PURE__ */ e.jsxs(
|
|
914
|
-
/* @__PURE__ */ e.jsx(
|
|
915
|
-
|
|
912
|
+
/* @__PURE__ */ e.jsxs(bs, { children: [
|
|
913
|
+
/* @__PURE__ */ e.jsx(gs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
914
|
+
S,
|
|
916
915
|
{
|
|
917
916
|
className: "relative z-10 text-gray-800 hover:bg-secondary [&_svg]:size-4",
|
|
918
917
|
size: "sm",
|
|
919
918
|
variant: "ghost",
|
|
920
|
-
children: /* @__PURE__ */ e.jsx(
|
|
919
|
+
children: /* @__PURE__ */ e.jsx(js, {})
|
|
921
920
|
}
|
|
922
921
|
) }),
|
|
923
|
-
/* @__PURE__ */ e.jsxs(
|
|
924
|
-
|
|
925
|
-
/* @__PURE__ */ e.jsx(
|
|
922
|
+
/* @__PURE__ */ e.jsxs(vs, { align: "start", children: [
|
|
923
|
+
c && /* @__PURE__ */ e.jsx(W, { asChild: !0, children: /* @__PURE__ */ e.jsxs("a", { href: `${c}#ghost-comments-${i}`, rel: "noopener noreferrer", target: "_blank", children: [
|
|
924
|
+
/* @__PURE__ */ e.jsx(Cs, { className: "size-4" }),
|
|
926
925
|
"View on post"
|
|
927
|
-
] }) })
|
|
928
|
-
|
|
929
|
-
"View post"
|
|
930
|
-
] }) })),
|
|
931
|
-
u && /* @__PURE__ */ e.jsx(A, { asChild: !0, children: /* @__PURE__ */ e.jsxs("a", { href: `#/members/${u}`, children: [
|
|
926
|
+
] }) }),
|
|
927
|
+
d && /* @__PURE__ */ e.jsx(W, { asChild: !0, children: /* @__PURE__ */ e.jsxs("a", { href: `#/members/${d}`, children: [
|
|
932
928
|
/* @__PURE__ */ e.jsx(oe, { className: "size-4" }),
|
|
933
929
|
"View member"
|
|
934
930
|
] }) }),
|
|
935
|
-
|
|
936
|
-
/* @__PURE__ */ e.jsx(
|
|
931
|
+
d && (u !== !1 ? /* @__PURE__ */ e.jsxs(W, { onClick: () => n(!0), children: [
|
|
932
|
+
/* @__PURE__ */ e.jsx(Se, { className: "size-4" }),
|
|
937
933
|
"Disable commenting"
|
|
938
|
-
] }) : /* @__PURE__ */ e.jsxs(
|
|
939
|
-
/* @__PURE__ */ e.jsx(
|
|
934
|
+
] }) : /* @__PURE__ */ e.jsxs(W, { onClick: x, children: [
|
|
935
|
+
/* @__PURE__ */ e.jsx(Ts, { className: "size-4" }),
|
|
940
936
|
"Enable commenting"
|
|
941
937
|
] }))
|
|
942
938
|
] })
|
|
943
939
|
] }),
|
|
944
940
|
/* @__PURE__ */ e.jsx(
|
|
945
|
-
|
|
941
|
+
Lt,
|
|
946
942
|
{
|
|
947
|
-
memberName:
|
|
948
|
-
open:
|
|
949
|
-
onConfirm:
|
|
950
|
-
onOpenChange:
|
|
943
|
+
memberName: l == null ? void 0 : l.name,
|
|
944
|
+
open: a,
|
|
945
|
+
onConfirm: m,
|
|
946
|
+
onOpenChange: n
|
|
951
947
|
}
|
|
952
948
|
)
|
|
953
949
|
] });
|
|
954
950
|
}
|
|
955
|
-
function
|
|
956
|
-
var
|
|
957
|
-
const { data:
|
|
951
|
+
function Et({ comment: s, open: t, onOpenChange: r }) {
|
|
952
|
+
var c, d, u, m, x;
|
|
953
|
+
const { data: a, isLoading: n } = Pt(s.id, { enabled: t }), i = (a == null ? void 0 : a.comment_likes) ?? [], o = ((c = s.count) == null ? void 0 : c.likes) ?? 0, l = o - i.length;
|
|
958
954
|
return /* @__PURE__ */ e.jsx(de, { open: t, onOpenChange: r, children: /* @__PURE__ */ e.jsxs(me, { "aria-describedby": void 0, children: [
|
|
959
955
|
/* @__PURE__ */ e.jsx(ue, { children: /* @__PURE__ */ e.jsxs(he, { children: [
|
|
960
|
-
|
|
956
|
+
o,
|
|
961
957
|
" ",
|
|
962
|
-
|
|
958
|
+
o === 1 ? "like" : "likes"
|
|
963
959
|
] }) }),
|
|
964
960
|
/* @__PURE__ */ e.jsx("div", { className: "overflow-hidden rounded-md border p-3", children: /* @__PURE__ */ e.jsxs("div", { className: "flex min-w-0 items-start gap-3", children: [
|
|
965
961
|
/* @__PURE__ */ e.jsx(
|
|
966
|
-
|
|
962
|
+
z,
|
|
967
963
|
{
|
|
968
964
|
avatarImage: (d = s.member) == null ? void 0 : d.avatar_image,
|
|
969
965
|
className: "shrink-0",
|
|
@@ -974,9 +970,9 @@ function $t({ comment: s, open: t, onOpenChange: r }) {
|
|
|
974
970
|
/* @__PURE__ */ e.jsxs("div", { className: "flex min-w-0 items-center gap-1 text-sm", children: [
|
|
975
971
|
/* @__PURE__ */ e.jsx("span", { className: "shrink-0 font-semibold", children: ((m = s.member) == null ? void 0 : m.name) || "Unknown" }),
|
|
976
972
|
/* @__PURE__ */ e.jsx(ce, { className: "shrink-0 text-muted-foreground/50", size: 16 }),
|
|
977
|
-
/* @__PURE__ */ e.jsx("span", { className: "shrink-0 text-muted-foreground", children: s.created_at &&
|
|
973
|
+
/* @__PURE__ */ e.jsx("span", { className: "shrink-0 text-muted-foreground", children: s.created_at && A(s.created_at) }),
|
|
978
974
|
/* @__PURE__ */ e.jsx("span", { className: "shrink-0 text-muted-foreground", children: "on" }),
|
|
979
|
-
/* @__PURE__ */ e.jsx("span", { className: "min-w-0 truncate font-medium text-gray-800 dark:text-gray-400", children: ((
|
|
975
|
+
/* @__PURE__ */ e.jsx("span", { className: "min-w-0 truncate font-medium text-gray-800 dark:text-gray-400", children: ((x = s.post) == null ? void 0 : x.title) || "Unknown post" })
|
|
980
976
|
] }),
|
|
981
977
|
/* @__PURE__ */ e.jsx(
|
|
982
978
|
"div",
|
|
@@ -987,49 +983,49 @@ function $t({ comment: s, open: t, onOpenChange: r }) {
|
|
|
987
983
|
)
|
|
988
984
|
] })
|
|
989
985
|
] }) }),
|
|
990
|
-
/* @__PURE__ */ e.jsx("div", { className: "-mx-1 max-h-64 overflow-y-auto px-1", children: n ? /* @__PURE__ */ e.jsx("div", { className: "flex justify-center py-4", children: /* @__PURE__ */ e.jsx(
|
|
991
|
-
|
|
992
|
-
var
|
|
986
|
+
/* @__PURE__ */ e.jsx("div", { className: "-mx-1 max-h-64 overflow-y-auto px-1", children: n ? /* @__PURE__ */ e.jsx("div", { className: "flex justify-center py-4", children: /* @__PURE__ */ e.jsx(U, { size: "md" }) }) : /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-3 pb-1", children: [
|
|
987
|
+
i.map((p) => {
|
|
988
|
+
var f, j, g;
|
|
993
989
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-3", children: [
|
|
994
990
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
995
991
|
/* @__PURE__ */ e.jsxs("div", { className: "relative shrink-0", children: [
|
|
996
992
|
/* @__PURE__ */ e.jsx(
|
|
997
|
-
|
|
993
|
+
z,
|
|
998
994
|
{
|
|
999
|
-
avatarImage: (
|
|
1000
|
-
memberId: (
|
|
995
|
+
avatarImage: (f = p.member) == null ? void 0 : f.avatar_image,
|
|
996
|
+
memberId: (j = p.member) == null ? void 0 : j.id
|
|
1001
997
|
}
|
|
1002
998
|
),
|
|
1003
|
-
/* @__PURE__ */ e.jsx("div", { className: "absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-pink-500 text-white", children: /* @__PURE__ */ e.jsx(
|
|
999
|
+
/* @__PURE__ */ e.jsx("div", { className: "absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-pink-500 text-white", children: /* @__PURE__ */ e.jsx(Pe, { className: "size-2.5", fill: "currentColor" }) })
|
|
1004
1000
|
] }),
|
|
1005
|
-
/* @__PURE__ */ e.jsx("span", { className: "font-medium", children: ((
|
|
1001
|
+
/* @__PURE__ */ e.jsx("span", { className: "font-medium", children: ((g = p.member) == null ? void 0 : g.name) || "Deleted member" })
|
|
1006
1002
|
] }),
|
|
1007
|
-
/* @__PURE__ */ e.jsx("span", { className: "shrink-0 text-sm text-muted-foreground", children:
|
|
1008
|
-
] },
|
|
1003
|
+
/* @__PURE__ */ e.jsx("span", { className: "shrink-0 text-sm text-muted-foreground", children: A(p.created_at) })
|
|
1004
|
+
] }, p.id);
|
|
1009
1005
|
}),
|
|
1010
|
-
|
|
1006
|
+
l > 0 && /* @__PURE__ */ e.jsxs("div", { className: "pt-1 text-center text-sm text-muted-foreground", children: [
|
|
1011
1007
|
"and ",
|
|
1012
|
-
|
|
1008
|
+
l,
|
|
1013
1009
|
" more"
|
|
1014
1010
|
] })
|
|
1015
1011
|
] }) }),
|
|
1016
|
-
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsx(
|
|
1012
|
+
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsx(S, { onClick: () => r(!1), children: "OK" }) })
|
|
1017
1013
|
] }) });
|
|
1018
1014
|
}
|
|
1019
|
-
function
|
|
1020
|
-
var
|
|
1021
|
-
const { data:
|
|
1015
|
+
function It({ comment: s, open: t, onOpenChange: r }) {
|
|
1016
|
+
var l, c, d, u, m;
|
|
1017
|
+
const { data: a, isLoading: n } = _t(s.id, { enabled: t }), i = (a == null ? void 0 : a.comment_reports) ?? [], o = ((l = s.count) == null ? void 0 : l.reports) ?? i.length;
|
|
1022
1018
|
return /* @__PURE__ */ e.jsx(de, { open: t, onOpenChange: r, children: /* @__PURE__ */ e.jsxs(me, { "aria-describedby": void 0, children: [
|
|
1023
1019
|
/* @__PURE__ */ e.jsx(ue, { children: /* @__PURE__ */ e.jsxs(he, { children: [
|
|
1024
|
-
|
|
1020
|
+
o,
|
|
1025
1021
|
" ",
|
|
1026
|
-
|
|
1022
|
+
o === 1 ? "report" : "reports"
|
|
1027
1023
|
] }) }),
|
|
1028
1024
|
/* @__PURE__ */ e.jsx("div", { className: "overflow-hidden rounded-md border p-3", children: /* @__PURE__ */ e.jsxs("div", { className: "flex min-w-0 items-start gap-3", children: [
|
|
1029
1025
|
/* @__PURE__ */ e.jsx(
|
|
1030
|
-
|
|
1026
|
+
z,
|
|
1031
1027
|
{
|
|
1032
|
-
avatarImage: (
|
|
1028
|
+
avatarImage: (c = s.member) == null ? void 0 : c.avatar_image,
|
|
1033
1029
|
className: "shrink-0",
|
|
1034
1030
|
memberId: (d = s.member) == null ? void 0 : d.id
|
|
1035
1031
|
}
|
|
@@ -1038,7 +1034,7 @@ function Mt({ comment: s, open: t, onOpenChange: r }) {
|
|
|
1038
1034
|
/* @__PURE__ */ e.jsxs("div", { className: "flex min-w-0 items-center gap-1 text-sm", children: [
|
|
1039
1035
|
/* @__PURE__ */ e.jsx("span", { className: "shrink-0 font-semibold", children: ((u = s.member) == null ? void 0 : u.name) || "Unknown" }),
|
|
1040
1036
|
/* @__PURE__ */ e.jsx(ce, { className: "shrink-0 text-muted-foreground/50", size: 16 }),
|
|
1041
|
-
/* @__PURE__ */ e.jsx("span", { className: "shrink-0 text-muted-foreground", children: s.created_at &&
|
|
1037
|
+
/* @__PURE__ */ e.jsx("span", { className: "shrink-0 text-muted-foreground", children: s.created_at && A(s.created_at) }),
|
|
1042
1038
|
/* @__PURE__ */ e.jsx("span", { className: "shrink-0 text-muted-foreground", children: "on" }),
|
|
1043
1039
|
/* @__PURE__ */ e.jsx("span", { className: "min-w-0 truncate font-medium text-gray-800 dark:text-gray-400", children: ((m = s.post) == null ? void 0 : m.title) || "Unknown post" })
|
|
1044
1040
|
] }),
|
|
@@ -1051,57 +1047,57 @@ function Mt({ comment: s, open: t, onOpenChange: r }) {
|
|
|
1051
1047
|
)
|
|
1052
1048
|
] })
|
|
1053
1049
|
] }) }),
|
|
1054
|
-
/* @__PURE__ */ e.jsx("div", { className: "-mx-1 max-h-64 overflow-y-auto px-1", children: n ? /* @__PURE__ */ e.jsx("div", { className: "flex justify-center py-4", children: /* @__PURE__ */ e.jsx(
|
|
1055
|
-
var
|
|
1050
|
+
/* @__PURE__ */ e.jsx("div", { className: "-mx-1 max-h-64 overflow-y-auto px-1", children: n ? /* @__PURE__ */ e.jsx("div", { className: "flex justify-center py-4", children: /* @__PURE__ */ e.jsx(U, { size: "md" }) }) : /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-3 pb-1", children: i.map((x) => {
|
|
1051
|
+
var p, f, j;
|
|
1056
1052
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-3", children: [
|
|
1057
1053
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
1058
1054
|
/* @__PURE__ */ e.jsxs("div", { className: "relative shrink-0", children: [
|
|
1059
1055
|
/* @__PURE__ */ e.jsx(
|
|
1060
|
-
|
|
1056
|
+
z,
|
|
1061
1057
|
{
|
|
1062
|
-
avatarImage: (
|
|
1063
|
-
memberId: (
|
|
1058
|
+
avatarImage: (p = x.member) == null ? void 0 : p.avatar_image,
|
|
1059
|
+
memberId: (f = x.member) == null ? void 0 : f.id
|
|
1064
1060
|
}
|
|
1065
1061
|
),
|
|
1066
1062
|
/* @__PURE__ */ e.jsx("div", { className: "absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-red text-white", children: /* @__PURE__ */ e.jsx(le, { className: "size-2.5", fill: "currentColor" }) })
|
|
1067
1063
|
] }),
|
|
1068
|
-
/* @__PURE__ */ e.jsx("span", { className: "font-medium", children: ((
|
|
1064
|
+
/* @__PURE__ */ e.jsx("span", { className: "font-medium", children: ((j = x.member) == null ? void 0 : j.name) || "Deleted member" })
|
|
1069
1065
|
] }),
|
|
1070
|
-
/* @__PURE__ */ e.jsx("span", { className: "shrink-0 text-sm text-muted-foreground", children:
|
|
1071
|
-
] },
|
|
1066
|
+
/* @__PURE__ */ e.jsx("span", { className: "shrink-0 text-sm text-muted-foreground", children: A(x.created_at) })
|
|
1067
|
+
] }, x.id);
|
|
1072
1068
|
}) }) }),
|
|
1073
|
-
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsx(
|
|
1069
|
+
/* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsx(S, { onClick: () => r(!1), children: "OK" }) })
|
|
1074
1070
|
] }) });
|
|
1075
1071
|
}
|
|
1076
|
-
function se({ icon: s, count: t, label: r, to:
|
|
1077
|
-
const
|
|
1072
|
+
function se({ icon: s, count: t, label: r, to: a, onClick: n, className: i, testId: o }) {
|
|
1073
|
+
const l = P("flex items-center gap-1 text-xs text-gray-800", i), c = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1078
1074
|
s,
|
|
1079
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
1080
|
-
] }), d =
|
|
1075
|
+
/* @__PURE__ */ e.jsx("span", { children: is(t) })
|
|
1076
|
+
] }), d = a || n;
|
|
1081
1077
|
return /* @__PURE__ */ e.jsx(te, { children: /* @__PURE__ */ e.jsxs(re, { children: [
|
|
1082
|
-
/* @__PURE__ */ e.jsx(ne, { asChild: !0, children:
|
|
1078
|
+
/* @__PURE__ */ e.jsx(ne, { asChild: !0, children: a ? /* @__PURE__ */ e.jsx(
|
|
1083
1079
|
ie,
|
|
1084
1080
|
{
|
|
1085
|
-
className:
|
|
1086
|
-
"data-testid":
|
|
1087
|
-
to:
|
|
1081
|
+
className: P(l, "cursor-pointer hover:opacity-70"),
|
|
1082
|
+
"data-testid": o,
|
|
1083
|
+
to: a,
|
|
1088
1084
|
onClick: (u) => {
|
|
1089
1085
|
u.stopPropagation();
|
|
1090
1086
|
},
|
|
1091
|
-
children:
|
|
1087
|
+
children: c
|
|
1092
1088
|
}
|
|
1093
1089
|
) : n ? /* @__PURE__ */ e.jsx(
|
|
1094
1090
|
"button",
|
|
1095
1091
|
{
|
|
1096
|
-
className:
|
|
1097
|
-
"data-testid":
|
|
1092
|
+
className: P(l, "cursor-pointer hover:opacity-70"),
|
|
1093
|
+
"data-testid": o,
|
|
1098
1094
|
type: "button",
|
|
1099
1095
|
onClick: (u) => {
|
|
1100
1096
|
u.stopPropagation(), n();
|
|
1101
1097
|
},
|
|
1102
|
-
children:
|
|
1098
|
+
children: c
|
|
1103
1099
|
}
|
|
1104
|
-
) : /* @__PURE__ */ e.jsx("div", { className:
|
|
1100
|
+
) : /* @__PURE__ */ e.jsx("div", { className: l, "data-testid": o, children: c }) }),
|
|
1105
1101
|
/* @__PURE__ */ e.jsx(ae, { children: d ? `View ${r.toLowerCase()}` : r })
|
|
1106
1102
|
] }) });
|
|
1107
1103
|
}
|
|
@@ -1111,63 +1107,63 @@ function ge(s, t) {
|
|
|
1111
1107
|
const r = new URLSearchParams(s);
|
|
1112
1108
|
return r.set("thread", `is:${t}`), `?${r.toString()}`;
|
|
1113
1109
|
}
|
|
1114
|
-
function
|
|
1110
|
+
function es({
|
|
1115
1111
|
comment: s,
|
|
1116
1112
|
className: t
|
|
1117
1113
|
}) {
|
|
1118
|
-
var
|
|
1119
|
-
const [r] =
|
|
1114
|
+
var f, j, g, v, b;
|
|
1115
|
+
const [r] = G(), [a, n] = T(!1), [i, o] = T(!1), l = ge(r, s.id), c = ((f = s.count) == null ? void 0 : f.direct_replies) ?? ((j = s.count) == null ? void 0 : j.replies) ?? ((g = s.replies) == null ? void 0 : g.length) ?? 0, d = ((v = s.count) == null ? void 0 : v.likes) ?? 0, u = ((b = s.count) == null ? void 0 : b.reports) ?? 0, m = c > 0, x = d > 0, p = u > 0;
|
|
1120
1116
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1121
|
-
/* @__PURE__ */ e.jsxs("div", { className:
|
|
1117
|
+
/* @__PURE__ */ e.jsxs("div", { className: P("flex items-center gap-6", t), children: [
|
|
1122
1118
|
/* @__PURE__ */ e.jsx(
|
|
1123
1119
|
se,
|
|
1124
1120
|
{
|
|
1125
|
-
count:
|
|
1126
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
1121
|
+
count: c,
|
|
1122
|
+
icon: /* @__PURE__ */ e.jsx(Rs, { size: 16, strokeWidth: 1.5 }),
|
|
1127
1123
|
label: "Replies",
|
|
1128
1124
|
testId: "replies-metric",
|
|
1129
|
-
to: m ?
|
|
1125
|
+
to: m ? l : void 0
|
|
1130
1126
|
}
|
|
1131
1127
|
),
|
|
1132
1128
|
/* @__PURE__ */ e.jsx(
|
|
1133
1129
|
se,
|
|
1134
1130
|
{
|
|
1135
1131
|
count: d,
|
|
1136
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
1132
|
+
icon: /* @__PURE__ */ e.jsx(Pe, { size: 16, strokeWidth: 1.5 }),
|
|
1137
1133
|
label: "Likes",
|
|
1138
|
-
onClick:
|
|
1134
|
+
onClick: x ? () => n(!0) : void 0
|
|
1139
1135
|
}
|
|
1140
1136
|
),
|
|
1141
1137
|
/* @__PURE__ */ e.jsx(
|
|
1142
1138
|
se,
|
|
1143
1139
|
{
|
|
1144
|
-
className:
|
|
1140
|
+
className: p ? "font-semibold text-red" : void 0,
|
|
1145
1141
|
count: u,
|
|
1146
1142
|
icon: /* @__PURE__ */ e.jsx(le, { size: 16, strokeWidth: 1.5 }),
|
|
1147
1143
|
label: "Reports",
|
|
1148
|
-
onClick:
|
|
1144
|
+
onClick: p ? () => o(!0) : void 0
|
|
1149
1145
|
}
|
|
1150
1146
|
)
|
|
1151
1147
|
] }),
|
|
1152
1148
|
/* @__PURE__ */ e.jsx(
|
|
1153
|
-
|
|
1149
|
+
Et,
|
|
1154
1150
|
{
|
|
1155
1151
|
comment: s,
|
|
1156
|
-
open:
|
|
1152
|
+
open: a,
|
|
1157
1153
|
onOpenChange: n
|
|
1158
1154
|
}
|
|
1159
1155
|
),
|
|
1160
1156
|
/* @__PURE__ */ e.jsx(
|
|
1161
|
-
|
|
1157
|
+
It,
|
|
1162
1158
|
{
|
|
1163
1159
|
comment: s,
|
|
1164
|
-
open:
|
|
1165
|
-
onOpenChange:
|
|
1160
|
+
open: i,
|
|
1161
|
+
onOpenChange: o
|
|
1166
1162
|
}
|
|
1167
1163
|
)
|
|
1168
1164
|
] });
|
|
1169
1165
|
}
|
|
1170
|
-
function
|
|
1166
|
+
function $t({ hasReplies: s }) {
|
|
1171
1167
|
return s ? /* @__PURE__ */ e.jsx(
|
|
1172
1168
|
"div",
|
|
1173
1169
|
{
|
|
@@ -1176,21 +1172,21 @@ function Dt({ hasReplies: s }) {
|
|
|
1176
1172
|
}
|
|
1177
1173
|
) : null;
|
|
1178
1174
|
}
|
|
1179
|
-
function
|
|
1180
|
-
var u, m, p, f,
|
|
1181
|
-
const [
|
|
1182
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `flex w-full flex-row ${
|
|
1175
|
+
function ss({ comment: s, isReply: t = !1, isSelectedComment: r = !1, selectedCommentId: a }) {
|
|
1176
|
+
var d, u, m, x, p, f, j, g;
|
|
1177
|
+
const [n] = G(), { mutate: i } = Ye(), { mutate: o } = Xe(), l = (((d = s.replies) == null ? void 0 : d.length) ?? 0) > 0 || (((u = s.count) == null ? void 0 : u.direct_replies) ?? ((m = s.count) == null ? void 0 : m.replies) ?? 0) > 0, c = !l || t ? "mb-7" : "mb-0";
|
|
1178
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `flex w-full flex-row ${c}`, children: [
|
|
1183
1179
|
/* @__PURE__ */ e.jsxs("div", { className: "mr-2 flex shrink-0 flex-col items-center justify-start md:mr-3", children: [
|
|
1184
1180
|
/* @__PURE__ */ e.jsx(
|
|
1185
|
-
|
|
1181
|
+
z,
|
|
1186
1182
|
{
|
|
1187
|
-
avatarImage: (
|
|
1183
|
+
avatarImage: (x = s.member) == null ? void 0 : x.avatar_image,
|
|
1188
1184
|
className: "mb-3 shrink-0 md:mb-4",
|
|
1189
1185
|
isHidden: s.status === "hidden",
|
|
1190
|
-
memberId: (
|
|
1186
|
+
memberId: (p = s.member) == null ? void 0 : p.id
|
|
1191
1187
|
}
|
|
1192
1188
|
),
|
|
1193
|
-
/* @__PURE__ */ e.jsx(
|
|
1189
|
+
/* @__PURE__ */ e.jsx($t, { hasReplies: l && !t })
|
|
1194
1190
|
] }),
|
|
1195
1191
|
/* @__PURE__ */ e.jsx("div", { className: "grow", children: /* @__PURE__ */ e.jsxs(
|
|
1196
1192
|
"div",
|
|
@@ -1200,13 +1196,13 @@ function rs({ comment: s, isReply: t = !1, isSelectedComment: r = !1, selectedCo
|
|
|
1200
1196
|
children: [
|
|
1201
1197
|
/* @__PURE__ */ e.jsxs("div", { className: "flex min-w-0 flex-col", children: [
|
|
1202
1198
|
/* @__PURE__ */ e.jsx(
|
|
1203
|
-
|
|
1199
|
+
Ze,
|
|
1204
1200
|
{
|
|
1205
|
-
canComment: (
|
|
1201
|
+
canComment: (f = s.member) == null ? void 0 : f.can_comment,
|
|
1206
1202
|
createdAt: s.created_at,
|
|
1207
1203
|
isHidden: s.status === "hidden",
|
|
1208
|
-
memberId: (
|
|
1209
|
-
memberName: (
|
|
1204
|
+
memberId: (j = s.member) == null ? void 0 : j.id,
|
|
1205
|
+
memberName: (g = s.member) == null ? void 0 : g.name
|
|
1210
1206
|
}
|
|
1211
1207
|
),
|
|
1212
1208
|
s.in_reply_to_snippet && r && /* @__PURE__ */ e.jsxs("div", { className: `mb-1 line-clamp-1 text-sm ${s.status === "hidden" && "opacity-50"}`, children: [
|
|
@@ -1217,187 +1213,181 @@ function rs({ comment: s, isReply: t = !1, isSelectedComment: r = !1, selectedCo
|
|
|
1217
1213
|
{
|
|
1218
1214
|
className: "text-sm font-normal text-muted-foreground hover:text-foreground",
|
|
1219
1215
|
"data-testid": "replied-to-link",
|
|
1220
|
-
to: ge(
|
|
1221
|
-
onClick: (
|
|
1222
|
-
|
|
1216
|
+
to: ge(n, s.in_reply_to_id || s.parent_id) || "",
|
|
1217
|
+
onClick: (v) => {
|
|
1218
|
+
v.stopPropagation();
|
|
1223
1219
|
},
|
|
1224
1220
|
children: s.in_reply_to_snippet
|
|
1225
1221
|
}
|
|
1226
1222
|
)
|
|
1227
1223
|
] }),
|
|
1228
|
-
/* @__PURE__ */ e.jsx(
|
|
1224
|
+
/* @__PURE__ */ e.jsx(Ke, { item: s }),
|
|
1229
1225
|
/* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex flex-row flex-wrap items-center gap-3", children: [
|
|
1230
|
-
s.status === "published" && /* @__PURE__ */ e.jsxs(
|
|
1231
|
-
/* @__PURE__ */ e.jsx(
|
|
1226
|
+
s.status === "published" && /* @__PURE__ */ e.jsxs(S, { className: "text-gray-800", size: "sm", variant: "outline", onClick: () => i({ id: s.id }), children: [
|
|
1227
|
+
/* @__PURE__ */ e.jsx(Te, {}),
|
|
1232
1228
|
/* @__PURE__ */ e.jsx("span", { className: "max-md:hidden", children: "Hide" })
|
|
1233
1229
|
] }),
|
|
1234
|
-
s.status === "hidden" && /* @__PURE__ */ e.jsxs(
|
|
1235
|
-
/* @__PURE__ */ e.jsx(
|
|
1230
|
+
s.status === "hidden" && /* @__PURE__ */ e.jsxs(S, { className: "text-gray-800", size: "sm", variant: "outline", onClick: () => o({ id: s.id }), children: [
|
|
1231
|
+
/* @__PURE__ */ e.jsx(Re, {}),
|
|
1236
1232
|
/* @__PURE__ */ e.jsx("span", { className: "max-md:hidden", children: "Show" })
|
|
1237
1233
|
] }),
|
|
1238
1234
|
/* @__PURE__ */ e.jsx(
|
|
1239
|
-
|
|
1235
|
+
es,
|
|
1240
1236
|
{
|
|
1241
1237
|
comment: s
|
|
1242
1238
|
}
|
|
1243
1239
|
),
|
|
1244
1240
|
/* @__PURE__ */ e.jsx(
|
|
1245
|
-
|
|
1241
|
+
Je,
|
|
1246
1242
|
{
|
|
1247
|
-
comment: s
|
|
1248
|
-
commentPermalinksEnabled: n
|
|
1243
|
+
comment: s
|
|
1249
1244
|
}
|
|
1250
1245
|
)
|
|
1251
1246
|
] })
|
|
1252
1247
|
] }),
|
|
1253
|
-
|
|
1254
|
-
|
|
1248
|
+
l && s.replies && /* @__PURE__ */ e.jsx("div", { className: "-ml-2 mb-4 mt-7 pl-2 md:-ml-3 md:mb-0 md:mt-8 md:pl-3", children: s.replies.map((v) => /* @__PURE__ */ e.jsx(
|
|
1249
|
+
ss,
|
|
1255
1250
|
{
|
|
1256
|
-
comment:
|
|
1257
|
-
commentPermalinksEnabled: n,
|
|
1251
|
+
comment: v,
|
|
1258
1252
|
isReply: !0,
|
|
1259
|
-
selectedCommentId:
|
|
1253
|
+
selectedCommentId: a
|
|
1260
1254
|
},
|
|
1261
|
-
|
|
1255
|
+
v.id
|
|
1262
1256
|
)) })
|
|
1263
1257
|
]
|
|
1264
1258
|
}
|
|
1265
1259
|
) })
|
|
1266
1260
|
] });
|
|
1267
1261
|
}
|
|
1268
|
-
const
|
|
1262
|
+
const Mt = ({
|
|
1269
1263
|
selectedComment: s,
|
|
1270
1264
|
replies: t,
|
|
1271
1265
|
selectedCommentId: r,
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
isFetchingNextPage: l
|
|
1266
|
+
fetchNextPage: a,
|
|
1267
|
+
hasNextPage: n,
|
|
1268
|
+
isFetchingNextPage: i
|
|
1276
1269
|
}) => {
|
|
1277
|
-
const
|
|
1270
|
+
const o = { ...s, replies: t };
|
|
1278
1271
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", "data-testid": "comment-thread-list", children: [
|
|
1279
1272
|
/* @__PURE__ */ e.jsx(
|
|
1280
|
-
|
|
1273
|
+
ss,
|
|
1281
1274
|
{
|
|
1282
|
-
comment:
|
|
1283
|
-
commentPermalinksEnabled: i,
|
|
1275
|
+
comment: o,
|
|
1284
1276
|
isSelectedComment: !0,
|
|
1285
1277
|
selectedCommentId: r
|
|
1286
1278
|
}
|
|
1287
1279
|
),
|
|
1288
|
-
|
|
1289
|
-
|
|
1280
|
+
n && /* @__PURE__ */ e.jsx("div", { className: "flex justify-center pb-4", children: /* @__PURE__ */ e.jsx(
|
|
1281
|
+
S,
|
|
1290
1282
|
{
|
|
1291
|
-
disabled:
|
|
1283
|
+
disabled: i,
|
|
1292
1284
|
variant: "outline",
|
|
1293
|
-
onClick: () =>
|
|
1294
|
-
children:
|
|
1295
|
-
/* @__PURE__ */ e.jsx(
|
|
1285
|
+
onClick: () => a(),
|
|
1286
|
+
children: i ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1287
|
+
/* @__PURE__ */ e.jsx(U, { size: "sm" }),
|
|
1296
1288
|
"Loading..."
|
|
1297
1289
|
] }) : "Load more replies"
|
|
1298
1290
|
}
|
|
1299
1291
|
) })
|
|
1300
1292
|
] });
|
|
1301
|
-
},
|
|
1293
|
+
}, Dt = ({
|
|
1302
1294
|
commentId: s,
|
|
1303
1295
|
open: t,
|
|
1304
|
-
onOpenChange: r
|
|
1305
|
-
commentPermalinksEnabled: i
|
|
1296
|
+
onOpenChange: r
|
|
1306
1297
|
}) => {
|
|
1307
|
-
var
|
|
1298
|
+
var g;
|
|
1308
1299
|
const {
|
|
1309
|
-
data:
|
|
1310
|
-
isLoading:
|
|
1311
|
-
isError:
|
|
1312
|
-
fetchNextPage:
|
|
1313
|
-
hasNextPage:
|
|
1314
|
-
isFetchingNextPage:
|
|
1315
|
-
} =
|
|
1300
|
+
data: a,
|
|
1301
|
+
isLoading: n,
|
|
1302
|
+
isError: i,
|
|
1303
|
+
fetchNextPage: o,
|
|
1304
|
+
hasNextPage: l,
|
|
1305
|
+
isFetchingNextPage: c
|
|
1306
|
+
} = Tt(s ?? "", {
|
|
1316
1307
|
enabled: t && !!s
|
|
1317
|
-
}), { data:
|
|
1308
|
+
}), { data: d, isLoading: u, isError: m } = kt(s ?? "", {
|
|
1318
1309
|
enabled: t && !!s
|
|
1319
|
-
}),
|
|
1320
|
-
return /* @__PURE__ */ e.jsx(
|
|
1321
|
-
/* @__PURE__ */ e.jsx(
|
|
1322
|
-
(
|
|
1310
|
+
}), x = n || u, p = m || i && !d, f = (g = d == null ? void 0 : d.comments) == null ? void 0 : g[0], j = (a == null ? void 0 : a.comments) || [];
|
|
1311
|
+
return /* @__PURE__ */ e.jsx(As, { open: t, onOpenChange: r, children: /* @__PURE__ */ e.jsxs(Us, { className: "overflow-y-auto px-6 pt-0 sm:max-w-[600px]", children: [
|
|
1312
|
+
/* @__PURE__ */ e.jsx(Vs, { className: "sticky top-0 z-40 -mx-6 bg-background/60 p-6 backdrop-blur", children: /* @__PURE__ */ e.jsx(qs, { className: "text-md", children: "Thread" }) }),
|
|
1313
|
+
(f == null ? void 0 : f.post) && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1323
1314
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-4", children: [
|
|
1324
1315
|
/* @__PURE__ */ e.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
1325
|
-
/* @__PURE__ */ e.jsx("h3", { className: "line-clamp-1 text-xl font-semibold text-foreground", children:
|
|
1326
|
-
|
|
1316
|
+
/* @__PURE__ */ e.jsx("h3", { className: "line-clamp-1 text-xl font-semibold text-foreground", children: f.post.title }),
|
|
1317
|
+
f.post.excerpt && /* @__PURE__ */ e.jsx("p", { className: "mt-1 line-clamp-2 text-sm text-muted-foreground", children: f.post.excerpt })
|
|
1327
1318
|
] }),
|
|
1328
|
-
|
|
1319
|
+
f.post.feature_image && /* @__PURE__ */ e.jsx(
|
|
1329
1320
|
"img",
|
|
1330
1321
|
{
|
|
1331
|
-
alt:
|
|
1322
|
+
alt: f.post.title || "Post feature image",
|
|
1332
1323
|
className: "hidden aspect-video h-18 shrink-0 rounded object-cover lg:block",
|
|
1333
|
-
src:
|
|
1324
|
+
src: f.post.feature_image
|
|
1334
1325
|
}
|
|
1335
1326
|
)
|
|
1336
1327
|
] }),
|
|
1337
|
-
/* @__PURE__ */ e.jsx(
|
|
1328
|
+
/* @__PURE__ */ e.jsx(ys, { className: "-mx-6 my-6 w-auto" })
|
|
1338
1329
|
] }),
|
|
1339
|
-
/* @__PURE__ */ e.jsx("div", { children:
|
|
1340
|
-
|
|
1330
|
+
/* @__PURE__ */ e.jsx("div", { children: x ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center py-8", children: /* @__PURE__ */ e.jsx(U, { size: "lg" }) }) : p || !f ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center py-8", children: /* @__PURE__ */ e.jsx(
|
|
1331
|
+
Ie,
|
|
1341
1332
|
{
|
|
1342
|
-
actions: /* @__PURE__ */ e.jsx(
|
|
1333
|
+
actions: /* @__PURE__ */ e.jsx(S, { variant: "outline", onClick: () => r(!1), children: "Back to comments" }),
|
|
1343
1334
|
description: "This thread may have been deleted or doesn't exist.",
|
|
1344
1335
|
title: "Thread not found",
|
|
1345
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1336
|
+
children: /* @__PURE__ */ e.jsx(Le, {})
|
|
1346
1337
|
}
|
|
1347
1338
|
) }) : /* @__PURE__ */ e.jsx(
|
|
1348
|
-
|
|
1339
|
+
Mt,
|
|
1349
1340
|
{
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
selectedComment: h,
|
|
1341
|
+
fetchNextPage: o,
|
|
1342
|
+
hasNextPage: l,
|
|
1343
|
+
isFetchingNextPage: c,
|
|
1344
|
+
replies: j,
|
|
1345
|
+
selectedComment: f,
|
|
1356
1346
|
selectedCommentId: s ?? ""
|
|
1357
1347
|
}
|
|
1358
1348
|
) })
|
|
1359
1349
|
] }) });
|
|
1360
|
-
},
|
|
1361
|
-
function
|
|
1362
|
-
const
|
|
1363
|
-
|
|
1350
|
+
}, Ne = /* @__PURE__ */ new Map();
|
|
1351
|
+
function Ft({ parentRef: s, enabled: t = !0, isLoading: r = !1 }) {
|
|
1352
|
+
const a = os(), [n, i] = T(null), o = w(null);
|
|
1353
|
+
I(() => {
|
|
1364
1354
|
if (!t || !s.current)
|
|
1365
1355
|
return;
|
|
1366
|
-
const
|
|
1367
|
-
|
|
1368
|
-
}, [t, s]),
|
|
1356
|
+
const l = Ms(s.current);
|
|
1357
|
+
i(l);
|
|
1358
|
+
}, [t, s]), I(() => {
|
|
1369
1359
|
if (!t || !n)
|
|
1370
1360
|
return;
|
|
1371
|
-
const
|
|
1361
|
+
const l = a.pathname + a.search, c = () => {
|
|
1372
1362
|
const d = n.scrollTop;
|
|
1373
|
-
|
|
1363
|
+
Ne.set(l, d);
|
|
1374
1364
|
};
|
|
1375
|
-
return n.addEventListener("scroll",
|
|
1376
|
-
}, [t,
|
|
1377
|
-
const
|
|
1365
|
+
return n.addEventListener("scroll", c), () => n.removeEventListener("scroll", c);
|
|
1366
|
+
}, [t, a.pathname, a.search, n]), I(() => {
|
|
1367
|
+
const l = a.pathname + a.search, c = Ne.get(l);
|
|
1378
1368
|
if (!(!t || !n || r)) {
|
|
1379
|
-
if (
|
|
1369
|
+
if (c !== void 0 && o.current !== l) {
|
|
1380
1370
|
let d = 0;
|
|
1381
1371
|
const u = 3, m = () => {
|
|
1382
1372
|
if (d += 1, !n)
|
|
1383
1373
|
return;
|
|
1384
|
-
const
|
|
1385
|
-
if (
|
|
1374
|
+
const p = n.scrollTop, f = n.scrollHeight, j = n.clientHeight, g = f - j;
|
|
1375
|
+
if (c > g && d < u) {
|
|
1386
1376
|
setTimeout(m, 100);
|
|
1387
1377
|
return;
|
|
1388
1378
|
}
|
|
1389
|
-
if (Math.abs(
|
|
1390
|
-
const
|
|
1391
|
-
n.scrollTop =
|
|
1379
|
+
if (Math.abs(c - p) > 5) {
|
|
1380
|
+
const v = Math.min(c, g);
|
|
1381
|
+
n.scrollTop = v;
|
|
1392
1382
|
}
|
|
1393
|
-
},
|
|
1394
|
-
return () => clearTimeout(
|
|
1383
|
+
}, x = setTimeout(m, 150);
|
|
1384
|
+
return () => clearTimeout(x);
|
|
1395
1385
|
}
|
|
1396
|
-
|
|
1386
|
+
o.current = l;
|
|
1397
1387
|
}
|
|
1398
|
-
}, [t,
|
|
1388
|
+
}, [t, a.pathname, a.search, n, r]);
|
|
1399
1389
|
}
|
|
1400
|
-
const
|
|
1390
|
+
const ke = ({ height: s }) => /* @__PURE__ */ e.jsx("div", { "aria-hidden": "true", className: "flex", children: /* @__PURE__ */ e.jsx("div", { className: "flex", style: { height: s } }) }), zt = L(function(t, r) {
|
|
1401
1391
|
return /* @__PURE__ */ e.jsx(
|
|
1402
1392
|
"div",
|
|
1403
1393
|
{
|
|
@@ -1409,86 +1399,85 @@ const _e = ({ height: s }) => /* @__PURE__ */ e.jsx("div", { "aria-hidden": "tru
|
|
|
1409
1399
|
}
|
|
1410
1400
|
);
|
|
1411
1401
|
});
|
|
1412
|
-
function
|
|
1402
|
+
function Ot({
|
|
1413
1403
|
items: s,
|
|
1414
1404
|
totalItems: t,
|
|
1415
1405
|
hasNextPage: r,
|
|
1416
|
-
isFetchingNextPage:
|
|
1406
|
+
isFetchingNextPage: a,
|
|
1417
1407
|
fetchNextPage: n,
|
|
1418
|
-
onAddFilter:
|
|
1419
|
-
isLoading:
|
|
1420
|
-
commentPermalinksEnabled: c
|
|
1408
|
+
onAddFilter: i,
|
|
1409
|
+
isLoading: o
|
|
1421
1410
|
}) {
|
|
1422
|
-
const
|
|
1423
|
-
if (
|
|
1424
|
-
const
|
|
1425
|
-
|
|
1411
|
+
const l = w(null), [c, d] = G(), [u, m] = T(!1), [x, p] = T(null), { mutate: f } = Ye(), { mutate: j } = Xe(), g = (C) => {
|
|
1412
|
+
if (m(C), !C) {
|
|
1413
|
+
const k = new URLSearchParams(c);
|
|
1414
|
+
k.delete("thread"), d(k, { replace: !0 });
|
|
1426
1415
|
}
|
|
1427
1416
|
};
|
|
1428
|
-
|
|
1429
|
-
const
|
|
1430
|
-
if (
|
|
1431
|
-
const
|
|
1432
|
-
if (
|
|
1433
|
-
const
|
|
1434
|
-
|
|
1417
|
+
I(() => {
|
|
1418
|
+
const C = c.get("thread");
|
|
1419
|
+
if (C) {
|
|
1420
|
+
const k = C.match(/^is:(.+)$/);
|
|
1421
|
+
if (k && k[1]) {
|
|
1422
|
+
const h = k[1];
|
|
1423
|
+
p(h), m(!0);
|
|
1435
1424
|
} else
|
|
1436
|
-
|
|
1425
|
+
m(!1), p(null);
|
|
1437
1426
|
} else
|
|
1438
|
-
|
|
1439
|
-
}, [
|
|
1440
|
-
const { visibleItems:
|
|
1427
|
+
m(!1), p(null);
|
|
1428
|
+
}, [c]), Ft({ parentRef: l, isLoading: o });
|
|
1429
|
+
const { visibleItems: v, spaceBefore: b, spaceAfter: y } = Ds({
|
|
1441
1430
|
items: s,
|
|
1442
1431
|
totalItems: t,
|
|
1443
1432
|
hasNextPage: r,
|
|
1444
|
-
isFetchingNextPage:
|
|
1433
|
+
isFetchingNextPage: a,
|
|
1445
1434
|
fetchNextPage: n,
|
|
1446
|
-
parentRef:
|
|
1435
|
+
parentRef: l
|
|
1447
1436
|
});
|
|
1448
|
-
return /* @__PURE__ */ e.jsxs("div", { ref:
|
|
1437
|
+
return /* @__PURE__ */ e.jsxs("div", { ref: l, className: "overflow-hidden", children: [
|
|
1449
1438
|
/* @__PURE__ */ e.jsx(
|
|
1450
1439
|
"div",
|
|
1451
1440
|
{
|
|
1452
1441
|
className: "flex flex-col",
|
|
1453
1442
|
"data-testid": "comments-list",
|
|
1454
1443
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
|
|
1455
|
-
/* @__PURE__ */ e.jsx(
|
|
1456
|
-
|
|
1457
|
-
var
|
|
1458
|
-
return
|
|
1444
|
+
/* @__PURE__ */ e.jsx(ke, { height: b }),
|
|
1445
|
+
v.map(({ key: C, virtualItem: k, item: h, props: R }) => {
|
|
1446
|
+
var O, F, V, M, N, _, D, q, je;
|
|
1447
|
+
return k.index > s.length - 1 ? /* @__PURE__ */ e.jsx(zt, { ...R }, C) : /* @__PURE__ */ e.jsxs(
|
|
1459
1448
|
"div",
|
|
1460
1449
|
{
|
|
1461
|
-
...
|
|
1450
|
+
...R,
|
|
1462
1451
|
className: "grid w-full grid-cols-1 items-start justify-between gap-4 border-b p-3 hover:bg-muted/50 md:p-5 lg:grid-cols-[minmax(0,1fr)_144px]",
|
|
1463
1452
|
"data-testid": "comment-list-row",
|
|
1464
1453
|
onClick: () => {
|
|
1465
|
-
|
|
1454
|
+
u && g(!1);
|
|
1466
1455
|
},
|
|
1467
1456
|
children: [
|
|
1468
1457
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-3", children: [
|
|
1469
1458
|
/* @__PURE__ */ e.jsx(
|
|
1470
|
-
|
|
1459
|
+
z,
|
|
1471
1460
|
{
|
|
1472
|
-
avatarImage: (
|
|
1473
|
-
isHidden:
|
|
1474
|
-
memberId: (
|
|
1461
|
+
avatarImage: (O = h.member) == null ? void 0 : O.avatar_image,
|
|
1462
|
+
isHidden: h.status === "hidden",
|
|
1463
|
+
memberId: (F = h.member) == null ? void 0 : F.id
|
|
1475
1464
|
}
|
|
1476
1465
|
),
|
|
1477
1466
|
/* @__PURE__ */ e.jsxs("div", { className: "flex min-w-0 flex-col", children: [
|
|
1478
1467
|
/* @__PURE__ */ e.jsx(
|
|
1479
|
-
|
|
1468
|
+
Ze,
|
|
1480
1469
|
{
|
|
1481
|
-
canComment: (
|
|
1482
|
-
createdAt:
|
|
1483
|
-
isHidden:
|
|
1484
|
-
memberId: (
|
|
1485
|
-
memberName: (
|
|
1486
|
-
postTitle: (
|
|
1487
|
-
onAuthorClick: (
|
|
1488
|
-
onPostClick: (
|
|
1470
|
+
canComment: (V = h.member) == null ? void 0 : V.can_comment,
|
|
1471
|
+
createdAt: h.created_at,
|
|
1472
|
+
isHidden: h.status === "hidden",
|
|
1473
|
+
memberId: (M = h.member) == null ? void 0 : M.id,
|
|
1474
|
+
memberName: (N = h.member) == null ? void 0 : N.name,
|
|
1475
|
+
postTitle: (_ = h.post) == null ? void 0 : _.title,
|
|
1476
|
+
onAuthorClick: (D = h.member) != null && D.id ? () => i("author", h.member.id) : void 0,
|
|
1477
|
+
onPostClick: (q = h.post) != null && q.id ? () => i("post", h.post.id) : void 0
|
|
1489
1478
|
}
|
|
1490
1479
|
),
|
|
1491
|
-
|
|
1480
|
+
h.in_reply_to_snippet && /* @__PURE__ */ e.jsxs("div", { className: `mb-1 line-clamp-1 max-w-3xl text-sm ${h.status === "hidden" && "opacity-50"}`, children: [
|
|
1492
1481
|
/* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "Replied to:" }),
|
|
1493
1482
|
" ",
|
|
1494
1483
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1496,71 +1485,69 @@ function Ht({
|
|
|
1496
1485
|
{
|
|
1497
1486
|
className: "text-sm font-normal text-muted-foreground hover:text-foreground",
|
|
1498
1487
|
"data-testid": "replied-to-link",
|
|
1499
|
-
to: ge(
|
|
1500
|
-
onClick: (
|
|
1501
|
-
|
|
1488
|
+
to: ge(c, h.in_reply_to_id || h.parent_id) || "",
|
|
1489
|
+
onClick: (rs) => {
|
|
1490
|
+
rs.stopPropagation();
|
|
1502
1491
|
},
|
|
1503
|
-
children:
|
|
1492
|
+
children: h.in_reply_to_snippet
|
|
1504
1493
|
}
|
|
1505
1494
|
)
|
|
1506
1495
|
] }),
|
|
1507
|
-
/* @__PURE__ */ e.jsx(
|
|
1496
|
+
/* @__PURE__ */ e.jsx(Ke, { item: h }),
|
|
1508
1497
|
/* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex flex-row flex-nowrap items-center gap-3", children: [
|
|
1509
|
-
|
|
1510
|
-
/* @__PURE__ */ e.jsx(
|
|
1498
|
+
h.status === "published" && /* @__PURE__ */ e.jsxs(S, { className: "text-foreground", size: "sm", variant: "outline", onClick: () => f({ id: h.id }), children: [
|
|
1499
|
+
/* @__PURE__ */ e.jsx(Te, {}),
|
|
1511
1500
|
"Hide"
|
|
1512
1501
|
] }),
|
|
1513
|
-
|
|
1514
|
-
/* @__PURE__ */ e.jsx(
|
|
1502
|
+
h.status === "hidden" && /* @__PURE__ */ e.jsxs(S, { className: "text-foreground", size: "sm", variant: "outline", onClick: () => j({ id: h.id }), children: [
|
|
1503
|
+
/* @__PURE__ */ e.jsx(Re, {}),
|
|
1515
1504
|
"Show"
|
|
1516
1505
|
] }),
|
|
1517
1506
|
/* @__PURE__ */ e.jsx(
|
|
1518
|
-
|
|
1507
|
+
es,
|
|
1519
1508
|
{
|
|
1520
1509
|
className: "ml-2",
|
|
1521
|
-
comment:
|
|
1510
|
+
comment: h
|
|
1522
1511
|
}
|
|
1523
1512
|
),
|
|
1524
1513
|
/* @__PURE__ */ e.jsx(
|
|
1525
|
-
|
|
1514
|
+
Je,
|
|
1526
1515
|
{
|
|
1527
|
-
comment:
|
|
1528
|
-
commentPermalinksEnabled: c
|
|
1516
|
+
comment: h
|
|
1529
1517
|
}
|
|
1530
1518
|
)
|
|
1531
1519
|
] })
|
|
1532
1520
|
] })
|
|
1533
1521
|
] }),
|
|
1534
|
-
/* @__PURE__ */ e.jsx("div", { children: (
|
|
1522
|
+
/* @__PURE__ */ e.jsx("div", { children: (je = h.post) != null && je.feature_image ? /* @__PURE__ */ e.jsx(
|
|
1535
1523
|
"img",
|
|
1536
1524
|
{
|
|
1537
|
-
alt:
|
|
1538
|
-
className: `hidden aspect-video w-36 rounded object-cover lg:block ${
|
|
1539
|
-
src:
|
|
1525
|
+
alt: h.post.title || "Post feature image",
|
|
1526
|
+
className: `hidden aspect-video w-36 rounded object-cover lg:block ${h.status === "hidden" && "opacity-50"}`,
|
|
1527
|
+
src: h.post.feature_image
|
|
1540
1528
|
}
|
|
1541
1529
|
) : null })
|
|
1542
1530
|
]
|
|
1543
1531
|
},
|
|
1544
|
-
|
|
1532
|
+
C
|
|
1545
1533
|
);
|
|
1546
1534
|
}),
|
|
1547
|
-
/* @__PURE__ */ e.jsx(
|
|
1535
|
+
/* @__PURE__ */ e.jsx(ke, { height: y })
|
|
1548
1536
|
] })
|
|
1549
1537
|
}
|
|
1550
1538
|
),
|
|
1551
1539
|
/* @__PURE__ */ e.jsx(
|
|
1552
|
-
|
|
1540
|
+
Dt,
|
|
1553
1541
|
{
|
|
1554
|
-
commentId:
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
onOpenChange: j
|
|
1542
|
+
commentId: x,
|
|
1543
|
+
open: u,
|
|
1544
|
+
onOpenChange: g
|
|
1558
1545
|
}
|
|
1559
1546
|
)
|
|
1560
1547
|
] });
|
|
1561
1548
|
}
|
|
1562
|
-
const
|
|
1563
|
-
function
|
|
1549
|
+
const ts = ["id", "status", "created_at", "body", "post", "author", "reported"];
|
|
1550
|
+
function Ht(s) {
|
|
1564
1551
|
const t = [];
|
|
1565
1552
|
for (const r of s)
|
|
1566
1553
|
if (r.values[0])
|
|
@@ -1577,8 +1564,8 @@ function At(s) {
|
|
|
1577
1564
|
else if (r.operator === "after" && r.values[0])
|
|
1578
1565
|
t.push(`created_at:>'${r.values[0]}'`);
|
|
1579
1566
|
else if (r.operator === "is" && r.values[0]) {
|
|
1580
|
-
const
|
|
1581
|
-
t.push(`created_at:>='${
|
|
1567
|
+
const i = String(r.values[0]), o = (/* @__PURE__ */ new Date(i + "T00:00:00")).toISOString(), l = (/* @__PURE__ */ new Date(i + "T23:59:59.999")).toISOString();
|
|
1568
|
+
t.push(`created_at:>='${o}'+created_at:<='${l}'`);
|
|
1582
1569
|
}
|
|
1583
1570
|
break;
|
|
1584
1571
|
case "body":
|
|
@@ -1597,7 +1584,7 @@ function At(s) {
|
|
|
1597
1584
|
}
|
|
1598
1585
|
return t.length ? t.join("+") : void 0;
|
|
1599
1586
|
}
|
|
1600
|
-
function
|
|
1587
|
+
function Bt(s) {
|
|
1601
1588
|
if (!s)
|
|
1602
1589
|
return null;
|
|
1603
1590
|
const t = s.indexOf(":");
|
|
@@ -1606,12 +1593,12 @@ function Ut(s) {
|
|
|
1606
1593
|
value: s.substring(t + 1)
|
|
1607
1594
|
};
|
|
1608
1595
|
}
|
|
1609
|
-
function
|
|
1596
|
+
function At(s) {
|
|
1610
1597
|
const t = [];
|
|
1611
|
-
for (const [r,
|
|
1612
|
-
if (!
|
|
1598
|
+
for (const [r, a] of s.entries()) {
|
|
1599
|
+
if (!ts.includes(r) || !a)
|
|
1613
1600
|
continue;
|
|
1614
|
-
const n =
|
|
1601
|
+
const n = Bt(a);
|
|
1615
1602
|
n && t.push({
|
|
1616
1603
|
id: r,
|
|
1617
1604
|
field: r,
|
|
@@ -1621,36 +1608,36 @@ function Vt(s) {
|
|
|
1621
1608
|
}
|
|
1622
1609
|
return t;
|
|
1623
1610
|
}
|
|
1624
|
-
function
|
|
1611
|
+
function Ut(s) {
|
|
1625
1612
|
const t = new URLSearchParams();
|
|
1626
1613
|
for (const r of s)
|
|
1627
|
-
if (
|
|
1628
|
-
const
|
|
1629
|
-
t.set(r.field,
|
|
1614
|
+
if (ts.includes(r.field) && r.values[0] !== void 0) {
|
|
1615
|
+
const a = `${r.operator}:${String(r.values[0])}`;
|
|
1616
|
+
t.set(r.field, a);
|
|
1630
1617
|
}
|
|
1631
1618
|
return t;
|
|
1632
1619
|
}
|
|
1633
|
-
function
|
|
1634
|
-
const [s, t] =
|
|
1635
|
-
const d = typeof
|
|
1620
|
+
function Vt() {
|
|
1621
|
+
const [s, t] = G(), r = E(() => At(s), [s]), a = B((l, c = {}) => {
|
|
1622
|
+
const d = typeof l == "function" ? l(r) : l, u = Ut(d), m = c.replace ?? !0;
|
|
1636
1623
|
t(u, { replace: m });
|
|
1637
|
-
}, [r, t]), n =
|
|
1638
|
-
t(new URLSearchParams(), { replace:
|
|
1639
|
-
}, [t]),
|
|
1640
|
-
return { filters: r, nql:
|
|
1624
|
+
}, [r, t]), n = B(({ replace: l = !0 } = {}) => {
|
|
1625
|
+
t(new URLSearchParams(), { replace: l });
|
|
1626
|
+
}, [t]), i = E(() => Ht(r), [r]), o = E(() => r.length === 1 && r[0].field === "id", [r]);
|
|
1627
|
+
return { filters: r, nql: i, setFilters: a, clearFilters: n, isSingleIdFilter: o };
|
|
1641
1628
|
}
|
|
1642
|
-
function
|
|
1643
|
-
return
|
|
1644
|
-
var
|
|
1629
|
+
function qt({ comments: s }) {
|
|
1630
|
+
return E(() => {
|
|
1631
|
+
var a, n, i;
|
|
1645
1632
|
const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
1646
|
-
for (const
|
|
1647
|
-
(
|
|
1648
|
-
id:
|
|
1649
|
-
title:
|
|
1650
|
-
}), (
|
|
1651
|
-
id:
|
|
1652
|
-
name:
|
|
1653
|
-
email:
|
|
1633
|
+
for (const o of s)
|
|
1634
|
+
(a = o.post) != null && a.id && ((n = o.post) != null && n.title) && t.set(o.post.id, {
|
|
1635
|
+
id: o.post.id,
|
|
1636
|
+
title: o.post.title
|
|
1637
|
+
}), (i = o.member) != null && i.id && r.set(o.member.id, {
|
|
1638
|
+
id: o.member.id,
|
|
1639
|
+
name: o.member.name,
|
|
1640
|
+
email: o.member.email
|
|
1654
1641
|
});
|
|
1655
1642
|
return {
|
|
1656
1643
|
knownPosts: Array.from(t.values()),
|
|
@@ -1658,61 +1645,60 @@ function Qt({ comments: s }) {
|
|
|
1658
1645
|
};
|
|
1659
1646
|
}, [s]);
|
|
1660
1647
|
}
|
|
1661
|
-
const
|
|
1662
|
-
var
|
|
1663
|
-
const { filters: s, nql: t, setFilters: r, clearFilters:
|
|
1664
|
-
r((
|
|
1648
|
+
const ar = () => {
|
|
1649
|
+
var g, v;
|
|
1650
|
+
const { filters: s, nql: t, setFilters: r, clearFilters: a, isSingleIdFilter: n } = Vt(), i = B((b, y, C = "is") => {
|
|
1651
|
+
r((k) => [...k.filter((R) => R.field !== b), ds(b, C, [y])], { replace: !1 });
|
|
1665
1652
|
}, [r]), {
|
|
1666
1653
|
data: o,
|
|
1667
|
-
isError:
|
|
1668
|
-
isFetching:
|
|
1669
|
-
isFetchingNextPage:
|
|
1670
|
-
isRefetching:
|
|
1671
|
-
fetchNextPage:
|
|
1672
|
-
hasNextPage:
|
|
1673
|
-
} =
|
|
1654
|
+
isError: l,
|
|
1655
|
+
isFetching: c,
|
|
1656
|
+
isFetchingNextPage: d,
|
|
1657
|
+
isRefetching: u,
|
|
1658
|
+
fetchNextPage: m,
|
|
1659
|
+
hasNextPage: x
|
|
1660
|
+
} = Ge({
|
|
1674
1661
|
searchParams: t ? { filter: t } : {},
|
|
1675
1662
|
keepPreviousData: !0
|
|
1676
|
-
}), { knownPosts:
|
|
1677
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1678
|
-
/* @__PURE__ */ e.jsx(
|
|
1679
|
-
|
|
1663
|
+
}), { knownPosts: p, knownMembers: f } = qt({ comments: (o == null ? void 0 : o.comments) ?? [] }), j = c && !d && !u;
|
|
1664
|
+
return /* @__PURE__ */ e.jsxs(Ct, { children: [
|
|
1665
|
+
/* @__PURE__ */ e.jsx(vt, { children: !n && /* @__PURE__ */ e.jsx(
|
|
1666
|
+
jt,
|
|
1680
1667
|
{
|
|
1681
1668
|
filters: s,
|
|
1682
|
-
knownMembers:
|
|
1683
|
-
knownPosts:
|
|
1669
|
+
knownMembers: f,
|
|
1670
|
+
knownPosts: p,
|
|
1684
1671
|
onFiltersChange: r
|
|
1685
1672
|
}
|
|
1686
1673
|
) }),
|
|
1687
|
-
/* @__PURE__ */ e.jsx(
|
|
1674
|
+
/* @__PURE__ */ e.jsx(dt, { children: j ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx(U, { size: "lg" }) }) : l ? /* @__PURE__ */ e.jsxs("div", { className: "mb-16 flex h-full flex-col items-center justify-center", children: [
|
|
1688
1675
|
/* @__PURE__ */ e.jsx("h2", { className: "mb-2 text-xl font-medium", children: "Error loading comments" }),
|
|
1689
1676
|
/* @__PURE__ */ e.jsx("p", { className: "mb-4 text-muted-foreground", children: "Please reload the page to try again" }),
|
|
1690
|
-
/* @__PURE__ */ e.jsx(
|
|
1677
|
+
/* @__PURE__ */ e.jsx(S, { onClick: () => window.location.reload(), children: "Reload page" })
|
|
1691
1678
|
] }) : o != null && o.comments.length ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1692
1679
|
/* @__PURE__ */ e.jsx(
|
|
1693
|
-
|
|
1680
|
+
Ot,
|
|
1694
1681
|
{
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
isLoading: u && !m,
|
|
1682
|
+
fetchNextPage: m,
|
|
1683
|
+
hasNextPage: x,
|
|
1684
|
+
isFetchingNextPage: d,
|
|
1685
|
+
isLoading: c && !d,
|
|
1700
1686
|
items: (o == null ? void 0 : o.comments) ?? [],
|
|
1701
|
-
totalItems: ((
|
|
1702
|
-
onAddFilter:
|
|
1687
|
+
totalItems: ((v = (g = o == null ? void 0 : o.meta) == null ? void 0 : g.pagination) == null ? void 0 : v.total) ?? 0,
|
|
1688
|
+
onAddFilter: i
|
|
1703
1689
|
}
|
|
1704
1690
|
),
|
|
1705
|
-
n && /* @__PURE__ */ e.jsx("div", { className: "flex justify-center py-8", children: /* @__PURE__ */ e.jsx(
|
|
1691
|
+
n && /* @__PURE__ */ e.jsx("div", { className: "flex justify-center py-8", children: /* @__PURE__ */ e.jsx(S, { variant: "outline", onClick: () => a({ replace: !1 }), children: "Show all comments" }) })
|
|
1706
1692
|
] }) : /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1707
|
-
|
|
1693
|
+
Ie,
|
|
1708
1694
|
{
|
|
1709
1695
|
title: "No comments yet",
|
|
1710
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1696
|
+
children: /* @__PURE__ */ e.jsx(Le, {})
|
|
1711
1697
|
}
|
|
1712
1698
|
) }) })
|
|
1713
1699
|
] });
|
|
1714
1700
|
};
|
|
1715
1701
|
export {
|
|
1716
|
-
|
|
1702
|
+
ar as default
|
|
1717
1703
|
};
|
|
1718
|
-
//# sourceMappingURL=comments-
|
|
1704
|
+
//# sourceMappingURL=comments-C0ntS6jH.mjs.map
|