fedipod 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +123 -0
- package/architecture.svg +89 -0
- package/bin/fedipod.mjs +2303 -0
- package/cli.md +243 -0
- package/groups.md +85 -0
- package/gui.md +99 -0
- package/lib/account.mjs +87 -0
- package/lib/admin.mjs +1606 -0
- package/lib/atproto.mjs +310 -0
- package/lib/bskyfeed.mjs +166 -0
- package/lib/bskygroup.mjs +162 -0
- package/lib/c2s.mjs +305 -0
- package/lib/certs.mjs +265 -0
- package/lib/deliver.mjs +249 -0
- package/lib/directory.mjs +90 -0
- package/lib/embed.mjs +214 -0
- package/lib/export-collections.mjs +161 -0
- package/lib/front-core.mjs +322 -0
- package/lib/gateway-core.mjs +115 -0
- package/lib/guard.mjs +213 -0
- package/lib/home.mjs +161 -0
- package/lib/httpsig.mjs +109 -0
- package/lib/import.mjs +357 -0
- package/lib/intake.mjs +1710 -0
- package/lib/keys.mjs +139 -0
- package/lib/lease.mjs +190 -0
- package/lib/localapi.mjs +87 -0
- package/lib/mastoapi.mjs +1588 -0
- package/lib/migrate.mjs +127 -0
- package/lib/oidc-auth.mjs +53 -0
- package/lib/podrdf.mjs +132 -0
- package/lib/ports.mjs +27 -0
- package/lib/publisher.mjs +1003 -0
- package/lib/remote.mjs +303 -0
- package/lib/safefetch.mjs +235 -0
- package/lib/setup.mjs +262 -0
- package/lib/social.mjs +505 -0
- package/lib/storage.mjs +170 -0
- package/lib/store.mjs +470 -0
- package/lib/streaming.mjs +154 -0
- package/lib/tagfeed.mjs +158 -0
- package/lib/ua.mjs +29 -0
- package/lib/update.mjs +91 -0
- package/lib/webpush.mjs +98 -0
- package/lib/wire.mjs +762 -0
- package/package.json +60 -0
- package/phanpy/dist/404.html +40 -0
- package/phanpy/dist/_headers +2 -0
- package/phanpy/dist/apple-touch-icon.png +0 -0
- package/phanpy/dist/assets/ICONS-DIPJeU0C.js +2 -0
- package/phanpy/dist/assets/ICONS-DIPJeU0C.js.map +1 -0
- package/phanpy/dist/assets/ScheduledAtField-D-Abfo4J.js +183 -0
- package/phanpy/dist/assets/ScheduledAtField-D-Abfo4J.js.map +1 -0
- package/phanpy/dist/assets/Temml-CCjoacWt.woff2 +0 -0
- package/phanpy/dist/assets/__vite-browser-external-C7iut881.js +2 -0
- package/phanpy/dist/assets/__vite-browser-external-C7iut881.js.map +1 -0
- package/phanpy/dist/assets/boosts-carousel-BiOaNdMT.jpg +0 -0
- package/phanpy/dist/assets/catch-up-O5q5C75Z.png +0 -0
- package/phanpy/dist/assets/chunk-aKtaBQYM.js +1 -0
- package/phanpy/dist/assets/compose-CFEx7wb4.js +2 -0
- package/phanpy/dist/assets/compose-CFEx7wb4.js.map +1 -0
- package/phanpy/dist/assets/compose-ZJN5xSb4.js +35 -0
- package/phanpy/dist/assets/compose-ZJN5xSb4.js.map +1 -0
- package/phanpy/dist/assets/debug.module-YFQgwnIr.js +52 -0
- package/phanpy/dist/assets/debug.module-YFQgwnIr.js.map +1 -0
- package/phanpy/dist/assets/dom-p1YcJ5Rw.js +2 -0
- package/phanpy/dist/assets/dom-p1YcJ5Rw.js.map +1 -0
- package/phanpy/dist/assets/home-mobile-dark@2x-Dc-J8-SM.png +0 -0
- package/phanpy/dist/assets/home-mobile-light@2x-Bd3fod8m.png +0 -0
- package/phanpy/dist/assets/home-tablet-dark@2x-BgcNI8le.png +0 -0
- package/phanpy/dist/assets/home-tablet-light@2x-BW2RV9T6.png +0 -0
- package/phanpy/dist/assets/icons/add-circle-line-WD0mwORD.js +1 -0
- package/phanpy/dist/assets/icons/alert-line-CpFUMf9s.js +1 -0
- package/phanpy/dist/assets/icons/android-2-line-Bzxnrd3S.js +1 -0
- package/phanpy/dist/assets/icons/announcement-line-5nwaJFJm.js +1 -0
- package/phanpy/dist/assets/icons/arrow-down-circle-line-a7Id9-Iv.js +1 -0
- package/phanpy/dist/assets/icons/arrow-down-line-B8uzXzq6.js +1 -0
- package/phanpy/dist/assets/icons/arrow-left-line-CGrGT9C-.js +1 -0
- package/phanpy/dist/assets/icons/arrow-right-line-CE-HERfX.js +1 -0
- package/phanpy/dist/assets/icons/arrow-to-up-line-CvdQjmcy.js +1 -0
- package/phanpy/dist/assets/icons/arrow-up-circle-line-DEparSNF.js +1 -0
- package/phanpy/dist/assets/icons/arrow-up-line-C7yBeugc.js +1 -0
- package/phanpy/dist/assets/icons/arrows-right-line-BtbXmJGP.js +1 -0
- package/phanpy/dist/assets/icons/at-line-CF66Bznk.js +1 -0
- package/phanpy/dist/assets/icons/attachment-line-BY8It-l9.js +1 -0
- package/phanpy/dist/assets/icons/blockquote-line-BS6pU_hm.js +1 -0
- package/phanpy/dist/assets/icons/board-line-C0UWXyA6.js +1 -0
- package/phanpy/dist/assets/icons/bookmark-line-1CtX5JLF.js +1 -0
- package/phanpy/dist/assets/icons/building-5-line-Dd59MzbO.js +1 -0
- package/phanpy/dist/assets/icons/bus-2-line-6_dvA0GG.js +1 -0
- package/phanpy/dist/assets/icons/calendar-day-line-Crpl_fmu.js +1 -0
- package/phanpy/dist/assets/icons/calendar-month-line-vommts2C.js +1 -0
- package/phanpy/dist/assets/icons/calendar-time-add-line-BU_DTlQk.js +1 -0
- package/phanpy/dist/assets/icons/camera-line-Cv69MEei.js +1 -0
- package/phanpy/dist/assets/icons/celebrate-line-B8DvIoi0.js +1 -0
- package/phanpy/dist/assets/icons/chart-bar-line-FK-QOmtF.js +1 -0
- package/phanpy/dist/assets/icons/chart-line-line-BGcJAFWw.js +1 -0
- package/phanpy/dist/assets/icons/chat-3-line-YFK2-hwz.js +1 -0
- package/phanpy/dist/assets/icons/check-circle-line-DsAxFr5-.js +1 -0
- package/phanpy/dist/assets/icons/clipboard-line-BBp364gJ.js +1 -0
- package/phanpy/dist/assets/icons/close-circle-line-CICdiuGz.js +1 -0
- package/phanpy/dist/assets/icons/close-line-DYrFWcjv.js +1 -0
- package/phanpy/dist/assets/icons/cloud-line-tiQAbah8.js +1 -0
- package/phanpy/dist/assets/icons/code-line-fAl8iiV3.js +1 -0
- package/phanpy/dist/assets/icons/comment-2-line-CR3g7WeB.js +1 -0
- package/phanpy/dist/assets/icons/copy-2-line-CLW69yF5.js +1 -0
- package/phanpy/dist/assets/icons/delete-2-line-B8xmbr4n.js +1 -0
- package/phanpy/dist/assets/icons/document-3-line-DBGNhAg2.js +1 -0
- package/phanpy/dist/assets/icons/document-line-C7mb9sb7.js +1 -0
- package/phanpy/dist/assets/icons/down-line-BGqSSThd.js +1 -0
- package/phanpy/dist/assets/icons/edit-4-line-DcgGaEhx.js +1 -0
- package/phanpy/dist/assets/icons/emoji-2-line-D8YgnM-y.js +1 -0
- package/phanpy/dist/assets/icons/exit-line-Dc07BS-x.js +1 -0
- package/phanpy/dist/assets/icons/external-link-line-BvpSkmjO.js +1 -0
- package/phanpy/dist/assets/icons/eye-2-line-CiWXx-f_.js +1 -0
- package/phanpy/dist/assets/icons/eye-close-line-BgTaSJ4P.js +1 -0
- package/phanpy/dist/assets/icons/filter-2-line-B_mR2usy.js +1 -0
- package/phanpy/dist/assets/icons/filter-line-C_nm-3cU.js +1 -0
- package/phanpy/dist/assets/icons/flag-1-line-C2HB05I0.js +1 -0
- package/phanpy/dist/assets/icons/forbid-circle-line-D3LTT9yd.js +1 -0
- package/phanpy/dist/assets/icons/formula-line-DLrt2d6j.js +1 -0
- package/phanpy/dist/assets/icons/grid-line-CgUmEikf.js +1 -0
- package/phanpy/dist/assets/icons/group-line-C5fnX0wU.js +1 -0
- package/phanpy/dist/assets/icons/hand-finger-2-line-BGgxbuL9.js +1 -0
- package/phanpy/dist/assets/icons/hashtag-line-CyTEEXBb.js +1 -0
- package/phanpy/dist/assets/icons/heart-crack-line-BZddbO2C.js +1 -0
- package/phanpy/dist/assets/icons/heart-line-CJ7K47J4.js +1 -0
- package/phanpy/dist/assets/icons/history-2-line-kWWvFzqv.js +1 -0
- package/phanpy/dist/assets/icons/history-line-bGQiwbTH.js +1 -0
- package/phanpy/dist/assets/icons/home-3-line-fRU1zeLG.js +1 -0
- package/phanpy/dist/assets/icons/information-line-iNk6-sOY.js +1 -0
- package/phanpy/dist/assets/icons/keyboard-line-DsCyuQNz.js +1 -0
- package/phanpy/dist/assets/icons/layout-4-line-CZkOX52Z.js +1 -0
- package/phanpy/dist/assets/icons/layout-5-line-B_znt5wO.js +1 -0
- package/phanpy/dist/assets/icons/left-line-eUw0tya4.js +1 -0
- package/phanpy/dist/assets/icons/lightning-line-DaKoDdix.js +1 -0
- package/phanpy/dist/assets/icons/link-2-line-DCqLmMA7.js +1 -0
- package/phanpy/dist/assets/icons/list-check-line-BAxosBh9.js +1 -0
- package/phanpy/dist/assets/icons/lock-line-CPoaXeUW.js +1 -0
- package/phanpy/dist/assets/icons/mail-line-B0P8aa1L.js +1 -0
- package/phanpy/dist/assets/icons/moon-line-CEqNAToP.js +1 -0
- package/phanpy/dist/assets/icons/more-1-fill-Dw2e5xab.js +1 -0
- package/phanpy/dist/assets/icons/more-3-line-BIiVjYTz.js +1 -0
- package/phanpy/dist/assets/icons/notification-line-BZZq2Gtu.js +1 -0
- package/phanpy/dist/assets/icons/pencil-line-CKh8-A1v.js +1 -0
- package/phanpy/dist/assets/icons/photo-album-line-Bnfg2u40.js +1 -0
- package/phanpy/dist/assets/icons/pin-line-DpTolyhs.js +1 -0
- package/phanpy/dist/assets/icons/play-fill-B0-G_8lX.js +1 -0
- package/phanpy/dist/assets/icons/qrcode-2-line-B6SPCaHn.js +1 -0
- package/phanpy/dist/assets/icons/quill-pen-line-B6LUrnCP.js +1 -0
- package/phanpy/dist/assets/icons/quote-left-fill-hQZ1cj_6.js +1 -0
- package/phanpy/dist/assets/icons/radar-line-CKyroTth.js +1 -0
- package/phanpy/dist/assets/icons/react-line-CoIKhhtK.js +1 -0
- package/phanpy/dist/assets/icons/refresh-2-line-D0mTF97S.js +1 -0
- package/phanpy/dist/assets/icons/right-line-B3KWJaqc.js +1 -0
- package/phanpy/dist/assets/icons/rocket-line-4KZl537D.js +1 -0
- package/phanpy/dist/assets/icons/round-fill-C69NTrZ0.js +1 -0
- package/phanpy/dist/assets/icons/round-line-B9k_1uo-.js +1 -0
- package/phanpy/dist/assets/icons/route-line-B28ReHcE.js +1 -0
- package/phanpy/dist/assets/icons/rows-4-line-CrBniagM.js +1 -0
- package/phanpy/dist/assets/icons/scan-line-DSf74YdP.js +1 -0
- package/phanpy/dist/assets/icons/search-2-line-B6geIU1z.js +1 -0
- package/phanpy/dist/assets/icons/settings-3-line-azJwK47w.js +1 -0
- package/phanpy/dist/assets/icons/settings-6-line-C_5zc5YR.js +1 -0
- package/phanpy/dist/assets/icons/share-2-line-D5MxWjrm.js +1 -0
- package/phanpy/dist/assets/icons/share-forward-line-Cp61fZzZ.js +1 -0
- package/phanpy/dist/assets/icons/sparkles-2-line-DYYyXTaW.js +1 -0
- package/phanpy/dist/assets/icons/sparkles-line-C2hY1s6I.js +1 -0
- package/phanpy/dist/assets/icons/time-line-BF3eet1v.js +1 -0
- package/phanpy/dist/assets/icons/transfer-4-line-oisfvTBw.js +1 -0
- package/phanpy/dist/assets/icons/translate-line-BFWol2Ce.js +1 -0
- package/phanpy/dist/assets/icons/unlock-line-X_x5vwv3.js +1 -0
- package/phanpy/dist/assets/icons/upload-3-line-DgzwUJeW.js +1 -0
- package/phanpy/dist/assets/icons/user-4-line-BVSynZCp.js +1 -0
- package/phanpy/dist/assets/icons/user-add-2-line-BlGS5Q8q.js +1 -0
- package/phanpy/dist/assets/icons/user-add-line-BbXdHG4z.js +1 -0
- package/phanpy/dist/assets/icons/user-edit-line-BFAHOV0X.js +1 -0
- package/phanpy/dist/assets/icons/user-follow-line-BXux0wSd.js +1 -0
- package/phanpy/dist/assets/icons/user-star-line-DdYlpHLU.js +1 -0
- package/phanpy/dist/assets/icons/user-warning-line-Cj43j0_E.js +1 -0
- package/phanpy/dist/assets/icons/user-x-line-DIDgNlPH.js +1 -0
- package/phanpy/dist/assets/icons/volume-line-Bs390KQt.js +1 -0
- package/phanpy/dist/assets/icons/volume-mute-line-DzlzIqFZ.js +1 -0
- package/phanpy/dist/assets/icons/walk-line-yNXfB-md.js +1 -0
- package/phanpy/dist/assets/icons/world-2-line-CenkGIwj.js +1 -0
- package/phanpy/dist/assets/icons/zoom-in-line-CaENUphf.js +1 -0
- package/phanpy/dist/assets/icons/zoom-out-line-BDNk0EWo.js +1 -0
- package/phanpy/dist/assets/instances-BNPptnn-.json +333 -0
- package/phanpy/dist/assets/locales/ar-SA-CfheRbCu.js +1 -0
- package/phanpy/dist/assets/locales/ca-ES-DHRW86Tz.js +1 -0
- package/phanpy/dist/assets/locales/cs-CZ-CKoqEuA1.js +1 -0
- package/phanpy/dist/assets/locales/de-DE-ByRPMRFy.js +1 -0
- package/phanpy/dist/assets/locales/eo-UY-CPC7wLCS.js +1 -0
- package/phanpy/dist/assets/locales/es-ES-dJa0Fd9t.js +1 -0
- package/phanpy/dist/assets/locales/eu-ES-C3djlPR2.js +1 -0
- package/phanpy/dist/assets/locales/fa-IR-DTT490Ck.js +1 -0
- package/phanpy/dist/assets/locales/fi-FI-B23MCPuz.js +1 -0
- package/phanpy/dist/assets/locales/fr-FR-BcaQsO5C.js +1 -0
- package/phanpy/dist/assets/locales/gl-ES-BR-CVKBN.js +1 -0
- package/phanpy/dist/assets/locales/he-IL-CfheRbCu.js +1 -0
- package/phanpy/dist/assets/locales/hu-HU-CfheRbCu.js +1 -0
- package/phanpy/dist/assets/locales/it-IT-C1136UFV.js +1 -0
- package/phanpy/dist/assets/locales/ja-JP-CRZmRAhD.js +1 -0
- package/phanpy/dist/assets/locales/kab-Cz8xH_TT.js +1 -0
- package/phanpy/dist/assets/locales/ko-KR-CG9UiY4o.js +1 -0
- package/phanpy/dist/assets/locales/lt-LT-CJcI6sHZ.js +1 -0
- package/phanpy/dist/assets/locales/nb-NO-CfheRbCu.js +1 -0
- package/phanpy/dist/assets/locales/nl-NL-DxN4Yc1t.js +1 -0
- package/phanpy/dist/assets/locales/oc-FR-CfheRbCu.js +1 -0
- package/phanpy/dist/assets/locales/pl-PL-DkwGXf6P.js +1 -0
- package/phanpy/dist/assets/locales/pseudo-LOCALE-CQ4XxkQ0.js +1 -0
- package/phanpy/dist/assets/locales/pt-BR-nGL0HdFS.js +1 -0
- package/phanpy/dist/assets/locales/pt-PT-Cp17aj2z.js +1 -0
- package/phanpy/dist/assets/locales/ru-RU-0Y8cIoaK.js +1 -0
- package/phanpy/dist/assets/locales/th-TH-CfheRbCu.js +1 -0
- package/phanpy/dist/assets/locales/tok-CfheRbCu.js +1 -0
- package/phanpy/dist/assets/locales/tr-TR-CfheRbCu.js +1 -0
- package/phanpy/dist/assets/locales/uk-UA-C5E3dFBf.js +1 -0
- package/phanpy/dist/assets/locales/zh-CN-BHJi7_et.js +1 -0
- package/phanpy/dist/assets/locales/zh-TW-CfheRbCu.js +1 -0
- package/phanpy/dist/assets/main-BdqNbG-a.js +26 -0
- package/phanpy/dist/assets/main-BdqNbG-a.js.map +1 -0
- package/phanpy/dist/assets/mock-home-DGhR__He.js +2 -0
- package/phanpy/dist/assets/mock-home-DGhR__He.js.map +1 -0
- package/phanpy/dist/assets/multi-column-ROck0NVt.jpg +0 -0
- package/phanpy/dist/assets/multi-hashtag-timeline-DH5INVHi.jpg +0 -0
- package/phanpy/dist/assets/nested-comments-thread-hv59kZLc.jpg +0 -0
- package/phanpy/dist/assets/polyfill-force-H8sUkLGp.js +2 -0
- package/phanpy/dist/assets/polyfill-force-H8sUkLGp.js.map +1 -0
- package/phanpy/dist/assets/pwa-viewport-ogKbF51K.js +20 -0
- package/phanpy/dist/assets/pwa-viewport-ogKbF51K.js.map +1 -0
- package/phanpy/dist/assets/style-B1iLPTPR.css +2 -0
- package/phanpy/dist/assets/temml-DuyIQMei.js +97 -0
- package/phanpy/dist/assets/temml-DuyIQMei.js.map +1 -0
- package/phanpy/dist/assets/tinyld.light.node-DtbBhLYC.js +2 -0
- package/phanpy/dist/assets/tinyld.light.node-DtbBhLYC.js.map +1 -0
- package/phanpy/dist/assets/year-in-posts-B2lywqdx.png +0 -0
- package/phanpy/dist/assets/year-in-posts-DJv_star.js +3 -0
- package/phanpy/dist/assets/year-in-posts-DJv_star.js.map +1 -0
- package/phanpy/dist/compose/index.html +20 -0
- package/phanpy/dist/favicon.ico +0 -0
- package/phanpy/dist/index.html +73 -0
- package/phanpy/dist/logo-192.png +0 -0
- package/phanpy/dist/logo-512.png +0 -0
- package/phanpy/dist/logo-badge-72.png +0 -0
- package/phanpy/dist/logo-maskable-512.png +0 -0
- package/phanpy/dist/logo-monochrome-512.png +0 -0
- package/phanpy/dist/logo-monochrome-maskable-512.png +0 -0
- package/phanpy/dist/manifest.webmanifest +1 -0
- package/phanpy/dist/og-image-2.jpg +0 -0
- package/phanpy/dist/og-image.png +0 -0
- package/phanpy/dist/robots.txt +2 -0
- package/phanpy/dist/sw.js +25 -0
- package/phanpy/dist/version.json +1 -0
- package/run-agent.mjs +805 -0
- package/scripts/build-dist.mjs +37 -0
- package/scripts/verify-ui.mjs +60 -0
- package/ui/README.md +23 -0
- package/vendor/gate.cjs +132 -0
- package/vendor/idp-grant.cjs +394 -0
- package/vendor/jfetch.cjs +16 -0
- package/web/admin/admin.js +958 -0
- package/web/admin/bar.css +64 -0
- package/web/admin/bar.js +61 -0
- package/web/admin/client/client.js +66 -0
- package/web/admin/client/index.html +42 -0
- package/web/admin/index.html +493 -0
- package/web/admin/setup/index.html +172 -0
- package/web/admin/setup/setup.js +268 -0
- package/web/admin/window.css +55 -0
- package/web/admin/window.js +136 -0
- package/web/front/install.sh +69 -0
- package/web/front/new-account.html +424 -0
- package/web/front/run.html +138 -0
- package/web/front/solid-client-authn.bundle.js +2 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./mock-home-DGhR__He.js","./pwa-viewport-ogKbF51K.js","./chunk-aKtaBQYM.js","./ScheduledAtField-D-Abfo4J.js","./ICONS-DIPJeU0C.js","./year-in-posts-DJv_star.js","./__vite-browser-external-C7iut881.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e,t as n}from"./chunk-aKtaBQYM.js";import{$ as r,$t as i,A as a,B as o,Bt as s,C as c,Ct as l,D as u,Et as d,F as f,G as p,Gt as m,H as h,Ht as g,I as _,J as v,Jt as y,K as b,Kt as x,L as S,M as C,Mt as w,O as T,Ot as E,Q as ee,Qt as D,R as O,S as k,St as A,Tt as j,U as M,Ut as N,V as P,Vt as te,W as F,Wt as I,Y as ne,Yt as L,Z as R,_t as z,a as B,at as V,b as re,bt as ie,ct as ae,et as H,f as U,ft as W,gt as oe,h as se,ht as ce,i as le,in as G,it as ue,jt as K,l as de,lt as fe,m as pe,mt as me,n as he,o as ge,ot as _e,pt as ve,q as ye,qt as be,r as xe,rt as Se,s as Ce,st as we,t as Te,tn as Ee,tt as De,u as q,ut as J,v as Oe,vt as ke,w as Ae,wt as je,x as Me,xt as Ne,y as Pe,yt as Fe,z as Ie,zt as Le}from"./pwa-viewport-ogKbF51K.js";import{$ as Re,A as ze,At as Be,B as Ve,C as He,Ct as Ue,D as We,Dt as Ge,E as Ke,Et as qe,F as Je,G as Ye,H as Xe,I as Ze,J as Qe,K as $e,L as et,M as tt,Mt as nt,N as rt,Nt as it,O as at,Ot as Y,P as ot,Q as st,R as ct,S as lt,St as ut,T as dt,Tt as ft,X as pt,Y as mt,Z as ht,_t as gt,a as _t,b as vt,c as yt,d as bt,dt as X,et as xt,f as St,ft as Ct,g as wt,gt as Tt,ht as Et,i as Dt,it as Ot,j as kt,jt as Z,kt as At,l as jt,lt as Mt,mt as Nt,n as Pt,nt as Ft,o as It,ot as Lt,p as Rt,pt as zt,q as Bt,r as Vt,rt as Ht,s as Ut,st as Wt,tt as Gt,u as Kt,ut as Q,v as qt,vt as Jt,w as Yt,wt as Xt,x as Zt,xt as Qt,y as $t}from"./ScheduledAtField-D-Abfo4J.js";import{t as en}from"./ICONS-DIPJeU0C.js";(function(e,n){typeof e.CustomEvent!=`function`&&(e.CustomEvent=function(e,r){r||={bubbles:!1,cancelable:!1,detail:void 0};var i=n.createEvent(`CustomEvent`);return i.initCustomEvent(e,r.bubbles,r.cancelable,r.detail),i},e.CustomEvent.prototype=e.Event.prototype),n.addEventListener(`touchstart`,d,!1),n.addEventListener(`touchmove`,f,!1),n.addEventListener(`touchend`,u,!1);var r=null,i=null,a=null,o=null,s=null,c=null,l=0;function u(e){if(c===e.target){var u=parseInt(p(c,`data-swipe-threshold`,`20`),10),d=p(c,`data-swipe-unit`,`px`),f=parseInt(p(c,`data-swipe-timeout`,`500`),10),m=Date.now()-s,h=``,g=e.changedTouches||e.touches||[];if(d===`vh`&&(u=Math.round(u/100*n.documentElement.clientHeight)),d===`vw`&&(u=Math.round(u/100*n.documentElement.clientWidth)),Math.abs(a)>Math.abs(o)?Math.abs(a)>u&&m<f&&(h=a>0?`swiped-left`:`swiped-right`):Math.abs(o)>u&&m<f&&(h=o>0?`swiped-up`:`swiped-down`),h!==``){var _={dir:h.replace(/swiped-/,``),touchType:(g[0]||{}).touchType||`direct`,fingers:l,xStart:parseInt(r,10),xEnd:parseInt((g[0]||{}).clientX||-1,10),yStart:parseInt(i,10),yEnd:parseInt((g[0]||{}).clientY||-1,10)};c.dispatchEvent(new CustomEvent(`swiped`,{bubbles:!0,cancelable:!0,detail:_})),c.dispatchEvent(new CustomEvent(h,{bubbles:!0,cancelable:!0,detail:_}))}r=null,i=null,s=null}}function d(e){e.target.getAttribute(`data-swipe-ignore`)!==`true`&&(c=e.target,s=Date.now(),r=e.touches[0].clientX,i=e.touches[0].clientY,a=0,o=0,l=e.touches.length)}function f(e){if(!(!r||!i)){var n=e.touches[0].clientX,s=e.touches[0].clientY;a=r-n,o=i-s}}function p(e,r,i){for(;e&&e!==n.documentElement;){var a=e.getAttribute(r);if(a)return a;e=e.parentNode}return i}})(window,document);var tn=nn;function nn(e,n,r){var i=null,a=null,o=function(){i&&=(clearTimeout(i),a=null,null)},s=function(){var e=a;o(),e&&e()},c=function(){if(!n)return e.apply(this,arguments);var s=this,c=arguments,l=r&&!i;if(o(),a=function(){e.apply(s,c)},i=setTimeout(function(){if(i=null,!l){var e=a;return a=null,e()}},n),l)return a()};return c.cancel=o,c.flush=s,c}var rn=e(it(),1),an=window.alert;window.__nativeAlert||(window.__nativeAlert=an),window.alert=function(e){e instanceof Error&&e?.message&&(e=e.message),typeof e!=`string`&&(e=JSON.stringify(e));let n=(0,rn.default)({text:e,className:`alert`,gravity:`top`,position:`center`,duration:1e4,offset:{y:48},onClick:()=>{n.hideToast()}});n.showToast()};var on=Ee(!1);function sn({children:e,value:n}){return L(on.Provider,{value:n,children:e})}function cn(){return be(on)}function ln(e=()=>{},n=[]){let r=s(e);y(()=>{r.current=e},[n]),y(()=>{let e=()=>{let e=document.hidden||document.visibilityState===`hidden`;r.current(!e)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[])}var un=1e3*3,dn=2e4,fn=K(function(){let e=cn(),{_:n}=d(),[r,i]=I(!0),a=s();ln(e=>{clearTimeout(a.current),e?i(!0):a.current=setTimeout(()=>{i(!1)},dn)});let o=async(e,n,r)=>{if(k.notificationsLast){let{value:n}=await e.v1.notifications.list({limit:1,sinceId:k.notificationsLast.id}).values().next();if(n?.length)if(r)k.notificationsShowNew=!0;else{let r;try{r=(await e.v1.markers.fetch({timeline:`notifications`}))?.notifications?.lastReadId}catch{}r?k.notificationsShowNew=n[0].id!==r:k.notificationsShowNew=!0}}};y(()=>{let n,i,a,s=!1;if(e&&r){let{masto:e,streaming:r,instance:c}=f();(async()=>{await o(e,c);let l=()=>{s||(a=setInterval(()=>{o(e,c,!0)},dn))};r?i=setTimeout(()=>{(async()=>{try{n=r.user.notification.subscribe();for await(let e of n){if(s||!n)break;e.event===`notification`&&Me(e.payload,c,{skipThreading:!0}),k.notificationsShowNew=!0}}catch{}l()})()},un):l()})()}return()=>{s=!0,n?.unsubscribe?.(),n=null,clearTimeout(i),clearInterval(a)}},[r,e]);let c=s(),l=()=>{c.current=Date.now(),fetch(`./version.json`).then(e=>e.json()).then(e=>{e&&(k.appVersion=e)}).catch(e=>{})};return Be(l,r&&1e3*60*30),ln(e=>{e&&(c.current?Date.now()-c.current>1e3*60*60&&l():l())}),nt(`shift+alt+k`,e=>{if(!e.shiftKey||!e.altKey)return;let r=k.settings.cloakMode;k.settings.cloakMode=!r,Z({text:n(r?{id:`oguMwa`}:{id:`IXZLPs`})})},{ignoreEventWhen:e=>e.metaKey||e.ctrlKey}),null}),pn=a(async(e,n)=>{let{value:r}=await e.v1.accounts.$select(n).statuses.list({limit:3,exclude_replies:!0,exclude_reblogs:!0}).values().next();return r||[]},{expires:6e4});function mn(){let{_:e}=d(),n=W(k),{masto:r}=f(),[a,o]=I(!1),[c,l]=I([]),[u,p]=I(!1),m=s(null),h=s(null),g=n.settings.shortcutsViewMode===`multi-column`;function _(e){if(e.key&&e.key.toLowerCase()!==`c`)return;if(n.composerState.minimized){k.composerState.minimized=!1,Tt();return}let r=document.querySelectorAll(`data.compose-data`),i=!g&&r.length===1?JSON.parse(r[0].value):void 0;e.shiftKey?gt(i)||(k.showCompose=i||!0):(Tt(),k.showCompose=i||!0)}nt(`c, shift+c`,_,{useKey:!0,ignoreEventWhen:e=>!!document.querySelector(`#modal-container > *`)||e.metaKey||e.ctrlKey||e.altKey});let v=ut(()=>{o(!0)},{threshold:600}),b=x(async()=>{try{p(!0);let e=ee();if(!e)return;l(await pn(r,e))}catch{}finally{p(!1)}},[r]),S=x(e=>{Nt({replyToStatus:e}),o(!1)},[]);return y(()=>{a&&b()},[b,a]),L(i,{children:[L(`button`,{ref:m,type:`button`,id:`compose-button`,onClick:e=>{Qt.trigger(`light`),_(e)},onContextMenu:e=>{e.preventDefault(),o(!0)},...v(),class:`${n.composerState.minimized?`min`:``} ${n.composerState.publishing?`loading`:``} ${n.composerState.publishingError?`error`:``}`,children:L(X,{icon:`quill`,size:`xl`,alt:e({id:`QOhkyl`})})}),L(At,{ref:h,state:a?`open`:void 0,anchorRef:m,onClose:()=>o(!1),direction:`top`,gap:8,unmountOnClose:!0,portal:{target:document.body},boundingBoxPadding:Et(),containerProps:{style:{zIndex:19},onClick:()=>{h.current?.closeMenu?.()}},submenuOpenDelay:600,children:[L(Mt,{to:`/sp`,children:[L(X,{icon:`schedule`}),` `,L(`span`,{children:L(j,{id:`-GkIdc`})})]}),L(qe,{}),L(Lt,{align:`end`,direction:`top`,shift:-8,disabled:u||c.length===0,label:L(i,{children:[L(X,{icon:`comment`}),` `,L(`span`,{className:`menu-grow`,children:L(j,{id:`LwOr4P`})}),u?`…`:L(X,{icon:`chevron-right`})]}),children:c.length>0&&c.map(e=>{let n=new Date(e.createdAt),r=Date.now()-n.getTime()<864e5;return L(Y,{onClick:()=>S(e),children:L(`small`,{children:[L(`div`,{class:`menu-post-text`,children:Ct(e)}),L(`span`,{className:`more-insignificant`,children:[r&&L(i,{children:[L(Wt,{datetime:n,format:`micro`}),` `,`‒`,` `]}),L(`time`,{className:`created`,dateTime:n.toISOString(),title:n.toLocaleString(),children:Jt(e.createdAt)})]})]})},e.id)})})]})]})}function hn({key1:e,key2:n}){return L(j,{id:`Qh-0sm`,values:{key1:e,key2:n},components:{0:L(`kbd`,{}),1:L(`kbd`,{})}})}var gn=K(function(){let{_:e}=d(),n=W(k);function r(){k.showKeyboardShortcutsHelp=!1}return nt(`?`,()=>{k.showKeyboardShortcutsHelp=!0},{useKey:!0,ignoreModifiers:!0,ignoreEventWhen:e=>/\/catchup/i.test(location.hash)||e.metaKey||e.ctrlKey||e.altKey}),!!n.showKeyboardShortcutsHelp&&L(Ot,{onClose:r,children:L(`div`,{id:`keyboard-shortcuts-help-container`,class:`sheet`,tabindex:`-1`,children:[L(`button`,{type:`button`,class:`sheet-close`,onClick:r,children:L(X,{icon:`x`,alt:e({id:`yz7wBu`})})}),L(`header`,{children:L(`h2`,{children:L(j,{id:`77Emn0`})})}),L(`main`,{children:L(`table`,{children:L(`tbody`,{children:[{action:e({id:`ulXSNi`}),keys:L(`kbd`,{children:`?`})},{action:e({id:`Gy9P9T`}),keys:L(`kbd`,{children:`j`})},{action:e({id:`6XYpYY`}),keys:L(`kbd`,{children:`k`})},{action:e({id:`DYowFe`}),keys:L(j,{id:`mzjGX4`,components:{0:L(`kbd`,{}),1:L(`kbd`,{})}})},{action:e({id:`S5ez7Y`}),keys:L(j,{id:`Fd8FaU`,components:{0:L(`kbd`,{}),1:L(`kbd`,{})}})},{action:e({id:`VkLESX`}),keys:L(`kbd`,{children:`.`})},{action:e({id:`jsFF8C`}),keys:L(`kbd`,{children:`Enter`})},{action:e({id:`9VPqHP`}),keys:L(`kbd`,{children:`o`})},{action:L(j,{id:`41gejM`,components:{0:L(`br`,{})}}),keys:L(`kbd`,{children:`x`})},{action:e({id:`jAj8rv`}),keys:L(j,{id:`evz6c6`,components:{0:L(`kbd`,{}),1:L(`kbd`,{})}})},{action:e({id:`duF1lx`}),keys:L(j,{id:`nhpsIN`,components:{0:L(`kbd`,{}),1:L(`kbd`,{})}})},{action:e({id:`YrR3Co`}),keys:L(`kbd`,{children:`]`})},{action:e({id:`noxAFR`}),keys:L(`kbd`,{children:`[`})},{action:e({id:`AIa_f7`}),keys:L(`kbd`,{children:`c`})},{action:e({id:`snPx8X`}),className:`insignificant`,keys:L(j,{id:`-Cxvld`,components:{0:L(`kbd`,{}),1:L(`kbd`,{})}})},{action:e({id:`1pKapz`}),keys:L(j,{id:`py67WT`,components:{0:L(`kbd`,{}),1:L(`kbd`,{}),2:L(`kbd`,{}),3:L(`kbd`,{})}})},{action:e({id:`A1taO8`}),keys:L(`kbd`,{children:`/`})},{action:e({id:`ImOQa9`}),keys:L(`kbd`,{children:`r`})},{action:e({id:`KFs8c6`}),className:`insignificant`,keys:L(j,{id:`XpQLJF`,components:{0:L(`kbd`,{}),1:L(`kbd`,{})}})},{action:e({id:`cqi4Mx`}),keys:L(j,{id:`84WuL2`,components:{0:L(`kbd`,{}),1:L(`kbd`,{})}})},{action:e({id:`kulphB`}),keys:L(j,{id:`yrz6Ck`,components:{0:L(`kbd`,{}),1:L(`kbd`,{})}})},{action:e({id:`ZhhOwV`}),keys:L(`kbd`,{children:`q`})},{action:e({id:`PZlHt8`}),keys:L(`kbd`,{children:`d`})},{action:e({id:`C7ujRh`}),keys:L(j,{id:`v4TbMP`,components:{0:L(`kbd`,{}),1:L(`kbd`,{}),2:L(`kbd`,{})}})},{action:e({id:`UmuIdg`}),keys:L(hn,{key1:`g`,key2:`h`})},{action:e({id:`0YgcH9`}),keys:L(hn,{key1:`g`,key2:`n`})},{action:e({id:`mT57-Q`}),keys:L(hn,{key1:`g`,key2:`s`})},{action:e({id:`T1_8PL`}),keys:L(hn,{key1:`g`,key2:`p`})},{action:e({id:`29r697`}),keys:L(hn,{key1:`g`,key2:`b`})}].map(({action:e,className:n,keys:r})=>L(`tr`,{children:[L(`th`,{class:n,children:e}),L(`td`,{children:r})]},e))})})})]})})}),_n=new Set,vn=new WeakMap,yn=new WeakMap,bn=new WeakMap,xn=new WeakMap,Sn=new WeakMap,Cn=new WeakMap,wn=new WeakMap,Tn=new WeakMap,En=new WeakSet,Dn,On=0,kn=0,An=`__aa_tgt`,jn=`__aa_del`,Mn=`__aa_new`,Nn=e=>{let n=Un(e);n&&n.forEach(e=>Gn(e))},Pn=e=>{e.forEach(e=>{e.target===Dn&&Rn(),vn.has(e.target)&&Ln(e.target)})};function Fn(e){let n=e.getBoundingClientRect(),r=Dn?.clientWidth||0,i=Dn?.clientHeight||0;return n.bottom<0||n.top>i||n.right<0||n.left>r}function In(e){xn.get(e)?.disconnect();let n=vn.get(e),r=0;n||(n=Jn(e),vn.set(e,n));let{offsetWidth:i,offsetHeight:a}=Dn,o=[n.top-5,i-(n.left+5+n.width),a-(n.top+5+n.height),n.left-5].map(e=>`${-1*Math.floor(e)}px`).join(` `),s=new IntersectionObserver(()=>{++r>1&&Ln(e)},{root:Dn,threshold:1,rootMargin:o});s.observe(e),xn.set(e,s)}function Ln(e,n=!0){clearTimeout(Tn.get(e));let r=Xn(e),i=n?tr(r)?500:r.duration:0;Tn.set(e,setTimeout(async()=>{let n=bn.get(e);try{await n?.finished,vn.set(e,Jn(e)),In(e)}catch{}},i))}function Rn(){clearTimeout(Tn.get(Dn)),Tn.set(Dn,setTimeout(()=>{_n.forEach(e=>$n(e,e=>Bn(()=>Ln(e))))},100))}function zn(e){setTimeout(()=>{Cn.set(e,setInterval(()=>Bn(Ln.bind(null,e)),2e3))},Math.round(2e3*Math.random()))}function Bn(e){typeof requestIdleCallback==`function`?requestIdleCallback(()=>e()):requestAnimationFrame(()=>e())}var Vn,Hn=typeof window<`u`&&`ResizeObserver`in window;Hn&&(Dn=document.documentElement,new MutationObserver(Nn),Vn=new ResizeObserver(Pn),window.addEventListener(`scroll`,()=>{kn=window.scrollY,On=window.scrollX}),Vn.observe(Dn));function Un(e){return e.reduce((e,n)=>[...e,...Array.from(n.addedNodes),...Array.from(n.removedNodes)],[]).every(e=>e.nodeName===`#comment`)?!1:e.reduce((e,n)=>{if(e===!1)return!1;if(n.target instanceof Element){if(Wn(n.target),!e.has(n.target)){e.add(n.target);for(let r=0;r<n.target.children.length;r++){let i=n.target.children.item(r);if(i){if(jn in i)return!1;Wn(n.target,i),e.add(i)}}}if(n.removedNodes.length)for(let r=0;r<n.removedNodes.length;r++){let i=n.removedNodes[r];if(jn in i)return!1;i instanceof Element&&(e.add(i),Wn(n.target,i),yn.set(i,[n.previousSibling,n.nextSibling]))}}return e},new Set)}function Wn(e,n){!n&&!(An in e)?Object.defineProperty(e,An,{value:e}):n&&!(An in n)&&Object.defineProperty(n,An,{value:e})}function Gn(e){let n=e.isConnected,r=vn.has(e);n&&yn.has(e)&&yn.delete(e),bn.get(e)?.playState!==`finished`&&bn.get(e)?.cancel(),Mn in e?rr(e):r&&n?nr(e):r&&!n?ar(e):rr(e)}function Kn(e){return Number(e.replace(/[^0-9.\-]/g,``))}function qn(e){let n=e.parentElement;for(;n;){if(n.scrollLeft||n.scrollTop)return{x:n.scrollLeft,y:n.scrollTop};n=n.parentElement}return{x:0,y:0}}function Jn(e){let n=e.getBoundingClientRect(),{x:r,y:i}=qn(e);return{top:n.top+i,left:n.left+r,width:n.width,height:n.height}}function Yn(e,n,r){let i=n.width,a=n.height,o=r.width,s=r.height,c=getComputedStyle(e);if(c.getPropertyValue(`box-sizing`)===`content-box`){let e=Kn(c.paddingTop)+Kn(c.paddingBottom)+Kn(c.borderTopWidth)+Kn(c.borderBottomWidth),n=Kn(c.paddingLeft)+Kn(c.paddingRight)+Kn(c.borderRightWidth)+Kn(c.borderLeftWidth);i-=n,o-=n,a-=e,s-=e}return[i,o,a,s].map(Math.round)}function Xn(e){return An in e&&wn.has(e[An])?wn.get(e[An]):{duration:250,easing:`ease-in-out`}}function Zn(e){if(An in e)return e[An]}function Qn(e){let n=Zn(e);return n?En.has(n):!1}function $n(e,...n){n.forEach(n=>n(e,wn.has(e)));for(let r=0;r<e.children.length;r++){let i=e.children.item(r);i&&n.forEach(e=>e(i,wn.has(i)))}}function er(e){return Array.isArray(e)?e:[e]}function tr(e){return typeof e==`function`}function nr(e){let n=vn.get(e),r=Jn(e);if(!Qn(e))return vn.set(e,r);if(Fn(e)){vn.set(e,r),In(e);return}let i;if(!n)return;let a=Xn(e);if(typeof a!=`function`){let o=n.left-r.left,s=n.top-r.top,c=n.left+n.width-(r.left+r.width);n.top+n.height-(r.top+r.height)==0&&(s=0),c==0&&(o=0);let[l,u,d,f]=Yn(e,n,r),p={transform:`translate(${o}px, ${s}px)`},m={transform:`translate(0, 0)`};l!==u&&(p.width=`${l}px`,m.width=`${u}px`),d!==f&&(p.height=`${d}px`,m.height=`${f}px`),i=e.animate([p,m],{duration:a.duration,easing:a.easing})}else{let[o]=er(a(e,`remain`,n,r));i=new Animation(o),i.play()}bn.set(e,i),vn.set(e,r),i.addEventListener(`finish`,Ln.bind(null,e,!1),{once:!0})}function rr(e){Mn in e&&delete e[Mn];let n=Jn(e);vn.set(e,n);let r=Xn(e);if(!Qn(e))return;if(Fn(e)){In(e);return}let i;if(typeof r!=`function`)i=e.animate([{transform:`scale(.98)`,opacity:0},{transform:`scale(0.98)`,opacity:0,offset:.5},{transform:`scale(1)`,opacity:1}],{duration:r.duration*1.5,easing:`ease-in`});else{let[a]=er(r(e,`add`,n));i=new Animation(a),i.play()}bn.set(e,i),i.addEventListener(`finish`,Ln.bind(null,e,!1),{once:!0})}function ir(e,n){e.remove(),vn.delete(e),yn.delete(e),bn.delete(e),xn.get(e)?.disconnect(),setTimeout(()=>{if(jn in e&&delete e[jn],Object.defineProperty(e,Mn,{value:!0,configurable:!0}),n&&e instanceof HTMLElement)for(let r in n)e.style[r]=``},0)}function ar(e){if(!yn.has(e)||!vn.has(e))return;let[n,r]=yn.get(e);Object.defineProperty(e,jn,{value:!0,configurable:!0});let i=window.scrollX,a=window.scrollY;if(r&&r.parentNode&&r.parentNode instanceof Element?r.parentNode.insertBefore(e,r):n&&n.parentNode?n.parentNode.appendChild(e):Zn(e)?.appendChild(e),!Qn(e))return ir(e);let[o,s,c,l]=sr(e),u=Xn(e),d=vn.get(e);(i!==On||a!==kn)&&or(e,i,a,u);let f,p={position:`absolute`,top:`${o}px`,left:`${s}px`,width:`${c}px`,height:`${l}px`,margin:`0`,pointerEvents:`none`,transformOrigin:`center`,zIndex:`100`};if(!tr(u))Object.assign(e.style,p),f=e.animate([{transform:`scale(1)`,opacity:1},{transform:`scale(.98)`,opacity:0}],{duration:u.duration,easing:`ease-out`});else{let[n,r]=er(u(e,`remove`,d));r?.styleReset!==!1&&(p=r?.styleReset||p,Object.assign(e.style,p)),f=new Animation(n),f.play()}bn.set(e,f),f.addEventListener(`finish`,()=>ir(e,p),{once:!0})}function or(e,n,r,i){let a=On-n,o=kn-r,s=document.documentElement.style.scrollBehavior;if(getComputedStyle(Dn).scrollBehavior===`smooth`&&(document.documentElement.style.scrollBehavior=`auto`),window.scrollTo(window.scrollX+a,window.scrollY+o),!e.parentElement)return;let c=e.parentElement,l=c.clientHeight,u=c.clientWidth,d=performance.now();function f(){requestAnimationFrame(()=>{if(!tr(i)){let e=l-c.clientHeight,n=u-c.clientWidth;d+i.duration>performance.now()?(window.scrollTo({left:window.scrollX-n,top:window.scrollY-e}),l=c.clientHeight,u=c.clientWidth,f()):document.documentElement.style.scrollBehavior=s}})}f()}function sr(e){let n=vn.get(e),[r,,i]=Yn(e,n,Jn(e)),a=e.parentElement;for(;a&&(getComputedStyle(a).position===`static`||a instanceof HTMLBodyElement);)a=a.parentElement;a||=document.body;let o=getComputedStyle(a),s=!bn.has(e)||bn.get(e)?.playState===`finished`?Jn(a):vn.get(a);return[Math.round(n.top-s.top)-Kn(o.borderTopWidth),Math.round(n.left-s.left)-Kn(o.borderLeftWidth),r,i]}function cr(e,n={}){if(Hn&&Vn&&!(window.matchMedia(`(prefers-reduced-motion: reduce)`).matches&&!tr(n)&&!n.disrespectUserMotionPreference)){En.add(e),getComputedStyle(e).position===`static`&&Object.assign(e.style,{position:`relative`}),$n(e,Ln,zn,e=>Vn?.observe(e)),tr(n)?wn.set(e,n):wn.set(e,{duration:250,easing:`ease-in-out`,...n});let r=new MutationObserver(Nn);r.observe(e,{childList:!0}),Sn.set(e,r),_n.add(e)}return Object.freeze({parent:e,enable:()=>{En.add(e)},disable:()=>{En.delete(e),$n(e,e=>{let n=bn.get(e);try{n?.cancel()}catch{}bn.delete(e);let r=Tn.get(e);r&&clearTimeout(r),Tn.delete(e);let i=Cn.get(e);i&&clearInterval(i),Cn.delete(e)})},isEnabled:()=>En.has(e),destroy:()=>{En.delete(e),_n.delete(e),wn.delete(e),Sn.get(e)?.disconnect(),Sn.delete(e),$n(e,e=>{Vn?.unobserve(e);let n=bn.get(e);try{n?.cancel()}catch{}bn.delete(e),xn.get(e)?.disconnect(),xn.delete(e);let r=Cn.get(e);r&&clearInterval(r),Cn.delete(e);let i=Tn.get(e);i&&clearTimeout(i),Tn.delete(e),vn.delete(e),yn.delete(e)})}})}function lr(e){let n=s(null),[r,i]=I();return y(()=>{n.current instanceof HTMLElement&&i(cr(n.current,e||{}))},[]),y(()=>()=>{(r?.destroy)?.call(r)},[r]),[n,e=>{r&&(e?r.enable():r.disable())}]}function ur(e){return(`0`+e.toString(16)).slice(-2)}function dr(){var e=new Uint32Array(56/2);return window.crypto.getRandomValues(e),Array.from(e,ur).join(``)}function fr(e){let n=new TextEncoder().encode(e);return window.crypto.subtle.digest(`SHA-256`,n)}function pr(e){let n=``,r=new Uint8Array(e),i=r.byteLength;for(var a=0;a<i;a++)n+=String.fromCharCode(r[a]);return btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}async function mr(e){return pr(await fr(e))}async function hr({instanceURL:e}){if(!e)return!1;try{let n=await fetch(`${location.protocol}//${e}/.well-known/oauth-authorization-server`);return!n.ok||n.status!==200?!1:!!(await n.json()).code_challenge_methods_supported?.includes(`S256`)}catch{return!1}}window.__generateCodeChallenge=mr;var{DEV:gr,PHANPY_CLIENT_NAME:_r,PHANPY_WEBSITE:vr}={DEV:!1,PHANPY_CLIENT_NAME:`Phanpy`},yr=`read write follow push`,br=vr?vr.toLowerCase().includes(location.hostname):!1,xr=location.origin+location.pathname,Sr=gr||!br?xr:vr;async function Cr({instanceURL:e}){let n=new URLSearchParams({client_name:_r,redirect_uris:Sr,scopes:yr,website:vr||Sr});return await(await fetch(`${location.protocol}//${e}/api/v1/apps`,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:n.toString()})).json()}async function wr({instanceURL:e,client_id:n,forceLogin:r=!1}){let i=dr(),a=await mr(i),o=new URLSearchParams({client_id:n,code_challenge_method:`S256`,code_challenge:a,redirect_uri:Sr,response_type:`code`,scope:yr});return r&&o.append(`force_login`,!0),[`${location.protocol}//${e}/oauth/authorize?${o.toString()}`,i]}async function Tr({instanceURL:e,client_id:n,forceLogin:r=!1}){let i=new URLSearchParams({client_id:n,scope:yr,redirect_uri:Sr,response_type:`code`});return r&&i.append(`force_login`,!0),`${location.protocol}//${e}/oauth/authorize?${i.toString()}`}async function Er({instanceURL:e,client_id:n,client_secret:r,code:i,code_verifier:a}){let o=new URLSearchParams({client_id:n,redirect_uri:Sr,grant_type:`authorization_code`,code:i});return r&&o.append(`client_secret`,r),a&&o.append(`code_verifier`,a),await(await fetch(`${location.protocol}//${e}/oauth/token`,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:o.toString()})).json()}async function Dr({instanceURL:e,client_id:n,client_secret:r,token:i}){try{let a=new URLSearchParams({client_id:n,client_secret:r,token:i});return(await fetch(`${location.protocol}//${e}/oauth/revoke`,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:a.toString(),keepalive:!0})).ok}catch{return!1}}var Or=window.matchMedia(`(display-mode: standalone)`).matches;function kr({onClose:e}){let{_:n}=d(),{masto:r}=f(),a=v(),o=ee(),s=a.length>1,[c,l]=m(e=>e+1,0),[u]=lr();return L(`div`,{id:`accounts-container`,class:`sheet`,tabIndex:`-1`,children:[!!e&&L(`button`,{type:`button`,class:`sheet-close`,onClick:e,children:L(X,{icon:`x`,alt:n({id:`yz7wBu`})})}),L(`header`,{class:`header-grid`,children:L(`h2`,{children:L(j,{id:`bPwFdf`})})}),L(`main`,{children:L(`section`,{children:[L(`ul`,{class:`accounts-list`,ref:u,children:a.map((c,u)=>{let d=c.info.id===o,f=u===0,p=!c.accessToken,m=()=>{a.splice(u,1),_e(a);try{F.session.get(`currentAccount`)===c.info.id&&F.session.del(`currentAccount`)}catch{}},h=async()=>{await Dr({instanceURL:c.instanceURL,client_id:c.clientId,client_secret:c.clientSecret,token:c.accessToken})};return L(`li`,{children:[L(`div`,{children:[s&&L(`span`,{class:`current ${d?`is-current`:``}`,children:L(X,{icon:`check-circle`,alt:n({id:`Hp1l6f`})})}),L(Ht,{url:c.info.avatarStatic,size:`xxl`,onDblClick:async()=>{if(d)try{c.info=await r.v1.accounts.$select(c.info.id).fetch(),_e(a),l()}catch{}}}),L(ht,{account:s?{...c.info,acct:/@/.test(c.info.acct)?c.info.acct:`${c.info.acct}@${c.instanceURL}`}:c.info,showAcct:!0,onClick:()=>{Qt.trigger(`medium`),p?(location.href=`/#/login?instance=${c.instanceURL}`,e()):d?k.showAccount=`${c.info.username}@${c.instanceURL}`:(we(c.info.id),location.reload())}})]}),L(`div`,{class:`actions`,children:[p&&L(`span`,{class:`tag`,children:L(j,{id:`mxY4xF`})}),f&&s&&L(i,{children:[L(`span`,{class:`tag`,children:L(j,{id:`ovBPCi`})}),` `]}),L(Gt,{align:`end`,menuButton:L(`button`,{type:`button`,class:`plain more-button`,children:L(X,{icon:`more`,size:`l`,alt:n({id:`2FYpfJ`})})}),children:[s&&L(i,{children:[L(Y,{disabled:d||p,onClick:()=>{we(c.info.id),location.reload()},children:[L(X,{icon:`transfer`}),` `,L(j,{id:`3t_Nrv`})]}),!Or&&!d&&!p&&L(Mt,{href:`./?account=${c.info.id}`,target:`_blank`,children:[L(X,{icon:`external`}),L(`span`,{children:L(j,{id:`PZgZtY`})})]}),L(qe,{})]}),L(Y,{onClick:()=>{k.showAccount=`${c.info.username}@${c.instanceURL}`},children:[L(X,{icon:`user`}),L(`span`,{children:L(j,{id:`40z2Fm`})})]}),L(qe,{}),s&&L(i,{children:[L(Y,{disabled:f||p,onClick:()=>{a.splice(u,1),a.unshift(c),_e(a),l()},children:[L(X,{icon:`check-circle`}),L(`span`,{children:L(j,{id:`PPcets`})})]}),L(Y,{disabled:u<=1,onClick:()=>{a.splice(u,1),a.splice(u-1,0,c),_e(a),l()},children:[L(X,{icon:`arrow-up`}),L(`span`,{children:L(j,{id:`QyioBP`})})]}),L(Y,{disabled:u===0||u===a.length-1,onClick:()=>{a.splice(u,1),a.splice(u+1,0,c),_e(a),l()},children:[L(X,{icon:`arrow-down`}),L(`span`,{children:L(j,{id:`3Ib6FN`})})]}),L(qe,{})]}),p?L(xt,{subMenu:!0,confirmLabel:L(i,{children:[L(X,{icon:`x`}),L(`span`,{children:L(j,{id:`yyX15r`,values:{0:c.info.acct},components:{0:L(`span`,{class:`bidi-isolate`})}})})]}),menuItemClassName:`danger`,onClick:()=>{m(),l()},children:[L(X,{icon:`x`}),L(`span`,{children:L(j,{id:`9OzDUH`})})]}):L(xt,{subMenu:!0,confirmLabel:L(i,{children:[L(X,{icon:`exit`}),L(`span`,{children:L(j,{id:`k08LxG`,values:{0:c.info.acct},components:{0:L(`span`,{class:`bidi-isolate`})}})})]}),menuItemClassName:`danger`,onClick:async()=>{await h(),delete c.accessToken,_e(a),l()},menuExtras:L(Y,{className:`danger`,onClick:async()=>{await h(),m(),location.href=location.pathname||`/`},children:[L(X,{icon:`x`}),L(`span`,{children:L(j,{id:`A3GDG1`,values:{0:c.info.acct},components:{0:L(`span`,{class:`bidi-isolate`})}})})]}),children:[L(X,{icon:`exit`}),L(`span`,{children:L(j,{id:`CXk1bI`})})]}),!!c?.createdAt&&L(`div`,{class:`footer`,children:[L(X,{icon:`account-add`}),L(`span`,{children:L(j,{id:`-9E7iR`,values:{0:Jt(c.createdAt)},components:{0:L(Wt,{datetime:c.createdAt})}})})]})]})]})]},c.info.id)})}),L(`p`,{children:L(Q,{to:`/login`,class:`button plain2`,onClick:e,children:[L(X,{icon:`plus`}),` `,L(`span`,{children:L(j,{id:`Is7_PB`})})]})}),s&&L(`p`,{children:L(`small`,{children:L(j,{id:`52x24e`,components:{0:L(`i`,{})}})})}),L(`p`,{children:L(`button`,{type:`button`,class:`light`,onClick:()=>k.showImportExportAccounts=!0,children:L(j,{id:`bgVLbt`})})})]})})]})}var Ar=class extends HTMLElement{connectedCallback(){if(this.button=this.querySelector(`button`),window.matchMedia(`(display-mode: standalone)`).matches){this.button.remove();return}if(!navigator.install){this.button.remove();return}this.button.addEventListener(`click`,async e=>{await navigator.install()})}};customElements.define(`button-install`,Ar);var jr=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%20fill-rule='evenodd'%20stroke-linejoin='round'%20stroke-miterlimit='2'%20clip-rule='evenodd'%20viewBox='0%200%2064%2064'%3e%3cpath%20fill='%23a4bff7'%20d='M37.774%2011.471c14.639%203.752%2019.034%2016.557%2015.889%2031.304-.696%203.261-2.563%206.661-6.356%208.693-3.204%201.717-8.07%202.537-15.338.55l-9.634-2.404C11.651%2046.992%208.378%2038.733%2010.027%2031.823c3.627-15.201%2015.543-23.48%2027.747-20.352Z'/%3e%3cpath%20fill='%23d8e7fe'%20d='M36.76%2015.429c12.289%203.15%2015.547%2014.114%2012.907%2026.493-.947%204.44-4.937%209.365-16.664%206.143l-9.684-2.417c-7.854-1.923-10.53-7.8-9.318-12.877%203.016-12.639%2012.611-19.943%2022.759-17.342Z'/%3e%3cpath%20fill='%236081e6'%20d='M27.471%2024.991c-1.457-.698-7.229%203.213-7.663%208.926-.182%202.39%204.55%203.237%205.071-.169.725-4.743%203.715-8.218%202.592-8.757Zm10.746%202.005c-2.083.327-.382%205.901-.595%2010.727-.123%202.8%204.388%203.464%204.703%202.011%201.098-5.073-2.066-13.058-4.108-12.738Z'/%3e%3c/svg%3e`,Mr={"zh-CN":`zh-Hans`,"zh-TW":`zh-Hant`,"pt-BR":`pt-BR`};function Nr(){let{i18n:e}=d(),n=g(()=>de.map(n=>{let r=Mr[n]||n.replace(/-[a-z]+$/i,``),i=Bt({code:r,locale:n,fallback:Ce.find(e=>e.code===n)?.nativeName});return{code:n,regionlessCode:r,_common:Bt({code:r,locale:e.locale,fallback:Ce.find(e=>e.code===n)?.name}),native:i}}).sort((n,r)=>{let i=n._common.localeCompare(r._common,e.locale);return i===0?n.code<r.code?-1:+(n.code>r.code):i}),[]);return L(`label`,{class:`lang-selector`,children:[`🌐`,` `,L(`select`,{class:`small`,value:e.locale||`en`,onChange:e=>{F.local.set(`lang`,e.target.value),B(e.target.value)},children:[n.map(({code:n,regionlessCode:r,native:i})=>{let a=Bt({code:r,locale:e.locale,fallback:Ce.find(e=>e.code===n)?.name});return L(`option`,{value:n,"data-regionless-code":r,children:a&&a!==i?`${i} - ${a}`:i},n)}),void 0]})]})}function Pr(e){let{masto:n}=f();return n.v1.push.subscription.create(e)}function Fr(){let{masto:e}=f();return e.v1.push.subscription.fetch()}function Ir(e){let{masto:n}=f();return n.v1.push.subscription.update(e)}function Lr(){let{masto:e}=f();return e.v1.push.subscription.remove()}function Rr(){return`serviceWorker`in navigator&&`PushManager`in window}function zr(){return navigator.serviceWorker.getRegistration()}async function Br(){let e=await zr();return{registration:e,subscription:e?await e.pushManager.getSubscription():void 0}}function Vr(e){let n=`${e}${`=`.repeat((4-e.length%4)%4)}`.replace(/-/g,`+`).replace(/_/g,`/`),r=window.atob(n),i=new Uint8Array(r.length);for(let e=0;e<r.length;++e)i[e]=r.charCodeAt(e);return i}async function Hr(){if(!Rr())return;let{subscription:e}=await Br(),n=null;try{n=await Fr()}catch(e){if(!/(not found|unknown)/i.test(e.message))throw e}if(n&&e){let r=n.endpoint===e.endpoint,i=Se(),a=n.serverKey===i;if(!r)throw Error(`Backend subscription endpoint changed`);if(!a)throw Error(`Backend subscription key and vapid key changed`)}if(e&&!n){let n=Se();if(n){let{applicationServerKey:r}=e.options;if(Vr(n).toString()!==new Uint8Array(r).toString())throw await e.unsubscribe(),Error(`Subscription key and vapid key changed`)}}return{subscription:e,backendSubscription:n}}async function Ur({data:e,policy:n}){if(!Rr())return;let{registration:r,subscription:i}=await Br(),a=null;if(i)try{a=await Ir({data:e,policy:n})}catch{a=await Pr({subscription:i,data:e,policy:n})}else{let o=Se();if(!o)throw Error(`No server key found`);i=await r.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Vr(o)}),a=await Pr({subscription:i,data:e,policy:n})}return{subscription:i,backendSubscription:a}}async function Wr(){if(!Rr())return;let{subscription:e}=await Br();e&&(await Lr(),await e.unsubscribe())}var Gr=16,Kr=[14,15,16,17,18,19,20],qr=Kr[0],Jr=Kr[Kr.length-1],{PHANPY_WEBSITE:Yr,PHANPY_PRIVACY_POLICY_URL:Xr,PHANPY_TRANSLANG_INSTANCES:Zr,PHANPY_IMG_ALT_API_URL:Qr,PHANPY_GIPHY_API_KEY:$r,PHANPY_CLIENT_NAME:ei}={PHANPY_CLIENT_NAME:`Phanpy`,PHANPY_PRIVACY_POLICY_URL:`https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD`,PHANPY_TRANSLANG_INSTANCES:`translang.phanpy.social`},ti=Object.entries($e.tl).map(([e,n])=>({code:e,name:n})),ni=`TransLang API`;function ri({onClose:e}){let{_:n}=d(),r=W(k),a=F.local.get(`theme`)||`auto`,o=s(),c=r.settings.contentTranslationTargetLanguage||null,l=Bt(Ye()),u=F.local.get(`textSize`)||Gr,[p,m]=I(_()),{masto:h,authenticated:g,instance:v}=f(),[y,b]=I(F.local.get(`experiments-tabBarV2`)??!1),x=p[`posting:default:visibility`]===`private`;return L(`div`,{id:`settings-container`,class:`sheet`,tabIndex:`-1`,style:{"--current-text-size":`${u}px`},children:[!!e&&L(`button`,{type:`button`,class:`sheet-close`,onClick:e,children:L(X,{icon:`x`,alt:n({id:`yz7wBu`})})}),L(`header`,{children:L(`h2`,{children:L(j,{id:`Tz0i8g`})})}),L(`main`,{children:[L(`section`,{children:L(`ul`,{children:[L(`li`,{children:[L(`div`,{children:L(`label`,{children:L(j,{id:`aAIQg2`})})}),L(`div`,{children:L(`form`,{ref:o,onInput:e=>{e.preventDefault();let n=new FormData(o.current).get(`theme`),r=document.documentElement;if(n===`auto`){r.classList.remove(`is-light`,`is-dark`);let e=document.querySelector(`meta[data-theme-setting="manual"]`);e&&(e.name=``),document.querySelectorAll(`meta[data-theme-setting="auto"]`).forEach(e=>{e.name=`theme-color`})}else{r.classList.toggle(`is-light`,n===`light`),r.classList.toggle(`is-dark`,n===`dark`);let e=document.querySelector(`meta[data-theme-setting="manual"]`);e&&(e.name=`theme-color`,e.content=n===`light`?e.dataset.themeLightColor:e.dataset.themeDarkColor),document.querySelectorAll(`meta[data-theme-setting="auto"]`).forEach(e=>{e.name=``})}document.querySelector(`meta[name="color-scheme"]`).setAttribute(`content`,n===`auto`?`light dark`:n),n===`auto`?F.local.del(`theme`):F.local.set(`theme`,n)},children:L(`div`,{class:`radio-group`,children:[L(`label`,{children:[L(`input`,{type:`radio`,name:`theme`,value:`light`,defaultChecked:a===`light`}),L(`span`,{children:L(j,{id:`1njn7W`})})]}),L(`label`,{children:[L(`input`,{type:`radio`,name:`theme`,value:`dark`,defaultChecked:a===`dark`}),L(`span`,{children:L(j,{id:`pvnfJD`})})]}),L(`label`,{children:[L(`input`,{type:`radio`,name:`theme`,value:`auto`,defaultChecked:a!==`light`&&a!==`dark`}),L(`span`,{children:L(j,{id:`R9Khdg`})})]})]})})})]}),L(`li`,{children:[L(`div`,{children:L(`label`,{children:L(j,{id:`7r6sCa`})})}),L(ii,{currentTextSize:u})]}),L(`li`,{children:[L(`span`,{children:[L(`label`,{children:L(j,{id:`CeJHfb`})}),` `,L(`small`,{children:L(`a`,{href:`https://crowdin.com/project/phanpy`,target:`_blank`,rel:`noopener`,children:L(j,{id:`FFmj1D`})})})]}),L(Nr,{})]}),L(`li`,{class:`block`,children:L(`label`,{children:[L(`input`,{type:`checkbox`,checked:!r.settings.autoHideBars,onChange:e=>{k.settings.autoHideBars=!e.target.checked}}),` `,L(j,{id:`S8Y1Xb`})]})})]})}),g&&L(i,{children:[L(`h3`,{children:L(j,{id:`PcoS3v`})}),L(`section`,{children:L(`ul`,{children:[L(`li`,{children:[L(`label`,{for:`posting-privacy-field`,children:[L(j,{id:`NAjVvt`}),` `,L(X,{icon:`cloud`,alt:n({id:`N2FcBE`}),class:`synced-icon`})]}),L(`select`,{id:`posting-privacy-field`,value:p[`posting:default:visibility`]||`public`,onChange:e=>{let{value:r}=e.target;(async()=>{try{await h.v1.accounts.updateCredentials({source:{privacy:r}});let e={...p,"posting:default:visibility":r};r===`private`&&(e[`posting:default:quote_policy`]=`nobody`),m(e),M(e),Z(n({id:`4uflEE`}))}catch{alert(n({id:`hFs2qq`}))}})()},children:[L(`option`,{value:`public`,children:L(j,{id:`7d1a0d`})}),L(`option`,{value:`unlisted`,children:L(j,{id:`pPYeIN`})}),L(`option`,{value:`private`,children:L(j,{id:`x5LEuB`})})]})]}),Xe()&&L(`li`,{children:[L(`label`,{for:`posting-quote-policy-field`,children:[L(j,{id:`eKInue`}),` `,L(X,{icon:`cloud`,alt:n({id:`N2FcBE`}),class:`synced-icon`})]}),L(`select`,{id:`posting-quote-policy-field`,value:x?`nobody`:p[`posting:default:quote_policy`]||`public`,disabled:x,onChange:e=>{let{value:r}=e.target;(async()=>{try{await h.v1.accounts.updateCredentials({source:{quote_policy:r}});let e={...p,"posting:default:quote_policy":r};m(e),M(e),Z(n({id:`3P1r1z`}))}catch{alert(n({id:`hEe3YR`}))}})()},children:[L(`option`,{value:`public`,disabled:x,children:L(j,{id:`hDWXuG`})}),L(`option`,{value:`followers`,disabled:x,children:L(j,{id:`9Ko-Xp`})}),L(`option`,{value:`nobody`,children:L(j,{id:`-bAQ3S`})})]})]})]})}),L(`p`,{class:`section-postnote`,children:[L(X,{icon:`cloud`,alt:n({id:`N2FcBE`}),class:`synced-icon`}),` `,L(`small`,{children:L(j,{id:`cR6K65`,values:{instance:v},components:{0:L(`a`,{href:`${location.protocol}//${v}/`,target:`_blank`,rel:`noopener`})}})})]})]}),g&&L(i,{children:[L(`h3`,{children:L(j,{id:`sG7QTC`})}),L(`section`,{children:L(`ul`,{children:[L(`li`,{class:`block`,children:L(`label`,{children:[L(`input`,{type:`checkbox`,checked:r.settings.hideTrendingTimeline,onChange:e=>{k.settings.hideTrendingTimeline=e.target.checked}}),` `,L(j,{id:`jyo0K2`})]})}),L(`li`,{class:`block`,children:L(`label`,{children:[L(`input`,{type:`checkbox`,checked:r.settings.hideLocalTimeline,onChange:e=>{k.settings.hideLocalTimeline=e.target.checked}}),` `,L(j,{id:`1HxK8h`})]})}),L(`li`,{class:`block`,children:L(`label`,{children:[L(`input`,{type:`checkbox`,checked:r.settings.hideFederatedTimeline,onChange:e=>{k.settings.hideFederatedTimeline=e.target.checked}}),` `,L(j,{id:`KI7v-9`})]})})]})})]}),L(`h3`,{children:L(j,{id:`ivdhsq`})}),L(`section`,{children:L(`ul`,{children:[L(`li`,{class:`block`,children:L(`label`,{children:[L(`input`,{type:`checkbox`,checked:r.settings.autoRefresh,onChange:e=>{k.settings.autoRefresh=e.target.checked}}),` `,L(j,{id:`0mC0SF`})]})}),L(`li`,{class:`block`,children:L(`label`,{children:[L(`input`,{type:`checkbox`,checked:r.settings.boostsCarousel,onChange:e=>{k.settings.boostsCarousel=e.target.checked}}),` `,L(j,{id:`TSbnoW`})]})}),!!Zr&&L(`li`,{class:`block`,children:[L(`label`,{children:[L(`input`,{type:`checkbox`,checked:r.settings.contentTranslation,onChange:e=>{let{checked:n}=e.target;k.settings.contentTranslation=n,n||(k.settings.contentTranslationTargetLanguage=null)}}),` `,L(j,{id:`0SdaOt`})]}),L(`div`,{class:`sub-section ${r.settings.contentTranslation?``:`more-insignificant`}`,children:[L(`div`,{children:L(`label`,{children:[L(j,{id:`zXCa9e`}),` `,L(`select`,{value:c||``,disabled:!r.settings.contentTranslation,style:{width:`10em`},onChange:e=>{k.settings.contentTranslationTargetLanguage=e.target.value||null},children:[L(`option`,{value:``,children:L(j,{id:`jNCSyx`,values:{systemTargetLanguageText:l}})}),L(`option`,{disabled:!0,children:`──────────`}),ti.map(e=>{let n=Bt({code:e.code,fallback:e.name}),r=Bt({code:e.code,locale:e.code}),i=r&&n!==r;return L(`option`,{value:e.code,children:i?`${r} - ${n}`:n})})]})]})}),L(`hr`,{}),L(`div`,{class:`checkbox-fieldset`,children:[L(j,{id:`cc0NrU`,values:{0:r.settings.contentTranslationHideLanguages.length}}),L(`div`,{class:`checkbox-fields`,children:ti.map(e=>{let n=Bt({code:e.code,fallback:e.name}),i=Bt({code:e.code,locale:e.code}),a=i&&n!==i;return L(`label`,{children:[L(`input`,{type:`checkbox`,checked:r.settings.contentTranslationHideLanguages.includes(e.code),onChange:n=>{let{checked:i}=n.target;i?k.settings.contentTranslationHideLanguages.push(e.code):k.settings.contentTranslationHideLanguages=r.settings.contentTranslationHideLanguages.filter(n=>n!==e.code)}}),` `,a?L(`span`,{children:[i,` `,L(`span`,{class:`insignificant ib`,children:[`- `,n]})]}):n]})})})]}),L(`p`,{class:`insignificant`,children:L(`small`,{children:L(j,{id:`7I3sDQ`,values:{TRANSLATION_API_NAME:ni},components:{0:L(`a`,{href:`https://github.com/cheeaun/translang-api`,target:`_blank`,rel:`noopener`})}})})}),L(`hr`,{}),L(`div`,{children:[L(`label`,{children:[L(`input`,{type:`checkbox`,checked:r.settings.contentTranslationAutoInline,disabled:!r.settings.contentTranslation,onChange:e=>{k.settings.contentTranslationAutoInline=e.target.checked}}),` `,L(j,{id:`gURvmk`})]}),L(`p`,{class:`insignificant`,children:L(`small`,{children:L(j,{id:`PbHARL`,components:{0:L(`b`,{})}})})})]})]})]}),g&&L(`li`,{class:`block`,children:[L(`label`,{children:[L(`input`,{type:`checkbox`,checked:r.settings.paginatedTimeline,onChange:e=>{k.settings.paginatedTimeline=e.target.checked}}),` `,L(j,{id:`Cf1xHf`})]}),L(`div`,{class:`sub-section insignificant`,children:L(`small`,{children:L(j,{id:`rYXCO0`})})})]}),!!$r&&g&&L(`li`,{class:`block`,children:[L(`label`,{children:[L(`input`,{type:`checkbox`,checked:r.settings.composerGIFPicker,onChange:e=>{k.settings.composerGIFPicker=e.target.checked}}),` `,L(j,{id:`D7_2jB`})]}),L(`div`,{class:`sub-section insignificant`,children:L(`small`,{children:L(j,{id:`_CLBTL`,components:{0:L(`a`,{href:`https://developers.giphy.com/`,target:`_blank`,rel:`noopener`})}})})})]}),!!Qr&&g&&L(`li`,{class:`block`,children:[L(`label`,{children:[L(`input`,{type:`checkbox`,checked:r.settings.mediaAltGenerator,onChange:e=>{k.settings.mediaAltGenerator=e.target.checked}}),` `,L(j,{id:`9q5uor`}),` `,L(X,{icon:`sparkles2`,class:`more-insignificant`})]}),L(`div`,{class:`sub-section insignificant`,children:L(`small`,{children:L(j,{id:`faZ9RI`})})}),L(`div`,{class:`sub-section insignificant`,children:L(`small`,{children:L(j,{id:`fHZgvt`,components:{0:L(`a`,{href:`https://github.com/cheeaun/img-alt-api`,target:`_blank`,rel:`noopener`})}})})})]}),g&&L(`li`,{class:`block`,children:[L(`label`,{children:[L(`input`,{type:`checkbox`,checked:r.settings.shortcutSettingsCloudImportExport,onChange:e=>{k.settings.shortcutSettingsCloudImportExport=e.target.checked}}),` `,L(j,{id:`570qTm`}),` `,L(X,{icon:`cloud`,class:`more-insignificant`})]}),L(`div`,{class:`sub-section insignificant`,children:L(`small`,{children:L(j,{id:`0tZAhT`,components:{0:L(`br`,{})}})})}),L(`div`,{class:`sub-section insignificant`,children:L(`small`,{children:L(j,{id:`Iq3FHt`})})})]}),L(`li`,{class:`block`,children:[L(`label`,{children:[L(`input`,{type:`checkbox`,checked:r.settings.cloakMode,onChange:e=>{k.settings.cloakMode=e.target.checked}}),` `,L(j,{id:`lxYe-I`,components:{0:L(`span`,{class:`insignificant`}),1:L(`samp`,{}),2:L(`samp`,{})}})]}),L(`div`,{class:`sub-section insignificant`,children:L(`small`,{children:L(j,{id:`T_hglb`})})})]}),g&&L(`li`,{children:L(`button`,{type:`button`,class:`light`,onClick:()=>{k.showDrafts=!0,k.showSettings=!1},children:L(j,{id:`krk5ws`})})}),L(`li`,{children:L(Q,{to:`/yip`,onClick:e,class:`button light`,children:`Year in Posts`})}),L(`li`,{children:L(`button-install`,{children:L(`button`,{type:`button`,class:`light`,children:L(j,{id:`vOsY-K`,values:{CLIENT_NAME:ei}})})})})]})}),g&&L(ai,{onClose:e}),L(`h3`,{children:L(j,{id:`uyJsf6`})}),L(`section`,{children:[L(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:8,lineHeight:1.25,alignItems:`center`,marginTop:8},children:[L(`img`,{src:jr,alt:``,width:`64`,height:`64`,style:{aspectRatio:`1/1`,verticalAlign:`middle`,background:`#b7cdf9`,borderRadius:12}}),L(`div`,{children:[L(`b`,{children:`Phanpy`}),` `,L(`a`,{href:`https://hachyderm.io/@phanpy`,rel:`noopener`,onClick:e=>{e.preventDefault(),k.showAccount=`phanpy@hachyderm.io`},children:`@phanpy`}),L(`br`,{}),L(j,{id:`AZ2EoP`,components:{0:L(`a`,{href:`https://github.com/cheeaun/phanpy`,target:`_blank`,rel:`noopener`}),1:L(`a`,{href:`https://mastodon.social/@cheeaun`,rel:`noopener`,onClick:e=>{e.preventDefault(),k.showAccount=`cheeaun@mastodon.social`}})}})]})]}),L(`p`,{children:[L(`a`,{href:`https://github.com/sponsors/cheeaun`,target:`_blank`,rel:`noopener`,children:L(j,{id:`O4cLCR`})}),` `,`·`,` `,L(`a`,{href:`https://www.buymeacoffee.com/cheeaun`,target:`_blank`,rel:`noopener`,children:L(j,{id:`Ng063n`})}),` `,`·`,` `,L(`a`,{href:`https://patreon.com/cheeaun`,target:`_blank`,rel:`noopener`,children:`Patreon`}),` `,`·`,` `,L(`a`,{href:`https://github.com/cheeaun/phanpy/blob/main/CHANGELOG.md`,target:`_blank`,rel:`noopener`,children:L(j,{id:`3ePd3I`})}),` `,`·`,` `,L(`a`,{href:Xr,target:`_blank`,rel:`noopener`,children:L(j,{id:`LcET2C`})})]}),L(`p`,{children:[Yr&&L(i,{children:[L(j,{id:`pFnMHn`,values:{0:Yr.replace(/https?:\/\//g,``).replace(/\/$/,``)},components:{0:L(`span`,{class:`insignificant`})}}),L(`br`,{})]}),L(j,{id:`6KkH-2`,values:{0:L(`span`,{class:`ib insignificant`,children:[`(`,L(`a`,{href:`https://github.com/cheeaun/phanpy/commit/05dcc55`,target:`_blank`,rel:`noopener`,children:L(Wt,{datetime:new Date(`2026-06-23T13:27:31.176Z`)})}),`)`]})},components:{0:L(`span`,{class:`insignificant`}),1:L(`input`,{type:`text`,class:`version-string`,readOnly:!0,size:`18`,value:`${`2026-06-23`.replace(/-/g,`.`)}.05dcc55`,onClick:e=>{e.target.select();try{navigator.clipboard.writeText(e.target.value),Z(n({id:`PiPfua`}))}catch{Z(n({id:`gdxreD`}))}}})}})]})]}),void 0]})]})}function ii({currentTextSize:e}){let n=s(null),[r,i]=I(e),[a]=pt(r,1e3);return y(()=>{document.documentElement.style.setProperty(`--text-size`,`${a}px`),a===Gr?F.local.del(`textSize`):F.local.set(`textSize`,a)},[a]),L(`div`,{class:`text-size-control ${r===a?``:`loading`}`,children:[L(`button`,{type:`button`,style:{fontSize:qr},class:`small light ${r===Gr?`default-size`:``}`,disabled:r===qr,onClick:()=>{i(Math.max(qr,r-1))},children:L(j,{id:`J6ypuD`})}),` `,L(`input`,{ref:n,type:`range`,min:qr,max:Jr,step:`1`,value:r,list:`sizes`,onChange:e=>{i(parseInt(e.target.value,10))}}),` `,L(`button`,{type:`button`,style:{fontSize:Jr},class:`small light ${r===Gr?`default-size`:``}`,disabled:r===Jr,onClick:()=>{i(Math.min(Jr,r+1))},children:L(j,{id:`J6ypuD`})}),L(`datalist`,{id:`sizes`,children:Kr.map(e=>L(`option`,{value:e}))})]})}function ai({onClose:e}){let{_:n}=d();if(!Rr())return null;let{instance:r}=f(),[i,a]=I(`default`),o=s(),[c,l]=I(!1),[u,p]=I(!1),m=s();y(()=>{(async()=>{a(`loading`);try{let{subscription:e,backendSubscription:n}=await Hr();if(n?.policy&&n.policy!==`none`){l(!0);let{alerts:e,policy:r}=n;m.current=r;let{elements:i}=o.current,a=i.namedItem(`policy`);a&&(a.value=r),Object.entries(e).forEach(([e,n])=>{let r=i.namedItem(e);r?.type===`checkbox`&&(r.checked=!!n)})}a(`default`)}catch(e){/outside.*authorized/i.test(e.message)?p(!0):alert(e?.message||e),a(`error`)}})()},[]);let h=i===`loading`;return L(`form`,{ref:o,onChange:()=>{setTimeout(()=>{let e=Object.fromEntries(new FormData(o.current)),r=!!e[`policy-allow`],i={data:{policy:e.policy,alerts:{mention:!!e.mention,favourite:!!e.favourite,reblog:!!e.reblog,follow:!!e.follow,follow_request:!!e.followRequest,poll:!!e.poll,update:!!e.update,status:!!e.status}}},a=0;Object.keys(i.data.alerts).forEach(e=>{i.data.alerts[e]?a++:delete i.data.alerts[e]});let s=m.current!==i.data.policy;r&&a>0?s?Wr().then(()=>{Ur(i)}).catch(e=>{alert(n({id:`I6pdY3`}))}):Ur(i).catch(e=>{alert(n({id:`I6pdY3`}))}):Wr().catch(e=>{alert(n({id:`q1zFd-`}))})},100)},children:[L(`h3`,{children:L(j,{id:`WUHLnz`})}),L(`section`,{children:L(`ul`,{children:L(`li`,{children:[L(`label`,{children:[L(`input`,{type:`checkbox`,disabled:h||u,name:`policy-allow`,checked:c,onChange:async e=>{let{checked:r}=e.target;if(r){let e=await Notification.requestPermission();e===`granted`?l(!0):(l(!1),e===`denied`&&alert(n({id:`6LUsk7`})))}else l(!1)}}),` `,L(j,{id:`qYNCa1`,values:{0:[{value:`all`,label:n({id:`-niKJH`})},{value:`followed`,label:n({id:`x2NYtp`})},{value:`follower`,label:n({id:`PBFNgg`})}].map(e=>L(`option`,{value:e.value,children:e.label}))},components:{0:L(`select`,{name:`policy`,disabled:h||u||!c})}})]}),L(`div`,{class:`shazam-container no-animation`,style:{width:`100%`},hidden:!c,children:L(`div`,{class:`shazam-container-inner`,children:L(`div`,{class:`sub-section`,children:L(`ul`,{children:[{value:`mention`,label:n({id:`_bZzdR`})},{value:`favourite`,label:n({id:`zZOZj7`})},{value:`reblog`,label:n({id:`puY2t0`})},{value:`follow`,label:n({id:`aaJhcT`})},{value:`followRequest`,label:n({id:`6Fs1Ba`})},{value:`poll`,label:n({id:`wNExRS`})},{value:`update`,label:n({id:`K_EtE6`})},{value:`status`,label:n({id:`2yr1_p`})}].map(e=>L(`li`,{children:L(`label`,{children:[L(`input`,{type:`checkbox`,name:e.value}),` `,e.label]})}))})})})}),u&&L(`div`,{class:`sub-section`,children:L(`p`,{children:L(j,{id:`8d0b8B`,components:{0:L(Q,{to:`/login?instance=${r}`,onClick:e}),1:L(`b`,{})}})})})]})})}),L(`p`,{class:`section-postnote`,children:L(`small`,{children:L(j,{id:`z96cOX`,components:{0:L(`b`,{})}})})})]})}var oi=()=>{let e=setTimeout(()=>{let e=document.getElementById(`columns`);if(e){let n=e.querySelector(`.deck-container.focus`);if(n)n.focus();else{let n=Array.from(e.querySelectorAll(`.deck-container`)).find(e=>e.getBoundingClientRect().left>=0);n?n.focus():e.querySelector(`.deck-container`)?.focus?.()}}else{let e=document.querySelectorAll(`#modal-container > *`);if(e?.length){let n=e[e.length-1],r=n.querySelector(`[tabindex="-1"]`)||n;if(r){r.focus();return}}if(document.querySelector(`.deck-backdrop`))return;let n=document.querySelectorAll(`.deck-container`),r=n[n.length-1];r&&r.tabIndex===-1&&r.focus()}},100);return()=>clearTimeout(e)};function si(e){if(!e)return;let n=ie(),r=s(n.pathname);y(()=>{r.current&&n.pathname!==r.current&&e?.()},[n.pathname,e])}function ci({acct:e,instance:n}){let[r,i]=e.split(`@`);return i||=n,L(`div`,{class:`handle-info`,children:[L(`span`,{class:`handle-handle`,title:T.toASCII(e),children:[L(`b`,{class:`handle-username`,children:r}),L(`span`,{class:`handle-at`,children:`@`}),L(`b`,{class:`handle-server`,children:i})]}),L(`div`,{class:`handle-legend`,children:[L(`span`,{class:`ib`,children:[L(`span`,{class:`handle-legend-icon username`}),` `,L(j,{id:`silO9A`})]}),` `,L(`span`,{class:`ib`,children:[L(`span`,{class:`handle-legend-icon server`}),` `,L(j,{id:`rZgCpJ`})]})]})]})}var li=typeof Intl?.Segmenter==`function`?new Intl.Segmenter:null,ui=class extends HTMLElement{#e;#t;#n;connectedCallback(){setTimeout(()=>{if(!this.isConnected)return;let e=this.querySelector(`input, textarea`);if(!e)return;let n=e.getAttribute(`maxlength`);if(!n)return;let r=parseInt(n,10);if(isNaN(r))return;e.removeAttribute(`maxlength`),this.setAttribute(`maxlength`,n),this.#e=e,this.#n=r,this.#t=()=>this.#r(),e.addEventListener(`input`,this.#t);let i=e.value,a;a=li?[...li.segment(i)].length:[...i].length,this.setAttribute(`current-length`,a)},0)}#r(){let e=this.#e,n=this.#n,r=e.value,i,a;if(li){let e=[...li.segment(r)];a=e.length,e.length>n&&(i=e.slice(0,n).map(e=>e.segment).join(``),a=n)}else{let e=[...r];a=e.length,e.length>n&&(i=e.slice(0,n).join(``),a=n)}this.setAttribute(`current-length`,a),i!==void 0&&(e.value=i,e.dispatchEvent(new Event(`input`,{bubbles:!0,cancelable:!0,composed:!0})))}disconnectedCallback(){this.#e&&this.#e.removeEventListener(`input`,this.#t)}};customElements.define(`grapheme-input`,ui);var di=0;function fi(){return++di}var pi=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`].join(`,`);function mi({defaultName:e,defaultValue:n,disabled:r,index:i,nameMaxLength:a=255,valueMaxLength:o=255,onDelete:s,onMoveUp:c,onMoveDown:l,canMoveUp:u,canMoveDown:f}){let{_:p}=d();return L(`tr`,{children:[L(`td`,{children:L(`grapheme-input`,{children:L(`input`,{type:`text`,name:`fields_attributes[${i}][name]`,defaultValue:e,disabled:r,maxLength:a,required:!0,dir:`auto`,enterKeyHint:`next`})})}),L(`td`,{children:L(`grapheme-input`,{children:L(`input`,{type:`text`,name:`fields_attributes[${i}][value]`,defaultValue:n,disabled:r,maxLength:o,required:!0,dir:`auto`,enterKeyHint:`done`})})}),L(`td`,{style:{width:36},children:L(Gt,{align:`end`,menuButton:L(`button`,{type:`button`,class:`plain4 small more-button`,disabled:r,children:L(X,{icon:`more`,size:`l`,alt:p({id:`2FYpfJ`})})}),children:[L(Y,{disabled:!u,onClick:c,children:[L(X,{icon:`arrow-up`}),` `,L(`span`,{children:L(j,{id:`QyioBP`})})]}),L(Y,{disabled:!f,onClick:l,children:[L(X,{icon:`arrow-down`}),` `,L(`span`,{children:L(j,{id:`3Ib6FN`})})]}),L(qe,{}),e.trim()===``&&n.trim()===``?L(Y,{menuItemClassName:`danger`,onClick:s,children:[L(X,{icon:`trash`}),` `,L(`span`,{children:L(j,{id:`Jb6_SB`})})]}):L(xt,{subMenu:!0,menuItemClassName:`danger`,confirmLabel:L(j,{id:`QfD1qq`}),onClick:s,children:[L(X,{icon:`trash`,size:`s`}),` `,L(`span`,{children:L(j,{id:`Jb6_SB`})})]})]})})]})}function hi({onClose:e=()=>{}}){let{_:n}=d(),{masto:r}=f(),[a,o]=I(`start`),[s,c]=I(null),[l,u]=I(null),[m,h]=I(null),[g,_]=I(null),[v,b]=I([]),x=!!l,{accounts:{maxDisplayNameLength:S,maxNoteLength:C,maxProfileFields:w,profileFieldNameLimit:T,profileFieldValueLimit:E,maxAvatarDescriptionLength:ee,maxHeaderDescriptionLength:D}={}}=De()||{};y(()=>{(async()=>{try{if(p()?.mastodon>=9)try{let e=await r.v1.profile.fetch();u(e),b((e?.fields||[]).map(e=>({...e,_key:fi()}))),o(`default`);return}catch{}let e=await r.v1.accounts.verifyCredentials();c(e),b((e?.source?.fields||[]).map(e=>({...e,_key:fi()}))),o(`default`)}catch{o(`error`)}})()},[]);let{note:O}=(l??s?.source)||{},{avatarDescription:A=``,headerDescription:M=``,displayName:N=``,avatar:P=``,header:te=``}=(l??s)||{},F=[...P?[{type:`image`,url:P}]:[],...g?[{type:`image`,url:g}]:[]],ne=[...te?[{type:`image`,url:te}]:[],...m?[{type:`image`,url:m}]:[]];return y(()=>()=>{m&&URL.revokeObjectURL(m),g&&URL.revokeObjectURL(g)},[m,g]),L(`div`,{class:`sheet`,id:`edit-profile-container`,children:[!!e&&L(`button`,{type:`button`,class:`sheet-close`,onClick:e,children:L(X,{icon:`x`,alt:n({id:`yz7wBu`})})}),L(`header`,{children:L(`h2`,{children:[L(j,{id:`9OpVZg`}),` `,L(q,{hidden:a!==`loading`})]})}),L(`main`,{children:a===`start`?L(`p`,{class:`ui-state`,children:L(q,{abrupt:!0})}):L(`form`,{onSubmit:i=>{i.preventDefault();let a=new FormData(i.target),s=a.get(`header`),c=a.get(`avatar`),l=a.get(`display_name`),u=a.get(`note`);if(x){let e=a.get(`avatar_description`),r=a.get(`header_description`),i=(!!P||!!g)&&!e?.trim(),o=(!!te||!!m)&&!r?.trim();if(i&&o){if(!confirm(n({id:`zckhCq`})))return}else if(i){if(!confirm(n({id:`fvc_zp`})))return}else if(o&&!confirm(n({id:`QPtB2n`})))return}let d=w||4,f=[];for(let e=0;e<d;e++){let n=a.get(`fields_attributes[${e}][name]`)?.trim(),r=a.get(`fields_attributes[${e}][value]`)?.trim();n&&r&&f.push({name:n,value:r})}(async()=>{o(`loading`);try{let n;if(x){let e=a.get(`avatar_description`),n=a.get(`header_description`),i={};f.forEach((e,n)=>{i[n]=e});let o={displayName:l,note:u,fieldsAttributes:i};e&&(o.avatarDescription=e),n&&(o.headerDescription=n),c?.size&&(o.avatar=c),s?.size&&(o.header=s),await r.v1.profile.update(o)}else n=await r.v1.accounts.updateCredentials({header:s,avatar:c,displayName:l,note:u,fieldsAttributes:f});o(`default`),e?.({state:`success`,account:n})}catch(e){o(`error`),alert(e?.message||n({id:`FwMMx0`})),o(`default`)}})()},onReset:()=>{m&&(URL.revokeObjectURL(m),h(null)),g&&(URL.revokeObjectURL(g),_(null))},children:[L(`fieldset`,{class:`edit-profile-media-container`,children:[L(`legend`,{children:L(j,{id:`C5zXYJ`})}),L(`input`,{type:`file`,name:`header`,accept:pi,onChange:e=>{let n=e.target.files[0];n&&(m&&URL.revokeObjectURL(m),h(URL.createObjectURL(n)))}}),L(`div`,{class:`edit-profile-media-field`,children:[te?L(`div`,{class:`edit-media`,tabIndex:`0`,onClick:()=>{k.showMediaModal={mediaAttachments:ne,mediaIndex:0}},children:L(`img`,{src:te,alt:M||``})}):L(`div`,{class:`edit-media`}),m&&L(i,{children:[L(X,{icon:`arrow-right`}),L(`div`,{class:`edit-media`,tabIndex:`0`,onClick:()=>{k.showMediaModal={mediaAttachments:ne,mediaIndex:1}},children:L(`img`,{src:m,alt:``})})]})]}),x&&(!!te||!!m)&&L(`p`,{children:L(`label`,{children:[L(j,{id:`Lh8B0N`}),` `,L(`grapheme-input`,{children:L(`textarea`,{name:`header_description`,defaultValue:M,disabled:a===`loading`,maxLength:D||150,rows:`2`,dir:`auto`})})]})}),x&&!!te&&L(`div`,{class:`footer`,children:[L(`div`,{class:`spacer`}),L(xt,{confirmLabel:L(j,{id:`p7M2tI`}),menuItemClassName:`danger`,align:`end`,disabled:a===`loading`,onClick:async()=>{if(l){o(`loading`);try{await r.v1.profile.header.remove(),r.v1.profile.update({headerDescription:``}).catch(()=>{}),o(`default`),e?.({state:`success`})}catch{o(`error`),Z(n({id:`551IUY`})),o(`default`)}}},children:L(`button`,{type:`button`,class:`light danger`,disabled:a===`loading`,children:L(j,{id:`MWIaew`})})})]})]}),L(`fieldset`,{class:`edit-profile-media-container`,children:[L(`legend`,{children:L(j,{id:`4XF0BB`})}),L(`input`,{type:`file`,name:`avatar`,accept:pi,onChange:e=>{let n=e.target.files[0];n&&(g&&URL.revokeObjectURL(g),_(URL.createObjectURL(n)))}}),L(`div`,{class:`edit-profile-media-field`,children:[P?L(`div`,{class:`edit-media`,tabIndex:`0`,onClick:()=>{k.showMediaModal={mediaAttachments:F,mediaIndex:0}},children:L(`img`,{src:P,alt:A||``})}):L(`div`,{class:`edit-media`}),g&&L(i,{children:[L(X,{icon:`arrow-right`}),L(`div`,{class:`edit-media`,tabIndex:`0`,onClick:()=>{k.showMediaModal={mediaAttachments:F,mediaIndex:1}},children:L(`img`,{src:g,alt:``})})]})]}),x&&(!!P||!!g)&&L(`p`,{children:L(`label`,{children:[L(j,{id:`Lh8B0N`}),` `,L(`grapheme-input`,{children:L(`textarea`,{name:`avatar_description`,defaultValue:A,disabled:a===`loading`,maxLength:ee||150,rows:`2`,dir:`auto`})})]})}),x&&!!P&&L(`div`,{class:`footer`,children:[L(`div`,{class:`spacer`}),L(xt,{confirmLabel:L(j,{id:`jsXSTc`}),menuItemClassName:`danger`,align:`end`,disabled:a===`loading`,onClick:async()=>{if(l){o(`loading`);try{await r.v1.profile.avatar.remove(),r.v1.profile.update({avatarDescription:``}).catch(()=>{}),o(`default`),e?.({state:`success`})}catch{o(`error`),Z(n({id:`eJ6Y9F`})),o(`default`)}}},children:L(`button`,{type:`button`,class:`light danger`,disabled:a===`loading`,children:L(j,{id:`MWIaew`})})})]})]}),L(`fieldset`,{children:[L(`p`,{children:L(`label`,{children:[L(j,{id:`6YtxFj`}),` `,L(`grapheme-input`,{children:L(`input`,{type:`text`,name:`display_name`,defaultValue:N,maxLength:S||30,disabled:a===`loading`,dir:`auto`,enterKeyHint:`done`})})]})}),L(`p`,{children:L(`label`,{children:[L(j,{id:`E-oKCO`}),L(`grapheme-input`,{children:L(`textarea`,{defaultValue:O,name:`note`,maxLength:C||500,rows:`5`,disabled:a===`loading`,dir:`auto`})})]})})]}),L(`fieldset`,{children:[L(`legend`,{children:L(j,{id:`oPwQt4`})}),L(`table`,{children:[L(`thead`,{children:L(`tr`,{children:[L(`th`,{children:L(j,{id:`87a_t_`})}),L(`th`,{children:L(j,{id:`4b3oEV`})}),L(`th`,{})]})}),L(`tbody`,{children:v.map((e,n)=>{let{name:r=``,value:i=``}=e;return L(mi,{defaultName:r,defaultValue:i,index:n,disabled:a===`loading`,nameMaxLength:T||255,valueMaxLength:E||255,onDelete:()=>{b(v.filter((e,r)=>r!==n))},onMoveUp:()=>{if(n>0){let e=[...v];[e[n-1],e[n]]=[e[n],e[n-1]],b(e)}},onMoveDown:()=>{if(n<v.length-1){let e=[...v];[e[n],e[n+1]]=[e[n+1],e[n]],b(e)}},canMoveUp:n>0,canMoveDown:n<v.length-1},e._key)})})]}),v.length<(w||4)&&L(`p`,{children:L(`button`,{type:`button`,class:`light`,disabled:a===`loading`,onClick:()=>{b([...v,{name:``,value:``,_key:fi()}])},children:L(j,{id:`Va3xJe`})})})]}),L(`footer`,{children:[L(`button`,{type:`button`,class:`light`,disabled:a===`loading`,onClick:()=>{e?.()},children:L(j,{id:`dEgA5A`})}),L(`button`,{type:`submit`,disabled:a===`loading`,children:L(j,{id:`tfDRzk`})})]})]})})]})}function gi({accountId:e,instance:n}){let{masto:r}=f({instance:n}),[i,a]=I(``),[o,s]=I(!1),[c,l]=I(!1);return L(`form`,{class:`email-subscription-form`,onSubmit:async n=>{if(n.preventDefault(),i){l(!0);try{await r.v1.accounts.$select(e).emailSubscriptions.create({email:i}),Z(`Check your inbox`),a(``)}catch{Z(`Unable to subscribe`)}finally{l(!1)}}},children:[L(`input`,{type:`email`,required:!0,value:i,onInput:e=>{a(e.target.value),s(e.target.validity.valid)},disabled:c}),L(`button`,{type:`submit`,disabled:c||!o,children:`Subscribe`})]})}var _i=80;function vi({accountID:e,info:n,open:r=!1,onlyOpenIfHasEndorsements:i=!1}){let{masto:a}=f(),o=s(),[c,l]=I(`default`),[u,d]=I([]),[p,m]=I({});return y(()=>{ot(`@mastodon/endorsements`)&&r&&(async()=>{l(`loading`);try{let n=await a.v1.accounts.$select(e).endorsements.list({limit:_i});if(!n.length){l(`default`);return}d(n),l(`default`),setTimeout(()=>{o.current.scrollIntoView({behavior:`smooth`,block:`nearest`})},300);let r=await tt(n,p);r&&m(r)}catch{l(`error`)}})()},[r,e]),(i?r&&u.length>0:r)?L(`div`,{class:`shazam-container`,children:L(`div`,{class:`shazam-container-inner`,children:L(`div`,{class:`endorsements-container`,ref:o,children:[L(`h3`,{children:L(j,{id:`UIfdY1`,values:{0:n.username}})}),c===`loading`?L(`p`,{class:`ui-state`,children:L(q,{abrupt:!0})}):u.length>0?L(`ul`,{class:`endorsements ${u.length>10?`expanded`:``}`,children:u.map(e=>L(`li`,{children:L(rt,{account:e,showStats:!0,avatarSize:`xxl`,relationship:p[e.id]},e.id)}))}):L(`p`,{class:`ui-state insignificant`,children:L(j,{id:`AgkUZa`})})]})})}):null}function yi(){return p()?.mastodon>=10}async function bi(e){let{masto:n}=f({instance:e});return!!(await n.v2.search.list({q:`from:me`,type:`statuses`,limit:1}))?.statuses?.length}var xi=a(bi),Si=1e3*60,Ci=1440*60*1e3,wi=a(async()=>{let{masto:e}=f(),n=await e.v1.lists.list();return n.sort((e,n)=>e.title.localeCompare(n.title)),n.length&&setTimeout(()=>{F.account.set(`lists`,{lists:n,updatedAt:Date.now()})},1),n},{expires:Si});async function Ti(){try{let{lists:e,updatedAt:n}=F.account.get(`lists`)||{};return e?.length?(Date.now()-n>Ci&&wi(),e):await wi()}catch{return[]}}var Ei=a(e=>{let{masto:n}=f();return n.v1.lists.$select(e).fetch()},{expires:Si});async function Di(e){let{lists:n}=F.account.get(`lists`)||{};if(n?.length){let r=n.find(n=>n.id===e);if(r)return r}try{return Ei(e)}catch{return null}}async function Oi(e){return(await Di(e))?.title||``}function ki(e){let{lists:n}=F.account.get(`lists`)||{};n?.length&&(n.push(e),n.sort((e,n)=>e.title.localeCompare(n.title)),F.account.set(`lists`,{lists:n,updatedAt:Date.now()}))}function Ai(e){let{lists:n}=F.account.get(`lists`)||{};if(n?.length){let r=n.findIndex(n=>n.id===e.id);r!==-1&&(n[r]=e,n.sort((e,n)=>e.title.localeCompare(n.title)),F.account.set(`lists`,{lists:n,updatedAt:Date.now()}))}}function ji(e){let{lists:n}=F.account.get(`lists`)||{};if(n?.length){let r=n.findIndex(n=>n.id===e);r!==-1&&(n.splice(r,1),F.account.set(`lists`,{lists:n,updatedAt:Date.now()}))}}function Mi({insignificant:e}){let{_:n}=d();return L(X,{icon:`filter`,size:`xs`,class:`list-exclusive-badge ${e?`insignificant`:``}`,title:n({id:`FNptcJ`})})}function Ni({list:e,onClose:n}){let{_:r}=d(),{masto:i}=f(),[a,o]=I(`default`),c=!!e,l=s(),u=s(),p=s();y(()=>{c&&(l.current.value=e.title,u.current.value=e.repliesPolicy,p.current&&(p.current.checked=e.exclusive))},[c]);let m=ot(`@mastodon/list-exclusive`)||ot(`@gotosocial/list-exclusive`);return L(`div`,{class:`sheet`,children:[!!n&&L(`button`,{type:`button`,class:`sheet-close`,onClick:n,children:L(X,{icon:`x`,alt:r({id:`yz7wBu`})})}),` `,L(`header`,{children:L(`h2`,{children:r(c?{id:`tuhghE`}:{id:`Sb2gYF`})})}),L(`main`,{children:L(`form`,{class:`list-form`,onSubmit:a=>{a.preventDefault();let s=new FormData(a.target),l=s.get(`title`),u=s.get(`replies_policy`),d=s.get(`exclusive`)===`on`;o(`loading`),(async()=>{try{let r;r=c?await i.v1.lists.$select(e.id).update({title:l,replies_policy:u,exclusive:d}):await i.v1.lists.create({title:l,replies_policy:u,exclusive:d}),o(`default`),n?.({state:`success`,list:r}),setTimeout(()=>{c?Ai(r):ki(r)},1)}catch{o(`error`),alert(r(c?{id:`R7ep1i`}:{id:`KPoj8w`}))}})()},children:[L(`div`,{class:`list-form-row`,children:L(`label`,{for:`list-title`,children:[L(j,{id:`6YtxFj`}),` `,L(`input`,{ref:l,type:`text`,id:`list-title`,name:`title`,required:!0,disabled:a===`loading`,dir:`auto`})]})}),L(`div`,{class:`list-form-row`,children:L(`select`,{ref:u,name:`replies_policy`,required:!0,disabled:a===`loading`,children:[L(`option`,{value:`list`,children:L(j,{id:`ei6pnR`})}),L(`option`,{value:`followed`,children:L(j,{id:`Mr53YX`})}),L(`option`,{value:`none`,children:L(j,{id:`PM7llw`})})]})}),m&&L(`div`,{class:`list-form-row`,children:L(`label`,{class:`label-block`,children:[L(`input`,{ref:p,type:`checkbox`,name:`exclusive`,disabled:a===`loading`}),` `,L(Mi,{insignificant:!0}),` `,L(j,{id:`jxxYp0`})]})}),L(`div`,{class:`list-form-footer`,children:[L(`button`,{type:`submit`,disabled:a===`loading`,children:r(c?{id:`tfDRzk`}:{id:`hYgDIe`})}),c&&L(xt,{disabled:a===`loading`,align:`end`,menuItemClassName:`danger`,confirmLabel:r({id:`-kQ_cY`}),onClick:()=>{o(`loading`),(async()=>{try{await i.v1.lists.$select(e.id).remove(),o(`default`),n?.({state:`deleted`}),setTimeout(()=>{ji(e.id)},1)}catch{o(`error`),alert(r({id:`tqUaGL`}))}})()},children:L(`button`,{type:`button`,class:`light danger`,disabled:a===`loading`,children:L(j,{id:`Jb6_SB`})})})]})]})})]})}function Pi({accountID:e,onClose:n}){let{_:r}=d(),{masto:i}=f(),[a,o]=I(`default`),[s,c]=I([]),[l,u]=I([]),[p,h]=m(e=>e+1,0);y(()=>{o(`loading`),(async()=>{try{c(await Ti()),u(await i.v1.accounts.$select(e).lists.list()),o(`default`)}catch{o(`error`)}})()},[p]);let[g,_]=I(!1);return L(`div`,{class:`sheet`,id:`list-add-remove-container`,children:[!!n&&L(`button`,{type:`button`,class:`sheet-close`,onClick:n,children:L(X,{icon:`x`,alt:r({id:`yz7wBu`})})}),L(`header`,{children:L(`h2`,{children:L(j,{id:`sJ2yQc`})})}),L(`main`,{children:[s.length>0?L(`ul`,{class:`list-add-remove`,children:s.map(n=>{let s=l.some(e=>e.id===n.id);return L(`li`,{children:L(`button`,{type:`button`,class:`light ${s?`checked`:``}`,disabled:a===`loading`,onClick:()=>{o(`loading`),(async()=>{try{s?await i.v1.lists.$select(n.id).accounts.remove({accountIds:[e]}):await i.v1.lists.$select(n.id).accounts.create({accountIds:[e]}),h()}catch{o(`error`),alert(r(s?{id:`7KnEYa`}:{id:`Tba8uO`}))}})()},children:[L(X,{icon:`check-circle`,alt:`☑️`}),L(`span`,{children:n.title})]})})})}):a===`loading`?L(`p`,{class:`ui-state`,children:L(q,{abrupt:!0})}):a===`error`?L(`p`,{class:`ui-state`,children:L(j,{id:`v_l5uA`})}):L(`p`,{class:`ui-state`,children:L(j,{id:`_MJ7gZ`})}),L(`button`,{type:`button`,class:`plain2`,onClick:()=>_(!0),disabled:a!=="default",children:[L(X,{icon:`plus`,size:`l`}),` `,L(`span`,{children:L(j,{id:`Sb2gYF`})})]})]}),g&&L(Ot,{onClick:e=>{e.target===e.currentTarget&&_(!1)},children:L(Ni,{list:g?.list,onClose:e=>{e.state===`success`&&h(),_(!1)}})})]})}function Fi({account:e,note:n,onRelationshipChange:r=()=>{},onClose:i=()=>{}}){let{_:a}=d(),{masto:o}=f(),[c,l]=I(`default`),u=s(null);return y(()=>{let e;return u.current&&!n&&(e=setTimeout(()=>{u.current.focus?.()},100)),()=>{clearTimeout(e)}},[]),L(`div`,{class:`sheet`,id:`private-note-container`,children:[!!i&&L(`button`,{type:`button`,class:`sheet-close`,onClick:i,children:L(X,{icon:`x`,alt:a({id:`yz7wBu`})})}),L(`header`,{children:[L(`b`,{children:L(j,{id:`1DBGsz`})}),` `,L(`small`,{class:`insignificant`,children:L(j,{id:`XHVHK2`})})]}),L(`main`,{children:L(`form`,{onSubmit:s=>{s.preventDefault();let c=new FormData(s.target).get(`note`);c?.trim()!==n?.trim()&&(l(`loading`),(async()=>{try{let n=await o.v1.accounts.$select(e?.id).note.create({comment:c});l(`default`),r(n),i()}catch(e){l(`error`),alert(e?.message||a({id:`ot8LpF`}))}})())},children:[L(`textarea`,{ref:u,name:`note`,disabled:c===`loading`,dir:`auto`,children:n}),L(`footer`,{children:[L(`button`,{type:`button`,class:`light`,disabled:c===`loading`,onClick:()=>{i?.()},children:L(j,{id:`dEgA5A`})}),L(`span`,{children:[L(q,{abrupt:!0,hidden:c!==`loading`}),L(`button`,{disabled:c===`loading`,type:`submit`,children:L(j,{id:`SrwrEj`})})]})]})]})})]})}function Ii({note:e,fields:n,onClose:r}){let{_:i}=d(),a=n?.map(({name:e,value:n})=>`${e}\n${zt(n)}`).join(`
|
|
3
|
+
|
|
4
|
+
`)||``,o=zt(e)+(a?`\n\n${a}`:``);return L(`div`,{class:`sheet`,children:[!!r&&L(`button`,{type:`button`,class:`sheet-close`,onClick:r,children:L(X,{icon:`x`,alt:i({id:`yz7wBu`})})}),L(`header`,{children:L(`h2`,{children:L(j,{id:`9groMz`})})}),L(`main`,{children:[L(`p`,{style:{whiteSpace:`pre-wrap`},children:o}),L(We,{forceTranslate:!0,text:o})]})]})}var Li=[300,1800,3600,3600*6,3600*24,3600*24*3,3600*24*7,3600*24*30,0],Ri={0:{id:`9ZP9cc`},300:kt(5,`minute`),1800:kt(30,`minute`),3600:kt(1,`hour`),21600:kt(6,`hour`),86400:kt(1,`day`),259200:kt(3,`day`),604800:kt(1,`week`),2592e3:kt(30,`day`)};function zi({info:e,instance:n,standalone:r,authenticated:a,onRelationshipChange:o=()=>{},setShowEditProfile:c=()=>{},showEndorsements:l=!1,renderEndorsements:u=!1,setRenderEndorsements:p=()=>{}}){if(!e)return null;let{_:m,_:h}=d(),{masto:g,instance:_,authenticated:v}=f(),b=n===_,[x,S]=I(`default`),[C,w]=I(null),{id:T,acct:E,url:D,username:O,locked:A,lastStatusAt:M,note:N,fields:P,moved:te}=e,F=s(T),{following:ne,showingReblogs:R,notifying:z,followedBy:B,blocking:V,blockedBy:re,muting:ie,mutingNotifications:ae,requested:H,domainBlocking:U,endorsed:W,note:oe}=C||{},[se,ce]=I(null),[le,G]=I(!1),ue=E.includes(`@`)?E:`${E}@${n}`,K=ot(`@mastodon/endorsements`),de=yi();y(()=>{if(e){let r=ee(),i;(async()=>{if(b&&a)i=T;else if(!b&&v){S(`loading`);let r=e.acct.includes(`@`);try{let a=await g.v2.search.list({q:r?e.acct:`${e.username}@${n}`,type:`accounts`,limit:1,resolve:!0});a.accounts.length&&(i=a.accounts[0].id,ce(a.accounts[0]))}catch{}}if(!i){S(`default`);return}if(r===i){G(!0),S(`default`);return}F.current=i,S(`loading`);let s=g.v1.accounts.relationships.fetch({id:[i]});try{let e=await s;if(S(`default`),e.length){let n=e[0];w(n),o({relationship:n,currentID:i})}}catch{S(`error`)}})()}},[e,a]),y(()=>{e&&le&&fe(e)},[e,le]);let pe=x===`loading`,[me,he]=I(!1),[ge,_e]=I(!1),[ve,ye]=I(!1),[be,xe]=I([]),[Se,Ce]=I(!1);y(()=>{v&&(async()=>{Ce(await xi(_))})()},[_,v]);let{headerStatic:we,avatarStatic:Te}=e;return(!we||/missing\.png$/.test(we))&&Te&&!/missing\.png$/.test(Te)&&(we=Te),L(i,{children:[L(`div`,{class:`actions`,children:[L(`span`,{children:[B?L(`span`,{class:`tag`,children:L(j,{id:`p3UO_y`})}):M?L(`small`,{class:`insignificant`,children:L(j,{id:`F3cM1G`,values:{0:Jt(M,{hideTime:!0})},components:{0:L(`span`,{class:`ib`})}})}):L(`span`,{}),ie&&L(`span`,{class:`tag danger`,children:L(j,{id:`-IJm1Z`})}),V&&L(`span`,{class:`tag danger`,children:L(j,{id:`32TndD`})})]}),` `,L(`span`,{class:`buttons`,children:[!!oe&&L(`button`,{type:`button`,class:`private-note-tag`,title:h({id:`1DBGsz`}),onClick:()=>{ye(!0)},dir:`auto`,children:L(`span`,{children:oe})}),L(Gt,{portal:{target:document.body},containerProps:{style:{zIndex:1001}},align:`center`,position:`anchor`,overflow:`auto`,menuButton:L(`button`,{type:`button`,class:`plain4`,disabled:pe,children:L(X,{icon:`more2`,size:`l`,alt:h({id:`2FYpfJ`})})}),onMenuChange:e=>{ne&&e.open&&(async()=>{try{xe(await g.v1.accounts.$select(F.current).lists.list())}catch{}})()},children:[v&&!le?L(i,{children:[L(Y,{onClick:()=>{Nt({draftStatus:{status:`@${se?.acct||E} `}})},children:[L(X,{icon:`at`}),L(`span`,{children:L(j,{id:`3LkfZu`,values:{username:O},components:{0:L(`span`,{class:`bidi-isolate`})}})})]}),Se&&L(Y,{onClick:()=>{k.showSearchCommand={query:`from:${E} `}},children:[L(X,{icon:`search`}),L(`span`,{children:L(j,{id:`LCX3ys`,values:{username:O},components:{0:L(`span`,{class:`bidi-isolate`})}})})]}),L(Y,{onClick:()=>{he(!0)},children:[L(X,{icon:`translate`}),L(`span`,{children:L(j,{id:`R8mSiS`})})]}),ot(`@mastodon/profile-private-note`)&&L(Y,{onClick:()=>{ye(!0)},children:[L(X,{icon:`note`}),L(`span`,{children:h(oe?{id:`-kQy_G`}:{id:`GquPwe`})})]}),ne&&!!C&&L(i,{children:[L(Y,{onClick:()=>{S(`loading`),(async()=>{try{let e=await g.v1.accounts.$select(F.current).follow({notify:!z});e&&w(e),S(`default`),Z(e.notifying?h({id:`jL3N0G`,values:{username:O}}):h({id:`0h4_9h`,values:{username:O}}))}catch(e){alert(e),S(`error`)}})()},children:[L(X,{icon:`notification`}),L(`span`,{children:h(z?{id:`osJmEN`}:{id:`I92Z-b`})})]}),L(Y,{onClick:()=>{S(`loading`),(async()=>{try{let e=await g.v1.accounts.$select(F.current).follow({reblogs:!R});e&&w(e),S(`default`),Z(e.showingReblogs?h({id:`0X2KC8`,values:{username:O}}):h({id:`cXWjH0`,values:{username:O}}))}catch(e){alert(e),S(`error`)}})()},children:[L(X,{icon:`rocket`}),L(`span`,{children:h(R?{id:`GRUr8d`}:{id:`uREpT3`})})]})]}),K&&ne&&L(Y,{onClick:()=>{S(`loading`),(async()=>{try{W?(w(await g.v1.accounts.$select(se?.id||T).unpin()),S(`default`),Z(h({id:`pWFLFk`,values:{username:O}}))):(w(await g.v1.accounts.$select(se?.id||T).pin()),S(`default`),Z(h({id:`xhiXaF`,values:{username:O}})))}catch{S(`error`),Z(h(W?{id:`xHq5L2`,values:{username:O}}:{id:`Owr_5-`,values:{username:O}}))}})()},children:[L(X,{icon:`endorsement`}),h(W?{id:`S9JvjK`}:{id:`UlJ3QN`})]}),l&&K&&!u&&L(Y,{onClick:()=>p(!0),children:[L(X,{icon:`endorsement`}),L(`span`,{children:L(j,{id:`Qopbnd`})})]}),de&&L(Mt,{to:`/${n||_}/a/${se?.id||T}/c`,children:[L(X,{icon:`collections`}),L(j,{id:`ucJFhB`})]}),ne&&L(Y,{onClick:()=>{_e(!0)},children:[L(X,{icon:`list`}),be.length?L(i,{children:[L(`small`,{class:`menu-grow`,children:[L(j,{id:`sJ2yQc`}),L(`br`,{}),L(`span`,{class:`more-insignificant`,children:be.map(e=>e.title).join(`, `)})]}),L(`small`,{class:`more-insignificant`,children:be.length})]}):L(`span`,{children:L(j,{id:`sJ2yQc`})})]}),L(qe,{})]}):L(i,{children:[Se&&le&&L(Y,{onClick:()=>{k.showSearchCommand={query:`from:me `}},children:[L(X,{icon:`search`}),L(`span`,{children:L(j,{id:`BmW9JG`})})]}),K&&!u&&L(i,{children:L(Y,{onClick:()=>p(!0),children:[L(X,{icon:`endorsement`}),L(j,{id:`Qopbnd`})]})}),de&&L(Mt,{to:`/${n||_}/a/${se?.id||T}/c`,children:[L(X,{icon:`collections`}),L(j,{id:`ucJFhB`})]}),(Se&&le||K&&!u)&&L(qe,{})]}),L(Y,{onClick:()=>{let e=`@${se?.acct||ue}`;try{navigator.clipboard.writeText(e),Z(h({id:`zJoEwS`}))}catch{Z(h({id:`BC0lSD`}))}},children:[L(X,{icon:`copy`}),L(`small`,{children:[L(j,{id:`27x6gl`}),L(`br`,{}),L(`span`,{class:`more-insignificant bidi-isolate`,children:[`@`,se?.acct||ue]})]})]}),L(Y,{href:D,target:`_blank`,children:[L(X,{icon:`external`}),L(`small`,{class:`menu-double-lines`,children:Bi(D)})]}),L(`div`,{class:`menu-horizontal`,children:[L(Y,{onClick:()=>{try{navigator.clipboard.writeText(D),Z(h({id:`edWbV6`}))}catch{Z(h({id:`W1ewR0`}))}},children:[L(X,{icon:`link`}),L(`span`,{children:L(j,{id:`he3ygx`})})]}),navigator?.share&&navigator?.canShare?.({url:D})&&L(Y,{onClick:()=>{try{navigator.share({url:D})}catch{alert(h({id:`TtG3Uh`}))}},children:[L(X,{icon:`share`}),L(`span`,{children:L(j,{id:`LFKLqp`})})]})]}),L(Y,{onClick:()=>{k.showQrCodeModal={text:D,arena:Te,backgroundMask:we,caption:E.includes(`@`)?E:`${E}@${n}`,onScannerClick:Ki}},children:[L(X,{icon:`qrcode`}),L(`span`,{children:L(j,{id:`gCX4Z9`})})]}),!!C&&L(i,{children:[L(qe,{}),ie?L(Y,{onClick:()=>{S(`loading`),(async()=>{try{w(await g.v1.accounts.$select(se?.id||T).unmute()),S(`default`),Z(h({id:`B4Xkly`,values:{username:O}})),k.reloadGenericAccounts.id=`mute`,k.reloadGenericAccounts.counter++}catch{S(`error`)}})()},children:[L(X,{icon:`unmute`}),L(`span`,{children:L(j,{id:`Q_HUhC`,values:{username:O},components:{0:L(`span`,{class:`bidi-isolate`})}})})]}):L(Lt,{menuClassName:`menu-blur`,openTrigger:`clickOnly`,direction:`bottom`,overflow:`auto`,shift:16,label:L(i,{children:[L(X,{icon:`mute`}),L(`span`,{class:`menu-grow`,children:L(j,{id:`xhPEH3`,values:{username:O},components:{0:L(`span`,{class:`bidi-isolate`})}})}),L(`span`,{style:{textOverflow:`clip`},children:[L(X,{icon:`time`}),L(X,{icon:`chevron-right`})]})]}),children:L(`div`,{class:`menu-wrap`,children:Li.map(e=>L(Y,{onClick:()=>{S(`loading`),(async()=>{try{w(await g.v1.accounts.$select(se?.id||T).mute({duration:e})),S(`default`),Z(h({id:`_plB9m`,values:{0:typeof Ri[e]==`function`?Ri[e]():m(Ri[e]),username:O}})),k.reloadGenericAccounts.id=`mute`,k.reloadGenericAccounts.counter++}catch{S(`error`),Z(h({id:`vWGBjT`,values:{username:O}}))}})()},children:typeof Ri[e]==`function`?Ri[e]():m(Ri[e])}))})}),B&&L(xt,{subMenu:!0,menuItemClassName:`danger`,confirmLabel:L(i,{children:[L(X,{icon:`user-x`}),L(`span`,{children:L(j,{id:`unyq2W`,values:{username:O},components:{0:L(`span`,{class:`bidi-isolate`})}})})]}),onClick:()=>{S(`loading`),(async()=>{try{w(await g.v1.accounts.$select(se?.id||T).removeFromFollowers()),S(`default`),Z(h({id:`AgkcM_`,values:{username:O}})),k.reloadGenericAccounts.id=`followers`,k.reloadGenericAccounts.counter++}catch{S(`error`)}})()},children:[L(X,{icon:`user-x`}),L(`span`,{children:L(j,{id:`VCZ0OT`})})]}),L(xt,{subMenu:!0,confirm:!V,confirmLabel:L(i,{children:[L(X,{icon:`block`}),L(`span`,{children:L(j,{id:`aforS9`,values:{username:O},components:{0:L(`span`,{class:`bidi-isolate`})}})})]}),itemProps:{className:`danger`},menuItemClassName:`danger`,onClick:()=>{S(`loading`),(async()=>{try{V?(w(await g.v1.accounts.$select(se?.id||T).unblock()),S(`default`),Z(h({id:`sI9N29`,values:{username:O}}))):(w(await g.v1.accounts.$select(se?.id||T).block()),S(`default`),Z(h({id:`uYcYzu`,values:{username:O}}))),k.reloadGenericAccounts.id=`block`,k.reloadGenericAccounts.counter++}catch{S(`error`),Z(h(V?{id:`0tG4wG`,values:{username:O}}:{id:`pA-qEx`,values:{username:O}}))}})()},children:V?L(i,{children:[L(X,{icon:`unblock`}),L(`span`,{children:L(j,{id:`_3LJfX`,values:{username:O},components:{0:L(`span`,{class:`bidi-isolate`})}})})]}):L(i,{children:[L(X,{icon:`block`}),L(`span`,{children:L(j,{id:`JRswkR`,values:{username:O},components:{0:L(`span`,{class:`bidi-isolate`})}})})]})}),L(Y,{className:`danger`,onClick:()=>{k.showReportModal={account:se||e}},children:[L(X,{icon:`flag`}),L(`span`,{children:L(j,{id:`qTJgpR`,values:{username:O},components:{0:L(`span`,{class:`bidi-isolate`})}})})]})]}),!1]}),v&&le&&L(`button`,{type:`button`,class:`plain`,onClick:()=>{k.showQrCodeModal={text:D,arena:Te,backgroundMask:we,caption:E.includes(`@`)?E:`${E}@${n}`,onScannerClick:Ki}},children:L(X,{icon:`qrcode`,alt:h({id:`gCX4Z9`})})}),!C&&x===`loading`&&L(q,{abrupt:!0}),v&&le&&r?L(`button`,{type:`button`,class:`light`,onClick:()=>{c(!0)},children:L(j,{id:`9OpVZg`})}):!le&&!!C&&!te&&L(xt,{confirm:ne||H,confirmLabel:L(`span`,{children:h(H?{id:`e7qQIH`}:{id:`eYsAQr`,values:{0:e.acct||e.username}})}),menuItemClassName:`danger`,align:`end`,disabled:pe,onClick:()=>{S(`loading`),(async()=>{try{let e;e=ne||H?await g.v1.accounts.$select(F.current).unfollow():await g.v1.accounts.$select(F.current).follow(),e&&(w(e),l&&K&&!u&&e.following&&p(`onlyOpenIfHasEndorsements`)),S(`default`)}catch(e){alert(e),S(`error`)}})()},children:L(`button`,{type:`button`,class:`${ne||H?`light swap`:``}`,"data-swap-state":ne||H?`danger`:``,disabled:pe,children:ne?L(i,{children:[L(`span`,{children:L(j,{id:`y6sq5j`})}),L(`span`,{children:L(j,{id:`HKrBPX`})})]}):H?L(i,{children:[L(`span`,{children:L(j,{id:`Yx0Ud8`})}),L(`span`,{children:L(j,{id:`yTVtKs`})})]}):A?L(i,{children:[L(X,{icon:`lock`}),` `,L(`span`,{children:L(j,{id:`MKEPCY`})})]}):h({id:`MKEPCY`})})})]})]}),!!me&&L(Ot,{onClose:()=>{he(!1)},children:L(Ii,{note:N,fields:P,onClose:()=>he(!1)})}),!!ge&&L(Ot,{onClose:()=>{_e(!1)},children:L(Pi,{accountID:F.current,onClose:()=>_e(!1)})}),!!ve&&L(Ot,{onClose:()=>{ye(!1)},children:L(Fi,{account:e,note:oe,onRelationshipChange:e=>{w(e)},onClose:()=>ye(!1)})})]})}function Bi(e){if(!e)return;let n=URL.parse(e);if(!n)return;let{host:r,pathname:a}=n,o=a.replace(/\/$/,``).replace(/^\//,``);return L(i,{children:[L(`span`,{class:`more-insignificant`,children:[T.toUnicode(r),`/`]}),L(`wbr`,{}),L(`span`,{children:o})]})}var Vi=80,Hi=1e3*60*10;async function Ui(e,n){let{value:r}=await n.v1.accounts.$select(e).statuses.list({limit:20}).values().next(),i={total:r.length,originals:0,replies:0,boosts:0,quotes:0};return r.forEach(e=>{e.reblog?i.boosts++:e.inReplyToId&&e.inReplyToAccountId!==e.account.id?i.replies++:Xe()&&(e.quote?.id||e.quote?.quotedStatus?.id)?i.quotes++:i.originals++}),r.length&&(i.daysSinceLastPost=Math.ceil((Date.now()-Date.parse(r[r.length-1].createdAt))/864e5)),i}var Wi=a(Ui,{expires:Hi}),Gi=e=>{try{return new URL(e),!0}catch{return!1}},Ki=()=>{k.showQrScannerModal={checkValidity:Gi,actionableText:{id:`73lp8c`},onClose:({text:e}={})=>{e&&(Pe(),location.hash=`/${e}`)}}};function qi({account:e,fetchAccount:n=()=>{},standalone:r,instance:a,authenticated:o,showEndorsements:c=!1}){let{i18n:l,_:p}=d(),{masto:h,authenticated:_}=f({instance:a}),{instance:b}=f(),[S,C]=I(`default`),w=typeof e==`string`,[T,E]=I(w?null:e),[D,O]=m(e=>e+1,0),A=g(()=>a===b,[a,b]);y(()=>{if(!w){E(e);return}C(`loading`),(async()=>{try{let e=await n();k.accounts[`${e.id}@${a}`]=e,E(e),C(`default`)}catch{E(null),C(`error`)}})()},[w,e,n,D]);let{acct:M,avatar:N,avatarStatic:P,avatarDescription:te,bot:F,createdAt:ne,displayName:R,emojis:z,fields:B,followersCount:V,followingCount:re,group:ie,headerDescription:ae,id:H,lastStatusAt:U,locked:W,note:oe,statusesCount:se,url:ce,username:le,memorial:ue,moved:K,roles:de,hideCollections:fe}=T||{},pe=!1,{header:me,headerStatic:he}=T||{};(!me||/missing\.png$/.test(me))&&N&&!/missing\.png$/.test(N)&&(me=N,pe=!0,P&&!/missing\.png$/.test(P)&&(he=P));let ge=g(()=>H===ee(),[H]);y(()=>{let e=!!(T?.id&&T?.username&&T?.acct&&T?.avatar&&T?.avatarStatic&&T?.displayName&&T?.url);if(ge&&a&&e){let e=v(),n=!1;e.forEach(e=>{e.info.id===T.id&&e.instanceURL===a&&(e.info=T,n=!0)}),n&&_e(e)}},[ge,T,a]),u(ce);let[ve,ye]=I([]),be=s(),xe=s([]);async function Se(e){(e||!be.current)&&(be.current=h.v1.accounts.$select(H).followers.list({limit:Vi}).values());let n=await be.current.next();if(ge||!A)return n;let{value:r}=n,i=[];if(e){let e=[];try{e=await h.v1.accounts.familiarFollowers.fetch({id:[H]})}catch{}xe.current=e?.[0]?.accounts||[],i=[...xe.current,...r.filter(e=>!xe.current.some(n=>n.id===e.id))]}else r?.length&&(i=r.filter(e=>!xe.current.some(n=>n.id===e.id)));return{...n,value:i}}let Ce=s();async function we(e){return(e||!Ce.current)&&(Ce.current=h.v1.accounts.$select(H).following.list({limit:Vi}).values()),await Ce.current.next()}let Te=r?`div`:Q,Ee=a?`/${a}/a/${H}`:`/a/${H}`,[De,q]=I([]),[J,Oe]=I(),[ke,Ae]=I(`default`),je=!!J?.total,Me=async e=>{try{q((await et(e))[0]?.accounts?.slice(0,Ji)||[])}catch{}},Ne=async()=>{if(H){Ae(`loading`);try{Oe(await Wi(H,h)),Ae(`default`)}catch{Ae(`error`)}}},Pe=x(({relationship:e,currentID:n})=>{e.following||(Me(n),!r&&se>0&&Ne())},[r,H,se]),Fe=x(e=>{e.id===H&&(E(e),k.accounts[`${e.id}@${a}`]=e)},[H,a]),Ie=w&&e&&/^https?:\/\//.test(e),[Le,Re]=I(!1),[ze,Be]=I(!1);return L(i,{children:[L(`div`,{tabIndex:`-1`,class:`account-container ${S===`loading`?`skeleton`:``}`,style:{"--header-color-1":ve[0],"--header-color-2":ve[1],"--header-color-3":ve[2],"--header-color-4":ve[3]},children:[S===`error`&&L(`div`,{class:`ui-state`,children:[L(`p`,{children:L(j,{id:`44hICK`})}),w?L(`p`,{children:Ie?L(`a`,{href:e,target:`_blank`,rel:`noopener`,children:e}):L(`code`,{class:`insignificant`,children:e})}):L(`p`,{children:L(`a`,{href:ce,target:`_blank`,rel:`noopener`,children:[L(j,{id:`Aadw0-`}),` `,L(X,{icon:`external`})]})}),w&&L(`button`,{type:`button`,onClick:O,children:L(j,{id:`KDw4GX`})})]}),S===`loading`?L(i,{children:[L(`header`,{children:L(rt,{avatarSize:`xxxl`,skeleton:!0})}),L(`main`,{children:[L(`div`,{class:`note`,children:[L(`p`,{children:`███████ ████ ████`}),L(`p`,{children:`████ ████████ ██████ █████████ ████ ██`})]}),L(`div`,{class:`account-metadata-box`,children:[L(`div`,{class:`profile-metadata`,children:[L(`div`,{class:`profile-field`,children:[L(`b`,{class:`more-insignificant`,children:`███`}),L(`p`,{children:`██████`})]}),L(`div`,{class:`profile-field`,children:[L(`b`,{class:`more-insignificant`,children:`████`}),L(`p`,{children:`███████████`})]})]}),L(`div`,{class:`stats`,children:[L(`div`,{children:[L(`span`,{children:`██`}),` ██████`]}),L(`div`,{children:[L(`span`,{children:`██`}),` ██████`]}),L(`div`,{children:[L(`span`,{children:`██`}),` █████`]})]})]}),L(`div`,{class:`actions`,children:[L(`span`,{}),L(`span`,{class:`buttons`,children:L(`button`,{type:`button`,class:`plain4`,disabled:!0,children:L(X,{icon:`more2`,size:`l`})})})]})]})]}):T&&L(i,{children:[!!K&&L(`div`,{class:`account-moved`,children:[L(`p`,{children:L(j,{id:`C6cVP_`,values:{displayName:R},components:{0:L(`b`,{})}})}),L(rt,{account:K,instance:a,onClick:e=>{e.stopPropagation(),k.showAccount=K}})]}),!!me&&!/missing\.png$/.test(me)&&L(`img`,{src:me,alt:ae||``,class:`header-banner ${pe?`header-is-avatar`:``}`,onError:e=>{e.target.crossOrigin?e.target.src===he?(e.target.removeAttribute(`crossorigin`),e.target.src=me):e.target.src=he:e.target.src===he?e.target.remove():e.target.src=he},crossOrigin:`anonymous`,onLoad:e=>{e.target.classList.add(`loaded`);let{width:n,height:r}=e.target;e.target.style.setProperty(`--anim-duration`,`${Math.min(Math.max(Math.max(n,r)/25,10),120)}s`);try{let i=window.OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement(`canvas`),a=i.getContext(`2d`,{willReadFrequently:!0});i.width=n,i.height=r,a.imageSmoothingEnabled=!1,a.drawImage(e.target,0,0),ye([a.getImageData(0,0,10,10).data,a.getImageData(e.target.width-10,0,10,10).data,a.getImageData(0,e.target.height-10,10,10).data,a.getImageData(e.target.width-10,e.target.height-10,10,10).data].map(e=>{let n=0,r=0,i=0,a=0;for(let o=0;o<e.length;o+=4)n+=e[o],r+=e[o+1],i+=e[o+2],a+=e[o+3];let o=e.length/4;return[n/o,r/o,i/o,a/o]}).map(e=>{let[n,r,i,a]=Yi(e);return`rgba(${n}, ${r}, ${i}, ${a})`}))}catch{}}}),L(`header`,{children:r?L(Gt,{shift:window.matchMedia(`(min-width: calc(40em))`).matches?114:64,menuButton:L(`div`,{children:L(rt,{account:T,instance:a,avatarSize:`xxxl`,avatarDescription:te,onClick:()=>{}})}),children:[L(`div`,{class:`szh-menu__header`,children:L(ci,{acct:M,instance:a})}),L(Y,{onClick:()=>{let e=M.includes(`@`)?`@${M}`:`@${M}@${a}`;try{navigator.clipboard.writeText(e),Z(p({id:`zJoEwS`}))}catch{Z(p({id:`BC0lSD`}))}},children:[L(X,{icon:`link`}),L(`span`,{children:L(j,{id:`27x6gl`})})]}),L(Y,{onClick:()=>{k.showQrCodeModal={text:ce,arena:P,backgroundMask:he,caption:M.includes(`@`)?M:`${M}@${a}`,onScannerClick:Ki}},children:[L(X,{icon:`qrcode`}),L(`span`,{children:L(j,{id:`gCX4Z9`})})]}),L(Y,{href:ce,target:`_blank`,children:[L(X,{icon:`external`}),L(`span`,{children:L(j,{id:`Bz5hLl`})})]}),L(qe,{}),L(Y,{onClick:()=>{k.showMediaModal={mediaAttachments:[{type:`image`,url:P,description:te}]}},children:[L(X,{icon:`user`}),L(`span`,{children:L(j,{id:`7WYl2I`})})]}),!!he&&!pe&&L(Y,{onClick:()=>{k.showMediaModal={mediaAttachments:[{type:`image`,url:he,description:ae}]}},children:[L(X,{icon:`media`}),L(`span`,{children:L(j,{id:`ZNme5R`})})]}),_&&ge&&ot(`@mastodon/profile-edit`)&&L(i,{children:[L(qe,{}),L(Y,{onClick:()=>{Re(!0)},children:[L(X,{icon:`pencil`}),L(`span`,{children:L(j,{id:`9OpVZg`})})]})]})]}):L(rt,{account:T,instance:a,avatarSize:`xxxl`,internal:!0})}),L(`div`,{class:`faux-header-bg`,"aria-hidden":`true`}),L(`main`,{children:[!!ue&&L(`span`,{class:`tag`,children:L(j,{id:`prdIOK`})}),!!F&&L(`span`,{class:`tag`,children:[L(X,{icon:`bot`}),` `,L(j,{id:`9Vdq-j`})]}),!!ie&&L(`span`,{class:`tag`,children:[L(X,{icon:`group`}),` `,L(j,{id:`L8fEEm`})]}),L(`div`,{class:`note`,dir:`auto`,onClick:Ze({instance:b}),dangerouslySetInnerHTML:{__html:ct(oe,{emojis:z})}}),L(`div`,{class:`account-metadata-box`,children:[B?.length>0&&L(`div`,{class:`profile-metadata`,children:B.map(({name:e,value:n,verifiedAt:r},i)=>L(`div`,{class:`profile-field ${r?`profile-verified`:``}`,dir:`auto`,children:[L(`b`,{children:[L(st,{text:e,emojis:z}),` `,!!r&&L(X,{icon:`check-circle`,size:`s`,alt:p({id:`QDEWii`})})]}),L(`p`,{dangerouslySetInnerHTML:{__html:ct(n,{emojis:z})}})]},e+i))}),L(`div`,{class:`stats`,children:[L(Te,{tabIndex:0,to:Ee,onClick:()=>{setTimeout(()=>{k.showGenericAccounts={id:`followers`,heading:p({id:`x5LEuB`}),fetchAccounts:Se,instance:a,excludeRelationshipAttrs:ge?[`followedBy`]:[],blankCopy:fe?p({id:`BRV_wh`}):void 0}},0)},children:[!!De.length&&L(`span`,{class:`shazam-container-horizontal`,children:L(`span`,{class:`shazam-container-inner stats-avatars-bunch`,children:De.map(e=>L(Ht,{url:e.avatarStatic,size:`s`,alt:`${e.displayName} @${e.acct}`,squircle:e?.bot}))})}),L(j,{id:`TbttfX`,values:{0:Je(V),1:Je(V),followersCount:V},components:{0:L(`span`,{title:V}),1:L(`span`,{title:V})}})]}),L(Te,{class:`insignificant`,tabIndex:0,to:Ee,onClick:()=>{setTimeout(()=>{k.showGenericAccounts={heading:p({id:`following.stats`}),fetchAccounts:we,instance:a,excludeRelationshipAttrs:ge?[`following`]:[],blankCopy:fe?p({id:`BRV_wh`}):void 0}},0)},children:[L(j,{id:`SGcIK-`,values:{0:Je(re),followingCount:re},components:{0:L(`span`,{title:re})}}),L(`br`,{})]}),L(Te,{class:`insignificant`,to:Ee,children:L(j,{id:`C4x3-X`,values:{0:Je(se),1:Je(se),statusesCount:se},components:{0:L(`span`,{title:se}),1:L(`span`,{title:se})}})}),!!ne&&L(`div`,{class:`insignificant`,children:L(j,{id:`PCcEFZ`,values:{0:Jt(ne,{hideTime:!0})},components:{0:L(`time`,{datetime:ne})}})})]})]}),!!J&&L(Te,{to:Ee,class:`account-metadata-box`,onClick:void 0,children:L(`div`,{class:`shazam-container`,children:L(`div`,{class:`shazam-container-inner`,children:je?L(`div`,{class:`posting-stats`,title:Xe()?p({id:`CKHUZ2`,values:{0:(J.originals/J.total).toLocaleString(l.locale||void 0,{style:`percent`}),1:(J.replies/J.total).toLocaleString(l.locale||void 0,{style:`percent`}),2:(J.quotes/J.total).toLocaleString(l.locale||void 0,{style:`percent`}),3:(J.boosts/J.total).toLocaleString(l.locale||void 0,{style:`percent`})}}):p({id:`wiuWLe`,values:{0:(J.originals/J.total).toLocaleString(l.locale||void 0,{style:`percent`}),1:(J.replies/J.total).toLocaleString(l.locale||void 0,{style:`percent`}),2:(J.boosts/J.total).toLocaleString(l.locale||void 0,{style:`percent`})}}),children:[L(`div`,{children:J.daysSinceLastPost<365?G._({id:`oZUtTk`,values:{0:J.total,1:J.daysSinceLastPost,2:J.daysSinceLastPost,3:J.daysSinceLastPost,4:J.total,5:J.total,6:J.daysSinceLastPost}}):G._({id:`JvA7Mo`,values:{0:J.total,1:J.total}})}),L(`div`,{class:`posting-stats-bar`,children:[J.originals>0&&L(`div`,{class:`posting-stats-bar-section posting-stats-bar-originals`,style:{"--percentage":`${J.originals/J.total*100}%`}}),J.replies>0&&L(`div`,{class:`posting-stats-bar-section posting-stats-bar-replies`,style:{"--percentage":`${J.replies/J.total*100}%`}}),J.quotes>0&&L(`div`,{class:`posting-stats-bar-section posting-stats-bar-quotes`,style:{"--percentage":`${J.quotes/J.total*100}%`}}),J.boosts>0&&L(`div`,{class:`posting-stats-bar-section posting-stats-bar-boosts`,style:{"--percentage":`${J.boosts/J.total*100}%`}})]}),L(`div`,{class:`posting-stats-legends`,children:[L(`span`,{class:`ib`,children:[L(`span`,{class:`posting-stats-legend-item posting-stats-bar-originals`}),` `,L(j,{id:`HxF6Fk`})]}),` `,L(`span`,{class:`ib`,children:[L(`span`,{class:`posting-stats-legend-item posting-stats-bar-replies`}),` `,L(j,{id:`N8UzTV`})]}),` `,Xe()&&L(`span`,{class:`ib`,children:[L(`span`,{class:`posting-stats-legend-item posting-stats-bar-quotes`}),` `,L(j,{id:`eWLklq`})]}),L(`span`,{class:`ib`,children:[L(`span`,{class:`posting-stats-legend-item posting-stats-bar-boosts`}),` `,L(j,{id:`puY2t0`})]})]})]}):L(`div`,{class:`posting-stats`,children:L(j,{id:`vl3XTJ`})})})})}),!K&&L(`div`,{class:`account-metadata-box`,children:L(`div`,{class:`shazam-container no-animation`,hidden:!!J,children:L(`div`,{class:`shazam-container-inner`,children:L(`button`,{type:`button`,class:`posting-stats-button`,disabled:ke===`loading`,onClick:()=>{Ne()},children:[L(`div`,{class:`posting-stats-icon ${ke===`loading`?`loading`:``}`}),L(j,{id:`PjP87f`}),` `]})})})})]}),L(`footer`,{children:L(zi,{info:T,instance:a,standalone:r,authenticated:o,onRelationshipChange:Pe,onProfileUpdate:Fe,setShowEditProfile:Re,showEndorsements:c,renderEndorsements:ze,setRenderEndorsements:Be})}),L(vi,{accountID:H,info:T,open:ze,onlyOpenIfHasEndorsements:ze===`onlyOpenIfHasEndorsements`})]})]}),!K&&T?.emailSubscriptions===!0&&!ge&&L(gi,{accountId:H,instance:a}),!!Le&&L(Ot,{onClose:()=>{Re(!1)},children:L(hi,{onClose:({state:e,account:n}={})=>{Re(!1),e===`success`&&(n?Fe(n):(async()=>{try{Fe(await h.v1.accounts.verifyCredentials())}catch{}})())}})})]})}var Ji=3;function Yi([e,n,r]){let i=.2126*e+.7152*n+.0722*r,a;return a=i>=220?1:i<=50?.1:i/255,a=Math.min(1,a),[e,n,r,a]}function Xi({account:e,instance:n,onClose:r}){let{_:i}=d(),{masto:a,instance:o,authenticated:s}=f({instance:n}),c=typeof e==`string`;return y(()=>{c||(k.accounts[`${e.id}@${o}`]=e)},[e]),si(r),L(`div`,{class:`sheet`,children:[!!r&&L(`button`,{type:`button`,class:`sheet-close outer`,onClick:r,children:L(X,{icon:`x`,alt:i({id:`yz7wBu`})})}),L(qi,{instance:o,authenticated:s,account:e,fetchAccount:async()=>{if(c)try{return await a.v1.accounts.lookup({acct:e,skip_webfinger:!1})}catch{let n=await a.v2.search.list({q:e,type:`accounts`,limit:s?1:11,resolve:s});if(n.accounts.length){let r=n.accounts.find(n=>n.url===e||e.startsWith(n.url));if(r)return r}if(/^https?:\/\/[^/]+\/@[^/]+$/.test(e)){let n=URL.parse(e);if(n){let{hostname:e,pathname:r}=n,i=r.replace(/^\//,``).replace(/\/$/,``)+`@`+e,o=await a.v2.search.list({q:i,type:`accounts`,limit:1,resolve:s});if(o.accounts.length)return o.accounts[0]}}}else return e}})]})}function Zi({onClose:e}){let{_:n}=d(),{masto:a}=f(),[o,s]=I(`default`),[c,l]=I([]),[u,p]=m(e=>e+1,0);y(()=>{s(`loading`),(async()=>{try{let e=await Ke.drafts.keys();if(e.length){let n=r(),i=e.filter(e=>e.startsWith(n));if(i.length){let e=await Ke.drafts.getMany(i);e.sort((e,n)=>Date.parse(n.updatedAt)-Date.parse(e.updatedAt)),l(e)}else l([])}else l([]);s(`default`)}catch{s(`error`)}})()},[u]);let h=c?.length>0;return L(`div`,{class:`sheet`,children:[!!e&&L(`button`,{type:`button`,class:`sheet-close`,onClick:e,children:L(X,{icon:`x`,alt:n({id:`yz7wBu`})})}),L(`header`,{children:[L(`h2`,{children:[L(j,{id:`krk5ws`}),` `,L(q,{abrupt:!0,hidden:o!==`loading`})]}),h&&L(`div`,{class:`insignificant`,children:L(j,{id:`Ap_10-`})})]}),L(`main`,{children:h?L(i,{children:[L(`ul`,{class:`drafts-list`,children:c.map(e=>{let{updatedAt:r,key:c,draftStatus:l,replyTo:u,quote:d}=e,f=new Date(r);return L(`li`,{children:[L(`div`,{class:`mini-draft-meta`,children:[L(`b`,{children:[L(X,{icon:u?`reply`:`quill`,size:`s`}),` `,L(`time`,{children:[!!u&&L(i,{children:[L(`span`,{class:`bidi-isolate`,children:[`@`,u.account.acct]}),L(`br`,{})]}),Jt(f)]})]}),L(xt,{confirmLabel:L(`span`,{children:L(j,{id:`_W5yFF`})}),menuItemClassName:`danger`,align:`end`,disabled:o===`loading`,onClick:()=>{(async()=>{try{await Ke.drafts.del(c),p()}catch{alert(n({id:`rEYoku`}))}})()},children:L(`button`,{type:`button`,class:`small light`,disabled:o===`loading`,children:L(j,{id:`Jb6_SB`})})})]}),L(`button`,{type:`button`,disabled:o===`loading`,class:`draft-item`,onClick:async()=>{let e,r;if(u?.id||d?.id){if(s(`loading`),u)try{e=await a.v1.statuses.$select(u.id).fetch()}catch{alert(n({id:`tMwimH`})),s(`default`);return}if(d)try{r=await a.v1.statuses.$select(d.id).fetch()}catch{alert(n({id:`2oZ4Iw`})),s(`default`)}s(`default`)}window.__COMPOSE__={draftStatus:l,replyToStatus:e,quoteStatus:r},k.showCompose=!0,k.showDrafts=!1},children:L(Qi,{draft:e})})]},r)})}),c.length>1&&L(`p`,{children:L(xt,{confirmLabel:L(`span`,{children:L(j,{id:`3IakFR`})}),menuItemClassName:`danger`,disabled:o===`loading`,onClick:()=>{(async()=>{s(`loading`);try{await Ke.drafts.delMany(c.map(e=>e.key)),s(`default`),p()}catch{alert(n({id:`0J4sZq`})),s(`error`)}})()},children:L(`button`,{type:`button`,class:`light danger`,disabled:o===`loading`,children:L(j,{id:`hOg-Mt`})})})})]}):L(`p`,{children:L(j,{id:`8iQ-jk`})})})]})}function Qi({draft:e}){let{_:n}=d(),{draftStatus:r,replyTo:a,quote:o}=e,{status:s,spoilerText:c,poll:l,mediaAttachments:u}=r,f=l?.options?.length>0,p=u?.length>0,m=!!o?.id,h=f||p||m,_=g(()=>{if(!p)return;let e=u.find(e=>/image/.test(e.type));if(!e)return;let{fileData:n,type:r,file:i,url:a}=e;if(n){let e=new Blob([n],{type:r});return URL.createObjectURL(e)}return i?URL.createObjectURL(i):a||null},[p,u]);return y(()=>()=>{_?.startsWith(`blob:`)&&URL.revokeObjectURL(_)},[_]),L(i,{children:L(`div`,{class:`mini-draft`,children:[h&&L(`div`,{class:`mini-draft-aside ${_?`has-image`:``}`,style:_?{"--bg-image":`url(${_})`}:{},children:[f&&L(X,{icon:`poll`,alt:n({id:`4WUbF1`})}),p&&L(`span`,{children:[L(X,{icon:`attachment`,alt:n({id:`xYilR2`})}),` `,L(`small`,{children:u?.length})]}),m&&L(X,{icon:`quote`,alt:n({id:`ZhhOwV`})})]}),L(`div`,{class:`mini-draft-main`,children:[!!c&&L(`div`,{class:`mini-draft-spoiler`,children:c}),!!s&&L(`div`,{class:`mini-draft-status`,children:s})]})]})})}function $i({html:e,url:n,width:r,height:i,onClose:a=()=>{}}){let{_:o}=d();return L(`div`,{class:`embed-modal-container`,children:[L(`div`,{class:`top-controls`,children:[L(`button`,{type:`button`,class:`light`,onClick:()=>a(),children:L(X,{icon:`x`,alt:o({id:`yz7wBu`})})}),n&&L(`a`,{href:n,target:`_blank`,rel:`noopener`,class:`button plain`,children:[L(`span`,{children:L(j,{id:`4_RpOy`})}),` `,L(X,{icon:`external`})]})]}),L(`div`,{class:`embed-content`,dangerouslySetInnerHTML:{__html:e},style:{"--width":r+`px`,"--height":i+`px`,"--aspect-ratio":`${r}/${i}`}})]})}function ea({instance:e,excludeRelationshipAttrs:n=[],postID:r,onClose:a=()=>{},blankCopy:o}){let{_:c}=d(),{masto:l,instance:u}=f(),p=e?e===u:!0,m=W(k),[h,g]=I(`default`),[_,v]=I(!1);if(si(a),!m.showGenericAccounts)return null;let{id:b,heading:x,fetchAccounts:S,accounts:C,showReactions:w}=m.showGenericAccounts,[T,E]=I(C?.length?C:[]),[ee,D]=I({}),O=async e=>{if(!e?.length||!p)return;let n=await tt(e,ee);n&&D({...ee,...n})},A=e=>{S&&(e&&!T?.length&&E([]),g(`loading`),(async()=>{try{let{done:n,value:r}=await S(e);if(Array.isArray(r)){if(e){let e=[];for(let n=0;n<r.length;n++){let i=r[n],a=e.find((e,r)=>e.id===i.id&&n!==r);a?a._types.push(...i._types):e.push({_types:[],...i})}E(e)}else E(e=>{let n=e;for(let e of r){let r=n.find(n=>n.id===e.id);r?r._types.push(...e._types):n.push(e)}return n});v(!n),O(r)}else v(!1);g(`default`)}catch{g(`error`)}})())},M=s(!0);y(()=>{T?.length>0?S?(A(!0),M.current=!1):O(T):(A(!0),M.current=!1)},[S]),y(()=>{M.current||m.reloadGenericAccounts?.id===b&&A(!0)},[m.reloadGenericAccounts.counter]);let N=k.statuses[r];return L(`div`,{id:`generic-accounts-container`,class:`sheet`,tabindex:`-1`,children:[L(`button`,{type:`button`,class:`sheet-close`,onClick:a,children:L(X,{icon:`x`,alt:c({id:`yz7wBu`})})}),L(`header`,{children:L(`h2`,{children:x||c({id:`bPwFdf`})})}),L(`main`,{children:[N&&L(Q,{to:`/${e||u}/s/${N.id}`,class:`post-preview`,children:L(Ut,{status:N,size:`s`,readOnly:!0})}),T.length>0?L(i,{children:[L(`ul`,{class:`accounts-list`,children:T.map(e=>{let r=ee[e.id],i=`${e.id}-${e._types?.length||``}`;return L(`li`,{children:[w&&e._types?.length>0&&L(`div`,{class:`reactions-block`,children:e._types.map(e=>L(X,{icon:{reblog:`rocket`,favourite:`heart`}[e],class:`${e}-icon`}))}),L(`div`,{class:`account-relationships`,children:L(rt,{account:e,showStats:!0,relationship:r,excludeRelationshipAttrs:n})})]},i)})}),h==="default"?_?L(at,{onChange:e=>{e&&A()},children:L(`button`,{type:`button`,class:`plain block`,onClick:()=>A(),children:L(j,{id:`uXRAkV`})})}):L(`p`,{class:`ui-state insignificant`,children:L(j,{id:`2EYeAZ`})}):h===`loading`&&L(`p`,{class:`ui-state`,children:L(q,{abrupt:!0})})]}):h===`loading`?L(`p`,{class:`ui-state`,children:L(q,{abrupt:!0})}):h===`error`?L(`p`,{class:`ui-state`,children:L(j,{id:`AThL_k`})}):L(`p`,{class:`ui-state insignificant`,children:o||c({id:`10OlfF`})})]})]})}function ta({accounts:e,onClose:n}){let{_:r}=d(),i=v(),{accountsToImport:a}=g(()=>{if(!e)return{accountsToImport:[]};let n={duplicate:0,new:1};return{accountsToImport:e.map(e=>{let n=i.find(n=>n.info.id===e.info.id&&n.instanceURL===e.instanceURL)?`duplicate`:`new`;return{...e,__status:n}}).sort((e,r)=>n[e.__status]-n[r.__status])}},[e,i]),[o,s]=I(()=>{let e={};return a.forEach(n=>{n.__status===`duplicate`?e[n.info.id+n.instanceURL]=!1:e[n.info.id+n.instanceURL]=!0}),e}),[c,l]=I(`default`),u=()=>{l(`importing`),_e([...i,...e.filter(e=>o[e.info.id+e.instanceURL])]),n(),k.showImportExportAccounts=!1,k.showAccounts=!0},f=Object.values(o).filter(Boolean).length;return L(`div`,{id:`import-accounts-selection-container`,class:`sheet`,children:[!!n&&L(`button`,{type:`button`,class:`sheet-close`,onClick:n,disabled:c===`importing`,children:L(X,{icon:`x`,alt:r({id:`yz7wBu`})})}),L(`header`,{children:L(`b`,{children:L(j,{id:`jiFPsN`})})}),L(`main`,{children:L(`div`,{class:`import-selection`,children:[a.filter(e=>e.__status!==`duplicate`).length>3&&L(`div`,{class:`accounts-list-header`,children:L(`label`,{class:`account-item`,children:[L(`input`,{type:`checkbox`,checked:a.filter(e=>e.__status!==`duplicate`).length>0&&a.filter(e=>e.__status!==`duplicate`).every(e=>o[e.info.id+e.instanceURL]),onChange:e=>{let n={...o},r=e.target.checked;a.forEach(e=>{e.__status!==`duplicate`&&(n[e.info.id+e.instanceURL]=r)}),s(n)},disabled:c===`importing`}),L(`span`,{class:`account-info`,children:L(j,{id:`wgNoIs`})})]})}),L(`ul`,{class:`accounts-list`,children:a.map(e=>{let n=e.info.id+e.instanceURL,r=o[n],{__status:i}=e;return L(`li`,{children:L(`label`,{class:`account-item`,children:[L(`input`,{type:`checkbox`,checked:r,onChange:e=>{s({...o,[n]:e.target.checked})},disabled:c===`importing`||i===`duplicate`}),L(Ht,{url:e.info.avatarStatic,size:`xl`}),L(`div`,{class:`account-info`,children:L(ht,{account:{...e.info,acct:/@/.test(e.info.acct)?e.info.acct:`${e.info.acct}@${e.instanceURL}`},showAcct:!0})}),L(`div`,{class:`account-meta`,children:i===`duplicate`&&L(`span`,{class:`tag collapsed`,children:L(j,{id:`5Lvp3B`})})})]})},n)})}),L(`footer`,{children:[L(`button`,{type:`button`,class:`light`,onClick:n,disabled:c===`importing`,children:L(j,{id:`dEgA5A`})}),L(q,{hidden:c!==`importing`}),L(`button`,{type:`button`,disabled:f===0||c===`importing`,onClick:u,children:L(j,{id:`0mebiX`,values:{selectedCount:f}})})]})]})})]})}function na({onClose:e}){let{_:n}=d(),r=v(),[i,a]=I(`default`),[o,s]=I(null),[c,l]=I(!1),u=async()=>{a(`exporting`);try{let n={accounts:v().map(e=>{let{accessToken:n,...r}=e;return r}),createdAt:Date.now()},r=JSON.stringify(n),i=new Blob([r],{type:`application/json`}),a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a;let s=new Date;o.download=`accounts-${`${s.getFullYear()}-${String(s.getMonth()+1).padStart(2,`0`)}-${String(s.getDate()).padStart(2,`0`)}_${String(s.getHours()).padStart(2,`0`)}-${String(s.getMinutes()).padStart(2,`0`)}`}.phanpy.json`,o.click(),URL.revokeObjectURL(a),e()}catch{Z(n({id:`lpYill`})),a(`error`)}},f=async e=>{if(e){a(`importing`);try{let n=await e.text(),r=JSON.parse(n)?.accounts;if(!Array.isArray(r))throw Error(`Invalid backup file`);s(r),a(`default`)}catch{Z(n({id:`BEVzjL`})),a(`error`)}}};return L(`div`,{id:`import-export-accounts-container`,class:`sheet`,onDragOver:e=>{e.preventDefault(),l(!0)},onDragLeave:()=>{l(!1)},onDrop:e=>{e.preventDefault(),l(!1);let n=e.dataTransfer.files[0];f(n)},children:[!!e&&L(`button`,{type:`button`,class:`sheet-close`,onClick:e,children:L(X,{icon:`x`,alt:n({id:`yz7wBu`})})}),L(`header`,{children:L(`h2`,{children:L(j,{id:`k30qb8`,components:{0:L(`small`,{class:`ib insignificant`})}})})}),L(`main`,{children:[L(`section`,{children:[L(`label`,{class:`section-button button-import button plain4 ${c?`drag-over`:``}`,tabindex:`0`,children:[L(X,{icon:`arrow-down-circle`,size:`xxl`}),L(`b`,{children:L(j,{id:`l3s5ri`})}),L(`input`,{type:`file`,accept:`.json`,onChange:e=>{let n=e.target.files[0];f(n)},disabled:i===`importing`,style:{display:`none`}}),L(`div`,{children:L(`small`,{class:`insignificant`,children:L(j,{id:`SdA74G`})})})]}),` `,L(`button`,{type:`button`,class:`section-button button-export plain4`,onClick:u,disabled:i===`exporting`||r.length===0,children:[L(X,{icon:`arrow-up-circle`,size:`xxl`}),L(`b`,{children:L(j,{id:`GS-Mus`})}),L(`div`,{children:L(`small`,{class:`insignificant`,children:L(j,{id:`A7kMZX`,values:{0:r.length}})})})]})]}),L(`p`,{class:`insignificant`,children:L(`small`,{children:L(j,{id:`R-Pgtr`})})})]}),o&&L(Ot,{onClose:()=>{s(null)},children:L(ta,{accounts:o,onClose:()=>{s(null)}})})]})}var ra=140;function ia({alt:e,lang:n,onClose:r}){let{_:i}=d(),a=W(k),[o,s]=I(!1),c=Ye(!0),l=a.settings.contentTranslationHideLanguages||[],u=!!n&&n!==c&&!se([n],[c])&&!l.find(e=>n===e||se([n],[e]));return y(()=>{let n=e?.length>0&&e?.length<=ra;u&&n&&s(!0)},[u,e]),L(`div`,{class:`sheet`,tabindex:`-1`,children:[!!r&&L(`button`,{type:`button`,class:`sheet-close outer`,onClick:r,children:L(X,{icon:`x`,alt:i({id:`yz7wBu`})})}),L(`header`,{class:`header-grid`,children:[L(`h2`,{children:L(j,{id:`5gfDMm`})}),L(`div`,{class:`header-side`,children:L(Gt,{align:`end`,menuButton:L(`button`,{type:`button`,class:`plain4`,children:L(X,{icon:`more`,alt:i({id:`2FYpfJ`}),size:`xl`})}),children:[L(Y,{disabled:o,onClick:()=>{s(!0)},children:[L(X,{icon:`translate`}),L(`span`,{children:L(j,{id:`pi8x_S`})})]}),$t&&L(Y,{onClick:()=>{qt(e,n)},children:[L(X,{icon:`speak`}),L(`span`,{children:L(j,{id:`yIBLq8`})})]})]})})]}),L(`main`,{lang:n,dir:`auto`,children:[L(`p`,{style:{whiteSpace:`pre-wrap`,textWrap:`pretty`},children:e}),(u||o)&&L(We,{forceTranslate:o,sourceLanguage:n,text:e})]})]})}var{min:aa,max:oa}=Math,sa={};for(let e of[`Boolean`,`Number`,`String`,`Function`,`Array`,`Date`,`RegExp`,`Undefined`,`Null`])sa[`[object ${e}]`]=e.toLowerCase();function ca(e){return sa[Object.prototype.toString.call(e)]||`object`}var la=(e,n=null)=>e.length>=3?Array.prototype.slice.call(e):ca(e[0])==`object`&&n?n.split(``).filter(n=>e[0][n]!==void 0).map(n=>e[0][n]):e[0].slice(0),{PI:ua,min:da,max:fa}=Math;ua*2,ua/3;var pa=ua/180,ma=180/ua;function ha(e,n){let r=e.length;Array.isArray(e[0])||(e=[e]),Array.isArray(n[0])||(n=n.map(e=>[e]));let i=n[0].length,a=n[0].map((e,r)=>n.map(e=>e[r])),o=e.map(e=>a.map(n=>Array.isArray(e)?e.reduce((e,r,i)=>e+r*(n[i]||0),0):n.reduce((n,r)=>n+r*e,0)));return r===1&&(o=o[0]),i===1?o.map(e=>e[0]):o}var ga={Kn:18,labWhitePoint:`d65`,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452,kE:216/24389,kKE:8,kK:24389/27,RefWhiteRGB:{X:.95047,Y:1,Z:1.08883},MtxRGB2XYZ:{m00:.4124564390896922,m01:.21267285140562253,m02:.0193338955823293,m10:.357576077643909,m11:.715152155287818,m12:.11919202588130297,m20:.18043748326639894,m21:.07217499330655958,m22:.9503040785363679},MtxXYZ2RGB:{m00:3.2404541621141045,m01:-.9692660305051868,m02:.055643430959114726,m10:-1.5371385127977166,m11:1.8760108454466942,m12:-.2040259135167538,m20:-.498531409556016,m21:.041556017530349834,m22:1.0572251882231791},As:.9414285350000001,Bs:1.040417467,Cs:1.089532651,MtxAdaptMa:{m00:.8951,m01:-.7502,m02:.0389,m10:.2664,m11:1.7135,m12:-.0685,m20:-.1614,m21:.0367,m22:1.0296},MtxAdaptMaI:{m00:.9869929054667123,m01:.43230526972339456,m02:-.008528664575177328,m10:-.14705425642099013,m11:.5183602715367776,m12:.04004282165408487,m20:.15996265166373125,m21:.0492912282128556,m22:.9684866957875502}};new Map([[`a`,[1.0985,.35585]],[`b`,[1.0985,.35585]],[`c`,[.98074,1.18232]],[`d50`,[.96422,.82521]],[`d55`,[.95682,.92149]],[`d65`,[.95047,1.08883]],[`e`,[1,1,1]],[`f2`,[.99186,.67393]],[`f7`,[.95041,1.08747]],[`f11`,[1.00962,.6435]],[`icc`,[.96422,.82521]]]);var _a=e=>{let n=Math.sign(e);return e=Math.abs(e),(e<=.0031308?e*12.92:1.055*e**(1/2.4)-.055)*n},va=(e,n,r)=>{let{MtxAdaptMa:i,MtxAdaptMaI:a,MtxXYZ2RGB:o,RefWhiteRGB:s,Xn:c,Yn:l,Zn:u}=ga,d=c*i.m00+l*i.m10+u*i.m20,f=c*i.m01+l*i.m11+u*i.m21,p=c*i.m02+l*i.m12+u*i.m22,m=s.X*i.m00+s.Y*i.m10+s.Z*i.m20,h=s.X*i.m01+s.Y*i.m11+s.Z*i.m21,g=s.X*i.m02+s.Y*i.m12+s.Z*i.m22,_=(e*i.m00+n*i.m10+r*i.m20)*(m/d),v=(e*i.m01+n*i.m11+r*i.m21)*(h/f),y=(e*i.m02+n*i.m12+r*i.m22)*(g/p),b=_*a.m00+v*a.m10+y*a.m20,x=_*a.m01+v*a.m11+y*a.m21,S=_*a.m02+v*a.m12+y*a.m22,C=_a(b*o.m00+x*o.m10+S*o.m20),w=_a(b*o.m01+x*o.m11+S*o.m21),T=_a(b*o.m02+x*o.m12+S*o.m22);return[C*255,w*255,T*255]},ya=(...e)=>{e=la(e,`lab`);let[n,r,i,...a]=e,[o,s,c]=ba([n,r,i]),[l,u,d]=va(o,s,c);return[l,u,d,...a.length>0&&a[0]<1?[a[0]]:[]]};function ba(e){return ha([[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],ha([[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],e).map(e=>e**3))}function xa(e){let n=Math.sign(e);return e=Math.abs(e),(e<=.04045?e/12.92:((e+.055)/1.055)**2.4)*n}var Sa=(e,n,r)=>{e=xa(e/255),n=xa(n/255),r=xa(r/255);let{MtxRGB2XYZ:i,MtxAdaptMa:a,MtxAdaptMaI:o,Xn:s,Yn:c,Zn:l,As:u,Bs:d,Cs:f}=ga,p=e*i.m00+n*i.m10+r*i.m20,m=e*i.m01+n*i.m11+r*i.m21,h=e*i.m02+n*i.m12+r*i.m22,g=s*a.m00+c*a.m10+l*a.m20,_=s*a.m01+c*a.m11+l*a.m21,v=s*a.m02+c*a.m12+l*a.m22,y=p*a.m00+m*a.m10+h*a.m20,b=p*a.m01+m*a.m11+h*a.m21,x=p*a.m02+m*a.m12+h*a.m22;return y*=g/u,b*=_/d,x*=v/f,p=y*o.m00+b*o.m10+x*o.m20,m=y*o.m01+b*o.m11+x*o.m21,h=y*o.m02+b*o.m12+x*o.m22,[p,m,h]},Ca=(...e)=>{let[n,r,i,...a]=la(e,`rgb`);return[...wa(Sa(n,r,i)),...a.length>0&&a[0]<1?[a[0]]:[]]};function wa(e){return ha([[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],ha([[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],e).map(e=>Math.cbrt(e)))}var{sin:Ta,cos:Ea}=Math,Da=(...e)=>{let[n,r,i]=la(e,`lch`);return isNaN(i)&&(i=0),i*=pa,[n,Ea(i)*r,Ta(i)*r]},Oa=(...e)=>{e=la(e,`lch`);let[n,r,i,...a]=e,[o,s,c]=Da(n,r,i),[l,u,d]=ya(o,s,c);return[l,u,d,...a.length>0&&a[0]<1?[a[0]]:[]]},{sqrt:ka,atan2:Aa,round:ja}=Math,Ma=(...e)=>{let[n,r,i]=la(e,`lab`),a=ka(r*r+i*i),o=(Aa(i,r)*ma+360)%360;return ja(a*1e4)===0&&(o=NaN),[n,a,o]},Na=(...e)=>{let[n,r,i,...a]=la(e,`rgb`),[o,s,c]=Ca(n,r,i),[l,u,d]=Ma(o,s,c);return[l,u,d,...a.length>0&&a[0]<1?[a[0]]:[]]},{PHANPY_IMG_ALT_API_URL:Pa}={};function Fa({mediaAttachments:e,statusID:n,instance:r,lang:i,index:a=0,onClose:o=()=>{}}){let{_:c}=d(),[l,u]=I(`default`),f=s(null),[p,m]=I(a),h=s(null);N(()=>{h.current?.scrollIntoView()},[]);let _=s(n);y(()=>{let e=a*f.current.clientWidth,r=_.current!==n;r&&(_.current=n),f.current.focus(),f.current.scrollTo({left:e*(Ft()?-1:1),behavior:r?`auto`:`smooth`})},[a,n]);let[v,b]=I(!0);y(()=>{let n=n=>{o(n,p,e,f)};return f.current&&f.current.addEventListener(`swiped-down`,n),()=>{f.current&&f.current.removeEventListener(`swiped-down`,n)}},[p,e]),nt(`esc`,n=>{o(n,p,e,f)},{ignoreEventWhen:e=>!!document.querySelector(`#modal-container > *`)||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey,useKey:!0},[o,p,e]),y(()=>{let e=()=>{let{clientWidth:e,scrollLeft:n}=f.current;m(Math.round(Math.abs(n)/e))};return f.current&&f.current.addEventListener(`scroll`,e,{passive:!0}),()=>{f.current&&f.current.removeEventListener(`scroll`,e)}},[]);let x=s(p);y(()=>{let e=x.current;if(x.current=p,e===p)return;let n=f.current;n&&n.querySelectorAll(`video, audio`).forEach(e=>{if(e.muted)return;let n=e.closest(`.carousel-item`);n&&Array.from(n.parentNode.children).indexOf(n)!==p&&e.pause()})},[p]),y(()=>{let e=setTimeout(()=>{f.current?.focus?.()},100);return()=>clearTimeout(e)},[]);let S=g(()=>e?.map(e=>{let{blurhash:n}=e;return n?Na(St(n)):null}),[e]),C=g(()=>S?.map(e=>e?{light:Oa([.95,.01,e[2]]),dark:Oa([.35,.01,e[2]]),default:Oa([.6,e[1],e[2]])}:null)),w=g(()=>{let e=100/C.length,n=C.map((n,r)=>{let i=r*e+5,a=(r+1)*e-5;return n?.light&&n?.dark?{light:`
|
|
5
|
+
rgb(${n.light?.join(`,`)}) ${i}%,
|
|
6
|
+
rgb(${n.light?.join(`,`)}) ${a}%
|
|
7
|
+
`,dark:`
|
|
8
|
+
rgb(${n.dark?.join(`,`)}) ${i}%,
|
|
9
|
+
rgb(${n.dark?.join(`,`)}) ${a}%
|
|
10
|
+
`}:{light:`
|
|
11
|
+
transparent ${i}%,
|
|
12
|
+
transparent ${a}%
|
|
13
|
+
`,dark:`
|
|
14
|
+
transparent ${i}%,
|
|
15
|
+
transparent ${a}%
|
|
16
|
+
`}});return{light:n.map(e=>e.light).join(`, `),dark:n.map(e=>e.dark).join(`, `)}},[C]),T=s(null);return y(()=>()=>{T.current?.hideToast?.()},[]),N(()=>{let e=C[p],n,r;if(e){let i=F.local.get(`theme`);if(i){let a=`rgb(${e[i].join(`,`)})`;n=document.querySelector(`meta[name="theme-color"][data-theme-setting="manual"]`),n&&(r=n.content,n.content=a),document.documentElement.style.setProperty(`--meta-theme-color`,a)}else{let i=window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`,a=`rgb(${e[i].join(`,`)})`;n=document.querySelector(`meta[name="theme-color"][media*="${i}"]`),n&&(r=n.content,n.content=a),document.documentElement.style.setProperty(`--meta-theme-color`,a)}}return()=>{n&&r&&(n.content=r),document.documentElement.style.removeProperty(`--meta-theme-color`)}},[p,C]),L(`div`,{class:`media-modal-container media-modal-count-${e?.length}`,children:[L(`div`,{ref:f,tabIndex:`0`,"data-swipe-threshold":`44`,class:`carousel`,onClick:n=>{(n.target.classList.contains(`carousel-item`)||n.target.classList.contains(`media`)||n.target.classList.contains(`media-zoom`))&&o(n,p,e,f)},style:e.length>1?{backgroundAttachment:`local`,"--accent-gradient-light":w?.light,"--accent-gradient-dark":w?.dark}:{},children:e?.map((n,r)=>{let o=e.length===1?C[r]:null;return L(`div`,{class:`carousel-item`,style:o?{"--accent-color":`rgb(${o.default.join(`,`)})`,"--accent-light-color":`rgb(${o.light?.join(`,`)})`,"--accent-dark-color":`rgb(${o.dark?.join(`,`)})`,"--accent-alpha-color":`rgba(${o.default.join(`,`)}, 0.4)`}:{},tabindex:`0`,ref:r===p?h:null,onClick:e=>{e.target.classList.contains(`media`)||b(!v)},children:[!!n.description&&L(`button`,{type:`button`,class:`media-alt`,hidden:!v,onClick:()=>{k.showMediaAlt={alt:n.description,lang:i}},children:[L(`span`,{class:`alt-badge`,children:`ALT`}),L(`span`,{class:`media-alt-desc`,lang:i,dir:`auto`,children:n.description})]}),L(bt,{media:n,showOriginal:!0,lang:i,autoplay:r===a})]},n.id)})}),L(`div`,{class:`carousel-top-controls`,hidden:!v,children:[L(`span`,{children:L(`button`,{type:`button`,class:`carousel-button`,onClick:n=>o(n,p,e,f),children:L(X,{icon:`x`,alt:c({id:`yz7wBu`})})})}),e?.length>1?L(`span`,{class:`carousel-dots`,children:e?.map((e,n)=>L(`button`,{type:`button`,disabled:n===p,class:`carousel-dot ${n===p?`active`:``}`,onClick:e=>{e.preventDefault(),e.stopPropagation();let r=f.current.clientWidth*n*(Ft()?-1:1);f.current.focus(),f.current.scrollTo({left:r,behavior:`smooth`})},children:L(X,{icon:`round`,size:`s`,alt:`⸱`})},e.id))}):L(`span`,{}),L(`span`,{children:[L(Gt,{overflow:`auto`,align:`end`,position:`anchor`,gap:4,menuClassName:`glass-menu`,menuButton:L(`button`,{type:`button`,class:`carousel-button`,children:L(X,{icon:`more2`,alt:c({id:`2FYpfJ`})})}),children:[L(Mt,{href:e[p]?.remoteUrl||e[p]?.url,class:`carousel-button`,target:`_blank`,title:c({id:`5hXGws`}),children:[L(X,{icon:`popout`}),L(`span`,{children:L(j,{id:`aDr7Vc`})})]}),!1]}),` `,!!n&&L(Q,{to:`${r?`/${r}`:``}/s/${n}${window.matchMedia(`(min-width: calc(40em + 350px))`).matches?`?media=${p+1}`:``}`,class:`button carousel-button media-post-link`,children:[L(`span`,{class:`button-label`,children:[L(j,{id:`ISg5SQ`}),` `]}),`»`]})]})]}),e?.length>1&&L(`div`,{class:`carousel-controls`,hidden:!v,children:[L(`button`,{type:`button`,class:`carousel-button`,hidden:p===0,onClick:e=>{e.preventDefault(),e.stopPropagation(),f.current.focus(),f.current.scrollTo({left:f.current.clientWidth*(p-1)*(Ft()?-1:1),behavior:`smooth`})},children:L(X,{icon:`arrow-left`,alt:c({id:`DHhJ7s`})})}),L(`button`,{type:`button`,class:`carousel-button`,hidden:p===e.length-1,onClick:e=>{e.preventDefault(),e.stopPropagation(),f.current.focus(),f.current.scrollTo({left:f.current.clientWidth*(p+1)*(Ft()?-1:1),behavior:`smooth`})},children:L(X,{icon:`arrow-right`,alt:c({id:`hXzOVo`})})})]})]})}function Ia({url:e,linkText:n,onClose:r}){let{_:a}=d();if(!e)return null;let o=e;try{let n=URL.parse(e),r=n.protocol,a=n.hostname,s=e.slice(n.origin.length);o=L(i,{children:[r,`//`,L(`strong`,{children:a}),s]})}catch{}return L(`div`,{class:`sheet sheet-modal`,id:`open-link-sheet`,tabindex:`-1`,children:[!!r&&L(`button`,{type:`button`,class:`sheet-close`,onClick:r,children:L(X,{icon:`x`,alt:a({id:`yz7wBu`})})}),L(`header`,{class:`header-grid`,children:L(`h2`,{children:L(j,{id:`Gj4mrz`})})}),L(`main`,{children:[!!n&&L(i,{children:[L(`p`,{class:`link-text`,children:[L(X,{icon:`cursor-hand`,size:`xl`}),` `,n]}),L(`div`,{class:`arrow`,children:L(X,{icon:`arrow-down`})})]}),L(`p`,{class:`full-url`,children:o})]}),L(`footer`,{children:[L(`button`,{type:`button`,class:`light`,onClick:r,children:L(j,{id:`dEgA5A`})}),L(`span`,{class:`spacer`}),L(`button`,{type:`button`,class:`plain6`,onClick:()=>{try{navigator.clipboard.writeText(e),Z(a({id:`edWbV6`}))}catch{Z(a({id:`W1ewR0`}))}},children:L(X,{icon:`copy`,alt:a({id:`he3ygx`})})}),navigator.canShare&&navigator.canShare({url:e})&&L(`button`,{type:`button`,class:`plain6`,onClick:()=>{if(navigator.share&&navigator.canShare({url:e}))try{navigator.share({url:e})}catch{}},children:L(X,{icon:`share`,alt:a({id:`LFKLqp`})})}),L(`a`,{class:`button`,href:e,target:`_blank`,rel:`noopener noreferrer`,onClick:r,children:L(j,{id:`1TNIig`})})]})]})}var La={newline:10,reset:27};function Ra(e){if(!Number.isSafeInteger(e))throw Error(`integer expected: ${e}`)}function za(e){if(!Number.isSafeInteger(e)||e<1||e>40)throw Error(`Invalid version=${e}. Expected number [1..40]`)}function Ba(e,n){return e.toString(2).padStart(n,`0`)}function Va(e,n){let r=e%n;return r>=0?r:n+r}function Ha(e,n){return Array(e).fill(n)}function Ua(e){return e-=e>>>1&1431655765,e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}function Wa(e){let n=0,r=0;for(let i of e)n=Math.max(n,i.length),r+=i.length;let i=new Uint8Array(r),a=0;for(let r=0;r<n;r++)for(let n of e)r<n.length&&(i[a++]=n[r]);return i}function Ga(){let e,n=1/0;return{add(r,i){r>=n||(e=i,n=r)},get:()=>e,score:()=>n}}function Ka(e){return Object.freeze({has:n=>e.includes(n),decode:n=>{if(!Array.isArray(n)||n.length&&typeof n[0]!=`string`)throw Error(`alphabet.decode input should be array of strings`);return n.map(n=>{if(typeof n!=`string`)throw Error(`alphabet.decode: not string element=${n}`);let r=e.indexOf(n);if(r===-1)throw Error(`Unknown letter: "${n}". Allowed: ${e}`);return r})},encode:n=>{if(!Array.isArray(n)||n.length&&typeof n[0]!=`number`)throw Error(`alphabet.encode input should be an array of numbers`);return n.map(n=>{if(Ra(n),n<0||n>=e.length)throw Error(`Digit index outside alphabet: ${n} (alphabet: ${e.length})`);return e[n]})}})}function qa(e){if(e.length!==32)throw Error(`expects 32 element matrix`);let n=[1431655765,858993459,252645135,16711935,65535];for(let r=0;r<5;r++){let i=n[r]>>>0,a=1<<r,o=a<<1;for(let n=0;n<32;n+=o)for(let r=0;r<a;r++){let o=n+r,s=o+a,c=e[o]>>>0,l=e[s]>>>0,u=(c>>>a^l)&i;e[o]=(c^u<<a)>>>0,e[s]=(l^u)>>>0}}}var Ja=e=>1<<(e&31)>>>0,Ya=(e,n)=>n===0?0:n===32?4294967295:(1<<n)-1<<e>>>0,Xa=class e{static size(e,n){if(typeof e==`number`&&(e={height:e,width:e}),!Number.isSafeInteger(e.height)&&e.height!==1/0)throw Error(`Bitmap: invalid height=${e.height} (${typeof e.height})`);if(!Number.isSafeInteger(e.width)&&e.width!==1/0)throw Error(`Bitmap: invalid width=${e.width} (${typeof e.width})`);return n!==void 0&&(e={width:Math.min(e.width,n.width),height:Math.min(e.height,n.height)}),e}static fromString(n){n=n.replace(/^\n+/g,``).replace(/\n+$/g,``);let r=n.split(String.fromCharCode(La.newline)),i=r.length,a,o=[];for(let e of r){let n=e.split(``).map(e=>{if(e===`X`)return!0;if(e===` `)return!1;if(e!==`?`)throw Error(`Bitmap.fromString: unknown symbol=${e}`)});if(a!==void 0&&n.length!==a)throw Error(`Bitmap.fromString different row sizes: width=${a} cur=${n.length}`);a=n.length,o.push(n)}return a===void 0&&(a=0),new e({height:i,width:a},o)}defined;value;tailMask;words;fullWords;height;width;constructor(n,r){let{height:i,width:a}=e.size(n);if(!Number.isSafeInteger(i)||i<=0)throw Error(`Bitmap: invalid height=${i}, expected positive safe integer dimension`);if(!Number.isSafeInteger(a)||a<=0)throw Error(`Bitmap: invalid width=${a}, expected positive safe integer dimension`);if(this.height=i,this.width=a,this.tailMask=Ya(0,a&31||32),this.words=Math.ceil(a/32)|0,this.fullWords=Math.floor(a/32)|0,this.value=new Uint32Array(this.words*i),this.defined=new Uint32Array(this.value.length),r){if(r.length!==i)throw Error(`Bitmap: data height mismatch: exp=${i} got=${r.length}`);for(let e=0;e<i;e++){let n=r[e];if(!n||n.length!==a)throw Error(`Bitmap: data width mismatch at y=${e}: exp=${a} got=${n?.length}`);for(let r=0;r<a;r++)this.set(r,e,n[r])}}}point(e){return this.get(e.x,e.y)}isInside(e){return 0<=e.x&&e.x<this.width&&0<=e.y&&e.y<this.height}size(e){if(!e)return{height:this.height,width:this.width};let{x:n,y:r}=this.xy(e);return{height:this.height-r,width:this.width-n}}xy(e){if(typeof e==`number`&&(e={x:e,y:e}),!Number.isSafeInteger(e.x))throw Error(`Bitmap: invalid x=${e.x}`);if(!Number.isSafeInteger(e.y))throw Error(`Bitmap: invalid y=${e.y}`);return e.x=Va(e.x,this.width),e.y=Va(e.y,this.height),e}wordIndex(e,n){return n*this.words+(e>>>5)}bitIndex(e,n){return{word:this.wordIndex(e,n),bit:e&31}}isDefined(e,n){let r=this.wordIndex(e,n),i=Ja(e);return(this.defined[r]&i)!==0}get(e,n){let r=this.wordIndex(e,n),i=Ja(e);return(this.value[r]&i)!==0}maskWord(e,n,r){let{defined:i,value:a}=this;i[e]|=n,a[e]=a[e]&~n|-r&n}set(e,n,r){r!==void 0&&this.maskWord(this.wordIndex(e,n),Ja(e),r)}fillRectConst(e,n,r,i,a){if(r<=0||i<=0||a===void 0)return;let{value:o,defined:s,words:c}=this,l=e>>>5,u=e+r-1>>>5,d=e&31,f=e+r-1&31;for(let e=0;e<i;e++){let r=(n+e)*c;if(l===u){let e=Ya(d,f-d+1);this.maskWord(r+l,e,a);continue}this.maskWord(r+l,Ya(d,32-d),a);for(let e=l+1;e<u;e++)s[r+e]=4294967295,o[r+e]=a?4294967295:0;this.maskWord(r+u,Ya(0,f+1),a)}}rectWords(e,n,r,i,a){for(let o=0;o<i;o++){let i=n+o;for(let n=0;n<r;){let s=e+n,{bit:c,word:l}=this.bitIndex(s,i),u=Math.min(32-c,r-n);a(l,s,n,o,u),n+=u}}}rect(n,r,i){let{x:a,y:o}=this.xy(n),{height:s,width:c}=e.size(r,this.size({x:a,y:o}));if(typeof i!=`function`)return this.fillRectConst(a,o,c,s,i),this;let{defined:l,value:u}=this;return this.rectWords(a,o,c,s,(e,n,r,a,o)=>{let s=0,c=u[e];for(let e=0;e<o;e++){let o=Ja(n+e),l=i({x:r+e,y:a},(c&o)!==0);l!==void 0&&(s|=o,c=c&~o|-l&o)}l[e]|=s,u[e]=c}),this}rectRead(n,r,i){let{x:a,y:o}=this.xy(n),{height:s,width:c}=e.size(r,this.size({x:a,y:o})),{value:l}=this;return this.rectWords(a,o,c,s,(e,n,r,a,o)=>{let s=l[e];for(let e=0;e<o;e++){let o=Ja(n+e);i({x:r+e,y:a},(s&o)!==0)}}),this}hLine(e,n,r){return this.rect(e,{width:n,height:1},r)}vLine(e,n,r){return this.rect(e,{width:1,height:n},r)}border(n=2,r){if(!Number.isSafeInteger(n)||n<=0)throw Error(`Bitmap.border: invalid size=${n}`);let i=new e({height:this.height+2*n,width:this.width+2*n});return i.rect(0,1/0,r),i.embed({x:n,y:n},this),i}embed(n,r){let{x:i,y:a}=this.xy(n),{height:o,width:s}=e.size(r.size(),this.size({x:i,y:a}));if(s<=0||o<=0)return this;let{value:c,defined:l}=this,{words:u,value:d}=r;for(let e=0;e<o;e++){let n=e*u;for(let o=0;o<s;){let f=i+o,{word:p,bit:m}=this.bitIndex(f,a+e),{word:h,bit:g}=r.bitIndex(o,e),_=Math.min(32-m,s-o),v=d[h],y=g&&h+1<n+u?d[h+1]:0,b=g?(v>>>g|y<<32-g)>>>0:v,x=Ya(m,_),S=(b&Ya(0,_))<<m>>>0;l[p]|=x,c[p]=c[p]&~x|S,o+=_}}return this}rectSlice(n,r=this.size()){let{x:i,y:a}=this.xy(n),{height:o,width:s}=e.size(r,this.size({x:i,y:a})),c=new e({height:o,width:s});return this.rectRead({x:i,y:a},{height:o,width:s},(e,n)=>{this.isDefined(i+e.x,a+e.y)&&c.set(e.x,e.y,n)}),c}transpose(){let{height:n,width:r,value:i,defined:a,words:o}=this,s=new e({height:r,width:n}),{words:c,value:l,defined:u,tailMask:d}=s,f=new Uint32Array(32),p=new Uint32Array(32);for(let e=0;e<n;e+=32)for(let m=0;m<o;m++){let o=Math.min(32,n-e);for(let n=0;n<o;n++){let r=this.wordIndex(32*m,e+n);f[n]=i[r],p[n]=a[r]}f.fill(0,o),p.fill(0,o),qa(f),qa(p);for(let n=0;n<32;n++){let i=m*32+n;if(i>=r)break;let a=s.wordIndex(e,i),o=e>>>5==c-1?d:4294967295;l[a]=f[n]&o,u[a]=p[n]&o}}return s}negate(){let e=this.defined.length;for(let n=0;n<e;n++)this.value[n]=~this.value[n],this.defined[n]=4294967295;return this}scale(n){if(!Number.isSafeInteger(n)||n>1024)throw Error(`invalid scale factor: ${n}`);let{height:r,width:i}=this;return new e({height:n*r,width:n*i}).rect({x:0,y:0},1/0,({x:e,y:r})=>this.get(e/n|0,r/n|0))}clone(){let n=new e(this.size());return n.defined.set(this.defined),n.value.set(this.value),n}assertDrawn(){let{height:e,width:n,defined:r,tailMask:i,fullWords:a,words:o}=this;if(!(!e||!n))for(let n=0;n<e;n++){let e=n*o;for(let n=0;n<a;n++)if(r[e+n]!==4294967295)throw Error(`Invalid color type=undefined`);if(o!==a&&(r[e+a]&i)!==i)throw Error(`Invalid color type=undefined`)}}countPatternInRow(e,n,...r){if(!Number.isSafeInteger(n)||n<=0||n>=32)throw Error(`wrong patternLen`);let i=(1<<n)-1,{height:a,width:o,value:s,words:c}=this;if(!Number.isSafeInteger(e)||e<0||e>=a)return 0;let l=0,u=this.wordIndex(0,e);for(let e=0,a=0;e<c;e++){let d=s[u+e],f=e===c-1&&o&31||32;for(let o=0;o<f;o++)if(a=(a<<1|d>>>o&1)&i,!(e*32+o+1<n)){for(let e of r)if(a===e){l++;break}}}return l}getRuns(e,n){let{height:r,width:i,value:a,words:o}=this;if(i===0||!Number.isSafeInteger(e)||e<0||e>=r)return;let s=0,c,l=this.wordIndex(0,e);for(let e=0;e<o;e++){let r=a[l+e],u=e===o-1&&i&31||32;for(let e=0;e<u;e++){let i=(r&1<<e)!=0;if(i===c){s++;continue}c!==void 0&&n(s,c),c=i,s=1}}c!==void 0&&n(s,c)}popcnt(){let{height:e,width:n,words:r,fullWords:i,tailMask:a}=this;if(!e||!n)return 0;let o=0;for(let n=0;n<e;n++){let e=n*r;for(let n=0;n<i;n++)o+=Ua(this.value[e+n]);r!==i&&(o+=Ua(this.value[e+i]&a))}return o}countBoxes2x2(e){let{height:n,width:r,words:i}=this;if(r<2||!Number.isSafeInteger(e)||e<0||e+1>=n)return 0;let a=this.wordIndex(0,e),o=this.wordIndex(0,e+1),s=r&31?Ya(0,r-1&31):2147483647,c=0;for(let e=0;e<i;e++){let n=this.value[a+e],r=this.value[o+e],l=~(n^r)>>>0,u=e+1<i?this.value[a+e+1]>>>0:0,d=~(n^(n>>>1|(u&1)<<31)>>>0)>>>0,f=e+1<i?this.value[o+e+1]>>>0:0,p=~(r^(r>>>1|(f&1)<<31)>>>0)>>>0,m=(l&d&p)>>>0;e===i-1&&(m&=s),c+=Ua(m)}return c}toString(){let e=String.fromCharCode(La.newline),n=``;for(let r=0;r<this.height;r++){let i=``;for(let e=0;e<this.width;e++){let n=this.get(e,r);i+=this.isDefined(e,r)?n?`X`:` `:`?`}n+=i+(r+1===this.height?``:e)}return n}toRaw(){let e=Array.from({length:this.height},()=>Array(this.width));for(let n=0;n<this.height;n++){let r=e[n];for(let e=0;e<this.width;e++)r[e]=this.get(e,n)}return e}toASCII(){let{height:e,width:n}=this,r=``;for(let i=0;i<e;i+=2){for(let a=0;a<n;a++){let n=this.get(a,i),o=i+1>=e?!0:this.get(a,i+1);!n&&!o?r+=`█`:!n&&o?r+=`▀`:n&&!o?r+=`▄`:n&&o&&(r+=` `)}r+=String.fromCharCode(La.newline)}return r}toTerm(){let e=String.fromCharCode(La.reset),n=e+`[0m`,r=e+`[1;47m `+n,i=e+`[40m `+n,a=String.fromCharCode(La.newline),o=``;for(let e=0;e<this.height;e++){for(let n=0;n<this.width;n++){let a=this.get(n,e);o+=a?i:r}o+=a}return o}toSVG(e=!0){let n=`<svg viewBox="0 0 ${this.width} ${this.height}" xmlns="http://www.w3.org/2000/svg">`,r=``,i;return this.rectRead(0,1/0,(a,o)=>{if(!o)return;let{x:s,y:c}=a;if(!e){n+=`<rect x="${s}" y="${c}" width="1" height="1" />`;return}let l=`M${s} ${c}`;if(i){let e=`m${s-i.x} ${c-i.y}`;e.length<=l.length&&(l=e)}let u=s<10?`H${s}`:`h-1`;r+=`${l}h1v1${u}Z`,i=a}),e&&(n+=`<path d="${r}"/>`),n+=`</svg>`,n}toGIF(){let e=e=>[e&255,e>>>8&255],n=[...e(this.width),...e(this.height)],r=[];this.rectRead(0,1/0,(e,n)=>r.push(+(n===!0)));let i=[71,73,70,56,55,97,...n,246,0,0,255,255,255,...Ha(381,0),44,0,0,0,0,...n,0,7],a=Math.floor(r.length/126);for(let e=0;e<a;e++)i.push(127,128,...r.slice(126*e,126*(e+1)).map(e=>+e));return i.push(r.length%126+1,128,...r.slice(a*126).map(e=>+e)),i.push(1,129,0,59),new Uint8Array(i)}toImage(e=!1){let{height:n,width:r}=this.size(),i=new Uint8Array(n*r*(e?3:4)),a=0;for(let o=0;o<n;o++)for(let n=0;n<r;n++){let r=this.get(n,o)?0:255;i[a++]=r,i[a++]=r,i[a++]=r,e||(i[a++]=255)}return{height:n,width:r,data:i}}},Za=Object.freeze([`low`,`medium`,`quartile`,`high`]),Qa=Object.freeze([`numeric`,`alphanumeric`,`byte`,`kanji`,`eci`]),$a=[26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706],eo={low:[7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],medium:[10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],quartile:[13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],high:[17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]},to={low:[1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],medium:[1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],quartile:[1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],high:[1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]},no=Object.freeze({size:Object.freeze({encode:e=>21+4*(e-1),decode:e=>(e-17)/4}),sizeType:e=>Math.floor((e+7)/17),alignmentPatterns(e){if(e===1)return[];let n=no.size.encode(e)-6-1,r=n-6,i=Math.ceil(r/28),a=Math.floor(r/i);a%2?a+=1:r%i*2>=i&&(a+=2);let o=[6];for(let e=1;e<i;e++)o.push(n-(i-e)*a);return o.push(n),o},ECCode:Object.freeze({low:1,medium:0,quartile:3,high:2}),formatMask:21522,formatBits(e,n){let r=no.ECCode[e]<<3|n,i=r;for(let e=0;e<10;e++)i=i<<1^(i>>9)*1335;return(r<<10|i)^no.formatMask},versionBits(e){let n=e;for(let e=0;e<12;e++)n=n<<1^(n>>11)*7973;return e<<12|n},alphabet:Object.freeze({numeric:Ka(`0123456789`),alphanumerc:Ka(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`)}),lengthBits(e,n){return{numeric:[10,12,14],alphanumeric:[9,11,13],byte:[8,16,16],kanji:[8,10,12],eci:[0,0,0]}[n][no.sizeType(e)]},modeBits:Object.freeze({numeric:`0001`,alphanumeric:`0010`,byte:`0100`,kanji:`1000`,eci:`0111`}),capacity(e,n){let r=$a[e-1],i=eo[n][e-1],a=to[n][e-1],o=Math.floor(r/a)-i,s=a-r%a;return{words:i,numBlocks:a,shortBlocks:s,blockLen:o,capacity:(r-i*a)*8,total:(i+o)*a+a-s}}}),ro=Object.freeze([(e,n)=>(e+n)%2==0,(e,n)=>n%2==0,(e,n)=>e%3==0,(e,n)=>(e+n)%3==0,(e,n)=>(Math.floor(n/2)+Math.floor(e/3))%2==0,(e,n)=>e*n%2+e*n%3==0,(e,n)=>(e*n%2+e*n%3)%2==0,(e,n)=>((e+n)%2+e*n%3)%2==0]),$={tables:(e=>{let n=Ha(256,0),r=Ha(256,0);for(let i=0,a=1;i<256;i++)n[i]=a,r[a]=i,a<<=1,a&256&&(a^=e);return{exp:n,log:r}})(285),exp:e=>$.tables.exp[e],log(e){if(e===0)throw Error(`GF.log: invalid arg=${e}`);return $.tables.log[e]%255},mul(e,n){return e===0||n===0?0:$.tables.exp[($.tables.log[e]+$.tables.log[n])%255]},add:(e,n)=>e^n,pow:(e,n)=>$.tables.exp[$.tables.log[e]*n%255],inv(e){if(e===0)throw Error(`GF.inverse: invalid arg=${e}`);return $.tables.exp[255-$.tables.log[e]]},polynomial(e){if(e.length==0)throw Error(`GF.polymomial: invalid length`);if(e[0]!==0)return e;let n=0;for(;n<e.length-1&&e[n]==0;n++);return e.slice(n)},monomial(e,n){if(e<0)throw Error(`GF.monomial: invalid degree=${e}`);if(n==0)return[0];let r=Ha(e+1,0);return r[0]=n,$.polynomial(r)},degree:e=>e.length-1,coefficient:(e,n)=>e[$.degree(e)-n],mulPoly(e,n){if(e[0]===0||n[0]===0)return[0];let r=Ha(e.length+n.length-1,0);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]=$.add(r[i+a],$.mul(e[i],n[a]));return $.polynomial(r)},mulPolyScalar(e,n){if(n==0)return[0];if(n==1)return e;let r=Ha(e.length,0);for(let i=0;i<e.length;i++)r[i]=$.mul(e[i],n);return $.polynomial(r)},mulPolyMonomial(e,n,r){if(n<0)throw Error(`GF.mulPolyMonomial: invalid degree`);if(r==0)return[0];let i=Ha(e.length+n,0);for(let n=0;n<e.length;n++)i[n]=$.mul(e[n],r);return $.polynomial(i)},addPoly(e,n){if(e[0]===0)return n;if(n[0]===0)return e;let r=e,i=n;r.length>i.length&&([r,i]=[i,r]);let a=Ha(i.length,0),o=i.length-r.length,s=i.slice(0,o);for(let e=0;e<s.length;e++)a[e]=s[e];for(let e=o;e<i.length;e++)a[e]=$.add(r[e-o],i[e]);return $.polynomial(a)},remainderPoly(e,n){let r=Array.from(e);for(let i=0;i<e.length-n.length+1;i++){let e=r[i];if(e!==0)for(let a=1;a<n.length;a++)n[a]!==0&&(r[i+a]=$.add(r[i+a],$.mul(n[a],e)))}return r.slice(e.length-n.length+1,r.length)},divisorPoly(e){let n=[1];for(let r=0;r<e;r++)n=$.mulPoly(n,[1,$.pow(2,r)]);return n},evalPoly(e,n){if(n==0)return $.coefficient(e,0);let r=e[0];for(let i=1;i<e.length;i++)r=$.add($.mul(n,r),e[i]);return r},euclidian(e,n,r){$.degree(e)<$.degree(n)&&([e,n]=[n,e]);let i=e,a=n,o=[0],s=[1];for(;2*$.degree(a)>=r;){let e=i,n=o;if(i=a,o=s,i[0]===0)throw Error(`rLast[0] === 0`);a=e;let r=[0],c=$.inv(i[0]);for(;$.degree(a)>=$.degree(i)&&a[0]!==0;){let e=$.degree(a)-$.degree(i),n=$.mul(a[0],c);r=$.addPoly(r,$.monomial(e,n)),a=$.addPoly(a,$.mulPolyMonomial(i,e,n))}if(r=$.mulPoly(r,o),s=$.addPoly(r,n),$.degree(a)>=$.degree(i))throw Error(`Division failed r: ${a}, rLast: ${i}`)}let c=$.coefficient(s,0);if(c==0)throw Error(`sigmaTilde(0) was zero`);let l=$.inv(c);return[$.mulPolyScalar(s,l),$.mulPolyScalar(a,l)]}};function io(e){return{encode(n){let r=$.divisorPoly(e),i=Array.from(n);return i.push(...r.slice(0,-1).fill(0)),Uint8Array.from($.remainderPoly(i,r))},decode(n){let r=n.slice(),i=$.polynomial(Array.from(n)),a=Ha(e,0),o=!1;for(let n=0;n<e;n++){let e=$.evalPoly(i,$.exp(n));a[a.length-1-n]=e,e!==0&&(o=!0)}if(!o)return r;a=$.polynomial(a);let s=$.monomial(e,1),[c,l]=$.euclidian(s,a,e),u=Ha($.degree(c),0),d=0;for(let e=1;e<256&&d<u.length;e++)$.evalPoly(c,e)===0&&(u[d++]=$.inv(e));if(d!==u.length)throw Error(`RS.decode: invalid errors number`);for(let e=0;e<u.length;e++){let n=r.length-1-$.log(u[e]);if(n<0)throw Error(`RS.decode: invalid error location`);let i=$.inv(u[e]),a=1;for(let n=0;n<u.length;n++)e!==n&&(a=$.mul(a,$.add(1,$.mul(u[n],i))));r[n]=$.add(r[n],$.mul($.evalPoly(l,i),$.inv(a)))}return r}}}function ao(e,n){let{words:r,shortBlocks:i,numBlocks:a,blockLen:o,total:s}=no.capacity(e,n),c=io(r);return{encode(e){let n=[],r=[];for(let s=0;s<a;s++){let a=o+ +!(s<i);n.push(e.subarray(0,a)),r.push(c.encode(e.subarray(0,a))),e=e.subarray(a)}let s=Wa(n),l=Wa(r),u=new Uint8Array(s.length+l.length);return u.set(s),u.set(l,s.length),u},decode(e){if(e.length!==s)throw Error(`interleave.decode: len(data)=${e.length}, total=${s}`);let n=[];for(let e=0;e<a;e++){let a=e<i;n.push(new Uint8Array(r+o+ +!a))}let l=0;for(let r=0;r<o;r++)for(let i=0;i<a;i++)n[i][r]=e[l++];for(let r=i;r<a;r++)n[r][o]=e[l++];for(let s=o;s<o+r;s++)for(let r=0;r<a;r++){let a=r<i;n[r][s+ +!a]=e[l++]}let u=[];for(let e of n)u.push(...Array.from(c.decode(e)).slice(0,-r));return Uint8Array.from(u)}}}function oo(e,n,r,i=!1){let a=no.size.encode(e),o=new Xa(a+2),s=new Xa(3).rect(0,3,!0).border(1,!1).border(1,!0).border(1,!1);o=o.embed(0,s).embed({x:-s.width,y:0},s).embed({x:0,y:-s.height},s),o=o.rectSlice(1,a);let c=new Xa(1).rect(0,1,!0).border(1,!1).border(1,!0),l=no.alignmentPatterns(e);for(let e of l)for(let n of l)o.isDefined(n,e)||o.embed({x:n-2,y:e-2},c);o=o.hLine({x:0,y:6},1/0,({x:e})=>o.isDefined(e,6)?void 0:e%2==0).vLine({x:6,y:0},1/0,({y:e})=>o.isDefined(6,e)?void 0:e%2==0);{let e=no.formatBits(n,r),s=n=>!i&&(e>>n&1)==1;for(let e=0;e<6;e++)o.set(8,e,s(e));for(let e=6;e<8;e++)o.set(8,e+1,s(e));for(let e=8;e<15;e++)o.set(8,a-15+e,s(e));for(let e=0;e<8;e++)o.set(a-e-1,8,s(e));for(let e=8;e<9;e++)o.set(15-e-1+1,8,s(e));for(let e=9;e<15;e++)o.set(15-e-1,8,s(e));o.set(8,a-8,!i)}if(e>=7){let n=no.versionBits(e);for(let e=0;e<18;e+=1){let r=!i&&(n>>e&1)==1,s=Math.floor(e/3),c=e%3+a-8-3;o.set(c,s,r),o.set(s,c,r)}}return o}function so(e,n,r){let i=e,a=i.height,o=ro[n],s=-1,c=a-1;for(let e=a-1;e>0;e-=2){for(e==6&&(e=5);;c+=s){for(let n=0;n<2;n+=1){let a=e-n;i.isDefined(a,c)||r(a,c,o(a,c))}if(c+s<0||c+s>=a)break}s=-s}}function co(e){let n=`numeric`;for(let r of e)if(!no.alphabet.numeric.has(r)&&(n=`alphanumeric`,!no.alphabet.alphanumerc.has(r)))return`byte`;return n}function lo(e){if(typeof e!=`string`)throw Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function uo(e,n,r,i,a=lo){let o=``,s=r.length;if(i===`numeric`){let e=no.alphabet.numeric.decode(r.split(``)),n=e.length;for(let r=0;r<n-2;r+=3)o+=Ba(e[r]*100+e[r+1]*10+e[r+2],10);n%3==1?o+=Ba(e[n-1],4):n%3==2&&(o+=Ba(e[n-2]*10+e[n-1],7))}else if(i===`alphanumeric`){let e=no.alphabet.alphanumerc.decode(r.split(``)),n=e.length;for(let r=0;r<n-1;r+=2)o+=Ba(e[r]*45+e[r+1],11);n%2==1&&(o+=Ba(e[n-1],6))}else if(i===`byte`){let e=a(r);s=e.length,o=Array.from(e).map(e=>Ba(e,8)).join(``)}else throw Error(`encode: unsupported type`);let{capacity:c}=no.capacity(e,n),l=Ba(s,no.lengthBits(e,i)),u=no.modeBits[i]+l+o;if(u.length>c)throw Error(`Capacity overflow`);u+=`0`.repeat(Math.min(4,Math.max(0,c-u.length))),u.length%8&&(u+=`0`.repeat(8-u.length%8));for(let e=0;u.length!==c;e++)u+=`1110110000010001`[e%16];let d=Uint8Array.from(u.match(/(.{8})/g).map(e=>Number(`0b${e}`)));return ao(e,n).encode(d)}function fo(e,n,r,i,a=!1){let o=oo(e,n,i,a),s=0,c=8*r.length;if(so(o,i,(e,n,i)=>{let a=!1;s<c&&(a=(r[s>>>3]>>(7-s&7)&1)!=0,s++),o.set(e,n,a!==i)}),s!==c)throw Error(`QR: bytes left after draw`);return o}var po=e=>{let n=e.map(e=>e?`1`:`0`).join(``);return{len:n.length,n:Number(`0b${n}`)}},mo=[!0,!1,!0,!0,!0,!1,!0],ho=[!1,!1,!1,!1],go=po([...mo,...ho]),_o=po([...ho,...mo]);function vo(e){let n=e,{width:r,height:i}=n,a=n.transpose(),o=0;for(let e=0;e<i;e++)n.getRuns(e,e=>{e>=5&&(o+=3+(e-5))});for(let e=0;e<r;e++)a.getRuns(e,e=>{e>=5&&(o+=3+(e-5))});let s=0;for(let e=0;e<i-1;e++)s+=3*n.countBoxes2x2(e);let c=0;for(let e=0;e<i;e++)c+=40*n.countPatternInRow(e,go.len,go.n,_o.n);for(let e=0;e<r;e++)c+=40*a.countPatternInRow(e,go.len,go.n,_o.n);let l=i*r,u=n.popcnt(),d=10*Math.ceil(Math.max(0,Math.abs(u*100-l*50)-l*5)/(l*5));return o+s+c+d}function yo(e,n,r,i){if(i===void 0){let a=Ga();for(let i=0;i<ro.length;i++)a.add(vo(fo(e,n,r,i,!0)),i);i=a.get()}if(i===void 0)throw Error(`Cannot find mask`);return fo(e,n,r,i)}function bo(e){if(!Za.includes(e))throw Error(`Invalid error correction mode=${e}. Expected: ${Za}`)}function xo(e){if(!Qa.includes(e))throw Error(`Encoding: invalid mode=${e}. Expected: ${Qa}`);if(e===`kanji`||e===`eci`)throw Error(`Encoding: ${e} is not supported (yet?).`)}function So(e){if(![0,1,2,3,4,5,6,7].includes(e)||!ro[e])throw Error(`Invalid mask=${e}. Expected number [0..7]`)}function Co(e,n=`raw`,r={}){let i=r,a=i.ecc===void 0?`medium`:i.ecc;bo(a);let o=i.encoding===void 0?co(e):i.encoding;xo(o),i.mask!==void 0&&So(i.mask);let s=i.version,c,l=Error(`Unknown error`);if(s!==void 0)za(s),c=uo(s,a,e,o,i.textEncoder);else for(let n=1;n<=40;n++)try{c=uo(n,a,e,o,i.textEncoder),s=n;break}catch(e){l=e}if(!s||!c)throw l;let u=yo(s,a,c,i.mask);u.assertDrawn();let d=i.border===void 0?2:i.border;if(!Number.isSafeInteger(d)||d<=0)throw Error(`invalid border=${d}`);if(u=u.border(d,!1),i.scale!==void 0&&(u=u.scale(i.scale)),n===`raw`)return u.toRaw();if(n===`ascii`)return u.toASCII();if(n===`svg`)return u.toSVG(i.optimize);if(n===`gif`)return u.toGIF();if(n===`term`)return u.toTerm();throw Error(`Unknown output: ${n}`)}var wo=Object.freeze({best:Ga,bin:Ba,popcnt:Ua,drawTemplate:oo,fillArr:Ha,info:no,interleave:ao,validateVersion:za,zigzag:so}),To=window.OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement(`canvas`),Eo=To.getContext(`2d`,{willReadFrequently:!0});Eo.imageSmoothingEnabled=!1;function Do({text:e,arena:n,backgroundMask:r,arenaCircle:i=!0,caption:a}){let o=s(null),[c,l]=I(0),[u,d]=I(!1),[f,p]=I(!1),m=f?!1:i;if(y(()=>{if(a&&o.current){let e=o.current.offsetHeight;l(e)}},[a]),y(()=>{if(n){let e=new Image;e.crossOrigin=`anonymous`,e.onload=()=>{d(!0);try{let{width:n,height:r}=e;To.width=n,To.height=r,Eo.drawImage(e,0,0);let i=Eo.getImageData(0,0,n,r).data,a=i.length/4,o=0,s=!1;for(let e=3;e<i.length;e+=4)if(i[e]<=128&&o++,o/a>.1){s=!0;break}p(s)}catch{p(!1)}},e.onerror=e=>{d(!0)},e.src=n}else d(!1)},[n]),!e)return null;let h=g(()=>Co(e,`raw`,{ecc:`high`,border:1,scale:1}).slice(1,-1).map(e=>e.slice(1,-1)),[e]),_=h.length,v=u?Math.ceil(_*.3):0,b=Math.floor((_-v)/2),x=b+v,S=(e,n)=>{if(e<0||e>=_||n<0||n>=_)return!1;if(u&&e>=b&&e<x&&n>=b&&n<x)if(i){let r=(b+x)/2,i=(b+x)/2,a=v/2,o=e+.5-r,s=n+.5-i;if(Math.sqrt(o*o+s*s)<a)return!1}else return!1;return h[n][e]},C=(e,n)=>e<0||e>=_||n<0||n>=_?!1:S(e,n),w=(e,n)=>e<7&&n<7||e>=_-7&&n<7||e<7&&n>=_-7,T=g(()=>{let e=``;for(let n=0;n<_;n++)for(let r=0;r<_;r++){if(!C(r,n)||w(r,n))continue;let i=r+.5,a=n+.5,o=C(r,n-1)&&!w(r,n-1),s=C(r+1,n)&&!w(r+1,n),c=C(r,n+1)&&!w(r,n+1),l=C(r-1,n)&&!w(r-1,n);s&&(e+=`M ${i} ${a} L ${i+1} ${a} `),c&&(e+=`M ${i} ${a} L ${i} ${a+1} `),!o&&!s&&!c&&!l&&(e+=`M ${i} ${a} L ${i} ${a} `)}return e},[_,h,u,b,x,v,m]),E=[{x:0,y:0},{x:_-7,y:0},{x:0,y:_-7}],ee=1.1,D=.6,O=v-2,k=b+1,A=b+1,j=_+4,M=_+4+(a?2+c:0),N=j*.25;return L(`svg`,{class:`qr-code`,viewBox:`-2 -2 ${j} ${M}`,xmlns:`http://www.w3.org/2000/svg`,"shape-rendering":`geometricPrecision`,children:[L(`defs`,{children:[L(`g`,{id:`position-marker`,children:[L(`rect`,{x:`0.5`,y:`0.5`,width:`6`,height:`6`,fill:`none`,stroke:`currentColor`,"stroke-width":`1`,rx:ee,ry:ee}),L(`rect`,{x:`2`,y:`2`,width:`3`,height:`3`,fill:`currentColor`,rx:D,ry:D})]}),L(`g`,{id:`position-marker-mask`,children:[L(`rect`,{x:`0.5`,y:`0.5`,width:`6`,height:`6`,fill:`none`,stroke:`white`,"stroke-width":`1`,rx:ee,ry:ee}),L(`rect`,{x:`2`,y:`2`,width:`3`,height:`3`,fill:`white`,rx:D,ry:D})]}),r&&L(`filter`,{id:`blur-mask`,children:[L(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:`2`}),L(`feColorMatrix`,{type:`saturate`,values:`2`}),L(`feComponentTransfer`,{children:[L(`feFuncR`,{type:`linear`,slope:`1.2`,intercept:`0.3`}),L(`feFuncG`,{type:`linear`,slope:`1.2`,intercept:`0.3`}),L(`feFuncB`,{type:`linear`,slope:`1.2`,intercept:`0.3`})]})]}),r&&L(`mask`,{id:`qr-pattern-mask`,children:[L(`path`,{fill:`white`,stroke:`white`,"stroke-width":`1`,"stroke-linejoin":`round`,"stroke-linecap":`round`,d:T}),L(`g`,{id:`position-markers-mask`,children:E.map(e=>L(`use`,{href:`#position-marker-mask`,x:e.x,y:e.y},`${e.x}-${e.y}`))}),u&&m&&L(`circle`,{cx:k+O/2,cy:A+O/2,r:O/2,fill:`black`}),u&&!i&&L(`rect`,{x:k,y:A,width:O,height:O,fill:`black`})]}),L(`path`,{id:`qr-pattern`,fill:`currentColor`,stroke:`currentColor`,"stroke-width":`1`,"stroke-linejoin":`round`,"stroke-linecap":`round`,d:T})]}),L(`use`,{href:`#qr-pattern`}),L(`g`,{id:`position-markers`,children:E.map(e=>L(`use`,{href:`#position-marker`,x:e.x,y:e.y},`${e.x}-${e.y}`))}),r&&L(`g`,{mask:`url(#qr-pattern-mask)`,children:L(`image`,{href:r,x:-2-N,y:-2-N,width:j+N*2,height:j+N*2,preserveAspectRatio:`none`,opacity:`0.5`,filter:`url(#blur-mask)`})}),n&&u&&L(`image`,{href:n,x:k,y:A,width:O,height:O,preserveAspectRatio:`xMidYMid slice`,"clip-path":m?`circle(${O/2}px at ${O/2}px ${O/2}px)`:void 0}),a&&L(`foreignObject`,{x:0,y:_+2,width:_,height:c,children:L(`div`,{ref:o,xmlns:`http://www.w3.org/1999/xhtml`,class:`qr-code-caption`,dangerouslySetInnerHTML:{__html:a}})})]})}var Oo=!!navigator.mediaDevices?.getUserMedia;function ko({text:e,arena:n,backgroundMask:r,caption:i,onClose:a,onScannerClick:o}){let{_:s}=d();return L(`div`,{class:`qr-code-modal-container`,children:[L(`div`,{class:`qr-code-modal-controls`,children:[Oo&&typeof o==`function`?L(`button`,{type:`button`,class:`plain4`,onClick:o,children:L(X,{icon:`scan`,alt:s({id:`XDwkfO`})})}):L(`span`,{}),!!a&&L(`button`,{type:`button`,class:`plain4`,onClick:a,children:L(X,{icon:`x`,alt:s({id:`yz7wBu`})})})]}),L(Do,{text:e,arena:n,backgroundMask:r,caption:i}),L(`div`,{class:`qr-code-text`,children:e})]})}var Ao=`BarcodeDetector`in window;Ao||setTimeout(()=>{pe(()=>import(`./dom-p1YcJ5Rw.js`),[],import.meta.url).catch(()=>{})},1e3);var jo=class{constructor(e,n){this.stream=e,this.player=n,this.setStream(e)}setStream(e){this.stream=e;let{player:n}=this;n.setAttribute(`autoplay`,``),n.setAttribute(`muted`,``),n.setAttribute(`playsinline`,``),n.srcObject=e}async listDevices(){if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)throw Error(`Media Devices not supported`);return(await navigator.mediaDevices.enumerateDevices()).filter(e=>e.kind===`videoinput`).map(e=>({deviceId:e.deviceId,label:e.label||`Camera ${e.deviceId}`}))}async setDevice(e){this.stop();let n=await navigator.mediaDevices.getUserMedia({video:{deviceId:{exact:e}}});this.setStream(n)}readFrame(e,n=!1){let{player:r}=this;if(n)return e.drawImage(r,r.videoHeight,r.videoWidth);let i=getSize(r);return e.drawImage(r,i.height,i.width)}stop(){for(let e of this.stream.getTracks())e.stop()}},Mo=async e=>{if(navigator.permissions?.query)try{(await navigator.permissions.query({name:`camera`})).addEventListener(`change`,()=>{})}catch{}return new jo(await navigator.mediaDevices.getUserMedia({video:{height:{ideal:720},width:{ideal:1280},facingMode:`environment`}}),e)};function No({onClose:e,checkValidity:n,actionableText:r}){let{_:a,_:o}=d(),c=s(null),l=s(null),u=s(null),[f,p]=I(``),[m,h]=I(!0),[g,_]=I(`loading`);y(()=>{let e;return screen?.orientation?.type&&c.current&&(e=()=>{let e=/landscape/.test(window.screen.orientation.type)?`landscape`:`portrait`;c.current.classList.toggle(`landscape`,e===`landscape`)},screen.orientation.addEventListener(`change`,e),e()),()=>{e&&screen?.orientation?.removeEventListener&&screen.orientation.removeEventListener(`change`,e)}},[]),y(()=>{let e,n,r,i,a;return m&&(async()=>{try{n=await Mo(l.current),Ao?i=new BarcodeDetector({formats:[`qr_code`]}):(a=await pe(()=>import(`./dom-p1YcJ5Rw.js`),[],import.meta.url),r=new a.QRCanvas({overlay:u.current},{cropToSquare:!1,overlayMainColor:`transparent`,overlayFinderColor:`rgba(255, 0, 255, 0.5)`}));let o=l.current;o&&(o.addEventListener(`loadedmetadata`,()=>{_(`default`)}),o.addEventListener(`play`,()=>{let{videoWidth:s,videoHeight:u}=o;if(s&&u&&(c.current.style.setProperty(`--long-dimension`,Math.max(s,u)),c.current.style.setProperty(`--short-dimension`,Math.min(s,u))),Ao){let n=async()=>{try{let e=await i.detect(l.current);e.length>0&&p(e[0].rawValue)}catch{}},r,a=()=>{n(),r=requestAnimationFrame(a)};a(),e=()=>cancelAnimationFrame(r)}else e=a.frameLoop(()=>{try{let e=n.readFrame(r,!0);e!=null&&p(e)}catch{}})}))}catch{_(`error`),h(!1)}})(),()=>{e&&e(),n&&n.stop(),r&&r.clear()}},[m]);let v=typeof n==`function`?n(f):!!f;return L(`div`,{class:`qr-scanner-modal`,children:[L(`div`,{class:`qr-scanner-header`,children:[L(q,{abrupt:!0,hidden:g!==`loading`}),L(`button`,{type:`button`,class:`plain4`,onClick:e,children:L(X,{icon:`x`,alt:a({id:`yz7wBu`})})})]}),g===`error`?L(`div`,{class:`ui-state`,children:L(`p`,{children:L(j,{id:`08IojR`})})}):L(i,{children:[L(`div`,{ref:c,class:`qr-scanner-video-container`,children:[L(`video`,{ref:l,playsInline:!0,muted:!0,disablepictureinpicture:!0}),!Ao&&L(`canvas`,{ref:u,class:`qr-scanner-canvas`}),L(`svg`,{class:`qr-scanner-corner-hint`,viewBox:`0 0 100 100`,preserveAspectRatio:`xMidYMid meet`,children:[L(`path`,{d:`M 25 10 L 15 10 Q 10 10 10 15 L 10 25`,stroke:`currentColor`,"stroke-width":`2`,fill:`none`,"stroke-linecap":`round`}),L(`path`,{d:`M 75 10 L 85 10 Q 90 10 90 15 L 90 25`,stroke:`currentColor`,"stroke-width":`2`,fill:`none`,"stroke-linecap":`round`}),L(`path`,{d:`M 25 90 L 15 90 Q 10 90 10 85 L 10 75`,stroke:`currentColor`,"stroke-width":`2`,fill:`none`,"stroke-linecap":`round`}),L(`path`,{d:`M 75 90 L 85 90 Q 90 90 90 85 L 90 75`,stroke:`currentColor`,"stroke-width":`2`,fill:`none`,"stroke-linecap":`round`})]})]}),L(`div`,{class:`qr-scanner-result`,children:!!f&&L(i,{children:[L(`p`,{class:`qr-scanner-text`,children:f}),v&&L(`button`,{type:`button`,class:`button plain6`,onClick:()=>{e({text:f})},children:r?o(r):L(X,{icon:`arrow-right`})})]})})]})]})}var Po=[`spam`,`legal`,`violation`,`other`],Fo={spam:{label:{id:`t8dIOP`},description:{id:`csQin_`}},legal:{label:{id:`IjKdHM`},description:{id:`e6tGFu`}},violation:{label:{id:`KPFHM2`},description:{id:`fpotTF`},stampLabel:{id:`iuLUuH`}},other:{label:{id:`_IX_7x`},description:{id:`kxiG8g`},excludeStamp:!0}};function Io(e,n){if(!e.translations||!n)return null;let r=Object.keys(e.translations);if(!r?.length)return null;let i=se([n],r,null);if(!i){let e=r.map(e=>e.split(/(?=[A-Z])/).map((e,n)=>n===0?e:e.toLowerCase()).join(`-`));i=se([n],e,null)}if(i&&i.includes(`-`)){let[e,n]=i.split(`-`);i=e+n.charAt(0).toUpperCase()+n.slice(1)}return i}function Lo(e,n){return e?.length?n?e.map(e=>{let r=Io(e,n);return{...e,_translatedText:e.translations?.[r]?.text||null}}):e:[]}function Ro({account:e,post:n,onClose:r}){let{_:a,_:o,i18n:c}=d(),{masto:l}=f(),[u,p]=I(`default`),[m,h]=e.acct.split(`@`),[_,v]=g(()=>{let{rules:e,domain:n}=H();return[Lo(e||[],c.locale),n]},[c.locale]),[y,b]=I(null),[x,S]=I(!1),C=s(null),[w,T]=I(!1);return L(`div`,{class:`report-modal-container`,children:[L(`div`,{class:`top-controls`,children:[L(`h1`,{children:o(n?{id:`muLhL3`}:{id:`ACul2G`,values:{username:m}})}),L(`button`,{type:`button`,class:`plain4 small`,disabled:u===`loading`,onClick:()=>r(),children:L(X,{icon:`x`,size:`xl`,alt:o({id:`yz7wBu`})})})]}),L(`main`,{children:[L(`div`,{class:`report-preview`,children:n?L(Ut,{status:n,size:`s`,previewMode:!0}):L(rt,{account:e,avatarSize:`xxl`,useAvatarStatic:!0,showStats:!0,showActivity:!0})}),!!y&&!Fo[y].excludeStamp&&L(`span`,{class:`rubber-stamp`,"aria-hidden":`true`,children:[a(Fo[y].stampLabel||a(Fo[y].label)),L(`small`,{children:L(j,{id:`2WtL62`})})]},y),L(`form`,{onSubmit:i=>{i.preventDefault();let a=new FormData(i.target),s=Object.fromEntries(a.entries()),{category:c,comment:u,forward:d}=s;u||=void 0,d===`on`&&(d=!0);let f=c===`violation`?Object.entries(s).filter(([e])=>e.startsWith(`rule_ids`)).map(([e,n])=>n):void 0;p(`loading`),(async()=>{try{await l.v1.reports.create({accountId:e.id,statusIds:n?.id?[n.id]:void 0,category:c,comment:u,ruleIds:f,forward:d}),p(`success`),Z(o(n?{id:`y3ou-8`}:{id:`R9kjEL`})),r()}catch(e){p(`error`),Z(e?.message||o(n?{id:`-3FjPq`}:{id:`oEQq5w`}))}})()},children:[L(`p`,{children:o(n?{id:`L9fUm-`}:{id:`rSLkfe`})}),L(`section`,{class:`report-categories`,children:Po.map(e=>e===`violation`&&!_?.length?null:L(i,{children:[L(`label`,{class:`report-category`,children:[L(`input`,{type:`radio`,name:`category`,value:e,required:!0,disabled:u===`loading`,onChange:e=>{b(e.target.value),S(e.target.value===`violation`)}}),L(`span`,{children:[a(Fo[e].label),` \xA0`,L(`small`,{class:`ib insignificant`,children:a(Fo[e].description)})]})]}),e===`violation`&&!!_?.length&&L(`div`,{class:`shazam-container no-animation`,hidden:!x,children:L(`div`,{class:`shazam-container-inner`,children:L(`div`,{class:`report-rules`,ref:C,children:_.map((e,n)=>L(`label`,{class:`report-rule`,children:[L(`input`,{type:`checkbox`,name:`rule_ids[${n}]`,value:e.id,required:x&&!w,disabled:u===`loading`,onChange:e=>{let{checked:n}=e.target;n?T(!0):C.current.querySelectorAll(`input:checked`).length||T(!1)}}),L(`span`,{children:e._translatedText||e.text})]},e.id))})})})]},e))}),L(`section`,{class:`report-comment`,children:[L(`p`,{children:L(`label`,{for:`report-comment`,children:L(j,{id:`ecVtjm`})})}),L(`textarea`,{maxlength:`1000`,rows:`1`,name:`comment`,id:`report-comment`,disabled:u===`loading`,required:!n})]}),!!h&&h!==v&&L(`section`,{children:L(`p`,{children:L(`label`,{children:[L(`input`,{type:`checkbox`,switch:!0,name:`forward`,disabled:u===`loading`}),` `,L(`span`,{children:L(j,{id:`cyjS8M`,values:{domain:h},components:{0:L(`i`,{})}})})]})})}),L(`footer`,{children:[L(`button`,{type:`submit`,disabled:u===`loading`,children:L(j,{id:`4cijjm`})}),` `,L(`button`,{type:`submit`,class:`plain2`,disabled:u===`loading`,onClick:async()=>{try{await l.v1.accounts.$select(e.id).mute(),Z(o({id:`_BGBeF`,values:{username:m}}))}catch{Z(o({id:`v02K7_`,values:{username:m}}))}},children:L(j,{id:`caeqw_`,components:{0:L(`small`,{class:`ib`})}})}),` `,L(`button`,{type:`submit`,class:`plain2`,disabled:u===`loading`,onClick:async()=>{try{await l.v1.accounts.$select(e.id).block(),Z(o({id:`kjUejn`,values:{username:m}}))}catch{Z(o({id:`pMcdDp`,values:{username:m}}))}},children:L(j,{id:`JybQca`,components:{0:L(`small`,{class:`ib`})}})}),L(q,{hidden:u!==`loading`})]})]})]})]})}var zo=n(((e,n)=>{var r=(function(){var e=String.fromCharCode,n=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`,r=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$`,i={};function a(e,n){if(!i[e]){i[e]={};for(var r=0;r<e.length;r++)i[e][e.charAt(r)]=r}return i[e][n]}var o={compressToBase64:function(e){if(e==null)return``;var r=o._compress(e,6,function(e){return n.charAt(e)});switch(r.length%4){default:case 0:return r;case 1:return r+`===`;case 2:return r+`==`;case 3:return r+`=`}},decompressFromBase64:function(e){return e==null?``:e==``?null:o._decompress(e.length,32,function(r){return a(n,e.charAt(r))})},compressToUTF16:function(n){return n==null?``:o._compress(n,15,function(n){return e(n+32)})+` `},decompressFromUTF16:function(e){return e==null?``:e==``?null:o._decompress(e.length,16384,function(n){return e.charCodeAt(n)-32})},compressToUint8Array:function(e){for(var n=o.compress(e),r=new Uint8Array(n.length*2),i=0,a=n.length;i<a;i++){var s=n.charCodeAt(i);r[i*2]=s>>>8,r[i*2+1]=s%256}return r},decompressFromUint8Array:function(n){if(n==null)return o.decompress(n);for(var r=Array(n.length/2),i=0,a=r.length;i<a;i++)r[i]=n[i*2]*256+n[i*2+1];var s=[];return r.forEach(function(n){s.push(e(n))}),o.decompress(s.join(``))},compressToEncodedURIComponent:function(e){return e==null?``:o._compress(e,6,function(e){return r.charAt(e)})},decompressFromEncodedURIComponent:function(e){return e==null?``:e==``?null:(e=e.replace(/ /g,`+`),o._decompress(e.length,32,function(n){return a(r,e.charAt(n))}))},compress:function(n){return o._compress(n,16,function(n){return e(n)})},_compress:function(e,n,r){if(e==null)return``;var i,a,o={},s={},c=``,l=``,u=``,d=2,f=3,p=2,m=[],h=0,g=0,_;for(_=0;_<e.length;_+=1)if(c=e.charAt(_),Object.prototype.hasOwnProperty.call(o,c)||(o[c]=f++,s[c]=!0),l=u+c,Object.prototype.hasOwnProperty.call(o,l))u=l;else{if(Object.prototype.hasOwnProperty.call(s,u)){if(u.charCodeAt(0)<256){for(i=0;i<p;i++)h<<=1,g==n-1?(g=0,m.push(r(h)),h=0):g++;for(a=u.charCodeAt(0),i=0;i<8;i++)h=h<<1|a&1,g==n-1?(g=0,m.push(r(h)),h=0):g++,a>>=1}else{for(a=1,i=0;i<p;i++)h=h<<1|a,g==n-1?(g=0,m.push(r(h)),h=0):g++,a=0;for(a=u.charCodeAt(0),i=0;i<16;i++)h=h<<1|a&1,g==n-1?(g=0,m.push(r(h)),h=0):g++,a>>=1}d--,d==0&&(d=2**p,p++),delete s[u]}else for(a=o[u],i=0;i<p;i++)h=h<<1|a&1,g==n-1?(g=0,m.push(r(h)),h=0):g++,a>>=1;d--,d==0&&(d=2**p,p++),o[l]=f++,u=String(c)}if(u!==``){if(Object.prototype.hasOwnProperty.call(s,u)){if(u.charCodeAt(0)<256){for(i=0;i<p;i++)h<<=1,g==n-1?(g=0,m.push(r(h)),h=0):g++;for(a=u.charCodeAt(0),i=0;i<8;i++)h=h<<1|a&1,g==n-1?(g=0,m.push(r(h)),h=0):g++,a>>=1}else{for(a=1,i=0;i<p;i++)h=h<<1|a,g==n-1?(g=0,m.push(r(h)),h=0):g++,a=0;for(a=u.charCodeAt(0),i=0;i<16;i++)h=h<<1|a&1,g==n-1?(g=0,m.push(r(h)),h=0):g++,a>>=1}d--,d==0&&(d=2**p,p++),delete s[u]}else for(a=o[u],i=0;i<p;i++)h=h<<1|a&1,g==n-1?(g=0,m.push(r(h)),h=0):g++,a>>=1;d--,d==0&&(d=2**p,p++)}for(a=2,i=0;i<p;i++)h=h<<1|a&1,g==n-1?(g=0,m.push(r(h)),h=0):g++,a>>=1;for(;;)if(h<<=1,g==n-1){m.push(r(h));break}else g++;return m.join(``)},decompress:function(e){return e==null?``:e==``?null:o._decompress(e.length,32768,function(n){return e.charCodeAt(n)})},_decompress:function(n,r,i){var a=[],o=4,s=4,c=3,l=``,u=[],d,f,p,m,h,g,_,v={val:i(0),position:r,index:1};for(d=0;d<3;d+=1)a[d]=d;for(p=0,h=2**2,g=1;g!=h;)m=v.val&v.position,v.position>>=1,v.position==0&&(v.position=r,v.val=i(v.index++)),p|=+(m>0)*g,g<<=1;switch(p){case 0:for(p=0,h=2**8,g=1;g!=h;)m=v.val&v.position,v.position>>=1,v.position==0&&(v.position=r,v.val=i(v.index++)),p|=+(m>0)*g,g<<=1;_=e(p);break;case 1:for(p=0,h=2**16,g=1;g!=h;)m=v.val&v.position,v.position>>=1,v.position==0&&(v.position=r,v.val=i(v.index++)),p|=+(m>0)*g,g<<=1;_=e(p);break;case 2:return``}for(a[3]=_,f=_,u.push(_);;){if(v.index>n)return``;for(p=0,h=2**c,g=1;g!=h;)m=v.val&v.position,v.position>>=1,v.position==0&&(v.position=r,v.val=i(v.index++)),p|=+(m>0)*g,g<<=1;switch(_=p){case 0:for(p=0,h=2**8,g=1;g!=h;)m=v.val&v.position,v.position>>=1,v.position==0&&(v.position=r,v.val=i(v.index++)),p|=+(m>0)*g,g<<=1;a[s++]=e(p),_=s-1,o--;break;case 1:for(p=0,h=2**16,g=1;g!=h;)m=v.val&v.position,v.position>>=1,v.position==0&&(v.position=r,v.val=i(v.index++)),p|=+(m>0)*g,g<<=1;a[s++]=e(p),_=s-1,o--;break;case 2:return u.join(``)}if(o==0&&(o=2**c,c++),a[_])l=a[_];else if(_===s)l=f+f.charAt(0);else return null;u.push(l),a[s++]=f+l.charAt(0),o--,f=l,o==0&&(o=2**c,c++)}}};return o})();typeof define==`function`&&define.amd?define(function(){return r}):n!==void 0&&n!=null?n.exports=r:typeof angular<`u`&&angular!=null&&angular.module(`LZString`,[]).factory(`LZString`,function(){return r})}))(),Bo=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2084%2062'%3e%3crect%20width='64'%20height='48'%20x='18'%20y='2'%20fill='%23fff'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3crect%20width='32'%20height='48'%20x='2'%20y='12'%20fill='%23fff'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3cpath%20fill='%234169E1'%20d='M14%2052a4%204%200%201%201-8%200%204%204%200%200%201%208%200Zm64-42a4%204%200%201%201-8%200%204%204%200%200%201%208%200Z'/%3e%3c/svg%3e`,Vo=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2082%2062'%3e%3crect%20width='78'%20height='58'%20x='2'%20y='2'%20fill='%23999'%20fill-opacity='.3'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3crect%20width='18'%20height='46'%20x='8'%20y='8'%20fill='%23fff'%20stroke='%23999'%20stroke-width='2'%20rx='1'/%3e%3crect%20width='18'%20height='46'%20x='32'%20y='8'%20fill='%23fff'%20stroke='%23999'%20stroke-width='2'%20rx='1'/%3e%3crect%20width='18'%20height='46'%20x='56'%20y='8'%20fill='%23fff'%20stroke='%23999'%20stroke-width='2'%20rx='1'/%3e%3c/svg%3e`,Ho=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2084%2062'%3e%3crect%20width='64'%20height='48'%20x='18'%20y='2'%20fill='%23fff'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3cpath%20fill='%23999'%20fill-opacity='.3'%20d='M19%203h62v10H19z'/%3e%3cpath%20stroke='%234169E1'%20stroke-width='2'%20d='M43%208a2%202%200%201%201-4%200%202%202%200%200%201%204%200Z'/%3e%3cpath%20stroke='%23999'%20stroke-width='2'%20d='M52%208a2%202%200%201%201-4%200%202%202%200%200%201%204%200Zm9%200a2%202%200%201%201-4%200%202%202%200%200%201%204%200Z'/%3e%3crect%20width='32'%20height='48'%20x='2'%20y='12'%20fill='%23fff'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3cpath%20fill='%23999'%20fill-opacity='.3'%20d='M3%2049h30v10H3z'/%3e%3cpath%20stroke='%234169E1'%20stroke-width='2'%20d='M11%2054a2%202%200%201%201-4%200%202%202%200%200%201%204%200Z'/%3e%3cpath%20stroke='%23999'%20stroke-width='2'%20d='M20%2054a2%202%200%201%201-4%200%202%202%200%200%201%204%200Zm9%200a2%202%200%201%201-4%200%202%202%200%200%201%204%200Z'/%3e%3c/svg%3e`,Uo=200,Wo=10;async function Go(){let{masto:e}=f(),n=e.v1.followedTags.list({limit:Uo}).values(),r=[],i=0;do{let{value:e,done:a}=await n.next();if(a||e?.length===0)break;r.push(...e),i++}while(i<Wo);return r.sort((e,n)=>e.name.localeCompare(n.name)),r.length&&setTimeout(()=>{F.account.set(`followedTags`,{tags:r,updatedAt:Date.now()})},1),r}var Ko=1440*60*1e3;async function qo(){try{let{tags:e,updatedAt:n}=F.account.get(`followedTags`)||{};return e?.length?(Date.now()-n>Ko&&Go(),e):await Go()}catch{return[]}}var Jo=document.createElement(`div`),Yo=e=>{if(!e||e.indexOf(`#`)===-1)return[];Jo.innerHTML=e;let n=Jo.querySelectorAll(`a.hashtag`);return n.length?Array.from(n).map(e=>e.innerText.trim().replace(/^[^#]*#+/,``)):[]};function Xo({children:e}){if(typeof e==`string`)return e;let[n,r]=I(``);return y(()=>{Promise.resolve(e).then(r)},[e]),n}var Zo=[`following`,`mentions`,`notifications`,`list`,`public`,`trending`,`search`,`hashtag`,`bookmarks`,`favourites`,`profile`],Qo={following:{id:`7ZJHdw`},notifications:{id:`iDNBZe`},list:{id:`h16FyT`},public:{id:`tXgQpk`},search:{id:`A1taO8`},"account-statuses":{id:`AeXO77`},bookmarks:{id:`7Ff7ia`},favourites:{id:`zZOZj7`},hashtag:{id:`GP8RLS`},trending:{id:`4_iCqx`},mentions:{id:`_bZzdR`},profile:{id:`vERlcd`}},$o={list:[{text:{id:`DUMt1y`},name:`id`,notRequired:!0}],public:[{text:{id:`OgyJSr`},name:`local`,type:`checkbox`},{text:{id:`sGH11W`},name:`instance`,type:`text`,placeholder:{id:`7defFj`},notRequired:!0}],trending:[{text:{id:`sGH11W`},name:`instance`,type:`text`,placeholder:{id:`7defFj`},notRequired:!0}],search:[{text:{id:`dmloPh`},name:`query`,type:`text`,placeholder:{id:`UHDQDE`},notRequired:!0}],"account-statuses":[{text:`@`,name:`id`,type:`text`,placeholder:`cheeaun@mastodon.social`}],hashtag:[{text:`#`,name:`hashtag`,type:`text`,placeholder:{id:`a6oTWs`},pattern:`[^#]+`},{text:{id:`eK4SL_`},name:`media`,type:`checkbox`},{text:{id:`sGH11W`},name:`instance`,type:`text`,placeholder:{id:`7defFj`},notRequired:!0}]},es={following:{id:`home`,title:(e,n)=>n===0?G._({id:`i0qMbr`}):G._({id:`following.title`}),path:`/`,icon:`home`},mentions:{id:`mentions`,title:{id:`_bZzdR`},path:`/mentions`,icon:`at`},notifications:{id:`notifications`,title:{id:`iDNBZe`},path:`/notifications`,icon:`notification`},list:{id:({id:e})=>e?`list`:`lists`,title:({id:e})=>e?Oi(e):G._({id:`h16FyT`}),path:({id:e})=>e?`/l/${e}`:`/l`,icon:`list`,excludeViewMode:({id:e})=>e?[]:[`multi-column`]},public:{id:`public`,title:({local:e})=>e?G._({id:`d5zxa4`}):G._({id:`4ERYY7`}),subtitle:({instance:e})=>e||f().instance,path:({local:e,instance:n})=>`/${n}/p${e?`/l`:``}`,icon:({local:e})=>e?`building`:`earth`},trending:{id:`trending`,title:{id:`4_iCqx`},subtitle:({instance:e})=>e||f().instance,path:({instance:e})=>`/${e}/trending`,icon:`chart`},search:{id:`search`,title:({query:e})=>e?`“${e}”`:G._({id:`A1taO8`}),path:({query:e})=>e?`/search?q=${encodeURIComponent(e)}&type=statuses`:`/search`,icon:`search`,excludeViewMode:({query:e})=>e?[]:[`multi-column`]},profile:{id:`profile`,title:{id:`vERlcd`},path:()=>`/a/${ee()}?replies=1`,icon:`user`,altIcon:()=>{let e=R();return{url:e?.info?.avatarStatic||e?.info?.avatar,type:`avatar`}}},"account-statuses":{id:`account-statuses`,title:a(async({id:e})=>{let n=await f().masto.v1.accounts.$select(e).fetch();return n.username||n.acct||n.displayName}),path:({id:e})=>`/a/${e}`,icon:`user`},bookmarks:{id:`bookmarks`,title:{id:`7Ff7ia`},path:`/b`,icon:`bookmark`},favourites:{id:`favourites`,title:{id:`zZOZj7`},path:`/f`,icon:`heart`},hashtag:{id:`hashtag`,title:({hashtag:e})=>e,subtitle:({instance:e})=>e||f().instance,path:({hashtag:e,instance:n,media:r})=>`${n?`/${n}`:``}/t/${e.split(/\s+/).join(`+`)}${r?`?media=1`:``}`,icon:`hashtag`}};function ts({onClose:e}){let{_:n}=d(),r=W(k),{shortcuts:a}=r,[o,s]=I(!1),[c,l]=I(!1),[u]=lr();return L(`div`,{id:`shortcuts-settings-container`,class:`sheet`,tabindex:`-1`,children:[!!e&&L(`button`,{type:`button`,class:`sheet-close`,onClick:e,children:L(X,{icon:`x`,alt:G._({id:`yz7wBu`})})}),L(`header`,{children:L(`h2`,{children:[L(X,{icon:`shortcut`}),` `,L(j,{id:`CTqTgr`}),` `,L(`sup`,{style:{fontSize:12,opacity:.5,textTransform:`uppercase`},children:L(j,{id:`A1As8l`})})]})}),L(`main`,{children:[L(`p`,{children:L(j,{id:`CIHAsy`})}),L(`div`,{class:`shortcuts-view-mode`,children:[{value:`float-button`,label:G._({id:`qwdOim`}),imgURL:Bo},{value:`tab-menu-bar`,label:G._({id:`UxBoCm`}),imgURL:Ho},{value:`multi-column`,label:G._({id:`uvDfdW`}),imgURL:Vo}].map(({value:e,label:n,imgURL:i})=>{let a=r.settings.shortcutsViewMode===e||e===`float-button`&&!r.settings.shortcutsViewMode;return L(`label`,{class:a?`checked`:``,children:[L(`input`,{type:`radio`,name:`shortcuts-view-mode`,value:e,checked:a,onChange:e=>{k.settings.shortcutsViewMode=e.target.value}}),` `,L(`img`,{src:i,alt:``,width:`80`,height:`58`}),` `,L(`span`,{children:n})]},e)})}),a.length>0?L(i,{children:[L(`ol`,{class:`shortcuts-list`,ref:u,children:a.filter(Boolean).map((e,o)=>{let c=Object.values(e).join(`-`),{type:l}=e;if(!es[l])return null;let{icon:u,title:d,subtitle:f,excludeViewMode:p}=es[l];d=typeof d==`function`?d(e,o):n(d),f=typeof f==`function`?f(e,o):n(f),typeof u==`function`&&(u=u(e,o)),typeof p==`function`&&(p=p(e,o));let m=p?.includes(r.settings.shortcutsViewMode);return L(`li`,{children:[L(X,{icon:u}),L(`span`,{class:`shortcut-text`,children:[L(Xo,{children:d}),f&&L(i,{children:[` `,L(`small`,{class:`ib insignificant`,children:f})]}),m&&L(`span`,{class:`tag`,children:L(j,{id:`5KJFnN`})})]}),L(`span`,{class:`shortcut-actions`,children:[L(`button`,{type:`button`,class:`plain small`,disabled:o===0,onClick:()=>{let n=Array.from(k.shortcuts);if(o>0){let r=k.shortcuts[o-1];n[o-1]=e,n[o]=r,k.shortcuts=n}},children:L(X,{icon:`arrow-up`,alt:G._({id:`QyioBP`})})}),L(`button`,{type:`button`,class:`plain small`,disabled:o===a.length-1,onClick:()=>{let n=Array.from(k.shortcuts);if(o<k.shortcuts.length-1){let r=k.shortcuts[o+1];n[o+1]=e,n[o]=r,k.shortcuts=n}},children:L(X,{icon:`arrow-down`,alt:G._({id:`3Ib6FN`})})}),L(`button`,{type:`button`,class:`plain small`,onClick:()=>{s({shortcut:e,shortcutIndex:o})},children:L(X,{icon:`pencil`,alt:G._({id:`ePK91l`})})})]})]},c)})}),a.length===1&&r.settings.shortcutsViewMode!==`float-button`&&L(`div`,{class:`ui-state insignificant`,children:[L(X,{icon:`info`}),` `,L(`small`,{children:L(j,{id:`3Xq4Zi`})})]})]}):L(`div`,{class:`ui-state insignificant`,children:[L(`p`,{children:r.settings.shortcutsViewMode===`multi-column`?G._({id:`3xIN-E`}):G._({id:`vLxvHT`})}),L(`p`,{children:L(j,{id:`Fq4zw3`,components:{0:L(`br`,{}),1:L(`a`,{href:`#`,onClick:e=>{e.preventDefault(),k.shortcuts=[{type:`following`},{type:`notifications`}]}})}})})]}),L(`p`,{class:`insignificant`,children:a.length>=9&&(r.settings.shortcutsViewMode===`multi-column`?G._({id:`RqXfsz`,values:{SHORTCUTS_LIMIT:9}}):G._({id:`EVRO_o`,values:{SHORTCUTS_LIMIT:9}}))}),L(`p`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[L(`button`,{type:`button`,class:`light`,onClick:()=>l(!0),children:L(j,{id:`bgVLbt`})}),L(`button`,{type:`button`,disabled:a.length>=9,onClick:()=>s(!0),children:[L(X,{icon:`plus`}),` `,L(`span`,{children:r.settings.shortcutsViewMode===`multi-column`?G._({id:`Vh3ADI`}):G._({id:`9tmn6W`})})]})]})]}),o&&L(Ot,{onClick:e=>{e.target===e.currentTarget&&s(!1)},children:L(rs,{shortcut:o.shortcut,shortcutIndex:o.shortcutIndex,onSubmit:({result:e,mode:n})=>{n===`edit`?k.shortcuts[o.shortcutIndex]=e:k.shortcuts.push(e)},onClose:()=>s(!1)})}),c&&L(Ot,{onClick:e=>{e.target===e.currentTarget&&l(!1)},children:L(is,{shortcuts:a,onClose:()=>l(!1)})})]})}var ns={list:{id:`1qL-L-`},search:{id:`dmTmkQ`},hashtag:{id:`E8laYz`}};function rs({onSubmit:e,disabled:n,shortcut:r,shortcutIndex:i,onClose:a}){let{_:o}=d(),c=!!r,[l,u]=I(r?.type||null),[f,p]=I(`default`),[m,h]=I([]),[g,_]=I([]);y(()=>{(async()=>{if(l===`list`)try{p(`loading`),h(await Ti()),p(`default`)}catch{p(`error`)}})(),(async()=>{if(l===`hashtag`)try{_(await Go())}catch{}})()},[l]);let v=s();return y(()=>{if(c&&l&&$o[l]){let e=v.current;$o[l].forEach(({name:n,type:i})=>{let a=e.querySelector(`[name="${n}"]`);a&&r[n]&&(i===`checkbox`?a.checked=r[n]===`on`:a.value=r[n])})}},[c,l]),L(`div`,{id:`shortcut-settings-form`,class:`sheet`,children:[!!a&&L(`button`,{type:`button`,class:`sheet-close`,onClick:a,children:L(X,{icon:`x`,alt:G._({id:`yz7wBu`})})}),L(`header`,{children:L(`h2`,{children:c?G._({id:`pe1jog`}):G._({id:`Lsxpe5`})})}),L(`main`,{tabindex:`-1`,children:L(`form`,{ref:v,onSubmit:n=>{n.preventDefault();let r=new FormData(n.target),i={};r.forEach((e,n)=>{i[n]=e?.trim(),n===`instance`&&(i[n]=i[n].replace(/^https?:\/\//,``).replace(/\/+$/,``),i[n]=i[n].replace(/^@?[^@]+@/,``))}),i.type&&(e({result:i,mode:c?`edit`:`add`}),n.target.reset(),u(null),a?.())},children:[L(`p`,{children:L(`label`,{children:[L(`span`,{children:L(j,{id:`cklVjM`})}),L(`select`,{required:!0,disabled:n,onChange:e=>{u(e.target.value)},defaultValue:c?r.type:void 0,name:`type`,dir:`auto`,children:[L(`option`,{}),Zo.map(e=>L(`option`,{value:e,children:o(Qo[e])}))]})]})}),$o[l]?.map?.(({text:e,name:i,type:a,placeholder:s,pattern:u,notRequired:d})=>l===`list`?L(`p`,{children:L(`label`,{children:[L(`span`,{children:L(j,{id:`2BBAbc`})}),L(`select`,{name:`id`,required:!d,disabled:n||f===`loading`,defaultValue:c?r.id:void 0,dir:`auto`,children:[L(`option`,{value:``}),m.map(e=>L(`option`,{value:e.id,children:e.title}))]})]})}):L(`p`,{children:L(`label`,{children:[L(`span`,{children:o(e)}),` `,L(`input`,{type:a,switch:a===`checkbox`||void 0,name:i,placeholder:o(s),required:a===`text`&&!d,disabled:n,list:l===`hashtag`?`followed-hashtags-datalist`:null,autocorrect:`off`,autocapitalize:`off`,spellCheck:!1,pattern:u,dir:`auto`}),l===`hashtag`&&g.length>0&&L(`datalist`,{id:`followed-hashtags-datalist`,children:g.map(e=>L(`option`,{value:e.name}))})]})})),!!ns[l]&&L(`p`,{class:`form-note insignificant`,children:[L(X,{icon:`info`}),o(ns[l])]}),L(`footer`,{children:[L(`button`,{type:`submit`,class:`block`,disabled:n||f===`loading`,children:c?G._({id:`tfDRzk`}):G._({id:`m16xKo`})}),c&&L(`button`,{type:`button`,class:`light danger`,onClick:()=>{k.shortcuts.splice(i,1),a?.()},children:L(j,{id:`t_YqKh`})})]})]})})]})}function is({shortcuts:e,onClose:n}){let{_:r}=d(),{masto:a}=f(),o=g(()=>!e||!e.filter(Boolean).length?``:(0,zo.compressToEncodedURIComponent)(JSON.stringify(e.filter(Boolean))),[e]),[c,l]=I(``),[u,p]=I(`default`),m=g(()=>{if(!c)return p(`default`),null;try{let e=JSON.parse((0,zo.decompressFromEncodedURIComponent)(c));if(!Array.isArray(e))throw Error(`Not an array`);return p(`default`),e}catch{try{let e=JSON.parse(c);if(!Array.isArray(e))throw Error(`Not an array`);return p(`default`),e}catch{return p(`error`),null}}},[c]),h=k.shortcuts.length>0,_=s();return L(`div`,{id:`import-export-container`,class:`sheet`,children:[!!n&&L(`button`,{type:`button`,class:`sheet-close`,onClick:n,children:L(X,{icon:`x`,alt:G._({id:`yz7wBu`})})}),L(`header`,{children:L(`h2`,{children:L(j,{id:`OOa7_5`,components:{0:L(`small`,{class:`ib insignificant`})}})})}),L(`main`,{tabindex:`-1`,children:[L(`section`,{children:[L(`h3`,{children:[L(X,{icon:`arrow-down-circle`,size:`l`,class:`insignificant`}),` `,L(`span`,{children:L(j,{id:`l3s5ri`})})]}),L(`p`,{class:`field-button`,children:[L(`input`,{ref:_,type:`text`,name:`import`,placeholder:G._({id:`tBmklN`}),class:`block`,onInput:e=>{l(e.target.value)},dir:`auto`}),Oo&&L(`button`,{type:`button`,class:`plain2 small`,onClick:()=>{k.showQrScannerModal={onClose:({text:e}={})=>{e&&(l(e),_.current.value=e,_.current.dispatchEvent(new Event(`input`)))}}},children:L(X,{icon:`scan`,alt:G._({id:`XDwkfO`})})}),k.settings.shortcutSettingsCloudImportExport&&L(`button`,{type:`button`,class:`plain2 small`,disabled:u===`cloud-downloading`,onClick:async()=>{p(`cloud-downloading`);let e=ee();Z(G._({id:`jFdM_T`}));try{let n=(await a.v1.accounts.relationships.fetch({id:[e]}))[0];if(n){let{note:e=``}=n;if(/<phanpy-shortcuts-settings>(.*)<\/phanpy-shortcuts-settings>/.test(e)){let n=e.match(/<phanpy-shortcuts-settings>(.*)<\/phanpy-shortcuts-settings>/)[1],{v:r,dt:i,data:a}=JSON.parse(n);_.current.value=a,_.current.dispatchEvent(new Event(`input`))}}p(`default`)}catch{p(`error`),Z(G._({id:`gCDfX-`}))}},title:G._({id:`5I1YZO`}),children:[L(X,{icon:`cloud`}),L(X,{icon:`arrow-down`,size:`s`})]})]}),!!m&&Array.isArray(m)&&L(i,{children:[L(`p`,{children:[L(`b`,{children:m.length}),` shortcut`,m.length>1?`s`:``,` `,L(`small`,{class:`insignificant`,children:[`(`,c.length,` characters)`]})]}),L(`ol`,{class:`import-settings-list`,children:m.map(n=>L(`li`,{children:[L(`span`,{style:{opacity:+!!e.some(e=>Object.keys(e).every(r=>{if(!(r in n))return!0;let i=n[r];return i===``||i==null?!0:e[r]===i}))},children:`*`}),L(`span`,{children:[r(Qo[n.type]),n.type===`list`&&!!n.id&&` ⚠️`,` `,$o[n.type]?.map?.(({text:e,name:a,type:o})=>n[a]?L(i,{children:[L(`span`,{class:`tag collapsed insignificant`,children:[r(e),`:`,` `,o===`checkbox`?n[a]===`on`?`✅`:`❌`:n[a]]}),` `]}):null)]})]}))}),L(`p`,{children:[L(`small`,{children:L(j,{id:`o6sElH`})}),L(`br`,{}),L(`small`,{children:[`⚠️`,` `,L(j,{id:`N4z4P_`})]})]})]}),u===`error`&&L(`p`,{class:`error`,children:L(`small`,{children:[`⚠️ `,L(j,{id:`ZhsPEb`})]})}),L(`p`,{children:[h&&L(i,{children:[L(xt,{confirmLabel:G._({id:`6MzUUU`}),menuFooter:L(`div`,{class:`footer`,children:L(j,{id:`nl8sCE`})}),onClick:()=>{let e=m.filter(e=>!k.shortcuts.some(n=>Object.keys(n).every(r=>n[r]===e[r])));if(!e.length){Z(G._({id:`o6L30P`}));return}let r=[...k.shortcuts,...e],i=r.length>9;i&&(r=r.slice(0,9)),k.shortcuts=r,Z(i?G._({id:`SBmqmC`,values:{SHORTCUTS_LIMIT:9}}):G._({id:`QO9uTx`})),n?.()},children:L(`button`,{type:`button`,class:`plain2`,disabled:!m,children:L(j,{id:`c89gCv`})})}),` `]}),L(xt,{confirmLabel:h?G._({id:`6ZjzWP`}):G._({id:`DWumLi`}),menuItemClassName:h?`danger`:void 0,onClick:()=>{k.shortcuts=m,Z(G._({id:`QO9uTx`})),n?.()},children:L(`button`,{type:`button`,class:`plain2`,disabled:!m,children:h?G._({id:`uIp8WL`}):G._({id:`Sjnlwj`})})})]})]}),L(`section`,{children:[L(`h3`,{children:[L(X,{icon:`arrow-up-circle`,size:`l`,class:`insignificant`}),` `,L(`span`,{children:L(j,{id:`GS-Mus`})})]}),L(`p`,{class:`field-button`,children:[L(`input`,{style:{width:`100%`},type:`text`,value:o,readOnly:!0,onClick:e=>{if(e.target.value){e.target.select();try{navigator.clipboard.writeText(e.target.value),Z(G._({id:`cWtH-v`}))}catch{Z(G._({id:`yUWyHa`}))}}},dir:`auto`}),L(`button`,{type:`button`,class:`plain2 small`,disabled:!o,onClick:()=>{k.showQrCodeModal={text:o}},children:L(X,{icon:`qrcode`,alt:G._({id:`gCX4Z9`})})}),k.settings.shortcutSettingsCloudImportExport&&L(`button`,{type:`button`,class:`plain2 small`,disabled:u===`cloud-uploading`,onClick:async()=>{p(`cloud-uploading`);let e=ee();try{let n=(await a.v1.accounts.relationships.fetch({id:[e]}))[0];if(n){let{note:r=``}=n,i=``,s=JSON.stringify({v:`1`,dt:Date.now(),data:o});i=/<phanpy-shortcuts-settings>(.*)<\/phanpy-shortcuts-settings>/.test(r)?r.replace(/<phanpy-shortcuts-settings>(.*)<\/phanpy-shortcuts-settings>/,`<phanpy-shortcuts-settings>${s}</phanpy-shortcuts-settings>`):`${r}\n\n\n<phanpy-shortcuts-settings>${s}</phanpy-shortcuts-settings>`,Z(G._({id:`fVybCv`})),await a.v1.accounts.$select(e).note.create({comment:i}),p(`default`),Z(G._({id:`5w02SH`}))}}catch{p(`error`),Z(G._({id:`aVsTYo`}))}},title:G._({id:`oivBcO`}),children:[L(X,{icon:`cloud`}),L(X,{icon:`arrow-up`,size:`s`})]})]}),L(`p`,{children:[L(`button`,{type:`button`,class:`plain2`,disabled:!o,onClick:()=>{try{navigator.clipboard.writeText(o),Z(G._({id:`-Kq2vY`}))}catch{Z(G._({id:`tFvxZF`}))}},children:[L(X,{icon:`clipboard`}),` `,L(`span`,{children:L(j,{id:`he3ygx`})})]}),` `,navigator?.share&&navigator?.canShare?.({text:o})&&L(`button`,{type:`button`,class:`plain2`,disabled:!o,onClick:()=>{try{navigator.share({text:o})}catch{alert(G._({id:`TtG3Uh`}))}},children:[L(X,{icon:`share`}),` `,L(`span`,{children:L(j,{id:`Z8lGw6`})})]}),` `,o.length>0&&L(`small`,{class:`insignificant ib`,children:L(j,{id:`IPXOXm`,values:{0:o.length}})})]}),!!o&&L(`details`,{children:[L(`summary`,{class:`insignificant`,children:L(`small`,{children:L(j,{id:`e5E-WH`})})}),L(`textarea`,{style:{width:`100%`},rows:10,readOnly:!0,children:JSON.stringify(e.filter(Boolean),null,2)})]})]}),k.settings.shortcutSettingsCloudImportExport&&L(`footer`,{children:L(`p`,{children:[L(X,{icon:`cloud`}),` `,L(j,{id:`Cxr3Kn`})]})})]})]})}ve(k,e=>{for(let[n,r,i,a]of e)/^show/i.test(r)&&!i&&oi()});function as(){let{_:e}=d(),n=W(k),r=Ne(),a=ie(),o=cn();return y(()=>{setTimeout(le,1e3)},[]),L(i,{children:[o&&!!n.showCompose&&L(Ot,{class:`solid ${n.composerState.minimized?`min`:``}`,minimized:!!n.composerState.minimized,children:L(xe,{replyToStatus:typeof n.showCompose==`boolean`?window.__COMPOSE__?.replyToStatus||null:n.showCompose.replyToStatus,replyMode:k.showCompose?.replyMode||window.__COMPOSE__?.replyMode||`all`,editStatus:k.showCompose?.editStatus||window.__COMPOSE__?.editStatus||null,draftStatus:k.showCompose?.draftStatus||window.__COMPOSE__?.draftStatus||null,quoteStatus:k.showCompose?.quoteStatus||window.__COMPOSE__?.quoteStatus||null,sharedData:window.__SHARED_DATA__||null,onClose:n=>{let{newStatus:i,instance:o,type:s,scheduledAt:c}=n||{};k.showCompose=!1,window.__COMPOSE__=null,window.__SHARED_DATA__=null,i&&(k.reloadStatusPage++,c&&k.reloadScheduledPosts++,Z({text:{post:e(c?{id:`IrX0sj`}:{id:`aTyHBW`}),reply:e(c?{id:`-38pse`}:{id:`lZdBKl`}),edit:e({id:`a5BN7l`})}[s||`post`],delay:1e3,duration:1e4,onClick:e=>{e.hideToast(),k.prevLocation=a,r(c?`/sp`:o?`/${o}/s/${i.id}`:`/s/${i.id}`)}}))}})}),o&&!!n.showSettings&&L(Ot,{onClose:()=>{k.showSettings=!1},children:L(ri,{onClose:()=>{k.showSettings=!1}})}),o&&!!n.showAccounts&&L(Ot,{onClose:()=>{k.showAccounts=!1},children:L(kr,{onClose:()=>{k.showAccounts=!1}})}),!!n.showAccount&&L(Ot,{onClose:()=>{k.showAccount=!1},children:L(Xi,{account:n.showAccount?.account||n.showAccount,instance:n.showAccount?.instance,onClose:({destination:e}={})=>{k.showAccount=!1}})}),!!n.showOpenLink&&L(Ot,{onClose:()=>{k.showOpenLink=!1},children:L(Ia,{url:n.showOpenLink.url,linkText:n.showOpenLink.linkText,onClose:()=>{k.showOpenLink=!1}})}),o&&!!n.showDrafts&&L(Ot,{onClose:()=>{k.showDrafts=!1},children:L(Zi,{onClose:()=>k.showDrafts=!1})}),!!n.showMediaModal&&L(Ot,{onClick:e=>{(e.target===e.currentTarget||e.target.classList.contains(`media`))&&(k.showMediaModal=!1)},children:L(Fa,{mediaAttachments:n.showMediaModal.mediaAttachments,instance:n.showMediaModal.instance,index:n.showMediaModal.mediaIndex,statusID:n.showMediaModal.statusID,onClose:()=>{k.showMediaModal=!1}})}),o&&!!n.showShortcutsSettings&&L(Ot,{onClose:()=>{k.showShortcutsSettings=!1},children:L(ts,{onClose:()=>k.showShortcutsSettings=!1})}),!!n.showGenericAccounts&&L(Ot,{onClose:()=>{k.showGenericAccounts=!1},children:L(ea,{instance:n.showGenericAccounts.instance,excludeRelationshipAttrs:n.showGenericAccounts.excludeRelationshipAttrs,postID:n.showGenericAccounts.postID,onClose:()=>k.showGenericAccounts=!1,blankCopy:n.showGenericAccounts.blankCopy})}),!!n.showMediaAlt&&L(Ot,{onClose:e=>{k.showMediaAlt=!1},children:L(ia,{alt:n.showMediaAlt.alt||n.showMediaAlt,lang:n.showMediaAlt?.lang,onClose:()=>{k.showMediaAlt=!1}})}),!!n.showEmbedModal&&L(Ot,{class:`solid`,onClose:()=>{k.showEmbedModal=!1},children:L($i,{html:n.showEmbedModal.html,url:n.showEmbedModal.url,width:n.showEmbedModal.width,height:n.showEmbedModal.height,onClose:()=>{k.showEmbedModal=!1}})}),o&&!!n.showReportModal&&L(Ot,{onClose:()=>{k.showReportModal=!1},children:L(Ro,{account:n.showReportModal.account,post:n.showReportModal.post,onClose:()=>{k.showReportModal=!1}})}),!!n.showQrCodeModal&&L(Ot,{class:`solid`,onClose:()=>{k.showQrCodeModal=!1},children:L(ko,{text:n.showQrCodeModal.text,arena:n.showQrCodeModal.arena,backgroundMask:n.showQrCodeModal.backgroundMask,caption:n.showQrCodeModal.caption,onClose:()=>{k.showQrCodeModal=!1},onScannerClick:n.showQrCodeModal.onScannerClick})}),!!n.showQrScannerModal&&L(Ot,{class:`solid`,onClose:()=>{k.showQrScannerModal=!1},children:L(No,{checkValidity:n.showQrScannerModal.checkValidity,actionableText:n.showQrScannerModal.actionableText,onClose:(...e)=>{n.showQrScannerModal.onClose&&n.showQrScannerModal.onClose(...e),k.showQrScannerModal=!1}})}),o&&!!n.showImportExportAccounts&&L(Ot,{onClose:()=>{k.showImportExportAccounts=!1},children:L(na,{onClose:()=>{k.showImportExportAccounts=!1},exportDisabled:typeof n.showImportExportAccounts==`object`?n.showImportExportAccounts.exportDisabled:!1})})]})}var os=(e,n)=>{nt(`g>${e}`,e=>{document.querySelector(`#modal-container > *`)||e.metaKey||e.ctrlKey||e.altKey||n(e)},{useKey:!0})},ss=K(function(){let e=Ne();return os(`h`,()=>e(`/`)),os(`n`,()=>e(`/notifications`)),os(`s`,()=>{k.showSettings=!0}),os(`p`,()=>{let n=R();if(n){let{instanceURL:r}=n,{id:i}=n.info;e(`/${r}/a/${i}`)}}),os(`b`,()=>e(`/b`)),null});function cs({accountID:e,onChange:n}){let{_:r}=d(),{masto:i}=f(),[a,o]=I(`default`),[s,c]=I(null),[l,u]=I(null),p=l!==null;return L(`p`,{class:`follow-request-buttons`,children:[L(`button`,{type:`button`,disabled:a===`loading`||p,onClick:()=>{Qt.trigger(`success`),o(`loading`),c(`accept`),(async()=>{try{let r=await i.v1.followRequests.$select(e).authorize();if(!r?.followedBy)throw Error(`Follow request not accepted`);u(r),n()}catch{}o(`default`)})()},children:L(j,{id:`g3UF2V`})}),` `,L(`button`,{type:`button`,disabled:a===`loading`||p,class:`light danger`,onClick:()=>{Qt.trigger(`light`),o(`loading`),c(`reject`),(async()=>{try{let r=await i.v1.followRequests.$select(e).reject();if(r?.followedBy)throw Error(`Follow request not rejected`);u(r),n()}catch{o(`default`)}})()},children:L(j,{id:`1t_NnN`})}),L(`span`,{class:`follow-request-states`,children:p&&s?s===`accept`?L(X,{icon:`check-circle`,alt:r({id:`bzMKg7`}),class:`follow-accepted`}):L(X,{icon:`x-circle`,alt:r({id:`ekCRTP`}),class:`follow-rejected`}):L(q,{hidden:a!==`loading`})})]})}var ls={mention:`comment`,status:`notification`,reblog:`rocket`,follow:`follow`,follow_request:`follow-add`,favourite:`heart`,poll:`poll`,update:`pencil`,"admin.sign_up":`account-edit`,"admin.report":`account-warning`,severed_relationships:`heart-break`,moderation_warning:`alert`,emoji_reaction:`emoji2`,reaction:`emoji2`,"pleroma:emoji_reaction":`emoji2`,annual_report:`celebrate`,quote:`quote`,quoted_update:`pencil`,added_to_collection:`collections`,collection_update:`collections`};function us({account:e,emoji:n,emojiURL:r}){let i,a;return typeof r==`string`?i=r:(i=r?.url,a=r?.staticUrl),L(j,{id:`i5uN6K`,values:{account:e,emojiObject:i?L(Re,{url:i,staticUrl:a,alt:n}):n}})}var ds={status:({account:e})=>L(j,{id:`idiIxW`,values:{account:e}}),reblog:({count:e,account:n,postsCount:r,postType:i,components:{Subject:a}})=>L(j,{id:`jkt9P5`,values:{0:Je(e),1:Je(e),count:e,postsCount:r,postType:i,account:n},components:{0:L(a,{clickable:e>1}),1:L(`span`,{title:e}),2:L(a,{clickable:e>1}),3:L(`span`,{title:e})}}),follow:({account:e,count:n,components:{Subject:r}})=>L(j,{id:`-71G9C`,values:{0:Je(n),count:n,account:e},components:{0:L(r,{clickable:n>1}),1:L(`span`,{title:n})}}),follow_request:({account:e})=>L(j,{id:`eh6NHW`,values:{account:e}}),favourite:({account:e,count:n,postsCount:r,postType:i,components:{Subject:a}})=>L(j,{id:`RqX1mR`,values:{0:Je(n),1:Je(n),count:n,postsCount:r,postType:i,account:e},components:{0:L(a,{clickable:n>1}),1:L(`span`,{title:n}),2:L(a,{clickable:n>1}),3:L(`span`,{title:n})}}),poll:()=>G._({id:`kIlJaS`}),"poll-self":()=>G._({id:`kpjzdN`}),"poll-voted":()=>G._({id:`moT7M8`}),update:({account:e})=>e?L(j,{id:`W-eFn3`,values:{account:e}}):G._({id:`uzt17m`}),"favourite+reblog":({count:e,account:n,postsCount:r,postType:i,components:{Subject:a}})=>L(j,{id:`NunZZQ`,values:{0:Je(e),1:Je(e),count:e,postsCount:r,postType:i,account:n},components:{0:L(a,{clickable:e>1}),1:L(`span`,{title:e}),2:L(a,{clickable:e>1}),3:L(`span`,{title:e})}}),quoted_update:({account:e})=>L(j,{id:`pkB7ti`,values:{account:e}}),"admin.sign_up":({account:e,count:n,components:{Subject:r}})=>L(j,{id:`eDkKRi`,values:{0:Je(n),count:n,account:e},components:{0:L(r,{clickable:n>1}),1:L(`span`,{title:n})}}),"admin.report":({account:e,targetAccount:n})=>L(j,{id:`eNfCmq`,values:{account:e,targetAccount:n}}),severed_relationships:({name:e})=>L(j,{id:`Xl9v6-`,values:{name:e},components:{0:L(`i`,{})}}),moderation_warning:()=>L(`b`,{children:L(j,{id:`YqffEv`})}),emoji_reaction:us,reaction:us,"pleroma:emoji_reaction":us,annual_report:({year:e})=>L(j,{id:`INLTzH`,values:{year:e}}),added_to_collection:({account:e})=>L(j,{id:`_79dKl`,values:{account:e}}),collection_update:({account:e})=>L(j,{id:`ERceEl`,values:{account:e}})},fs={account_suspension:({from:e,targetName:n})=>L(j,{id:`uRkcgw`,values:{from:e,targetName:n},components:{0:L(`i`,{}),1:L(`i`,{})}}),domain_block:({from:e,targetName:n,followersCount:r,followingCount:i})=>L(j,{id:`Q3yArs`,values:{from:e,targetName:n,followersCount:r,followingCount:i},components:{0:L(`i`,{}),1:L(`i`,{})}}),user_domain_block:({targetName:e,followersCount:n,followingCount:r})=>L(j,{id:`RQKWUa`,values:{targetName:e,followersCount:n,followingCount:r},components:{0:L(`i`,{})}})},ps={none:{id:`ipnHrn`},disable:{id:`jw0eSZ`},mark_statuses_as_sensitive:{id:`v9jO-F`},delete_statuses:{id:`raUMBQ`},sensitive:{id:`w2OpMr`},silence:{id:`mlycBx`},suspend:{id:`Fz4lZ1`}},ms=30;function hs({notification:e,instance:n,isStatic:r,disableContextMenu:a}){let{_:o}=d(),{masto:s}=f(),{id:l,status:u,account:p,report:m,event:h,moderation_warning:g,annualReport:_,collection:v,_ids:y,_accounts:b,_statuses:x,_groupKeys:S,sampleAccounts:C,notificationsCount:w,groupKey:T,_notificationsCount:E,_sampleAccountsCount:D}=e,{type:O}=e;if((O===`mention`||O===`quote`)&&!u)return null;let A=u?.reblog||u,M=A?.id,N=ee(),P=N===p?.id,te=u?.poll?.voted,F=!!u?.inReplyToAccountId&&u?.inReplyToAccountId!==N&&u?.account?.id===N,I=0,ne=0;if(O===`favourite+reblog`){if(b)for(let e of b)e._types?.includes(`favourite`)&&I++,e._types?.includes(`reblog`)&&ne++;!ne&&I&&(O=`favourite`),!I&&ne&&(O=`reblog`)}let R;R=O===`poll`?ds[P?`poll-self`:te?`poll-voted`:`poll`]:ds[O]?ds[O]:e.fallback?.title?L(`span`,{dangerouslySetInnerHTML:{__html:ct(e.fallback.title)}}):G._({id:`ODqZt1`,values:{type:O}});let z=({clickable:e,...n})=>e?L(`b`,{tabIndex:`0`,onClick:H,...n}):L(`b`,{...n}),B=w>0&&w>C?.length,V=B?`remote`:`local`;if(typeof R==`function`){let n=(O===`favourite`||O===`reblog`||O===`admin.sign_up`)&&w?B?w:C?.length:b?.length||C?.length||+!!p,r=x?.length||+!!u;if(O===`admin.report`){let e=m?.targetAccount;e&&(R=R({account:L(ht,{account:p,showAvatar:!0}),targetAccount:L(ht,{account:e,showAvatar:!0})}))}else if(O===`severed_relationships`){let e=h?.targetName;e&&(R=R({name:e}))}else if((O===`emoji_reaction`||O===`pleroma:emoji_reaction`)&&e.emoji){let n=e.emoji_url||u?.emojis?.find?.(n=>n?.shortcode===e.emoji.replace(/^:/,``).replace(/:$/,``));R=R({account:L(ht,{account:p,showAvatar:!0}),emoji:e.emoji,emojiURL:n})}else R=R(O===`annual_report`?{...e.annualReport}:{account:p?L(ht,{account:p,showAvatar:!0}):C?.[0]&&L(ht,{account:C[0],showAvatar:!0}),count:n,postsCount:r,postType:F?`reply`:`post`,components:{Subject:z}})}let re=e.createdAt&&new Date(e.createdAt).toLocaleString(),ie={"favourite+reblog":G._({id:`-XOeb-`}),favourite:G._({id:`LQFF6J`}),reblog:G._({id:`phQpSa`}),follow:G._({id:`Ih01jh`})}[O]||G._({id:`bPwFdf`}),ae=(O===`favourite+reblog`||O===`favourite`||O===`reblog`||O===`admin.sign_up`)&&V===`remote`,H=()=>{ae?k.showGenericAccounts={heading:ie,accounts:b,fetchAccounts:async()=>{let e=await Promise.allSettled(S.map(async e=>[e,(await s.v2.notifications.$select(e).accounts.list().values().next()).value])),n=[];for(let r of e){let[e,i]=r.value,a=/^favourite/.test(e)?`favourite`:/^reblog/.test(e)?`reblog`:null;for(let e of i){let r=n.find(n=>n.id===e.id);r&&a?r._types.push(a):(a&&(e._types=[a]),n.push(e))}}return{done:!0,value:n}},showReactions:O===`favourite+reblog`,postID:c(M,n)}:k.showGenericAccounts={heading:ie,accounts:b,showReactions:O===`favourite+reblog`,excludeRelationshipAttrs:O===`follow`?[`followedBy`]:[],postID:c(M,n)}};if(u?.filtered){let e=u?.account?.id===N,n=lt(u.filtered,`notifications`);if(!P&&!e&&n?.action===`hide`)return null}return L(`div`,{class:`notification notification-${O}`,"data-notification-id":y||l,"data-group-key":S?.join(` `)||T,tabIndex:`0`,onMouseEnter:e=>{e.shiftKey},children:[L(`div`,{class:`notification-type notification-${O}`,title:re,children:O===`favourite+reblog`?L(i,{children:[L(X,{icon:`rocket`,size:`xl`,alt:O,class:`reblog-icon`}),L(X,{icon:`heart`,size:`xl`,alt:O,class:`favourite-icon`})]}):O===`mention+quote`?L(i,{children:[L(X,{icon:`comment`,size:`xl`,alt:O,class:`mention-icon`}),L(X,{icon:`quote`,size:`xl`,alt:O,class:`quote-icon`})]}):L(X,{icon:ls[O]||`notification`,size:`xl`,alt:O})}),L(`div`,{class:`notification-content`,children:[O!==`mention`&&O!==`quote`&&O!==`mention+quote`&&L(i,{children:[L(`p`,{children:R}),O===`follow_request`&&L(cs,{accountID:p.id}),O===`severed_relationships`&&L(`div`,{children:[fs[h.type]({from:n,...h}),L(`br`,{}),L(`a`,{href:`${location.protocol}//${n}/severed_relationships`,target:`_blank`,rel:`noopener`,children:L(j,{id:`YL6Y8P`,components:{0:L(X,{icon:`external`,size:`s`})}})}),`.`]}),O===`moderation_warning`&&!!g&&L(`div`,{children:[o(ps[g.action]()),L(`br`,{}),L(`a`,{href:`/disputes/strikes/${g.id}`,target:`_blank`,rel:`noopener`,children:L(j,{id:`YL6Y8P`,components:{0:L(X,{icon:`external`,size:`s`})}})})]}),O===`annual_report`&&L(`div`,{children:L(Q,{to:`/annual_report/${_?.year}`,children:L(j,{id:`5PGPvG`})})}),!!e.fallback?.summary&&(e.fallback?.details?L(`details`,{class:`notification-fallback-details`,children:[L(`summary`,{dangerouslySetInnerHTML:{__html:ct(e.fallback.summary)}}),L(`div`,{class:`notification-fallback-details-content`,dangerouslySetInnerHTML:{__html:ct(e.fallback.details)}})]}):L(`div`,{class:`notification-fallback-details`,dangerouslySetInnerHTML:{__html:ct(e.fallback.summary)}})),!!v&&L(Rt,{collection:v,instance:n})]}),b?.length>1&&L(`p`,{class:`avatars-stack`,children:[b.slice(0,ms).map(e=>L(i,{children:[L(`a`,{href:e.url,rel:`noopener`,class:`account-avatar-stack`,onClick:n=>{n.preventDefault(),k.showAccount=e},children:[L(Ht,{url:e.avatarStatic,size:b.length<=10?`xxl`:b.length<20?`xl`:`l`,alt:`${e.displayName} @${e.acct}`,squircle:e?.bot},e.id),O===`favourite+reblog`&&L(`div`,{class:`account-sub-icons`,children:e._types.map(e=>L(X,{icon:ls[e],size:`s`,class:`${e}-icon`}))})]},e.id),` `]},e.id)),ae?L(`button`,{type:`button`,class:`small plain`,"data-group-keys":S?.join(` `),onClick:H,children:[`+`,(O===`favourite`||O===`reblog`||O===`admin.sign_up`)&&w-b.length,L(X,{icon:`chevron-down`})]}):L(`button`,{type:`button`,class:`small plain`,onClick:H,children:[b.length>ms&&`+${b.length-ms}`,L(X,{icon:`chevron-down`})]})]}),!b?.length&&C?.length>1&&L(`p`,{class:`avatars-stack`,children:[C.map(e=>L(i,{children:[L(`a`,{href:e.url,rel:`noopener`,class:`account-avatar-stack`,onClick:n=>{n.preventDefault(),k.showAccount=e},children:L(Ht,{url:e.avatarStatic,size:`xxl`,alt:`${e.displayName} @${e.acct}`,squircle:e?.bot},e.id)},e.id),` `]},e.id)),w>C.length&&u?.id&&L(Q,{to:n?`/${n}/s/${u.id}`:`/s/${u.id}`,class:`button small plain centered`,children:[`+`,w-C.length,L(X,{icon:`chevron-right`})]})]}),x?.length>1&&L(`ul`,{class:`notification-group-statuses`,children:x.map(e=>L(`li`,{children:L(gs,{class:`status-link status-type-${O}`,to:n?`/${n}/s/${e.id}`:`/s/${e.id}`,children:L(Ut,{status:e,size:`s`,previewMode:!0,allowContextMenu:!0,allowFilters:!0})})},e.id))}),u&&(!x?.length||x?.length<=1)&&L(gs,{class:`status-link status-type-${O}`,to:n?`/${n}/s/${M}`:`/s/${M}`,onContextMenu:a?void 0:e=>{let n=e.target.querySelector(`.status`);if(n){if(e.metaKey)return;e.preventDefault(),n.dispatchEvent(new MouseEvent(`contextmenu`,{clientX:e.clientX,clientY:e.clientY}))}},children:r?L(Ut,{status:A,size:`s`,readOnly:!0,allowContextMenu:!0,allowFilters:!0}):L(Ut,{statusID:M,size:`s`,readOnly:!0,allowContextMenu:!0,allowFilters:!0})})]})]})}function gs(e){let{_:n}=d(),r=wt();return L(Q,{...e,"data-read-more":n({id:`8fZueG`}),ref:r})}var _s=K(hs,(e,n)=>e.notification?.id===n.notification?.id);`serviceWorker`in navigator&&navigator.serviceWorker.addEventListener(`message`,e=>{let{type:n,id:r,accessToken:i}=e?.data||{};n===`notification`&&(k.routeNotification={id:r,accessToken:i})});var vs=K(function(){let{_:e}=d();if(!(`serviceWorker`in navigator))return null;let{routeNotification:n}=W(k),{id:r,accessToken:i}=n||{},[a,o]=I(!1);N(()=>{if(!r||!i)return;let{instance:e}=f(),{masto:n,instance:a}=f({accessToken:i}),s=e===a,c=i?ye(i):R();(async()=>{let i=await n.v1.notifications.$select(r).fetch();if(i&&c){let n=c.instanceURL,{type:a,status:l,account:u}=i,d=!!document.querySelector(`#modal-container > *`),f=a===`follow`&&!!u?.id,p=!!u?.id,m=!!l?.id;f&&s?k.showAccount={account:u,instance:n}:d||!s||p&&m?o({id:r,account:c,notification:i,sameInstance:s}):m?location.hash=`/${e}/s/${l.id}`:f?location.hash=`/${e}/a/${u.id}`:location.hash=`/notifications`}})()},[r,i]),N(()=>{navigator?.clearAppBadge&&navigator.clearAppBadge()},[]),ln(e=>{e&&navigator?.clearAppBadge&&navigator.clearAppBadge()});let s=()=>{o(!1),k.routeNotification=null,/\/notifications\?id=/i.test(location.hash)&&(location.hash=`/notifications`)};if(a){let{id:n,account:r,notification:i,sameInstance:o}=a;return L(Ot,{onClick:e=>{e.target===e.currentTarget&&s()},children:L(`div`,{class:`sheet`,tabIndex:`-1`,children:[L(`button`,{type:`button`,class:`sheet-close`,onClick:s,children:L(X,{icon:`x`,alt:e({id:`yz7wBu`})})}),L(`header`,{children:L(`b`,{children:L(j,{id:`5-87Pq`})})}),L(`main`,{children:[!o&&L(`p`,{children:L(j,{id:`k9N0Xk`})}),L(`div`,{class:`notification-peek`,onClick:e=>{let{target:n}=e;(e.target.tagName===`BUTTON`||e.target.tagName===`A`)&&s()},children:L(_s,{instance:r.instanceURL,notification:i,isStatic:!0})}),L(`div`,{style:{textAlign:`end`},children:L(Q,{to:`/notifications`,class:`button light`,onClick:s,children:[L(`span`,{children:L(j,{id:`_WA_tl`})}),` `,L(X,{icon:`arrow-right`})]})})]})]})})}return null}),ys=({limit:e}={})=>{let n=F.account.get(`searchHistory`)||[];return e?n.slice(0,e):n},bs=10,xs=(e,n=null)=>{if(!e?.trim?.())return;let r=ys(),i=r.findIndex(r=>r.query===e&&r.queryType===n);i!==-1&&r.splice(i,1),r.unshift({query:e.trim(),queryType:n,timestamp:Date.now()});let a=r.slice(0,bs);F.account.set(`searchHistory`,a)},Ss=(e,n=null)=>{let r=ys().filter(r=>!(r.query===e&&r.queryType===n));F.account.set(`searchHistory`,r)},Cs=()=>{F.account.set(`searchHistory`,[])},ws=(e,n,r)=>{let i,a,o;if(n===`statuses`)i=L(j,{id:`o1mMWT`,values:{query:e},components:{0:L(`q`,{})}}),a=`/search?q=${encodeURIComponent(e)}&type=statuses`,o=`document`;else if(n===`accounts`)i=L(j,{id:`cDoNQr`,values:{query:e},components:{0:L(`q`,{})}}),a=`/search?q=${encodeURIComponent(e)}&type=accounts`,o=`group`;else if(n===`hashtags`){let[,n=`#`,s=e]=e.match(/^([##])?(.*)$/);i=L(j,{id:`mFfcu0`,values:{hashtag:`${n}${s}`},components:{0:L(`mark`,{})}}),a=`/${r}/t/${s}`,o=`hashtag`}else i=L(j,{id:`48oDit`,values:{query:e},components:{0:L(`small`,{class:`insignificant`})}}),a=`/search?q=${encodeURIComponent(e)}`,o=`search`;return{label:i,to:a,icon:o}},Ts=E((e,n)=>{let{_:r}=d(),{instance:i}=f(),[a,o]=oe(),[c,l]=I(!1),[u,p]=I(a.get(`q`)||``),m=a.get(`type`),h=s(null),_=s(null);te(n,()=>({setValue:e=>{p(e)},focus:()=>{_.current.focus()},select:()=>{_.current.select()},blur:()=>{_.current.blur()}}));let v=g(()=>ys({limit:5}),[e?.hidden]),y=g(()=>{if(!u)return[];let e=v.filter(e=>e.query===u?!1:e.query.toLowerCase().includes(u.toLowerCase())).slice(0,2).map(e=>({...ws(e.query,e.queryType,i),queryType:e.queryType,isRecentSearch:!0,historyItem:e}));return[{...ws(u,null,i),top:!m&&!/\s/.test(u),hidden:!!m},...e,{...ws(u,`statuses`,i),hidden:/^https?:/.test(u),top:/\s/.test(u),queryType:`statuses`},{...ws(u,`hashtags`,i),hidden:/^[@@]/.test(u)||/^https?:/.test(u)||/\s/.test(u),top:/^[##]/.test(u),type:`link`,queryType:`hashtags`},{label:L(j,{id:`gEoOUj`,values:{query:u},components:{0:L(`mark`,{})}}),to:`/${u}`,hidden:!/^https?:/.test(u),top:/^https?:/.test(u),type:`link`,icon:`arrow-right`},{...ws(u,`accounts`,i),queryType:`accounts`}].sort((e,n)=>{if(m){if(e.queryType===m)return-1;if(n.queryType===m)return 1}return e.top&&!n.top?-1:!e.top&&n.top?1:0}).filter(({hidden:e})=>!e)},[u,m,i]);return L(`form`,{ref:h,class:`search-popover-container`,onSubmit:n=>{if(n.preventDefault(),/\/search/.test(location.hash))if(u){let e={q:u};m&&(e.type=m),o(e)}else o({});else u?location.hash=`/search?q=${encodeURIComponent(u)}${m?`&type=${m}`:``}`:location.hash=`/search`;xs(u,m),e?.onSubmit?.(n)},children:[L(`input`,{ref:_,value:u,name:`q`,type:`search`,placeholder:r({id:`A1taO8`}),dir:`auto`,autocomplete:`off`,autocorrect:`off`,autocapitalize:`off`,spellCheck:`false`,enterKeyHint:`search`,onSearch:e=>{e.target.value||o({})},onInput:e=>{p(e.target.value),l(!0)},onFocus:()=>{l(!0);let e=h.current?.querySelector(`.search-popover-item`);e&&e.classList.add(`focus`)},onBlur:()=>{setTimeout(()=>{l(!1)},100),h.current?.querySelector(`.search-popover-item.focus`)?.classList.remove(`focus`)},onKeyDown:n=>{let{key:r}=n;switch(r){case`Escape`:l(!1);break;case`Down`:case`ArrowDown`:if(n.preventDefault(),c){let e=h.current.querySelector(`.search-popover-item.focus`);if(e){let n=e.nextElementSibling;for(;n&&n.hidden;)n=n.nextElementSibling;n&&(n.classList.add(`focus`),Array.from(n.parentElement.children).filter(e=>e!==n).forEach(e=>{e.classList.remove(`focus`)}))}else{let e=h.current.querySelector(`.search-popover-item`);e&&e.classList.add(`focus`)}}break;case`Up`:case`ArrowUp`:if(n.preventDefault(),c){let e=document.querySelector(`.search-popover-item.focus`);if(e){let n=e.previousElementSibling;for(;n&&n.hidden;)n=n.previousElementSibling;n&&(n.classList.add(`focus`),Array.from(n.parentElement.children).filter(e=>e!==n).forEach(e=>{e.classList.remove(`focus`)}))}else{let e=document.querySelectorAll(`.search-popover-item`),n=e[e.length-1];n&&n.classList.add(`focus`)}}break;case`Enter`:if(c){let r=document.querySelector(`.search-popover-item.focus`);r&&(n.preventDefault(),r.click()),l(!1),e?.onSubmit?.(n)}break}}}),L(`div`,{class:`search-popover`,hidden:!c,children:[!u&&v.length>0&&L(`div`,{class:`search-popover-recent-searches`,children:[L(`div`,{class:`search-popover-header`,children:[L(X,{icon:`history`,size:`s`}),L(j,{id:`4R1B1H`})]}),v.map((n,r)=>{let{label:a,to:o,icon:s}=ws(n.query,n.queryType,i);return L(Q,{to:o,class:`search-popover-item ${r===0?`focus`:``}`,onClick:r=>{xs(n.query,n.queryType),e?.onSubmit?.(r)},children:[L(X,{icon:s,class:`more-insignificant`}),L(`span`,{children:a})]},`${n.query}-${n.queryType}-${n.timestamp}`)}),L(Q,{to:`/search`,class:`search-popover-item search-history-see-all`,children:[L(X,{icon:`more2`,class:`more-insignificant`}),L(`span`,{children:L(j,{id:`gukqfD`})})]})]}),y.map(({label:n,to:r,icon:i,queryType:a,isRecentSearch:o,historyItem:s},c)=>L(Q,{to:r,class:`search-popover-item ${o?`search-popover-item-recent`:``} ${c===0?`focus`:``}`,onClick:n=>{o||xs(u,a),e?.onSubmit?.(n)},children:[L(X,{icon:i,class:`more-insignificant`}),L(`span`,{children:n})]},o?`recent-${s.query}-${s.queryType}-${s.timestamp}`:`suggestion-${a||`general`}-${c}`))]})]})}),Es=K(function({onClose:e=()=>{}}){let n=W(k),[r,i]=I(!1),a=s(null);y(()=>{if(n.showSearchCommand){let{query:e}=n.showSearchCommand;i(!0),setTimeout(()=>{e&&a.current?.setValue?.(e),a.current?.focus?.()},150),k.showSearchCommand=!1}},[n.showSearchCommand]),nt([`Slash`,`/`],e=>{i(!0),setTimeout(()=>{a.current?.focus?.(),a.current?.select?.()},0)},{useKey:!0,preventDefault:!0,ignoreEventWhen:e=>{let n=/\/search/.test(location.hash),r=/\/yip/.test(location.hash),i=!!document.querySelector(`#modal-container > *`);return e.key===`/`?!1:n||r||i||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey}});let o=()=>{i(!1),e()};nt(`esc`,e=>{a.current?.blur?.(),o()},{enabled:r,enableOnFormTags:!0,preventDefault:!0,useKey:!0,ignoreEventWhen:e=>e.metaKey||e.ctrlKey||e.altKey||e.shiftKey});let c=!r;return L(`div`,{id:`search-command-container`,hidden:c,onClick:e=>{e.target===e.currentTarget&&o()},children:L(Ts,{ref:a,hidden:c,onSubmit:()=>{o()}})})});function Ds({lists:e}){return L(i,{children:[L(Mt,{to:`/l`,children:L(`span`,{children:L(j,{id:`BHWx-g`})})}),L(qe,{}),e?.map(e=>L(Mt,{to:`/l/${e.id}`,children:L(`span`,{children:[e.title,e.exclusive&&L(i,{children:[` `,L(Mi,{})]})]})},e.id))]})}function Os(){let{_:e,_:n}=d(),{instance:r}=f(),a=W(k),{shortcuts:o,settings:c}=a;if(!o.length)return null;let l=c.shortcutsViewMode===`multi-column`||!c.shortcutsViewMode&&c.shortcutsColumnsMode,u=s(),p=s(),m=s(!1),h=o.map((e,i)=>{let{type:a,...o}=e;if(!es[a])return null;let{id:s,path:c,title:l,subtitle:u,icon:d,altIcon:f}=es[a];return typeof s==`function`&&(s=s(o,i)),typeof c==`function`&&(c=c({...o,instance:o.instance||r},i)),typeof l==`function`?l=l(o,i):l?.id&&(l=n(l)),typeof u==`function`?u=u(o,i):u?.id&&(u=n(u)),typeof d==`function`&&(d=d(o,i)),typeof f==`function`&&(f=f(o,i)),s===`lists`&&(m.current=!0),{id:s,path:c,title:l,subtitle:u,icon:d,altIcon:f}}).filter(Boolean);y(()=>{if(a.settings.shortcutsViewMode===`tab-menu-bar`&&p.current){let e=setTimeout(()=>{let e=p.current?.querySelector(`.is-active`);e&&e.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})},100);return()=>clearTimeout(e)}},[]);let g=Ne();nt([`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],e=>{let n=parseInt(e.key,10)-1;if(n<h.length){let{path:e}=h[n];e&&(g(e),u.current?.closeMenu?.())}},{enabled:!l,useKey:!0,ignoreEventWhen:e=>{let n=/^[1-9]$/.test(e.key);return e.metaKey||e.ctrlKey||e.altKey||e.shiftKey&&!n}});let[_,v]=I([]),b=s(),x=s(),[S,C]=I(void 0);y(()=>{S===`open`&&Ti().then(v)},[S]);let w=ut(()=>{C(`open`)},{threshold:600,detect:`touch`,cancelOnMovement:!0}),T=ut(()=>{k.showAccounts=!0},{threshold:600,detect:`touch`,cancelOnMovement:!0});return l?null:L(`div`,{id:`shortcuts`,children:a.settings.shortcutsViewMode===`tab-menu-bar`?L(i,{children:[L(`nav`,{ref:p,class:`tab-bar`,onContextMenu:e=>{e.preventDefault(),k.showShortcutsSettings=!0},children:L(`ul`,{children:h.map(({id:e,path:n,title:r,subtitle:a,icon:o,altIcon:s},c)=>{let l=e===`lists`?{ref:x,onContextMenu(e){e.preventDefault(),e.stopPropagation(),C(`open`)},...w()}:e===`profile`?{onContextMenu(e){e.preventDefault(),e.stopPropagation(),k.showAccounts=!0},...T()}:{};return L(`li`,{children:L(Q,{class:a?`has-subtitle`:``,to:n,onClick:n=>{if(n.target.classList.contains(`is-active`)){n.preventDefault();let r=document.getElementById(`${e}-page`);if(r){r.scrollTop=0;let e=r.querySelector(`.updates-button`);e&&e.click()}}},...l,children:[s?.url?s?.type===`avatar`?L(Ht,{staticUrl:s.url,size:`l`}):L(`img`,{src:s.url,alt:``,class:`shortcut-icon`,loading:`lazy`,decoding:`async`,fetchPriority:`low`}):L(X,{icon:o,size:`xl`}),L(`span`,{children:[L(Xo,{children:r}),a&&L(i,{children:[L(`br`,{}),L(`small`,{children:a})]})]})]})},`${c}-${e}-${r}-${a}-${n}`)})})}),L(At,{ref:b,state:S,anchorRef:x,onClose:()=>{C(void 0)},overflow:`auto`,viewScroll:`close`,gap:4,boundingBoxPadding:Et(),portal:{target:document.body},children:L(Ds,{lists:_})})]}):L(Gt,{instanceRef:u,overflow:`auto`,viewScroll:`close`,menuClassName:`glass-menu shortcuts-menu`,gap:8,position:`anchor`,onMenuChange:e=>{e.open&&m.current&&Ti().then(v)},menuButton:L(`button`,{type:`button`,id:`shortcuts-button`,class:`plain`,onContextMenu:e=>{e.preventDefault(),k.showShortcutsSettings=!0},onTransitionStart:e=>{try{let{target:n}=e;getComputedStyle(n).pointerEvents===`none`&&u.current?.closeMenu?.()}catch{}},children:L(X,{icon:`shortcut`,size:`xl`,alt:e({id:`CTqTgr`})})}),children:h.map(({id:e,path:n,title:r,subtitle:a,icon:o},s)=>e===`lists`?L(Lt,{menuClassName:`glass-menu`,overflow:`auto`,gap:-8,label:L(i,{children:[L(X,{icon:o,size:`l`}),L(`span`,{class:`menu-grow`,children:L(Xo,{children:r})}),L(X,{icon:`chevron-right`})]}),children:L(Ds,{lists:_})}):L(Mt,{to:n,class:`glass-menu-item`,children:[L(X,{icon:o,size:`l`}),` `,L(`span`,{class:`menu-grow`,children:[L(`span`,{children:L(Xo,{children:r})}),a&&L(i,{children:[` `,L(`small`,{class:`more-insignificant`,children:a})]})]}),L(`span`,{class:`menu-shortcut hide-until-focus-visible`,children:s+1})]},`${s}-${e}-${r}-${a}-${n}`))})})}var ks=K(Os);function As({collection:e,onClose:n}){let{_:r}=d(),{masto:i}=f(),a=!!e,[o,c]=I(`default`),l=s(),u=s(),p=s(),m=s();return y(()=>{a&&(l.current.value=e.name||``,u.current.value=e.description||``,p.current.value=e.language||``,m.current.checked=e.sensitive===!0)},[a]),L(`div`,{class:`sheet`,children:[!!n&&L(`button`,{type:`button`,class:`sheet-close`,onClick:n,children:L(X,{icon:`x`,alt:r({id:`yz7wBu`})})}),` `,L(`header`,{children:L(`h2`,{children:[r(a?{id:`xxjKhD`}:{id:`3HCpJW`}),` `,L(q,{hidden:o!==`loading`})]})}),L(`main`,{children:L(`form`,{class:`collection-add-edit-form`,onSubmit:o=>{o.preventDefault();let s=new FormData(o.target),l=s.get(`name`)?.trim(),u=s.get(`description`)?.trim(),d=s.get(`language`),f=s.get(`sensitive`)===`on`,p=s.get(`discoverable`)===`public`;l&&(c(`loading`),(async()=>{try{let r;r=a?await i.v1.collections.$select(e.id).update({name:l,...u?{description:u}:{},...d?{language:d}:{},sensitive:f,discoverable:p}):await i.v1.collections.create({name:l,...u?{description:u}:{},...d?{language:d}:{},sensitive:f,discoverable:p}),c(`default`),n?.({state:`success`,collection:r?.collection||r})}catch{c(`error`),Z(r(a?{id:`bVrsXl`}:{id:`cFdBgp`}))}})())},children:[L(`div`,{class:`collection-form-row`,children:L(`label`,{for:`collection-name`,children:[L(j,{id:`6YtxFj`}),` `,L(`grapheme-input`,{children:L(`input`,{ref:l,type:`text`,id:`collection-name`,name:`name`,required:!0,maxLength:40,disabled:o===`loading`,dir:`auto`,autoFocus:!0})})]})}),L(`div`,{class:`collection-form-row`,children:L(`label`,{for:`collection-description`,children:[L(j,{id:`Nu4oKW`}),` `,L(`grapheme-input`,{children:L(`textarea`,{ref:u,id:`collection-description`,name:`description`,maxLength:100,readOnly:o===`loading`,dir:`auto`,rows:1})})]})}),L(`div`,{class:`collection-toolbar`,children:[L(`select`,{ref:p,id:`collection-language`,name:`language`,disabled:o===`loading`,children:[L(`option`,{value:``,children:L(j,{id:`vXIe7J`})}),L(`hr`,{}),It.map(([e,n,r])=>{let i=Bt({code:e,fallback:n});return L(`option`,{value:e,children:i===r?i:`${r} - ${i}`},e)})]}),L(`label`,{class:`collection-option`,children:[L(`input`,{ref:m,type:`checkbox`,name:`sensitive`,disabled:o===`loading`}),` `,L(j,{id:`RpcZRB`})]}),L(`select`,{name:`discoverable`,defaultValue:a?e.discoverable?`public`:`unlisted`:`public`,disabled:o===`loading`,children:[L(`option`,{value:`public`,children:L(j,{id:`7d1a0d`})}),L(`option`,{value:`unlisted`,children:L(j,{id:`WDcQq9`})})]})]}),L(`footer`,{children:[L(`button`,{type:`submit`,disabled:o===`loading`,children:r(a?{id:`tfDRzk`}:{id:`hYgDIe`})}),a&&L(xt,{disabled:o===`loading`,align:`end`,menuItemClassName:`danger`,confirmLabel:r({id:`-8W4nA`}),onClick:()=>{c(`loading`),(async()=>{try{await i.v1.collections.$select(e.id).remove(),c(`default`),n?.({state:`deleted`})}catch{c(`error`),Z(r({id:`PssvYb`}))}})()},children:L(`button`,{type:`button`,class:`light danger`,disabled:o===`loading`,children:L(j,{id:`Jb6_SB`})})})]})]})})]})}function js(e){let{_:n}=d(),r=W(k),{masto:a,instance:o,authenticated:c}=f(),[l,u]=g(()=>{let e=v();return[e.find(e=>e.info.id===ee())||e[0],e.length>1]},[]),p=r.settings.shortcutsViewMode===`tab-menu-bar`&&r.shortcuts.some(e=>e.type===`profile`),m=u&&!p,h=(r.settings.shortcutsViewMode===`multi-column`||!r.settings.shortcutsViewMode&&r.settings.shortcutsColumnsMode)&&!r.shortcuts.find(e=>e.type===`following`),_=ut(()=>{k.showAccounts=!0},{threshold:600,detect:`touch`,cancelOnMovement:!0}),y=s(),[b,x]=I(void 0),S=Et([0,0,r.settings.shortcutsViewMode===`tab-menu-bar`?50:0,0]),C=s();async function w(e){return(e||!C.current)&&(C.current=a.v1.mutes.list({limit:80}).values()),await C.current.next()}let T=s();async function E(e){return(e||!T.current)&&(T.current=a.v1.blocks.list({limit:80}).values()),await T.current.next()}let D=s();return L(i,{children:[L(`button`,{ref:y,type:`button`,class:`button plain nav-menu-button ${m?`with-avatar`:``} ${b===`open`?`active`:``}`,style:{position:`relative`},onClick:()=>{D.current=Date.now(),x(e=>e?void 0:`open`)},onContextMenu:e=>{e.preventDefault(),k.showAccounts=!0},..._(),children:[m&&L(Ht,{url:l?.info?.avatar||l?.info?.avatarStatic,size:`l`,squircle:l?.info?.bot}),L(X,{icon:`menu`,size:m?`s`:`l`,alt:n({id:`zucql-`})})]}),L(At,{menuClassName:`nav-menu`,state:b,anchorRef:y,onClose:()=>{x(void 0)},containerProps:{style:{zIndex:10},onClick:()=>{Date.now()-D.current}},portal:{target:document.body},...e,overflow:`auto`,viewScroll:`close`,position:`anchor`,align:`center`,boundingBoxPadding:S,unmountOnClose:!0,children:[!!r.appVersion?.commitHash&&r.appVersion.commitHash!==`05dcc55`&&L(`div`,{class:`top-menu`,children:[L(Y,{onClick:()=>{confirm(n({id:`Djbaby`}))&&(async()=>{try{location.reload()}catch{}})()},children:[L(X,{icon:`sparkles`,class:`sparkle-icon`,size:`l`}),` `,L(`span`,{children:L(j,{id:`95IFnD`})})]}),L(qe,{})]}),L(`section`,{children:[L(Mt,{to:`/`,children:[L(X,{icon:`home`,size:`l`}),` `,L(`span`,{children:L(j,{id:`i0qMbr`})})]}),c?L(i,{children:[h&&L(Mt,{to:`/following`,children:[L(X,{icon:`following`,size:`l`}),` `,L(`span`,{children:L(j,{id:`following.title`})})]}),L(Mt,{to:`/catchup`,children:[L(X,{icon:`history2`,size:`l`}),L(`span`,{children:L(j,{id:`xrl8fj`})})]}),ot(`@mastodon/mentions`)&&L(Mt,{to:`/mentions`,children:[L(X,{icon:`at`,size:`l`}),` `,L(`span`,{children:L(j,{id:`_bZzdR`})})]}),L(Mt,{to:`/notifications`,children:[L(X,{icon:`notification`,size:`l`}),` `,L(`span`,{children:L(j,{id:`iDNBZe`})}),r.notificationsShowNew&&L(`sup`,{title:n({id:`isRobC`}),style:{opacity:.5},children:[` `,`•`]})]}),L(qe,{}),l?.info?.id&&L(Mt,{to:`/${o}/a/${l.info.id}`,children:[L(X,{icon:`user`,size:`l`}),` `,L(`span`,{children:L(j,{id:`vERlcd`})})]}),L(Ms,{menuState:b}),L(Mt,{to:`/b`,children:[L(X,{icon:`bookmark`,size:`l`}),` `,L(`span`,{children:L(j,{id:`7Ff7ia`})})]}),L(Lt,{menuClassName:`nav-submenu`,overflow:`auto`,gap:-8,label:L(i,{children:[L(X,{icon:`more`,size:`l`}),L(`span`,{class:`menu-grow`,children:L(j,{id:`24misb`})}),L(X,{icon:`chevron-right`})]}),children:[L(Mt,{to:`/f`,children:[L(X,{icon:`heart`,size:`l`}),` `,L(`span`,{children:L(j,{id:`zZOZj7`})})]}),l?.info?.id&&yi()&&L(Mt,{to:`/${o}/a/${l.info.id}/c`,children:[L(X,{icon:`collections`,size:`l`}),` `,L(`span`,{children:L(j,{id:`DoJzLz`})})]}),L(Mt,{to:`/fh`,children:[L(X,{icon:`hashtag`,size:`l`}),` `,L(`span`,{children:L(j,{id:`Xi1_bw`})})]}),L(Mt,{to:`/sp`,children:[L(X,{icon:`schedule`,size:`l`}),` `,L(`span`,{children:L(j,{id:`-GkIdc`})})]}),L(qe,{}),ot(`@mastodon/filters`)&&L(Mt,{to:`/ft`,children:[L(X,{icon:`filters`,size:`l`}),` `,L(`span`,{children:L(j,{id:`cSev-j`})})]}),L(Y,{onClick:()=>{k.showGenericAccounts={id:`mute`,heading:n({id:`sOKhEA`}),fetchAccounts:w,excludeRelationshipAttrs:[`muting`]}},children:[L(X,{icon:`mute`,size:`l`}),` `,L(`span`,{children:L(j,{id:`n1sANU`})})]}),L(Y,{onClick:()=>{k.showGenericAccounts={id:`block`,heading:n({id:`nL8nlr`}),fetchAccounts:E,excludeRelationshipAttrs:[`blocking`]}},children:[L(X,{icon:`block`,size:`l`}),` `,L(`span`,{children:L(j,{id:`r3RRWo`})})]}),` `]}),L(qe,{}),L(Y,{onClick:()=>{k.showAccounts=!0},children:[L(X,{icon:`group`,size:`l`}),` `,L(`span`,{children:L(j,{id:`7e0O8Z`})})]})]}):L(i,{children:[L(qe,{}),L(Mt,{to:`/login`,children:[L(X,{icon:`user`,size:`l`}),` `,L(`span`,{children:L(j,{id:`sQia9P`})})]})]})]}),L(`section`,{children:[L(qe,{}),L(Mt,{to:`/search`,children:[L(X,{icon:`search`,size:`l`}),` `,L(`span`,{children:L(j,{id:`A1taO8`})})]}),!r.settings.hideTrendingTimeline&&L(Mt,{to:`/${o}/trending`,children:[L(X,{icon:`chart`,size:`l`}),` `,L(`span`,{children:L(j,{id:`4_iCqx`})})]}),!r.settings.hideLocalTimeline&&L(Mt,{to:`/${o}/p/l`,children:[L(X,{icon:`building`,size:`l`}),` `,L(`span`,{children:L(j,{id:`d5zxa4`})})]}),!r.settings.hideFederatedTimeline&&L(Mt,{to:`/${o}/p`,children:[L(X,{icon:`earth`,size:`l`}),` `,L(`span`,{children:L(j,{id:`4ERYY7`})})]}),c?L(i,{children:[L(qe,{className:`divider-grow`}),L(Y,{onClick:()=>{k.showKeyboardShortcutsHelp=!0},children:[L(X,{icon:`keyboard`,size:`l`}),` `,L(`span`,{children:L(j,{id:`77Emn0`})})]}),L(Y,{onClick:()=>{k.showShortcutsSettings=!0},children:[L(X,{icon:`shortcut`,size:`l`}),` `,L(`span`,{children:L(j,{id:`8Kudkr`})})]}),L(Y,{onClick:()=>{k.showSettings=!0},children:[L(X,{icon:`gear`,size:`l`}),` `,L(`span`,{children:L(j,{id:`uVbUP8`})})]})]}):L(i,{children:[L(qe,{}),L(Y,{onClick:()=>{k.showSettings=!0},children:[L(X,{icon:`gear`,size:`l`}),` `,L(`span`,{children:L(j,{id:`uVbUP8`})})]})]})]})]})]})}function Ms({menuState:e}){let n=ot(`@mastodon/lists`),[r,a]=I([]);return y(()=>{n&&e===`open`&&Ti().then(a)},[e,n]),r.length>0?L(Lt,{menuClassName:`nav-submenu`,overflow:`auto`,gap:-8,label:L(i,{children:[L(X,{icon:`list`,size:`l`}),L(`span`,{class:`menu-grow`,children:L(j,{id:`h16FyT`})}),L(X,{icon:`chevron-right`})]}),children:[L(Mt,{to:`/l`,children:L(`span`,{children:L(j,{id:`BHWx-g`})})}),r?.length>0&&L(i,{children:[L(qe,{}),r.map(e=>L(Mt,{to:`/l/${e.id}`,children:L(`span`,{children:[e.title,e.exclusive&&L(i,{children:[` `,L(Mi,{})]})]})},e.id))]})]}):n&&L(Mt,{to:`/l`,children:[L(X,{icon:`list`,size:`l`}),L(`span`,{children:L(j,{id:`h16FyT`})})]})}var Ns=K(js),Ps=80;function Fs({account:e,instance:n}){let{_:r}=d();if(!e)return null;let{followersCount:i,followingCount:a,statusesCount:o,id:c,hideCollections:l}=e,u=n?`/${n}/a/${c}`:`/a/${c}`,{masto:p}=f({instance:n}),m=s();async function h(e){return c?((e||!m.current)&&(m.current=p.v1.accounts.$select(c).followers.list({limit:Ps}).values()),await m.current.next()):{value:[],done:!0}}let g=s();async function _(e){return c?((e||!g.current)&&(g.current=p.v1.accounts.$select(c).following.list({limit:Ps}).values()),await g.current.next()):{value:[],done:!0}}return L(`div`,{class:`account-container mini`,children:L(`div`,{class:`account-metadata-box`,children:L(`div`,{class:`stats`,children:[L(`div`,{tabIndex:0,onClick:()=>{setTimeout(()=>{k.showGenericAccounts={id:`followers`,heading:r({id:`x5LEuB`}),fetchAccounts:h,instance:n,blankCopy:l?r({id:`BRV_wh`}):void 0}},0)},children:L(j,{id:`TbttfX`,values:{0:Je(i),1:Je(i),followersCount:i},components:{0:L(`span`,{title:i}),1:L(`span`,{title:i})}})}),L(`div`,{class:`insignificant`,tabIndex:0,onClick:()=>{setTimeout(()=>{k.showGenericAccounts={heading:r({id:`following.stats`}),fetchAccounts:_,instance:n,blankCopy:l?r({id:`BRV_wh`}):void 0}},0)},children:L(j,{id:`SGcIK-`,values:{0:Je(a),followingCount:a},components:{0:L(`span`,{title:a})}})}),L(Q,{class:`insignificant`,to:u,children:L(j,{id:`C4x3-X`,values:{0:Je(o),1:Je(o),statusesCount:o},components:{0:L(`span`,{title:o}),1:L(`span`,{title:o})}})})]})})})}function Is(e){let n=[],r=[],i=0;for(let a=0;a<e.length;a++){let o=e[a];o.reblog&&!o.account?.group?(r.push(o),i++):(n.push(o),i<3&&(i=0))}if(e.length>10&&(r.length>e.length/4||i>=3)){let i=r.map(e=>e.id);if(r.length>e.length*3/4)n=[...n,{id:i,items:r,type:`boosts`}];else{let e=Math.floor(n.length/2);n=[...n.slice(0,e),{id:i,items:r,type:`boosts`},...n.slice(e)]}return n}else return e}var Ls=100;function Rs(e,n){let r=F.account.get(`boostedStatusIDs`)||{},i=e.filter(e=>{if(!e.reblog)return!0;let i=`${n}-${e.reblog.id}`,a=r[i];return a&&a!==e.id?!1:(r[i]=e.id,!0)}),a=Object.keys(r);return a.length>Ls&&a.slice(0,a.length-Ls).forEach(e=>{delete r[e]}),F.account.set(`boostedStatusIDs`,r),i}function zs(e,n){if(!n)return e;let r=ee();return e.filter(e=>{if(!e?.filtered)return!0;let i=e?.account?.id===r,a=lt(e.filtered,n);return!(!i&&a?.action===`hide`)})}function Bs(e,n){let r=[],i=0;e.forEach(n=>{for(let e=0;e<r.length;e++){if(r[e].find(e=>e.id===n.id))return;if(r[e].find(e=>e.id===n.inReplyToId)||r[e].find(e=>e.inReplyToId===n.id)){r[e].push(n);return}}let a=e.find(e=>e.id===n.inReplyToId);a&&(r[i++]=[n,a])});for(let e=0;e<r.length;e++)for(let n=e+1;n<r.length;n++)r[e].find(e=>r[n].includes(e))&&(r[e]=[...r[e],...r[n]],r[e]=r[e].filter((e,n,r)=>r.findIndex(n=>n.id===e.id)===n),r.splice(n,1),n--);r.forEach(e=>{e.sort((e,n)=>!e.inReplyToId&&!n.inReplyToId?Date.parse(e.createdAt)-Date.parse(n.createdAt):e.inReplyToId===n.id?1:n.inReplyToId===e.id||!e.inReplyToId?-1:n.inReplyToId?Date.parse(e.createdAt)-Date.parse(n.createdAt):1)}),r.forEach(e=>{let n=e[0].account.id;e.forEach(e=>{e.account.id!==n&&(e._differentAuthor=!0)})}),r.length;let a=[],o=[],s=[];return e.forEach(e=>{if(e.reblog){a.push(e);return}for(let n=0;n<r.length;n++)if(r[n].find(n=>n.id===e.id)){if(o.includes(n))return;let e=r[n];e.sort((e,n)=>Date.parse(e.createdAt)-Date.parse(n.createdAt));let i=e[0].account.id;a.push({id:e.map(e=>e.id),items:e,type:e.every(e=>e.account.id===i)?`thread`:`conversation`}),o.push(n);return}if(e.inReplyToId&&e.inReplyToAccountId!==e.account.id){let r=c(e.id,n);k.statusReply[r]||s.push({sKey:r,inReplyToId:e.inReplyToId})}a.push(e)}),s?.length&&setTimeout(()=>{let{masto:e}=f({instance:n});async function r(){for(let e=0;e<s.length;e++){let{sKey:r,inReplyToId:i}=s[e];try{let e=await Vs(i,n);Me(e,n,{skipThreading:!0}),k.statusReply[r]={id:e.id,instance:n},await new Promise(e=>setTimeout(e,1e3))}catch{}}}if(ot(`@mastodon/fetch-multiple-statuses`)){let i=s.map(({inReplyToId:e})=>e);(async()=>{try{let a=await e.v1.statuses.list({id:i});if(a?.length)for(let e of a){Me(e,n,{skipThreading:!0});let r=s.find(({inReplyToId:n})=>n===e.id)?.sKey;r&&(k.statusReply[r]={id:e.id,instance:n})}else r()}catch{r()}})()}else r()},10),a}var Vs=a((e,n)=>{let{masto:r}=f({instance:n});return r.v1.statuses.$select(e).fetch()});async function Hs(e,n){let r=await qo();if(!r.length)return;let{statusFollowedTags:i}=k,a=[];if(e.forEach(e=>{if(e.reblog)return;let{id:o,content:s,tags:l=[]}=e,u=c(o,n);if(i[u]?.length)return;let d=Yo(s);if(!d.length&&!l.length)return;let f=r.reduce((e,n)=>((d.some(e=>e.toLowerCase()===n.name.toLowerCase())||l.some(e=>e.name.toLowerCase()===n.name.toLowerCase()))&&e.push(n.name),e),[]);f.length&&a.push({item:e,sKey:u,followedTags:f})}),a.length){let e=await tt(a.map(e=>e.item.account));if(!e)return;a.forEach(n=>{let{item:r,sKey:a,followedTags:o}=n,s=e[r.account.id];s&&!s.following&&(i[a]=o)})}}function Us(){k.statusFollowedTags={}}function Ws({scrollableRef:e,distanceFromStart:n=1,distanceFromEnd:r=1,scrollThresholdStart:i=10,scrollThresholdEnd:a=10,direction:o=`vertical`,distanceFromStartPx:s,distanceFromEndPx:c}={}){let[l,u]=I(null),[d,f]=I(!1),[p,m]=I(!1),[h,g]=I(!1),[_,v]=I(!1),y=o===`vertical`;return N(()=>{let o=e.current;if(!o)return{};let l=y?o.scrollTop:o.scrollLeft;function d(){let{scrollTop:e,scrollLeft:d,scrollHeight:p,scrollWidth:h,clientHeight:_,clientWidth:b}=o,x=y?e:d,S=y?p:h,C=y?_:b,w=Math.abs(x-l),T=s||Math.min(C*n,S,x),E=c||Math.min(C*r,S,S-x-C);w>=(l<x?a:i)&&(u(l<x?`end`:`start`),l=x),f(x<=0),m(x+C>=S),g(x<=T),v(x+C>=S-E)}return o.addEventListener(`scroll`,d,{passive:!0}),()=>o.removeEventListener(`scroll`,d)},[n,r,i,a]),{scrollDirection:l,reachStart:d,reachEnd:p,nearReachStart:h,nearReachEnd:_,init:()=>{e.current&&e.current.dispatchEvent(new Event(`scroll`))}}}function Gs({scrollableRef:e,distanceFromStart:n=1,distanceFromEnd:r=1,scrollThresholdStart:i=10,scrollThresholdEnd:a=10,direction:o=`vertical`,distanceFromStartPx:c,distanceFromEndPx:l,init:u}={},d){if(!d)return;let f=o===`vertical`,p=s(null),m=s(null),h=Qe(()=>{let o=!1,s=!1,u=!1,h=!1,{scrollTop:g,scrollLeft:_,scrollHeight:v,scrollWidth:y,clientHeight:b,clientWidth:x}=e.current,S=f?g:_,C=f?v:y,w=f?b:x,T=S-p.current,E=T>0,ee=E?a:i,D=c||Math.min(w*n,C,S),O=l||Math.min(w*r,C,C-S-w);Math.abs(T)>=ee&&(m.current=E?`end`:`start`,p.current=S),o=S<=0,s=S+w>=C,u=S<=D,h=S+w>=C-O,d({scrollDirection:m.current,reachStart:o,reachEnd:s,nearReachStart:u,nearReachEnd:h})},500,{leading:!1});return N(()=>{let n=e.current;return n&&(p.current=n[f?`scrollTop`:`scrollLeft`],n.addEventListener(`scroll`,h,{passive:!0})),()=>{n&&n.removeEventListener(`scroll`,h)}},[]),y(()=>{u&&e.current&&queueMicrotask(()=>{e.current.dispatchEvent(new Event(`scroll`))})},[u]),{resetScrollDirection:()=>{m.current=null}}}function Ks({class:e,statusID:n,status:r,instance:i,parent:a,onMediaClick:o}){let{_:s}=d(),l=c(n,i),u=W(k);if(r||(r=u.statuses[l]||u.statuses[n],l=c(r?.id,i)),!r)return null;let{account:{acct:f,avatar:p,avatarStatic:m,id:h,url:v,displayName:y,username:b,emojis:x,bot:S,group:C},id:w,repliesCount:T,reblogged:E,reblogsCount:D,favourited:O,favouritesCount:A,bookmarked:j,poll:M,muted:N,sensitive:P,spoilerText:te,visibility:F,language:I,editedAt:ne,filtered:R,card:z,createdAt:B,inReplyToId:V,inReplyToAccountId:re,content:ie,mentions:ae,mediaAttachments:H,reblog:U,uri:oe,url:se,emojis:ce,_deleted:le,_pinned:G}=r;if(!H?.length)return null;let ue=e=>{e.shiftKey},K=g(()=>ee(),[]),de=g(()=>K&&K===h,[h,K]),fe=be(He),pe=!de&<(R,fe);if(pe?.action===`hide`)return null;let me=P,he=(_()[`reading:expand:media`]?.toLowerCase()||`default`)===`show_all`,ge=a||`div`;return H.map((n,a)=>{let c=`${l}-${n.id}`,u=pe?.titlesStr;return L(ge,{"data-state-post-id":l,onMouseEnter:ue,"data-spoiler-text":te||(P?s({id:`FKojeB`}):void 0),"data-filtered-text":pe?s(u?{id:`7FGvtQ`,values:{filterTitleStr:u}}:{id:`03Qqf9`}):void 0,class:`
|
|
17
|
+
media-post
|
|
18
|
+
${pe?`filtered`:``}
|
|
19
|
+
${me?`has-spoiler`:``}
|
|
20
|
+
${he?`show-media`:``}
|
|
21
|
+
`,children:L(bt,{class:e,media:n,lang:I,to:`/${i}/s/${w}?media-only=${a+1}`,onClick:o?e=>o(e,a,n,r):void 0})},c)})}var qs=K(Ks),Js={block:`start`,inline:`center`,behavior:`instant`},Ys=`.timeline-pagination button[data-pagination-trigger="prev"]`,Xs=`.timeline-pagination button[data-pagination-trigger="next"]`,Zs=`.timeline-item, .timeline-item-alt`;function Qs(e){return nt(`j, shift+j`,(n,r)=>{if(n.shiftKey!==r.shift)return;let i=document.activeElement.closest(Zs),a=i?.getBoundingClientRect(),o=Array.from(e.current?.querySelectorAll(Zs)||[]).filter(e=>!!e.offsetHeight);if(i&&a.top<e.current.clientHeight&&a.bottom>0){let n=o.indexOf(i),a=o[n+1];if(r.shift&&(a=o.find((e,r)=>r>n&&!e.classList.contains(`timeline-item-alt`))),a)a.focus(),a.scrollIntoView(Js);else{let n=e.current.querySelector(Xs);n&&n.click()}}else{let e=o.find(e=>{let n=e.getBoundingClientRect();return n.top>=44&&n.left>=0});e&&(e.focus(),e.scrollIntoView(Js))}},{useKey:!0,ignoreEventWhen:e=>e.metaKey||e.ctrlKey||e.altKey||e.key.toLowerCase()!==`j`})}function $s(e){return nt(`k, shift+k`,(n,r)=>{if(n.shiftKey!==r.shift)return;let i=document.activeElement.closest(Zs),a=i?.getBoundingClientRect(),o=Array.from(e.current?.querySelectorAll(Zs)||[]).filter(e=>!!e.offsetHeight);if(i&&a.top<e.current.clientHeight&&a.bottom>0){let n=o.indexOf(i),a=o[n-1];if(r.shift&&(a=o.findLast((e,r)=>r<n&&!e.classList.contains(`timeline-item-alt`))),a)a.focus(),a.scrollIntoView(Js);else{let n=e.current.querySelector(Ys);n&&n.click()}}else{let e=o.find(e=>{let n=e.getBoundingClientRect();return n.top>=44&&n.left>=0});e&&(e.focus(),e.scrollIntoView(Js))}},{useKey:!0,ignoreEventWhen:e=>e.metaKey||e.ctrlKey||e.altKey||e.key.toLowerCase()!==`k`})}function ec(){return nt([`enter`,`o`],(e,n)=>{let r=document.activeElement;if(r?.matches(Zs))if(n.keys.join(``)===`o`){let e=r.querySelector(`a.media:not(.status-card a.media)`);if(e){let n=e.getAttribute(`href`);if(/media\-only=/i.test(n)){let e=n.replace(/media\-only=/i,`media=`);setTimeout(()=>{location.hash=e},100)}else e.click()}else r.click()}else r.click()},{useKey:!0,ignoreEventWhen:e=>e.key===`Enter`?!1:e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.key.toLowerCase()!==`o`})}function tc({title:e,titleComponent:n,id:r,instance:a,emptyText:o,errorText:c,useItemID:l,boostsCarousel:u,fetchItems:f=()=>{},checkForUpdates:p=()=>{},checkForUpdatesInterval:m=15e3,headerStart:h,headerEnd:_,timelineStart:v,refresh:b,view:S,filterContext:C,showFollowedTags:w,showReplyParent:T,clearWhenRefresh:E}){let{_:ee}=d(),D=W(k),O=D.settings.autoHideBars,[A,M]=I([]),[N,P]=I(`start`),[te,F]=I(!1),[ne,R]=I(!1),[z,B]=I(!0),re=s();__BENCHMARK.start(`timeline-${r}-load`);let ie=g(()=>V(),[]),ae=S!==`media`,H=s(0),U=mt(e=>{R(!1),P(`loading`),(async()=>{try{let n=H.current=Date.now(),{done:i,value:o}=await f(e);if(n!==H.current)return;if(i)F(!1);else if(Array.isArray(o)){let[n,r]=o.reduce((e,n)=>(n._pinned?e[0].push(n):e[1].push(n),e),[[],[]]);o=r,o=zs(o,C),ae&&(u&&(o=Is(o)),o=Bs(o,a)),n.length&&(o=n.concat(o)),M(e?o:e=>[...e,...o]),o.length||(i=!0),F(!i)}else throw Error(`Timeline load failed`);P(`default`),__BENCHMARK.end(`timeline-${r}-load`)}catch{P(`error`),e&&!A.length&&c&&Z(c)}finally{U.cancel()}})()},1e3,{leading:!0}),oe=Qs(re),se=$s(re),ce=ec(),le=A.length>0&&N!==`loading`&&ne,G=x(()=>{le&&U(!0),re.current?.scrollTo({top:0,behavior:`smooth`})},[U,le]),ue=nt(`.`,G,{useKey:!0,ignoreEventWhen:e=>e.key===`.`?!1:e.metaKey||e.ctrlKey||e.altKey||e.shiftKey}),K=s(),[de,fe]=I(!1),pe=x(({scrollDirection:e,nearReachStart:n,reachStart:r})=>{if(K.current){let r=O&&e===`end`&&!n;K.current.hidden=r}fe(n),r&&U(!0)},[fe,U,O]),{resetScrollDirection:me}=Gs({scrollableRef:re,distanceFromEnd:2,scrollThresholdStart:44},pe);y(()=>{re.current?.scrollTo({top:0}),U(!0)},[]);let he=s(!0);y(()=>{if(he.current){he.current=!1;return}E&&A?.length&&(U.cancel?.(),M([])),U(!0)},[E,b]);let ge=s(S);y(()=>{ge.current!==S&&(ge.current=S,M([]))},[S]);let _e=x(async({disableIdleCheck:e=!1}={})=>{let n=re.current?getComputedStyle(re.current).pointerEvents===`none`:!1;D.settings.autoRefresh&&re.current.scrollTop<16&&(e||window.__IDLE__)&&!ac()&&!n?U(!0):await p()&&R(!0)},[r,U,p,D.settings.autoRefresh]),ve=s();return ln(e=>{if(e){let e=Date.now()-ve.current;(!ve.current||e>1e3*3)&&_e({disableIdleCheck:!0})}else ve.current=Date.now();B(e)},[p,_e,D.settings.autoRefresh]),Be(_e,z&&!ne?m*(de?1:2):null),L(He.Provider,{value:C,children:L(`div`,{id:`${r}-page`,class:`deck-container ${ie?`deck-container-media-first`:``}`,ref:e=>{re.current=e,oe.current=e,se.current=e,ce.current=e,ue.current=e},tabIndex:`-1`,onClick:e=>{K.current&&e.target.closest(`.timeline-item, .timeline-item-alt`)&&setTimeout(()=>{K.current.hidden=!1,me()},250)},children:L(`div`,{class:`timeline-deck deck`,children:[L(`header`,{ref:K,onClick:e=>{e.target.closest(`a, button`)||re.current?.scrollTo({top:0,behavior:`smooth`})},onDblClick:e=>{e.target.closest(`a, button`)||U(!0)},class:N===`loading`?`loading`:``,children:[L(`div`,{class:`header-grid`,children:[L(`div`,{class:`header-side`,children:[L(Ns,{}),h??L(Q,{to:`/`,class:`button plain home-button`,children:L(X,{icon:`home`,size:`l`,alt:ee({id:`i0qMbr`})})})]}),e&&(n||L(`h1`,{children:e})),L(`div`,{class:`header-side`,children:!!_&&_})]}),le&&L(`button`,{class:`updates-button shiny-pill`,type:`button`,onClick:G,children:[L(X,{icon:`arrow-up`}),` `,L(j,{id:`2yr1_p`})]})]}),!!v&&L(`div`,{class:`timeline-start ${N===`loading`?`loading`:``}`,children:v}),A.length?L(i,{children:[L(`ul`,{class:`timeline ${S?`timeline-${S}`:``}`,children:[A.map(e=>L(nc,{status:e,instance:a,useItemID:l,filterContext:C,view:S,showFollowedTags:w,showReplyParent:T,mediaFirst:ie},e.id+e?._pinned+S)),te&&N===`loading`&&(S===`media`?null:L(i,{children:[L(`li`,{style:{height:`20vh`},children:L(Ut,{skeleton:!0,mediaFirst:ie})}),L(`li`,{style:{height:`25vh`},children:L(Ut,{skeleton:!0,mediaFirst:ie})})]}))]}),N==="default"&&(te?L(at,{root:re.current,rootMargin:`0px 0px ${screen.height*1.5}px 0px`,onChange:e=>{e&&U()},children:L(`button`,{type:`button`,class:`plain block`,onClick:()=>U(),style:{marginBlockEnd:`6em`},children:L(j,{id:`uXRAkV`})})}):L(`p`,{class:`ui-state insignificant`,children:L(j,{id:`2EYeAZ`})}))]}):N===`loading`?L(`ul`,{class:`timeline`,children:Array.from({length:5}).map((e,n)=>S===`media`?L(`div`,{style:{height:`50vh`}}):L(`li`,{children:L(Ut,{skeleton:!0,mediaFirst:ie})},n))}):N!==`error`&&N!==`start`&&L(`p`,{class:`ui-state`,children:o}),N===`error`&&L(`p`,{class:`ui-state`,children:[c,L(`br`,{}),L(`br`,{}),L(`button`,{type:`button`,onClick:()=>U(!A.length),children:L(j,{id:`KDw4GX`})})]})]})})})}var nc=K(({status:e,instance:n,useItemID:r,filterContext:i,view:a,showFollowedTags:o,showReplyParent:s,mediaFirst:c})=>{let{_:l}=d(),{id:u,reblog:f,items:p,type:m,_pinned:h}=e;h&&(r=!1);let g=f?.id||u,_=n?`/${n}/s/${g}`:`/s/${g}`;if(p){let e=Zt(p,i),a=``;if(m===`boosts`?a=G._({id:`NuqppG`,values:{0:e.length}}):m===`pinned`&&(a=l({id:`GlfmCu`})),m===`boosts`||m===`pinned`){let o=new Set;if(e.sort((e,n)=>{let r=lt(e.filtered,i),a=lt(n.filtered,i),s=r&&r.action!==`blur`,c=a&&a.action!==`blur`;return s&&o.add(e.id),c&&o.add(n.id),s&&!c?1:!s&&c?-1:0}),o.size>=2){let n=[],r=[];e.forEach(e=>{o.has(e.id)?r.push(e):n.push(e)});let i=[];for(let e=0;e<r.length;e+=5)i.push({_grouped:!0,posts:r.slice(e,e+5)});e=n.concat(i)}return L(`li`,{class:`timeline-item-carousel`,children:L(rc,{title:a,class:`${m}-carousel`,children:e.map(e=>{let{id:i,reblog:a,_pinned:o,_grouped:s}=e;if(s)return L(`li`,{class:`timeline-item-carousel-group`,children:e.posts.map(e=>{let{id:i,reblog:a,_pinned:o}=e,s=a?.id||i,c=n?`/${n}/s/${s}`:`/s/${s}`;return o&&(r=!1),L(Q,{class:`status-carousel-link timeline-item-alt`,to:c,children:r?L(Ut,{statusID:i,instance:n,size:`s`}):L(Ut,{status:e,instance:n,size:`s`})})})},i);let l=a?.id||i,u=n?`/${n}/s/${l}`:`/s/${l}`;return o&&(r=!1),L(`li`,{children:L(Q,{class:`status-carousel-link timeline-item-alt`,to:u,children:r?L(Ut,{statusID:i,instance:n,size:`s`,contentTextWeight:!0,enableCommentHint:!0,mediaFirst:c}):L(Ut,{status:e,instance:n,size:`s`,contentTextWeight:!0,enableCommentHint:!0,mediaFirst:c})})},i)})})},`timeline-${u}`)}let s=e.length>3;return e.map((a,c)=>{let{id:l,_differentAuthor:u}=a,d=n?`/${n}/s/${l}`:`/s/${l}`,f=c>0&&c<e.length-1,p=a.sensitive&&!!a.spoilerText,h=!u&&p&&c>0||s&&f&&(m===`thread`||m===`conversation`&&!u&&!e[c-1]._differentAuthor&&!e[c+1]._differentAuthor),g=c===0,_=c===e.length-1;return L(`li`,{class:`timeline-item-container timeline-item-container-type-${m} timeline-item-container-${g?`start`:_?`end`:`middle`} ${u?`timeline-item-diff-author`:``}`,children:L(Q,{class:`status-link timeline-item`,to:d,children:h?L(ic,{status:a,instance:n,filterContext:i}):r?L(Ut,{statusID:l,instance:n,enableCommentHint:_,showFollowedTags:o}):L(Ut,{status:a,instance:n,enableCommentHint:_,showFollowedTags:o})})},`timeline-${l}`)})}let v=`timeline-${u+h}`;return a===`media`?r?L(qs,{class:`timeline-item`,parent:`li`,statusID:u,instance:n},v):L(qs,{class:`timeline-item`,parent:`li`,status:e,instance:n},v):L(`li`,{children:L(Q,{class:`status-link timeline-item`,to:_,children:r?L(Ut,{statusID:u,instance:n,enableCommentHint:!0,showFollowedTags:o,showReplyParent:s,mediaFirst:c}):L(Ut,{status:e,instance:n,enableCommentHint:!0,showFollowedTags:o,showReplyParent:s,mediaFirst:c})})},v)},(e,n)=>(e.status?.id||``).toString()===(n.status?.id||``).toString()&&e.instance===n.instance&&e.view===n.view);function rc({title:e,class:n,children:r}){let{_:i}=d(),a=s(),o=s(),c=s(),[l,u]=I(!1);return y(()=>{setTimeout(()=>{u(!0)},1)},[]),L(`div`,{class:`status-carousel ${n}`,children:[L(`header`,{children:[L(`h3`,{children:e}),L(`span`,{children:[L(`button`,{ref:o,type:`button`,class:`small plain2`,onClick:()=>{let e=Math.min(320,a.current?.offsetWidth)*(Ft()?1:-1);a.current?.scrollBy({left:e,behavior:`smooth`})},children:L(X,{icon:`chevron-left`,alt:i({id:`DHhJ7s`})})}),` `,L(`button`,{ref:c,type:`button`,class:`small plain2`,onClick:()=>{let e=Math.min(320,a.current?.offsetWidth)*(Ft()?-1:1);a.current?.scrollBy({left:e,behavior:`smooth`})},children:L(X,{icon:`chevron-right`,alt:i({id:`hXzOVo`})})})]})]}),L(`ul`,{ref:a,children:[L(at,{class:`status-carousel-beacon`,onChange:e=>{o.current&&(o.current.disabled=e)}}),r[0],l&&r.slice(1),L(at,{class:`status-carousel-beacon`,onChange:e=>{c.current&&(c.current.disabled=e)}})]})]})}function ic({status:e,instance:n,filterContext:r}){let{_:a}=d(),o=W(k),{id:s,visibility:l,language:u}=e,f=Ct(e),p=c(s,n),m=lt(e.filtered,r);return L(`article`,{class:`status compact-thread ${l===`direct`?`visibility-direct`:``}`,tabindex:`-1`,children:[L(`div`,{class:`status-thread-badge-container`,children:L(yt,{index:o.statusThreadNumber[p]})}),L(`div`,{class:`content-compact`,title:f,lang:u,dir:`auto`,children:m&&m?.action!==`blur`?L(`b`,{class:`status-filtered-badge badge-meta horizontal`,title:m?.titlesStr||``,children:m?.titlesStr?L(j,{id:`sr6maL`,values:{0:m.titlesStr},components:{0:L(`span`,{}),1:L(`span`,{})}}):L(`span`,{children:L(j,{id:`03Qqf9`})})}):L(i,{children:[f,e.sensitive&&e.spoilerText&&L(i,{children:[` `,L(`span`,{class:`spoiler-badge`,children:L(X,{icon:`eye-close`,size:`s`,alt:a({id:`gnKo7f`})})})]})]})})]})}function ac(){return!!document.querySelector(`.deck-backdrop, #modal-container > *`)}var oc=20,sc=1983,cc=`${sc}-01`,lc=J(()=>{try{let e=document.createElement(`input`);return e.setAttribute(`type`,`month`),e.type===`month`}catch{return!1}});function uc({columnMode:e,...n}){let{i18n:r,_:a}=d(),o=W(k),{id:c,...l}=e?{id:n.id}:A(),u=s(new URLSearchParams({replies:1})),[,p]=m(e=>e+1,0),h=x(e=>{let n=u.current;typeof e==`function`?e(n):e instanceof URLSearchParams?([...n.keys()].forEach(e=>n.delete(e)),e.forEach((e,r)=>n.set(r,e))):Object.entries(e).forEach(([e,r])=>{r?n.set(e,r):n.delete(e)}),p()},[]),[_,v]=e?[u.current,h]:oe(),b=x((n,r)=>{let i=new URLSearchParams(e?{replies:1}:void 0);r!==void 0&&i.set(n,r),v(i)},[v]),S=x((e,n)=>{let r=new URLSearchParams(_.toString());r.get(e)?r.delete(e):r.set(e,n??`1`),v(r)},[v,_]),C=_.get(`month`),w=!_.get(`replies`),E=!!_.get(`boosts`),D=_.get(`tagged`),O=!!_.get(`media`),{masto:M,instance:N,authenticated:P}=f({instance:l?.instance}),{masto:te,instance:F}=f(),ne=s(),R=[C,w,E,D,O],[z,B]=I(),re=s(0);y(()=>{re.current=0},R);let ie=g(()=>V(),[]),ae=g(()=>N===F,[N,F]),[H,U]=I(!1);y(()=>{ae&&z?.acct&&(async()=>{U(await xi(N))})()},[N,ae,z?.acct]);async function se(n){let r=/^\d{4}-[01]\d$/.test(C),i=C?.split?.(`-`)?.[0]>=sc;if(r&&i){if(!z)return{value:[],done:!0};let[e,r]=C.split(`-`),i=parseInt(r,10)-1,a=new Date(e,i,0),o=`${a.getFullYear()}-${(a.getMonth()+1).toString().padStart(2,`0`)}-${a.getDate().toString().padStart(2,`0`)}`,s=new Date(e,i+1,1),c=`${s.getFullYear()}-${(s.getMonth()+1).toString().padStart(2,`0`)}-${s.getDate().toString().padStart(2,`0`)}`,l=oc+1;n?re.current=0:re.current+=oc;let u=await M.v2.search.list({q:`from:${z.acct} after:${o} before:${c}`,type:`statuses`,limit:l,offset:re.current});if(u?.statuses?.length){let e=u.statuses.slice(0,oc);return e.forEach(e=>{Me(e,N)}),{value:e,done:u.statuses.length<=oc}}else return{value:[],done:!0}}let a=[];if(n&&!e){let{value:e}=await M.v1.accounts.$select(c).statuses.list({pinned:!0}).values().next();if(e?.length&&!D&&!O){let n=e.map(e=>(Me(e,N),{...e,_pinned:!0}));if(n.length>=3){let e=n.map(e=>e.id);a.push({id:e,items:n,type:`pinned`})}else a.push(...n)}}(n||!ne.current)&&(ne.current=M.v1.accounts.$select(c).statuses.list({limit:oc,exclude_replies:w,exclude_reblogs:E,only_media:O||void 0,tagged:D}).values());let{value:o,done:s}=await ne.current.next();if(o?.length){if(!ot(`@mastodon/pinned-posts`)&&a.length){let e=[];e=a[0]?.type===`pinned`?a[0].id:a.filter(e=>e._pinned).map(e=>e.id),e.every(e=>o.some(n=>n.id===e))&&(a=[])}a.push(...o),o.forEach(e=>{Me(e,N)})}return{value:a,done:s}}let[ce,le]=I([]),G=a({id:`_cKnpj`});if(z?.acct){let e=(/@/.test(z.acct)?``:`@`)+z.acct,n=z?.displayName?`${z.displayName} (${e})`:e;if(D&&O)G=a({id:`lYyloN`,values:{tagged:D,accountDisplay:n}});else if(D)G=a({id:`8ZPzp0`,values:{tagged:D,accountDisplay:n}});else if(C){let[e,i]=C.split(`-`);G=a({id:`Did6le`,values:{monthYear:new Date(+e,i-1,1).toLocaleString(r.locale,{month:`long`,year:`numeric`}),accountDisplay:n}})}else G=O?a({id:`dFu2-z`,values:{accountDisplay:n}}):n}he(G,`/:instance?/a/:id`);let ue=x(()=>pc(c,M),[c,M]);y(()=>{(async()=>{try{B(await ue())}catch{}if(!ie)try{le(await M.v1.accounts.$select(c).featuredTags.list())}catch{}})()},[c,ie]);let{displayName:K,acct:de,emojis:fe}=z||{},pe=g(()=>z?.id===ee(),[z?.id]),me=s(),ge=g(()=>{let n=(e?w:!w)||E||D||O||!!C,s=o.accounts[`${c}@${N}`],l=e=>{let n=new URLSearchParams(_.toString());for(let[r,i]of Object.entries(e))i==null?n.delete(r):n.set(r,i);let r=n.toString();return r?`?${r}`:``};return L(i,{children:[e?L(Fs,{account:z,instance:N}):L(qi,{instance:N,account:s||c,fetchAccount:ue,authenticated:P,standalone:!0,showEndorsements:!0}),!ie&&L(`div`,{class:`filter-bar`,ref:me,style:{position:`relative`},children:[n?L(Q,{to:`/${N}/a/${c}`,class:`insignificant filter-clear`,title:a({id:`I9EnzM`}),onClick:n=>{e&&(n.preventDefault(),b())},children:L(X,{icon:`x`,size:`l`,alt:a({id:`I9EnzM`})})},`clear-filters`):L(X,{icon:`filter`,class:`insignificant`,size:`l`,alt:a({id:`cSev-j`})}),L(`div`,{class:`filter-bar-group`,children:[L(`label`,{children:[L(`input`,{type:`checkbox`,checked:!w,disabled:!!C,onChange:()=>{S(`replies`,`1`),Z(a(w?{id:`t9yqkt`}:{id:`BHjZV6`}))}}),L(j,{id:`N8UzTV`})]}),L(`label`,{children:[L(`input`,{type:`checkbox`,checked:!E,disabled:!!C,onChange:()=>{S(`boosts`,`0`),Z(a(E?{id:`Wk2coq`}:{id:`63FG7O`}))}}),L(j,{id:`puY2t0`})]})]}),L(Q,{to:`/${N}/a/${c}${l({media:O?null:`1`})}`,onClick:n=>{e&&(n.preventDefault(),S(`media`,`1`)),O||Z(a({id:`rKpfPY`}))},class:O?`is-active`:``,children:L(j,{id:`xYilR2`})}),ce.length>0&&L(`div`,{class:`filter-bar-group`,children:[...ce].sort((e,n)=>e.name===D?-1:+(n.name===D)).map(n=>L(Q,{to:`/${N}/a/${c}${l({tagged:D===n.name?null:n.name})}`,onClick:r=>{if(e){r.preventDefault();let e=new URLSearchParams(_.toString());e.get(`tagged`)===n.name?e.delete(`tagged`):e.set(`tagged`,n.name),v(e)}D!==n.name&&Z(a({id:`L-HFfr`,values:{0:n.name}}))},class:D===n.name?`is-active`:``,children:L(`span`,{children:[L(`span`,{class:`more-insignificant`,children:`#`}),n.name]})},n.id))}),H&&!e&&L(i,{children:[L(`div`,{class:`filter-bar-separator`}),lc()?L(`label`,{class:`filter-field ${C?`is-active`:``}`,children:[L(X,{icon:`month`,size:`l`}),L(`input`,{type:`month`,disabled:!z?.acct,value:C||``,min:cc,max:new Date().toISOString().slice(0,7),onInput:e=>{let{value:n,validity:i}=e.currentTarget;if(!i.valid)return;v(n?{month:n}:{});let[o,s]=n.split(`-`),c=parseInt(s,10)-1;Z(a({id:`0WUFGD`,values:{0:new Date(o,c).toLocaleString(r.locale,{month:`long`,year:`numeric`})}}))}})]}):L(dc,{class:`filter-field ${C?`is-active`:``}`,disabled:!z?.acct,value:C||``,min:cc,max:new Date().toISOString().slice(0,7),onInput:e=>{let{value:n,validity:r}=e;r.valid&&v(n?{month:n}:{})}}),L(`button`,{type:`button`,class:`filter-field`,onClick:()=>{k.showSearchCommand={query:pe?`from:me `:`from:${z?.acct} `}},children:L(X,{icon:`search`,size:`l`,alt:a(pe?{id:`BmW9JG`}:{id:`h7t_Tx`,values:{0:z?.username}})})})]})]})]})},[c,N,P,ce,ue,H,...R]);y(()=>{let e=[...me.current?.querySelectorAll(`.is-active`)??[]];if(!e.length)return;let n=me.current.offsetWidth,r=Math.min(...e.map(e=>e.offsetLeft)),i=Math.max(...e.map(e=>e.offsetLeft+e.offsetWidth))-r;me.current.scrollTo({behavior:`smooth`,left:i>=n?r:r-(n-i)/2})},[ce,H,...R]);let _e=g(()=>z?.url?URL.parse(z.url)?.hostname:null,[z]),ve=!!z&&N!==_e;return L(i,{children:[L(tc,{title:`${z?.acct?`@`+z.acct:a({id:`-owNNn`})}`,titleComponent:L(`h1`,{class:`header-double-lines header-account`,children:[L(`b`,{children:L(st,{text:K,emojis:fe,resolverURL:z?.url})}),L(`div`,{children:L(`span`,{class:`bidi-isolate`,children:[`@`,de]})})]}),id:`account-statuses`,instance:N,emptyText:a({id:`-k97fV`}),errorText:a({id:`scd9lw`}),fetchItems:se,useItemID:!0,view:O||ie?`media`:void 0,boostsCarousel:!pe&&o.settings.boostsCarousel,timelineStart:ge,refresh:[w,E,D,O,C+z?.acct].toString(),headerEnd:L(Gt,{portal:!0,overflow:`auto`,viewScroll:`close`,position:`anchor`,menuButton:L(`button`,{type:`button`,class:`plain`,children:L(X,{icon:`more`,size:`l`,alt:a({id:`2FYpfJ`})})}),children:[L(Y,{disabled:!ve,onClick:()=>{(async()=>{try{let{masto:e}=f({instance:_e}),{id:n}=await e.v1.accounts.lookup({acct:z.acct});location.hash=`/${_e}/a/${n}`}catch{alert(a({id:`FgdLx0`}))}})()},children:[L(X,{icon:`transfer`}),` `,L(`small`,{class:`menu-double-lines`,children:L(j,{id:`6GZBJp`,values:{0:_e?L(i,{children:[` `,`(`,L(`b`,{children:T.toUnicode(_e)}),`)`]}):null}})})]}),!ae&&L(Y,{onClick:()=>{(async()=>{try{let{id:e}=await te.v1.accounts.lookup({acct:z.acct+`@`+N});location.hash=`/${F}/a/${e}`}catch{alert(a({id:`FgdLx0`}))}})()},children:[L(X,{icon:`transfer`}),` `,L(`small`,{class:`menu-double-lines`,children:L(j,{id:`SiegcM`,values:{currentInstance:F},components:{0:L(`b`,{})}})})]})]})},c),de&&!pe&&L(`data`,{class:`compose-data`,value:JSON.stringify({draftStatus:{status:`@${de} `}})})]})}function dc(e){let{i18n:n}=d(),{class:r,disabled:i,value:a,min:o,max:c,onInput:l=()=>{}}=e,[u,f]=a?.split(`-`)||[],p=s(),m=s(),h=(e,n)=>{let[r,i]=o?.split(`-`)||[],[a,s]=c?.split(`-`)||[];return!(n<r||n>a||n===r&&e<i||n===a&&e>s)};return L(`div`,{class:r,children:[L(X,{icon:`month`,size:`l`}),L(`select`,{ref:p,disabled:i,value:f||``,onInput:e=>{let{value:n}=e.currentTarget,r=m.current.value;if(!h(n,r))return{value:``,validity:{valid:!1}};l({value:n?`${r}-${n}`:``,validity:{valid:!0}})},children:[L(`option`,{value:``,children:L(j,{id:`HajiZl`})}),L(`option`,{disabled:!0,children:`-----`}),Array.from({length:12},(e,r)=>L(`option`,{value:(r+1).toString().padStart(2,`0`),children:new Date(0,r).toLocaleString(n.locale,{month:`long`})},r))]}),` `,L(`input`,{ref:m,type:`number`,disabled:i,value:u||new Date().getFullYear(),min:o?.slice(0,4)||sc,max:c?.slice(0,4)||new Date().getFullYear(),onInput:e=>{let{value:n,validity:r}=e.currentTarget,i=p.current.value;if(!r.valid||!h(i,n))return{value:``,validity:{valid:!1}};l({value:n?`${n}-${i}`:``,validity:{valid:!0}})},style:{width:`4.5em`}})]})}function fc(e,n){return n.v1.accounts.$select(e).fetch()}var pc=a(fc,{expires:1800*1e3});function mc(){let{_:e}=d(),n=Ne(),{id:r,...a}=A(),[o]=oe(),c=o.get(`ic`)!=null,l=W(k),{instance:u,masto:p}=f({instance:a?.instance}),{instance:m}=f(),[h,g]=I();y(()=>{let e=!1;return g(void 0),(async()=>{try{let n=await pc(r,p);if(e)return;g(n)}catch{if(e)return}})(),()=>{e=!0}},[r,p]);let{acct:_}=h||{},v=r===ee()&&u===m;y(()=>{c&&!v&&n(`/${u}/a/${r}/c`,{replace:!0})},[c,v,n,u,r]);let b=e({id:`DoJzLz`});h?.acct&&(c?b=e({id:`xnkAvy`}):v||(b=e({id:`EzMSOY`,values:{username:(/@/.test(h.acct)?``:`@`)+h.acct}}))),he(b,`/:instance?/a/:id/c`);let[x,S]=I([]),[C,w]=I(`loading`),[T,E]=I(!1),D=s(),O=s(0),M=async e=>{(e||!D.current)&&(D.current=(c?p.v1.accounts.$select(r).inCollections:p.v1.accounts.$select(r).collections).list({limit:80}).values());let n=await D.current.next();return{...n,value:n.value?.collections??[]}},N=async e=>{let n=++O.current;w(`loading`);try{let{done:r,value:i}=await M(e);if(n!==O.current)return;r?(E(!1),e&&S([])):(S(e?i:e=>[...e,...i]),E(i.length>=80)),w(`default`)}catch{if(n!==O.current)return;w(`error`)}};y(()=>{N(!0)},[r,c,p]);let P=`/${u}/a/${r}/c`,[te,F]=I(!1);return L(`div`,{id:`account-collections-page`,class:`deck-container`,tabIndex:`-1`,children:[L(`div`,{class:`timeline-deck deck`,children:[L(`header`,{children:L(`div`,{class:`header-grid`,children:[L(`div`,{class:`header-side`,children:[L(Ns,{}),v&&L(Q,{to:`/`,class:`button plain`,children:L(X,{icon:`home`,size:`l`,alt:e({id:`i0qMbr`})})})]}),h&&!v?L(`h1`,{class:`header-double-lines`,children:[L(`b`,{children:L(j,{id:`DoJzLz`})}),L(`div`,{children:L(Q,{class:`insignificant`,to:`/${u}/a/${r}`,onClick:e=>{v||(e.preventDefault(),e.stopPropagation(),k.showAccount={account:h,instance:u})},children:L(`span`,{class:`bidi-isolate`,children:[`@`,_]})})})]}):L(`h1`,{children:L(j,{id:`DoJzLz`})}),L(`div`,{class:`header-side`,children:v&&!c&&L(`button`,{type:`button`,class:`plain`,onClick:()=>F(!0),children:L(X,{icon:`plus`,size:`l`,alt:e({id:`3HCpJW`})})})})]})}),L(`main`,{children:[v&&L(`div`,{class:`filter-bar`,children:[L(X,{icon:`collections`,size:`l`,class:`insignificant`}),` `,L(Q,{to:P,class:c?``:`is-active`,children:L(j,{id:`WZTg05`})}),` `,L(Q,{to:`${P}?ic=1`,class:c?`is-active`:``,children:L(j,{id:`D15TLa`})})]}),x.length>0?L(i,{children:[L(`ul`,{class:`collections-list`,children:x.map(e=>L(`li`,{children:L(Rt,{collection:e,size:`l`,instance:u,creatorAccount:e.accountId?l.accounts[e.accountId]:null,showMeta:!c})},e.id))}),T&&(C===`loading`?L(`div`,{class:`ui-state`,children:L(q,{abrupt:!0})}):L(`div`,{class:`ui-state`,children:L(`button`,{type:`button`,class:`light`,onClick:()=>N(),children:L(j,{id:`uXRAkV`})})})),x.length>1&&L(`footer`,{class:`ui-state insignificant`,children:L(`small`,{children:L(j,{id:`FSeU2b`,values:{0:x.length}})})})]}):C===`loading`?L(`p`,{class:`ui-state`,children:L(q,{})}):C===`error`?L(`p`,{class:`ui-state insignificant`,children:L(j,{id:`xf6TNV`})}):h?L(`p`,{class:`ui-state insignificant`,children:e(c?{id:`pp8krA`}:{id:`-MACwa`})}):L(`p`,{class:`ui-state`,children:L(q,{})})]})]}),te&&L(Ot,{onClick:e=>{e.target===e.currentTarget&&F(!1)},children:L(As,{onClose:e=>{if(e?.state===`success`&&e.collection){let r=e.collection.id;n(`/${u}/c/${r}`)}F(!1)}})})]})}function hc(){let{year:e}=A();he(e?`${e} #Wrapstodon`:`#Wrapstodon`,`/annual_report/:year`);let{masto:n,instance:r}=f(),[a,o]=I(null),[s,c]=I(`default`);y(()=>{e&&(async()=>{c(`loading`),o(await n.v1.annualReports.$select(e).fetch()),c(`default`)})()},[e]);let{accounts:l,annualReports:u,statuses:d}=a||{},p=u?.find(n=>n.year==e)?.data,m=new Date;return L(`div`,{id:`annual-report-page`,class:`deck-container`,tabIndex:`-1`,children:[L(`div`,{class:`report ${s===`loading`?`loading-mask`:``}`,children:[L(`h1`,{children:[e,` #Wrapstodon`]}),!!p&&L(`dl`,{children:Object.entries(p).map(([e,n])=>{let a={};return Array.isArray(n)&&n.forEach(e=>{Object.entries(e).forEach(([e,n])=>{typeof n==`number`&&(a[e]=(a[e]||0)+n)})}),L(i,{children:[L(`dt`,{children:e}),L(`dd`,{class:`report-${e}`,children:Array.isArray(n)?L(`table`,{children:[L(`thead`,{children:L(`tr`,{children:Object.entries(n[0]).map(([e,n])=>L(`th`,{class:e!==`month`&&typeof n==`number`?`number`:``,children:e}))})}),L(`tbody`,{children:n.map(n=>L(`tr`,{children:Object.entries(n).map(([n,r])=>L(`td`,{class:n!==`month`&&typeof r==`number`?`number`:``,style:{"--percentage":typeof r==`number`?`${r/a[n]*100}%`:0},children:r&&/(accountId)/i.test(n)&&/^(mostRebloggedAccounts|commonlyInteractedWithAccounts)$/i.test(e)?l?.find(e=>e.id===r)?L(ht,{account:l?.find(e=>e.id===r),showAvatar:!0}):`👻`:n===`month`?m.setMonth(r-1)&&m.toLocaleString(void 0,{month:`long`}):typeof r==`number`?r.toLocaleString():r}))}))})]}):typeof n==`object`?/^(topStatuses)$/i.test(e)?L(`dl`,{children:Object.entries(n).map(([e,n])=>L(i,{children:[L(`dt`,{children:e}),L(`dd`,{children:n&&L(Q,{to:`/${r}/s/${n}`,children:L(Ut,{status:d?.find(e=>e.id===n),size:`s`,readOnly:!0,showCommentCount:!0})})})]}))}):L(`table`,{children:L(`tbody`,{children:Object.entries(n).map(([e,n])=>L(`tr`,{children:[L(`th`,{children:e}),L(`td`,{class:typeof n==`number`?`number`:``,children:n})]}))})}):typeof n==`string`?n:JSON.stringify(n,null,2)})]})})})]}),L(`hr`,{}),L(`p`,{style:{textAlign:`center`},children:L(Q,{to:`/`,children:L(j,{id:`iWpEwy`})})})]})}var gc=20;function _c(){let{_:e}=d();he(e({id:`7Ff7ia`}),`/b`);let{masto:n,instance:r}=f(),i=s();async function a(e){return(e||!i.current)&&(i.current=n.v1.bookmarks.list({limit:gc}).values()),await i.current.next()}return L(tc,{title:e({id:`7Ff7ia`}),id:`bookmarks`,emptyText:e({id:`8k2w6G`}),errorText:e({id:`UoL-FC`}),instance:r,fetchItems:a})}var vc=``+new URL(`catch-up-O5q5C75Z.png`,import.meta.url).href,yc=`home`,bc=`catchup`,xc=[{label:{id:`Ov9hfp`},value:1},{label:{id:`tVE2wM`},value:2},{label:{id:`8-HOWa`},value:3},{label:{id:`1o-mEC`},value:4},{label:{id:`dZZ8oA`},value:5},{label:{id:`lpPucp`},value:6},{label:{id:`r9r5X6`},value:7},{label:{id:`I9uBFA`},value:8},{label:{id:`pBYFlb`},value:9},{label:{id:`wvL7OJ`},value:10},{label:{id:`7Vb-qD`},value:11},{label:{id:`VU1Pnd`},value:12},{label:{id:`vpc27K`},value:13,beyond:!0}],Sc={original:{id:`HxF6Fk`},replies:{id:`N8UzTV`},quotes:{id:`eWLklq`},boosts:{id:`puY2t0`},followedTags:{id:`lCLRBe`},groups:{id:`zhrjek`},filtered:{id:`03Qqf9`}},Cc=[`createdAt`,`repliesCount`,`favouritesCount`,`reblogsCount`,`density`],wc=[null,`account`],Tc=J(e=>new Intl.DateTimeFormat(e||void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`numeric`,minute:`numeric`}));function Ec(e){return e?.id||e?.quotedStatus?.id}function Dc(){let{i18n:e,_:n,_:a}=d(),o=Tc(e.locale);he(`Catch-up`,`/catchup`);let{masto:l,instance:p}=f(),[h,_]=oe(),v=h.get(`id`),[b,S]=I(`start`),[C,w]=I(!1),T=g(()=>ee(),[]),E=e=>e===T,D=ot(`@pixelfed/home-include-reblogs`);async function O({maxCreatedAt:e}){let n=[],r=l.v1.timelines.home.list({limit:40}),i=r.values();mainloop:for(;;)try{D&&r.params&&(typeof r.params==`string`?r.params+=`&include_reblogs=true`:r.params.include_reblogs=!0);let{value:a}=await i.next();if(a?.length){await Hs(a,p);let r=!1;for(let i=0;i<a.length;i++){let o=a[i],s=Date.parse(o.createdAt);if(!e||s>=e){let e=!E(o.reblog?.account?.id||o.account.id)&<(o.reblog?.filtered||o.filtered,yc);if(e?.action===`hide`)continue;o._filtered=e;let i=c(o.id,p);o._followedTags=k.statusFollowedTags[i]?[...k.statusFollowedTags[i]]:[],n.push(o),r=!0}if(!r)break mainloop}}else break mainloop;await new Promise(e=>setTimeout(e,1e3))}catch{break mainloop}return n.forEach(e=>{if(e?.inReplyToId){let r=n.find(n=>n.id===e.inReplyToId);r&&!r.inReplyToId&&(r._thread=!0)}}),n}let[A,M]=I([]),P=s(),te=s(),ne=g(()=>r(),[]),R=x(async({duration:e}={})=>{let n=Date.now(),r=e?n-e:null;S(`loading`);let i=await O({maxCreatedAt:r}),a=`${ne}-${_t()}`;try{await Ke.catchup.set(a,{id:a,posts:i,count:i.length,startAt:r,endAt:n}),_({id:a})}catch{}},[]);y(()=>{v?(async()=>{let e=await Ke.catchup.get(v);e&&(e.posts.sort((e,n)=>e.createdAt>n.createdAt?1:-1),M(e.posts),S(`results`))})():b===`results`&&(M([]),S(`start`))},[v]);let[z,B]=m(e=>e+1,0),[V,re]=I(null),[ie,ae]=I([]);y(()=>{let e=new Set(ie.map(e=>e.id));for(let n=sessionStorage.length-1;n>=0;n--){let r=sessionStorage.key(n);if(r?.startsWith(`${bc}-`)){let n=r.replace(`${bc}-`,``);e.has(n)||F.session.del(r)}}},[ie]),y(()=>{(async()=>{try{let e=await Ke.catchup.keys();if(e.length){let n=r(),i=e.filter(e=>e.startsWith(`${n}-`));if(i.length){let e=await Ke.catchup.getMany(i);e.sort((e,n)=>n.endAt-e.endAt);let n=e.slice(0,3),r=e.slice(3);ae(n.map(e=>{let{id:n,count:r,startAt:i,endAt:a}=e;return{id:n,count:r,startAt:i,endAt:a}})),re(n[0].endAt),e=null,n=null,queueMicrotask(()=>{r.length&&Ke.catchup.delMany(r.map(e=>e.id)).then(()=>{r=null}).catch(e=>{})});return}}}catch{}ae([])})()},[z]),y(()=>{b===`start`&&B()},[b===`start`]);let[H,U]=g(()=>{let e=0,n=0,r=0,i=0,a=0,o=0,s=0,c={};for(let l of A){l._filtered&&l._filtered?.action!==`blur`?(e++,l.__FILTER=`filtered`):l.group?(n++,l.__FILTER=`groups`):l.reblog?(r++,l.__FILTER=`boosts`):Xe()&&Ec(l.quote)?(i++,l.__FILTER=`quotes`):l._followedTags?.length?(o++,l.__FILTER=`followedTags`):l.inReplyToId&&l.inReplyToAccountId!==l.account?.id?(a++,l.__FILTER=`replies`):(s++,l.__FILTER=`original`);let u=l.reblog||l;if(l.__FILTER!==`filtered`&&u.card?.url&&u.card?.image&&u.card?.type===`link`){let{card:e,favouritesCount:n,reblogsCount:r}=u,{url:i}=e;if(i=i.replace(/\/$/,``),!c[i])c[i]={postID:u.id,card:e,shared:1,sharers:[l.account],likes:n,boosts:r};else{if(c[i].sharers.find(e=>e.id===l.account.id))continue;c[i].shared++,c[i].sharers.push(l.account),c[i].postID!==u.id&&(c[i].likes+=n,c[i].boosts+=r)}}}let l=[];for(let e in c)l.push({url:e,...c[e]});if(l.sort((e,n)=>e.shared>n.shared?-1:e.shared<n.shared?1:e.boosts>n.boosts?-1:e.boosts<n.boosts?1:e.likes>n.likes?-1:e.likes<n.likes?1:e.quotes>n.quotes?-1:+(e.quotes<n.quotes)),l.length>10)linksLoop:for(let e=10;e<l.length;e++){let{shared:n}=l[e];if(n<=1){l=l.slice(0,e);break linksLoop}}return[{filtered:e,groups:n,boosts:r,quotes:i,replies:a,followedTags:o,original:s},l]},[A]),[W,se]=I(`all`),[ce,le]=I(null),[G,ue]=I(1),[K,de]=I(`createdAt`),[fe,pe]=I(`asc`),[me,ge]=I(null);y(()=>{if(!v)return;let e=F.session.getJSON(`${bc}-${v}`);e&&(e.selectedFilterCategory!==void 0&&se(e.selectedFilterCategory),e.selectedAuthor!==void 0&&le(e.selectedAuthor),e.sortBy!==void 0&&de(e.sortBy),e.sortOrder!==void 0&&pe(e.sortOrder),e.groupBy!==void 0&&ge(e.groupBy),e.showTopLinks!==void 0&&w(e.showTopLinks))},[v]),y(()=>{if(!v||b!==`results`)return;let e={selectedFilterCategory:W,selectedAuthor:ce,sortBy:K,sortOrder:fe,groupBy:me,showTopLinks:C};F.session.setJSON(`${bc}-${v}`,e)},[v,b,W,ce,K,fe,me,C]);let[_e,ve,ye]=g(()=>{let e={},n=new Map,r=A.filter(r=>{let i=W===`all`||r.__FILTER===W;return i&&(e[r.account.id]=r.account,n.set(r.account.id,(n.get(r.account.id)||0)+1)),i}),i={};return r.forEach(e=>{e.reblog&&(i[e.reblog.id]?(i[e.reblog.id].__BOOSTERS?i[e.reblog.id].__BOOSTERS.add(e.account):i[e.reblog.id].__BOOSTERS=new Set([e.account]),e.__HIDDEN=!0):i[e.reblog.id]=e)}),ce&&n.has(ce)&&(r=r.filter(e=>e.account.id===ce||[...e.__BOOSTERS||[]].find(e=>e.id===ce))),[r,e,Object.fromEntries(n)]},[W,ce,A]),be=g(()=>{let e={};return _e.forEach(n=>{e[n.id]=n}),e},[_e]),xe=g(()=>Object.keys(ye).sort((e,n)=>ye[n]-ye[e]),[ye]),Se=g(()=>{let e={};return xe.forEach((n,r)=>{e[n]=r}),_e.filter(e=>!e.__HIDDEN).sort((n,r)=>{if(me===`account`){let i=n.account.id,a=r.account.id,o=e[i]-e[a];if(o!==0)return o}if(K!==`createdAt`&&(n=n.reblog||n,r=r.reblog||r,K!==`density`&&n[K]===r[K]))return n.createdAt>r.createdAt?1:-1;if(K===`density`){let e=Mc(n),i=Mc(r);return fe===`asc`?e>i?1:-1:i>e?1:-1}return fe===`asc`?n[K]>r[K]?1:-1:r[K]>n[K]?1:-1})},[_e,K,fe,me,xe]),Ce=s(null),we=s(null),Te=s(!1);y(()=>{A.length>100||Te.current||we.current&&(cr(we.current,{duration:200}),Te.current=!0)},[A,we]);let Ee=A.length>160?`3d`:`2d`,De=g(()=>Ee===`2d`?A.map(e=>{let n=be[e.id];return L(`span`,{class:`post-dot ${n?`post-dot-highlight`:``}`},e.id)}):null,[be]),J=g(()=>Ee!==`3d`||!A?.length?null:Ic(A,`createdAt`,320).map((e,n)=>L(`div`,{class:`posts-bin`,children:e.map(e=>{let n=be[e.id];return L(`span`,{class:`post-dot ${n?`post-dot-highlight`:``}`},e.id)})},n)),[be]),Oe=s(null);N(()=>{if(!v||b!==`results`||!Oe.current||!Se.length)return;let e=F.session.getJSON(`${bc}-${v}`);if(e?.scrollTop!==void 0&&e.scrollTop>0){let n=setTimeout(()=>{Oe.current&&Oe.current.scrollTo({top:e.scrollTop,behavior:`instant`})},100);return()=>clearTimeout(n)}},[v,b,Se.length]),y(()=>{if(!v||b!==`results`||!Oe.current)return;let e=()=>{if(!Oe.current)return;let e=F.session.getJSON(`${bc}-${v}`)||{};e.scrollTop=Oe.current.scrollTop,F.session.setJSON(`${bc}-${v}`,e)},n=Oe.current;return n.addEventListener(`scroll`,e,{passive:!0}),()=>{n.removeEventListener(`scroll`,e)}},[v,b]);let ke=g(()=>V?(Date.now()-V)/1e3/60/60:null,[V,G]);y(()=>{if(b!==`results`)return;ce&&ve[ce]&&ve[ce].username;let e=Z({duration:5e3,text:a({id:`XKZRZ_`,values:{selectedFilterCategory:W,sortBy:K,sortOrder:fe,groupBy:me}})});return()=>{e?.hideToast?.()}},[b,W,ce,K,fe,me,ve]),y(()=>{if(ce&&ve[ce]){let e=we.current.querySelector(`[data-author="${ce}"]`),n=we.current?.getBoundingClientRect(),r=e?.getBoundingClientRect();r.left<n.left||r.right>n.right?e.scrollIntoView({block:`nearest`,inline:`center`,behavior:`smooth`}):r.top<0&&e.scrollIntoView({block:`nearest`,inline:`nearest`,behavior:`smooth`})}},[ce,ve]);let[Ae,je]=I(!1),Me=`.catchup-list > li > a`,Ne=nt(`j`,()=>{let e=document.activeElement.closest(Me),n=e?.getBoundingClientRect(),r=Array.from(Oe.current.querySelectorAll(Me));if(e&&n.top<Oe.current.clientHeight&&n.bottom>0){let n=r[r.indexOf(e)+1];n&&(n.focus(),n.scrollIntoView({block:`center`,inline:`center`,behavior:`instant`}))}else{let e=r.find(e=>e.getBoundingClientRect().top>=0);e&&(e.focus(),e.scrollIntoView({block:`nearest`,inline:`center`,behavior:`instant`}))}},{useKey:!0,preventDefault:!0,ignoreEventWhen:e=>e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.key.toLowerCase()!==`j`}),Pe=nt(`k`,()=>{let e=document.activeElement.closest(Me),n=e?.getBoundingClientRect(),r=Array.from(Oe.current.querySelectorAll(Me));if(e&&n.top<Oe.current.clientHeight&&n.bottom>0){let n=r[r.indexOf(e)-1];n&&(n.focus(),n.scrollIntoView({block:`center`,inline:`center`,behavior:`instant`}))}else{let e=r.find(e=>{let n=e.getBoundingClientRect();return n.top>=44&&n.left>=0});e&&(e.focus(),e.scrollIntoView({block:`nearest`,inline:`center`,behavior:`instant`}))}},{useKey:!0,preventDefault:!0,ignoreEventWhen:e=>e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.key.toLowerCase()!==`k`}),Fe=nt(`h, l`,(e,n)=>{let r=n.keys[0];if(ce){let e=xe.indexOf(ce);r===`h`?e>0&&e<xe.length&&(le(xe[e-1]),Oe.current?.focus()):r===`l`&&e<xe.length-1&&e>=0&&(le(xe[e+1]),Oe.current?.focus())}else r===`l`&&(le(xe[0]),Oe.current?.focus())},{useKey:!0,preventDefault:!0,ignoreEventWhen:e=>e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||![`h`,`l`].includes(e.key.toLowerCase()),enableOnFormTags:[`input`]}),Ie=nt(`esc`,()=>{le(null),Oe.current?.focus()},{preventDefault:!0,ignoreEventWhen:e=>e.metaKey||e.ctrlKey||e.altKey||e.shiftKey,enableOnFormTags:[`input`],useKey:!0}),Le=nt(`.`,()=>{Oe.current?.scrollTo({top:0,behavior:`smooth`})},{useKey:!0,preventDefault:!0,ignoreEventWhen:e=>e.key===`.`?!1:e.metaKey||e.ctrlKey||e.altKey||e.shiftKey,enableOnFormTags:[`input`]}),Re=x(e=>{let n=document.activeElement,r=n?.tagName===`INPUT`&&n.type===`radio`;if((e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`ArrowLeft`||e.key===`ArrowRight`)&&r){n.blur();return}},[]);return L(`div`,{ref:e=>{Oe.current=e,Ne.current=e,Pe.current=e,Fe.current=e,Ie.current=e,Le.current=e},id:`catchup-page`,class:`deck-container`,tabIndex:`-1`,children:[L(`div`,{class:`timeline-deck deck wide`,children:[L(`header`,{class:`${b===`loading`?`loading`:``}`,onClick:e=>{e.target.closest(`a, button`)||Oe.current?.scrollTo({top:0,behavior:`smooth`})},children:L(`div`,{class:`header-grid`,children:[L(`div`,{class:`header-side`,children:[L(Ns,{}),b===`results`&&L(Q,{to:`/catchup`,class:`button plain`,children:L(X,{icon:`history2`,size:`l`,alt:a({id:`xrl8fj`})})}),b===`start`&&L(Q,{to:`/`,class:`button plain`,children:L(X,{icon:`home`,size:`l`,alt:a({id:`i0qMbr`})})})]}),L(`h1`,{children:b!==`start`&&L(j,{id:`wyL_3_`,components:{0:L(`sup`,{})}})}),L(`div`,{class:`header-side`,children:b!==`start`&&b!==`loading`&&L(`button`,{type:`button`,class:`plain`,onClick:()=>{je(!0)},children:L(j,{id:`c3XJ18`})})})]})}),L(`main`,{onKeyDown:Re,children:[b===`start`&&L(`div`,{class:`catchup-start`,children:[L(`h1`,{children:L(j,{id:`wyL_3_`,components:{0:L(`sup`,{})}})}),L(`details`,{children:[L(`summary`,{children:L(j,{id:`CxKPv6`})}),L(`p`,{children:L(j,{id:`YMU1CK`})}),L(`img`,{src:``+new URL(`catch-up-O5q5C75Z.png`,import.meta.url).href,width:`1200`,height:`900`,alt:a({id:`CeInO2`})}),L(`p`,{children:L(`button`,{type:`button`,onClick:e=>{e.target.closest(`details`).open=!1},children:L(j,{id:`2jI8hh`})})})]}),L(`p`,{children:L(j,{id:`1RfGk7`})}),L(`p`,{children:L(`b`,{children:L(j,{id:`OOEonE`})})}),L(`div`,{class:`catchup-form`,children:[L(`input`,{ref:P,type:`range`,value:G,min:xc[0].value,max:xc[xc.length-1].value,step:`1`,list:`catchup-ranges`,onChange:e=>ue(+e.target.value)}),` `,L(`span`,{style:{width:`8em`},children:[n(xc[G-1].label),L(`br`,{}),L(`small`,{class:`insignificant`,children:G==xc[xc.length-1].value?a({id:`NMNiaO`}):Jt(new Date(Date.now()-G*60*60*1e3))})]}),L(`datalist`,{id:`catchup-ranges`,children:xc.map(({label:e,value:r})=>L(`option`,{value:r,label:n(e)}))}),` `,L(`button`,{type:`button`,onClick:()=>{let e;G<xc.find(e=>e.beyond).value?e=G*60*60*1e3:te.current?.checked&&(e=Date.now()-V),R({duration:e})},children:L(j,{id:`R0yu2l`})})]}),ke&&G>ke?L(`p`,{class:`catchup-info`,children:[L(X,{icon:`info`}),` `,L(j,{id:`AGyV7s`})]}):G===xc[xc.length-1].value&&V?L(`p`,{class:`catchup-info`,children:L(`label`,{children:[L(`input`,{type:`checkbox`,switch:!0,checked:!0,ref:te}),` `,L(j,{id:`dDJEHI`,values:{0:o.format(new Date(V))}})]})}):null,L(`p`,{class:`insignificant`,children:L(`small`,{children:L(j,{id:`1atgyZ`})})}),!!ie?.length&&L(`div`,{class:`catchup-prev`,children:[L(`p`,{children:L(j,{id:`Yfb9A8`})}),L(`ul`,{children:ie.map(e=>L(`li`,{children:[L(Q,{to:`/catchup?id=${e.id}`,children:[L(X,{icon:`history2`}),` `,L(`span`,{children:e.startAt?o.formatRange(new Date(e.startAt),new Date(e.endAt)):`… – ${o.format(new Date(e.endAt))}`})]}),` `,L(`span`,{children:[L(`small`,{class:`ib insignificant`,children:L(j,{id:`S6XZwv`,values:{0:e.count}})}),` `,L(`button`,{type:`button`,class:`light danger small`,onClick:async()=>{if(confirm(a({id:`D9CmP2`}))){let n=Z(a({id:`xJUo4P`,values:{0:e.id}}));await Ke.catchup.del(e.id),n?.hideToast?.(),Z(a({id:`1dyGG_`,values:{0:e.id}})),B()}},children:L(X,{icon:`x`,alt:a({id:`t_YqKh`})})})]})]},e.id))}),ie.length>=3&&L(`p`,{children:L(`small`,{children:L(j,{id:`sXmrl4`})})})]})]}),b===`loading`&&L(`div`,{class:`ui-state catchup-start`,children:[L(q,{abrupt:!0}),L(`p`,{class:`insignificant`,children:L(j,{id:`rbUTzD`})}),L(`p`,{class:`insignificant`,children:L(j,{id:`q9urQO`})})]}),b===`results`&&L(i,{children:[L(`div`,{class:`catchup-header`,children:[A.length>0&&L(`p`,{children:L(`b`,{class:`ib`,children:o.formatRange(new Date(A[0].createdAt),new Date(A[A.length-1].createdAt))})}),L(`aside`,{children:[L(`button`,{hidden:W===`all`&&!ce&&K===`createdAt`&&fe===`asc`,type:`button`,class:`plain4 small`,onClick:()=>{se(`all`),le(null),de(`createdAt`),ge(null),pe(`asc`)},children:L(j,{id:`I9EnzM`})}),U?.length>0&&L(`button`,{type:`button`,class:`plain small`,onClick:()=>w(!C),children:[L(j,{id:`EIZREX`}),` `,L(X,{icon:`chevron-down`,style:{transform:C?`rotate(180deg)`:`rotate(0deg)`}})]})]})]}),L(`div`,{class:`shazam-container no-animation`,hidden:!C,children:L(`div`,{class:`shazam-container-inner`,children:L(`div`,{class:`catchup-top-links links-bar`,children:U.map(e=>{let{card:n,shared:r,sharers:a,likes:o,boosts:s}=e,{blurhash:c,title:l,description:d,url:f,image:p,imageDescription:m,language:h,width:g,height:_,publishedAt:v}=n,y=u(f),b;if(c){let e=Ca(St(c));b=ya([.6,e[1],e[2]])}return L(`a`,{href:f,target:`_blank`,rel:`noopener`,class:`link-block`,style:b?{"--accent-color":`rgb(${b.join(`,`)})`,"--accent-alpha-color":`rgba(${b.join(`,`)}, 0.4)`}:{},children:L(`article`,{children:[L(`figure`,{children:L(`img`,{src:p,alt:m,width:g,height:_,loading:`lazy`})}),L(`div`,{class:`article-body`,children:[L(`header`,{children:[L(`div`,{class:`article-meta`,children:[L(`span`,{class:`domain`,children:y}),` `,!!v&&L(i,{children:`· `}),!!v&&L(i,{children:L(Wt,{datetime:v,format:`micro`})})]}),!!l&&L(`h1`,{class:`title`,lang:h,dir:`auto`,title:l,children:l})]}),!!d&&L(`p`,{class:`description`,lang:h,dir:`auto`,title:d,children:d}),L(`hr`,{}),L(`p`,{style:{whiteSpace:`nowrap`},children:L(j,{id:`bfSr6z`,values:{0:a.map(e=>{let{avatarStatic:n,displayName:r}=e;return L(`button`,{type:`button`,class:`plain`,style:{padding:0},onClick:n=>{n.preventDefault(),n.stopPropagation();let{id:r}=e;le(r),se(`all`)},children:L(Ht,{url:n,size:`s`,alt:r})})})}})})]})]})},f)})})})}),A.length>=5&&(Ee===`3d`?L(`div`,{class:`catchup-posts-viz-time-bar`,children:J}):L(`div`,{class:`catchup-posts-viz-bar`,children:De})),A.length>=2&&L(`div`,{class:`catchup-filters`,children:[L(`label`,{class:`filter-cat`,children:[L(`input`,{type:`radio`,name:`filter-cat`,checked:W.toLowerCase()===`all`,onChange:()=>{se(`all`)}}),L(j,{id:`N40H-G`}),` `,L(`span`,{class:`count`,children:A.length})]}),Object.entries(Sc).map(([e,r])=>!!H[e]&&L(`label`,{class:`filter-cat`,title:(H[e]/A.length*100).toFixed(2)+`%`,children:[L(`input`,{type:`radio`,name:`filter-cat`,checked:W.toLowerCase()===e.toLowerCase(),onChange:()=>{se(e),e===`boosts`&&(de(`reblogsCount`),pe(`desc`),ge(null))}}),n(r),` `,L(`span`,{class:`count`,children:H[e]})]},n(r)))]}),A.length>=2&&!!ye&&L(`div`,{class:`catchup-filters authors-filters`,ref:we,children:[xe.map(e=>L(`label`,{class:`filter-author`,"data-author":e,children:[L(`input`,{type:`radio`,name:`filter-author`,checked:ce===e,onChange:()=>{le(e)},onClick:()=>{ce===e&&le(null)}}),L(Ht,{url:ve[e].avatarStatic||ve[e].avatar,size:`xxl`,alt:`${ve[e].displayName} (@${ve[e].acct})`}),` `,L(`span`,{class:`count`,children:ye[e]}),L(`span`,{class:`username`,children:ve[e].username})]},`${e}-${ye[e]}`)),xe.length>5&&L(`small`,{style:{whiteSpace:`nowrap`,paddingInline:`1em`,opacity:.33},children:L(j,{id:`HHtYi7`,values:{0:xe.length}})},`authors-count`)]}),A.length>=2&&L(`div`,{class:`catchup-filters`,children:[L(`span`,{class:`filter-label`,children:L(j,{id:`f6Hub0`})}),` `,L(`fieldset`,{class:`radio-field-group`,children:Cc.map(e=>L(`label`,{class:`filter-sort`,onClick:n=>{K===e&&(n.preventDefault(),n.stopPropagation(),pe(fe===`asc`?`desc`:`asc`))},children:[L(`input`,{type:`radio`,name:`filter-sort-cat`,checked:K===e,onChange:()=>{de(e),pe(/(replies|favourites|reblogs|quotes)/.test(e)?`desc`:`asc`)}}),{createdAt:a({id:`mYGY3B`}),repliesCount:a({id:`N8UzTV`}),favouritesCount:a({id:`zZOZj7`}),reblogsCount:a({id:`puY2t0`}),quotesCount:a({id:`eWLklq`}),density:a({id:`0tQ7AD`})}[e],K===e&&(fe===`asc`?` ↑`:` ↓`)]},e))}),L(`span`,{class:`filter-label`,children:L(j,{id:`group.filter`})}),` `,L(`fieldset`,{class:`radio-field-group`,children:wc.map(e=>L(`label`,{class:`filter-group`,children:[L(`input`,{type:`radio`,name:`filter-group`,checked:me===e,onChange:()=>{ge(e)},disabled:e===`account`&&ce}),{account:a({id:`dpqPBg`})}[e]||a({id:`EdQY6l`})]},e||`none`))}),ce&&xe.length>1?L(`button`,{type:`button`,class:`plain6 small`,onClick:()=>{le(null)},style:{whiteSpace:`nowrap`},children:L(j,{id:`_dlmrZ`})}):null]}),L(`ul`,{class:`catchup-list catchup-filter-${W||``} ${K?`catchup-sort-${K}`:``} ${ce&&ve[ce]?`catchup-selected-author`:``} ${me?`catchup-group-${me}`:``}`,children:Se.map((e,n)=>{let r=e.reblog?.id||e.id,a=!1;return me===`account`&&(Ce.current&&e.account.id!==Ce.current&&n>0&&(a=!0),Ce.current=e.account.id),L(i,{children:[a&&L(`li`,{class:`separator`}),L(kc,{to:`/${p}/s/${r}`,post:e,root:Oe.current})]},`${e.id}-${a}`)})}),L(`footer`,{children:_e.length>5&&L(`p`,{children:[a(W===`boosts`?{id:`eVosYr`}:{id:`rhmyFK`}),` `,L(`button`,{type:`button`,class:`textual`,onClick:()=>{Oe.current.scrollTop=0},children:L(j,{id:`0MgdN-`})}),`.`]})})]})]})]}),Ae&&L(Ot,{onClose:()=>je(!1),children:L(`div`,{class:`sheet`,id:`catchup-help-sheet`,children:[L(`button`,{type:`button`,class:`sheet-close`,onClick:()=>je(!1),children:L(X,{icon:`x`,alt:a({id:`yz7wBu`})})}),L(`header`,{children:L(`h2`,{children:L(j,{id:`c3XJ18`})})}),L(`main`,{children:L(`dl`,{children:[L(`dt`,{children:L(j,{id:`EIZREX`})}),L(`dd`,{children:L(j,{id:`YmGrIy`})}),L(`dt`,{children:L(j,{id:`coaNtr`})}),L(`dd`,{children:L(j,{id:`UUrqX1`})}),L(`dt`,{children:L(j,{id:`ScQBC_`})}),L(`dd`,{children:L(j,{id:`srocAr`})}),L(`dt`,{children:L(j,{id:`77Emn0`})}),L(`dd`,{children:L(`table`,{children:L(`tbody`,{children:[L(`tr`,{children:[L(`td`,{children:L(j,{id:`Gy9P9T`})}),L(`td`,{children:L(`kbd`,{children:`j`})})]}),L(`tr`,{children:[L(`td`,{children:L(j,{id:`6XYpYY`})}),L(`td`,{children:L(`kbd`,{children:`k`})})]}),L(`tr`,{children:[L(`td`,{children:L(j,{id:`f5dduh`})}),L(`td`,{children:L(`kbd`,{children:`l`})})]}),L(`tr`,{children:[L(`td`,{children:L(j,{id:`rj0vxZ`})}),L(`td`,{children:L(`kbd`,{children:`h`})})]}),L(`tr`,{children:[L(`td`,{children:L(j,{id:`jsFF8C`})}),L(`td`,{children:L(`kbd`,{children:`Enter`})})]}),L(`tr`,{children:[L(`td`,{children:L(j,{id:`bUUv3P`})}),L(`td`,{children:L(`kbd`,{children:`.`})})]})]})})})]})})]})})]})}var Oc=K(function({post:e}){let{id:n,account:r,group:i,reblog:a,quote:o,inReplyToId:s,inReplyToAccountId:c,_followedTags:l,_filtered:u,visibility:d,__BOOSTERS:f}=e,p=s&&c!==r.id,m=!!u&&u?.action!==`blur`;return L(`article`,{class:`post-line ${i?`group`:a?`reblog`:Xe()&&Ec(o)?`quote`:l?.length?`followed-tags`:``} ${p?`reply-to`:``} ${m?`filtered`:``} visibility-${d}`,onMouseEnter:e=>{e.shiftKey},children:[L(`span`,{class:`post-author`,children:a?L(`span`,{class:`post-reblog-avatar`,children:[L(Ht,{url:r.avatarStatic||r.avatar,squircle:r.bot}),f?.size>0?[...f].map(e=>L(Ht,{url:e.avatarStatic||e.avatar,squircle:e.bot})):``,` `,L(X,{icon:`rocket`}),` `,L(ht,{account:a.account,showAvatar:!0})]}):Ec(o)?L(`span`,{class:`post-quote-avatar`,children:[L(Ht,{url:r.avatarStatic||r.avatar,squircle:r.bot}),` `,L(X,{icon:`quote`}),` `,L(ht,{account:o.quotedStatus?.account||o.account,showAvatar:!0})]}):L(ht,{account:r,showAvatar:!0})}),L(Pc,{post:a||e,filterInfo:u}),L(`span`,{class:`post-meta`,children:[L(Fc,{post:a||e}),` `,L(Wt,{datetime:new Date(a?.createdAt||e.createdAt),format:`micro`})]})]})},(e,n)=>e?.post?.id===n?.post?.id),kc=({root:e,to:n,...r})=>{let i=s(),[a,o]=I(!1);return y(()=>{let n=new IntersectionObserver(e=>{e[0].isIntersecting&&(queueMicrotask(()=>o(!0)),n.unobserve(i.current))},{root:e,rootMargin:`${Math.max(320,screen.height*.75)}px`});return i.current&&n.observe(i.current),()=>{i.current&&n.unobserve(i.current)}},[]),a?L(`li`,{children:L(Q,{to:n,children:L(Oc,{...r})})}):L(`li`,{ref:i,style:{height:`4em`}})},Ac=8,jc=8;function Mc(e){let{spoilerText:n,content:r,poll:i,mediaAttachments:a,card:o}=e,s=i?.options?.length?i.options.reduce((e,n)=>e+n.title,``):``;return(n.length+vt(r)+s.length)/140+(a?.length?Ac*a.length:o?.image?jc:0)}var Nc=48;function Pc({post:e,filterInfo:n}){let{_:r}=d(),{spoilerText:a,sensitive:o,content:s,emojis:c,poll:l,mediaAttachments:u,card:f,inReplyToId:p,inReplyToAccountId:m,account:h,_thread:g,quote:v}=e,y=p&&m===h.id||!!g,b=Xe()&&Ec(v)?v.quotedStatus||v:null;(b?.spoilerText||b?.sensitive)&&(b=null),b?.emojis&&c.push(...b.emojis),!u?.length&&b?.mediaAttachments?.length&&(u=b.mediaAttachments);let x=!!_()[`reading:expand:spoilers`],S=x||!a&&!o&&n?.action!==`blur`,C=s?Ct(e):``,w=!a||x;return L(`div`,{class:`post-peek`,title:a?``:C,children:[L(`span`,{class:`post-peek-content`,children:[y&&!w&&L(i,{children:[L(`span`,{class:`post-peek-tag post-peek-thread`,children:`Thread`}),` `]}),n&&n?.action!==`blur`?L(`span`,{class:`post-peek-filtered`,children:n?.titlesStr?r({id:`suKjh3`,values:{0:n.titlesStr}}):r({id:`03Qqf9`})}):L(i,{children:[!!a&&L(`span`,{class:`post-peek-spoiler`,children:[L(X,{icon:`${x?`eye-open`:`eye-close`}`}),` `,a]}),w&&L(`div`,{class:`post-peek-html`,children:[y&&L(i,{children:[L(`span`,{class:`post-peek-tag post-peek-thread`,children:L(j,{id:`e66y2Z`})}),` `]}),!!s&&L(`div`,{dangerouslySetInnerHTML:{__html:Ve(s,c)+(b?.content?`<blockquote class="post-peek-quote">${b.content}</blockquote>`:``)}}),!!l?.options?.length&&l.options.map(e=>L(`div`,{children:[l.multiple?`▪️`:`•`,` `,e.title]})),!s&&u?.length===1&&u[0].description&&L(i,{children:[L(`span`,{class:`post-peek-tag post-peek-alt`,children:`ALT`}),` `,L(`div`,{children:u[0].description})]})]})]})]}),(!n||n?.action===`blur`)&&L(`span`,{class:`post-peek-post-content`,children:[!!l&&L(`span`,{class:`post-peek-tag post-peek-poll`,children:[L(X,{icon:`poll`,size:`s`}),L(j,{id:`4WUbF1`})]}),u?.length?u.map(e=>{let n=e.previewUrl||e.url,r=e.previewRemoteUrl||e.remoteUrl,i=e.meta?.original?e.meta.original.width:e.meta?.small?.width||e.meta?.original?.width,a=e.meta?.original?e.meta.original.height:e.meta?.small?.height||e.meta?.original?.height;return L(`span`,{class:`post-peek-media`,children:{image:(n||r)&&S?L(`img`,{src:n,width:Nc,height:Nc,alt:e.description,loading:`lazy`,onError:e=>{let{src:i}=e.target;i===n&&r&&n!==r&&(e.target.src=r)},style:{"--anim-duration":`${Math.min(Math.max(Math.max(i,a)/100,5),120)}s`}}):L(`span`,{class:`post-peek-faux-media`,children:`🖼`}),gifv:(n||r)&&S?L(`img`,{src:n,width:Nc,height:Nc,alt:e.description,loading:`lazy`,onError:e=>{let{src:i}=e.target;i===n&&r&&n!==r&&(e.target.src=r)}}):L(`span`,{class:`post-peek-faux-media`,children:`🎞️`}),video:(n||r)&&S?L(`img`,{src:n,width:Nc,height:Nc,alt:e.description,loading:`lazy`,onError:e=>{let{src:i}=e.target;i===n&&r&&n!==r&&(e.target.src=r)}}):L(`span`,{class:`post-peek-faux-media`,children:`📹`}),audio:L(`span`,{class:`post-peek-faux-media`,children:`🎵`})}[e.type]||null},e.id)}):!!f&&f.image&&S&&L(`span`,{class:`post-peek-media post-peek-card card-${f.type||``}`,children:f.image?L(`img`,{src:f.image,width:Nc,height:Nc,alt:f.title||f.description||f.imageDescription,loading:`lazy`,style:{"--anim-duration":f.width&&f.height&&`${Math.min(Math.max(Math.max(f.width,f.height)/100,5),120)}s`}}):L(`span`,{class:`post-peek-faux-media`,children:`🔗`})})]})]})}function Fc({post:e}){let{_:n}=d(),{reblogsCount:r,repliesCount:i,favouritesCount:a,quotesCount:o}=e;return L(`span`,{class:`post-stats`,children:[i>0&&L(`span`,{class:`post-stat-replies`,children:[L(X,{icon:`comment2`,size:`s`,alt:n({id:`N8UzTV`})}),` `,Je(i)]}),a>0&&L(`span`,{class:`post-stat-likes`,children:[L(X,{icon:`heart`,size:`s`,alt:n({id:`zZOZj7`})}),` `,Je(a)]}),r>0||o>0?L(`span`,{class:`post-stat-boosts`,children:[L(X,{icon:`rocket`,size:`s`,alt:n({id:`puY2t0`})}),` `,r>0||o>0?`${r>0?Je(r):``}${r>0&&o>0?`+`:``}${o>0?Je(o):``}`:Je(r)]}):null]})}function Ic(e,n,r){let i=e.map(e=>new Date(e[n])),a=i.reduce((e,n)=>n<e?n:e,i[0]),o=i.reduce((e,n)=>n>e?n:e,i[0]),s=Math.min(o.getTime(),Date.now())-a.getTime(),c=Array.from({length:r},()=>[]);return e.forEach(e=>{let i=Date.parse(e[n]);if(i>Date.now())c[c.length-1].push(e);else{let n=(i-a.getTime())/s;c[Math.floor(n*(r-1))].push(e)}}),c}function Lc({account:e,relationship:n,instance:r,isSelf:a,isCurator:o,onRelationshipChange:s,onSelfRemove:c}){let{masto:l}=f({instance:r}),[u,d]=I(`default`);return a?o?null:L(`div`,{class:`collection-account-actions`,children:u===`loading`?L(q,{abrupt:!0}):L(xt,{portal:!0,confirmLabel:L(i,{children:[L(X,{icon:`user-x`}),L(`span`,{children:L(j,{id:`4v_hQI`})})]}),className:`danger`,menuItemClassName:`danger`,menuFooter:L(`div`,{class:`footer`,children:[L(X,{icon:`info`}),L(j,{id:`sfZnzc`})]}),onClick:async()=>{d(`loading`);try{c&&await c(),d(`default`)}catch{d(`default`)}},children:L(`button`,{type:`button`,class:`light danger small`,disabled:u===`loading`,children:L(j,{id:`j8_z3-`})})})}):!n||n.following||n.requested?null:L(`div`,{class:`collection-account-actions`,children:u===`loading`?L(q,{abrupt:!0}):L(`button`,{type:`button`,class:`small`,disabled:u===`loading`,onClick:async()=>{d(`loading`);try{let n=await l.v1.accounts.$select(e.id).follow();d(`default`),s&&s(n)}catch{d(`default`)}},children:[L(X,{icon:`follow`}),` `,L(`span`,{children:L(j,{id:`MKEPCY`})})]})})}function Rc(e,n){let r=e.featureApproval;return[`automatic`,`manual`].includes(r?.currentUser)?`available`:(r?.automatic?.includes(`followers`)||r?.manual?.includes(`followers`))&&!n?.following?`mustFollow`:`disabled`}function zc({collectionId:e,instance:n,existingAccountIds:r=new Set,onAdded:i=()=>{},onClose:a=()=>{}}){let{_:o}=d(),{masto:c}=f({instance:n}),[l,u]=I(`default`),[p,m]=I([]),[h,_]=I({}),[v,b]=I(new Set),x=async e=>{if(!e?.length)return;let n=await tt(e,h);n&&_(e=>({...e,...n}))},S=mt(e=>{e&&(u(`loading`),(async()=>{try{let n=await c.v1.accounts.search.list({q:e,limit:30,resolve:!0});m(n),x(n),u(`default`)}catch{u(`error`)}})())},1e3),C=s();y(()=>{C.current&&C.current.focus()},[]);let w=n=>{v.has(n.id)||(b(e=>new Set([...e,n.id])),(async()=>{try{i(n,(await c.v1.collections.$select(e).items.create({accountId:n.id})).collectionItem),Z(o({id:`fx5B7p`,values:{username:n.username}}))}catch{Z(o({id:`CkOaai`}))}finally{b(e=>{let r=new Set(e);return r.delete(n.id),r})}})())},{sortedAccounts:T,footnoteGroups:E}=g(()=>{let e=[],n=[],r=[];for(let i of p){let a=h[i.id],o=Rc(i,a);o===`available`?e.push(i):(n.push(i),r.includes(o)||r.push(o))}return{sortedAccounts:[...e,...n],footnoteGroups:r}},[p,h]);return L(`div`,{id:`collection-add-account-sheet`,class:`sheet`,children:[!!a&&L(`button`,{type:`button`,class:`sheet-close`,onClick:a,children:L(X,{icon:`x`,alt:o({id:`yz7wBu`})})}),L(`header`,{children:L(`form`,{onSubmit:e=>{e.preventDefault(),S.flush?.()},children:L(`input`,{ref:C,required:!0,type:`search`,class:`block`,placeholder:o({id:`eH1bqp`}),onInput:e=>{let{value:n}=e.target;S(n)},autocomplete:`off`,autocorrect:`off`,autocapitalize:`off`,spellCheck:`false`,dir:`auto`,enterKeyHint:`search`})})}),L(`main`,{children:p?.length>0?L(`ul`,{class:`accounts-list ${l===`loading`?`loading`:``}`,children:T.map(e=>{let n=h[e.id],i=r.has(e.id),a=v.has(e.id),s=Rc(e,n),c=!i&&s===`available`;return L(`li`,{class:s===`available`?``:`disabled`,children:[L(rt,{avatarSize:`xxl`,account:e,relationship:n,showStats:!0,showActivity:!0}),i?L(`button`,{type:`button`,class:`plain`,disabled:!0,children:L(X,{icon:`check-circle`,size:`xl`,alt:``})}):c?L(`button`,{type:`button`,class:`plain2`,disabled:a,onClick:()=>w(e),children:a?L(q,{abrupt:!0}):L(X,{icon:`plus`,size:`xl`,alt:o({id:`m16xKo`})})}):L(`span`,{class:`dummy-button-wrap`,children:L(`span`,{class:`dummy-button`,children:L(`span`,{class:`dummy-button-circle`,children:E.indexOf(s)+1})})})]},e.id)})}):l===`loading`?L(`div`,{class:`ui-state`,children:L(q,{abrupt:!0})}):l===`error`?L(`div`,{class:`ui-state`,children:L(`p`,{children:L(j,{id:`AThL_k`})})}):null}),E.length>0&&L(`footer`,{class:`footnotes`,children:L(`ol`,{children:E.map(e=>L(`li`,{children:e===`disabled`?L(j,{id:`2tUUhP`}):L(j,{id:`fomSje`})},e))})})]})}var Bc=E(function({collection:e,accounts:n=[],instance:r,onClose:i=()=>{},onDataChange:a=()=>{}},o){let{_:s}=d(),{masto:c}=f({instance:r}),[l,u]=I(e?.items||[]),[p,m]=I(!1);te(o,()=>({openAddAccount:()=>m(!0)}));let[h,_]=I(new Set),[v,b]=I({}),x=g(()=>{let e={};for(let r of n)e[r.id]=r;return e},[n]);y(()=>{if(!n?.length)return;let e=!1;return tt(n,v).then(n=>{e||n&&b(e=>({...e,...n}))}),()=>{e=!0}},[n]);let S=(r,i)=>{h.has(r.id)||(_(e=>new Set([...e,r.id])),(async()=>{try{await c.v1.collections.$select(e.id).items.$select(r.id).remove();let o=l.filter(e=>e.id!==r.id);u(o),a({collectionItems:o,accounts:n}),Z(s({id:`hC_ij1`,values:{username:i.username}}))}catch{Z(s({id:`-H9yli`}))}_(e=>{let n=new Set(e);return n.delete(r.id),n})})())},C=g(()=>new Set(l.map(e=>e.accountId)),[l]);return L(`div`,{id:`collection-manage-accounts-container`,class:`sheet`,children:[L(`button`,{type:`button`,class:`sheet-close`,onClick:i,children:L(X,{icon:`x`,alt:s({id:`yz7wBu`})})}),L(`header`,{children:L(`h2`,{children:L(j,{id:`BvmBs6`})})}),L(`main`,{children:[L(`ul`,{class:`accounts-list`,children:l.map(e=>{let n=x[e.accountId];if(!n)return null;let i=h.has(e.id);return L(`li`,{children:[L(`div`,{class:`account-block-wrap`,children:[L(rt,{account:n,instance:r,relationship:v[n.id]}),e.state===`pending`&&L(`span`,{class:`tag insignificant`,children:L(j,{id:`UbRKMZ`})})]}),L(xt,{confirmLabel:L(`span`,{children:L(j,{id:`Hy80qV`,values:{username:`@${n.username}`},components:{0:L(`span`,{class:`bidi-isolate`})}})}),menuItemClassName:`danger`,align:`end`,onClick:()=>S(e,n),children:L(`button`,{type:`button`,class:`light ${i?``:`danger`}`,disabled:i,children:i?L(q,{abrupt:!0}):s({id:`MWIaew`})})})]},e.id)})}),L(`button`,{type:`button`,class:`light`,onClick:()=>m(!0),children:[L(X,{icon:`plus`}),` `,L(`span`,{children:L(j,{id:`MPPZ54`})})]})]}),p&&L(Ot,{onClick:e=>{e.target===e.currentTarget&&m(!1)},children:L(zc,{collectionId:e.id,instance:r,existingAccountIds:C,onAdded:(e,r)=>{let i=[...l,r],o=[...n,e];u(i),a({collectionItems:i,accounts:o})},onClose:()=>m(!1)})})]})});function Vc({collection:e,domain:n,onClose:r}){let{_:i}=d(),{masto:a}=f(),o=!!n,[s,c]=I(`default`);return L(`div`,{class:`report-collection-container`,children:[L(`div`,{class:`top-controls`,children:[L(`h1`,{children:L(j,{id:`Hhfqft`})}),L(`button`,{type:`button`,class:`plain4 small`,disabled:s===`loading`,onClick:()=>r(),children:L(X,{icon:`x`,size:`xl`,alt:i({id:`yz7wBu`})})})]}),L(`main`,{children:[L(`div`,{class:`report-preview`,children:L(Rt,{collection:e})}),L(`form`,{onSubmit:o=>{o.preventDefault();let s=new FormData(o.target),l=s.get(`comment`)||void 0,u=s.get(`forwardToDomain`)===`on`;c(`loading`),(async()=>{try{await a.v1.reports.create({accountId:e.accountId,collectionIds:[e.id],category:`spam`,comment:l,forwardToDomains:u?[n]:[],forward:u}),Z(i({id:`hoxERX`})),r()}catch(e){c(`error`),Z(e?.message||i({id:`2pjfev`}))}})()},children:[L(`section`,{class:`report-comment`,children:[L(`p`,{children:L(`label`,{for:`report-collection-comment`,children:L(j,{id:`qDLFnT`})})}),L(`textarea`,{maxlength:`1000`,rows:`2`,id:`report-collection-comment`,name:`comment`,disabled:s===`loading`})]}),o&&L(`section`,{class:`report-forward-section`,children:L(`label`,{children:[L(`input`,{type:`checkbox`,switch:!0,name:`forwardToDomain`,disabled:s===`loading`}),` `,L(`span`,{children:L(j,{id:`cyjS8M`,values:{domain:n},components:{0:L(`i`,{})}})})]})}),L(`footer`,{children:[L(`button`,{type:`submit`,disabled:s===`loading`,children:L(j,{id:`4cijjm`})}),L(q,{hidden:s!==`loading`})]})]})]})]})}function Hc(e){if(!e)return;let n=URL.parse(e);if(!n)return;let{host:r,pathname:a}=n,o=a.replace(/\/$/,``);try{return L(i,{children:[T.toUnicode(r),L(`span`,{class:`more-insignificant`,children:o})]})}catch{return e}}var Uc=[{key:`date_added`,label:{id:`Rj3wWq`}},{key:`name`,label:{id:`sort.name`}},{key:`last_active`,label:{id:`mJn6Bl`}},{key:`most_followers`,label:{id:`Hu-C6L`}}];function Wc(){let{_:e,_:n}=d(),{id:r,instance:a}=A(),[o,c]=I(`date_added`),[l,u]=I(!1),[p,m]=I(!1),h=s(null),[_,v]=I(!1),{masto:b,instance:x}=f({instance:a}),{masto:S,instance:C,authenticated:w}=f(),T=x===C,[E,D]=I(),O=E?.collection||{},k=E?.accounts||[],[M,N]=I(!1),[P,te]=I(`loading`),[F,ne]=I(!1),[R,z]=I({});y(()=>{let e=!1;return te(`loading`),(async()=>{try{let n=await b.v1.collections.$select(r).fetch();if(e)return;if(!n){te(`error`);return}D(n),te(`default`)}catch{if(e)return;te(`error`)}})(),()=>{e=!0}},[r,a]),y(()=>{if(!k?.length)return;let{instance:e,authenticated:n}=f();if(!n||x!==e)return;let r=!1;return(async()=>{let e=await tt(k,R);r||e&&z(n=>({...n,...e}))})(),()=>{r=!0}},[k]);let B=g(()=>k.reduce((e,n)=>(n?.id&&(e[n.id]=n),e),{}),[k]),V=B[O.accountId]||null,re=g(()=>{let e=URL.parse(O?.url);if(!e)return{};let n=e.pathname.match(/\/collections\/([^/]+)/i);return n?{hostname:e.hostname,id:n[1]}:{}},[O?.url]),ie=g(()=>{if(!V?.acct)return``;if(V.acct.includes(`@`))return V.acct;let e=URL.parse(V?.url)?.hostname||re?.hostname||x;return e?`${V.acct}@${e}`:V.acct},[V?.acct,V?.url,re?.hostname,x]);he(ie?`${O?.name||n({id:`q-hNag`})} — @${ie}`:O?.name||n({id:`q-hNag`}),`/:instance?/c/:id`);let ae=ee(),H=V?.id===ae,U=g(()=>!O?.items||!ae?null:O.items.find(e=>e.accountId===ae)||null,[O,ae]),W=async()=>{if(U){ne(!0);try{await b.v1.collections.$select(O.id).items.$select(U.id).revoke(),D(e=>{let n=e?.collection||e;return n?{...e,collection:{...n,items:n.items.filter(e=>e.id!==U.id)}}:e}),Z(n({id:`WJQKJn`}))}catch{Z(n({id:`W-NOEj`}))}ne(!1)}},oe=g(()=>{let e=O?.items||[];if(o===`date_added`)return e;let n=[...e];switch(o){case`name`:n.sort((e,n)=>{let r=B[e.accountId]||{},i=B[n.accountId]||{},a=r.displayName||r.username||r.acct||``,o=i.displayName||i.username||i.acct||``;return a.localeCompare(o)});break;case`last_active`:n.sort((e,n)=>{let r=B[e.accountId]||{},i=B[n.accountId]||{},a=r.lastStatusAt?new Date(r.lastStatusAt).getTime():0;return(i.lastStatusAt?new Date(i.lastStatusAt).getTime():0)-a});break;case`most_followers`:n.sort((e,n)=>{let r=B[e.accountId]||{};return((B[n.accountId]||{}).followersCount||0)-(r.followersCount||0)});break}return n},[O?.items,B,o]),se=O?.language;return L(i,{children:[L(`div`,{id:`collection-page`,class:`deck-container`,tabIndex:`-1`,children:[L(`div`,{class:`timeline-deck deck`,children:[L(`header`,{children:L(`div`,{class:`header-grid`,children:[L(`div`,{class:`header-side`,children:[L(Ns,{}),H&&L(Q,{to:x?`/${x}/a/${V.id}/c`:`/a/${V.id}/c`,class:`button plain`,"aria-label":n({id:`DoJzLz`}),children:L(X,{icon:`collections`,size:`l`})})]}),L(`h1`,{class:`header-account`,dir:`auto`,lang:se,children:P===`loading`?`…`:O?.name||n({id:`q-hNag`})}),L(`div`,{class:`header-side`,children:L(Gt,{portal:!0,setDownOverflow:!0,overflow:`auto`,position:`anchor`,menuButton:L(`button`,{type:`button`,class:`plain`,children:L(X,{icon:`more`,size:`l`,alt:n({id:`2FYpfJ`})})}),children:[P!==`loading`&&L(Y,{href:O?.url,target:`_blank`,children:[L(X,{icon:`external`}),L(`small`,{class:`menu-double-lines should-cloak`,style:{maxWidth:`16em`},children:Hc(O?.url)})]}),w&&L(Y,{disabled:P===`loading`,onClick:()=>Nt({draftStatus:{status:`\n\n${O?.url||window.location.href}`}}),children:[L(X,{icon:`quill`}),L(`span`,{children:L(j,{id:`0IrTm_`})})]}),L(`div`,{class:`menu-horizontal`,children:[L(Y,{disabled:P===`loading`,onClick:()=>{try{let e=O?.url||window.location.href;navigator.clipboard.writeText(e),Z(n({id:`edWbV6`}))}catch{Z(n({id:`W1ewR0`}))}},children:[L(X,{icon:`link`}),L(`span`,{children:L(j,{id:`he3ygx`})})]}),navigator?.share&&L(Y,{disabled:P===`loading`,onClick:()=>{try{let e=O?.url||window.location.href;navigator.share({url:e})}catch{}},children:[L(X,{icon:`share`}),L(`span`,{children:L(j,{id:`LFKLqp`})})]})]}),L(qe,{}),L(ft,{className:`plain`,children:L(j,{id:`f6Hub0`})}),L(Ue,{value:o,onRadioChange:({value:e})=>c(e),children:Uc.map(n=>L(Y,{type:`radio`,value:n.key,disabled:P===`loading`||(O?.items?.length||0)<=2||O?.sensitive&&!H&&!M,children:[L(X,{icon:o===n.key?`check-circle`:`round-line`,alt:``}),` `,L(`span`,{children:e(n.label)})]},n.key))}),H&&L(i,{children:[L(qe,{}),L(Y,{disabled:P===`loading`,onClick:()=>u(!0),children:[L(X,{icon:`pencil`}),L(`span`,{children:L(j,{id:`ePK91l`})})]}),L(Y,{disabled:P===`loading`,onClick:()=>m(!0),children:[L(X,{icon:`group`}),L(`span`,{children:L(j,{id:`BvmBs6`})})]})]}),!H&&(U||w&&T)&&L(qe,{}),U&&!H&&L(xt,{subMenu:!0,disabled:P===`loading`||F,confirmLabel:L(i,{children:[L(X,{icon:`user-x`}),L(`span`,{children:L(j,{id:`4v_hQI`})})]}),itemProps:{className:`danger`},menuItemClassName:`danger`,menuFooter:L(`div`,{class:`footer`,children:[L(X,{icon:`info`}),L(j,{id:`sfZnzc`})]}),onClick:W,children:[L(X,{icon:`user-x`}),L(`span`,{children:L(j,{id:`j8_z3-`})})]}),!H&&w&&T&&L(Y,{className:`danger`,disabled:P===`loading`,onClick:()=>v(!0),children:[L(X,{icon:`flag`}),L(`span`,{children:L(j,{id:`NwBwmN`})})]}),w&&(!T||re?.hostname!==x)&&L(i,{children:[L(qe,{}),L(ft,{className:`plain`,children:L(j,{id:`Rsjgm0`})}),T?L(Mt,{to:`/${re.hostname}/c/${re.id}`,children:[L(X,{icon:`transfer`}),L(`small`,{class:`menu-double-lines`,children:L(j,{id:`DA_qA3`,values:{serverDomain:re.hostname}})})]}):L(Y,{disabled:P===`loading`||!yi(),onClick:()=>{te(`loading`),(async()=>{try{let e=await S.v2.search.list({q:O.url,resolve:!0,limit:1});if(e?.collections?.length){let n=e.collections[0];location.hash=C?`/${C}/c/${n.id}`:`/c/${n.id}`}else throw Error(`No results`)}catch(e){te(`default`),Z(n({id:`DnepCE`,values:{e}}))}})()},children:[L(X,{icon:`transfer`}),L(`small`,{class:`menu-double-lines`,children:L(j,{id:`SiegcM`,values:{currentInstance:C},components:{0:L(`b`,{})}})})]})]})]})})]})}),L(`main`,{children:P===`loading`?L(`p`,{class:`ui-state`,children:L(q,{})}):P===`error`?L(`p`,{class:`ui-state`,children:L(j,{id:`VC2M2a`})}):L(i,{children:[L(`section`,{class:`collection-meta`,children:[L(`h2`,{lang:se,children:O.name}),O.description&&L(`p`,{lang:se,children:L(st,{text:O.description,emojis:O.emojis,resolverURL:O.url})}),!!V&&L(`p`,{class:`sub-meta insignificant`,children:L(`small`,{children:L(j,{id:`H0Vm3h`,components:{link:L(Q,{to:x?`/${x}/a/${V.id}/c`:`/a/${V.id}/c`}),icon:L(X,{icon:`collections`}),name:L(ht,{account:{...V,acct:ie},instance:x,showAvatar:!0})}})})})]}),O.sensitive&&!H&&!M?L(`div`,{class:`collection-sensitive-container`,children:L(`button`,{type:`button`,class:`light`,onClick:()=>N(!0),children:[L(X,{icon:`eye-close`}),` `,L(`span`,{children:L(j,{id:`lqBX03`})})]})}):L(i,{children:[oe.length>0?L(`ul`,{class:`accounts-list`,children:oe.map(e=>{let n=B[e.accountId];return n?L(`li`,{tabIndex:`-1`,children:[L(rt,{account:n,instance:x,showActivity:!0,showStats:!0,avatarSize:`xxl`,relationship:R[n.id]}),!!ae&&T&&L(Lc,{account:n,relationship:R[n.id],instance:x,isSelf:n.id===ae,isCurator:H,onRelationshipChange:e=>{z(r=>({...r,[n.id]:e}))},onSelfRemove:W})]},e.id):null})}):L(`div`,{class:`ui-state`,children:[L(`p`,{class:`insignificant`,children:L(j,{id:`bHinbm`})}),H&&L(`p`,{children:L(`button`,{type:`button`,class:`light`,onClick:()=>{m(!0),setTimeout(()=>h.current?.openAddAccount(),400)},children:[L(X,{icon:`plus`}),` `,L(j,{id:`MPPZ54`})]})})]}),(oe.length>1||O?.updatedAt||O?.discoverable!==void 0)&&L(`footer`,{class:`ui-state`,children:L(`small`,{class:`insignificant`,children:[oe.length>1&&L(i,{children:[L(j,{id:`A7kMZX`,values:{0:oe.length}}),L(`br`,{})]}),O?.updatedAt&&L(j,{id:`sqjguT`,components:{relativeTime:L(Wt,{datetime:O.updatedAt,format:`micro`})}}),O?.discoverable===!1&&L(i,{children:[O?.updatedAt&&` · `,L(j,{id:`WDcQq9`})]}),O?.discoverable!==!1&&L(i,{children:[O?.updatedAt&&` · `,L(j,{id:`7d1a0d`})]}),O?.sensitive&&L(i,{children:[L(`br`,{}),L(X,{icon:`alert`,size:`s`}),` `,L(j,{id:`up99W1`})]})]})})]})]})})]}),k.length>0&&!(O?.sensitive&&!H&&!M)&&L(`div`,{id:`collection-page-bg`,"aria-hidden":`true`,children:k.filter(Boolean).slice(0,4).map(e=>L(`img`,{src:e.avatarStatic||e.avatar,alt:``,decoding:`async`,loading:`lazy`},e.id))})]}),l&&L(Ot,{onClick:e=>{e.target===e.currentTarget&&u(!1)},children:L(As,{collection:O,onClose:e=>{e?.state===`success`&&e.collection?D(n=>n?.collection||n?{...n,collection:e.collection}:n):e?.state===`deleted`&&(location.hash=x?`/${x}/a/${ae}/c`:`/a/${ae}/c`),u(!1)}})}),p&&L(Ot,{onClick:e=>{e.target===e.currentTarget&&m(!1)},children:L(Bc,{ref:h,collection:O,accounts:k,instance:x,onClose:()=>m(!1),onDataChange:({collectionItems:e,accounts:n})=>{D(r=>({...r,collection:{...r?.collection||r,items:e},accounts:n}))}})}),_&&L(Ot,{onClick:e=>{e.target===e.currentTarget&&v(!1)},children:L(Vc,{collection:O,domain:V?.acct?.split(`@`)[1],onClose:()=>v(!1)})})]})}var Gc=20;function Kc(){let{_:e}=d();he(e({id:`zZOZj7`}),`/favourites`);let{masto:n,instance:r}=f(),i=s();async function a(e){return(e||!i.current)&&(i.current=n.v1.favourites.list({limit:Gc}).values()),await i.current.next()}return L(tc,{title:e({id:`zZOZj7`}),id:`favourites`,emptyText:e({id:`PHIrMr`}),errorText:e({id:`khVljG`}),instance:r,fetchItems:a})}var qc=[`home`,`public`,`notifications`,`thread`,`account`],Jc=[`thread`,`account`],Yc={home:{id:`Buy2bt`},notifications:{id:`iDNBZe`},public:{id:`RO10dm`},thread:{id:`EnJuK0`},account:{id:`vrQQgz`}},Xc=[0,1800,3600,360*60,720*60,3600*24,3600*24*7,3600*24*30],Zc={0:{id:`qqeAJM`},1800:kt(30,`minute`),3600:kt(1,`hour`),21600:kt(6,`hour`),43200:kt(12,`hour`),86400:kt(24,`hour`),604800:kt(7,`day`),2592e3:kt(30,`day`)};function Qc(){let{_:e}=d(),{masto:n}=f();he(e({id:`cSev-j`}),`/ft`);let[r,a]=I(`default`),[o,s]=I(!1),[c,l]=m(e=>e+1,0),[u,p]=I([]);return y(()=>{a(`loading`),(async()=>{try{let e=await n.v2.filters.list();e.sort((e,n)=>e.title.localeCompare(n.title)),e.forEach(e=>{e.keywords?.length&&e.keywords.sort((e,n)=>e.id-n.id)}),p(e),a(`default`)}catch{a(`error`)}})()},[c]),L(`div`,{id:`filters-page`,class:`deck-container`,tabIndex:`-1`,children:[L(`div`,{class:`timeline-deck deck`,children:[L(`header`,{children:L(`div`,{class:`header-grid`,children:[L(`div`,{class:`header-side`,children:[L(Ns,{}),L(Q,{to:`/`,class:`button plain`,children:L(X,{icon:`home`,size:`l`,alt:e({id:`i0qMbr`})})})]}),L(`h1`,{children:L(j,{id:`cSev-j`})}),L(`div`,{class:`header-side`,children:L(`button`,{type:`button`,class:`plain`,onClick:()=>{s(!0)},children:L(X,{icon:`plus`,size:`l`,alt:e({id:`yFfBdX`})})})})]})}),L(`main`,{children:u.length>0?L(i,{children:[L(`ul`,{class:`filters-list`,children:u.map(e=>{let{id:n,title:r,expiresAt:a,keywords:o}=e;return L(`li`,{children:[L(`div`,{children:[L(`h2`,{children:r}),o?.length>0&&L(`div`,{children:o.map(e=>L(i,{children:[L(`span`,{class:`tag collapsed insignificant`,children:e.wholeWord?`“${e.keyword}”`:e.keyword}),` `]}))}),L(`small`,{class:`insignificant`,children:L(nl,{expiresAt:a})})]}),L(`button`,{type:`button`,class:`plain`,onClick:()=>{s({filter:e})},children:L(X,{icon:`pencil`,size:`l`,alt:`Edit filter`})})]},n)})}),u.length>1&&L(`footer`,{class:`ui-state`,children:L(`small`,{class:`insignificant`,children:L(j,{id:`5vzJxv`,values:{0:u.length}})})})]}):r===`loading`?L(`p`,{class:`ui-state`,children:L(q,{})}):r===`error`?L(`p`,{class:`ui-state`,children:L(j,{id:`qcAUwp`})}):L(`p`,{class:`ui-state`,children:L(j,{id:`cWIHTt`})})})]}),!!o&&L(Ot,{title:e({id:`vCSBPD`}),onClose:()=>{s(!1)},children:L(tl,{filter:o?.filter,onClose:e=>{e.state===`success`&&l(),s(!1)}})})]})}var $c=1,el=()=>$c++;function tl({filter:e,onClose:n}){let{_:r,_:i}=d(),{masto:a}=f(),[o,c]=I(`default`),l=!!e,{context:u,expiresAt:m,id:h,keywords:g,title:_,filterAction:v}=e||{},y=!!m,b=y&&new Date(m),[x,S]=I(g||[]),C=s(),[w,T]=I([]),[E,ee]=I([]),D=x.filter(e=>!w.includes(e.id)&&!E.includes(e._id));return L(`div`,{class:`sheet`,id:`filters-add-edit-modal`,children:[!!n&&L(`button`,{type:`button`,class:`sheet-close`,onClick:n,children:L(X,{icon:`x`,alt:i({id:`yz7wBu`})})}),L(`header`,{children:L(`h2`,{children:i(l?{id:`3mOee6`}:{id:`yFfBdX`})})}),L(`main`,{children:L(`form`,{onSubmit:e=>{e.preventDefault();let r=new FormData(e.target),o=r.get(`title`),s=r.getAll(`keyword_attributes[][id]`),u=r.getAll(`keyword_attributes[][keyword]`),d=[...C.current.querySelectorAll(`input[name="keyword_attributes[][whole_word]"]`)].map(e=>e.checked),f=u.map((e,n)=>({id:s[n]||void 0,keyword:e,wholeWord:d[n]}));l&&w?.length&&w.forEach(e=>{f.push({id:e,_destroy:!0})});let p=r.getAll(`context`),m=r.get(`expires_in`),g=r.get(`filter_action`);!o||!p?.length||(c(`loading`),(async()=>{try{let e;l?(m=m===``||m===null?y?Math.floor((b-Date.now())/1e3):null:m===`0`||m===0?null:+m,e=await a.v2.filters.$select(h).update({title:o,context:p,expiresIn:m,keywordsAttributes:f,filterAction:g})):(m=+m||null,e=await a.v2.filters.create({title:o,context:p,expiresIn:m,keywordsAttributes:f,filterAction:g})),c(`default`),n?.({state:`success`,filter:e})}catch{c(`error`),alert(i(l?{id:`H8RP-h`}:{id:`Fr0hAN`}))}})())},children:[L(`div`,{class:`filter-form-row`,children:L(`label`,{children:[L(`b`,{children:L(j,{id:`MHrjPM`})}),L(`input`,{type:`text`,name:`title`,defaultValue:_,disabled:o===`loading`,dir:`auto`,enterKeyHint:`done`,required:!0})]})}),L(`div`,{class:`filter-form-keywords`,ref:C,children:[D.length?L(`ul`,{class:`filter-keywords`,children:D.map(e=>{let{id:n,keyword:r,wholeWord:a,_id:s}=e;return L(`li`,{children:[L(`input`,{type:`hidden`,name:`keyword_attributes[][id]`,value:n}),L(`input`,{name:`keyword_attributes[][keyword]`,type:`text`,defaultValue:r,disabled:o===`loading`,required:!0,dir:`auto`,enterKeyHint:`done`}),L(`div`,{class:`filter-keyword-actions`,children:[L(`label`,{children:[L(`input`,{name:`keyword_attributes[][whole_word]`,type:`checkbox`,value:n,defaultChecked:a,disabled:o===`loading`}),` `,L(j,{id:`_7UQ7y`})]}),L(`button`,{type:`button`,class:`light danger small`,disabled:o===`loading`,onClick:()=>{n?(w.push(n),T([...w])):s&&(E.push(s),ee([...E]))},children:L(X,{icon:`x`,alt:i({id:`t_YqKh`})})})]})]},`${n}-${s}`)})}):L(`div`,{class:`filter-keywords`,children:L(`div`,{class:`insignificant`,children:L(j,{id:`SYKm3p`})})}),L(`footer`,{class:`filter-keywords-footer`,children:[L(`button`,{type:`button`,class:`light`,onClick:()=>{S([...x,{_id:el(),keyword:``,wholeWord:!0}]),setTimeout(()=>{let e=C.current.querySelectorAll(`input[type="text"]`);e[e.length-1]?.focus?.()},10)},children:L(j,{id:`qn5Dbn`})}),` `,D?.length>1&&L(`small`,{class:`insignificant`,children:L(j,{id:`1JZ175`,values:{0:D.length}})})]})]}),L(`div`,{class:`filter-form-cols`,children:[L(`div`,{class:`filter-form-col`,children:[L(`div`,{children:L(`b`,{children:L(j,{id:`uqf7Yq`})})}),qc.map(e=>L(`div`,{children:[L(`label`,{class:Jc.includes(e)?`insignificant`:``,children:[L(`input`,{type:`checkbox`,name:`context`,value:e,defaultChecked:u?u.includes(e):!0,disabled:o===`loading`}),` `,r(Yc[e]),Jc.includes(e)?`*`:``]}),` `]})),L(`p`,{children:L(`small`,{class:`insignificant`,children:L(j,{id:`m0G499`})})})]}),L(`div`,{class:`filter-form-col`,children:[l&&L(j,{id:`ucJk3m`,components:{0:L(`b`,{}),1:L(nl,{expiresAt:m,showNeverExpires:!0})}}),L(`div`,{children:[L(`label`,{for:`filters-expires_in`,children:i(l?{id:`BcNdg-`}:{id:`agO_T_`})}),L(`select`,{id:`filters-expires_in`,name:`expires_in`,disabled:o===`loading`,defaultValue:l?void 0:0,children:[l&&L(`option`,{}),Xc.map(e=>L(`option`,{value:e,children:typeof Zc[e]==`function`?Zc[e]():r(Zc[e])}))]})]}),L(`p`,{children:[L(j,{id:`blQMpa`}),L(`br`,{}),p()?.mastodon>=5&&L(`label`,{class:`ib`,children:[L(`input`,{type:`radio`,name:`filter_action`,value:`blur`,defaultChecked:v===`blur`,disabled:o===`loading`}),` `,L(j,{id:`ggxOw9`})]}),` `,L(`label`,{class:`ib`,children:[L(`input`,{type:`radio`,name:`filter_action`,value:`warn`,defaultChecked:v!==`hide`&&v!==`blur`||!l,disabled:o===`loading`}),` `,L(j,{id:`jbreWy`})]}),` `,L(`label`,{class:`ib`,children:[L(`input`,{type:`radio`,name:`filter_action`,value:`hide`,defaultChecked:v===`hide`,disabled:o===`loading`}),` `,L(j,{id:`zNCBmf`})]})]})]})]}),L(`footer`,{class:`filter-form-footer`,children:[L(`span`,{children:[L(`button`,{type:`submit`,disabled:o===`loading`,children:i(l?{id:`tfDRzk`}:{id:`hYgDIe`})}),` `,L(q,{abrupt:!0,hidden:o!==`loading`})]}),l&&L(xt,{disabled:o===`loading`,align:`end`,menuItemClassName:`danger`,confirmLabel:i({id:`BPjyR2`}),onClick:()=>{c(`loading`),(async()=>{try{await a.v2.filters.$select(h).remove(),c(`default`),n?.({state:`success`})}catch{c(`error`),alert(i({id:`4Dh9J1`}))}})()},children:L(`button`,{type:`button`,class:`light danger`,onClick:()=>{},disabled:o===`loading`,children:L(j,{id:`Jb6_SB`})})})]})]})})]})}function nl({expiresAt:e,showNeverExpires:n}){let{_:r}=d(),i=!!e,a=i&&new Date(e),o=i&&Date.parse(e)<=Date.now(),[s,c]=m(e=>e+1,0);return Be(c,o||3e4),o?r({id:`M1RnFv`}):i?L(j,{id:`urGtsw`,components:{0:L(Wt,{datetime:a})}}):n&&r({id:`O1Aswy`})}function rl(){let{_:e}=d(),{masto:n,instance:r}=f();he(e({id:`Xi1_bw`}),`/fh`);let[a,o]=I(`default`),[s,c]=I([]);return y(()=>{o(`loading`),(async()=>{try{c(await Go()),o(`default`)}catch{o(`error`)}})()},[]),L(`div`,{id:`followed-hashtags-page`,class:`deck-container`,tabIndex:`-1`,children:L(`div`,{class:`timeline-deck deck`,children:[L(`header`,{children:L(`div`,{class:`header-grid`,children:[L(`div`,{class:`header-side`,children:[L(Ns,{}),L(Q,{to:`/`,class:`button plain`,children:L(X,{icon:`home`,size:`l`,alt:e({id:`i0qMbr`})})})]}),L(`h1`,{children:L(j,{id:`Xi1_bw`})}),L(`div`,{class:`header-side`})]})}),L(`main`,{children:s.length>0?L(i,{children:[L(`ul`,{class:`link-list`,children:s.map(e=>L(`li`,{children:L(Q,{to:r?`/${r}/t/${e.name}`:`/t/${e.name}`,children:[L(X,{icon:`hashtag`,alt:`#`}),` `,L(`span`,{children:e.name})]})}))}),s.length>1&&L(`footer`,{class:`ui-state`,children:L(`small`,{class:`insignificant`,children:L(j,{id:`2S_uvJ`,values:{0:s.length}})})})]}):a===`loading`?L(`p`,{class:`ui-state`,children:L(q,{abrupt:!0})}):a===`error`?L(`p`,{class:`ui-state`,children:L(j,{id:`2AeREO`})}):L(`p`,{class:`ui-state`,children:L(j,{id:`vKsGhk`})})})]})})}var il=20;function al({title:e,path:n,id:r,...i}){let{_:a}=d();he(e||a({id:`following.title`}),n||`/following`);let{masto:o,streaming:c,instance:l,client:u}=f(),[p,m]=I(c),h=W(k),g=s(),_=s(),v=s();y(()=>{!c&&u?.onStreamingReady&&u.onStreamingReady(e=>{m(e)})},[u]),__BENCHMARK.end(`time-to-following`);let b=ot(`@pixelfed/home-include-reblogs`);async function x(e){(e||!_.current)&&(__BENCHMARK.start(`fetch-home-first`),g.current=o.v1.timelines.home.list({limit:il}),_.current=g.current.values()),b&&g.current?.params&&(typeof g.current.params==`string`?g.current.params+=`&include_reblogs=true`:g.current.params.include_reblogs=!0);let n=await _.current.next(),{value:r}=n;if(r?.length){let n=!1;e&&(r[0].id!==v.current&&(n=!0),v.current=r[0].id),r.forEach(e=>{Me(e,l)}),r=Rs(r,l),e&&n&&Us(),setTimeout(()=>{Hs(r,l)},100),r.sort((e,n)=>Date.parse(n.createdAt)-Date.parse(e.createdAt))}return __BENCHMARK.end(`fetch-home-first`),{...n,value:r}}async function S(){try{let e={limit:5,since_id:v.current};b&&(e.include_reblogs=!0);let{value:n}=await o.v1.timelines.home.list(e).values().next(),r=n[0]?.id===v.current;return!!(n?.length&&!r&&(v.current=n[0].id,n=Rs(n,l),n=Zt(n,`home`),n.some(e=>!e.reblog)))}catch{return!1}}return y(()=>{let e;return(async()=>{if(p){e=p.user.subscribe();for await(let n of e){if(!e)break;if(n.event===`status.update`){let e=n.payload;Me(e,l)}else if(n.event===`delete`){let e=n.payload,r=Oe(e,l);r&&(r._deleted=!0)}}}})(),()=>{e?.unsubscribe?.(),e=null}},[p]),L(tc,{title:e||a({id:`following.title`}),id:r||`following`,emptyText:a({id:`nJEKbY`}),errorText:a({id:`7QSeK6`}),instance:l,fetchItems:x,checkForUpdates:S,useItemID:!0,boostsCarousel:h.settings.boostsCarousel,...i,filterContext:`home`,showFollowedTags:!0,showReplyParent:!0})}var ol=20,sl=50,cl=1e3*60*15;function ll(e){let n=e[e.length-1];return n.items?n.items[n.items.length-1]:n}function ul(e){let n=e[0];return n.items?n.items[0]:n}function dl(e){if(!e)return null;let n=e.getBoundingClientRect(),r=e.querySelectorAll(`[data-state-post-id]`);for(let e of r){let r=e.getBoundingClientRect();if(r.bottom>n.top+10&&r.top<n.bottom-10){let i=e.dataset.statePostId?.split?.(` `);if(i)return{itemId:i,offset:r.top-n.top}}}return null}function fl({title:e,titleComponent:n,id:r,instance:a,emptyText:o,errorText:l,useItemID:u,fetchItems:p=async()=>{},checkForUpdates:m=async()=>{},checkForUpdatesInterval:h=15e3,headerStart:g,headerEnd:_,timelineStart:v,refresh:b,filterContext:S,showFollowedTags:C,showReplyParent:w,dedupeBoosts:T}){let{_:E}=d(),ee=W(k).settings.autoHideBars,{masto:D}=f({instance:a}),O=`timeline2-${r}`,A=s(null);A.current===null&&(A.current=F.account.get(O)||null);let M=!!A.current?.items?.length,P=A.current?.updatedAt,te=P?Date.now()-P:0,ne=s(),[R,z]=I(M?`default`:`start`),[B,V]=I((A.current?.showNewer??!1)||te>cl),[re,ie]=I(A.current?.showOlder??!0),[ae,H]=I(!0),U=s(),oe=s(!0),[se,ce]=I(()=>{let e=A.current?.items;return e?.length?(e.forEach(e=>{e.items?e.items.forEach(e=>{Me(e,a,{sync:!0})}):Me(e,a,{sync:!0})}),e):[]}),le=x(()=>{let e=A.current;if(!e?.items?.length||(e.updatedAt?Date.now()-e.updatedAt:1/0)<=cl)return;let n=[];if(e.items.forEach(e=>{e.items?e.items.forEach(e=>{n.push(e.id)}):n.push(e.id)}),n.length===0)return;let r=[];(async()=>{try{for(let e=0;e<n.length;e+=ol){let i=n.slice(e,e+ol);try{let e=await D.v1.statuses.list({id:i}),n=new Set(e?.map(e=>e.id)||[]);i.forEach(e=>{n.has(e)||r.push(e)}),e?.length&&e.forEach(e=>{Me(e,a,{sync:!0})})}catch{}}r.forEach(e=>{let n=c(e,a);k.statuses[n]&&(k.statuses[n]._deleted=!0)})}catch{}})()},[a,D]);y(()=>{le()},[]),ln(e=>{e&&le()},[le]);let G=s(A.current?.scrollAnchor||null),ue=x(({items:e,direction:n})=>{if(!e?.length||!U.current)return;let r=c((n===`next`?ll:ul)(e)?.id,a),i=U.current.querySelector(`[data-state-post-id~="${r}"]`);if(i){let e=U.current.getBoundingClientRect();G.current={itemId:r,offset:i.getBoundingClientRect().top-e.top,direction:n}}},[]);__BENCHMARK.start(`timeline-${r}-load`);let K=s(A.current?.minID||null),de=s(A.current?.maxID||null),fe=mt((e={})=>{let{max_id:n,min_id:i}=e,o=!n&&!i?`start`:n?`next`:i?`prev`:null;ne.current=o,z(`loading`),(async()=>{try{let n=await p(e),{max_id:i,min_id:s}=e,{value:c,originalValue:l,done:u}=n;if(u&&c==null){ie(!1),V(!1),z(`default`),__BENCHMARK.end(`timeline-${r}-load`);return}else if(c==null)throw Error(`Timeline load failed`);let d=!u,f=l[0]?.id,m=l[l.length-1]?.id;c?.length?(T&&(c=Rs(c,a)),c=zs(c,S),c=Bs(c,a),o===`start`?(K.current=f,de.current=m,ce(c),ie(d),V(!1)):o===`next`?(de.current=m,U.current.classList.add(`scrolling-next`),ce(e=>{ue({items:e,direction:`next`});let n=[...e,...c].slice(-sl);return K.current=[n[0].id].flat()[0],n}),ie(d),V(!0)):o===`prev`&&(K.current=f,U.current.classList.add(`scrolling-prev`),ce(e=>{ue({items:e,direction:`prev`});let n=[...c,...e].slice(0,sl);return de.current=[n.at(-1).id].flat().at(-1),n}),ie(!0),V(l.length>=ol))):(i&&ie(!1),s&&V(!1)),z(`default`),__BENCHMARK.end(`timeline-${r}-load`)}catch{z(`error`)}finally{fe.cancel()}})()},300,{leading:!0}),pe=Qs(U),me=$s(U),he=ec(),ge=s();y(()=>{if(!oe.current)if(se.length>0){let e=F.account.get(O)||{};F.account.set(O,{...e,items:se,minID:K.current,maxID:de.current,showNewer:B,showOlder:re,updatedAt:Date.now()})}else F.account.del(O)},[se,O,B,re]);let _e=Qe(()=>{if(!U.current||se.length===0)return;let e=dl(U.current);if(e){let n=F.account.get(O)||{};F.account.set(O,{...n,scrollAnchor:e})}},500),ve=x(({scrollDirection:e,nearReachStart:n})=>{ge.current&&(ge.current.hidden=ee&&e===`end`&&!n),_e()},[_e,ee]),{resetScrollDirection:ye}=Gs({scrollableRef:U,distanceFromEnd:2,scrollThresholdStart:44},ve);y(()=>{oe.current&&(oe.current=!1,A.current?.items?.length?be():fe())},[fe]);let be=x(async()=>{K.current&&V(await m({minID:K.current}))},[m]),xe=s();return ln(e=>{if(!oe.current){if(e){let e=Date.now()-xe.current;(!xe.current||e>1e3*3)&&be()}else xe.current=Date.now();H(e)}},[be]),Be(be,ae&&!B?h:null),N(()=>{if(R!=="default"||!U.current||!G.current)return;let e=G.current;G.current=null;let{itemId:n,offset:r,direction:i}=e,a=U.current.querySelector(`[data-state-post-id~="${n}"]`);if(a){let e=U.current.getBoundingClientRect(),n=a.getBoundingClientRect().top-e.top-r;Math.abs(n)>1&&(U.current.scrollTop+=n),setTimeout(()=>{U.current?.classList.remove(`scrolling-${i}`)},300)}},[se,R]),L(He.Provider,{value:S,children:L(`div`,{id:`${r}-page`,class:`deck-container timeline-2-container`,ref:e=>{U.current=e,pe.current=e,me.current=e,he.current=e},tabIndex:`-1`,onClick:e=>{ge.current&&e.target.closest(`.timeline-item, .timeline-item-alt`)&&setTimeout(()=>{ge.current.hidden=!1,ye()},250)},children:L(`div`,{class:`timeline-deck deck`,children:[L(`header`,{ref:ge,onClick:e=>{e.target.closest(`a, button`)||U.current?.scrollTo({top:0,behavior:`smooth`})},onDblClick:e=>{e.target.closest(`a, button`)||fe()},children:L(`div`,{class:`header-grid`,children:[L(`div`,{class:`header-side`,children:[L(Ns,{}),g??L(Q,{to:`/`,class:`button plain home-button`,children:L(X,{icon:`home`,size:`l`,alt:E({id:`i0qMbr`})})})]}),e&&(n||L(`h1`,{children:e})),L(`div`,{class:`header-side`,children:!!_&&_})]})}),!!v&&L(`div`,{class:`timeline-start ${R===`loading`?`loading`:``}`,children:v}),se.length?L(i,{children:[B&&L(`div`,{class:`timeline-pagination timeline-pagination-top ${oe.current?``:`transitioning`}`,children:[L(`button`,{type:`button`,"data-pagination-trigger":`latest`,class:`plain4 ${R===`loading`&&ne.current===`start`?`block`:``}`,onClick:()=>{fe()},disabled:R===`loading`,children:R===`loading`&&ne.current===`start`?L(q,{abrupt:!0}):L(X,{icon:`arrow-up-top`,size:`l`})}),L(`button`,{type:`button`,"data-pagination-trigger":`prev`,class:`plain4 ${R===`loading`&&ne.current===`start`?``:`block`}`,onClick:()=>{fe({min_id:K.current})},disabled:R===`loading`,children:R===`loading`&&ne.current===`prev`?L(q,{abrupt:!0}):L(X,{icon:`arrow-up`,size:`l`})})]}),L(`ul`,{class:`timeline`,children:se.map(e=>L(nc,{status:e,instance:a,useItemID:u,filterContext:S,showFollowedTags:C,showReplyParent:w},e.id))}),re?L(`div`,{class:`timeline-pagination timeline-pagination-bottom`,children:L(`button`,{type:`button`,class:`plain4 block`,"data-pagination-trigger":`next`,onClick:()=>{fe({max_id:de.current})},disabled:R===`loading`,children:R===`loading`?L(q,{abrupt:!0}):L(X,{icon:`arrow-down`,size:`l`})})}):R===`loading`?null:L(`p`,{class:`ui-state insignificant`,children:L(j,{id:`2EYeAZ`})})]}):R===`loading`?L(`ul`,{class:`timeline`,children:Array.from({length:5}).map((e,n)=>L(`li`,{children:L(Ut,{skeleton:!0})},n))}):R!==`error`&&R!==`start`&&L(`p`,{class:`ui-state`,children:o}),R===`error`&&L(`p`,{class:`ui-state`,children:[l,L(`br`,{}),L(`br`,{}),L(`button`,{type:`button`,onClick:()=>fe(),children:L(j,{id:`KDw4GX`})})]})]})})})}var pl=20;function ml({title:e,path:n,id:r,...i}){let{_:a}=d();he(e||a({id:`following.title`}),n||`/_following2`);let{masto:o,streaming:s,instance:c,client:l}=f(),[u,p]=I(s);y(()=>{!s&&l?.onStreamingReady&&l.onStreamingReady(e=>{p(e)})},[l]),__BENCHMARK.end(`time-to-following`);let m=ot(`@pixelfed/home-include-reblogs`);async function h({max_id:e,min_id:n}={}){__BENCHMARK.start(`fetch-home`);let r={limit:pl};e&&(r.max_id=e),n&&(r.min_id=n),m&&(r.include_reblogs=!0);let i=await o.v1.timelines.home.list(r).values().next(),{value:a}=i,s=[...a||[]];return a?.length&&(a.forEach(e=>{Me(e,c)}),setTimeout(()=>{Hs(a,c)},100),a.sort((e,n)=>Date.parse(n.createdAt)-Date.parse(e.createdAt))),__BENCHMARK.end(`fetch-home`),{...i,value:a,originalValue:s}}async function g({minID:e}){try{let n={limit:5,since_id:e};m&&(n.include_reblogs=!0);let{value:r}=await o.v1.timelines.home.list(n).values().next();return r?.length?(r=Rs(r,c),r=Zt(r,`home`),r.length>0):!1}catch{return!1}}return y(()=>{let e;return(async()=>{if(u){e=u.user.subscribe();for await(let n of e){if(!e)break;if(n.event===`status.update`){let e=n.payload;Me(e,c)}else if(n.event===`delete`){let e=n.payload,r=Oe(e,c);r&&(r._deleted=!0)}}}})(),()=>{e?.unsubscribe?.(),e=null}},[u]),L(fl,{title:e||a({id:`following.title`}),id:r||`following2`,emptyText:a({id:`nJEKbY`}),errorText:a({id:`7QSeK6`}),instance:c,fetchItems:h,checkForUpdates:g,useItemID:!0,...i,filterContext:`home`,showFollowedTags:!0,showReplyParent:!0})}var hl={"disabled.example.com":`disabled`,"authenticated.example.com":`authenticated`};async function gl(e,n){let r=F.local.getJSON(`instances`)||{},i=r[n?.toLowerCase()];if(!i?.configuration?.timelinesAccess){let a=await e.v2.instance.fetch().catch(()=>null);a&&(i=a,r[n?.toLowerCase()]=a,F.local.setJSON(`instances`,r))}return i}async function _l({feed:e,feedType:n,feeds:r,instance:i}){let{masto:a,instance:o}=f({instance:i}),s=i||o;try{let i=hl[s?.toLowerCase()];if(r){if(i){let e={};return r.forEach(({feed:n,feedType:r})=>{e[`${n}_${r}`]=i}),e}let e=await gl(a,s),n={};return r.forEach(({feed:r,feedType:i})=>{n[`${r}_${i}`]=e?.configuration?.timelinesAccess?.[r]?.[i]||`public`}),n}return i||(await gl(a,s))?.configuration?.timelinesAccess?.[e]?.[n]||`public`}catch{return r?{}:`public`}}var vl=20,yl=5;function bl({media:e,columnMode:n,...r}){let{_:a}=d(),{hashtag:o,...c}=n?{}:A();r.hashtag&&(o=r.hashtag);let l=o.trim().split(/[\s+]+/);l.sort(),o=l[0];let[u,p]=oe(),m=e||!!u.get(`media`),h=m?`?media=1`:``,{masto:_,instance:v,authenticated:b}=f({instance:r?.instance||c.instance}),{masto:x,instance:S,authenticated:C}=f(),w=l.map(e=>`#${e}`).join(` `),T=a(v?m?{id:`kH0rA0`,values:{hashtagTitle:w,instance:v}}:{id:`IK0zKi`,values:{hashtagTitle:w,instance:v}}:m?{id:`hHSI3w`,values:{hashtagTitle:w}}:{id:`-ZzjRY`,values:{hashtagTitle:w}});he(T,`/:instance?/t/:hashtag`);let E=s(),ee=g(()=>V(),[]),[D,O]=I(null),M=D===`disabled`,N=D===`authenticated`&&!b,P=s(void 0);async function te(e){let n=await _l({feed:`hashtagFeeds`,feedType:`local`,instance:v});if(O(n),n===`disabled`||n===`authenticated`&&!b)return{done:!0,value:[]};let r=await _.v1.timelines.tag.$select(o).list({limit:vl,any:l.slice(1),maxId:e?void 0:P.current,onlyMedia:m?!0:void 0}).values().next(),{value:i}=r;return i?.length&&(e&&(E.current=i[0].id),i.forEach(e=>{Me(e,v,{skipThreading:m||ee})}),P.current=i[i.length-1].id),{...r,value:i}}async function F(){try{let{value:e}=await _.v1.timelines.tag.$select(o).list({limit:1,any:l.slice(1),since_id:E.current,onlyMedia:m}).values().next(),n=e[0]?.id===E.current;return e?.length&&!n?(e=Zt(e,`public`),!0):!1}catch{return!1}}let[ne,R]=I(`default`),[z,B]=I();y(()=>{(async()=>{try{B(await _.v1.tags.$select(o).fetch())}catch{}})()},[o]);let re=l.length>=yl,[ie,ae]=I(`default`),[H,U]=I([]),[W,se]=I(!1);return y(()=>{b&&(async()=>{try{let e=await _.v1.featuredTags.list();U(e),se(e.some(e=>e.name.toLowerCase()===o.toLowerCase()))}catch{}})()},[]),L(i,{children:[L(tc,{title:T,titleComponent:!!v&&L(`h1`,{class:`header-double-lines`,children:[L(`b`,{dir:`auto`,children:w}),L(`div`,{children:v})]}),id:`hashtag`,instance:v,emptyText:a(M?{id:`qbE_m4`}:N?{id:`aqJggz`}:{id:`CNSLAW`}),errorText:a({id:`yjj6Ll`}),fetchItems:te,checkForUpdates:F,useItemID:!0,view:m||ee?`media`:void 0,refresh:m,filterContext:`public`,headerEnd:L(Gt,{portal:!0,setDownOverflow:!0,overflow:`auto`,position:`anchor`,menuButton:L(`button`,{type:`button`,class:`plain`,children:L(X,{icon:`more`,size:`l`,alt:a({id:`2FYpfJ`})})}),children:[!!z&&l.length===1&&L(i,{children:[L(xt,{subMenu:!0,confirm:z.following,confirmLabel:a({id:`ctJi7k`,values:{hashtag:o}}),disabled:ne===`loading`||!b,onClick:()=>{R(`loading`),z.following?_.v1.tags.$select(o).unfollow().then(()=>{B({...z,following:!1}),Z(a({id:`doK_ij`,values:{hashtag:o}}))}).catch(e=>{alert(e)}).finally(()=>{R(`default`)}):_.v1.tags.$select(o).follow().then(()=>{B({...z,following:!0}),Z(a({id:`R9-aEN`,values:{hashtag:o}}))}).catch(e=>{alert(e)}).finally(()=>{R(`default`)})},children:z.following?L(i,{children:[L(X,{icon:`check-circle`}),` `,L(`span`,{children:L(j,{id:`HOSk7R`})})]}):L(i,{children:[L(X,{icon:`plus`}),` `,L(`span`,{children:L(j,{id:`MKEPCY`})})]})}),L(Y,{type:`checkbox`,checked:W,disabled:ie===`loading`||!b,onClick:()=>{if(ae(`loading`),W){let e=H.find(e=>e.name.toLowerCase()===o.toLowerCase()).id;e?_.v1.featuredTags.$select(e).remove().then(()=>{se(!1),Z(a({id:`VH-Tf9`})),U(H.filter(n=>n.id!==e))}).catch(e=>{}).finally(()=>{ae(`default`)}):Z(a({id:`3OLv47`}))}else _.v1.featuredTags.create({name:o}).then(e=>{se(!0),Z(a({id:`9ra4hn`})),U(H.concat(e))}).catch(e=>{}).finally(()=>{ae(`default`)})},children:W?L(i,{children:[L(X,{icon:`check-circle`}),L(`span`,{children:L(j,{id:`9ra4hn`})})]}):L(i,{children:[L(X,{icon:`check-circle`}),L(`span`,{children:L(j,{id:`UlJ3QN`})})]})}),L(qe,{})]}),!ee&&L(i,{children:[L(ft,{className:`plain`,children:L(j,{id:`cSev-j`})}),L(Y,{type:`checkbox`,checked:!!m,onClick:()=>{m?u.delete(`media`):u.set(`media`,`1`),p(u)},children:[L(X,{icon:`check-circle`,alt:`☑️`}),` `,L(`span`,{class:`menu-grow`,children:L(j,{id:`eK4SL_`})})]}),L(qe,{})]}),L(Ge,{className:`menu-field`,disabled:re,children:({ref:e})=>L(`form`,{onSubmit:e=>{e.preventDefault();let n=e.target[0].value?.trim?.();n&&!l.some(e=>e.toLowerCase()===n.toLowerCase())&&(l.push(n),l.sort(),location.hash=v?`/${v}/t/${l.join(`+`)}${h}`:`/t/${l.join(`+`)}${h}`)},children:[L(X,{icon:`hashtag`}),L(`input`,{ref:e,type:`text`,placeholder:re?G._({id:`ouWc_D`,values:{TOTAL_TAGS_LIMIT:yl}}):a({id:`cxL5F9`}),required:!0,autocorrect:`off`,autocapitalize:`off`,spellCheck:!1,pattern:`[^##][^\\s##]+[^##]`,disabled:re,dir:`auto`,enterKeyHint:`go`})]})}),L(Xt,{takeOverflow:!0,children:l.map((e,n)=>L(Y,{disabled:l.length===1,onClick:e=>{l.splice(n,1),l.sort(),location.hash=v?`/${v}/t/${l.join(`+`)}${h}`:`/t/${l.join(`+`)}${h}`},children:[L(X,{icon:`x`,alt:a({id:`OISAkj`}),class:`danger-icon`}),L(`span`,{class:`bidi-isolate`,children:[L(`span`,{class:`more-insignificant`,children:`#`}),e]})]},e))}),L(qe,{}),L(Y,{disabled:!C,onClick:()=>{if(k.shortcuts.length>=9){alert(G._({id:`XN1xAY`,values:{SHORTCUTS_LIMIT:9}}));return}let e={type:`hashtag`,hashtag:l.join(` `),instance:v,media:m?`on`:void 0};k.shortcuts.some(n=>n.type===e.type&&n.hashtag.split(/[\s+]+/).sort().join(` `)===e.hashtag.split(/[\s+]+/).sort().join(` `)&&(n.instance?n.instance===e.instance:!0)&&(n.media?!!n.media==!!e.media:!0))?alert(a({id:`kfeQnS`})):(k.shortcuts.push(e),Z(a({id:`MIhb91`})))},children:[L(X,{icon:`shortcut`}),` `,L(`span`,{children:L(j,{id:`i02Lq_`})})]}),L(Y,{onClick:()=>{let e=prompt(a({id:`4CZnNE`}));if(!/\./.test(e)){e&&alert(a({id:`Q5COHO`}));return}e&&(e=e.toLowerCase().trim(),location.hash=`/${e}/t/${l.join(`+`)}${h}`)},children:[L(X,{icon:`bus`}),` `,L(`span`,{children:L(j,{id:`kesYbo`})})]}),S!==v&&L(Y,{onClick:()=>{location.hash=`/${S}/t/${l.join(`+`)}${h}`},children:[L(X,{icon:`bus`}),` `,L(`small`,{class:`menu-double-lines`,children:L(j,{id:`_AfxaA`,values:{currentInstance:S},components:{0:L(`b`,{})}})})]})]})},v+w),!n&&!!l?.length&&L(`data`,{class:`compose-data`,value:JSON.stringify({draftStatus:{status:`${l.length>1?`
|
|
22
|
+
|
|
23
|
+
`:` `}${w}`}})})]})}var xl=20;function Sl(e){let{_:n}=d(),r=W(k),{masto:a,instance:o}=f(),c=e?.id||A()?.id,l=s(),u=s();async function p(e){(e||!u.current)&&(u.current=a.v1.timelines.list.$select(c).list({limit:xl}).values());let n=await u.current.next(),{value:r}=n;return r?.length&&(e&&(l.current=r[0].id),r.forEach(e=>{Me(e,o)})),{...n,value:r}}async function m(){try{let{value:e}=await a.v1.timelines.list.$select(c).list({limit:1,since_id:l.current}),n=e[0]?.id===l.current;return e?.length&&!n?(e=Zt(e,`home`),!0):!1}catch{return!1}}let[h,g]=I([]),[_,v]=I({title:`List`});he(_.title,`/l/:id`),y(()=>{(async()=>{try{v(await Di(c))}catch{}})()},[c]);let[b,x]=I(!1),[S,C]=I(!1);return L(i,{children:[L(tc,{title:_.title,id:`list`,emptyText:n({id:`KkDhfU`}),errorText:n({id:`7QSeK6`}),instance:o,fetchItems:p,checkForUpdates:m,useItemID:!0,boostsCarousel:r.settings.boostsCarousel,filterContext:`home`,showReplyParent:!0,headerStart:L(Gt,{overflow:`auto`,menuButton:L(`button`,{type:`button`,class:`plain`,children:[L(X,{icon:`list`,size:`l`,alt:n({id:`h16FyT`})}),L(X,{icon:`chevron-down`,size:`s`})]}),onMenuChange:e=>{e.open&&Ti().then(g)},children:[L(Mt,{to:`/l`,children:L(`span`,{children:L(j,{id:`BHWx-g`})})}),h?.length>0&&L(i,{children:[L(qe,{}),h.map(e=>L(Mt,{to:`/l/${e.id}`,children:L(`span`,{children:[e.title,e.exclusive&&L(i,{children:[` `,L(Mi,{})]})]})},e.id))]})]}),headerEnd:L(Gt,{portal:!0,setDownOverflow:!0,overflow:`auto`,viewScroll:`close`,position:`anchor`,menuButton:L(`button`,{type:`button`,class:`plain`,children:L(X,{icon:`more`,size:`l`,alt:n({id:`2FYpfJ`})})}),children:[_?.exclusive&&L(i,{children:[L(ft,{className:`plain`,children:[L(Mi,{}),` `,L(j,{id:`FNptcJ`})]}),L(qe,{})]}),L(Y,{onClick:()=>x({list:_}),children:[L(X,{icon:`pencil`,size:`l`}),L(`span`,{children:L(j,{id:`ePK91l`})})]}),L(Y,{onClick:()=>C(!0),children:[L(X,{icon:`group`,size:`l`}),L(`span`,{children:L(j,{id:`hB02vO`})})]})]})},c),b&&L(Ot,{onClick:e=>{e.target===e.currentTarget&&x(!1)},children:L(Ni,{list:b?.list,onClose:e=>{e.state===`success`&&e.list?v(e.list):e.state===`deleted`&&(location.hash=`/l`),x(!1)}})}),S&&L(Ot,{onClick:e=>{e.target===e.currentTarget&&C(!1)},children:L(wl,{listID:c,onClose:()=>C(!1)})})]})}var Cl=40;function wl({listID:e,onClose:n}){let{_:r}=d(),{masto:i,instance:a}=f(),[o,c]=I([]),[l,u]=I(`default`),[p,m]=I(!1),h=s();async function g(n){m(!1),u(`loading`),(async()=>{try{(n||!h.current)&&(h.current=i.v1.lists.$select(e).accounts.list({limit:Cl}).values());let{done:r,value:a}=await h.current.next();a?.length?(c(n?a:o.concat(a)),m(!r)):m(!1),u(`default`)}catch{u(`error`)}})()}return y(()=>{g(!0)},[]),L(`div`,{class:`sheet`,id:`list-manage-members-container`,children:[!!n&&L(`button`,{type:`button`,class:`sheet-close`,onClick:n,children:L(X,{icon:`x`,alt:r({id:`yz7wBu`})})}),L(`header`,{children:L(`h2`,{children:L(j,{id:`hB02vO`})})}),L(`main`,{children:L(`ul`,{children:[o.map(n=>L(`li`,{children:[L(rt,{account:n,instance:a}),L(Tl,{account:n,listID:e})]},n.id)),p&&l==="default"&&L(at,{as:`li`,onChange:e=>e&&g(),children:L(`button`,{type:`button`,class:`light block`,onClick:g,children:L(j,{id:`uXRAkV`})})})]})})]})}function Tl({account:e,listID:n}){let{_:r}=d(),{masto:i}=f(),[a,o]=I(`default`),[s,c]=I(!1);return L(xt,{confirm:!s,confirmLabel:L(`span`,{children:L(j,{id:`j5n9Ry`,values:{0:e.username},components:{0:L(`span`,{class:`bidi-isolate`})}})}),align:`end`,menuItemClassName:`danger`,onClick:()=>{s?(o(`loading`),(async()=>{try{await i.v1.lists.$select(n).accounts.create({accountIds:[e.id]}),o(`default`),c(!1)}catch{o(`error`)}})()):(o(`loading`),(async()=>{try{await i.v1.lists.$select(n).accounts.remove({accountIds:[e.id]}),o(`default`),c(!0)}catch{o(`error`)}})())},children:L(`button`,{type:`button`,class:`light ${s?``:`danger`}`,disabled:a===`loading`,children:r(s?{id:`m16xKo`}:{id:`MWIaew`})})})}var El={added_to_collection:[`sampleAccounts`,`collection`],collection_update:[`sampleAccounts`,`collection`]},Dl={mention:[`account`,`status`],quote:[`account`,`status`],status:[`account`,`status`],reblog:[`account`,`status`],follow:[`account`],follow_request:[`account`],favourite:[`account`,`status`],poll:[`status`],update:[`status`],added_to_collection:[`account`,`collection`],collection_update:[`account`,`collection`]},Ol=[`favourite`,`reblog`,`follow`,`admin.sign_up`],kl=e=>Ol.includes(e);function Al(e){return e.filter((n,r)=>{let{type:i}=n;if(!i)return!1;let a=El[i];return a?.length?a.every(e=>!!n[e]):i===`quote`&&n.statusId?e.findIndex(e=>e.type===`quote`&&e.statusId===n.statusId)===r:!0})}function jl(e){return e.filter(e=>{let{type:n,id:r,createdAt:i}=e;if(!n)return!1;let a=Dl[n];return a?.length?a.every(n=>!!e[n]):!0})}function Ml(e){if(e?.notificationGroups){let{accounts:n=[],notificationGroups:r=[],statuses:i=[]}=e;return r.map(e=>{let{sampleAccountIds:r,statusId:a}=e,o=r?.map(e=>n.find(n=>n.id===e))||[],s=i?.find(e=>e.id===a)||null;return{...e,sampleAccounts:o,status:s}})}return e}function Nl(e){e=Al(e);let n=e.map(e=>{let{latestPageNotificationAt:n,mostRecentNotificationId:r,sampleAccounts:i,notificationsCount:a}=e;return{id:``+r,createdAt:n,account:i[0],...e}}),r={},i=[];for(let e=0;e<n.length;e++){let a=n[e],{type:o,status:s,createdAt:c,notificationsCount:l,sampleAccounts:u,groupKey:d}=a,f=c?new Date(c).toLocaleDateString():``,p=o;!(l>0&&u?.length>0&&l>u?.length)&&(o===`favourite`||o===`reblog`)&&(p=`favourite+reblog`);let m=`${s?.id}-${p}-${f}`,h=r[m];if(!kl(o)){if((o===`mention`||o===`quote`)&&s?.id){let e=i.find(e=>(o===`quote`&&e.type===`mention`||o===`mention`&&e.type===`quote`)&&e.status?.id===s.id);if(e){e.type=`mention+quote`;continue}}i.push(a)}else if(h)u.forEach(e=>{let n=h.sampleAccounts.find(n=>n.id===e.id);n?(n._types.push(o),n._types.sort().reverse()):h.sampleAccounts.push({...e,_types:[o]})}),h.notificationsCount=Math.min(h.notificationsCount,l),h._notificationsCount.push(l),h._sampleAccountsCount.push(u?.length),h._accounts=h.sampleAccounts,d&&h._groupKeys.push(d);else{let e=u.map(e=>({...e,_types:[o]}));r[m]={...a,sampleAccounts:e,type:p,_accounts:e,_groupKeys:d?[d]:[],_notificationsCount:[l],_sampleAccountsCount:[u?.length]},i.push(r[m])}}let a={},o=[];for(let e=0;e<i.length;e++){let n=i[e],{type:r,account:s,_accounts:c,sampleAccounts:l,createdAt:u,groupKey:d}=n,f=u?new Date(u).toLocaleDateString():``,p=l?.length===1||c?.length===1;if((r===`favourite`||r===`reblog`||r===`favourite+reblog`)&&p){let e=`${s?.id}-${r}-${f}`,i=a[e];if(i)i._statuses.push(n.status),i._ids+=`-${n.id}`,i._groupKeys.push(d);else{let i=a[e]={...n,type:r,_ids:n.id,_statuses:[n.status],_groupKeys:d?[d]:[]};o.push(i)}}else o.push(n)}return o}function Pl(e){e=jl(e);let n={},r=[];for(let i=0,a=0;i<e.length;i++){let o=e[i],{id:s,status:c,account:l,type:u,createdAt:d}=o,f=d?new Date(d).toLocaleDateString():``,p=u;(u===`favourite`||u===`reblog`)&&(p=`favourite+reblog`);let m=`${c?.id}-${p}-${f}`,h=n[m];if(!kl(u))r[a++]=o;else if(h?.account){let e=h._accounts.find(e=>e.id===l.id);e?(e._types.push(u),e._types.sort().reverse(),h._ids+=`-${s}`):(l._types=[u],h._accounts.push(l),h._ids+=`-${s}`)}else{l&&(l._types=[u]);let e=n[m]={...o,type:p,_ids:s,_accounts:l?[l]:[]};r[a++]=e}}let i={},a=[];for(let e=0,n=0;e<r.length;e++){let o=r[e],{id:s,account:c,_accounts:l,type:u,createdAt:d}=o,f=d?new Date(d).toLocaleDateString():``;if(u===`favourite+reblog`&&c&&l.length===1){let e=`${c?.id}-${u}-${f}`,r=i[e];if(r)r._statuses.push(o.status),r._ids+=`-${s}`;else{let r=i[e]={...o,type:u,_ids:s,_statuses:[o.status]};a[n++]=r}}else a[n++]=o}return a}var Fl=20,Il=new URLSearchParams;function Ll({columnMode:e,...n}){let{_:r}=d(),{masto:a,instance:o}=f(),[c]=e?[Il]:oe(),[l,u]=I(null),p=n?.type||c.get(`type`)||l;he(r(p===`private`?{id:`2BApYc`}:{id:`_bZzdR`}),`/mentions`);let[m,h]=I(!1),_=s({}),v=s(),y=s();function b(e){if(!m||!e?.length)return e;let n=ee();return e.filter(e=>{let r=e.account?.id;return!r||r===n?!1:_.current[r]?.following===!0})}async function x(e){(e||!v.current)&&(v.current=a.v1.notifications.list({limit:Fl,types:[`mention`]}).values());let n=await v.current.next(),{value:r}=n;if(r?.length){r=jl(r),e&&(y.current=r[0].id),r.forEach(({status:e})=>{Me(e,o)});let i=r.map(e=>e.status);if(m&&i?.length){let e=await tt(i.map(e=>e.account),_.current);e&&(_.current={..._.current,...e}),i=b(i)}return{...n,value:i}}return{...n,value:r?.map(e=>e.status)}}let S=s(),C=s();async function w(e){(e||!S.current)&&(S.current=a.v1.conversations.list({limit:Fl}).values());let n=await S.current.next(),{value:r}=n;if(r=r?.filter(e=>e.lastStatus),r?.length){e&&(C.current=r[0].lastStatus.id),r.forEach(({lastStatus:e})=>{Me(e,o)});let i=r.map(e=>e.lastStatus);if(m&&i?.length){let e=await tt(i.map(e=>e.account),_.current);e&&(_.current={..._.current,...e}),i=b(i)}return{...n,value:i}}return{...n,value:r?.map(e=>e.lastStatus)}}function T(...e){return p===`private`?w(...e):x(...e)}async function E(){if(p===`private`)try{let{value:e}=await a.v1.conversations.list({limit:1,since_id:C.current}).values().next(),n=e[0]?.id===C.current;return e?.length&&!n?(C.current=e[0].lastStatus.id,!0):!1}catch{return!1}else try{let{value:e}=await a.v1.notifications.list({limit:1,types:[`mention`],since_id:y.current}).values().next();return e?.length?(y.current=e[0].id,!0):!1}catch{return!1}}let D=g(()=>L(i,{children:[L(`div`,{id:`followings-option`,children:L(`label`,{children:[L(`input`,{type:`checkbox`,checked:m,onChange:e=>{h(e.target.checked)}}),` `,L(j,{id:`h4JxWH`})]})}),L(`div`,{class:`filter-bar`,children:[L(Q,{to:`/mentions`,class:p?``:`is-active`,onClick:n=>{e&&(n.preventDefault(),u(null))},children:L(j,{id:`N40H-G`})}),L(Q,{to:`/mentions?type=private`,class:p===`private`?`is-active`:``,onClick:n=>{e&&(n.preventDefault(),u(`private`))},children:L(j,{id:`zwBp5t`})})]})]}),[p,m]);return L(tc,{title:r({id:`_bZzdR`}),id:`mentions`,emptyText:r({id:`03jFGT`}),errorText:r({id:`pqR9KF`}),instance:o,fetchItems:T,checkForUpdates:E,useItemID:!0,timelineStart:D,refresh:`${p}-${m}`,filterContext:`notifications`})}var Rl=80,zl=20,Bl=new URLSearchParams,Vl=[`mention`,`status`,`reblog`,`follow`,`follow_request`,`favourite`,`poll`,`update`,`admin.sign_up`,`admin.report`,`severed_relationships`,`moderation_warning`,`quote`,`quoted_update`,`added_to_collection`,`collection_update`],Hl={block:`start`,inline:`center`,behavior:`instant`},Ul=J(()=>p()?.mastodon>=2,{expires:1e3*60*5}),Wl=J(()=>p()?.mastodon>=10,{expires:1e3*60*5});function Gl(e={}){let{masto:n}=f(),r=Wl()?Vl:void 0;return Ul()?n.v2.notifications.list({limit:zl,supportedTypes:r,...e}):n.v1.notifications.list({limit:Rl,supportedTypes:r,...e})}function Kl(e={}){return Gl(e).values()}function ql(e){return Ul()?Nl(e):Pl(e)}var Jl=[`forNotFollowing`,`forNotFollowers`,`forNewAccounts`,`forPrivateMentions`,`forLimitedAccounts`,`forBots`],Yl={forNotFollowing:{id:`gBOf4F`},forNotFollowers:{id:`ULVw6q`},forNewAccounts:{id:`PdNgnE`},forPrivateMentions:{id:`S2vQN5`},forLimitedAccounts:{id:`3W4MYO`},forBots:{id:`9KK2rC`}};function Xl({columnMode:e}){let{_:n,_:r}=d();he(r({id:`iDNBZe`}),`/notifications`);let{masto:a,instance:o}=f(),c=W(k),[l,u]=I(`default`),[p]=e?[Bl]:oe(),m=p.get(`id`),h=p.get(`access_token`),[_,v]=I(!1),[b,S]=I(!1),[w,T]=I(!1),[E,ee]=I(!1),D=s(),{nearReachEnd:O,scrollDirection:A,reachStart:M,nearReachStart:N}=Ws({scrollableRef:D}),P=c.settings.autoHideBars&&A===`end`&&!N,[te,ne]=I([]),[R,z]=I([]),B=s(),V=s();async function re(n){if((n||!V.current)&&(B.current=Gl({excludeTypes:[`follow_request`]}),V.current=B.current.values()),/max_id=($|&)/i.test(V.current?.nextParams))return{done:!0};let r=await V.current.next(),i=Ml(r.value);if(i?.length){i.forEach(e=>{Me(e.status,o,{skipThreading:!0})});let r=ql(i);n?(k.notificationsLast=r[0],k.notifications=r,a.v1.markers.create({notifications:{lastReadId:r[0].id}}).catch(()=>{}),e||me(r)):k.notifications.push(...r)}return k.notificationsShowNew=!1,k.notificationsLastFetchTime=Date.now(),r}async function ie(){try{return await a.v1.followRequests.list({limit:80})}catch{return[]}}async function ae(){try{return await a.v1.announcements.list()}catch{return[]}}let H=ot(`@mastodon/filtered-notifications`),U=ot(`@mastodon/notification-bot-filter`),[se,ce]=I(!1),[le,G]=I({});function ue(){return a.v2.notifications.policy.fetch().catch(()=>{})}function K(){ue().then(e=>{G(e)}).catch(()=>{})}let[de,fe]=I(null);function pe(){return a.v1.notifications.requests.list()}let me=e=>{if(w)return;let n=e.length;e.reduce((e,n)=>e+(n.notificationsCount||1),0);let r=e.filter(e=>e.type===`mention`).length,i={},a={};e.forEach(e=>{let{createdAt:n,notificationsCount:r,type:o}=e,s=new Date(n).toDateString();a[s]=(a[s]||0)+(r||1),o===`mention`&&(i[s]=(i[s]||0)+1)});let o=(n>0?r/n:0)<.33,s=Object.values(i).some(e=>e>30),c=e.some(e=>e.notificationsCount>30),l={},u=!1;for(let n of e){let{createdAt:e,notificationsCount:r}=n,i=new Date(e).toISOString().slice(0,13);if(l[i]=(l[i]||0)+(r||1),l[i]>30){u=!0;break}}T(o||s||c||u),ee(Date.now())},ge=e=>{ve(!1),u(`loading`),(async()=>{try{let n=re(e);e&&(ae().then(e=>{e.sort((e,n)=>Date.parse(n.updatedAt||n.createdAt)-Date.parse(e.updatedAt||e.createdAt)),z(e)}).catch(()=>{}),ie().then(e=>{ne(e)}).catch(()=>{}),H&&K());let{done:r}=await n;v(!r),u(`default`)}catch{u(`error`)}})()};y(()=>{ge(!0)},[]),y(()=>{M&&ge(!0)},[M]);let[_e,ve]=I(!1),ye=x(({disableIdleCheck:e=!1}={})=>{l!==`loading`&&c.settings.autoRefresh&&D.current?.scrollTop<16&&(e||window.__IDLE__)&&!Zl()&&ge(!0)},[c.notificationsShowNew,c.settings.autoRefresh,l]),be=s();ln(e=>{if(e){let e=Date.now()-be.current;!be.current||e>1e3*3?ye({disableIdleCheck:!0}):be.current=Date.now()}});let xe=s(!0);y(()=>{let e=C(k,`notificationsShowNew`,e=>{if(xe.current){xe.current=!1;return}l!==`loading`&&(e&&ye(),ve(e))});return()=>e?.()},[]);let Se=new Date,Ce=new Date(Se-1440*60*1e3),we=new Date,Te=!c.notifications.some(e=>new Date(e.createdAt).toDateString()===Se.toDateString()),Ee=s();y(()=>{m&&(k.routeNotification={id:m,accessToken:atob(h)})},[m,h]);let[De,J]=I(null);y(async()=>{let e=new Date;if(e.getMonth()!==11)return;let n=e.getFullYear();if(!ot(`@mastodon/annual-report`))return;let r=F.account.get(`annualReportNotification`);if(r&&r?.annualReport?.year==n){J(r);return}let i=Kl({types:[`annual_report`]});try{r=(await i.next())?.value?.notificationGroups?.[0],r?.annualReport?.year==n&&(J(r),F.account.set(`annualReportNotification`,r))}catch{}},[]);let Oe=`.notification`,ke=nt(`j`,()=>{let e=document.activeElement.closest(Oe),n=e?.getBoundingClientRect(),r=Array.from(D.current.querySelectorAll(Oe));if(e&&n.top<D.current.clientHeight&&n.bottom>0){let n=r[r.indexOf(e)+1];n&&(n.focus(),n.scrollIntoView(Hl))}else{let e=r.find(e=>{let n=e.getBoundingClientRect();return n.top>=44&&n.left>=0});e&&(e.focus(),e.scrollIntoView(Hl))}},{useKey:!0,ignoreEventWhen:e=>e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.key.toLowerCase()!==`j`}),Ae=nt(`k`,()=>{let e=document.activeElement.closest(Oe),n=e?.getBoundingClientRect(),r=Array.from(D.current.querySelectorAll(Oe));if(e&&n.top<D.current.clientHeight&&n.bottom>0){let n=r[r.indexOf(e)-1];n&&(n.focus(),n.scrollIntoView(Hl))}else{let e=r.find(e=>{let n=e.getBoundingClientRect();return n.top>=44&&n.left>=0});e&&(e.focus(),e.scrollIntoView(Hl))}},{useKey:!0,ignoreEventWhen:e=>e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.key.toLowerCase()!==`k`}),je=nt([`enter`,`o`],()=>{let e=document.activeElement.closest(Oe)?.querySelector(`.status-link`);e&&e.click()},{useKey:!0,ignoreEventWhen:e=>e.key===`Enter`?!1:e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.key.toLowerCase()!==`o`}),Ne=nt(`.`,()=>{ge(!0),D.current?.scrollTo({top:0,behavior:`smooth`})},{useKey:!0,ignoreEventWhen:e=>e.key===`.`?!1:e.metaKey||e.ctrlKey||e.altKey||e.shiftKey}),Pe=new Date,Fe=g(()=>Jt(Pe,{forceOpts:{weekday:`long`}}),[Pe]);return L(`div`,{id:`notifications-page`,class:`deck-container`,ref:e=>{D.current=e,ke.current=e,Ae.current=e,je.current=e,Ne.current=e},tabIndex:`-1`,children:[L(`div`,{class:`timeline-deck deck ${b?`only-mentions`:``}`,children:[L(`header`,{hidden:P,onClick:e=>{e.target.closest(`a, button`)||D.current?.scrollTo({top:0,behavior:`smooth`})},onDblClick:e=>{e.target.closest(`a, button`)||ge(!0)},class:l===`loading`?`loading`:``,children:[L(`div`,{class:`header-grid`,children:[L(`div`,{class:`header-side`,children:[L(Ns,{}),L(Q,{to:`/`,class:`button plain`,children:L(X,{icon:`home`,size:`l`,alt:r({id:`i0qMbr`})})})]}),L(`h1`,{children:L(j,{id:`iDNBZe`})}),L(`div`,{class:`header-side`,children:H&&L(`button`,{type:`button`,class:`button plain4`,onClick:()=>{ce(!0)},children:L(X,{icon:`settings`,size:`l`,alt:r({id:`a_-arl`})})})})]}),_e&&l!==`loading`&&L(`button`,{class:`updates-button shiny-pill`,type:`button`,onClick:()=>{ge(!0),D.current?.scrollTo({top:0,behavior:`smooth`})},children:[L(X,{icon:`arrow-up`}),` `,L(j,{id:`Jy9RU_`})]})]}),R.length>0&&L(`div`,{class:`shazam-container`,children:L(`div`,{class:`shazam-container-inner`,children:L(`details`,{class:`announcements`,children:[L(`summary`,{children:[L(`span`,{children:[L(X,{icon:`announce`,class:`announcement-icon`,size:`l`}),` `,L(j,{id:`0whvLM`,values:{0:R.length}}),` `,L(`small`,{class:`insignificant`,children:o})]}),R.length>1&&L(`span`,{class:`announcements-nav-buttons`,children:R.map((e,n)=>L(`button`,{type:`button`,class:`plain2 small`,onClick:()=>{Ee.current?.children[n].scrollIntoView({behavior:`smooth`,block:`nearest`})},children:n+1}))})]}),L(`ul`,{class:`announcements-list-${R.length>1?`multiple`:`single`}`,ref:Ee,children:R.map(e=>L(`li`,{children:L(Ql,{announcement:e})}))})]})})}),te.length>0&&L(`div`,{class:`follow-requests`,children:[L(`h2`,{class:`timeline-header`,children:L(j,{id:`6Fs1Ba`})}),te.length>5?L(`details`,{children:[L(`summary`,{children:L(j,{id:`7dHKu4`,values:{0:te.length}})}),L(`ul`,{children:te.map(e=>L(`li`,{children:[L(rt,{account:e}),L(cs,{accountID:e.id,onChange:()=>{}})]},e.id))})]}):L(`ul`,{children:te.map(e=>L(`li`,{children:[L(rt,{account:e}),L(cs,{accountID:e.id,onChange:()=>{}})]},e.id))})]}),H&&le?.summary?.pendingRequestsCount>0&&L(`div`,{class:`shazam-container`,children:L(`div`,{class:`shazam-container-inner`,children:L(`div`,{class:`filtered-notifications`,children:L(`details`,{onToggle:async e=>{let{open:n}=e.target;n&&fe(await pe())},children:[L(`summary`,{children:L(j,{id:`N3Bq0f`,values:{0:le.summary.pendingRequestsCount}})}),de?de?.length>0&&L(`ul`,{children:de.map(e=>L(`li`,{children:[L(`div`,{class:`request-notifcations`,children:[!e.lastStatus?.id&&L(rt,{useAvatarStatic:!0,showStats:!0,account:e.account}),e.lastStatus?.id&&L(`div`,{class:`last-post`,children:L(Q,{class:`status-link`,to:`/${o}/s/${e.lastStatus.id}`,children:L(Ut,{status:e.lastStatus,size:`s`,readOnly:!0})})}),L(eu,{request:e})]}),L(tu,{request:e,onChange:()=>{ge(!0)}})]},e.id))}):L(`p`,{class:`ui-state`,children:L(q,{abrupt:!0})})]})})})}),De&&L(`div`,{class:`shazam-container`,children:L(`div`,{class:`shazam-container-inner`,children:L(_s,{notification:De})})}),!!E&&L(`div`,{id:`mentions-option`,children:w?L(Q,{to:`/mentions`,class:`button plain`,children:[L(X,{icon:`at`}),` `,L(`span`,{children:L(j,{id:`_bZzdR`})}),` `,L(X,{icon:`arrow-right`,class:`more-insignificant`})]}):L(`label`,{children:[L(`input`,{type:`checkbox`,checked:b,onChange:e=>{S(e.target.checked)}}),` `,L(j,{id:`0udtPI`})]})}),L(`h2`,{class:`timeline-header`,children:[L(j,{id:`ecUA8p`}),` `,L(`small`,{class:`insignificant bidi-isolate`,children:Fe})]}),Te&&L(`p`,{class:`ui-state insignificant`,children:l==="default"?r({id:`KS7iJH`}):L(i,{children:`…`})}),c.notifications.length?L(He.Provider,{value:`notifications`,children:c.notifications.filter(e=>e.type!==`follow_request`).map(e=>{if(b&&e.type!==`mention`)return null;let n=new Date(e.createdAt),a=n.toDateString()!==we.toDateString();a&&(we=n);let s=n.toDateString()===Ce.toDateString()?r({id:`y_0uwd`}):Jt(we,{hideTime:!0}),c=Jt(we,{forceOpts:{weekday:`long`}});return L(i,{children:[a&&L(`h2`,{class:`timeline-header`,children:[L(`span`,{children:s}),` `,L(`small`,{class:`insignificant bidi-isolate`,children:c})]}),L(_s,{instance:o,notification:e},e._ids||e.id)]},e._ids||e.id)})}):L(i,{children:[l===`loading`&&L(i,{children:L(`ul`,{class:`timeline flat`,children:Array.from({length:5}).map((e,n)=>L(`li`,{class:`notification skeleton`,children:[L(`div`,{class:`notification-type`,children:L(X,{icon:`notification`,size:`xl`})}),L(`div`,{class:`notification-content`,children:L(`p`,{children:`███████████ ████`})})]}))})}),l===`error`&&L(`p`,{class:`ui-state`,children:[L(j,{id:`gjzl8E`}),L(`br`,{}),L(`br`,{}),L(`button`,{type:`button`,onClick:()=>ge(!0),children:L(j,{id:`KDw4GX`})})]})]}),_&&L(at,{onChange:e=>{e&&ge()},children:L(`button`,{type:`button`,class:`plain block`,disabled:l===`loading`,onClick:()=>ge(),style:{marginBlockEnd:`6em`},children:l===`loading`?L(q,{abrupt:!0}):L(j,{id:`uXRAkV`})})})]}),H&&se&&L(Ot,{onClick:e=>{e.target===e.currentTarget&&ce(!1)},children:L(`div`,{class:`sheet`,id:`notifications-settings`,tabIndex:`-1`,children:[L(`button`,{type:`button`,class:`sheet-close`,onClick:()=>ce(!1),children:L(X,{icon:`x`,alt:r({id:`yz7wBu`})})}),L(`header`,{children:L(`h2`,{children:L(j,{id:`a_-arl`})})}),L(`main`,{children:L(`form`,{onSubmit:e=>{e.preventDefault();let{forNotFollowing:n,forNotFollowers:i,forNewAccounts:o,forPrivateMentions:s,forLimitedAccounts:c,forBots:l}=e.target,u={...le,forNotFollowing:n.value,forNotFollowers:i.value,forNewAccounts:o.value,forPrivateMentions:s.value,forLimitedAccounts:c.value};U&&(u.forBots=l?.value),G(u),ce(!1),(async()=>{try{await a.v2.notifications.policy.update(u),Z(r({id:`4-7X9i`}))}catch{}})()},children:[L(`p`,{children:L(j,{id:`J4ONfI`})}),L(`div`,{class:`notification-policy-fields`,children:Jl.filter(e=>e!==`forBots`||U).map(e=>{let r=le[e];return L(`div`,{children:L(`label`,{children:[n(Yl[e]),L(`select`,{name:e,defaultValue:r,class:`small`,children:[L(`option`,{value:`accept`,children:L(j,{id:`g3UF2V`})}),L(`option`,{value:`filter`,children:L(j,{id:`o7J4JM`})}),L(`option`,{value:`drop`,children:L(j,{id:`gbbkE7`})})]})]})},e)})}),L(`p`,{children:L(`button`,{type:`submit`,children:L(j,{id:`tfDRzk`})})})]})})]})})]})}function Zl(){return!!document.querySelector(`.deck-backdrop, #modal-container > *`)}function Ql({announcement:e}){let{instance:n}=f(),{contact:r}=H(),a=r?.account,{id:o,content:s,startsAt:c,endsAt:l,published:u,allDay:d,publishedAt:p,updatedAt:m,read:h,mentions:g,statuses:_,tags:v,emojis:y,reactions:b}=e,x=new Date(p),S=Jt(x),C=new Date(m),w=Jt(C);return L(`div`,{class:`announcement-block`,children:[L(rt,{account:a}),L(`div`,{class:`announcement-content`,onClick:Ze({mentions:g,instance:n}),dangerouslySetInnerHTML:{__html:ct(s,{emojis:y})}}),L(`p`,{class:`insignificant`,children:[L(`time`,{datetime:x.toISOString(),children:Jt(x)}),m&&w!==S&&L(i,{children:[` `,`•`,` `,L(`span`,{class:`ib`,children:L(j,{id:`TbFrLc`,values:{0:Jt(C)},components:{0:L(`time`,{datetime:C.toISOString()})}})})]})]}),L(`div`,{class:`announcement-reactions`,hidden:!0,children:b.map(e=>{let{name:n,count:r,me:i,staticUrl:a,url:o}=e;return L(`button`,{type:`button`,class:`plain4 small ${i?`reacted`:``}`,children:[o||a?L(`img`,{src:o||a,alt:n,width:`16`,height:`16`}):L(`span`,{children:n}),` `,L(`span`,{class:`count`,children:Je(r)})]})})})]})}function $l(e){let{masto:n}=f();return n.v1.notifications.list({accountID:e})}function eu({request:e}){let{instance:n}=f(),[r,a]=I(`loading`),{account:o,lastStatus:s}=e,[c,l]=I(!1),[u,d]=I([]);function p(){l(!1)}return y(()=>{e?.account?.id&&c&&(a(`loading`),(async()=>{d(await $l(e.account.id)||[]),a(`default`)})())},[c,e?.account?.id]),L(i,{children:[L(`button`,{type:`button`,class:`plain4 request-notifications-account`,onClick:()=>{l(!0)},children:[L(X,{icon:`notification`,class:`more-insignificant`}),` `,L(`small`,{children:L(j,{id:`H0wUNM`,values:{0:o.username},components:{0:L(`span`,{class:`bidi-isolate`})}})}),` `,L(X,{icon:`chevron-down`})]}),c&&L(Ot,{onClick:e=>{e.target===e.currentTarget&&p()},children:L(`div`,{class:`sheet`,tabIndex:`-1`,children:[L(`button`,{type:`button`,class:`sheet-close`,onClick:p,children:L(X,{icon:`x`,alt:t`Close`})}),L(`header`,{children:L(`b`,{children:L(j,{id:`MXOmPt`,values:{0:o.username},components:{0:L(`span`,{class:`bidi-isolate`})}})})}),L(`main`,{children:r===`loading`?L(`p`,{class:`ui-state`,children:L(q,{abrupt:!0})}):u.map(e=>L(`div`,{class:`notification-peek`,onClick:e=>{let{target:n}=e;(e.target.tagName===`BUTTON`||e.target.tagName===`A`)&&p()},children:L(_s,{instance:n,notification:e,isStatic:!0})}))})]})})]})}function tu({request:e,onChange:n}){let{_:r}=d(),{masto:i}=f(),[a,o]=I(`default`),[s,c]=I(null),l=s!==null;return L(`p`,{class:`notification-request-buttons`,children:[L(`button`,{type:`button`,disabled:a===`loading`||l,onClick:()=>{Qt.trigger(`success`),o(`loading`),(async()=>{try{await i.v1.notifications.requests.$select(e.id).accept(),c(`accept`),o(`default`),n({request:e,state:`accept`}),Z(r({id:`ZtBMwU`,values:{0:e.account.username}}))}catch{o(`error`),Z(r({id:`S92JKG`}))}})()},children:L(j,{id:`h7peZQ`})}),` `,L(`button`,{type:`button`,disabled:a===`loading`||l,class:`light danger`,onClick:()=>{Qt.trigger(`light`),o(`loading`),(async()=>{try{await i.v1.notifications.requests.$select(e.id).dismiss(),c(`dismiss`),o(`default`),n({request:e,state:`dismiss`}),Z(r({id:`ibBDry`,values:{0:e.account.username}}))}catch{o(`error`),Z(r({id:`S5aemF`}))}})()},children:L(j,{id:`1QfxQT`})}),L(`span`,{class:`notification-request-states`,children:a===`loading`?L(q,{abrupt:!0}):s===`accept`?L(X,{icon:`check-circle`,alt:r({id:`bzMKg7`}),class:`notification-accepted`}):s===`dismiss`&&L(X,{icon:`x-circle`,alt:r({id:`J6hrEy`}),class:`notification-dismissed`})})]})}var nu=K(Xl),ru=20;function iu({local:e,columnMode:n,...r}){let{_:a}=d(),o=W(k),c=!!e,l=n?{}:A(),{masto:u,authenticated:p,instance:m}=f({instance:r?.instance||l.instance}),{instance:h}=f(),g=a(c?{id:`u96B_B`,values:{instance:m}}:{id:`PgVqvd`,values:{instance:m}});he(g,c?`/:instance?/p/l`:`/:instance?/p`);let _=s(),[v,y]=I(null),b=v===`disabled`,x=v===`authenticated`&&!p,S=s();async function C(e){if(e||!S.current){let e=await _l({feed:`liveFeeds`,feedType:c?`local`:`remote`,instance:m});if(y(e),e===`disabled`||e===`authenticated`&&!p)return{done:!0,value:[]};let n={limit:ru,local:c||void 0};!c&&ot(`@pixelfed/global-feed`)&&(n.remote=!0),S.current=u.v1.timelines.public.list(n).values()}let n=await S.current.next(),{value:r}=n;return r?.length&&(e&&(_.current=r[0].id),r.forEach(e=>{Me(e,m)})),{...n,value:r}}async function w(){if(b||x)return!1;try{let{value:e}=await u.v1.timelines.public.list({limit:1,local:c,since_id:_.current}).values().next(),n=e[0]?.id===_.current;return e?.length&&!n?(e=Zt(e,`public`),!0):!1}catch{return!1}}return L(tc,{title:g,titleComponent:L(`h1`,{class:`header-double-lines`,children:[L(`b`,{children:a(c?{id:`pJQgQV`}:{id:`cg0I-x`})}),L(`div`,{children:m})]}),id:`public`,instance:m,emptyText:a(b?{id:`qbE_m4`}:x?{id:`aqJggz`}:{id:`BiZJ6G`}),errorText:a({id:`scd9lw`}),fetchItems:C,checkForUpdates:w,useItemID:!0,headerStart:L(i,{}),boostsCarousel:o.settings.boostsCarousel,filterContext:`public`,headerEnd:L(Gt,{portal:!0,overflow:`auto`,viewScroll:`close`,position:`anchor`,menuButton:L(`button`,{type:`button`,class:`plain`,children:L(X,{icon:`more`,size:`l`,alt:a({id:`2FYpfJ`})})}),children:[L(Y,{href:c?`/#/${m}/p`:`/#/${m}/p/l`,children:c?L(i,{children:[L(X,{icon:`transfer`}),` `,L(`span`,{children:L(j,{id:`dXMiUw`})})]}):L(i,{children:[L(X,{icon:`transfer`}),` `,L(`span`,{children:L(j,{id:`t2B_we`})})]})}),L(qe,{}),L(Y,{onClick:()=>{let e=prompt(a({id:`4CZnNE`}));if(!/\./.test(e)){e&&alert(a({id:`Q5COHO`}));return}e&&(e=e.toLowerCase().trim(),location.hash=c?`/${e}/p/l`:`/${e}/p`)},children:[L(X,{icon:`bus`}),` `,L(`span`,{children:L(j,{id:`kesYbo`})})]}),h!==m&&L(Y,{onClick:()=>{location.hash=c?`/${h}/p/l`:`/${h}/p`},children:[L(X,{icon:`bus`}),` `,L(`small`,{class:`menu-double-lines`,children:L(j,{id:`_AfxaA`,values:{currentInstance:h},components:{0:L(`b`,{})}})})]})]})},m+c)}function au({onItemClick:e}){let{_:n}=d(),{instance:r}=f(),[,i]=m(e=>e+1,0),a=ys(),o=()=>{Cs(),Z({text:n({id:`hgPsUe`}),delay:1e3}),i()},s=(e,n)=>{Ss(e,n),i()},[c]=lr();return a.length===0?null:L(`div`,{class:`recent-searches`,children:[L(`div`,{class:`recent-searches-header`,children:[L(X,{icon:`history`}),` `,L(`span`,{children:L(j,{id:`4R1B1H`})}),L(`span`,{class:`spacer`}),L(`button`,{type:`button`,class:`plain4 small`,onClick:o,disabled:a.length<=0,children:L(`span`,{children:L(j,{id:`yYxB17`})})})]}),L(`ul`,{class:`link-list recent-searches-list`,ref:c,children:a.map(i=>{let{label:a,to:o,icon:c}=ws(i.query,i.queryType,r);return L(`li`,{class:`recent-searches-item`,children:[L(Q,{to:o,class:`recent-searches-link`,onClick:n=>{xs(i.query,i.queryType),e?.(n)},children:[L(X,{icon:c,class:`more-insignificant`}),L(`span`,{class:`recent-searches-label`,children:a})]}),L(`button`,{type:`button`,class:`plain4 small`,onClick:()=>s(i.query,i.queryType),children:L(X,{icon:`trash`,alt:n({id:`xCJdfg`})})})]},`${i.query}-${i.queryType}-${i.timestamp}`)})})]})}var ou=5,su=40,cu=new URLSearchParams,lu={block:`start`,inline:`center`,behavior:`instant`};function uu({columnMode:e,...n}){let{_:r}=d(),{masto:a,instance:o,authenticated:c}=f({instance:(e?{}:A()).instance}),[l,u]=I(`default`),[p]=e?[cu]:oe(),m=s(),h=n?.query||p.get(`q`),_=e?`statuses`:n?.type||p.get(`type`),v=r({id:`A1taO8`});if(h)switch(_){case`statuses`:v=r({id:`6YeoAt`,values:{q:h}});break;case`accounts`:v=r({id:`fpgumQ`,values:{q:h}});break;case`hashtags`:v=r({id:`AuiMZZ`,values:{q:h}});break;default:v=r({id:`wr3GZI`,values:{q:h}})}he(v,`/search`);let[b,x]=I(!1),S=s(0),C=s(0);y(()=>{S.current=0},[h,_]);let w=s();N(()=>{w.current?.scrollTo?.(0,0)},[h,_]);let[T,E]=I([]),[ee,D]=I([]),[O,k]=I([]),[M,P]=I([]);y(()=>{E([]),D([]),k([]),P([])},[h]);let te={statuses:T,accounts:ee,hashtags:O,collections:M},F={statuses:E,accounts:D,hashtags:k,collections:P},[ne,R]=I({}),z=async e=>{if(!e?.length)return;let n=await tt(e,ne);n&&R(e=>({...e,...n}))},B=g(()=>[{key:`accounts`,label:r({id:`bPwFdf`}),seeMoreLabel:r({id:`BMmtZ8`}),emptyLabel:r({id:`YYB61U`}),listClass:`timeline flat accounts-list`,results:ee,renderItem:e=>L(`li`,{children:L(rt,{account:e,instance:o,showStats:!0,relationship:ne[e.id]})},e.id)},{key:`hashtags`,label:r({id:`VwUsHI`}),seeMoreLabel:r({id:`Nc_W5J`}),emptyLabel:r({id:`4MFM3P`}),listClass:`link-list hashtag-list`,results:O,renderItem:e=>{let{name:n,history:r}=e,i=r?.reduce?.((e,n)=>e+ +n.uses,0);return L(`li`,{children:L(Q,{to:o?`/${o}/t/${n}`:`/t/${n}`,children:[L(X,{icon:`hashtag`,alt:`#`}),L(`span`,{children:n}),!!i&&L(`span`,{class:`count`,children:Je(i)})]})},n)}},{key:`collections`,label:r({id:`DoJzLz`}),emptyLabel:null,listClass:`collections-list`,results:M,renderItem:e=>L(`li`,{children:L(Rt,{collection:e,instance:o,size:`l`})},e.id)},{key:`statuses`,label:r({id:`-owNNn`}),seeMoreLabel:r({id:`LYCgej`}),emptyLabel:r({id:`Hzi9AA`}),listClass:`timeline`,results:T,renderItem:e=>L(`li`,{children:L(Q,{class:`status-link`,to:o?`/${o}/s/${e.id}`:`/s/${e.id}`,children:L(Ut,{status:e})})},e.id)}].filter(e=>!_||e.key===_).filter(e=>e.key!==`collections`||e.results.length>0).sort((e,n)=>_?0:e.results.length>0&&n.results.length===0?-1:+(e.results.length===0&&n.results.length>0)),[_,ee,O,M,T,o,ne]);function V(e){if(e&&(S.current=0),!e&&!c)return;u(`loading`),e&&!_&&(E(T.slice(0,ou)),D(ee.slice(0,ou)),k(O.slice(0,ou)),P(M.slice(0,ou)));let n=++C.current;(async()=>{let r={q:h,resolve:c,limit:ou};_&&(r.limit=su,r.type=_,c&&(r.offset=S.current));try{let i=await a.v2.search.list(r);if(C.current!==n)return;if(_)if(e){F[_](i[_]);let e=i[_]?.length;S.current=su,x(!!e)}else if(i[_]?.[0]?.id===te[_]?.[0]?.id)x(!1);else{F[_](e=>[...e,...i[_]]);let e=i[_]?.length;S.current+=su,x(!!e)}else E(i.statuses||[]),D(i.accounts||[]),k(i.hashtags||[]),P(i.collections||[]),S.current=0,x(!1);z(i.accounts),u(`default`)}catch{if(C.current!==n)return;u(`error`)}})()}let re=s();ln(e=>{let n=w.current?.scrollTop===0;if(e&&n){let e=Date.now()-re.current;!re.current||e>1e3*3?V(!0):re.current=Date.now()}}),y(()=>{let e;return m.current?.setValue?.(h||``),h?V(!0):e=setTimeout(()=>{m.current?.focus?.()},150),()=>clearTimeout(e)},[h,_,o]),nt([`Slash`,`/`],e=>{m.current?.focus?.(),m.current?.select?.()},{useKey:!0,preventDefault:!0,ignoreEventWhen:e=>e.key===`/`?!1:e.metaKey||e.ctrlKey||e.altKey||e.shiftKey});let ie=`.timeline > li > a, .hashtag-list > li > a, .collections-list > li > a`,ae=nt(`j`,()=>{let e=document.activeElement.closest(ie),n=e?.getBoundingClientRect(),r=Array.from(w.current.querySelectorAll(ie));if(e&&n.top<w.current.clientHeight&&n.bottom>0){let n=r[r.indexOf(e)+1];n&&(n.focus(),n.scrollIntoView(lu))}else{let e=r.find(e=>{let n=e.getBoundingClientRect();return n.top>=44&&n.left>=0});e&&(e.focus(),e.scrollIntoView(lu))}},{useKey:!0,ignoreEventWhen:e=>e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.key.toLowerCase()!==`j`}),H=nt(`k`,()=>{let e=document.activeElement.closest(ie),n=e?.getBoundingClientRect(),r=Array.from(w.current.querySelectorAll(ie));if(e&&n.top<w.current.clientHeight&&n.bottom>0){let n=r[r.indexOf(e)-1];n&&(n.focus(),n.scrollIntoView(lu))}else{let e=r.find(e=>{let n=e.getBoundingClientRect();return n.top>=44&&n.left>=0});e&&(e.focus(),e.scrollIntoView(lu))}},{useKey:!0,ignoreEventWhen:e=>e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.key.toLowerCase()!==`k`}),[U]=lr();return L(`div`,{id:`search-page`,class:`deck-container`,tabIndex:`-1`,ref:e=>{w.current=e,ae.current=e,H.current=e},children:L(`div`,{class:`timeline-deck deck`,children:[L(`header`,{class:l===`loading`?`loading`:``,children:L(`div`,{class:`header-grid`,children:[L(`div`,{class:`header-side`,children:L(Ns,{})}),L(Ts,{ref:m}),L(`div`,{class:`header-side`,children:L(`button`,{type:`button`,class:`plain`,onClick:()=>{V(!0)},disabled:l===`loading`,children:L(X,{icon:`search`,size:`l`,alt:r({id:`A1taO8`})})})})]})}),L(`main`,{children:[!!h&&!e&&L(`div`,{ref:U,class:`filter-bar ${l===`loading`?`loading`:``}`,children:[!!_&&L(Q,{to:`/search${h?`?q=${encodeURIComponent(h)}`:``}`,children:[L(X,{icon:`chevron-left`}),` `,L(j,{id:`N40H-G`})]}),[{label:r({id:`bPwFdf`}),type:`accounts`,to:`/search?q=${encodeURIComponent(h)}&type=accounts`},{label:r({id:`VwUsHI`}),type:`hashtags`,to:`/search?q=${encodeURIComponent(h)}&type=hashtags`},{label:r({id:`-owNNn`}),type:`statuses`,to:`/search?q=${encodeURIComponent(h)}&type=statuses`}].sort((e,n)=>e.type===_?-1:+(n.type===_)).map(e=>L(Q,{to:e.to,children:e.label},e.type))]}),h?L(i,{children:[B.map(e=>L(i,{children:[!_&&L(`h2`,{class:`timeline-header`,children:[e.label,` `,e.seeMoreLabel&&L(Q,{to:`/search?q=${encodeURIComponent(h)}&type=${e.key}`,children:L(X,{icon:`arrow-right`,size:`l`,alt:r({id:`V1fa9u`})})})]}),e.results.length>0?L(i,{children:[L(`ul`,{class:e.listClass,children:e.results.map(e.renderItem)}),!_&&e.seeMoreLabel&&L(`div`,{class:`ui-state`,children:L(Q,{class:`plain button`,to:`/search?q=${encodeURIComponent(h)}&type=${e.key}`,children:[e.seeMoreLabel,` `,L(X,{icon:`arrow-right`})]})})]}):!_&&e.emptyLabel&&(l===`loading`?L(`p`,{class:`ui-state`,children:L(q,{abrupt:!0})}):L(`p`,{class:`ui-state`,children:e.emptyLabel}))]},e.key)),!!_&&(l==="default"?b?L(at,{onChange:e=>{e&&V()},children:L(`button`,{type:`button`,class:`plain block`,onClick:()=>V(),style:{marginBlockEnd:`6em`},children:L(j,{id:`uXRAkV`})})}):L(`p`,{class:`ui-state insignificant`,children:L(j,{id:`2EYeAZ`})}):l===`loading`&&L(`p`,{class:`ui-state`,children:L(q,{abrupt:!0})}))]}):l===`loading`?L(`p`,{class:`ui-state`,children:L(q,{abrupt:!0})}):L(i,{children:[L(`p`,{class:`ui-state insignificant`,children:L(j,{id:`fGn1Hk`})}),L(au,{})]})]})]})})}var du=20,fu=600*1e3,pu=a(e=>e.v1.trends.links.list().values().next(),{expires:fu}),mu=a(e=>e.v1.trends.tags.list().values().next(),{expires:fu});function hu(e){return ot(`@pixelfed/trending`)?e.pixelfed.v2.discover.posts.trending.list({range:`daily`}).values():e.v1.trends.statuses.list({limit:du}).values()}function gu(e,n){return e.v1.timelines.link.list(n).values()}function _u({columnMode:e,...n}){let{_:r}=d(),a=W(k),o=e?{}:A(),{masto:c,instance:l,authenticated:p}=f({instance:n?.instance||o.instance}),{masto:m,instance:h}=f(),_=r({id:`cI3UEs`,values:{instance:l}});he(_,`/:instance?/trending`);let v=s(),b=l===h,[x,S]=I([]),[C,w]=I([]),T=s();async function E(e){if(e||!T.current){if(T.current=hu(c),ot(`@mastodon/trending-hashtags`))try{let{value:e}=await mu(c);e?.length&&S(e)}catch{}if(ot(`@mastodon/trending-links`))try{let{value:e}=await pu(c,l),n=e?.filter?.(e=>e.type===`link`);n?.length&&w(n)}catch{}}let n=await T.current.next(),{value:r}=n;return r?.length&&(e&&(v.current=r[0].id),r.forEach(e=>{Me(e,l)})),{...n,value:r}}let[ee,D]=I(!1),O=s(),[M,N]=I(null),P=!!M,te=s(),F=b&&ot(`@mastodon/trending-link-posts`);y(()=>{M&&te.current&&te.current.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})},[M]);let ne=s();async function R(e){(e||!O.current)&&(D(!0),O.current=gu(c,{url:M})),ne.current=M;let n=await O.current.next(),{value:r}=n;return r?.length&&(r=Zt(r,`public`),r.forEach(e=>{Me(e,l)})),ne.current===M&&D(!1),{...n,value:r}}async function z(){try{let{value:e}=await c.v1.trends.statuses.list({limit:1}).values().next();return e=Zt(e,`public`),e?.length&&e[0].id!==v.current?(v.current=e[0].id,!0):!1}catch{return!1}}let B=g(()=>L(i,{children:[!!x.length&&L(`div`,{class:`filter-bar expandable`,children:[L(X,{icon:`chart`,class:`insignificant`,size:`l`}),x.map((e,n)=>{let{name:r,history:i}=e,a=i.reduce((e,n)=>e+ +n.uses,0);return L(Q,{to:`/${l}/t/${r}`,children:[L(`span`,{dir:`auto`,children:[L(`span`,{class:`more-insignificant`,children:`#`}),r]}),L(`span`,{class:`filter-count`,children:Je(a)})]},r)})]}),!!C.length&&L(`div`,{class:`links-bar`,children:[L(`header`,{children:L(`h3`,{children:L(j,{id:`9veeTb`})})}),C.map(e=>{let{authors:n,authorName:r,authorUrl:a,blurhash:o,description:s,height:c,image:l,imageDescription:d,language:f,providerName:p,providerUrl:m,publishedAt:h,title:g,url:_,width:v}=e,y=n?.[0]?.account?.id?n[0].account:null,b=g.length<30,x=!!(r||y),S=u(_),C;if(o){let e=Ca(St(o));C=ya([.6,e[1],e[2]])}return L(`div`,{children:[L(`a`,{ref:M===_?te:null,href:_,target:`_blank`,rel:`noopener`,class:`link-block ${P?M===_?`active`:`inactive`:``}`,style:C?{"--accent-color":`rgb(${C.join(`,`)})`,"--accent-alpha-color":`rgba(${C.join(`,`)}, 0.4)`}:{},children:L(`article`,{children:[L(`figure`,{children:L(`img`,{src:l,alt:d,width:v,height:c,loading:`lazy`})}),L(`div`,{class:`article-body`,children:[L(`header`,{children:[L(`div`,{class:`article-meta`,children:[L(`span`,{class:`domain`,children:S}),` `,!!h&&L(i,{children:`· `}),!!h&&L(i,{children:L(Wt,{datetime:h,format:`micro`})})]}),!!g&&L(`h1`,{class:`title`,lang:f,dir:`auto`,title:g,children:g})]}),!!s&&L(`p`,{class:`description ${x&&!b?``:`more-lines`}`,lang:f,dir:`auto`,title:s,children:s}),x&&L(i,{children:[L(`hr`,{}),L(`p`,{class:`byline`,children:L(`small`,{children:L(j,{id:`aavdrC`,values:{0:y?L(ht,{account:y,showAvatar:!0}):a?L(`a`,{href:a,target:`_blank`,rel:`noopener`,children:r}):r}})})})]})]})]})}),F&&L(`button`,{type:`button`,class:`small plain4 block`,onClick:()=>{N(_)},disabled:_===M,children:[L(X,{icon:`comment2`}),` `,L(`span`,{children:L(j,{id:`_bZzdR`})}),` `,L(X,{icon:`chevron-down`})]})]},_)})]}),F&&!!C.length&&L(`div`,{class:`timeline-header-block ${P?`blended`:``}`,children:P?L(i,{children:[L(`div`,{style:{width:50,flexShrink:0,textAlign:`center`},children:ee?L(q,{abrupt:!0}):L(`button`,{type:`button`,class:`light`,onClick:()=>{N(null)},children:L(X,{icon:`x`,alt:r({id:`9Q_4xJ`})})})}),L(`p`,{children:L(j,{id:`BATCqf`,values:{0:M.replace(/^https?:\/\/(www\.)?/i,``).replace(/\/$/,``)},components:{0:L(`span`,{class:`link-text`})}})})]}):L(`p`,{class:`insignificant`,children:L(j,{id:`Vosm4k`})})})]}),[x,C,M,ee]);return L(tc,{title:_,titleComponent:L(`h1`,{class:`header-double-lines`,children:[L(`b`,{children:L(j,{id:`4_iCqx`})}),L(`div`,{children:l})]}),id:`trending`,instance:l,emptyText:r({id:`6HA9-s`}),errorText:r({id:`scd9lw`}),fetchItems:P?R:E,checkForUpdates:P?void 0:z,checkForUpdatesInterval:300*1e3,useItemID:!0,headerStart:L(i,{}),boostsCarousel:a.settings.boostsCarousel,filterContext:`public`,timelineStart:B,refresh:M,clearWhenRefresh:!0,view:P?`link-mentions`:void 0,headerEnd:L(Gt,{portal:!0,overflow:`auto`,viewScroll:`close`,position:`anchor`,menuButton:L(`button`,{type:`button`,class:`plain`,children:L(X,{icon:`more`,size:`l`,alt:r({id:`2FYpfJ`})})}),children:[L(Y,{onClick:()=>{let e=prompt(r({id:`4CZnNE`}));if(!/\./.test(e)){e&&alert(r({id:`Q5COHO`}));return}e&&(e=e.toLowerCase().trim(),location.hash=`/${e}/trending`)},children:[L(X,{icon:`bus`}),` `,L(`span`,{children:L(j,{id:`kesYbo`})})]}),h!==l&&L(Y,{onClick:()=>{location.hash=`/${h}/trending`},children:[L(X,{icon:`bus`}),` `,L(`small`,{class:`menu-double-lines`,children:L(j,{id:`_AfxaA`,values:{currentInstance:h},components:{0:L(`b`,{})}})})]})]})},l)}var vu={block:`nearest`,inline:`nearest`,behavior:`instant`};function yu(){let{_:e}=d();he(e({id:`i0qMbr`}),`/`);let{shortcuts:n}=W(k),r=n.map(e=>{if(!e)return null;let{type:n,...r}=e,i={following:al,notifications:nu,list:Sl,public:iu,bookmarks:_c,favourites:Kc,hashtag:bl,mentions:Ll,trending:_u,search:uu,profile:uc}[n];return!i||n===`search`&&!r.query||n===`list`&&!r.id?null:(n===`profile`&&(r.id=ee()),L(i,{...r,columnMode:!0},n+JSON.stringify(r)))});return nt([`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],e=>{try{let n=parseInt(e.key,10)-1,r=document.querySelectorAll(`#columns > *`)[n];r&&(r.focus(),r.scrollIntoView(vu))}catch{}},{useKey:!0,ignoreEventWhen:e=>{let n=/^[1-9]$/.test(e.key);return e.metaKey||e.ctrlKey||e.altKey||e.shiftKey&&!n}}),nt([`[`,`]`],(e,n)=>{let r=n.keys[0],i=document.activeElement.closest(`#columns > *`),a=Ft(),o=a?`]`:`[`,s=a?`[`:`]`,c;r===o?c=i?i.previousElementSibling:document.querySelectorAll(`#columns > *`)[0]:r===s&&(c=i?i.nextElementSibling:document.querySelectorAll(`#columns > *`)[1]),c&&(c.focus(),c.scrollIntoView(vu))},{useKey:!0,ignoreEventWhen:e=>[`[`,`]`].includes(e.key)?!1:e.metaKey||e.ctrlKey||e.altKey||e.shiftKey}),L(`div`,{id:`columns`,onContextMenu:e=>{e.target.closest(`.deck > header`)&&!e.target.closest(`a`)&&!e.target.closest(`button`)&&(e.preventDefault(),k.showShortcutsSettings=!0)},onFocus:()=>{let e=document.activeElement.closest(`#columns > *`);e&&document.querySelectorAll(`#columns > *`).forEach(n=>{n.classList.toggle(`focus`,n===e)})},children:r})}function bu(){let{_:e}=d(),n=W(k);return __BENCHMARK.end(`time-to-home`),y(()=>{(async()=>{let e=await Ke.drafts.keys();if(e.length){let n=r();e.filter(e=>e.startsWith(n)).length&&(k.showDrafts=!0)}})()},[]),L(i,{children:(n.settings.shortcutsViewMode===`multi-column`||!n.settings.shortcutsViewMode&&n.settings.shortcutsColumnsMode)&&n.shortcuts?.length?L(yu,{}):n.settings.paginatedTimeline?L(ml,{title:e({id:`i0qMbr`}),path:`/`,id:`home`,headerStart:!1,headerEnd:L(xu,{})}):L(al,{title:e({id:`i0qMbr`}),path:`/`,id:`home`,headerStart:!1,headerEnd:L(xu,{})})})}function xu(){let{_:e}=d(),n=W(k),r=s(),[a,o]=I(void 0);return L(i,{children:[L(Q,{ref:r,to:`/notifications`,class:`button plain notifications-button ${n.notificationsShowNew?`has-badge`:``} ${a||``}`,onClick:e=>{e.stopPropagation(),window.matchMedia(`(min-width: calc(40em))`).matches&&(e.preventDefault(),o(e=>e?void 0:`open`))},children:L(X,{icon:`notification`,size:`l`,alt:e({id:`iDNBZe`})})}),L(Cu,{state:a,anchorRef:r,onClose:()=>o(void 0)})]})}var Su=5;function Cu({anchorRef:e,state:n,onClose:r}){let{masto:a,instance:o}=f(),c=W(k),[l,u]=I(`default`),d=Kl();async function p(){let e=await d.next(),n=Ml(e.value);if(n?.length){n.forEach(e=>{Me(e.status,o,{skipThreading:!0})});let e=ql(n);k.notificationsLast=e[0],k.notifications=e,a.v1.markers.create({notifications:{lastReadId:e[0].id}}).catch(()=>{})}return k.notificationsShowNew=!1,k.notificationsLastFetchTime=Date.now(),e}let[m,h]=I(!1);function g(){return a.v1.followRequests.list({limit:1})}function _({skipFollowRequests:e=!1}={}){u(`loading`),(async()=>{try{await p(),e||h(!!(await g())?.length),u(`default`)}catch{u(`error`)}})()}let v=s();return y(()=>{n===`open`&&(c.notificationsShowNew?v.current?.scrollTop<=52&&_({skipFollowRequests:!0}):_())},[n,c.notificationsShowNew]),L(At,{ref:v,menuClassName:`notifications-menu`,state:n,anchorRef:e,onClose:r,portal:{target:document.body},containerProps:{onClick:()=>{v.current?.closeMenu?.()}},overflow:`auto`,viewScroll:`close`,position:`anchor`,align:`center`,boundingBoxPadding:`8 8 8 8`,children:[L(`header`,{children:L(`h2`,{children:L(j,{id:`iDNBZe`})})}),L(He.Provider,{value:`notifications`,children:L(`main`,{children:c.notifications.length?L(i,{children:c.notifications.slice(0,Su).map(e=>L(_s,{instance:o,notification:e,disableContextMenu:!0},e._ids||e.id))}):l===`loading`?L(`div`,{class:`ui-state`,children:L(q,{abrupt:!0})}):l===`error`&&L(`div`,{class:`ui-state`,children:[L(`p`,{children:L(j,{id:`5GFQTh`})}),L(`p`,{children:L(`button`,{type:`button`,onClick:_,children:L(j,{id:`KDw4GX`})})})]})})}),L(`footer`,{children:[L(Q,{to:`/mentions`,class:`button plain`,children:[L(X,{icon:`at`}),` `,L(`span`,{children:L(j,{id:`_bZzdR`})})]}),L(Q,{to:`/notifications`,class:`button plain2`,children:[m?L(j,{id:`OdVhdR`,components:{0:L(`span`,{class:`tag collapsed`}),1:L(`span`,{})}}):L(`b`,{children:L(j,{id:`gukqfD`})}),` `,L(X,{icon:`arrow-right`})]})]})]})}var wu=K(bu),Tu=[/^\/@[^@\/]+\/(?:statuses|posts)\/([^\/]+)/i,/\/notes\/([^\/]+)/i,/^\/(?:notice|objects)\/([a-z0-9-]+)/i,/\/@[^@\/]+\/post\/([^\/]+)/i,/\/@[^@\/]+@?[^\/]+?\/([^\/]+)/i,/^\/p\/[^\/]+\/([^\/]+)/i];function Eu(e){let n=URL.parse(e);if(!n)return{};let{hostname:r,pathname:i}=n;for(let e of Tu){let[,n]=i.match(e)||[];if(n)return{instance:r,id:n}}return{}}function Du(e){let{instance:n,id:r}=Eu(e);return n&&r?`/${n}/s/${r}`:null}function Ou(){let e=ie().pathname.replace(/^\//,``),n=Eu(e),r=n?.instance?`/${n.instance}/s/${n.id}`:null,[a,o]=I(`loading`);return N(()=>{o(`loading`),(async()=>{try{let{instance:e,id:i}=n;if(i){let{masto:n}=f({instance:e});if(await n.v1.statuses.$select(i).fetch()){window.location.hash=r+`?view=full`;return}}}catch{}{let{masto:n,instance:i}=f(),a=await n.v2.search.list({q:e,limit:1,resolve:!0});if(a.statuses?.length){let e=a.statuses[0];window.location.hash=`/${i}/s/${e.id}?view=full`}else if(a.accounts?.length){let e=a.accounts[0];window.location.hash=`/${i}/a/${e.id}`}else if(a.collections?.length){let e=a.collections[0];window.location.hash=`/${i}/c/${e.id}`}else r?window.location.hash=r+`?view=full`:o(`error`)}})()},[r]),L(`div`,{class:`ui-state`,tabIndex:`-1`,children:[a===`loading`?L(i,{children:[L(q,{abrupt:!0}),L(`h2`,{children:L(j,{id:`RTAr_z`})}),L(`p`,{children:L(`a`,{href:e,target:`_blank`,rel:`noopener`,children:e})})]}):L(i,{children:[L(`h2`,{children:L(j,{id:`ufzZSJ`})}),L(`p`,{children:L(`a`,{href:e,target:`_blank`,rel:`noopener`,children:e})})]}),L(`hr`,{}),L(`p`,{children:L(Q,{to:`/`,children:L(j,{id:`iWpEwy`})})})]})}function ku(){let{_:e}=d();he(e({id:`h16FyT`}),`/l`);let[n,r]=I(`default`),[a,o]=m(e=>e+1,0),[s,c]=I([]);y(()=>{r(`loading`),(async()=>{try{c(await wi()),r(`default`)}catch{r(`error`)}})()},[a]);let[l,u]=I(!1),f=s.some(e=>e.exclusive);return L(`div`,{id:`lists-page`,class:`deck-container`,tabIndex:`-1`,children:[L(`div`,{class:`timeline-deck deck`,children:[L(`header`,{children:L(`div`,{class:`header-grid`,children:[L(`div`,{class:`header-side`,children:[L(Ns,{}),L(Q,{to:`/`,class:`button plain`,children:L(X,{icon:`home`,size:`l`})})]}),L(`h1`,{children:L(j,{id:`h16FyT`})}),L(`div`,{class:`header-side`,children:L(`button`,{type:`button`,class:`plain`,onClick:()=>u(!0),children:L(X,{icon:`plus`,size:`l`,alt:e({id:`Sb2gYF`})})})})]})}),L(`main`,{children:s.length>0?L(i,{children:[L(`ul`,{class:`link-list`,children:s.map(e=>L(`li`,{children:L(Q,{to:`/l/${e.id}`,children:[L(X,{icon:`list`}),` `,L(`span`,{children:[e.title,e.exclusive&&L(i,{children:[` `,L(Mi,{insignificant:!0})]})]})]})}))}),s.length>1&&L(`footer`,{class:`ui-state`,children:[f&&L(`p`,{children:L(`small`,{class:`insignificant`,children:[L(Mi,{}),` `,L(j,{id:`FNptcJ`})]})}),L(`p`,{children:L(`small`,{class:`insignificant`,children:L(j,{id:`8prZNK`,values:{0:s.length}})})})]})]}):n===`loading`?L(`p`,{class:`ui-state`,children:L(q,{})}):n===`error`?L(`p`,{class:`ui-state`,children:L(j,{id:`v_l5uA`})}):L(`p`,{class:`ui-state`,children:L(j,{id:`IvPikw`})})})]}),l&&L(Ot,{onClick:e=>{e.target===e.currentTarget&&u(!1)},children:L(Ni,{list:l?.list,onClose:e=>{e.state===`success`&&o(),u(!1)}})})]})}var Au=``+new URL(`instances-BNPptnn-.json`,import.meta.url).href;function ju(e){let n=`popup,width=${Math.min(500,Math.floor(window.screen.width*.9))},height=${Math.min(600,Math.floor(window.screen.height*.8))}`;try{let r=window.open(e,`auth-popup`,n);return!r||r.closed||r.closed===void 0?null:r}catch{return null}}function Mu(e){if(e&&!e.closed)try{e.close()}catch{}}function Nu(e,n,r){let i=!1,a=e=>{e.origin===window.location.origin&&e.data&&e.data.type===`oauth-callback`&&(i=!0,s(),e.data.code?n(e.data.code):r(Error(`No authorization code received`)))};window.addEventListener(`message`,a);let o=setInterval(()=>{(!e||e.closed)&&(clearInterval(o),i||(i=!0,s(),r(Error(`Popup was closed before authentication completed`))))},500),s=()=>{window.removeEventListener(`message`,a),clearInterval(o),Mu(e)};return s}var{PHANPY_DEFAULT_INSTANCE:Pu}={};function Fu(){let{_:e}=d();he(e({id:`sQia9P`}),`/login`);let n=s(),r=F.local.get(`instanceURL`),[i,a]=I(`default`),[o]=oe(),c=o.get(`instance`),l=o.get(`submit`),[u,f]=I(c||r?.toLowerCase()||``),[p,m]=I([]),h=s();y(()=>{(async()=>{try{let e=await(await fetch(Au)).json();m(e),h.current=new Dt(e)}catch{}})()},[]);let g=n=>{n&&(async()=>{try{let e=await(await fetch(`${location.protocol}//${n}/.well-known/host-meta`)).text(),r=new DOMParser().parseFromString(e,`text/xml`).getElementsByTagName(`Link`)[0].getAttribute(`template`),{host:i}=URL.parse(r);n!==i&&(n=i)}catch{}F.local.set(`instanceURL`,n),a(`loading`);try{let r=ne(n);(!r||!r.client_id||!r.client_secret)&&(r=await Cr({instanceURL:n}),ae(n,r));let{client_id:i,client_secret:o}=r,s=await hr({instanceURL:n}),c=ue(n),l;if(s&&window.isSecureContext)if(i&&o){let[e,r]=await wr({instanceURL:n,client_id:i,forceLogin:c});F.sessionCookie.set(`codeVerifier`,r),l=e}else{alert(e({id:`ZP1FIA`})),a(`default`);return}else if(i&&o)l=await Tr({instanceURL:n,client_id:i,forceLogin:c});else{alert(e({id:`ZP1FIA`})),a(`default`);return}let u=ju(l);u?Nu(u,e=>{let n=`${window.location.origin}${window.location.pathname}?code=${encodeURIComponent(e)}`;window.location.href=n},e=>{a(`error`)}):location.href=l,a(`default`)}catch{a(`error`)}})()},_=u?u.replace(/^https?:\/\//,``).replace(/\/+$/,``).replace(/^@?[^@]+@/,``).trim():null,v=(/[^\s\r\n\t\/\\]+\.[^\s\r\n\t\/\\]+/.test(_)||/^localhost(:\d+)?$/i.test(_))&&!/[\s\/\\@]/.test(_),b=_?h.current?.search(_,{limit:10})?.map(e=>e.item):[],x=v?_:b?.length?b[0]:u?p.find(e=>e.includes(u)):null;return l&&y(()=>{g(c||x)},[]),L(`main`,{id:`login`,style:{textAlign:`center`},children:L(`form`,{onSubmit:e=>{e.preventDefault(),g(x)},children:[L(`h1`,{children:[L(`img`,{src:jr,alt:``,width:`80`,height:`80`}),L(`br`,{}),L(j,{id:`sQia9P`})]}),L(`label`,{children:[L(`p`,{children:L(j,{id:`sGH11W`})}),L(`input`,{value:u,required:!0,type:`text`,class:`large`,id:`instanceURL`,ref:n,disabled:i===`loading`,autocorrect:`off`,autocapitalize:`off`,autocomplete:`off`,spellCheck:!1,placeholder:e({id:`0hbkwr`}),enterKeyHint:`go`,onInput:e=>{f(e.target.value)},dir:`auto`}),b?.length>0?L(`ul`,{id:`instances-suggestions`,children:b.map((e,n)=>L(`li`,{children:L(`button`,{type:`button`,class:`plain5`,onClick:()=>{g(e)},children:e})}))}):L(`div`,{id:`instances-eg`,children:L(j,{id:`_OvbEC`})})]}),i===`error`&&L(`p`,{class:`error`,children:L(j,{id:`yCXori`})}),L(`div`,{children:[L(`button`,{disabled:i===`loading`||!u||!x,children:e(x?{id:`2xahsi`,values:{selectedInstanceText:x}}:{id:`xGVfLh`})}),` `]}),L(q,{hidden:i!==`loading`}),L(`hr`,{}),!Pu&&L(`p`,{children:L(`a`,{href:`https://joinmastodon.org/servers`,target:`_blank`,children:L(j,{id:`LcOiWS`})})}),L(`p`,{children:L(Q,{to:`/`,children:L(j,{id:`iWpEwy`})})}),L(Nr,{})]})})}var Iu=40;function Lu(){let{_:e}=d(),n=W(k);he(e({id:`-GkIdc`}),`/sp`);let{masto:r}=f(),[i,a]=I([]),[o,s]=I(`default`),[c,l]=m(e=>e+1,0),[u,p]=I(!1);return y(l,[n.reloadScheduledPosts]),y(()=>{s(`loading`),(async()=>{try{let e=r.v1.scheduledStatuses.list({limit:Iu}).values(),n=[],i;do i=(await e.next()).value,i?.length&&n.push(...i);while(i?.length);a(n)}catch{s(`error`)}finally{s(`default`)}})()},[c]),L(`div`,{id:`scheduled-posts-page`,class:`deck-container`,tabIndex:`-1`,children:L(`div`,{class:`timeline-deck deck`,children:[L(`header`,{children:L(`div`,{class:`header-grid`,children:[L(`div`,{class:`header-side`,children:[L(Ns,{}),L(Q,{to:`/`,class:`button plain`,children:L(X,{icon:`home`,size:`l`,alt:e({id:`i0qMbr`})})})]}),L(`h1`,{children:L(j,{id:`-GkIdc`})}),L(`div`,{class:`header-side`,children:L(Gt,{portal:!0,setDownOverflow:!0,overflow:`auto`,viewScroll:`close`,position:`anchor`,menuButton:L(`button`,{type:`button`,class:`plain`,children:L(X,{icon:`more`,size:`l`,alt:e({id:`2FYpfJ`})})}),children:L(Y,{onClick:()=>{l()},children:[L(X,{icon:`refresh`,size:`l`}),L(`span`,{children:L(j,{id:`lCF0wC`})})]})})})]})}),L(`main`,{children:[i.length?L(`ul`,{class:`posts-list`,children:i.map(e=>{let{id:n,params:r,scheduledAt:i,mediaAttachments:a}=e,{inReplyToId:o,language:s,poll:c,sensitive:l,spoilerText:u,text:d,visibility:f,quotedStatusId:m,quoteApprovalPolicy:h}=r,g={id:n,inReplyToId:o,language:s,mediaAttachments:a,poll:c?{...c,expiresAt:new Date(Date.now()+c.expiresIn*1e3),options:c.options.map(e=>({title:e,votesCount:0}))}:void 0,sensitive:l,spoilerText:u,text:d,visibility:f,content:`<p>${d}</p>`,quotedStatusId:m,quoteApprovalPolicy:h};return L(`li`,{children:L(Ru,{status:g,scheduledAt:i,onClick:()=>{p({post:g,scheduledAt:new Date(i)})}})},n)})}):L(`p`,{class:`ui-state`,children:o===`loading`?L(q,{}):e({id:`mZYb1f`})}),u&&L(Ot,{onClick:e=>{e.target===e.currentTarget&&p(!1)},children:L(zu,{post:u.post,scheduledAt:u.scheduledAt,onClose:()=>p(!1)})})]})]})})}function Ru({status:e,scheduledAt:n,onClick:r}){let i=g(()=>{let e=(Date.parse(n)-Date.now())/(1e3*60*60);return e<24?`time`:e<720?`day`:`month`},[n]);return L(`button`,{type:`button`,class:`textual block`,onClick:r,children:[L(`div`,{class:`post-schedule-meta post-schedule-${i}`,children:[L(X,{icon:i,class:`insignificant`}),` `,L(`span`,{children:L(j,{id:`aEp6lO`,values:{0:Jt(n,{formatOpts:{weekday:`short`,second:`numeric`}})},components:{0:L(`b`,{}),1:L(Wt,{datetime:n}),2:L(`small`,{})}})})]}),L(Ut,{status:e,size:`s`,previewMode:!0,readOnly:!0})]})}function zu({post:e,scheduledAt:n,onClose:r}){let{masto:i,instance:a}=f(),{_:o}=d(),[s,c]=I(`default`),[l,u]=I(),p=l&&l.getTime()!==n.getTime(),m=Vt(),h=n&&n<=Date.now(),{inReplyToId:g}=e,[_,v]=I(null),{quotedStatusId:y}=e;return L(`div`,{id:`scheduled-post-sheet`,class:`sheet`,children:[L(`button`,{type:`button`,class:`sheet-close`,onClick:r,children:L(X,{icon:`x`,size:`l`,alt:o({id:`yz7wBu`})})}),L(`header`,{children:L(`h2`,{children:[L(j,{id:`orjBLU`,components:{0:L(`b`,{}),1:L(Wt,{datetime:n})}}),L(`br`,{}),L(`small`,{children:Jt(n,{formatOpts:{weekday:`short`,second:`numeric`}})})]})}),L(`main`,{tabIndex:`-1`,children:[!!_&&L(`div`,{class:`status-reply`,children:L(Ut,{status:_,size:`s`,previewMode:!0,readOnly:!0})}),L(Ut,{status:e,size:`s`,previewMode:!0,readOnly:!0,onMediaClick:(n,r,i,a)=>{n.preventDefault(),k.showMediaModal={mediaAttachments:e.mediaAttachments,mediaIndex:r}}}),L(`form`,{onSubmit:n=>{n.preventDefault(),c(`loading`),(async()=>{try{await i.v1.scheduledStatuses.$select(e.id).update({scheduledAt:l.toISOString()}),Z(o({id:`40naR1`})),r(),c(`default`),k.reloadScheduledPosts++}catch{c(`error`),Z(o({id:`ZM3jAs`}))}})()},children:L(`footer`,{children:[L(`div`,{class:`row`,children:L(`span`,{children:[L(Pt,{scheduledAt:n,setScheduledAt:e=>{u(e)}}),` `,L(`small`,{class:`ib`,children:m})]})}),L(`div`,{class:`row`,children:[L(`button`,{disabled:!p||s===`loading`||h,children:L(j,{id:`QqW27M`})}),L(`span`,{class:`grow`}),L(xt,{align:`end`,menuItemClassName:`danger`,confirmLabel:o({id:`09u3Kk`}),onClick:()=>{c(`loading`),(async()=>{try{await f().masto.v1.scheduledStatuses.$select(e.id).remove(),Z(o({id:`_zL_Mq`})),r(),c(`default`),k.reloadScheduledPosts++}catch{c(`error`),Z(o({id:`aOh6Md`}))}})()},children:L(`button`,{type:`button`,class:`light danger`,disabled:s===`loading`||h,children:L(j,{id:`Jb6_SB`})})})]})]})})]})]})}function Bu(){let{_:e}=d(),{prevEditedAt:n,nextEditedAt:r,editedAtIndex:i,editHistoryMode:a,editHistoryRef:o,exitEditHistory:s}=dt();return a?L(`div`,{class:`edit-history-controls`,children:[L(X,{icon:`edit`}),L(`b`,{class:`edit-history-heading`,children:e({id:`HSA2au`})}),L(`span`,{class:`spacer`}),L(`span`,{class:`edit-history-pagination`,children:[L(`button`,{type:`button`,class:`plain4`,onClick:()=>{n()},disabled:!a||i+1>=o.current.length,children:L(X,{icon:`chevron-left`,alt:e({id:`DHhJ7s`})})}),` `,o.current.length-i,` /`,` `,o.current.length,` `,L(`button`,{type:`button`,class:`plain4`,onClick:()=>{r()},disabled:!a||i<=0,children:L(X,{icon:`chevron-right`,alt:e({id:`hXzOVo`})})})]}),L(`button`,{type:`button`,class:`plain3`,onClick:()=>{s()},children:L(X,{icon:`exit`,alt:e({id:`ydzS9x`})})})]}):null}var{PHANPY_DEFAULT_INSTANCE:Vu}={},Hu=40,Uu=10,Wu=5,Gu={},Ku={},qu={};function Ju(e){delete Ku[e],delete qu[e]}var Yu={block:`nearest`,inline:`center`,behavior:`instant`},Xu=`.status-link:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *), .status-focus:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *)`,Zu=/\/s\//i;function Qu(e){let{_:n}=d(),{id:r}=e,{masto:i,instance:a}=f({instance:e.instance}),o=W(k),[s,u]=oe(),p=s.get(`media`),m=s.get(`media-only`),h=parseInt(p||m,10),_=h>0,v=s.get(`mediaStatusID`),b=Oe(v,a);v&&!b&&(_=!1);let S=_&&!!m,C=c(r,a),[w,T]=I(k.statuses[C]);y(()=>{k.statuses[C]&&T(k.statuses[C])},[C]),y(()=>{if(!w||!w.url)return;let e=document.querySelector(`link[rel="canonical"]`),n=null,r;return e?(n=e.href,e.href=w.url):(r=document.createElement(`link`),r.rel=`canonical`,r.href=w.url,document.head.appendChild(r)),()=>{e&&n?e.href=n:r&&document.head.removeChild(r)}},[w?.url]);let E=g(()=>{let{prevLocation:e}=k,n=(e?.pathname||``)+(e?.search||``),r=l(`/:instance/s/:id`,n)||l(`/s/:id`,n);return!n||r?`/`:n},[]);y(()=>{!w&&_&&(async()=>{try{let e=await i.v1.statuses.$select(r).fetch();Me(e,a),T(e)}catch{alert(n({id:`H_MI1F`})),location.hash=E}})()},[_]);let ee=v?o.statuses[c(v,a)]?.mediaAttachments:w?.mediaAttachments,D=()=>window.matchMedia(`(min-width: calc(40em + 350px))`).matches?`large`:`small`,O=x(()=>{D()===`small`&&o.prevLocation?history.back():S?location.hash=E:(s.delete(`media`),s.delete(`mediaStatusID`),u(s))},[S,E,o.prevLocation]),A=x((e,n,r,i)=>{if(D()===`large`&&!S){O();return}if(_&&document.startViewTransition){let{id:e,blurhash:a,url:o}=r[n],s=Kt(e||a||o),c=[...document.querySelectorAll(`.status .media [data-view-transition-name="${s}"]`)].filter?.(e=>{let n=e.getBoundingClientRect();return n.top<window.innerHeight&&n.bottom>0&&n.left<window.innerWidth&&n.right>0}),l=c.length===1?c[0]:c.find(e=>!!e.closest(`.status-deck`));l?document.startViewTransition(()=>{l.style.viewTransitionName=s,i?.current&&i.current.querySelectorAll(`.media img, .media video`)?.forEach(e=>{e.style.viewTransitionName=``}),O()}).ready.finally(()=>{l.style.viewTransitionName=``,l.dataset.viewTransitioned=s}):O()}else O()},[_,S]);return y(()=>{let e=setTimeout(()=>{let e=document.querySelector(`.carousel`);e&&e.focus()},100);return()=>clearTimeout(e)},[S]),y(()=>{let e=document.querySelectorAll(`.deck-container`);return e.forEach(e=>{e.setAttribute(`inert`,``)}),()=>{e.forEach(e=>{e.removeAttribute(`inert`)})}},[]),L(`div`,{class:`deck-backdrop`,children:[_?ee?.length?L(Fa,{mediaAttachments:ee,statusID:v||r,instance:a,lang:w?.language,index:h-1,onClose:A}):L(`div`,{class:`media-modal-container loading`,children:L(q,{abrupt:!0})}):L(Q,{to:E}),!S&&L(Yt,{statusID:r,children:L(rd,{id:r,instance:e.instance,closeLink:E})})]})}function $u(e){let{linkable:n,to:r,onClick:i,...a}=e;return n?L(Q,{class:`status-link`,to:r,onClick:i,...a}):L(`div`,{class:`status-focus`,tabIndex:0,...a})}function ed(e,n){return Date.parse(e.createdAt)-Date.parse(n.createdAt)}var td=1e3*60*60*24*30,nd=typeof Intl?.Segmenter==`function`?new Intl.Segmenter:null;function rd({id:e,closeLink:n=`/`,instance:r}){let{_:a}=d(),[o,l]=oe(),u=o.get(`media`),p=o.get(`mediaStatusID`),m=parseInt(u,10)>0,h=s(!k.prevLocation&&(history.length===1||`navigation`in window&&navigation?.entries?.()?.length===1)),[_,v]=I(o.get(`view`)||h.current?`full`:null),b=!!parseInt(o.get(`translate`)),{masto:S,instance:C}=f({instance:r}),{masto:w,instance:E,authenticated:ee}=f(),D=C===E,O=W(k),[A,M]=I([]),[P,te]=I(`default`),F=s(),ne=c(e,C),z=s(0),B=s();y(()=>{B.current?.focus()},[]),y(()=>{let n=tn(()=>{if(!B.current)return;let{scrollTop:n}=B.current;P!==`loading`&&(qu[e]=n)},50);return B.current?.addEventListener(`scroll`,n,{passive:!0}),n(),()=>{n.cancel(),B.current?.removeEventListener(`scroll`,n)}},[e,P!==`loading`]);let{editHistoryMode:V,initEditHistory:re,editedAtIndex:ie,editHistoryRef:ae}=dt(),H=s(),U=s(),[se,ce]=I(0),le=s(null),ue=()=>{if(!le.current)return;let{ancestors:n,descendants:r,heroStatus:i}=le.current;if(V&&r?.length){let e=ae.current[ie],n=Date.parse(e.createdAt),i=ae.current[ie-1],a=i?Date.parse(i.createdAt):null;r=r.filter(e=>{let r=Date.parse(e.editedAt||e.createdAt);return r>=n&&(!a||r<=a)})}n.sort(ed),r.sort(ed),z.current=r?.length||0;let a=new Set;n.forEach(e=>{Me(e,C,{skipThreading:!0}),e.inReplyToId&&!n.find(n=>n.id===e.inReplyToId)&&a.add(e.inReplyToId)}),i.inReplyToId&&!n.find(e=>e.id===i.inReplyToId)&&a.add(i.inReplyToId),a.forEach(e=>{let r=n.find(n=>n.inReplyToId===e)||(i.inReplyToId===e?i:null);if(r){let a={id:e,ghost:{inReplyToAccountId:r.inReplyToAccountId}};if(r===i)n.push(a);else{let e=n.indexOf(r);n.splice(e,0,a)}}});let o=new Set,s=n.every(e=>e.ghost||e.account.id===i.account.id),c=[];r.forEach(e=>{if(Me(e,C,{}),e.inReplyToId&&!r.find(n=>n.id===e.inReplyToId)&&e.inReplyToId!==i.id&&o.add(e.inReplyToId),e.inReplyToAccountId===e.account.id)c.push(e);else if(e.inReplyToId===i.id)c.push(e);else if(!e.inReplyToAccountId&&c.find(n=>n.id===e.inReplyToId&&n.account.id===i.account.id)&&e.account.id===i.account.id)c.push(e);else{let n=r.find(n=>n.id===e.inReplyToId);n&&(n.__replies||=[],n.__replies.push(e))}}),c.sort((e,n)=>{let r=i.account.id;return e.account.id===r&&n.account.id!==r?-1:+(n.account.id===r&&e.account.id!==r)}),o.size;let l=1;function u(e,n){let r=n+1;return r>l&&(l=n),e?.map(e=>({id:e.id,account:e.account,repliesCount:e.repliesCount,content:e.content,weight:ud(e),level:r,replies:u(e.__replies,r)}))}let d=c.map(e=>({id:e.id,account:e.account,accountID:e.account.id,descendant:!0,thread:e.account.id===i.account.id,weight:ud(e),level:1,replies:u(e.__replies,1),createdAt:e.createdAt}));return{allStatuses:[...n.map(e=>({id:e.id,ancestor:!0,ghost:e.ghost,isThread:s&&!e.ghost,accountID:e.account?.id,account:e.account,repliesCount:e.repliesCount,weight:e.ghost?0:ud(e),createdAt:e.createdAt})),{id:e,accountID:i.account.id,weight:ud(i),createdAt:i.createdAt},...d],ancestorsIsThread:s,mappedNestedDescendants:d}},K=({reloadHero:n}={})=>{te(`loading`);let r=Ku[e];return M(r?r.filter(e=>k.statuses[ne]):[{id:e}]),(async()=>{let r=()=>ze(()=>S.v1.statuses.$select(e).fetch(),{retries:4}),i=ze(()=>S.v1.statuses.$select(e).context.fetch(),{retries:8}),a=!!O.statuses[ne],o=O.statuses[ne];if(!(a&&!n))try{o=await r(),Me(o,C),await new Promise(e=>{setTimeout(e,100)})}catch{te(`error`);return}try{let n=await i,{ancestors:r}=n;le.current={...n,heroStatus:o};let{allStatuses:a,ancestorsIsThread:s,mappedNestedDescendants:c}=ue(),l=r.length&&!s?[]:c.filter(e=>e.thread),u=(s?r.length:0)+l.length;u>0&&u<100&&ce(u+1),te(`default`),H.current={offsetTop:F.current?.offsetTop,scrollTop:B.current?.scrollTop};let d=r.length||0;d>=ye&&be(d+1),M(a),Ku[e]=a,Ae(o,C)}catch{te(`error`)}})(),U.current=Date.now(),()=>{clearTimeout(void 0)}};y(K,[e,S]),y(()=>{try{let{allStatuses:e}=ue();M(e)}catch{}},[V,ie]);let[de,fe]=I(!1);y(()=>{let e=setInterval(()=>{let e=Date.now();U.current&&e-U.current>=6e4&&fe(!0)},6e4);return()=>{clearInterval(e)}},[]),N(()=>{if(!A.length)return;let n=qu[e];if(n)B.current.scrollTop=n;else if(H.current){let e={offsetTop:F.current?.offsetTop,scrollTop:B.current?.scrollTop},n=e.offsetTop-H.current.offsetTop+e.scrollTop;B.current.scrollTop=n}else A.length===1&&(B.current.scrollTop=0);H.current=null},[A]),y(()=>{O.reloadStatusPage<=0||(async()=>{try{let{instanceURL:n}=R(),r=`${location.protocol}//${n}/api/v1/statuses/${e}/context`;return await(await caches.open(`api`)).delete(r,{ignoreVary:!0}),K({reloadHero:!0})}catch{}})()},[O.reloadStatusPage]),y(()=>()=>{qu={},k.reloadStatusPage=0,Ku={},Gu={},ld.clear()},[]);let pe=O.statuses[ne]||O.statuses[e],me=g(()=>{if(!pe)return``;let{account:e}=pe,n=document.createElement(`div`);return n.innerHTML=e.displayName,n.innerText.trim()},[pe]),ge=g(()=>{if(!pe)return``;let e=Ct(pe);return e.length>64&&(e=(nd?[...nd.segment(e)].map(e=>e.segment):[...e]).slice(0,64).join(``)+`…`),e},[pe]);he(me&&ge?`${me}: "${ge}"`:a({id:`post.title`}),`/:instance?/s/:id`);let _e=g(()=>{if(!pe)return;let{url:e}=pe;if(e)return URL.parse(e)?.hostname},[pe]),ve=g(()=>{if(_e)return _e===C},[_e,C]),[ye,be]=I(Hu),xe=g(()=>A.length-ye,[A.length,ye]),Se=A.some(e=>e.descendant),Ce=A.filter(e=>e.ancestor),[we,Te]=I(!0),Ee=g(()=>{if(!F.current||we)return null;let{top:e}=F.current.getBoundingClientRect();return e>0?`down`:`up`},[we]);nt(`esc`,()=>{location.hash=n},{enabled:!m,ignoreEventWhen:e=>!!document.querySelector(`#modal-container > *`)||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey,useKey:!0}),nt(`backspace`,()=>{location.hash=n},{useKey:!0,ignoreEventWhen:e=>e.metaKey||e.ctrlKey||e.altKey||e.shiftKey}),nt(`j`,()=>{let e=document.activeElement.closest(`.status-link, .status-focus`),n=e?.getBoundingClientRect(),r=Array.from(B.current.querySelectorAll(Xu));if(e&&n.top<B.current.clientHeight&&n.bottom>0){let n=r[r.indexOf(e)+1];n&&(n.focus(),n.scrollIntoView(Yu))}else{let e=r.find(e=>{let n=e.getBoundingClientRect();return n.top>=44&&n.left>=0});e&&(e.focus(),e.scrollIntoView(Yu))}},{useKey:!0,ignoreEventWhen:e=>e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.key.toLowerCase()!==`j`}),nt(`k`,()=>{let e=document.activeElement.closest(`.status-link, .status-focus`),n=e?.getBoundingClientRect(),r=Array.from(B.current.querySelectorAll(Xu));if(e&&n.top<B.current.clientHeight&&n.bottom>0){let n=r[r.indexOf(e)-1];n&&(n.focus(),n.scrollIntoView(Yu))}else{let e=r.find(e=>{let n=e.getBoundingClientRect();return n.top>=44&&n.left>=0});e&&(e.focus(),e.scrollIntoView(Yu))}},{useKey:!0,ignoreEventWhen:e=>e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.key.toLowerCase()!==`k`}),nt(`x`,()=>{let e=document.activeElement.closest(`.status-link, .status-focus`);if(e){let n=e.nextElementSibling;n&&n.tagName.toLowerCase()===`details`&&(n.open=!n.open)}},{useKey:!0,ignoreEventWhen:e=>e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.key.toLowerCase()!==`x`}),nt(`o`,()=>{let e=document.activeElement.closest(`.status-link, .status-focus`);if(e){let n=e.querySelector(`a.media:not(.status-card a.media)`);n&&n.click()}},{useKey:!0,ignoreEventWhen:e=>e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.key.toLowerCase()!==`o`});let[De,J]=I(!1),Oe=s(m?`media+status`:`status`),ke=x((e,n,r,i)=>{e.preventDefault(),e.stopPropagation(),l({media:n+1,mediaStatusID:i.id})},[e]),je=x((e,n)=>{Ju(n.id)},[]);y(()=>{let e;return p&&m&&(e=setTimeout(()=>{let e=B.current?.querySelector(`.status-link[href*="/${p}"]`);e&&e.scrollIntoView(Yu)},400)),()=>{clearTimeout(e)}},[p,m]);let Ne=x((n,r)=>{let{id:o,ancestor:s,ghost:c,isThread:l,descendant:u,thread:d,replies:f,repliesCount:p,weight:m,level:h}=n,g=o===e;return L(`li`,{ref:g?F:null,class:`${s?`ancestor`:``} ${u?`descendant`:``} ${d?`thread`:``} ${g?`hero`:``}`,children:[g?L(i,{children:[L(at,{threshold:.1,onChange:e=>{queueMicrotask(()=>{requestAnimationFrame(()=>{Te(e)})})},class:`status-focus`,tabIndex:0,children:L(Ut,{statusID:o,instance:C,withinContext:!0,size:`l`,enableTranslate:!0,forceTranslate:b})}),P!==`loading`&&!ee?L(`div`,{class:`post-status-banner`,children:[L(`p`,{children:L(j,{id:`Vyeh4F`})}),L(Q,{to:Vu?`/login?instance=${Vu}&submit=1`:`/login`,class:`button`,children:L(j,{id:`sQia9P`})})]}):!D&&L(`div`,{class:`post-status-banner`,children:[L(`p`,{children:L(j,{id:`BrLbQp`,values:{instance:C},components:{0:L(`b`,{})}})}),L(`button`,{type:`button`,disabled:P===`loading`,onClick:()=>{te(`loading`),(async()=>{try{let e=await w.v2.search.list({q:pe.url,type:`statuses`,resolve:!0,limit:1});if(e.statuses.length){let n=e.statuses[0];location.hash=E?`/${E}/s/${n.id}`:`/s/${n.id}`}else throw Error(`No results`)}catch(e){te(`default`),alert(a({id:`DnepCE`,values:{e}}))}})()},children:[L(X,{icon:`transfer`}),` `,L(j,{id:`jtQUzv`})]})]})]}):L($u,{linkable:!c&&(l||s),to:C?`/${C}/s/${o}`:`/s/${o}`,onClick:()=>{Ju(o)},children:[c?L(Ut,{statusID:o,instance:C,withinContext:!0,size:`m`,ghost:c}):r===0&&s?L(at,{threshold:.5,onChange:e=>{queueMicrotask(()=>{requestAnimationFrame(()=>{J(e)})})},children:L(Ut,{statusID:o,instance:C,withinContext:!0,size:d||s?`m`:`s`,enableTranslate:!0,onMediaClick:ke,onStatusLinkClick:je})}):L(Ut,{statusID:o,instance:C,withinContext:!0,size:d||s?`m`:`s`,enableTranslate:!0,onMediaClick:ke,onStatusLinkClick:je,showActionsBar:!!u}),s&&p>1&&L(`div`,{class:`replies-link`,children:[L(X,{icon:`comment2`,alt:a({id:`N8UzTV`})}),` `,L(`span`,{title:p,children:Je(p)})]}),` `]}),u&&f?.length>0&&L(id,{instance:C,replies:f,hasParentThread:d,level:h,accWeight:m,openAll:z.current<Uu,lazyRenderReplies:z.current>Hu,parentLink:{to:C?`/${C}/s/${o}`:`/s/${o}`,onClick:()=>Ju(o)}}),P===`loading`&&g&&!!pe?.repliesCount&&!Se&&L(`div`,{class:`status-loading`,children:L(q,{abrupt:pe.repliesCount>=3})}),P===`error`&&g&&!!pe?.repliesCount&&!Se&&L(`div`,{class:`status-error`,children:[L(j,{id:`HQJU6W`}),L(`br`,{}),L(`button`,{type:`button`,class:`plain`,onClick:()=>{k.reloadStatusPage++},children:L(j,{id:`KDw4GX`})})]})]},o)},[e,C,P,ee,D,b,ke,je,Se]),Pe=g(()=>{if(`navigation`in window&&navigation?.entries){let e=navigation.entries()[navigation.currentEntry.index-1];if(e?.url)return Zu.test(e.url)}return Zu.test(k.prevLocation?.pathname)},[ne]),Fe=g(()=>{let e=[];function n(r){e.push(r.id);let i=r.quote?.quotedStatus?.id||r.quote?.id;i&&e.push(i),r.replies&&r.replies.forEach(n)}return A.forEach(n),e.map(e=>c(e,C))},[A,C]);function Ie(e){if(e<12)return G._({id:`DqsEm-`,values:{months:e}});{let n=Math.floor(e/12);return G._({id:`24w-FD`,values:{years:n}})}}let Le=g(()=>{let e=[],n=A.slice(0,ye);for(let r=0;r<n.length;r++){let i=n[r];if(r>0){let a=n[r-1],{createdAt:o,descendant:s,thread:c,id:l}=i;if(a?.createdAt&&o){let n=Date.parse(o);if(isFinite(n)&&n>td){let r=Date.parse(a.createdAt);if(r&&isFinite(r)){let{ancestor:i,id:o}=a,u=~~((n-r)/td);u>0&&e.push(L(`li`,{style:{"--time-gap-range":Math.min(12,u)},class:`time-gap ${i?`ancestor`:``} ${s?`descendant`:``} ${c?`thread`:``}`,children:Ie(u)},`time-gap-${l}-${o}`))}}}}e.push(Ne(i,r))}return e},[A,ye,Ne,V,ie]);return y(()=>{let e=setTimeout(()=>{if(!F.current)return;let e=F.current.querySelector(`.spoiler-button:not(.spoiling), .spoiler-media-button:not(.spoiling)`);e&&e.click()},1e3);return()=>clearTimeout(e)},[e]),L(jt.Provider,{value:se,children:L(`div`,{tabIndex:`-1`,ref:B,class:`status-deck deck contained ${A.length>1?`padded-bottom`:``} ${Oe.current===`status`&&!h.current?`slide-in`:``} ${_?`deck-view-${_}`:``} ${V?`edit-history-mode`:``}`,style:V?{"--edit-history-percentage":`${ie/(ae.current.length-1)}`}:void 0,onAnimationEnd:e=>{Oe.current===`status`&&(Oe.current=null)},children:[L(`header`,{class:`${P===`loading`?`loading`:``}`,onDblClick:e=>{k.reloadStatusPage++},children:L(`div`,{class:`header-grid header-grid-2`,children:[L(`h1`,{children:[Pe&&L(`button`,{type:`button`,class:`plain deck-back`,onClick:()=>{history.back()},children:L(X,{icon:`chevron-left`,size:`xl`,alt:a({id:`iH8pgl`})})}),!we&&pe&&P!==`loading`?L(i,{children:[L(`span`,{class:`hero-heading`,children:[L(ht,{account:pe.account,instance:C,showAvatar:!0,short:!0}),` `,L(`span`,{class:`insignificant`,children:[`•`,` `,L(Wt,{datetime:pe.createdAt,format:`micro`})]})]}),` `,L(`button`,{type:`button`,class:`ancestors-indicator light small`,onClick:e=>{e.preventDefault(),e.stopPropagation(),F.current.scrollIntoView({behavior:`smooth`,block:`start`})},title:a({id:`NCy-Nw`}),children:L(X,{icon:Ee===`down`?`arrow-down`:`arrow-up`})})]}):L(i,{children:[L(j,{id:`post.title`}),` `,L(`button`,{type:`button`,class:`ancestors-indicator light small`,onClick:e=>{e.preventDefault(),e.stopPropagation(),B.current.scrollTo({top:0,behavior:`smooth`})},hidden:!Ce.length||De,title:a({id:`R8CUl0`,values:{0:Ce.length}}),children:[L(X,{icon:`arrow-up`}),Ce.filter(e=>!e.ghost).filter((e,n,r)=>r.findIndex(n=>n.accountID===e.accountID)===n).slice(0,3).map(e=>L(Ht,{url:e.account.avatarStatic||e.account.avatar,alt:e.account.displayName,squircle:e.account?.bot},e.account.id)),Ce.length>3&&L(i,{children:[` `,L(`span`,{class:`insignificant`,children:Je(Ce.length)})]})]})]})]}),L(`div`,{class:`header-side`,children:[L(`button`,{type:`button`,class:`plain4 button-switch-view`,style:{display:_===`full`?``:`none`},onClick:()=>{v(null),o.delete(`media`),o.delete(`media-only`),o.delete(`view`),l(o)},title:a({id:`-_xYEI`}),children:L(X,{icon:`layout4`,size:`l`})}),de&&L(`button`,{type:`button`,class:`plain button-refresh`,onClick:()=>{k.reloadStatusPage++,fe(!1)},children:L(X,{icon:`refresh`,size:`l`,alt:a({id:`lCF0wC`})})}),L(Gt,{align:`end`,portal:{target:B.current},menuButton:L(`button`,{type:`button`,class:`button plain4`,children:L(X,{icon:`more`,alt:a({id:`2FYpfJ`}),size:`xl`})}),children:[L(Y,{disabled:P===`loading`,onClick:()=>{k.reloadStatusPage++},children:[L(X,{icon:`refresh`}),L(`span`,{children:L(j,{id:`lCF0wC`})})]}),L(Y,{className:`menu-switch-view`,onClick:()=>{v(_===`full`?null:`full`),o.delete(`media`),o.delete(`media-only`),_===`full`?o.delete(`view`):o.set(`view`,`full`),l(o)},children:[L(X,{icon:{"":`layout5`,full:`layout4`}[_||``]}),L(`span`,{children:a(_===`full`?{id:`-_xYEI`}:{id:`2LiWsE`})})]}),L(Y,{onClick:()=>{Array.from(B.current.querySelectorAll(`.spoiler-button:not(.spoiling), .spoiler-media-button:not(.spoiling)`)).forEach(e=>{e.click()})},children:[L(X,{icon:`eye-open`}),` `,L(`span`,{children:L(j,{id:`8r8KmB`})})]}),L(qe,{}),L(ft,{className:`plain`,children:L(j,{id:`Rsjgm0`})}),L(Y,{disabled:!_e||ve,onClick:()=>{let e=Du(pe.url);e?location.hash=e:alert(a({id:`9J6biQ`}))},children:[L(X,{icon:`transfer`}),L(`small`,{class:`menu-double-lines`,children:a(_e?{id:`yi60j9`,values:{0:T.toUnicode(_e)}}:{id:`rWTcqf`})})]}),L(Y,{disabled:!D||P===`loading`||!pe?.editedAt||!z.current,onClick:re,children:[L(X,{icon:`edit`}),L(`span`,{children:a({id:`OqaQnE`})})]})]}),L(Q,{class:`button plain deck-close`,to:n,children:L(X,{icon:`x`,size:`xl`,alt:a({id:`yz7wBu`})})})]})]})}),L(Bu,{}),A.length&&pe?L(`ul`,{class:`timeline flat contextual grow ${P===`loading`?`loading`:``}`,children:[Le,xe>0&&L(`li`,{class:`descendant descendant-more`,children:L(`button`,{type:`button`,class:`plain block show-more`,disabled:P===`loading`,onClick:()=>be(e=>e+Hu),style:{marginBlockEnd:`6em`},children:[L(`div`,{class:`ib avatars-bunch`,children:A.slice(ye,ye+5).map(e=>L(Ht,{url:e.account.avatarStatic},e.id))}),` `,L(`div`,{class:`ib`,children:[L(j,{id:`uXRAkV`}),` `,L(`span`,{class:`tag`,children:xe>Hu?`${Hu}+`:xe})]})]})})]}):L(i,{children:[P===`loading`&&L(`ul`,{class:`timeline flat contextual grow loading`,children:L(`li`,{children:L(Ut,{skeleton:!0,size:`l`})})}),P===`error`&&L(`p`,{class:`ui-state`,children:[L(j,{id:`JWxodU`}),L(`br`,{}),L(`br`,{}),L(`button`,{type:`button`,onClick:()=>{k.reloadStatusPage++},children:L(j,{id:`KDw4GX`})})]})]}),L(`div`,{"data-state-post-ids":Fe.join(` `),hidden:!0})]})})}function id({replies:e,instance:n,hasParentThread:r,level:a,accWeight:o,openAll:c,parentLink:l,lazyRenderReplies:u}){let{_:f}=d(),[p,m]=oe(),h=e=>e.reduce((e,n)=>{let{repliesCount:r,replies:i}=n;return e+(i?.length||r)+h(i||[])},0),_=e.length+h(e),v=e.length===_,b=e.map(e=>e.account).filter((e,n,r)=>r.findIndex(n=>n.id===e.id)===n).slice(0,3),S=g(()=>e?.reduce((e,n)=>e+n?.weight,o),[o,e?.length]),C=!1;(c||S<=Wu||!r&&_===1&&ud(e[0])<2)&&(C=!0);let w=Gu[e[0].id],T=x((e,n,r,i)=>{e.preventDefault(),e.stopPropagation(),m({media:n+1,mediaStatusID:i.id})},[]),E=s();N(()=>{function e(e){e.target.dataset.scrollLeft=e.target.scrollLeft}return E.current?.addEventListener(`scroll`,e,{passive:!0}),()=>{E.current?.removeEventListener(`scroll`,e)}},[]);let[ee,D]=I(w||C),O=u?ee:!0,[k,A]=I(O);y(()=>{A(O)},[O]);let M=C?`div`:`details`,P=M===`details`;return L(M,{ref:E,class:`replies`,open:P?w||C:void 0,onToggle:P?n=>{let{open:r}=n.target;D(r),Gu[e[0].id]=r}:void 0,style:{"--comments-level":a},"data-comments-level":a,"data-comments-level-overflow":a>4,children:[!C&&L(`summary`,{class:`replies-summary`,hidden:C,children:[L(`span`,{class:`avatars`,children:b.map(e=>L(Ht,{url:e.avatarStatic,title:`${e.displayName} @${e.username}`,squircle:e?.bot},e.id))}),L(`span`,{class:`replies-counts`,children:[L(`b`,{children:L(j,{id:`DOQUen`,values:{0:e.length,1:Je(e.length)},components:{0:L(`span`,{title:e.length})}})}),!v&&_>1&&L(i,{children:[` `,`·`,` `,L(`span`,{children:L(j,{id:`qSQQSe`,values:{0:Je(_),totalComments:_},components:{0:L(`span`,{title:_})}})})]})]}),L(X,{icon:`chevron-down`,class:`replies-summary-chevron`}),!!l&&L(Q,{class:`replies-parent-link`,to:l.to,onClick:l.onClick,title:f({id:`ZlV82A`}),children:`»`})]}),k&&L(`ul`,{children:e.map(e=>L(`li`,{children:[L(`div`,{class:`status-focus`,tabIndex:0,children:[L(Ut,{statusID:e.id,instance:n,withinContext:!0,size:`s`,enableTranslate:!0,onMediaClick:T,showActionsBar:!0}),!e.replies?.length&&e.repliesCount>0&&L(`div`,{class:`replies-link`,children:[L(X,{icon:`comment2`,alt:f({id:`N8UzTV`})}),` `,L(`span`,{title:e.repliesCount,children:Je(e.repliesCount)})]})]}),e.replies?.length&&L(id,{instance:n,replies:e.replies,level:e.level,accWeight:C?S:e.weight,openAll:c,lazyRenderReplies:u,parentLink:{to:n?`/${n}/s/${e.id}`:`/s/${e.id}`,onClick:()=>{Ju(e.id)}}})]},e.id))})]})}var ad=140,od=35,sd=70,cd=140,ld=new Map;function ud(e){let n=ld.get(e.id);if(n)return n;let{spoilerText:r,content:i,mediaAttachments:a,poll:o,card:s}=e,c=vt(r+i),l=a?.length?ad:0,u=(o?.options?.length||0)*od,d=s&&(a?.length||o?.options?.length)?0:sd,f=(c+l+u+d)/cd;return ld.set(e.id,f),f}var dd=K(Qu);function fd(){let{id:e,instance:n}=A();return L(dd,{id:e,instance:n})}var pd=``+new URL(`boosts-carousel-BiOaNdMT.jpg`,import.meta.url).href,md=``+new URL(`multi-column-ROck0NVt.jpg`,import.meta.url).href,hd=``+new URL(`multi-hashtag-timeline-DH5INVHi.jpg`,import.meta.url).href,gd=``+new URL(`nested-comments-thread-hv59kZLc.jpg`,import.meta.url).href,_d=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2093%2027'%3e%3cpath%20fill='%2382a0ef'%20d='M1.96%2021.31c1.26%200%201.99-.79%201.99-2.14v-4.86h3.79c4.29%200%207-2.45%207-6.58%200-3.96-2.68-6.56-6.84-6.56H2.85c-2.07%200-2.86.81-2.86%202.89v15.12c0%201.35.72%202.14%201.96%202.14Zm1.99-10.08v-6.9h3.46c2.17%200%203.4%201.26%203.4%203.46%200%202.55-1.25%203.44-4.32%203.44zm26.04%207.96v-8.41c0-3.38-1.93-5.41-5.17-5.41-2.21%200-4.12%201.23-4.64%202.99h-.19V2.13c0-1.36-.69-2.14-1.92-2.14-1.25%200-1.93.78-1.93%202.14v17.05c0%201.36.69%202.12%201.92%202.12s1.93-.76%201.93-2.12v-6.67c0-2.39%201.3-3.9%203.28-3.9%201.8%200%202.86%201.16%202.86%203.19v7.37c0%201.36.69%202.12%201.93%202.12%201.23%200%201.93-.78%201.93-2.12Zm10.95%200h.19v.54c.12%201.01.79%201.58%201.82%201.58%201.2%200%201.88-.75%201.88-2.07v-8.5c0-3.44-2.29-5.38-6.36-5.38q-2.53.01-3.98.81c-1.36.69-1.99%201.61-1.99%202.52%200%20.79.53%201.36%201.38%201.36.63%200%201.04-.16%201.48-.51a4%204%200%200%201%202.87-1.22c1.77%200%202.75.82%202.75%202.39v1.27h-3.69c-3.53%200-5.65%201.77-5.65%204.64%200%202.83%202.05%204.73%205.08%204.73%201.9%200%203.44-.79%204.23-2.18Zm-5.48-2.78c0-1.27.94-2.04%202.52-2.04h2.99v1.61c0%201.46-1.3%202.61-2.97%202.61-1.51%200-2.53-.89-2.53-2.18Zm25.55%202.79v-8.45c0-3.41-1.88-5.38-5.19-5.38-2.29%200-4.03%201.14-4.63%202.99H51v-.95c-.04-1.25-.72-1.93-1.88-1.93-1.17%200-1.9.79-1.9%202.07V19.2c0%201.36.7%202.12%201.93%202.12s1.93-.76%201.93-2.12v-6.67c0-2.42%201.26-3.9%203.27-3.9%201.79%200%202.8%201.14%202.8%203.18v7.38c0%201.36.69%202.12%201.93%202.12%201.23%200%201.92-.75%201.92-2.11Zm6.36%205.37V18.8h.19c.69%201.64%202.29%202.58%204.41%202.58%203.65%200%205.84-2.61%205.84-6.93V12.3c0-4.32-2.17-6.91-5.79-6.91-2.18%200-3.9%201.04-4.53%202.71h-.19v-.75c-.09-1.2-.76-1.86-1.9-1.86-1.22%200-1.89.76-1.89%202.14v16.95c0%201.36.69%202.12%201.92%202.12%201.25%200%201.93-.76%201.93-2.12Zm0-10.06v-2.07c0-2.49%201.25-3.97%203.27-3.97%202.07%200%203.24%201.52%203.24%204.2v1.41c0%202.67-1.17%204.2-3.21%204.2-1.98%200-3.3-1.49-3.3-3.78ZM78.73%2025q0%20.62.42%201.04c.45.44%201.25.67%202.26.67%203.12%200%204.92-1.44%206.14-4.92l4.67-13.4c.16-.45.22-.76.22-1.05%200-1.04-.78-1.8-1.83-1.8q-1.5-.01-1.98%201.85l-3.05%2010.59h-.16L82.4%207.39q-.46-1.86-2.01-1.85c-1.1%200-1.9.78-1.9%201.82q-.02.42.19%201.04l4.57%2012.96c0%20.1-.15.75-.19.83-.32%201-1.05%201.64-1.93%201.64-.44%200-.7-.07-1.01-.07-.83%200-1.39.53-1.39%201.25Z'/%3e%3c/svg%3e`,vd=``+new URL(`home-mobile-dark@2x-Dc-J8-SM.png`,import.meta.url).href,yd=``+new URL(`home-mobile-light@2x-Bd3fod8m.png`,import.meta.url).href,bd=``+new URL(`home-tablet-dark@2x-BgcNI8le.png`,import.meta.url).href,xd=``+new URL(`home-tablet-light@2x-BW2RV9T6.png`,import.meta.url).href,{PHANPY_DEFAULT_INSTANCE:Sd,PHANPY_WEBSITE:Cd,PHANPY_PRIVACY_POLICY_URL:wd,PHANPY_DEFAULT_INSTANCE_REGISTRATION_URL:Td}={PHANPY_PRIVACY_POLICY_URL:`https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD`},Ed=Cd?Cd.replace(/https?:\/\//g,``).replace(/\/$/,``):null,Dd=Cd?Cd.toLowerCase().includes(location.hostname):!1,Od=`${`2026-06-23`.replace(/-/g,`.`)}.05dcc55`;function kd(){let{_:e}=d();return he(null,[`/`,`/welcome`]),L(`main`,{id:`welcome`,children:[L(`div`,{class:`hero-container`,children:L(`div`,{class:`hero-content`,children:[L(`h1`,{children:[L(`img`,{src:jr,alt:``,width:`100`,height:`100`}),L(`img`,{src:_d,alt:`Phanpy`,width:`180`,height:`52`})]}),L(`p`,{class:`desc`,children:L(j,{id:`Ogtv0V`})}),L(`p`,{children:L(Q,{to:Sd?`/login?instance=${Sd}&submit=1`:`/login`,class:`button plain6`,children:e(Sd?{id:`sQia9P`}:{id:`ZLoGls`})})}),Sd&&Td&&L(`p`,{children:L(`a`,{href:Td,class:`button plain5`,children:L(j,{id:`e-RpCP`})})}),!Sd&&L(`p`,{class:`insignificant`,children:L(`small`,{children:L(j,{id:`fvAsUK`,components:{0:L(`br`,{})}})})})]})}),L(`div`,{id:`device-showcase`,children:[L(`div`,{class:`device mobile`,children:L(`div`,{class:`device-frame`,children:L(`picture`,{children:[L(`source`,{srcSet:vd,media:`(prefers-color-scheme: dark)`}),L(`img`,{src:yd,alt:e({id:`LVd2Ia`}),width:`375`,height:`812`,loading:`lazy`})]})})}),L(`div`,{class:`device tablet`,children:L(`div`,{class:`device-frame`,children:L(`picture`,{children:[L(`source`,{srcSet:bd,media:`(prefers-color-scheme: dark)`}),L(`img`,{src:xd,alt:e({id:`6XjvUL`}),width:`768`,height:`1024`,loading:`lazy`})]})})})]}),L(`div`,{id:`why-container`,children:L(`div`,{class:`sections`,children:[L(`section`,{children:[L(`img`,{src:pd,alt:e({id:`S5cYrQ`}),width:`400`,height:`303`,loading:`lazy`}),L(`div`,{children:[L(`h4`,{children:L(j,{id:`Tu-sCN`})}),L(`p`,{children:L(j,{id:`e2uVlo`})})]})]}),L(`section`,{children:[L(`img`,{src:vc,alt:e({id:`LUnwPh`}),width:`600`,height:`450`,loading:`lazy`}),L(`div`,{children:[L(`h4`,{children:L(j,{id:`xrl8fj`})}),L(`p`,{children:L(j,{id:`1lGm1k`})})]})]}),L(`section`,{children:[L(`img`,{src:gd,alt:e({id:`CGQ27z`}),width:`400`,height:`474`,loading:`lazy`}),L(`div`,{children:[L(`h4`,{children:L(j,{id:`cYE45-`})}),L(`p`,{children:L(j,{id:`Pc7QKh`})})]})]}),L(`section`,{children:[L(`img`,{src:md,alt:e({id:`VLKtvP`}),width:`400`,height:`209`,loading:`lazy`}),L(`div`,{children:[L(`h4`,{children:L(j,{id:`pEkad9`})}),L(`p`,{children:L(j,{id:`t7Py5R`})})]})]}),L(`section`,{children:[L(`img`,{src:hd,alt:e({id:`wOax6E`}),width:`400`,height:`196`,loading:`lazy`}),L(`div`,{children:[L(`h4`,{children:L(j,{id:`Wi1Ov0`})}),L(`p`,{children:L(j,{id:`tS2i-h`})})]})]})]})}),L(`footer`,{children:[(Ed||Od)&&L(`p`,{class:`app-site-version`,children:L(`small`,{children:[Dd?Ed:``,` `,Od]})}),L(`p`,{children:L(j,{id:`BskFI2`,components:{0:L(`a`,{href:`https://github.com/cheeaun/phanpy`,target:`_blank`}),1:L(`a`,{href:`https://mastodon.social/@cheeaun`,target:`_blank`,onClick:e=>{e.preventDefault(),k.showAccount=`cheeaun@mastodon.social`}}),2:L(`a`,{href:wd,target:`_blank`})}})}),L(`div`,{children:L(Nr,{})})]})]})}me(!0);var Ad=Le(()=>pe(()=>import(`./mock-home-DGhR__He.js`),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),jd=Le(()=>pe(()=>import(`./year-in-posts-DJv_star.js`),__vite__mapDeps([5,2,1,3,4,6]),import.meta.url));window.__STATES__=k,window.__STATES_STATS__=()=>{let e=[`statuses`,`accounts`,`spoilers`,`unfurledLinks`,`statusQuotes`],n={};e.forEach(e=>{n[e]=Object.keys(k[e]).length});let{statuses:r}=k,i=new Set;document.querySelectorAll(`[data-state-post-id], [data-state-post-ids]`).forEach(e=>{let n=e.dataset.statePostId?.trim?.(),r=e.dataset.statePostIds?.trim?.();n&&i.add(n),r&&r.split(/\s+/).forEach(e=>i.add(e))}),Object.keys(r).filter(e=>!i.has(e))},setInterval(()=>{if(!window.__IDLE__)return;let{statuses:e,unfurledLinks:n,notifications:r}=k,i=0,{instance:a}=f(),o=new Set;document.querySelectorAll(`[data-state-post-id], [data-state-post-ids]`).forEach(e=>{let n=e.dataset.statePostId,r=e.dataset.statePostIds;n&&o.add(n),r&&r.split(/\s+/).forEach(e=>o.add(e))});for(let s in e){if(!window.__IDLE__)break;try{let e=r.some(e=>s===c(e.status?.id,a));if(!o.has(s)&&!e){delete k.statuses[s],delete k.statusQuotes[s];for(let e in n){let r=n[e];if(c(r.id,r.instance)===s){delete k.unfurledLinks[e];break}}i++}}catch{}}},900*1e3),setTimeout(()=>{for(let e in en)setTimeout(()=>{Array.isArray(en[e])?en[e][0]?.():typeof en[e]==`object`?en[e].module?.():en[e]?.()},1)},5e3),(()=>{window.__IDLE__=!0;let e=[`mousemove`,`mousedown`,`resize`,`keydown`,`touchstart`,`pointerdown`,`pointermove`,`wheel`],n=()=>{window.__IDLE__=!0},r=tn(n,3e3),i=()=>{window.__IDLE__=!1,r()};e.forEach(e=>{window.addEventListener(e,i,{passive:!0,capture:!0})}),window.addEventListener(`blur`,n,{passive:!0}),document.documentElement.addEventListener(`mouseleave`,e=>{!e.relatedTarget&&!e.toElement&&n()},{passive:!0})})(),/iPad|iPhone|iPod/.test(navigator.userAgent)&&document.addEventListener(`visibilitychange`,()=>{if(document.visibilityState===`visible`){if(document.getElementsByClassName(`media-modal-container`).length>0)return;let e=F.local.get(`theme`),n;if(e){if(n=document.querySelector(`meta[name="theme-color"][data-theme-setting="manual"]`),n){let r=n.content,i=e===`light`?n.dataset.themeLightColorTemp:n.dataset.themeDarkColorTemp;n.content=i||``,setTimeout(()=>{n.content=r},10)}}else{let e=window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`;if(n=document.querySelector(`meta[name="theme-color"][media*="${e}"]`),n){let e=n.dataset.content,r=n.dataset.contentTemp;n.content=r||``,setTimeout(()=>{n.content=e},10)}}}});{let e=F.local.get(`theme`);if(e){document.documentElement.classList.add(`is-${e}`),document.querySelector(`meta[name="color-scheme"]`).setAttribute(`content`,e||`light dark`);let n=document.querySelector(`meta[data-theme-setting="manual"]`);n&&(n.name=`theme-color`,n.content=e===`light`?n.dataset.themeLightColor:n.dataset.themeDarkColor),document.querySelectorAll(`meta[data-theme-setting="auto"]`).forEach(e=>{e.name=``})}let n=F.local.get(`textSize`);n&&document.documentElement.style.setProperty(`--text-size`,`${n}px`)}ve(k,e=>{for(let[n,r,i,a]of e){if(r.join(`.`)===`settings.shortcutsViewMode`){let e=document.getElementById(`app`);e&&(e.dataset.shortcutsViewMode=k.shortcuts?.length?i:``)}r.join(`.`)===`settings.cloakMode`&&document.body.classList.toggle(`cloak`,i)}}),window.__BENCH_RESULTS=new Map,window.__BENCHMARK={start(e){},end(e){}},document.body.classList.toggle(`exp-tab-bar-v2`,F.local.get(`experiments-tabBarV2`)??!1);var Md=window.matchMedia(`(display-mode: standalone)`).matches||window.navigator.standalone===!0,Nd=3600*1e3;function Pd(){let[e,n]=I(()=>!!R()),[r,i]=I(`loading`);__BENCHMARK.start(`app-init`),__BENCHMARK.start(`time-to-following`),__BENCHMARK.start(`time-to-home`),__BENCHMARK.start(`time-to-isLoggedIn`),d(),y(()=>{let e=F.local.get(`instanceURL`),r=decodeURIComponent((window.location.search.match(/code=([^&]+)/)||[,``])[1]);if(r){if(window.opener&&!window.opener.closed){try{window.opener.postMessage({type:`oauth-callback`,code:r},window.location.origin),setTimeout(()=>{window.close()},100)}catch{window.close()}return}window.history.replaceState({},document.title,window.location.pathname||`/`);let{client_id:a,client_secret:s,vapid_key:c}=ne(e)||{},l=Se(e)||c,u=F.sessionCookie.get(`codeVerifier`);(async()=>{i(`loading`);let{access_token:c}=await Er({instanceURL:e,client_id:a,client_secret:s,code:r,code_verifier:u||void 0});if(c){let r=o({instance:e,accessToken:c});await Promise.allSettled([h(r),P(r,e),Ie(r,e,c,l)]),re(),window.__IGNORE_GET_ACCOUNT_ERROR__=!0,n(!0),i(`default`);let a=F.session.get(`loginRedirect`);a&&(F.session.del(`loginRedirect`),window.location.hash=a)}else i(`error`);__BENCHMARK.end(`app-init`)})()}else{window.__IGNORE_GET_ACCOUNT_ERROR__=!0;let e=decodeURIComponent((window.location.search.match(/account=([^&]+)/)||[,``])[1]),r;if(e&&(r=b(e),r&&(we(r.info.id),window.history.replaceState({},document.title,window.location.pathname||`/`))),r||=R(),r){we(r.info.id);let{client:e}=f({account:r}),{instance:a}=e;re(),i(`loading`),(async()=>{try{O()&&S(a)?(h(e),P(e,a)):await Promise.allSettled([h(e),P(e,a)])}catch{}finally{n(!0),i(`default`),__BENCHMARK.end(`app-init`)}})()}else i(`default`),__BENCHMARK.end(`app-init`)}F.sessionCookie.del(`clientID`),F.sessionCookie.del(`clientSecret`),F.sessionCookie.del(`codeVerifier`)},[]);let a=ie();k.currentLocation=a.pathname,y(oi,[a,e]);let c=s(!1),l=`pwaLastPath`;return y(()=>{c.current&&Md&&e&&(Id(a.pathname)?F.local.del(l):F.local.setJSON(l,{path:a.pathname+a.search,lastAccessed:Date.now()}))},[a.pathname,a.search,e]),y(()=>{if(!(c.current||!(!a.pathname||a.pathname===`/`))&&Md&&e&&r==="default"){let e=F.local.getJSON(l);e&&setTimeout(()=>{e?.path&&Date.now()-(e.lastAccessed||0)<Nd&&(window.location.hash=e.path),F.local.del(l)},300),c.current=!0}},[r,e]),y(()=>{`serviceWorker`in navigator&&Md&&r==="default"&&navigator.serviceWorker.getRegistration().then(function(e){e&&e.active&&e.active.postMessage({type:`client-ready`})}).catch(function(e){})},[Md,r]),/\/https?:/.test(a.pathname)?L(Ou,{}):r===`loading`?L(q,{id:`loader-root`}):L(sn,{value:e,children:[L(Ld,{}),L(Bd,{}),L(Fe,{children:L(ke,{path:`/:instance?/s/:id`,element:L(fd,{})})}),e&&L(mn,{}),e&&L(ks,{}),L(as,{}),e&&L(vs,{}),L(fn,{}),e&&L(ss,{}),L(Es,{onClose:oi}),L(gn,{})]})}function Fd(){let e=cn();return e&&__BENCHMARK.end(`time-to-isLoggedIn`),L(e?wu:kd,{})}function Id(e){return/^\/(login|welcome|_sandbox|_qr-scan|_mock)/i.test(e)}var Ld=K(()=>{let e=ie();return L(Fe,{location:g(()=>{let{pathname:n}=e;return!Id(n)},[e])||e,children:[L(ke,{path:`/`,element:L(Fd,{})}),L(ke,{path:`/login`,element:L(Fu,{})}),L(ke,{path:`/welcome`,element:L(kd,{})}),L(ke,{path:`/_mock/home`,element:L(w,{children:L(Ad,{})})}),void 0]})});function Rd({children:e}){let n=cn(),r=ie();if(!n){let e=r.pathname+r.search;return F.session.set(`loginRedirect`,e),L(z,{to:`/login`,replace:!0})}return e}function zd(){return k.prevLocation||null}function Bd(){let e=ie(),n=s(zd()),r=g(()=>l(`/:instance/s/:id`,e.pathname)||l(`/s/:id`,e.pathname),[e.pathname,l]);return y(()=>{r?k.prevLocation&&F.session.setJSON(`prevLocation`,{pathname:k.prevLocation.pathname,search:k.prevLocation.search}):(k.prevLocation&&=null,F.session.del(`prevLocation`))},[r]),r?n.current||=zd():n.current=null,L(Fe,{location:n.current||e,children:[L(ke,{path:`/notifications`,element:L(Rd,{children:L(nu,{})})}),L(ke,{path:`/mentions`,element:L(Rd,{children:L(Ll,{})})}),L(ke,{path:`/following`,element:L(Rd,{children:L(al,{})})}),L(ke,{path:`/_following2`,element:L(Rd,{children:L(ml,{})})}),L(ke,{path:`/b`,element:L(Rd,{children:L(_c,{})})}),L(ke,{path:`/f`,element:L(Rd,{children:L(Kc,{})})}),L(ke,{path:`/l`,children:[L(ke,{index:!0,element:L(Rd,{children:L(ku,{})})}),L(ke,{path:`:id`,element:L(Rd,{children:L(Sl,{})})})]}),L(ke,{path:`/fh`,element:L(Rd,{children:L(rl,{})})}),L(ke,{path:`/sp`,element:L(Rd,{children:L(Lu,{})})}),L(ke,{path:`/ft`,element:L(Rd,{children:L(Qc,{})})}),L(ke,{path:`/catchup`,element:L(Rd,{children:L(Dc,{})})}),L(ke,{path:`/yip`,element:L(Rd,{children:L(w,{fallback:L(`div`,{id:`year-in-posts-page`,class:`deck-container`,tabIndex:`-1`,children:L(q,{})}),children:L(jd,{})})})}),L(ke,{path:`/annual_report/:year`,element:L(Rd,{children:L(hc,{})})}),L(ke,{path:`/:instance?/t/:hashtag`,element:L(bl,{})}),L(ke,{path:`/:instance?/a/:id`,children:[L(ke,{index:!0,element:L(uc,{})}),L(ke,{path:`c`,element:L(mc,{})})]}),L(ke,{path:`/:instance?/c/:id`,element:L(Wc,{})}),L(ke,{path:`/:instance?/p`,children:[L(ke,{index:!0,element:L(iu,{})}),L(ke,{path:`l`,element:L(iu,{local:!0})})]}),L(ke,{path:`/:instance?/trending`,element:L(_u,{})}),L(ke,{path:`/:instance?/search`,element:L(uu,{})})]})}if(ge(),Te(),D(L(je,{i18n:G,children:L(ce,{children:L(U,{children:L(Pd,{})})})}),document.getElementById(`app`)),setTimeout(()=>{try{localStorage.removeItem(`settings-groupedNotificationsAlpha`)}catch{}},5e3),`serviceWorker`in navigator&&typeof caches<`u`){let e=[`icons`],n=!1,r=1e4;async function i(){if(window.__IDLE__)try{let r=await caches.keys();for(let n of r){if(e.includes(n))continue;let r=await caches.open(n),i=await r.keys();if(i.length>50){let e=i.slice(50);for(let n of e)await r.delete(n)}}n=!0}catch{}setTimeout(i,n?36e5:r)}setTimeout(i,r)}if(`serviceWorker`in navigator){function e(e){if(!e)return null;let n=[];return e.title&&n.push(e.title),e.text&&n.push(e.text),e.url&&n.push(e.url),{initialText:n.join(`
|
|
24
|
+
|
|
25
|
+
`),files:e.files||[]}}navigator.serviceWorker.addEventListener(`message`,n=>{let{data:r,action:i}=n.data||{};if(i===`compose-with-shared-data`){let n=e(r);n&&(window.__SHARED_DATA__=n,k.showCompose=!0)}})}window.__CLOAK__=()=>{document.body.classList.toggle(`cloak`)};export{xi as a,wo as i,ks as n,mn as o,Xa as r,Ns as t};
|
|
26
|
+
//# sourceMappingURL=main-BdqNbG-a.js.map
|