ghost 6.24.0 → 6.25.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.24.0.tgz → tryghost-i18n-6.25.0.tgz} +0 -0
- package/components/tryghost-parse-email-address-6.25.0.tgz +0 -0
- package/core/boot.js +3 -1
- package/core/built/admin/assets/{PolarAngleAxis-7TlIQL3R.js → PolarAngleAxis-BNo3yZOE.js} +1 -1
- package/core/built/admin/assets/{_baseAssignValue-DJsCJz6y.js → _baseAssignValue-DwWJd_kU.js} +1 -1
- package/core/built/admin/assets/{a-large-small-BnBpzYwl.js → a-large-small-DzN0AB7t.js} +1 -1
- package/core/built/admin/assets/{at-sign-DC4NtDDM.js → at-sign-vqoOA4VZ.js} +1 -1
- package/core/built/admin/assets/{audience-CC5U4UxI.js → audience-CFjVlFTu.js} +1 -1
- package/core/built/admin/assets/{avatar-flipboard-_GQfQXQc.js → avatar-flipboard-DuTJ0ty5.js} +1 -1
- package/core/built/admin/assets/{bluesky-sharing-BKyzPl9y.js → bluesky-sharing-C1WkXrRJ.js} +1 -1
- package/core/built/admin/assets/{chart-BCQFlmhJ.js → chart-Bs2L1q8g.js} +1 -1
- package/core/built/admin/assets/{chunk.423.dae9a3bbe7845c3a3cfc.js → chunk.434.de8a15730373eccfeefe.js} +13 -101
- package/core/built/admin/assets/{chunk.524.b5e454aa74df4428420c.js → chunk.524.ed5714f505e821e549f3.js} +5 -5
- package/core/built/admin/assets/{chunk.582.20635869be68725e6d5c.js → chunk.582.639cecaca9e77bd7dd4f.js} +7 -7
- package/core/built/admin/assets/{chunk.123.1255d9e815f933dfdc57.js → chunk.603.5cb992da88800a9388f3.js} +8 -6
- package/core/built/admin/assets/{code-editor-view-BXnjo7qe.js → code-editor-view-DIH4grxv.js} +1 -1
- package/core/built/admin/assets/comments-gAnA10dK.js +1 -0
- package/core/built/admin/assets/{content-helpers-CQXipRWa.js → content-helpers-Cr_DHEOl.js} +1 -1
- package/core/built/admin/assets/{copy-B-MxRWPu.js → copy-w3c9zkaZ.js} +1 -1
- package/core/built/admin/assets/{data-list-B2sqn7IE.js → data-list-D-K_XfF3.js} +1 -1
- package/core/built/admin/assets/{deleted-feed-item-DQi676Dy.js → deleted-feed-item-DK47iaMV.js} +1 -1
- package/core/built/admin/assets/{dropzone-GgOCfK2j.js → dropzone-BHWXAN0m.js} +3 -3
- package/core/built/admin/assets/{edit-profile-COx5FmF9.js → edit-profile-DCyHhZgx.js} +1 -1
- package/core/built/admin/assets/{empty-indicator-Bf4Dqk72.js → empty-indicator-DjmACVr2.js} +1 -1
- package/core/built/admin/assets/{en-BkI47Ou-.js → en-Cl0b7CNW.js} +1 -1
- package/core/built/admin/assets/{feed-Dzc-8jwd.js → feed-C5AauoXf.js} +1 -1
- package/core/built/admin/assets/filters-DzSJ1ez3.js +1 -0
- package/core/built/admin/assets/{gh-chart-Ch6dYUac.js → gh-chart-xjwu2HZo.js} +1 -1
- package/core/built/admin/assets/{ghost-69e448feab2cb78aba64f7177fa4d6f0.js → ghost-78b4a517ac907213ab47708eef33bc6f.js} +423 -542
- package/core/built/admin/assets/{growth-BIBJdcm6.js → growth-DDyypj0q.js} +1 -1
- package/core/built/admin/assets/{hash-BGd7HEsT.js → hash-Bowe71Lt.js} +1 -1
- package/core/built/admin/assets/{inbox-CFzKvW3h.js → inbox-DS4qMjUb.js} +1 -1
- package/core/built/admin/assets/{index-DDJAHYHQ.js → index-4xuWCs9h.js} +1 -1
- package/core/built/admin/assets/{index-DIO8ceib.js → index-6Ag8SK_E.js} +1 -1
- package/core/built/admin/assets/{index-Dy8dCc8t.js → index-A6WmqYr6.js} +4 -4
- package/core/built/admin/assets/index-B8XuCPIT.js +1 -0
- package/core/built/admin/assets/{index-S2DGJkmz.js → index-BCvRITTU.js} +2 -2
- package/core/built/admin/assets/{index-BZyG96u1.js → index-B_XhekWb.js} +1 -1
- package/core/built/admin/assets/{index-D0gRP4Gp.js → index-C8ssgmjI.js} +1 -1
- package/core/built/admin/assets/{index-DM98UB_U.js → index-CFY2MOp4.js} +1 -1
- package/core/built/admin/assets/{index-CvX5YYEz.js → index-CVvW6Q-y.js} +1 -1
- package/core/built/admin/assets/{index-DpZazR71.js → index-CZK1A375.js} +1 -1
- package/core/built/admin/assets/{index-BYXKsmpv.js → index-CfpTfwls.js} +1 -1
- package/core/built/admin/assets/index-Chp0ODAU.css +1 -0
- package/core/built/admin/assets/{index-7NTHsKgE.js → index-DX6vaEVx.js} +1 -1
- package/core/built/admin/assets/{index-CsHjDdYB.js → index-DqlHFtZD.js} +1 -1
- package/core/built/admin/assets/{index-ZuWSQ3L6.js → index-JMWMnGGt.js} +93 -93
- package/core/built/admin/assets/{index-_WMp37yL.js → index-N61Xkr32.js} +1 -1
- package/core/built/admin/assets/{index-n5opb8tL.js → index-SDMWxO5r.js} +1 -1
- package/core/built/admin/assets/{koenig-lexical-8qAZ5o1x.js → koenig-lexical-DL3I-AcK.js} +1 -1
- package/core/built/admin/assets/{kpis-Cv75oSPY.js → kpis-Bm-hIEkf.js} +1 -1
- package/core/built/admin/assets/{label-CofMdj8x.js → label-DBwnwMrX.js} +1 -1
- package/core/built/admin/assets/{links-MSlYSad1.js → links-CnjcW0lg.js} +1 -1
- package/core/built/admin/assets/{loader-circle-CF5G2g_Z.js → loader-circle-CGDGFypO.js} +1 -1
- package/core/built/admin/assets/{lucide-react-DZiAu6PQ.js → lucide-react-BfVLf4Hw.js} +1 -1
- package/core/built/admin/assets/{main-layout-DEVUkqt_.js → main-layout-C_UH037j.js} +1 -1
- package/core/built/admin/assets/{member-route-mLKS-PsA.js → member-route-CKuE9uDU.js} +1 -1
- package/core/built/admin/assets/members-CzztojNk.js +15 -0
- package/core/built/admin/assets/{message-square-text-DESy3kSk.js → message-square-text-BDJyLbG2.js} +1 -1
- package/core/built/admin/assets/{minus-DVNwSjD6.js → minus-BM0xhFIQ.js} +1 -1
- package/core/built/admin/assets/{modals-FYjLOMaQ.js → modals-B6ZySU0x.js} +13 -13
- package/core/built/admin/assets/{moderation-u4WS46a-.js → moderation-CQMIGpv1.js} +1 -1
- package/core/built/admin/assets/{newsletter-Cj0UCg4J.js → newsletter-Dexg7vU8.js} +1 -1
- package/core/built/admin/assets/{newsletters-_UvhdBE3.js → newsletters-CT4k07rm.js} +1 -1
- package/core/built/admin/assets/{note-CRnFryTp.js → note-CiemurXq.js} +1 -1
- package/core/built/admin/assets/{overview-Cr0dGxEU.js → overview-9TwqfzGq.js} +1 -1
- package/core/built/admin/assets/{pagemenu-BqoDENpI.js → pagemenu-Dq744OgH.js} +1 -1
- package/core/built/admin/assets/{post-analytics-DIr_rDtL.js → post-analytics-CcRhLDKA.js} +1 -1
- package/core/built/admin/assets/{post-analytics-context-WA--pwK5.js → post-analytics-context-COgn3d86.js} +1 -1
- package/core/built/admin/assets/{post-analytics-header-D97SoEaV.js → post-analytics-header-DtBp2QSX.js} +1 -1
- package/core/built/admin/assets/{post-share-modal-DBxR7WCX.js → post-share-modal-BlOEKX3-.js} +1 -1
- package/core/built/admin/assets/posts/comments-C4rwkXWy.mjs +1473 -0
- package/core/built/admin/assets/posts/{dialog-67vvNv8e.mjs → dialog-Chkt119L.mjs} +3 -3
- package/core/built/admin/assets/posts/{dropdown-menu-BKZfsAPJ.mjs → dropdown-menu-CvSs_ay2.mjs} +5 -5
- package/core/built/admin/assets/posts/{empty-indicator-DTmBQa_3.mjs → empty-indicator-GyeO28CG.mjs} +2 -2
- package/core/built/admin/assets/posts/filters-BD3A2GlB.mjs +2831 -0
- package/core/built/admin/assets/posts/{get-site-timezone-D75cHSJ1.mjs → get-site-timezone-Baeue4hE.mjs} +2 -2
- package/core/built/admin/assets/posts/{growth-BqJWjpAp.mjs → growth-kmVbKjBt.mjs} +14 -14
- package/core/built/admin/assets/posts/{heading-DXxLDQ96.mjs → heading-DV_WQJh4.mjs} +2 -2
- package/core/built/admin/assets/posts/{hooks-pVotzebr.mjs → hooks-DQhsid0U.mjs} +2 -2
- package/core/built/admin/assets/posts/{index-By5yPnMZ.mjs → index-Bl1ReYmV.mjs} +10 -10
- package/core/built/admin/assets/posts/{index-DZ1HzbGS.mjs → index-CVum5OE6.mjs} +3 -3
- package/core/built/admin/assets/posts/{input-DdXe2Fjm.mjs → input-C7qFEkmt.mjs} +2 -2
- package/core/built/admin/assets/posts/{kpis-1MXZeSC9.mjs → kpis-DteuJY-D.mjs} +10 -10
- package/core/built/admin/assets/posts/{links-DGzzdzsH.mjs → links-eoZr0T0x.mjs} +4 -4
- package/core/built/admin/assets/posts/{loading-indicator-CSj2spwS.mjs → loading-indicator-Dj1SCL40.mjs} +3 -3
- package/core/built/admin/assets/posts/{main-layout-CGs25JVH.mjs → main-layout-Ct-TA0TH.mjs} +2 -2
- package/core/built/admin/assets/posts/{members-BRcED5fL.mjs → members-BY9oPKo4.mjs} +3814 -3378
- package/core/built/admin/assets/posts/{newsletter-D706LlgM.mjs → newsletter-BR1tln6E.mjs} +15 -15
- package/core/built/admin/assets/posts/{overview-5dG5ypjx.mjs → overview-j1ANMAQ2.mjs} +16 -16
- package/core/built/admin/assets/posts/{post-analytics-wvNuOa4c.mjs → post-analytics-DnG-Rolr.mjs} +6 -6
- package/core/built/admin/assets/posts/{post-analytics-context-BqnFe05q.mjs → post-analytics-context-hiKFF4yE.mjs} +5 -5
- package/core/built/admin/assets/posts/{post-analytics-header-Dsi5l6hb.mjs → post-analytics-header-OqAJ8SUL.mjs} +11 -11
- package/core/built/admin/assets/posts/{post-share-modal-DWe35McY.mjs → post-share-modal-BWfujDu2.mjs} +4 -4
- package/core/built/admin/assets/posts/posts-CS9tqSJC.mjs +37 -0
- package/core/built/admin/assets/posts/posts.js +1 -1
- package/core/built/admin/assets/posts/{reply-B4vwBMwj.mjs → reply-CX_EQh9X.mjs} +2 -2
- package/core/built/admin/assets/posts/{search-DQuB1WMm.mjs → search-BqzdnPQb.mjs} +2 -2
- package/core/built/admin/assets/posts/{select-BMPHyOdQ.mjs → select-CD5WLIrZ.mjs} +8 -8
- package/core/built/admin/assets/posts/{separator-DgZ2VF9r.mjs → separator-DFPLsWCc.mjs} +3 -3
- package/core/built/admin/assets/posts/{settings-D-wnf7Qg.mjs → settings-lnEt3Kb-.mjs} +2 -2
- package/core/built/admin/assets/posts/{sheet-SOdCzxUt.mjs → sheet-CkLfUqdH.mjs} +3 -3
- package/core/built/admin/assets/posts/{skeleton-Du7JXZ_1.mjs → skeleton-BZCi-IYy.mjs} +3 -3
- package/core/built/admin/assets/posts/{source-icon-DcBtKbCl.mjs → source-icon-C0k2hDC_.mjs} +3 -3
- package/core/built/admin/assets/posts/{stats-CeLav-Hu.mjs → stats-AHbSTqzG.mjs} +4 -4
- package/core/built/admin/assets/posts/{table-DlaJMBps.mjs → table-DMrf6wp5.mjs} +2 -2
- package/core/built/admin/assets/posts/{tabs-BQQbtw2g.mjs → tabs-BH8GNJCe.mjs} +14 -14
- package/core/built/admin/assets/posts/tags-C5VV8Gd0.mjs +398 -0
- package/core/built/admin/assets/posts/{tags-CLyaNf39.mjs → tags-DucujdYI.mjs} +2 -2
- package/core/built/admin/assets/posts/use-scroll-restoration-C7A3TpAz.mjs +517 -0
- package/core/built/admin/assets/posts/{use-infinite-virtual-scroll-B_NwiBXK.mjs → virtual-list-window-BIGoc0th.mjs} +322 -244
- package/core/built/admin/assets/posts/{web-TEVKbXSI.mjs → web-DczNailO.mjs} +18 -18
- package/core/built/admin/assets/posts-Dr3u9yOp.js +1 -0
- package/core/built/admin/assets/{referrers-J4vexZCf.js → referrers-6As_USul.js} +1 -1
- package/core/built/admin/assets/{repeat-BxOK9zhN.js → repeat-D-Ki-Cg5.js} +1 -1
- package/core/built/admin/assets/{reply-BoTN-eE0.js → reply-C4V0xZ2U.js} +1 -1
- package/core/built/admin/assets/{select-Bd1zcqox.js → select-Dt579MbD.js} +1 -1
- package/core/built/admin/assets/{settings-D72z6T_a.js → settings-BMsoTszq.js} +1 -1
- package/core/built/admin/assets/{settings-BGbGoa4s.js → settings-Ck1Hqs1x.js} +19 -19
- package/core/built/admin/assets/{sort-button-BOLTpImz.js → sort-button-Bn325H3y.js} +1 -1
- package/core/built/admin/assets/{source-icon-BqEM5MvU.js → source-icon-CNqsYZeA.js} +1 -1
- package/core/built/admin/assets/{sprout-Bf-wc2Vo.js → sprout-C9DbfYGe.js} +1 -1
- package/core/built/admin/assets/{square-Cj_bJ0HZ.js → square-CWrI0H4v.js} +1 -1
- package/core/built/admin/assets/stats/{audience-BiHYBUzT.mjs → audience-DBW5Xu1c.mjs} +3 -3
- package/core/built/admin/assets/stats/{content-helpers-CIXZiyCm.mjs → content-helpers-BR6DcWwH.mjs} +4 -4
- package/core/built/admin/assets/stats/{index-DBB8Oih1.mjs → index-BuS4r1cs.mjs} +5 -5
- package/core/built/admin/assets/stats/{index-CkKk-p14.mjs → index-CFvGHbAV.mjs} +8 -8
- package/core/built/admin/assets/stats/{index-9zQR4gr0.mjs → index-DKS4mzS-.mjs} +3621 -3512
- package/core/built/admin/assets/stats/{index-DMSmQLxG.mjs → index-TeAxlGlY.mjs} +5 -5
- package/core/built/admin/assets/stats/{index-DErXBfDM.mjs → index-ZjicrvMA.mjs} +5 -5
- package/core/built/admin/assets/stats/{sort-button-BqY7GFaO.mjs → sort-button-DbwzvVKL.mjs} +3 -3
- package/core/built/admin/assets/stats/{stats-BeJgKX2G.mjs → stats-BatzfgdA.mjs} +4 -4
- package/core/built/admin/assets/stats/stats.js +1 -1
- package/core/built/admin/assets/stats/{tabs-CPz357mW.mjs → tabs-B32ptD5t.mjs} +3 -3
- package/core/built/admin/assets/stats/{use-growth-stats-WMYXBQE3.mjs → use-growth-stats-DmTT2gKd.mjs} +3 -3
- package/core/built/admin/assets/{stats-DWpHtRym.js → stats-G4Ge9ETb.js} +1 -1
- package/core/built/admin/assets/stats-view-Bx3oDAIW.js +1 -0
- package/core/built/admin/assets/{step-1-Bjya9Gt0.js → step-1-y3anLU0g.js} +1 -1
- package/core/built/admin/assets/{step-2-CJ6I8JNc.js → step-2-Dr1lGnHU.js} +1 -1
- package/core/built/admin/assets/{step-3-3fs6Y2Kj.js → step-3-C_d2hvMs.js} +2 -2
- package/core/built/admin/assets/{table-B4zlzEDP.js → table-CbN_vbUx.js} +1 -1
- package/core/built/admin/assets/{tabs-mR5oJGm5.js → tabs-DFJzY5np.js} +1 -1
- package/core/built/admin/assets/tags-D5g9tXZU.js +1 -0
- package/core/built/admin/assets/{tags-CsgMtkFL.js → tags-Ddg8oG2Y.js} +1 -1
- package/core/built/admin/assets/{textarea-CQjEvapR.js → textarea-DikWsYMt.js} +1 -1
- package/core/built/admin/assets/{tiers-CQE0v797.js → tiers-B7qV_8mO.js} +1 -1
- package/core/built/admin/assets/{toggle-group-CR-Z-bJL.js → toggle-group-tXaaTD7P.js} +1 -1
- package/core/built/admin/assets/{topic-filter-_NyD55eH.js → topic-filter-bQtscKE6.js} +1 -1
- package/core/built/admin/assets/{trash-BFSLkv0z.js → trash--VS50LgS.js} +1 -1
- package/core/built/admin/assets/{upload-BTxT4v2z.js → upload-Dz-DI9rQ.js} +1 -1
- package/core/built/admin/assets/{use-growth-stats-BGymNu5O.js → use-growth-stats-DNVioFUq.js} +1 -1
- package/core/built/admin/assets/use-scroll-restoration-CxWEiCuS.js +1 -0
- package/core/built/admin/assets/{use-simple-pagination-Cq7Afp_c.js → use-simple-pagination-BA6xsVQO.js} +1 -1
- package/core/built/admin/assets/{user-plus-DMl69yKl.js → user-plus-B0tpOnLM.js} +1 -1
- package/core/built/admin/assets/{user-round-check-CVuZXUPz.js → user-round-check-caJYm0bB.js} +1 -1
- package/core/built/admin/assets/virtual-list-window-JdKgHS9L.js +4 -0
- package/core/built/admin/assets/{wallet-cards-zHR_y6Sp.js → wallet-cards-DBM65lA_.js} +1 -1
- package/core/built/admin/assets/{web-CmFHgeQw.js → web-CSXixG1S.js} +1 -1
- package/core/built/admin/index.html +7 -7
- package/core/frontend/helpers/ghost_head.js +1 -4
- package/core/server/data/migrations/versions/6.25/2026-03-26-15-47-00-insert-default-email-design-settings-row.js +42 -0
- package/core/server/data/migrations/versions/6.25/2026-03-30-20-22-25-add-email-design-setting-permissions.js +44 -0
- package/core/server/data/migrations/versions/6.25/2026-03-30-22-16-43-add-email-design-setting-id-to-automated-emails.js +8 -0
- package/core/server/data/migrations/versions/6.25/2026-03-31-13-12-10-backfill-automated-emails-email-design-setting-id.js +45 -0
- package/core/server/data/migrations/versions/6.25/2026-03-31-20-31-19-drop-nullable-on-automated-emails-email-design-setting-id.js +3 -0
- package/core/server/data/schema/fixtures/fixtures.json +35 -0
- package/core/server/data/schema/schema.js +1 -0
- package/core/server/data/seeders/importers/comment-reports-importer.js +1 -3
- package/core/server/data/seeders/importers/comments-importer.js +3 -2
- package/core/server/data/seeders/importers/email-batches-importer.js +3 -3
- package/core/server/data/seeders/importers/email-recipients-importer.js +6 -6
- package/core/server/data/seeders/importers/emails-importer.js +4 -3
- package/core/server/data/seeders/importers/members-click-events-importer.js +1 -1
- package/core/server/data/seeders/importers/members-created-events-importer.js +2 -1
- package/core/server/data/seeders/importers/members-feedback-importer.js +3 -4
- package/core/server/data/seeders/importers/members-login-events-importer.js +3 -2
- package/core/server/data/seeders/importers/members-status-events-importer.js +1 -2
- package/core/server/data/seeders/importers/members-stripe-customers-importer.js +2 -1
- package/core/server/data/seeders/importers/members-stripe-customers-subscriptions-importer.js +4 -2
- package/core/server/data/seeders/importers/members-subscribe-events-importer.js +1 -2
- package/core/server/data/seeders/importers/members-subscription-created-events-importer.js +3 -1
- package/core/server/data/seeders/importers/offer-redemptions-importer.js +3 -3
- package/core/server/data/seeders/utils/database-date.js +26 -1
- package/core/server/models/automated-email.js +27 -0
- package/core/server/models/email-design-setting.js +27 -0
- package/core/server/services/stripe/service.js +1 -2
- package/core/server/services/webhooks/webhook-trigger.js +1 -1
- package/package.json +10 -28
- package/tsconfig.tsbuildinfo +1 -1
- package/yarn.lock +423 -107
- package/components/tryghost-parse-email-address-6.24.0.tgz +0 -0
- package/core/built/admin/assets/comments-CteqV7ZN.js +0 -1
- package/core/built/admin/assets/filters-DXXaCya7.js +0 -1
- package/core/built/admin/assets/index-QB-va_sk.css +0 -1
- package/core/built/admin/assets/index-nBUk6L1X.js +0 -1
- package/core/built/admin/assets/members-DcElgZ2t.js +0 -15
- package/core/built/admin/assets/posts/comments-Bswx2dzs.mjs +0 -1551
- package/core/built/admin/assets/posts/filters-Ds_ZaYIU.mjs +0 -2722
- package/core/built/admin/assets/posts/posts-DI5YQFp4.mjs +0 -17
- package/core/built/admin/assets/posts/tags-CjwolIiT.mjs +0 -395
- package/core/built/admin/assets/posts/use-scroll-restoration-YSR5jwQl.mjs +0 -232
- package/core/built/admin/assets/posts-CJHEP4C-.js +0 -1
- package/core/built/admin/assets/stats-view-CcyaLPwj.js +0 -1
- package/core/built/admin/assets/tags-DEFC6GpD.js +0 -1
- package/core/built/admin/assets/use-infinite-virtual-scroll-CNqGwgHd.js +0 -4
- package/core/built/admin/assets/use-scroll-restoration-BWtb0NrS.js +0 -1
- /package/core/built/admin/assets/{chunk.423.dae9a3bbe7845c3a3cfc.js.LICENSE.txt → chunk.434.de8a15730373eccfeefe.js.LICENSE.txt} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{dt as Sr,du as Nt}from"./index-JMWMnGGt.js";import{_ as wr}from"./dropzone-BHWXAN0m.js";function Jt(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ye={},pe={exports:{}};const Zt={},Yt=Object.freeze(Object.defineProperty({__proto__:null,default:Zt},Symbol.toStringTag,{value:"Module"})),Tr=Sr(Yt);var Ir;function Kt(){return Ir||(Ir=1,(function(e,r){var o=(function(){var i=function(L,h,S,w){for(S=S||{},w=L.length;w--;S[L[w]]=h);return S},y=[1,5],p=[1,7],g=[1,8],u=[1,6,10],c=[1,9],d=[1,6,8,10],m=[1,24],v=[1,25],A=[1,26],C=[1,27],M=[1,28],F=[1,29],I=[1,30],k=[1,17],B=[1,18],_=[1,19],N=[21,22,23,24,25,29,30],H=[1,6,8,10,18],J=[1,47],G=[6,18],Z={trace:function(){},yy:{},symbols_:{error:2,expressions:3,expression:4,andCondition:5,OR:6,filterExpr:7,AND:8,LPAREN:9,RPAREN:10,propExpr:11,valueExpr:12,PROP:13,NOT:14,REGEXPOP:15,LBRACKET:16,inExpr:17,RBRACKET:18,OP:19,VALUE:20,NULL:21,TRUE:22,FALSE:23,NUMBER:24,NOW:25,DATEOP:26,AMOUNT:27,INTERVAL:28,LITERAL:29,STRING:30,ADD:31,SUB:32,CONTAINS:33,STARTSWITH:34,ENDSWITH:35,GT:36,LT:37,GTE:38,LTE:39,$accept:0,$end:1},terminals_:{2:"error",6:"OR",8:"AND",9:"LPAREN",10:"RPAREN",13:"PROP",14:"NOT",16:"LBRACKET",18:"RBRACKET",21:"NULL",22:"TRUE",23:"FALSE",24:"NUMBER",25:"NOW",27:"AMOUNT",28:"INTERVAL",29:"LITERAL",30:"STRING",31:"ADD",32:"SUB",33:"CONTAINS",34:"STARTSWITH",35:"ENDSWITH",36:"GT",37:"LT",38:"GTE",39:"LTE"},productions_:[0,[3,1],[4,1],[4,3],[5,1],[5,3],[7,3],[7,2],[11,1],[12,2],[12,1],[12,4],[12,3],[12,2],[12,1],[17,3],[17,1],[20,1],[20,1],[20,1],[20,1],[20,4],[20,1],[20,1],[26,1],[26,1],[15,2],[15,2],[15,2],[19,1],[19,1],[19,1],[19,1],[19,1]],performAction:function(h,S,w,P,E,f,K,W){var l=f.length-1;switch(E){case 1:return P.debug("expression",f[l]),P.debug("opt",W),f[l]&&f[l].yg?f[l].yg:f[l];case 2:P.debug("andCondition",f[l]),this.$=f[l];break;case 3:P.debug("expression OR andCondition",f[l-2],f[l]),f[l-2]=f[l-2].$or?f[l-2]:{$or:[P.ungroup(f[l-2])]},f[l-2].$or.push(P.ungroup(f[l])),this.$=f[l-2];break;case 4:P.debug("filterExpr",f[l]),this.$=f[l];break;case 5:P.debug("andCondition AND filterExpr",f[l-2],f[l]),f[l-2]=f[l-2].$and?f[l-2]:{$and:[P.ungroup(f[l-2])]},f[l-2].$and.push(P.ungroup(f[l])),this.$=f[l-2];break;case 6:P.debug("LPAREN expression RPAREN",f[l-1]),this.$={yg:f[l-1]};break;case 7:this.$={[f[l-1]]:f[l]};break;case 8:f[l]=f[l].replace(/:$/,""),f[l]=W.aliases&&W.aliases[f[l]]?W.aliases[f[l]]:f[l],this.$=f[l];break;case 9:this.$={$not:f[l]};break;case 10:this.$={$regex:f[l]};break;case 11:this.$={$nin:f[l-1]};break;case 12:this.$={$in:f[l-1]};break;case 13:this.$={},this.$[f[l-1]]=f[l];break;case 14:this.$=f[l];break;case 15:this.$.push(f[l]);break;case 16:this.$=[f[l]];break;case 17:this.$=null;break;case 18:this.$=!0;break;case 19:this.$=!1;break;case 20:this.$=parseInt(h);break;case 21:this.$=P.relDateToAbsolute(f[l-2],f[l-1],f[l]);break;case 22:this.$=P.unescape(f[l]);break;case 23:f[l]=f[l].replace(/^'|'$/g,""),this.$=P.unescape(f[l]);break;case 24:this.$="add";break;case 25:this.$="sub";break;case 26:f[l]=f[l].replace(/^'|'$/g,""),f[l]=P.unescape(f[l]),this.$=P.stringToRegExp(f[l]);break;case 27:f[l]=f[l].replace(/^'|'$/g,""),f[l]=P.unescape(f[l]),this.$=P.stringToRegExp(f[l],"^");break;case 28:f[l]=f[l].replace(/^'|'$/g,""),f[l]=P.unescape(f[l]),this.$=P.stringToRegExp(f[l],"$");break;case 29:this.$="$ne";break;case 30:this.$="$gt";break;case 31:this.$="$lt";break;case 32:this.$="$gte";break;case 33:this.$="$lte";break}},table:[{3:1,4:2,5:3,7:4,9:y,11:6,13:p},{1:[3]},{1:[2,1],6:g},i(u,[2,2],{8:c}),i(d,[2,4]),{4:10,5:3,7:4,9:y,11:6,13:p},{12:11,14:[1,12],15:13,16:[1,14],19:15,20:16,21:m,22:v,23:A,24:C,25:M,29:F,30:I,33:k,34:B,35:_,36:[1,20],37:[1,21],38:[1,22],39:[1,23]},i([14,16,21,22,23,24,25,29,30,33,34,35,36,37,38,39],[2,8]),{5:31,7:4,9:y,11:6,13:p},{7:32,9:y,11:6,13:p},{6:g,10:[1,33]},i(d,[2,7]),i(N,[2,29],{15:34,16:[1,35],33:k,34:B,35:_}),i(d,[2,10]),{17:36,20:37,21:m,22:v,23:A,24:C,25:M,29:F,30:I},{20:38,21:m,22:v,23:A,24:C,25:M,29:F,30:I},i(d,[2,14]),{30:[1,39]},{30:[1,40]},{30:[1,41]},i(N,[2,30]),i(N,[2,31]),i(N,[2,32]),i(N,[2,33]),i(H,[2,17]),i(H,[2,18]),i(H,[2,19]),i(H,[2,20]),{26:42,31:[1,43],32:[1,44]},i(H,[2,22]),i(H,[2,23]),i(u,[2,3],{8:c}),i(d,[2,5]),i(d,[2,6]),i(d,[2,9]),{17:45,20:37,21:m,22:v,23:A,24:C,25:M,29:F,30:I},{6:J,18:[1,46]},i(G,[2,16]),i(d,[2,13]),i(d,[2,26]),i(d,[2,27]),i(d,[2,28]),{27:[1,48]},{27:[2,24]},{27:[2,25]},{6:J,18:[1,49]},i(d,[2,12]),{20:50,21:m,22:v,23:A,24:C,25:M,29:F,30:I},{28:[1,51]},i(d,[2,11]),i(G,[2,15]),i(H,[2,21])],defaultActions:{43:[2,24],44:[2,25]},parseError:function(h,S){if(S.recoverable)this.trace(h);else{var w=new Error(h);throw w.hash=S,w}},parse:function(h){var S=this,w=[0],P=[null],E=[],f=this.table,K="",W=0,l=0,ie=2,X=1,t=E.slice.call(arguments,1),n=Object.create(this.lexer),s={yy:{}};for(var T in this.yy)Object.prototype.hasOwnProperty.call(this.yy,T)&&(s.yy[T]=this.yy[T]);n.setInput(h,s.yy),s.yy.lexer=n,s.yy.parser=this,typeof n.yylloc>"u"&&(n.yylloc={});var q=n.yylloc;E.push(q);var D=n.options&&n.options.ranges;typeof s.yy.parseError=="function"?this.parseError=s.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var R=function(){var Q;return Q=n.lex()||X,typeof Q!="number"&&(Q=S.symbols_[Q]||Q),Q},b,O,j,x,V={},$,U,ne,re;;){if(O=w[w.length-1],this.defaultActions[O]?j=this.defaultActions[O]:((b===null||typeof b>"u")&&(b=R()),j=f[O]&&f[O][b]),typeof j>"u"||!j.length||!j[0]){var a="";re=[];for($ in f[O])this.terminals_[$]&&$>ie&&re.push("'"+this.terminals_[$]+"'");n.showPosition?a="Parse error on line "+(W+1)+`:
|
|
2
2
|
`+n.showPosition()+`
|
|
3
3
|
Expecting `+re.join(", ")+", got '"+(this.terminals_[b]||b)+"'":a="Parse error on line "+(W+1)+": Unexpected "+(b==X?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(a,{text:n.match,token:this.terminals_[b]||b,line:n.yylineno,loc:q,expected:re})}if(j[0]instanceof Array&&j.length>1)throw new Error("Parse Error: multiple actions possible at state: "+O+", token: "+b);switch(j[0]){case 1:w.push(b),P.push(n.yytext),E.push(n.yylloc),w.push(j[1]),b=null,l=n.yyleng,K=n.yytext,W=n.yylineno,q=n.yylloc;break;case 2:if(U=this.productions_[j[1]][1],V.$=P[P.length-U],V._$={first_line:E[E.length-(U||1)].first_line,last_line:E[E.length-1].last_line,first_column:E[E.length-(U||1)].first_column,last_column:E[E.length-1].last_column},D&&(V._$.range=[E[E.length-(U||1)].range[0],E[E.length-1].range[1]]),x=this.performAction.apply(V,[K,l,W,s.yy,j[1],P,E].concat(t)),typeof x<"u")return x;U&&(w=w.slice(0,-1*U*2),P=P.slice(0,-1*U),E=E.slice(0,-1*U)),w.push(this.productions_[j[1]][0]),P.push(V.$),E.push(V._$),ne=f[w[w.length-2]][w[w.length-1]],w.push(ne);break;case 3:return!0}}return!0}};Z.parseError=function(L,h){var S=L.split(`
|
|
4
4
|
`);throw S[0]="Query Error: unexpected character in filter at char "+(h.loc.first_column+1),new Error(S.join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as q,r as u,b as $,j as e,R as H,T as L,c8 as Ne,g as Ce,t as Ue,P as Me,V as Be,A as ae,B as j,m as ie,h as Pe,e as X,bG as De,F as ce,aZ as de,a1 as ue,cK as Te,a2 as me,a3 as Q,a4 as Y,a5 as G,H as K,aL as Fe,a$ as Oe,a6 as W,a7 as xe,W as U,cw as Re,cx as Ie,cz as Ee,cL as ne,a8 as Se,a9 as Ae,u as fe,aM as $e,a as He,K as Le,M as ze,N as Ve,O as _e,L as te,E as Qe,c as Ye,S as R,b6 as Ge,D as Ke,q as We,v as qe,w as Xe,x as Ze,Q as Je,a0 as es,cM as ss,s as re,o as ls,n as ns,cG as V,U as ts,bC as rs,bD as os,cN as as,cO as he,cP as is}from"./index-ZuWSQ3L6.js";import{P as cs}from"./tags-CsgMtkFL.js";import{E as ds}from"./edit-profile-COx5FmF9.js";import{T as us,a as ms,b as S,f as _,c as A}from"./tabs-mR5oJGm5.js";import{a as xs}from"./settings-D72z6T_a.js";import{U as fs}from"./lucide-react-DZiAu6PQ.js";import{C as hs}from"./copy-B-MxRWPu.js";import"./label-CofMdj8x.js";import"./textarea-CQjEvapR.js";import"./at-sign-DC4NtDDM.js";import"./wallet-cards-zHR_y6Sp.js";import"./a-large-small-BnBpzYwl.js";import"./upload-BTxT4v2z.js";import"./loader-circle-CF5G2g_Z.js";import"./message-square-text-DESy3kSk.js";import"./hash-BGd7HEsT.js";import"./inbox-CFzKvW3h.js";import"./user-plus-DMl69yKl.js";import"./minus-DVNwSjD6.js";import"./square-Cj_bJ0HZ.js";import"./user-round-check-CVuZXUPz.js";import"./repeat-BxOK9zhN.js";import"./reply-BoTN-eE0.js";import"./sprout-Bf-wc2Vo.js";import"./trash-BFSLkv0z.js";function ps(s){return typeof s.name=="string"?s.name:typeof s.preferredUsername=="string"?s.preferredUsername:typeof s.preferredUsername=="object"&&s.preferredUsername!==null&&"@value"in s.preferredUsername&&typeof s.preferredUsername["@value"]=="string"?s.preferredUsername["@value"]:"Unknown"}const pe=({noResultsMessage:s,actors:o,isLoading:n,fetchNextPage:c,hasNextPage:x,isFetchingNextPage:d})=>{const i=q("index","me"),{data:r}=i,t=u.useRef(null),a=u.useRef(null);u.useEffect(()=>(t.current&&t.current.disconnect(),t.current=new IntersectionObserver(l=>{l[0].isIntersecting&&x&&!d&&c()}),a.current&&t.current.observe(a.current),()=>{t.current&&t.current.disconnect()}),[x,d,c]);const m=$();return e.jsxs("div",{className:"pt-3","data-testid":"actor-list",children:[x===!1&&o.length===0?e.jsxs(H,{children:[e.jsx(L,{children:e.jsx(Ne,{})}),s]}):e.jsx("div",{className:"flex flex-col",children:o.map(({actor:l,isFollowing:h,blockedByMe:b,domainBlockedByMe:k})=>{const w=l.handle||Ce(l),y=w===r?.handle;return e.jsx(Ue.Fragment,{children:e.jsx(Me,{actor:l,align:"center",isCurrentUser:y,side:"left",children:e.jsx("div",{children:e.jsxs(Be,{"data-testid":"actor-item",onClick:()=>{Pe(l,m)},children:[e.jsx(ae,{author:l}),e.jsx("div",{children:e.jsxs("div",{className:"break-anywhere text-gray-600",children:[e.jsx("span",{className:"mr-1 line-clamp-1 font-bold text-black dark:text-white",children:ps(l)}),e.jsx("div",{className:"line-clamp-1 text-sm",children:w})]})}),b||k?e.jsx(j,{className:"pointer-events-none ml-auto min-w-[90px]",variant:"destructive",children:"Blocked"}):y?null:e.jsx(ie,{className:"ml-auto","data-testid":"follow-button",following:h,handle:w,type:"secondary"})]},l.id)})})},l.id)})}),e.jsx("div",{ref:a,className:"h-1"}),(d||n)&&e.jsx("div",{className:"mt-6 flex flex-col items-center justify-center gap-4 text-center",children:e.jsx(X,{size:"md"})})]})},js=({posts:s,fetchNextPage:o,hasNextPage:n,isFetchingNextPage:c,isLoading:x})=>{const d=u.useRef(null),i=u.useRef(null),r=u.useRef(null),t=Math.max(0,Math.floor(s.length*.75)-1);u.useEffect(()=>(d.current&&d.current.disconnect(),d.current=new IntersectionObserver(m=>{m[0].isIntersecting&&n&&!c&&o()}),i.current&&d.current.observe(i.current),r.current&&d.current.observe(r.current),()=>{d.current&&d.current.disconnect()}),[n,c,o]);const a=$();return e.jsxs(e.Fragment,{children:[n===!1&&s.length===0&&e.jsxs(H,{children:[e.jsx(L,{children:e.jsx(De,{})}),"You haven't liked anything yet."]}),e.jsxs("ul",{className:"mx-auto flex max-w-[640px] flex-col","data-testid":"profile-likes-list",children:[s.map((m,l)=>e.jsxs("li",{"data-testid":"profile-like-item","data-test-view-article":!0,children:[e.jsx(ce,{actor:m.actor,allowDelete:m.object.authored,commentCount:m.object.replyCount,isLoading:x,layout:"feed",likeCount:m.object.likeCount,object:m.object,repostCount:m.object.repostCount,type:m.type,onClick:()=>{m.object.type==="Note"?a(`/notes/${encodeURIComponent(m.object.id)}`):m.object.type==="Article"&&a(`/reader/${encodeURIComponent(m.object.id)}`)}}),l<s.length-1&&e.jsx(de,{}),l===t&&e.jsx("div",{ref:i,className:"h-1"})]},`likes-${m.id}`)),c&&e.jsx("li",{className:"flex flex-col items-center justify-center gap-4 text-center",children:e.jsx(X,{size:"md"})})]}),e.jsx("div",{ref:r,className:"h-1"})]})},bs=({posts:s,fetchNextPage:o,hasNextPage:n,isFetchingNextPage:c,isLoading:x,noResultsMessage:d})=>{const i=u.useRef(null),r=u.useRef(null),t=u.useRef(null),a=Math.max(0,Math.floor(s.length*.75)-1);u.useEffect(()=>(i.current&&i.current.disconnect(),i.current=new IntersectionObserver(l=>{l[0].isIntersecting&&n&&!c&&o()}),r.current&&i.current.observe(r.current),t.current&&i.current.observe(t.current),()=>{i.current&&i.current.disconnect()}),[n,c,o]);const m=$();return e.jsxs(e.Fragment,{children:[n===!1&&s.length===0&&e.jsxs(H,{children:[e.jsx(L,{children:e.jsx(cs,{})}),d]}),e.jsxs("ul",{className:"mx-auto flex max-w-[640px] flex-col","data-testid":"profile-posts-list",children:[s.map((l,h)=>e.jsxs("li",{"data-testid":"profile-post-item","data-test-view-article":!0,children:[e.jsx(ce,{actor:l.actor,allowDelete:l.object.authored,commentCount:l.object.replyCount,isLoading:x,layout:"feed",likeCount:l.object.likeCount,object:l.object,repostCount:l.object.repostCount,type:l.type,onClick:()=>{l.object.type==="Note"?m(`/notes/${encodeURIComponent(l.object.id)}`):l.object.type==="Article"&&m(`/reader/${encodeURIComponent(l.object.id)}`)}}),h<s.length-1&&e.jsx(de,{}),h===a&&e.jsx("div",{ref:r,className:"h-1"})]},`posts-${l.id}`)),c&&e.jsx("li",{className:"flex flex-col items-center justify-center gap-4 text-center",children:e.jsx(X,{size:"md"})})]}),e.jsx("div",{ref:t,className:"h-1"})]})},je=({handle:s,isUserBlocked:o,isDomainBlocked:n,onUnblockUser:c,onUnblockDomain:x,trigger:d,onUnblockComplete:i,isOpen:r,onOpenChange:t})=>{const[a,m]=u.useState(!1),[l,h]=u.useState(()=>{const p=o&&n,N=o&&!n,F=!o&&n;let g="idle";return p?g="dual":N?g="userOnly":F&&(g="domainOnly"),{mode:g,userUnblocked:!1,domainUnblocked:!1}}),b=r!==void 0,k=b?r:a,[w,y]=u.useState(!1),M=u.useCallback(()=>{const p=o&&n,N=o&&!n,F=!o&&n;let g="idle";p?g="dual":N?g="userOnly":F&&(g="domainOnly"),h(C=>({...C,mode:g,userUnblocked:!1,domainUnblocked:!1}))},[o,n]);u.useEffect(()=>{k&&!w?(M(),y(!0)):k||y(!1)},[k,w,M]);const D=()=>{b?t?.(!0):m(!0)},f=p=>{p||(b?t?.(!1):m(!1))},I=async()=>{await c(),h(p=>({...p,userUnblocked:!0})),(l.mode!=="dual"||l.domainUnblocked)&&(f(!1),i?.()),U.success("User unblocked")},E=async()=>{await x(),h(p=>({...p,domainUnblocked:!0})),(l.mode!=="dual"||l.userUnblocked)&&(f(!1),i?.()),U.success("Domain unblocked")},T=s.split("@").filter(Boolean)[1],B=()=>e.jsxs(e.Fragment,{children:[e.jsxs(Q,{children:[e.jsx(Y,{className:"mb-1 flex flex-col gap-1",children:"Unblock"}),e.jsx(G,{className:"mt-4!",asChild:!0,children:e.jsxs("div",{className:"flex flex-col rounded-md border",children:[e.jsxs("div",{className:"flex justify-between gap-6 p-5",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(K,{children:"Unblock user"}),e.jsxs("p",{children:[e.jsx("span",{className:"font-semibold text-black",children:s})," will be able to follow you and engage with your public posts."]})]}),e.jsxs(j,{className:`gap-1 ${l.userUnblocked?"pointer-events-none border-green bg-green text-white hover:bg-green hover:text-white":"text-red hover:text-red-400"}`,variant:"outline",onClick:I,children:[e.jsx(Fe,{}),l.userUnblocked?"User unblocked":"Unblock user"]})]}),e.jsx("div",{className:"border-t"}),e.jsxs("div",{className:"flex justify-between gap-6 p-5",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(K,{children:"Unblock domain"}),e.jsxs("p",{children:["Users from ",e.jsx("span",{className:"font-semibold text-black",children:T})," will be able to follow you and engage with your public posts."]})]}),e.jsxs(j,{className:`gap-1 ${l.domainUnblocked?"pointer-events-none border-green bg-green text-white hover:bg-green hover:text-white":"text-red hover:text-red-400"}`,variant:"outline",onClick:E,children:[e.jsx(Oe,{}),l.domainUnblocked?"Domain unblocked":"Unblock domain"]})]})]})})]}),e.jsx(W,{children:e.jsx(j,{onClick:()=>f(!1),children:"OK"})})]}),P=()=>{const p=l.mode==="userOnly";return e.jsxs(e.Fragment,{children:[e.jsxs(Q,{children:[e.jsx(Y,{className:"mb-1 flex flex-col gap-1",children:p?"Unblock this user?":"Unblock this domain?"}),e.jsx(G,{children:p?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-semibold text-black",children:s})," will be able to follow you and engage with your public posts."]}):e.jsxs(e.Fragment,{children:["Users from ",e.jsx("span",{className:"font-semibold text-black",children:T})," will be able to follow you and engage with your public posts."]})})]}),e.jsxs(W,{children:[e.jsx(xe,{children:"Cancel"}),e.jsx(j,{onClick:p?I:E,children:"Unblock"})]})]})};return e.jsxs(ue,{open:k,onOpenChange:f,children:[d&&e.jsx(Te,{asChild:!0,onClick:D,children:d}),e.jsx(me,{className:`${l.mode==="dual"&&"max-w-[600px]"}`,children:l.mode==="dual"?B():P()})]})},gs=({account:s,children:o,onCopyHandle:n,onBlockAccount:c,onBlockDomain:x,disabled:d=!1,isBlocked:i=!1,isDomainBlocked:r=!1})=>{const[t,a]=u.useState(null),[m,l]=u.useState(!1),h=f=>{f.stopPropagation(),n()},b=f=>{f.stopPropagation(),c()},k=f=>{f.stopPropagation(),x()},w=s?.handle,y=w?.split("@").filter(Boolean)[1],M=()=>e.jsx(ue,{open:m,onOpenChange:l,children:e.jsxs(me,{onClick:f=>f.stopPropagation(),children:[e.jsxs(Q,{children:[e.jsx(Y,{className:"mb-1 flex flex-col gap-1",children:t==="user"?"Block this user?":"Block this domain?"}),e.jsx(G,{children:t==="user"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-semibold text-black",children:w})," will be able to see your public posts, but will no longer be able follow you or interact with your content on the social web."]}):e.jsxs(e.Fragment,{children:["All users from ",e.jsx("span",{className:"font-semibold text-black",children:y})," will be able to see your public posts, but won't be able to follow you or interact with your content."]})})]}),e.jsxs(W,{children:[t!=="domain"&&e.jsx(j,{className:"mr-auto -ml-3 hover:bg-transparent hover:opacity-80",variant:"ghost",onClick:f=>{f.stopPropagation(),a("domain")},children:"Block domain instead"}),e.jsx(xe,{onClick:f=>f.stopPropagation(),children:"Cancel"}),e.jsx(Se,{className:Ae({variant:"destructive"}),onClick:t==="user"?b:k,children:"Block"})]})]})}),D=()=>s&&e.jsx(je,{handle:s.handle,isDomainBlocked:s.domainBlockedByMe,isOpen:m,isUserBlocked:s.blockedByMe,onOpenChange:l,onUnblockDomain:x,onUnblockUser:c});return e.jsxs(e.Fragment,{children:[e.jsxs(Re,{children:[e.jsx(Ie,{disabled:d,asChild:!0,onClick:f=>f.stopPropagation(),children:o}),e.jsx(Ee,{align:"end",className:"p-2",children:e.jsxs("div",{className:"flex w-48 flex-col",children:[e.jsx(ne,{asChild:!0,children:e.jsx(j,{className:"justify-start",variant:"ghost",onClick:h,children:"Copy handle"})}),e.jsx(ne,{asChild:!0,children:e.jsx(j,{className:"justify-start text-red hover:bg-red/5 hover:text-red",variant:"ghost",onClick:f=>{f.stopPropagation(),!i&&!r&&a("user"),l(!0)},children:i?"Unblock user":r?"Unblock domain":"Block user"})})]})})]}),i||r?D():M()]})},ks=({account:s,onUnblock:o,onDomainUnblock:n,className:c=""})=>{const[x,d]=u.useState(!1),i=e.jsx(j,{className:`min-w-[90px] ${c}`,variant:"destructive",onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),children:x?"Unblock":"Blocked"});return e.jsx(je,{handle:s.handle,isDomainBlocked:s.domainBlockedByMe,isUserBlocked:s.blockedByMe,trigger:i,onUnblockDomain:n,onUnblockUser:o})},oe=()=>{},ws=({account:s,customFields:o,isLoadingAccount:n,postsTab:c,likesTab:x,followingTab:d,followersTab:i})=>{const r=fe(),t=$e(),a=$(),{canGoBack:m}=He(),l=r.handle?`/profile/${r.handle}`:"/profile",h=!r.handle,b=r.handle?r.tab||"":t.pathname.split("/").pop()||"",k=u.useMemo(()=>h?["likes","following","followers"]:["following","followers"],[h]),w=k.includes(b)?b:"posts",y=Le("index"),M=ze("index"),D=Ve("index"),f=_e("index"),I=q("index","me"),{data:E}=r.handle?I:{data:void 0},T=r.handle===E?.handle||!r.handle,B=s?.blockedByMe,P=s?.domainBlockedByMe,[p,N]=u.useState(!1),[F,g]=u.useState(!1),C=u.useRef(null);u.useEffect(()=>()=>{C.current&&window.clearTimeout(C.current)},[]);const Z=()=>{B?M.mutate(s):(y.mutate(s),U.success("User blocked")),N(!1)},J=()=>{P?f.mutate({url:s.apId,handle:s.handle}):(D.mutate({url:s.apId,handle:s.handle}),U.success("Domain blocked")),N(!1)},ee=async()=>{if(!s?.handle||!navigator?.clipboard?.writeText){U.error("Unable to copy handle");return}try{await navigator.clipboard.writeText(s.handle),g(!0),U.success("Handle copied"),C.current&&window.clearTimeout(C.current),C.current=window.setTimeout(()=>g(!1),2e3)}catch{U.error("Failed to copy handle"),g(!1)}},[O,be]=u.useState(!1),[ge,se]=u.useState(!1),ke=()=>{be(!O)},z=u.useRef(null),[le,we]=u.useState(!1);u.useEffect(()=>{z.current&&we(z.current.scrollHeight>160)},[O,s?.bio,o,n]),u.useEffect(()=>{b&&(k.includes(b)||a(l,{replace:!0}))},[k,l,a,b]);const ve=v=>v==="posts"?l:`${l}/${v}`,ye=v=>{v!==w&&a(ve(v),{replace:!0})};return!n&&!s?e.jsx(te,{children:e.jsx("div",{className:"mx-auto mt-4 flex w-full max-w-[620px] flex-col items-center [&_svg]:translate-x-px",children:e.jsxs(Qe,{children:[e.jsx(Ye,{children:e.jsx(fs,{})}),e.jsx("div",{children:"Profile not found"})]})})}):e.jsx(te,{children:e.jsx("div",{className:"z-0 mx-[max(-4vw,-32px)] -mt-9 flex flex-col items-center pb-16",children:e.jsx("div",{className:"mx-auto w-full",children:e.jsxs(e.Fragment,{children:[s?.bannerImageUrl?e.jsx("div",{className:"h-[15vw] min-h-[200px] w-full overflow-hidden bg-gradient-to-tr from-gray-200 to-gray-100",children:e.jsx("img",{alt:s?.name,className:"size-full object-cover",referrerPolicy:"no-referrer",src:s?.bannerImageUrl})}):e.jsx("div",{className:"h-[max(8vw,132px)] w-full overflow-hidden bg-gradient-to-tr from-white to-white dark:from-black dark:to-black"}),e.jsxs("div",{className:`mx-auto max-w-[620px] px-6 ${!s?.bannerImageUrl&&!m?"-mt-8":"-mt-12"}`,children:[e.jsxs("div",{className:"flex items-end justify-between",children:[e.jsx("div",{className:"-ml-2 rounded-full bg-white p-1 dark:bg-black",children:n?e.jsx(R,{className:"size-[92px] rounded-full"}):e.jsx(ae,{author:{icon:{url:s?.avatarUrl},name:s?.name,handle:s?.handle},size:"lg"})}),!T&&!n&&e.jsxs("div",{className:"flex gap-2",children:[B||P?e.jsx(ks,{account:s,onDomainUnblock:J,onUnblock:Z}):e.jsx(ie,{following:s?.followedByMe,handle:s?.handle,type:"primary",onFollow:oe,onUnfollow:oe}),e.jsx(gs,{account:s,isBlocked:B,isDomainBlocked:P,onBlockAccount:Z,onBlockDomain:J,onCopyHandle:ee,children:e.jsx(j,{"aria-label":"Open profile menu",variant:"outline",children:e.jsx(Ge,{})})})]}),T&&!n&&e.jsxs(Ke,{open:ge,onOpenChange:se,children:[e.jsx(We,{children:e.jsx(xs,{children:e.jsx(j,{variant:"secondary",children:"Edit profile"})})}),e.jsxs(qe,{className:"w-full max-w-[520px]",onOpenAutoFocus:v=>v.preventDefault(),children:[e.jsx(Xe,{children:e.jsx(Ze,{children:"Profile settings"})}),s&&e.jsx(ds,{account:s,setIsEditingProfile:se})]})]})]}),e.jsx(Je,{className:"break-anywhere mt-4 truncate",children:n?e.jsx(R,{className:"w-32"}):s?.name}),e.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[e.jsx("a",{className:"inline-flex max-w-full truncate text-[1.5rem] text-gray-800 hover:text-gray-900 dark:text-gray-600 dark:hover:text-gray-500",href:s?.url,rel:"noopener noreferrer",target:"_blank",children:e.jsx("span",{className:"truncate",children:n?e.jsx(R,{className:"w-full max-w-56"}):s?.handle})}),!n&&e.jsx(j,{className:"-ml-1.5 size-6 p-0 text-gray-800 hover:text-gray-900 dark:text-gray-700 dark:hover:text-gray-600",title:"Copy handle",variant:"link",onClick:ee,children:F?e.jsx(es,{size:16}):e.jsx(hs,{size:16})}),s?.followsMe&&!n&&e.jsx(ss,{className:"mt-px whitespace-nowrap",variant:"secondary",children:"Follows you"})]}),(s?.bio||o?.length>0)&&e.jsxs("div",{ref:z,className:`ap-profile-content break-anywhere relative text-[1.5rem] [&>p]:mb-3 ${O?"max-h-none pb-7":"max-h-[160px] overflow-hidden"} relative`,children:[n?e.jsxs(e.Fragment,{children:[e.jsx(R,{}),e.jsx(R,{className:"w-full max-w-48"})]}):e.jsx("div",{dangerouslySetInnerHTML:{__html:re(ls(ns(s?.bio??"",["a","br"])))}}),o?.map(v=>e.jsxs("span",{className:"mt-3 line-clamp-1 flex flex-col text-[1.5rem]",children:[e.jsx("span",{className:"text-xs font-semibold",children:v.name}),e.jsx("span",{dangerouslySetInnerHTML:{__html:re(v.value)},className:"ap-profile-content truncate"})]})),!O&&le&&e.jsx("div",{className:"absolute inset-x-0 bottom-0 h-16 bg-gradient-to-t from-white via-white/100 via-60% to-transparent dark:from-black dark:via-black/100"}),le&&e.jsx(j,{className:"absolute bottom-0 h-auto p-0 text-md",variant:"link",onClick:ke,children:O?"Show less":"Show all"})]}),e.jsxs(us,{className:"mt-5",value:w,variant:"underline",onValueChange:v=>ye(v),children:[e.jsxs(ms,{children:[e.jsx(S,{value:"posts",children:"Posts"}),h&&e.jsxs(S,{value:"likes",children:["Likes",e.jsx(_,{children:V(s?.likedCount||0)})]}),e.jsxs(S,{value:"following",children:["Following",e.jsx(_,{children:V(s?.followingCount||0)})]}),e.jsxs(S,{value:"followers",children:["Followers",e.jsx(_,{children:V(s?.followerCount||0)})]})]}),e.jsx(A,{value:"posts",children:(B||P)&&!p?e.jsxs(H,{children:[e.jsx(L,{children:e.jsx(ts,{})}),e.jsxs("div",{className:"mt-2 flex flex-col items-center gap-0.5",children:[e.jsxs(K,{children:[s.name," is blocked"]}),e.jsx("p",{children:"You can view the posts, but it won't unblock the user."}),e.jsx(j,{className:"mt-4",variant:"secondary",onClick:()=>N(!0),children:"View posts"})]})]}):c}),h&&e.jsx(A,{value:"likes",children:x}),e.jsx(A,{value:"following",children:d}),e.jsx(A,{value:"followers",children:i})]},r.handle||s?.handle||"current-user")]})]})})})})},vs=({handle:s})=>{const{postsByAccountQuery:o}=as(s||"me",{enabled:!0}),{data:n,fetchNextPage:c,hasNextPage:x,isFetchingNextPage:d,isLoading:i}=o,r=n?.pages.flatMap(t=>t.posts)??Array.from({length:5},(t,a)=>({id:`placeholder-${a}`,object:{}}));return e.jsx(bs,{fetchNextPage:c,hasNextPage:x,isFetchingNextPage:d,isLoading:i,noResultsMessage:s?`${s} hasn't posted anything yet`:"You haven't posted anything yet.",posts:r})},ys=()=>{const{postsLikedByAccountQuery:s}=is({enabled:!0}),{data:o,fetchNextPage:n,hasNextPage:c,isFetchingNextPage:x,isLoading:d}=s,i=o?.pages.flatMap(r=>r.posts)??Array.from({length:5},(r,t)=>({id:`placeholder-${t}`,object:{}}));return e.jsx(js,{fetchNextPage:n,hasNextPage:c,isFetchingNextPage:x,isLoading:d,posts:i})},Ns=({handle:s})=>{const o=he(s===""?"me":s,"following"),{data:n,fetchNextPage:c,hasNextPage:x,isFetchingNextPage:d,isLoading:i}=o,r=n?.pages.flatMap(t=>"following"in t?t.following:"accounts"in t?t.accounts.map(a=>({actor:{id:a.id,name:a.name,handle:a.handle,icon:{url:a.avatarUrl}},isFollowing:a.isFollowing,blockedByMe:a.blockedByMe,domainBlockedByMe:a.domainBlockedByMe})):[])??[];return e.jsx(pe,{actors:r,fetchNextPage:c,hasNextPage:x,isFetchingNextPage:d,isLoading:i,noResultsMessage:`${s||"You"} have no following`})},Cs=({handle:s})=>{const o=he(s===""?"me":s,"followers"),{data:n,fetchNextPage:c,hasNextPage:x,isFetchingNextPage:d,isLoading:i}=o,r=n?.pages.flatMap(t=>"followers"in t?t.followers:"accounts"in t?t.accounts.map(a=>({actor:{id:a.id,name:a.name,handle:a.handle,icon:{url:a.avatarUrl}},isFollowing:a.isFollowing})):[])??[];return e.jsx(pe,{actors:r,fetchNextPage:c,hasNextPage:x,isFetchingNextPage:d,isLoading:i,noResultsMessage:`${s||"You"} have no followers yet`})},Xs=({})=>{const s=fe(),{data:o,isLoading:n,error:c,refetch:x}=q("index",s.handle||"me");if(u.useEffect(()=>{x()},[s.handle,x]),c&&rs(c)&&c.statusCode!==404)return e.jsx(os,{errorCode:c.code,statusCode:c.statusCode});const d=Object.keys(o?.customFields||{}).map(m=>({name:m,value:o.customFields[m]}))||[],i=e.jsx(vs,{handle:s.handle||""}),r=e.jsx(ys,{}),t=e.jsx(Ns,{handle:s.handle||""}),a=e.jsx(Cs,{handle:s.handle||""});return e.jsx(ws,{account:o,customFields:d,followersTab:a,followingTab:t,isLoadingAccount:n,likesTab:r,postsTab:i})};export{Xs as default};
|
|
1
|
+
import{l as q,r as u,b as $,j as e,R as H,T as L,c4 as Ne,g as Ce,t as Ue,P as Me,V as Be,A as ae,B as j,m as ie,h as Pe,e as X,bB as De,F as ce,aU as de,a1 as ue,cK as Te,a2 as me,a3 as Q,a4 as Y,a5 as W,H as G,bS as Fe,aW as Oe,a6 as K,a7 as xe,W as U,ct as Re,cu as Ie,cw as Ee,cL as ne,a8 as Se,a9 as Ae,u as fe,cn as $e,a as He,K as Le,M as Ve,N as ze,O as _e,L as te,E as Qe,c as Ye,S as R,b1 as We,D as Ge,q as Ke,v as qe,w as Xe,x as Je,Q as Ze,a0 as es,cM as ss,s as re,o as ls,n as ns,cG as z,U as ts,bx as rs,by as os,cN as as,cO as he,cP as is}from"./index-JMWMnGGt.js";import{P as cs}from"./tags-Ddg8oG2Y.js";import{E as ds}from"./edit-profile-DCyHhZgx.js";import{T as us,a as ms,b as S,f as _,c as A}from"./tabs-DFJzY5np.js";import{a as xs}from"./settings-BMsoTszq.js";import{U as fs}from"./lucide-react-BfVLf4Hw.js";import{C as hs}from"./copy-w3c9zkaZ.js";import"./label-DBwnwMrX.js";import"./textarea-DikWsYMt.js";import"./at-sign-vqoOA4VZ.js";import"./wallet-cards-DBM65lA_.js";import"./a-large-small-DzN0AB7t.js";import"./upload-Dz-DI9rQ.js";import"./loader-circle-CGDGFypO.js";import"./message-square-text-BDJyLbG2.js";import"./hash-Bowe71Lt.js";import"./inbox-DS4qMjUb.js";import"./user-plus-B0tpOnLM.js";import"./minus-BM0xhFIQ.js";import"./square-CWrI0H4v.js";import"./user-round-check-caJYm0bB.js";import"./repeat-D-Ki-Cg5.js";import"./reply-C4V0xZ2U.js";import"./sprout-C9DbfYGe.js";import"./trash--VS50LgS.js";function ps(s){return typeof s.name=="string"?s.name:typeof s.preferredUsername=="string"?s.preferredUsername:typeof s.preferredUsername=="object"&&s.preferredUsername!==null&&"@value"in s.preferredUsername&&typeof s.preferredUsername["@value"]=="string"?s.preferredUsername["@value"]:"Unknown"}const pe=({noResultsMessage:s,actors:o,isLoading:n,fetchNextPage:c,hasNextPage:x,isFetchingNextPage:d})=>{const i=q("index","me"),{data:r}=i,t=u.useRef(null),a=u.useRef(null);u.useEffect(()=>(t.current&&t.current.disconnect(),t.current=new IntersectionObserver(l=>{l[0].isIntersecting&&x&&!d&&c()}),a.current&&t.current.observe(a.current),()=>{t.current&&t.current.disconnect()}),[x,d,c]);const m=$();return e.jsxs("div",{className:"pt-3","data-testid":"actor-list",children:[x===!1&&o.length===0?e.jsxs(H,{children:[e.jsx(L,{children:e.jsx(Ne,{})}),s]}):e.jsx("div",{className:"flex flex-col",children:o.map(({actor:l,isFollowing:h,blockedByMe:b,domainBlockedByMe:k})=>{const w=l.handle||Ce(l),y=w===r?.handle;return e.jsx(Ue.Fragment,{children:e.jsx(Me,{actor:l,align:"center",isCurrentUser:y,side:"left",children:e.jsx("div",{children:e.jsxs(Be,{"data-testid":"actor-item",onClick:()=>{Pe(l,m)},children:[e.jsx(ae,{author:l}),e.jsx("div",{children:e.jsxs("div",{className:"break-anywhere text-gray-600",children:[e.jsx("span",{className:"mr-1 line-clamp-1 font-bold text-black dark:text-white",children:ps(l)}),e.jsx("div",{className:"line-clamp-1 text-sm",children:w})]})}),b||k?e.jsx(j,{className:"pointer-events-none ml-auto min-w-[90px]",variant:"destructive",children:"Blocked"}):y?null:e.jsx(ie,{className:"ml-auto","data-testid":"follow-button",following:h,handle:w,type:"secondary"})]},l.id)})})},l.id)})}),e.jsx("div",{ref:a,className:"h-1"}),(d||n)&&e.jsx("div",{className:"mt-6 flex flex-col items-center justify-center gap-4 text-center",children:e.jsx(X,{size:"md"})})]})},js=({posts:s,fetchNextPage:o,hasNextPage:n,isFetchingNextPage:c,isLoading:x})=>{const d=u.useRef(null),i=u.useRef(null),r=u.useRef(null),t=Math.max(0,Math.floor(s.length*.75)-1);u.useEffect(()=>(d.current&&d.current.disconnect(),d.current=new IntersectionObserver(m=>{m[0].isIntersecting&&n&&!c&&o()}),i.current&&d.current.observe(i.current),r.current&&d.current.observe(r.current),()=>{d.current&&d.current.disconnect()}),[n,c,o]);const a=$();return e.jsxs(e.Fragment,{children:[n===!1&&s.length===0&&e.jsxs(H,{children:[e.jsx(L,{children:e.jsx(De,{})}),"You haven't liked anything yet."]}),e.jsxs("ul",{className:"mx-auto flex max-w-[640px] flex-col","data-testid":"profile-likes-list",children:[s.map((m,l)=>e.jsxs("li",{"data-testid":"profile-like-item","data-test-view-article":!0,children:[e.jsx(ce,{actor:m.actor,allowDelete:m.object.authored,commentCount:m.object.replyCount,isLoading:x,layout:"feed",likeCount:m.object.likeCount,object:m.object,repostCount:m.object.repostCount,type:m.type,onClick:()=>{m.object.type==="Note"?a(`/notes/${encodeURIComponent(m.object.id)}`):m.object.type==="Article"&&a(`/reader/${encodeURIComponent(m.object.id)}`)}}),l<s.length-1&&e.jsx(de,{}),l===t&&e.jsx("div",{ref:i,className:"h-1"})]},`likes-${m.id}`)),c&&e.jsx("li",{className:"flex flex-col items-center justify-center gap-4 text-center",children:e.jsx(X,{size:"md"})})]}),e.jsx("div",{ref:r,className:"h-1"})]})},bs=({posts:s,fetchNextPage:o,hasNextPage:n,isFetchingNextPage:c,isLoading:x,noResultsMessage:d})=>{const i=u.useRef(null),r=u.useRef(null),t=u.useRef(null),a=Math.max(0,Math.floor(s.length*.75)-1);u.useEffect(()=>(i.current&&i.current.disconnect(),i.current=new IntersectionObserver(l=>{l[0].isIntersecting&&n&&!c&&o()}),r.current&&i.current.observe(r.current),t.current&&i.current.observe(t.current),()=>{i.current&&i.current.disconnect()}),[n,c,o]);const m=$();return e.jsxs(e.Fragment,{children:[n===!1&&s.length===0&&e.jsxs(H,{children:[e.jsx(L,{children:e.jsx(cs,{})}),d]}),e.jsxs("ul",{className:"mx-auto flex max-w-[640px] flex-col","data-testid":"profile-posts-list",children:[s.map((l,h)=>e.jsxs("li",{"data-testid":"profile-post-item","data-test-view-article":!0,children:[e.jsx(ce,{actor:l.actor,allowDelete:l.object.authored,commentCount:l.object.replyCount,isLoading:x,layout:"feed",likeCount:l.object.likeCount,object:l.object,repostCount:l.object.repostCount,type:l.type,onClick:()=>{l.object.type==="Note"?m(`/notes/${encodeURIComponent(l.object.id)}`):l.object.type==="Article"&&m(`/reader/${encodeURIComponent(l.object.id)}`)}}),h<s.length-1&&e.jsx(de,{}),h===a&&e.jsx("div",{ref:r,className:"h-1"})]},`posts-${l.id}`)),c&&e.jsx("li",{className:"flex flex-col items-center justify-center gap-4 text-center",children:e.jsx(X,{size:"md"})})]}),e.jsx("div",{ref:t,className:"h-1"})]})},je=({handle:s,isUserBlocked:o,isDomainBlocked:n,onUnblockUser:c,onUnblockDomain:x,trigger:d,onUnblockComplete:i,isOpen:r,onOpenChange:t})=>{const[a,m]=u.useState(!1),[l,h]=u.useState(()=>{const p=o&&n,N=o&&!n,F=!o&&n;let g="idle";return p?g="dual":N?g="userOnly":F&&(g="domainOnly"),{mode:g,userUnblocked:!1,domainUnblocked:!1}}),b=r!==void 0,k=b?r:a,[w,y]=u.useState(!1),M=u.useCallback(()=>{const p=o&&n,N=o&&!n,F=!o&&n;let g="idle";p?g="dual":N?g="userOnly":F&&(g="domainOnly"),h(C=>({...C,mode:g,userUnblocked:!1,domainUnblocked:!1}))},[o,n]);u.useEffect(()=>{k&&!w?(M(),y(!0)):k||y(!1)},[k,w,M]);const D=()=>{b?t?.(!0):m(!0)},f=p=>{p||(b?t?.(!1):m(!1))},I=async()=>{await c(),h(p=>({...p,userUnblocked:!0})),(l.mode!=="dual"||l.domainUnblocked)&&(f(!1),i?.()),U.success("User unblocked")},E=async()=>{await x(),h(p=>({...p,domainUnblocked:!0})),(l.mode!=="dual"||l.userUnblocked)&&(f(!1),i?.()),U.success("Domain unblocked")},T=s.split("@").filter(Boolean)[1],B=()=>e.jsxs(e.Fragment,{children:[e.jsxs(Q,{children:[e.jsx(Y,{className:"mb-1 flex flex-col gap-1",children:"Unblock"}),e.jsx(W,{className:"mt-4!",asChild:!0,children:e.jsxs("div",{className:"flex flex-col rounded-md border",children:[e.jsxs("div",{className:"flex justify-between gap-6 p-5",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(G,{children:"Unblock user"}),e.jsxs("p",{children:[e.jsx("span",{className:"font-semibold text-black",children:s})," will be able to follow you and engage with your public posts."]})]}),e.jsxs(j,{className:`gap-1 ${l.userUnblocked?"pointer-events-none border-green bg-green text-white hover:bg-green hover:text-white":"text-red hover:text-red-400"}`,variant:"outline",onClick:I,children:[e.jsx(Fe,{}),l.userUnblocked?"User unblocked":"Unblock user"]})]}),e.jsx("div",{className:"border-t"}),e.jsxs("div",{className:"flex justify-between gap-6 p-5",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(G,{children:"Unblock domain"}),e.jsxs("p",{children:["Users from ",e.jsx("span",{className:"font-semibold text-black",children:T})," will be able to follow you and engage with your public posts."]})]}),e.jsxs(j,{className:`gap-1 ${l.domainUnblocked?"pointer-events-none border-green bg-green text-white hover:bg-green hover:text-white":"text-red hover:text-red-400"}`,variant:"outline",onClick:E,children:[e.jsx(Oe,{}),l.domainUnblocked?"Domain unblocked":"Unblock domain"]})]})]})})]}),e.jsx(K,{children:e.jsx(j,{onClick:()=>f(!1),children:"OK"})})]}),P=()=>{const p=l.mode==="userOnly";return e.jsxs(e.Fragment,{children:[e.jsxs(Q,{children:[e.jsx(Y,{className:"mb-1 flex flex-col gap-1",children:p?"Unblock this user?":"Unblock this domain?"}),e.jsx(W,{children:p?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-semibold text-black",children:s})," will be able to follow you and engage with your public posts."]}):e.jsxs(e.Fragment,{children:["Users from ",e.jsx("span",{className:"font-semibold text-black",children:T})," will be able to follow you and engage with your public posts."]})})]}),e.jsxs(K,{children:[e.jsx(xe,{children:"Cancel"}),e.jsx(j,{onClick:p?I:E,children:"Unblock"})]})]})};return e.jsxs(ue,{open:k,onOpenChange:f,children:[d&&e.jsx(Te,{asChild:!0,onClick:D,children:d}),e.jsx(me,{className:`${l.mode==="dual"&&"max-w-[600px]"}`,children:l.mode==="dual"?B():P()})]})},gs=({account:s,children:o,onCopyHandle:n,onBlockAccount:c,onBlockDomain:x,disabled:d=!1,isBlocked:i=!1,isDomainBlocked:r=!1})=>{const[t,a]=u.useState(null),[m,l]=u.useState(!1),h=f=>{f.stopPropagation(),n()},b=f=>{f.stopPropagation(),c()},k=f=>{f.stopPropagation(),x()},w=s?.handle,y=w?.split("@").filter(Boolean)[1],M=()=>e.jsx(ue,{open:m,onOpenChange:l,children:e.jsxs(me,{onClick:f=>f.stopPropagation(),children:[e.jsxs(Q,{children:[e.jsx(Y,{className:"mb-1 flex flex-col gap-1",children:t==="user"?"Block this user?":"Block this domain?"}),e.jsx(W,{children:t==="user"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-semibold text-black",children:w})," will be able to see your public posts, but will no longer be able follow you or interact with your content on the social web."]}):e.jsxs(e.Fragment,{children:["All users from ",e.jsx("span",{className:"font-semibold text-black",children:y})," will be able to see your public posts, but won't be able to follow you or interact with your content."]})})]}),e.jsxs(K,{children:[t!=="domain"&&e.jsx(j,{className:"mr-auto -ml-3 hover:bg-transparent hover:opacity-80",variant:"ghost",onClick:f=>{f.stopPropagation(),a("domain")},children:"Block domain instead"}),e.jsx(xe,{onClick:f=>f.stopPropagation(),children:"Cancel"}),e.jsx(Se,{className:Ae({variant:"destructive"}),onClick:t==="user"?b:k,children:"Block"})]})]})}),D=()=>s&&e.jsx(je,{handle:s.handle,isDomainBlocked:s.domainBlockedByMe,isOpen:m,isUserBlocked:s.blockedByMe,onOpenChange:l,onUnblockDomain:x,onUnblockUser:c});return e.jsxs(e.Fragment,{children:[e.jsxs(Re,{children:[e.jsx(Ie,{disabled:d,asChild:!0,onClick:f=>f.stopPropagation(),children:o}),e.jsx(Ee,{align:"end",className:"p-2",children:e.jsxs("div",{className:"flex w-48 flex-col",children:[e.jsx(ne,{asChild:!0,children:e.jsx(j,{className:"justify-start",variant:"ghost",onClick:h,children:"Copy handle"})}),e.jsx(ne,{asChild:!0,children:e.jsx(j,{className:"justify-start text-red hover:bg-red/5 hover:text-red",variant:"ghost",onClick:f=>{f.stopPropagation(),!i&&!r&&a("user"),l(!0)},children:i?"Unblock user":r?"Unblock domain":"Block user"})})]})})]}),i||r?D():M()]})},ks=({account:s,onUnblock:o,onDomainUnblock:n,className:c=""})=>{const[x,d]=u.useState(!1),i=e.jsx(j,{className:`min-w-[90px] ${c}`,variant:"destructive",onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),children:x?"Unblock":"Blocked"});return e.jsx(je,{handle:s.handle,isDomainBlocked:s.domainBlockedByMe,isUserBlocked:s.blockedByMe,trigger:i,onUnblockDomain:n,onUnblockUser:o})},oe=()=>{},ws=({account:s,customFields:o,isLoadingAccount:n,postsTab:c,likesTab:x,followingTab:d,followersTab:i})=>{const r=fe(),t=$e(),a=$(),{canGoBack:m}=He(),l=r.handle?`/profile/${r.handle}`:"/profile",h=!r.handle,b=r.handle?r.tab||"":t.pathname.split("/").pop()||"",k=u.useMemo(()=>h?["likes","following","followers"]:["following","followers"],[h]),w=k.includes(b)?b:"posts",y=Le("index"),M=Ve("index"),D=ze("index"),f=_e("index"),I=q("index","me"),{data:E}=r.handle?I:{data:void 0},T=r.handle===E?.handle||!r.handle,B=s?.blockedByMe,P=s?.domainBlockedByMe,[p,N]=u.useState(!1),[F,g]=u.useState(!1),C=u.useRef(null);u.useEffect(()=>()=>{C.current&&window.clearTimeout(C.current)},[]);const J=()=>{B?M.mutate(s):(y.mutate(s),U.success("User blocked")),N(!1)},Z=()=>{P?f.mutate({url:s.apId,handle:s.handle}):(D.mutate({url:s.apId,handle:s.handle}),U.success("Domain blocked")),N(!1)},ee=async()=>{if(!s?.handle||!navigator?.clipboard?.writeText){U.error("Unable to copy handle");return}try{await navigator.clipboard.writeText(s.handle),g(!0),U.success("Handle copied"),C.current&&window.clearTimeout(C.current),C.current=window.setTimeout(()=>g(!1),2e3)}catch{U.error("Failed to copy handle"),g(!1)}},[O,be]=u.useState(!1),[ge,se]=u.useState(!1),ke=()=>{be(!O)},V=u.useRef(null),[le,we]=u.useState(!1);u.useEffect(()=>{V.current&&we(V.current.scrollHeight>160)},[O,s?.bio,o,n]),u.useEffect(()=>{b&&(k.includes(b)||a(l,{replace:!0}))},[k,l,a,b]);const ve=v=>v==="posts"?l:`${l}/${v}`,ye=v=>{v!==w&&a(ve(v),{replace:!0})};return!n&&!s?e.jsx(te,{children:e.jsx("div",{className:"mx-auto mt-4 flex w-full max-w-[620px] flex-col items-center [&_svg]:translate-x-px",children:e.jsxs(Qe,{children:[e.jsx(Ye,{children:e.jsx(fs,{})}),e.jsx("div",{children:"Profile not found"})]})})}):e.jsx(te,{children:e.jsx("div",{className:"z-0 mx-[max(-4vw,-32px)] -mt-9 flex flex-col items-center pb-16",children:e.jsx("div",{className:"mx-auto w-full",children:e.jsxs(e.Fragment,{children:[s?.bannerImageUrl?e.jsx("div",{className:"h-[15vw] min-h-[200px] w-full overflow-hidden bg-gradient-to-tr from-gray-200 to-gray-100",children:e.jsx("img",{alt:s?.name,className:"size-full object-cover",referrerPolicy:"no-referrer",src:s?.bannerImageUrl})}):e.jsx("div",{className:"h-[max(8vw,132px)] w-full overflow-hidden bg-gradient-to-tr from-white to-white dark:from-black dark:to-black"}),e.jsxs("div",{className:`mx-auto max-w-[620px] px-6 ${!s?.bannerImageUrl&&!m?"-mt-8":"-mt-12"}`,children:[e.jsxs("div",{className:"flex items-end justify-between",children:[e.jsx("div",{className:"-ml-2 rounded-full bg-white p-1 dark:bg-black",children:n?e.jsx(R,{className:"size-[92px] rounded-full"}):e.jsx(ae,{author:{icon:{url:s?.avatarUrl},name:s?.name,handle:s?.handle},size:"lg"})}),!T&&!n&&e.jsxs("div",{className:"flex gap-2",children:[B||P?e.jsx(ks,{account:s,onDomainUnblock:Z,onUnblock:J}):e.jsx(ie,{following:s?.followedByMe,handle:s?.handle,type:"primary",onFollow:oe,onUnfollow:oe}),e.jsx(gs,{account:s,isBlocked:B,isDomainBlocked:P,onBlockAccount:J,onBlockDomain:Z,onCopyHandle:ee,children:e.jsx(j,{"aria-label":"Open profile menu",variant:"outline",children:e.jsx(We,{})})})]}),T&&!n&&e.jsxs(Ge,{open:ge,onOpenChange:se,children:[e.jsx(Ke,{children:e.jsx(xs,{children:e.jsx(j,{variant:"secondary",children:"Edit profile"})})}),e.jsxs(qe,{className:"w-full max-w-[520px]",onOpenAutoFocus:v=>v.preventDefault(),children:[e.jsx(Xe,{children:e.jsx(Je,{children:"Profile settings"})}),s&&e.jsx(ds,{account:s,setIsEditingProfile:se})]})]})]}),e.jsx(Ze,{className:"break-anywhere mt-4 truncate",children:n?e.jsx(R,{className:"w-32"}):s?.name}),e.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[e.jsx("a",{className:"inline-flex max-w-full truncate text-[1.5rem] text-gray-800 hover:text-gray-900 dark:text-gray-600 dark:hover:text-gray-500",href:s?.url,rel:"noopener noreferrer",target:"_blank",children:e.jsx("span",{className:"truncate",children:n?e.jsx(R,{className:"w-full max-w-56"}):s?.handle})}),!n&&e.jsx(j,{className:"-ml-1.5 size-6 p-0 text-gray-800 hover:text-gray-900 dark:text-gray-700 dark:hover:text-gray-600",title:"Copy handle",variant:"link",onClick:ee,children:F?e.jsx(es,{size:16}):e.jsx(hs,{size:16})}),s?.followsMe&&!n&&e.jsx(ss,{className:"mt-px whitespace-nowrap",variant:"secondary",children:"Follows you"})]}),(s?.bio||o?.length>0)&&e.jsxs("div",{ref:V,className:`ap-profile-content break-anywhere relative text-[1.5rem] [&>p]:mb-3 ${O?"max-h-none pb-7":"max-h-[160px] overflow-hidden"} relative`,children:[n?e.jsxs(e.Fragment,{children:[e.jsx(R,{}),e.jsx(R,{className:"w-full max-w-48"})]}):e.jsx("div",{dangerouslySetInnerHTML:{__html:re(ls(ns(s?.bio??"",["a","br"])))}}),o?.map(v=>e.jsxs("span",{className:"mt-3 line-clamp-1 flex flex-col text-[1.5rem]",children:[e.jsx("span",{className:"text-xs font-semibold",children:v.name}),e.jsx("span",{dangerouslySetInnerHTML:{__html:re(v.value)},className:"ap-profile-content truncate"})]})),!O&&le&&e.jsx("div",{className:"absolute inset-x-0 bottom-0 h-16 bg-gradient-to-t from-white via-white/100 via-60% to-transparent dark:from-black dark:via-black/100"}),le&&e.jsx(j,{className:"absolute bottom-0 h-auto p-0 text-md",variant:"link",onClick:ke,children:O?"Show less":"Show all"})]}),e.jsxs(us,{className:"mt-5",value:w,variant:"underline",onValueChange:v=>ye(v),children:[e.jsxs(ms,{children:[e.jsx(S,{value:"posts",children:"Posts"}),h&&e.jsxs(S,{value:"likes",children:["Likes",e.jsx(_,{children:z(s?.likedCount||0)})]}),e.jsxs(S,{value:"following",children:["Following",e.jsx(_,{children:z(s?.followingCount||0)})]}),e.jsxs(S,{value:"followers",children:["Followers",e.jsx(_,{children:z(s?.followerCount||0)})]})]}),e.jsx(A,{value:"posts",children:(B||P)&&!p?e.jsxs(H,{children:[e.jsx(L,{children:e.jsx(ts,{})}),e.jsxs("div",{className:"mt-2 flex flex-col items-center gap-0.5",children:[e.jsxs(G,{children:[s.name," is blocked"]}),e.jsx("p",{children:"You can view the posts, but it won't unblock the user."}),e.jsx(j,{className:"mt-4",variant:"secondary",onClick:()=>N(!0),children:"View posts"})]})]}):c}),h&&e.jsx(A,{value:"likes",children:x}),e.jsx(A,{value:"following",children:d}),e.jsx(A,{value:"followers",children:i})]},r.handle||s?.handle||"current-user")]})]})})})})},vs=({handle:s})=>{const{postsByAccountQuery:o}=as(s||"me",{enabled:!0}),{data:n,fetchNextPage:c,hasNextPage:x,isFetchingNextPage:d,isLoading:i}=o,r=n?.pages.flatMap(t=>t.posts)??Array.from({length:5},(t,a)=>({id:`placeholder-${a}`,object:{}}));return e.jsx(bs,{fetchNextPage:c,hasNextPage:x,isFetchingNextPage:d,isLoading:i,noResultsMessage:s?`${s} hasn't posted anything yet`:"You haven't posted anything yet.",posts:r})},ys=()=>{const{postsLikedByAccountQuery:s}=is({enabled:!0}),{data:o,fetchNextPage:n,hasNextPage:c,isFetchingNextPage:x,isLoading:d}=s,i=o?.pages.flatMap(r=>r.posts)??Array.from({length:5},(r,t)=>({id:`placeholder-${t}`,object:{}}));return e.jsx(js,{fetchNextPage:n,hasNextPage:c,isFetchingNextPage:x,isLoading:d,posts:i})},Ns=({handle:s})=>{const o=he(s===""?"me":s,"following"),{data:n,fetchNextPage:c,hasNextPage:x,isFetchingNextPage:d,isLoading:i}=o,r=n?.pages.flatMap(t=>"following"in t?t.following:"accounts"in t?t.accounts.map(a=>({actor:{id:a.id,name:a.name,handle:a.handle,icon:{url:a.avatarUrl}},isFollowing:a.isFollowing,blockedByMe:a.blockedByMe,domainBlockedByMe:a.domainBlockedByMe})):[])??[];return e.jsx(pe,{actors:r,fetchNextPage:c,hasNextPage:x,isFetchingNextPage:d,isLoading:i,noResultsMessage:`${s||"You"} have no following`})},Cs=({handle:s})=>{const o=he(s===""?"me":s,"followers"),{data:n,fetchNextPage:c,hasNextPage:x,isFetchingNextPage:d,isLoading:i}=o,r=n?.pages.flatMap(t=>"followers"in t?t.followers:"accounts"in t?t.accounts.map(a=>({actor:{id:a.id,name:a.name,handle:a.handle,icon:{url:a.avatarUrl}},isFollowing:a.isFollowing})):[])??[];return e.jsx(pe,{actors:r,fetchNextPage:c,hasNextPage:x,isFetchingNextPage:d,isLoading:i,noResultsMessage:`${s||"You"} have no followers yet`})},Xs=({})=>{const s=fe(),{data:o,isLoading:n,error:c,refetch:x}=q("index",s.handle||"me");if(u.useEffect(()=>{x()},[s.handle,x]),c&&rs(c)&&c.statusCode!==404)return e.jsx(os,{errorCode:c.code,statusCode:c.statusCode});const d=Object.keys(o?.customFields||{}).map(m=>({name:m,value:o.customFields[m]}))||[],i=e.jsx(vs,{handle:s.handle||""}),r=e.jsx(ys,{}),t=e.jsx(Ns,{handle:s.handle||""}),a=e.jsx(Cs,{handle:s.handle||""});return e.jsx(ws,{account:o,customFields:d,followersTab:a,followingTab:t,isLoadingAccount:n,likesTab:r,postsTab:i})};export{Xs as default};
|