ghost 6.21.0 → 6.21.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/tryghost-i18n-6.21.2.tgz +0 -0
- package/components/{tryghost-parse-email-address-6.21.0.tgz → tryghost-parse-email-address-6.21.2.tgz} +0 -0
- package/content/themes/casper/LICENSE +1 -1
- package/content/themes/casper/README.md +7 -2
- package/content/themes/casper/assets/built/casper.js +1 -2
- package/content/themes/casper/assets/built/casper.js.map +1 -1
- package/content/themes/casper/assets/built/global.css +1 -2
- package/content/themes/casper/assets/built/global.css.map +1 -1
- package/content/themes/casper/assets/built/screen.css +1 -2
- package/content/themes/casper/assets/built/screen.css.map +1 -1
- package/content/themes/casper/assets/css/global.css +4 -0
- package/content/themes/casper/default.hbs +5 -5
- package/content/themes/casper/error-404.hbs +1 -1
- package/content/themes/casper/error.hbs +2 -2
- package/content/themes/casper/gulpfile.js +13 -2
- package/content/themes/casper/locales/context.json +112 -0
- package/content/themes/casper/locales/de-CH.json +112 -0
- package/content/themes/casper/locales/de.json +112 -0
- package/content/themes/casper/locales/en.json +112 -0
- package/content/themes/casper/locales/fr.json +112 -0
- package/content/themes/casper/locales/ga.json +112 -0
- package/content/themes/casper/locales/gd.json +112 -0
- package/content/themes/casper/locales/nl.json +112 -0
- package/content/themes/casper/locales/pt-BR.json +112 -0
- package/content/themes/casper/locales/sv.json +112 -0
- package/content/themes/casper/locales/uk.json +112 -0
- package/content/themes/casper/locales/zh.json +112 -0
- package/content/themes/casper/package.json +12 -11
- package/content/themes/casper/partials/post-card.hbs +4 -4
- package/content/themes/casper/post.hbs +4 -4
- package/content/themes/casper/tag.hbs +1 -1
- package/content/themes/source/LICENSE +1 -1
- package/content/themes/source/README.md +4 -1
- package/content/themes/source/assets/built/screen.css +1 -2
- package/content/themes/source/assets/built/screen.css.map +1 -1
- package/content/themes/source/assets/built/source.js +1 -2
- package/content/themes/source/assets/built/source.js.map +1 -1
- package/content/themes/source/assets/css/screen.css +18 -16
- package/content/themes/source/default.hbs +1 -1
- package/content/themes/source/gulpfile.js +5 -3
- package/content/themes/source/locales/context.json +112 -0
- package/content/themes/source/locales/de-CH.json +112 -0
- package/content/themes/source/locales/de.json +112 -0
- package/content/themes/source/locales/en.json +112 -0
- package/content/themes/source/locales/fr.json +112 -0
- package/content/themes/source/locales/ga.json +112 -0
- package/content/themes/source/locales/gd.json +112 -0
- package/content/themes/source/locales/nl.json +112 -0
- package/content/themes/source/locales/pt-BR.json +112 -0
- package/content/themes/source/locales/sv.json +112 -0
- package/content/themes/source/locales/uk.json +112 -0
- package/content/themes/source/locales/zh.json +112 -0
- package/content/themes/source/package.json +13 -11
- package/content/themes/source/partials/components/featured.hbs +1 -1
- package/content/themes/source/partials/components/footer.hbs +1 -1
- package/content/themes/source/partials/components/header-content.hbs +1 -1
- package/content/themes/source/partials/components/navigation.hbs +5 -5
- package/content/themes/source/partials/components/post-list.hbs +7 -7
- package/content/themes/source/partials/email-subscription.hbs +5 -5
- package/content/themes/source/partials/lightbox.hbs +6 -6
- package/content/themes/source/partials/post-card.hbs +1 -1
- package/content/themes/source/partials/search-toggle.hbs +1 -1
- package/content/themes/source/post.hbs +2 -2
- package/core/built/admin/assets/{PolarAngleAxis-a31TecIQ.js → PolarAngleAxis-D8t9UwHk.js} +1 -1
- package/core/built/admin/assets/{_baseAssignValue-Dw5pcaUJ.js → _baseAssignValue-DPyNU5o6.js} +1 -1
- package/core/built/admin/assets/{a-large-small-Cf_hUupE.js → a-large-small-BijOKCoa.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-C1ZFtR6M.mjs → code-editor-view-DJsXOcZ2.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/{index-zyVbQw03.mjs → index-BnhIi5NU.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/{index-D96qFjP9.mjs → index-CnwJhGbs.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/{index-ILVAmH8Q.mjs → index-DaGaokMn.mjs} +1067 -1063
- package/core/built/admin/assets/admin-x-settings/{modals-BbDVa22r.mjs → modals-D02VJnTV.mjs} +2838 -2840
- package/core/built/admin/assets/{at-sign-DyMz5le1.js → at-sign-_JfhlimD.js} +1 -1
- package/core/built/admin/assets/{audience-BevM-Udw.js → audience-BdrhpNZ4.js} +1 -1
- package/core/built/admin/assets/{avatar-flipboard-DiGYhH_s.js → avatar-flipboard-BdmM8eOn.js} +1 -1
- package/core/built/admin/assets/{bluesky-sharing-Dj4VOEDi.js → bluesky-sharing-yeM8KkY8.js} +1 -1
- package/core/built/admin/assets/{chart-BDdnkPgC.js → chart-CULaDoVB.js} +1 -1
- package/core/built/admin/assets/{chunk.138.5c4b0d0ae3f21c9c726d.js → chunk.482.c45c97fe666cd1a6b060.js} +4 -4
- package/core/built/admin/assets/{chunk.524.54ba5b50c191627c46f2.js → chunk.524.7fc2692374515780e66e.js} +4 -4
- package/core/built/admin/assets/{chunk.582.3232d44081d84d135e3d.js → chunk.582.fd8c4fa8e637e2d5611e.js} +8 -8
- package/core/built/admin/assets/{code-editor-view-V0wBeYuE.js → code-editor-view-UA2xKjk1.js} +1 -1
- package/core/built/admin/assets/{comments-CqurDRGu.js → comments-DoNjlMYA.js} +1 -1
- package/core/built/admin/assets/{content-helpers-C8lVEp2H.js → content-helpers-BRzxAgjP.js} +1 -1
- package/core/built/admin/assets/{copy-BdseBMKx.js → copy-CbX-_mHj.js} +1 -1
- package/core/built/admin/assets/{data-list--5Xfh5gm.js → data-list-nZOiCWV9.js} +1 -1
- package/core/built/admin/assets/{deleted-feed-item-Bmxp6PAR.js → deleted-feed-item-DjkZpKDC.js} +1 -1
- package/core/built/admin/assets/{edit-profile-Bi-G8vrq.js → edit-profile-BY_oJrQn.js} +1 -1
- package/core/built/admin/assets/{empty-indicator-C1cLHSRX.js → empty-indicator-DoxAratw.js} +1 -1
- package/core/built/admin/assets/{en-DPpVO1wK.js → en-B9ScC5j9.js} +1 -1
- package/core/built/admin/assets/{feed-lCu_EJ0a.js → feed-BsgqABLQ.js} +1 -1
- package/core/built/admin/assets/{filters-BYYV0fmK.js → filters-CscMb_Gl.js} +1 -1
- package/core/built/admin/assets/{gh-chart-BYWaeEuY.js → gh-chart-GokHrG5_.js} +1 -1
- package/core/built/admin/assets/{ghost-565670d46ad5b30935426b5dfa95bc81.js → ghost-d1843f84a9476ccbdf2a350848ac88aa.js} +2 -2
- package/core/built/admin/assets/{growth-DXHnB1EQ.js → growth-CKOWA1_V.js} +1 -1
- package/core/built/admin/assets/{hash-tZATAzZa.js → hash-twG7-iIB.js} +1 -1
- package/core/built/admin/assets/{inbox-B-LuWyHY.js → inbox-BdkIJbSq.js} +1 -1
- package/core/built/admin/assets/{index-BDrJ3N3y.js → index-B7OzWwwP.js} +1 -1
- package/core/built/admin/assets/{index-B8tGZsrG.js → index-BFySh9qo.js} +1 -1
- package/core/built/admin/assets/{index-EiGE3Aiy.js → index-BOWUajrT.js} +1 -1
- package/core/built/admin/assets/{index-ig4J4RpO.js → index-BQLCImHQ.js} +1 -1
- package/core/built/admin/assets/{index-BmKPrbBK.js → index-C398bG84.js} +1 -1
- package/core/built/admin/assets/{index-BX0_v5NB.js → index-C5YCjM6z.js} +1 -1
- package/core/built/admin/assets/{index-DEwhVcR5.js → index-CHpxzPRR.js} +1 -1
- package/core/built/admin/assets/{index-CX1A5TwO.js → index-CM-iA6b-.js} +3 -3
- package/core/built/admin/assets/{index-9bj69FKq.js → index-CgCHCdle.js} +1 -1
- package/core/built/admin/assets/{index-BocVu6WC.js → index-Cw441AFq.js} +1 -1
- package/core/built/admin/assets/{index-jHIJgh6L.js → index-D9S88kRl.js} +1 -1
- package/core/built/admin/assets/{index-CqvBC0jL.js → index-DbgA2vK8.js} +1 -1
- package/core/built/admin/assets/{index-2H-Jp89Z.js → index-ghPdV1ln.js} +1 -1
- package/core/built/admin/assets/{index-BcOzgmTC.js → index-tX0pajfP.js} +1 -1
- package/core/built/admin/assets/{index-BxVUX0dN.js → index-upXLfQxx.js} +1 -1
- package/core/built/admin/assets/{koenig-lexical-BdX9U-oB.js → koenig-lexical-GZS7bHDz.js} +1 -1
- package/core/built/admin/assets/{kpi-card-DQ1AbLJB.js → kpi-card-B6fmS7IH.js} +1 -1
- package/core/built/admin/assets/{kpis-vcbQvnLh.js → kpis-B-JXQ-4C.js} +1 -1
- package/core/built/admin/assets/{label-CNmRJkLy.js → label-ChHoKmj0.js} +1 -1
- package/core/built/admin/assets/{links-BE51SJxR.js → links-DQSOljcR.js} +1 -1
- package/core/built/admin/assets/{list-filter-BwnQ0Xlp.js → list-filter-cWuCDOLb.js} +1 -1
- package/core/built/admin/assets/{loader-circle-CcLEGvsN.js → loader-circle-B5ILzHHu.js} +1 -1
- package/core/built/admin/assets/{lucide-react-DHFgHS1l.js → lucide-react-CM0rB7CS.js} +1 -1
- package/core/built/admin/assets/{main-layout-DsxBNVo-.js → main-layout-BE7vZmy0.js} +1 -1
- package/core/built/admin/assets/{members-3okEkvWv.js → members-C10Z_BuG.js} +1 -1
- package/core/built/admin/assets/{message-square-text-BkERj4f5.js → message-square-text-DVZjnBBF.js} +1 -1
- package/core/built/admin/assets/{minus-C6oMPJo2.js → minus-BWrVDnd-.js} +1 -1
- package/core/built/admin/assets/{modals-CfUec0CL.js → modals-Bx7uDUHI.js} +15 -15
- package/core/built/admin/assets/{moderation-DEHUqi1e.js → moderation-DwlKZoB5.js} +1 -1
- package/core/built/admin/assets/{newsletter-Cp-39ksw.js → newsletter-DkOl42UB.js} +1 -1
- package/core/built/admin/assets/{newsletters-Bj58VQa2.js → newsletters-DNt9qd4h.js} +1 -1
- package/core/built/admin/assets/{note-9ysQWJz6.js → note-C-BLqULD.js} +1 -1
- package/core/built/admin/assets/{offers-DORdeAfE.js → offers-CU0KFuyW.js} +1 -1
- package/core/built/admin/assets/{overview-aZmI_71o.js → overview-DAEelSKq.js} +1 -1
- package/core/built/admin/assets/{pagemenu-DK1tbdsq.js → pagemenu-Cr7_YYR8.js} +1 -1
- package/core/built/admin/assets/{post-analytics-context-D8nk51yA.js → post-analytics-context-B2ytyOU0.js} +1 -1
- package/core/built/admin/assets/{post-analytics-header-qh1LEasb.js → post-analytics-header-CvR25xxU.js} +1 -1
- package/core/built/admin/assets/{post-analytics-HdZI-1J7.js → post-analytics-qpfoP-57.js} +1 -1
- package/core/built/admin/assets/{post-share-modal-CvTf3PP9.js → post-share-modal-DDhiG0X4.js} +1 -1
- package/core/built/admin/assets/{posts-mIxckqHa.js → posts-DTy4lguT.js} +1 -1
- package/core/built/admin/assets/{referrers-qhD64pmp.js → referrers-BzKz9fT9.js} +1 -1
- package/core/built/admin/assets/{repeat-Idtsb62O.js → repeat-C_xWSLK1.js} +1 -1
- package/core/built/admin/assets/{reply-DXS-C-Rk.js → reply-CXnb6Juu.js} +1 -1
- package/core/built/admin/assets/{select-CeD8IhXy.js → select-WZUCQgjI.js} +1 -1
- package/core/built/admin/assets/{settings-BHfStwmS.js → settings-BC82mM6N.js} +1 -1
- package/core/built/admin/assets/{settings-M0QTt_tT.js → settings-EbntXZw9.js} +7 -7
- package/core/built/admin/assets/{sort-button-BoTFsBYE.js → sort-button-CFYf_NOQ.js} +1 -1
- package/core/built/admin/assets/{source-icon-opy8g_Nk.js → source-icon-xS8eeWX-.js} +1 -1
- package/core/built/admin/assets/{sprout-BKOFkdV8.js → sprout-CLmu2pln.js} +1 -1
- package/core/built/admin/assets/{square-BjZk7vJx.js → square-D0Y5-h0C.js} +1 -1
- package/core/built/admin/assets/{stats-DXXxmfRV.js → stats-B5O9DjYi.js} +1 -1
- package/core/built/admin/assets/{stats-view-D_5J0Nf7.js → stats-view-Cr6M1ycv.js} +1 -1
- package/core/built/admin/assets/{step-1-BcaR_MDC.js → step-1-DGbl6AAj.js} +1 -1
- package/core/built/admin/assets/{step-2-BR0jqEO_.js → step-2-Rf8oissi.js} +1 -1
- package/core/built/admin/assets/{step-3-CMPME0ky.js → step-3-tMPmbeBc.js} +1 -1
- package/core/built/admin/assets/{table-CwbnKMYe.js → table-CXo8NKU2.js} +1 -1
- package/core/built/admin/assets/{tabs-hfT89L_O.js → tabs-BMk71Tf2.js} +1 -1
- package/core/built/admin/assets/{tags-BSwYlj_e.js → tags-CSl0BjsA.js} +1 -1
- package/core/built/admin/assets/{tags-C3b5AHTm.js → tags-CqHx8i6Q.js} +1 -1
- package/core/built/admin/assets/{ticket-BnxPoED1.js → ticket-BtYGyQvH.js} +1 -1
- package/core/built/admin/assets/{tiers-DHKKzaBK.js → tiers-CPwRaPSt.js} +1 -1
- package/core/built/admin/assets/{toggle-group-U-Oqm2AA.js → toggle-group-QFge4qQs.js} +1 -1
- package/core/built/admin/assets/{topic-filter-28veMlW4.js → topic-filter-DnYtZ5e5.js} +1 -1
- package/core/built/admin/assets/{trash-D6TuYuIs.js → trash-B4ncKmRu.js} +1 -1
- package/core/built/admin/assets/{use-growth-stats-COmCRCzY.js → use-growth-stats-eFO-f1o1.js} +1 -1
- package/core/built/admin/assets/{use-infinite-virtual-scroll-mIEgtLoq.js → use-infinite-virtual-scroll-DTqnBtHM.js} +1 -1
- package/core/built/admin/assets/{use-scroll-restoration-CXVseKDj.js → use-scroll-restoration-o1DrSdlb.js} +1 -1
- package/core/built/admin/assets/{use-simple-pagination-5-LKveLR.js → use-simple-pagination-BsBGNcxc.js} +1 -1
- package/core/built/admin/assets/{user-plus-CKQ-d0d4.js → user-plus-BS8SGBmk.js} +1 -1
- package/core/built/admin/assets/{user-round-check-BWc7Da4S.js → user-round-check-BgOPeBFs.js} +1 -1
- package/core/built/admin/assets/{wallet-cards-BlDtHc6_.js → wallet-cards-Be7G77lR.js} +1 -1
- package/core/built/admin/assets/{web-Bvvtl44p.js → web-BNs01IAt.js} +1 -1
- package/core/built/admin/index.html +5 -5
- package/core/frontend/helpers/cancel_link.js +2 -2
- package/core/server/api/endpoints/authors-public.js +3 -3
- package/core/server/api/endpoints/files.js +2 -1
- package/core/server/api/endpoints/pages-public.js +3 -3
- package/core/server/api/endpoints/posts-public.js +3 -3
- package/core/server/api/endpoints/users.js +6 -2
- package/core/server/api/endpoints/utils/api-filter-utils.js +22 -0
- package/core/server/api/endpoints/utils/api-filter-utils.ts +22 -0
- package/core/server/lib/lexical.js +2 -1
- package/core/server/lib/mobiledoc.js +1 -1
- package/core/server/lib/request-external.js +78 -2
- package/core/server/services/email-service/email-templates/partials/styles.hbs +3 -1
- package/core/server/services/koenig/node-renderers/image-renderer.js +80 -10
- package/core/server/services/koenig/render-utils/srcset-attribute.js +15 -3
- package/core/server/services/members/members-api/controllers/router-controller.js +5 -5
- package/core/server/services/members/members-api/repositories/member-repository.js +1 -1
- package/core/server/services/members/members-api/utils/get-discount-window.js +70 -4
- package/core/server/services/members/members-api/utils/has-active-offer.js +10 -14
- package/core/server/services/oembed/oembed-service.js +9 -1
- package/core/server/services/offers/application/offer-mapper.js +48 -0
- package/core/server/services/offers/application/offers-api.js +2 -2
- package/core/shared/config/defaults.json +1 -1
- package/core/shared/labs.js +2 -1
- package/package.json +6 -6
- package/tsconfig.tsbuildinfo +1 -1
- package/yarn.lock +148 -16
- package/components/tryghost-i18n-6.21.0.tgz +0 -0
- package/core/server/api/endpoints/utils/public-endpoint-utils.js +0 -18
- package/core/server/api/endpoints/utils/public-endpoint-utils.ts +0 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as v,u as b,b as j,l as y,r as k,j as e,L as F,H as P,B,X as E,e as C,f as T,m as H,P as S,A as U,S as x,n as A,s as L,o as M,p as z}from"./index-
|
|
1
|
+
import{k as v,u as b,b as j,l as y,r as k,j as e,L as F,H as P,B,X as E,e as C,f as T,m as H,P as S,A as U,S as x,n as A,s as L,o as M,p as z}from"./index-CM-iA6b-.js";import{T as I}from"./topic-filter-DnYtZ5e5.js";import{S as _}from"./sprout-CLmu2pln.js";const f=({profile:s,update:l,isLoading:t,onOpenChange:r})=>{const o=H("index","me"),{data:m}=o,n=s.handle===m?.handle,p=()=>{l(s.id,{followedByMe:!0})},i=()=>{l(s.id,{followedByMe:!1})},c=j();return e.jsx("div",{className:"flex w-full cursor-pointer items-start gap-3 pt-4 [&:last-of-type>:nth-child(2)]:border-none",onClick:()=>{c(`/profile/${s.handle}`)},children:e.jsxs("div",{className:"flex w-full flex-col gap-1 border-b border-gray-200 pb-4 dark:border-gray-950",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(S,{actor:s,isCurrentUser:n,children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx(U,{author:{icon:{url:s.avatarUrl},name:s.name,handle:s.handle},onClick:()=>r?.(!1)}),e.jsxs("div",{className:"-mt-0.5 flex grow flex-col break-anywhere",children:[e.jsx("span",{className:"line-clamp-1 font-semibold text-black dark:text-white",children:t?e.jsx(x,{className:"w-full max-w-48"}):s.name}),e.jsx("span",{className:"line-clamp-1 text-md text-gray-700 dark:text-gray-600",children:t?e.jsx(x,{className:"w-32"}):s.handle})]})]})}),t?e.jsx("div",{className:"inline-flex items-center",children:e.jsx(x,{className:"w-24"})}):n?null:e.jsx(A,{className:"ml-auto",following:s.followedByMe,handle:s.handle,type:"primary",onFollow:p,onUnfollow:i})]}),e.jsx("div",{className:"pl-[52px]",children:t?e.jsx(x,{className:"w-full max-w-96"}):s.bio&&e.jsx("div",{dangerouslySetInnerHTML:{__html:L(M(z(s.bio,["a","br"])))},className:"ap-profile-content pointer-events-none mt-0 line-clamp-2 max-w-[460px] break-anywhere"})})]})})},W=()=>{const{isExplainerClosed:s,setExplainerClosed:l}=v(),t=b(),r=j(),o=t.topic||"top",{exploreProfilesQuery:m,updateExploreProfile:n}=y("index",o),{data:p,isLoading:i,fetchNextPage:c,hasNextPage:h,isFetchingNextPage:u}=m,g=Array(10).fill(null).map((a,d)=>({id:`skeleton-${d}`,name:"",handle:"",avatarUrl:"",bio:"",url:"",followedByMe:!1})),w=p?.pages.flatMap(a=>a.accounts)||[];return k.useEffect(()=>{const a=document.querySelector(".load-more-trigger");if(!a)return;const d=new IntersectionObserver(N=>{N[0].isIntersecting&&h&&!u&&c()},{threshold:.1});return d.observe(a),()=>d.disconnect()},[h,u,c]),e.jsxs(F,{children:[!s&&e.jsxs("div",{className:"relative mb-6 flex items-start gap-1 rounded-md bg-gradient-to-r from-[#CFB0FF66] to-[#B6E8FF66] p-4 pr-10 dark:from-[#CFB0FF20] dark:to-[#B6E8FF20]",children:[e.jsx("div",{className:"min-w-[46px]",children:e.jsx(_,{className:"text-purple",size:46,strokeWidth:.75})}),e.jsxs("div",{className:"mt-1 flex flex-col gap-[2px]",children:[e.jsx(P,{className:"text-pretty",children:"The fastest way to grow your followers, is to follow others!"}),e.jsx("p",{className:"2xl:text-pretty text-balance text-sm text-black/60 dark:text-white/60",children:"Here are some recommendations to get you started, from Ghost publishers and other great accounts from around the social web."})]}),e.jsx(B,{className:"absolute right-4 top-[17px] size-6 opacity-40",variant:"link",onClick:()=>l(!0),children:e.jsx(E,{size:20})})]}),e.jsx(I,{currentTopic:o,excludeTopics:["following"],onTopicChange:a=>{a==="top"?r("/explore",{replace:!0}):r(`/explore/${a}`,{replace:!0})}}),e.jsx("div",{className:"mt-12 flex flex-col gap-12 pb-20 max-md:mt-5",children:i?e.jsx("div",{children:g.map(a=>e.jsx("div",{className:"mx-auto w-full max-w-[640px]",children:e.jsx(f,{isLoading:i,profile:a,update:()=>{}})},a.id))}):e.jsxs("div",{className:"mx-auto flex w-full max-w-[640px] flex-col items-center",children:[e.jsx("div",{className:"w-full",children:w.map(a=>e.jsx(C.Fragment,{children:e.jsx(f,{isLoading:!1,profile:a,update:n})},a.id))}),e.jsx("div",{className:"load-more-trigger h-4 w-full"}),u&&e.jsx("div",{className:"mt-2 flex w-full justify-center",children:e.jsx(T,{size:"sm"})})]})})]})};export{W as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cH as wv,df as x0}from"./index-
|
|
1
|
+
import{cH as wv,df as x0}from"./index-CM-iA6b-.js";import{r as qv,a as Ev,b as R0,c as _0,d as A0,e as M0,f as Ae,g as L0,h as N0,i as $v,j as Sv,k as k0,l as F0,m as C0,n as D0,o as P0,p as U0}from"./_baseAssignValue-DPyNU5o6.js";function B0(e,i){for(var c=0;c<i.length;c++){const l=i[c];if(typeof l!="string"&&!Array.isArray(l)){for(const v in l)if(v!=="default"&&!(v in e)){const g=Object.getOwnPropertyDescriptor(l,v);g&&Object.defineProperty(e,v,g.get?g:{enumerable:!0,get:()=>l[v]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var ht,Ys;function j0(){if(Ys)return ht;Ys=1;var e=qv(),i=Ev(),c=Object.prototype,l=c.hasOwnProperty;function v(g,b,m){var T=g[b];(!(l.call(g,b)&&i(T,m))||m===void 0&&!(b in g))&&e(g,b,m)}return ht=v,ht}var vt,Js;function V0(){if(Js)return vt;Js=1;var e=j0(),i=qv();function c(l,v,g,b){var m=!g;g||(g={});for(var T=-1,C=v.length;++T<C;){var A=v[T],S=b?b(g[A],l[A],A,g,l):void 0;S===void 0&&(S=l[A]),m?i(g,A,S):e(g,A,S)}return g}return vt=c,vt}var mt,Xs;function H0(){if(Xs)return mt;Xs=1;function e(i){var c=[];if(i!=null)for(var l in Object(i))c.push(l);return c}return mt=e,mt}var yt,Qs;function Z0(){if(Qs)return yt;Qs=1;var e=R0(),i=_0(),c=H0(),l=Object.prototype,v=l.hasOwnProperty;function g(b){if(!e(b))return c(b);var m=i(b),T=[];for(var C in b)C=="constructor"&&(m||!v.call(b,C))||T.push(C);return T}return yt=g,yt}var pt,Ks;function W0(){if(Ks)return pt;Ks=1;var e=A0(),i=Z0(),c=M0();function l(v){return c(v)?e(v,!0):i(v)}return pt=l,pt}var gt,rf;function z0(){if(rf)return gt;rf=1;var e=Ae(),i=L0();function c(l){return i(e(l).toLowerCase())}return gt=c,gt}var bt,ef;function G0(){if(ef)return bt;ef=1;function e(i,c,l,v){var g=-1,b=i==null?0:i.length;for(v&&b&&(l=i[++g]);++g<b;)l=c(l,i[g],g,i);return l}return bt=e,bt}var wt,tf;function Iv(){if(tf)return wt;tf=1;function e(i){return function(c){return i?.[c]}}return wt=e,wt}var qt,nf;function Y0(){if(nf)return qt;nf=1;var e=Iv(),i={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},c=e(i);return qt=c,qt}var Et,af;function J0(){if(af)return Et;af=1;var e=Y0(),i=Ae(),c=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,l="\\u0300-\\u036f",v="\\ufe20-\\ufe2f",g="\\u20d0-\\u20ff",b=l+v+g,m="["+b+"]",T=RegExp(m,"g");function C(A){return A=i(A),A&&A.replace(c,e).replace(T,"")}return Et=C,Et}var $t,uf;function X0(){if(uf)return $t;uf=1;var e=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function i(c){return c.match(e)||[]}return $t=i,$t}var St,of;function Q0(){if(of)return St;of=1;var e=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function i(c){return e.test(c)}return St=i,St}var It,sf;function K0(){if(sf)return It;sf=1;var e="\\ud800-\\udfff",i="\\u0300-\\u036f",c="\\ufe20-\\ufe2f",l="\\u20d0-\\u20ff",v=i+c+l,g="\\u2700-\\u27bf",b="a-z\\xdf-\\xf6\\xf8-\\xff",m="\\xac\\xb1\\xd7\\xf7",T="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",C="\\u2000-\\u206f",A=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",S="A-Z\\xc0-\\xd6\\xd8-\\xde",O="\\ufe0e\\ufe0f",w=m+T+C+A,F="['’]",_="["+w+"]",D="["+v+"]",M="\\d+",B="["+g+"]",j="["+b+"]",U="[^"+e+w+M+g+b+S+"]",R="\\ud83c[\\udffb-\\udfff]",X="(?:"+D+"|"+R+")",H="[^"+e+"]",Z="(?:\\ud83c[\\udde6-\\uddff]){2}",Q="[\\ud800-\\udbff][\\udc00-\\udfff]",pr="["+S+"]",or="\\u200d",Er="(?:"+j+"|"+U+")",fr="(?:"+pr+"|"+U+")",br="(?:"+F+"(?:d|ll|m|re|s|t|ve))?",sr="(?:"+F+"(?:D|LL|M|RE|S|T|VE))?",Mr=X+"?",cr="["+O+"]?",Vr="(?:"+or+"(?:"+[H,Z,Q].join("|")+")"+cr+Mr+")*",Hr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",xr="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",tr=cr+Mr+Vr,dr="(?:"+[B,Z,Q].join("|")+")"+tr,Lr=RegExp([pr+"?"+j+"+"+br+"(?="+[_,pr,"$"].join("|")+")",fr+"+"+sr+"(?="+[_,pr+Er,"$"].join("|")+")",pr+"?"+Er+"+"+br,pr+"+"+sr,xr,Hr,M,dr].join("|"),"g");function Or(Zr){return Zr.match(Lr)||[]}return It=Or,It}var Ot,ff;function rp(){if(ff)return Ot;ff=1;var e=X0(),i=Q0(),c=Ae(),l=K0();function v(g,b,m){return g=c(g),b=m?void 0:b,b===void 0?i(g)?l(g):e(g):g.match(b)||[]}return Ot=v,Ot}var Tt,lf;function Ov(){if(lf)return Tt;lf=1;var e=G0(),i=J0(),c=rp(),l="['’]",v=RegExp(l,"g");function g(b){return function(m){return e(c(i(m).replace(v,"")),b,"")}}return Tt=g,Tt}var xt,cf;function ep(){if(cf)return xt;cf=1;var e=z0(),i=Ov(),c=i(function(l,v,g){return v=v.toLowerCase(),l+(g?e(v):v)});return xt=c,xt}var Rt,df;function tp(){if(df)return Rt;df=1;var e=Object.prototype,i=e.hasOwnProperty;function c(l,v){return l!=null&&i.call(l,v)}return Rt=c,Rt}var _t,hf;function np(){if(hf)return _t;hf=1;var e=tp(),i=N0();function c(l,v){return l!=null&&i(l,v,e)}return _t=c,_t}let Be;const ip=new Uint8Array(16);function ap(){if(!Be&&(Be=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Be))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Be(ip)}const wr=[];for(let e=0;e<256;++e)wr.push((e+256).toString(16).slice(1));function up(e,i=0){return wr[e[i+0]]+wr[e[i+1]]+wr[e[i+2]]+wr[e[i+3]]+"-"+wr[e[i+4]]+wr[e[i+5]]+"-"+wr[e[i+6]]+wr[e[i+7]]+"-"+wr[e[i+8]]+wr[e[i+9]]+"-"+wr[e[i+10]]+wr[e[i+11]]+wr[e[i+12]]+wr[e[i+13]]+wr[e[i+14]]+wr[e[i+15]]}let vf,At,Mt=0,Lt=0;function op(e,i,c){let l=0;const v=new Array(16);e=e||{};let g=e.node||vf,b=e.clockseq!==void 0?e.clockseq:At;if(g==null||b==null){const O=e.random||(e.rng||ap)();g==null&&(g=vf=[O[0]|1,O[1],O[2],O[3],O[4],O[5]]),b==null&&(b=At=(O[6]<<8|O[7])&16383)}let m=e.msecs!==void 0?e.msecs:Date.now(),T=e.nsecs!==void 0?e.nsecs:Lt+1;const C=m-Mt+(T-Lt)/1e4;if(C<0&&e.clockseq===void 0&&(b=b+1&16383),(C<0||m>Mt)&&e.nsecs===void 0&&(T=0),T>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Mt=m,Lt=T,At=b,m+=122192928e5;const A=((m&268435455)*1e4+T)%4294967296;v[l++]=A>>>24&255,v[l++]=A>>>16&255,v[l++]=A>>>8&255,v[l++]=A&255;const S=m/4294967296*1e4&268435455;v[l++]=S>>>8&255,v[l++]=S&255,v[l++]=S>>>24&15|16,v[l++]=S>>>16&255,v[l++]=b>>>8|128,v[l++]=b&255;for(let O=0;O<6;++O)v[l+O]=g[O];return i||up(v)}function sp(e,i){const c=(e.stack?.split(/\n/g)||[])[1],[l,...v]=i.stack?.split(/\n/g)||[];return[l,c,...v].join(`
|
|
2
2
|
`)}var fp=Object.defineProperty,lp=(e,i,c)=>i in e?fp(e,i,{enumerable:!0,configurable:!0,writable:!0,value:c}):e[i]=c,Dr=(e,i,c)=>lp(e,typeof i!="symbol"?i+"":i,c);class rr extends Error{constructor(i={}){super(),Dr(this,"statusCode"),Dr(this,"errorType"),Dr(this,"level"),Dr(this,"id"),Dr(this,"context"),Dr(this,"help"),Dr(this,"errorDetails"),Dr(this,"code"),Dr(this,"property"),Dr(this,"redirect"),Dr(this,"hideStack"),this.statusCode=500,this.errorType="InternalServerError",this.level="normal",this.message="The server has encountered an error.",this.id=op(),this.id=i.id||this.id,this.statusCode=i.statusCode||this.statusCode,this.level=i.level||this.level,this.context=i.context,this.help=i.help,this.errorType=this.name=i.errorType||this.errorType,this.errorDetails=i.errorDetails,this.code=i.code||null,this.property=i.property||null,this.redirect=i.redirect||null,this.message=i.message||this.message,this.hideStack=i.hideStack||!1,i.err&&(typeof i.err=="string"&&(i.err=new Error(i.err)),Object.getOwnPropertyNames(i.err).forEach(c=>{if(["errorType","name","statusCode","message","level"].indexOf(c)===-1){if(c==="code"){this[c]=this[c]||i.err[c];return}if(c==="stack"&&!this.hideStack){this[c]=sp(this,i.err);return}this[c]=i.err[c]||this[c]}}))}}const nr=(e,i)=>{const c={...i};return Object.keys(e).forEach(l=>{e[l]!==void 0&&(c[l]=e[l])}),c};class ge extends rr{constructor(i={}){super(nr(i,{statusCode:500,level:"critical",errorType:"InternalServerError",message:"The server has encountered an error."}))}}class Tv extends rr{constructor(i={}){super(nr(i,{statusCode:400,level:"critical",errorType:"IncorrectUsageError",message:"We detected a misuse. Please read the stack trace."}))}}class xv extends rr{constructor(i={}){super(nr(i,{statusCode:404,errorType:"NotFoundError",message:"Resource could not be found.",hideStack:!0}))}}class Co extends rr{constructor(i={}){super(nr(i,{statusCode:400,errorType:"BadRequestError",message:"The request could not be understood."}))}}class Rv extends rr{constructor(i={}){super(nr(i,{statusCode:401,errorType:"UnauthorizedError",message:"You are not authorised to make this request."}))}}class Do extends rr{constructor(i={}){super(nr(i,{statusCode:403,errorType:"NoPermissionError",message:"You do not have permission to perform this request."}))}}class Po extends rr{constructor(i={}){super(nr(i,{statusCode:422,errorType:"ValidationError",message:"The request failed validation."}))}}class _v extends rr{constructor(i={}){super(nr(i,{statusCode:415,errorType:"UnsupportedMediaTypeError",message:"The media in the request is not supported by the server."}))}}class Av extends rr{constructor(i={}){super(nr(i,{statusCode:429,errorType:"TooManyRequestsError",message:"Server has received too many similar requests in a short space of time."}))}}class Uo extends rr{constructor(i={}){super(nr(i,{statusCode:503,errorType:"MaintenanceError",message:"The server is temporarily down for maintenance."}))}}class Mv extends rr{constructor(i={}){super(nr(i,{statusCode:405,errorType:"MethodNotAllowedError",message:"Method not allowed for resource."}))}}class Lv extends rr{constructor(i={}){super(nr(i,{statusCode:406,errorType:"RequestNotAcceptableError",message:"Request not acceptable for provided Accept-Version header.",hideStack:!0}))}}class Nv extends rr{constructor(i={}){super(nr(i,{statusCode:416,errorType:"RangeNotSatisfiableError",message:"Range not satisfiable for provided Range header.",hideStack:!0}))}}class kv extends rr{constructor(i={}){super(nr(i,{statusCode:413,errorType:"RequestEntityTooLargeError",message:"Request was too big for the server to handle."}))}}class Fv extends rr{constructor(i={}){super(nr(i,{statusCode:503,errorType:"TokenRevocationError",message:"Token is no longer available."}))}}class Cv extends rr{constructor(i={}){super(nr(i,{statusCode:400,errorType:"VersionMismatchError",message:"Requested version does not match server version."}))}}class Dv extends rr{constructor(i={}){super(nr(i,{statusCode:500,errorType:"DataExportError",message:"The server encountered an error whilst exporting data."}))}}class Pv extends rr{constructor(i={}){super(nr(i,{statusCode:500,errorType:"DataImportError",message:"The server encountered an error whilst importing data."}))}}class Uv extends rr{constructor(i={}){super(nr(i,{statusCode:500,errorType:"EmailError",message:"The server encountered an error whilst sending email."}))}}class Bv extends rr{constructor(i={}){super(nr(i,{statusCode:422,errorType:"ThemeValidationError",message:"The theme has a validation error.",errorDetails:{}}))}}class jv extends rr{constructor(i={}){super(nr(i,{statusCode:409,errorType:"DisabledFeatureError",message:"Unable to complete the request, this feature is disabled."}))}}class Vv extends rr{constructor(i={}){super(nr(i,{statusCode:409,errorType:"UpdateCollisionError",message:"Unable to complete the request, there was a conflict."}))}}class Hv extends rr{constructor(i={}){super(nr(i,{errorType:"HostLimitError",hideStack:!0,statusCode:403,message:"Unable to complete the request, this resource is limited."}))}}class Zv extends rr{constructor(i={}){super(nr(i,{errorType:"HelperWarning",hideStack:!0,statusCode:400,message:"A theme helper has done something unexpected."}))}}class Wv extends rr{constructor(i={}){super(nr(i,{errorType:"PasswordResetRequiredError",statusCode:401,message:"For security, you need to create a new password. An email has been sent to you with instructions!"}))}}class zv extends rr{constructor(i={}){super(nr(i,{errorType:"UnhandledJobError",message:"Processed job threw an unhandled error",level:"critical"}))}}class Gv extends rr{constructor(i={}){super(nr(i,{errorType:"NoContentError",statusCode:204,hideStack:!0}))}}class Yv extends rr{constructor(i={}){super(nr(i,{errorType:"ConflictError",statusCode:409,message:"The server has encountered an conflict."}))}}class Jv extends rr{constructor(i={}){super(nr(i,{errorType:"MigrationError",message:"An error has occurred applying a database migration.",level:"critical"}))}}const Xv=Object.freeze(Object.defineProperty({__proto__:null,BadRequestError:Co,ConflictError:Yv,DataExportError:Dv,DataImportError:Pv,DisabledFeatureError:jv,EmailError:Uv,HelperWarning:Zv,HostLimitError:Hv,IncorrectUsageError:Tv,InternalServerError:ge,MaintenanceError:Uo,MethodNotAllowedError:Mv,MigrationError:Jv,NoContentError:Gv,NoPermissionError:Do,NotFoundError:xv,PasswordResetRequiredError:Wv,RangeNotSatisfiableError:Nv,RequestEntityTooLargeError:kv,RequestNotAcceptableError:Lv,ThemeValidationError:Bv,TokenRevocationError:Fv,TooManyRequestsError:Av,UnauthorizedError:Rv,UnhandledJobError:zv,UnsupportedMediaTypeError:_v,UpdateCollisionError:Vv,ValidationError:Po,VersionMismatchError:Cv},Symbol.toStringTag,{value:"Module"}));/**
|
|
3
3
|
* @license Apache-2.0
|
|
4
4
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,bC as A,e as u,b as g,bD as z,r as j,by as E,bz as T,L as S,E as M,c as P,bE as U,S as w,A as $,B as L,bq as B,n as C,h as v,d as W,p as _,bF as D,bG as H,f as O,P as q}from"./index-CX1A5TwO.js";import{A as G}from"./at-sign-DyMz5le1.js";import{R as V,U as K}from"./user-round-check-BWc7Da4S.js";import{R as Q}from"./reply-DXS-C-Rk.js";const F=({notificationType:a,size:l="lg",className:i})=>{let r,s="";const n="white",o=l==="sm"?13:20,c=l==="sm"?2:1.5;switch(a){case"follow":r=t.jsx(K,{className:`-mr-0.5 -mt-0.5 ${l==="sm"&&"size-[11px]"}`,color:n,size:o,strokeWidth:c}),s="bg-blue-600";break;case"like":r=t.jsx(A,{className:`${l==="sm"?"size-[11px]":"mt-px size-5"}`,color:n,strokeWidth:c}),s="bg-pink-600";break;case"reply":r=t.jsx(Q,{className:"mb-px mr-px",color:n,size:o,strokeWidth:c}),s="bg-purple-600";break;case"repost":r=t.jsx(V,{color:n,size:o,strokeWidth:c}),s="bg-green-500";break;case"mention":r=t.jsx(G,{className:`${l==="sm"?"size-[12px]":"size-5"}`,color:n,size:o,strokeWidth:c}),s="bg-orange-500";break}return t.jsx("div",{className:`flex ${l==="sm"?"size-5":"size-9"} items-center justify-center rounded-full ${s} ${i&&i}`,children:r})},Z=u.createContext(void 0),h=({isGrouped:a,centerAlign:l,children:i,onClick:r,url:s,className:n})=>t.jsx(Z.Provider,{value:{onClick:r,url:s},children:t.jsx("div",{className:`group relative -mx-4 -my-px ${a?"grid":"flex"} ${l?"items-center":"items-start"} cursor-pointer grid-cols-[auto_1fr] gap-x-4 gap-y-2.5 rounded-lg px-4 py-5 text-left break-anywhere hover:bg-gray-75 ${n}`,role:"button",onClick:r,children:i})}),J=({size:a="lg",type:l})=>t.jsx("div",{className:"col-start-1 row-start-1",children:t.jsx(F,{notificationType:l,size:a})}),X=({children:a})=>t.jsx("div",{className:"col-start-2 row-start-1 flex gap-2",children:a}),Y=({children:a})=>t.jsx("div",{className:"col-start-2 row-start-2 -mt-0.5 grow overflow-hidden",children:a});h.Icon=J;h.Avatars=X;h.Content=Y;const ee=()=>t.jsx("div",{className:"h-px w-full bg-gray-150 dark:bg-gray-950"});function te(a){const r=new Date(a).getTime();return(Math.floor(r/864e5)*864e5).toString()}function se(a){const l={};let i=null,r=0;return a.forEach(s=>{s.type!==i&&(r+=1,i=s.type);let n="";const o=`_${te(s.createdAt)}`,c=`_seq${r}`;switch(s.type){case"like":s.post?.id&&(n=`like_${s.post.id}${o}${c}`);break;case"reply":n=`reply_${s.id}`;break;case"repost":s.post?.id&&(n=`repost_${s.post.id}${o}${c}`);break;case"follow":n=`follow_${o}${c}`;break;case"mention":n=`mention_${s.id}`;break}l[n]||(l[n]={id:s.id,type:s.type,actors:[],post:s.post,inReplyTo:s.inReplyTo,createdAt:s.createdAt}),l[n].actors.find(f=>f.id===s.actor.id)||l[n].actors.push(s.actor)}),Object.values(l)}const ae=({group:a})=>{const[l,...i]=a.actors,r=i.length>0,s="cursor-pointer font-semibold hover:underline text-black dark:text-white",n=g(),o=t.jsxs(t.Fragment,{children:[t.jsx(q,{actor:l,align:"center",isCurrentUser:!1,children:t.jsx("span",{className:s,onClick:c=>{c?.stopPropagation(),v(l.handle,n)},children:l.name})}),r&&` and ${i.length} ${i.length>1?"others":"other"}`]});switch(a.type){case"follow":return t.jsxs(t.Fragment,{children:[o," followed you"]});case"like":return t.jsxs(t.Fragment,{children:[o," liked your ",a.post?.type==="article"?"post":"note"]});case"repost":return t.jsxs(t.Fragment,{children:[o," reposted your ",a.post?.type==="article"?"post":"note"]});case"reply":if(a.inReplyTo&&typeof a.inReplyTo!="string")return o;break;case"mention":return o}return t.jsx(t.Fragment,{})},ne=({content:a,className:l,stripTags:i=[]})=>{const r=j.useRef(null),s=g();return j.useEffect(()=>{const n=r.current;if(!n)return;const o=c=>{const y=c.target.closest("a[data-profile]");if(y){const x=y.getAttribute("data-profile")?.trim();/^@([\w.-]+)@([\w-]+\.[\w.-]+[a-zA-Z])$/.test(x||"")&&x&&(c.preventDefault(),c.stopPropagation(),v(x,s))}};return n.addEventListener("click",o),()=>{n.removeEventListener("click",o)}},[s,a]),t.jsx("div",{dangerouslySetInnerHTML:{__html:_(a||"",i)},ref:r,className:l})},oe=()=>{const[a,l]=u.useState({}),i=g(),r=e=>{l(d=>({...d,[e]:!d[e]}))},s=()=>{},n=5,{data:o,error:c,fetchNextPage:f,hasNextPage:y,isFetchingNextPage:x,isLoading:b}=z("index"),k=o?.pages.flatMap(e=>se(e.notifications))??Array(10).fill({actors:[{}]}),p=j.useRef(null),N=j.useRef(null);j.useEffect(()=>(p.current&&p.current.disconnect(),p.current=new IntersectionObserver(e=>{e[0].isIntersecting&&y&&!x&&f()}),N.current&&p.current.observe(N.current),()=>{p.current&&p.current.disconnect()}),[y,x,f]);const I=(e,d)=>{switch(e.type){case"like":e.post&&i(`/${e.post.type==="article"?"reader":"notes"}/${encodeURIComponent(e.post.id)}`);break;case"reply":e.post&&e.inReplyTo&&i(`/notes/${encodeURIComponent(e.post.id)}`);break;case"repost":e.post&&i(`/${e.post.type==="article"?"reader":"notes"}/${encodeURIComponent(e.post.id)}`);break;case"follow":e.actors.length>1?r(e.id||`${e.type}_${d}`):v(e.actors[0].handle,i);break;case"mention":e.post&&i(`/notes/${encodeURIComponent(e.post.id)}`);break}};return c&&E(c)?t.jsx(T,{errorCode:c.code,statusCode:c.statusCode}):t.jsx(S,{children:t.jsxs("div",{className:"z-0 flex w-full flex-col items-center",children:[b===!1&&k.length===0&&t.jsxs(M,{children:[t.jsx(P,{children:t.jsx(U,{})}),"Quiet for now, but not for long! When someone likes, boosts, or replies to you, you'll find it here."]}),k.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"my-8 flex w-full max-w-[620px] flex-col max-md:mt-5",children:k.map((e,d)=>t.jsxs(u.Fragment,{children:[t.jsxs(h,{centerAlign:e.actors.length<2&&e.type==="follow",className:"hover:bg-gray-75 dark:hover:bg-gray-950",isGrouped:e.actors.length>1,onClick:()=>I(e,d),children:[b?t.jsx(w,{className:"rounded-full",containerClassName:"flex h-10 w-10"}):e.actors.length>1?t.jsx(h.Icon,{type:e.type}):t.jsxs("div",{className:"relative",children:[t.jsx($,{author:{icon:{url:e.actors[0].avatarUrl||""},name:e.actors[0].name,handle:e.actors[0].handle},size:"notification"},e.actors[0].id),t.jsx(F,{className:"absolute -bottom-1 -right-1 z-10 border-2 border-white dark:border-black",notificationType:e.type,size:"sm"})]}),e.actors.length>1&&t.jsx(h.Avatars,{children:t.jsxs("div",{className:"flex w-full flex-col",children:[t.jsxs("div",{className:"relative flex items-center pl-2",children:[!a[e.id||`${e.type}_${d}`]&&e.actors.slice(0,n).map(m=>t.jsx($,{author:{icon:{url:m.avatarUrl||""},name:m.name,handle:m.handle},className:"-ml-2 !bg-[#F3F3F3] outline outline-2 outline-white group-hover:!bg-[#EDEEF0] group-hover:outline-gray-75 dark:outline-black group-hover:dark:outline-gray-950",size:"notification"},m.id)),e.actors.length>n&&!a[e.id||`${e.type}_${d}`]&&t.jsx("div",{className:"absolute right-[28px] z-10 flex size-9 items-center justify-center rounded-full bg-black/50 text-base font-semibold tracking-tightest text-white",children:`+${e.actors.length-n}`}),e.actors.length>1&&t.jsxs(L,{className:`group flex items-center gap-0.5 text-gray-700 hover:bg-transparent hover:text-black dark:text-gray-600 dark:hover:text-white ${a[e.id||`${e.type}_${d}`]?"ml-[-20px]":"ml-0 w-[28px]"}`,variant:"ghost",onClick:m=>{m?.stopPropagation(),r(e.id||`${e.type}_${d}`)},children:[t.jsx(B,{className:`${a[e.id||`${e.type}_${d}`]?"rotate-180":""}`,size:20,strokeWidth:1.5}),a[e.id||`${e.type}_${d}`]?"Hide":t.jsx("span",{className:"sr-only",children:"Show all"})]})]}),t.jsx("div",{className:`overflow-hidden transition-all duration-300 ease-in-out ${a[e.id||`${e.type}_${d}`]?"mb-2 max-h-[1384px] opacity-100":"max-h-0 opacity-0"}`,children:a[e.id||`${e.type}_${d}`]&&e.actors.length>1&&t.jsx("div",{className:"flex flex-col gap-2 pt-2",children:e.actors.map(m=>t.jsxs("div",{className:"group/item flex items-center justify-between gap-4 break-anywhere",onClick:R=>{R?.stopPropagation(),v(m.handle,i)},children:[t.jsxs("div",{className:"flex min-w-0 items-center",children:[t.jsx($,{author:{icon:{url:m.avatarUrl||""},name:m.name,handle:m.handle},size:"xs"}),t.jsx("span",{className:"ml-2 line-clamp-1 text-base font-semibold group-hover/item:underline dark:text-white",children:m.name}),t.jsx("span",{className:"ml-1 line-clamp-1 text-base text-gray-700 dark:text-gray-600",children:m.handle})]}),e.type==="follow"&&!m.followedByMe&&t.jsx(C,{following:!1,handle:m.handle,variant:"link"})]},m.id))})})]})}),t.jsxs(h.Content,{children:[t.jsx("div",{children:b?t.jsxs(t.Fragment,{children:[t.jsx(w,{}),t.jsx(w,{className:"w-full max-w-60"})]}):t.jsxs("div",{className:"flex justify-between",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"truncate",children:t.jsx(ae,{group:e})}),e.actors.length<2&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mt-px text-[8px] text-gray-700 dark:text-gray-600",children:"•"}),t.jsx("span",{className:"mt-0.5 text-sm text-gray-700 dark:text-gray-600",children:W(e,!1)})]})]}),e.actors.length===1&&(e.type==="follow"||e.type==="reply"||e.type==="mention")&&!e.actors[0].followedByMe&&t.jsx(C,{following:!1,handle:e.actors[0].handle,variant:"link"})]})}),(e.type==="reply"&&e.inReplyTo||e.type==="mention"||e.type==="like"&&!e.post?.name&&e.post?.content||e.type==="repost"&&!e.post?.name&&e.post?.content)&&(e.type!=="reply"&&e.type!=="mention"?t.jsxs("div",{className:"ap-note-content mt-0.5 line-clamp-1 text-pretty text-sm text-gray-700 dark:text-gray-600",children:[e.post?.type==="article"&&e.post?.title&&t.jsxs(t.Fragment,{children:[e.post.title," — "]}),t.jsx("span",{dangerouslySetInnerHTML:{__html:_(e.post?.content||"")}})]}):t.jsx(t.Fragment,{children:t.jsxs("div",{className:"mt-2.5 rounded-md bg-gray-100 px-5 py-[14px] group-hover:bg-gray-200 dark:bg-gray-925/30 group-hover:dark:bg-black/40",children:[t.jsx(ne,{className:"ap-note-content text-pretty",content:e.post?.content||"",stripTags:["a"]}),e.post&&e.post.attachments&&e.post.attachments.length>0&&t.jsx("div",{className:"notification-attachments mb-1 [&_.attachment-gallery]:flex [&_.attachment-gallery]:flex-wrap [&_img]:aspect-square [&_img]:max-w-[calc(20%-6.4px)]",children:D({...e.post,type:"Note",attachment:e.post.attachments})})]})})),(e.type==="reply"&&e.post||e.type==="mention")&&t.jsx("div",{className:"mt-1.5",children:t.jsx(H,{actor:{...e.actors[0],icon:{url:e.actors[0].avatarUrl||""},id:e.actors[0].url,preferredUsername:e.actors[0].handle?.replace(/^@([^@]+)@.*$/,"$1")||"unknown"},buttonClassName:"hover:bg-gray-200",commentCount:e.post.replyCount||0,layout:"notification",likeCount:e.post.likeCount||0,object:{...e.post,liked:e.post.likedByMe,reposted:e.post.repostedByMe},repostCount:e.post.repostCount||0,onLikeClick:s})})]})]}),d<k.length-1&&t.jsx("div",{className:"pl-[52px]",children:t.jsx(ee,{})})]},e.id||`${e.type}_${d}`))}),t.jsx("div",{ref:N,className:"h-1"}),x&&t.jsx("div",{className:"-mt-4 mb-8 flex flex-col items-center justify-center space-y-4 text-center",children:t.jsx(O,{size:"md"})})]})]})})};export{oe as default};
|
|
1
|
+
import{j as t,bC as A,e as u,b as g,bD as z,r as j,by as E,bz as T,L as S,E as M,c as P,bE as U,S as w,A as $,B as L,bq as B,n as C,h as v,d as W,p as _,bF as D,bG as H,f as O,P as q}from"./index-CM-iA6b-.js";import{A as G}from"./at-sign-_JfhlimD.js";import{R as V,U as K}from"./user-round-check-BgOPeBFs.js";import{R as Q}from"./reply-CXnb6Juu.js";const F=({notificationType:a,size:l="lg",className:i})=>{let r,s="";const n="white",o=l==="sm"?13:20,c=l==="sm"?2:1.5;switch(a){case"follow":r=t.jsx(K,{className:`-mr-0.5 -mt-0.5 ${l==="sm"&&"size-[11px]"}`,color:n,size:o,strokeWidth:c}),s="bg-blue-600";break;case"like":r=t.jsx(A,{className:`${l==="sm"?"size-[11px]":"mt-px size-5"}`,color:n,strokeWidth:c}),s="bg-pink-600";break;case"reply":r=t.jsx(Q,{className:"mb-px mr-px",color:n,size:o,strokeWidth:c}),s="bg-purple-600";break;case"repost":r=t.jsx(V,{color:n,size:o,strokeWidth:c}),s="bg-green-500";break;case"mention":r=t.jsx(G,{className:`${l==="sm"?"size-[12px]":"size-5"}`,color:n,size:o,strokeWidth:c}),s="bg-orange-500";break}return t.jsx("div",{className:`flex ${l==="sm"?"size-5":"size-9"} items-center justify-center rounded-full ${s} ${i&&i}`,children:r})},Z=u.createContext(void 0),h=({isGrouped:a,centerAlign:l,children:i,onClick:r,url:s,className:n})=>t.jsx(Z.Provider,{value:{onClick:r,url:s},children:t.jsx("div",{className:`group relative -mx-4 -my-px ${a?"grid":"flex"} ${l?"items-center":"items-start"} cursor-pointer grid-cols-[auto_1fr] gap-x-4 gap-y-2.5 rounded-lg px-4 py-5 text-left break-anywhere hover:bg-gray-75 ${n}`,role:"button",onClick:r,children:i})}),J=({size:a="lg",type:l})=>t.jsx("div",{className:"col-start-1 row-start-1",children:t.jsx(F,{notificationType:l,size:a})}),X=({children:a})=>t.jsx("div",{className:"col-start-2 row-start-1 flex gap-2",children:a}),Y=({children:a})=>t.jsx("div",{className:"col-start-2 row-start-2 -mt-0.5 grow overflow-hidden",children:a});h.Icon=J;h.Avatars=X;h.Content=Y;const ee=()=>t.jsx("div",{className:"h-px w-full bg-gray-150 dark:bg-gray-950"});function te(a){const r=new Date(a).getTime();return(Math.floor(r/864e5)*864e5).toString()}function se(a){const l={};let i=null,r=0;return a.forEach(s=>{s.type!==i&&(r+=1,i=s.type);let n="";const o=`_${te(s.createdAt)}`,c=`_seq${r}`;switch(s.type){case"like":s.post?.id&&(n=`like_${s.post.id}${o}${c}`);break;case"reply":n=`reply_${s.id}`;break;case"repost":s.post?.id&&(n=`repost_${s.post.id}${o}${c}`);break;case"follow":n=`follow_${o}${c}`;break;case"mention":n=`mention_${s.id}`;break}l[n]||(l[n]={id:s.id,type:s.type,actors:[],post:s.post,inReplyTo:s.inReplyTo,createdAt:s.createdAt}),l[n].actors.find(f=>f.id===s.actor.id)||l[n].actors.push(s.actor)}),Object.values(l)}const ae=({group:a})=>{const[l,...i]=a.actors,r=i.length>0,s="cursor-pointer font-semibold hover:underline text-black dark:text-white",n=g(),o=t.jsxs(t.Fragment,{children:[t.jsx(q,{actor:l,align:"center",isCurrentUser:!1,children:t.jsx("span",{className:s,onClick:c=>{c?.stopPropagation(),v(l.handle,n)},children:l.name})}),r&&` and ${i.length} ${i.length>1?"others":"other"}`]});switch(a.type){case"follow":return t.jsxs(t.Fragment,{children:[o," followed you"]});case"like":return t.jsxs(t.Fragment,{children:[o," liked your ",a.post?.type==="article"?"post":"note"]});case"repost":return t.jsxs(t.Fragment,{children:[o," reposted your ",a.post?.type==="article"?"post":"note"]});case"reply":if(a.inReplyTo&&typeof a.inReplyTo!="string")return o;break;case"mention":return o}return t.jsx(t.Fragment,{})},ne=({content:a,className:l,stripTags:i=[]})=>{const r=j.useRef(null),s=g();return j.useEffect(()=>{const n=r.current;if(!n)return;const o=c=>{const y=c.target.closest("a[data-profile]");if(y){const x=y.getAttribute("data-profile")?.trim();/^@([\w.-]+)@([\w-]+\.[\w.-]+[a-zA-Z])$/.test(x||"")&&x&&(c.preventDefault(),c.stopPropagation(),v(x,s))}};return n.addEventListener("click",o),()=>{n.removeEventListener("click",o)}},[s,a]),t.jsx("div",{dangerouslySetInnerHTML:{__html:_(a||"",i)},ref:r,className:l})},oe=()=>{const[a,l]=u.useState({}),i=g(),r=e=>{l(d=>({...d,[e]:!d[e]}))},s=()=>{},n=5,{data:o,error:c,fetchNextPage:f,hasNextPage:y,isFetchingNextPage:x,isLoading:b}=z("index"),k=o?.pages.flatMap(e=>se(e.notifications))??Array(10).fill({actors:[{}]}),p=j.useRef(null),N=j.useRef(null);j.useEffect(()=>(p.current&&p.current.disconnect(),p.current=new IntersectionObserver(e=>{e[0].isIntersecting&&y&&!x&&f()}),N.current&&p.current.observe(N.current),()=>{p.current&&p.current.disconnect()}),[y,x,f]);const I=(e,d)=>{switch(e.type){case"like":e.post&&i(`/${e.post.type==="article"?"reader":"notes"}/${encodeURIComponent(e.post.id)}`);break;case"reply":e.post&&e.inReplyTo&&i(`/notes/${encodeURIComponent(e.post.id)}`);break;case"repost":e.post&&i(`/${e.post.type==="article"?"reader":"notes"}/${encodeURIComponent(e.post.id)}`);break;case"follow":e.actors.length>1?r(e.id||`${e.type}_${d}`):v(e.actors[0].handle,i);break;case"mention":e.post&&i(`/notes/${encodeURIComponent(e.post.id)}`);break}};return c&&E(c)?t.jsx(T,{errorCode:c.code,statusCode:c.statusCode}):t.jsx(S,{children:t.jsxs("div",{className:"z-0 flex w-full flex-col items-center",children:[b===!1&&k.length===0&&t.jsxs(M,{children:[t.jsx(P,{children:t.jsx(U,{})}),"Quiet for now, but not for long! When someone likes, boosts, or replies to you, you'll find it here."]}),k.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"my-8 flex w-full max-w-[620px] flex-col max-md:mt-5",children:k.map((e,d)=>t.jsxs(u.Fragment,{children:[t.jsxs(h,{centerAlign:e.actors.length<2&&e.type==="follow",className:"hover:bg-gray-75 dark:hover:bg-gray-950",isGrouped:e.actors.length>1,onClick:()=>I(e,d),children:[b?t.jsx(w,{className:"rounded-full",containerClassName:"flex h-10 w-10"}):e.actors.length>1?t.jsx(h.Icon,{type:e.type}):t.jsxs("div",{className:"relative",children:[t.jsx($,{author:{icon:{url:e.actors[0].avatarUrl||""},name:e.actors[0].name,handle:e.actors[0].handle},size:"notification"},e.actors[0].id),t.jsx(F,{className:"absolute -bottom-1 -right-1 z-10 border-2 border-white dark:border-black",notificationType:e.type,size:"sm"})]}),e.actors.length>1&&t.jsx(h.Avatars,{children:t.jsxs("div",{className:"flex w-full flex-col",children:[t.jsxs("div",{className:"relative flex items-center pl-2",children:[!a[e.id||`${e.type}_${d}`]&&e.actors.slice(0,n).map(m=>t.jsx($,{author:{icon:{url:m.avatarUrl||""},name:m.name,handle:m.handle},className:"-ml-2 !bg-[#F3F3F3] outline outline-2 outline-white group-hover:!bg-[#EDEEF0] group-hover:outline-gray-75 dark:outline-black group-hover:dark:outline-gray-950",size:"notification"},m.id)),e.actors.length>n&&!a[e.id||`${e.type}_${d}`]&&t.jsx("div",{className:"absolute right-[28px] z-10 flex size-9 items-center justify-center rounded-full bg-black/50 text-base font-semibold tracking-tightest text-white",children:`+${e.actors.length-n}`}),e.actors.length>1&&t.jsxs(L,{className:`group flex items-center gap-0.5 text-gray-700 hover:bg-transparent hover:text-black dark:text-gray-600 dark:hover:text-white ${a[e.id||`${e.type}_${d}`]?"ml-[-20px]":"ml-0 w-[28px]"}`,variant:"ghost",onClick:m=>{m?.stopPropagation(),r(e.id||`${e.type}_${d}`)},children:[t.jsx(B,{className:`${a[e.id||`${e.type}_${d}`]?"rotate-180":""}`,size:20,strokeWidth:1.5}),a[e.id||`${e.type}_${d}`]?"Hide":t.jsx("span",{className:"sr-only",children:"Show all"})]})]}),t.jsx("div",{className:`overflow-hidden transition-all duration-300 ease-in-out ${a[e.id||`${e.type}_${d}`]?"mb-2 max-h-[1384px] opacity-100":"max-h-0 opacity-0"}`,children:a[e.id||`${e.type}_${d}`]&&e.actors.length>1&&t.jsx("div",{className:"flex flex-col gap-2 pt-2",children:e.actors.map(m=>t.jsxs("div",{className:"group/item flex items-center justify-between gap-4 break-anywhere",onClick:R=>{R?.stopPropagation(),v(m.handle,i)},children:[t.jsxs("div",{className:"flex min-w-0 items-center",children:[t.jsx($,{author:{icon:{url:m.avatarUrl||""},name:m.name,handle:m.handle},size:"xs"}),t.jsx("span",{className:"ml-2 line-clamp-1 text-base font-semibold group-hover/item:underline dark:text-white",children:m.name}),t.jsx("span",{className:"ml-1 line-clamp-1 text-base text-gray-700 dark:text-gray-600",children:m.handle})]}),e.type==="follow"&&!m.followedByMe&&t.jsx(C,{following:!1,handle:m.handle,variant:"link"})]},m.id))})})]})}),t.jsxs(h.Content,{children:[t.jsx("div",{children:b?t.jsxs(t.Fragment,{children:[t.jsx(w,{}),t.jsx(w,{className:"w-full max-w-60"})]}):t.jsxs("div",{className:"flex justify-between",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"truncate",children:t.jsx(ae,{group:e})}),e.actors.length<2&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mt-px text-[8px] text-gray-700 dark:text-gray-600",children:"•"}),t.jsx("span",{className:"mt-0.5 text-sm text-gray-700 dark:text-gray-600",children:W(e,!1)})]})]}),e.actors.length===1&&(e.type==="follow"||e.type==="reply"||e.type==="mention")&&!e.actors[0].followedByMe&&t.jsx(C,{following:!1,handle:e.actors[0].handle,variant:"link"})]})}),(e.type==="reply"&&e.inReplyTo||e.type==="mention"||e.type==="like"&&!e.post?.name&&e.post?.content||e.type==="repost"&&!e.post?.name&&e.post?.content)&&(e.type!=="reply"&&e.type!=="mention"?t.jsxs("div",{className:"ap-note-content mt-0.5 line-clamp-1 text-pretty text-sm text-gray-700 dark:text-gray-600",children:[e.post?.type==="article"&&e.post?.title&&t.jsxs(t.Fragment,{children:[e.post.title," — "]}),t.jsx("span",{dangerouslySetInnerHTML:{__html:_(e.post?.content||"")}})]}):t.jsx(t.Fragment,{children:t.jsxs("div",{className:"mt-2.5 rounded-md bg-gray-100 px-5 py-[14px] group-hover:bg-gray-200 dark:bg-gray-925/30 group-hover:dark:bg-black/40",children:[t.jsx(ne,{className:"ap-note-content text-pretty",content:e.post?.content||"",stripTags:["a"]}),e.post&&e.post.attachments&&e.post.attachments.length>0&&t.jsx("div",{className:"notification-attachments mb-1 [&_.attachment-gallery]:flex [&_.attachment-gallery]:flex-wrap [&_img]:aspect-square [&_img]:max-w-[calc(20%-6.4px)]",children:D({...e.post,type:"Note",attachment:e.post.attachments})})]})})),(e.type==="reply"&&e.post||e.type==="mention")&&t.jsx("div",{className:"mt-1.5",children:t.jsx(H,{actor:{...e.actors[0],icon:{url:e.actors[0].avatarUrl||""},id:e.actors[0].url,preferredUsername:e.actors[0].handle?.replace(/^@([^@]+)@.*$/,"$1")||"unknown"},buttonClassName:"hover:bg-gray-200",commentCount:e.post.replyCount||0,layout:"notification",likeCount:e.post.likeCount||0,object:{...e.post,liked:e.post.likedByMe,reposted:e.post.repostedByMe},repostCount:e.post.repostCount||0,onLikeClick:s})})]})]}),d<k.length-1&&t.jsx("div",{className:"pl-[52px]",children:t.jsx(ee,{})})]},e.id||`${e.type}_${d}`))}),t.jsx("div",{ref:N,className:"h-1"}),x&&t.jsx("div",{className:"-mt-4 mb-8 flex flex-col items-center justify-center space-y-4 text-center",children:t.jsx(O,{size:"md"})})]})]})})};export{oe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as X,r as u,b as $,j as e,R as H,T as L,ca as Ne,g as Ce,e as Ue,P as Me,V as Be,A as ae,B as j,n as ie,h as Pe,f as q,bC as De,F as ce,aV as de,a1 as ue,cK as Te,a2 as me,a3 as Q,a4 as Y,a5 as K,H as W,aO as Fe,aX as Oe,a6 as G,a7 as xe,W as U,cs as Re,ct as Ie,cv as Ee,cL as ne,a8 as Se,a9 as Ae,u as fe,aP 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,b2 as Ke,D as We,t as Ge,v as Xe,w as qe,x as Je,Q as Ze,a0 as es,cM as ss,s as re,o as ls,p as ns,cF as z,U as ts,by as rs,bz as os,cN as as,cO as he,cP as is}from"./index-CX1A5TwO.js";import{P as cs}from"./tags-C3b5AHTm.js";import{E as ds}from"./edit-profile-Bi-G8vrq.js";import{T as us,a as ms,b as S,f as _,c as A}from"./tabs-hfT89L_O.js";import{a as xs}from"./settings-BHfStwmS.js";import{U as fs}from"./lucide-react-DHFgHS1l.js";import{C as hs}from"./copy-BdseBMKx.js";import"./label-CNmRJkLy.js";import"./at-sign-DyMz5le1.js";import"./index-BX0_v5NB.js";import"./wallet-cards-BlDtHc6_.js";import"./a-large-small-Cf_hUupE.js";import"./list-filter-BwnQ0Xlp.js";import"./ticket-BnxPoED1.js";import"./loader-circle-CcLEGvsN.js";import"./message-square-text-BkERj4f5.js";import"./hash-tZATAzZa.js";import"./inbox-B-LuWyHY.js";import"./user-plus-CKQ-d0d4.js";import"./minus-C6oMPJo2.js";import"./square-BjZk7vJx.js";import"./user-round-check-BWc7Da4S.js";import"./repeat-Idtsb62O.js";import"./reply-DXS-C-Rk.js";import"./sprout-BKOFkdV8.js";import"./trash-D6TuYuIs.js";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=X("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:"text-gray-600 break-anywhere",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 space-y-4 text-center",children:e.jsx(q,{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 space-y-4 text-center",children:e.jsx(q,{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 space-y-4 text-center",children:e.jsx(q,{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(K,{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(W,{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(W,{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(G,{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(K,{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(G,{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(K,{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(G,{children:[t!=="domain"&&e.jsx(j,{className:"-ml-3 mr-auto 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=X("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(Ke,{})})})]}),T&&!n&&e.jsxs(We,{open:ge,onOpenChange:se,children:[e.jsx(Ge,{children:e.jsx(xs,{children:e.jsx(j,{variant:"secondary",children:"Edit profile"})})}),e.jsxs(Xe,{className:"w-full max-w-[520px]",onOpenAutoFocus:v=>v.preventDefault(),children:[e.jsx(qe,{children:e.jsx(Je,{children:"Profile settings"})}),s&&e.jsx(ds,{account:s,setIsEditingProfile:se})]})]})]}),e.jsx(Ze,{className:"mt-4 truncate break-anywhere",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 relative text-[1.5rem] break-anywhere [&>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(W,{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`})},Js=({})=>{const s=fe(),{data:o,isLoading:n,error:c,refetch:x}=X("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{Js as default};
|
|
1
|
+
import{m as X,r as u,b as $,j as e,R as H,T as L,ca as Ne,g as Ce,e as Ue,P as Me,V as Be,A as ae,B as j,n as ie,h as Pe,f as q,bC as De,F as ce,aV as de,a1 as ue,cK as Te,a2 as me,a3 as Q,a4 as Y,a5 as K,H as W,aO as Fe,aX as Oe,a6 as G,a7 as xe,W as U,cs as Re,ct as Ie,cv as Ee,cL as ne,a8 as Se,a9 as Ae,u as fe,aP 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,b2 as Ke,D as We,t as Ge,v as Xe,w as qe,x as Je,Q as Ze,a0 as es,cM as ss,s as re,o as ls,p as ns,cF as z,U as ts,by as rs,bz as os,cN as as,cO as he,cP as is}from"./index-CM-iA6b-.js";import{P as cs}from"./tags-CqHx8i6Q.js";import{E as ds}from"./edit-profile-BY_oJrQn.js";import{T as us,a as ms,b as S,f as _,c as A}from"./tabs-BMk71Tf2.js";import{a as xs}from"./settings-BC82mM6N.js";import{U as fs}from"./lucide-react-CM0rB7CS.js";import{C as hs}from"./copy-CbX-_mHj.js";import"./label-ChHoKmj0.js";import"./at-sign-_JfhlimD.js";import"./index-C5YCjM6z.js";import"./wallet-cards-Be7G77lR.js";import"./a-large-small-BijOKCoa.js";import"./list-filter-cWuCDOLb.js";import"./ticket-BtYGyQvH.js";import"./loader-circle-B5ILzHHu.js";import"./message-square-text-DVZjnBBF.js";import"./hash-twG7-iIB.js";import"./inbox-BdkIJbSq.js";import"./user-plus-BS8SGBmk.js";import"./minus-BWrVDnd-.js";import"./square-D0Y5-h0C.js";import"./user-round-check-BgOPeBFs.js";import"./repeat-C_xWSLK1.js";import"./reply-CXnb6Juu.js";import"./sprout-CLmu2pln.js";import"./trash-B4ncKmRu.js";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=X("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:"text-gray-600 break-anywhere",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 space-y-4 text-center",children:e.jsx(q,{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 space-y-4 text-center",children:e.jsx(q,{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 space-y-4 text-center",children:e.jsx(q,{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(K,{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(W,{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(W,{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(G,{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(K,{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(G,{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(K,{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(G,{children:[t!=="domain"&&e.jsx(j,{className:"-ml-3 mr-auto 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=X("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(Ke,{})})})]}),T&&!n&&e.jsxs(We,{open:ge,onOpenChange:se,children:[e.jsx(Ge,{children:e.jsx(xs,{children:e.jsx(j,{variant:"secondary",children:"Edit profile"})})}),e.jsxs(Xe,{className:"w-full max-w-[520px]",onOpenAutoFocus:v=>v.preventDefault(),children:[e.jsx(qe,{children:e.jsx(Je,{children:"Profile settings"})}),s&&e.jsx(ds,{account:s,setIsEditingProfile:se})]})]})]}),e.jsx(Ze,{className:"mt-4 truncate break-anywhere",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 relative text-[1.5rem] break-anywhere [&>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(W,{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`})},Js=({})=>{const s=fe(),{data:o,isLoading:n,error:c,refetch:x}=X("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{Js as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as j,r as F,aD as bj,aE as ane,aF as yj}from"./index-
|
|
1
|
+
import{e as j,r as F,aD as bj,aE as ane,aF as yj}from"./index-CM-iA6b-.js";var ed={},lne=Object.defineProperty,cne=(t,e,n)=>e in t?lne(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ye=(t,e,n)=>cne(t,typeof e!="symbol"?e+"":e,n);(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="538e5585-63e3-409d-89b9-b2c2a2cc2bf8",t._sentryDebugIdIdentifier="sentry-dbid-538e5585-63e3-409d-89b9-b2c2a2cc2bf8")}catch{}})();var nn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zo(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Tk(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,r.get?r:{enumerable:!0,get:function(){return t[i]}})}),n}var wj={exports:{}},Mk={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a,z as o,B as s}from"./index-
|
|
1
|
+
import{j as a,z as o,B as s}from"./index-CM-iA6b-.js";const i=({children:e,className:r,...t})=>a.jsx("div",{className:o("flex flex-col",r),...t,children:e}),l=({children:e,className:r,...t})=>a.jsx("div",{className:o("[&_svg]:size-4 flex items-center gap-1.5 text-base h-[22px] font-medium transition-all",r,t.onClick&&"hover:cursor-pointer hover:text-black dark:hover:text-white"),...t,children:e}),d=({children:e,className:r,...t})=>a.jsx("div",{className:o("text-[26px] mt-0.5 tracking-tighter leading-none text-foreground font-semibold",r),...t,children:e}),c=({children:e,className:r,...t})=>a.jsx(s,{className:o("absolute right-4 top-4 z-50 hidden translate-x-10 text-black dark:text-white/80 dark:hover:text-white opacity-0 transition-all duration-200 group-hover:translate-x-0 group-hover:opacity-100 md:!visible md:!block",r),size:"sm",variant:"outline",...t,children:e}),x=({children:e,className:r,...t})=>a.jsx("div",{className:o("group relative isolate flex flex-col border-r border-border last:border-none items-start gap-2 px-6 py-5 transition-all text-muted-foreground",t.onClick?"hover:bg-accent/50 hover:text-foreground cursor-pointer":"cursor-auto",r),...t,children:e});export{x as K,l as a,i as b,d as c,c as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as N,j as s,bK as w,bL as T,B as y,bM as D,bN as C,bO as L,bP as K,aW as E,bQ as $,ao as u,an as g,bR as H,bS as I,r as O,a_ as G,b1 as q,ar as F,b3 as W,b5 as S}from"./index-
|
|
1
|
+
import{e as N,j as s,bK as w,bL as T,B as y,bM as D,bN as C,bO as L,bP as K,aW as E,bQ as $,ao as u,an as g,bR as H,bS as I,r as O,a_ as G,b1 as q,ar as F,b3 as W,b5 as S}from"./index-CM-iA6b-.js";import{S as k}from"./source-icon-xS8eeWX-.js";import{p as Q,e as U}from"./source-utils-B1S3ZHA2.js";import{C as M,a as J,b as X,h as Y,c as P,i as Z}from"./pagemenu-Cr7_YYR8.js";import{D as ss,h as es,i as V,a as as,b as ts,c as rs,d as is,e as ls,f as ns,g as cs}from"./data-list-nZOiCWV9.js";import{S as os,u as ds}from"./post-analytics-context-B2ytyOU0.js";import{A as hs}from"./lucide-react-CM0rB7CS.js";import{a as ms}from"./wallet-cards-Be7G77lR.js";import{G as us}from"./gh-chart-GokHrG5_.js";import{T as xs,a as ps,K as _,d as x,e as vs}from"./tabs-BMk71Tf2.js";const js=i=>{const a=Object.values(os).find(l=>l.value===i);return a?["Last 7 days","Last 30 days","Last 90 days","Last 12 months"].includes(a.name)?`in the ${a.name.toLowerCase()}`:a.name==="All time"?"(all time)":a.name.toLowerCase():""},R="https://www.google.com/s2/favicons?domain=ghost.org&sz=64",p=({dataTableHeader:i,data:a,defaultSourceIconUrl:l=R,onSourceClick:o})=>s.jsxs(ss,{children:[i&&s.jsxs(es,{children:[s.jsx(V,{children:"Source"}),s.jsx(V,{children:"Visitors"})]}),s.jsx(as,{children:a?.map(e=>{const r=!!o,c=e.source?e.source.toLowerCase().replace(/[^a-z0-9]/g,"-"):"direct";return s.jsxs(ts,{className:`group/row ${r?"cursor-pointer":""}`,"data-testid":`source-row-${c}`,onClick:r?()=>o(e.source):void 0,children:[s.jsx(rs,{style:{width:`${e.percentage?Math.round(e.percentage*100):0}%`}}),s.jsx(is,{className:"group-hover/datalist:max-w-[calc(100%-140px)]",children:s.jsx("div",{className:"flex items-center space-x-4 overflow-hidden",children:s.jsx("div",{className:"truncate font-medium",children:e.linkUrl&&!o?s.jsxs("a",{className:"group/link flex items-center gap-2",href:e.linkUrl,rel:"noreferrer",target:"_blank",children:[s.jsx(k,{defaultSourceIconUrl:l,displayName:e.displayName,iconSrc:e.iconSrc}),s.jsx("span",{className:"group-hover/link:underline",children:e.displayName})]}):s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(k,{defaultSourceIconUrl:l,displayName:e.displayName,iconSrc:e.iconSrc}),s.jsx("span",{children:e.displayName})]})})})}),s.jsxs(ls,{children:[s.jsx(ns,{children:u(e.visits)}),s.jsx(cs,{children:g(e.percentage||0)})]})]},e.source)})})]}),Ss=({data:i,range:a=30,totalVisitors:l=0,siteUrl:o,siteIcon:e,defaultSourceIconUrl:r=R,tableOnly:c=!1,topSourcesLimit:n=10,onSourceClick:t})=>{const{isPostLoading:h}=ds(),m=N.useMemo(()=>Q({data:i,mode:"visits",siteUrl:o,siteIcon:e,defaultSourceIconUrl:r}),[i,o,e,r]),d=N.useMemo(()=>U({processedData:m,totalVisitors:l,mode:"visits"}),[m,l]),f=d.slice(0,n),v="Top sources",j=`How readers found this post ${a&&` ${js(a)}`}`;if(c){const z=d.slice(0,n),B=d.length>n;return s.jsxs("div",{children:[s.jsx(p,{data:z,dataTableHeader:!1,defaultSourceIconUrl:r,range:a,onSourceClick:t}),B&&s.jsx("div",{className:"mt-4",children:s.jsxs(w,{children:[s.jsx(T,{asChild:!0,children:s.jsxs(y,{className:"w-full",size:"sm",variant:"outline",children:["View all (",d.length,") ",s.jsx(hs,{size:14})]})}),s.jsxs(D,{className:"overflow-y-auto pt-0 sm:max-w-[600px]",children:[s.jsxs(C,{className:"sticky top-0 z-40 -mx-6 bg-background/60 p-6 backdrop-blur",children:[s.jsx(L,{children:v}),s.jsx(K,{children:j})]}),s.jsx("div",{className:"group/datalist",children:s.jsx(p,{data:d,dataTableHeader:!0,defaultSourceIconUrl:r,range:a,onSourceClick:t})})]})]})})]})}const A=h;return s.jsxs(M,{className:"group/datalist","data-testid":"top-sources-card",children:[s.jsxs("div",{className:"flex items-center justify-between p-6",children:[s.jsxs(J,{className:"p-0",children:[s.jsx(X,{children:v}),s.jsx(Y,{children:j})]}),s.jsx(E,{className:"mr-2",children:"Visitors"})]}),s.jsxs(P,{className:"overflow-hidden",children:[s.jsx("div",{className:"h-[1px] w-full bg-border"}),A?s.jsx($,{lines:5}):f.length>0?s.jsx(p,{data:f,dataTableHeader:!1,defaultSourceIconUrl:r,range:a,onSourceClick:t}):s.jsx("div",{className:"py-20 text-center text-sm text-gray-700",children:"No sources data available."})]}),d.length>10&&s.jsx(Z,{children:s.jsxs(w,{children:[s.jsx(T,{asChild:!0,children:s.jsxs(y,{variant:"outline",children:["View all ",s.jsx(ms,{})]})}),s.jsxs(D,{className:"overflow-y-auto pt-0 sm:max-w-[600px]",children:[s.jsxs(C,{className:"sticky top-0 z-40 -mx-6 bg-background/60 p-6 backdrop-blur",children:[s.jsx(L,{children:v}),s.jsx(K,{children:j})]}),s.jsx("div",{className:"group/datalist",children:s.jsx(p,{data:d,dataTableHeader:!0,defaultSourceIconUrl:r,range:a,onSourceClick:t})})]})]})})]})},bs=i=>{if(!i?.length)return{visits:"0",views:"0",bounceRate:"0%",duration:"0s"};const a=n=>{const t=Number(n);return isNaN(t)?0:t},l=i.reduce((n,t)=>n+a(t.visits),0),o=i.reduce((n,t)=>n+a(t.pageviews),0),e=n=>l===0?0:i.reduce((t,h)=>{const m=a(h[n]),d=a(h.visits);return t+m*d/l},0),r=e("bounce_rate"),c=e("avg_session_sec");return{visits:u(l),views:u(o),bounceRate:g(r),duration:H(c)}},b={visits:{dataKey:"visits",label:"Visitors",color:"hsl(var(--chart-blue))",formatter:u},views:{dataKey:"pageviews",label:"Pageviews",color:"hsl(var(--chart-teal))",formatter:u},"bounce-rate":{dataKey:"bounce_rate",label:"Bounce rate",color:"hsl(var(--chart-purple))",formatter:g},duration:{dataKey:"avg_session_sec",label:"Time on page",color:"hsl(var(--chart-orange))",formatter:H}},ks=({data:i,range:a})=>{const[l]=I(),o=l.get("tab")||"visits",[e,r]=O.useState(o),c=b[e],n=G(i||[],a,c.dataKey,"sum")?.map(h=>{const m=Number(h[c.dataKey]);return{date:String(h.date),value:m,formattedValue:c.formatter(m),label:c.label}}),t=bs(i);return s.jsx(M,{children:s.jsx(P,{children:s.jsxs(xs,{defaultValue:e,variant:"kpis",children:[s.jsxs(ps,{className:"-mx-6 hidden grid-cols-2 md:!visible md:!grid",children:[s.jsx(_,{value:"visits",onClick:()=>{r("visits")},children:s.jsx(x,{color:b.visits.color,label:"Unique visitors",value:t.visits})}),s.jsx(_,{value:"views",onClick:()=>{r("views")},children:s.jsx(x,{color:b.views.color,label:"Total views",value:t.views})})]}),s.jsxs(q,{children:[s.jsx(F,{className:"md:hidden",asChild:!0,children:s.jsxs(vs,{children:[e==="visits"&&s.jsx(x,{color:"hsl(var(--chart-blue))",label:"Unique visitors",value:t.visits}),e==="views"&&s.jsx(x,{color:"hsl(var(--chart-teal))",label:"Total views",value:t.views})]})}),s.jsxs(W,{align:"end",className:"w-56",children:[s.jsx(S,{onClick:()=>r("visits"),children:"Unique visitors"}),s.jsx(S,{onClick:()=>r("views"),children:"Total views"})]})]}),s.jsx("div",{className:"my-4 [&_.recharts-cartesian-axis-tick-value]:fill-gray-500",children:s.jsx(us,{className:"-mb-3 aspect-auto h-[16vw] max-h-[320px] min-h-[180px] w-full",color:c.color,data:n,id:c.dataKey,range:a,showHours:!0,syncId:"overview-charts"})})]})})})};export{b as K,Ss as S,ks as a,js as b,bs as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,bT as E,j as p,bU as x,z as R,ap as S}from"./index-
|
|
1
|
+
import{r as i,bT as E,j as p,bU as x,z as R,ap as S}from"./index-CM-iA6b-.js";var v=Symbol.for("react.lazy"),u=E[" use ".trim().toString()];function C(e){return typeof e=="object"&&e!==null&&"then"in e}function y(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===v&&"_payload"in e&&C(e._payload)}function w(e){const t=h(e),r=i.forwardRef((o,n)=>{let{children:a,...s}=o;y(a)&&typeof u=="function"&&(a=u(a._payload));const l=i.Children.toArray(a),f=l.find(N);if(f){const c=f.props.children,g=l.map(d=>d===f?i.Children.count(c)>1?i.Children.only(null):i.isValidElement(c)?c.props.children:null:d);return p.jsx(t,{...s,ref:n,children:i.isValidElement(c)?i.cloneElement(c,void 0,g):null})}return p.jsx(t,{...s,ref:n,children:a})});return r.displayName=`${e}.Slot`,r}function h(e){const t=i.forwardRef((r,o)=>{let{children:n,...a}=r;if(y(n)&&typeof u=="function"&&(n=u(n._payload)),i.isValidElement(n)){const s=_(n),l=P(a,n.props);return n.type!==i.Fragment&&(l.ref=o?x(o,s):s),i.cloneElement(n,l)}return i.Children.count(n)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var j=Symbol("radix.slottable");function N(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===j}function P(e,t){const r={...t};for(const o in t){const n=e[o],a=t[o];/^on[A-Z]/.test(o)?n&&a?r[o]=(...l)=>{const f=a(...l);return n(...l),f}:n&&(r[o]=n):o==="style"?r[o]={...n,...a}:o==="className"&&(r[o]=[n,a].filter(Boolean).join(" "))}return{...e,...r}}function _(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var L=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$=L.reduce((e,t)=>{const r=w(`Primitive.${t}`),o=i.forwardRef((n,a)=>{const{asChild:s,...l}=n,f=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(f,{...l,ref:a})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),A="Label",m=i.forwardRef((e,t)=>p.jsx($.label,{...e,ref:t,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));m.displayName=A;var b=m;const D=S("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),V=i.forwardRef(({className:e,...t},r)=>p.jsx(b,{ref:r,className:R(D(),e),...t}));V.displayName=b.displayName;export{V as L};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as A,aJ as Q,r as ht,j as o,z as yt,an as bt,ac as gt,ab as vt}from"./index-CX1A5TwO.js";import{S as At,b as H,c as X,A as xt,i as F,L as N,d as Ot,e as st,m as V,h as Y,G as jt,j as St,k as Pt,l as kt,n as Rt,t as Ct,o as Et,p as Z,q as _t,r as wt,g as Dt,s as Tt,C as Nt,u as It,a as zt,v as Bt}from"./chart-BDdnkPgC.js";import{P as ct,a as lt}from"./PolarAngleAxis-a31TecIQ.js";function w(t){"@babel/helpers - typeof";return w=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(t)}function U(){return U=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},U.apply(this,arguments)}function tt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),a.push.apply(a,r)}return a}function K(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?tt(Object(a),!0).forEach(function(r){Lt(t,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):tt(Object(a)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))})}return t}function Lt(t,e,a){return e=Mt(e),e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function Mt(t){var e=$t(t,"string");return w(e)=="symbol"?e:e+""}function $t(t,e){if(w(t)!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var r=a.call(t,e);if(w(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function et(t){return typeof t=="string"?parseInt(t,10):t}function Wt(t,e){var a="".concat(e.cx||t.cx),r=Number(a),n="".concat(e.cy||t.cy),i=Number(n);return K(K(K({},e),t),{},{cx:r,cy:i})}function rt(t){return A.createElement(At,U({shapeType:"sector",propTransformer:Wt},t))}var Gt=["shape","activeShape","activeIndex","cornerRadius"],Ft=["value","background"];function C(t){"@babel/helpers - typeof";return C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},C(t)}function I(){return I=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},I.apply(this,arguments)}function at(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),a.push.apply(a,r)}return a}function u(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?at(Object(a),!0).forEach(function(r){j(t,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):at(Object(a)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))})}return t}function nt(t,e){if(t==null)return{};var a=Kt(t,e),r,n;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}function Kt(t,e){if(t==null)return{};var a={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;a[r]=t[r]}return a}function Vt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function it(t,e){for(var a=0;a<e.length;a++){var r=e[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,pt(r.key),r)}}function Ut(t,e,a){return e&&it(t.prototype,e),a&&it(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t}function qt(t,e,a){return e=z(e),Jt(t,ut()?Reflect.construct(e,a||[],z(t).constructor):e.apply(t,a))}function Jt(t,e){if(e&&(C(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qt(t)}function Qt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ut(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ut=function(){return!!t})()}function z(t){return z=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},z(t)}function Ht(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&q(t,e)}function q(t,e){return q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},q(t,e)}function j(t,e,a){return e=pt(e),e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function pt(t){var e=Xt(t,"string");return C(e)=="symbol"?e:e+""}function Xt(t,e){if(C(t)!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var r=a.call(t,e);if(C(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var D=(function(t){function e(){var a;Vt(this,e);for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return a=qt(this,e,[].concat(n)),j(a,"state",{isAnimationFinished:!1}),j(a,"handleAnimationEnd",function(){var s=a.props.onAnimationEnd;a.setState({isAnimationFinished:!0}),Y(s)&&s()}),j(a,"handleAnimationStart",function(){var s=a.props.onAnimationStart;a.setState({isAnimationFinished:!1}),Y(s)&&s()}),a}return Ht(e,t),Ut(e,[{key:"getDeltaAngle",value:function(){var r=this.props,n=r.startAngle,i=r.endAngle,s=V(i-n),p=Math.min(Math.abs(i-n),360);return s*p}},{key:"renderSectorsStatically",value:function(r){var n=this,i=this.props,s=i.shape,p=i.activeShape,d=i.activeIndex,l=i.cornerRadius,c=nt(i,Gt),y=H(c,!1);return r.map(function(b,f){var v=f===d,m=u(u(u(u({},y),{},{cornerRadius:et(l)},b),X(n.props,b,f)),{},{className:"recharts-radial-bar-sector ".concat(b.className),forceCornerRadius:c.forceCornerRadius,cornerIsExternal:c.cornerIsExternal,isActive:v,option:v?p:s});return A.createElement(rt,I({},m,{key:"sector-".concat(f)}))})}},{key:"renderSectorsWithAnimation",value:function(){var r=this,n=this.props,i=n.data,s=n.isAnimationActive,p=n.animationBegin,d=n.animationDuration,l=n.animationEasing,c=n.animationId,y=this.state.prevData;return A.createElement(xt,{begin:p,duration:d,isActive:s,easing:l,from:{t:0},to:{t:1},key:"radialBar-".concat(c),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(b){var f=b.t,v=i.map(function(m,E){var S=y&&y[E];if(S){var B=F(S.startAngle,m.startAngle),g=F(S.endAngle,m.endAngle);return u(u({},m),{},{startAngle:B(f),endAngle:g(f)})}var T=m.endAngle,L=m.startAngle,M=F(L,T);return u(u({},m),{},{endAngle:M(f)})});return A.createElement(N,null,r.renderSectorsStatically(v))})}},{key:"renderSectors",value:function(){var r=this.props,n=r.data,i=r.isAnimationActive,s=this.state.prevData;return i&&n&&n.length&&(!s||!Ot(s,n))?this.renderSectorsWithAnimation():this.renderSectorsStatically(n)}},{key:"renderBackground",value:function(r){var n=this,i=this.props.cornerRadius,s=H(this.props.background,!1);return r.map(function(p,d){p.value;var l=p.background,c=nt(p,Ft);if(!l)return null;var y=u(u(u(u(u({cornerRadius:et(i)},c),{},{fill:"#eee"},l),s),X(n.props,p,d)),{},{index:d,className:Q("recharts-radial-bar-background-sector",s?.className),option:l,isActive:!1});return A.createElement(rt,I({},y,{key:"sector-".concat(d)}))})}},{key:"render",value:function(){var r=this.props,n=r.hide,i=r.data,s=r.className,p=r.background,d=r.isAnimationActive;if(n||!i||!i.length)return null;var l=this.state.isAnimationFinished,c=Q("recharts-area",s);return A.createElement(N,{className:c},p&&A.createElement(N,{className:"recharts-radial-bar-background"},this.renderBackground(i)),A.createElement(N,{className:"recharts-radial-bar-sectors"},this.renderSectors()),(!d||l)&&st.renderCallByParent(u({},this.props),i))}}],[{key:"getDerivedStateFromProps",value:function(r,n){return r.animationId!==n.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:n.curData}:r.data!==n.curData?{curData:r.data}:null}}])})(ht.PureComponent);j(D,"displayName","RadialBar");j(D,"defaultProps",{angleAxisId:0,radiusAxisId:0,minPointSize:0,hide:!1,legendType:"rect",data:[],isAnimationActive:!jt.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease",forceCornerRadius:!1,cornerIsExternal:!1});j(D,"getComposedData",function(t){var e=t.item,a=t.props,r=t.radiusAxis,n=t.radiusAxisTicks,i=t.angleAxis,s=t.angleAxisTicks,p=t.displayedData,d=t.dataKey,l=t.stackedData,c=t.barPosition,y=t.bandSize,b=t.dataStartIndex,f=St(c,e);if(!f)return null;var v=i.cx,m=i.cy,E=a.layout,S=e.props,B=S.children,g=S.minPointSize,T=E==="radial"?i:r,L=l?T.scale.domain():null,M=Pt({numericAxis:T}),$=kt(B,Rt),dt=p.map(function(P,_){var h,x,O,k,R,J;if(l?h=Ct(l[b+_],L):(h=Et(P,d),Array.isArray(h)||(h=[M,h])),E==="radial"){x=Z({axis:r,ticks:n,bandSize:y,offset:f.offset,entry:P,index:_}),R=i.scale(h[1]),k=i.scale(h[0]),O=x+f.size;var W=R-k;if(Math.abs(g)>0&&Math.abs(W)<Math.abs(g)){var ft=V(W||g)*(Math.abs(g)-Math.abs(W));R+=ft}J={background:{cx:v,cy:m,innerRadius:x,outerRadius:O,startAngle:a.startAngle,endAngle:a.endAngle}}}else{x=r.scale(h[0]),O=r.scale(h[1]),k=Z({axis:i,ticks:s,bandSize:y,offset:f.offset,entry:P,index:_}),R=k+f.size;var G=O-x;if(Math.abs(g)>0&&Math.abs(G)<Math.abs(g)){var mt=V(G||g)*(Math.abs(g)-Math.abs(G));O+=mt}}return u(u(u(u({},P),J),{},{payload:P,value:l?h:h[1],cx:v,cy:m,innerRadius:x,outerRadius:O,startAngle:k,endAngle:R},$&&$[_]&&$[_].props),{},{tooltipPayload:[_t(e,P)],tooltipPosition:wt(v,m,(x+O)/2,(k+R)/2)})});return{data:dt,layout:E}});var Yt=Dt({chartName:"RadialBarChart",GraphicalChild:D,legendContent:"children",defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"angleAxis",AxisComp:ct},{axisType:"radiusAxis",AxisComp:lt}],formatAxisMap:Tt,defaultProps:{layout:"radial",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const re=({config:t,data:e,percentageValue:a,percentageLabel:r,className:n,tooltip:i=!0,size:s="responsive"})=>{const d=(()=>{switch(s){case"sm":return{barWidth:28,innerRadiusStart:e.length>1?42:56,fontSize:{percentage:"1.2rem",label:"0.8rem"}};case"md":return{barWidth:36,innerRadiusStart:e.length>1?60:72,fontSize:{percentage:"1.4rem",label:"0.9rem"}};case"lg":return{barWidth:46,innerRadiusStart:e.length>1?72:94,fontSize:{percentage:"1.6rem",label:"1rem"}};case"responsive":default:return{barWidth:46,innerRadiusStart:e.length>1?72:94,fontSize:{percentage:"1.6rem",label:"1rem"}}}})(),l={innerRadius:d.innerRadiusStart,outerRadius:d.innerRadiusStart+d.barWidth,startAngle:90,endAngle:-270};return o.jsx(Nt,{className:yt("mx-auto",n),config:t,children:o.jsxs(Yt,{data:e,endAngle:l.endAngle,innerRadius:l.innerRadius,outerRadius:l.outerRadius,startAngle:l.startAngle,children:[o.jsxs("defs",{children:[o.jsxs("radialGradient",{cx:"30%",cy:"30%",id:"gradientPurple",r:"70%",children:[o.jsx("stop",{offset:"0%",stopColor:"hsl(var(--chart-purple))",stopOpacity:.5}),o.jsx("stop",{offset:"100%",stopColor:"hsl(var(--chart-purple))",stopOpacity:1})]}),o.jsxs("radialGradient",{cx:"30%",cy:"30%",id:"gradientBlue",r:"70%",children:[o.jsx("stop",{offset:"0%",stopColor:"hsl(var(--chart-blue))",stopOpacity:.5}),o.jsx("stop",{offset:"100%",stopColor:"hsl(var(--chart-blue))",stopOpacity:1})]}),o.jsxs("radialGradient",{cx:"30%",cy:"30%",id:"gradientTeal",r:"70%",children:[o.jsx("stop",{offset:"0%",stopColor:"hsl(var(--chart-teal))",stopOpacity:.5}),o.jsx("stop",{offset:"100%",stopColor:"hsl(var(--chart-teal))",stopOpacity:1})]}),o.jsxs("radialGradient",{cx:"30%",cy:"30%",id:"gradientGray",r:"70%",children:[o.jsx("stop",{offset:"0%",stopColor:"hsl(var(--chart-gray))",stopOpacity:.5}),o.jsx("stop",{offset:"100%",stopColor:"hsl(var(--chart-gray))",stopOpacity:1})]})]}),o.jsx(ct,{angleAxisId:0,domain:[0,1],tick:!1,type:"number"}),o.jsx(D,{cornerRadius:10,dataKey:"value",minPointSize:-2,background:!0,children:e.length>1&&o.jsx(st,{className:"fill-black opacity-60",dataKey:"datatype",fontSize:11,position:"insideStart"})}),o.jsx(lt,{axisLine:!1,tick:!1,tickLine:!1,children:o.jsx(It,{content:({viewBox:c})=>{if(c&&"cx"in c&&"cy"in c)return o.jsxs("text",{dominantBaseline:"middle",textAnchor:"middle",x:c.cx,y:c.cy,children:[a&&o.jsx("tspan",{className:"fill-foreground text-[1.6rem] font-semibold tracking-tight",x:c.cx,y:(c.cy||0)-6,children:a}),r&&o.jsx("tspan",{className:"fill-muted-foreground font-medium",x:c.cx,y:(c.cy||0)+14,children:r})]})}})}),i&&o.jsx(zt,{content:o.jsx(Bt,{formatter:(c,y,b)=>o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("div",{className:"size-2 rounded-full opacity-50",style:{backgroundColor:b.payload?.color}}),o.jsx("div",{className:"text-xs text-muted-foreground",children:b.payload?.datatype}),o.jsx("div",{className:"ml-3 font-mono text-xs",children:bt(c)})]}),nameKey:"datatype",hideLabel:!0}),cursor:!1,isAnimationActive:!1})]})})},ot=(t,e=!1)=>{try{const a=["ref","attribution_id","attribution_type"],r=new URL(t);for(const i of a)r.searchParams.delete(i);return e?(r.host+(r.pathname==="/"&&!r.search?"":r.pathname)+(r.search?r.search:"")+(r.hash?r.hash:"")).replace(/^www\./,""):r.toString()}catch{return t}},ae=(t,e)=>t.find(a=>a.link.link_id===e),ne=t=>{const r=(t?.links.map(n=>({link:n.link,count:n.count?.clicks||0}))||[]).map(n=>({...n,link:{...n.link,originalTo:n.link.to,to:ot(n.link.to,!1),title:ot(n.link.to,!0)}})).reduce((n,i)=>(n[i.link.title]?(n[i.link.title].count||(n[i.link.title].count=0),n[i.link.title].count+=i.count??0):n[i.link.title]=i,n),{});return Object.values(r).sort((n,i)=>{const s=n.count||0;return(i.count||0)-s})},ie=gt({dataType:"LinkResponseType",path:"/links/"}),oe=vt({method:"PUT",path:()=>"/links/bulk/",body:({editedUrl:t})=>({bulk:{action:"updateLink",meta:{link:{to:t}}}}),searchParams:({originalUrl:t,postId:e})=>({filter:`post_id:'${e}'+to:'${t}'`})});export{re as N,oe as a,ot as c,ae as g,ne as p,ie as u};
|
|
1
|
+
import{e as A,aJ as Q,r as ht,j as o,z as yt,an as bt,ac as gt,ab as vt}from"./index-CM-iA6b-.js";import{S as At,b as H,c as X,A as xt,i as F,L as N,d as Ot,e as st,m as V,h as Y,G as jt,j as St,k as Pt,l as kt,n as Rt,t as Ct,o as Et,p as Z,q as _t,r as wt,g as Dt,s as Tt,C as Nt,u as It,a as zt,v as Bt}from"./chart-CULaDoVB.js";import{P as ct,a as lt}from"./PolarAngleAxis-D8t9UwHk.js";function w(t){"@babel/helpers - typeof";return w=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(t)}function U(){return U=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},U.apply(this,arguments)}function tt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),a.push.apply(a,r)}return a}function K(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?tt(Object(a),!0).forEach(function(r){Lt(t,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):tt(Object(a)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))})}return t}function Lt(t,e,a){return e=Mt(e),e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function Mt(t){var e=$t(t,"string");return w(e)=="symbol"?e:e+""}function $t(t,e){if(w(t)!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var r=a.call(t,e);if(w(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function et(t){return typeof t=="string"?parseInt(t,10):t}function Wt(t,e){var a="".concat(e.cx||t.cx),r=Number(a),n="".concat(e.cy||t.cy),i=Number(n);return K(K(K({},e),t),{},{cx:r,cy:i})}function rt(t){return A.createElement(At,U({shapeType:"sector",propTransformer:Wt},t))}var Gt=["shape","activeShape","activeIndex","cornerRadius"],Ft=["value","background"];function C(t){"@babel/helpers - typeof";return C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},C(t)}function I(){return I=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},I.apply(this,arguments)}function at(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),a.push.apply(a,r)}return a}function u(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?at(Object(a),!0).forEach(function(r){j(t,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):at(Object(a)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))})}return t}function nt(t,e){if(t==null)return{};var a=Kt(t,e),r,n;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}function Kt(t,e){if(t==null)return{};var a={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;a[r]=t[r]}return a}function Vt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function it(t,e){for(var a=0;a<e.length;a++){var r=e[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,pt(r.key),r)}}function Ut(t,e,a){return e&&it(t.prototype,e),a&&it(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t}function qt(t,e,a){return e=z(e),Jt(t,ut()?Reflect.construct(e,a||[],z(t).constructor):e.apply(t,a))}function Jt(t,e){if(e&&(C(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qt(t)}function Qt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ut(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ut=function(){return!!t})()}function z(t){return z=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},z(t)}function Ht(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&q(t,e)}function q(t,e){return q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},q(t,e)}function j(t,e,a){return e=pt(e),e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function pt(t){var e=Xt(t,"string");return C(e)=="symbol"?e:e+""}function Xt(t,e){if(C(t)!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var r=a.call(t,e);if(C(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var D=(function(t){function e(){var a;Vt(this,e);for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return a=qt(this,e,[].concat(n)),j(a,"state",{isAnimationFinished:!1}),j(a,"handleAnimationEnd",function(){var s=a.props.onAnimationEnd;a.setState({isAnimationFinished:!0}),Y(s)&&s()}),j(a,"handleAnimationStart",function(){var s=a.props.onAnimationStart;a.setState({isAnimationFinished:!1}),Y(s)&&s()}),a}return Ht(e,t),Ut(e,[{key:"getDeltaAngle",value:function(){var r=this.props,n=r.startAngle,i=r.endAngle,s=V(i-n),p=Math.min(Math.abs(i-n),360);return s*p}},{key:"renderSectorsStatically",value:function(r){var n=this,i=this.props,s=i.shape,p=i.activeShape,d=i.activeIndex,l=i.cornerRadius,c=nt(i,Gt),y=H(c,!1);return r.map(function(b,f){var v=f===d,m=u(u(u(u({},y),{},{cornerRadius:et(l)},b),X(n.props,b,f)),{},{className:"recharts-radial-bar-sector ".concat(b.className),forceCornerRadius:c.forceCornerRadius,cornerIsExternal:c.cornerIsExternal,isActive:v,option:v?p:s});return A.createElement(rt,I({},m,{key:"sector-".concat(f)}))})}},{key:"renderSectorsWithAnimation",value:function(){var r=this,n=this.props,i=n.data,s=n.isAnimationActive,p=n.animationBegin,d=n.animationDuration,l=n.animationEasing,c=n.animationId,y=this.state.prevData;return A.createElement(xt,{begin:p,duration:d,isActive:s,easing:l,from:{t:0},to:{t:1},key:"radialBar-".concat(c),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(b){var f=b.t,v=i.map(function(m,E){var S=y&&y[E];if(S){var B=F(S.startAngle,m.startAngle),g=F(S.endAngle,m.endAngle);return u(u({},m),{},{startAngle:B(f),endAngle:g(f)})}var T=m.endAngle,L=m.startAngle,M=F(L,T);return u(u({},m),{},{endAngle:M(f)})});return A.createElement(N,null,r.renderSectorsStatically(v))})}},{key:"renderSectors",value:function(){var r=this.props,n=r.data,i=r.isAnimationActive,s=this.state.prevData;return i&&n&&n.length&&(!s||!Ot(s,n))?this.renderSectorsWithAnimation():this.renderSectorsStatically(n)}},{key:"renderBackground",value:function(r){var n=this,i=this.props.cornerRadius,s=H(this.props.background,!1);return r.map(function(p,d){p.value;var l=p.background,c=nt(p,Ft);if(!l)return null;var y=u(u(u(u(u({cornerRadius:et(i)},c),{},{fill:"#eee"},l),s),X(n.props,p,d)),{},{index:d,className:Q("recharts-radial-bar-background-sector",s?.className),option:l,isActive:!1});return A.createElement(rt,I({},y,{key:"sector-".concat(d)}))})}},{key:"render",value:function(){var r=this.props,n=r.hide,i=r.data,s=r.className,p=r.background,d=r.isAnimationActive;if(n||!i||!i.length)return null;var l=this.state.isAnimationFinished,c=Q("recharts-area",s);return A.createElement(N,{className:c},p&&A.createElement(N,{className:"recharts-radial-bar-background"},this.renderBackground(i)),A.createElement(N,{className:"recharts-radial-bar-sectors"},this.renderSectors()),(!d||l)&&st.renderCallByParent(u({},this.props),i))}}],[{key:"getDerivedStateFromProps",value:function(r,n){return r.animationId!==n.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:n.curData}:r.data!==n.curData?{curData:r.data}:null}}])})(ht.PureComponent);j(D,"displayName","RadialBar");j(D,"defaultProps",{angleAxisId:0,radiusAxisId:0,minPointSize:0,hide:!1,legendType:"rect",data:[],isAnimationActive:!jt.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease",forceCornerRadius:!1,cornerIsExternal:!1});j(D,"getComposedData",function(t){var e=t.item,a=t.props,r=t.radiusAxis,n=t.radiusAxisTicks,i=t.angleAxis,s=t.angleAxisTicks,p=t.displayedData,d=t.dataKey,l=t.stackedData,c=t.barPosition,y=t.bandSize,b=t.dataStartIndex,f=St(c,e);if(!f)return null;var v=i.cx,m=i.cy,E=a.layout,S=e.props,B=S.children,g=S.minPointSize,T=E==="radial"?i:r,L=l?T.scale.domain():null,M=Pt({numericAxis:T}),$=kt(B,Rt),dt=p.map(function(P,_){var h,x,O,k,R,J;if(l?h=Ct(l[b+_],L):(h=Et(P,d),Array.isArray(h)||(h=[M,h])),E==="radial"){x=Z({axis:r,ticks:n,bandSize:y,offset:f.offset,entry:P,index:_}),R=i.scale(h[1]),k=i.scale(h[0]),O=x+f.size;var W=R-k;if(Math.abs(g)>0&&Math.abs(W)<Math.abs(g)){var ft=V(W||g)*(Math.abs(g)-Math.abs(W));R+=ft}J={background:{cx:v,cy:m,innerRadius:x,outerRadius:O,startAngle:a.startAngle,endAngle:a.endAngle}}}else{x=r.scale(h[0]),O=r.scale(h[1]),k=Z({axis:i,ticks:s,bandSize:y,offset:f.offset,entry:P,index:_}),R=k+f.size;var G=O-x;if(Math.abs(g)>0&&Math.abs(G)<Math.abs(g)){var mt=V(G||g)*(Math.abs(g)-Math.abs(G));O+=mt}}return u(u(u(u({},P),J),{},{payload:P,value:l?h:h[1],cx:v,cy:m,innerRadius:x,outerRadius:O,startAngle:k,endAngle:R},$&&$[_]&&$[_].props),{},{tooltipPayload:[_t(e,P)],tooltipPosition:wt(v,m,(x+O)/2,(k+R)/2)})});return{data:dt,layout:E}});var Yt=Dt({chartName:"RadialBarChart",GraphicalChild:D,legendContent:"children",defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"angleAxis",AxisComp:ct},{axisType:"radiusAxis",AxisComp:lt}],formatAxisMap:Tt,defaultProps:{layout:"radial",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const re=({config:t,data:e,percentageValue:a,percentageLabel:r,className:n,tooltip:i=!0,size:s="responsive"})=>{const d=(()=>{switch(s){case"sm":return{barWidth:28,innerRadiusStart:e.length>1?42:56,fontSize:{percentage:"1.2rem",label:"0.8rem"}};case"md":return{barWidth:36,innerRadiusStart:e.length>1?60:72,fontSize:{percentage:"1.4rem",label:"0.9rem"}};case"lg":return{barWidth:46,innerRadiusStart:e.length>1?72:94,fontSize:{percentage:"1.6rem",label:"1rem"}};case"responsive":default:return{barWidth:46,innerRadiusStart:e.length>1?72:94,fontSize:{percentage:"1.6rem",label:"1rem"}}}})(),l={innerRadius:d.innerRadiusStart,outerRadius:d.innerRadiusStart+d.barWidth,startAngle:90,endAngle:-270};return o.jsx(Nt,{className:yt("mx-auto",n),config:t,children:o.jsxs(Yt,{data:e,endAngle:l.endAngle,innerRadius:l.innerRadius,outerRadius:l.outerRadius,startAngle:l.startAngle,children:[o.jsxs("defs",{children:[o.jsxs("radialGradient",{cx:"30%",cy:"30%",id:"gradientPurple",r:"70%",children:[o.jsx("stop",{offset:"0%",stopColor:"hsl(var(--chart-purple))",stopOpacity:.5}),o.jsx("stop",{offset:"100%",stopColor:"hsl(var(--chart-purple))",stopOpacity:1})]}),o.jsxs("radialGradient",{cx:"30%",cy:"30%",id:"gradientBlue",r:"70%",children:[o.jsx("stop",{offset:"0%",stopColor:"hsl(var(--chart-blue))",stopOpacity:.5}),o.jsx("stop",{offset:"100%",stopColor:"hsl(var(--chart-blue))",stopOpacity:1})]}),o.jsxs("radialGradient",{cx:"30%",cy:"30%",id:"gradientTeal",r:"70%",children:[o.jsx("stop",{offset:"0%",stopColor:"hsl(var(--chart-teal))",stopOpacity:.5}),o.jsx("stop",{offset:"100%",stopColor:"hsl(var(--chart-teal))",stopOpacity:1})]}),o.jsxs("radialGradient",{cx:"30%",cy:"30%",id:"gradientGray",r:"70%",children:[o.jsx("stop",{offset:"0%",stopColor:"hsl(var(--chart-gray))",stopOpacity:.5}),o.jsx("stop",{offset:"100%",stopColor:"hsl(var(--chart-gray))",stopOpacity:1})]})]}),o.jsx(ct,{angleAxisId:0,domain:[0,1],tick:!1,type:"number"}),o.jsx(D,{cornerRadius:10,dataKey:"value",minPointSize:-2,background:!0,children:e.length>1&&o.jsx(st,{className:"fill-black opacity-60",dataKey:"datatype",fontSize:11,position:"insideStart"})}),o.jsx(lt,{axisLine:!1,tick:!1,tickLine:!1,children:o.jsx(It,{content:({viewBox:c})=>{if(c&&"cx"in c&&"cy"in c)return o.jsxs("text",{dominantBaseline:"middle",textAnchor:"middle",x:c.cx,y:c.cy,children:[a&&o.jsx("tspan",{className:"fill-foreground text-[1.6rem] font-semibold tracking-tight",x:c.cx,y:(c.cy||0)-6,children:a}),r&&o.jsx("tspan",{className:"fill-muted-foreground font-medium",x:c.cx,y:(c.cy||0)+14,children:r})]})}})}),i&&o.jsx(zt,{content:o.jsx(Bt,{formatter:(c,y,b)=>o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("div",{className:"size-2 rounded-full opacity-50",style:{backgroundColor:b.payload?.color}}),o.jsx("div",{className:"text-xs text-muted-foreground",children:b.payload?.datatype}),o.jsx("div",{className:"ml-3 font-mono text-xs",children:bt(c)})]}),nameKey:"datatype",hideLabel:!0}),cursor:!1,isAnimationActive:!1})]})})},ot=(t,e=!1)=>{try{const a=["ref","attribution_id","attribution_type"],r=new URL(t);for(const i of a)r.searchParams.delete(i);return e?(r.host+(r.pathname==="/"&&!r.search?"":r.pathname)+(r.search?r.search:"")+(r.hash?r.hash:"")).replace(/^www\./,""):r.toString()}catch{return t}},ae=(t,e)=>t.find(a=>a.link.link_id===e),ne=t=>{const r=(t?.links.map(n=>({link:n.link,count:n.count?.clicks||0}))||[]).map(n=>({...n,link:{...n.link,originalTo:n.link.to,to:ot(n.link.to,!1),title:ot(n.link.to,!0)}})).reduce((n,i)=>(n[i.link.title]?(n[i.link.title].count||(n[i.link.title].count=0),n[i.link.title].count+=i.count??0):n[i.link.title]=i,n),{});return Object.values(r).sort((n,i)=>{const s=n.count||0;return(i.count||0)-s})},ie=gt({dataType:"LinkResponseType",path:"/links/"}),oe=vt({method:"PUT",path:()=>"/links/bulk/",body:({editedUrl:t})=>({bulk:{action:"updateLink",meta:{link:{to:t}}}}),searchParams:({originalUrl:t,postId:e})=>({filter:`post_id:'${e}'+to:'${t}'`})});export{re as N,oe as a,ot as c,ae as g,ne as p,ie as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aC as e,eB as M0,aQ as v0,U as m0,bE as g0,eC as _0,eD as L0,a0 as x0,bq as w0,bu as f0,C as I0,eE as C0,d3 as b0,eF as c,eG as r,cG as N0,b2 as k,y as q0,eH as $0,bv as p,cB as z0,aX as S0,bC as A0,cE as H0,eI as j0,ai as V0,eJ as P0,eK as B0,d7 as F0,c$ as D0,eL as R0,eM as T0,eN as s,cT as l,eO as U0,cu as O0,eP as G0,cr as Z0,eQ as W0,eR as E0,eS as X0,eT as u,cm as K0,c9 as Q0,aq as J0,eU as M,aO as Y0,eV as v,eW as m,ca as g,cl as ea,X as aa,eX as $g}from"./index-
|
|
1
|
+
import{aC as e,eB as M0,aQ as v0,U as m0,bE as g0,eC as _0,eD as L0,a0 as x0,bq as w0,bu as f0,C as I0,eE as C0,d3 as b0,eF as c,eG as r,cG as N0,b2 as k,y as q0,eH as $0,bv as p,cB as z0,aX as S0,bC as A0,cE as H0,eI as j0,ai as V0,eJ as P0,eK as B0,d7 as F0,c$ as D0,eL as R0,eM as T0,eN as s,cT as l,eO as U0,cu as O0,eP as G0,cr as Z0,eQ as W0,eR as E0,eS as X0,eT as u,cm as K0,c9 as Q0,aq as J0,eU as M,aO as Y0,eV as v,eW as m,ca as g,cl as ea,X as aa,eX as $g}from"./index-CM-iA6b-.js";import{A as ca}from"./a-large-small-BijOKCoa.js";import{A as ta,C as oa,G as da,P as _,S as na,a as ha,T as ia,W as ya}from"./wallet-cards-Be7G77lR.js";import{A as ra,L as ka}from"./list-filter-cWuCDOLb.js";import{A as pa,e as sa,c as la,d as ua,C as L,D as Ma,a as va,b as ma,M as ga,N as _a,P as La,S as xa,T as wa}from"./ticket-BtYGyQvH.js";import{A as fa}from"./at-sign-_JfhlimD.js";import{C as Ia,a as x,E as Ca,b as w,F as ba,L as f}from"./loader-circle-B5ILzHHu.js";import{C as Na,D as qa,E as $a,F as za,a as Sa,M as Aa}from"./message-square-text-DVZjnBBF.js";import{C as Ha}from"./copy-CbX-_mHj.js";import{H as ja}from"./hash-twG7-iIB.js";import{I as Va}from"./inbox-BdkIJbSq.js";import{M as Pa,U as Ba}from"./user-plus-BS8SGBmk.js";import{M as Fa}from"./minus-BWrVDnd-.js";import{P as Da,T as Ra}from"./tags-CqHx8i6Q.js";import{R as Ta,S as Ua}from"./square-D0Y5-h0C.js";import{R as Oa,U as I}from"./user-round-check-BgOPeBFs.js";import{R as Ga}from"./repeat-C_xWSLK1.js";import{R as Za}from"./reply-CXnb6Juu.js";import{S as Wa}from"./sprout-CLmu2pln.js";import{T as Ea}from"./trash-B4ncKmRu.js";/**
|
|
2
2
|
* @license lucide-react v0.553.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a}from"./index-
|
|
1
|
+
import{j as a}from"./index-CM-iA6b-.js";const t=({children:e,...s})=>a.jsx("div",{className:"size-full",children:a.jsx("div",{className:"relative mx-auto flex h-full max-w-page flex-col",...s,children:e})});export{t as M};
|