ghost 6.13.1 → 6.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/components/tryghost-i18n-6.13.2.tgz +0 -0
  2. package/core/built/admin/assets/{_baseAssignValue-CPzElAl9.js → _baseAssignValue-qTINVNgk.js} +1 -1
  3. package/core/built/admin/assets/{a-large-small-2Oh9oqBr.js → a-large-small-D-nhKFBX.js} +1 -1
  4. package/core/built/admin/assets/admin-x-settings/admin-x-settings.js +2 -2
  5. package/core/built/admin/assets/admin-x-settings/{code-editor-view-B5QudVu-.mjs → code-editor-view-CXaEQbfL.mjs} +2 -2
  6. package/core/built/admin/assets/admin-x-settings/{index-D3C8sdqQ.mjs → index-BrqKezEN.mjs} +30 -24
  7. package/core/built/admin/assets/admin-x-settings/{index-B66mLTSp.mjs → index-CwXvgyDY.mjs} +2 -2
  8. package/core/built/admin/assets/admin-x-settings/{index-CdWUpaGD.mjs → index-Dc7foGQ2.mjs} +2 -2
  9. package/core/built/admin/assets/admin-x-settings/{modals-lYrPGC_E.mjs → modals-Ba1hMizc.mjs} +2 -2
  10. package/core/built/admin/assets/{at-sign-BtKGpnjs.js → at-sign-DHUgIxNb.js} +1 -1
  11. package/core/built/admin/assets/{audience-select-DuSCQEyi.js → audience-select-C17Kh6Hl.js} +1 -1
  12. package/core/built/admin/assets/{avatar-flipboard-CcvOD0pV.js → avatar-flipboard-Cdj8uoBX.js} +1 -1
  13. package/core/built/admin/assets/{bluesky-sharing-Frg4QWOQ.js → bluesky-sharing-DYSv4ewp.js} +1 -1
  14. package/core/built/admin/assets/{chart-tL51cfF9.js → chart-BYGpVun6.js} +1 -1
  15. package/core/built/admin/assets/{chunk.397.a720333cfffc99c47e71.js → chunk.397.71f16fce8de382622bb4.js} +2 -2
  16. package/core/built/admin/assets/{chunk.524.6168e2262e63b155f63e.js → chunk.524.ccb5a082c09fdedaf1d0.js} +6 -6
  17. package/core/built/admin/assets/{chunk.582.45f8c5479d11e969ddc2.js → chunk.582.311f93280422738b8a5d.js} +7 -7
  18. package/core/built/admin/assets/{code-editor-view-BHiySSgi.js → code-editor-view-BnOaGsRA.js} +1 -1
  19. package/core/built/admin/assets/{comments-svHZXAlu.js → comments-DiZAz2yU.js} +1 -1
  20. package/core/built/admin/assets/{copy-B8yuX-e4.js → copy-CCj6xx5V.js} +1 -1
  21. package/core/built/admin/assets/{data-list-C_WXxmo3.js → data-list-By9zN-Ma.js} +1 -1
  22. package/core/built/admin/assets/{deleted-feed-item-OXPcC4Z2.js → deleted-feed-item-Dl0oQ0DH.js} +1 -1
  23. package/core/built/admin/assets/{edit-profile-DgMLvoyu.js → edit-profile-DZhjWF_f.js} +1 -1
  24. package/core/built/admin/assets/{empty-indicator-DOQCKEXD.js → empty-indicator-B7WXKrac.js} +1 -1
  25. package/core/built/admin/assets/{en-Z93BzXte.js → en-B8oRL8Ua.js} +1 -1
  26. package/core/built/admin/assets/{feed-BKXpQU0e.js → feed-DU5QhfRX.js} +1 -1
  27. package/core/built/admin/assets/{filters-dwDByCkK.js → filters-C-v3cGt0.js} +1 -1
  28. package/core/built/admin/assets/{gh-chart-CaA6rQiP.js → gh-chart-B98YGgzG.js} +1 -1
  29. package/core/built/admin/assets/{growth-DKtJYCNb.js → growth-_giTyVF8.js} +1 -1
  30. package/core/built/admin/assets/{hash-ZzZYv2ek.js → hash-B4UtN3nq.js} +1 -1
  31. package/core/built/admin/assets/{inbox-C5KDymI8.js → inbox-D336Mbic.js} +1 -1
  32. package/core/built/admin/assets/{index-VdGL6HfS.js → index-B3CWs1Pb.js} +1 -1
  33. package/core/built/admin/assets/{index-CM3YmTO5.js → index-Bl3YnEiK.js} +1 -1
  34. package/core/built/admin/assets/{index-OPvny56_.js → index-BuFp5nYK.js} +1 -1
  35. package/core/built/admin/assets/{index-BX3p0DcO.js → index-C9PDrFEW.js} +1 -1
  36. package/core/built/admin/assets/{index-DethZCE1.js → index-CEEPij-w.js} +1 -1
  37. package/core/built/admin/assets/{index-BNkw6KwF.js → index-CLdEbHsV.js} +1 -1
  38. package/core/built/admin/assets/{index-CQVI9TPr.js → index-CdIdIOil.js} +1 -1
  39. package/core/built/admin/assets/{index-B6mBuUxr.js → index-DI4OotZO.js} +1 -1
  40. package/core/built/admin/assets/{index-BniBHF2r.js → index-DXuLaG0T.js} +1 -1
  41. package/core/built/admin/assets/{index-6_RXbq08.css → index-DbjfIcZe.css} +1 -1
  42. package/core/built/admin/assets/{index-X_uC_0DD.js → index-Dq_j8mTf.js} +3 -3
  43. package/core/built/admin/assets/{index-DOORRiFo.js → index-cWfIWdIX.js} +1 -1
  44. package/core/built/admin/assets/{index-CF6UHTsD.js → index-iHz8ZTSi.js} +1 -1
  45. package/core/built/admin/assets/{index-D9gfkxEz.js → index-k2aVq6ms.js} +1 -1
  46. package/core/built/admin/assets/{index-syvYkr47.js → index-w7Tz4ytz.js} +1 -1
  47. package/core/built/admin/assets/koenig-lexical/index.css +2 -2
  48. package/core/built/admin/assets/koenig-lexical/koenig-lexical.js +21800 -23540
  49. package/core/built/admin/assets/koenig-lexical/koenig-lexical.umd.js +177 -177
  50. package/core/built/admin/assets/{koenig-lexical-D4CBYCN7.js → koenig-lexical-5o67f7C9.js} +155 -155
  51. package/core/built/admin/assets/{kpi-card-DOIcNxgg.js → kpi-card-XLCPc_4J.js} +1 -1
  52. package/core/built/admin/assets/{kpis-BrSBq5c9.js → kpis-Czdhg1qV.js} +1 -1
  53. package/core/built/admin/assets/{links-DkVK8XO7.js → links-CY3nuFg7.js} +1 -1
  54. package/core/built/admin/assets/{lucide-react-DNj9Mt50.js → lucide-react-B7CWr8XP.js} +1 -1
  55. package/core/built/admin/assets/{main-layout-A6BaeVIm.js → main-layout-CmX429hf.js} +1 -1
  56. package/core/built/admin/assets/{message-square-text-DJWDCab0.js → message-square-text-Cqodm1uC.js} +1 -1
  57. package/core/built/admin/assets/{minus-B7zQY2p1.js → minus-K1Fj4qFh.js} +1 -1
  58. package/core/built/admin/assets/{modals-DJQDv_48.js → modals-C0x0SG_a.js} +1 -1
  59. package/core/built/admin/assets/{moderation-DikYZSIC.js → moderation-DqX2eQNM.js} +1 -1
  60. package/core/built/admin/assets/{newsletter-ok4p5aPZ.js → newsletter-BaZVL4Rg.js} +1 -1
  61. package/core/built/admin/assets/{newsletters-ClUaZMbc.js → newsletters-DpmHk1Kf.js} +1 -1
  62. package/core/built/admin/assets/{note-C445n_od.js → note-Bqr3ECo6.js} +1 -1
  63. package/core/built/admin/assets/{overview-vPttXZEx.js → overview-CGTvSQfN.js} +1 -1
  64. package/core/built/admin/assets/{pagemenu-CUEgz3GC.js → pagemenu-z-Nc5-Yy.js} +1 -1
  65. package/core/built/admin/assets/{post-analytics-DPIgO2YG.js → post-analytics-DCAOPWEx.js} +1 -1
  66. package/core/built/admin/assets/{post-analytics-context-DGNsxT8V.js → post-analytics-context-DctS9fHu.js} +1 -1
  67. package/core/built/admin/assets/{post-analytics-header-B1f7HAy_.js → post-analytics-header-C6tJIKtV.js} +1 -1
  68. package/core/built/admin/assets/{post-share-modal-BIddzWjJ.js → post-share-modal-CtQTpIsC.js} +1 -1
  69. package/core/built/admin/assets/{posts-DOThg8yh.js → posts-D0erEci0.js} +1 -1
  70. package/core/built/admin/assets/{referrers-BK-mXdat.js → referrers-D4s1ncIT.js} +1 -1
  71. package/core/built/admin/assets/{repeat-CQvZJI02.js → repeat-BNamsVQr.js} +1 -1
  72. package/core/built/admin/assets/{reply-BET0l7FZ.js → reply-DqXFv78k.js} +1 -1
  73. package/core/built/admin/assets/{select-BH3t_tDB.js → select-CFBw9aAY.js} +1 -1
  74. package/core/built/admin/assets/{settings-CpkvyD93.js → settings-B_8Oslb0.js} +5 -5
  75. package/core/built/admin/assets/{settings-OIq7tQiJ.js → settings-BnZOyHrT.js} +1 -1
  76. package/core/built/admin/assets/{sort-button-DkfQ-8QJ.js → sort-button-K1rs2zWp.js} +1 -1
  77. package/core/built/admin/assets/{source-icon-DOOAvJR8.js → source-icon-KI6QTdIv.js} +1 -1
  78. package/core/built/admin/assets/{sprout-gjsBxaCU.js → sprout-C96gimQS.js} +1 -1
  79. package/core/built/admin/assets/{square-DsGufPa-.js → square-s6ZVKvbY.js} +1 -1
  80. package/core/built/admin/assets/{stats-Cu49FJzo.js → stats-C8Qt0L-1.js} +1 -1
  81. package/core/built/admin/assets/{stats-view-DUoDKh7r.js → stats-view-0eaQf_pM.js} +1 -1
  82. package/core/built/admin/assets/{step-1-QOnWlIzD.js → step-1-Gnp7iGGY.js} +1 -1
  83. package/core/built/admin/assets/{step-2-CDFj1bR5.js → step-2-DFbY2-K1.js} +1 -1
  84. package/core/built/admin/assets/{step-3-Cjmt9ecL.js → step-3-CoA_-aRF.js} +1 -1
  85. package/core/built/admin/assets/{table-PBYP6iVu.js → table-DpY57zP6.js} +1 -1
  86. package/core/built/admin/assets/{tabs--ia9i-R8.js → tabs-BTEs4Aby.js} +1 -1
  87. package/core/built/admin/assets/{tags-DwsoamaL.js → tags-CIEzegXe.js} +1 -1
  88. package/core/built/admin/assets/{tags-DK91bj9-.js → tags-DUcQDnmf.js} +1 -1
  89. package/core/built/admin/assets/{toggle-group-my6OlgUp.js → toggle-group-qaH0bKBM.js} +1 -1
  90. package/core/built/admin/assets/{topic-filter-Cdat1Ona.js → topic-filter-BmvO9gja.js} +1 -1
  91. package/core/built/admin/assets/{trash-C2kuVkXA.js → trash-DIVNO9rU.js} +1 -1
  92. package/core/built/admin/assets/{url-helpers-BuFo9dQz.js → url-helpers-Cn69VioM.js} +1 -1
  93. package/core/built/admin/assets/{use-growth-stats-DY2E0ltn.js → use-growth-stats-DPN4F7Mt.js} +1 -1
  94. package/core/built/admin/assets/{use-infinite-virtual-scroll-CS20HV8J.js → use-infinite-virtual-scroll-D5U6oSIq.js} +1 -1
  95. package/core/built/admin/assets/{use-simple-pagination-kb9H2Ssw.js → use-simple-pagination-_Ui1WbsL.js} +1 -1
  96. package/core/built/admin/assets/{user-round-check-Biw6QBQA.js → user-round-check-pBOLjTqi.js} +1 -1
  97. package/core/built/admin/assets/{wallet-cards-aM5Ct3OB.js → wallet-cards-yxIjXIK2.js} +1 -1
  98. package/core/built/admin/assets/{web-DiBDLMW8.js → web-CtBMATfv.js} +1 -1
  99. package/core/built/admin/index-forward.html +5 -5
  100. package/core/built/admin/index.html +3 -3
  101. package/core/server/services/member-welcome-emails/constants.js +1 -22
  102. package/core/server/services/member-welcome-emails/service.js +2 -20
  103. package/core/server/services/members/members-api/repositories/member-repository.js +7 -12
  104. package/package.json +13 -13
  105. package/yarn.lock +72 -89
  106. package/components/tryghost-i18n-6.13.1.tgz +0 -0
  107. /package/core/built/admin/assets/{chunk.397.a720333cfffc99c47e71.js.LICENSE.txt → chunk.397.71f16fce8de382622bb4.js.LICENSE.txt} +0 -0
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BX3p0DcO.js","assets/minus-B7zQY2p1.js","assets/deleted-feed-item-OXPcC4Z2.js","assets/trash-C2kuVkXA.js","assets/topic-filter-Cdat1Ona.js","assets/empty-indicator-DOQCKEXD.js","assets/inbox-C5KDymI8.js","assets/feed-BKXpQU0e.js","assets/hash-ZzZYv2ek.js","assets/note-C445n_od.js","assets/index-DethZCE1.js","assets/at-sign-BtKGpnjs.js","assets/user-round-check-Biw6QBQA.js","assets/reply-BET0l7FZ.js","assets/index-CQVI9TPr.js","assets/sprout-gjsBxaCU.js","assets/index-syvYkr47.js","assets/tags-DwsoamaL.js","assets/edit-profile-DgMLvoyu.js","assets/tabs--ia9i-R8.js","assets/index-BNkw6KwF.js","assets/lucide-react-DNj9Mt50.js","assets/a-large-small-2Oh9oqBr.js","assets/wallet-cards-aM5Ct3OB.js","assets/message-square-text-DJWDCab0.js","assets/copy-B8yuX-e4.js","assets/square-DsGufPa-.js","assets/repeat-CQvZJI02.js","assets/settings-OIq7tQiJ.js","assets/index-OPvny56_.js","assets/toggle-group-my6OlgUp.js","assets/moderation-DikYZSIC.js","assets/bluesky-sharing-Frg4QWOQ.js","assets/step-1-QOnWlIzD.js","assets/step-2-CDFj1bR5.js","assets/avatar-flipboard-CcvOD0pV.js","assets/step-3-Cjmt9ecL.js","assets/post-analytics-context-DGNsxT8V.js","assets/posts-DOThg8yh.js","assets/post-analytics-DPIgO2YG.js","assets/main-layout-A6BaeVIm.js","assets/post-share-modal-BIddzWjJ.js","assets/overview-vPttXZEx.js","assets/kpi-card-DOIcNxgg.js","assets/pagemenu-CUEgz3GC.js","assets/data-list-C_WXxmo3.js","assets/links-DkVK8XO7.js","assets/chart-tL51cfF9.js","assets/_baseAssignValue-CPzElAl9.js","assets/post-analytics-header-B1f7HAy_.js","assets/post-helpers-gInwAwEv.js","assets/kpis-BrSBq5c9.js","assets/source-icon-DOOAvJR8.js","assets/source-utils-B1S3ZHA2.js","assets/gh-chart-CaA6rQiP.js","assets/growth-DKtJYCNb.js","assets/table-PBYP6iVu.js","assets/currency-fEUUCkj0.js","assets/stats-Cu49FJzo.js","assets/web-DiBDLMW8.js","assets/select-BH3t_tDB.js","assets/en-Z93BzXte.js","assets/filters-dwDByCkK.js","assets/newsletter-ok4p5aPZ.js","assets/use-simple-pagination-kb9H2Ssw.js","assets/tags-DK91bj9-.js","assets/use-infinite-virtual-scroll-CS20HV8J.js","assets/comments-svHZXAlu.js","assets/index-BniBHF2r.js","assets/stats-view-DUoDKh7r.js","assets/audience-select-DuSCQEyi.js","assets/use-growth-stats-DY2E0ltn.js","assets/index-D9gfkxEz.js","assets/url-helpers-BuFo9dQz.js","assets/index-B6mBuUxr.js","assets/sort-button-DkfQ-8QJ.js","assets/referrers-BK-mXdat.js","assets/index-VdGL6HfS.js","assets/newsletters-ClUaZMbc.js","assets/settings-CpkvyD93.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-C9PDrFEW.js","assets/minus-K1Fj4qFh.js","assets/deleted-feed-item-Dl0oQ0DH.js","assets/trash-DIVNO9rU.js","assets/topic-filter-BmvO9gja.js","assets/empty-indicator-B7WXKrac.js","assets/inbox-D336Mbic.js","assets/feed-DU5QhfRX.js","assets/hash-B4UtN3nq.js","assets/note-Bqr3ECo6.js","assets/index-CEEPij-w.js","assets/at-sign-DHUgIxNb.js","assets/user-round-check-pBOLjTqi.js","assets/reply-DqXFv78k.js","assets/index-CdIdIOil.js","assets/sprout-C96gimQS.js","assets/index-w7Tz4ytz.js","assets/tags-CIEzegXe.js","assets/edit-profile-DZhjWF_f.js","assets/tabs-BTEs4Aby.js","assets/index-CLdEbHsV.js","assets/lucide-react-B7CWr8XP.js","assets/a-large-small-D-nhKFBX.js","assets/wallet-cards-yxIjXIK2.js","assets/message-square-text-Cqodm1uC.js","assets/copy-CCj6xx5V.js","assets/square-s6ZVKvbY.js","assets/repeat-BNamsVQr.js","assets/settings-BnZOyHrT.js","assets/index-BuFp5nYK.js","assets/toggle-group-qaH0bKBM.js","assets/moderation-DqX2eQNM.js","assets/bluesky-sharing-DYSv4ewp.js","assets/step-1-Gnp7iGGY.js","assets/step-2-DFbY2-K1.js","assets/avatar-flipboard-Cdj8uoBX.js","assets/step-3-CoA_-aRF.js","assets/post-analytics-context-DctS9fHu.js","assets/posts-D0erEci0.js","assets/post-analytics-DCAOPWEx.js","assets/main-layout-CmX429hf.js","assets/post-share-modal-CtQTpIsC.js","assets/overview-CGTvSQfN.js","assets/kpi-card-XLCPc_4J.js","assets/pagemenu-z-Nc5-Yy.js","assets/data-list-By9zN-Ma.js","assets/links-CY3nuFg7.js","assets/chart-BYGpVun6.js","assets/_baseAssignValue-qTINVNgk.js","assets/post-analytics-header-C6tJIKtV.js","assets/post-helpers-gInwAwEv.js","assets/kpis-Czdhg1qV.js","assets/source-icon-KI6QTdIv.js","assets/source-utils-B1S3ZHA2.js","assets/gh-chart-B98YGgzG.js","assets/growth-_giTyVF8.js","assets/table-DpY57zP6.js","assets/currency-fEUUCkj0.js","assets/stats-C8Qt0L-1.js","assets/web-CtBMATfv.js","assets/select-CFBw9aAY.js","assets/en-B8oRL8Ua.js","assets/filters-C-v3cGt0.js","assets/newsletter-BaZVL4Rg.js","assets/use-simple-pagination-_Ui1WbsL.js","assets/tags-DUcQDnmf.js","assets/use-infinite-virtual-scroll-D5U6oSIq.js","assets/comments-DiZAz2yU.js","assets/index-DXuLaG0T.js","assets/stats-view-0eaQf_pM.js","assets/audience-select-C17Kh6Hl.js","assets/use-growth-stats-DPN4F7Mt.js","assets/index-k2aVq6ms.js","assets/url-helpers-Cn69VioM.js","assets/index-DI4OotZO.js","assets/sort-button-K1rs2zWp.js","assets/referrers-D4s1ncIT.js","assets/index-B3CWs1Pb.js","assets/newsletters-DpmHk1Kf.js","assets/settings-B_8Oslb0.js"])))=>i.map(i=>d[i]);
2
2
  function QR(e,t){for(var o=0;o<t.length;o++){const n=t[o];if(typeof n!="string"&&!Array.isArray(n)){for(const r in n)if(r!=="default"&&!(r in e)){const a=Object.getOwnPropertyDescriptor(n,r);a&&Object.defineProperty(e,r,a.get?a:{enumerable:!0,get:()=>n[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function o(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(r){if(r.ep)return;r.ep=!0;const a=o(r);fetch(r.href,a)}})();var Kr0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Dz(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ZR(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var o=function n(){var r=!1;try{r=this instanceof n}catch{}return r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};o.prototype=t.prototype}else o={};return Object.defineProperty(o,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(o,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}),o}var Bb={exports:{}},Pc={},_b={exports:{}},s1={};/**
3
3
  * @license React
4
4
  * react.production.min.js
@@ -596,7 +596,7 @@ y0.version="2.24.0";eU(T1);y0.fn=h0;y0.min=DV;y0.max=IV;y0.now=FV;y0.utc=qt;y0.u
596
596
  * See the LICENSE file in the root directory of this source tree.
597
597
  */const LG=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ad=V0("x",LG),u3=Yt("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-[1.5px]",{variants:{variant:{default:"bg-primary font-medium text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive font-medium text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background font-medium hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary font-medium text-secondary-foreground hover:bg-secondary/80 dark:bg-gray-925/70 dark:hover:bg-gray-900",ghost:"font-medium hover:bg-accent hover:text-accent-foreground",link:"font-medium text-primary underline-offset-4 hover:underline",dropdown:"border border-input bg-background hover:bg-accent hover:text-accent-foreground"},size:{default:"h-[34px] px-3 py-2",sm:"h-7 rounded-md px-3 text-xs [&_svg]:size-3",lg:"h-11 rounded-md px-8 text-md font-semibold",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),o1=p.forwardRef(({className:e,variant:t,size:o,asChild:n=!1,children:r,...a},i)=>{const b=n?Qr:"button",l=t==="dropdown"?z.jsxs(z.Fragment,{children:[r,z.jsx(zZ,{className:"!-ml-1 !-mr-0.5 size-4 !stroke-[2px] opacity-50",strokeWidth:2})]}):r;return z.jsx(b,{ref:i,className:g0(u3({variant:t,size:o,className:e})),...a,children:l})});o1.displayName="Button";function xG(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",t.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}const kG=e=>{switch(e){case"success":return BG;case"info":return EG;case"warning":return _G;case"error":return SG;default:return null}},CG=Array(12).fill(0),NG=({visible:e,className:t})=>b0.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},b0.createElement("div",{className:"sonner-spinner"},CG.map((o,n)=>b0.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),BG=b0.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},b0.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),_G=b0.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},b0.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),EG=b0.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},b0.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),SG=b0.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},b0.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),TG=b0.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},b0.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),b0.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),PG=()=>{const[e,t]=b0.useState(document.hidden);return b0.useEffect(()=>{const o=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",o),()=>window.removeEventListener("visibilitychange",o)},[]),e};let dz=1;class XG{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const o=this.subscribers.indexOf(t);this.subscribers.splice(o,1)}),this.publish=t=>{this.subscribers.forEach(o=>o(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var o;const{message:n,...r}=t,a=typeof t?.id=="number"||((o=t.id)==null?void 0:o.length)>0?t.id:dz++,i=this.toasts.find(l=>l.id===a),b=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(l=>l.id===a?(this.publish({...l,...t,id:a,title:n}),{...l,...t,id:a,dismissible:b,title:n}):l):this.addToast({title:n,...r,dismissible:b,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(o=>o({id:t,dismiss:!0})))):this.toasts.forEach(o=>{this.subscribers.forEach(n=>n({id:o.id,dismiss:!0}))}),t),this.message=(t,o)=>this.create({...o,message:t}),this.error=(t,o)=>this.create({...o,message:t,type:"error"}),this.success=(t,o)=>this.create({...o,type:"success",message:t}),this.info=(t,o)=>this.create({...o,type:"info",message:t}),this.warning=(t,o)=>this.create({...o,type:"warning",message:t}),this.loading=(t,o)=>this.create({...o,type:"loading",message:t}),this.promise=(t,o)=>{if(!o)return;let n;o.loading!==void 0&&(n=this.create({...o,promise:t,type:"loading",message:o.loading,description:typeof o.description!="function"?o.description:void 0}));const r=Promise.resolve(t instanceof Function?t():t);let a=n!==void 0,i;const b=r.then(async u=>{if(i=["resolve",u],b0.isValidElement(u))a=!1,this.create({id:n,type:"default",message:u});else if(DG(u)&&!u.ok){a=!1;const f=typeof o.error=="function"?await o.error(`HTTP error! status: ${u.status}`):o.error,h=typeof o.description=="function"?await o.description(`HTTP error! status: ${u.status}`):o.description,g=typeof f=="object"&&!b0.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:h,...g})}else if(u instanceof Error){a=!1;const f=typeof o.error=="function"?await o.error(u):o.error,h=typeof o.description=="function"?await o.description(u):o.description,g=typeof f=="object"&&!b0.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:h,...g})}else if(o.success!==void 0){a=!1;const f=typeof o.success=="function"?await o.success(u):o.success,h=typeof o.description=="function"?await o.description(u):o.description,g=typeof f=="object"&&!b0.isValidElement(f)?f:{message:f};this.create({id:n,type:"success",description:h,...g})}}).catch(async u=>{if(i=["reject",u],o.error!==void 0){a=!1;const O=typeof o.error=="function"?await o.error(u):o.error,f=typeof o.description=="function"?await o.description(u):o.description,q=typeof O=="object"&&!b0.isValidElement(O)?O:{message:O};this.create({id:n,type:"error",description:f,...q})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),o.finally==null||o.finally.call(o)}),l=()=>new Promise((u,O)=>b.then(()=>i[0]==="reject"?O(i[1]):u(i[1])).catch(O));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(t,o)=>{const n=o?.id||dz++;return this.create({jsx:t(n),id:n,...o}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Ye=new XG,jG=(e,t)=>{const o=t?.id||dz++;return Ye.addToast({title:e,...t,id:o}),o},DG=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",IG=jG,FG=()=>Ye.toasts,HG=()=>Ye.getActiveToasts(),Re=Object.assign(IG,{success:Ye.success,info:Ye.info,warning:Ye.warning,error:Ye.error,custom:Ye.custom,message:Ye.message,promise:Ye.promise,dismiss:Ye.dismiss,loading:Ye.loading},{getHistory:FG,getToasts:HG});xG("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function di(e){return e.label!==void 0}const UG=3,VG="24px",$G="16px",Ef=4e3,QG=356,ZG=14,GG=45,KG=200;function pt(...e){return e.filter(Boolean).join(" ")}function YG(e){const[t,o]=e.split("-"),n=[];return t&&n.push(t),o&&n.push(o),n}const JG=e=>{var t,o,n,r,a,i,b,l,u;const{invert:O,toast:f,unstyled:h,interacting:q,setHeights:g,visibleToasts:W,heights:v,index:y,toasts:x,expanded:k,removeToast:L,defaultRichColors:C,closeButton:w,style:N,cancelButtonStyle:D,actionButtonStyle:Y,className:V="",descriptionClassName:J="",duration:t0,position:K,gap:a0,expandByDefault:q0,classNames:Z,icons:z0,closeButtonAriaLabel:U="Close toast"}=e,[X,G]=b0.useState(null),[_,I]=b0.useState(null),[i0,d0]=b0.useState(!1),[m0,W0]=b0.useState(!1),[s0,e0]=b0.useState(!1),[w0,x0]=b0.useState(!1),[j0,p1]=b0.useState(!1),[S,o0]=b0.useState(0),[r0,A0]=b0.useState(0),E0=b0.useRef(f.duration||t0||Ef),t1=b0.useRef(null),b1=b0.useRef(null),n1=y===0,d1=y+1<=W,L1=f.type,Te=f.dismissible!==!1,on=f.className||"",eo=f.descriptionClassName||"",me=b0.useMemo(()=>v.findIndex(Z0=>Z0.toastId===f.id)||0,[v,f.id]),Pe=b0.useMemo(()=>{var Z0;return(Z0=f.closeButton)!=null?Z0:w},[f.closeButton,w]),J2=b0.useMemo(()=>f.duration||t0||Ef,[f.duration,t0]),to=b0.useRef(0),Le=b0.useRef(0),et=b0.useRef(0),ze=b0.useRef(null),[nn,rn]=K.split("-"),cn=b0.useMemo(()=>v.reduce((Z0,x1,j1)=>j1>=me?Z0:Z0+x1.height,0),[v,me]),oo=PG(),no=f.invert||O,b2=L1==="loading";Le.current=b0.useMemo(()=>me*a0+cn,[me,cn]),b0.useEffect(()=>{E0.current=J2},[J2]),b0.useEffect(()=>{d0(!0)},[]),b0.useEffect(()=>{const Z0=b1.current;if(Z0){const x1=Z0.getBoundingClientRect().height;return A0(x1),g(j1=>[{toastId:f.id,height:x1,position:f.position},...j1]),()=>g(j1=>j1.filter(ue=>ue.toastId!==f.id))}},[g,f.id]),b0.useLayoutEffect(()=>{if(!i0)return;const Z0=b1.current,x1=Z0.style.height;Z0.style.height="auto";const j1=Z0.getBoundingClientRect().height;Z0.style.height=x1,A0(j1),g(ue=>ue.find(E=>E.toastId===f.id)?ue.map(E=>E.toastId===f.id?{...E,height:j1}:E):[{toastId:f.id,height:j1,position:f.position},...ue])},[i0,f.title,f.description,g,f.id,f.jsx,f.action,f.cancel]);const Xe=b0.useCallback(()=>{W0(!0),o0(Le.current),g(Z0=>Z0.filter(x1=>x1.toastId!==f.id)),setTimeout(()=>{L(f)},KG)},[f,L,g,Le]);b0.useEffect(()=>{if(f.promise&&L1==="loading"||f.duration===1/0||f.type==="loading")return;let Z0;return k||q||oo?(()=>{if(et.current<to.current){const ue=new Date().getTime()-to.current;E0.current=E0.current-ue}et.current=new Date().getTime()})():(()=>{E0.current!==1/0&&(to.current=new Date().getTime(),Z0=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),Xe()},E0.current))})(),()=>clearTimeout(Z0)},[k,q,f,L1,oo,Xe]),b0.useEffect(()=>{f.delete&&(Xe(),f.onDismiss==null||f.onDismiss.call(f,f))},[Xe,f.delete]);function gt(){var Z0;if(z0?.loading){var x1;return b0.createElement("div",{className:pt(Z?.loader,f==null||(x1=f.classNames)==null?void 0:x1.loader,"sonner-loader"),"data-visible":L1==="loading"},z0.loading)}return b0.createElement(NG,{className:pt(Z?.loader,f==null||(Z0=f.classNames)==null?void 0:Z0.loader),visible:L1==="loading"})}const tt=f.icon||z0?.[L1]||kG(L1);var l2,an;return b0.createElement("li",{tabIndex:0,ref:b1,className:pt(V,on,Z?.toast,f==null||(t=f.classNames)==null?void 0:t.toast,Z?.default,Z?.[L1],f==null||(o=f.classNames)==null?void 0:o[L1]),"data-sonner-toast":"","data-rich-colors":(l2=f.richColors)!=null?l2:C,"data-styled":!(f.jsx||f.unstyled||h),"data-mounted":i0,"data-promise":!!f.promise,"data-swiped":j0,"data-removed":m0,"data-visible":d1,"data-y-position":nn,"data-x-position":rn,"data-index":y,"data-front":n1,"data-swiping":s0,"data-dismissible":Te,"data-type":L1,"data-invert":no,"data-swipe-out":w0,"data-swipe-direction":_,"data-expanded":!!(k||q0&&i0),"data-testid":f.testId,style:{"--index":y,"--toasts-before":y,"--z-index":x.length-y,"--offset":`${m0?S:Le.current}px`,"--initial-height":q0?"auto":`${r0}px`,...N,...f.style},onDragEnd:()=>{e0(!1),G(null),ze.current=null},onPointerDown:Z0=>{Z0.button!==2&&(b2||!Te||(t1.current=new Date,o0(Le.current),Z0.target.setPointerCapture(Z0.pointerId),Z0.target.tagName!=="BUTTON"&&(e0(!0),ze.current={x:Z0.clientX,y:Z0.clientY})))},onPointerUp:()=>{var Z0,x1,j1;if(w0||!Te)return;ze.current=null;const ue=Number(((Z0=b1.current)==null?void 0:Z0.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ot=Number(((x1=b1.current)==null?void 0:x1.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),E=new Date().getTime()-((j1=t1.current)==null?void 0:j1.getTime()),j=X==="x"?ue:ot,$=Math.abs(j)/E;if(Math.abs(j)>=GG||$>.11){o0(Le.current),f.onDismiss==null||f.onDismiss.call(f,f),I(X==="x"?ue>0?"right":"left":ot>0?"down":"up"),Xe(),x0(!0);return}else{var c0,O0;(c0=b1.current)==null||c0.style.setProperty("--swipe-amount-x","0px"),(O0=b1.current)==null||O0.style.setProperty("--swipe-amount-y","0px")}p1(!1),e0(!1),G(null)},onPointerMove:Z0=>{var x1,j1,ue;if(!ze.current||!Te||((x1=window.getSelection())==null?void 0:x1.toString().length)>0)return;const E=Z0.clientY-ze.current.y,j=Z0.clientX-ze.current.x;var $;const c0=($=e.swipeDirections)!=null?$:YG(K);!X&&(Math.abs(j)>1||Math.abs(E)>1)&&G(Math.abs(j)>Math.abs(E)?"x":"y");let O0={x:0,y:0};const k0=R0=>1/(1.5+Math.abs(R0)/20);if(X==="y"){if(c0.includes("top")||c0.includes("bottom"))if(c0.includes("top")&&E<0||c0.includes("bottom")&&E>0)O0.y=E;else{const R0=E*k0(E);O0.y=Math.abs(R0)<Math.abs(E)?R0:E}}else if(X==="x"&&(c0.includes("left")||c0.includes("right")))if(c0.includes("left")&&j<0||c0.includes("right")&&j>0)O0.x=j;else{const R0=j*k0(j);O0.x=Math.abs(R0)<Math.abs(j)?R0:j}(Math.abs(O0.x)>0||Math.abs(O0.y)>0)&&p1(!0),(j1=b1.current)==null||j1.style.setProperty("--swipe-amount-x",`${O0.x}px`),(ue=b1.current)==null||ue.style.setProperty("--swipe-amount-y",`${O0.y}px`)}},Pe&&!f.jsx&&L1!=="loading"?b0.createElement("button",{"aria-label":U,"data-disabled":b2,"data-close-button":!0,onClick:b2||!Te?()=>{}:()=>{Xe(),f.onDismiss==null||f.onDismiss.call(f,f)},className:pt(Z?.closeButton,f==null||(n=f.classNames)==null?void 0:n.closeButton)},(an=z0?.close)!=null?an:TG):null,(L1||f.icon||f.promise)&&f.icon!==null&&(z0?.[L1]!==null||f.icon)?b0.createElement("div",{"data-icon":"",className:pt(Z?.icon,f==null||(r=f.classNames)==null?void 0:r.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||gt():null,f.type!=="loading"?tt:null):null,b0.createElement("div",{"data-content":"",className:pt(Z?.content,f==null||(a=f.classNames)==null?void 0:a.content)},b0.createElement("div",{"data-title":"",className:pt(Z?.title,f==null||(i=f.classNames)==null?void 0:i.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?b0.createElement("div",{"data-description":"",className:pt(J,eo,Z?.description,f==null||(b=f.classNames)==null?void 0:b.description)},typeof f.description=="function"?f.description():f.description):null),b0.isValidElement(f.cancel)?f.cancel:f.cancel&&di(f.cancel)?b0.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||D,onClick:Z0=>{di(f.cancel)&&Te&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,Z0),Xe())},className:pt(Z?.cancelButton,f==null||(l=f.classNames)==null?void 0:l.cancelButton)},f.cancel.label):null,b0.isValidElement(f.action)?f.action:f.action&&di(f.action)?b0.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||Y,onClick:Z0=>{di(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,Z0),!Z0.defaultPrevented&&Xe())},className:pt(Z?.actionButton,f==null||(u=f.classNames)==null?void 0:u.actionButton)},f.action.label):null)};function Sf(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function eK(e,t){const o={};return[e,t].forEach((n,r)=>{const a=r===1,i=a?"--mobile-offset":"--offset",b=a?$G:VG;function l(u){["top","right","bottom","left"].forEach(O=>{o[`${i}-${O}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?l(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?o[`${i}-${u}`]=b:o[`${i}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):l(b)}),o}const tK=b0.forwardRef(function(t,o){const{id:n,invert:r,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:b,closeButton:l,className:u,offset:O,mobileOffset:f,theme:h="light",richColors:q,duration:g,style:W,visibleToasts:v=UG,toastOptions:y,dir:x=Sf(),gap:k=ZG,icons:L,containerAriaLabel:C="Notifications"}=t,[w,N]=b0.useState([]),D=b0.useMemo(()=>n?w.filter(i0=>i0.toasterId===n):w.filter(i0=>!i0.toasterId),[w,n]),Y=b0.useMemo(()=>Array.from(new Set([a].concat(D.filter(i0=>i0.position).map(i0=>i0.position)))),[D,a]),[V,J]=b0.useState([]),[t0,K]=b0.useState(!1),[a0,q0]=b0.useState(!1),[Z,z0]=b0.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=b0.useRef(null),X=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),G=b0.useRef(null),_=b0.useRef(!1),I=b0.useCallback(i0=>{N(d0=>{var m0;return(m0=d0.find(W0=>W0.id===i0.id))!=null&&m0.delete||Ye.dismiss(i0.id),d0.filter(({id:W0})=>W0!==i0.id)})},[]);return b0.useEffect(()=>Ye.subscribe(i0=>{if(i0.dismiss){requestAnimationFrame(()=>{N(d0=>d0.map(m0=>m0.id===i0.id?{...m0,delete:!0}:m0))});return}setTimeout(()=>{ih.flushSync(()=>{N(d0=>{const m0=d0.findIndex(W0=>W0.id===i0.id);return m0!==-1?[...d0.slice(0,m0),{...d0[m0],...i0},...d0.slice(m0+1)]:[i0,...d0]})})})}),[w]),b0.useEffect(()=>{if(h!=="system"){z0(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z0("dark"):z0("light")),typeof window>"u")return;const i0=window.matchMedia("(prefers-color-scheme: dark)");try{i0.addEventListener("change",({matches:d0})=>{z0(d0?"dark":"light")})}catch{i0.addListener(({matches:m0})=>{try{z0(m0?"dark":"light")}catch(W0){console.error(W0)}})}},[h]),b0.useEffect(()=>{w.length<=1&&K(!1)},[w]),b0.useEffect(()=>{const i0=d0=>{var m0;if(i.every(e0=>d0[e0]||d0.code===e0)){var s0;K(!0),(s0=U.current)==null||s0.focus()}d0.code==="Escape"&&(document.activeElement===U.current||(m0=U.current)!=null&&m0.contains(document.activeElement))&&K(!1)};return document.addEventListener("keydown",i0),()=>document.removeEventListener("keydown",i0)},[i]),b0.useEffect(()=>{if(U.current)return()=>{G.current&&(G.current.focus({preventScroll:!0}),G.current=null,_.current=!1)}},[U.current]),b0.createElement("section",{ref:o,"aria-label":`${C} ${X}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},Y.map((i0,d0)=>{var m0;const[W0,s0]=i0.split("-");return D.length?b0.createElement("ol",{key:i0,dir:x==="auto"?Sf():x,tabIndex:-1,ref:U,className:u,"data-sonner-toaster":!0,"data-sonner-theme":Z,"data-y-position":W0,"data-x-position":s0,style:{"--front-toast-height":`${((m0=V[0])==null?void 0:m0.height)||0}px`,"--width":`${QG}px`,"--gap":`${k}px`,...W,...eK(O,f)},onBlur:e0=>{_.current&&!e0.currentTarget.contains(e0.relatedTarget)&&(_.current=!1,G.current&&(G.current.focus({preventScroll:!0}),G.current=null))},onFocus:e0=>{e0.target instanceof HTMLElement&&e0.target.dataset.dismissible==="false"||_.current||(_.current=!0,G.current=e0.relatedTarget)},onMouseEnter:()=>K(!0),onMouseMove:()=>K(!0),onMouseLeave:()=>{a0||K(!1)},onDragEnd:()=>K(!1),onPointerDown:e0=>{e0.target instanceof HTMLElement&&e0.target.dataset.dismissible==="false"||q0(!0)},onPointerUp:()=>q0(!1)},D.filter(e0=>!e0.position&&d0===0||e0.position===i0).map((e0,w0)=>{var x0,j0;return b0.createElement(JG,{key:e0.id,icons:L,index:w0,toast:e0,defaultRichColors:q,duration:(x0=y?.duration)!=null?x0:g,className:y?.className,descriptionClassName:y?.descriptionClassName,invert:r,visibleToasts:v,closeButton:(j0=y?.closeButton)!=null?j0:l,interacting:a0,position:i0,style:y?.style,unstyled:y?.unstyled,classNames:y?.classNames,cancelButtonStyle:y?.cancelButtonStyle,actionButtonStyle:y?.actionButtonStyle,closeButtonAriaLabel:y?.closeButtonAriaLabel,removeToast:I,toasts:D.filter(p1=>p1.position==e0.position),heights:V.filter(p1=>p1.position==e0.position),setHeights:J,expandByDefault:b,gap:k,expanded:t0,swipeDirections:t.swipeDirections})})):null}))}),oK=({...e})=>z.jsx(tK,{className:"toaster group",style:{"--normal-bg":"hsl(var(--background))","--normal-text":"hsl(var(--foreground))","--normal-border":"hsl(var(--border))"},theme:"light",...e}),nK=b0.createContext({isDirty:!1,setGlobalDirtyState:()=>{}}),rK=({children:e})=>{const[t,o]=p.useState([]),n=p.useCallback((r,a)=>{o(i=>a&&!i.includes(r)?[...i,r]:!a&&i.includes(r)?i.filter(b=>b!==r):i)},[]);return z.jsx(nK.Provider,{value:{isDirty:t.length>0,setGlobalDirtyState:n},children:e})},cK=e=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",height:24,width:24,id:"Alert-Triangle--Streamline-Ultimate",...e},p.createElement("desc",null,"Alert Triangle Streamline Icon: https://streamlinehq.com"),p.createElement("path",{d:"m23.77 20.57 -10 -19A2 2 0 0 0 12 0.5a2 2 0 0 0 -1.77 1.07l-10 19a2 2 0 0 0 0.06 2A2 2 0 0 0 2 23.5h20a2 2 0 0 0 1.77 -2.93ZM11 8.5a1 1 0 0 1 2 0v6a1 1 0 0 1 -2 0ZM12.05 20a1.53 1.53 0 0 1 -1.52 -1.47A1.48 1.48 0 0 1 12 17a1.53 1.53 0 0 1 1.52 1.47A1.48 1.48 0 0 1 12.05 20Z",fill:"currentColor",strokeWidth:1})),aK="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20height='24'%20width='24'%20id='Alert-Triangle--Streamline-Ultimate'%3e%3cdesc%3eAlert%20Triangle%20Streamline%20Icon:%20https://streamlinehq.com%3c/desc%3e%3cpath%20d='m23.77%2020.57%20-10%20-19A2%202%200%200%200%2012%200.5a2%202%200%200%200%20-1.77%201.07l-10%2019a2%202%200%200%200%200.06%202A2%202%200%200%200%202%2023.5h20a2%202%200%200%200%201.77%20-2.93ZM11%208.5a1%201%200%200%201%202%200v6a1%201%200%200%201%20-2%200ZM12.05%2020a1.53%201.53%200%200%201%20-1.52%20-1.47A1.48%201.48%200%200%201%2012%2017a1.53%201.53%200%200%201%201.52%201.47A1.48%201.48%200%200%201%2012.05%2020Z'%20fill='currentColor'%20stroke-width='1'%3e%3c/path%3e%3c/svg%3e",sK=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:cK,default:aK},Symbol.toStringTag,{value:"Module"})),iK=e=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",height:24,width:24,id:"Information-Circle--Streamline-Ultimate",...e},p.createElement("desc",null,"Information Circle Streamline Icon: https://streamlinehq.com"),p.createElement("path",{d:"M12 0a12 12 0 1 0 12 12A12 12 0 0 0 12 0Zm0.25 5a1.5 1.5 0 1 1 -1.5 1.5 1.5 1.5 0 0 1 1.5 -1.5Zm2.25 13.5h-4a1 1 0 0 1 0 -2h0.75a0.25 0.25 0 0 0 0.25 -0.25v-4.5a0.25 0.25 0 0 0 -0.25 -0.25h-0.75a1 1 0 0 1 0 -2h1a2 2 0 0 1 2 2v4.75a0.25 0.25 0 0 0 0.25 0.25h0.75a1 1 0 0 1 0 2Z",fill:"currentcolor",strokeWidth:1})),pK="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20height='24'%20width='24'%20id='Information-Circle--Streamline-Ultimate'%3e%3cdesc%3eInformation%20Circle%20Streamline%20Icon:%20https://streamlinehq.com%3c/desc%3e%3cpath%20d='M12%200a12%2012%200%201%200%2012%2012A12%2012%200%200%200%2012%200Zm0.25%205a1.5%201.5%200%201%201%20-1.5%201.5%201.5%201.5%200%200%201%201.5%20-1.5Zm2.25%2013.5h-4a1%201%200%200%201%200%20-2h0.75a0.25%200.25%200%200%200%200.25%20-0.25v-4.5a0.25%200.25%200%200%200%20-0.25%20-0.25h-0.75a1%201%200%200%201%200%20-2h1a2%202%200%200%201%202%202v4.75a0.25%200.25%200%200%200%200.25%200.25h0.75a1%201%200%200%201%200%202Z'%20fill='currentcolor'%20stroke-width='1'%3e%3c/path%3e%3c/svg%3e",MK=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:iK,default:pK},Symbol.toStringTag,{value:"Module"})),bK=e=>p.createElement("svg",{height:16,id:"Skull-2--Streamline-Ultimate",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("desc",null,`
598
598
  Skull 2 Streamline Icon: https://streamlinehq.com
599
- `),p.createElement("g",null,p.createElement("path",{d:"M12.333333333333332 7.333333333333333a4.333333333333333 4.333333333333333 0 1 0 -7.333333333333333 3.126666666666667v1.88a1 1 0 0 0 2 0 1 1 0 0 0 2 0 1 1 0 1 0 2 0v-1.88a4.326666666666666 4.326666666666666 0 0 0 1.3333333333333333 -3.126666666666667Zm-6.253333333333334 1a1 1 0 1 1 1 -1 1 1 0 0 1 -1 1Zm4 0a1 1 0 1 1 1 -1 1 1 0 0 1 -1 1Z",fill:"currentColor",strokeWidth:.6667}),p.createElement("path",{d:"m1.8666666666666665 3.28 1.22 1.22a0.3466666666666667 0.3466666666666667 0 0 0 0.26666666666666666 0.09333333333333334 0.35333333333333333 0.35333333333333333 0 0 0 0.24666666666666665 -0.14666666666666667 5.133333333333333 5.133333333333333 0 0 1 0.8066666666666666 -0.9733333333333333 0.3133333333333333 0.3133333333333333 0 0 0 0.09999999999999999 -0.2333333333333333 0.3666666666666667 0.3666666666666667 0 0 0 -0.09333333333333334 -0.24666666666666665L3.28 1.8666666666666665A1.1666666666666665 1.1666666666666665 0 0 0 1.8399999999999999 0.11333333333333334a0.6666666666666666 0.6666666666666666 0 0 0 -0.3666666666666667 0.48l-0.09999999999999999 0.5133333333333333a0.31999999999999995 0.31999999999999995 0 0 1 -0.26 0.26666666666666666l-0.52 0.09999999999999999a0.6666666666666666 0.6666666666666666 0 0 0 -0.48 0.3666666666666667A1.1666666666666665 1.1666666666666665 0 0 0 1.8666666666666665 3.28Z",fill:"currentColor",strokeWidth:.6667}),p.createElement("path",{d:"M12.4 4.446666666666666a0.35333333333333333 0.35333333333333333 0 0 0 0.24666666666666665 0.14666666666666667 0.3466666666666667 0.3466666666666667 0 0 0 0.26666666666666666 -0.09333333333333334l1.22 -1.22a1.1666666666666665 1.1666666666666665 0 0 0 1.7533333333333332 -1.44 0.6666666666666666 0.6666666666666666 0 0 0 -0.48 -0.3666666666666667l-0.52 -0.09999999999999999a0.31999999999999995 0.31999999999999995 0 0 1 -0.26 -0.26666666666666666l-0.09999999999999999 -0.5133333333333333a0.6666666666666666 0.6666666666666666 0 0 0 -0.3666666666666667 -0.48 1.1666666666666665 1.1666666666666665 0 0 0 -1.44 1.7533333333333332l-1.1333333333333333 1.1266666666666665a0.3666666666666667 0.3666666666666667 0 0 0 -0.09333333333333334 0.24666666666666665 0.3133333333333333 0.3133333333333333 0 0 0 0.09999999999999999 0.2333333333333333 5.133333333333333 5.133333333333333 0 0 1 0.8066666666666666 0.9733333333333333Z",fill:"currentColor",strokeWidth:.6667}),p.createElement("path",{d:"M3.6 11.559999999999999a0.33999999999999997 0.33999999999999997 0 0 0 -0.26666666666666666 -0.15333333333333332 0.3466666666666667 0.3466666666666667 0 0 0 -0.26666666666666666 0.09333333333333334l-1.2 1.22a1.1666666666666665 1.1666666666666665 0 0 0 -1.7533333333333332 1.44 0.6666666666666666 0.6666666666666666 0 0 0 0.48 0.3666666666666667l0.52 0.09999999999999999a0.31999999999999995 0.31999999999999995 0 0 1 0.26 0.26666666666666666l0.09999999999999999 0.5133333333333333a0.6666666666666666 0.6666666666666666 0 0 0 0.3666666666666667 0.48 1.1666666666666665 1.1666666666666665 0 0 0 1.44 -1.7533333333333332l1.1333333333333333 -1.1266666666666665a0.36 0.36 0 0 0 0.09333333333333334 -0.24 0.31999999999999995 0.31999999999999995 0 0 0 -0.09999999999999999 -0.24 5.333333333333333 5.333333333333333 0 0 1 -0.8066666666666666 -0.9666666666666666Z",fill:"currentColor",strokeWidth:.6667}),p.createElement("path",{d:"m14.133333333333333 12.719999999999999 -1.22 -1.22a0.3466666666666667 0.3466666666666667 0 0 0 -0.26666666666666666 -0.09333333333333334 0.33999999999999997 0.33999999999999997 0 0 0 -0.24666666666666665 0.15333333333333332 5.333333333333333 5.333333333333333 0 0 1 -0.8066666666666666 0.9666666666666666 0.31999999999999995 0.31999999999999995 0 0 0 -0.09999999999999999 0.24 0.36 0.36 0 0 0 0.09333333333333334 0.24l1.1333333333333333 1.1266666666666665a1.1666666666666665 1.1666666666666665 0 0 0 1.44 1.7533333333333332 0.6666666666666666 0.6666666666666666 0 0 0 0.3666666666666667 -0.48l0.09999999999999999 -0.5133333333333333a0.31999999999999995 0.31999999999999995 0 0 1 0.26 -0.26666666666666666l0.52 -0.09999999999999999a0.6666666666666666 0.6666666666666666 0 0 0 0.48 -0.3666666666666667 1.1666666666666665 1.1666666666666665 0 0 0 -1.7533333333333332 -1.44Z",fill:"currentColor",strokeWidth:.6667}))),lK="data:image/svg+xml,%3csvg%20height='16'%20id='Skull-2--Streamline-Ultimate'%20viewBox='0%200%2016%2016'%20width='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cdesc%3e%20Skull%202%20Streamline%20Icon:%20https://streamlinehq.com%20%3c/desc%3e%3cg%3e%3cpath%20d='M12.333333333333332%207.333333333333333a4.333333333333333%204.333333333333333%200%201%200%20-7.333333333333333%203.126666666666667v1.88a1%201%200%200%200%202%200%201%201%200%200%200%202%200%201%201%200%201%200%202%200v-1.88a4.326666666666666%204.326666666666666%200%200%200%201.3333333333333333%20-3.126666666666667Zm-6.253333333333334%201a1%201%200%201%201%201%20-1%201%201%200%200%201%20-1%201Zm4%200a1%201%200%201%201%201%20-1%201%201%200%200%201%20-1%201Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3cpath%20d='m1.8666666666666665%203.28%201.22%201.22a0.3466666666666667%200.3466666666666667%200%200%200%200.26666666666666666%200.09333333333333334%200.35333333333333333%200.35333333333333333%200%200%200%200.24666666666666665%20-0.14666666666666667%205.133333333333333%205.133333333333333%200%200%201%200.8066666666666666%20-0.9733333333333333%200.3133333333333333%200.3133333333333333%200%200%200%200.09999999999999999%20-0.2333333333333333%200.3666666666666667%200.3666666666666667%200%200%200%20-0.09333333333333334%20-0.24666666666666665L3.28%201.8666666666666665A1.1666666666666665%201.1666666666666665%200%200%200%201.8399999999999999%200.11333333333333334a0.6666666666666666%200.6666666666666666%200%200%200%20-0.3666666666666667%200.48l-0.09999999999999999%200.5133333333333333a0.31999999999999995%200.31999999999999995%200%200%201%20-0.26%200.26666666666666666l-0.52%200.09999999999999999a0.6666666666666666%200.6666666666666666%200%200%200%20-0.48%200.3666666666666667A1.1666666666666665%201.1666666666666665%200%200%200%201.8666666666666665%203.28Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3cpath%20d='M12.4%204.446666666666666a0.35333333333333333%200.35333333333333333%200%200%200%200.24666666666666665%200.14666666666666667%200.3466666666666667%200.3466666666666667%200%200%200%200.26666666666666666%20-0.09333333333333334l1.22%20-1.22a1.1666666666666665%201.1666666666666665%200%200%200%201.7533333333333332%20-1.44%200.6666666666666666%200.6666666666666666%200%200%200%20-0.48%20-0.3666666666666667l-0.52%20-0.09999999999999999a0.31999999999999995%200.31999999999999995%200%200%201%20-0.26%20-0.26666666666666666l-0.09999999999999999%20-0.5133333333333333a0.6666666666666666%200.6666666666666666%200%200%200%20-0.3666666666666667%20-0.48%201.1666666666666665%201.1666666666666665%200%200%200%20-1.44%201.7533333333333332l-1.1333333333333333%201.1266666666666665a0.3666666666666667%200.3666666666666667%200%200%200%20-0.09333333333333334%200.24666666666666665%200.3133333333333333%200.3133333333333333%200%200%200%200.09999999999999999%200.2333333333333333%205.133333333333333%205.133333333333333%200%200%201%200.8066666666666666%200.9733333333333333Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3cpath%20d='M3.6%2011.559999999999999a0.33999999999999997%200.33999999999999997%200%200%200%20-0.26666666666666666%20-0.15333333333333332%200.3466666666666667%200.3466666666666667%200%200%200%20-0.26666666666666666%200.09333333333333334l-1.2%201.22a1.1666666666666665%201.1666666666666665%200%200%200%20-1.7533333333333332%201.44%200.6666666666666666%200.6666666666666666%200%200%200%200.48%200.3666666666666667l0.52%200.09999999999999999a0.31999999999999995%200.31999999999999995%200%200%201%200.26%200.26666666666666666l0.09999999999999999%200.5133333333333333a0.6666666666666666%200.6666666666666666%200%200%200%200.3666666666666667%200.48%201.1666666666666665%201.1666666666666665%200%200%200%201.44%20-1.7533333333333332l1.1333333333333333%20-1.1266666666666665a0.36%200.36%200%200%200%200.09333333333333334%20-0.24%200.31999999999999995%200.31999999999999995%200%200%200%20-0.09999999999999999%20-0.24%205.333333333333333%205.333333333333333%200%200%201%20-0.8066666666666666%20-0.9666666666666666Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3cpath%20d='m14.133333333333333%2012.719999999999999%20-1.22%20-1.22a0.3466666666666667%200.3466666666666667%200%200%200%20-0.26666666666666666%20-0.09333333333333334%200.33999999999999997%200.33999999999999997%200%200%200%20-0.24666666666666665%200.15333333333333332%205.333333333333333%205.333333333333333%200%200%201%20-0.8066666666666666%200.9666666666666666%200.31999999999999995%200.31999999999999995%200%200%200%20-0.09999999999999999%200.24%200.36%200.36%200%200%200%200.09333333333333334%200.24l1.1333333333333333%201.1266666666666665a1.1666666666666665%201.1666666666666665%200%200%200%201.44%201.7533333333333332%200.6666666666666666%200.6666666666666666%200%200%200%200.3666666666666667%20-0.48l0.09999999999999999%20-0.5133333333333333a0.31999999999999995%200.31999999999999995%200%200%201%200.26%20-0.26666666666666666l0.52%20-0.09999999999999999a0.6666666666666666%200.6666666666666666%200%200%200%200.48%20-0.3666666666666667%201.1666666666666665%201.1666666666666665%200%200%200%20-1.7533333333333332%20-1.44Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3c/g%3e%3c/svg%3e",zK=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:bK,default:lK},Symbol.toStringTag,{value:"Module"})),uK=e=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",height:24,width:24,id:"Check-Circle-1--Streamline-Ultimate",...e},p.createElement("desc",null,"Check Circle 1 Streamline Icon: https://streamlinehq.com"),p.createElement("path",{d:"M12 0a12 12 0 1 0 12 12A12 12 0 0 0 12 0Zm6.93 8.2 -6.85 9.29a1 1 0 0 1 -1.43 0.19l-4.89 -3.91a1 1 0 0 1 -0.15 -1.41A1 1 0 0 1 7 12.21l4.08 3.26L17.32 7a1 1 0 0 1 1.39 -0.21 1 1 0 0 1 0.22 1.41Z",fill:"currentcolor",strokeWidth:1})),dK="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20height='24'%20width='24'%20id='Check-Circle-1--Streamline-Ultimate'%3e%3cdesc%3eCheck%20Circle%201%20Streamline%20Icon:%20https://streamlinehq.com%3c/desc%3e%3cpath%20d='M12%200a12%2012%200%201%200%2012%2012A12%2012%200%200%200%2012%200Zm6.93%208.2%20-6.85%209.29a1%201%200%200%201%20-1.43%200.19l-4.89%20-3.91a1%201%200%200%201%20-0.15%20-1.41A1%201%200%200%201%207%2012.21l4.08%203.26L17.32%207a1%201%200%200%201%201.39%20-0.21%201%201%200%200%201%200.22%201.41Z'%20fill='currentcolor'%20stroke-width='1'%3e%3c/path%3e%3c/svg%3e",OK=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:uK,default:dK},Symbol.toStringTag,{value:"Module"})),fK=e=>p.createElement("svg",{viewBox:"-0.75 -0.75 20 20",xmlns:"http://www.w3.org/2000/svg",height:24,width:24,...e},p.createElement("desc",null,"Typography"),p.createElement("path",{d:"m0.578125 9.827354166666668 8.09375 0",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),p.createElement("path",{d:"m12.140625 13.296104166666666 5.78125 0",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),p.createElement("path",{d:"M12.140625 16.764854166666666V10.40625a2.890625 2.890625 0 0 1 5.78125 0v6.359375",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),p.createElement("path",{d:"M0.578125 16.764854166666666V5.78125a4.046875 4.046875 0 0 1 8.09375 0v10.984375",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5})),AK="data:image/svg+xml,%3csvg%20viewBox='-0.75%20-0.75%2020%2020'%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20width='24'%3e%3cdesc%3eTypography%3c/desc%3e%3cpath%20d='m0.578125%209.827354166666668%208.09375%200'%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.5'%3e%3c/path%3e%3cpath%20d='m12.140625%2013.296104166666666%205.78125%200'%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.5'%3e%3c/path%3e%3cpath%20d='M12.140625%2016.764854166666666V10.40625a2.890625%202.890625%200%200%201%205.78125%200v6.359375'%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.5'%3e%3c/path%3e%3cpath%20d='M0.578125%2016.764854166666666V5.78125a4.046875%204.046875%200%200%201%208.09375%200v10.984375'%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.5'%3e%3c/path%3e%3c/svg%3e",hK=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:fK,default:AK},Symbol.toStringTag,{value:"Module"})),qK=Yt("",{variants:{size:{sm:"size-3",md:"size-4",lg:"size-6",xl:"size-8"}},defaultVariants:{size:"md"}}),mK=Object.assign({"../../assets/icons/error-fill.svg":sK,"../../assets/icons/info-fill.svg":MK,"../../assets/icons/skull-and-bones.svg":zK,"../../assets/icons/success-fill.svg":OK,"../../assets/icons/typography.svg":hK}),Ii=Object.entries(mK).reduce((e,[t,o])=>{var n;const r=((n=t.match(/[^/]+(?=\.svg$)/))==null?void 0:n[0])??"",a=VQ(r),i=b=>{const{size:l,className:u,...O}=b,f=g0(qK({size:l,className:u}));return b0.createElement(o.ReactComponent,{...O,className:f})};return i.displayName=`Icon.${a}`,e[a]=i,e},{}),gc0=Ii,gK=p.createContext({isAnyTextFieldFocused:!1,setFocusState:()=>{},darkMode:!1}),WK=()=>{const[e,t]=p.useState(!1);return p.useEffect(()=>(t(!0),()=>t(!1)),[]),e?Sp.createPortal(z.jsx("div",{className:en,style:{width:"unset",height:"unset"},children:z.jsx(oK,{icons:{error:z.jsx(Ii.ErrorFill,{className:"text-red"}),success:z.jsx(Ii.SuccessFill,{className:"text-green"}),info:z.jsx(Ii.InfoFill,{className:"text-gray-500"})},position:"bottom-left",toastOptions:{classNames:{title:"!mt-[-1px] !text-md !font-semibold !leading-tighter !tracking-[0.1px]",description:"!text-gray-900 dark:!text-gray-300 !text-sm !mt-px",icon:"!ml-0"},style:{alignItems:"flex-start",maxWidth:"290px"}}})}),document.body):null},vK=({darkMode:e,children:t})=>{const[o,n]=p.useState(!1),r=a=>{n(a)};return z.jsx(gK.Provider,{value:{isAnyTextFieldFocused:o,setFocusState:r,darkMode:e},children:z.jsxs(rK,{children:[t,z.jsx(WK,{})]})})},en="shade shade-admin shade-activitypub shade-stats shade-posts",RK=({darkMode:e,fetchKoenigLexical:t,className:o,children:n,...r})=>{const a=Z1("shade",o);return z.jsx("div",{className:a,...r,children:z.jsx(vK,{darkMode:e,children:n})})},yK=hH,wK=qH,LK=mH,d9=p.forwardRef(({className:e,...t},o)=>z.jsx(t8,{className:g0("fixed inset-0 z-50 bg-black/30 backdrop-blur-none transform-gpu data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=open]:backdrop-blur-[3px]",e),...t,ref:o}));d9.displayName=t8.displayName;const O9=p.forwardRef(({className:e,...t},o)=>z.jsx(LK,{children:z.jsxs("div",{className:en,children:[z.jsx(d9,{onClick:n=>n.stopPropagation()}),z.jsx(o8,{ref:o,className:g0("fixed left-[50%] top-[20%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-20%] gap-6 bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[18%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[18%] sm:rounded-lg",e),...t})]})}));O9.displayName=o8.displayName;const f9=({className:e,...t})=>z.jsx("div",{className:g0("flex flex-col space-y-2 text-center sm:text-left",e),...t});f9.displayName="AlertDialogHeader";const A9=({className:e,...t})=>z.jsx("div",{className:g0("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 [&>button]:min-w-20",e),...t});A9.displayName="AlertDialogFooter";const h9=p.forwardRef(({className:e,...t},o)=>z.jsx(c8,{ref:o,className:g0("text-xl font-semibold",e),...t}));h9.displayName=c8.displayName;const q9=p.forwardRef(({className:e,...t},o)=>z.jsx(a8,{ref:o,className:g0("text-base",e),...t}));q9.displayName=a8.displayName;const m9=p.forwardRef(({className:e,...t},o)=>z.jsx(n8,{ref:o,className:g0(u3(),e),...t}));m9.displayName=n8.displayName;const g9=p.forwardRef(({className:e,...t},o)=>z.jsx(r8,{ref:o,className:g0(u3({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));g9.displayName=r8.displayName;const xK=p.lazy(()=>z1(()=>import("./index-DOORRiFo.js"),[])),Tf=e=>z.jsx(p.Suspense,{fallback:z.jsx("div",{}),children:z.jsx(xK,{...e})}),hd=p.forwardRef(({className:e,...t},o)=>z.jsx(gq,{ref:o,className:g0("relative flex h-8 w-8 shrink-0 overflow-hidden rounded-full",e),...t}));hd.displayName=gq.displayName;const qd=p.forwardRef(({className:e,...t},o)=>z.jsx(Wq,{ref:o,className:g0("aspect-square h-full w-full",e),...t}));qd.displayName=Wq.displayName;const md=p.forwardRef(({className:e,...t},o)=>z.jsx(vq,{ref:o,className:g0("flex h-full w-full items-center justify-center rounded-full bg-muted [&_svg]:size-4",e),...t}));md.displayName=vq.displayName;const kK=Yt("inline-flex items-center rounded-sm border px-1.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground/70",destructive:"border-transparent bg-destructive/20 text-destructive",success:"border-transparent bg-green/20 text-green",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function CK({className:e,variant:t,...o}){return z.jsx("div",{className:g0(kK({variant:t}),e),...o})}const NK=Yt("relative block rounded-lg transition-all duration-300",{variants:{variant:{default:"border border-border bg-background shadow-sm hover:shadow-md",gradient:["cursor-pointer border border-gray-100 bg-white","shadow-[rgb(75_225_226_/_28%)_-7px_-6px_42px_8px,rgb(202_103_255_/_32%)_7px_6px_42px_8px]","hover:shadow-[rgb(75_225_226_/_38%)_-7px_-4px_42px_10px,rgb(202_103_255_/_42%)_7px_8px_42px_10px]","hover:translate-y-[-2px] hover:scale-[1.01]"],info:"bg-blue-50 border-blue-200 dark:bg-blue-950/30 dark:border-blue-800 border",success:"bg-green-50 border-green-200 dark:bg-green-950/30 dark:border-green-800 border",warning:"bg-yellow-50 border-yellow-200 dark:bg-yellow-950/30 dark:border-yellow-800 border",destructive:"bg-red-50 border-red-200 dark:bg-red-950/30 dark:border-red-800 border"},size:{sm:"p-2 text-sm",md:"p-3",lg:"p-4"}},defaultVariants:{variant:"default",size:"md"}}),gd=p.forwardRef((e,t)=>{const{variant:o,size:n,dismissible:r=!1,onDismiss:a,role:i="status",className:b,children:l,...u}=e,O=f=>{f.preventDefault(),f.stopPropagation(),r&&a&&a()};return z.jsxs("div",{ref:t,className:g0(NK({variant:o,size:n}),b),role:i,...u,children:[r&&z.jsx(o1,{"aria-label":"Dismiss notification",className:"absolute right-1 top-1 size-8 text-gray-600",size:"icon",variant:"ghost",onClick:O,children:z.jsx(Ad,{className:"size-5"})}),l]})});gd.displayName="Banner";function jo(e,t,{checkForDefaultPrevented:o=!0}={}){return function(r){if(e?.(r),o===!1||!r.defaultPrevented)return t?.(r)}}var BK="DismissableLayer",Oz="dismissableLayer.update",_K="dismissableLayer.pointerDownOutside",EK="dismissableLayer.focusOutside",Pf,W9=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),v9=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:n,onPointerDownOutside:r,onFocusOutside:a,onInteractOutside:i,onDismiss:b,...l}=e,u=p.useContext(W9),[O,f]=p.useState(null),h=O?.ownerDocument??globalThis?.document,[,q]=p.useState({}),g=Y0(t,N=>f(N)),W=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=W.indexOf(v),x=O?W.indexOf(O):-1,k=u.layersWithOutsidePointerEventsDisabled.size>0,L=x>=y,C=PK(N=>{const D=N.target,Y=[...u.branches].some(V=>V.contains(D));!L||Y||(r?.(N),i?.(N),N.defaultPrevented||b?.())},h),w=XK(N=>{const D=N.target;[...u.branches].some(V=>V.contains(D))||(a?.(N),i?.(N),N.defaultPrevented||b?.())},h);return Fp(N=>{x===u.layers.size-1&&(n?.(N),!N.defaultPrevented&&b&&(N.preventDefault(),b()))},h),p.useEffect(()=>{if(O)return o&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Pf=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(O)),u.layers.add(O),Xf(),()=>{o&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Pf)}},[O,h,o,u]),p.useEffect(()=>()=>{O&&(u.layers.delete(O),u.layersWithOutsidePointerEventsDisabled.delete(O),Xf())},[O,u]),p.useEffect(()=>{const N=()=>q({});return document.addEventListener(Oz,N),()=>document.removeEventListener(Oz,N)},[]),z.jsx(H0.div,{...l,ref:g,style:{pointerEvents:k?L?"auto":"none":void 0,...e.style},onFocusCapture:jo(e.onFocusCapture,w.onFocusCapture),onBlurCapture:jo(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:jo(e.onPointerDownCapture,C.onPointerDownCapture)})});v9.displayName=BK;var SK="DismissableLayerBranch",TK=p.forwardRef((e,t)=>{const o=p.useContext(W9),n=p.useRef(null),r=Y0(t,n);return p.useEffect(()=>{const a=n.current;if(a)return o.branches.add(a),()=>{o.branches.delete(a)}},[o.branches]),z.jsx(H0.div,{...e,ref:r})});TK.displayName=SK;function PK(e,t=globalThis?.document){const o=he(e),n=p.useRef(!1),r=p.useRef(()=>{});return p.useEffect(()=>{const a=b=>{if(b.target&&!n.current){let l=function(){R9(_K,o,u,{discrete:!0})};const u={originalEvent:b};b.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=l,t.addEventListener("click",r.current,{once:!0})):l()}else t.removeEventListener("click",r.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",a),t.removeEventListener("click",r.current)}},[t,o]),{onPointerDownCapture:()=>n.current=!0}}function XK(e,t=globalThis?.document){const o=he(e),n=p.useRef(!1);return p.useEffect(()=>{const r=a=>{a.target&&!n.current&&R9(EK,o,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,o]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Xf(){const e=new CustomEvent(Oz);document.dispatchEvent(e)}function R9(e,t,o,{discrete:n}){const r=o.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:o});t&&r.addEventListener(e,t,{once:!0}),n?qa(r,a):r.dispatchEvent(a)}function jK(e,t){return p.useReducer((o,n)=>t[o][n]??o,e)}var d3=e=>{const{present:t,children:o}=e,n=DK(t),r=typeof o=="function"?o({present:n.isPresent}):p.Children.only(o),a=Y0(n.ref,IK(r));return typeof o=="function"||n.isPresent?p.cloneElement(r,{ref:a}):null};d3.displayName="Presence";function DK(e){const[t,o]=p.useState(),n=p.useRef(null),r=p.useRef(e),a=p.useRef("none"),i=e?"mounted":"unmounted",[b,l]=jK(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const u=Oi(n.current);a.current=b==="mounted"?u:"none"},[b]),re(()=>{const u=n.current,O=r.current;if(O!==e){const h=a.current,q=Oi(u);e?l("MOUNT"):q==="none"||u?.display==="none"?l("UNMOUNT"):l(O&&h!==q?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,l]),re(()=>{if(t){let u;const O=t.ownerDocument.defaultView??window,f=q=>{const W=Oi(n.current).includes(CSS.escape(q.animationName));if(q.target===t&&W&&(l("ANIMATION_END"),!r.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=O.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},h=q=>{q.target===t&&(a.current=Oi(n.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{O.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(b),ref:p.useCallback(u=>{n.current=u?getComputedStyle(u):null,o(u)},[])}}function Oi(e){return e?.animationName||"none"}function IK(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var ul=0;function FK(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??jf()),document.body.insertAdjacentElement("beforeend",e[1]??jf()),ul++,()=>{ul===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ul--}},[])}function jf(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var O3="Dialog",[y9]=_e(O3),[HK,Y2]=y9(O3),w9=e=>{const{__scopeDialog:t,children:o,open:n,defaultOpen:r,onOpenChange:a,modal:i=!0}=e,b=p.useRef(null),l=p.useRef(null),[u,O]=Ko({prop:n,defaultProp:r??!1,onChange:a,caller:O3});return z.jsx(HK,{scope:t,triggerRef:b,contentRef:l,contentId:e2(),titleId:e2(),descriptionId:e2(),open:u,onOpenChange:O,onOpenToggle:p.useCallback(()=>O(f=>!f),[O]),modal:i,children:o})};w9.displayName=O3;var L9="DialogTrigger",x9=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=Y2(L9,o),a=Y0(t,r.triggerRef);return z.jsx(H0.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":Rd(r.open),...n,ref:a,onClick:jo(e.onClick,r.onOpenToggle)})});x9.displayName=L9;var Wd="DialogPortal",[UK,k9]=y9(Wd,{forceMount:void 0}),C9=e=>{const{__scopeDialog:t,forceMount:o,children:n,container:r}=e,a=Y2(Wd,t);return z.jsx(UK,{scope:t,forceMount:o,children:p.Children.map(n,i=>z.jsx(d3,{present:o||a.open,children:z.jsx(Kr,{asChild:!0,container:r,children:i})}))})};C9.displayName=Wd;var up="DialogOverlay",N9=p.forwardRef((e,t)=>{const o=k9(up,e.__scopeDialog),{forceMount:n=o.forceMount,...r}=e,a=Y2(up,e.__scopeDialog);return a.modal?z.jsx(d3,{present:n||a.open,children:z.jsx($K,{...r,ref:t})}):null});N9.displayName=up;var VK=Fo("DialogOverlay.RemoveScroll"),$K=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=Y2(up,o);return z.jsx(wa,{as:VK,allowPinchZoom:!0,shards:[r.contentRef],children:z.jsx(H0.div,{"data-state":Rd(r.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Xn="DialogContent",B9=p.forwardRef((e,t)=>{const o=k9(Xn,e.__scopeDialog),{forceMount:n=o.forceMount,...r}=e,a=Y2(Xn,e.__scopeDialog);return z.jsx(d3,{present:n||a.open,children:a.modal?z.jsx(QK,{...r,ref:t}):z.jsx(ZK,{...r,ref:t})})});B9.displayName=Xn;var QK=p.forwardRef((e,t)=>{const o=Y2(Xn,e.__scopeDialog),n=p.useRef(null),r=Y0(t,o.contentRef,n);return p.useEffect(()=>{const a=n.current;if(a)return Vp(a)},[]),z.jsx(_9,{...e,ref:r,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:jo(e.onCloseAutoFocus,a=>{a.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:jo(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,b=i.button===0&&i.ctrlKey===!0;(i.button===2||b)&&a.preventDefault()}),onFocusOutside:jo(e.onFocusOutside,a=>a.preventDefault())})}),ZK=p.forwardRef((e,t)=>{const o=Y2(Xn,e.__scopeDialog),n=p.useRef(!1),r=p.useRef(!1);return z.jsx(_9,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(n.current||o.triggerRef.current?.focus(),a.preventDefault()),n.current=!1,r.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=a.target;o.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&r.current&&a.preventDefault()}})}),_9=p.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:n,onOpenAutoFocus:r,onCloseAutoFocus:a,...i}=e,b=Y2(Xn,o),l=p.useRef(null),u=Y0(t,l);return FK(),z.jsxs(z.Fragment,{children:[z.jsx(ya,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:r,onUnmountAutoFocus:a,children:z.jsx(v9,{role:"dialog",id:b.contentId,"aria-describedby":b.descriptionId,"aria-labelledby":b.titleId,"data-state":Rd(b.open),...i,ref:u,onDismiss:()=>b.onOpenChange(!1)})}),z.jsxs(z.Fragment,{children:[z.jsx(GK,{titleId:b.titleId}),z.jsx(YK,{contentRef:l,descriptionId:b.descriptionId})]})]})}),vd="DialogTitle",E9=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=Y2(vd,o);return z.jsx(H0.h2,{id:r.titleId,...n,ref:t})});E9.displayName=vd;var S9="DialogDescription",T9=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=Y2(S9,o);return z.jsx(H0.p,{id:r.descriptionId,...n,ref:t})});T9.displayName=S9;var P9="DialogClose",X9=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=Y2(P9,o);return z.jsx(H0.button,{type:"button",...n,ref:t,onClick:jo(e.onClick,()=>r.onOpenChange(!1))})});X9.displayName=P9;function Rd(e){return e?"open":"closed"}var j9="DialogTitleWarning",[Wc0,D9]=Ah(j9,{contentName:Xn,titleName:vd,docsSlug:"dialog"}),GK=({titleId:e})=>{const t=D9(j9),o=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
599
+ `),p.createElement("g",null,p.createElement("path",{d:"M12.333333333333332 7.333333333333333a4.333333333333333 4.333333333333333 0 1 0 -7.333333333333333 3.126666666666667v1.88a1 1 0 0 0 2 0 1 1 0 0 0 2 0 1 1 0 1 0 2 0v-1.88a4.326666666666666 4.326666666666666 0 0 0 1.3333333333333333 -3.126666666666667Zm-6.253333333333334 1a1 1 0 1 1 1 -1 1 1 0 0 1 -1 1Zm4 0a1 1 0 1 1 1 -1 1 1 0 0 1 -1 1Z",fill:"currentColor",strokeWidth:.6667}),p.createElement("path",{d:"m1.8666666666666665 3.28 1.22 1.22a0.3466666666666667 0.3466666666666667 0 0 0 0.26666666666666666 0.09333333333333334 0.35333333333333333 0.35333333333333333 0 0 0 0.24666666666666665 -0.14666666666666667 5.133333333333333 5.133333333333333 0 0 1 0.8066666666666666 -0.9733333333333333 0.3133333333333333 0.3133333333333333 0 0 0 0.09999999999999999 -0.2333333333333333 0.3666666666666667 0.3666666666666667 0 0 0 -0.09333333333333334 -0.24666666666666665L3.28 1.8666666666666665A1.1666666666666665 1.1666666666666665 0 0 0 1.8399999999999999 0.11333333333333334a0.6666666666666666 0.6666666666666666 0 0 0 -0.3666666666666667 0.48l-0.09999999999999999 0.5133333333333333a0.31999999999999995 0.31999999999999995 0 0 1 -0.26 0.26666666666666666l-0.52 0.09999999999999999a0.6666666666666666 0.6666666666666666 0 0 0 -0.48 0.3666666666666667A1.1666666666666665 1.1666666666666665 0 0 0 1.8666666666666665 3.28Z",fill:"currentColor",strokeWidth:.6667}),p.createElement("path",{d:"M12.4 4.446666666666666a0.35333333333333333 0.35333333333333333 0 0 0 0.24666666666666665 0.14666666666666667 0.3466666666666667 0.3466666666666667 0 0 0 0.26666666666666666 -0.09333333333333334l1.22 -1.22a1.1666666666666665 1.1666666666666665 0 0 0 1.7533333333333332 -1.44 0.6666666666666666 0.6666666666666666 0 0 0 -0.48 -0.3666666666666667l-0.52 -0.09999999999999999a0.31999999999999995 0.31999999999999995 0 0 1 -0.26 -0.26666666666666666l-0.09999999999999999 -0.5133333333333333a0.6666666666666666 0.6666666666666666 0 0 0 -0.3666666666666667 -0.48 1.1666666666666665 1.1666666666666665 0 0 0 -1.44 1.7533333333333332l-1.1333333333333333 1.1266666666666665a0.3666666666666667 0.3666666666666667 0 0 0 -0.09333333333333334 0.24666666666666665 0.3133333333333333 0.3133333333333333 0 0 0 0.09999999999999999 0.2333333333333333 5.133333333333333 5.133333333333333 0 0 1 0.8066666666666666 0.9733333333333333Z",fill:"currentColor",strokeWidth:.6667}),p.createElement("path",{d:"M3.6 11.559999999999999a0.33999999999999997 0.33999999999999997 0 0 0 -0.26666666666666666 -0.15333333333333332 0.3466666666666667 0.3466666666666667 0 0 0 -0.26666666666666666 0.09333333333333334l-1.2 1.22a1.1666666666666665 1.1666666666666665 0 0 0 -1.7533333333333332 1.44 0.6666666666666666 0.6666666666666666 0 0 0 0.48 0.3666666666666667l0.52 0.09999999999999999a0.31999999999999995 0.31999999999999995 0 0 1 0.26 0.26666666666666666l0.09999999999999999 0.5133333333333333a0.6666666666666666 0.6666666666666666 0 0 0 0.3666666666666667 0.48 1.1666666666666665 1.1666666666666665 0 0 0 1.44 -1.7533333333333332l1.1333333333333333 -1.1266666666666665a0.36 0.36 0 0 0 0.09333333333333334 -0.24 0.31999999999999995 0.31999999999999995 0 0 0 -0.09999999999999999 -0.24 5.333333333333333 5.333333333333333 0 0 1 -0.8066666666666666 -0.9666666666666666Z",fill:"currentColor",strokeWidth:.6667}),p.createElement("path",{d:"m14.133333333333333 12.719999999999999 -1.22 -1.22a0.3466666666666667 0.3466666666666667 0 0 0 -0.26666666666666666 -0.09333333333333334 0.33999999999999997 0.33999999999999997 0 0 0 -0.24666666666666665 0.15333333333333332 5.333333333333333 5.333333333333333 0 0 1 -0.8066666666666666 0.9666666666666666 0.31999999999999995 0.31999999999999995 0 0 0 -0.09999999999999999 0.24 0.36 0.36 0 0 0 0.09333333333333334 0.24l1.1333333333333333 1.1266666666666665a1.1666666666666665 1.1666666666666665 0 0 0 1.44 1.7533333333333332 0.6666666666666666 0.6666666666666666 0 0 0 0.3666666666666667 -0.48l0.09999999999999999 -0.5133333333333333a0.31999999999999995 0.31999999999999995 0 0 1 0.26 -0.26666666666666666l0.52 -0.09999999999999999a0.6666666666666666 0.6666666666666666 0 0 0 0.48 -0.3666666666666667 1.1666666666666665 1.1666666666666665 0 0 0 -1.7533333333333332 -1.44Z",fill:"currentColor",strokeWidth:.6667}))),lK="data:image/svg+xml,%3csvg%20height='16'%20id='Skull-2--Streamline-Ultimate'%20viewBox='0%200%2016%2016'%20width='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cdesc%3e%20Skull%202%20Streamline%20Icon:%20https://streamlinehq.com%20%3c/desc%3e%3cg%3e%3cpath%20d='M12.333333333333332%207.333333333333333a4.333333333333333%204.333333333333333%200%201%200%20-7.333333333333333%203.126666666666667v1.88a1%201%200%200%200%202%200%201%201%200%200%200%202%200%201%201%200%201%200%202%200v-1.88a4.326666666666666%204.326666666666666%200%200%200%201.3333333333333333%20-3.126666666666667Zm-6.253333333333334%201a1%201%200%201%201%201%20-1%201%201%200%200%201%20-1%201Zm4%200a1%201%200%201%201%201%20-1%201%201%200%200%201%20-1%201Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3cpath%20d='m1.8666666666666665%203.28%201.22%201.22a0.3466666666666667%200.3466666666666667%200%200%200%200.26666666666666666%200.09333333333333334%200.35333333333333333%200.35333333333333333%200%200%200%200.24666666666666665%20-0.14666666666666667%205.133333333333333%205.133333333333333%200%200%201%200.8066666666666666%20-0.9733333333333333%200.3133333333333333%200.3133333333333333%200%200%200%200.09999999999999999%20-0.2333333333333333%200.3666666666666667%200.3666666666666667%200%200%200%20-0.09333333333333334%20-0.24666666666666665L3.28%201.8666666666666665A1.1666666666666665%201.1666666666666665%200%200%200%201.8399999999999999%200.11333333333333334a0.6666666666666666%200.6666666666666666%200%200%200%20-0.3666666666666667%200.48l-0.09999999999999999%200.5133333333333333a0.31999999999999995%200.31999999999999995%200%200%201%20-0.26%200.26666666666666666l-0.52%200.09999999999999999a0.6666666666666666%200.6666666666666666%200%200%200%20-0.48%200.3666666666666667A1.1666666666666665%201.1666666666666665%200%200%200%201.8666666666666665%203.28Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3cpath%20d='M12.4%204.446666666666666a0.35333333333333333%200.35333333333333333%200%200%200%200.24666666666666665%200.14666666666666667%200.3466666666666667%200.3466666666666667%200%200%200%200.26666666666666666%20-0.09333333333333334l1.22%20-1.22a1.1666666666666665%201.1666666666666665%200%200%200%201.7533333333333332%20-1.44%200.6666666666666666%200.6666666666666666%200%200%200%20-0.48%20-0.3666666666666667l-0.52%20-0.09999999999999999a0.31999999999999995%200.31999999999999995%200%200%201%20-0.26%20-0.26666666666666666l-0.09999999999999999%20-0.5133333333333333a0.6666666666666666%200.6666666666666666%200%200%200%20-0.3666666666666667%20-0.48%201.1666666666666665%201.1666666666666665%200%200%200%20-1.44%201.7533333333333332l-1.1333333333333333%201.1266666666666665a0.3666666666666667%200.3666666666666667%200%200%200%20-0.09333333333333334%200.24666666666666665%200.3133333333333333%200.3133333333333333%200%200%200%200.09999999999999999%200.2333333333333333%205.133333333333333%205.133333333333333%200%200%201%200.8066666666666666%200.9733333333333333Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3cpath%20d='M3.6%2011.559999999999999a0.33999999999999997%200.33999999999999997%200%200%200%20-0.26666666666666666%20-0.15333333333333332%200.3466666666666667%200.3466666666666667%200%200%200%20-0.26666666666666666%200.09333333333333334l-1.2%201.22a1.1666666666666665%201.1666666666666665%200%200%200%20-1.7533333333333332%201.44%200.6666666666666666%200.6666666666666666%200%200%200%200.48%200.3666666666666667l0.52%200.09999999999999999a0.31999999999999995%200.31999999999999995%200%200%201%200.26%200.26666666666666666l0.09999999999999999%200.5133333333333333a0.6666666666666666%200.6666666666666666%200%200%200%200.3666666666666667%200.48%201.1666666666666665%201.1666666666666665%200%200%200%201.44%20-1.7533333333333332l1.1333333333333333%20-1.1266666666666665a0.36%200.36%200%200%200%200.09333333333333334%20-0.24%200.31999999999999995%200.31999999999999995%200%200%200%20-0.09999999999999999%20-0.24%205.333333333333333%205.333333333333333%200%200%201%20-0.8066666666666666%20-0.9666666666666666Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3cpath%20d='m14.133333333333333%2012.719999999999999%20-1.22%20-1.22a0.3466666666666667%200.3466666666666667%200%200%200%20-0.26666666666666666%20-0.09333333333333334%200.33999999999999997%200.33999999999999997%200%200%200%20-0.24666666666666665%200.15333333333333332%205.333333333333333%205.333333333333333%200%200%201%20-0.8066666666666666%200.9666666666666666%200.31999999999999995%200.31999999999999995%200%200%200%20-0.09999999999999999%200.24%200.36%200.36%200%200%200%200.09333333333333334%200.24l1.1333333333333333%201.1266666666666665a1.1666666666666665%201.1666666666666665%200%200%200%201.44%201.7533333333333332%200.6666666666666666%200.6666666666666666%200%200%200%200.3666666666666667%20-0.48l0.09999999999999999%20-0.5133333333333333a0.31999999999999995%200.31999999999999995%200%200%201%200.26%20-0.26666666666666666l0.52%20-0.09999999999999999a0.6666666666666666%200.6666666666666666%200%200%200%200.48%20-0.3666666666666667%201.1666666666666665%201.1666666666666665%200%200%200%20-1.7533333333333332%20-1.44Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3c/g%3e%3c/svg%3e",zK=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:bK,default:lK},Symbol.toStringTag,{value:"Module"})),uK=e=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",height:24,width:24,id:"Check-Circle-1--Streamline-Ultimate",...e},p.createElement("desc",null,"Check Circle 1 Streamline Icon: https://streamlinehq.com"),p.createElement("path",{d:"M12 0a12 12 0 1 0 12 12A12 12 0 0 0 12 0Zm6.93 8.2 -6.85 9.29a1 1 0 0 1 -1.43 0.19l-4.89 -3.91a1 1 0 0 1 -0.15 -1.41A1 1 0 0 1 7 12.21l4.08 3.26L17.32 7a1 1 0 0 1 1.39 -0.21 1 1 0 0 1 0.22 1.41Z",fill:"currentcolor",strokeWidth:1})),dK="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20height='24'%20width='24'%20id='Check-Circle-1--Streamline-Ultimate'%3e%3cdesc%3eCheck%20Circle%201%20Streamline%20Icon:%20https://streamlinehq.com%3c/desc%3e%3cpath%20d='M12%200a12%2012%200%201%200%2012%2012A12%2012%200%200%200%2012%200Zm6.93%208.2%20-6.85%209.29a1%201%200%200%201%20-1.43%200.19l-4.89%20-3.91a1%201%200%200%201%20-0.15%20-1.41A1%201%200%200%201%207%2012.21l4.08%203.26L17.32%207a1%201%200%200%201%201.39%20-0.21%201%201%200%200%201%200.22%201.41Z'%20fill='currentcolor'%20stroke-width='1'%3e%3c/path%3e%3c/svg%3e",OK=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:uK,default:dK},Symbol.toStringTag,{value:"Module"})),fK=e=>p.createElement("svg",{viewBox:"-0.75 -0.75 20 20",xmlns:"http://www.w3.org/2000/svg",height:24,width:24,...e},p.createElement("desc",null,"Typography"),p.createElement("path",{d:"m0.578125 9.827354166666668 8.09375 0",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),p.createElement("path",{d:"m12.140625 13.296104166666666 5.78125 0",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),p.createElement("path",{d:"M12.140625 16.764854166666666V10.40625a2.890625 2.890625 0 0 1 5.78125 0v6.359375",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),p.createElement("path",{d:"M0.578125 16.764854166666666V5.78125a4.046875 4.046875 0 0 1 8.09375 0v10.984375",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5})),AK="data:image/svg+xml,%3csvg%20viewBox='-0.75%20-0.75%2020%2020'%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20width='24'%3e%3cdesc%3eTypography%3c/desc%3e%3cpath%20d='m0.578125%209.827354166666668%208.09375%200'%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.5'%3e%3c/path%3e%3cpath%20d='m12.140625%2013.296104166666666%205.78125%200'%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.5'%3e%3c/path%3e%3cpath%20d='M12.140625%2016.764854166666666V10.40625a2.890625%202.890625%200%200%201%205.78125%200v6.359375'%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.5'%3e%3c/path%3e%3cpath%20d='M0.578125%2016.764854166666666V5.78125a4.046875%204.046875%200%200%201%208.09375%200v10.984375'%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.5'%3e%3c/path%3e%3c/svg%3e",hK=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:fK,default:AK},Symbol.toStringTag,{value:"Module"})),qK=Yt("",{variants:{size:{sm:"size-3",md:"size-4",lg:"size-6",xl:"size-8"}},defaultVariants:{size:"md"}}),mK=Object.assign({"../../assets/icons/error-fill.svg":sK,"../../assets/icons/info-fill.svg":MK,"../../assets/icons/skull-and-bones.svg":zK,"../../assets/icons/success-fill.svg":OK,"../../assets/icons/typography.svg":hK}),Ii=Object.entries(mK).reduce((e,[t,o])=>{var n;const r=((n=t.match(/[^/]+(?=\.svg$)/))==null?void 0:n[0])??"",a=VQ(r),i=b=>{const{size:l,className:u,...O}=b,f=g0(qK({size:l,className:u}));return b0.createElement(o.ReactComponent,{...O,className:f})};return i.displayName=`Icon.${a}`,e[a]=i,e},{}),gc0=Ii,gK=p.createContext({isAnyTextFieldFocused:!1,setFocusState:()=>{},darkMode:!1}),WK=()=>{const[e,t]=p.useState(!1);return p.useEffect(()=>(t(!0),()=>t(!1)),[]),e?Sp.createPortal(z.jsx("div",{className:en,style:{width:"unset",height:"unset"},children:z.jsx(oK,{icons:{error:z.jsx(Ii.ErrorFill,{className:"text-red"}),success:z.jsx(Ii.SuccessFill,{className:"text-green"}),info:z.jsx(Ii.InfoFill,{className:"text-gray-500"})},position:"bottom-left",toastOptions:{classNames:{title:"!mt-[-1px] !text-md !font-semibold !leading-tighter !tracking-[0.1px]",description:"!text-gray-900 dark:!text-gray-300 !text-sm !mt-px",icon:"!ml-0"},style:{alignItems:"flex-start",maxWidth:"290px"}}})}),document.body):null},vK=({darkMode:e,children:t})=>{const[o,n]=p.useState(!1),r=a=>{n(a)};return z.jsx(gK.Provider,{value:{isAnyTextFieldFocused:o,setFocusState:r,darkMode:e},children:z.jsxs(rK,{children:[t,z.jsx(WK,{})]})})},en="shade shade-admin shade-activitypub shade-stats shade-posts",RK=({darkMode:e,fetchKoenigLexical:t,className:o,children:n,...r})=>{const a=Z1("shade",o);return z.jsx("div",{className:a,...r,children:z.jsx(vK,{darkMode:e,children:n})})},yK=hH,wK=qH,LK=mH,d9=p.forwardRef(({className:e,...t},o)=>z.jsx(t8,{className:g0("fixed inset-0 z-50 bg-black/30 backdrop-blur-none transform-gpu data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=open]:backdrop-blur-[3px]",e),...t,ref:o}));d9.displayName=t8.displayName;const O9=p.forwardRef(({className:e,...t},o)=>z.jsx(LK,{children:z.jsxs("div",{className:en,children:[z.jsx(d9,{onClick:n=>n.stopPropagation()}),z.jsx(o8,{ref:o,className:g0("fixed left-[50%] top-[20%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-20%] gap-6 bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[18%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[18%] sm:rounded-lg",e),...t})]})}));O9.displayName=o8.displayName;const f9=({className:e,...t})=>z.jsx("div",{className:g0("flex flex-col space-y-2 text-center sm:text-left",e),...t});f9.displayName="AlertDialogHeader";const A9=({className:e,...t})=>z.jsx("div",{className:g0("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 [&>button]:min-w-20",e),...t});A9.displayName="AlertDialogFooter";const h9=p.forwardRef(({className:e,...t},o)=>z.jsx(c8,{ref:o,className:g0("text-xl font-semibold",e),...t}));h9.displayName=c8.displayName;const q9=p.forwardRef(({className:e,...t},o)=>z.jsx(a8,{ref:o,className:g0("text-base",e),...t}));q9.displayName=a8.displayName;const m9=p.forwardRef(({className:e,...t},o)=>z.jsx(n8,{ref:o,className:g0(u3(),e),...t}));m9.displayName=n8.displayName;const g9=p.forwardRef(({className:e,...t},o)=>z.jsx(r8,{ref:o,className:g0(u3({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));g9.displayName=r8.displayName;const xK=p.lazy(()=>z1(()=>import("./index-cWfIWdIX.js"),[])),Tf=e=>z.jsx(p.Suspense,{fallback:z.jsx("div",{}),children:z.jsx(xK,{...e})}),hd=p.forwardRef(({className:e,...t},o)=>z.jsx(gq,{ref:o,className:g0("relative flex h-8 w-8 shrink-0 overflow-hidden rounded-full",e),...t}));hd.displayName=gq.displayName;const qd=p.forwardRef(({className:e,...t},o)=>z.jsx(Wq,{ref:o,className:g0("aspect-square h-full w-full",e),...t}));qd.displayName=Wq.displayName;const md=p.forwardRef(({className:e,...t},o)=>z.jsx(vq,{ref:o,className:g0("flex h-full w-full items-center justify-center rounded-full bg-muted [&_svg]:size-4",e),...t}));md.displayName=vq.displayName;const kK=Yt("inline-flex items-center rounded-sm border px-1.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground/70",destructive:"border-transparent bg-destructive/20 text-destructive",success:"border-transparent bg-green/20 text-green",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function CK({className:e,variant:t,...o}){return z.jsx("div",{className:g0(kK({variant:t}),e),...o})}const NK=Yt("relative block rounded-lg transition-all duration-300",{variants:{variant:{default:"border border-border bg-background shadow-sm hover:shadow-md",gradient:["cursor-pointer border border-gray-100 bg-white","shadow-[rgb(75_225_226_/_28%)_-7px_-6px_42px_8px,rgb(202_103_255_/_32%)_7px_6px_42px_8px]","hover:shadow-[rgb(75_225_226_/_38%)_-7px_-4px_42px_10px,rgb(202_103_255_/_42%)_7px_8px_42px_10px]","hover:translate-y-[-2px] hover:scale-[1.01]"],info:"bg-blue-50 border-blue-200 dark:bg-blue-950/30 dark:border-blue-800 border",success:"bg-green-50 border-green-200 dark:bg-green-950/30 dark:border-green-800 border",warning:"bg-yellow-50 border-yellow-200 dark:bg-yellow-950/30 dark:border-yellow-800 border",destructive:"bg-red-50 border-red-200 dark:bg-red-950/30 dark:border-red-800 border"},size:{sm:"p-2 text-sm",md:"p-3",lg:"p-4"}},defaultVariants:{variant:"default",size:"md"}}),gd=p.forwardRef((e,t)=>{const{variant:o,size:n,dismissible:r=!1,onDismiss:a,role:i="status",className:b,children:l,...u}=e,O=f=>{f.preventDefault(),f.stopPropagation(),r&&a&&a()};return z.jsxs("div",{ref:t,className:g0(NK({variant:o,size:n}),b),role:i,...u,children:[r&&z.jsx(o1,{"aria-label":"Dismiss notification",className:"absolute right-1 top-1 size-8 text-gray-600",size:"icon",variant:"ghost",onClick:O,children:z.jsx(Ad,{className:"size-5"})}),l]})});gd.displayName="Banner";function jo(e,t,{checkForDefaultPrevented:o=!0}={}){return function(r){if(e?.(r),o===!1||!r.defaultPrevented)return t?.(r)}}var BK="DismissableLayer",Oz="dismissableLayer.update",_K="dismissableLayer.pointerDownOutside",EK="dismissableLayer.focusOutside",Pf,W9=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),v9=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:n,onPointerDownOutside:r,onFocusOutside:a,onInteractOutside:i,onDismiss:b,...l}=e,u=p.useContext(W9),[O,f]=p.useState(null),h=O?.ownerDocument??globalThis?.document,[,q]=p.useState({}),g=Y0(t,N=>f(N)),W=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=W.indexOf(v),x=O?W.indexOf(O):-1,k=u.layersWithOutsidePointerEventsDisabled.size>0,L=x>=y,C=PK(N=>{const D=N.target,Y=[...u.branches].some(V=>V.contains(D));!L||Y||(r?.(N),i?.(N),N.defaultPrevented||b?.())},h),w=XK(N=>{const D=N.target;[...u.branches].some(V=>V.contains(D))||(a?.(N),i?.(N),N.defaultPrevented||b?.())},h);return Fp(N=>{x===u.layers.size-1&&(n?.(N),!N.defaultPrevented&&b&&(N.preventDefault(),b()))},h),p.useEffect(()=>{if(O)return o&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Pf=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(O)),u.layers.add(O),Xf(),()=>{o&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Pf)}},[O,h,o,u]),p.useEffect(()=>()=>{O&&(u.layers.delete(O),u.layersWithOutsidePointerEventsDisabled.delete(O),Xf())},[O,u]),p.useEffect(()=>{const N=()=>q({});return document.addEventListener(Oz,N),()=>document.removeEventListener(Oz,N)},[]),z.jsx(H0.div,{...l,ref:g,style:{pointerEvents:k?L?"auto":"none":void 0,...e.style},onFocusCapture:jo(e.onFocusCapture,w.onFocusCapture),onBlurCapture:jo(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:jo(e.onPointerDownCapture,C.onPointerDownCapture)})});v9.displayName=BK;var SK="DismissableLayerBranch",TK=p.forwardRef((e,t)=>{const o=p.useContext(W9),n=p.useRef(null),r=Y0(t,n);return p.useEffect(()=>{const a=n.current;if(a)return o.branches.add(a),()=>{o.branches.delete(a)}},[o.branches]),z.jsx(H0.div,{...e,ref:r})});TK.displayName=SK;function PK(e,t=globalThis?.document){const o=he(e),n=p.useRef(!1),r=p.useRef(()=>{});return p.useEffect(()=>{const a=b=>{if(b.target&&!n.current){let l=function(){R9(_K,o,u,{discrete:!0})};const u={originalEvent:b};b.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=l,t.addEventListener("click",r.current,{once:!0})):l()}else t.removeEventListener("click",r.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",a),t.removeEventListener("click",r.current)}},[t,o]),{onPointerDownCapture:()=>n.current=!0}}function XK(e,t=globalThis?.document){const o=he(e),n=p.useRef(!1);return p.useEffect(()=>{const r=a=>{a.target&&!n.current&&R9(EK,o,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,o]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Xf(){const e=new CustomEvent(Oz);document.dispatchEvent(e)}function R9(e,t,o,{discrete:n}){const r=o.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:o});t&&r.addEventListener(e,t,{once:!0}),n?qa(r,a):r.dispatchEvent(a)}function jK(e,t){return p.useReducer((o,n)=>t[o][n]??o,e)}var d3=e=>{const{present:t,children:o}=e,n=DK(t),r=typeof o=="function"?o({present:n.isPresent}):p.Children.only(o),a=Y0(n.ref,IK(r));return typeof o=="function"||n.isPresent?p.cloneElement(r,{ref:a}):null};d3.displayName="Presence";function DK(e){const[t,o]=p.useState(),n=p.useRef(null),r=p.useRef(e),a=p.useRef("none"),i=e?"mounted":"unmounted",[b,l]=jK(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const u=Oi(n.current);a.current=b==="mounted"?u:"none"},[b]),re(()=>{const u=n.current,O=r.current;if(O!==e){const h=a.current,q=Oi(u);e?l("MOUNT"):q==="none"||u?.display==="none"?l("UNMOUNT"):l(O&&h!==q?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,l]),re(()=>{if(t){let u;const O=t.ownerDocument.defaultView??window,f=q=>{const W=Oi(n.current).includes(CSS.escape(q.animationName));if(q.target===t&&W&&(l("ANIMATION_END"),!r.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=O.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},h=q=>{q.target===t&&(a.current=Oi(n.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{O.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(b),ref:p.useCallback(u=>{n.current=u?getComputedStyle(u):null,o(u)},[])}}function Oi(e){return e?.animationName||"none"}function IK(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var ul=0;function FK(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??jf()),document.body.insertAdjacentElement("beforeend",e[1]??jf()),ul++,()=>{ul===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ul--}},[])}function jf(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var O3="Dialog",[y9]=_e(O3),[HK,Y2]=y9(O3),w9=e=>{const{__scopeDialog:t,children:o,open:n,defaultOpen:r,onOpenChange:a,modal:i=!0}=e,b=p.useRef(null),l=p.useRef(null),[u,O]=Ko({prop:n,defaultProp:r??!1,onChange:a,caller:O3});return z.jsx(HK,{scope:t,triggerRef:b,contentRef:l,contentId:e2(),titleId:e2(),descriptionId:e2(),open:u,onOpenChange:O,onOpenToggle:p.useCallback(()=>O(f=>!f),[O]),modal:i,children:o})};w9.displayName=O3;var L9="DialogTrigger",x9=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=Y2(L9,o),a=Y0(t,r.triggerRef);return z.jsx(H0.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":Rd(r.open),...n,ref:a,onClick:jo(e.onClick,r.onOpenToggle)})});x9.displayName=L9;var Wd="DialogPortal",[UK,k9]=y9(Wd,{forceMount:void 0}),C9=e=>{const{__scopeDialog:t,forceMount:o,children:n,container:r}=e,a=Y2(Wd,t);return z.jsx(UK,{scope:t,forceMount:o,children:p.Children.map(n,i=>z.jsx(d3,{present:o||a.open,children:z.jsx(Kr,{asChild:!0,container:r,children:i})}))})};C9.displayName=Wd;var up="DialogOverlay",N9=p.forwardRef((e,t)=>{const o=k9(up,e.__scopeDialog),{forceMount:n=o.forceMount,...r}=e,a=Y2(up,e.__scopeDialog);return a.modal?z.jsx(d3,{present:n||a.open,children:z.jsx($K,{...r,ref:t})}):null});N9.displayName=up;var VK=Fo("DialogOverlay.RemoveScroll"),$K=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=Y2(up,o);return z.jsx(wa,{as:VK,allowPinchZoom:!0,shards:[r.contentRef],children:z.jsx(H0.div,{"data-state":Rd(r.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Xn="DialogContent",B9=p.forwardRef((e,t)=>{const o=k9(Xn,e.__scopeDialog),{forceMount:n=o.forceMount,...r}=e,a=Y2(Xn,e.__scopeDialog);return z.jsx(d3,{present:n||a.open,children:a.modal?z.jsx(QK,{...r,ref:t}):z.jsx(ZK,{...r,ref:t})})});B9.displayName=Xn;var QK=p.forwardRef((e,t)=>{const o=Y2(Xn,e.__scopeDialog),n=p.useRef(null),r=Y0(t,o.contentRef,n);return p.useEffect(()=>{const a=n.current;if(a)return Vp(a)},[]),z.jsx(_9,{...e,ref:r,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:jo(e.onCloseAutoFocus,a=>{a.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:jo(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,b=i.button===0&&i.ctrlKey===!0;(i.button===2||b)&&a.preventDefault()}),onFocusOutside:jo(e.onFocusOutside,a=>a.preventDefault())})}),ZK=p.forwardRef((e,t)=>{const o=Y2(Xn,e.__scopeDialog),n=p.useRef(!1),r=p.useRef(!1);return z.jsx(_9,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(n.current||o.triggerRef.current?.focus(),a.preventDefault()),n.current=!1,r.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=a.target;o.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&r.current&&a.preventDefault()}})}),_9=p.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:n,onOpenAutoFocus:r,onCloseAutoFocus:a,...i}=e,b=Y2(Xn,o),l=p.useRef(null),u=Y0(t,l);return FK(),z.jsxs(z.Fragment,{children:[z.jsx(ya,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:r,onUnmountAutoFocus:a,children:z.jsx(v9,{role:"dialog",id:b.contentId,"aria-describedby":b.descriptionId,"aria-labelledby":b.titleId,"data-state":Rd(b.open),...i,ref:u,onDismiss:()=>b.onOpenChange(!1)})}),z.jsxs(z.Fragment,{children:[z.jsx(GK,{titleId:b.titleId}),z.jsx(YK,{contentRef:l,descriptionId:b.descriptionId})]})]})}),vd="DialogTitle",E9=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=Y2(vd,o);return z.jsx(H0.h2,{id:r.titleId,...n,ref:t})});E9.displayName=vd;var S9="DialogDescription",T9=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=Y2(S9,o);return z.jsx(H0.p,{id:r.descriptionId,...n,ref:t})});T9.displayName=S9;var P9="DialogClose",X9=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=Y2(P9,o);return z.jsx(H0.button,{type:"button",...n,ref:t,onClick:jo(e.onClick,()=>r.onOpenChange(!1))})});X9.displayName=P9;function Rd(e){return e?"open":"closed"}var j9="DialogTitleWarning",[Wc0,D9]=Ah(j9,{contentName:Xn,titleName:vd,docsSlug:"dialog"}),GK=({titleId:e})=>{const t=D9(j9),o=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
600
600
 
601
601
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
602
602
 
@@ -619,4 +619,4 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
619
619
  newResult[${C}] = ${L}.value;
620
620
  }
621
621
 
622
- `)}q.write("payload.value = newResult;"),q.write("return payload;");const x=q.compile();return(k,L)=>x(h,k,L)};let a;const i=mp,b=!dW.jitless,u=b&&te0.value,O=t.catchall;let f;e._zod.parse=(h,q)=>{f??(f=n.value);const g=h.value;return i(g)?b&&u&&q?.async===!1&&q.jitless!==!0?(a||(a=r(t.shape)),h=a(h,q),O?wW([],g,h,q,f,e):h):o(h,q):(h.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),h)}});function Jf(e,t,o,n){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const r=e.filter(a=>!xr(a));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:e.map(a=>a.issues.map(i=>Zo(i,n,Qo())))}),t)}const X20=n0("$ZodUnion",(e,t)=>{V1.init(e,t),m1(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),m1(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),m1(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),m1(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(a=>a._zod.pattern);return new RegExp(`^(${r.map(a=>Gd(a.source)).join("|")})$`)}});const o=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(r,a)=>{if(o)return n(r,a);let i=!1;const b=[];for(const l of t.options){const u=l._zod.run({value:r.value,issues:[]},a);if(u instanceof Promise)b.push(u),i=!0;else{if(u.issues.length===0)return u;b.push(u)}}return i?Promise.all(b).then(l=>Jf(l,r,e,a)):Jf(b,r,e,a)}}),j20=n0("$ZodIntersection",(e,t)=>{V1.init(e,t),e._zod.parse=(o,n)=>{const r=o.value,a=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return a instanceof Promise||i instanceof Promise?Promise.all([a,i]).then(([l,u])=>eA(o,l,u)):eA(o,a,i)}});function yz(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ur(e)&&Ur(t)){const o=Object.keys(t),n=Object.keys(e).filter(a=>o.indexOf(a)!==-1),r={...e,...t};for(const a of n){const i=yz(e[a],t[a]);if(!i.valid)return{valid:!1,mergeErrorPath:[a,...i.mergeErrorPath]};r[a]=i.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const o=[];for(let n=0;n<e.length;n++){const r=e[n],a=t[n],i=yz(r,a);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};o.push(i.data)}return{valid:!0,data:o}}return{valid:!1,mergeErrorPath:[]}}function eA(e,t,o){if(t.issues.length&&e.issues.push(...t.issues),o.issues.length&&e.issues.push(...o.issues),xr(e))return e;const n=yz(t.value,o.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const D20=n0("$ZodRecord",(e,t)=>{V1.init(e,t),e._zod.parse=(o,n)=>{const r=o.value;if(!Ur(r))return o.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),o;const a=[];if(t.keyType._zod.values){const i=t.keyType._zod.values;o.value={};for(const l of i)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){const u=t.valueType._zod.run({value:r[l],issues:[]},n);u instanceof Promise?a.push(u.then(O=>{O.issues.length&&o.issues.push(...kr(l,O.issues)),o.value[l]=O.value})):(u.issues.length&&o.issues.push(...kr(l,u.issues)),o.value[l]=u.value)}let b;for(const l in r)i.has(l)||(b=b??[],b.push(l));b&&b.length>0&&o.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:b})}else{o.value={};for(const i of Reflect.ownKeys(r)){if(i==="__proto__")continue;const b=t.keyType._zod.run({value:i,issues:[]},n);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(b.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:b.issues.map(u=>Zo(u,n,Qo())),input:i,path:[i],inst:e}),o.value[b.value]=b.value;continue}const l=t.valueType._zod.run({value:r[i],issues:[]},n);l instanceof Promise?a.push(l.then(u=>{u.issues.length&&o.issues.push(...kr(i,u.issues)),o.value[b.value]=u.value})):(l.issues.length&&o.issues.push(...kr(i,l.issues)),o.value[b.value]=l.value)}}return a.length?Promise.all(a).then(()=>o):o}}),I20=n0("$ZodEnum",(e,t)=>{V1.init(e,t);const o=ee0(t.entries),n=new Set(o);e._zod.values=n,e._zod.pattern=new RegExp(`^(${o.filter(r=>oe0.has(typeof r)).map(r=>typeof r=="string"?P3(r):r.toString()).join("|")})$`),e._zod.parse=(r,a)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:o,input:i,inst:e}),r}}),F20=n0("$ZodTransform",(e,t)=>{V1.init(e,t),e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new uW(e.constructor.name);const r=t.transform(o.value,o);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then(i=>(o.value=i,o));if(r instanceof Promise)throw new jr;return o.value=r,o}});function tA(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const H20=n0("$ZodOptional",(e,t)=>{V1.init(e,t),e._zod.optin="optional",e._zod.optout="optional",m1(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),m1(e._zod,"pattern",()=>{const o=t.innerType._zod.pattern;return o?new RegExp(`^(${Gd(o.source)})?$`):void 0}),e._zod.parse=(o,n)=>{if(t.innerType._zod.optin==="optional"){const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(a=>tA(a,o.value)):tA(r,o.value)}return o.value===void 0?o:t.innerType._zod.run(o,n)}}),U20=n0("$ZodNullable",(e,t)=>{V1.init(e,t),m1(e._zod,"optin",()=>t.innerType._zod.optin),m1(e._zod,"optout",()=>t.innerType._zod.optout),m1(e._zod,"pattern",()=>{const o=t.innerType._zod.pattern;return o?new RegExp(`^(${Gd(o.source)}|null)$`):void 0}),m1(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(o,n)=>o.value===null?o:t.innerType._zod.run(o,n)}),V20=n0("$ZodDefault",(e,t)=>{V1.init(e,t),e._zod.optin="optional",m1(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);if(o.value===void 0)return o.value=t.defaultValue,o;const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(a=>oA(a,t)):oA(r,t)}});function oA(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const $20=n0("$ZodPrefault",(e,t)=>{V1.init(e,t),e._zod.optin="optional",m1(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>(n.direction==="backward"||o.value===void 0&&(o.value=t.defaultValue),t.innerType._zod.run(o,n))}),Q20=n0("$ZodNonOptional",(e,t)=>{V1.init(e,t),m1(e._zod,"values",()=>{const o=t.innerType._zod.values;return o?new Set([...o].filter(n=>n!==void 0)):void 0}),e._zod.parse=(o,n)=>{const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(a=>nA(a,e)):nA(r,e)}});function nA(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Z20=n0("$ZodCatch",(e,t)=>{V1.init(e,t),m1(e._zod,"optin",()=>t.innerType._zod.optin),m1(e._zod,"optout",()=>t.innerType._zod.optout),m1(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(a=>(o.value=a.value,a.issues.length&&(o.value=t.catchValue({...o,error:{issues:a.issues.map(i=>Zo(i,n,Qo()))},input:o.value}),o.issues=[]),o)):(o.value=r.value,r.issues.length&&(o.value=t.catchValue({...o,error:{issues:r.issues.map(a=>Zo(a,n,Qo()))},input:o.value}),o.issues=[]),o)}}),G20=n0("$ZodPipe",(e,t)=>{V1.init(e,t),m1(e._zod,"values",()=>t.in._zod.values),m1(e._zod,"optin",()=>t.in._zod.optin),m1(e._zod,"optout",()=>t.out._zod.optout),m1(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,n)=>{if(n.direction==="backward"){const a=t.out._zod.run(o,n);return a instanceof Promise?a.then(i=>qi(i,t.in,n)):qi(a,t.in,n)}const r=t.in._zod.run(o,n);return r instanceof Promise?r.then(a=>qi(a,t.out,n)):qi(r,t.out,n)}});function qi(e,t,o){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},o)}const LW=n0("$ZodCodec",(e,t)=>{V1.init(e,t),m1(e._zod,"values",()=>t.in._zod.values),m1(e._zod,"optin",()=>t.in._zod.optin),m1(e._zod,"optout",()=>t.out._zod.optout),m1(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,n)=>{if((n.direction||"forward")==="forward"){const a=t.in._zod.run(o,n);return a instanceof Promise?a.then(i=>mi(i,t,n)):mi(a,t,n)}else{const a=t.out._zod.run(o,n);return a instanceof Promise?a.then(i=>mi(i,t,n)):mi(a,t,n)}}});function mi(e,t,o){if(e.issues.length)return e.aborted=!0,e;if((o.direction||"forward")==="forward"){const r=t.transform(e.value,e);return r instanceof Promise?r.then(a=>gi(e,a,t.out,o)):gi(e,r,t.out,o)}else{const r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(a=>gi(e,a,t.in,o)):gi(e,r,t.in,o)}}function gi(e,t,o,n){return e.issues.length?(e.aborted=!0,e):o._zod.run({value:t,issues:e.issues},n)}const K20=n0("$ZodReadonly",(e,t)=>{V1.init(e,t),m1(e._zod,"propValues",()=>t.innerType._zod.propValues),m1(e._zod,"values",()=>t.innerType._zod.values),m1(e._zod,"optin",()=>t.innerType._zod.optin),m1(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(rA):rA(r)}});function rA(e){return e.value=Object.freeze(e.value),e}const Y20=n0("$ZodCustom",(e,t)=>{N2.init(e,t),V1.init(e,t),e._zod.parse=(o,n)=>o,e._zod.check=o=>{const n=o.value,r=t.fn(n);if(r instanceof Promise)return r.then(a=>cA(a,o,n,e));cA(r,o,n,e)}});function cA(e,t,o,n){if(!e){const r={code:"custom",input:o,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(r.params=n._zod.def.params),t.issues.push(Oa(r))}}class J20{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...o){const n=o[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const o=this._map.get(t);return o&&typeof o=="object"&&"id"in o&&this._idmap.delete(o.id),this._map.delete(t),this}get(t){const o=t._zod.parent;if(o){const n={...this.get(o)??{}};delete n.id;const r={...n,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function et0(){return new J20}const Wi=et0();function tt0(e,t){return new e({type:"string",...D0(t)})}function ot0(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...D0(t)})}function aA(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...D0(t)})}function nt0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...D0(t)})}function rt0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...D0(t)})}function ct0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...D0(t)})}function at0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...D0(t)})}function st0(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...D0(t)})}function it0(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...D0(t)})}function pt0(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...D0(t)})}function Mt0(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...D0(t)})}function bt0(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...D0(t)})}function lt0(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...D0(t)})}function zt0(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...D0(t)})}function ut0(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...D0(t)})}function dt0(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...D0(t)})}function Ot0(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...D0(t)})}function ft0(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...D0(t)})}function At0(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...D0(t)})}function ht0(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...D0(t)})}function qt0(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...D0(t)})}function mt0(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...D0(t)})}function gt0(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...D0(t)})}function Wt0(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...D0(t)})}function vt0(e,t){return new e({type:"string",format:"date",check:"string_format",...D0(t)})}function Rt0(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...D0(t)})}function yt0(e,t){return new e({type:"string",format:"duration",check:"string_format",...D0(t)})}function wt0(e,t){return new e({type:"boolean",...D0(t)})}function Lt0(e){return new e({type:"unknown"})}function xt0(e,t){return new e({type:"never",...D0(t)})}function kt0(e,t){return new e({type:"date",...D0(t)})}function Ct0(e,t){return new Qe0({check:"less_than",...D0(t),value:e,inclusive:!0})}function Nt0(e,t){return new Ze0({check:"greater_than",...D0(t),value:e,inclusive:!0})}function xW(e,t){return new Ge0({check:"max_length",...D0(t),maximum:e})}function Wp(e,t){return new Ke0({check:"min_length",...D0(t),minimum:e})}function kW(e,t){return new Ye0({check:"length_equals",...D0(t),length:e})}function Bt0(e,t){return new Je0({check:"string_format",format:"regex",...D0(t),pattern:e})}function _t0(e){return new e20({check:"string_format",format:"lowercase",...D0(e)})}function Et0(e){return new t20({check:"string_format",format:"uppercase",...D0(e)})}function St0(e,t){return new o20({check:"string_format",format:"includes",...D0(t),includes:e})}function Tt0(e,t){return new n20({check:"string_format",format:"starts_with",...D0(t),prefix:e})}function Pt0(e,t){return new r20({check:"string_format",format:"ends_with",...D0(t),suffix:e})}function Ua(e){return new c20({check:"overwrite",tx:e})}function Xt0(e){return Ua(t=>t.normalize(e))}function jt0(){return Ua(e=>e.trim())}function Dt0(){return Ua(e=>e.toLowerCase())}function It0(){return Ua(e=>e.toUpperCase())}function Ft0(e,t,o){return new e({type:"array",element:t,...D0(o)})}function Ht0(e,t,o){return new e({type:"custom",check:"custom",fn:t,...D0(o)})}function Ut0(e){const t=Vt0(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(Oa(n,o.value,t._zod.def));else{const r=n;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=o.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),o.issues.push(Oa(r))}},e(o.value,o)));return t}function Vt0(e,t){const o=new N2({check:"custom",...D0(t)});return o._zod.check=e,o}function $t0(e,t){const o=D0(t);let n=o.truthy??["true","1","yes","on","y","enabled"],r=o.falsy??["false","0","no","off","n","disabled"];o.case!=="sensitive"&&(n=n.map(q=>typeof q=="string"?q.toLowerCase():q),r=r.map(q=>typeof q=="string"?q.toLowerCase():q));const a=new Set(n),i=new Set(r),b=e.Codec??LW,l=e.Boolean??RW,u=e.String??U3,O=new u({type:"string",error:o.error}),f=new l({type:"boolean",error:o.error}),h=new b({type:"pipe",in:O,out:f,transform:((q,g)=>{let W=q;return o.case!=="sensitive"&&(W=W.toLowerCase()),a.has(W)?!0:i.has(W)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...a,...i],input:g.value,inst:h,continue:!1}),{})}),reverseTransform:((q,g)=>q===!0?n[0]||"true":r[0]||"false"),error:o.error});return h}const Qt0=n0("ZodISODateTime",(e,t)=>{h20.init(e,t),$1.init(e,t)});function CW(e){return Wt0(Qt0,e)}const Zt0=n0("ZodISODate",(e,t)=>{q20.init(e,t),$1.init(e,t)});function Gt0(e){return vt0(Zt0,e)}const Kt0=n0("ZodISOTime",(e,t)=>{m20.init(e,t),$1.init(e,t)});function Yt0(e){return Rt0(Kt0,e)}const Jt0=n0("ZodISODuration",(e,t)=>{g20.init(e,t),$1.init(e,t)});function eo0(e){return yt0(Jt0,e)}const to0=(e,t)=>{hW.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o=>le0(e,o)},flatten:{value:o=>be0(e,o)},addIssue:{value:o=>{e.issues.push(o),e.message=JSON.stringify(e.issues,Rz,2)}},addIssues:{value:o=>{e.issues.push(...o),e.message=JSON.stringify(e.issues,Rz,2)}},isEmpty:{get(){return e.issues.length===0}}})},B2=n0("ZodError",to0,{Parent:Error}),oo0=j3(B2),no0=D3(B2),ro0=I3(B2),co0=F3(B2),ao0=de0(B2),so0=Oe0(B2),io0=fe0(B2),po0=Ae0(B2),Mo0=he0(B2),bo0=qe0(B2),lo0=me0(B2),zo0=ge0(B2),ce=n0("ZodType",(e,t)=>(V1.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...o)=>e.clone(Yn(t,{checks:[...t.checks??[],...o.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]})),e.clone=(o,n)=>tn(e,o,n),e.brand=()=>e,e.register=((o,n)=>(o.add(e,n),e)),e.parse=(o,n)=>oo0(e,o,n,{callee:e.parse}),e.safeParse=(o,n)=>ro0(e,o,n),e.parseAsync=async(o,n)=>no0(e,o,n,{callee:e.parseAsync}),e.safeParseAsync=async(o,n)=>co0(e,o,n),e.spa=e.safeParseAsync,e.encode=(o,n)=>ao0(e,o,n),e.decode=(o,n)=>so0(e,o,n),e.encodeAsync=async(o,n)=>io0(e,o,n),e.decodeAsync=async(o,n)=>po0(e,o,n),e.safeEncode=(o,n)=>Mo0(e,o,n),e.safeDecode=(o,n)=>bo0(e,o,n),e.safeEncodeAsync=async(o,n)=>lo0(e,o,n),e.safeDecodeAsync=async(o,n)=>zo0(e,o,n),e.refine=(o,n)=>e.check(rn0(o,n)),e.superRefine=o=>e.check(cn0(o)),e.overwrite=o=>e.check(Ua(o)),e.optional=()=>iA(e),e.nullable=()=>pA(e),e.nullish=()=>iA(pA(e)),e.nonoptional=o=>Ko0(e,o),e.array=()=>Yd(e),e.or=o=>Po0([e,o]),e.and=o=>jo0(e,o),e.transform=o=>MA(e,Uo0(o)),e.default=o=>Qo0(e,o),e.prefault=o=>Go0(e,o),e.catch=o=>Jo0(e,o),e.pipe=o=>MA(e,o),e.readonly=()=>on0(e),e.describe=o=>{const n=e.clone();return Wi.add(n,{description:o}),n},Object.defineProperty(e,"description",{get(){return Wi.get(e)?.description},configurable:!0}),e.meta=(...o)=>{if(o.length===0)return Wi.get(e);const n=e.clone();return Wi.add(n,o[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),NW=n0("_ZodString",(e,t)=>{U3.init(e,t),ce.init(e,t);const o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,e.regex=(...n)=>e.check(Bt0(...n)),e.includes=(...n)=>e.check(St0(...n)),e.startsWith=(...n)=>e.check(Tt0(...n)),e.endsWith=(...n)=>e.check(Pt0(...n)),e.min=(...n)=>e.check(Wp(...n)),e.max=(...n)=>e.check(xW(...n)),e.length=(...n)=>e.check(kW(...n)),e.nonempty=(...n)=>e.check(Wp(1,...n)),e.lowercase=n=>e.check(_t0(n)),e.uppercase=n=>e.check(Et0(n)),e.trim=()=>e.check(jt0()),e.normalize=(...n)=>e.check(Xt0(...n)),e.toLowerCase=()=>e.check(Dt0()),e.toUpperCase=()=>e.check(It0())}),BW=n0("ZodString",(e,t)=>{U3.init(e,t),NW.init(e,t),e.email=o=>e.check(ot0(uo0,o)),e.url=o=>e.check(st0(do0,o)),e.jwt=o=>e.check(gt0(ko0,o)),e.emoji=o=>e.check(it0(Oo0,o)),e.guid=o=>e.check(aA(sA,o)),e.uuid=o=>e.check(nt0(vi,o)),e.uuidv4=o=>e.check(rt0(vi,o)),e.uuidv6=o=>e.check(ct0(vi,o)),e.uuidv7=o=>e.check(at0(vi,o)),e.nanoid=o=>e.check(pt0(fo0,o)),e.guid=o=>e.check(aA(sA,o)),e.cuid=o=>e.check(Mt0(Ao0,o)),e.cuid2=o=>e.check(bt0(ho0,o)),e.ulid=o=>e.check(lt0(qo0,o)),e.base64=o=>e.check(ht0(wo0,o)),e.base64url=o=>e.check(qt0(Lo0,o)),e.xid=o=>e.check(zt0(mo0,o)),e.ksuid=o=>e.check(ut0(go0,o)),e.ipv4=o=>e.check(dt0(Wo0,o)),e.ipv6=o=>e.check(Ot0(vo0,o)),e.cidrv4=o=>e.check(ft0(Ro0,o)),e.cidrv6=o=>e.check(At0(yo0,o)),e.e164=o=>e.check(mt0(xo0,o)),e.datetime=o=>e.check(CW(o)),e.date=o=>e.check(Gt0(o)),e.time=o=>e.check(Yt0(o)),e.duration=o=>e.check(eo0(o))});function s2(e){return tt0(BW,e)}const $1=n0("ZodStringFormat",(e,t)=>{I1.init(e,t),NW.init(e,t)}),uo0=n0("ZodEmail",(e,t)=>{M20.init(e,t),$1.init(e,t)}),sA=n0("ZodGUID",(e,t)=>{i20.init(e,t),$1.init(e,t)}),vi=n0("ZodUUID",(e,t)=>{p20.init(e,t),$1.init(e,t)}),do0=n0("ZodURL",(e,t)=>{b20.init(e,t),$1.init(e,t)}),Oo0=n0("ZodEmoji",(e,t)=>{l20.init(e,t),$1.init(e,t)}),fo0=n0("ZodNanoID",(e,t)=>{z20.init(e,t),$1.init(e,t)}),Ao0=n0("ZodCUID",(e,t)=>{u20.init(e,t),$1.init(e,t)}),ho0=n0("ZodCUID2",(e,t)=>{d20.init(e,t),$1.init(e,t)}),qo0=n0("ZodULID",(e,t)=>{O20.init(e,t),$1.init(e,t)}),mo0=n0("ZodXID",(e,t)=>{f20.init(e,t),$1.init(e,t)}),go0=n0("ZodKSUID",(e,t)=>{A20.init(e,t),$1.init(e,t)}),Wo0=n0("ZodIPv4",(e,t)=>{W20.init(e,t),$1.init(e,t)}),vo0=n0("ZodIPv6",(e,t)=>{v20.init(e,t),$1.init(e,t)}),Ro0=n0("ZodCIDRv4",(e,t)=>{R20.init(e,t),$1.init(e,t)}),yo0=n0("ZodCIDRv6",(e,t)=>{y20.init(e,t),$1.init(e,t)}),wo0=n0("ZodBase64",(e,t)=>{w20.init(e,t),$1.init(e,t)}),Lo0=n0("ZodBase64URL",(e,t)=>{x20.init(e,t),$1.init(e,t)}),xo0=n0("ZodE164",(e,t)=>{k20.init(e,t),$1.init(e,t)}),ko0=n0("ZodJWT",(e,t)=>{N20.init(e,t),$1.init(e,t)}),_W=n0("ZodBoolean",(e,t)=>{RW.init(e,t),ce.init(e,t)});function wz(e){return wt0(_W,e)}const Co0=n0("ZodUnknown",(e,t)=>{B20.init(e,t),ce.init(e,t)});function Lz(){return Lt0(Co0)}const No0=n0("ZodNever",(e,t)=>{_20.init(e,t),ce.init(e,t)});function Bo0(e){return xt0(No0,e)}const _o0=n0("ZodDate",(e,t)=>{E20.init(e,t),ce.init(e,t),e.min=(n,r)=>e.check(Nt0(n,r)),e.max=(n,r)=>e.check(Ct0(n,r));const o=e._zod.bag;e.minDate=o.minimum?new Date(o.minimum):null,e.maxDate=o.maximum?new Date(o.maximum):null});function Eo0(e){return kt0(_o0,e)}const So0=n0("ZodArray",(e,t)=>{S20.init(e,t),ce.init(e,t),e.element=t.element,e.min=(o,n)=>e.check(Wp(o,n)),e.nonempty=o=>e.check(Wp(1,o)),e.max=(o,n)=>e.check(xW(o,n)),e.length=(o,n)=>e.check(kW(o,n)),e.unwrap=()=>e.element});function Yd(e,t){return Ft0(So0,e,t)}const EW=n0("ZodObject",(e,t)=>{P20.init(e,t),ce.init(e,t),m1(e,"shape",()=>t.shape),e.keyof=()=>Fo0(Object.keys(e._zod.def.shape)),e.catchall=o=>e.clone({...e._zod.def,catchall:o}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Lz()}),e.loose=()=>e.clone({...e._zod.def,catchall:Lz()}),e.strict=()=>e.clone({...e._zod.def,catchall:Bo0()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=o=>ae0(e,o),e.safeExtend=o=>se0(e,o),e.merge=o=>ie0(e,o),e.pick=o=>re0(e,o),e.omit=o=>ce0(e,o),e.partial=(...o)=>pe0(SW,e,o[0]),e.required=(...o)=>Me0(TW,e,o[0])});function vp(e,t){const o={type:"object",shape:e??{},...D0(t)};return new EW(o)}function V3(e,t){return new EW({type:"object",shape:e,catchall:Lz(),...D0(t)})}const To0=n0("ZodUnion",(e,t)=>{X20.init(e,t),ce.init(e,t),e.options=t.options});function Po0(e,t){return new To0({type:"union",options:e,...D0(t)})}const Xo0=n0("ZodIntersection",(e,t)=>{j20.init(e,t),ce.init(e,t)});function jo0(e,t){return new Xo0({type:"intersection",left:e,right:t})}const Do0=n0("ZodRecord",(e,t)=>{D20.init(e,t),ce.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Io0(e,t,o){return new Do0({type:"record",keyType:e,valueType:t,...D0(o)})}const xz=n0("ZodEnum",(e,t)=>{I20.init(e,t),ce.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const o=new Set(Object.keys(t.entries));e.extract=(n,r)=>{const a={};for(const i of n)if(o.has(i))a[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new xz({...t,checks:[],...D0(r),entries:a})},e.exclude=(n,r)=>{const a={...t.entries};for(const i of n)if(o.has(i))delete a[i];else throw new Error(`Key ${i} not found in enum`);return new xz({...t,checks:[],...D0(r),entries:a})}});function Fo0(e,t){const o=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new xz({type:"enum",entries:o,...D0(t)})}const Ho0=n0("ZodTransform",(e,t)=>{F20.init(e,t),ce.init(e,t),e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new uW(e.constructor.name);o.addIssue=a=>{if(typeof a=="string")o.issues.push(Oa(a,o.value,t));else{const i=a;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=e),o.issues.push(Oa(i))}};const r=t.transform(o.value,o);return r instanceof Promise?r.then(a=>(o.value=a,o)):(o.value=r,o)}});function Uo0(e){return new Ho0({type:"transform",transform:e})}const SW=n0("ZodOptional",(e,t)=>{H20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function iA(e){return new SW({type:"optional",innerType:e})}const Vo0=n0("ZodNullable",(e,t)=>{U20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function pA(e){return new Vo0({type:"nullable",innerType:e})}const $o0=n0("ZodDefault",(e,t)=>{V20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Qo0(e,t){return new $o0({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():fW(t)}})}const Zo0=n0("ZodPrefault",(e,t)=>{$20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Go0(e,t){return new Zo0({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():fW(t)}})}const TW=n0("ZodNonOptional",(e,t)=>{Q20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ko0(e,t){return new TW({type:"nonoptional",innerType:e,...D0(t)})}const Yo0=n0("ZodCatch",(e,t)=>{Z20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Jo0(e,t){return new Yo0({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const PW=n0("ZodPipe",(e,t)=>{G20.init(e,t),ce.init(e,t),e.in=t.in,e.out=t.out});function MA(e,t){return new PW({type:"pipe",in:e,out:t})}const XW=n0("ZodCodec",(e,t)=>{PW.init(e,t),LW.init(e,t)});function en0(e,t,o){return new XW({type:"pipe",in:e,out:t,transform:o.decode,reverseTransform:o.encode})}const tn0=n0("ZodReadonly",(e,t)=>{K20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function on0(e){return new tn0({type:"readonly",innerType:e})}const nn0=n0("ZodCustom",(e,t)=>{Y20.init(e,t),ce.init(e,t)});function rn0(e,t={}){return Ht0(nn0,e,t)}function cn0(e){return Ut0(e)}const an0=(...e)=>$t0({Codec:XW,Boolean:_W,String:BW},...e),jW=en0(CW({offset:!0}),Eo0(),{decode:e=>new Date(e),encode:e=>e.toISOString()}),sn0=V3({slug:s2(),title:s2(),custom_excerpt:s2(),url:s2().url(),published_at:jW,featured:an0(),feature_image:s2().url().optional(),html:s2().optional()}).transform(e=>({slug:e.slug,title:e.title,customExcerpt:e.custom_excerpt,url:e.url,publishedAt:e.published_at,featured:e.featured,featureImage:e.feature_image,html:e.html})),in0=vp({posts:Yd(sn0).default([]),changelogUrl:s2().url().default("https://ghost.org/changelog")}).transform(e=>({entries:e.posts,changelogUrl:e.changelogUrl})),$3=()=>L2({queryKey:["changelog"],queryFn:async()=>{const e=await fetch("https://ghost.org/changelog.json");if(!e.ok)throw new Error(`Failed to fetch changelog: ${e.status}`);const t=await e.json();return in0.parse(t)},staleTime:1/0});function bA(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function DW(e,t){const o={...e};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const r=t[n],a=e[n];r!==void 0&&(bA(r)&&bA(a)?o[n]=DW(a,r):o[n]=r)}return o}const pn0=V3({lastSeenDate:jW.optional().catch(void 0)}),lA={expanded:{posts:!0},menu:{visible:!0}},Mn0=V3({expanded:vp({posts:wz()}),menu:vp({visible:wz()})}),kz=V3({whatsNew:pn0.optional().catch(void 0),nightShift:wz().optional(),navigation:Mn0.default(lA).catch(lA)}),IW=e=>["userPreferences",e?.id,e?.accessibility];function Q3(e){const{data:t}=qe();return L2({...e,queryKey:IW(t),queryFn:()=>{if(!t)throw new Error("User not loaded");const o=t.accessibility||"{}",n=JSON.parse(o);return kz.parse(n)},enabled:!!t,staleTime:1/0,cacheTime:0})}const Z3=()=>{const e=f1(),{data:t}=qe(),{mutateAsync:o}=lW();return Y1({mutationFn:async n=>{if(!t)throw new Error("User is not loaded");const r=e.getQueryData(IW(t))??kz.parse({}),a=DW(r,n),i=kz.encode(a);await o({...t,accessibility:JSON.stringify(i)})}})};function bn0(){return{lastSeenDate:new Date}}const ln0=(e,t)=>["whatsNew",e?.whatsNew?.lastSeenDate?.toISOString(),t?.publishedAt.toISOString()],FW=()=>{const{data:e,isSuccess:t}=Q3(),{data:o,isSuccess:n}=$3(),{mutateAsync:r}=Z3(),a=!!e?.whatsNew?.lastSeenDate;p.useEffect(()=>{!a&&t&&r({whatsNew:bn0()})},[a,t,r]);const i=o?.entries[0];return L2({queryKey:ln0(e,i),queryFn:()=>{if(!i)return{hasNew:!1,hasNewFeatured:!1};const b=e.whatsNew.lastSeenDate,l=i.publishedAt>b,u=l&&i.featured===!0;return{hasNew:l,hasNewFeatured:u}},enabled:n&&a,staleTime:1/0,cacheTime:0})},HW=()=>{const{data:e}=$3(),{mutateAsync:t}=Z3();return Y1({mutationFn:async()=>{const o=e?.entries[0];if(!o)return;const n={lastSeenDate:o.publishedAt};await t({whatsNew:n})}})};function zn0(e){return e.toLocaleDateString("en-GB",{day:"2-digit",month:"long",year:"numeric"})}function un0({entry:e}){return z.jsxs("a",{className:"flex items-start gap-6 p-2 -mx-2 rounded-md hover:bg-muted/80 transition-colors","data-test-entry":!0,href:e.url,rel:"noopener noreferrer",target:"_blank",children:[e.featureImage&&z.jsx("img",{alt:e.title,className:"flex-shrink-0 w-40 h-[110px] object-cover rounded","data-test-entry-image":!0,src:e.featureImage}),z.jsxs("div",{className:"flex flex-col gap-2 min-w-0 flex-1",children:[z.jsx("h2",{className:"text-[17px] font-semibold text-foreground mt-1.5","data-test-entry-title":!0,children:e.title}),z.jsx("p",{className:"text-sm text-gray-700 leading-[1.45] line-clamp-2","data-test-entry-excerpt":!0,children:e.customExcerpt}),z.jsx("span",{className:"text-sm text-gray-600","data-test-entry-date":!0,children:zn0(e.publishedAt)})]})]})}function dn0({open:e,onOpenChange:t}){const{data:o}=$3(),{mutate:n}=HW();return p.useEffect(()=>{e&&n()},[e,n]),z.jsx(m3,{open:e,onOpenChange:t,children:z.jsxs(Ta,{className:"max-w-2xl max-h-[85vh] flex flex-col","data-test-modal":"whats-new",role:"dialog","aria-modal":"true","aria-labelledby":"whats-new-modal-title",children:[z.jsx(yd,{children:z.jsx(Ld,{id:"whats-new-modal-title","data-test-modal-title":!0,className:"text-2xl tracking-tighter",children:"What’s new?"})}),o?z.jsxs(z.Fragment,{children:[z.jsx("section",{className:"flex-1 overflow-y-auto space-y-2 -mx-6 px-6","data-test-entries":!0,children:o.entries.map(r=>z.jsx(un0,{entry:r},r.slug))}),z.jsxs(wd,{className:"flex-row justify-between sm:justify-between gap-3",children:[z.jsx(o1,{asChild:!0,variant:"outline",children:z.jsx("a",{href:`${o.changelogUrl}#/portal/signup`,rel:"noopener noreferrer",target:"_blank",children:"Turn on notifications"})}),z.jsx(o1,{asChild:!0,children:z.jsx("a",{href:o.changelogUrl,rel:"noopener noreferrer",target:"_blank",children:"All updates →"})})]})]}):z.jsx("div",{className:"flex-1 flex items-center justify-center py-12",children:z.jsx(hp,{size:"lg"})})]})})}function UW(){const e=pW(),t=!!e?.subscription?.isActiveTrial,o=e?.subscription?.trial_end?Math.ceil((new Date(e.subscription.trial_end).getTime()-Date.now())/(1e3*60*60*24)):0;return{showUpgradeBanner:t,trialDaysRemaining:o}}function On0({children:e,...t}){return z.jsx("span",{className:"flex-1",...t,children:e})}const Ie=({children:e,...t})=>z.jsx(Um,{className:"cursor-pointer text-base",asChild:!0,...t,children:e});Ie.Label=On0;function Rp(e){const t=qe();return z.jsxs(hd,{...e,children:[t.data?.profile_image&&z.jsx(qd,{src:t.data?.profile_image}),z.jsx(md,{className:"text-foreground-muted hover:text-foreground",children:z.jsx(fd,{})})]})}function VW({name:e,email:t,children:o}){return z.jsx("div",{className:"p-3",children:z.jsxs("div",{className:"flex items-center gap-3",children:[o,z.jsxs("div",{className:"flex flex-col",children:[z.jsx("span",{className:"text-base font-semibold text-foreground",children:e}),z.jsx("span",{className:"text-xs text-foreground-muted -mt-px",children:t})]})]})})}function $W(){const e=qe();return z.jsx(Ie,{children:z.jsxs(Ba,{to:`/settings/staff/${e.data?.slug}`,children:[z.jsx(fd,{}),z.jsx(Ie.Label,{children:"Your profile"})]})})}function QW(){const{data:e}=Q3(),{mutateAsync:t,isLoading:o}=Z3(),n=r=>{t({nightShift:r})};return z.jsxs(Ie,{asChild:!1,onSelect:r=>{r.preventDefault(),n(!e?.nightShift)},children:[z.jsx(eG,{}),z.jsx(Ie.Label,{className:"flex-1",children:"Dark mode"}),z.jsx(eg,{size:"sm",checked:e?.nightShift??!1,disabled:o,onCheckedChange:n,onClick:r=>r.stopPropagation(),tabIndex:-1})]})}function ZW(){const e=()=>{fetch("/ghost/api/admin/session",{method:"DELETE"}).then(()=>{window.location.href="/ghost"}).catch(t=>{console.error(t)})};return z.jsxs(Ie,{asChild:!1,onSelect:e,children:[z.jsx(UZ,{}),z.jsx(Ie.Label,{children:"Sign out"})]})}function fn0(e){const t=qe(),{data:o}=FW(),{showUpgradeBanner:n}=UW();return z.jsxs(Fm,{...e,children:[z.jsx(Hm,{asChild:!0,className:"focus-visible:ring-0",children:z.jsxs(B3,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground","aria-label":"User menu",children:[z.jsxs("div",{className:"relative",children:[z.jsx(Rp,{}),o?.hasNew&&z.jsx("span",{className:"absolute -top-0.5 -right-0.5",children:z.jsx(Vf,{variant:"success",size:"sm",label:"New updates available","data-test-whats-new-avatar-badge":!0})})]}),z.jsxs("div",{className:"grid flex-1 text-left text-base leading-tight",children:[z.jsx("span",{className:"truncate font-semibold",children:t.data?.name}),z.jsx("span",{className:"text-muted-foreground truncate text-xs -mt-px",children:t.data?.email})]}),z.jsx(AZ,{className:"ml-auto size-4 text-grey-700","data-test-nav":"arrow-down"})]})}),z.jsxs(Sd,{align:"end",sideOffset:10,className:`w-full min-w-[240px] sidebar:min-w-[260px] ${n?"shadow-[0_18px_80px_0_rgba(0,0,0,0.07),0_7.52px_33.422px_0_rgba(0,0,0,0.05),0_4.021px_17.869px_0_rgba(0,0,0,0.04),0_2.254px_10.017px_0_rgba(0,0,0,0.04),0_1.197px_5.32px_0_rgba(0,0,0,0.03),0_0.498px_2.214px_0_rgba(0,0,0,0.02)]":""}`,children:[z.jsx(VW,{name:t.data?.name,email:t.data?.email,children:z.jsx(Rp,{})}),z.jsx(Bn,{}),z.jsxs(Ie,{"data-test-nav":"whatsnew",asChild:!1,onSelect:()=>{queueMicrotask(()=>e.onOpenWhatsNew?.())},children:[z.jsx(b9,{}),z.jsx(Ie.Label,{children:"What’s new?"}),o?.hasNew&&z.jsx("div",{className:"flex-1 flex justify-end",children:z.jsx(Vf,{variant:"success",size:"sm",label:"New updates available","data-test-whats-new-menu-badge":!0})})]}),z.jsx($W,{}),z.jsx(Bn,{}),z.jsx(Ie,{children:z.jsxs("a",{href:"https://ghost.org/resources?utm_source=admin&utm_campaign=resources",target:"_blank",rel:"noopener noreferrer",children:[z.jsx(MZ,{}),z.jsx(Ie.Label,{children:"Resources & guides"})]})}),z.jsx(QW,{}),z.jsx(Bn,{}),z.jsx(ZW,{})]})]})}function An0(){const e=qe(),o=T3().data?.site.url??"";return z.jsxs(Fm,{children:[z.jsx(Hm,{asChild:!0,children:z.jsx("button",{className:"rounded-full shadow-lg hover:shadow-xl transition-shadow focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 p-0.5 flex items-center justify-center border border-border dark:bg-muted bg-background","aria-label":"Open user menu",children:z.jsx(Rp,{className:"w-11 h-11"})})}),z.jsxs(Sd,{align:"start",side:"top",sideOffset:10,className:"w-full min-w-[240px] mb-2",children:[z.jsx(VW,{name:e.data?.name,email:e.data?.email,children:z.jsx(Rp,{})}),z.jsx(Bn,{}),z.jsx(Ie,{children:z.jsxs(Ba,{to:"/",children:[z.jsx(NZ,{}),z.jsx(Ie.Label,{children:"Posts"})]})}),z.jsx(Ie,{children:z.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",children:[z.jsx(zd,{}),z.jsx(Ie.Label,{children:"View site"})]})}),z.jsx(Bn,{}),z.jsx($W,{}),z.jsx(QW,{}),z.jsx(Bn,{}),z.jsx(ZW,{})]})]})}function hn0({...e}){const[t,o]=p.useState(!1);return z.jsxs(z.Fragment,{children:[z.jsx(eW,{...e,children:z.jsx(oc,{children:z.jsx(nc,{children:z.jsx(Vd,{children:z.jsx(fn0,{onOpenWhatsNew:()=>o(!0)})})})})}),z.jsx(dn0,{open:t,onOpenChange:o})]})}function qn0(){const{data:e}=FW(),{data:t}=$3(),{mutate:o}=HW(),[n,r]=p.useState(!1);if(n||!e?.hasNewFeatured)return null;const a=t?.entries[0];if(!a)return null;const i=()=>{r(!0),o()},b=()=>{o()};return z.jsx(gd,{"data-test-toast":"whats-new",role:"status","aria-label":"What’s new notification","aria-live":"polite",variant:"gradient",dismissible:!0,onDismiss:i,children:z.jsxs("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"block pr-8",onClick:b,"data-test-toast-link":!0,children:[z.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[z.jsx(b9,{className:"size-4 text-purple-600"}),z.jsx("span",{className:"text-xs font-semibold text-gray-700 uppercase tracking-wide",children:"What’s new?"})]}),z.jsx("div",{className:"text-base font-semibold text-gray-900 mb-1","data-test-toast-title":!0,children:a.title}),z.jsx("div",{className:"text-sm text-gray-700","data-test-toast-excerpt":!0,children:a.customExcerpt})]})})}const yp="SettingsResponseType",G3=Fn({dataType:yp,path:"/settings/",defaultSearchParams:{group:"site,theme,private,members,portal,newsletter,email,labs,slack,unsplash,views,firstpromoter,editor,comments,analytics,announcement,pintura,donations,security,social_web,explore"}}),jc0=Hn({method:"PUT",path:()=>"/settings/",body:e=>({settings:e.map(({key:t,value:o})=>({key:t,value:o}))}),updateQueries:{dataType:yp,emberUpdateType:"createOrUpdate",update:e=>({...e,settings:e.settings})},invalidateQueries:{filters:{predicate(e){return e.queryKey[0]!==yp}}}}),Dc0=Hn({method:"DELETE",path:()=>"/settings/stripe/connect/",invalidateQueries:{dataType:yp}}),Ic0=Hn({method:"POST",path:()=>"/slack/test/"});function Fc0(e){const t=["API","CTA","RSS"];return e.replace(/^[a-z]/,o=>o.toUpperCase()).replace(/_/g," ").replace(new RegExp(`\\b(${t.join("|")})\\b`,"ig"),o=>o.toUpperCase())}function Hc0(e,t){return t.map(o=>{var n;return(n=e?.find(r=>r.key===o))==null?void 0:n.value})}function Tt(e,t){if(!e)return null;const o=e.find(n=>n.key===t);return o?.value||null}function Uc0(e,t){if(!e)return;const o=e.find(n=>n.key===t);return o?.is_read_only||!1}function Vc0(e,t){const o=a=>e.some(i=>i.key===a&&i.value),n=o("stripe_secret_key")&&o("stripe_publishable_key"),r=o("stripe_connect_secret_key")&&o("stripe_connect_publishable_key");return t.stripeDirect?n:r||n}const Jd=[],GW=p.createContext(void 0),mn0=({children:e})=>{const t=we(),[o,n]=p.useState(()=>{const i=localStorage.getItem("featureFlags");return i?JSON.parse(i):gn0()});p.useEffect(()=>{const i=Wn0(t.search);Object.keys(i).length>0&&n(b=>{const l={...b,...i};return localStorage.setItem("featureFlags",JSON.stringify(l)),l})},[t.search]);const a={isEnabled:i=>o[i]??!1,flags:o,allFlags:Jd};return z.jsx(GW.Provider,{value:a,children:e})},gn0=()=>Jd.reduce((e,t)=>({...e,[t]:!1}),{}),Wn0=e=>{const t=new URLSearchParams(e),o={};return Jd.forEach(n=>{const r=t.get(n);r==="ON"?o[n]=!0:r==="OFF"&&(o[n]=!1)}),o},vn0=()=>{const e=p.useContext(GW);if(e===void 0)throw new Error("useFeatureFlags must be used within a FeatureFlagsProvider");return e};function K3(){const t=Iu().find(o=>o.handle==="activitypub-basepath")?.pathname??"";return t.endsWith("/")?t.slice(0,-1):t}function Jt(){const e=rW(),t=K3();return p.useCallback((o,n)=>{if(typeof o=="number"){e(o,n);return}o.startsWith("/")?e(`${t}${o}`,n):e(o,n)},[e,t])}const KW=({className:e,onClick:t})=>{const o=Jt(),{previousPath:n}=Jp();return z.jsx(o1,{className:g0("size-9 rounded-full bg-white/85 px-2 backdrop-blur-md dark:bg-black/85 dark:text-white [&_svg]:size-6 focus-visible:ring-0",e),variant:"ghost",onClick:()=>{if(t){t();return}o(n?-1:"/")},children:z.jsx(oZ,{size:24,strokeWidth:1.25})})},Rn0=()=>{const e=we(),t=Pt(pv,e.pathname);if(!t)return null;const o=t.map(n=>n.route).filter(n=>n.pageTitle);return o[o.length-1]||t[t.length-1].route};function YW(){const e=Iu(),t=e.findIndex(l=>l.handle==="activitypub-basepath");if(t===-1)return"";const o=e[t+1];if(!o)return"";const r=e[t].pathname,a=o.pathname;let i=a.startsWith(r)?a.slice(r.length):a;return i=i.replace(/^\//,""),i.split("/")[0]}const yn0=({title:e,backIcon:t})=>t?z.jsx(KW,{className:"-ml-2"}):z.jsx(oW,{className:"max-md:text-[2.4rem]",children:e}),zA=({onToggleMobileSidebar:e})=>z.jsx(o1,{className:"px:0 mr-[-9px] w-[34px] rounded-full bg-white/85 backdrop-blur-md lg:hidden dark:bg-black/85 dark:text-white",variant:"ghost",onClick:e,children:z.jsx($Z,{className:"!size-5"})}),wn0=({onToggleMobileSidebar:e,showBorder:t=!0})=>{const{canGoBack:o}=Jp(),n=YW(),r=R10(),a=Rn0();let i=!1;n==="profile"&&(i=!0),n==="notes"&&o&&(i=!0);const b=o&&r||a?.showBackButton===!0;return z.jsx(z.Fragment,{children:i?z.jsxs("div",{className:"sticky left-0 top-8 z-50 inline-block max-lg:flex max-lg:items-center max-lg:justify-between max-lg:pr-[15.5px] max-md:top-4",children:[z.jsx("div",{children:b&&z.jsx(KW,{className:"ml-6 max-md:ml-[10px]"})}),!b&&z.jsx(zA,{onToggleMobileSidebar:e})]}):z.jsx("div",{className:"sticky top-0 z-50 bg-white/85 backdrop-blur-md dark:bg-black",children:z.jsxs("div",{className:`relative flex h-[102px] items-center justify-between gap-5 px-[min(4vw,32px)] max-md:h-[68px] ${t?'before:absolute before:inset-x-[min(4vw,32px)] before:bottom-0 before:block before:border-b before:border-gray-200 before:content-[""] before:dark:border-gray-950':""}`,children:[z.jsx(yn0,{backIcon:b,title:a?.pageTitle||""}),z.jsx(zA,{onToggleMobileSidebar:e})]})})})};function Po(e){if(!e.preferredUsername||!e.id)return"@unknown@unknown";try{return`@${e.preferredUsername}@${new URL(e.id).hostname.replace(/^www\./,"")}`}catch{return"@unknown@unknown"}}var Cz=(e=>(e[e.Note=0]="Note",e[e.Article=1]="Article",e[e.Tombstone=2]="Tombstone",e))(Cz||{});const Ln0=e=>typeof e=="object"&&e!==null&&"statusCode"in e&&"message"in e&&typeof e.statusCode=="number"&&typeof e.message=="string";class xn0{constructor(t,o,n,r=window.fetch.bind(window)){this.apiUrl=t,this.authApiUrl=o,this.handle=n,this.fetch=r}async getToken(){try{return(await(await this.fetch(this.authApiUrl)).json())?.identities?.[0]?.token||null}catch{return null}}async fetchJSON(t,o="GET",n){const r=await this.getToken(),a={method:o,headers:{Authorization:`Bearer ${r}`,Accept:"application/activity+json"}};n&&(a.body=JSON.stringify(n),a.headers["Content-Type"]="application/json");const i=await this.fetch(t,a);if(i.status===204||i.status===202)return null;if(!i.ok){const b={message:"Something went wrong, please try again.",statusCode:i.status};try{const l=await i.json(),u=l.message||l.error;u&&(b.message=u),l.code&&(b.code=l.code)}catch{}throw b}return await i.json()}async blockDomain(t){const o=new URL(`.ghost/activitypub/v1/actions/block/domain/${encodeURIComponent(t.href)}`,this.apiUrl);return await this.fetchJSON(o,"POST"),!0}async unblockDomain(t){const o=new URL(`.ghost/activitypub/v1/actions/unblock/domain/${encodeURIComponent(t.href)}`,this.apiUrl);return await this.fetchJSON(o,"POST"),!0}async block(t){const o=new URL(`.ghost/activitypub/v1/actions/block/${encodeURIComponent(t.href)}`,this.apiUrl);return await this.fetchJSON(o,"POST"),!0}async unblock(t){const o=new URL(`.ghost/activitypub/v1/actions/unblock/${encodeURIComponent(t.href)}`,this.apiUrl);return await this.fetchJSON(o,"POST"),!0}async follow(t){const o=new URL(`.ghost/activitypub/v1/actions/follow/${t}`,this.apiUrl);return await this.fetchJSON(o,"POST")}async unfollow(t){const o=new URL(`.ghost/activitypub/v1/actions/unfollow/${t}`,this.apiUrl);return await this.fetchJSON(o,"POST")}async like(t){const o=new URL(`.ghost/activitypub/v1/actions/like/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"POST")}async unlike(t){const o=new URL(`.ghost/activitypub/v1/actions/unlike/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"POST")}async repost(t){const o=new URL(`.ghost/activitypub/v1/actions/repost/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"POST")}async derepost(t){const o=new URL(`.ghost/activitypub/v1/actions/derepost/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"POST")}async reply(t,o,n){const r=new URL(`.ghost/activitypub/v1/actions/reply/${encodeURIComponent(t)}`,this.apiUrl),a={content:o};return n&&(a.image=n),await this.fetchJSON(r,"POST",a)}async note(t,o){const n=new URL(".ghost/activitypub/v1/actions/note",this.apiUrl),r={content:t};return o&&(r.image=o),(await this.fetchJSON(n,"POST",r)).post}async delete(t){const o=new URL(`.ghost/activitypub/v1/post/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"DELETE")}get userApiUrl(){return new URL(`.ghost/activitypub/users/${this.handle}`,this.apiUrl)}async getUser(){return await this.fetchJSON(this.userApiUrl)}get searchApiUrl(){return new URL(".ghost/activitypub/v1/actions/search",this.apiUrl)}async search(t){const o=this.searchApiUrl;o.searchParams.set("query",t);const n=await this.fetchJSON(o,"GET");return n&&"accounts"in n?n:{accounts:[]}}async getThread(t){const o=new URL(`.ghost/activitypub/v1/thread/${encodeURIComponent(t)}`,this.apiUrl);return await this.fetchJSON(o)}async getAccount(t){const o=new URL(`.ghost/activitypub/v1/account/${t}`,this.apiUrl);return await this.fetchJSON(o)}async getAccountFollows(t,o,n){const r=new URL(`.ghost/activitypub/v1/account/${t}/follows/${o}`,this.apiUrl);n&&r.searchParams.set("next",n);const a=await this.fetchJSON(r);if(a===null)return{accounts:[],next:null};if(!("accounts"in a))return{accounts:[],next:null};const i=Array.isArray(a.accounts)?a.accounts:[],b="next"in a&&typeof a.next=="string"?a.next:null;return{accounts:i,next:b}}async getFeed(t){return this.getPaginatedPosts(".ghost/activitypub/v1/feed/notes",t)}async getInbox(t){return this.getPaginatedPosts(".ghost/activitypub/v1/feed/reader",t)}async getDiscoveryFeed(t,o){const n=`.ghost/activitypub/v1/feed/discover/${t}`;return this.getPaginatedPosts(n,o)}async getExploreAccounts(t,o){const n=`.ghost/activitypub/v1/explore/${t}`;return this.getPaginatedExploreAccounts(n,o)}async getTopics(){const t=new URL(".ghost/activitypub/v1/topics",this.apiUrl),o=await this.fetchJSON(t);return{topics:o&&"topics"in o&&Array.isArray(o.topics)?o.topics:[]}}async getRecommendations(t){const o=new URL(".ghost/activitypub/v1/recommendations",this.apiUrl);t&&o.searchParams.set("limit",t.toString());const n=await this.fetchJSON(o);return{accounts:n&&"accounts"in n&&Array.isArray(n.accounts)?n.accounts:[]}}async getPostsByAccount(t,o){return this.getPaginatedPosts(`.ghost/activitypub/v1/posts/${t}`,o)}async getPostsLikedByAccount(t){return this.getPaginatedPosts(".ghost/activitypub/v1/posts/me/liked",t)}async getPaginatedPosts(t,o){const n=new URL(t,this.apiUrl);o&&n.searchParams.set("next",o);const r=await this.fetchJSON(n);if(r===null||!("posts"in r))return{posts:[],next:null};const a=Array.isArray(r.posts)?r.posts:[],i="next"in r&&typeof r.next=="string"?r.next:null;return{posts:a,next:i}}async getNotifications(t){const o=new URL(".ghost/activitypub/v1/notifications",this.apiUrl);t&&o.searchParams.set("next",t);const n=await this.fetchJSON(o);if(n===null)return{notifications:[],next:null};if(!("notifications"in n))return{notifications:[],next:null};const r=Array.isArray(n.notifications)?n.notifications:[],a="next"in n&&typeof n.next=="string"?n.next:null;return{notifications:r,next:a}}async getNotificationsCount(){const t=new URL(".ghost/activitypub/v1/notifications/unread/count",this.apiUrl),o=await this.fetchJSON(t);return o===null?{count:0}:{count:typeof o.count=="number"?o.count:0}}async resetNotificationsCount(){const t=new URL(".ghost/activitypub/v1/notifications/unread/reset",this.apiUrl);return await this.fetchJSON(t,"PUT"),!0}async getBlockedAccounts(t){const o=new URL(".ghost/activitypub/v1/blocks/accounts",this.apiUrl);t&&o.searchParams.set("next",t);const n=await this.fetchJSON(o);if(n===null)return{accounts:[],next:null};const r="blocked_accounts"in n&&Array.isArray(n.blocked_accounts)?n.blocked_accounts:[],a="next"in n&&typeof n.next=="string"?n.next:null;return{accounts:r,next:a}}async getBlockedDomains(t){const o=new URL(".ghost/activitypub/v1/blocks/domains",this.apiUrl);t&&o.searchParams.set("next",t);const n=await this.fetchJSON(o);if(n===null)return{domains:[],next:null};const r="blocked_domains"in n&&Array.isArray(n.blocked_domains)?n.blocked_domains:[],a="next"in n&&typeof n.next=="string"?n.next:null;return{domains:r,next:a}}async getPaginatedExploreAccounts(t,o){const n=new URL(t,this.apiUrl);o&&n.searchParams.set("next",o);const r=await this.fetchJSON(n);if(r===null||!("accounts"in r))return{accounts:[],next:null};const a=Array.isArray(r.accounts)?r.accounts:[],i="next"in r&&typeof r.next=="string"?r.next:null;return{accounts:a,next:i}}async getPost(t){const o=new URL(`.ghost/activitypub/v1/post/${encodeURIComponent(t)}`,this.apiUrl);return await this.fetchJSON(o)}async getReplies(t,o){const n=new URL(`.ghost/activitypub/v1/replies/${encodeURIComponent(t)}`,this.apiUrl);return o&&n.searchParams.set("next",o),await this.fetchJSON(n)}async updateAccount({name:t,username:o,bio:n,avatarUrl:r,bannerImageUrl:a}){const i=new URL(".ghost/activitypub/v1/account",this.apiUrl);await this.fetchJSON(i,"PUT",{name:t,username:o,bio:n,avatarUrl:r,bannerImageUrl:a})}async upload(t){const o=new URL(".ghost/activitypub/v1/upload/image",this.apiUrl),n=new FormData;n.append("file",t);const r=await this.getToken(),a=await this.fetch(o,{method:"POST",headers:{Authorization:`Bearer ${r}`},body:n});if(!a.ok)throw{message:"Upload failed",statusCode:a.status};return(await a.json()).fileUrl}async enableBluesky(){const t=new URL(".ghost/activitypub/v2/actions/bluesky/enable",this.apiUrl);await this.fetchJSON(t,"POST")}async disableBluesky(){const t=new URL(".ghost/activitypub/v2/actions/bluesky/disable",this.apiUrl);await this.fetchJSON(t,"POST")}async confirmBlueskyHandle(){const t=new URL(".ghost/activitypub/v2/actions/bluesky/confirm-handle",this.apiUrl),o=await this.fetchJSON(t,"POST");return o===null||!("handle"in o)||typeof o.handle!="string"?"":String(o.handle)}}const JW="pending-";function ev(){return`${JW}${crypto.randomUUID()}`}function $c0(e){return e.startsWith(JW)}function kn0(e,t,o,n){const r={id:e.url,icon:e.icon,name:e.name,preferredUsername:e.preferredUsername,"@context":"",discoverable:!1,featured:"",followers:"",following:"",image:{url:""},inbox:"",manuallyApprovesFollowers:!1,outbox:"",publicKey:{id:"",owner:"",publicKeyPem:""},published:"",summary:"",type:"Person",url:""};return{id:t,type:"Create",actor:r,object:{type:"Note",name:"",content:o,summary:null,url:"",attributedTo:r,image:n||"",published:new Date().toISOString(),attachment:[],preview:{type:"Note",content:o},id:t,replyCount:0,liked:!1,reposted:!1,repostCount:0,authored:!0,"@context":""},"@context":"",to:""}}function Cn0(e){return e.replace(/\n/g,"<br />")}function rc(e){let t="";e.repostedBy!==null?t="Announce":t="Create";const o={id:e.author.url,icon:{url:e.author.avatarUrl},name:e.author.name,preferredUsername:e.author.handle.split("@")[1],followedByMe:e.author.followedByMe,"@context":"",discoverable:!1,featured:"",followers:"",following:"",image:{url:""},inbox:"",manuallyApprovesFollowers:!1,outbox:"",publicKey:{id:"",owner:"",publicKeyPem:""},published:"",summary:"",type:"Person",url:""};let n=null;e.repostedBy!==null&&(n={id:e.repostedBy.url,icon:{url:e.repostedBy.avatarUrl},name:e.repostedBy.name,preferredUsername:e.repostedBy.handle.split("@")[1],followedByMe:e.repostedBy.followedByMe,"@context":"",discoverable:!1,featured:"",followers:"",following:"",image:{url:""},inbox:"",manuallyApprovesFollowers:!1,outbox:"",publicKey:{id:"",owner:"",publicKeyPem:""},published:"",summary:"",type:"Person",url:""});let r="Note";e.type===Cz.Article?r="Article":e.type===Cz.Tombstone&&(r="Tombstone");const a={type:r,name:e.title,content:e.content,summary:e.summary,url:e.url,attributedTo:o,image:e.featureImageUrl??"",published:e.publishedAt,attachment:e.attachments,preview:{type:"",content:e.excerpt},id:e.id,replyCount:e.replyCount,likeCount:e.likeCount,liked:e.likedByMe,reposted:e.repostedByMe,repostCount:e.repostCount,authored:e.authoredByMe===!0,metadata:e.metadata,"@context":""};return{id:e.id,type:t,actor:n!==null?n:o,object:a,"@context":"",to:""}}let Al;async function c1(){return Al||(Al=(await(await fetch("/ghost/api/admin/site/")).json()).site.url),Al}function a1(e,t){return new xn0(new URL(t),new URL("/ghost/api/admin/identities/",window.location.origin),e)}function He(e="Rate limit exceeded",t="You've made too many requests. Please try again later."){Re.error(e,{description:t})}function Y3(e="Action failed",t="This user has restricted who can interact with their account."){Re.error(e,{description:t})}const l0={outbox:e=>["outbox",e],liked:e=>["liked",e],user:e=>["user",e],profilePosts:e=>e===null?["profile_posts"]:["profile_posts",e],account:e=>["account",e],accountFollows:(e,t)=>["account_follows",e,t],searchResults:e=>["search_results",e],suggestedProfiles:(e,t)=>["suggested_profiles",e,t],exploreProfiles:e=>["explore_profiles",e],replyChain:e=>e===null?["reply_chain"]:["reply_chain",e],feed:["feed"],inbox:["inbox"],discoveryFeed:["discovery_feed"],postsByAccount:["account_posts"],postsLikedByAccount:["account_liked_posts"],notifications:e=>["notifications",e],notificationsCount:e=>["notifications_count",e],blockedAccounts:e=>["blocked_accounts",e],blockedDomains:e=>["blocked_domains",e],topics:()=>["topics"]};function Nz(e,t,o){const n=[l0.feed,l0.inbox,l0.discoveryFeed,l0.postsLikedByAccount,l0.profilePosts(null)];for(const r of n)e.setQueriesData(r,a=>a===void 0?a:{...a,pages:a.pages.map(i=>({...i,posts:i.posts.map(b=>b.object.id===t?{...b,object:{...b.object,liked:o,likeCount:Math.max(o?(b.object.likeCount||0)+1:(b.object.likeCount||0)-1,0)}}:b)}))}),r===l0.postsLikedByAccount&&(e.setQueriesData(r,a=>a&&{...a,pages:a.pages.map(i=>({...i,posts:o?i.posts:i.posts.filter(b=>b.object.id!==t)}))}),o&&e.invalidateQueries({queryKey:l0.postsLikedByAccount}))}function tv(e,t,o,n){const r=[l0.feed,l0.inbox,l0.discoveryFeed,l0.profilePosts("index")],a=o.split("@")[1];for(const b of r)e.setQueriesData(b,l=>l===void 0?l:{...l,pages:l.pages.map(u=>({...u,posts:u.posts.map(O=>O.type!=="Announce"&&O.actor?.preferredUsername===a?{...O,actor:{...O.actor,followedByMe:n}}:O.type==="Announce"&&typeof O.object.attributedTo=="object"&&O.object.attributedTo&&!Array.isArray(O.object.attributedTo)&&"preferredUsername"in O.object.attributedTo&&O.object.attributedTo.preferredUsername===a?{...O,object:{...O.object,attributedTo:{...O.object.attributedTo,followedByMe:n}}}:O)}))});const i=l0.replyChain(null);e.setQueriesData(i,b=>{if(!b)return b;const l=u=>u.author.handle===o?{...u,author:{...u.author,followedByMe:n}}:u;return{...b,post:l(b.post),ancestors:{...b.ancestors,chain:b.ancestors.chain.map(l)},children:b.children.map(u=>({...u,post:l(u.post),chain:u.chain.map(l)}))}})}function ov(e,t,o){e.getQueryCache().getAll().forEach(a=>{const i=a.queryKey;Array.isArray(i)&&i[0]==="account_follows"&&e.setQueryData(i,b=>b?.pages?{...b,pages:b.pages.map(l=>({...l,accounts:l.accounts.map(u=>u.handle===t?{...u,isFollowing:o}:u)}))}:b)})}function Bz(e,t,o){const n=l0.replyChain(null);e.setQueriesData(n,r=>{if(!r)return r;const a=i=>i.id===t?{...i,likedByMe:o,likeCount:Math.max(o?(i.likeCount||0)+1:(i.likeCount||0)-1,0)}:i;return{...r,post:a(r.post),ancestors:{...r.ancestors,chain:r.ancestors.chain.map(a)},children:r.children.map(i=>({...i,post:a(i.post),chain:i.chain.map(a)}))}}),e.setQueryData(l0.account("index"),r=>r&&{...r,likedCount:Math.max(0,r.likedCount+(o?1:-1))})}function _z(e,t,o,n){const r=l0.notifications(t);e.setQueriesData({queryKey:r},a=>{if(!a||!a.pages)return a;try{return{...a,pages:a.pages.map(i=>!i||!i.notifications?i:{...i,notifications:i.notifications.map(b=>!b||!b.post?b:b.post.id===o?{...b,post:{...b.post,likedByMe:n,likeCount:Math.max(n?b.post.likeCount+1:b.post.likeCount-1,0)}}:b)})}}catch{return a}})}function Ez(e,t,o,n){const r=l0.notifications(t);e.setQueriesData({queryKey:r},a=>{if(!a||!a.pages)return a;try{return{...a,pages:a.pages.map(i=>!i||!i.notifications?i:{...i,notifications:i.notifications.map(b=>!b||!b.post?b:b.post.id===o?{...b,post:{...b.post,repostedByMe:n,repostCount:Math.max(n?b.post.repostCount+1:b.post.repostCount-1,0)}}:b)})}}catch{return a}})}function Sz(e,t,o,n){const r=l0.notifications(t);e.setQueriesData({queryKey:r},a=>{if(!a||!a.pages)return a;try{return{...a,pages:a.pages.map(i=>!i||!i.notifications?i:{...i,notifications:i.notifications.map(b=>!b||!b.post?b:b.post.id===o?{...b,post:{...b.post,replyCount:Math.max((b.post.replyCount??0)+n,0)}}:b)})}}catch{return a}})}function uA(e,t,o){const n=[l0.feed,l0.inbox,l0.discoveryFeed,l0.profilePosts("index"),l0.postsLikedByAccount];for(const r of n)e.setQueriesData(r,a=>a&&{...a,pages:a.pages.map(i=>({...i,posts:i.posts.map(b=>b.object.id===t?{...b,object:{...b.object,replyCount:Math.max((b.object.replyCount??0)+o,0)}}:b)}))})}function dA(e,t,o){const n=l0.replyChain(null);e.setQueriesData({queryKey:n,exact:!1},r=>{if(!r)return r;const a=i=>i.id===t?{...i,replyCount:Math.max((i.replyCount||0)+o,0)}:i;return{...r,post:a(r.post),ancestors:{...r.ancestors,chain:r.ancestors.chain.map(a)},children:r.children.map(i=>({...i,post:a(i.post),chain:i.chain.map(a)}))}})}function Qc0(e){return Q2({queryKey:l0.blockedAccounts(e),refetchOnMount:"always",async queryFn({pageParam:t}){const o=await c1();return a1(e,o).getBlockedAccounts(t)},getNextPageParam(t){return t.next}})}function Zc0(e){return Q2({queryKey:l0.blockedDomains(e),refetchOnMount:"always",async queryFn({pageParam:t}){const o=await c1();return a1(e,o).getBlockedDomains(t)},getNextPageParam(t){return t.next}})}function Nn0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).like(o)},onMutate:o=>{Nz(t,o,!0),Bz(t,o,!0),_z(t,e,o,!0)},onError(o,n){Nz(t,n,!1),Bz(t,n,!1),_z(t,e,n,!1),o.statusCode===403&&Y3(),o.statusCode===429&&He()}})}function Bn0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).unlike(o)},onMutate:o=>{Nz(t,o,!1),Bz(t,o,!1),_z(t,e,o,!1)},onError(o){o.statusCode===429&&He()}})}function Gc0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).blockDomain(new URL(o.url))},onMutate:o=>{o.handle&&t.setQueryData(l0.account(o.handle),n=>n&&{...n,domainBlockedByMe:!0,followedByMe:!1,followsMe:!1})},onError(o){o.statusCode===429&&He()}})}function Kc0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).unblockDomain(new URL(o.url))},onMutate:o=>{o.handle&&t.setQueryData(l0.account(o.handle),n=>n&&{...n,domainBlockedByMe:!1})},onError(o){o.statusCode===429&&He()}})}function Yc0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).block(new URL(o.apId))},onMutate:o=>{t.setQueryData(l0.account(o.handle),n=>n&&{...n,blockedByMe:!0,followedByMe:!1,followsMe:!1}),t.invalidateQueries({queryKey:l0.feed}),t.invalidateQueries({queryKey:l0.inbox}),t.invalidateQueries({queryKey:l0.discoveryFeed})},onError(o){o.statusCode===429&&He()}})}function Jc0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).unblock(new URL(o.apId))},onMutate:o=>{t.setQueryData(l0.account(o.handle),n=>n&&{...n,blockedByMe:!1})},onError(o){o.statusCode===429&&He()}})}function Tz(e,t,o){const n=[l0.feed,l0.inbox,l0.discoveryFeed,l0.profilePosts(null)];for(const r of n)e.setQueriesData(r,a=>a===void 0?a:{...a,pages:a.pages.map(i=>({...i,posts:i.posts.map(b=>b.object.id===t?{...b,object:{...b.object,reposted:o,repostCount:Math.max(o?b.object.repostCount+1:b.object.repostCount-1,0)}}:b)}))})}function Pz(e,t,o){const n=l0.replyChain(null);e.setQueriesData(n,r=>{if(!r)return r;const a=i=>i.id===t?{...i,repostedByMe:o,repostCount:Math.max(o?(i.repostCount||0)+1:(i.repostCount||0)-1,0)}:i;return{...r,post:a(r.post),ancestors:{...r.ancestors,chain:r.ancestors.chain.map(a)},children:r.children.map(i=>({...i,post:a(i.post),chain:i.chain.map(a)}))}})}function _n0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).repost(o)},onMutate:o=>{Tz(t,o,!0),Pz(t,o,!0),Ez(t,e,o,!0)},onError(o,n){Tz(t,n,!1),Pz(t,n,!1),Ez(t,e,n,!1),o.statusCode===403&&Y3(),o.statusCode===429&&He()}})}function En0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).derepost(o)},onMutate:o=>{Tz(t,o,!1),Pz(t,o,!1),Ez(t,e,o,!1)},onError(o){o.statusCode===429&&He()}})}function Sn0(e){return L2({queryKey:l0.user(e),async queryFn(){const t=await c1();return a1(e,t).getUser()}})}function e5(e,t,o){const n=f1();return Y1({async mutationFn(r){const a=await c1();return a1(e,a).unfollow(r)},onSuccess(r,a){const i=l0.account(a==="me"?"index":a);n.setQueryData(i,h=>h&&{...h,followedByMe:!1,followerCount:h.followerCount-1<0?0:h.followerCount-1});const b=l0.accountFollows(a,"followers");n.setQueryData(b,h=>{if(!h?.pages?.[0])return h;const q=n.getQueryData(l0.account("index"));return q?{...h,pages:h.pages.map(g=>({...g,accounts:g.accounts.filter(W=>W.name!==q.name)}))}:h});const l=l0.account("index");n.setQueryData(l,h=>h&&{...h,followingCount:h.followingCount-1});const O=l0.accountFollows("me","following");n.getQueryData(O)?n.setQueryData(O,h=>h?.pages?{...h,pages:h.pages.map(q=>({...q,accounts:q.accounts.filter(g=>g.handle!==a)}))}:h):n.invalidateQueries({queryKey:O}),ov(n,a,!1),n.setQueryData(l0.exploreProfiles(e),h=>{if(!h)return h;const q=h.pages.map(g=>{const W=Object.entries(g.results).reduce((v,[y,x])=>{const k=x.sites.map(L=>L.handle===a?{...L,followedByMe:!1,followerCount:Math.max(0,L.followerCount-1)}:L);return v[y]={...x,sites:k},v},{});return{...g,results:W}});return{...h,pages:q}}),n.setQueriesData({queryKey:["suggested_profiles"],exact:!1},h=>h&&h.map(q=>q.handle===a?{...q,followedByMe:!1,followerCount:Math.max(0,q.followerCount-1)}:q)),tv(n,e,a,!1),t()},onError:r=>{r.statusCode===429&&He(),o()}})}function t5(e,t,o){const n=f1();return Y1({async mutationFn(r){const a=await c1();return a1(e,a).follow(r)},onSuccess(r,a){const i=l0.account(a==="me"?"index":a);n.setQueryData(i,h=>h&&{...h,followedByMe:!0,followerCount:h.followerCount+1});const b=l0.account("index");n.setQueryData(b,h=>h&&{...h,followingCount:h.followingCount+1});const l=l0.accountFollows(a,"followers"),O=l0.accountFollows("me","following");n.getQueryData(O)?n.setQueryData(O,h=>{if(!h?.pages?.[0])return h;const q=n.getQueryData(l0.account(a==="me"?"index":a));if(!q)return h;const g={id:q.id,name:q.name,handle:q.handle,avatarUrl:q.avatarUrl,blockedByMe:q.blockedByMe,domainBlockedByMe:q.domainBlockedByMe,isFollowing:!0};return{...h,pages:[{...h.pages[0],accounts:[g,...h.pages[0].accounts]},...h.pages.slice(1)]}}):n.invalidateQueries({queryKey:O}),ov(n,a,!0),n.setQueryData(l0.exploreProfiles(e),h=>{if(!h)return h;const q=h.pages.map(g=>{const W=Object.entries(g.results).reduce((v,[y,x])=>{const k=x.sites.map(L=>L.handle===a?{...L,followedByMe:!0,followerCount:L.followerCount+1}:L);return v[y]={...x,sites:k},v},{});return{...g,results:W}});return{...h,pages:q}}),n.setQueriesData({queryKey:["suggested_profiles"],exact:!1},h=>h&&h.map(q=>q.handle===a?{...q,followedByMe:!0,followerCount:q.followerCount+1}:q)),n.setQueryData(l,h=>{if(!h?.pages?.[0])return h;const q=n.getQueryData(l0.account("index"));if(!q)return h;const g={id:q.url,type:"Person",preferredUsername:"index",name:q.name,url:q.url,handle:`index@${new URL(q.url).hostname}`,icon:{type:"Image",url:q.avatarUrl},isFollowing:!1};return{...h,pages:[{...h.pages[0],accounts:[g,...h.pages[0].accounts]},...h.pages.slice(1)]}}),tv(n,e,a,!0),t()},onError(r){o(),r.statusCode===429&&He(),r.statusCode===403&&Y3()}})}function Tn0(e,t){const o=f1(),n=l0.searchResults(t);return{searchQuery:L2({queryKey:n,enabled:t.length>0,refetchOnMount:"always",async queryFn(){const i=await c1();return a1(e,i).search(t)}}),updateAccountSearchResult:(i,b)=>{o.setQueryData(n,l=>l&&{...l,accounts:l.accounts.map(u=>u.id===i?{...u,...b}:u)})}}}function hl(e,t,o,n){e.setQueryData(t,r=>r&&{...r,pages:r.pages.map((a,i)=>i===0?{...a,[o]:[n,...a[o]]}:a)})}function Do(e,t,o,n,r){e.setQueryData(t,a=>a&&{...a,pages:a.pages.map(i=>({...i,[o]:i[o].map(b=>b.id===n?r(b):b)}))})}function ql(e,t,o,n){e.setQueryData(t,r=>r&&{...r,pages:r.pages.map(a=>({...a,[o]:a[o].filter(i=>i.id!==n)}))})}function Pn0(e,t){const o=f1();return Y1({async mutationFn({inReplyTo:n,content:r,imageUrl:a,altText:i}){const b=await c1(),l=a1(e,b),u=a?{url:a,altText:i}:void 0;return l.reply(n,r,u)},onMutate:({inReplyTo:n})=>{if(!t)throw new Error("Cannot create reply without actor props");const r=ev();return uA(o,n,1),dA(o,n,1),Sz(o,e,n,1),{id:r}},onSuccess:(n,r)=>{if(n.id===void 0)throw new Error("Activity returned from API has no id");o.invalidateQueries({queryKey:l0.replyChain(r.inReplyTo)})},onError(n,r){console.error(n),uA(o,r.inReplyTo,-1),dA(o,r.inReplyTo,-1),Sz(o,e,r.inReplyTo,-1),n.statusCode===403&&Y3(),n.statusCode===429&&He(),Re.error("An error occurred while sending your reply.")}})}function Xn0(e,t){const o=f1(),n=l0.feed,r=l0.outbox(e),a=l0.profilePosts("index");return Y1({async mutationFn({content:i,imageUrl:b,altText:l}){const u=await c1(),O=a1(e,u),f=b?{url:b,altText:l}:void 0;return O.note(i,f)},onMutate:({content:i,imageUrl:b})=>{if(!t)throw new Error("Cannot create note without actor props");const l=Cn0(i),u=ev(),O=kn0(t,u,l,b);return hl(o,n,"posts",O),hl(o,r,"data",O),hl(o,a,"posts",O),{id:u}},onSuccess:(i,b,l)=>{if(i.id===void 0)throw new Error("Post returned from API has no id");const u=rc(i);Do(o,n,"posts",l?.id??"",()=>u),Do(o,r,"data",l?.id??"",()=>u),Do(o,a,"posts",l?.id??"",()=>u)},onError(i,b,l){console.error(i),ql(o,n,"posts",l?.id??""),ql(o,r,"data",l?.id??""),ql(o,a,"posts",l?.id??""),i.statusCode===429&&He(),Re.error("An error occurred while posting your note.")}})}function o5(e,t,o){const n=o?.enabled!==!1;return L2({queryKey:l0.account(t==="me"?"index":t),enabled:n,async queryFn(){const r=await c1();return a1(e,r).getAccount(t)}})}function ea0(e,t){const o=f1();return Q2({queryKey:l0.accountFollows(e,t),async queryFn({pageParam:n}){const r=await c1(),i=await a1("index",r).getAccountFollows(e,t,n);return i.accounts&&i.accounts.forEach(b=>{o.setQueryData(l0.account(b.handle),b)}),i},getNextPageParam(n){return n.next}})}function ta0(e){const t=l0.feed,o=f1();return{feedQuery:Q2({queryKey:t,enabled:e.enabled,staleTime:60*1e3,async queryFn({pageParam:a}){const i=await c1();return a1("index",i).getFeed(a).then(l=>({posts:l.posts.map(rc),next:l.next}))},getNextPageParam(a){return a.next}}),updateFeedActivity:(a,i)=>{Do(o,t,"posts",a,b=>({...b,...i}))}}}function oa0(e){const t=l0.inbox,o=f1();return{inboxQuery:Q2({queryKey:t,enabled:e.enabled,staleTime:20*1e3,async queryFn({pageParam:a}){const i=await c1();return a1("index",i).getInbox(a).then(l=>({posts:l.posts.map(rc),next:l.next}))},getNextPageParam(a){return a.next}}),updateInboxActivity:(a,i)=>{Do(o,t,"posts",a,b=>({...b,...i}))}}}function na0(e){const t=[...l0.discoveryFeed,e.topic],o=f1();return{discoveryFeedQuery:Q2({queryKey:t,enabled:e.enabled,staleTime:20*1e3,async queryFn({pageParam:a}){const i=await c1();return a1("index",i).getDiscoveryFeed(e.topic,a).then(l=>({posts:l.posts.map(rc),next:l.next}))},getNextPageParam(a){return a.next}}),updateDiscoveryFeedActivity:(a,i)=>{Do(o,t,"posts",a,b=>({...b,...i}))}}}function ra0(e,t){const o=l0.profilePosts(e==="me"?"index":e),n=f1();return{postsByAccountQuery:Q2({queryKey:o,enabled:t.enabled,async queryFn({pageParam:i}){const b=await c1();return a1("index",b).getPostsByAccount(e,i).then(u=>({posts:u.posts.map(rc),next:u.next})).catch(()=>({posts:[],next:null}))},getNextPageParam(i){return i.next}}),updatePostsByAccount:(i,b)=>{Do(n,o,"posts",i,l=>({...l,...b}))}}}function ca0(e){const t=l0.postsLikedByAccount,o=f1();return{postsLikedByAccountQuery:Q2({queryKey:t,enabled:e.enabled,async queryFn({pageParam:a}){const i=await c1();return a1("index",i).getPostsLikedByAccount(a).then(l=>({posts:l.posts.map(rc),next:l.next}))},getNextPageParam(a){return a.next}}),updatePostsLikedByAccount:(a,i)=>{Do(o,t,"posts",a,b=>({...b,...i}))}}}function jn0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).delete(o.id)},onMutate:({id:o,parentId:n})=>{const r=t.getQueryData(l0.feed);t.setQueryData(l0.feed,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.id!==o).map(w=>w.object.id===n?{...w,object:{...w.object,replyCount:w.object.replyCount-1}}:w)}))});const a=t.getQueryData(l0.inbox);t.setQueryData(l0.inbox,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.id!==o).map(w=>w.object.id===n?{...w,object:{...w.object,replyCount:w.object.replyCount-1}}:w)}))}),n&&Sz(t,e,n,-1);const i=l0.outbox(e),b=t.getQueryData(i);t.setQueryData(i,L=>L&&{...L,pages:L.pages.map(C=>({...C,data:C.data.filter(w=>w.object.id!==o)}))});const l=l0.liked(e),u=t.getQueryData(l);let O=!1;t.setQueryData(l,L=>L&&{...L,pages:L.pages.map(C=>(O=C.data.some(w=>w.object.id===o),{...C,data:C.data.filter(w=>w.object.id!==o)}))}),[l0.feed,l0.inbox,l0.discoveryFeed,l0.profilePosts("index"),l0.postsLikedByAccount].some(L=>t.getQueryData(L)?.pages.some(w=>w.posts.some(N=>N.id===o&&N.object.liked)))&&t.setQueryData(l0.account(e),L=>L&&{...L,likedCount:Math.max(0,L.likedCount-1)});const h=l0.profilePosts(null),q=t.getQueriesData(h);t.setQueriesData(h,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.object.id!==o)}))});let g=[],W;O&&(g=l0.account(e),W=t.getQueryData(g),t.setQueryData(g,L=>L&&{...L,likedCount:L.likedCount-1<0?0:L.likedCount-1}));const v=l0.profilePosts("index"),y=t.getQueryData(v);t.setQueryData(v,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.object.id!==o)}))});const x=l0.postsLikedByAccount,k=t.getQueryData(x);return t.setQueryData(x,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.object.id!==o)}))}),n&&t.setQueriesData({queryKey:["reply_chain"],exact:!1},L=>{if(!L)return L;const C=L.children.filter(N=>N.post.id!==o).map(N=>({...N,chain:N.chain.filter(D=>D.id!==o)}));let w=L.post;return L.post.id===n&&(w={...L.post,replyCount:Math.max(0,(L.post.replyCount||0)-1)}),{...L,post:w,children:C}}),{previousFeed:{key:l0.feed,data:r},previousInbox:{key:l0.inbox,data:a},previousOutbox:{key:i,data:b},previousLiked:{key:l,data:u},previousProfilePosts:{key:h,data:q},previousAccount:O?{key:g,data:W}:null,previousPostsByAccount:{key:l0.profilePosts("index"),data:y},previousPostsLikedByAccount:{key:l0.postsLikedByAccount,data:k}}},onError:(o,n,r)=>{r&&(t.setQueryData(r.previousFeed.key,r.previousFeed.data),t.setQueryData(r.previousInbox.key,r.previousInbox.data),t.setQueryData(r.previousOutbox.key,r.previousOutbox.data),t.setQueryData(r.previousLiked.key,r.previousLiked.data),t.setQueriesData(r.previousProfilePosts.key,r.previousProfilePosts.data),r.previousAccount&&t.setQueryData(r.previousAccount.key,r.previousAccount.data),r.previousPostsByAccount&&t.setQueryData(l0.profilePosts("index"),r.previousPostsByAccount),r.previousPostsLikedByAccount&&t.setQueryData(l0.postsLikedByAccount,r.previousPostsLikedByAccount))},onSuccess:(o,{parentId:n})=>{t.invalidateQueries({queryKey:["reply_chain"]}),n&&(t.invalidateQueries({queryKey:l0.feed}),t.invalidateQueries({queryKey:l0.inbox}))}})}function aa0(e){return Q2({queryKey:l0.notifications(e),async queryFn({pageParam:t}){const o=await c1();return a1(e,o).getNotifications(t)},getNextPageParam(t){return t.next}})}function sa0(e,t){const o=L2({queryKey:l0.replyChain(t),enabled:!!t,async queryFn(){if(!t)throw new Error("Post ID is required");const O=await c1(),f=a1(e,O);try{return await f.getReplies(t)}catch(h){if(Ln0(h)&&h.statusCode===404)return await f.getPost(t),await f.getReplies(t);throw h}}}),[n,r]=p.useState(null),[a,i]=p.useState(null);p.useEffect(()=>{o.data?r(o.data):o.error&&i(o.error)},[o.data,o.error]);const b=p.useCallback(async()=>{if(!(!n?.ancestors.hasMore||!n?.ancestors.chain[0]))try{const O=await c1(),h=await a1(e,O).getReplies(n.ancestors.chain[0].id);r(q=>q&&{...q,ancestors:{chain:[...h.ancestors.chain,...q.ancestors.chain],hasMore:h.ancestors.hasMore}})}catch(O){i(O instanceof Error?O:new Error("Failed to load more ancestors"))}},[e,n?.ancestors.hasMore,n?.ancestors.chain]),l=p.useCallback(async()=>{if(n?.next&&t)try{const O=await c1(),h=await a1(e,O).getReplies(t,n.next);r(q=>q&&{...q,children:[...q.children,...h.children],next:h.next})}catch(O){i(O instanceof Error?O:new Error("Failed to load more children"))}},[e,n?.next,t]),u=p.useCallback(async O=>{if(n?.children[O]?.hasMore)try{const f=await c1(),h=a1(e,f),q=n.children[O],g=q.chain.length>1?q.chain[q.chain.length-2]:q.post,W=await h.getReplies(g.id),v=W.children[0].chain;r(y=>{if(!y)return y;const x=[...y.children];return x[O]={...q,chain:[...q.chain,...v],hasMore:W.children[0].hasMore},{...y,children:x}})}catch(f){i(f instanceof Error?f:new Error("Failed to load more child replies"))}},[e,n]);return{data:n,isLoading:o.isLoading,error:a,loadMoreAncestors:b,loadMoreChildren:l,loadMoreChildReplies:u,hasMoreAncestors:!!n?.ancestors.hasMore,hasMoreChildren:!!n?.next,hasMoreChildReplies:O=>!!n?.children[O]?.hasMore}}function ia0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).updateAccount(o)},onSuccess(){t.invalidateQueries({queryKey:l0.account("index")})}})}async function Dn0(e){const t=await c1();return a1("index",t).upload(e)}function nv(e,t=!0){const o=p.useCallback(async()=>await c1(),[]),n=p.useCallback(async()=>{const r=await o();return a1(e,r)},[e,o]);return L2({queryKey:l0.notificationsCount(e),enabled:t,async queryFn(){return(await(await n()).getNotificationsCount()).count}})}function In0(e){const t=f1(),o=p.useCallback(async()=>await c1(),[]),n=p.useCallback(async()=>{const r=await o();return a1(e,r)},[e,o]);return Y1({async mutationFn(){return t.setQueryData(l0.notificationsCount(e),0),(await n()).resetNotificationsCount()}})}function pa0(e,t){const o=f1(),n=[...l0.exploreProfiles(e),t];return{exploreProfilesQuery:Q2({queryKey:n,staleTime:3600*1e3,async queryFn({pageParam:i}){const b=await c1(),u=await a1(e,b).getExploreAccounts(t,i);return u.accounts.forEach(O=>{o.setQueryData(l0.account(O.handle),O)}),{accounts:u.accounts,next:u.next}},getNextPageParam(i){return i.next}}),updateExploreProfile:(i,b)=>{o.setQueryData(n,l=>{if(!l)return l;const u=l.pages.map(O=>{const f=O.accounts.map(h=>h.id===i?{...h,...b}:h);return{...O,accounts:f}});return{...l,pages:u}})}}}function n5(e,t=3){const o=f1(),n=l0.suggestedProfiles(e,t);return{suggestedProfilesQuery:L2({queryKey:n,async queryFn(){const i=await c1(),u=(await a1("index",i).getRecommendations(t)).accounts;return u.length>0&&u.forEach(O=>{o.setQueryData(l0.account(O.handle),O)}),u.length>0?u:null},retry:!1,staleTime:3600*1e3}),updateSuggestedProfile:(i,b)=>{o.setQueryData(n,l=>l&&l.map(u=>u.id===i?{...u,...b}:u))}}}function r5(){return{topicsQuery:L2({queryKey:l0.topics(),async queryFn(){const t=await c1();return a1("index",t).getTopics()},staleTime:864e5,retry:!1})}}function c5(e,t){const o=l0.account("index");e.setQueryData(o,n=>n&&{...n,...t})}function Ma0(e){const t=f1();return Y1({async mutationFn(){const o=await c1();return a1(e,o).enableBluesky()},onSuccess(){c5(t,{blueskyEnabled:!0,blueskyHandleConfirmed:!1,blueskyHandle:null}),t.invalidateQueries({queryKey:l0.accountFollows("index","following")})},onError(o){o.statusCode===429&&He()}})}function ba0(e){const t=f1();return Y1({async mutationFn(){const o=await c1();return a1(e,o).disableBluesky()},onSuccess(){c5(t,{blueskyEnabled:!1,blueskyHandleConfirmed:!1,blueskyHandle:null}),t.invalidateQueries({queryKey:l0.accountFollows("index","following")})},onError(o){o.statusCode===429&&He()}})}function la0(e){const t=f1();return Y1({async mutationFn(){const o=await c1();return a1(e,o).confirmBlueskyHandle()},onSuccess(o){o!==""&&c5(t,{blueskyEnabled:!0,blueskyHandleConfirmed:!0,blueskyHandle:o})},onError(o){o.statusCode===429&&He()}})}let Fi=null;const OA=({onFollow:e,onUnfollow:t,authorHandle:o,followedByMe:n})=>{const[,r]=b0.useReducer(l=>l+1,0),i=Fi===o&&!n,b=l=>{i?(t(l),setTimeout(()=>{Fi=null,r()},0)):(Fi=o,r(),e(l))};return z.jsx(o1,{className:"absolute -right-1.5 bottom-px z-10 flex size-4 items-center justify-center rounded-full p-0 outline outline-2 outline-white transition-transform hover:scale-105 active:scale-100 dark:outline-black",title:i?"Unfollow":"Follow",onClick:b,children:i?z.jsx(c9,{className:"-mb-px !size-3 !stroke-[2.4]"}):z.jsx(i9,{className:"!size-[14px] !stroke-2"})})},Xo=({author:e,size:t,isLoading:o=!1,disabled:n=!1,className:r="",showFollowButton:a=!1})=>{let i=20,b=`shrink-0 items-center justify-center rounded-full relative z-10 flex bg-black/5 dark:bg-gray-900 ${t==="lg"||n?"":"cursor-pointer"} ${r}`,l="z-10 object-cover rounded-full outline outline-[0.5px] outline-offset-[-0.5px] outline-black/10";const[u,O]=p.useState(e?.icon?.url),f=Jt(),h=t5("index",()=>{Re.success(`Followed ${e?.name}`)},()=>{Re.error("Failed to follow")}),q=e5("index",()=>{Re.info(`Unfollowed ${e?.name}`)},()=>{Re.error("Failed to unfollow")});switch(p.useEffect(()=>{O(e?.icon?.url)},[e?.icon?.url]),t){case"2xs":i=10,b=Z1("size-4",b),l=Z1("size-4",l);break;case"xs":i=12,b=Z1("size-6",b),l=Z1("size-6",l);break;case"notification":i=16,b=Z1("size-9",b),l=Z1("size-9",l);break;case"sm":b=Z1("size-10",b),l=Z1("size-10",l);break;case"md":b=Z1("size-[60px]",b),l=Z1("size-[60px]",l);break;case"lg":i=32,b=Z1("size-22",b),l=Z1("size-22",l);break;default:b=Z1("size-10",b),l=Z1("size-10",l);break}if(!e||o)return z.jsx(w1,{className:l,containerClassName:b});const g=e?.handle||Po(e),W=L=>{L.stopPropagation(),f(`/profile/${g}`)},v=L=>{L.stopPropagation(),h.mutate(g)},y=L=>{L.stopPropagation(),q.mutate(g)},k=a||Fi===g;return u?z.jsxs("div",{className:b,onClick:t==="lg"||n?void 0:W,children:[z.jsx("img",{className:l,referrerPolicy:"no-referrer",src:u,onError:()=>O(void 0)}),k&&z.jsx(OA,{authorHandle:g,followedByMe:!1,onFollow:v,onUnfollow:y})]}):z.jsxs("div",{className:b,onClick:n?void 0:W,children:[z.jsx(Od,{className:"text-gray-600",size:i,strokeWidth:1.5}),k&&z.jsx(OA,{authorHandle:g,followedByMe:!1,onFollow:v,onUnfollow:y})]})},ml=({trigger:e,onCopyLink:t,onDelete:o,allowDelete:n=!1,disabled:r=!1,layout:a,followedByMe:i=!1,authoredByMe:b=!1,onFollow:l=()=>{},onUnfollow:u=()=>{}})=>{const O=q=>{q.stopPropagation(),t()},f=q=>{q.stopPropagation(),o()},h=q=>{q.stopPropagation(),i?u():l()};return z.jsxs(yK,{children:[z.jsxs(dJ,{children:[z.jsx(OJ,{disabled:r,asChild:!0,onClick:q=>q.stopPropagation(),children:e}),z.jsx($m,{align:`${a==="modal"?"start":"end"}`,alignOffset:a==="modal"?-12:0,className:"p-2",children:z.jsxs("div",{className:"flex w-48 flex-col",children:[(!n||a==="inbox")&&z.jsx(dl,{asChild:!0,children:z.jsxs(o1,{className:"justify-start",variant:"ghost",onClick:O,children:[z.jsx(FZ,{}),"Copy link"]})}),!b&&z.jsx(dl,{asChild:!0,children:z.jsxs(o1,{className:"justify-start",variant:"ghost",onClick:h,children:[i?z.jsx(gG,{}):z.jsx(vG,{}),i?"Unfollow":"Follow"]})}),n&&z.jsx(wK,{asChild:!0,children:z.jsx(dl,{asChild:!0,children:z.jsxs(o1,{className:"justify-start text-red hover:bg-red/5 hover:text-red",variant:"ghost",onClick:q=>q.stopPropagation(),children:[z.jsx(l9,{}),"Delete"]})})})]})})]}),z.jsxs(O9,{onClick:q=>q.stopPropagation(),children:[z.jsxs(f9,{children:[z.jsx(h9,{children:"Delete this post?"}),z.jsx(q9,{children:a==="inbox"?"This will remove the post from the Ghost social web, but it will remain on your website.":z.jsx(z.Fragment,{children:"If you delete this post, you won't be able to restore it."})})]}),z.jsxs(A9,{children:[z.jsx(g9,{onClick:q=>q.stopPropagation(),children:"Cancel"}),z.jsx(m9,{className:u3({variant:"destructive"}),onClick:f,children:"Delete"})]})]})]})};function Fn0(e){const[t,o]=p.useState({images:[],currentIndex:0,isOpen:!1}),n=b=>{const l=s5(b);if(!l)return[];if(Array.isArray(l))return l.map((u,O)=>({url:u.url,alt:u.name||`Image-${O}`}));if(l.mediaType?.startsWith("image/")||l.type==="Image")return[{url:l.url,alt:l.name||"Image"}];if(b.image){let u;if(typeof b.image=="string"?u=b.image:u=b.image?.url,u)return[{url:u,alt:"Image"}]}return[]};return{lightboxState:t,openLightbox:b=>{if(!e)return;const l=n(e),u=l.findIndex(O=>O.url===b);u!==-1&&o({images:l,currentIndex:u,isOpen:!0})},closeLightbox:()=>{o(b=>({...b,isOpen:!1}))},navigateToIndex:b=>{o(l=>({...l,currentIndex:b}))}}}const gl=({images:e,currentIndex:t,isOpen:o,onClose:n,onNavigate:r})=>{const a=t===0,i=t===e.length-1,b=p.useCallback(()=>{if(e.length<=1||i)return;const u=(t+1)%e.length;r(u)},[e.length,i,t,r]),l=p.useCallback(()=>{if(e.length<=1||a)return;const u=(t-1+e.length)%e.length;r(u)},[e.length,a,t,r]);return p.useEffect(()=>{const u=O=>{o&&(O.key==="ArrowRight"&&!i?b():O.key==="ArrowLeft"&&!a&&l())};return window.addEventListener("keydown",u),()=>{window.removeEventListener("keydown",u)}},[o,t,e.length,b,l,i,a]),!o||e.length===0?null:z.jsx(m3,{open:o,onOpenChange:u=>{u||n()},children:z.jsxs(Ta,{className:"top-[50%] h-[100vh] max-h-[100vh] w-[100vw] max-w-[100vw] translate-y-[-50%] items-center border-none bg-transparent p-0 shadow-none data-[state=closed]:zoom-out-100 data-[state=open]:zoom-in-100 data-[state=closed]:slide-out-to-top-[50%] data-[state=open]:slide-in-from-top-[50%]",onClick:()=>n(),children:[z.jsx("img",{alt:e[t].alt,className:"mx-auto max-h-[90vh] max-w-[90vw] object-contain",src:e[t].url,onClick:u=>u.stopPropagation()}),e.length>1&&z.jsxs(z.Fragment,{children:[z.jsxs(o1,{className:"absolute left-5 top-1/2 size-11 -translate-y-1/2 rounded-full bg-black/50 p-0 pr-0.5 hover:bg-black/70",disabled:a,onClick:u=>{u.stopPropagation(),l()},children:[z.jsx(dZ,{className:"!size-6"}),z.jsx("span",{className:"sr-only",children:"Previous image"})]}),z.jsxs(o1,{className:"absolute right-5 top-1/2 size-11 -translate-y-1/2 rounded-full bg-black/50 p-0 pl-0.5 hover:bg-black/70",disabled:i,onClick:u=>{u.stopPropagation(),b()},children:[z.jsx(ld,{className:"!size-6"}),z.jsx("span",{className:"sr-only",children:"Next image"})]})]}),z.jsx(eY,{asChild:!0,children:z.jsxs(o1,{className:"absolute right-5 top-5 size-11 rounded-full bg-black/50 p-0 hover:bg-black/70",children:[z.jsx(Ad,{className:"!size-5"}),z.jsx("span",{className:"sr-only",children:"Close"})]})})]})})},fA=()=>{},a5=({className:e,following:t,handle:o,variant:n="default",onFollow:r=fA,onUnfollow:a=fA,"data-testid":i})=>{const[b,l]=p.useState(t),u=e5("index",()=>{},()=>{l(!0)}),O=t5("index",()=>{},()=>{l(!1)}),f=async()=>{b?(l(!1),a(),u.mutate(o)):(l(!0),r(),O.mutate(o))};p.useEffect(()=>{l(t)},[t]);const h=b?"Following":"Follow";return n==="link"?z.jsx(o1,{className:Z1("p-0 font-medium",b?"text-gray-700 hover:text-black dark:text-gray-600 dark:hover:text-white":"text-purple hover:text-black dark:hover:text-white",e),"data-testid":i,variant:"link",onClick:q=>{q?.preventDefault(),q?.stopPropagation(),f()},children:h}):z.jsx(o1,{className:Z1("min-w-[90px]",e),"data-testid":i,title:b?"Click to unfollow":"",variant:b?"outline":"default",onClick:q=>{q?.preventDefault(),q?.stopPropagation(),f()},children:h})};function Xz(e,t=[]){if(t.length===0)return e.replace(/<br\s*\/?>/gi," ").replace(/<\/p>\s*<p>|<\/div>\s*<div>|<\/h[1-6]>\s*<|<\/li>\s*<li>|<\/a>/gi," ").replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim();const o=t.map(u=>u.toLowerCase()),n={};let r=0,i=e.replace(/<\/(h[1-6]|p|div|li|blockquote|pre)>/gi,"<br>");for(const u of o){const O=new RegExp(`<${u}[^>]*>.*?<\\/${u}>|<${u}[^>]*\\/?>`,"gis");i=i.replace(O,f=>{const h=`__EXCLUDED_TAG_${r+=1}__`;return n[h]=f,h})}let b=i;o.includes("br")||(b=i.replace(/<br\s*\/?>/gi," "));let l=b.replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim();for(const[u,O]of Object.entries(n))l=l.replace(u,O);return l}const Hi=e=>{const t=document.createElement("div");t.innerHTML=e;const o=t.getElementsByTagName("a");for(let n=0;n<o.length;n++)(o[n].getAttribute("href")||"").match(/^\s*(javascript|data|vbscript):/i)&&o[n].removeAttribute("href"),o[n].setAttribute("target","_blank"),o[n].setAttribute("rel","noopener noreferrer");return t.innerHTML},AA=e=>"preferredUsername"in e,Eo=({actor:e,children:t,disabled:o=!1,side:n="bottom",align:r="start",isCurrentUser:a=!1})=>{const[i,b]=p.useState(!1),l=Jt();let u=e?.handle;!u&&e&&AA(e)&&(u=Po(e));const O=o||!u&&!e,f=o5("index",u||"",{enabled:i&&!!u}),h=f.isFetching||f.isLoading,q=f.error,g=f.data?typeof f.data.followerCount=="number"&&typeof f.data.followingCount=="number"&&f.data.bio!==void 0:!1;if(p.useEffect(()=>{!i||!u||!g&&!h&&!q&&f.refetch({cancelRefetch:!1})},[f,h,q,g,i,u]),O)return z.jsx(z.Fragment,{children:t});const v=f.data||e,y=v?.handle??u??"",x=v?.name??"",k=v?.avatarUrl??(e&&AA(e)?e.icon?.url:null)??null,L=!!v?.followsMe,C=typeof v?.followingCount=="number"?v.followingCount:Number(v?.followingCount)||0,w=typeof v?.followerCount=="number"?v.followerCount:Number(v?.followerCount)||0,N=v?.bio?Hi(Xz(v.bio,["a"])):void 0,D=()=>{y&&l(`/profile/${y}`)},Y=()=>{y&&l(`/profile/${y}/following`)},V=()=>{y&&l(`/profile/${y}/followers`)};return z.jsxs(F00,{onOpenChange:b,children:[z.jsx(H00,{asChild:!0,children:t}),z.jsx(Hg,{align:r,className:"w-[320px] cursor-default rounded-2xl border-0 p-5 text-left text-gray-900 shadow-[0_5px_24px_0px_rgba(0,0,0,0.02),0px_2px_5px_0px_rgba(0,0,0,0.07),0px_0px_1px_0px_rgba(0,0,0,0.25)] outline-none dark:bg-[#101114] dark:shadow-none",side:n,sideOffset:12,onClick:J=>J.stopPropagation(),children:z.jsxs("div",{className:"flex flex-col gap-2",children:[z.jsxs("div",{className:"flex flex-col gap-2",children:[z.jsxs("div",{className:"flex justify-between",children:[z.jsxs(hd,{className:"size-14 cursor-pointer",onClick:D,children:[k&&z.jsx(qd,{alt:x,className:"rounded-full outline outline-[0.5px] outline-offset-[-0.5px] outline-black/10",src:k,onError:J=>{J.target.src="",J.target.style.display="none"}}),z.jsx(md,{className:"bg-gray-200 text-sm font-semibold text-gray-700 dark:bg-gray-800 dark:text-gray-200",children:z.jsx(Od,{className:"size-5 text-gray-500 dark:text-gray-400",strokeWidth:1.5})})]}),!a&&z.jsx(a5,{following:!!v?.followedByMe,handle:y,type:"primary"})]}),z.jsxs("div",{className:"flex cursor-pointer flex-col items-start",onClick:D,children:[z.jsx(nW,{className:"w-full truncate",children:x}),z.jsxs("div",{className:"flex w-full gap-2",children:[z.jsx("span",{className:"truncate text-gray-700 dark:text-gray-600",children:y}),L&&!a&&z.jsx(CK,{className:"mt-px whitespace-nowrap",variant:"secondary",children:"Follows you"})]})]})]}),z.jsx("div",{className:"flex gap-3 dark:text-gray-300",children:h?z.jsx(w1,{className:"h-4 w-32"}):!q&&z.jsxs(z.Fragment,{children:[z.jsxs("span",{className:"cursor-pointer hover:underline",onClick:Y,children:[z.jsx("span",{className:"font-bold text-black dark:text-white",children:Cf(C)})," ","Following"]}),z.jsxs("span",{className:"cursor-pointer hover:underline",onClick:V,children:[z.jsx("span",{className:"font-bold text-black dark:text-white",children:Cf(w)})," ","Followers"]})]})}),h?z.jsx(w1,{className:"h-4 w-48"}):!q&&N?z.jsx("div",{dangerouslySetInnerHTML:{__html:N},className:"leading-tight dark:text-gray-300 [&_.invisible]:hidden [&_a:hover]:underline [&_a]:text-[#00a4eb]"}):null]})})]})},rv=(e={})=>{const[t,o]=p.useState(!1),n=we();return p.useEffect(()=>{const r=a=>{if(a.target instanceof HTMLInputElement||a.target instanceof HTMLTextAreaElement||a.target instanceof HTMLElement&&a.target.isContentEditable||a.target instanceof HTMLSelectElement||a.metaKey||a.ctrlKey||a.altKey||a.shiftKey)return;const i=document.querySelector('[role="dialog"][data-state="open"]');if(!(i&&!(e.componentRef?.current?.closest('[role="dialog"]')===i)))switch(a.key.toLowerCase()){case"n":i||(a.preventDefault(),e.onOpenNewNote?e.onOpenNewNote():o(!0));break;case"r":e.isReplyAvailable&&e.onOpenReply&&(n.pathname.includes("/notes/")||n.pathname.includes("/reader/"))&&(a.preventDefault(),e.onOpenReply());break}};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,n.pathname]),{isNewNoteModalOpen:t,setIsNewNoteModalOpen:o}},Ri=({actor:e,object:t,likeCount:o,commentCount:n,repostCount:r,layout:a,disabled:i=!1,buttonClassName:b="",onLikeClick:l,onCommentClick:u,onReplyCountChange:O})=>{const[f,h]=p.useState(t.liked),[q,g]=p.useState(t.reposted),[W,v]=p.useState(!1),y=p.useRef(null);rv({isReplyAvailable:!u&&a!=="reply",onOpenReply:()=>v(!0),componentRef:y}),p.useEffect(()=>{h(t.liked),g(t.reposted)},[t.liked,t.reposted]),p.useEffect(()=>{N(r)},[r]);const x=Nn0("index"),k=Bn0("index"),L=_n0("index"),C=En0("index"),[w,N]=p.useState(r),D=async J=>{J.stopPropagation(),f?k.mutate(t.id):x.mutate(t.id,{onError(){h(!1)}}),h(!f),l()},Y=J=>{J.stopPropagation(),u?u():v(!0)},V=`px-2 gap-1.5 font-normal text-md [&_svg]:size-[18px] transition-color ap-action-button text-gray-900 hover:text-gray-900 hover:bg-black/[3%] dark:bg-black dark:hover:bg-gray-950 dark:text-gray-600 ${b}`;return z.jsxs(z.Fragment,{children:[z.jsxs("div",{ref:y,className:`flex ${a!=="inbox"&&"gap-1"}`,children:[z.jsxs(o1,{className:`${V} ${f&&"text-pink-500 hover:text-pink-500"}`,"data-testid":"like-button",disabled:i,id:"like",title:`${f?"Undo like":"Like"}`,variant:"ghost",onClick:J=>{J?.stopPropagation(),J&&D(J)},children:[z.jsx(TZ,{className:`${f&&"fill-pink-500 text-pink-500"}`}),a!=="inbox"&&z.jsx(Tf,{className:o===0?"-ml-1.5 w-0 overflow-hidden":"",spinTiming:{duration:300},value:o})]}),z.jsxs(o1,{className:`${V}`,"data-testid":"reply-button",disabled:i,id:"comment",title:"Reply",variant:"ghost",onClick:Y,children:[z.jsx(ud,{className:"-mr-px"}),a!=="inbox"&&n>0&&bd(n)]}),z.jsxs(o1,{className:`${V} ${q&&"text-green-500 hover:text-green-500"}`,"data-testid":"repost-button",disabled:i,id:"repost",title:`${q?"Undo repost":"Repost"}`,variant:"ghost",onClick:J=>{J?.stopPropagation(),q?(C.mutate(t.id),N(w-1)):(L.mutate(t.id,{onError(){g(!1),N(w-1)}}),N(w+1)),g(!q)},children:[z.jsx(p9,{className:`${q&&"text-green-500"}`}),a!=="inbox"&&z.jsx(Tf,{className:w===0?"-ml-1.5 w-0 overflow-hidden":"",spinTiming:{duration:300},value:w})]})]}),W&&z.jsx(i5,{open:W,replyTo:{object:t,actor:e},onOpenChange:J=>{v(J)},onReply:()=>{O?.(1),v(!1)},onReplyError:()=>{O?.(-1)}})]})};function Hn0(e){const o=e.replace(/<[^>]*>/g,"").split(/\s+/).filter(r=>r.length>0).length;return`${Math.ceil(o/275)} min read`}const Lo=(e,t,o)=>{o?.stopPropagation(),t(typeof e=="string"?`/profile/${e}`:`/profile/${e.handle||Po(e)}`)},Un0=e=>{const t=new Date,o=i=>new Date(i.getFullYear(),i.getMonth(),i.getDate()),n=o(t),r=o(new Date(t.getTime()-1440*60*1e3)),a=o(e);return a.getTime()===n.getTime()?Vn0(e):a.getTime()===r.getTime()?"Yesterday":$n0(e)},Vn0=e=>{const o=Math.floor((new Date().getTime()-e.getTime())/1e3);if(o<1)return"Just now";if(o<60)return`${o}s`;const n=Math.floor(o/60);return n<60?`${n}m`:`${Math.floor(n/60)}h`},$n0=e=>{const t=new Date,o=e.getDate(),n=e.toLocaleString("default",{month:"short"});return e.getFullYear()===t.getFullYear()?`${o} ${n}`:`${o} ${n} ${e.getFullYear()}`};function Qn0(e){return new Date(e).toLocaleDateString("default",{year:"numeric",month:"short",day:"2-digit"})+", "+new Date(e).toLocaleTimeString("default",{hour:"2-digit",minute:"2-digit"})}function yi(e,t=!0){const o=new Date(e?.published??e?.createdAt??new Date),n=Qn0(o),r=Un0(o);return t&&!e.url?.includes("/.ghost/activitypub")?z.jsx("a",{className:"whitespace-nowrap text-gray-700 hover:underline",href:e.url,rel:"noreferrer",target:"_blank",title:n,onClick:a=>a.stopPropagation(),children:r}):z.jsx("span",{className:"whitespace-nowrap text-gray-700",children:r})}function s5(e){let t;if(e.image&&(t=e.image),e.type==="Note"&&!t&&(t=e.attachment),!t)return null;if(Array.isArray(t)){if(t.length===0)return null;if(t.length===1)return t[0]}return t}function $c(e,t,o,n){const r=s5(e);if(!r)return null;const a=l=>u=>{u.stopPropagation(),t&&t(l)},i=l=>{n&&n(l)},b=(l,u=!1)=>{const O=u?"min-h-[200px]":"";return z.jsx("div",{className:`${l} ${O} flex w-full items-center justify-center bg-gray-100 dark:bg-gray-925/30`,children:z.jsx(XZ,{className:"text-gray-400",size:24,strokeWidth:1.5})})};if(Array.isArray(r)){const l=r.length;let u="";return l===1?u="grid-cols-1":l>=2&&l<=4?u="grid-cols-2 auto-rows-[150px]":l>4&&(u="grid-cols-3 auto-rows-[150px]"),z.jsx("div",{className:`attachment-gallery mt-3 grid w-full ${u} gap-2`,children:r.map((O,f)=>{const h=`size-full rounded-md outline outline-1 -outline-offset-1 outline-black/10 ${l===3&&f===0?"row-span-2":""}`;return o&&o.has(O.url)?b(h,l===1):z.jsx("img",{alt:O.name||`Image-${f}`,className:`${h} cursor-pointer object-cover`,referrerPolicy:"no-referrer",src:O.url,onClick:t?a(O.url):void 0,onError:()=>i(O.url)},O.url)})})}switch(r.mediaType){case"image/jpeg":case"image/png":case"image/gif":case"image/webp":return o&&o.has(r.url)?b(`${e.type==="Article"?"w-full rounded-t-md":"mt-3 max-h-[420px] rounded-md outline outline-1 -outline-offset-1 outline-black/10"}`,!0):z.jsx("img",{alt:r.name||"Image",className:`cursor-pointer ${e.type==="Article"?"w-full rounded-t-md":"mt-3 max-h-[420px] rounded-md outline outline-1 -outline-offset-1 outline-black/10"}`,referrerPolicy:"no-referrer",src:r.url,onClick:t?a(r.url):void 0,onError:()=>i(r.url)});case"video/mp4":case"video/webm":return z.jsx("div",{className:"relative mb-4 mt-3",children:z.jsx("video",{className:"h-[300px] w-full rounded object-cover",src:r.url,controls:!0})});case"audio/mpeg":case"audio/ogg":return z.jsx("div",{className:"relative mb-4 mt-2 w-full",children:z.jsx("audio",{className:"w-full",src:r.url,controls:!0})});default:if(e.image||r.type==="Image"){const l=e.type==="Article"?"cursor-pointer aspect-[16/7.55] w-full rounded-t-md object-cover":"cursor-pointer mt-3 max-h-[420px] rounded-md outline outline-1 -outline-offset-1 outline-black/10";let u;return e.image?typeof e.image=="string"?u=e.image:u=e.image?.url:u=r.url,o&&o.has(u)?b(l,!0):z.jsx("img",{alt:r.name||"Image",className:l,referrerPolicy:"no-referrer",src:u,onClick:t?a(u):void 0,onError:()=>i(u)})}return null}}function Zn0(e,t){const o=s5(e),n="ml-8 md:ml-9 shrink-0 rounded-md h-[91px] w-[121px] relative",r=Z1("object-cover outline outline-1 -outline-offset-1 outline-black/[0.05]",n);if(t)return z.jsx(w1,{className:`${r} outline-0`});if(!o)return null;if(Array.isArray(o))return z.jsx("img",{className:r,referrerPolicy:"no-referrer",src:o[0].url});switch(o.mediaType){case"image/jpeg":case"image/png":case"image/gif":return z.jsx("img",{className:r,referrerPolicy:"no-referrer",src:o.url});case"video/mp4":case"video/webm":return z.jsxs("div",{className:n,children:[z.jsx("video",{className:"h-[80px] w-full rounded object-cover",src:o.url}),z.jsx("div",{className:"absolute inset-0 rounded bg-gray-900 opacity-50"}),z.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:z.jsx(cG,{color:"white",fill:"white",size:40})})]});case"audio/mpeg":case"audio/ogg":return z.jsx("div",{className:"ml-8 w-[120px]",children:z.jsx("div",{className:"relative mb-4 mt-2 w-full",children:z.jsx("audio",{className:"w-full",src:o.url,controls:!0})})});default:return e.image?z.jsx("img",{className:r,referrerPolicy:"no-referrer",src:typeof e.image=="string"?e.image:e.image?.url}):null}}const hA=()=>{},qA=z.jsx(p9,{className:"shrink-0 text-gray-700 dark:text-gray-600",size:16,strokeWidth:1.5}),Gn0=({actor:e,allowDelete:t=!1,object:o,parentId:n=void 0,layout:r,type:a,commentCount:i=0,repostCount:b=0,likeCount:l=0,showHeader:u=!0,last:O,isLoading:f,isPending:h=!1,isCompact:q=!1,isChainContinuation:g=!1,isChainParent:W=!1,onClick:v=hA,onDelete:y=hA,showStats:x=!0})=>{const k=new Date(o?.published??new Date).toLocaleDateString("default",{year:"numeric",month:"short",day:"2-digit"})+", "+new Date(o?.published??new Date).toLocaleTimeString("default",{hour:"2-digit",minute:"2-digit"}),[,L]=p.useState(!1),[C,w]=p.useState(new Set),N=p.useRef(null),[D,Y]=p.useState(!1),V=jn0("index"),J=Jt(),t0=t5("index",()=>{Re.success(`Followed ${X?.name}`)},()=>{Re.error("Failed to follow")}),K=e5("index",()=>{Re.info(`Unfollowed ${X?.name}`)},()=>{Re.error("Failed to unfollow")});p.useEffect(()=>{const j0=N.current;j0&&Y(j0.scrollHeight>j0.clientHeight)},[o?.content]),p.useEffect(()=>{const j0=N.current;if(!j0)return;const p1=S=>{const r0=S.target.closest("a[data-profile]");if(r0){const A0=r0.getAttribute("data-profile")?.trim();/^@([\w.-]+)@([\w-]+\.[\w.-]+[a-zA-Z])$/.test(A0||"")&&A0&&(S.preventDefault(),S.stopPropagation(),Lo(A0,J))}};return j0.addEventListener("click",p1),()=>{j0.removeEventListener("click",p1)}},[J,o?.content]);const a0=()=>{},q0=()=>{h||v()},Z=()=>{V.mutate({id:o.id,parentId:n}),y()},z0=async()=>{o?.url&&(await navigator.clipboard.writeText(o.url),L(!0),Re.success("Link copied"),setTimeout(()=>L(!1),2e3))},U=j0=>{w(p1=>new Set(p1).add(j0))};let X=e;a==="Announce"&&(X=typeof o.attributedTo=="object"?o.attributedTo:e);const G=X?Po(X):null,_=X?.followedByMe||!1,I=a==="Announce"?typeof o.attributedTo=="object"&&o.attributedTo&&!Array.isArray(o.attributedTo)&&"authored"in o.attributedTo?o.attributedTo.authored:typeof o.attributedTo=="object"&&o.attributedTo&&!Array.isArray(o.attributedTo)&&typeof e=="object"&&e&&o.attributedTo.id===e.id:o.authored,i0=a==="Announce"?o.reposted??!1:o.authored,d0=()=>{G&&t0.mutate(G)},m0=()=>{G&&K.mutate(G)},W0=z.jsx(o1,{className:`relative z-10 size-[34px] rounded-md ${r==="inbox"||r==="modal"?"text-gray-900 hover:text-gray-900 dark:text-gray-600 dark:hover:text-gray-600":"text-gray-500 hover:text-gray-500"} dark:bg-black dark:hover:bg-gray-950 [&_svg]:size-5`,"data-testid":"menu-button",variant:"ghost",children:z.jsx(a9,{})}),{lightboxState:s0,openLightbox:e0,closeLightbox:w0,navigateToIndex:x0}=Fn0(o);return r==="feed"?z.jsxs(z.Fragment,{children:[o&&z.jsxs("div",{className:`group/article relative -mx-4 ${h?"pointer-events-none":"cursor-pointer"} rounded-lg p-6 px-4 pb-[18px]`,"data-layout":"feed","data-object-id":o.id,onClick:q0,children:[a==="Announce"&&z.jsxs("div",{className:"z-10 mb-2 flex items-center gap-1.5 text-gray-700 dark:text-gray-600",children:[qA,z.jsxs("div",{className:"flex min-w-0 items-center gap-1 text-sm",children:[z.jsx(Eo,{actor:e,align:"center",isCurrentUser:i0,children:z.jsx("span",{className:"truncate break-anywhere hover:underline",onClick:j0=>{Lo(e,J,j0)},children:e.name})}),"reposted"]})]}),z.jsxs("div",{className:"border-1 flex flex-col gap-2.5","data-test-activity":!0,children:[z.jsxs("div",{className:"flex items-center justify-between",children:[z.jsx(Eo,{actor:X,isCurrentUser:I,children:z.jsxs("div",{className:"flex min-w-0 grow items-center gap-3",children:[z.jsx(Xo,{author:X,disabled:h,showFollowButton:!I&&!_}),z.jsxs("div",{className:"flex min-w-0 grow flex-col",onClick:j0=>{h||Lo(X,J,j0)},children:[z.jsx("span",{className:`min-w-0 truncate font-semibold break-anywhere ${q?"text-lg":"text-md"} ${h?"":"hover-underline"} dark:text-white`,"data-test-activity-heading":!0,children:f?z.jsx(w1,{className:"w-24"}):X.name}),z.jsxs("div",{className:"flex w-full text-md text-gray-700 dark:text-gray-600",children:[z.jsx("span",{className:`truncate ${h?"":"hover-underline"}`,children:f?z.jsx(w1,{className:"w-56"}):Po(X)}),z.jsx("div",{className:`ml-1 before:mr-1 ${!f&&'before:content-["·"]'}`,title:`${k}`,children:f?z.jsx(w1,{className:"w-4"}):yi(o,h===!1&&!o.authored)})]})]})]})}),z.jsx(ml,{allowDelete:t,authoredByMe:I,disabled:h,followedByMe:_,layout:"feed",trigger:W0,onCopyLink:z0,onDelete:Z,onFollow:d0,onUnfollow:m0})]}),z.jsx("div",{className:"relative col-start-2 col-end-3 w-full gap-4 pl-[52px]",children:z.jsxs("div",{className:"flex flex-col",children:[z.jsx("div",{className:"",children:o.type==="Article"?z.jsxs("div",{className:"rounded-md border border-gray-150 transition-colors hover:bg-gray-75 dark:border-gray-950 dark:hover:bg-gray-950",children:[$c(o,q0,C,U),z.jsxs("div",{className:"p-5",children:[z.jsx("div",{className:"mb-1 line-clamp-2 text-pretty text-lg font-semibold leading-tight tracking-tight break-anywhere","data-test-activity-heading":!0,children:o.name}),z.jsx("div",{className:"line-clamp-3 leading-[1.4em] break-anywhere",children:o.preview?.content})]})]}):z.jsxs("div",{className:"relative",children:[z.jsx("div",{className:"ap-note-content line-clamp-[10] text-pretty leading-[1.4285714286] tracking-[-0.006em] text-gray-900 break-anywhere dark:text-gray-300 [&_p+p]:mt-3",children:f?z.jsx(w1,{count:2}):z.jsx("div",{dangerouslySetInnerHTML:{__html:Hi(o.content||"")??""},ref:N,onClick:j0=>{const p1=j0.target;(p1.tagName==="A"||p1.closest("a"))&&j0.stopPropagation()}})}),D&&z.jsx("button",{className:"mt-1 text-blue-600",type:"button",children:"Show more"}),$c(o,e0,C,U)]})}),z.jsx("div",{className:"space-between relative z-[30] ml-[-8px] mt-1 flex",children:f?z.jsx(w1,{className:"ml-2 w-18"}):x&&z.jsx(Ri,{actor:X,commentCount:i,disabled:h,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0})})]})})]})]}),z.jsx(gl,{currentIndex:s0.currentIndex,images:s0.images,isOpen:s0.isOpen,onClose:w0,onNavigate:x0})]}):r==="modal"?z.jsxs(z.Fragment,{children:[o&&z.jsxs("div",{"data-object-id":o.id,children:[z.jsxs("div",{className:"group/article relative","data-layout":"modal",onClick:q0,children:[z.jsxs("div",{className:"z-10 -my-1 grid grid-cols-[auto_1fr] grid-rows-[auto_1fr] gap-3 pb-3 pt-4","data-test-activity":!0,children:[u&&z.jsxs(z.Fragment,{children:[z.jsx("div",{className:"relative z-10 pt-[3px]",children:z.jsx(Xo,{author:X,showFollowButton:!I&&!_})}),z.jsxs("div",{className:"relative z-10 flex w-full min-w-0 cursor-pointer flex-col overflow-visible text-[1.5rem]",onClick:j0=>{h||Lo(X,J,j0)},children:[z.jsxs("div",{className:"flex w-full",children:[z.jsx("span",{className:'min-w-0 truncate whitespace-nowrap font-semibold break-anywhere after:mx-1 after:font-normal after:text-gray-700 after:content-["·"] after:dark:text-gray-600',"data-test-activity-heading":!0,children:X.name}),z.jsx("div",{children:yi(o,!o.authored)})]}),z.jsx("div",{className:"flex w-full",children:z.jsx("span",{className:"min-w-0 truncate text-gray-700 dark:text-gray-600",children:Po(X)})})]})]}),z.jsx("div",{className:"relative z-10 col-start-1 col-end-3 w-full gap-4",children:z.jsxs("div",{className:"flex flex-col items-start",children:[o.name&&z.jsx(v2,{className:"mb-1 leading-tight break-anywhere","data-test-activity-heading":!0,children:o.name}),z.jsx("div",{dangerouslySetInnerHTML:{__html:Hi(o.content||"")??""},ref:N,className:"ap-note-content-large text-pretty text-[1.6rem] tracking-[-0.011em] text-gray-900 break-anywhere dark:text-gray-300 [&_p+p]:mt-3"}),$c(o,e0,C,U),z.jsx("div",{className:"space-between ml-[-8px] mt-3 flex",children:x&&z.jsx(Ri,{actor:X,commentCount:i,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0})})]})})]}),z.jsx("div",{className:"absolute -inset-x-3 -inset-y-0 z-0 rounded transition-colors max-lg:hidden"})]}),z.jsx("div",{className:"mt-3 h-px bg-gray-200 dark:bg-gray-950"})]}),z.jsx(gl,{currentIndex:s0.currentIndex,images:s0.images,isOpen:s0.isOpen,onClose:w0,onNavigate:x0})]}):r==="reply"?z.jsxs(z.Fragment,{children:[o&&z.jsxs("div",{className:`group/article relative ${q?"pb-6":g?"pb-5":"py-5"} ${h?"pointer-events-none":"cursor-pointer"}`,"data-layout":"reply","data-object-id":o.id,onClick:q0,children:[z.jsxs("div",{className:"border-1 flex flex-col gap-2.5 border-b-gray-200","data-test-activity":!0,children:[z.jsxs("div",{className:"flex items-center justify-between",children:[z.jsx(Eo,{actor:X,isCurrentUser:I,children:z.jsxs("div",{className:"flex min-w-0 grow items-center gap-3",children:[z.jsx(Xo,{author:X,disabled:h,showFollowButton:!I&&!_}),z.jsxs("div",{className:"flex min-w-0 grow flex-col",onClick:j0=>{h||Lo(X,J,j0)},children:[z.jsxs("div",{className:"flex",children:[z.jsx("span",{className:'min-w-0 truncate whitespace-nowrap font-semibold text-black break-anywhere after:mx-1 after:font-normal after:text-gray-700 after:content-["·"] dark:text-white',"data-test-activity-heading":!0,children:X.name}),z.jsx("div",{children:yi(o,h===!1&&!o.authored)})]}),z.jsx("div",{className:"flex",children:z.jsx("span",{className:"truncate text-gray-700",children:Po(X)})})]})]})}),!q&&z.jsx(ml,{allowDelete:t,authoredByMe:I,disabled:h,followedByMe:_,layout:"reply",trigger:W0,onCopyLink:z0,onDelete:Z,onFollow:d0,onUnfollow:m0})]}),z.jsx("div",{className:"relative z-10 col-start-2 col-end-3 w-full gap-4 pl-[52px]",children:z.jsxs("div",{className:"flex flex-col items-start",children:[o.type==="Article"&&$c(o,q0,C,U),o.name&&z.jsx(v2,{className:"mt-2.5 text-pretty leading-tight break-anywhere","data-test-activity-heading":!0,children:o.name}),o.preview&&o.type==="Article"?z.jsx("div",{className:"mt-1 line-clamp-3 leading-tight",children:o.preview.content}):z.jsx("div",{dangerouslySetInnerHTML:{__html:Hi(o.content||"")??""},ref:N,className:"ap-note-content text-pretty tracking-[-0.006em] text-gray-900 break-anywhere dark:text-gray-300 [&_p+p]:mt-3"}),o.type==="Note"&&$c(o,e0,C,U),o.type==="Article"&&z.jsx(o1,{className:"mt-3 w-full",id:"read-more",variant:"secondary",children:"Read more"}),!q&&z.jsx("div",{className:"space-between ml-[-8px] mt-2 flex",children:x&&z.jsx(Ri,{actor:X,commentCount:i,disabled:h,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0})})]})})]}),!O&&z.jsx("div",{className:`absolute left-[19px] ${q?"bottom-[8px] top-[51px]":g?"bottom-[5px] top-[51px]":W?"bottom-[5px] top-[71px]":"bottom-[-7px] top-[71px]"} z-0 w-[2px] rounded-sm bg-gray-200 dark:bg-gray-950`})]}),z.jsx(gl,{currentIndex:s0.currentIndex,images:s0.images,isOpen:s0.isOpen,onClose:w0,onNavigate:x0})]}):r==="inbox"?z.jsx(z.Fragment,{children:o&&z.jsxs("div",{className:"group/article relative -mx-4 -my-px flex min-h-[112px] min-w-0 cursor-pointer items-center justify-between rounded-lg p-6 hover:bg-gray-75 dark:hover:bg-gray-950/50","data-layout":"inbox","data-object-id":o.id,onClick:q0,children:[z.jsxs("div",{className:"w-full min-w-0",children:[z.jsx("div",{className:"z-10 mb-1.5 flex w-full min-w-0 items-center gap-1.5 text-sm group-hover/article:border-transparent",children:f?z.jsx(w1,{className:"w-24"}):z.jsxs(z.Fragment,{children:[z.jsx(Eo,{actor:X,isCurrentUser:I,children:z.jsxs("div",{className:"flex items-center gap-1",children:[z.jsx(Xo,{author:X,size:"2xs"}),z.jsx("span",{className:"min-w-0 font-semibold text-gray-900 break-anywhere hover:underline dark:text-gray-600","data-test-activity-heading":!0,onClick:j0=>{Lo(X,J,j0)},children:X.name})]})}),a==="Announce"&&z.jsxs("span",{className:"z-10 flex items-center gap-1 text-gray-700 dark:text-gray-600",children:[qA,z.jsx(Eo,{actor:e,align:"center",isCurrentUser:i0,children:z.jsx("span",{className:"line-clamp-1 hover:underline",onClick:j0=>{Lo(e,J,j0)},children:e.name})})," reposted"]}),z.jsx("span",{className:'shrink-0 whitespace-nowrap text-gray-600 before:mr-1 before:content-["·"]',title:`${k}`,children:yi(o,!o.authored)})]})}),z.jsxs("div",{className:"flex",children:[z.jsxs("div",{className:"flex min-h-[73px] w-full min-w-0 flex-col items-start justify-start gap-1",children:[z.jsx(v2,{className:"line-clamp-2 w-full max-w-[600px] text-pretty leading-tight break-anywhere","data-test-activity-heading":!0,children:f?z.jsx(w1,{className:"w-full max-w-96"}):o.name?o.name:z.jsx("span",{dangerouslySetInnerHTML:{__html:Xz(o.content||"")}})}),z.jsx("div",{className:"ap-note-content line-clamp-2 w-full max-w-[600px] text-pretty text-base leading-normal text-gray-900 break-anywhere dark:text-gray-300 [&_p+p]:mt-3",children:f?z.jsx(w1,{count:2}):z.jsx("div",{dangerouslySetInnerHTML:{__html:Xz(o.preview?.content??o.content??"")}})}),z.jsx("span",{className:"mt-1 shrink-0 whitespace-nowrap text-sm leading-none text-gray-600",children:f?z.jsx(w1,{className:"w-16"}):o.content&&`${Hn0(o.content)}`})]}),z.jsxs("div",{className:"invisible absolute right-3 top-8 z-[49] flex -translate-y-1/2 rounded-lg bg-white p-1 shadow-md group-hover/article:visible dark:bg-black",children:[x&&z.jsx(Ri,{actor:X,commentCount:i,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0}),z.jsx(ml,{allowDelete:t,authoredByMe:I,followedByMe:_,layout:"inbox",trigger:W0,onCopyLink:z0,onDelete:Z,onFollow:d0,onUnfollow:m0})]})]})]}),Zn0(o,f)]})}):z.jsx(z.Fragment,{})},mA=5*1024*1024,gA="Image must be less than 5MB in size.",za0=async e=>{try{const t=await fetch(e,{mode:"cors"});if(!t.ok)throw new Error(`Failed to fetch image: ${t.status}`);const o=await t.blob();return new Promise((n,r)=>{const a=new FileReader;a.onload=()=>n(a.result),a.onerror=r,a.readAsDataURL(o)})}catch{return e}},ua0=e=>new Promise(t=>{const o=new Image;o.onload=()=>{URL.revokeObjectURL(o.src),t(o.width===o.height)},o.src=URL.createObjectURL(e)}),da0="Image must be square.",i5=({children:e,replyTo:t,onReply:o,onReplyError:n,onOpenChange:r,...a})=>{const{data:i}=Sn0("index"),b=Xn0("index",i),l=Pn0("index",i),{data:u,isLoading:O}=o5("index","me"),[f,h]=p.useState(!1),q=p.useRef(null),g=p.useRef(null),[W,v]=p.useState(null),[y,x]=p.useState(!1),k=p.useRef(null),[L,C]=p.useState(""),[w,N]=p.useState(null),[D,Y]=p.useState(""),[V,J]=p.useState(!1),[t0,K]=p.useState(!1),[a0,q0]=p.useState(!1),Z=Jt(),z0=500;p.useEffect(()=>{a.open!==void 0&&h(a.open)},[a.open]),p.useEffect(()=>{if(a.open!==void 0?a.open:f){const w0=setTimeout(()=>{q0(!0)},300);return()=>clearTimeout(w0)}else q0(!1)},[f,a.open]);const U=!L.trim()||!i||t0||L.length>z0,X=p.useCallback(async()=>{const e0=L.trim();if(!(!e0||!i))try{K(!0),t?(await l.mutateAsync({inReplyTo:t.object.id,content:e0,imageUrl:w||void 0,altText:D||void 0}),o?.()):(await b.mutateAsync({content:e0,imageUrl:w||void 0,altText:D||void 0}),Z("/notes")),h(!1),r&&r(!1),Re.success(t?"Reply posted":"Note posted")}catch{t&&n?.()}finally{K(!1)}},[L,i,t,l,b,w,D,o,n,h,Z,r]),G=e0=>{C(e0.target.value)};p.useEffect(()=>{q.current&&(q.current.style.height="auto",q.current.style.height=`${q.current.scrollHeight}px`)},[L]),p.useEffect(()=>{if((a.open!==void 0?a.open:f)&&q.current){const w0=setTimeout(()=>{q.current?.focus()},100);return()=>clearTimeout(w0)}},[f,a.open]),p.useEffect(()=>{if(V&&g.current){const e0=setTimeout(()=>{g.current?.focus()},100);return()=>clearTimeout(e0)}},[V]),p.useEffect(()=>{const e0=x0=>{(x0.metaKey||x0.ctrlKey)&&x0.key==="Enter"&&(x0.preventDefault(),!U&&!y&&X())};if(a.open!==void 0?a.open:f)return document.addEventListener("keydown",e0),()=>document.removeEventListener("keydown",e0)},[f,a.open,U,y,X]);const _=p.useCallback(async e0=>{const w0=e0.clipboardData?.items;if(w0)for(let x0=0;x0<w0.length;x0++){const j0=w0[x0];if(j0.type.indexOf("image")!==-1){e0.preventDefault();const p1=j0.getAsFile();if(p1){if(p1.size>mA){Re.error(gA);return}const S=URL.createObjectURL(p1);v(S),await I(p1)}break}}},[]);p.useEffect(()=>{if(a.open!==void 0?a.open:f)return document.addEventListener("paste",_),()=>document.removeEventListener("paste",_)},[f,a.open,_]);const I=async e0=>{try{x(!0);const w0=await Dn0(e0);N(w0)}catch(w0){v(null);let x0="Failed to upload image. Try again.";if(w0&&typeof w0=="object"&&"statusCode"in w0)switch(w0.statusCode){case 413:x0="Image size exceeds limit.";break;case 415:x0="The file type is not supported.";break}Re.error(x0)}finally{x(!1)}},i0=async e0=>{const w0=e0.target.files;if(w0&&w0.length>0){const x0=w0[0];if(x0.size>mA){Re.error(gA),e0.target.value="";return}const j0=URL.createObjectURL(x0);v(j0),await I(x0)}},d0=e0=>{e0.stopPropagation(),v(null),N(null),Y(""),J(!1),W&&URL.revokeObjectURL(W),k.current&&(k.current.value="")},m0=e0=>{e0.stopPropagation(),J(!V)},W0=()=>{q.current?.focus()};p.useEffect(()=>()=>{W&&URL.revokeObjectURL(W)},[W]);let s0="What's new?";if(t){const e0=t.object.attributedTo||{};typeof e0=="object"&&"preferredUsername"in e0&&"id"in e0&&(s0=`Reply to ${Po(e0)}...`)}return z.jsxs(m3,{open:a.open!==void 0?a.open:f,onOpenChange:e0=>{e0&&(C(""),v(null),N(null),Y(""),J(!1),W&&URL.revokeObjectURL(W),k.current&&(k.current.value="")),h(e0),r&&r(e0)},...a.open!==void 0?{}:a,children:[z.jsx(V9,{asChild:!0,children:e}),z.jsxs(Ta,{className:"max-h-[80vh] min-h-[240px] gap-0 overflow-y-auto pb-0","data-testid":"new-note-modal",onClick:e0=>e0.stopPropagation(),children:[z.jsxs(yd,{className:"hidden",children:[z.jsx(Ld,{children:t?"Reply":"New note"}),z.jsx(Q9,{children:"Post your thoughts to the Social web"})]}),t&&z.jsx(Gn0,{actor:t.actor,allowDelete:!1,commentCount:t.object.replyCount??0,isCompact:!0,layout:"reply",likeCount:t.object.likeCount??0,object:t.object,repostCount:t.object.repostCount??0,type:t.object.type==="Article"?"Article":"Note",onClick:()=>{}}),z.jsxs("div",{className:`flex ${W?"":"min-h-36"} cursor-text items-start gap-3`,onClick:W0,children:[z.jsx("div",{className:"sticky top-0",children:z.jsx(Xo,{author:i})}),z.jsx(JP,{asChild:!0,children:z.jsxs("div",{className:"-mt-0.5 flex w-full flex-col gap-0.5",children:[O?z.jsx(w1,{className:"w-10"}):z.jsx("span",{className:"min-w-0 truncate whitespace-nowrap font-semibold text-black break-anywhere dark:text-white",children:u?.name}),z.jsx(x6,{name:"content",asChild:!0,children:z.jsx(k6,{asChild:!0,children:z.jsx("textarea",{ref:q,autoFocus:!0,className:"ap-textarea w-full resize-none bg-transparent text-[1.5rem] break-anywhere","data-testid":"note-textarea",placeholder:s0,rows:1,value:L,onChange:G,onPaste:_})})}),z.jsx(x6,{name:"image",asChild:!0,children:z.jsx(k6,{asChild:!0,children:z.jsx("input",{ref:k,accept:"image/jpeg,image/png,image/webp,image/gif",className:"hidden",type:"file",onChange:i0})})})]})})]}),W&&z.jsxs("div",{className:"group relative mt-6 flex min-h-[200px] w-full items-center justify-center",children:[z.jsx("img",{alt:"Image attachment preview",className:`max-h-[320px] w-full rounded-sm object-cover outline outline-1 -outline-offset-1 outline-black/10 ${y&&"opacity-10"}`,src:W}),y&&z.jsx("div",{className:"absolute leading-[0]",children:z.jsx(hp,{size:"md"})}),z.jsx(o1,{className:"absolute right-3 top-3 size-8 bg-black/60 text-white opacity-0 hover:bg-black/80 group-hover:opacity-100",onClick:d0,children:z.jsx(l9,{})}),!y&&z.jsx(o1,{className:`absolute bottom-3 left-3 h-6 px-2 py-0 text-white ${V?"bg-green-500 hover:bg-green-500":"bg-black/60 hover:bg-black/80"}`,onClick:m0,children:"Alt"})]}),W&&!y&&V&&z.jsx("div",{className:"mt-1",children:z.jsx(C3,{ref:g,className:"w-full border-0 bg-transparent px-0 focus-visible:border-0 focus-visible:bg-transparent focus-visible:shadow-none focus-visible:outline-0 dark:bg-[#101114] dark:text-white dark:placeholder:text-gray-800",placeholder:"Type alt text for image (optional)",type:"text",value:D,onChange:e0=>Y(e0.target.value)})}),z.jsxs(wd,{className:`${a0?"sticky":"static"} bottom-0 flex-row bg-background py-6 dark:bg-[#101114]`,children:[z.jsx(o1,{className:"mr-auto w-[34px] !min-w-0",variant:"outline",onClick:()=>k.current?.click(),children:z.jsx(DZ,{})}),z.jsxs("div",{className:"flex items-center space-x-3",children:[z.jsxs("div",{className:`text-sm ${L.length>=z0?"text-red-500":L.length>=z0*.9?"text-yellow-600":"text-gray-500"}`,children:[L.length,"/",z0]}),z.jsx(o1,{className:"min-w-16","data-testid":"post-button",disabled:U||y,onClick:X,children:t0?z.jsx(hp,{color:"light",size:"sm"}):"Post"})]})]})]})]})};function jz(e){if(!e)return{};try{return JSON.parse(e)}catch{return{}}}function Kn0(e,t){const o=jz(e);return JSON.stringify({...o,...t})}const cv=()=>{const{data:e}=qe(),{mutateAsync:t}=lW(),o=b0.useMemo(()=>e?.accessibility?jz(e.accessibility).apOnboarding||{}:{},[e?.accessibility]),n=b0.useCallback(async r=>{if(!e)return;const a=jz(e.accessibility),i=Kn0(e.accessibility,{apOnboarding:{...a.apOnboarding,...r}});await t({...e,accessibility:i})},[e,t]);return{isOnboarded:!!o.welcomeStepsFinished,isExplainerClosed:!!o.exploreExplainerClosed,setOnboarded:r=>n({welcomeStepsFinished:r}),setExplainerClosed:r=>n({exploreExplainerClosed:r})}},av=()=>z.jsx("div",{className:"h-full pt-14",children:z.jsx(kn,{})}),Yn0=Object.freeze(Object.defineProperty({__proto__:null,default:av,useOnboardingStatus:cv},Symbol.toStringTag,{value:"Module"})),Jn0=()=>{const e=Jt();function t(){e(`/notes/${encodeURIComponent("https://activitypub.ghost.org/.ghost/activitypub/note/6d6d7f57-b656-4caa-ba9e-efa1d9a4b3fb")}`)}return z.jsxs("div",{className:"z-20 w-full bg-white dark:bg-black",children:[z.jsxs("div",{className:"flex w-full flex-col gap-0.5 border-t border-gray-200 bg-white px-3 pt-6 dark:border-gray-950 dark:bg-black",children:[z.jsxs("div",{className:"flex items-center gap-2",children:[z.jsx(GZ,{className:"text-purple-500",size:20,strokeWidth:1.5}),z.jsx(v2,{children:"Beta feedback"})]}),z.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-600",children:"Something not working? Let us know"}),z.jsx(o1,{className:"mt-2 dark:bg-gray-925/70 dark:hover:bg-gray-900",variant:"secondary",onClick:t,children:"Send feedback"})]}),z.jsxs("div",{className:"-mb-1 ml-3 flex items-center gap-1.5 pb-2 pt-4 text-xs text-gray-400",children:[z.jsx("a",{className:"text-xs font-medium text-gray-700 hover:text-black dark:text-gray-600 dark:hover:text-white",href:"https://ghost.org/help/social-web/",rel:"noreferrer",target:"_blank",children:"Help"}),"⋅",z.jsx("a",{className:"text-xs font-medium text-gray-700 hover:text-black dark:text-gray-600 dark:hover:text-white",href:"https://activitypub.ghost.org/archive",rel:"noreferrer",target:"_blank",children:"Updates"})]})]})},wp=({children:e,url:t=null,onClick:o,"data-testid":n,isSelected:r=!1})=>{const a=b0.Children.toArray(e),i=z.jsx("div",{className:`relative flex w-full max-w-[620px] cursor-pointer flex-col before:absolute before:inset-x-[-16px] before:inset-y-[-1px] before:rounded-md before:bg-gray-50 before:transition-opacity hover:z-10 hover:cursor-pointer hover:border-b-transparent hover:before:opacity-100 dark:before:bg-gray-950 ${r?"z-10 before:opacity-100":"before:opacity-0"}`,"data-testid":n,onClick:()=>{!t&&o&&o()},children:z.jsxs("div",{className:"relative z-10 flex w-full items-center gap-3 py-3",children:[a[0],a[1],a[2]]})});return t?z.jsx("a",{href:t,rel:"noreferrer",target:"_blank",onClick:b=>{o&&(b.preventDefault(),o())},children:i}):i},er0=()=>{const e=Jt(),{suggestedProfilesQuery:t}=n5("index",3),{data:o,isLoading:n}=t,r=n?Array(3).fill(null):o||[],{resetStack:a}=Jp(),i="[@media(max-height:740px)]:hidden";return!n&&(!o||o.length===0)?null:z.jsxs("div",{className:`border-t border-gray-200 px-3 pt-6 dark:border-gray-950 ${i}`,children:[z.jsxs("div",{className:"mb-3 flex flex-col gap-0.5",children:[z.jsxs("div",{className:"flex items-center gap-2",children:[z.jsx(zp,{className:"text-purple-500",size:20,strokeWidth:1.5}),z.jsx(v2,{children:"Follow suggestions"})]}),z.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-600",children:"Accounts you might be interested in"})]}),z.jsx("ul",{className:"grow",children:r.map((b,l)=>{const u=b?.id||`loading-${l}`,O=b?.name||"",f=b?.handle||"",h=b?.avatarUrl||"";let q;switch(l){case 0:q="[@media(max-height:740px)]:hidden";break;case 1:q="[@media(max-height:800px)]:hidden";break;case 2:q="[@media(max-height:860px)]:hidden";break}return z.jsx(p.Fragment,{children:z.jsx("li",{className:q,children:z.jsx(Eo,{actor:b,align:"center",isCurrentUser:!1,side:"left",children:z.jsx("div",{children:z.jsxs(wp,{onClick:()=>{!n&&b&&Lo(b,e)},children:[n?z.jsx(w1,{className:"z-10 size-10"}):z.jsx(Xo,{author:{icon:{url:h},name:O,handle:f},showFollowButton:!0}),z.jsxs("div",{className:"flex min-w-0 flex-col",children:[z.jsx("span",{className:"block max-w-[190px] truncate font-semibold text-black dark:text-white",children:n?z.jsx(w1,{className:"w-24"}):O}),z.jsx("span",{className:"block max-w-[190px] truncate text-sm text-gray-700 dark:text-gray-600",children:n?z.jsx(w1,{className:"w-40"}):f})]})]})})})},u)},u)})}),z.jsx(o1,{className:"p-0 font-medium text-purple hover:text-black dark:hover:text-white",variant:"link",onClick:()=>{a(),e("/explore")},children:"Find more →"})]})},tr0=({profile:e,update:t,isLoading:o,onOpenChange:n})=>{const r=()=>{t(e.id,{followedByMe:!0})},a=()=>{t(e.id,{followedByMe:!1})},i=Jt();return z.jsx(Eo,{actor:e,align:"center",isCurrentUser:!1,side:"left",children:z.jsx("div",{children:z.jsxs(wp,{onClick:()=>{n?.(!1),i(`/profile/${e.handle}`)},children:[z.jsx(Xo,{author:{icon:{url:e.avatarUrl},name:e.name,handle:e.handle},onClick:()=>n?.(!1)}),z.jsxs("div",{className:"flex grow flex-col break-anywhere",children:[z.jsx("span",{className:"line-clamp-1 font-semibold text-black dark:text-white",children:o?z.jsx(w1,{className:"w-full max-w-64"}):e.name}),z.jsx("span",{className:"line-clamp-1 text-sm text-gray-700 dark:text-gray-600",children:o?z.jsx(w1,{className:"w-24"}):e.handle})]}),o?z.jsx("div",{className:"inline-flex items-center",children:z.jsx(w1,{className:"w-12"})}):z.jsx(a5,{className:"ml-auto",following:e.followedByMe,handle:e.handle,type:"secondary",onFollow:r,onUnfollow:a})]},e.id)})})},or0=({onOpenChange:e})=>{const{suggestedProfilesQuery:t,updateSuggestedProfile:o}=n5("index",5),{data:n=[],isLoading:r}=t;return!r&&(!n||n.length===0)?null:z.jsx("div",{className:"mb-[-15px] flex flex-col gap-3 pt-2",children:z.jsx("div",{className:"flex flex-col",children:(r?Array(5).fill(null):n||[]).map((a,i)=>z.jsx(b0.Fragment,{children:z.jsx(tr0,{isLoading:r,profile:a||{id:"",name:"",handle:"",avatarUrl:"",bio:"",followerCount:0,followingCount:0,followedByMe:!1},update:o,onOpenChange:e})},a?.id||`loading-${i}`))})})};function nr0(e,t,o,n){var r=this,a=p.useRef(null),i=p.useRef(0),b=p.useRef(0),l=p.useRef(null),u=p.useRef([]),O=p.useRef(),f=p.useRef(),h=p.useRef(e),q=p.useRef(!0);h.current=e;var g=typeof window<"u",W=!t&&t!==0&&g;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var v=!!(o=o||{}).leading,y=!("trailing"in o)||!!o.trailing,x="maxWait"in o,k="debounceOnServer"in o&&!!o.debounceOnServer,L=x?Math.max(+o.maxWait||0,t):null;p.useEffect(function(){return q.current=!0,function(){q.current=!1}},[]);var C=p.useMemo(function(){var w=function(K){var a0=u.current,q0=O.current;return u.current=O.current=null,i.current=K,b.current=b.current||K,f.current=h.current.apply(q0,a0)},N=function(K,a0){W&&cancelAnimationFrame(l.current),l.current=W?requestAnimationFrame(K):setTimeout(K,a0)},D=function(K){if(!q.current)return!1;var a0=K-a.current;return!a.current||a0>=t||a0<0||x&&K-i.current>=L},Y=function(K){return l.current=null,y&&u.current?w(K):(u.current=O.current=null,f.current)},V=function K(){var a0=Date.now();if(v&&b.current===i.current&&J(),D(a0))return Y(a0);if(q.current){var q0=t-(a0-a.current),Z=x?Math.min(q0,L-(a0-i.current)):q0;N(K,Z)}},J=function(){n&&n({})},t0=function(){if(g||k){var K=Date.now(),a0=D(K);if(u.current=[].slice.call(arguments),O.current=r,a.current=K,a0){if(!l.current&&q.current)return i.current=a.current,N(V,t),v?w(a.current):f.current;if(x)return N(V,t),w(a.current)}return l.current||N(V,t),f.current}};return t0.cancel=function(){var K=l.current;K&&(W?cancelAnimationFrame(l.current):clearTimeout(l.current)),i.current=0,u.current=a.current=O.current=l.current=null,K&&n&&n({})},t0.isPending=function(){return!!l.current},t0.flush=function(){return l.current?Y(Date.now()):f.current},t0},[v,x,t,L,y,W,g,k,n]);return C}function rr0(e,t){return e===t}function cr0(e,t,o){var n=rr0,r=p.useRef(e),a=p.useState({})[1],i=nr0(p.useCallback(function(l){r.current=l,a({})},[a]),t,o,a),b=p.useRef(e);return n(b.current,e)||(i(e),b.current=e),[r.current,i]}const wi=80,ar0=({onOpenChange:e,query:t,setQuery:o})=>{const n=p.useRef(null),r=p.useRef([]),a=p.useRef(0),i=Jt(),[b]=cr0(t,300),l=t.length>=2,{searchQuery:u,updateAccountSearchResult:O}=Tn0("index",l?b:""),{data:f,isFetching:h,isFetched:q}=u,{suggestedProfilesQuery:g}=n5("index",5),{data:W,isLoading:v}=g,y=v||W&&W.length>0,{topicsQuery:x}=r5(),{data:k}=x,L=o5("index","me"),{data:C}=L,[w,N]=p.useState([]),[D,Y]=p.useState(null),[V,J]=p.useState(0),t0=p.useMemo(()=>{const X=k?.topics||[];if(!l||X.length===0)return[];const G=t.toLowerCase();return X.filter(_=>_.slug==="following"?!1:_.name.toLowerCase().startsWith(G)||_.slug.toLowerCase().startsWith(G))},[t,l,k?.topics]),K=p.useMemo(()=>[...t0.map(X=>({type:"topic",data:X})),...w.map(X=>({type:"account",data:X}))],[t0,w]);p.useEffect(()=>{if(!l){N([]),Y(null);return}q&&(f?.accounts&&f.accounts.length>0?(N(f.accounts),Y("results"),J(0)):(N([]),Y("none"),J(0)))},[f?.accounts,q,l]);const a0=h&&l,q0=t.length<2||!D&&l&&t0.length===0,Z=!q0&&D==="none"&&t0.length===0,z0=!q0&&(w.length>0||t0.length>0);p.useEffect(()=>{n.current?.focus()},[]),p.useEffect(()=>{const X=r.current[V];if(!X)return;const G=X.closest("[data-radix-scroll-area-viewport]")||X.closest(".overflow-y-auto");if(!G){X.scrollIntoView({block:"nearest"});return}const _=G.getBoundingClientRect(),I=X.getBoundingClientRect();I.top<_.top+wi?G.scrollTo({top:G.scrollTop-(_.top+wi-I.top),behavior:"smooth"}):I.bottom>_.bottom-wi&&G.scrollTo({top:G.scrollTop+(I.bottom-_.bottom+wi),behavior:"smooth"})},[V]);const U=X=>{if(!(!z0||K.length===0)){if(X.key==="ArrowDown"||X.key==="ArrowUp"){X.preventDefault();const G=Date.now();if(G-a.current<50)return;a.current=G,X.key==="ArrowDown"?J(_=>(_+1)%K.length):J(_=>(_-1+K.length)%K.length)}else if(X.key==="Enter"){const G=K[V];if(!G)return;X.preventDefault(),e?.(!1),G.type==="topic"?i(`/explore/${G.data.slug}`):i(`/profile/${G.data.handle}`)}}};return z.jsxs(z.Fragment,{children:[z.jsxs("div",{className:'sticky -top-6 z-30 -mt-6 flex h-[72px] shrink-0 items-center gap-2 bg-white pb-2 pt-3 before:pointer-events-none before:absolute before:-inset-x-6 before:bottom-0 before:h-0 before:border-b before:border-b-gray-150 before:content-[""] dark:bg-[#101114] dark:before:border-b-gray-950',children:[z.jsx(dd,{className:"text-gray-600",size:18,strokeWidth:1.5}),z.jsx(C3,{ref:n,autoComplete:"off",className:"flex h-10 w-full items-center rounded-lg border-0 bg-transparent px-0 py-1.5 text-lg focus-visible:border-0 focus-visible:bg-transparent focus-visible:shadow-none focus-visible:outline-0 dark:bg-[#101114] dark:text-white dark:placeholder:text-gray-800",placeholder:"Search by name, handle, or URL...",title:"Search",type:"text",value:t,onChange:X=>o(X.target.value),onKeyDown:U}),a0&&z.jsx(hp,{className:"!absolute right-0 mr-0.5 shrink-0",size:"sm"})]}),z.jsxs("div",{className:"h-full",children:[Z&&z.jsx("div",{className:"flex h-full items-center justify-center pb-14",children:z.jsxs(Q00,{children:[z.jsx(Z00,{children:z.jsx(Od,{})}),"No users matching this handle or account URL"]})}),z0&&z.jsx("div",{className:"mt-[-14px] pb-2",children:K.map((X,G)=>{const _=G===V;if(X.type==="topic")return z.jsx("div",{ref:d0=>r.current[G]=d0,children:z.jsxs(wp,{isSelected:_,onClick:()=>{e?.(!1),i(`/explore/${X.data.slug}`)},children:[z.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-full bg-gray-100 dark:bg-gray-900",children:z.jsx(zp,{className:"text-gray-700 dark:text-gray-500",size:18,strokeWidth:1.5})}),z.jsxs("div",{className:"flex flex-col",children:[z.jsx("span",{className:"font-semibold text-black dark:text-white",children:X.data.name}),z.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-600",children:"Topic"})]})]})},X.data.slug);const I=X.data,i0=I.handle===C?.handle;return z.jsx(Eo,{actor:I,align:"center",isCurrentUser:i0,side:"left",children:z.jsx("div",{ref:d0=>r.current[G]=d0,children:z.jsxs(wp,{isSelected:_,onClick:()=>{e?.(!1),i(`/profile/${I.handle}`)},children:[z.jsx(Xo,{author:{icon:{url:I.avatarUrl},name:I.name,handle:I.handle}}),z.jsxs("div",{className:"flex flex-col break-anywhere",children:[z.jsx("span",{className:"line-clamp-1 font-semibold text-black dark:text-white",children:I.name}),z.jsx("span",{className:"line-clamp-1 text-sm text-gray-700 dark:text-gray-600",children:I.handle})]}),I.blockedByMe||I.domainBlockedByMe?z.jsx(o1,{className:"pointer-events-none ml-auto min-w-[90px]",variant:"destructive",children:"Blocked"}):i0?null:z.jsx(a5,{className:"ml-auto",following:I.followedByMe,handle:I.handle,type:"secondary",onFollow:()=>O(I.id,{followedByMe:!0}),onUnfollow:()=>O(I.id,{followedByMe:!1})})]})})},I.id)})}),q0&&y&&z.jsxs(z.Fragment,{children:[z.jsx(v2,{children:"More people to follow"}),z.jsx(or0,{onOpenChange:e})]})]})]})},sr0=()=>z.jsxs("div",{className:"inline-flex h-9 w-full items-center justify-start gap-2 rounded-full bg-gray-100 px-3 text-md font-normal text-gray-600 hover:bg-gray-200 hover:text-gray-600 dark:bg-gray-925/70 dark:text-gray-700 dark:hover:bg-gray-925 [&_svg]:size-[18px]",children:[z.jsx(dd,{size:18,strokeWidth:1.5})," Search the social web"]}),Wn=p.forwardRef(({to:e,children:t,count:o,...n},r)=>{const a=we(),{resetStack:i}=Jp(),b=K3(),l=e&&e.startsWith("/")?`${b}${e}`:e,u=l&&(a.pathname===l||a.pathname.startsWith(`${l}/`)),O=g0("justify-start text-md font-medium text-gray-800 dark:hover:bg-gray-925/70 dark:text-gray-500 h-9 [&_svg]:size-[18px]",u&&"bg-gray-100 dark:bg-gray-925/70 dark:text-white text-black font-semibold"),f=o&&o>0?z.jsx("span",{className:g0("ml-auto bg-purple-500 text-white text-xs font-semibold py-1 px-1.5 rounded-full min-w-[20px] h-5 flex items-center justify-center"),children:bd(o)}):null;return l?z.jsx(o1,{className:O,variant:"ghost",asChild:!0,children:z.jsxs(Ba,{to:l,onClick:()=>{i(),g10(l)},children:[t,f]})}):z.jsxs(o1,{ref:r,className:O,variant:"ghost",onClick:n.onClick,...n,children:[t,f]})});Wn.displayName="SidebarMenuLink";const sv=({isMobileSidebarOpen:e})=>{const{allFlags:t,flags:o}=vn0(),[n,r]=p.useState(!1),[a,i]=p.useState(""),{data:b}=qe(),l=we(),u=K3(),{data:O}=nv(b?.slug||""),f=In0(b?.slug||""),{topicsQuery:h}=r5(),{data:q,isLoading:g}=h,W=!g&&q&&q.topics.length===0;p.useEffect(()=>{l.pathname===`${u}/notifications`&&O&&O>0&&f.mutate()},[l.pathname,u,O,f]);const v=p.useCallback(()=>{O&&O>0&&f.mutate()},[O,f]);return z.jsx("div",{className:`sticky top-0 flex min-h-screen w-[320px] flex-col border-l border-gray-200 pr-8 transition-transform duration-300 ease-in-out max-lg:fixed max-lg:inset-y-0 max-lg:right-0 max-lg:z-50 max-lg:border-0 max-lg:bg-white max-lg:shadow-xl max-md:bottom-[72px] max-md:min-h-[auto] max-md:overflow-y-scroll dark:border-gray-950 max-lg:dark:bg-black ${e?"max-lg:translate-x-0":"max-lg:translate-x-full"}`,children:z.jsxs("div",{className:"flex grow flex-col justify-between",children:[z.jsxs("div",{className:"isolate flex w-full flex-col items-start gap-6 pl-6 pt-6",children:[z.jsx("div",{className:"flex h-[52px] w-full items-center",children:z.jsxs(m3,{open:n,onOpenChange:r,children:[z.jsx(V9,{className:"mt-0.5 w-full",children:z.jsx(sr0,{})}),z.jsx(Ta,{className:"flex h-full max-h-[452px] flex-col overflow-y-auto pb-0",children:z.jsx(ar0,{query:a,setQuery:i,onOpenChange:r})})]})}),z.jsxs("div",{className:"flex w-full flex-col gap-px",children:[z.jsxs(Wn,{to:"/reader",children:[z.jsx(iZ,{size:18,strokeWidth:1.5}),"Reader"]}),z.jsxs(Wn,{to:"/notes",children:[z.jsx(ud,{size:18,strokeWidth:1.5}),"Notes"]}),z.jsxs(Wn,{count:l.pathname!==`${u}/notifications`?O:void 0,to:"/notifications",onClick:v,children:[z.jsx(aZ,{size:18,strokeWidth:1.5}),"Notifications"]}),W?z.jsx(o1,{className:"inline-flex w-full items-center gap-2 rounded-sm px-3 py-2.5 text-left text-md font-medium text-gray-800 transition-colors hover:bg-gray-100 dark:text-gray-500 dark:hover:bg-gray-925/70",variant:"ghost",asChild:!0,children:z.jsxs("a",{href:"https://explore.ghost.org/social-web",rel:"noopener noreferrer",target:"_blank",children:[z.jsx(zp,{size:18,strokeWidth:1.5}),"Explore",z.jsx(zd,{className:"ml-auto",size:14,strokeWidth:1.5})]})}):z.jsxs(Wn,{to:"/explore",children:[z.jsx(zp,{size:18,strokeWidth:1.5}),"Explore"]}),z.jsxs(Wn,{to:"/profile",children:[z.jsx(fd,{size:18,strokeWidth:1.5}),"Profile"]}),z.jsxs(Wn,{to:"/preferences",children:[z.jsx(lG,{size:18,strokeWidth:1.5}),"Preferences"]})]}),z.jsx(i5,{children:z.jsxs(o1,{className:"h-9 rounded-full bg-purple-500 px-3 text-md text-white hover:bg-purple-600 dark:hover:bg-purple-600",children:[z.jsx(kZ,{}),"New note"]})}),z.jsx(er0,{}),t.map(y=>o[y]?z.jsxs("div",{className:"flex items-center justify-between gap-1 pl-3 opacity-50",children:[z.jsx("span",{className:"font-mono text-xs",children:y}),z.jsx("span",{className:"text-green-800 inline-flex items-center rounded bg-green-100 px-1 py-0.5 text-xs font-medium",children:"ON"})]},y):z.jsx(z.Fragment,{}))]}),z.jsx("div",{className:"sticky bottom-0 flex items-center gap-2 bg-white pb-4 pl-4 dark:bg-black",children:z.jsx(Jn0,{})})]})})};sv.displayName="Sidebar";const ir0=({children:e,...t})=>{const{isOnboarded:o}=cv(),n=K3(),{data:r,isLoading:a}=qe(),i=p.useRef(null),[b,l]=p.useState(!1),u=YW(),{topicsQuery:O}=r5(),{data:f}=O,h=f&&f.topics.length>0,{isNewNoteModalOpen:q,setIsNewNoteModalOpen:g}=rv(),W=()=>{l(!b)},v=()=>{l(!1)};return a||!r?null:o?z.jsxs("div",{ref:i,className:`h-screen w-full ${o&&"overflow-y-auto"}`,"data-scrollable-container":!0,children:[z.jsx(W10,{containerRef:i}),z.jsx("div",{className:"relative mx-auto flex max-w-page flex-col",...t,children:o?z.jsxs(z.Fragment,{children:[z.jsxs("div",{className:"block grid-cols-[auto_320px] items-start lg:grid",children:[z.jsxs("div",{className:"z-0 min-w-0",children:[z.jsx(wn0,{showBorder:!(u==="reader"&&h)&&u!=="explore",onToggleMobileSidebar:W}),z.jsx("div",{className:"px-[min(4vw,32px)]",children:e})]}),z.jsx(sv,{isMobileSidebarOpen:b,onCloseMobileSidebar:v})]}),b&&z.jsx("div",{className:"fixed inset-0 z-40 lg:hidden",onClick:v})]}):z.jsx(av,{})}),z.jsx(i5,{open:q,onOpenChange:g})]}):z.jsx(vn,{to:`${n}/welcome`,replace:!0})},Qc=({children:e})=>z.jsx("div",{className:"flex max-h-12 max-w-12 grow-0 items-center justify-center rounded-full bg-gray-100 p-3 text-gray-700 dark:bg-gray-925/70 [&_svg]:size-8 [&_svg]:stroke-1",children:e}),Zc=({children:e,className:t})=>z.jsx("div",{className:`mx-auto mt-[24vh] flex max-w-[500px] flex-col items-center gap-5 text-center text-gray-700 ${t||""}`,children:e}),iv=({statusCode:e,errorCode:t})=>{const o=O7(),n=rW(),r=a=>{a.preventDefault(),n("/analytics/",{crossApp:!0})};return o?z.jsx(ir0,{children:z.jsxs(Zc,{children:[z.jsx(Qc,{children:z.jsx(pG,{})}),z.jsx(v2,{className:"-mb-4",children:"Oops, page not found!"}),z.jsx("div",{children:"We couldn't find the page you were looking for. It may have been moved, deleted, or never existed in the first place."})]})}):e===429?z.jsxs(Zc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Qc,{children:z.jsx(qG,{})}),z.jsx(v2,{className:"-mb-4",children:"Rate limit exceeded"}),z.jsx("div",{children:"You've made too many requests. Please try again in a moment."}),z.jsx(o1,{asChild:!0,children:z.jsx("a",{href:"https://ghost.org/help/social-web/",rel:"noopener noreferrer",target:"_blank",children:"Learn more →"})})]}):e===403?t==="ROLE_MISSING"||t==="SITE_MISSING"?z.jsxs(Zc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Qc,{children:z.jsx(M9,{})}),z.jsx(v2,{className:"-mb-4",children:"Site not configured correctly"}),z.jsx("div",{children:"This feature can't be used because the site isn't set up correctly. If you manage this site, check your settings or server logs, or contact support."}),z.jsx(o1,{asChild:!0,children:z.jsx("a",{href:"https://ghost.org/help/social-web/",rel:"noopener noreferrer",target:"_blank",children:"Learn more →"})})]}):z.jsxs(Zc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Qc,{children:z.jsx(rZ,{})}),z.jsx(v2,{className:"-mb-4",children:"Account suspended"}),z.jsx("div",{children:"Your account has been suspended due to policy violations."}),z.jsx(o1,{asChild:!0,children:z.jsx("a",{href:"https://ghost.org/help/social-web/",rel:"noopener noreferrer",target:"_blank",children:"Learn more →"})})]}):e===410&&t==="INVALID_VERSION"?z.jsxs(Zc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Qc,{children:z.jsx(vZ,{})}),z.jsx(v2,{className:"-mb-4",children:"New version available"}),z.jsx("div",{children:"We've made some updates! Refresh your page to see what's new"}),z.jsx(o1,{asChild:!0,children:z.jsx("button",{type:"button",onClick:()=>window.location.reload(),children:"Refresh your page"})})]}):z.jsx("div",{className:"admin-x-container-error",children:z.jsxs("div",{className:"admin-x-error max-w-xl",children:[z.jsx("h1",{children:"Loading interrupted"}),z.jsx("p",{children:"They say life is a series of trials and tribulations. This moment right here? It's a tribulation. Our app was supposed to load, and yet here we are. Loadless. Click back to the dashboard to try again."}),z.jsx("a",{className:"cursor-pointer text-green",onClick:r,children:"← Back to the homepage"})]})})},pr0=Object.freeze(Object.defineProperty({__proto__:null,default:iv},Symbol.toStringTag,{value:"Module"})),Mr0="activitypub",pv=[{path:Mr0,element:z.jsx(kn,{}),errorElement:z.jsx(iv,{}),handle:"activitypub-basepath",children:[{index:!0,element:z.jsx(vn,{to:"reader"})},{path:"inbox",element:z.jsx(vn,{to:"../reader",replace:!0})},{path:"feed",element:z.jsx(vn,{to:"../notes",replace:!0})},{path:"reader",lazy:h1(()=>z1(()=>import("./index-BX3p0DcO.js"),__vite__mapDeps([0,1,2,3,4,5,6]))),pageTitle:"Reader"},{path:"reader/:postId",lazy:h1(()=>z1(()=>import("./index-BX3p0DcO.js"),__vite__mapDeps([0,1,2,3,4,5,6]))),pageTitle:"Reader"},{path:"notes",lazy:h1(()=>z1(()=>import("./feed-BKXpQU0e.js"),__vite__mapDeps([7,8]))),pageTitle:"Notes"},{path:"notes/:postId",lazy:h1(()=>z1(()=>import("./note-C445n_od.js"),__vite__mapDeps([9,2,3,8]))),pageTitle:"Note"},{path:"notifications",lazy:h1(()=>z1(()=>import("./index-DethZCE1.js"),__vite__mapDeps([10,11,12,13]))),pageTitle:"Notifications"},{path:"explore",lazy:h1(()=>z1(()=>import("./index-CQVI9TPr.js"),__vite__mapDeps([14,4,15]))),pageTitle:"Explore"},{path:"explore/:topic",lazy:h1(()=>z1(()=>import("./index-CQVI9TPr.js"),__vite__mapDeps([14,4,15]))),pageTitle:"Explore"},{path:"profile",lazy:h1(()=>z1(()=>import("./index-syvYkr47.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]))),pageTitle:"Profile"},{path:"profile/likes",lazy:h1(()=>z1(()=>import("./index-syvYkr47.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]))),pageTitle:"Profile"},{path:"profile/following",lazy:h1(()=>z1(()=>import("./index-syvYkr47.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]))),pageTitle:"Profile"},{path:"profile/followers",lazy:h1(()=>z1(()=>import("./index-syvYkr47.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]))),pageTitle:"Profile"},{path:"profile/:handle/:tab?",lazy:h1(()=>z1(()=>import("./index-syvYkr47.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]))),pageTitle:"Profile"},{path:"preferences",lazy:h1(()=>z1(()=>import("./index-OPvny56_.js"),__vite__mapDeps([29,30,26,25,28,18,11]))),pageTitle:"Preferences"},{path:"preferences/moderation",lazy:h1(()=>z1(()=>import("./moderation-DikYZSIC.js"),__vite__mapDeps([31,19,20,21,22,23,11,24,25,8,6,1,17,26,12,27,13,15,3]))),pageTitle:"Moderation",showBackButton:!0},{path:"preferences/bluesky-sharing",lazy:h1(()=>z1(()=>import("./bluesky-sharing-Frg4QWOQ.js"),__vite__mapDeps([32,18,11,25]))),showBackButton:!0},{path:"welcome",lazy:h1(()=>z1(()=>Promise.resolve().then(()=>Yn0),void 0)),pageTitle:"Welcome",children:[{path:"",element:z.jsx(vn,{to:"1",replace:!0})},{path:"1",lazy:h1(()=>z1(()=>import("./step-1-QOnWlIzD.js"),__vite__mapDeps([33,25])))},{path:"2",lazy:h1(()=>z1(()=>import("./step-2-CDFj1bR5.js"),__vite__mapDeps([34,35,13,27])))},{path:"3",lazy:h1(()=>z1(()=>import("./step-3-Cjmt9ecL.js"),__vite__mapDeps([36,35,13,27,22,6,8])))},{path:"*",element:z.jsx(vn,{to:"1",replace:!0})}]},{path:"*",lazy:h1(()=>z1(()=>Promise.resolve().then(()=>pr0),void 0))}]}];function br0(){return z.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[z.jsx("path",{d:"M3.6349 20.3723C3.80192 20.5393 4.00019 20.6718 4.21841 20.7622C4.43663 20.8525 4.67052 20.8991 4.90672 20.8991C5.14291 20.8991 5.3768 20.8525 5.59502 20.7622C5.81324 20.6718 6.01152 20.5393 6.17853 20.3723C6.34555 20.2052 6.47804 20.007 6.56843 19.7888C6.65882 19.5705 6.70534 19.3366 6.70534 19.1004C6.70534 18.8643 6.65882 18.6304 6.56843 18.4121C6.47804 18.1939 6.34555 17.9956 6.17853 17.8286C5.84123 17.4913 5.38374 17.3018 4.90672 17.3018C4.42969 17.3018 3.9722 17.4913 3.6349 17.8286C3.29759 18.1659 3.10809 18.6234 3.10809 19.1004C3.10809 19.5775 3.29759 20.035 3.6349 20.3723ZM17.7153 6.17951C17.8823 6.34653 18.0806 6.47901 18.2988 6.5694C18.517 6.65979 18.7509 6.70632 18.9871 6.70632C19.2233 6.70632 19.4572 6.65979 19.6754 6.5694C19.8936 6.47901 20.0919 6.34653 20.2589 6.17951C20.4259 6.01249 20.5584 5.81421 20.6488 5.596C20.7392 5.37778 20.7857 5.14389 20.7857 4.90769C20.7857 4.67149 20.7392 4.43761 20.6488 4.21939C20.5584 4.00117 20.4259 3.80289 20.2589 3.63587C19.9216 3.29857 19.4641 3.10907 18.9871 3.10907C18.5101 3.10907 18.0526 3.29857 17.7153 3.63587C17.378 3.97318 17.1885 4.43067 17.1885 4.90769C17.1885 5.38472 17.378 5.8422 17.7153 6.17951ZM7.50655 12.0023C7.50655 13.1946 7.98019 14.3381 8.82329 15.1812C9.66639 16.0243 10.8099 16.4979 12.0022 16.4979C13.1945 16.4979 14.338 16.0243 15.1811 15.1812C16.0242 14.3381 16.4978 13.1946 16.4978 12.0023C16.4978 10.81 16.0242 9.66647 15.1811 8.82337C14.338 7.98027 13.1945 7.50663 12.0022 7.50663C10.8099 7.50663 9.66639 7.98027 8.82329 8.82337C7.98019 9.66647 7.50655 10.81 7.50655 12.0023Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),z.jsx("path",{d:"M8.79319 21.5246C10.5669 22.1224 12.4724 22.2127 14.2947 21.7854C16.1171 21.3581 17.7838 20.4302 19.1069 19.1062C20.4302 17.7827 21.3577 16.116 21.7848 14.2937C22.2119 12.4715 22.1217 10.5662 21.5243 8.79251M2.47582 15.2081C1.87829 13.4342 1.78805 11.5287 2.21527 9.70622C2.64249 7.88378 3.57019 6.21687 4.89383 4.89332C6.21747 3.56977 7.88445 2.64219 9.70692 2.21511C11.5294 1.78802 13.4349 1.87839 15.2088 2.47605",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Lp({path:e,activeOnSubpath:t=!1}){const o=t&&e?`${e}/*`:e;return II(o||"")!==null}function U0({children:e,...t}){return z.jsx(Vd,{...t,children:e})}function lr0({to:e,target:t,rel:o,activeOnSubpath:n=!1,isActive:r,children:a,...i}){const b=`#/${e?.replace(/^\/?#\//,"")}`,l=Lp({path:e,activeOnSubpath:n}),u=r!==void 0?r:l,{isMobile:O,setOpenMobile:f}=Gn(),h=()=>{O&&f(!1)};return z.jsx(B3,{asChild:!0,isActive:u,...i,children:z.jsx("a",{href:t==="_blank"?e:b,rel:t==="_blank"?o??"noopener noreferrer":o,target:t,"aria-current":u?"page":void 0,onClick:h,children:a})})}function zr0({children:e,...t}){return z.jsx("span",{...t,children:e})}function ur0({onClick:e,children:t,...o}){const{isMobile:n,setOpenMobile:r}=Gn(),a=()=>{n&&r(!1),e?.()};return z.jsx(B3,{onClick:a,...o,children:t})}U0.Link=lr0;U0.Label=zr0;U0.Button=ur0;function dr0({...e}){const{data:t}=qe(),{data:o}=G3(),n=Tt(o?.settings,"social_web_enabled")??!1,a=T3().data?.site.url,{data:i=0}=nv(t?.slug||"",n),b=Lp({path:"network",activeOnSubpath:!0}),l=Lp({path:"activitypub",activeOnSubpath:!0}),u=i>0&&!b&&!l;return!t||!Q10(t)?null:z.jsx(oc,{...e,children:z.jsx(Da,{children:z.jsxs(nc,{children:[z.jsx(U0,{children:z.jsxs(U0.Link,{to:"analytics",activeOnSubpath:!0,children:[z.jsx(z9,{}),z.jsx(U0.Label,{children:"Analytics"})]})}),n&&z.jsxs(U0,{children:[z.jsxs(U0.Link,{to:"network",isActive:b||l,children:[z.jsx(br0,{}),z.jsx(U0.Label,{children:"Network"})]}),u&&z.jsx($d,{children:i})]}),z.jsxs(U0,{className:"relative group/viewsite",children:[z.jsxs(U0.Link,{to:"site",children:[z.jsx(eZ,{}),z.jsx(U0.Label,{children:"View site"})]}),z.jsx("a",{href:a,target:"_blank","aria-label":"View site in new tab",rel:"noopener noreferrer",className:"absolute opacity-0 group-hover/viewsite:opacity-100 right-0 top-0 size-8 hover:bg-sidebar-accent flex items-center justify-center rounded-full text-gray-700 hover:text-sidebar-accent-foreground transition-all",children:z.jsx(zd,{size:16})})]})]})})})}function Or0({isExpanded:e,children:t,id:o}){return z.jsx("div",{id:o,className:`grid transition-all duration-200 ease-out ${e?"grid-rows-[1fr] mb-5":"grid-rows-[0fr] mb-0"}`,children:z.jsx("div",{className:"overflow-hidden",children:t})})}const fr0="MembersResponseType",Ar0=Fn({dataType:fr0,path:"/members/"});function hr0(){const{data:e}=Ar0({searchParams:{limit:"1"}});return e?.meta?.pagination.total}const qr0=()=>Q3({select:e=>e.navigation}),mr0=()=>{const{mutateAsync:e}=Z3();return Y1({mutationFn:async t=>{await e({navigation:t})}})},gr0=e=>{const{data:t}=qr0(),{mutateAsync:o}=mr0();return[t?.expanded[e]??!0,async a=>o({expanded:{[e]:a}})]},Wr0=vp({name:s2(),route:s2(),color:s2(),icon:s2().optional(),filter:Io0(s2(),s2().nullable())}),vr0=Yd(Wr0);function Rr0(e){return{midgrey:"#7C8B9A",blue:"#14b8ff",green:"#30cf43",red:"#f50b23",teal:"#4dcddc",purple:"#8e42ff",yellow:"#ffb41f",orange:"#fe8b05",pink:"#fb2d8d"}[e]||"#7C8B9A"}function yr0({route:e="posts"}){const{data:t}=G3(),o=MW(),n=p.useMemo(()=>{const r=Tt(t?.settings,"shared_views")??"[]";try{const a=JSON.parse(r),i=vr0.safeParse(a);return i.success?i.data.filter(b=>b.route===e):(console.error("Failed to validate shared_views setting:",i.error),[])}catch(a){return console.error("Failed to parse shared_views setting:",a),[]}},[t,e]);return n.length===0?null:z.jsx(z.Fragment,{children:n.map(r=>{const a=o.getRouteUrl(e,r.filter),i=o.isRouteActive(e,r.filter);return z.jsx(U0,{children:z.jsxs(U0.Link,{className:"pl-9",to:a,isActive:i,children:[z.jsx(U0.Label,{className:"grow",children:r.name}),z.jsx("span",{className:"size-2 rounded-full shrink-0 mx-0.5",style:{backgroundColor:Rr0(r.color)},"data-color":r.color,"aria-hidden":"true"})]})},a)})})}const p5=e=>{const{data:t}=Ia();return t?.config.labs?.[e]??!1};function wr0({...e}){const{data:t}=qe(),[o,n]=gr0("posts"),r=hr0(),a=MW(),i=p5("commentModeration"),b=t&&$10(t),l=t&&V10(t);return z.jsx(oc,{...e,children:z.jsx(Da,{children:z.jsxs(nc,{children:[z.jsxs(U0,{children:[z.jsx(o1,{"aria-controls":"posts-submenu","aria-expanded":o,"aria-label":"Toggle post views",variant:"ghost",size:"icon",className:"!h-[34px] absolute sidebar:opacity-0 group-hover/menu-item:opacity-100 focus-visible:opacity-100 transition-all left-3 top-0 p-0 h-9 w-auto text-sidebar-accent-foreground hover:text-gray-black hover:bg-transparent",onClick:()=>void n(!o),children:z.jsx(ld,{size:16,className:`transition-all ${o&&"rotate-[90deg]"}`})}),z.jsxs(U0.Link,{to:a.getRouteUrl("posts"),isActive:a.isRouteActive("posts"),children:[z.jsx(s9,{className:"opacity-0 sidebar:opacity-100 sidebar:group-hover/menu-item:opacity-0 pointer-events-none transition-all"}),z.jsx(U0.Label,{children:"Posts"})]}),z.jsx("a",{href:"#/editor/post","aria-label":"Create new post",className:"flex items-center justify-center absolute hover:bg-sidebar-accent transition-all rounded-full right-0 top-0 p-0 size-8 text-gray-700 hover:text-sidebar-accent-foreground",children:z.jsx(i9,{size:20,className:"!stroke-[1.5px] mt-px"})})]}),z.jsxs(Or0,{isExpanded:o,id:"posts-submenu",children:[z.jsx(U0,{children:z.jsx(U0.Link,{className:"pl-9",to:"posts?type=draft",isActive:a.isRouteActive("posts",{type:"draft"}),children:z.jsx(U0.Label,{children:"Drafts"})})}),z.jsx(U0,{children:z.jsx(U0.Link,{className:"pl-9",to:"posts?type=scheduled",isActive:a.isRouteActive("posts",{type:"scheduled"}),children:z.jsx(U0.Label,{children:"Scheduled"})})}),z.jsx(U0,{children:z.jsx(U0.Link,{className:"pl-9",to:"posts?type=published",isActive:a.isRouteActive("posts",{type:"published"}),children:z.jsx(U0.Label,{children:"Published"})})}),z.jsx(yr0,{})]}),z.jsx(U0,{children:z.jsxs(U0.Link,{to:a.getRouteUrl("pages"),isActive:a.isRouteActive("pages"),children:[z.jsx(_Z,{}),z.jsx(U0.Label,{children:"Pages"})]})}),b&&z.jsx(U0,{children:z.jsxs(U0.Link,{to:"tags",isActive:a.isRouteActive(["tags","tag","tag.new"]),children:[z.jsx(OG,{}),z.jsx(U0.Label,{children:"Tags"})]})}),l&&z.jsxs(U0,{children:[z.jsxs(U0.Link,{to:a.getRouteUrl("members"),isActive:a.isRouteActive(["members","member","member.new"]),children:[z.jsx(u9,{}),z.jsx(U0.Label,{children:"Members"})]}),r!=null&&z.jsx($d,{children:r})]}),l&&i&&z.jsx(U0,{children:z.jsxs(U0.Link,{to:"comments",activeOnSubpath:!0,children:[z.jsx(YZ,{}),z.jsx(U0.Label,{children:"Comments"})]})})]})})})}const Wl="https://do.featurebase.app/js/sdk.js";function Lr0(){return new Promise((e,t)=>{if(document.querySelector(`script[src="${Wl}"]`)){e();return}const n=document.createElement("script");n.src=Wl,n.onload=()=>e(),n.onerror=r=>{n.remove();const a=new Error(`[Featurebase] Failed to load SDK from ${Wl}`,{cause:r});console.error(a),t(a)},document.head.appendChild(n),typeof window.Featurebase!="function"&&(window.Featurebase=function(...r){(window.Featurebase.q=window.Featurebase.q||[]).push(r)})})}function xr0(){const{data:e}=qe(),{data:t}=Ia(),{data:o}=Q3(),n=p5("featurebaseFeedback"),r=p.useRef(!1),a=p.useRef(null),i=t?.config.featurebase,b=i?.organization,l=!!(n&&i?.enabled),u=o?.nightShift?"dark":"light",{data:O}=x10({enabled:l}),f=O?.featurebase?.token;return p.useEffect(()=>{if(!l||!b||!e||!f)return;const q=a.current,g=q&&q.theme===u&&q.token===f;r.current||g||(r.current=!0,Lr0().then(()=>{window.Featurebase?.("initialize_feedback_widget",{organization:b,theme:u,defaultBoard:"Feature Request",featurebaseJwt:f},W=>{r.current=!1,W?(console.error("[Featurebase] Failed to initialize widget:",W),a.current=null):a.current={theme:u,token:f}})}).catch(()=>{r.current=!1,a.current=null}))},[l,b,e,f,u]),{openFeedbackWidget:p.useCallback(q=>{window.postMessage({target:"FeaturebaseWidget",data:{action:"openFeedbackWidget",...q?.board&&{setBoard:q.board}}},"*")},[])}}function kr0({...e}){const{data:t}=qe(),{data:o}=Ia(),n=p5("featurebaseFeedback"),{openFeedbackWidget:r}=xr0();if(!t)return null;const i=o?.config.hostSettings?.billing?.enabled&&Ha(t),b=n&&!S3(t)&&o?.config.featurebase?.enabled;return!i&&!b?null:z.jsx(oc,{...e,children:z.jsx(Da,{children:z.jsxs(nc,{children:[i&&z.jsx(U0,{children:z.jsxs(U0.Link,{to:"pro",children:[z.jsx(yZ,{}),z.jsx(U0.Label,{children:"Ghost(Pro)"})]})}),b&&z.jsx(U0,{children:z.jsxs(U0.Button,{onClick:r,children:[z.jsx(ud,{}),z.jsx(U0.Label,{children:"Feedback"})]})})]})})})}function Cr0({...e}){const{data:t}=qe(),o=t&&U10(t);return z.jsx(oc,{...e,children:z.jsx(Da,{children:z.jsxs(nc,{children:[o&&z.jsx(U0,{children:z.jsxs(U0.Link,{to:"settings",children:[z.jsx(M9,{}),z.jsx(U0.Label,{children:"Settings"})]})}),z.jsx(U0,{children:z.jsxs(U0.Link,{to:"https://ghost.org/help?utm_source=admin&utm_campaign=help",target:"_blank",rel:"noopener noreferrer",children:[z.jsx(qZ,{}),z.jsx(U0.Label,{children:"Help"})]})})]})})})}const Nr0="/ghost/assets/ghost-pro-logo-B1sXD_MX.png";function Br0({trialDaysRemaining:e}){return z.jsxs(gd,{variant:"gradient",size:"lg",className:"mx-2 my-5 flex flex-col items-stretch",children:[z.jsx("div",{children:z.jsx("img",{src:Nr0,alt:"Ghost Pro",className:"max-h-[33px]"})}),z.jsx("div",{className:"text-base mt-3 font-semibold",children:"Unlock every feature"}),z.jsxs("div",{className:"mt-2 text-gray-700 text-sm mb-4",children:["Choose a plan to access the full power of Ghost right away, you have ",z.jsxs("span",{className:"font-semibold text-black",children:[e," days"]})," free trial remaining."]}),z.jsx(o1,{asChild:!0,children:z.jsx("a",{href:"#/pro/billing/plans",children:"Upgrade now"})})]})}function _r0(){const{showUpgradeBanner:e,trialDaysRemaining:t}=UW();return z.jsxs(tW,{className:"px-3 pt-4 justify-between",children:[z.jsxs("div",{className:"flex flex-col gap-2 sidebar:gap-4",children:[z.jsx(dr0,{}),z.jsx(wr0,{}),z.jsx(kr0,{})]}),z.jsxs("div",{className:"flex flex-col gap-2 sidebar:gap-4",children:[e?z.jsx(Br0,{trialDaysRemaining:t}):z.jsx(qn0,{}),z.jsx(Cr0,{className:"pb-0"})]})]})}function Er0({...e}){return z.jsxs(Gg,{...e,children:[z.jsx(J10,{className:"px-5 pt-6 pb-0"}),z.jsx(_r0,{}),z.jsx(hn0,{className:"p-3 gap-0"})]})}const Li=1.5;function vl({to:e,activeOnSubpath:t=!1,children:o,...n}){const r=Lp({path:e,activeOnSubpath:t});return z.jsx(o1,{asChild:!0,className:`rounded-full w-full max-w-16 min-w-9 hover:bg-gray-200 ${r?"bg-gray-200":"bg-transparent"}`,...n,variant:"ghost",size:"icon","data-active":r,children:z.jsx("a",{href:e,children:o})})}function Sr0(){const{isMobile:e}=Gn();return e?z.jsx("div",{className:"fixed sidebar:hidden bottom-0 left-0 right-0 h-[var(--mobile-navbar-height)] bg-sidebar/80 backdrop-blur-md border-t border-sidebar-border z-50 safe-area-inset-bottom",children:z.jsxs("div",{className:"grid grid-cols-4 items-center w-full justify-items-center max-w-[300px] h-full mx-auto px-5",children:[z.jsxs(vl,{activeOnSubpath:!0,to:"analytics",children:[z.jsx(z9,{strokeWidth:Li}),z.jsx("span",{className:"sr-only",children:"Analytics"})]}),z.jsxs(vl,{activeOnSubpath:!0,to:"posts",children:[z.jsx(s9,{strokeWidth:Li}),z.jsx("span",{className:"sr-only",children:"Posts"})]}),z.jsxs(vl,{activeOnSubpath:!0,to:"members",children:[z.jsx(u9,{strokeWidth:Li}),z.jsx("span",{className:"sr-only",children:"Members"})]}),z.jsxs(Kg,{className:"rounded-full px-8 h-9 hover:bg-transparent",children:[z.jsx(a9,{strokeWidth:Li}),z.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})]})}):z.jsx(z.Fragment,{})}function Tr0({children:e}){const{data:t}=qe(),o=P10();return t&&S3(t)?z.jsxs("div",{className:"relative h-full bg-background",children:[z.jsx("main",{className:"h-full overflow-auto",children:e}),z.jsx("div",{className:"fixed bottom-3.5 left-3.5 lg:bottom-8 lg:left-8 z-20",children:z.jsx(An0,{})})]}):z.jsxs(Zg,{open:!!t&&o,children:[z.jsx(Er0,{}),z.jsxs(Yg,{className:"bg-background overflow-y-scroll max-h-[calc(100%-var(--mobile-navbar-height))] sidebar:max-h-full",children:[z.jsx("main",{className:"flex-1",children:e}),z.jsx(Sr0,{})]})]})}function Pr0(){const{data:e}=qe();return S10(),E10(),z.jsx(k10,{children:e?z.jsxs(Tr0,{children:[z.jsx(kn,{}),z.jsx($f,{})]}):z.jsxs(z.Fragment,{children:[z.jsx(Wz,{}),z.jsx($f,{})]})})}const Mv=p.createContext(void 0),Oa0=()=>{const e=p.useContext(Mv);if(e===void 0)throw new Error("useAppContext must be used within an AppProvider");return e},Xr0=({children:e,value:t})=>{const o=p.useContext(nu),n=t.externalNavigate??o?.externalNavigate;if(!n)throw new Error("External navigate function is required");const r={externalNavigate:n,fromAnalytics:!1,...o,...t};return z.jsx(Mv.Provider,{value:r,children:e})},jr0=[{path:"",errorElement:z.jsx(qp,{onBackToDashboard:()=>{}}),children:[{path:"posts/analytics/:postId",lazy:async()=>{const[{default:e},{default:t}]=await Promise.all([z1(()=>import("./post-analytics-context-DGNsxT8V.js").then(o=>o.p),__vite__mapDeps([37,38])),z1(()=>import("./post-analytics-DPIgO2YG.js"),__vite__mapDeps([39,40,41,38,37]))]);return{element:z.jsx(e,{children:z.jsx(t,{})})}},children:[{path:"",lazy:h1(()=>z1(()=>import("./overview-vPttXZEx.js"),__vite__mapDeps([42,43,44,23,45,46,47,48,49,41,37,38,50,3,15,51,52,53,21,22,11,24,25,8,6,1,17,26,12,27,13,54,19,20,5,55,56,57,58])))},{path:"web",lazy:h1(()=>z1(()=>import("./web-DiBDLMW8.js"),__vite__mapDeps([59,37,38,60,24,51,52,23,53,44,45,21,22,11,25,8,6,1,17,26,12,27,13,15,3,54,47,48,19,20,61,49,41,50,62,5])))},{path:"growth",lazy:h1(()=>z1(()=>import("./growth-DKtJYCNb.js").then(e=>e.g),__vite__mapDeps([55,5,23,52,53,44,56,43,49,41,37,38,50,3,15,57,58])))},{path:"newsletter",lazy:h1(()=>z1(()=>import("./newsletter-ok4p5aPZ.js"),__vite__mapDeps([63,44,23,64,21,22,11,24,25,8,6,1,17,26,12,27,13,15,3,19,20,43,49,41,37,38,50,45,46,47,48,58])))}]},{path:"tags",children:[{index:!0,lazy:h1(()=>z1(()=>import("./tags-DK91bj9-.js"),__vite__mapDeps([65,30,66,40,56,17,5])))},{path:":tagSlug",element:null}]},{path:"comments",lazy:h1(()=>z1(()=>import("./comments-svHZXAlu.js"),__vite__mapDeps([67,62,24,38,66,40,13,5])))},{path:"*",element:z.jsx(qp,{onBackToDashboard:()=>{}})}]}],Dr0={today:{name:"Today",value:1},last7Days:{name:"Last 7 days",value:7},last30Days:{name:"Last 30 days",value:31},last3Months:{name:"Last 3 months",value:91},yearToDate:{name:"Year to date",value:-1},last12Months:{name:"Last 12 months",value:372},allTime:{name:"All time",value:1e3}},Ir0=Object.values(Dr0),Fr0=2,fa0={US:"United States",TWN:"Taiwan",TW:"Taiwan","mobile-ios":"iOS","mobile-android":"Android",macos:"macOS","google.com":"Google","ghost.org":"Ghost","bing.com":"Bing","bsky.app":"Bluesky","yahoo.com":"Yahoo","duckduckgo.com":"DuckDuckGo",Others:"Unknown",Other:"Unknown",NULL:"Unknown","ᴺᵁᴸᴸ":"Unknown"},Aa0=["NULL","ᴺᵁᴸᴸ","","Others","Other"],ha0="https://static.ghost.org/v5.0.0/images/globe-icon.svg",qa0={PUBLIC:1,FREE:2,PAID:4},bv=p.createContext(void 0),ma0=()=>{const e=p.useContext(bv);if(e===void 0)throw new Error("useGlobalData must be used within a GlobalDataProvider");return e},Hr0=({children:e})=>{const t=G3(),o=T3(),n=Ia(),r=n.data?.config,a=!!r?.stats,i=BD({enabled:a}),[b,l]=p.useState(Ir0[Fr0].value),[u,O]=p.useState(7),[f,h]=p.useState(null),q=[n,t,o],g=q.map(C=>C.error).find(Boolean),W=a?i.error:null,v=g||W,y=q.some(C=>C.isLoading),x=a?i.isLoading:!1,k=y||x;if(v)throw v;const L={url:o.data?.site.url,icon:o.data?.site.icon,title:o.data?.site.title};return z.jsx(bv.Provider,{value:{data:r,site:L,statsConfig:r?.stats,tinybirdToken:i.token,isLoading:k,range:b,setRange:l,audience:u,setAudience:O,settings:t.data?.settings||[],selectedNewsletterId:f,setSelectedNewsletterId:h},children:e})},Ur0=[{path:"analytics",children:[{index:!0,lazy:h1(()=>z1(()=>import("./index-BniBHF2r.js"),__vite__mapDeps([68,69,60,24,44,23,15,21,22,11,25,8,6,1,17,26,12,27,13,3,5,41,50,54,47,48,70,71,58,57,38])))},{path:"web",lazy:h1(()=>z1(()=>import("./index-D9gfkxEz.js"),__vite__mapDeps([72,70,69,60,24,44,23,15,21,22,11,25,8,6,1,17,26,12,27,13,3,61,45,5,64,73,53,62,58,19,20,54,47,48])))},{path:"growth",lazy:h1(()=>z1(()=>import("./index-B6mBuUxr.js"),__vite__mapDeps([74,69,60,24,44,23,15,21,22,11,25,8,6,1,17,26,12,27,13,3,5,47,48,54,19,20,70,75,56,73,57,53,58,76,71])))},{path:"newsletters",lazy:h1(()=>z1(()=>import("./index-VdGL6HfS.js"),__vite__mapDeps([77,69,60,24,44,23,15,21,22,11,25,8,6,1,17,26,12,27,13,3,47,48,5,54,19,20,75,56,78,58])))}]}],Vr0=[{element:z.jsx(D10,{}),children:[{path:"/tags/:tagSlug",Component:Wz,handle:{allowInForceUpgrade:!0}},{element:z.jsx(Xr0,{value:{fromAnalytics:!0},children:z.jsx(kn,{})}),children:jr0[0].children.filter(e=>e.path!=="*")},{element:z.jsx(Hr0,{children:z.jsx(kn,{})}),children:Ur0},{path:"network",loader:()=>sI("/activitypub")},{path:"",element:z.jsx(mn0,{children:z.jsx(kn,{})}),children:pv},{path:"settings/*",lazy:h1(()=>z1(()=>import("./settings-CpkvyD93.js").then(e=>e.bs),__vite__mapDeps([79,20,78,38,76]))),handle:{allowInForceUpgrade:!0}},{path:"*",Component:Wz,handle:{allowInForceUpgrade:!0}}]}],$r0=["http:","https:","mailto:","tel:"];function Qr0(e){if(e.match(/^[a-z]+:/i))try{const t=new URL(e);return $r0.includes(t.protocol)?(window.location.href=e,!0):!1}catch{const t=e.startsWith("/")?e:`/${e}`;return window.location.hash=t,!0}else{const t=e.startsWith("/")?e:`/${e}`;return window.location.hash=t,!0}}function Zr0({children:e}){const{data:t}=G3(),o=p.useMemo(()=>{if(!t?.settings)return;const n=t.settings;return{paidMembersEnabled:Tt(n,"paid_members_enabled")??!1,newslettersEnabled:Tt(n,"editor_default_email_recipients")!=="disabled",analytics:{emailTrackOpens:Tt(n,"email_track_opens")??!1,emailTrackClicks:Tt(n,"email_track_clicks")??!1,membersTrackSources:Tt(n,"members_track_sources")??!1,outboundLinkTagging:Tt(n,"outbound_link_tagging")??!1,webAnalytics:Tt(n,"web_analytics_enabled")??!1}}},[t]);return z.jsx(Cx,{appSettings:o,children:e})}const Gr0={ghostVersion:"",externalNavigate:e=>{Qr0(e.route)},unsplashConfig:{Authorization:"","Accept-Version":"","Content-Type":"","App-Pragma":"","X-Unsplash-Cache":!0},sentryDSN:null,onUpdate:(e,t)=>{window.EmberBridge?.state.onUpdate(e,t)},onInvalidate:e=>{window.EmberBridge?.state.onInvalidate(e)},onDelete:(e,t)=>{window.EmberBridge?.state.onDelete(e,t)}};ny.createRoot(document.getElementById("root")).render(z.jsx(p.StrictMode,{children:z.jsx(kx,{...Gr0,children:z.jsx(v10,{prefix:"/",routes:Vr0,children:z.jsx(Zr0,{children:z.jsx(RK,{className:"shade-admin",darkMode:!1,fetchKoenigLexical:null,children:z.jsx(Pr0,{})})})})})}));export{c9 as $,Xo as A,o1 as B,ld as C,m3 as D,Zc as E,Gn0 as F,Qc0 as G,v2 as H,Zc0 as I,Yc0 as J,Jc0 as K,ir0 as L,Gc0 as M,Kc0 as N,q10 as O,Eo as P,Q00 as Q,Z00 as R,w1 as S,rZ as T,wp as U,Re as V,Ma0 as W,Ad as X,ba0 as Y,la0 as Z,nW as _,Jp as a,Bn as a$,yK as a0,O9 as a1,f9 as a2,h9 as a3,q9 as a4,A9 as a5,g9 as a6,m9 as a7,u3 as a8,Q9 as a9,V0 as aA,Sp as aB,z1 as aC,ih as aD,Z1 as aE,Ia as aF,T3 as aG,G3 as aH,BD as aI,oZ as aJ,kc0 as aK,kn as aL,rW as aM,yc0 as aN,Vm as aO,m10 as aP,zp as aQ,Oa0 as aR,Oc0 as aS,Ac0 as aT,Qr as aU,_u as aV,Fm as aW,a9 as aX,Sd as aY,Rc0 as aZ,Um as a_,wd as aa,FZ as ab,Fn as ac,Hn as ad,wD as ae,fc0 as af,pc0 as ag,y0 as ah,lc0 as ai,bd as aj,yD as ak,xc0 as al,bW as am,Yt as an,z9 as ao,Hm as ap,Vh as aq,Ko as ar,_e as as,e2 as at,H0 as au,Qh as av,XX as aw,jX as ax,Q0 as ay,$t as az,Jt as b,gc0 as b$,oW as b0,dt as b1,qa0 as b2,ma0 as b3,Jr0 as b4,Od as b5,lJ as b6,Up as b7,lq as b8,Uh as b9,rc as bA,TZ as bB,aa0 as bC,aZ as bD,$c as bE,Ri as bF,hd as bG,qd as bH,md as bI,G00 as bJ,wc0 as bK,Vg as bL,J00 as bM,e10 as bN,t10 as bO,$00 as bP,bc0 as bQ,ic0 as bR,fd as bS,dc0 as bT,kf as bU,vn as bV,za0 as bW,M00 as bX,b00 as bY,l00 as bZ,Wg as b_,Y0 as ba,re as bb,Tx as bc,oj as bd,Cu as be,Kr as bf,he as bg,Vp as bh,Bu as bi,wa as bj,Fo as bk,ya as bl,Hp as bm,zq as bn,uq as bo,zZ as bp,en as bq,i5 as br,n5 as bs,dZ as bt,kZ as bu,ta0 as bv,Sn0 as bw,Ln0 as bx,iv as by,sa0 as bz,Qc as c,na0 as c$,u9 as c0,OG as c1,we as c2,WA as c3,Tp as c4,I9 as c5,H9 as c6,f3 as c7,A3 as c8,dd as c9,qc0 as cA,mc0 as cB,Mc0 as cC,DZ as cD,Cf as cE,yZ as cF,Ir0 as cG,wK as cH,dl as cI,CK as cJ,ra0 as cK,ea0 as cL,ca0 as cM,xp as cN,Aa0 as cO,fa0 as cP,s9 as cQ,uc0 as cR,ha0 as cS,Dz as cT,cr0 as cU,Ar0 as cV,gZ as cW,GZ as cX,KW as cY,Hn0 as cZ,oa0 as c_,dJ as ca,OJ as cb,i9 as cc,$m as cd,eg as ce,zc0 as cf,hc0 as cg,Dr0 as ch,NZ as ci,oc0 as cj,Pc0 as ck,Xc0 as cl,hW as cm,ia0 as cn,l9 as co,vG as cp,C3 as cq,eY as cr,vp as cs,mA as ct,gA as cu,ua0 as cv,da0 as cw,s2 as cx,Dn0 as cy,$Q as cz,yi as d,f1 as d$,Kr0 as d0,ZR as d1,Pp as d2,wN as d3,w6 as d4,Vq as d5,jc0 as d6,Hc0 as d7,el as d8,cc0 as d9,Nc0 as dA,_c0 as dB,U10 as dC,zW as dD,Ec0 as dE,E3 as dF,Wh as dG,tc0 as dH,JP as dI,x6 as dJ,k6 as dK,Kz as dL,Ru as dM,qh as dN,rj as dO,gq as dP,Wq as dQ,vq as dR,Kx as dS,pD as dT,rc0 as dU,MD as dV,Hq as dW,Zp as dX,ca as dY,qe as dZ,sc0 as d_,ac0 as da,Gz as db,Sc0 as dc,qD as dd,Yr as de,ha as df,Fc0 as dg,V2 as dh,C10 as di,N10 as dj,B10 as dk,Tt as dl,BP as dm,Tc0 as dn,G10 as dp,Vc0 as dq,Ic0 as dr,Dc0 as ds,K1 as dt,Q10 as du,Bc0 as dv,ez as dw,Ha as dx,Cc0 as dy,lW as dz,b0 as e,Aw as e0,Lc0 as e1,I10 as e2,Uc0 as e3,S3 as e4,ph as e5,ec0 as e6,fh as e7,eZ as e8,MZ as e9,iZ as ea,AZ as eb,qZ as ec,vZ as ed,_Z as ee,XZ as ef,UZ as eg,$Z as eh,ud as ei,YZ as ej,eG as ek,oG as el,cG as em,p9 as en,pG as eo,M9 as ep,lG as eq,b9 as er,qG as es,gG as et,YQ as eu,hp as f,Po as g,Lo as h,$c0 as i,z as j,cv as k,pa0 as l,o5 as m,a5 as n,Hi as o,r5 as p,V9 as q,p as r,Xz as s,Ta as t,VI as u,yd as v,Ld as w,zd as x,g0 as y,Ba as z};
622
+ `)}q.write("payload.value = newResult;"),q.write("return payload;");const x=q.compile();return(k,L)=>x(h,k,L)};let a;const i=mp,b=!dW.jitless,u=b&&te0.value,O=t.catchall;let f;e._zod.parse=(h,q)=>{f??(f=n.value);const g=h.value;return i(g)?b&&u&&q?.async===!1&&q.jitless!==!0?(a||(a=r(t.shape)),h=a(h,q),O?wW([],g,h,q,f,e):h):o(h,q):(h.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),h)}});function Jf(e,t,o,n){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const r=e.filter(a=>!xr(a));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:e.map(a=>a.issues.map(i=>Zo(i,n,Qo())))}),t)}const X20=n0("$ZodUnion",(e,t)=>{V1.init(e,t),m1(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),m1(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),m1(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),m1(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(a=>a._zod.pattern);return new RegExp(`^(${r.map(a=>Gd(a.source)).join("|")})$`)}});const o=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(r,a)=>{if(o)return n(r,a);let i=!1;const b=[];for(const l of t.options){const u=l._zod.run({value:r.value,issues:[]},a);if(u instanceof Promise)b.push(u),i=!0;else{if(u.issues.length===0)return u;b.push(u)}}return i?Promise.all(b).then(l=>Jf(l,r,e,a)):Jf(b,r,e,a)}}),j20=n0("$ZodIntersection",(e,t)=>{V1.init(e,t),e._zod.parse=(o,n)=>{const r=o.value,a=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return a instanceof Promise||i instanceof Promise?Promise.all([a,i]).then(([l,u])=>eA(o,l,u)):eA(o,a,i)}});function yz(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ur(e)&&Ur(t)){const o=Object.keys(t),n=Object.keys(e).filter(a=>o.indexOf(a)!==-1),r={...e,...t};for(const a of n){const i=yz(e[a],t[a]);if(!i.valid)return{valid:!1,mergeErrorPath:[a,...i.mergeErrorPath]};r[a]=i.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const o=[];for(let n=0;n<e.length;n++){const r=e[n],a=t[n],i=yz(r,a);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};o.push(i.data)}return{valid:!0,data:o}}return{valid:!1,mergeErrorPath:[]}}function eA(e,t,o){if(t.issues.length&&e.issues.push(...t.issues),o.issues.length&&e.issues.push(...o.issues),xr(e))return e;const n=yz(t.value,o.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const D20=n0("$ZodRecord",(e,t)=>{V1.init(e,t),e._zod.parse=(o,n)=>{const r=o.value;if(!Ur(r))return o.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),o;const a=[];if(t.keyType._zod.values){const i=t.keyType._zod.values;o.value={};for(const l of i)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){const u=t.valueType._zod.run({value:r[l],issues:[]},n);u instanceof Promise?a.push(u.then(O=>{O.issues.length&&o.issues.push(...kr(l,O.issues)),o.value[l]=O.value})):(u.issues.length&&o.issues.push(...kr(l,u.issues)),o.value[l]=u.value)}let b;for(const l in r)i.has(l)||(b=b??[],b.push(l));b&&b.length>0&&o.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:b})}else{o.value={};for(const i of Reflect.ownKeys(r)){if(i==="__proto__")continue;const b=t.keyType._zod.run({value:i,issues:[]},n);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(b.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:b.issues.map(u=>Zo(u,n,Qo())),input:i,path:[i],inst:e}),o.value[b.value]=b.value;continue}const l=t.valueType._zod.run({value:r[i],issues:[]},n);l instanceof Promise?a.push(l.then(u=>{u.issues.length&&o.issues.push(...kr(i,u.issues)),o.value[b.value]=u.value})):(l.issues.length&&o.issues.push(...kr(i,l.issues)),o.value[b.value]=l.value)}}return a.length?Promise.all(a).then(()=>o):o}}),I20=n0("$ZodEnum",(e,t)=>{V1.init(e,t);const o=ee0(t.entries),n=new Set(o);e._zod.values=n,e._zod.pattern=new RegExp(`^(${o.filter(r=>oe0.has(typeof r)).map(r=>typeof r=="string"?P3(r):r.toString()).join("|")})$`),e._zod.parse=(r,a)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:o,input:i,inst:e}),r}}),F20=n0("$ZodTransform",(e,t)=>{V1.init(e,t),e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new uW(e.constructor.name);const r=t.transform(o.value,o);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then(i=>(o.value=i,o));if(r instanceof Promise)throw new jr;return o.value=r,o}});function tA(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const H20=n0("$ZodOptional",(e,t)=>{V1.init(e,t),e._zod.optin="optional",e._zod.optout="optional",m1(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),m1(e._zod,"pattern",()=>{const o=t.innerType._zod.pattern;return o?new RegExp(`^(${Gd(o.source)})?$`):void 0}),e._zod.parse=(o,n)=>{if(t.innerType._zod.optin==="optional"){const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(a=>tA(a,o.value)):tA(r,o.value)}return o.value===void 0?o:t.innerType._zod.run(o,n)}}),U20=n0("$ZodNullable",(e,t)=>{V1.init(e,t),m1(e._zod,"optin",()=>t.innerType._zod.optin),m1(e._zod,"optout",()=>t.innerType._zod.optout),m1(e._zod,"pattern",()=>{const o=t.innerType._zod.pattern;return o?new RegExp(`^(${Gd(o.source)}|null)$`):void 0}),m1(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(o,n)=>o.value===null?o:t.innerType._zod.run(o,n)}),V20=n0("$ZodDefault",(e,t)=>{V1.init(e,t),e._zod.optin="optional",m1(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);if(o.value===void 0)return o.value=t.defaultValue,o;const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(a=>oA(a,t)):oA(r,t)}});function oA(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const $20=n0("$ZodPrefault",(e,t)=>{V1.init(e,t),e._zod.optin="optional",m1(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>(n.direction==="backward"||o.value===void 0&&(o.value=t.defaultValue),t.innerType._zod.run(o,n))}),Q20=n0("$ZodNonOptional",(e,t)=>{V1.init(e,t),m1(e._zod,"values",()=>{const o=t.innerType._zod.values;return o?new Set([...o].filter(n=>n!==void 0)):void 0}),e._zod.parse=(o,n)=>{const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(a=>nA(a,e)):nA(r,e)}});function nA(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Z20=n0("$ZodCatch",(e,t)=>{V1.init(e,t),m1(e._zod,"optin",()=>t.innerType._zod.optin),m1(e._zod,"optout",()=>t.innerType._zod.optout),m1(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(a=>(o.value=a.value,a.issues.length&&(o.value=t.catchValue({...o,error:{issues:a.issues.map(i=>Zo(i,n,Qo()))},input:o.value}),o.issues=[]),o)):(o.value=r.value,r.issues.length&&(o.value=t.catchValue({...o,error:{issues:r.issues.map(a=>Zo(a,n,Qo()))},input:o.value}),o.issues=[]),o)}}),G20=n0("$ZodPipe",(e,t)=>{V1.init(e,t),m1(e._zod,"values",()=>t.in._zod.values),m1(e._zod,"optin",()=>t.in._zod.optin),m1(e._zod,"optout",()=>t.out._zod.optout),m1(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,n)=>{if(n.direction==="backward"){const a=t.out._zod.run(o,n);return a instanceof Promise?a.then(i=>qi(i,t.in,n)):qi(a,t.in,n)}const r=t.in._zod.run(o,n);return r instanceof Promise?r.then(a=>qi(a,t.out,n)):qi(r,t.out,n)}});function qi(e,t,o){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},o)}const LW=n0("$ZodCodec",(e,t)=>{V1.init(e,t),m1(e._zod,"values",()=>t.in._zod.values),m1(e._zod,"optin",()=>t.in._zod.optin),m1(e._zod,"optout",()=>t.out._zod.optout),m1(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,n)=>{if((n.direction||"forward")==="forward"){const a=t.in._zod.run(o,n);return a instanceof Promise?a.then(i=>mi(i,t,n)):mi(a,t,n)}else{const a=t.out._zod.run(o,n);return a instanceof Promise?a.then(i=>mi(i,t,n)):mi(a,t,n)}}});function mi(e,t,o){if(e.issues.length)return e.aborted=!0,e;if((o.direction||"forward")==="forward"){const r=t.transform(e.value,e);return r instanceof Promise?r.then(a=>gi(e,a,t.out,o)):gi(e,r,t.out,o)}else{const r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(a=>gi(e,a,t.in,o)):gi(e,r,t.in,o)}}function gi(e,t,o,n){return e.issues.length?(e.aborted=!0,e):o._zod.run({value:t,issues:e.issues},n)}const K20=n0("$ZodReadonly",(e,t)=>{V1.init(e,t),m1(e._zod,"propValues",()=>t.innerType._zod.propValues),m1(e._zod,"values",()=>t.innerType._zod.values),m1(e._zod,"optin",()=>t.innerType._zod.optin),m1(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(rA):rA(r)}});function rA(e){return e.value=Object.freeze(e.value),e}const Y20=n0("$ZodCustom",(e,t)=>{N2.init(e,t),V1.init(e,t),e._zod.parse=(o,n)=>o,e._zod.check=o=>{const n=o.value,r=t.fn(n);if(r instanceof Promise)return r.then(a=>cA(a,o,n,e));cA(r,o,n,e)}});function cA(e,t,o,n){if(!e){const r={code:"custom",input:o,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(r.params=n._zod.def.params),t.issues.push(Oa(r))}}class J20{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...o){const n=o[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const o=this._map.get(t);return o&&typeof o=="object"&&"id"in o&&this._idmap.delete(o.id),this._map.delete(t),this}get(t){const o=t._zod.parent;if(o){const n={...this.get(o)??{}};delete n.id;const r={...n,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function et0(){return new J20}const Wi=et0();function tt0(e,t){return new e({type:"string",...D0(t)})}function ot0(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...D0(t)})}function aA(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...D0(t)})}function nt0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...D0(t)})}function rt0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...D0(t)})}function ct0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...D0(t)})}function at0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...D0(t)})}function st0(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...D0(t)})}function it0(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...D0(t)})}function pt0(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...D0(t)})}function Mt0(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...D0(t)})}function bt0(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...D0(t)})}function lt0(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...D0(t)})}function zt0(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...D0(t)})}function ut0(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...D0(t)})}function dt0(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...D0(t)})}function Ot0(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...D0(t)})}function ft0(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...D0(t)})}function At0(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...D0(t)})}function ht0(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...D0(t)})}function qt0(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...D0(t)})}function mt0(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...D0(t)})}function gt0(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...D0(t)})}function Wt0(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...D0(t)})}function vt0(e,t){return new e({type:"string",format:"date",check:"string_format",...D0(t)})}function Rt0(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...D0(t)})}function yt0(e,t){return new e({type:"string",format:"duration",check:"string_format",...D0(t)})}function wt0(e,t){return new e({type:"boolean",...D0(t)})}function Lt0(e){return new e({type:"unknown"})}function xt0(e,t){return new e({type:"never",...D0(t)})}function kt0(e,t){return new e({type:"date",...D0(t)})}function Ct0(e,t){return new Qe0({check:"less_than",...D0(t),value:e,inclusive:!0})}function Nt0(e,t){return new Ze0({check:"greater_than",...D0(t),value:e,inclusive:!0})}function xW(e,t){return new Ge0({check:"max_length",...D0(t),maximum:e})}function Wp(e,t){return new Ke0({check:"min_length",...D0(t),minimum:e})}function kW(e,t){return new Ye0({check:"length_equals",...D0(t),length:e})}function Bt0(e,t){return new Je0({check:"string_format",format:"regex",...D0(t),pattern:e})}function _t0(e){return new e20({check:"string_format",format:"lowercase",...D0(e)})}function Et0(e){return new t20({check:"string_format",format:"uppercase",...D0(e)})}function St0(e,t){return new o20({check:"string_format",format:"includes",...D0(t),includes:e})}function Tt0(e,t){return new n20({check:"string_format",format:"starts_with",...D0(t),prefix:e})}function Pt0(e,t){return new r20({check:"string_format",format:"ends_with",...D0(t),suffix:e})}function Ua(e){return new c20({check:"overwrite",tx:e})}function Xt0(e){return Ua(t=>t.normalize(e))}function jt0(){return Ua(e=>e.trim())}function Dt0(){return Ua(e=>e.toLowerCase())}function It0(){return Ua(e=>e.toUpperCase())}function Ft0(e,t,o){return new e({type:"array",element:t,...D0(o)})}function Ht0(e,t,o){return new e({type:"custom",check:"custom",fn:t,...D0(o)})}function Ut0(e){const t=Vt0(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(Oa(n,o.value,t._zod.def));else{const r=n;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=o.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),o.issues.push(Oa(r))}},e(o.value,o)));return t}function Vt0(e,t){const o=new N2({check:"custom",...D0(t)});return o._zod.check=e,o}function $t0(e,t){const o=D0(t);let n=o.truthy??["true","1","yes","on","y","enabled"],r=o.falsy??["false","0","no","off","n","disabled"];o.case!=="sensitive"&&(n=n.map(q=>typeof q=="string"?q.toLowerCase():q),r=r.map(q=>typeof q=="string"?q.toLowerCase():q));const a=new Set(n),i=new Set(r),b=e.Codec??LW,l=e.Boolean??RW,u=e.String??U3,O=new u({type:"string",error:o.error}),f=new l({type:"boolean",error:o.error}),h=new b({type:"pipe",in:O,out:f,transform:((q,g)=>{let W=q;return o.case!=="sensitive"&&(W=W.toLowerCase()),a.has(W)?!0:i.has(W)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...a,...i],input:g.value,inst:h,continue:!1}),{})}),reverseTransform:((q,g)=>q===!0?n[0]||"true":r[0]||"false"),error:o.error});return h}const Qt0=n0("ZodISODateTime",(e,t)=>{h20.init(e,t),$1.init(e,t)});function CW(e){return Wt0(Qt0,e)}const Zt0=n0("ZodISODate",(e,t)=>{q20.init(e,t),$1.init(e,t)});function Gt0(e){return vt0(Zt0,e)}const Kt0=n0("ZodISOTime",(e,t)=>{m20.init(e,t),$1.init(e,t)});function Yt0(e){return Rt0(Kt0,e)}const Jt0=n0("ZodISODuration",(e,t)=>{g20.init(e,t),$1.init(e,t)});function eo0(e){return yt0(Jt0,e)}const to0=(e,t)=>{hW.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o=>le0(e,o)},flatten:{value:o=>be0(e,o)},addIssue:{value:o=>{e.issues.push(o),e.message=JSON.stringify(e.issues,Rz,2)}},addIssues:{value:o=>{e.issues.push(...o),e.message=JSON.stringify(e.issues,Rz,2)}},isEmpty:{get(){return e.issues.length===0}}})},B2=n0("ZodError",to0,{Parent:Error}),oo0=j3(B2),no0=D3(B2),ro0=I3(B2),co0=F3(B2),ao0=de0(B2),so0=Oe0(B2),io0=fe0(B2),po0=Ae0(B2),Mo0=he0(B2),bo0=qe0(B2),lo0=me0(B2),zo0=ge0(B2),ce=n0("ZodType",(e,t)=>(V1.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...o)=>e.clone(Yn(t,{checks:[...t.checks??[],...o.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]})),e.clone=(o,n)=>tn(e,o,n),e.brand=()=>e,e.register=((o,n)=>(o.add(e,n),e)),e.parse=(o,n)=>oo0(e,o,n,{callee:e.parse}),e.safeParse=(o,n)=>ro0(e,o,n),e.parseAsync=async(o,n)=>no0(e,o,n,{callee:e.parseAsync}),e.safeParseAsync=async(o,n)=>co0(e,o,n),e.spa=e.safeParseAsync,e.encode=(o,n)=>ao0(e,o,n),e.decode=(o,n)=>so0(e,o,n),e.encodeAsync=async(o,n)=>io0(e,o,n),e.decodeAsync=async(o,n)=>po0(e,o,n),e.safeEncode=(o,n)=>Mo0(e,o,n),e.safeDecode=(o,n)=>bo0(e,o,n),e.safeEncodeAsync=async(o,n)=>lo0(e,o,n),e.safeDecodeAsync=async(o,n)=>zo0(e,o,n),e.refine=(o,n)=>e.check(rn0(o,n)),e.superRefine=o=>e.check(cn0(o)),e.overwrite=o=>e.check(Ua(o)),e.optional=()=>iA(e),e.nullable=()=>pA(e),e.nullish=()=>iA(pA(e)),e.nonoptional=o=>Ko0(e,o),e.array=()=>Yd(e),e.or=o=>Po0([e,o]),e.and=o=>jo0(e,o),e.transform=o=>MA(e,Uo0(o)),e.default=o=>Qo0(e,o),e.prefault=o=>Go0(e,o),e.catch=o=>Jo0(e,o),e.pipe=o=>MA(e,o),e.readonly=()=>on0(e),e.describe=o=>{const n=e.clone();return Wi.add(n,{description:o}),n},Object.defineProperty(e,"description",{get(){return Wi.get(e)?.description},configurable:!0}),e.meta=(...o)=>{if(o.length===0)return Wi.get(e);const n=e.clone();return Wi.add(n,o[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),NW=n0("_ZodString",(e,t)=>{U3.init(e,t),ce.init(e,t);const o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,e.regex=(...n)=>e.check(Bt0(...n)),e.includes=(...n)=>e.check(St0(...n)),e.startsWith=(...n)=>e.check(Tt0(...n)),e.endsWith=(...n)=>e.check(Pt0(...n)),e.min=(...n)=>e.check(Wp(...n)),e.max=(...n)=>e.check(xW(...n)),e.length=(...n)=>e.check(kW(...n)),e.nonempty=(...n)=>e.check(Wp(1,...n)),e.lowercase=n=>e.check(_t0(n)),e.uppercase=n=>e.check(Et0(n)),e.trim=()=>e.check(jt0()),e.normalize=(...n)=>e.check(Xt0(...n)),e.toLowerCase=()=>e.check(Dt0()),e.toUpperCase=()=>e.check(It0())}),BW=n0("ZodString",(e,t)=>{U3.init(e,t),NW.init(e,t),e.email=o=>e.check(ot0(uo0,o)),e.url=o=>e.check(st0(do0,o)),e.jwt=o=>e.check(gt0(ko0,o)),e.emoji=o=>e.check(it0(Oo0,o)),e.guid=o=>e.check(aA(sA,o)),e.uuid=o=>e.check(nt0(vi,o)),e.uuidv4=o=>e.check(rt0(vi,o)),e.uuidv6=o=>e.check(ct0(vi,o)),e.uuidv7=o=>e.check(at0(vi,o)),e.nanoid=o=>e.check(pt0(fo0,o)),e.guid=o=>e.check(aA(sA,o)),e.cuid=o=>e.check(Mt0(Ao0,o)),e.cuid2=o=>e.check(bt0(ho0,o)),e.ulid=o=>e.check(lt0(qo0,o)),e.base64=o=>e.check(ht0(wo0,o)),e.base64url=o=>e.check(qt0(Lo0,o)),e.xid=o=>e.check(zt0(mo0,o)),e.ksuid=o=>e.check(ut0(go0,o)),e.ipv4=o=>e.check(dt0(Wo0,o)),e.ipv6=o=>e.check(Ot0(vo0,o)),e.cidrv4=o=>e.check(ft0(Ro0,o)),e.cidrv6=o=>e.check(At0(yo0,o)),e.e164=o=>e.check(mt0(xo0,o)),e.datetime=o=>e.check(CW(o)),e.date=o=>e.check(Gt0(o)),e.time=o=>e.check(Yt0(o)),e.duration=o=>e.check(eo0(o))});function s2(e){return tt0(BW,e)}const $1=n0("ZodStringFormat",(e,t)=>{I1.init(e,t),NW.init(e,t)}),uo0=n0("ZodEmail",(e,t)=>{M20.init(e,t),$1.init(e,t)}),sA=n0("ZodGUID",(e,t)=>{i20.init(e,t),$1.init(e,t)}),vi=n0("ZodUUID",(e,t)=>{p20.init(e,t),$1.init(e,t)}),do0=n0("ZodURL",(e,t)=>{b20.init(e,t),$1.init(e,t)}),Oo0=n0("ZodEmoji",(e,t)=>{l20.init(e,t),$1.init(e,t)}),fo0=n0("ZodNanoID",(e,t)=>{z20.init(e,t),$1.init(e,t)}),Ao0=n0("ZodCUID",(e,t)=>{u20.init(e,t),$1.init(e,t)}),ho0=n0("ZodCUID2",(e,t)=>{d20.init(e,t),$1.init(e,t)}),qo0=n0("ZodULID",(e,t)=>{O20.init(e,t),$1.init(e,t)}),mo0=n0("ZodXID",(e,t)=>{f20.init(e,t),$1.init(e,t)}),go0=n0("ZodKSUID",(e,t)=>{A20.init(e,t),$1.init(e,t)}),Wo0=n0("ZodIPv4",(e,t)=>{W20.init(e,t),$1.init(e,t)}),vo0=n0("ZodIPv6",(e,t)=>{v20.init(e,t),$1.init(e,t)}),Ro0=n0("ZodCIDRv4",(e,t)=>{R20.init(e,t),$1.init(e,t)}),yo0=n0("ZodCIDRv6",(e,t)=>{y20.init(e,t),$1.init(e,t)}),wo0=n0("ZodBase64",(e,t)=>{w20.init(e,t),$1.init(e,t)}),Lo0=n0("ZodBase64URL",(e,t)=>{x20.init(e,t),$1.init(e,t)}),xo0=n0("ZodE164",(e,t)=>{k20.init(e,t),$1.init(e,t)}),ko0=n0("ZodJWT",(e,t)=>{N20.init(e,t),$1.init(e,t)}),_W=n0("ZodBoolean",(e,t)=>{RW.init(e,t),ce.init(e,t)});function wz(e){return wt0(_W,e)}const Co0=n0("ZodUnknown",(e,t)=>{B20.init(e,t),ce.init(e,t)});function Lz(){return Lt0(Co0)}const No0=n0("ZodNever",(e,t)=>{_20.init(e,t),ce.init(e,t)});function Bo0(e){return xt0(No0,e)}const _o0=n0("ZodDate",(e,t)=>{E20.init(e,t),ce.init(e,t),e.min=(n,r)=>e.check(Nt0(n,r)),e.max=(n,r)=>e.check(Ct0(n,r));const o=e._zod.bag;e.minDate=o.minimum?new Date(o.minimum):null,e.maxDate=o.maximum?new Date(o.maximum):null});function Eo0(e){return kt0(_o0,e)}const So0=n0("ZodArray",(e,t)=>{S20.init(e,t),ce.init(e,t),e.element=t.element,e.min=(o,n)=>e.check(Wp(o,n)),e.nonempty=o=>e.check(Wp(1,o)),e.max=(o,n)=>e.check(xW(o,n)),e.length=(o,n)=>e.check(kW(o,n)),e.unwrap=()=>e.element});function Yd(e,t){return Ft0(So0,e,t)}const EW=n0("ZodObject",(e,t)=>{P20.init(e,t),ce.init(e,t),m1(e,"shape",()=>t.shape),e.keyof=()=>Fo0(Object.keys(e._zod.def.shape)),e.catchall=o=>e.clone({...e._zod.def,catchall:o}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Lz()}),e.loose=()=>e.clone({...e._zod.def,catchall:Lz()}),e.strict=()=>e.clone({...e._zod.def,catchall:Bo0()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=o=>ae0(e,o),e.safeExtend=o=>se0(e,o),e.merge=o=>ie0(e,o),e.pick=o=>re0(e,o),e.omit=o=>ce0(e,o),e.partial=(...o)=>pe0(SW,e,o[0]),e.required=(...o)=>Me0(TW,e,o[0])});function vp(e,t){const o={type:"object",shape:e??{},...D0(t)};return new EW(o)}function V3(e,t){return new EW({type:"object",shape:e,catchall:Lz(),...D0(t)})}const To0=n0("ZodUnion",(e,t)=>{X20.init(e,t),ce.init(e,t),e.options=t.options});function Po0(e,t){return new To0({type:"union",options:e,...D0(t)})}const Xo0=n0("ZodIntersection",(e,t)=>{j20.init(e,t),ce.init(e,t)});function jo0(e,t){return new Xo0({type:"intersection",left:e,right:t})}const Do0=n0("ZodRecord",(e,t)=>{D20.init(e,t),ce.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Io0(e,t,o){return new Do0({type:"record",keyType:e,valueType:t,...D0(o)})}const xz=n0("ZodEnum",(e,t)=>{I20.init(e,t),ce.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const o=new Set(Object.keys(t.entries));e.extract=(n,r)=>{const a={};for(const i of n)if(o.has(i))a[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new xz({...t,checks:[],...D0(r),entries:a})},e.exclude=(n,r)=>{const a={...t.entries};for(const i of n)if(o.has(i))delete a[i];else throw new Error(`Key ${i} not found in enum`);return new xz({...t,checks:[],...D0(r),entries:a})}});function Fo0(e,t){const o=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new xz({type:"enum",entries:o,...D0(t)})}const Ho0=n0("ZodTransform",(e,t)=>{F20.init(e,t),ce.init(e,t),e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new uW(e.constructor.name);o.addIssue=a=>{if(typeof a=="string")o.issues.push(Oa(a,o.value,t));else{const i=a;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=e),o.issues.push(Oa(i))}};const r=t.transform(o.value,o);return r instanceof Promise?r.then(a=>(o.value=a,o)):(o.value=r,o)}});function Uo0(e){return new Ho0({type:"transform",transform:e})}const SW=n0("ZodOptional",(e,t)=>{H20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function iA(e){return new SW({type:"optional",innerType:e})}const Vo0=n0("ZodNullable",(e,t)=>{U20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function pA(e){return new Vo0({type:"nullable",innerType:e})}const $o0=n0("ZodDefault",(e,t)=>{V20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Qo0(e,t){return new $o0({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():fW(t)}})}const Zo0=n0("ZodPrefault",(e,t)=>{$20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Go0(e,t){return new Zo0({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():fW(t)}})}const TW=n0("ZodNonOptional",(e,t)=>{Q20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ko0(e,t){return new TW({type:"nonoptional",innerType:e,...D0(t)})}const Yo0=n0("ZodCatch",(e,t)=>{Z20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Jo0(e,t){return new Yo0({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const PW=n0("ZodPipe",(e,t)=>{G20.init(e,t),ce.init(e,t),e.in=t.in,e.out=t.out});function MA(e,t){return new PW({type:"pipe",in:e,out:t})}const XW=n0("ZodCodec",(e,t)=>{PW.init(e,t),LW.init(e,t)});function en0(e,t,o){return new XW({type:"pipe",in:e,out:t,transform:o.decode,reverseTransform:o.encode})}const tn0=n0("ZodReadonly",(e,t)=>{K20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function on0(e){return new tn0({type:"readonly",innerType:e})}const nn0=n0("ZodCustom",(e,t)=>{Y20.init(e,t),ce.init(e,t)});function rn0(e,t={}){return Ht0(nn0,e,t)}function cn0(e){return Ut0(e)}const an0=(...e)=>$t0({Codec:XW,Boolean:_W,String:BW},...e),jW=en0(CW({offset:!0}),Eo0(),{decode:e=>new Date(e),encode:e=>e.toISOString()}),sn0=V3({slug:s2(),title:s2(),custom_excerpt:s2(),url:s2().url(),published_at:jW,featured:an0(),feature_image:s2().url().optional(),html:s2().optional()}).transform(e=>({slug:e.slug,title:e.title,customExcerpt:e.custom_excerpt,url:e.url,publishedAt:e.published_at,featured:e.featured,featureImage:e.feature_image,html:e.html})),in0=vp({posts:Yd(sn0).default([]),changelogUrl:s2().url().default("https://ghost.org/changelog")}).transform(e=>({entries:e.posts,changelogUrl:e.changelogUrl})),$3=()=>L2({queryKey:["changelog"],queryFn:async()=>{const e=await fetch("https://ghost.org/changelog.json");if(!e.ok)throw new Error(`Failed to fetch changelog: ${e.status}`);const t=await e.json();return in0.parse(t)},staleTime:1/0});function bA(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function DW(e,t){const o={...e};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const r=t[n],a=e[n];r!==void 0&&(bA(r)&&bA(a)?o[n]=DW(a,r):o[n]=r)}return o}const pn0=V3({lastSeenDate:jW.optional().catch(void 0)}),lA={expanded:{posts:!0},menu:{visible:!0}},Mn0=V3({expanded:vp({posts:wz()}),menu:vp({visible:wz()})}),kz=V3({whatsNew:pn0.optional().catch(void 0),nightShift:wz().optional(),navigation:Mn0.default(lA).catch(lA)}),IW=e=>["userPreferences",e?.id,e?.accessibility];function Q3(e){const{data:t}=qe();return L2({...e,queryKey:IW(t),queryFn:()=>{if(!t)throw new Error("User not loaded");const o=t.accessibility||"{}",n=JSON.parse(o);return kz.parse(n)},enabled:!!t,staleTime:1/0,cacheTime:0})}const Z3=()=>{const e=f1(),{data:t}=qe(),{mutateAsync:o}=lW();return Y1({mutationFn:async n=>{if(!t)throw new Error("User is not loaded");const r=e.getQueryData(IW(t))??kz.parse({}),a=DW(r,n),i=kz.encode(a);await o({...t,accessibility:JSON.stringify(i)})}})};function bn0(){return{lastSeenDate:new Date}}const ln0=(e,t)=>["whatsNew",e?.whatsNew?.lastSeenDate?.toISOString(),t?.publishedAt.toISOString()],FW=()=>{const{data:e,isSuccess:t}=Q3(),{data:o,isSuccess:n}=$3(),{mutateAsync:r}=Z3(),a=!!e?.whatsNew?.lastSeenDate;p.useEffect(()=>{!a&&t&&r({whatsNew:bn0()})},[a,t,r]);const i=o?.entries[0];return L2({queryKey:ln0(e,i),queryFn:()=>{if(!i)return{hasNew:!1,hasNewFeatured:!1};const b=e.whatsNew.lastSeenDate,l=i.publishedAt>b,u=l&&i.featured===!0;return{hasNew:l,hasNewFeatured:u}},enabled:n&&a,staleTime:1/0,cacheTime:0})},HW=()=>{const{data:e}=$3(),{mutateAsync:t}=Z3();return Y1({mutationFn:async()=>{const o=e?.entries[0];if(!o)return;const n={lastSeenDate:o.publishedAt};await t({whatsNew:n})}})};function zn0(e){return e.toLocaleDateString("en-GB",{day:"2-digit",month:"long",year:"numeric"})}function un0({entry:e}){return z.jsxs("a",{className:"flex items-start gap-6 p-2 -mx-2 rounded-md hover:bg-muted/80 transition-colors","data-test-entry":!0,href:e.url,rel:"noopener noreferrer",target:"_blank",children:[e.featureImage&&z.jsx("img",{alt:e.title,className:"flex-shrink-0 w-40 h-[110px] object-cover rounded","data-test-entry-image":!0,src:e.featureImage}),z.jsxs("div",{className:"flex flex-col gap-2 min-w-0 flex-1",children:[z.jsx("h2",{className:"text-[17px] font-semibold text-foreground mt-1.5","data-test-entry-title":!0,children:e.title}),z.jsx("p",{className:"text-sm text-gray-700 leading-[1.45] line-clamp-2","data-test-entry-excerpt":!0,children:e.customExcerpt}),z.jsx("span",{className:"text-sm text-gray-600","data-test-entry-date":!0,children:zn0(e.publishedAt)})]})]})}function dn0({open:e,onOpenChange:t}){const{data:o}=$3(),{mutate:n}=HW();return p.useEffect(()=>{e&&n()},[e,n]),z.jsx(m3,{open:e,onOpenChange:t,children:z.jsxs(Ta,{className:"max-w-2xl max-h-[85vh] flex flex-col","data-test-modal":"whats-new",role:"dialog","aria-modal":"true","aria-labelledby":"whats-new-modal-title",children:[z.jsx(yd,{children:z.jsx(Ld,{id:"whats-new-modal-title","data-test-modal-title":!0,className:"text-2xl tracking-tighter",children:"What’s new?"})}),o?z.jsxs(z.Fragment,{children:[z.jsx("section",{className:"flex-1 overflow-y-auto space-y-2 -mx-6 px-6","data-test-entries":!0,children:o.entries.map(r=>z.jsx(un0,{entry:r},r.slug))}),z.jsxs(wd,{className:"flex-row justify-between sm:justify-between gap-3",children:[z.jsx(o1,{asChild:!0,variant:"outline",children:z.jsx("a",{href:`${o.changelogUrl}#/portal/signup`,rel:"noopener noreferrer",target:"_blank",children:"Turn on notifications"})}),z.jsx(o1,{asChild:!0,children:z.jsx("a",{href:o.changelogUrl,rel:"noopener noreferrer",target:"_blank",children:"All updates →"})})]})]}):z.jsx("div",{className:"flex-1 flex items-center justify-center py-12",children:z.jsx(hp,{size:"lg"})})]})})}function UW(){const e=pW(),t=!!e?.subscription?.isActiveTrial,o=e?.subscription?.trial_end?Math.ceil((new Date(e.subscription.trial_end).getTime()-Date.now())/(1e3*60*60*24)):0;return{showUpgradeBanner:t,trialDaysRemaining:o}}function On0({children:e,...t}){return z.jsx("span",{className:"flex-1",...t,children:e})}const Ie=({children:e,...t})=>z.jsx(Um,{className:"cursor-pointer text-base",asChild:!0,...t,children:e});Ie.Label=On0;function Rp(e){const t=qe();return z.jsxs(hd,{...e,children:[t.data?.profile_image&&z.jsx(qd,{src:t.data?.profile_image}),z.jsx(md,{className:"text-foreground-muted hover:text-foreground",children:z.jsx(fd,{})})]})}function VW({name:e,email:t,children:o}){return z.jsx("div",{className:"p-3",children:z.jsxs("div",{className:"flex items-center gap-3",children:[o,z.jsxs("div",{className:"flex flex-col",children:[z.jsx("span",{className:"text-base font-semibold text-foreground",children:e}),z.jsx("span",{className:"text-xs text-foreground-muted -mt-px",children:t})]})]})})}function $W(){const e=qe();return z.jsx(Ie,{children:z.jsxs(Ba,{to:`/settings/staff/${e.data?.slug}`,children:[z.jsx(fd,{}),z.jsx(Ie.Label,{children:"Your profile"})]})})}function QW(){const{data:e}=Q3(),{mutateAsync:t,isLoading:o}=Z3(),n=r=>{t({nightShift:r})};return z.jsxs(Ie,{asChild:!1,onSelect:r=>{r.preventDefault(),n(!e?.nightShift)},children:[z.jsx(eG,{}),z.jsx(Ie.Label,{className:"flex-1",children:"Dark mode"}),z.jsx(eg,{size:"sm",checked:e?.nightShift??!1,disabled:o,onCheckedChange:n,onClick:r=>r.stopPropagation(),tabIndex:-1})]})}function ZW(){const e=()=>{fetch("/ghost/api/admin/session",{method:"DELETE"}).then(()=>{window.location.href="/ghost"}).catch(t=>{console.error(t)})};return z.jsxs(Ie,{asChild:!1,onSelect:e,children:[z.jsx(UZ,{}),z.jsx(Ie.Label,{children:"Sign out"})]})}function fn0(e){const t=qe(),{data:o}=FW(),{showUpgradeBanner:n}=UW();return z.jsxs(Fm,{...e,children:[z.jsx(Hm,{asChild:!0,className:"focus-visible:ring-0",children:z.jsxs(B3,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground","aria-label":"User menu",children:[z.jsxs("div",{className:"relative",children:[z.jsx(Rp,{}),o?.hasNew&&z.jsx("span",{className:"absolute -top-0.5 -right-0.5",children:z.jsx(Vf,{variant:"success",size:"sm",label:"New updates available","data-test-whats-new-avatar-badge":!0})})]}),z.jsxs("div",{className:"grid flex-1 text-left text-base leading-tight",children:[z.jsx("span",{className:"truncate font-semibold",children:t.data?.name}),z.jsx("span",{className:"text-muted-foreground truncate text-xs -mt-px",children:t.data?.email})]}),z.jsx(AZ,{className:"ml-auto size-4 text-grey-700","data-test-nav":"arrow-down"})]})}),z.jsxs(Sd,{align:"end",sideOffset:10,className:`w-full min-w-[240px] sidebar:min-w-[260px] ${n?"shadow-[0_18px_80px_0_rgba(0,0,0,0.07),0_7.52px_33.422px_0_rgba(0,0,0,0.05),0_4.021px_17.869px_0_rgba(0,0,0,0.04),0_2.254px_10.017px_0_rgba(0,0,0,0.04),0_1.197px_5.32px_0_rgba(0,0,0,0.03),0_0.498px_2.214px_0_rgba(0,0,0,0.02)]":""}`,children:[z.jsx(VW,{name:t.data?.name,email:t.data?.email,children:z.jsx(Rp,{})}),z.jsx(Bn,{}),z.jsxs(Ie,{"data-test-nav":"whatsnew",asChild:!1,onSelect:()=>{queueMicrotask(()=>e.onOpenWhatsNew?.())},children:[z.jsx(b9,{}),z.jsx(Ie.Label,{children:"What’s new?"}),o?.hasNew&&z.jsx("div",{className:"flex-1 flex justify-end",children:z.jsx(Vf,{variant:"success",size:"sm",label:"New updates available","data-test-whats-new-menu-badge":!0})})]}),z.jsx($W,{}),z.jsx(Bn,{}),z.jsx(Ie,{children:z.jsxs("a",{href:"https://ghost.org/resources?utm_source=admin&utm_campaign=resources",target:"_blank",rel:"noopener noreferrer",children:[z.jsx(MZ,{}),z.jsx(Ie.Label,{children:"Resources & guides"})]})}),z.jsx(QW,{}),z.jsx(Bn,{}),z.jsx(ZW,{})]})]})}function An0(){const e=qe(),o=T3().data?.site.url??"";return z.jsxs(Fm,{children:[z.jsx(Hm,{asChild:!0,children:z.jsx("button",{className:"rounded-full shadow-lg hover:shadow-xl transition-shadow focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 p-0.5 flex items-center justify-center border border-border dark:bg-muted bg-background","aria-label":"Open user menu",children:z.jsx(Rp,{className:"w-11 h-11"})})}),z.jsxs(Sd,{align:"start",side:"top",sideOffset:10,className:"w-full min-w-[240px] mb-2",children:[z.jsx(VW,{name:e.data?.name,email:e.data?.email,children:z.jsx(Rp,{})}),z.jsx(Bn,{}),z.jsx(Ie,{children:z.jsxs(Ba,{to:"/",children:[z.jsx(NZ,{}),z.jsx(Ie.Label,{children:"Posts"})]})}),z.jsx(Ie,{children:z.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",children:[z.jsx(zd,{}),z.jsx(Ie.Label,{children:"View site"})]})}),z.jsx(Bn,{}),z.jsx($W,{}),z.jsx(QW,{}),z.jsx(Bn,{}),z.jsx(ZW,{})]})]})}function hn0({...e}){const[t,o]=p.useState(!1);return z.jsxs(z.Fragment,{children:[z.jsx(eW,{...e,children:z.jsx(oc,{children:z.jsx(nc,{children:z.jsx(Vd,{children:z.jsx(fn0,{onOpenWhatsNew:()=>o(!0)})})})})}),z.jsx(dn0,{open:t,onOpenChange:o})]})}function qn0(){const{data:e}=FW(),{data:t}=$3(),{mutate:o}=HW(),[n,r]=p.useState(!1);if(n||!e?.hasNewFeatured)return null;const a=t?.entries[0];if(!a)return null;const i=()=>{r(!0),o()},b=()=>{o()};return z.jsx(gd,{"data-test-toast":"whats-new",role:"status","aria-label":"What’s new notification","aria-live":"polite",variant:"gradient",dismissible:!0,onDismiss:i,children:z.jsxs("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"block pr-8",onClick:b,"data-test-toast-link":!0,children:[z.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[z.jsx(b9,{className:"size-4 text-purple-600"}),z.jsx("span",{className:"text-xs font-semibold text-gray-700 uppercase tracking-wide",children:"What’s new?"})]}),z.jsx("div",{className:"text-base font-semibold text-gray-900 mb-1","data-test-toast-title":!0,children:a.title}),z.jsx("div",{className:"text-sm text-gray-700","data-test-toast-excerpt":!0,children:a.customExcerpt})]})})}const yp="SettingsResponseType",G3=Fn({dataType:yp,path:"/settings/",defaultSearchParams:{group:"site,theme,private,members,portal,newsletter,email,labs,slack,unsplash,views,firstpromoter,editor,comments,analytics,announcement,pintura,donations,security,social_web,explore"}}),jc0=Hn({method:"PUT",path:()=>"/settings/",body:e=>({settings:e.map(({key:t,value:o})=>({key:t,value:o}))}),updateQueries:{dataType:yp,emberUpdateType:"createOrUpdate",update:e=>({...e,settings:e.settings})},invalidateQueries:{filters:{predicate(e){return e.queryKey[0]!==yp}}}}),Dc0=Hn({method:"DELETE",path:()=>"/settings/stripe/connect/",invalidateQueries:{dataType:yp}}),Ic0=Hn({method:"POST",path:()=>"/slack/test/"});function Fc0(e){const t=["API","CTA","RSS"];return e.replace(/^[a-z]/,o=>o.toUpperCase()).replace(/_/g," ").replace(new RegExp(`\\b(${t.join("|")})\\b`,"ig"),o=>o.toUpperCase())}function Hc0(e,t){return t.map(o=>{var n;return(n=e?.find(r=>r.key===o))==null?void 0:n.value})}function Tt(e,t){if(!e)return null;const o=e.find(n=>n.key===t);return o?.value||null}function Uc0(e,t){if(!e)return;const o=e.find(n=>n.key===t);return o?.is_read_only||!1}function Vc0(e,t){const o=a=>e.some(i=>i.key===a&&i.value),n=o("stripe_secret_key")&&o("stripe_publishable_key"),r=o("stripe_connect_secret_key")&&o("stripe_connect_publishable_key");return t.stripeDirect?n:r||n}const Jd=[],GW=p.createContext(void 0),mn0=({children:e})=>{const t=we(),[o,n]=p.useState(()=>{const i=localStorage.getItem("featureFlags");return i?JSON.parse(i):gn0()});p.useEffect(()=>{const i=Wn0(t.search);Object.keys(i).length>0&&n(b=>{const l={...b,...i};return localStorage.setItem("featureFlags",JSON.stringify(l)),l})},[t.search]);const a={isEnabled:i=>o[i]??!1,flags:o,allFlags:Jd};return z.jsx(GW.Provider,{value:a,children:e})},gn0=()=>Jd.reduce((e,t)=>({...e,[t]:!1}),{}),Wn0=e=>{const t=new URLSearchParams(e),o={};return Jd.forEach(n=>{const r=t.get(n);r==="ON"?o[n]=!0:r==="OFF"&&(o[n]=!1)}),o},vn0=()=>{const e=p.useContext(GW);if(e===void 0)throw new Error("useFeatureFlags must be used within a FeatureFlagsProvider");return e};function K3(){const t=Iu().find(o=>o.handle==="activitypub-basepath")?.pathname??"";return t.endsWith("/")?t.slice(0,-1):t}function Jt(){const e=rW(),t=K3();return p.useCallback((o,n)=>{if(typeof o=="number"){e(o,n);return}o.startsWith("/")?e(`${t}${o}`,n):e(o,n)},[e,t])}const KW=({className:e,onClick:t})=>{const o=Jt(),{previousPath:n}=Jp();return z.jsx(o1,{className:g0("size-9 rounded-full bg-white/85 px-2 backdrop-blur-md dark:bg-black/85 dark:text-white [&_svg]:size-6 focus-visible:ring-0",e),variant:"ghost",onClick:()=>{if(t){t();return}o(n?-1:"/")},children:z.jsx(oZ,{size:24,strokeWidth:1.25})})},Rn0=()=>{const e=we(),t=Pt(pv,e.pathname);if(!t)return null;const o=t.map(n=>n.route).filter(n=>n.pageTitle);return o[o.length-1]||t[t.length-1].route};function YW(){const e=Iu(),t=e.findIndex(l=>l.handle==="activitypub-basepath");if(t===-1)return"";const o=e[t+1];if(!o)return"";const r=e[t].pathname,a=o.pathname;let i=a.startsWith(r)?a.slice(r.length):a;return i=i.replace(/^\//,""),i.split("/")[0]}const yn0=({title:e,backIcon:t})=>t?z.jsx(KW,{className:"-ml-2"}):z.jsx(oW,{className:"max-md:text-[2.4rem]",children:e}),zA=({onToggleMobileSidebar:e})=>z.jsx(o1,{className:"px:0 mr-[-9px] w-[34px] rounded-full bg-white/85 backdrop-blur-md lg:hidden dark:bg-black/85 dark:text-white",variant:"ghost",onClick:e,children:z.jsx($Z,{className:"!size-5"})}),wn0=({onToggleMobileSidebar:e,showBorder:t=!0})=>{const{canGoBack:o}=Jp(),n=YW(),r=R10(),a=Rn0();let i=!1;n==="profile"&&(i=!0),n==="notes"&&o&&(i=!0);const b=o&&r||a?.showBackButton===!0;return z.jsx(z.Fragment,{children:i?z.jsxs("div",{className:"sticky left-0 top-8 z-50 inline-block max-lg:flex max-lg:items-center max-lg:justify-between max-lg:pr-[15.5px] max-md:top-4",children:[z.jsx("div",{children:b&&z.jsx(KW,{className:"ml-6 max-md:ml-[10px]"})}),!b&&z.jsx(zA,{onToggleMobileSidebar:e})]}):z.jsx("div",{className:"sticky top-0 z-50 bg-white/85 backdrop-blur-md dark:bg-black",children:z.jsxs("div",{className:`relative flex h-[102px] items-center justify-between gap-5 px-[min(4vw,32px)] max-md:h-[68px] ${t?'before:absolute before:inset-x-[min(4vw,32px)] before:bottom-0 before:block before:border-b before:border-gray-200 before:content-[""] before:dark:border-gray-950':""}`,children:[z.jsx(yn0,{backIcon:b,title:a?.pageTitle||""}),z.jsx(zA,{onToggleMobileSidebar:e})]})})})};function Po(e){if(!e.preferredUsername||!e.id)return"@unknown@unknown";try{return`@${e.preferredUsername}@${new URL(e.id).hostname.replace(/^www\./,"")}`}catch{return"@unknown@unknown"}}var Cz=(e=>(e[e.Note=0]="Note",e[e.Article=1]="Article",e[e.Tombstone=2]="Tombstone",e))(Cz||{});const Ln0=e=>typeof e=="object"&&e!==null&&"statusCode"in e&&"message"in e&&typeof e.statusCode=="number"&&typeof e.message=="string";class xn0{constructor(t,o,n,r=window.fetch.bind(window)){this.apiUrl=t,this.authApiUrl=o,this.handle=n,this.fetch=r}async getToken(){try{return(await(await this.fetch(this.authApiUrl)).json())?.identities?.[0]?.token||null}catch{return null}}async fetchJSON(t,o="GET",n){const r=await this.getToken(),a={method:o,headers:{Authorization:`Bearer ${r}`,Accept:"application/activity+json"}};n&&(a.body=JSON.stringify(n),a.headers["Content-Type"]="application/json");const i=await this.fetch(t,a);if(i.status===204||i.status===202)return null;if(!i.ok){const b={message:"Something went wrong, please try again.",statusCode:i.status};try{const l=await i.json(),u=l.message||l.error;u&&(b.message=u),l.code&&(b.code=l.code)}catch{}throw b}return await i.json()}async blockDomain(t){const o=new URL(`.ghost/activitypub/v1/actions/block/domain/${encodeURIComponent(t.href)}`,this.apiUrl);return await this.fetchJSON(o,"POST"),!0}async unblockDomain(t){const o=new URL(`.ghost/activitypub/v1/actions/unblock/domain/${encodeURIComponent(t.href)}`,this.apiUrl);return await this.fetchJSON(o,"POST"),!0}async block(t){const o=new URL(`.ghost/activitypub/v1/actions/block/${encodeURIComponent(t.href)}`,this.apiUrl);return await this.fetchJSON(o,"POST"),!0}async unblock(t){const o=new URL(`.ghost/activitypub/v1/actions/unblock/${encodeURIComponent(t.href)}`,this.apiUrl);return await this.fetchJSON(o,"POST"),!0}async follow(t){const o=new URL(`.ghost/activitypub/v1/actions/follow/${t}`,this.apiUrl);return await this.fetchJSON(o,"POST")}async unfollow(t){const o=new URL(`.ghost/activitypub/v1/actions/unfollow/${t}`,this.apiUrl);return await this.fetchJSON(o,"POST")}async like(t){const o=new URL(`.ghost/activitypub/v1/actions/like/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"POST")}async unlike(t){const o=new URL(`.ghost/activitypub/v1/actions/unlike/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"POST")}async repost(t){const o=new URL(`.ghost/activitypub/v1/actions/repost/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"POST")}async derepost(t){const o=new URL(`.ghost/activitypub/v1/actions/derepost/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"POST")}async reply(t,o,n){const r=new URL(`.ghost/activitypub/v1/actions/reply/${encodeURIComponent(t)}`,this.apiUrl),a={content:o};return n&&(a.image=n),await this.fetchJSON(r,"POST",a)}async note(t,o){const n=new URL(".ghost/activitypub/v1/actions/note",this.apiUrl),r={content:t};return o&&(r.image=o),(await this.fetchJSON(n,"POST",r)).post}async delete(t){const o=new URL(`.ghost/activitypub/v1/post/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"DELETE")}get userApiUrl(){return new URL(`.ghost/activitypub/users/${this.handle}`,this.apiUrl)}async getUser(){return await this.fetchJSON(this.userApiUrl)}get searchApiUrl(){return new URL(".ghost/activitypub/v1/actions/search",this.apiUrl)}async search(t){const o=this.searchApiUrl;o.searchParams.set("query",t);const n=await this.fetchJSON(o,"GET");return n&&"accounts"in n?n:{accounts:[]}}async getThread(t){const o=new URL(`.ghost/activitypub/v1/thread/${encodeURIComponent(t)}`,this.apiUrl);return await this.fetchJSON(o)}async getAccount(t){const o=new URL(`.ghost/activitypub/v1/account/${t}`,this.apiUrl);return await this.fetchJSON(o)}async getAccountFollows(t,o,n){const r=new URL(`.ghost/activitypub/v1/account/${t}/follows/${o}`,this.apiUrl);n&&r.searchParams.set("next",n);const a=await this.fetchJSON(r);if(a===null)return{accounts:[],next:null};if(!("accounts"in a))return{accounts:[],next:null};const i=Array.isArray(a.accounts)?a.accounts:[],b="next"in a&&typeof a.next=="string"?a.next:null;return{accounts:i,next:b}}async getFeed(t){return this.getPaginatedPosts(".ghost/activitypub/v1/feed/notes",t)}async getInbox(t){return this.getPaginatedPosts(".ghost/activitypub/v1/feed/reader",t)}async getDiscoveryFeed(t,o){const n=`.ghost/activitypub/v1/feed/discover/${t}`;return this.getPaginatedPosts(n,o)}async getExploreAccounts(t,o){const n=`.ghost/activitypub/v1/explore/${t}`;return this.getPaginatedExploreAccounts(n,o)}async getTopics(){const t=new URL(".ghost/activitypub/v1/topics",this.apiUrl),o=await this.fetchJSON(t);return{topics:o&&"topics"in o&&Array.isArray(o.topics)?o.topics:[]}}async getRecommendations(t){const o=new URL(".ghost/activitypub/v1/recommendations",this.apiUrl);t&&o.searchParams.set("limit",t.toString());const n=await this.fetchJSON(o);return{accounts:n&&"accounts"in n&&Array.isArray(n.accounts)?n.accounts:[]}}async getPostsByAccount(t,o){return this.getPaginatedPosts(`.ghost/activitypub/v1/posts/${t}`,o)}async getPostsLikedByAccount(t){return this.getPaginatedPosts(".ghost/activitypub/v1/posts/me/liked",t)}async getPaginatedPosts(t,o){const n=new URL(t,this.apiUrl);o&&n.searchParams.set("next",o);const r=await this.fetchJSON(n);if(r===null||!("posts"in r))return{posts:[],next:null};const a=Array.isArray(r.posts)?r.posts:[],i="next"in r&&typeof r.next=="string"?r.next:null;return{posts:a,next:i}}async getNotifications(t){const o=new URL(".ghost/activitypub/v1/notifications",this.apiUrl);t&&o.searchParams.set("next",t);const n=await this.fetchJSON(o);if(n===null)return{notifications:[],next:null};if(!("notifications"in n))return{notifications:[],next:null};const r=Array.isArray(n.notifications)?n.notifications:[],a="next"in n&&typeof n.next=="string"?n.next:null;return{notifications:r,next:a}}async getNotificationsCount(){const t=new URL(".ghost/activitypub/v1/notifications/unread/count",this.apiUrl),o=await this.fetchJSON(t);return o===null?{count:0}:{count:typeof o.count=="number"?o.count:0}}async resetNotificationsCount(){const t=new URL(".ghost/activitypub/v1/notifications/unread/reset",this.apiUrl);return await this.fetchJSON(t,"PUT"),!0}async getBlockedAccounts(t){const o=new URL(".ghost/activitypub/v1/blocks/accounts",this.apiUrl);t&&o.searchParams.set("next",t);const n=await this.fetchJSON(o);if(n===null)return{accounts:[],next:null};const r="blocked_accounts"in n&&Array.isArray(n.blocked_accounts)?n.blocked_accounts:[],a="next"in n&&typeof n.next=="string"?n.next:null;return{accounts:r,next:a}}async getBlockedDomains(t){const o=new URL(".ghost/activitypub/v1/blocks/domains",this.apiUrl);t&&o.searchParams.set("next",t);const n=await this.fetchJSON(o);if(n===null)return{domains:[],next:null};const r="blocked_domains"in n&&Array.isArray(n.blocked_domains)?n.blocked_domains:[],a="next"in n&&typeof n.next=="string"?n.next:null;return{domains:r,next:a}}async getPaginatedExploreAccounts(t,o){const n=new URL(t,this.apiUrl);o&&n.searchParams.set("next",o);const r=await this.fetchJSON(n);if(r===null||!("accounts"in r))return{accounts:[],next:null};const a=Array.isArray(r.accounts)?r.accounts:[],i="next"in r&&typeof r.next=="string"?r.next:null;return{accounts:a,next:i}}async getPost(t){const o=new URL(`.ghost/activitypub/v1/post/${encodeURIComponent(t)}`,this.apiUrl);return await this.fetchJSON(o)}async getReplies(t,o){const n=new URL(`.ghost/activitypub/v1/replies/${encodeURIComponent(t)}`,this.apiUrl);return o&&n.searchParams.set("next",o),await this.fetchJSON(n)}async updateAccount({name:t,username:o,bio:n,avatarUrl:r,bannerImageUrl:a}){const i=new URL(".ghost/activitypub/v1/account",this.apiUrl);await this.fetchJSON(i,"PUT",{name:t,username:o,bio:n,avatarUrl:r,bannerImageUrl:a})}async upload(t){const o=new URL(".ghost/activitypub/v1/upload/image",this.apiUrl),n=new FormData;n.append("file",t);const r=await this.getToken(),a=await this.fetch(o,{method:"POST",headers:{Authorization:`Bearer ${r}`},body:n});if(!a.ok)throw{message:"Upload failed",statusCode:a.status};return(await a.json()).fileUrl}async enableBluesky(){const t=new URL(".ghost/activitypub/v2/actions/bluesky/enable",this.apiUrl);await this.fetchJSON(t,"POST")}async disableBluesky(){const t=new URL(".ghost/activitypub/v2/actions/bluesky/disable",this.apiUrl);await this.fetchJSON(t,"POST")}async confirmBlueskyHandle(){const t=new URL(".ghost/activitypub/v2/actions/bluesky/confirm-handle",this.apiUrl),o=await this.fetchJSON(t,"POST");return o===null||!("handle"in o)||typeof o.handle!="string"?"":String(o.handle)}}const JW="pending-";function ev(){return`${JW}${crypto.randomUUID()}`}function $c0(e){return e.startsWith(JW)}function kn0(e,t,o,n){const r={id:e.url,icon:e.icon,name:e.name,preferredUsername:e.preferredUsername,"@context":"",discoverable:!1,featured:"",followers:"",following:"",image:{url:""},inbox:"",manuallyApprovesFollowers:!1,outbox:"",publicKey:{id:"",owner:"",publicKeyPem:""},published:"",summary:"",type:"Person",url:""};return{id:t,type:"Create",actor:r,object:{type:"Note",name:"",content:o,summary:null,url:"",attributedTo:r,image:n||"",published:new Date().toISOString(),attachment:[],preview:{type:"Note",content:o},id:t,replyCount:0,liked:!1,reposted:!1,repostCount:0,authored:!0,"@context":""},"@context":"",to:""}}function Cn0(e){return e.replace(/\n/g,"<br />")}function rc(e){let t="";e.repostedBy!==null?t="Announce":t="Create";const o={id:e.author.url,icon:{url:e.author.avatarUrl},name:e.author.name,preferredUsername:e.author.handle.split("@")[1],followedByMe:e.author.followedByMe,"@context":"",discoverable:!1,featured:"",followers:"",following:"",image:{url:""},inbox:"",manuallyApprovesFollowers:!1,outbox:"",publicKey:{id:"",owner:"",publicKeyPem:""},published:"",summary:"",type:"Person",url:""};let n=null;e.repostedBy!==null&&(n={id:e.repostedBy.url,icon:{url:e.repostedBy.avatarUrl},name:e.repostedBy.name,preferredUsername:e.repostedBy.handle.split("@")[1],followedByMe:e.repostedBy.followedByMe,"@context":"",discoverable:!1,featured:"",followers:"",following:"",image:{url:""},inbox:"",manuallyApprovesFollowers:!1,outbox:"",publicKey:{id:"",owner:"",publicKeyPem:""},published:"",summary:"",type:"Person",url:""});let r="Note";e.type===Cz.Article?r="Article":e.type===Cz.Tombstone&&(r="Tombstone");const a={type:r,name:e.title,content:e.content,summary:e.summary,url:e.url,attributedTo:o,image:e.featureImageUrl??"",published:e.publishedAt,attachment:e.attachments,preview:{type:"",content:e.excerpt},id:e.id,replyCount:e.replyCount,likeCount:e.likeCount,liked:e.likedByMe,reposted:e.repostedByMe,repostCount:e.repostCount,authored:e.authoredByMe===!0,metadata:e.metadata,"@context":""};return{id:e.id,type:t,actor:n!==null?n:o,object:a,"@context":"",to:""}}let Al;async function c1(){return Al||(Al=(await(await fetch("/ghost/api/admin/site/")).json()).site.url),Al}function a1(e,t){return new xn0(new URL(t),new URL("/ghost/api/admin/identities/",window.location.origin),e)}function He(e="Rate limit exceeded",t="You've made too many requests. Please try again later."){Re.error(e,{description:t})}function Y3(e="Action failed",t="This user has restricted who can interact with their account."){Re.error(e,{description:t})}const l0={outbox:e=>["outbox",e],liked:e=>["liked",e],user:e=>["user",e],profilePosts:e=>e===null?["profile_posts"]:["profile_posts",e],account:e=>["account",e],accountFollows:(e,t)=>["account_follows",e,t],searchResults:e=>["search_results",e],suggestedProfiles:(e,t)=>["suggested_profiles",e,t],exploreProfiles:e=>["explore_profiles",e],replyChain:e=>e===null?["reply_chain"]:["reply_chain",e],feed:["feed"],inbox:["inbox"],discoveryFeed:["discovery_feed"],postsByAccount:["account_posts"],postsLikedByAccount:["account_liked_posts"],notifications:e=>["notifications",e],notificationsCount:e=>["notifications_count",e],blockedAccounts:e=>["blocked_accounts",e],blockedDomains:e=>["blocked_domains",e],topics:()=>["topics"]};function Nz(e,t,o){const n=[l0.feed,l0.inbox,l0.discoveryFeed,l0.postsLikedByAccount,l0.profilePosts(null)];for(const r of n)e.setQueriesData(r,a=>a===void 0?a:{...a,pages:a.pages.map(i=>({...i,posts:i.posts.map(b=>b.object.id===t?{...b,object:{...b.object,liked:o,likeCount:Math.max(o?(b.object.likeCount||0)+1:(b.object.likeCount||0)-1,0)}}:b)}))}),r===l0.postsLikedByAccount&&(e.setQueriesData(r,a=>a&&{...a,pages:a.pages.map(i=>({...i,posts:o?i.posts:i.posts.filter(b=>b.object.id!==t)}))}),o&&e.invalidateQueries({queryKey:l0.postsLikedByAccount}))}function tv(e,t,o,n){const r=[l0.feed,l0.inbox,l0.discoveryFeed,l0.profilePosts("index")],a=o.split("@")[1];for(const b of r)e.setQueriesData(b,l=>l===void 0?l:{...l,pages:l.pages.map(u=>({...u,posts:u.posts.map(O=>O.type!=="Announce"&&O.actor?.preferredUsername===a?{...O,actor:{...O.actor,followedByMe:n}}:O.type==="Announce"&&typeof O.object.attributedTo=="object"&&O.object.attributedTo&&!Array.isArray(O.object.attributedTo)&&"preferredUsername"in O.object.attributedTo&&O.object.attributedTo.preferredUsername===a?{...O,object:{...O.object,attributedTo:{...O.object.attributedTo,followedByMe:n}}}:O)}))});const i=l0.replyChain(null);e.setQueriesData(i,b=>{if(!b)return b;const l=u=>u.author.handle===o?{...u,author:{...u.author,followedByMe:n}}:u;return{...b,post:l(b.post),ancestors:{...b.ancestors,chain:b.ancestors.chain.map(l)},children:b.children.map(u=>({...u,post:l(u.post),chain:u.chain.map(l)}))}})}function ov(e,t,o){e.getQueryCache().getAll().forEach(a=>{const i=a.queryKey;Array.isArray(i)&&i[0]==="account_follows"&&e.setQueryData(i,b=>b?.pages?{...b,pages:b.pages.map(l=>({...l,accounts:l.accounts.map(u=>u.handle===t?{...u,isFollowing:o}:u)}))}:b)})}function Bz(e,t,o){const n=l0.replyChain(null);e.setQueriesData(n,r=>{if(!r)return r;const a=i=>i.id===t?{...i,likedByMe:o,likeCount:Math.max(o?(i.likeCount||0)+1:(i.likeCount||0)-1,0)}:i;return{...r,post:a(r.post),ancestors:{...r.ancestors,chain:r.ancestors.chain.map(a)},children:r.children.map(i=>({...i,post:a(i.post),chain:i.chain.map(a)}))}}),e.setQueryData(l0.account("index"),r=>r&&{...r,likedCount:Math.max(0,r.likedCount+(o?1:-1))})}function _z(e,t,o,n){const r=l0.notifications(t);e.setQueriesData({queryKey:r},a=>{if(!a||!a.pages)return a;try{return{...a,pages:a.pages.map(i=>!i||!i.notifications?i:{...i,notifications:i.notifications.map(b=>!b||!b.post?b:b.post.id===o?{...b,post:{...b.post,likedByMe:n,likeCount:Math.max(n?b.post.likeCount+1:b.post.likeCount-1,0)}}:b)})}}catch{return a}})}function Ez(e,t,o,n){const r=l0.notifications(t);e.setQueriesData({queryKey:r},a=>{if(!a||!a.pages)return a;try{return{...a,pages:a.pages.map(i=>!i||!i.notifications?i:{...i,notifications:i.notifications.map(b=>!b||!b.post?b:b.post.id===o?{...b,post:{...b.post,repostedByMe:n,repostCount:Math.max(n?b.post.repostCount+1:b.post.repostCount-1,0)}}:b)})}}catch{return a}})}function Sz(e,t,o,n){const r=l0.notifications(t);e.setQueriesData({queryKey:r},a=>{if(!a||!a.pages)return a;try{return{...a,pages:a.pages.map(i=>!i||!i.notifications?i:{...i,notifications:i.notifications.map(b=>!b||!b.post?b:b.post.id===o?{...b,post:{...b.post,replyCount:Math.max((b.post.replyCount??0)+n,0)}}:b)})}}catch{return a}})}function uA(e,t,o){const n=[l0.feed,l0.inbox,l0.discoveryFeed,l0.profilePosts("index"),l0.postsLikedByAccount];for(const r of n)e.setQueriesData(r,a=>a&&{...a,pages:a.pages.map(i=>({...i,posts:i.posts.map(b=>b.object.id===t?{...b,object:{...b.object,replyCount:Math.max((b.object.replyCount??0)+o,0)}}:b)}))})}function dA(e,t,o){const n=l0.replyChain(null);e.setQueriesData({queryKey:n,exact:!1},r=>{if(!r)return r;const a=i=>i.id===t?{...i,replyCount:Math.max((i.replyCount||0)+o,0)}:i;return{...r,post:a(r.post),ancestors:{...r.ancestors,chain:r.ancestors.chain.map(a)},children:r.children.map(i=>({...i,post:a(i.post),chain:i.chain.map(a)}))}})}function Qc0(e){return Q2({queryKey:l0.blockedAccounts(e),refetchOnMount:"always",async queryFn({pageParam:t}){const o=await c1();return a1(e,o).getBlockedAccounts(t)},getNextPageParam(t){return t.next}})}function Zc0(e){return Q2({queryKey:l0.blockedDomains(e),refetchOnMount:"always",async queryFn({pageParam:t}){const o=await c1();return a1(e,o).getBlockedDomains(t)},getNextPageParam(t){return t.next}})}function Nn0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).like(o)},onMutate:o=>{Nz(t,o,!0),Bz(t,o,!0),_z(t,e,o,!0)},onError(o,n){Nz(t,n,!1),Bz(t,n,!1),_z(t,e,n,!1),o.statusCode===403&&Y3(),o.statusCode===429&&He()}})}function Bn0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).unlike(o)},onMutate:o=>{Nz(t,o,!1),Bz(t,o,!1),_z(t,e,o,!1)},onError(o){o.statusCode===429&&He()}})}function Gc0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).blockDomain(new URL(o.url))},onMutate:o=>{o.handle&&t.setQueryData(l0.account(o.handle),n=>n&&{...n,domainBlockedByMe:!0,followedByMe:!1,followsMe:!1})},onError(o){o.statusCode===429&&He()}})}function Kc0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).unblockDomain(new URL(o.url))},onMutate:o=>{o.handle&&t.setQueryData(l0.account(o.handle),n=>n&&{...n,domainBlockedByMe:!1})},onError(o){o.statusCode===429&&He()}})}function Yc0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).block(new URL(o.apId))},onMutate:o=>{t.setQueryData(l0.account(o.handle),n=>n&&{...n,blockedByMe:!0,followedByMe:!1,followsMe:!1}),t.invalidateQueries({queryKey:l0.feed}),t.invalidateQueries({queryKey:l0.inbox}),t.invalidateQueries({queryKey:l0.discoveryFeed})},onError(o){o.statusCode===429&&He()}})}function Jc0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).unblock(new URL(o.apId))},onMutate:o=>{t.setQueryData(l0.account(o.handle),n=>n&&{...n,blockedByMe:!1})},onError(o){o.statusCode===429&&He()}})}function Tz(e,t,o){const n=[l0.feed,l0.inbox,l0.discoveryFeed,l0.profilePosts(null)];for(const r of n)e.setQueriesData(r,a=>a===void 0?a:{...a,pages:a.pages.map(i=>({...i,posts:i.posts.map(b=>b.object.id===t?{...b,object:{...b.object,reposted:o,repostCount:Math.max(o?b.object.repostCount+1:b.object.repostCount-1,0)}}:b)}))})}function Pz(e,t,o){const n=l0.replyChain(null);e.setQueriesData(n,r=>{if(!r)return r;const a=i=>i.id===t?{...i,repostedByMe:o,repostCount:Math.max(o?(i.repostCount||0)+1:(i.repostCount||0)-1,0)}:i;return{...r,post:a(r.post),ancestors:{...r.ancestors,chain:r.ancestors.chain.map(a)},children:r.children.map(i=>({...i,post:a(i.post),chain:i.chain.map(a)}))}})}function _n0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).repost(o)},onMutate:o=>{Tz(t,o,!0),Pz(t,o,!0),Ez(t,e,o,!0)},onError(o,n){Tz(t,n,!1),Pz(t,n,!1),Ez(t,e,n,!1),o.statusCode===403&&Y3(),o.statusCode===429&&He()}})}function En0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).derepost(o)},onMutate:o=>{Tz(t,o,!1),Pz(t,o,!1),Ez(t,e,o,!1)},onError(o){o.statusCode===429&&He()}})}function Sn0(e){return L2({queryKey:l0.user(e),async queryFn(){const t=await c1();return a1(e,t).getUser()}})}function e5(e,t,o){const n=f1();return Y1({async mutationFn(r){const a=await c1();return a1(e,a).unfollow(r)},onSuccess(r,a){const i=l0.account(a==="me"?"index":a);n.setQueryData(i,h=>h&&{...h,followedByMe:!1,followerCount:h.followerCount-1<0?0:h.followerCount-1});const b=l0.accountFollows(a,"followers");n.setQueryData(b,h=>{if(!h?.pages?.[0])return h;const q=n.getQueryData(l0.account("index"));return q?{...h,pages:h.pages.map(g=>({...g,accounts:g.accounts.filter(W=>W.name!==q.name)}))}:h});const l=l0.account("index");n.setQueryData(l,h=>h&&{...h,followingCount:h.followingCount-1});const O=l0.accountFollows("me","following");n.getQueryData(O)?n.setQueryData(O,h=>h?.pages?{...h,pages:h.pages.map(q=>({...q,accounts:q.accounts.filter(g=>g.handle!==a)}))}:h):n.invalidateQueries({queryKey:O}),ov(n,a,!1),n.setQueryData(l0.exploreProfiles(e),h=>{if(!h)return h;const q=h.pages.map(g=>{const W=Object.entries(g.results).reduce((v,[y,x])=>{const k=x.sites.map(L=>L.handle===a?{...L,followedByMe:!1,followerCount:Math.max(0,L.followerCount-1)}:L);return v[y]={...x,sites:k},v},{});return{...g,results:W}});return{...h,pages:q}}),n.setQueriesData({queryKey:["suggested_profiles"],exact:!1},h=>h&&h.map(q=>q.handle===a?{...q,followedByMe:!1,followerCount:Math.max(0,q.followerCount-1)}:q)),tv(n,e,a,!1),t()},onError:r=>{r.statusCode===429&&He(),o()}})}function t5(e,t,o){const n=f1();return Y1({async mutationFn(r){const a=await c1();return a1(e,a).follow(r)},onSuccess(r,a){const i=l0.account(a==="me"?"index":a);n.setQueryData(i,h=>h&&{...h,followedByMe:!0,followerCount:h.followerCount+1});const b=l0.account("index");n.setQueryData(b,h=>h&&{...h,followingCount:h.followingCount+1});const l=l0.accountFollows(a,"followers"),O=l0.accountFollows("me","following");n.getQueryData(O)?n.setQueryData(O,h=>{if(!h?.pages?.[0])return h;const q=n.getQueryData(l0.account(a==="me"?"index":a));if(!q)return h;const g={id:q.id,name:q.name,handle:q.handle,avatarUrl:q.avatarUrl,blockedByMe:q.blockedByMe,domainBlockedByMe:q.domainBlockedByMe,isFollowing:!0};return{...h,pages:[{...h.pages[0],accounts:[g,...h.pages[0].accounts]},...h.pages.slice(1)]}}):n.invalidateQueries({queryKey:O}),ov(n,a,!0),n.setQueryData(l0.exploreProfiles(e),h=>{if(!h)return h;const q=h.pages.map(g=>{const W=Object.entries(g.results).reduce((v,[y,x])=>{const k=x.sites.map(L=>L.handle===a?{...L,followedByMe:!0,followerCount:L.followerCount+1}:L);return v[y]={...x,sites:k},v},{});return{...g,results:W}});return{...h,pages:q}}),n.setQueriesData({queryKey:["suggested_profiles"],exact:!1},h=>h&&h.map(q=>q.handle===a?{...q,followedByMe:!0,followerCount:q.followerCount+1}:q)),n.setQueryData(l,h=>{if(!h?.pages?.[0])return h;const q=n.getQueryData(l0.account("index"));if(!q)return h;const g={id:q.url,type:"Person",preferredUsername:"index",name:q.name,url:q.url,handle:`index@${new URL(q.url).hostname}`,icon:{type:"Image",url:q.avatarUrl},isFollowing:!1};return{...h,pages:[{...h.pages[0],accounts:[g,...h.pages[0].accounts]},...h.pages.slice(1)]}}),tv(n,e,a,!0),t()},onError(r){o(),r.statusCode===429&&He(),r.statusCode===403&&Y3()}})}function Tn0(e,t){const o=f1(),n=l0.searchResults(t);return{searchQuery:L2({queryKey:n,enabled:t.length>0,refetchOnMount:"always",async queryFn(){const i=await c1();return a1(e,i).search(t)}}),updateAccountSearchResult:(i,b)=>{o.setQueryData(n,l=>l&&{...l,accounts:l.accounts.map(u=>u.id===i?{...u,...b}:u)})}}}function hl(e,t,o,n){e.setQueryData(t,r=>r&&{...r,pages:r.pages.map((a,i)=>i===0?{...a,[o]:[n,...a[o]]}:a)})}function Do(e,t,o,n,r){e.setQueryData(t,a=>a&&{...a,pages:a.pages.map(i=>({...i,[o]:i[o].map(b=>b.id===n?r(b):b)}))})}function ql(e,t,o,n){e.setQueryData(t,r=>r&&{...r,pages:r.pages.map(a=>({...a,[o]:a[o].filter(i=>i.id!==n)}))})}function Pn0(e,t){const o=f1();return Y1({async mutationFn({inReplyTo:n,content:r,imageUrl:a,altText:i}){const b=await c1(),l=a1(e,b),u=a?{url:a,altText:i}:void 0;return l.reply(n,r,u)},onMutate:({inReplyTo:n})=>{if(!t)throw new Error("Cannot create reply without actor props");const r=ev();return uA(o,n,1),dA(o,n,1),Sz(o,e,n,1),{id:r}},onSuccess:(n,r)=>{if(n.id===void 0)throw new Error("Activity returned from API has no id");o.invalidateQueries({queryKey:l0.replyChain(r.inReplyTo)})},onError(n,r){console.error(n),uA(o,r.inReplyTo,-1),dA(o,r.inReplyTo,-1),Sz(o,e,r.inReplyTo,-1),n.statusCode===403&&Y3(),n.statusCode===429&&He(),Re.error("An error occurred while sending your reply.")}})}function Xn0(e,t){const o=f1(),n=l0.feed,r=l0.outbox(e),a=l0.profilePosts("index");return Y1({async mutationFn({content:i,imageUrl:b,altText:l}){const u=await c1(),O=a1(e,u),f=b?{url:b,altText:l}:void 0;return O.note(i,f)},onMutate:({content:i,imageUrl:b})=>{if(!t)throw new Error("Cannot create note without actor props");const l=Cn0(i),u=ev(),O=kn0(t,u,l,b);return hl(o,n,"posts",O),hl(o,r,"data",O),hl(o,a,"posts",O),{id:u}},onSuccess:(i,b,l)=>{if(i.id===void 0)throw new Error("Post returned from API has no id");const u=rc(i);Do(o,n,"posts",l?.id??"",()=>u),Do(o,r,"data",l?.id??"",()=>u),Do(o,a,"posts",l?.id??"",()=>u)},onError(i,b,l){console.error(i),ql(o,n,"posts",l?.id??""),ql(o,r,"data",l?.id??""),ql(o,a,"posts",l?.id??""),i.statusCode===429&&He(),Re.error("An error occurred while posting your note.")}})}function o5(e,t,o){const n=o?.enabled!==!1;return L2({queryKey:l0.account(t==="me"?"index":t),enabled:n,async queryFn(){const r=await c1();return a1(e,r).getAccount(t)}})}function ea0(e,t){const o=f1();return Q2({queryKey:l0.accountFollows(e,t),async queryFn({pageParam:n}){const r=await c1(),i=await a1("index",r).getAccountFollows(e,t,n);return i.accounts&&i.accounts.forEach(b=>{o.setQueryData(l0.account(b.handle),b)}),i},getNextPageParam(n){return n.next}})}function ta0(e){const t=l0.feed,o=f1();return{feedQuery:Q2({queryKey:t,enabled:e.enabled,staleTime:60*1e3,async queryFn({pageParam:a}){const i=await c1();return a1("index",i).getFeed(a).then(l=>({posts:l.posts.map(rc),next:l.next}))},getNextPageParam(a){return a.next}}),updateFeedActivity:(a,i)=>{Do(o,t,"posts",a,b=>({...b,...i}))}}}function oa0(e){const t=l0.inbox,o=f1();return{inboxQuery:Q2({queryKey:t,enabled:e.enabled,staleTime:20*1e3,async queryFn({pageParam:a}){const i=await c1();return a1("index",i).getInbox(a).then(l=>({posts:l.posts.map(rc),next:l.next}))},getNextPageParam(a){return a.next}}),updateInboxActivity:(a,i)=>{Do(o,t,"posts",a,b=>({...b,...i}))}}}function na0(e){const t=[...l0.discoveryFeed,e.topic],o=f1();return{discoveryFeedQuery:Q2({queryKey:t,enabled:e.enabled,staleTime:20*1e3,async queryFn({pageParam:a}){const i=await c1();return a1("index",i).getDiscoveryFeed(e.topic,a).then(l=>({posts:l.posts.map(rc),next:l.next}))},getNextPageParam(a){return a.next}}),updateDiscoveryFeedActivity:(a,i)=>{Do(o,t,"posts",a,b=>({...b,...i}))}}}function ra0(e,t){const o=l0.profilePosts(e==="me"?"index":e),n=f1();return{postsByAccountQuery:Q2({queryKey:o,enabled:t.enabled,async queryFn({pageParam:i}){const b=await c1();return a1("index",b).getPostsByAccount(e,i).then(u=>({posts:u.posts.map(rc),next:u.next})).catch(()=>({posts:[],next:null}))},getNextPageParam(i){return i.next}}),updatePostsByAccount:(i,b)=>{Do(n,o,"posts",i,l=>({...l,...b}))}}}function ca0(e){const t=l0.postsLikedByAccount,o=f1();return{postsLikedByAccountQuery:Q2({queryKey:t,enabled:e.enabled,async queryFn({pageParam:a}){const i=await c1();return a1("index",i).getPostsLikedByAccount(a).then(l=>({posts:l.posts.map(rc),next:l.next}))},getNextPageParam(a){return a.next}}),updatePostsLikedByAccount:(a,i)=>{Do(o,t,"posts",a,b=>({...b,...i}))}}}function jn0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).delete(o.id)},onMutate:({id:o,parentId:n})=>{const r=t.getQueryData(l0.feed);t.setQueryData(l0.feed,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.id!==o).map(w=>w.object.id===n?{...w,object:{...w.object,replyCount:w.object.replyCount-1}}:w)}))});const a=t.getQueryData(l0.inbox);t.setQueryData(l0.inbox,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.id!==o).map(w=>w.object.id===n?{...w,object:{...w.object,replyCount:w.object.replyCount-1}}:w)}))}),n&&Sz(t,e,n,-1);const i=l0.outbox(e),b=t.getQueryData(i);t.setQueryData(i,L=>L&&{...L,pages:L.pages.map(C=>({...C,data:C.data.filter(w=>w.object.id!==o)}))});const l=l0.liked(e),u=t.getQueryData(l);let O=!1;t.setQueryData(l,L=>L&&{...L,pages:L.pages.map(C=>(O=C.data.some(w=>w.object.id===o),{...C,data:C.data.filter(w=>w.object.id!==o)}))}),[l0.feed,l0.inbox,l0.discoveryFeed,l0.profilePosts("index"),l0.postsLikedByAccount].some(L=>t.getQueryData(L)?.pages.some(w=>w.posts.some(N=>N.id===o&&N.object.liked)))&&t.setQueryData(l0.account(e),L=>L&&{...L,likedCount:Math.max(0,L.likedCount-1)});const h=l0.profilePosts(null),q=t.getQueriesData(h);t.setQueriesData(h,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.object.id!==o)}))});let g=[],W;O&&(g=l0.account(e),W=t.getQueryData(g),t.setQueryData(g,L=>L&&{...L,likedCount:L.likedCount-1<0?0:L.likedCount-1}));const v=l0.profilePosts("index"),y=t.getQueryData(v);t.setQueryData(v,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.object.id!==o)}))});const x=l0.postsLikedByAccount,k=t.getQueryData(x);return t.setQueryData(x,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.object.id!==o)}))}),n&&t.setQueriesData({queryKey:["reply_chain"],exact:!1},L=>{if(!L)return L;const C=L.children.filter(N=>N.post.id!==o).map(N=>({...N,chain:N.chain.filter(D=>D.id!==o)}));let w=L.post;return L.post.id===n&&(w={...L.post,replyCount:Math.max(0,(L.post.replyCount||0)-1)}),{...L,post:w,children:C}}),{previousFeed:{key:l0.feed,data:r},previousInbox:{key:l0.inbox,data:a},previousOutbox:{key:i,data:b},previousLiked:{key:l,data:u},previousProfilePosts:{key:h,data:q},previousAccount:O?{key:g,data:W}:null,previousPostsByAccount:{key:l0.profilePosts("index"),data:y},previousPostsLikedByAccount:{key:l0.postsLikedByAccount,data:k}}},onError:(o,n,r)=>{r&&(t.setQueryData(r.previousFeed.key,r.previousFeed.data),t.setQueryData(r.previousInbox.key,r.previousInbox.data),t.setQueryData(r.previousOutbox.key,r.previousOutbox.data),t.setQueryData(r.previousLiked.key,r.previousLiked.data),t.setQueriesData(r.previousProfilePosts.key,r.previousProfilePosts.data),r.previousAccount&&t.setQueryData(r.previousAccount.key,r.previousAccount.data),r.previousPostsByAccount&&t.setQueryData(l0.profilePosts("index"),r.previousPostsByAccount),r.previousPostsLikedByAccount&&t.setQueryData(l0.postsLikedByAccount,r.previousPostsLikedByAccount))},onSuccess:(o,{parentId:n})=>{t.invalidateQueries({queryKey:["reply_chain"]}),n&&(t.invalidateQueries({queryKey:l0.feed}),t.invalidateQueries({queryKey:l0.inbox}))}})}function aa0(e){return Q2({queryKey:l0.notifications(e),async queryFn({pageParam:t}){const o=await c1();return a1(e,o).getNotifications(t)},getNextPageParam(t){return t.next}})}function sa0(e,t){const o=L2({queryKey:l0.replyChain(t),enabled:!!t,async queryFn(){if(!t)throw new Error("Post ID is required");const O=await c1(),f=a1(e,O);try{return await f.getReplies(t)}catch(h){if(Ln0(h)&&h.statusCode===404)return await f.getPost(t),await f.getReplies(t);throw h}}}),[n,r]=p.useState(null),[a,i]=p.useState(null);p.useEffect(()=>{o.data?r(o.data):o.error&&i(o.error)},[o.data,o.error]);const b=p.useCallback(async()=>{if(!(!n?.ancestors.hasMore||!n?.ancestors.chain[0]))try{const O=await c1(),h=await a1(e,O).getReplies(n.ancestors.chain[0].id);r(q=>q&&{...q,ancestors:{chain:[...h.ancestors.chain,...q.ancestors.chain],hasMore:h.ancestors.hasMore}})}catch(O){i(O instanceof Error?O:new Error("Failed to load more ancestors"))}},[e,n?.ancestors.hasMore,n?.ancestors.chain]),l=p.useCallback(async()=>{if(n?.next&&t)try{const O=await c1(),h=await a1(e,O).getReplies(t,n.next);r(q=>q&&{...q,children:[...q.children,...h.children],next:h.next})}catch(O){i(O instanceof Error?O:new Error("Failed to load more children"))}},[e,n?.next,t]),u=p.useCallback(async O=>{if(n?.children[O]?.hasMore)try{const f=await c1(),h=a1(e,f),q=n.children[O],g=q.chain.length>1?q.chain[q.chain.length-2]:q.post,W=await h.getReplies(g.id),v=W.children[0].chain;r(y=>{if(!y)return y;const x=[...y.children];return x[O]={...q,chain:[...q.chain,...v],hasMore:W.children[0].hasMore},{...y,children:x}})}catch(f){i(f instanceof Error?f:new Error("Failed to load more child replies"))}},[e,n]);return{data:n,isLoading:o.isLoading,error:a,loadMoreAncestors:b,loadMoreChildren:l,loadMoreChildReplies:u,hasMoreAncestors:!!n?.ancestors.hasMore,hasMoreChildren:!!n?.next,hasMoreChildReplies:O=>!!n?.children[O]?.hasMore}}function ia0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).updateAccount(o)},onSuccess(){t.invalidateQueries({queryKey:l0.account("index")})}})}async function Dn0(e){const t=await c1();return a1("index",t).upload(e)}function nv(e,t=!0){const o=p.useCallback(async()=>await c1(),[]),n=p.useCallback(async()=>{const r=await o();return a1(e,r)},[e,o]);return L2({queryKey:l0.notificationsCount(e),enabled:t,async queryFn(){return(await(await n()).getNotificationsCount()).count}})}function In0(e){const t=f1(),o=p.useCallback(async()=>await c1(),[]),n=p.useCallback(async()=>{const r=await o();return a1(e,r)},[e,o]);return Y1({async mutationFn(){return t.setQueryData(l0.notificationsCount(e),0),(await n()).resetNotificationsCount()}})}function pa0(e,t){const o=f1(),n=[...l0.exploreProfiles(e),t];return{exploreProfilesQuery:Q2({queryKey:n,staleTime:3600*1e3,async queryFn({pageParam:i}){const b=await c1(),u=await a1(e,b).getExploreAccounts(t,i);return u.accounts.forEach(O=>{o.setQueryData(l0.account(O.handle),O)}),{accounts:u.accounts,next:u.next}},getNextPageParam(i){return i.next}}),updateExploreProfile:(i,b)=>{o.setQueryData(n,l=>{if(!l)return l;const u=l.pages.map(O=>{const f=O.accounts.map(h=>h.id===i?{...h,...b}:h);return{...O,accounts:f}});return{...l,pages:u}})}}}function n5(e,t=3){const o=f1(),n=l0.suggestedProfiles(e,t);return{suggestedProfilesQuery:L2({queryKey:n,async queryFn(){const i=await c1(),u=(await a1("index",i).getRecommendations(t)).accounts;return u.length>0&&u.forEach(O=>{o.setQueryData(l0.account(O.handle),O)}),u.length>0?u:null},retry:!1,staleTime:3600*1e3}),updateSuggestedProfile:(i,b)=>{o.setQueryData(n,l=>l&&l.map(u=>u.id===i?{...u,...b}:u))}}}function r5(){return{topicsQuery:L2({queryKey:l0.topics(),async queryFn(){const t=await c1();return a1("index",t).getTopics()},staleTime:864e5,retry:!1})}}function c5(e,t){const o=l0.account("index");e.setQueryData(o,n=>n&&{...n,...t})}function Ma0(e){const t=f1();return Y1({async mutationFn(){const o=await c1();return a1(e,o).enableBluesky()},onSuccess(){c5(t,{blueskyEnabled:!0,blueskyHandleConfirmed:!1,blueskyHandle:null}),t.invalidateQueries({queryKey:l0.accountFollows("index","following")})},onError(o){o.statusCode===429&&He()}})}function ba0(e){const t=f1();return Y1({async mutationFn(){const o=await c1();return a1(e,o).disableBluesky()},onSuccess(){c5(t,{blueskyEnabled:!1,blueskyHandleConfirmed:!1,blueskyHandle:null}),t.invalidateQueries({queryKey:l0.accountFollows("index","following")})},onError(o){o.statusCode===429&&He()}})}function la0(e){const t=f1();return Y1({async mutationFn(){const o=await c1();return a1(e,o).confirmBlueskyHandle()},onSuccess(o){o!==""&&c5(t,{blueskyEnabled:!0,blueskyHandleConfirmed:!0,blueskyHandle:o})},onError(o){o.statusCode===429&&He()}})}let Fi=null;const OA=({onFollow:e,onUnfollow:t,authorHandle:o,followedByMe:n})=>{const[,r]=b0.useReducer(l=>l+1,0),i=Fi===o&&!n,b=l=>{i?(t(l),setTimeout(()=>{Fi=null,r()},0)):(Fi=o,r(),e(l))};return z.jsx(o1,{className:"absolute -right-1.5 bottom-px z-10 flex size-4 items-center justify-center rounded-full p-0 outline outline-2 outline-white transition-transform hover:scale-105 active:scale-100 dark:outline-black",title:i?"Unfollow":"Follow",onClick:b,children:i?z.jsx(c9,{className:"-mb-px !size-3 !stroke-[2.4]"}):z.jsx(i9,{className:"!size-[14px] !stroke-2"})})},Xo=({author:e,size:t,isLoading:o=!1,disabled:n=!1,className:r="",showFollowButton:a=!1})=>{let i=20,b=`shrink-0 items-center justify-center rounded-full relative z-10 flex bg-black/5 dark:bg-gray-900 ${t==="lg"||n?"":"cursor-pointer"} ${r}`,l="z-10 object-cover rounded-full outline outline-[0.5px] outline-offset-[-0.5px] outline-black/10";const[u,O]=p.useState(e?.icon?.url),f=Jt(),h=t5("index",()=>{Re.success(`Followed ${e?.name}`)},()=>{Re.error("Failed to follow")}),q=e5("index",()=>{Re.info(`Unfollowed ${e?.name}`)},()=>{Re.error("Failed to unfollow")});switch(p.useEffect(()=>{O(e?.icon?.url)},[e?.icon?.url]),t){case"2xs":i=10,b=Z1("size-4",b),l=Z1("size-4",l);break;case"xs":i=12,b=Z1("size-6",b),l=Z1("size-6",l);break;case"notification":i=16,b=Z1("size-9",b),l=Z1("size-9",l);break;case"sm":b=Z1("size-10",b),l=Z1("size-10",l);break;case"md":b=Z1("size-[60px]",b),l=Z1("size-[60px]",l);break;case"lg":i=32,b=Z1("size-22",b),l=Z1("size-22",l);break;default:b=Z1("size-10",b),l=Z1("size-10",l);break}if(!e||o)return z.jsx(w1,{className:l,containerClassName:b});const g=e?.handle||Po(e),W=L=>{L.stopPropagation(),f(`/profile/${g}`)},v=L=>{L.stopPropagation(),h.mutate(g)},y=L=>{L.stopPropagation(),q.mutate(g)},k=a||Fi===g;return u?z.jsxs("div",{className:b,onClick:t==="lg"||n?void 0:W,children:[z.jsx("img",{className:l,referrerPolicy:"no-referrer",src:u,onError:()=>O(void 0)}),k&&z.jsx(OA,{authorHandle:g,followedByMe:!1,onFollow:v,onUnfollow:y})]}):z.jsxs("div",{className:b,onClick:n?void 0:W,children:[z.jsx(Od,{className:"text-gray-600",size:i,strokeWidth:1.5}),k&&z.jsx(OA,{authorHandle:g,followedByMe:!1,onFollow:v,onUnfollow:y})]})},ml=({trigger:e,onCopyLink:t,onDelete:o,allowDelete:n=!1,disabled:r=!1,layout:a,followedByMe:i=!1,authoredByMe:b=!1,onFollow:l=()=>{},onUnfollow:u=()=>{}})=>{const O=q=>{q.stopPropagation(),t()},f=q=>{q.stopPropagation(),o()},h=q=>{q.stopPropagation(),i?u():l()};return z.jsxs(yK,{children:[z.jsxs(dJ,{children:[z.jsx(OJ,{disabled:r,asChild:!0,onClick:q=>q.stopPropagation(),children:e}),z.jsx($m,{align:`${a==="modal"?"start":"end"}`,alignOffset:a==="modal"?-12:0,className:"p-2",children:z.jsxs("div",{className:"flex w-48 flex-col",children:[(!n||a==="inbox")&&z.jsx(dl,{asChild:!0,children:z.jsxs(o1,{className:"justify-start",variant:"ghost",onClick:O,children:[z.jsx(FZ,{}),"Copy link"]})}),!b&&z.jsx(dl,{asChild:!0,children:z.jsxs(o1,{className:"justify-start",variant:"ghost",onClick:h,children:[i?z.jsx(gG,{}):z.jsx(vG,{}),i?"Unfollow":"Follow"]})}),n&&z.jsx(wK,{asChild:!0,children:z.jsx(dl,{asChild:!0,children:z.jsxs(o1,{className:"justify-start text-red hover:bg-red/5 hover:text-red",variant:"ghost",onClick:q=>q.stopPropagation(),children:[z.jsx(l9,{}),"Delete"]})})})]})})]}),z.jsxs(O9,{onClick:q=>q.stopPropagation(),children:[z.jsxs(f9,{children:[z.jsx(h9,{children:"Delete this post?"}),z.jsx(q9,{children:a==="inbox"?"This will remove the post from the Ghost social web, but it will remain on your website.":z.jsx(z.Fragment,{children:"If you delete this post, you won't be able to restore it."})})]}),z.jsxs(A9,{children:[z.jsx(g9,{onClick:q=>q.stopPropagation(),children:"Cancel"}),z.jsx(m9,{className:u3({variant:"destructive"}),onClick:f,children:"Delete"})]})]})]})};function Fn0(e){const[t,o]=p.useState({images:[],currentIndex:0,isOpen:!1}),n=b=>{const l=s5(b);if(!l)return[];if(Array.isArray(l))return l.map((u,O)=>({url:u.url,alt:u.name||`Image-${O}`}));if(l.mediaType?.startsWith("image/")||l.type==="Image")return[{url:l.url,alt:l.name||"Image"}];if(b.image){let u;if(typeof b.image=="string"?u=b.image:u=b.image?.url,u)return[{url:u,alt:"Image"}]}return[]};return{lightboxState:t,openLightbox:b=>{if(!e)return;const l=n(e),u=l.findIndex(O=>O.url===b);u!==-1&&o({images:l,currentIndex:u,isOpen:!0})},closeLightbox:()=>{o(b=>({...b,isOpen:!1}))},navigateToIndex:b=>{o(l=>({...l,currentIndex:b}))}}}const gl=({images:e,currentIndex:t,isOpen:o,onClose:n,onNavigate:r})=>{const a=t===0,i=t===e.length-1,b=p.useCallback(()=>{if(e.length<=1||i)return;const u=(t+1)%e.length;r(u)},[e.length,i,t,r]),l=p.useCallback(()=>{if(e.length<=1||a)return;const u=(t-1+e.length)%e.length;r(u)},[e.length,a,t,r]);return p.useEffect(()=>{const u=O=>{o&&(O.key==="ArrowRight"&&!i?b():O.key==="ArrowLeft"&&!a&&l())};return window.addEventListener("keydown",u),()=>{window.removeEventListener("keydown",u)}},[o,t,e.length,b,l,i,a]),!o||e.length===0?null:z.jsx(m3,{open:o,onOpenChange:u=>{u||n()},children:z.jsxs(Ta,{className:"top-[50%] h-[100vh] max-h-[100vh] w-[100vw] max-w-[100vw] translate-y-[-50%] items-center border-none bg-transparent p-0 shadow-none data-[state=closed]:zoom-out-100 data-[state=open]:zoom-in-100 data-[state=closed]:slide-out-to-top-[50%] data-[state=open]:slide-in-from-top-[50%]",onClick:()=>n(),children:[z.jsx("img",{alt:e[t].alt,className:"mx-auto max-h-[90vh] max-w-[90vw] object-contain",src:e[t].url,onClick:u=>u.stopPropagation()}),e.length>1&&z.jsxs(z.Fragment,{children:[z.jsxs(o1,{className:"absolute left-5 top-1/2 size-11 -translate-y-1/2 rounded-full bg-black/50 p-0 pr-0.5 hover:bg-black/70",disabled:a,onClick:u=>{u.stopPropagation(),l()},children:[z.jsx(dZ,{className:"!size-6"}),z.jsx("span",{className:"sr-only",children:"Previous image"})]}),z.jsxs(o1,{className:"absolute right-5 top-1/2 size-11 -translate-y-1/2 rounded-full bg-black/50 p-0 pl-0.5 hover:bg-black/70",disabled:i,onClick:u=>{u.stopPropagation(),b()},children:[z.jsx(ld,{className:"!size-6"}),z.jsx("span",{className:"sr-only",children:"Next image"})]})]}),z.jsx(eY,{asChild:!0,children:z.jsxs(o1,{className:"absolute right-5 top-5 size-11 rounded-full bg-black/50 p-0 hover:bg-black/70",children:[z.jsx(Ad,{className:"!size-5"}),z.jsx("span",{className:"sr-only",children:"Close"})]})})]})})},fA=()=>{},a5=({className:e,following:t,handle:o,variant:n="default",onFollow:r=fA,onUnfollow:a=fA,"data-testid":i})=>{const[b,l]=p.useState(t),u=e5("index",()=>{},()=>{l(!0)}),O=t5("index",()=>{},()=>{l(!1)}),f=async()=>{b?(l(!1),a(),u.mutate(o)):(l(!0),r(),O.mutate(o))};p.useEffect(()=>{l(t)},[t]);const h=b?"Following":"Follow";return n==="link"?z.jsx(o1,{className:Z1("p-0 font-medium",b?"text-gray-700 hover:text-black dark:text-gray-600 dark:hover:text-white":"text-purple hover:text-black dark:hover:text-white",e),"data-testid":i,variant:"link",onClick:q=>{q?.preventDefault(),q?.stopPropagation(),f()},children:h}):z.jsx(o1,{className:Z1("min-w-[90px]",e),"data-testid":i,title:b?"Click to unfollow":"",variant:b?"outline":"default",onClick:q=>{q?.preventDefault(),q?.stopPropagation(),f()},children:h})};function Xz(e,t=[]){if(t.length===0)return e.replace(/<br\s*\/?>/gi," ").replace(/<\/p>\s*<p>|<\/div>\s*<div>|<\/h[1-6]>\s*<|<\/li>\s*<li>|<\/a>/gi," ").replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim();const o=t.map(u=>u.toLowerCase()),n={};let r=0,i=e.replace(/<\/(h[1-6]|p|div|li|blockquote|pre)>/gi,"<br>");for(const u of o){const O=new RegExp(`<${u}[^>]*>.*?<\\/${u}>|<${u}[^>]*\\/?>`,"gis");i=i.replace(O,f=>{const h=`__EXCLUDED_TAG_${r+=1}__`;return n[h]=f,h})}let b=i;o.includes("br")||(b=i.replace(/<br\s*\/?>/gi," "));let l=b.replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim();for(const[u,O]of Object.entries(n))l=l.replace(u,O);return l}const Hi=e=>{const t=document.createElement("div");t.innerHTML=e;const o=t.getElementsByTagName("a");for(let n=0;n<o.length;n++)(o[n].getAttribute("href")||"").match(/^\s*(javascript|data|vbscript):/i)&&o[n].removeAttribute("href"),o[n].setAttribute("target","_blank"),o[n].setAttribute("rel","noopener noreferrer");return t.innerHTML},AA=e=>"preferredUsername"in e,Eo=({actor:e,children:t,disabled:o=!1,side:n="bottom",align:r="start",isCurrentUser:a=!1})=>{const[i,b]=p.useState(!1),l=Jt();let u=e?.handle;!u&&e&&AA(e)&&(u=Po(e));const O=o||!u&&!e,f=o5("index",u||"",{enabled:i&&!!u}),h=f.isFetching||f.isLoading,q=f.error,g=f.data?typeof f.data.followerCount=="number"&&typeof f.data.followingCount=="number"&&f.data.bio!==void 0:!1;if(p.useEffect(()=>{!i||!u||!g&&!h&&!q&&f.refetch({cancelRefetch:!1})},[f,h,q,g,i,u]),O)return z.jsx(z.Fragment,{children:t});const v=f.data||e,y=v?.handle??u??"",x=v?.name??"",k=v?.avatarUrl??(e&&AA(e)?e.icon?.url:null)??null,L=!!v?.followsMe,C=typeof v?.followingCount=="number"?v.followingCount:Number(v?.followingCount)||0,w=typeof v?.followerCount=="number"?v.followerCount:Number(v?.followerCount)||0,N=v?.bio?Hi(Xz(v.bio,["a"])):void 0,D=()=>{y&&l(`/profile/${y}`)},Y=()=>{y&&l(`/profile/${y}/following`)},V=()=>{y&&l(`/profile/${y}/followers`)};return z.jsxs(F00,{onOpenChange:b,children:[z.jsx(H00,{asChild:!0,children:t}),z.jsx(Hg,{align:r,className:"w-[320px] cursor-default rounded-2xl border-0 p-5 text-left text-gray-900 shadow-[0_5px_24px_0px_rgba(0,0,0,0.02),0px_2px_5px_0px_rgba(0,0,0,0.07),0px_0px_1px_0px_rgba(0,0,0,0.25)] outline-none dark:bg-[#101114] dark:shadow-none",side:n,sideOffset:12,onClick:J=>J.stopPropagation(),children:z.jsxs("div",{className:"flex flex-col gap-2",children:[z.jsxs("div",{className:"flex flex-col gap-2",children:[z.jsxs("div",{className:"flex justify-between",children:[z.jsxs(hd,{className:"size-14 cursor-pointer",onClick:D,children:[k&&z.jsx(qd,{alt:x,className:"rounded-full outline outline-[0.5px] outline-offset-[-0.5px] outline-black/10",src:k,onError:J=>{J.target.src="",J.target.style.display="none"}}),z.jsx(md,{className:"bg-gray-200 text-sm font-semibold text-gray-700 dark:bg-gray-800 dark:text-gray-200",children:z.jsx(Od,{className:"size-5 text-gray-500 dark:text-gray-400",strokeWidth:1.5})})]}),!a&&z.jsx(a5,{following:!!v?.followedByMe,handle:y,type:"primary"})]}),z.jsxs("div",{className:"flex cursor-pointer flex-col items-start",onClick:D,children:[z.jsx(nW,{className:"w-full truncate",children:x}),z.jsxs("div",{className:"flex w-full gap-2",children:[z.jsx("span",{className:"truncate text-gray-700 dark:text-gray-600",children:y}),L&&!a&&z.jsx(CK,{className:"mt-px whitespace-nowrap",variant:"secondary",children:"Follows you"})]})]})]}),z.jsx("div",{className:"flex gap-3 dark:text-gray-300",children:h?z.jsx(w1,{className:"h-4 w-32"}):!q&&z.jsxs(z.Fragment,{children:[z.jsxs("span",{className:"cursor-pointer hover:underline",onClick:Y,children:[z.jsx("span",{className:"font-bold text-black dark:text-white",children:Cf(C)})," ","Following"]}),z.jsxs("span",{className:"cursor-pointer hover:underline",onClick:V,children:[z.jsx("span",{className:"font-bold text-black dark:text-white",children:Cf(w)})," ","Followers"]})]})}),h?z.jsx(w1,{className:"h-4 w-48"}):!q&&N?z.jsx("div",{dangerouslySetInnerHTML:{__html:N},className:"leading-tight dark:text-gray-300 [&_.invisible]:hidden [&_a:hover]:underline [&_a]:text-[#00a4eb]"}):null]})})]})},rv=(e={})=>{const[t,o]=p.useState(!1),n=we();return p.useEffect(()=>{const r=a=>{if(a.target instanceof HTMLInputElement||a.target instanceof HTMLTextAreaElement||a.target instanceof HTMLElement&&a.target.isContentEditable||a.target instanceof HTMLSelectElement||a.metaKey||a.ctrlKey||a.altKey||a.shiftKey)return;const i=document.querySelector('[role="dialog"][data-state="open"]');if(!(i&&!(e.componentRef?.current?.closest('[role="dialog"]')===i)))switch(a.key.toLowerCase()){case"n":i||(a.preventDefault(),e.onOpenNewNote?e.onOpenNewNote():o(!0));break;case"r":e.isReplyAvailable&&e.onOpenReply&&(n.pathname.includes("/notes/")||n.pathname.includes("/reader/"))&&(a.preventDefault(),e.onOpenReply());break}};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,n.pathname]),{isNewNoteModalOpen:t,setIsNewNoteModalOpen:o}},Ri=({actor:e,object:t,likeCount:o,commentCount:n,repostCount:r,layout:a,disabled:i=!1,buttonClassName:b="",onLikeClick:l,onCommentClick:u,onReplyCountChange:O})=>{const[f,h]=p.useState(t.liked),[q,g]=p.useState(t.reposted),[W,v]=p.useState(!1),y=p.useRef(null);rv({isReplyAvailable:!u&&a!=="reply",onOpenReply:()=>v(!0),componentRef:y}),p.useEffect(()=>{h(t.liked),g(t.reposted)},[t.liked,t.reposted]),p.useEffect(()=>{N(r)},[r]);const x=Nn0("index"),k=Bn0("index"),L=_n0("index"),C=En0("index"),[w,N]=p.useState(r),D=async J=>{J.stopPropagation(),f?k.mutate(t.id):x.mutate(t.id,{onError(){h(!1)}}),h(!f),l()},Y=J=>{J.stopPropagation(),u?u():v(!0)},V=`px-2 gap-1.5 font-normal text-md [&_svg]:size-[18px] transition-color ap-action-button text-gray-900 hover:text-gray-900 hover:bg-black/[3%] dark:bg-black dark:hover:bg-gray-950 dark:text-gray-600 ${b}`;return z.jsxs(z.Fragment,{children:[z.jsxs("div",{ref:y,className:`flex ${a!=="inbox"&&"gap-1"}`,children:[z.jsxs(o1,{className:`${V} ${f&&"text-pink-500 hover:text-pink-500"}`,"data-testid":"like-button",disabled:i,id:"like",title:`${f?"Undo like":"Like"}`,variant:"ghost",onClick:J=>{J?.stopPropagation(),J&&D(J)},children:[z.jsx(TZ,{className:`${f&&"fill-pink-500 text-pink-500"}`}),a!=="inbox"&&z.jsx(Tf,{className:o===0?"-ml-1.5 w-0 overflow-hidden":"",spinTiming:{duration:300},value:o})]}),z.jsxs(o1,{className:`${V}`,"data-testid":"reply-button",disabled:i,id:"comment",title:"Reply",variant:"ghost",onClick:Y,children:[z.jsx(ud,{className:"-mr-px"}),a!=="inbox"&&n>0&&bd(n)]}),z.jsxs(o1,{className:`${V} ${q&&"text-green-500 hover:text-green-500"}`,"data-testid":"repost-button",disabled:i,id:"repost",title:`${q?"Undo repost":"Repost"}`,variant:"ghost",onClick:J=>{J?.stopPropagation(),q?(C.mutate(t.id),N(w-1)):(L.mutate(t.id,{onError(){g(!1),N(w-1)}}),N(w+1)),g(!q)},children:[z.jsx(p9,{className:`${q&&"text-green-500"}`}),a!=="inbox"&&z.jsx(Tf,{className:w===0?"-ml-1.5 w-0 overflow-hidden":"",spinTiming:{duration:300},value:w})]})]}),W&&z.jsx(i5,{open:W,replyTo:{object:t,actor:e},onOpenChange:J=>{v(J)},onReply:()=>{O?.(1),v(!1)},onReplyError:()=>{O?.(-1)}})]})};function Hn0(e){const o=e.replace(/<[^>]*>/g,"").split(/\s+/).filter(r=>r.length>0).length;return`${Math.ceil(o/275)} min read`}const Lo=(e,t,o)=>{o?.stopPropagation(),t(typeof e=="string"?`/profile/${e}`:`/profile/${e.handle||Po(e)}`)},Un0=e=>{const t=new Date,o=i=>new Date(i.getFullYear(),i.getMonth(),i.getDate()),n=o(t),r=o(new Date(t.getTime()-1440*60*1e3)),a=o(e);return a.getTime()===n.getTime()?Vn0(e):a.getTime()===r.getTime()?"Yesterday":$n0(e)},Vn0=e=>{const o=Math.floor((new Date().getTime()-e.getTime())/1e3);if(o<1)return"Just now";if(o<60)return`${o}s`;const n=Math.floor(o/60);return n<60?`${n}m`:`${Math.floor(n/60)}h`},$n0=e=>{const t=new Date,o=e.getDate(),n=e.toLocaleString("default",{month:"short"});return e.getFullYear()===t.getFullYear()?`${o} ${n}`:`${o} ${n} ${e.getFullYear()}`};function Qn0(e){return new Date(e).toLocaleDateString("default",{year:"numeric",month:"short",day:"2-digit"})+", "+new Date(e).toLocaleTimeString("default",{hour:"2-digit",minute:"2-digit"})}function yi(e,t=!0){const o=new Date(e?.published??e?.createdAt??new Date),n=Qn0(o),r=Un0(o);return t&&!e.url?.includes("/.ghost/activitypub")?z.jsx("a",{className:"whitespace-nowrap text-gray-700 hover:underline",href:e.url,rel:"noreferrer",target:"_blank",title:n,onClick:a=>a.stopPropagation(),children:r}):z.jsx("span",{className:"whitespace-nowrap text-gray-700",children:r})}function s5(e){let t;if(e.image&&(t=e.image),e.type==="Note"&&!t&&(t=e.attachment),!t)return null;if(Array.isArray(t)){if(t.length===0)return null;if(t.length===1)return t[0]}return t}function $c(e,t,o,n){const r=s5(e);if(!r)return null;const a=l=>u=>{u.stopPropagation(),t&&t(l)},i=l=>{n&&n(l)},b=(l,u=!1)=>{const O=u?"min-h-[200px]":"";return z.jsx("div",{className:`${l} ${O} flex w-full items-center justify-center bg-gray-100 dark:bg-gray-925/30`,children:z.jsx(XZ,{className:"text-gray-400",size:24,strokeWidth:1.5})})};if(Array.isArray(r)){const l=r.length;let u="";return l===1?u="grid-cols-1":l>=2&&l<=4?u="grid-cols-2 auto-rows-[150px]":l>4&&(u="grid-cols-3 auto-rows-[150px]"),z.jsx("div",{className:`attachment-gallery mt-3 grid w-full ${u} gap-2`,children:r.map((O,f)=>{const h=`size-full rounded-md outline outline-1 -outline-offset-1 outline-black/10 ${l===3&&f===0?"row-span-2":""}`;return o&&o.has(O.url)?b(h,l===1):z.jsx("img",{alt:O.name||`Image-${f}`,className:`${h} cursor-pointer object-cover`,referrerPolicy:"no-referrer",src:O.url,onClick:t?a(O.url):void 0,onError:()=>i(O.url)},O.url)})})}switch(r.mediaType){case"image/jpeg":case"image/png":case"image/gif":case"image/webp":return o&&o.has(r.url)?b(`${e.type==="Article"?"w-full rounded-t-md":"mt-3 max-h-[420px] rounded-md outline outline-1 -outline-offset-1 outline-black/10"}`,!0):z.jsx("img",{alt:r.name||"Image",className:`cursor-pointer ${e.type==="Article"?"w-full rounded-t-md":"mt-3 max-h-[420px] rounded-md outline outline-1 -outline-offset-1 outline-black/10"}`,referrerPolicy:"no-referrer",src:r.url,onClick:t?a(r.url):void 0,onError:()=>i(r.url)});case"video/mp4":case"video/webm":return z.jsx("div",{className:"relative mb-4 mt-3",children:z.jsx("video",{className:"h-[300px] w-full rounded object-cover",src:r.url,controls:!0})});case"audio/mpeg":case"audio/ogg":return z.jsx("div",{className:"relative mb-4 mt-2 w-full",children:z.jsx("audio",{className:"w-full",src:r.url,controls:!0})});default:if(e.image||r.type==="Image"){const l=e.type==="Article"?"cursor-pointer aspect-[16/7.55] w-full rounded-t-md object-cover":"cursor-pointer mt-3 max-h-[420px] rounded-md outline outline-1 -outline-offset-1 outline-black/10";let u;return e.image?typeof e.image=="string"?u=e.image:u=e.image?.url:u=r.url,o&&o.has(u)?b(l,!0):z.jsx("img",{alt:r.name||"Image",className:l,referrerPolicy:"no-referrer",src:u,onClick:t?a(u):void 0,onError:()=>i(u)})}return null}}function Zn0(e,t){const o=s5(e),n="ml-8 md:ml-9 shrink-0 rounded-md h-[91px] w-[121px] relative",r=Z1("object-cover outline outline-1 -outline-offset-1 outline-black/[0.05]",n);if(t)return z.jsx(w1,{className:`${r} outline-0`});if(!o)return null;if(Array.isArray(o))return z.jsx("img",{className:r,referrerPolicy:"no-referrer",src:o[0].url});switch(o.mediaType){case"image/jpeg":case"image/png":case"image/gif":return z.jsx("img",{className:r,referrerPolicy:"no-referrer",src:o.url});case"video/mp4":case"video/webm":return z.jsxs("div",{className:n,children:[z.jsx("video",{className:"h-[80px] w-full rounded object-cover",src:o.url}),z.jsx("div",{className:"absolute inset-0 rounded bg-gray-900 opacity-50"}),z.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:z.jsx(cG,{color:"white",fill:"white",size:40})})]});case"audio/mpeg":case"audio/ogg":return z.jsx("div",{className:"ml-8 w-[120px]",children:z.jsx("div",{className:"relative mb-4 mt-2 w-full",children:z.jsx("audio",{className:"w-full",src:o.url,controls:!0})})});default:return e.image?z.jsx("img",{className:r,referrerPolicy:"no-referrer",src:typeof e.image=="string"?e.image:e.image?.url}):null}}const hA=()=>{},qA=z.jsx(p9,{className:"shrink-0 text-gray-700 dark:text-gray-600",size:16,strokeWidth:1.5}),Gn0=({actor:e,allowDelete:t=!1,object:o,parentId:n=void 0,layout:r,type:a,commentCount:i=0,repostCount:b=0,likeCount:l=0,showHeader:u=!0,last:O,isLoading:f,isPending:h=!1,isCompact:q=!1,isChainContinuation:g=!1,isChainParent:W=!1,onClick:v=hA,onDelete:y=hA,showStats:x=!0})=>{const k=new Date(o?.published??new Date).toLocaleDateString("default",{year:"numeric",month:"short",day:"2-digit"})+", "+new Date(o?.published??new Date).toLocaleTimeString("default",{hour:"2-digit",minute:"2-digit"}),[,L]=p.useState(!1),[C,w]=p.useState(new Set),N=p.useRef(null),[D,Y]=p.useState(!1),V=jn0("index"),J=Jt(),t0=t5("index",()=>{Re.success(`Followed ${X?.name}`)},()=>{Re.error("Failed to follow")}),K=e5("index",()=>{Re.info(`Unfollowed ${X?.name}`)},()=>{Re.error("Failed to unfollow")});p.useEffect(()=>{const j0=N.current;j0&&Y(j0.scrollHeight>j0.clientHeight)},[o?.content]),p.useEffect(()=>{const j0=N.current;if(!j0)return;const p1=S=>{const r0=S.target.closest("a[data-profile]");if(r0){const A0=r0.getAttribute("data-profile")?.trim();/^@([\w.-]+)@([\w-]+\.[\w.-]+[a-zA-Z])$/.test(A0||"")&&A0&&(S.preventDefault(),S.stopPropagation(),Lo(A0,J))}};return j0.addEventListener("click",p1),()=>{j0.removeEventListener("click",p1)}},[J,o?.content]);const a0=()=>{},q0=()=>{h||v()},Z=()=>{V.mutate({id:o.id,parentId:n}),y()},z0=async()=>{o?.url&&(await navigator.clipboard.writeText(o.url),L(!0),Re.success("Link copied"),setTimeout(()=>L(!1),2e3))},U=j0=>{w(p1=>new Set(p1).add(j0))};let X=e;a==="Announce"&&(X=typeof o.attributedTo=="object"?o.attributedTo:e);const G=X?Po(X):null,_=X?.followedByMe||!1,I=a==="Announce"?typeof o.attributedTo=="object"&&o.attributedTo&&!Array.isArray(o.attributedTo)&&"authored"in o.attributedTo?o.attributedTo.authored:typeof o.attributedTo=="object"&&o.attributedTo&&!Array.isArray(o.attributedTo)&&typeof e=="object"&&e&&o.attributedTo.id===e.id:o.authored,i0=a==="Announce"?o.reposted??!1:o.authored,d0=()=>{G&&t0.mutate(G)},m0=()=>{G&&K.mutate(G)},W0=z.jsx(o1,{className:`relative z-10 size-[34px] rounded-md ${r==="inbox"||r==="modal"?"text-gray-900 hover:text-gray-900 dark:text-gray-600 dark:hover:text-gray-600":"text-gray-500 hover:text-gray-500"} dark:bg-black dark:hover:bg-gray-950 [&_svg]:size-5`,"data-testid":"menu-button",variant:"ghost",children:z.jsx(a9,{})}),{lightboxState:s0,openLightbox:e0,closeLightbox:w0,navigateToIndex:x0}=Fn0(o);return r==="feed"?z.jsxs(z.Fragment,{children:[o&&z.jsxs("div",{className:`group/article relative -mx-4 ${h?"pointer-events-none":"cursor-pointer"} rounded-lg p-6 px-4 pb-[18px]`,"data-layout":"feed","data-object-id":o.id,onClick:q0,children:[a==="Announce"&&z.jsxs("div",{className:"z-10 mb-2 flex items-center gap-1.5 text-gray-700 dark:text-gray-600",children:[qA,z.jsxs("div",{className:"flex min-w-0 items-center gap-1 text-sm",children:[z.jsx(Eo,{actor:e,align:"center",isCurrentUser:i0,children:z.jsx("span",{className:"truncate break-anywhere hover:underline",onClick:j0=>{Lo(e,J,j0)},children:e.name})}),"reposted"]})]}),z.jsxs("div",{className:"border-1 flex flex-col gap-2.5","data-test-activity":!0,children:[z.jsxs("div",{className:"flex items-center justify-between",children:[z.jsx(Eo,{actor:X,isCurrentUser:I,children:z.jsxs("div",{className:"flex min-w-0 grow items-center gap-3",children:[z.jsx(Xo,{author:X,disabled:h,showFollowButton:!I&&!_}),z.jsxs("div",{className:"flex min-w-0 grow flex-col",onClick:j0=>{h||Lo(X,J,j0)},children:[z.jsx("span",{className:`min-w-0 truncate font-semibold break-anywhere ${q?"text-lg":"text-md"} ${h?"":"hover-underline"} dark:text-white`,"data-test-activity-heading":!0,children:f?z.jsx(w1,{className:"w-24"}):X.name}),z.jsxs("div",{className:"flex w-full text-md text-gray-700 dark:text-gray-600",children:[z.jsx("span",{className:`truncate ${h?"":"hover-underline"}`,children:f?z.jsx(w1,{className:"w-56"}):Po(X)}),z.jsx("div",{className:`ml-1 before:mr-1 ${!f&&'before:content-["·"]'}`,title:`${k}`,children:f?z.jsx(w1,{className:"w-4"}):yi(o,h===!1&&!o.authored)})]})]})]})}),z.jsx(ml,{allowDelete:t,authoredByMe:I,disabled:h,followedByMe:_,layout:"feed",trigger:W0,onCopyLink:z0,onDelete:Z,onFollow:d0,onUnfollow:m0})]}),z.jsx("div",{className:"relative col-start-2 col-end-3 w-full gap-4 pl-[52px]",children:z.jsxs("div",{className:"flex flex-col",children:[z.jsx("div",{className:"",children:o.type==="Article"?z.jsxs("div",{className:"rounded-md border border-gray-150 transition-colors hover:bg-gray-75 dark:border-gray-950 dark:hover:bg-gray-950",children:[$c(o,q0,C,U),z.jsxs("div",{className:"p-5",children:[z.jsx("div",{className:"mb-1 line-clamp-2 text-pretty text-lg font-semibold leading-tight tracking-tight break-anywhere","data-test-activity-heading":!0,children:o.name}),z.jsx("div",{className:"line-clamp-3 leading-[1.4em] break-anywhere",children:o.preview?.content})]})]}):z.jsxs("div",{className:"relative",children:[z.jsx("div",{className:"ap-note-content line-clamp-[10] text-pretty leading-[1.4285714286] tracking-[-0.006em] text-gray-900 break-anywhere dark:text-gray-300 [&_p+p]:mt-3",children:f?z.jsx(w1,{count:2}):z.jsx("div",{dangerouslySetInnerHTML:{__html:Hi(o.content||"")??""},ref:N,onClick:j0=>{const p1=j0.target;(p1.tagName==="A"||p1.closest("a"))&&j0.stopPropagation()}})}),D&&z.jsx("button",{className:"mt-1 text-blue-600",type:"button",children:"Show more"}),$c(o,e0,C,U)]})}),z.jsx("div",{className:"space-between relative z-[30] ml-[-8px] mt-1 flex",children:f?z.jsx(w1,{className:"ml-2 w-18"}):x&&z.jsx(Ri,{actor:X,commentCount:i,disabled:h,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0})})]})})]})]}),z.jsx(gl,{currentIndex:s0.currentIndex,images:s0.images,isOpen:s0.isOpen,onClose:w0,onNavigate:x0})]}):r==="modal"?z.jsxs(z.Fragment,{children:[o&&z.jsxs("div",{"data-object-id":o.id,children:[z.jsxs("div",{className:"group/article relative","data-layout":"modal",onClick:q0,children:[z.jsxs("div",{className:"z-10 -my-1 grid grid-cols-[auto_1fr] grid-rows-[auto_1fr] gap-3 pb-3 pt-4","data-test-activity":!0,children:[u&&z.jsxs(z.Fragment,{children:[z.jsx("div",{className:"relative z-10 pt-[3px]",children:z.jsx(Xo,{author:X,showFollowButton:!I&&!_})}),z.jsxs("div",{className:"relative z-10 flex w-full min-w-0 cursor-pointer flex-col overflow-visible text-[1.5rem]",onClick:j0=>{h||Lo(X,J,j0)},children:[z.jsxs("div",{className:"flex w-full",children:[z.jsx("span",{className:'min-w-0 truncate whitespace-nowrap font-semibold break-anywhere after:mx-1 after:font-normal after:text-gray-700 after:content-["·"] after:dark:text-gray-600',"data-test-activity-heading":!0,children:X.name}),z.jsx("div",{children:yi(o,!o.authored)})]}),z.jsx("div",{className:"flex w-full",children:z.jsx("span",{className:"min-w-0 truncate text-gray-700 dark:text-gray-600",children:Po(X)})})]})]}),z.jsx("div",{className:"relative z-10 col-start-1 col-end-3 w-full gap-4",children:z.jsxs("div",{className:"flex flex-col items-start",children:[o.name&&z.jsx(v2,{className:"mb-1 leading-tight break-anywhere","data-test-activity-heading":!0,children:o.name}),z.jsx("div",{dangerouslySetInnerHTML:{__html:Hi(o.content||"")??""},ref:N,className:"ap-note-content-large text-pretty text-[1.6rem] tracking-[-0.011em] text-gray-900 break-anywhere dark:text-gray-300 [&_p+p]:mt-3"}),$c(o,e0,C,U),z.jsx("div",{className:"space-between ml-[-8px] mt-3 flex",children:x&&z.jsx(Ri,{actor:X,commentCount:i,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0})})]})})]}),z.jsx("div",{className:"absolute -inset-x-3 -inset-y-0 z-0 rounded transition-colors max-lg:hidden"})]}),z.jsx("div",{className:"mt-3 h-px bg-gray-200 dark:bg-gray-950"})]}),z.jsx(gl,{currentIndex:s0.currentIndex,images:s0.images,isOpen:s0.isOpen,onClose:w0,onNavigate:x0})]}):r==="reply"?z.jsxs(z.Fragment,{children:[o&&z.jsxs("div",{className:`group/article relative ${q?"pb-6":g?"pb-5":"py-5"} ${h?"pointer-events-none":"cursor-pointer"}`,"data-layout":"reply","data-object-id":o.id,onClick:q0,children:[z.jsxs("div",{className:"border-1 flex flex-col gap-2.5 border-b-gray-200","data-test-activity":!0,children:[z.jsxs("div",{className:"flex items-center justify-between",children:[z.jsx(Eo,{actor:X,isCurrentUser:I,children:z.jsxs("div",{className:"flex min-w-0 grow items-center gap-3",children:[z.jsx(Xo,{author:X,disabled:h,showFollowButton:!I&&!_}),z.jsxs("div",{className:"flex min-w-0 grow flex-col",onClick:j0=>{h||Lo(X,J,j0)},children:[z.jsxs("div",{className:"flex",children:[z.jsx("span",{className:'min-w-0 truncate whitespace-nowrap font-semibold text-black break-anywhere after:mx-1 after:font-normal after:text-gray-700 after:content-["·"] dark:text-white',"data-test-activity-heading":!0,children:X.name}),z.jsx("div",{children:yi(o,h===!1&&!o.authored)})]}),z.jsx("div",{className:"flex",children:z.jsx("span",{className:"truncate text-gray-700",children:Po(X)})})]})]})}),!q&&z.jsx(ml,{allowDelete:t,authoredByMe:I,disabled:h,followedByMe:_,layout:"reply",trigger:W0,onCopyLink:z0,onDelete:Z,onFollow:d0,onUnfollow:m0})]}),z.jsx("div",{className:"relative z-10 col-start-2 col-end-3 w-full gap-4 pl-[52px]",children:z.jsxs("div",{className:"flex flex-col items-start",children:[o.type==="Article"&&$c(o,q0,C,U),o.name&&z.jsx(v2,{className:"mt-2.5 text-pretty leading-tight break-anywhere","data-test-activity-heading":!0,children:o.name}),o.preview&&o.type==="Article"?z.jsx("div",{className:"mt-1 line-clamp-3 leading-tight",children:o.preview.content}):z.jsx("div",{dangerouslySetInnerHTML:{__html:Hi(o.content||"")??""},ref:N,className:"ap-note-content text-pretty tracking-[-0.006em] text-gray-900 break-anywhere dark:text-gray-300 [&_p+p]:mt-3"}),o.type==="Note"&&$c(o,e0,C,U),o.type==="Article"&&z.jsx(o1,{className:"mt-3 w-full",id:"read-more",variant:"secondary",children:"Read more"}),!q&&z.jsx("div",{className:"space-between ml-[-8px] mt-2 flex",children:x&&z.jsx(Ri,{actor:X,commentCount:i,disabled:h,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0})})]})})]}),!O&&z.jsx("div",{className:`absolute left-[19px] ${q?"bottom-[8px] top-[51px]":g?"bottom-[5px] top-[51px]":W?"bottom-[5px] top-[71px]":"bottom-[-7px] top-[71px]"} z-0 w-[2px] rounded-sm bg-gray-200 dark:bg-gray-950`})]}),z.jsx(gl,{currentIndex:s0.currentIndex,images:s0.images,isOpen:s0.isOpen,onClose:w0,onNavigate:x0})]}):r==="inbox"?z.jsx(z.Fragment,{children:o&&z.jsxs("div",{className:"group/article relative -mx-4 -my-px flex min-h-[112px] min-w-0 cursor-pointer items-center justify-between rounded-lg p-6 hover:bg-gray-75 dark:hover:bg-gray-950/50","data-layout":"inbox","data-object-id":o.id,onClick:q0,children:[z.jsxs("div",{className:"w-full min-w-0",children:[z.jsx("div",{className:"z-10 mb-1.5 flex w-full min-w-0 items-center gap-1.5 text-sm group-hover/article:border-transparent",children:f?z.jsx(w1,{className:"w-24"}):z.jsxs(z.Fragment,{children:[z.jsx(Eo,{actor:X,isCurrentUser:I,children:z.jsxs("div",{className:"flex items-center gap-1",children:[z.jsx(Xo,{author:X,size:"2xs"}),z.jsx("span",{className:"min-w-0 font-semibold text-gray-900 break-anywhere hover:underline dark:text-gray-600","data-test-activity-heading":!0,onClick:j0=>{Lo(X,J,j0)},children:X.name})]})}),a==="Announce"&&z.jsxs("span",{className:"z-10 flex items-center gap-1 text-gray-700 dark:text-gray-600",children:[qA,z.jsx(Eo,{actor:e,align:"center",isCurrentUser:i0,children:z.jsx("span",{className:"line-clamp-1 hover:underline",onClick:j0=>{Lo(e,J,j0)},children:e.name})})," reposted"]}),z.jsx("span",{className:'shrink-0 whitespace-nowrap text-gray-600 before:mr-1 before:content-["·"]',title:`${k}`,children:yi(o,!o.authored)})]})}),z.jsxs("div",{className:"flex",children:[z.jsxs("div",{className:"flex min-h-[73px] w-full min-w-0 flex-col items-start justify-start gap-1",children:[z.jsx(v2,{className:"line-clamp-2 w-full max-w-[600px] text-pretty leading-tight break-anywhere","data-test-activity-heading":!0,children:f?z.jsx(w1,{className:"w-full max-w-96"}):o.name?o.name:z.jsx("span",{dangerouslySetInnerHTML:{__html:Xz(o.content||"")}})}),z.jsx("div",{className:"ap-note-content line-clamp-2 w-full max-w-[600px] text-pretty text-base leading-normal text-gray-900 break-anywhere dark:text-gray-300 [&_p+p]:mt-3",children:f?z.jsx(w1,{count:2}):z.jsx("div",{dangerouslySetInnerHTML:{__html:Xz(o.preview?.content??o.content??"")}})}),z.jsx("span",{className:"mt-1 shrink-0 whitespace-nowrap text-sm leading-none text-gray-600",children:f?z.jsx(w1,{className:"w-16"}):o.content&&`${Hn0(o.content)}`})]}),z.jsxs("div",{className:"invisible absolute right-3 top-8 z-[49] flex -translate-y-1/2 rounded-lg bg-white p-1 shadow-md group-hover/article:visible dark:bg-black",children:[x&&z.jsx(Ri,{actor:X,commentCount:i,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0}),z.jsx(ml,{allowDelete:t,authoredByMe:I,followedByMe:_,layout:"inbox",trigger:W0,onCopyLink:z0,onDelete:Z,onFollow:d0,onUnfollow:m0})]})]})]}),Zn0(o,f)]})}):z.jsx(z.Fragment,{})},mA=5*1024*1024,gA="Image must be less than 5MB in size.",za0=async e=>{try{const t=await fetch(e,{mode:"cors"});if(!t.ok)throw new Error(`Failed to fetch image: ${t.status}`);const o=await t.blob();return new Promise((n,r)=>{const a=new FileReader;a.onload=()=>n(a.result),a.onerror=r,a.readAsDataURL(o)})}catch{return e}},ua0=e=>new Promise(t=>{const o=new Image;o.onload=()=>{URL.revokeObjectURL(o.src),t(o.width===o.height)},o.src=URL.createObjectURL(e)}),da0="Image must be square.",i5=({children:e,replyTo:t,onReply:o,onReplyError:n,onOpenChange:r,...a})=>{const{data:i}=Sn0("index"),b=Xn0("index",i),l=Pn0("index",i),{data:u,isLoading:O}=o5("index","me"),[f,h]=p.useState(!1),q=p.useRef(null),g=p.useRef(null),[W,v]=p.useState(null),[y,x]=p.useState(!1),k=p.useRef(null),[L,C]=p.useState(""),[w,N]=p.useState(null),[D,Y]=p.useState(""),[V,J]=p.useState(!1),[t0,K]=p.useState(!1),[a0,q0]=p.useState(!1),Z=Jt(),z0=500;p.useEffect(()=>{a.open!==void 0&&h(a.open)},[a.open]),p.useEffect(()=>{if(a.open!==void 0?a.open:f){const w0=setTimeout(()=>{q0(!0)},300);return()=>clearTimeout(w0)}else q0(!1)},[f,a.open]);const U=!L.trim()||!i||t0||L.length>z0,X=p.useCallback(async()=>{const e0=L.trim();if(!(!e0||!i))try{K(!0),t?(await l.mutateAsync({inReplyTo:t.object.id,content:e0,imageUrl:w||void 0,altText:D||void 0}),o?.()):(await b.mutateAsync({content:e0,imageUrl:w||void 0,altText:D||void 0}),Z("/notes")),h(!1),r&&r(!1),Re.success(t?"Reply posted":"Note posted")}catch{t&&n?.()}finally{K(!1)}},[L,i,t,l,b,w,D,o,n,h,Z,r]),G=e0=>{C(e0.target.value)};p.useEffect(()=>{q.current&&(q.current.style.height="auto",q.current.style.height=`${q.current.scrollHeight}px`)},[L]),p.useEffect(()=>{if((a.open!==void 0?a.open:f)&&q.current){const w0=setTimeout(()=>{q.current?.focus()},100);return()=>clearTimeout(w0)}},[f,a.open]),p.useEffect(()=>{if(V&&g.current){const e0=setTimeout(()=>{g.current?.focus()},100);return()=>clearTimeout(e0)}},[V]),p.useEffect(()=>{const e0=x0=>{(x0.metaKey||x0.ctrlKey)&&x0.key==="Enter"&&(x0.preventDefault(),!U&&!y&&X())};if(a.open!==void 0?a.open:f)return document.addEventListener("keydown",e0),()=>document.removeEventListener("keydown",e0)},[f,a.open,U,y,X]);const _=p.useCallback(async e0=>{const w0=e0.clipboardData?.items;if(w0)for(let x0=0;x0<w0.length;x0++){const j0=w0[x0];if(j0.type.indexOf("image")!==-1){e0.preventDefault();const p1=j0.getAsFile();if(p1){if(p1.size>mA){Re.error(gA);return}const S=URL.createObjectURL(p1);v(S),await I(p1)}break}}},[]);p.useEffect(()=>{if(a.open!==void 0?a.open:f)return document.addEventListener("paste",_),()=>document.removeEventListener("paste",_)},[f,a.open,_]);const I=async e0=>{try{x(!0);const w0=await Dn0(e0);N(w0)}catch(w0){v(null);let x0="Failed to upload image. Try again.";if(w0&&typeof w0=="object"&&"statusCode"in w0)switch(w0.statusCode){case 413:x0="Image size exceeds limit.";break;case 415:x0="The file type is not supported.";break}Re.error(x0)}finally{x(!1)}},i0=async e0=>{const w0=e0.target.files;if(w0&&w0.length>0){const x0=w0[0];if(x0.size>mA){Re.error(gA),e0.target.value="";return}const j0=URL.createObjectURL(x0);v(j0),await I(x0)}},d0=e0=>{e0.stopPropagation(),v(null),N(null),Y(""),J(!1),W&&URL.revokeObjectURL(W),k.current&&(k.current.value="")},m0=e0=>{e0.stopPropagation(),J(!V)},W0=()=>{q.current?.focus()};p.useEffect(()=>()=>{W&&URL.revokeObjectURL(W)},[W]);let s0="What's new?";if(t){const e0=t.object.attributedTo||{};typeof e0=="object"&&"preferredUsername"in e0&&"id"in e0&&(s0=`Reply to ${Po(e0)}...`)}return z.jsxs(m3,{open:a.open!==void 0?a.open:f,onOpenChange:e0=>{e0&&(C(""),v(null),N(null),Y(""),J(!1),W&&URL.revokeObjectURL(W),k.current&&(k.current.value="")),h(e0),r&&r(e0)},...a.open!==void 0?{}:a,children:[z.jsx(V9,{asChild:!0,children:e}),z.jsxs(Ta,{className:"max-h-[80vh] min-h-[240px] gap-0 overflow-y-auto pb-0","data-testid":"new-note-modal",onClick:e0=>e0.stopPropagation(),children:[z.jsxs(yd,{className:"hidden",children:[z.jsx(Ld,{children:t?"Reply":"New note"}),z.jsx(Q9,{children:"Post your thoughts to the Social web"})]}),t&&z.jsx(Gn0,{actor:t.actor,allowDelete:!1,commentCount:t.object.replyCount??0,isCompact:!0,layout:"reply",likeCount:t.object.likeCount??0,object:t.object,repostCount:t.object.repostCount??0,type:t.object.type==="Article"?"Article":"Note",onClick:()=>{}}),z.jsxs("div",{className:`flex ${W?"":"min-h-36"} cursor-text items-start gap-3`,onClick:W0,children:[z.jsx("div",{className:"sticky top-0",children:z.jsx(Xo,{author:i})}),z.jsx(JP,{asChild:!0,children:z.jsxs("div",{className:"-mt-0.5 flex w-full flex-col gap-0.5",children:[O?z.jsx(w1,{className:"w-10"}):z.jsx("span",{className:"min-w-0 truncate whitespace-nowrap font-semibold text-black break-anywhere dark:text-white",children:u?.name}),z.jsx(x6,{name:"content",asChild:!0,children:z.jsx(k6,{asChild:!0,children:z.jsx("textarea",{ref:q,autoFocus:!0,className:"ap-textarea w-full resize-none bg-transparent text-[1.5rem] break-anywhere","data-testid":"note-textarea",placeholder:s0,rows:1,value:L,onChange:G,onPaste:_})})}),z.jsx(x6,{name:"image",asChild:!0,children:z.jsx(k6,{asChild:!0,children:z.jsx("input",{ref:k,accept:"image/jpeg,image/png,image/webp,image/gif",className:"hidden",type:"file",onChange:i0})})})]})})]}),W&&z.jsxs("div",{className:"group relative mt-6 flex min-h-[200px] w-full items-center justify-center",children:[z.jsx("img",{alt:"Image attachment preview",className:`max-h-[320px] w-full rounded-sm object-cover outline outline-1 -outline-offset-1 outline-black/10 ${y&&"opacity-10"}`,src:W}),y&&z.jsx("div",{className:"absolute leading-[0]",children:z.jsx(hp,{size:"md"})}),z.jsx(o1,{className:"absolute right-3 top-3 size-8 bg-black/60 text-white opacity-0 hover:bg-black/80 group-hover:opacity-100",onClick:d0,children:z.jsx(l9,{})}),!y&&z.jsx(o1,{className:`absolute bottom-3 left-3 h-6 px-2 py-0 text-white ${V?"bg-green-500 hover:bg-green-500":"bg-black/60 hover:bg-black/80"}`,onClick:m0,children:"Alt"})]}),W&&!y&&V&&z.jsx("div",{className:"mt-1",children:z.jsx(C3,{ref:g,className:"w-full border-0 bg-transparent px-0 focus-visible:border-0 focus-visible:bg-transparent focus-visible:shadow-none focus-visible:outline-0 dark:bg-[#101114] dark:text-white dark:placeholder:text-gray-800",placeholder:"Type alt text for image (optional)",type:"text",value:D,onChange:e0=>Y(e0.target.value)})}),z.jsxs(wd,{className:`${a0?"sticky":"static"} bottom-0 flex-row bg-background py-6 dark:bg-[#101114]`,children:[z.jsx(o1,{className:"mr-auto w-[34px] !min-w-0",variant:"outline",onClick:()=>k.current?.click(),children:z.jsx(DZ,{})}),z.jsxs("div",{className:"flex items-center space-x-3",children:[z.jsxs("div",{className:`text-sm ${L.length>=z0?"text-red-500":L.length>=z0*.9?"text-yellow-600":"text-gray-500"}`,children:[L.length,"/",z0]}),z.jsx(o1,{className:"min-w-16","data-testid":"post-button",disabled:U||y,onClick:X,children:t0?z.jsx(hp,{color:"light",size:"sm"}):"Post"})]})]})]})]})};function jz(e){if(!e)return{};try{return JSON.parse(e)}catch{return{}}}function Kn0(e,t){const o=jz(e);return JSON.stringify({...o,...t})}const cv=()=>{const{data:e}=qe(),{mutateAsync:t}=lW(),o=b0.useMemo(()=>e?.accessibility?jz(e.accessibility).apOnboarding||{}:{},[e?.accessibility]),n=b0.useCallback(async r=>{if(!e)return;const a=jz(e.accessibility),i=Kn0(e.accessibility,{apOnboarding:{...a.apOnboarding,...r}});await t({...e,accessibility:i})},[e,t]);return{isOnboarded:!!o.welcomeStepsFinished,isExplainerClosed:!!o.exploreExplainerClosed,setOnboarded:r=>n({welcomeStepsFinished:r}),setExplainerClosed:r=>n({exploreExplainerClosed:r})}},av=()=>z.jsx("div",{className:"h-full pt-14",children:z.jsx(kn,{})}),Yn0=Object.freeze(Object.defineProperty({__proto__:null,default:av,useOnboardingStatus:cv},Symbol.toStringTag,{value:"Module"})),Jn0=()=>{const e=Jt();function t(){e(`/notes/${encodeURIComponent("https://activitypub.ghost.org/.ghost/activitypub/note/6d6d7f57-b656-4caa-ba9e-efa1d9a4b3fb")}`)}return z.jsxs("div",{className:"z-20 w-full bg-white dark:bg-black",children:[z.jsxs("div",{className:"flex w-full flex-col gap-0.5 border-t border-gray-200 bg-white px-3 pt-6 dark:border-gray-950 dark:bg-black",children:[z.jsxs("div",{className:"flex items-center gap-2",children:[z.jsx(GZ,{className:"text-purple-500",size:20,strokeWidth:1.5}),z.jsx(v2,{children:"Beta feedback"})]}),z.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-600",children:"Something not working? Let us know"}),z.jsx(o1,{className:"mt-2 dark:bg-gray-925/70 dark:hover:bg-gray-900",variant:"secondary",onClick:t,children:"Send feedback"})]}),z.jsxs("div",{className:"-mb-1 ml-3 flex items-center gap-1.5 pb-2 pt-4 text-xs text-gray-400",children:[z.jsx("a",{className:"text-xs font-medium text-gray-700 hover:text-black dark:text-gray-600 dark:hover:text-white",href:"https://ghost.org/help/social-web/",rel:"noreferrer",target:"_blank",children:"Help"}),"⋅",z.jsx("a",{className:"text-xs font-medium text-gray-700 hover:text-black dark:text-gray-600 dark:hover:text-white",href:"https://activitypub.ghost.org/archive",rel:"noreferrer",target:"_blank",children:"Updates"})]})]})},wp=({children:e,url:t=null,onClick:o,"data-testid":n,isSelected:r=!1})=>{const a=b0.Children.toArray(e),i=z.jsx("div",{className:`relative flex w-full max-w-[620px] cursor-pointer flex-col before:absolute before:inset-x-[-16px] before:inset-y-[-1px] before:rounded-md before:bg-gray-50 before:transition-opacity hover:z-10 hover:cursor-pointer hover:border-b-transparent hover:before:opacity-100 dark:before:bg-gray-950 ${r?"z-10 before:opacity-100":"before:opacity-0"}`,"data-testid":n,onClick:()=>{!t&&o&&o()},children:z.jsxs("div",{className:"relative z-10 flex w-full items-center gap-3 py-3",children:[a[0],a[1],a[2]]})});return t?z.jsx("a",{href:t,rel:"noreferrer",target:"_blank",onClick:b=>{o&&(b.preventDefault(),o())},children:i}):i},er0=()=>{const e=Jt(),{suggestedProfilesQuery:t}=n5("index",3),{data:o,isLoading:n}=t,r=n?Array(3).fill(null):o||[],{resetStack:a}=Jp(),i="[@media(max-height:740px)]:hidden";return!n&&(!o||o.length===0)?null:z.jsxs("div",{className:`border-t border-gray-200 px-3 pt-6 dark:border-gray-950 ${i}`,children:[z.jsxs("div",{className:"mb-3 flex flex-col gap-0.5",children:[z.jsxs("div",{className:"flex items-center gap-2",children:[z.jsx(zp,{className:"text-purple-500",size:20,strokeWidth:1.5}),z.jsx(v2,{children:"Follow suggestions"})]}),z.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-600",children:"Accounts you might be interested in"})]}),z.jsx("ul",{className:"grow",children:r.map((b,l)=>{const u=b?.id||`loading-${l}`,O=b?.name||"",f=b?.handle||"",h=b?.avatarUrl||"";let q;switch(l){case 0:q="[@media(max-height:740px)]:hidden";break;case 1:q="[@media(max-height:800px)]:hidden";break;case 2:q="[@media(max-height:860px)]:hidden";break}return z.jsx(p.Fragment,{children:z.jsx("li",{className:q,children:z.jsx(Eo,{actor:b,align:"center",isCurrentUser:!1,side:"left",children:z.jsx("div",{children:z.jsxs(wp,{onClick:()=>{!n&&b&&Lo(b,e)},children:[n?z.jsx(w1,{className:"z-10 size-10"}):z.jsx(Xo,{author:{icon:{url:h},name:O,handle:f},showFollowButton:!0}),z.jsxs("div",{className:"flex min-w-0 flex-col",children:[z.jsx("span",{className:"block max-w-[190px] truncate font-semibold text-black dark:text-white",children:n?z.jsx(w1,{className:"w-24"}):O}),z.jsx("span",{className:"block max-w-[190px] truncate text-sm text-gray-700 dark:text-gray-600",children:n?z.jsx(w1,{className:"w-40"}):f})]})]})})})},u)},u)})}),z.jsx(o1,{className:"p-0 font-medium text-purple hover:text-black dark:hover:text-white",variant:"link",onClick:()=>{a(),e("/explore")},children:"Find more →"})]})},tr0=({profile:e,update:t,isLoading:o,onOpenChange:n})=>{const r=()=>{t(e.id,{followedByMe:!0})},a=()=>{t(e.id,{followedByMe:!1})},i=Jt();return z.jsx(Eo,{actor:e,align:"center",isCurrentUser:!1,side:"left",children:z.jsx("div",{children:z.jsxs(wp,{onClick:()=>{n?.(!1),i(`/profile/${e.handle}`)},children:[z.jsx(Xo,{author:{icon:{url:e.avatarUrl},name:e.name,handle:e.handle},onClick:()=>n?.(!1)}),z.jsxs("div",{className:"flex grow flex-col break-anywhere",children:[z.jsx("span",{className:"line-clamp-1 font-semibold text-black dark:text-white",children:o?z.jsx(w1,{className:"w-full max-w-64"}):e.name}),z.jsx("span",{className:"line-clamp-1 text-sm text-gray-700 dark:text-gray-600",children:o?z.jsx(w1,{className:"w-24"}):e.handle})]}),o?z.jsx("div",{className:"inline-flex items-center",children:z.jsx(w1,{className:"w-12"})}):z.jsx(a5,{className:"ml-auto",following:e.followedByMe,handle:e.handle,type:"secondary",onFollow:r,onUnfollow:a})]},e.id)})})},or0=({onOpenChange:e})=>{const{suggestedProfilesQuery:t,updateSuggestedProfile:o}=n5("index",5),{data:n=[],isLoading:r}=t;return!r&&(!n||n.length===0)?null:z.jsx("div",{className:"mb-[-15px] flex flex-col gap-3 pt-2",children:z.jsx("div",{className:"flex flex-col",children:(r?Array(5).fill(null):n||[]).map((a,i)=>z.jsx(b0.Fragment,{children:z.jsx(tr0,{isLoading:r,profile:a||{id:"",name:"",handle:"",avatarUrl:"",bio:"",followerCount:0,followingCount:0,followedByMe:!1},update:o,onOpenChange:e})},a?.id||`loading-${i}`))})})};function nr0(e,t,o,n){var r=this,a=p.useRef(null),i=p.useRef(0),b=p.useRef(0),l=p.useRef(null),u=p.useRef([]),O=p.useRef(),f=p.useRef(),h=p.useRef(e),q=p.useRef(!0);h.current=e;var g=typeof window<"u",W=!t&&t!==0&&g;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var v=!!(o=o||{}).leading,y=!("trailing"in o)||!!o.trailing,x="maxWait"in o,k="debounceOnServer"in o&&!!o.debounceOnServer,L=x?Math.max(+o.maxWait||0,t):null;p.useEffect(function(){return q.current=!0,function(){q.current=!1}},[]);var C=p.useMemo(function(){var w=function(K){var a0=u.current,q0=O.current;return u.current=O.current=null,i.current=K,b.current=b.current||K,f.current=h.current.apply(q0,a0)},N=function(K,a0){W&&cancelAnimationFrame(l.current),l.current=W?requestAnimationFrame(K):setTimeout(K,a0)},D=function(K){if(!q.current)return!1;var a0=K-a.current;return!a.current||a0>=t||a0<0||x&&K-i.current>=L},Y=function(K){return l.current=null,y&&u.current?w(K):(u.current=O.current=null,f.current)},V=function K(){var a0=Date.now();if(v&&b.current===i.current&&J(),D(a0))return Y(a0);if(q.current){var q0=t-(a0-a.current),Z=x?Math.min(q0,L-(a0-i.current)):q0;N(K,Z)}},J=function(){n&&n({})},t0=function(){if(g||k){var K=Date.now(),a0=D(K);if(u.current=[].slice.call(arguments),O.current=r,a.current=K,a0){if(!l.current&&q.current)return i.current=a.current,N(V,t),v?w(a.current):f.current;if(x)return N(V,t),w(a.current)}return l.current||N(V,t),f.current}};return t0.cancel=function(){var K=l.current;K&&(W?cancelAnimationFrame(l.current):clearTimeout(l.current)),i.current=0,u.current=a.current=O.current=l.current=null,K&&n&&n({})},t0.isPending=function(){return!!l.current},t0.flush=function(){return l.current?Y(Date.now()):f.current},t0},[v,x,t,L,y,W,g,k,n]);return C}function rr0(e,t){return e===t}function cr0(e,t,o){var n=rr0,r=p.useRef(e),a=p.useState({})[1],i=nr0(p.useCallback(function(l){r.current=l,a({})},[a]),t,o,a),b=p.useRef(e);return n(b.current,e)||(i(e),b.current=e),[r.current,i]}const wi=80,ar0=({onOpenChange:e,query:t,setQuery:o})=>{const n=p.useRef(null),r=p.useRef([]),a=p.useRef(0),i=Jt(),[b]=cr0(t,300),l=t.length>=2,{searchQuery:u,updateAccountSearchResult:O}=Tn0("index",l?b:""),{data:f,isFetching:h,isFetched:q}=u,{suggestedProfilesQuery:g}=n5("index",5),{data:W,isLoading:v}=g,y=v||W&&W.length>0,{topicsQuery:x}=r5(),{data:k}=x,L=o5("index","me"),{data:C}=L,[w,N]=p.useState([]),[D,Y]=p.useState(null),[V,J]=p.useState(0),t0=p.useMemo(()=>{const X=k?.topics||[];if(!l||X.length===0)return[];const G=t.toLowerCase();return X.filter(_=>_.slug==="following"?!1:_.name.toLowerCase().startsWith(G)||_.slug.toLowerCase().startsWith(G))},[t,l,k?.topics]),K=p.useMemo(()=>[...t0.map(X=>({type:"topic",data:X})),...w.map(X=>({type:"account",data:X}))],[t0,w]);p.useEffect(()=>{if(!l){N([]),Y(null);return}q&&(f?.accounts&&f.accounts.length>0?(N(f.accounts),Y("results"),J(0)):(N([]),Y("none"),J(0)))},[f?.accounts,q,l]);const a0=h&&l,q0=t.length<2||!D&&l&&t0.length===0,Z=!q0&&D==="none"&&t0.length===0,z0=!q0&&(w.length>0||t0.length>0);p.useEffect(()=>{n.current?.focus()},[]),p.useEffect(()=>{const X=r.current[V];if(!X)return;const G=X.closest("[data-radix-scroll-area-viewport]")||X.closest(".overflow-y-auto");if(!G){X.scrollIntoView({block:"nearest"});return}const _=G.getBoundingClientRect(),I=X.getBoundingClientRect();I.top<_.top+wi?G.scrollTo({top:G.scrollTop-(_.top+wi-I.top),behavior:"smooth"}):I.bottom>_.bottom-wi&&G.scrollTo({top:G.scrollTop+(I.bottom-_.bottom+wi),behavior:"smooth"})},[V]);const U=X=>{if(!(!z0||K.length===0)){if(X.key==="ArrowDown"||X.key==="ArrowUp"){X.preventDefault();const G=Date.now();if(G-a.current<50)return;a.current=G,X.key==="ArrowDown"?J(_=>(_+1)%K.length):J(_=>(_-1+K.length)%K.length)}else if(X.key==="Enter"){const G=K[V];if(!G)return;X.preventDefault(),e?.(!1),G.type==="topic"?i(`/explore/${G.data.slug}`):i(`/profile/${G.data.handle}`)}}};return z.jsxs(z.Fragment,{children:[z.jsxs("div",{className:'sticky -top-6 z-30 -mt-6 flex h-[72px] shrink-0 items-center gap-2 bg-white pb-2 pt-3 before:pointer-events-none before:absolute before:-inset-x-6 before:bottom-0 before:h-0 before:border-b before:border-b-gray-150 before:content-[""] dark:bg-[#101114] dark:before:border-b-gray-950',children:[z.jsx(dd,{className:"text-gray-600",size:18,strokeWidth:1.5}),z.jsx(C3,{ref:n,autoComplete:"off",className:"flex h-10 w-full items-center rounded-lg border-0 bg-transparent px-0 py-1.5 text-lg focus-visible:border-0 focus-visible:bg-transparent focus-visible:shadow-none focus-visible:outline-0 dark:bg-[#101114] dark:text-white dark:placeholder:text-gray-800",placeholder:"Search by name, handle, or URL...",title:"Search",type:"text",value:t,onChange:X=>o(X.target.value),onKeyDown:U}),a0&&z.jsx(hp,{className:"!absolute right-0 mr-0.5 shrink-0",size:"sm"})]}),z.jsxs("div",{className:"h-full",children:[Z&&z.jsx("div",{className:"flex h-full items-center justify-center pb-14",children:z.jsxs(Q00,{children:[z.jsx(Z00,{children:z.jsx(Od,{})}),"No users matching this handle or account URL"]})}),z0&&z.jsx("div",{className:"mt-[-14px] pb-2",children:K.map((X,G)=>{const _=G===V;if(X.type==="topic")return z.jsx("div",{ref:d0=>r.current[G]=d0,children:z.jsxs(wp,{isSelected:_,onClick:()=>{e?.(!1),i(`/explore/${X.data.slug}`)},children:[z.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-full bg-gray-100 dark:bg-gray-900",children:z.jsx(zp,{className:"text-gray-700 dark:text-gray-500",size:18,strokeWidth:1.5})}),z.jsxs("div",{className:"flex flex-col",children:[z.jsx("span",{className:"font-semibold text-black dark:text-white",children:X.data.name}),z.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-600",children:"Topic"})]})]})},X.data.slug);const I=X.data,i0=I.handle===C?.handle;return z.jsx(Eo,{actor:I,align:"center",isCurrentUser:i0,side:"left",children:z.jsx("div",{ref:d0=>r.current[G]=d0,children:z.jsxs(wp,{isSelected:_,onClick:()=>{e?.(!1),i(`/profile/${I.handle}`)},children:[z.jsx(Xo,{author:{icon:{url:I.avatarUrl},name:I.name,handle:I.handle}}),z.jsxs("div",{className:"flex flex-col break-anywhere",children:[z.jsx("span",{className:"line-clamp-1 font-semibold text-black dark:text-white",children:I.name}),z.jsx("span",{className:"line-clamp-1 text-sm text-gray-700 dark:text-gray-600",children:I.handle})]}),I.blockedByMe||I.domainBlockedByMe?z.jsx(o1,{className:"pointer-events-none ml-auto min-w-[90px]",variant:"destructive",children:"Blocked"}):i0?null:z.jsx(a5,{className:"ml-auto",following:I.followedByMe,handle:I.handle,type:"secondary",onFollow:()=>O(I.id,{followedByMe:!0}),onUnfollow:()=>O(I.id,{followedByMe:!1})})]})})},I.id)})}),q0&&y&&z.jsxs(z.Fragment,{children:[z.jsx(v2,{children:"More people to follow"}),z.jsx(or0,{onOpenChange:e})]})]})]})},sr0=()=>z.jsxs("div",{className:"inline-flex h-9 w-full items-center justify-start gap-2 rounded-full bg-gray-100 px-3 text-md font-normal text-gray-600 hover:bg-gray-200 hover:text-gray-600 dark:bg-gray-925/70 dark:text-gray-700 dark:hover:bg-gray-925 [&_svg]:size-[18px]",children:[z.jsx(dd,{size:18,strokeWidth:1.5})," Search the social web"]}),Wn=p.forwardRef(({to:e,children:t,count:o,...n},r)=>{const a=we(),{resetStack:i}=Jp(),b=K3(),l=e&&e.startsWith("/")?`${b}${e}`:e,u=l&&(a.pathname===l||a.pathname.startsWith(`${l}/`)),O=g0("justify-start text-md font-medium text-gray-800 dark:hover:bg-gray-925/70 dark:text-gray-500 h-9 [&_svg]:size-[18px]",u&&"bg-gray-100 dark:bg-gray-925/70 dark:text-white text-black font-semibold"),f=o&&o>0?z.jsx("span",{className:g0("ml-auto bg-purple-500 text-white text-xs font-semibold py-1 px-1.5 rounded-full min-w-[20px] h-5 flex items-center justify-center"),children:bd(o)}):null;return l?z.jsx(o1,{className:O,variant:"ghost",asChild:!0,children:z.jsxs(Ba,{to:l,onClick:()=>{i(),g10(l)},children:[t,f]})}):z.jsxs(o1,{ref:r,className:O,variant:"ghost",onClick:n.onClick,...n,children:[t,f]})});Wn.displayName="SidebarMenuLink";const sv=({isMobileSidebarOpen:e})=>{const{allFlags:t,flags:o}=vn0(),[n,r]=p.useState(!1),[a,i]=p.useState(""),{data:b}=qe(),l=we(),u=K3(),{data:O}=nv(b?.slug||""),f=In0(b?.slug||""),{topicsQuery:h}=r5(),{data:q,isLoading:g}=h,W=!g&&q&&q.topics.length===0;p.useEffect(()=>{l.pathname===`${u}/notifications`&&O&&O>0&&f.mutate()},[l.pathname,u,O,f]);const v=p.useCallback(()=>{O&&O>0&&f.mutate()},[O,f]);return z.jsx("div",{className:`sticky top-0 flex min-h-screen w-[320px] flex-col border-l border-gray-200 pr-8 transition-transform duration-300 ease-in-out max-lg:fixed max-lg:inset-y-0 max-lg:right-0 max-lg:z-50 max-lg:border-0 max-lg:bg-white max-lg:shadow-xl max-md:bottom-[72px] max-md:min-h-[auto] max-md:overflow-y-scroll dark:border-gray-950 max-lg:dark:bg-black ${e?"max-lg:translate-x-0":"max-lg:translate-x-full"}`,children:z.jsxs("div",{className:"flex grow flex-col justify-between",children:[z.jsxs("div",{className:"isolate flex w-full flex-col items-start gap-6 pl-6 pt-6",children:[z.jsx("div",{className:"flex h-[52px] w-full items-center",children:z.jsxs(m3,{open:n,onOpenChange:r,children:[z.jsx(V9,{className:"mt-0.5 w-full",children:z.jsx(sr0,{})}),z.jsx(Ta,{className:"flex h-full max-h-[452px] flex-col overflow-y-auto pb-0",children:z.jsx(ar0,{query:a,setQuery:i,onOpenChange:r})})]})}),z.jsxs("div",{className:"flex w-full flex-col gap-px",children:[z.jsxs(Wn,{to:"/reader",children:[z.jsx(iZ,{size:18,strokeWidth:1.5}),"Reader"]}),z.jsxs(Wn,{to:"/notes",children:[z.jsx(ud,{size:18,strokeWidth:1.5}),"Notes"]}),z.jsxs(Wn,{count:l.pathname!==`${u}/notifications`?O:void 0,to:"/notifications",onClick:v,children:[z.jsx(aZ,{size:18,strokeWidth:1.5}),"Notifications"]}),W?z.jsx(o1,{className:"inline-flex w-full items-center gap-2 rounded-sm px-3 py-2.5 text-left text-md font-medium text-gray-800 transition-colors hover:bg-gray-100 dark:text-gray-500 dark:hover:bg-gray-925/70",variant:"ghost",asChild:!0,children:z.jsxs("a",{href:"https://explore.ghost.org/social-web",rel:"noopener noreferrer",target:"_blank",children:[z.jsx(zp,{size:18,strokeWidth:1.5}),"Explore",z.jsx(zd,{className:"ml-auto",size:14,strokeWidth:1.5})]})}):z.jsxs(Wn,{to:"/explore",children:[z.jsx(zp,{size:18,strokeWidth:1.5}),"Explore"]}),z.jsxs(Wn,{to:"/profile",children:[z.jsx(fd,{size:18,strokeWidth:1.5}),"Profile"]}),z.jsxs(Wn,{to:"/preferences",children:[z.jsx(lG,{size:18,strokeWidth:1.5}),"Preferences"]})]}),z.jsx(i5,{children:z.jsxs(o1,{className:"h-9 rounded-full bg-purple-500 px-3 text-md text-white hover:bg-purple-600 dark:hover:bg-purple-600",children:[z.jsx(kZ,{}),"New note"]})}),z.jsx(er0,{}),t.map(y=>o[y]?z.jsxs("div",{className:"flex items-center justify-between gap-1 pl-3 opacity-50",children:[z.jsx("span",{className:"font-mono text-xs",children:y}),z.jsx("span",{className:"text-green-800 inline-flex items-center rounded bg-green-100 px-1 py-0.5 text-xs font-medium",children:"ON"})]},y):z.jsx(z.Fragment,{}))]}),z.jsx("div",{className:"sticky bottom-0 flex items-center gap-2 bg-white pb-4 pl-4 dark:bg-black",children:z.jsx(Jn0,{})})]})})};sv.displayName="Sidebar";const ir0=({children:e,...t})=>{const{isOnboarded:o}=cv(),n=K3(),{data:r,isLoading:a}=qe(),i=p.useRef(null),[b,l]=p.useState(!1),u=YW(),{topicsQuery:O}=r5(),{data:f}=O,h=f&&f.topics.length>0,{isNewNoteModalOpen:q,setIsNewNoteModalOpen:g}=rv(),W=()=>{l(!b)},v=()=>{l(!1)};return a||!r?null:o?z.jsxs("div",{ref:i,className:`h-screen w-full ${o&&"overflow-y-auto"}`,"data-scrollable-container":!0,children:[z.jsx(W10,{containerRef:i}),z.jsx("div",{className:"relative mx-auto flex max-w-page flex-col",...t,children:o?z.jsxs(z.Fragment,{children:[z.jsxs("div",{className:"block grid-cols-[auto_320px] items-start lg:grid",children:[z.jsxs("div",{className:"z-0 min-w-0",children:[z.jsx(wn0,{showBorder:!(u==="reader"&&h)&&u!=="explore",onToggleMobileSidebar:W}),z.jsx("div",{className:"px-[min(4vw,32px)]",children:e})]}),z.jsx(sv,{isMobileSidebarOpen:b,onCloseMobileSidebar:v})]}),b&&z.jsx("div",{className:"fixed inset-0 z-40 lg:hidden",onClick:v})]}):z.jsx(av,{})}),z.jsx(i5,{open:q,onOpenChange:g})]}):z.jsx(vn,{to:`${n}/welcome`,replace:!0})},Qc=({children:e})=>z.jsx("div",{className:"flex max-h-12 max-w-12 grow-0 items-center justify-center rounded-full bg-gray-100 p-3 text-gray-700 dark:bg-gray-925/70 [&_svg]:size-8 [&_svg]:stroke-1",children:e}),Zc=({children:e,className:t})=>z.jsx("div",{className:`mx-auto mt-[24vh] flex max-w-[500px] flex-col items-center gap-5 text-center text-gray-700 ${t||""}`,children:e}),iv=({statusCode:e,errorCode:t})=>{const o=O7(),n=rW(),r=a=>{a.preventDefault(),n("/analytics/",{crossApp:!0})};return o?z.jsx(ir0,{children:z.jsxs(Zc,{children:[z.jsx(Qc,{children:z.jsx(pG,{})}),z.jsx(v2,{className:"-mb-4",children:"Oops, page not found!"}),z.jsx("div",{children:"We couldn't find the page you were looking for. It may have been moved, deleted, or never existed in the first place."})]})}):e===429?z.jsxs(Zc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Qc,{children:z.jsx(qG,{})}),z.jsx(v2,{className:"-mb-4",children:"Rate limit exceeded"}),z.jsx("div",{children:"You've made too many requests. Please try again in a moment."}),z.jsx(o1,{asChild:!0,children:z.jsx("a",{href:"https://ghost.org/help/social-web/",rel:"noopener noreferrer",target:"_blank",children:"Learn more →"})})]}):e===403?t==="ROLE_MISSING"||t==="SITE_MISSING"?z.jsxs(Zc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Qc,{children:z.jsx(M9,{})}),z.jsx(v2,{className:"-mb-4",children:"Site not configured correctly"}),z.jsx("div",{children:"This feature can't be used because the site isn't set up correctly. If you manage this site, check your settings or server logs, or contact support."}),z.jsx(o1,{asChild:!0,children:z.jsx("a",{href:"https://ghost.org/help/social-web/",rel:"noopener noreferrer",target:"_blank",children:"Learn more →"})})]}):z.jsxs(Zc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Qc,{children:z.jsx(rZ,{})}),z.jsx(v2,{className:"-mb-4",children:"Account suspended"}),z.jsx("div",{children:"Your account has been suspended due to policy violations."}),z.jsx(o1,{asChild:!0,children:z.jsx("a",{href:"https://ghost.org/help/social-web/",rel:"noopener noreferrer",target:"_blank",children:"Learn more →"})})]}):e===410&&t==="INVALID_VERSION"?z.jsxs(Zc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Qc,{children:z.jsx(vZ,{})}),z.jsx(v2,{className:"-mb-4",children:"New version available"}),z.jsx("div",{children:"We've made some updates! Refresh your page to see what's new"}),z.jsx(o1,{asChild:!0,children:z.jsx("button",{type:"button",onClick:()=>window.location.reload(),children:"Refresh your page"})})]}):z.jsx("div",{className:"admin-x-container-error",children:z.jsxs("div",{className:"admin-x-error max-w-xl",children:[z.jsx("h1",{children:"Loading interrupted"}),z.jsx("p",{children:"They say life is a series of trials and tribulations. This moment right here? It's a tribulation. Our app was supposed to load, and yet here we are. Loadless. Click back to the dashboard to try again."}),z.jsx("a",{className:"cursor-pointer text-green",onClick:r,children:"← Back to the homepage"})]})})},pr0=Object.freeze(Object.defineProperty({__proto__:null,default:iv},Symbol.toStringTag,{value:"Module"})),Mr0="activitypub",pv=[{path:Mr0,element:z.jsx(kn,{}),errorElement:z.jsx(iv,{}),handle:"activitypub-basepath",children:[{index:!0,element:z.jsx(vn,{to:"reader"})},{path:"inbox",element:z.jsx(vn,{to:"../reader",replace:!0})},{path:"feed",element:z.jsx(vn,{to:"../notes",replace:!0})},{path:"reader",lazy:h1(()=>z1(()=>import("./index-C9PDrFEW.js"),__vite__mapDeps([0,1,2,3,4,5,6]))),pageTitle:"Reader"},{path:"reader/:postId",lazy:h1(()=>z1(()=>import("./index-C9PDrFEW.js"),__vite__mapDeps([0,1,2,3,4,5,6]))),pageTitle:"Reader"},{path:"notes",lazy:h1(()=>z1(()=>import("./feed-DU5QhfRX.js"),__vite__mapDeps([7,8]))),pageTitle:"Notes"},{path:"notes/:postId",lazy:h1(()=>z1(()=>import("./note-Bqr3ECo6.js"),__vite__mapDeps([9,2,3,8]))),pageTitle:"Note"},{path:"notifications",lazy:h1(()=>z1(()=>import("./index-CEEPij-w.js"),__vite__mapDeps([10,11,12,13]))),pageTitle:"Notifications"},{path:"explore",lazy:h1(()=>z1(()=>import("./index-CdIdIOil.js"),__vite__mapDeps([14,4,15]))),pageTitle:"Explore"},{path:"explore/:topic",lazy:h1(()=>z1(()=>import("./index-CdIdIOil.js"),__vite__mapDeps([14,4,15]))),pageTitle:"Explore"},{path:"profile",lazy:h1(()=>z1(()=>import("./index-w7Tz4ytz.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]))),pageTitle:"Profile"},{path:"profile/likes",lazy:h1(()=>z1(()=>import("./index-w7Tz4ytz.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]))),pageTitle:"Profile"},{path:"profile/following",lazy:h1(()=>z1(()=>import("./index-w7Tz4ytz.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]))),pageTitle:"Profile"},{path:"profile/followers",lazy:h1(()=>z1(()=>import("./index-w7Tz4ytz.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]))),pageTitle:"Profile"},{path:"profile/:handle/:tab?",lazy:h1(()=>z1(()=>import("./index-w7Tz4ytz.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]))),pageTitle:"Profile"},{path:"preferences",lazy:h1(()=>z1(()=>import("./index-BuFp5nYK.js"),__vite__mapDeps([29,30,26,25,28,18,11]))),pageTitle:"Preferences"},{path:"preferences/moderation",lazy:h1(()=>z1(()=>import("./moderation-DqX2eQNM.js"),__vite__mapDeps([31,19,20,21,22,23,11,24,25,8,6,1,17,26,12,27,13,15,3]))),pageTitle:"Moderation",showBackButton:!0},{path:"preferences/bluesky-sharing",lazy:h1(()=>z1(()=>import("./bluesky-sharing-DYSv4ewp.js"),__vite__mapDeps([32,18,11,25]))),showBackButton:!0},{path:"welcome",lazy:h1(()=>z1(()=>Promise.resolve().then(()=>Yn0),void 0)),pageTitle:"Welcome",children:[{path:"",element:z.jsx(vn,{to:"1",replace:!0})},{path:"1",lazy:h1(()=>z1(()=>import("./step-1-Gnp7iGGY.js"),__vite__mapDeps([33,25])))},{path:"2",lazy:h1(()=>z1(()=>import("./step-2-DFbY2-K1.js"),__vite__mapDeps([34,35,13,27])))},{path:"3",lazy:h1(()=>z1(()=>import("./step-3-CoA_-aRF.js"),__vite__mapDeps([36,35,13,27,22,6,8])))},{path:"*",element:z.jsx(vn,{to:"1",replace:!0})}]},{path:"*",lazy:h1(()=>z1(()=>Promise.resolve().then(()=>pr0),void 0))}]}];function br0(){return z.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[z.jsx("path",{d:"M3.6349 20.3723C3.80192 20.5393 4.00019 20.6718 4.21841 20.7622C4.43663 20.8525 4.67052 20.8991 4.90672 20.8991C5.14291 20.8991 5.3768 20.8525 5.59502 20.7622C5.81324 20.6718 6.01152 20.5393 6.17853 20.3723C6.34555 20.2052 6.47804 20.007 6.56843 19.7888C6.65882 19.5705 6.70534 19.3366 6.70534 19.1004C6.70534 18.8643 6.65882 18.6304 6.56843 18.4121C6.47804 18.1939 6.34555 17.9956 6.17853 17.8286C5.84123 17.4913 5.38374 17.3018 4.90672 17.3018C4.42969 17.3018 3.9722 17.4913 3.6349 17.8286C3.29759 18.1659 3.10809 18.6234 3.10809 19.1004C3.10809 19.5775 3.29759 20.035 3.6349 20.3723ZM17.7153 6.17951C17.8823 6.34653 18.0806 6.47901 18.2988 6.5694C18.517 6.65979 18.7509 6.70632 18.9871 6.70632C19.2233 6.70632 19.4572 6.65979 19.6754 6.5694C19.8936 6.47901 20.0919 6.34653 20.2589 6.17951C20.4259 6.01249 20.5584 5.81421 20.6488 5.596C20.7392 5.37778 20.7857 5.14389 20.7857 4.90769C20.7857 4.67149 20.7392 4.43761 20.6488 4.21939C20.5584 4.00117 20.4259 3.80289 20.2589 3.63587C19.9216 3.29857 19.4641 3.10907 18.9871 3.10907C18.5101 3.10907 18.0526 3.29857 17.7153 3.63587C17.378 3.97318 17.1885 4.43067 17.1885 4.90769C17.1885 5.38472 17.378 5.8422 17.7153 6.17951ZM7.50655 12.0023C7.50655 13.1946 7.98019 14.3381 8.82329 15.1812C9.66639 16.0243 10.8099 16.4979 12.0022 16.4979C13.1945 16.4979 14.338 16.0243 15.1811 15.1812C16.0242 14.3381 16.4978 13.1946 16.4978 12.0023C16.4978 10.81 16.0242 9.66647 15.1811 8.82337C14.338 7.98027 13.1945 7.50663 12.0022 7.50663C10.8099 7.50663 9.66639 7.98027 8.82329 8.82337C7.98019 9.66647 7.50655 10.81 7.50655 12.0023Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),z.jsx("path",{d:"M8.79319 21.5246C10.5669 22.1224 12.4724 22.2127 14.2947 21.7854C16.1171 21.3581 17.7838 20.4302 19.1069 19.1062C20.4302 17.7827 21.3577 16.116 21.7848 14.2937C22.2119 12.4715 22.1217 10.5662 21.5243 8.79251M2.47582 15.2081C1.87829 13.4342 1.78805 11.5287 2.21527 9.70622C2.64249 7.88378 3.57019 6.21687 4.89383 4.89332C6.21747 3.56977 7.88445 2.64219 9.70692 2.21511C11.5294 1.78802 13.4349 1.87839 15.2088 2.47605",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Lp({path:e,activeOnSubpath:t=!1}){const o=t&&e?`${e}/*`:e;return II(o||"")!==null}function U0({children:e,...t}){return z.jsx(Vd,{...t,children:e})}function lr0({to:e,target:t,rel:o,activeOnSubpath:n=!1,isActive:r,children:a,...i}){const b=`#/${e?.replace(/^\/?#\//,"")}`,l=Lp({path:e,activeOnSubpath:n}),u=r!==void 0?r:l,{isMobile:O,setOpenMobile:f}=Gn(),h=()=>{O&&f(!1)};return z.jsx(B3,{asChild:!0,isActive:u,...i,children:z.jsx("a",{href:t==="_blank"?e:b,rel:t==="_blank"?o??"noopener noreferrer":o,target:t,"aria-current":u?"page":void 0,onClick:h,children:a})})}function zr0({children:e,...t}){return z.jsx("span",{...t,children:e})}function ur0({onClick:e,children:t,...o}){const{isMobile:n,setOpenMobile:r}=Gn(),a=()=>{n&&r(!1),e?.()};return z.jsx(B3,{onClick:a,...o,children:t})}U0.Link=lr0;U0.Label=zr0;U0.Button=ur0;function dr0({...e}){const{data:t}=qe(),{data:o}=G3(),n=Tt(o?.settings,"social_web_enabled")??!1,a=T3().data?.site.url,{data:i=0}=nv(t?.slug||"",n),b=Lp({path:"network",activeOnSubpath:!0}),l=Lp({path:"activitypub",activeOnSubpath:!0}),u=i>0&&!b&&!l;return!t||!Q10(t)?null:z.jsx(oc,{...e,children:z.jsx(Da,{children:z.jsxs(nc,{children:[z.jsx(U0,{children:z.jsxs(U0.Link,{to:"analytics",activeOnSubpath:!0,children:[z.jsx(z9,{}),z.jsx(U0.Label,{children:"Analytics"})]})}),n&&z.jsxs(U0,{children:[z.jsxs(U0.Link,{to:"network",isActive:b||l,children:[z.jsx(br0,{}),z.jsx(U0.Label,{children:"Network"})]}),u&&z.jsx($d,{children:i})]}),z.jsxs(U0,{className:"relative group/viewsite",children:[z.jsxs(U0.Link,{to:"site",children:[z.jsx(eZ,{}),z.jsx(U0.Label,{children:"View site"})]}),z.jsx("a",{href:a,target:"_blank","aria-label":"View site in new tab",rel:"noopener noreferrer",className:"absolute opacity-0 group-hover/viewsite:opacity-100 right-0 top-0 size-8 hover:bg-sidebar-accent flex items-center justify-center rounded-full text-gray-700 hover:text-sidebar-accent-foreground transition-all",children:z.jsx(zd,{size:16})})]})]})})})}function Or0({isExpanded:e,children:t,id:o}){return z.jsx("div",{id:o,className:`grid transition-all duration-200 ease-out ${e?"grid-rows-[1fr] mb-5":"grid-rows-[0fr] mb-0"}`,children:z.jsx("div",{className:"overflow-hidden",children:t})})}const fr0="MembersResponseType",Ar0=Fn({dataType:fr0,path:"/members/"});function hr0(){const{data:e}=Ar0({searchParams:{limit:"1"}});return e?.meta?.pagination.total}const qr0=()=>Q3({select:e=>e.navigation}),mr0=()=>{const{mutateAsync:e}=Z3();return Y1({mutationFn:async t=>{await e({navigation:t})}})},gr0=e=>{const{data:t}=qr0(),{mutateAsync:o}=mr0();return[t?.expanded[e]??!0,async a=>o({expanded:{[e]:a}})]},Wr0=vp({name:s2(),route:s2(),color:s2(),icon:s2().optional(),filter:Io0(s2(),s2().nullable())}),vr0=Yd(Wr0);function Rr0(e){return{midgrey:"#7C8B9A",blue:"#14b8ff",green:"#30cf43",red:"#f50b23",teal:"#4dcddc",purple:"#8e42ff",yellow:"#ffb41f",orange:"#fe8b05",pink:"#fb2d8d"}[e]||"#7C8B9A"}function yr0({route:e="posts"}){const{data:t}=G3(),o=MW(),n=p.useMemo(()=>{const r=Tt(t?.settings,"shared_views")??"[]";try{const a=JSON.parse(r),i=vr0.safeParse(a);return i.success?i.data.filter(b=>b.route===e):(console.error("Failed to validate shared_views setting:",i.error),[])}catch(a){return console.error("Failed to parse shared_views setting:",a),[]}},[t,e]);return n.length===0?null:z.jsx(z.Fragment,{children:n.map(r=>{const a=o.getRouteUrl(e,r.filter),i=o.isRouteActive(e,r.filter);return z.jsx(U0,{children:z.jsxs(U0.Link,{className:"pl-9",to:a,isActive:i,children:[z.jsx(U0.Label,{className:"grow",children:r.name}),z.jsx("span",{className:"size-2 rounded-full shrink-0 mx-0.5",style:{backgroundColor:Rr0(r.color)},"data-color":r.color,"aria-hidden":"true"})]})},a)})})}const p5=e=>{const{data:t}=Ia();return t?.config.labs?.[e]??!1};function wr0({...e}){const{data:t}=qe(),[o,n]=gr0("posts"),r=hr0(),a=MW(),i=p5("commentModeration"),b=t&&$10(t),l=t&&V10(t);return z.jsx(oc,{...e,children:z.jsx(Da,{children:z.jsxs(nc,{children:[z.jsxs(U0,{children:[z.jsx(o1,{"aria-controls":"posts-submenu","aria-expanded":o,"aria-label":"Toggle post views",variant:"ghost",size:"icon",className:"!h-[34px] absolute sidebar:opacity-0 group-hover/menu-item:opacity-100 focus-visible:opacity-100 transition-all left-3 top-0 p-0 h-9 w-auto text-sidebar-accent-foreground hover:text-gray-black hover:bg-transparent",onClick:()=>void n(!o),children:z.jsx(ld,{size:16,className:`transition-all ${o&&"rotate-[90deg]"}`})}),z.jsxs(U0.Link,{to:a.getRouteUrl("posts"),isActive:a.isRouteActive("posts"),children:[z.jsx(s9,{className:"opacity-0 sidebar:opacity-100 sidebar:group-hover/menu-item:opacity-0 pointer-events-none transition-all"}),z.jsx(U0.Label,{children:"Posts"})]}),z.jsx("a",{href:"#/editor/post","aria-label":"Create new post",className:"flex items-center justify-center absolute hover:bg-sidebar-accent transition-all rounded-full right-0 top-0 p-0 size-8 text-gray-700 hover:text-sidebar-accent-foreground",children:z.jsx(i9,{size:20,className:"!stroke-[1.5px] mt-px"})})]}),z.jsxs(Or0,{isExpanded:o,id:"posts-submenu",children:[z.jsx(U0,{children:z.jsx(U0.Link,{className:"pl-9",to:"posts?type=draft",isActive:a.isRouteActive("posts",{type:"draft"}),children:z.jsx(U0.Label,{children:"Drafts"})})}),z.jsx(U0,{children:z.jsx(U0.Link,{className:"pl-9",to:"posts?type=scheduled",isActive:a.isRouteActive("posts",{type:"scheduled"}),children:z.jsx(U0.Label,{children:"Scheduled"})})}),z.jsx(U0,{children:z.jsx(U0.Link,{className:"pl-9",to:"posts?type=published",isActive:a.isRouteActive("posts",{type:"published"}),children:z.jsx(U0.Label,{children:"Published"})})}),z.jsx(yr0,{})]}),z.jsx(U0,{children:z.jsxs(U0.Link,{to:a.getRouteUrl("pages"),isActive:a.isRouteActive("pages"),children:[z.jsx(_Z,{}),z.jsx(U0.Label,{children:"Pages"})]})}),b&&z.jsx(U0,{children:z.jsxs(U0.Link,{to:"tags",isActive:a.isRouteActive(["tags","tag","tag.new"]),children:[z.jsx(OG,{}),z.jsx(U0.Label,{children:"Tags"})]})}),l&&z.jsxs(U0,{children:[z.jsxs(U0.Link,{to:a.getRouteUrl("members"),isActive:a.isRouteActive(["members","member","member.new"]),children:[z.jsx(u9,{}),z.jsx(U0.Label,{children:"Members"})]}),r!=null&&z.jsx($d,{children:r})]}),l&&i&&z.jsx(U0,{children:z.jsxs(U0.Link,{to:"comments",activeOnSubpath:!0,children:[z.jsx(YZ,{}),z.jsx(U0.Label,{children:"Comments"})]})})]})})})}const Wl="https://do.featurebase.app/js/sdk.js";function Lr0(){return new Promise((e,t)=>{if(document.querySelector(`script[src="${Wl}"]`)){e();return}const n=document.createElement("script");n.src=Wl,n.onload=()=>e(),n.onerror=r=>{n.remove();const a=new Error(`[Featurebase] Failed to load SDK from ${Wl}`,{cause:r});console.error(a),t(a)},document.head.appendChild(n),typeof window.Featurebase!="function"&&(window.Featurebase=function(...r){(window.Featurebase.q=window.Featurebase.q||[]).push(r)})})}function xr0(){const{data:e}=qe(),{data:t}=Ia(),{data:o}=Q3(),n=p5("featurebaseFeedback"),r=p.useRef(!1),a=p.useRef(null),i=t?.config.featurebase,b=i?.organization,l=!!(n&&i?.enabled),u=o?.nightShift?"dark":"light",{data:O}=x10({enabled:l}),f=O?.featurebase?.token;return p.useEffect(()=>{if(!l||!b||!e||!f)return;const q=a.current,g=q&&q.theme===u&&q.token===f;r.current||g||(r.current=!0,Lr0().then(()=>{window.Featurebase?.("initialize_feedback_widget",{organization:b,theme:u,defaultBoard:"Feature Request",featurebaseJwt:f},W=>{r.current=!1,W?(console.error("[Featurebase] Failed to initialize widget:",W),a.current=null):a.current={theme:u,token:f}})}).catch(()=>{r.current=!1,a.current=null}))},[l,b,e,f,u]),{openFeedbackWidget:p.useCallback(q=>{window.postMessage({target:"FeaturebaseWidget",data:{action:"openFeedbackWidget",...q?.board&&{setBoard:q.board}}},"*")},[])}}function kr0({...e}){const{data:t}=qe(),{data:o}=Ia(),n=p5("featurebaseFeedback"),{openFeedbackWidget:r}=xr0();if(!t)return null;const i=o?.config.hostSettings?.billing?.enabled&&Ha(t),b=n&&!S3(t)&&o?.config.featurebase?.enabled;return!i&&!b?null:z.jsx(oc,{...e,children:z.jsx(Da,{children:z.jsxs(nc,{children:[i&&z.jsx(U0,{children:z.jsxs(U0.Link,{to:"pro",children:[z.jsx(yZ,{}),z.jsx(U0.Label,{children:"Ghost(Pro)"})]})}),b&&z.jsx(U0,{children:z.jsxs(U0.Button,{onClick:r,children:[z.jsx(ud,{}),z.jsx(U0.Label,{children:"Feedback"})]})})]})})})}function Cr0({...e}){const{data:t}=qe(),o=t&&U10(t);return z.jsx(oc,{...e,children:z.jsx(Da,{children:z.jsxs(nc,{children:[o&&z.jsx(U0,{children:z.jsxs(U0.Link,{to:"settings",children:[z.jsx(M9,{}),z.jsx(U0.Label,{children:"Settings"})]})}),z.jsx(U0,{children:z.jsxs(U0.Link,{to:"https://ghost.org/help?utm_source=admin&utm_campaign=help",target:"_blank",rel:"noopener noreferrer",children:[z.jsx(qZ,{}),z.jsx(U0.Label,{children:"Help"})]})})]})})})}const Nr0="/ghost/assets/ghost-pro-logo-B1sXD_MX.png";function Br0({trialDaysRemaining:e}){return z.jsxs(gd,{variant:"gradient",size:"lg",className:"mx-2 my-5 flex flex-col items-stretch",children:[z.jsx("div",{children:z.jsx("img",{src:Nr0,alt:"Ghost Pro",className:"max-h-[33px]"})}),z.jsx("div",{className:"text-base mt-3 font-semibold",children:"Unlock every feature"}),z.jsxs("div",{className:"mt-2 text-gray-700 text-sm mb-4",children:["Choose a plan to access the full power of Ghost right away, you have ",z.jsxs("span",{className:"font-semibold text-black",children:[e," days"]})," free trial remaining."]}),z.jsx(o1,{asChild:!0,children:z.jsx("a",{href:"#/pro/billing/plans",children:"Upgrade now"})})]})}function _r0(){const{showUpgradeBanner:e,trialDaysRemaining:t}=UW();return z.jsxs(tW,{className:"px-3 pt-4 justify-between",children:[z.jsxs("div",{className:"flex flex-col gap-2 sidebar:gap-4",children:[z.jsx(dr0,{}),z.jsx(wr0,{}),z.jsx(kr0,{})]}),z.jsxs("div",{className:"flex flex-col gap-2 sidebar:gap-4",children:[e?z.jsx(Br0,{trialDaysRemaining:t}):z.jsx(qn0,{}),z.jsx(Cr0,{className:"pb-0"})]})]})}function Er0({...e}){return z.jsxs(Gg,{...e,children:[z.jsx(J10,{className:"px-5 pt-6 pb-0"}),z.jsx(_r0,{}),z.jsx(hn0,{className:"p-3 gap-0"})]})}const Li=1.5;function vl({to:e,activeOnSubpath:t=!1,children:o,...n}){const r=Lp({path:e,activeOnSubpath:t});return z.jsx(o1,{asChild:!0,className:`rounded-full w-full max-w-16 min-w-9 hover:bg-gray-200 ${r?"bg-gray-200":"bg-transparent"}`,...n,variant:"ghost",size:"icon","data-active":r,children:z.jsx("a",{href:e,children:o})})}function Sr0(){const{isMobile:e}=Gn();return e?z.jsx("div",{className:"fixed sidebar:hidden bottom-0 left-0 right-0 h-[var(--mobile-navbar-height)] bg-sidebar/80 backdrop-blur-md border-t border-sidebar-border z-50 safe-area-inset-bottom",children:z.jsxs("div",{className:"grid grid-cols-4 items-center w-full justify-items-center max-w-[300px] h-full mx-auto px-5",children:[z.jsxs(vl,{activeOnSubpath:!0,to:"analytics",children:[z.jsx(z9,{strokeWidth:Li}),z.jsx("span",{className:"sr-only",children:"Analytics"})]}),z.jsxs(vl,{activeOnSubpath:!0,to:"posts",children:[z.jsx(s9,{strokeWidth:Li}),z.jsx("span",{className:"sr-only",children:"Posts"})]}),z.jsxs(vl,{activeOnSubpath:!0,to:"members",children:[z.jsx(u9,{strokeWidth:Li}),z.jsx("span",{className:"sr-only",children:"Members"})]}),z.jsxs(Kg,{className:"rounded-full px-8 h-9 hover:bg-transparent",children:[z.jsx(a9,{strokeWidth:Li}),z.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})]})}):z.jsx(z.Fragment,{})}function Tr0({children:e}){const{data:t}=qe(),o=P10();return t&&S3(t)?z.jsxs("div",{className:"relative h-full bg-background",children:[z.jsx("main",{className:"h-full overflow-auto",children:e}),z.jsx("div",{className:"fixed bottom-3.5 left-3.5 lg:bottom-8 lg:left-8 z-20",children:z.jsx(An0,{})})]}):z.jsxs(Zg,{open:!!t&&o,children:[z.jsx(Er0,{}),z.jsxs(Yg,{className:"bg-background overflow-y-scroll max-h-[calc(100%-var(--mobile-navbar-height))] sidebar:max-h-full",children:[z.jsx("main",{className:"flex-1",children:e}),z.jsx(Sr0,{})]})]})}function Pr0(){const{data:e}=qe();return S10(),E10(),z.jsx(k10,{children:e?z.jsxs(Tr0,{children:[z.jsx(kn,{}),z.jsx($f,{})]}):z.jsxs(z.Fragment,{children:[z.jsx(Wz,{}),z.jsx($f,{})]})})}const Mv=p.createContext(void 0),Oa0=()=>{const e=p.useContext(Mv);if(e===void 0)throw new Error("useAppContext must be used within an AppProvider");return e},Xr0=({children:e,value:t})=>{const o=p.useContext(nu),n=t.externalNavigate??o?.externalNavigate;if(!n)throw new Error("External navigate function is required");const r={externalNavigate:n,fromAnalytics:!1,...o,...t};return z.jsx(Mv.Provider,{value:r,children:e})},jr0=[{path:"",errorElement:z.jsx(qp,{onBackToDashboard:()=>{}}),children:[{path:"posts/analytics/:postId",lazy:async()=>{const[{default:e},{default:t}]=await Promise.all([z1(()=>import("./post-analytics-context-DctS9fHu.js").then(o=>o.p),__vite__mapDeps([37,38])),z1(()=>import("./post-analytics-DCAOPWEx.js"),__vite__mapDeps([39,40,41,38,37]))]);return{element:z.jsx(e,{children:z.jsx(t,{})})}},children:[{path:"",lazy:h1(()=>z1(()=>import("./overview-CGTvSQfN.js"),__vite__mapDeps([42,43,44,23,45,46,47,48,49,41,37,38,50,3,15,51,52,53,21,22,11,24,25,8,6,1,17,26,12,27,13,54,19,20,5,55,56,57,58])))},{path:"web",lazy:h1(()=>z1(()=>import("./web-CtBMATfv.js"),__vite__mapDeps([59,37,38,60,24,51,52,23,53,44,45,21,22,11,25,8,6,1,17,26,12,27,13,15,3,54,47,48,19,20,61,49,41,50,62,5])))},{path:"growth",lazy:h1(()=>z1(()=>import("./growth-_giTyVF8.js").then(e=>e.g),__vite__mapDeps([55,5,23,52,53,44,56,43,49,41,37,38,50,3,15,57,58])))},{path:"newsletter",lazy:h1(()=>z1(()=>import("./newsletter-BaZVL4Rg.js"),__vite__mapDeps([63,44,23,64,21,22,11,24,25,8,6,1,17,26,12,27,13,15,3,19,20,43,49,41,37,38,50,45,46,47,48,58])))}]},{path:"tags",children:[{index:!0,lazy:h1(()=>z1(()=>import("./tags-DUcQDnmf.js"),__vite__mapDeps([65,30,66,40,56,17,5])))},{path:":tagSlug",element:null}]},{path:"comments",lazy:h1(()=>z1(()=>import("./comments-DiZAz2yU.js"),__vite__mapDeps([67,62,24,38,66,40,13,5])))},{path:"*",element:z.jsx(qp,{onBackToDashboard:()=>{}})}]}],Dr0={today:{name:"Today",value:1},last7Days:{name:"Last 7 days",value:7},last30Days:{name:"Last 30 days",value:31},last3Months:{name:"Last 3 months",value:91},yearToDate:{name:"Year to date",value:-1},last12Months:{name:"Last 12 months",value:372},allTime:{name:"All time",value:1e3}},Ir0=Object.values(Dr0),Fr0=2,fa0={US:"United States",TWN:"Taiwan",TW:"Taiwan","mobile-ios":"iOS","mobile-android":"Android",macos:"macOS","google.com":"Google","ghost.org":"Ghost","bing.com":"Bing","bsky.app":"Bluesky","yahoo.com":"Yahoo","duckduckgo.com":"DuckDuckGo",Others:"Unknown",Other:"Unknown",NULL:"Unknown","ᴺᵁᴸᴸ":"Unknown"},Aa0=["NULL","ᴺᵁᴸᴸ","","Others","Other"],ha0="https://static.ghost.org/v5.0.0/images/globe-icon.svg",qa0={PUBLIC:1,FREE:2,PAID:4},bv=p.createContext(void 0),ma0=()=>{const e=p.useContext(bv);if(e===void 0)throw new Error("useGlobalData must be used within a GlobalDataProvider");return e},Hr0=({children:e})=>{const t=G3(),o=T3(),n=Ia(),r=n.data?.config,a=!!r?.stats,i=BD({enabled:a}),[b,l]=p.useState(Ir0[Fr0].value),[u,O]=p.useState(7),[f,h]=p.useState(null),q=[n,t,o],g=q.map(C=>C.error).find(Boolean),W=a?i.error:null,v=g||W,y=q.some(C=>C.isLoading),x=a?i.isLoading:!1,k=y||x;if(v)throw v;const L={url:o.data?.site.url,icon:o.data?.site.icon,title:o.data?.site.title};return z.jsx(bv.Provider,{value:{data:r,site:L,statsConfig:r?.stats,tinybirdToken:i.token,isLoading:k,range:b,setRange:l,audience:u,setAudience:O,settings:t.data?.settings||[],selectedNewsletterId:f,setSelectedNewsletterId:h},children:e})},Ur0=[{path:"analytics",children:[{index:!0,lazy:h1(()=>z1(()=>import("./index-DXuLaG0T.js"),__vite__mapDeps([68,69,60,24,44,23,15,21,22,11,25,8,6,1,17,26,12,27,13,3,5,41,50,54,47,48,70,71,58,57,38])))},{path:"web",lazy:h1(()=>z1(()=>import("./index-k2aVq6ms.js"),__vite__mapDeps([72,70,69,60,24,44,23,15,21,22,11,25,8,6,1,17,26,12,27,13,3,61,45,5,64,73,53,62,58,19,20,54,47,48])))},{path:"growth",lazy:h1(()=>z1(()=>import("./index-DI4OotZO.js"),__vite__mapDeps([74,69,60,24,44,23,15,21,22,11,25,8,6,1,17,26,12,27,13,3,5,47,48,54,19,20,70,75,56,73,57,53,58,76,71])))},{path:"newsletters",lazy:h1(()=>z1(()=>import("./index-B3CWs1Pb.js"),__vite__mapDeps([77,69,60,24,44,23,15,21,22,11,25,8,6,1,17,26,12,27,13,3,47,48,5,54,19,20,75,56,78,58])))}]}],Vr0=[{element:z.jsx(D10,{}),children:[{path:"/tags/:tagSlug",Component:Wz,handle:{allowInForceUpgrade:!0}},{element:z.jsx(Xr0,{value:{fromAnalytics:!0},children:z.jsx(kn,{})}),children:jr0[0].children.filter(e=>e.path!=="*")},{element:z.jsx(Hr0,{children:z.jsx(kn,{})}),children:Ur0},{path:"network",loader:()=>sI("/activitypub")},{path:"",element:z.jsx(mn0,{children:z.jsx(kn,{})}),children:pv},{path:"settings/*",lazy:h1(()=>z1(()=>import("./settings-B_8Oslb0.js").then(e=>e.bs),__vite__mapDeps([79,20,78,38,76]))),handle:{allowInForceUpgrade:!0}},{path:"*",Component:Wz,handle:{allowInForceUpgrade:!0}}]}],$r0=["http:","https:","mailto:","tel:"];function Qr0(e){if(e.match(/^[a-z]+:/i))try{const t=new URL(e);return $r0.includes(t.protocol)?(window.location.href=e,!0):!1}catch{const t=e.startsWith("/")?e:`/${e}`;return window.location.hash=t,!0}else{const t=e.startsWith("/")?e:`/${e}`;return window.location.hash=t,!0}}function Zr0({children:e}){const{data:t}=G3(),o=p.useMemo(()=>{if(!t?.settings)return;const n=t.settings;return{paidMembersEnabled:Tt(n,"paid_members_enabled")??!1,newslettersEnabled:Tt(n,"editor_default_email_recipients")!=="disabled",analytics:{emailTrackOpens:Tt(n,"email_track_opens")??!1,emailTrackClicks:Tt(n,"email_track_clicks")??!1,membersTrackSources:Tt(n,"members_track_sources")??!1,outboundLinkTagging:Tt(n,"outbound_link_tagging")??!1,webAnalytics:Tt(n,"web_analytics_enabled")??!1}}},[t]);return z.jsx(Cx,{appSettings:o,children:e})}const Gr0={ghostVersion:"",externalNavigate:e=>{Qr0(e.route)},unsplashConfig:{Authorization:"","Accept-Version":"","Content-Type":"","App-Pragma":"","X-Unsplash-Cache":!0},sentryDSN:null,onUpdate:(e,t)=>{window.EmberBridge?.state.onUpdate(e,t)},onInvalidate:e=>{window.EmberBridge?.state.onInvalidate(e)},onDelete:(e,t)=>{window.EmberBridge?.state.onDelete(e,t)}};ny.createRoot(document.getElementById("root")).render(z.jsx(p.StrictMode,{children:z.jsx(kx,{...Gr0,children:z.jsx(v10,{prefix:"/",routes:Vr0,children:z.jsx(Zr0,{children:z.jsx(RK,{className:"shade-admin",darkMode:!1,fetchKoenigLexical:null,children:z.jsx(Pr0,{})})})})})}));export{c9 as $,Xo as A,o1 as B,ld as C,m3 as D,Zc as E,Gn0 as F,Qc0 as G,v2 as H,Zc0 as I,Yc0 as J,Jc0 as K,ir0 as L,Gc0 as M,Kc0 as N,q10 as O,Eo as P,Q00 as Q,Z00 as R,w1 as S,rZ as T,wp as U,Re as V,Ma0 as W,Ad as X,ba0 as Y,la0 as Z,nW as _,Jp as a,Bn as a$,yK as a0,O9 as a1,f9 as a2,h9 as a3,q9 as a4,A9 as a5,g9 as a6,m9 as a7,u3 as a8,Q9 as a9,V0 as aA,Sp as aB,z1 as aC,ih as aD,Z1 as aE,Ia as aF,T3 as aG,G3 as aH,BD as aI,oZ as aJ,kc0 as aK,kn as aL,rW as aM,yc0 as aN,Vm as aO,m10 as aP,zp as aQ,Oa0 as aR,Oc0 as aS,Ac0 as aT,Qr as aU,_u as aV,Fm as aW,a9 as aX,Sd as aY,Rc0 as aZ,Um as a_,wd as aa,FZ as ab,Fn as ac,Hn as ad,wD as ae,fc0 as af,pc0 as ag,y0 as ah,lc0 as ai,bd as aj,yD as ak,xc0 as al,bW as am,Yt as an,z9 as ao,Hm as ap,Vh as aq,Ko as ar,_e as as,e2 as at,H0 as au,Qh as av,XX as aw,jX as ax,Q0 as ay,$t as az,Jt as b,gc0 as b$,oW as b0,dt as b1,qa0 as b2,ma0 as b3,Jr0 as b4,Od as b5,lJ as b6,Up as b7,lq as b8,Uh as b9,rc as bA,TZ as bB,aa0 as bC,aZ as bD,$c as bE,Ri as bF,hd as bG,qd as bH,md as bI,G00 as bJ,wc0 as bK,Vg as bL,J00 as bM,e10 as bN,t10 as bO,$00 as bP,bc0 as bQ,ic0 as bR,fd as bS,dc0 as bT,kf as bU,vn as bV,za0 as bW,M00 as bX,b00 as bY,l00 as bZ,Wg as b_,Y0 as ba,re as bb,Tx as bc,oj as bd,Cu as be,Kr as bf,he as bg,Vp as bh,Bu as bi,wa as bj,Fo as bk,ya as bl,Hp as bm,zq as bn,uq as bo,zZ as bp,en as bq,i5 as br,n5 as bs,dZ as bt,kZ as bu,ta0 as bv,Sn0 as bw,Ln0 as bx,iv as by,sa0 as bz,Qc as c,na0 as c$,u9 as c0,OG as c1,we as c2,WA as c3,Tp as c4,I9 as c5,H9 as c6,f3 as c7,A3 as c8,dd as c9,qc0 as cA,mc0 as cB,Mc0 as cC,DZ as cD,Cf as cE,yZ as cF,Ir0 as cG,wK as cH,dl as cI,CK as cJ,ra0 as cK,ea0 as cL,ca0 as cM,xp as cN,Aa0 as cO,fa0 as cP,s9 as cQ,uc0 as cR,ha0 as cS,Dz as cT,cr0 as cU,Ar0 as cV,gZ as cW,GZ as cX,KW as cY,Hn0 as cZ,oa0 as c_,dJ as ca,OJ as cb,i9 as cc,$m as cd,eg as ce,zc0 as cf,hc0 as cg,Dr0 as ch,NZ as ci,oc0 as cj,Pc0 as ck,Xc0 as cl,hW as cm,ia0 as cn,l9 as co,vG as cp,C3 as cq,eY as cr,vp as cs,mA as ct,gA as cu,ua0 as cv,da0 as cw,s2 as cx,Dn0 as cy,$Q as cz,yi as d,f1 as d$,Kr0 as d0,ZR as d1,Pp as d2,wN as d3,w6 as d4,Vq as d5,jc0 as d6,Hc0 as d7,el as d8,cc0 as d9,Nc0 as dA,_c0 as dB,U10 as dC,zW as dD,Ec0 as dE,E3 as dF,Wh as dG,tc0 as dH,JP as dI,x6 as dJ,k6 as dK,Kz as dL,Ru as dM,qh as dN,rj as dO,gq as dP,Wq as dQ,vq as dR,Kx as dS,pD as dT,rc0 as dU,MD as dV,Hq as dW,Zp as dX,ca as dY,qe as dZ,sc0 as d_,ac0 as da,Gz as db,Sc0 as dc,qD as dd,Yr as de,ha as df,Fc0 as dg,V2 as dh,C10 as di,N10 as dj,B10 as dk,Tt as dl,BP as dm,Tc0 as dn,G10 as dp,Vc0 as dq,Ic0 as dr,Dc0 as ds,K1 as dt,Q10 as du,Bc0 as dv,ez as dw,Ha as dx,Cc0 as dy,lW as dz,b0 as e,Aw as e0,Lc0 as e1,I10 as e2,Uc0 as e3,S3 as e4,ph as e5,ec0 as e6,fh as e7,eZ as e8,MZ as e9,iZ as ea,AZ as eb,qZ as ec,vZ as ed,_Z as ee,XZ as ef,UZ as eg,$Z as eh,ud as ei,YZ as ej,eG as ek,oG as el,cG as em,p9 as en,pG as eo,M9 as ep,lG as eq,b9 as er,qG as es,gG as et,YQ as eu,hp as f,Po as g,Lo as h,$c0 as i,z as j,cv as k,pa0 as l,o5 as m,a5 as n,Hi as o,r5 as p,V9 as q,p as r,Xz as s,Ta as t,VI as u,yd as v,Ld as w,zd as x,g0 as y,Ba as z};