@serifpersia/dango 3.4.0 → 3.4.1
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/README.md +1 -1
- package/client/dist/assets/{AnimeCard-CJy1SXH3.js → AnimeCard-B0oMgXBm.js} +1 -1
- package/client/dist/assets/{AnimeInfo-BoXlVvZ-.js → AnimeInfo-o0Udf0og.js} +1 -1
- package/client/dist/assets/{AnimeInfoPage-BxbA_7AV.js → AnimeInfoPage-CojMIEuf.js} +2 -2
- package/client/dist/assets/{Asmr--Zc8G9zv.js → Asmr-2V3yCCiK.js} +1 -1
- package/client/dist/assets/{AsmrResetProgressModal-CKYm-8cp.js → AsmrResetProgressModal-C9R7HlNa.js} +1 -1
- package/client/dist/assets/{AvSyncCalibrator-3yjZS7s6.js → AvSyncCalibrator-Bo3820j3.js} +1 -1
- package/client/dist/assets/{Home-rrhOGQcg.js → Home-C8uXTzIM.js} +1 -1
- package/client/dist/assets/{Insights-Bay90Yeg.js → Insights-CRqBfZuK.js} +1 -1
- package/client/dist/assets/{LibraryListPage-HzuDavbb.js → LibraryListPage-B_r51cRi.js} +1 -1
- package/client/dist/assets/{ListeningList-DYcQnnsG.js → ListeningList-BWnwvJTt.js} +1 -1
- package/client/dist/assets/{Manga-D8CT9aO0.js → Manga-CI5cZg3h.js} +1 -1
- package/client/dist/assets/{MangaInfoPage-DGK6CYp1.js → MangaInfoPage-BtkOrO34.js} +1 -1
- package/client/dist/assets/{MangaReadPage-B9XoDKF9.js → MangaReadPage-Uv72AYdY.js} +1 -1
- package/client/dist/assets/{MangaResetProgressModal-QjZyIAjl.js → MangaResetProgressModal-CPMEqZyi.js} +1 -1
- package/client/dist/assets/{Mature-CHt_-Hz5.js → Mature-DXHWvoY5.js} +1 -1
- package/client/dist/assets/{MediaCard-B5584Cq9.js → MediaCard-DzA336CA.js} +1 -1
- package/client/dist/assets/{Music-HeLrEZ2d.js → Music-C4dM0BQx.js} +1 -1
- package/client/dist/assets/{OptionListMenu-CJ90CdwI.js → OptionListMenu-CpwxAC3J.js} +1 -1
- package/client/dist/assets/{Player-BYtEax_z.js → Player-CpMvWTkH.js} +2 -2
- package/client/dist/assets/{PlayerSettings-4-cUAY4B.js → PlayerSettings-pMU85k7p.js} +1 -1
- package/client/dist/assets/{QueueOptionsButton-Ba0dg_82.js → QueueOptionsButton-1M7MdKzM.js} +1 -1
- package/client/dist/assets/{QueueRail-O7f4RqjB.js → QueueRail-Bpla2xD8.js} +1 -1
- package/client/dist/assets/{Radio-DPZxQnyD.js → Radio-DlmTC-qG.js} +1 -1
- package/client/dist/assets/{ReadingList-n6rr8ygy.js → ReadingList-wJMDUybm.js} +1 -1
- package/client/dist/assets/{ResetProgressModal-CcStlbhP.js → ResetProgressModal-CByRM1Fh.js} +1 -1
- package/client/dist/assets/{Search-C2wrWOdy.js → Search-B94D0tRM.js} +1 -1
- package/client/dist/assets/{Settings-CluUYs8U.js → Settings-CcU3oNY8.js} +1 -1
- package/client/dist/assets/{SkeletonGrid-CLEPY9nP.js → SkeletonGrid-BJyZkg_K.js} +1 -1
- package/client/dist/assets/{Trackers-CTGPxs0V.js → Trackers-vz-gqxtm.js} +1 -1
- package/client/dist/assets/{Tv-BwHlDdi8.js → Tv-Rji_lvQo.js} +1 -1
- package/client/dist/assets/{TvInfo-CXnrLekr.js → TvInfo-Ciujd6os.js} +1 -1
- package/client/dist/assets/{TvPopup-BekfiNcX.js → TvPopup-CqlVRF-Y.js} +1 -1
- package/client/dist/assets/{TvSearch-DuqR-z3v.js → TvSearch-BcKXQue9.js} +1 -1
- package/client/dist/assets/{TvWatchlist-CBvgFrA0.js → TvWatchlist-sjsiup2h.js} +1 -1
- package/client/dist/assets/{Watchlist-mj8mTOam.js → Watchlist-DAMdvt7Z.js} +1 -1
- package/client/dist/assets/{hls-Boje3IOE.js → hls-Do_n10_Y.js} +1 -1
- package/client/dist/assets/{index-BXwhFWB_.js → index-B5SLDCAi.js} +2 -2
- package/client/dist/assets/{useAnimeInfoData-DJ7A4B4T.js → useAnimeInfoData-DU9X90no.js} +1 -1
- package/client/dist/assets/{useAsmr-DIwIsJXF.js → useAsmr-D6cSjbvt.js} +1 -1
- package/client/dist/assets/{useAsmrPopup-e4zNN9ig.js → useAsmrPopup-DK1Vx-HV.js} +1 -1
- package/client/dist/assets/{useMangaLibrary-C9Lci5N4.js → useMangaLibrary-DcxPn0RM.js} +1 -1
- package/client/dist/assets/{useMangaPopup-B8nnpvyi.js → useMangaPopup-BLwvRZn0.js} +1 -1
- package/client/dist/assets/{useProviders-B5Qr4I1y.js → useProviders-D3L1Chqc.js} +1 -1
- package/client/dist/assets/{useTv-Dm8MCYlL.js → useTv-B546u-Rx.js} +1 -1
- package/client/dist/assets/{useTvLibrary-B7jEk2Q7.js → useTvLibrary-C2rPeCVT.js} +1 -1
- package/client/dist/index.html +1 -1
- package/package.json +6 -2
- package/server/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ _A local-first anime web app focused on performance, privacy, and personal libra
|
|
|
6
6
|
|
|
7
7
|
[](https://opensource.org/licenses/MIT)
|
|
8
8
|

|
|
9
|
-
[](https://github.com/serifpersia/dango)
|
|
10
10
|
|
|
11
11
|

|
|
12
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{T as B,d as P,A as C,u as s,S as T,L as A,N as D}from"./vendor-core-8R2fFbyN.js";import{I as o}from"./vendor-icons-CDMuNDeL.js";import{u as I}from"./useAnimeInfoData-
|
|
1
|
+
import{T as B,d as P,A as C,u as s,S as T,L as A,N as D}from"./vendor-core-8R2fFbyN.js";import{I as o}from"./vendor-icons-CDMuNDeL.js";import{u as I}from"./useAnimeInfoData-DU9X90no.js";import{d as R,s as z,e as M}from"./index-B5SLDCAi.js";import{Q as _}from"./QueueOptionsButton-1M7MdKzM.js";import{p as a,a as x,m as $,M as L}from"./MediaCard-DzA336CA.js";const O=({showId:e,anchorRect:l,onMouseEnter:v,onMouseLeave:u,onRequestClose:N})=>{const{showMeta:t,loadingMeta:i,inWatchlist:d,toggleWatchlist:f}=I(e),{titlePreference:c}=R(),r=B(()=>t?.name?c==="name"?t.name:c==="nativeName"?t.names?.native||t.name:c==="englishName"&&t.names?.english||t.name:"",[t,c]),[h,g]=P(!1),p=C(!1),b=()=>{p.current=!0,v()},y=()=>{p.current=!1,!h&&u()},w=n=>{g(n),!n&&!p.current&&u()};return s(x,{anchorRect:l,onMouseEnter:b,onMouseLeave:y,onRequestClose:N,children:i?s("div",{className:a.loading,children:[s("div",{className:a.spinner}),s("span",{children:"Fetching details..."})]}):t?s(T,{children:[s("div",{className:a.header,children:s("div",{className:a.title,children:r})}),s("div",{className:a.body,children:[s("div",{className:a.metaRow,children:[t.score&&s("div",{className:a.metaItem,children:[s(o,{name:"star",className:a.scoreIcon,size:14}),s("span",{children:t.score})]}),t.status&&s("div",{className:a.metaItem,children:[s(o,{name:"tv",size:14}),s("span",{children:t.status})]})]}),s("div",{className:a.synopsis,children:t.description?z(t.description):"No synopsis available."}),s("div",{className:a.details,children:[t.nextEpisodeAirDate&&s("div",{className:a.detailItem,children:[s("strong",{children:"Aired:"})," ",t.nextEpisodeAirDate]}),Array.isArray(t.genres)&&t.genres.length>0&&s("div",{className:a.genres,children:t.genres.filter(Boolean).slice(0,4).map(n=>{const E=typeof n=="string"?n:n?.name;return s("span",{className:a.genre,children:E},E)})})]})]}),s("div",{className:a.footer,children:[s("div",{className:a.primaryAction,children:s(A,{to:`/watch/${t?.id||e}`,className:a.watchBtn,children:[s(o,{name:"play",size:14}),"Watch now"]})}),s("div",{className:a.secondaryActions,children:[s("button",{className:`${a.watchlistBtn} ${d?a.active:""}`,onClick:n=>{n.preventDefault(),n.stopPropagation(),f()},children:[d?s(o,{name:"check",size:12}):s(o,{name:"plus",size:12}),s("span",{children:d?"Remove":"Watchlist"})]}),s(_,{showId:e,showName:t.name||t.names?.romaji,showThumbnail:t.thumbnail,nativeName:t.names?.native,englishName:t.names?.english,showType:t.type,className:a.watchlistBtn,activeClassName:a.active,align:"left",onMenuOpenChange:w}),s(A,{to:`/anime/${t?.id||e}`,className:a.detailsBtn,children:"Read more"})]})]})]}):s("div",{className:a.loading,children:"Failed to load info."})})},j=D(({anime:e,continueWatching:l=!1,onRemove:v,config:u,layout:N="vertical"})=>{const t=e.currentTime||0,i=e.duration||0,d=.8,f=t>5&&i>5&&t<i*d,c=t>0&&(i<=5||t>=i*d),r=e.episodeNumber,h=l?{pathname:r?`/watch/${e._id}/${r}`:`/watch/${e._id}`,state:{name:e.name,thumbnail:e.thumbnail,nativeName:e.nativeName,englishName:e.englishName,type:e.type}}:r?`/watch/${e._id}/${r}`:`/anime/${e._id}`,g=(()=>{if(typeof h=="string")return h.startsWith("/watch/");const m=h.pathname;return typeof m=="string"&&m.startsWith("/watch/")})(),p=l&&r?`EP ${r}`:e.watchedCount!==void 0&&e.watchedCount>0?`EP ${e.watchedCount}`:null,b=[e.airTime,e.aired===!1&&e.nextEpisodeAirDate?`· ${e.nextEpisodeAirDate.split(",")[0]}`:""].filter(Boolean).join(" "),y=e.isAdult||e.rating==="R+"||e.rating==="Rx"||e.rating?.includes("17+"),w=s(T,{children:[(e.availableEpisodesDetail?.sub||e.availableEpisodes?.sub)&&s("div",{className:$.metaItem,children:[s(o,{name:"closed-captioning",size:10}),e.availableEpisodesDetail?.sub?.length??e.availableEpisodes?.sub]}),(e.availableEpisodesDetail?.dub||e.availableEpisodes?.dub)&&s("div",{className:$.metaItem,children:[s(o,{name:"microphone",size:10}),e.availableEpisodesDetail?.dub?.length??e.availableEpisodes?.dub]})]});return s(L,{item:{id:e.id||e.showId||e._id,title:e.name,nativeName:e.nativeName,englishName:e.englishName,thumbnail:e.thumbnail,typeBadge:e.type||"TV",chapterBadge:p,airMeta:b||void 0,isAdult:y,notAired:e.aired===!1},linkTo:h,hoverIcon:g?"play":"info",progress:f?{percent:t/i*100,label:`${M(t)} / ${M(i)}`}:c?{percent:100,label:"Watched"}:void 0,showProgress:l,metaRow:w,display:u,layout:N,onRemove:v,showRemoveButton:u?.elements?.poster?.removeButton??(l&&!!v),showInfoButton:!l,enrichedId:e._id,renderPopup:(m,n)=>s(O,{showId:e._id,anchorRect:m,onMouseEnter:n.onMouseEnter,onMouseLeave:n.onMouseLeave,onRequestClose:n.close})})});export{j as A};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as C,a as I,d as S,h as p,T,u as e}from"./vendor-core-8R2fFbyN.js";import{I as s}from"./vendor-icons-CDMuNDeL.js";import{u as b}from"./useAnimeInfoData-
|
|
1
|
+
import{n as C,a as I,d as S,h as p,T,u as e}from"./vendor-core-8R2fFbyN.js";import{I as s}from"./vendor-icons-CDMuNDeL.js";import{u as b}from"./useAnimeInfoData-DU9X90no.js";import{d as B,f as d,s as w,M,B as u}from"./index-B5SLDCAi.js";import{u as x}from"./useMatureConsent-CT7-KfzG.js";import{A}from"./AnimeMetaDetails-BPvv5xIl.js";import{S as D}from"./SynopsisText-BcpwT5iw.js";import{Q as G}from"./QueueOptionsButton-1M7MdKzM.js";import"./vendor-query-BUTye89G.js";import"./useIsMobile-Dm_b6Ob3.js";import"./vendor-ui-CUDCvRS_.js";const P="_container_1287q_1",W="_heroSection_1287q_11",O="_bannerContainer_1287q_17",$="_banner_1287q_17",U="_bannerOverlay_1287q_37",j="_heroContent_1287q_49",z="_posterContainer_1287q_62",V="_floatIn_1287q_1",Q="_poster_1287q_62",E="_infoGlass_1287q_86",H="_slideUpIn_1287q_1",F="_title_1287q_100",J="_quickMeta_1287q_109",K="_metaItem_1287q_117",L="_iconStar_1287q_126",R="_iconTv_1287q_129",X="_iconType_1287q_132",Y="_iconClock_1287q_135",Z="_genres_1287q_139",ee="_genre_1287q_139",ne="_synopsisSection_1287q_165",te="_sectionTitleSmall_1287q_170",se="_description_1287q_178",ae="_actions_1287q_186",ie="_watchBtn_1287q_192",oe="_watchlistBtn_1287q_214",le="_active_1287q_234",ce="_detailsSection_1287q_241",re="_detailsToggleBtn_1287q_247",de="_expandedContent_1287q_270",_e="_fadeIn_1287q_1",me="_detailsGridContainer_1287q_274",he="_detailItem_1287q_284",pe="_airingValue_1287q_303",ue="_loadingDetails_1287q_308",ve="_spinner_1287q_317",ge="_spin_1287q_317",ke="_heroSkeleton_1287q_332",qe="_skeletonBanner_1287q_336",fe="_skeletonPoster_1287q_337",Ne="_skeletonTitle_1287q_338",ye="_skeletonMeta_1287q_339",Ce="_skeletonDesc_1287q_340",Ie="_skeletonActions_1287q_341",Se="_skeletonContent_1287q_374",Te="_skeletonInfo_1287q_388",n={container:P,heroSection:W,bannerContainer:O,banner:$,bannerOverlay:U,heroContent:j,posterContainer:z,floatIn:V,poster:Q,infoGlass:E,slideUpIn:H,title:F,quickMeta:J,metaItem:K,iconStar:L,iconTv:R,iconType:X,iconClock:Y,genres:Z,genre:ee,synopsisSection:ne,sectionTitleSmall:te,description:se,actions:ae,watchBtn:ie,watchlistBtn:oe,active:le,detailsSection:ce,detailsToggleBtn:re,expandedContent:de,fadeIn:_e,detailsGridContainer:me,detailItem:he,airingValue:pe,loadingDetails:ue,spinner:ve,spin:ge,heroSkeleton:ke,skeletonBanner:qe,skeletonPoster:fe,skeletonTitle:Ne,skeletonMeta:ye,skeletonDesc:Ce,skeletonActions:Ie,"skeleton-wave":"_skeleton-wave_1287q_1",skeletonContent:Se,skeletonInfo:Te};function $e(){const{id:a}=C(),i=I(),{titlePreference:l}=B(),[o,v]=S(!1),{showMeta:t,loadingMeta:g,toggleWatchlist:k,inWatchlist:c}=b(a),{hasConsent:q,grant:f}=x();p(()=>{a&&t?.id&&t.id!==a&&i(`/anime/${t.id}`,{replace:!0})},[a,t,i]),p(()=>{document.title=t?.name?`${t.name} - dango`:"Anime - dango"},[t?.name]);const N=()=>t?.name?l==="name"?t.name:l==="nativeName"?t.names?.native||t.name:l==="englishName"&&t.names?.english||t.name:"",y=()=>{a&&i(`/watch/${a}`)},_=T(()=>t?.bannerImage?d(t.bannerImage):t?.thumbnail?d(t.thumbnail,1200,450):"",[t?.bannerImage,t?.thumbnail]);if(g||!t?.name)return e("div",{className:n.container,children:e("div",{className:n.heroSkeleton,children:[e("div",{className:n.skeletonBanner}),e("div",{className:n.skeletonContent,children:[e("div",{className:n.skeletonPoster}),e("div",{className:n.skeletonInfo,children:[e("div",{className:n.skeletonTitle}),e("div",{className:n.skeletonMeta}),e("div",{className:n.skeletonDesc}),e("div",{className:n.skeletonActions})]})]})]})});const m=t.isAdult===!0&&!q;return e("div",{className:n.container,style:m?{filter:"blur(14px)",pointerEvents:"none",userSelect:"none"}:void 0,children:[e("div",{className:n.heroSection,children:[e("div",{className:n.bannerContainer,children:[e("div",{className:n.banner,style:_?{backgroundImage:`url(${_})`}:void 0}),e("div",{className:n.bannerOverlay})]}),e("div",{className:n.heroContent,children:[e("div",{className:n.posterContainer,children:e("img",{src:d(t.thumbnail||"",320,480),alt:t.name,className:n.poster,decoding:"async"})}),e("div",{className:n.infoGlass,children:[e("div",{className:n.topInfo,children:[e("h1",{className:n.title,children:N()}),e("div",{className:n.quickMeta,children:[t.score&&e("div",{className:n.metaItem,children:[e(s,{name:"star",className:n.iconStar}),e("span",{children:t.score})]}),t.status&&e("div",{className:n.metaItem,children:[e(s,{name:"tv",className:n.iconTv}),e("span",{children:t.status})]}),t.type&&e("div",{className:n.metaItem,children:[e(s,{name:"layer-group",className:n.iconType}),e("span",{children:t.type})]})]}),Array.isArray(t.genres)&&t.genres.length>0&&e("div",{className:n.genres,children:t.genres.filter(Boolean).slice(0,5).map(r=>{const h=typeof r=="string"?r:r?.name;return e("span",{className:n.genre,children:h},h)})})]}),e("div",{className:n.synopsisSection,children:[e("h2",{className:n.sectionTitleSmall,children:"Synopsis"}),e(D,{text:w(t.description),emptyText:"No description available."})]}),e("div",{className:n.actions,children:[e("button",{className:n.watchBtn,onClick:y,children:[e(s,{name:"play",size:14}),"Start Watching"]}),e("button",{className:`${n.watchlistBtn} ${c?n.active:""}`,onClick:k,children:[c?e(s,{name:"check",size:14}):e(s,{name:"plus",size:14}),c?"In Watchlist":"Add to Watchlist"]}),e(G,{showId:a,showName:t.name||t.names?.romaji,showThumbnail:t.thumbnail,nativeName:t.names?.native,englishName:t.names?.english,showType:t.type,className:n.watchlistBtn,activeClassName:n.active})]})]})]})]}),e("div",{className:n.detailsSection,children:[e("button",{className:n.detailsToggleBtn,onClick:()=>{v(!o)},children:[o?e(s,{name:"chevron-up"}):e(s,{name:"chevron-down"}),o?"Hide Details":"Show Details"]}),o&&e("div",{className:n.expandedContent,children:e(A,{showMeta:t,styles:n})})]}),m&&e(M,{isOpen:!0,title:"Content Warning",onClose:()=>i("/"),children:e("div",{style:{padding:"1rem",textAlign:"center"},children:[e("p",{children:"This title contains mature content intended for adult audiences."}),e("p",{children:["By proceeding, you confirm that you are ",e("strong",{children:"18 years of age or older"})," (or the age of majority in your jurisdiction) and wish to view this content."]}),e("div",{style:{marginTop:"1rem",display:"flex",gap:"10px",justifyContent:"center"},children:[e(u,{variant:"secondary",onClick:()=>i("/"),children:"Go Back"}),e(u,{onClick:f,children:"I'm 18+, Continue"})]})]})})]})}export{$e as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AnimeInfo-
|
|
2
|
-
import{$ as r,_ as t}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AnimeInfo-o0Udf0og.js","assets/vendor-core-8R2fFbyN.js","assets/vendor-icons-CDMuNDeL.js","assets/useAnimeInfoData-DU9X90no.js","assets/vendor-query-BUTye89G.js","assets/index-B5SLDCAi.js","assets/index-CUm1meqr.css","assets/QueueOptionsButton-1M7MdKzM.js","assets/vendor-ui-CUDCvRS_.js","assets/QueueOptionsButton-CM15uQn8.css","assets/useMatureConsent-CT7-KfzG.js","assets/AnimeMetaDetails-BPvv5xIl.js","assets/AnimeMetaDetails-BwNQnRCd.css","assets/SynopsisText-BcpwT5iw.js","assets/useIsMobile-Dm_b6Ob3.js","assets/SynopsisText-CYv2W3yR.css","assets/AnimeInfo-BFWtHlPC.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{$ as r,_ as t}from"./index-B5SLDCAi.js";import{u as o,P as e,z as i}from"./vendor-core-8R2fFbyN.js";import"./vendor-query-BUTye89G.js";import"./vendor-icons-CDMuNDeL.js";const a=i(()=>t(()=>import("./AnimeInfo-o0Udf0og.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])));function p(){return o(e,{fallback:o(r,{}),children:o(a,{})})}export{p as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{T as Je,u as e,A as j,d as m,h as N,a as Ge,g as $e,q,S as F,$ as Ve,n as bt,o as vt}from"./vendor-core-8R2fFbyN.js";import{I as y}from"./vendor-icons-CDMuNDeL.js";import{u as yt}from"./vendor-query-BUTye89G.js";import{e as me,t as Ee,B as he,M as xe,U as R,z as oe,W as kt,T as ze}from"./index-
|
|
1
|
+
import{T as Je,u as e,A as j,d as m,h as N,a as Ge,g as $e,q,S as F,$ as Ve,n as bt,o as vt}from"./vendor-core-8R2fFbyN.js";import{I as y}from"./vendor-icons-CDMuNDeL.js";import{u as yt}from"./vendor-query-BUTye89G.js";import{e as me,t as Ee,B as he,M as xe,U as R,z as oe,W as kt,T as ze}from"./index-B5SLDCAi.js";import{M as wt}from"./MediaCard-DzA336CA.js";import{c as Qe,a as Ze,d as Nt,e as Xe,f as et,g as Ct,h as St,i as Tt,j as At,k as Ye,l as Re}from"./useAsmr-D6cSjbvt.js";import{a as t}from"./Asmr.module-ChUXDZKx.js";import{u as Mt,A as xt}from"./useAsmrPopup-DK1Vx-HV.js";import{l as Bt}from"./hls-Do_n10_Y.js";import"./vendor-ui-CUDCvRS_.js";import"./useIsMobile-Dm_b6Ob3.js";const Lt=({work:s,onClose:o,onPlay:S,t:g})=>{const{data:i,isLoading:h}=Qe(s.id||null),v=Ze(s),{data:A}=Nt(v||void 0),{toggle:k,bookmarkedIds:T}=Xe(),{data:I}=et(v||void 0),L=v?T.has(v):!!A?.inLibrary,C=Je(()=>(i?.description||s.description||"").split(`
|
|
2
2
|
`).map(l=>{const u=l.indexOf(":");return u===-1?null:{label:l.slice(0,u),value:l.slice(u+1).trim()}}).filter(l=>!!l&&!!l.value),[i?.description,s.description]),f=i?.tracks||[],w=Je(()=>{const l=I?.progress??[];return l.length>0?l.reduce((u,d)=>u.updatedAt>=d.updatedAt?u:d):null},[I]),M=w&&w.trackIndex<f.length?w.trackIndex:null;return e("div",{className:t.detailOverlay,onClick:o,children:e("div",{className:t.detailModal,onClick:l=>l.stopPropagation(),children:[e("button",{className:t.detailClose,onClick:o,"aria-label":"Close",children:e(y,{name:"times"})}),e("div",{className:t.detailHeader,children:[s.thumbnail?e("img",{className:t.detailCover,src:s.thumbnail,alt:s.name,decoding:"async"}):e("div",{className:`${t.detailCover} ${t.thumbPlaceholder}`}),e("div",{className:t.detailInfo,children:[e("h2",{className:t.detailTitle,children:g?g(s.name):s.name}),e("p",{className:t.detailRj,children:s.id}),C.map(l=>l.label==="Tags"?e("p",{className:t.metaRow,children:[e("span",{className:t.metaLabel,children:"Tags"}),e("span",{className:t.tagChips,children:l.value.split(", ").map(u=>e("span",{className:t.tagChip,children:u},u))})]},l.label):e("p",{className:t.metaRow,children:[e("span",{className:t.metaLabel,children:l.label}),l.value]},l.label))]})]}),e("div",{className:t.tracksSection,children:[e("h3",{className:t.tracksHeading,children:h?"Loading tracks…":`Tracks (${f.length})`}),!h&&(f.length>0?e("ul",{className:t.trackList,children:f.map((l,u)=>e("li",{children:e("button",{className:t.trackRow,onClick:()=>S(s,f,u),children:[e(y,{name:"play",className:t.trackIcon}),e("span",{className:t.trackLabel,children:l.resolutionStr}),e("span",{className:t.trackType,children:l.hls?"HLS":"MP3"})]})},l.link))}):e("p",{className:t.noTracks,children:"No audio streams available for this work."}))]}),e("div",{className:t.detailActions,children:[!h&&f.length>0&&e("button",{className:t.playAllBtn,onClick:()=>S(s,f,0),children:[e(y,{name:"play"})," Play from start"]}),!h&&M!==null&&w&&e("button",{className:t.playAllBtn,onClick:()=>S(s,f,M),children:[e(y,{name:"history"})," Resume track ",M+1," ·"," ",me(w.currentTime),w.duration>0?` / ${me(w.duration)}`:""]}),v&&e("button",{className:t.playAllBtn,onClick:()=>k({rjCode:v,title:s.name,thumbnail:s.thumbnail||"",isAdult:!!s.isAdult}),"aria-pressed":L,children:[e(y,{name:L?"check":"plus"})," ",L?"In listening list":"Add to listening list"]})]})]})})},Pt=({title:s,images:o,chapters:S,tracks:g,trackIndex:i,expanded:h,isAdult:v,rjCode:A,t:k,onTrackChange:T,onExpandedChange:I,onClose:L})=>{const C=j(null),f=j(null),[w,M]=m(!1),[l,u]=m(0),[d,P]=m(0),[p,U]=m(0),[B,Y]=m(!0),[D,_]=m(0),[ae,ie]=m(new Set),[J,ne]=m(!1),[pe,$]=m(!0),re=j("");re.current||(re.current=typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`asmr-${Date.now()}-${Math.random().toString(36).slice(2)}`);const[O,Ne]=m(()=>{const a=parseFloat(localStorage.getItem("asmrVolume")||"");return Number.isFinite(a)?a:1}),ge=j(O);N(()=>{ge.current=O},[O]);const fe=Ge(),V=$e.useMemo(()=>A?Ct(A):"",[A]),Ce=St(),ce=Tt(),{data:Se}=et(V||void 0),[Be,be]=m(!1),[H,Le]=m(0),[Pe,G]=m(!1),ve=j(""),W=j(null),K=j(0),Q=j(0),de=j(0),Z=g[i],X=Z?.link,Te=Z?.hls,n=Z?.resolutionStr||"",c=o.length>0,x=`${V}:${i}`,se=$e.useMemo(()=>(Se?.progress??[]).find(r=>r.trackIndex===i)??null,[Se,i]),ee=j({workId:"",trackIndex:0,trackLabel:""});ee.current={workId:V,trackIndex:i,trackLabel:n};const le=q((a,r,b,E=!1)=>{!a.workId||!b||b<10||!E&&Math.abs(r-K.current)<5||(K.current=r,Ce.mutate({workId:a.workId,trackIndex:a.trackIndex,trackLabel:a.trackLabel,currentTime:Math.floor(r),duration:Math.floor(b),title:s,thumbnail:o[0]||"",rjCode:a.workId,isAdult:v?1:0}))},[Ce,s,o,v]),z=q((a=!1)=>{W.current&&(clearTimeout(W.current),W.current=null),le(ee.current,Q.current,de.current,a)},[le]),ye=j(z);ye.current=z;const _e=j(le);_e.current=le;const ue=q(()=>{f.current&&(f.current.destroy(),f.current=null)},[]);N(()=>{const a=C.current;if(!a||!X)return;const r={workId:V,trackIndex:i,trackLabel:n},b=()=>{W.current&&(clearTimeout(W.current),W.current=null),_e.current(r,Q.current,de.current,!0)};if(u(0),P(0),U(0),M(!1),Q.current=0,de.current=0,K.current=0,ue(),Te){let E=!1;return(async()=>{const te=await Bt();if(!E)if(te&&te.isSupported()){const we=new te({enableWorker:!0});f.current=we,we.loadSource(X),we.attachMedia(a),a.play().catch(()=>M(!1))}else a.src=X,a.load(),a.volume=ge.current,a.play().catch(()=>M(!1))})(),()=>{E=!0,ue(),a.removeAttribute("src"),b()}}else a.src=X;return a.load(),a.volume=ge.current,a.play().catch(()=>M(!1)),()=>{ue(),a.removeAttribute("src"),b()}},[X,Te,ue,V,i,n]),N(()=>()=>ue(),[ue]),N(()=>{const a=()=>{document.visibilityState==="hidden"&&ye.current()},r=()=>ye.current();return document.addEventListener("visibilitychange",a),window.addEventListener("pagehide",r),()=>{document.removeEventListener("visibilitychange",a),window.removeEventListener("pagehide",r)}},[]),N(()=>{if(!se||ve.current===x||!(d>0))return;const a=se.currentTime||0,r=se.duration||d;a>=10&&r-a>=15&&Q.current<a?(ve.current=x,Le(a),be(!0)):ve.current=x},[se,d,x]),N(()=>{const a=C.current;a&&(a.volume=O)},[O]),N(()=>{if(h)return document.body.classList.add("asmr-player-open"),()=>document.body.classList.remove("asmr-player-open")},[h]),N(()=>{_(0)},[o]),N(()=>{h&&$(!0)},[h]),N(()=>{J&&$(!0)},[J]);const Ae=q(a=>{if(!s||g.length===0)return;const r=g[i],b=r?`${r.resolutionStr} (${i+1}/${g.length})`:"",E=C.current,te=E?E.currentTime:0,we=E&&E.duration||0,ft=o[0]||"";Ee.discord.asmrPresence.mutate({title:s,trackLabel:b,isPlaying:a,thumbnail:ft,thumbnails:o,currentTime:te,duration:we,isAdult:!!v,rjCode:A||"",sessionId:re.current}).catch(()=>{}),Ee.discord.heartbeat.mutate({sessionId:re.current}).catch(()=>{})},[s,g,i,o,v,A]);N(()=>{Ae(w)},[Ae,w,i,s,h]),N(()=>{if(!w)return;const a=window.setInterval(()=>Ae(!0),15e3);return()=>window.clearInterval(a)},[w,Ae]),N(()=>{const a=re.current,r=()=>{if(!a)return;const te=JSON.stringify({sessionId:a});navigator.sendBeacon?(navigator.sendBeacon("/api/discord/clear",new Blob([te],{type:"application/json"})),navigator.sendBeacon("/api/discord/heartbeat",new Blob([JSON.stringify({sessionId:a,bye:!0})],{type:"application/json"}))):(fetch("/api/discord/clear",{method:"POST",headers:{"Content-Type":"application/json"},body:te,keepalive:!0}).catch(()=>{}),fetch("/api/discord/heartbeat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:a,bye:!0}),keepalive:!0}).catch(()=>{}))},b=()=>r(),E=()=>{document.visibilityState==="hidden"&&r()};return window.addEventListener("pagehide",b),window.addEventListener("beforeunload",b),document.addEventListener("visibilitychange",E),()=>{window.removeEventListener("pagehide",b),window.removeEventListener("beforeunload",b),document.removeEventListener("visibilitychange",E),r()}},[]);const Me=q(a=>{ie(r=>{if(r.has(a))return r;const b=new Set(r);return b.add(a),b})},[]),at=q((a,r)=>{a&&a.complete&&a.naturalWidth>0&&Me(r)},[Me]);N(()=>{if(!h)return;const a=r=>{if(r.key==="Escape"){J?ne(!1):I(!1);return}!B||o.length<2||(r.key==="ArrowLeft"&&_(b=>Math.max(0,b-1)),r.key==="ArrowRight"&&_(b=>Math.min(o.length-1,b+1)))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[h,B,o.length,J,I]);const nt=()=>{const a=C.current;a&&(a.paused?a.play().catch(()=>{}):a.pause())},rt=a=>{const r=C.current;if(!r||!d)return;const b=parseFloat(a.target.value);r.currentTime=b,u(b)},st=()=>{z(!0),i<g.length-1?T(i+1):G(!0)},lt=a=>{const r=a.currentTarget.currentTime;Q.current=r,u(r),W.current&&clearTimeout(W.current),W.current=setTimeout(()=>ye.current(),5e3)},ot=()=>{M(!1),ye.current()},it=a=>{const r=a.currentTarget.duration;de.current=Number.isFinite(r)?r:0,P(a.currentTarget.duration)},ct=q(()=>{const a=C.current;a&&H>0&&(a.currentTime=H,Q.current=H,a.play().catch(()=>{})),be(!1)},[H]),je=q(()=>{be(!1)},[]),dt=q(()=>{V&&ce.mutate({rjCode:V,title:s,thumbnail:o[0]||"",status:"Completed",isAdult:!!v,silent:!0}),G(!1),L(),fe("/")},[V,ce,s,o,v,L,fe]),ut=S.reduce((a,r,b)=>l>=r.time?b:a,-1),mt=a=>{const r=C.current;r&&(r.currentTime=a,u(a))},Fe=a=>{const r=C.current;if(!r)return;const b=Number.isFinite(r.currentTime)?r.currentTime:l,E=Math.max(0,Math.min(d||1/0,b+a));r.currentTime=E,u(E),$(!0)},Oe=d?Math.min(100,l/d*100):0,ht=d?Math.min(100,Math.max(Oe,p/d*100)):0,pt=e(F,{children:[e("div",{className:t.playerButtons,children:[e("button",{className:t.playerBtn,onClick:()=>T(Math.max(0,i-1)),disabled:i===0,"aria-label":"Previous track",children:e(y,{name:"step-backward"})}),e("button",{className:`${t.playerBtn} ${t.seekBtn}`,onClick:()=>Fe(-10),"aria-label":"Seek back 10 seconds",title:"Back 10s",children:[e(y,{name:"undo"}),e("span",{className:t.seekBtnLabel,children:"10"})]}),e("button",{className:`${t.playerBtn} ${t.playBtn}`,onClick:nt,"aria-label":w?"Pause":"Play",children:w?e(y,{name:"pause"}):e(y,{name:"play"})}),e("button",{className:`${t.playerBtn} ${t.seekBtn}`,onClick:()=>Fe(10),"aria-label":"Seek forward 10 seconds",title:"Forward 10s",children:[e(y,{name:"redo"}),e("span",{className:t.seekBtnLabel,children:"10"})]}),e("button",{className:t.playerBtn,onClick:()=>T(Math.min(g.length-1,i+1)),disabled:i>=g.length-1,"aria-label":"Next track",children:e(y,{name:"step-forward"})})]}),e("div",{className:t.seekRow,children:[e("span",{className:t.timeLabel,children:me(l)}),e("input",{className:t.seekBar,type:"range",min:0,max:d||0,step:.1,value:Math.min(l,d||0),onChange:rt,style:{"--played-percent":`${Oe}%`,"--buffered-percent":`${ht}%`},"aria-label":"Seek"}),e("span",{className:t.timeLabel,children:me(d)})]})]}),He=e(F,{children:[e("button",{className:`${t.playerBtn} ${t.playerToggle}`,onClick:()=>I(!h),"aria-label":h?"Minimize player":"Expand player",title:h?"Minimize to browse":"Expand",children:h?e(y,{name:"chevron-down"}):e(y,{name:"chevron-up"})}),e("div",{className:t.playerInfo,children:[e("p",{className:t.playerTitle,title:s,children:k?k(s):s}),e("p",{className:t.playerTrack,children:[Z?.resolutionStr||"",g.length>1?` (${i+1}/${g.length})`:""]})]}),e("div",{className:t.playerControls,children:pt}),e("div",{className:t.playerRight,children:[O===0?e(y,{name:"volume-mute",className:t.volumeIcon}):O<.5?e(y,{name:"volume-down",className:t.volumeIcon}):e(y,{name:"volume-up",className:t.volumeIcon}),e("input",{className:t.volumeBar,type:"range",min:0,max:1,step:.01,value:O,onChange:a=>{const r=parseFloat(a.target.value);Ne(r),localStorage.setItem("asmrVolume",String(r))},style:{"--volume-percent":`${O*100}%`},"aria-label":"Volume"})]}),e("div",{className:t.playerActions,children:[h&&c&&e("button",{className:t.playerBtn,onClick:()=>Y(a=>!a),"aria-label":B?"Hide images":"Show images",title:B?"Hide images":"Show images",children:B?e(y,{name:"eye-slash"}):e(y,{name:"image"})}),h&&S.length>0&&e("button",{className:`${t.playerBtn} ${J?t.playerBtnActive:""}`,onClick:()=>ne(a=>!a),"aria-label":J?"Hide bookmarks":"Show bookmarks",title:"Timestamps",children:e(y,{name:"list-ol"})}),e("button",{className:t.playerBtn,onClick:L,"aria-label":"Close player",children:e(y,{name:"times"})})]})]}),Ue=e("audio",{ref:C,preload:"metadata",onPlay:()=>M(!0),onPause:ot,onTimeUpdate:lt,onLoadedMetadata:it,onProgress:a=>{const r=a.currentTarget;r.buffered.length>0&&U(r.buffered.end(r.buffered.length-1))},onEnded:st}),De=e(xe,{isOpen:Be,onClose:je,title:"Resume Listening",children:e("div",{style:{padding:"1rem",textAlign:"center"},children:[e("p",{children:["You were at ",e("strong",{children:me(H)}),Z?.resolutionStr?` in ${Z.resolutionStr}`:""]}),e("div",{style:{marginTop:"1rem",display:"flex",gap:"10px",justifyContent:"center"},children:[e(he,{variant:"secondary",onClick:je,children:"Start from Beginning"}),e(he,{onClick:ct,children:"Resume"})]})]})}),We=e(xe,{isOpen:Pe,onClose:()=>G(!1),title:"Finished!",children:e("div",{style:{padding:"1rem",textAlign:"center"},children:[e(y,{name:"check-circle",size:48,style:{color:"var(--accent-lighter)",marginBottom:"0.5rem"}}),e("p",{style:{fontSize:"1.1rem",fontWeight:600},children:k?k(s):s}),e("p",{style:{color:"var(--text-secondary)"},children:"You finished this work!"}),e("div",{style:{marginTop:"1rem",display:"flex",gap:"10px",justifyContent:"center"},children:[e(he,{variant:"secondary",onClick:()=>G(!1),children:"Close"}),e(he,{onClick:dt,children:"Mark Completed & Back to Home"})]})]})});if(!h)return Ve(e(F,{children:[Ue,e("div",{className:t.playerBar,children:He}),De,We]}),document.body);const ke=Math.min(D,Math.max(0,o.length-1)),qe=o[ke],gt=B&&c&&!!qe&&!ae.has(qe);return Ve(e(F,{children:[Ue,De,We,e("div",{className:`${t.npOverlay} ${pe?"":t.npOverlayControlsHidden}`,children:[e("div",{className:`${t.npStage} ${!B||!c?t.npStageBlank:""}`,onClick:()=>$(a=>!a),children:B&&c&&e(F,{children:[e("div",{className:t.sliderViewport,children:[e("div",{className:t.sliderTrack,style:{transform:`translateX(-${ke*100}%)`},children:o.map(a=>e("div",{className:t.slide,children:e("img",{ref:r=>at(r,a),src:a,alt:`${k?k(s):s} — work image`,loading:"lazy",decoding:"async",draggable:!1,onLoad:()=>Me(a),onError:()=>Me(a),className:`${t.slideImg} ${ae.has(a)?t.slideImgLoaded:""}`})},a))}),gt&&e("span",{className:t.slideSpinner,"aria-label":"Loading image"})]}),o.length>1&&e(F,{children:[e("button",{className:`${t.npArrow} ${t.npArrowLeft}`,onClick:a=>{a.stopPropagation(),_(r=>Math.max(0,r-1)),$(!0)},disabled:ke===0,"aria-label":"Previous image",children:e(y,{name:"chevron-left"})}),e("button",{className:`${t.npArrow} ${t.npArrowRight}`,onClick:a=>{a.stopPropagation(),_(r=>Math.min(o.length-1,r+1)),$(!0)},disabled:ke===o.length-1,"aria-label":"Next image",children:e(y,{name:"chevron-right"})}),e("span",{className:t.npImageCount,onClick:a=>a.stopPropagation(),children:[ke+1," / ",o.length]})]})]})}),e("div",{className:`${t.playerBar} ${t.playerBarDocked} ${pe?"":t.playerBarDockedHidden}`,onClick:a=>a.stopPropagation(),children:[He,J&&e(F,{children:[e("div",{className:t.npBackdrop,onClick:()=>ne(!1)}),e("div",{className:t.chapterPanel,children:S.map((a,r)=>e("button",{className:`${t.chapterRow} ${r===ut?t.chapterRowActive:""}`,title:k?k(a.label):a.label,onClick:()=>{mt(a.time),ne(!1)},children:[e("span",{className:t.chapterRowTime,children:me(a.time)}),e("span",{className:t.chapterRowLabel,title:k?k(a.label):a.label,children:k?k(a.label):a.label})]},`${a.time}-${r}`))})]})]})]})]}),document.body)},Rt="https://github.com/serifpersia/dango/releases/latest/download/dango-extension.zip",It=s=>{try{return JSON.parse(s.detail)}catch{return null}},$t=({isOpen:s,onClose:o,onSuccess:S})=>{const[g,i]=m(1),[h,v]=m(typeof navigator<"u"?navigator.userAgent:""),[A,k]=m(""),[T,I]=m(!1),[L,C]=m(!1),f=j(null),w=typeof navigator<"u"?navigator.userAgent:"",M=/android/i.test(w),l=/firefox|fxios/i.test(w)&&!M,u=!l&&!M&&/chrome|chromium|edg|brave/i.test(w),d=l||u;N(()=>{s&&(i(1),v(typeof navigator<"u"?navigator.userAgent:""),k(""),I(!1),C(!1))},[s]),N(()=>()=>{f.current&&(window.removeEventListener("dango:jasmr-cookie",f.current),f.current=null)},[]);const P=async()=>{localStorage.setItem("jasmr_ua",h),window.open("https://japaneseasmr.com","_blank","noopener,noreferrer"),i(2)},p=()=>{if(L)return;C(!0);const B=window.setTimeout(()=>{C(!1),f.current&&(window.removeEventListener("dango:jasmr-cookie",f.current),f.current=null),oe.error("Helper not detected — install it via about:debugging first.")},3e3),Y=D=>{window.clearTimeout(B),window.removeEventListener("dango:jasmr-cookie",Y),f.current=null,C(!1);const _=It(D);if(_?.ok&&_.cookie)k(_.cookie),oe.success("Cookie extracted from helper!");else if(_?.error==="NO_COOKIE"){const ae=_.debug?.stores?.length??0,ie=_.debug?.names??[];oe.error(`Helper found no cf_clearance (checked ${ae} stores, saw: ${ie.join(", ")||"none"}) — solve the challenge on the JapaneseASMR tab first.`)}else oe.error("Helper request failed — try again.")};f.current=Y,window.addEventListener("dango:jasmr-cookie",Y),window.dispatchEvent(new CustomEvent("dango:get-jasmr-cookie"))},U=async()=>{if(!A.trim()){oe.error("Please enter the cf_clearance cookie");return}I(!0);try{localStorage.setItem("jasmr_cookie",A.trim()),oe.success("Cookie updated successfully!"),S?.(),o()}catch{oe.error("Failed to save cookie")}finally{I(!1)}};return e(xe,{isOpen:s,onClose:o,title:"JapaneseASMR Verification Required",children:e("div",{className:R.container,children:g===1?e(F,{children:[e("p",{children:["JapaneseASMR is protected by a Cloudflare challenge. Solve it once in your browser and paste the ",e("strong",{children:"cf_clearance"})," cookie so the app can load the site for you."]}),e("div",{className:R.field,children:[e("label",{children:"Your User-Agent (must match the browser you solve the challenge with):"}),e("textarea",{value:h,onChange:B=>v(B.target.value),rows:3,className:R.textarea})]}),e("div",{className:R.actions,children:[e("button",{className:R.secondaryButton,onClick:o,children:"Cancel"}),e("button",{className:R.button,onClick:P,children:"Start Verification (Opens JapaneseASMR)"})]})]}):e(F,{children:[e("p",{children:["1. Solve the challenge on the ",e("strong",{children:"JapaneseASMR tab"})," (keep that tab open).",e("br",{}),"2. Copy the ",e("strong",{children:"cf_clearance"})," cookie value using one of these:",e("br",{}),e("br",{}),e("strong",{children:"Chrome / Edge — DevTools:"})," press ",e("code",{children:"F12"})," →"," ",e("strong",{children:"Application"})," → ",e("strong",{children:"Cookies"})," →"," ",e("code",{children:"https://japaneseasmr.com"}),". Find ",e("strong",{children:"cf_clearance"}),", double-click its ",e("strong",{children:"Value"})," to select it, then copy.",e("br",{}),e("br",{}),e("strong",{children:"Firefox — Storage Inspector:"})," press ",e("code",{children:"F12"})," →"," ",e("strong",{children:"Storage"})," → ",e("strong",{children:"Cookies"})," →"," ",e("code",{children:"https://japaneseasmr.com"}),". Find ",e("strong",{children:"cf_clearance"}),", right-click the value → ",e("strong",{children:"Copy Value"}),".",e("br",{}),e("br",{}),e("strong",{children:"Either browser — extension:"})," open"," ",e("strong",{children:"Cookie Manager"})," while on the JapaneseASMR tab, find"," ",e("strong",{children:"cf_clearance"}),", and copy its value (or use the extension's export).",e("br",{}),e("br",{}),"3. Paste it below. Copy ",e("strong",{children:"only the value"})," — remove any"," ",e("code",{children:"cf_clearance="})," prefix or quotes if they were included."]}),d&&e("div",{className:R.hint,children:[e("strong",{children:"Dango helper (one-time setup):"})," ",l?e(F,{children:["type ",e("code",{children:"about:debugging"})," in the address bar →"," ",e("strong",{children:"This Firefox"})," → ",e("strong",{children:"Load Temporary Add-on"})," ","→ open the ",e("code",{children:"dango-extension/firefox"})," folder and pick"," ",e("code",{children:"manifest.json"}),". (Temporary helpers unload when Firefox closes — repeat after a restart.)"]}):e(F,{children:["type ",e("code",{children:"chrome://extensions"})," in the address bar → enable"," ",e("strong",{children:"Developer mode"})," → ",e("strong",{children:"Load unpacked"})," → open the ",e("code",{children:"dango-extension/chrome"})," folder. (Unpacked helpers show a developer-mode notice — expected.)"]})," ","Use this link to download the extension and extract it:"," ",e("a",{href:Rt,target:"_blank",rel:"noreferrer",className:R.link,children:"dango-extension.zip"}),". Then click Extract below and the field fills itself.",e("div",{className:R.actions,children:e("button",{className:R.button,onClick:p,disabled:L,type:"button",children:L?"Extracting…":"Extract cookie from helper"})})]}),e("div",{className:R.field,children:[e("label",{children:"cf_clearance cookie value:"}),e("input",{type:"text",value:A,onChange:B=>k(B.target.value),placeholder:"e.g. xxxxxxxx.xxxxxxxx.xxxxxxx-xxxxxxx",className:R.input})]}),e("div",{className:R.actions,children:[e("button",{className:R.secondaryButton,onClick:o,children:"Cancel"}),e("button",{className:R.secondaryButton,onClick:()=>i(1),children:"Back"}),e("button",{className:R.button,onClick:U,disabled:T,children:T?"Saving...":"Submit"})]})]})})})},tt="asmrTranslateCache",Et=10080*60*1e3;function _t(){try{const s=localStorage.getItem(tt);if(!s)return new Map;const o=JSON.parse(s);return new Map(Object.entries(o))}catch{return new Map}}function jt(s){try{const o={};for(const[S,g]of s)o[S]=g;localStorage.setItem(tt,JSON.stringify(o))}catch{}}function Ke(s){return/[\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FAF]/.test(s)}async function Ft(s){const o=s.map(i=>i.trim()).filter(Boolean);if(o.length===0)return new Map;const S=await Ee.settings.translate.mutate({texts:o,source:"ja",target:"en"}),g=new Map;for(const[i,h]of Object.entries(S.translations||{}))g.set(i,h);for(const i of o)g.has(i)||g.set(i,i);return g}function Ot(s,o){const[S,g]=m(new Map),[i,h]=m(!1),v=j(null),A=s.join("");return N(()=>{const T=A?A.split(""):[];if(!o||T.length===0){g(new Map),h(!1);return}const I=Array.from(new Set(T.map(l=>l.trim()).filter(Boolean).filter(Ke)));if(I.length===0){g(new Map);return}v.current||(v.current=_t());const L=Date.now(),C=new Map,f=[];for(const l of I){const u=v.current.get(l);u&&L-u.ts<Et?C.set(l,u.t):f.push(l)}if(f.length===0){g(C);return}let w=!1;h(!0);const M=[];for(let l=0;l<f.length;l+=15)M.push(f.slice(l,l+15));return(async()=>{const l=new Map;for(const d of M){try{const P=await Ft(d);for(const[p,U]of P)l.set(p,U)}catch{}await new Promise(P=>setTimeout(P,120))}if(w)return;if(v.current){for(const[d,P]of l)v.current.set(d,{t:P,ts:Date.now()});jt(v.current)}const u=new Map([...C,...l]);g(u),h(!1)})(),()=>{w=!0}},[o,A]),{t:T=>!o||!T||!Ke(T)?T:S.get(T.trim())||T,map:S,isTranslating:i}}const Ht=[{label:"Date",options:[{value:"latest",label:"Latest"},{value:"oldest",label:"Oldest"}]},{label:"Title",options:[{value:"title_asc",label:"A → Z"},{value:"title_desc",label:"Z → A"}]},{label:"Popular (Views)",options:[{value:"popular_recent",label:"Recent"},{value:"popular_week",label:"Week"},{value:"popular_month",label:"Month"},{value:"popular_6_months",label:"6 Months"},{value:"popular_year",label:"Year"},{value:"popular",label:"All Time"}]},{label:"Most Commented",options:[{value:"comments_week",label:"Week"},{value:"comments_month",label:"Month"},{value:"comments_year",label:"Year"},{value:"comments",label:"All Time"}]},{label:"Other",options:[{value:"random",label:"Random"}]}],Ut=[{value:"",label:"All"},{value:"sfw",label:"SFW / 全年齢"},{value:"r-15",label:"R-15"},{value:"r-18",label:"NSFW / R18"},{value:"yuri",label:"Yuri / Girls love / 百合"},{value:"otokonoko",label:"Otoko no ko / 男の娘"},{value:"futanari",label:"Futanari / フタナリ"},{value:"r-18g",label:"R-18G / グロ"}],Dt=[{value:"sfw",label:"SFW / 全年齢"}],Ie="agreedToViewMature",ea=()=>{const{rj:s}=bt(),o=Ge(),[S,g]=vt(),[i,h]=m(()=>localStorage.getItem(Ie)==="true"),[v,A]=m(!1),[k,T]=m(()=>S.get("q")||""),[I,L]=m(()=>S.get("q")||""),[C,f]=m("latest"),[w,M]=m("sfw"),[l,u]=m(1),[d,P]=m(null),[p,U]=m(null),[B,Y]=m(!0),[D,_]=m(()=>localStorage.getItem("asmrTranslateEN")==="true"),[ae,ie]=m(!1),J=yt(),{toggle:ne,bookmarkedIds:pe}=Xe(),{popup:$,openPopup:re,scheduleClose:O,cancelClose:Ne,closePopup:ge}=Mt();N(()=>kt("jasmr",()=>ie(!0)),[]),N(()=>{localStorage.setItem("asmrTranslateEN",String(D))},[D]),N(()=>{const n=()=>h(localStorage.getItem(Ie)==="true");return window.addEventListener("focus",n),window.addEventListener("storage",n),()=>{window.removeEventListener("focus",n),window.removeEventListener("storage",n)}},[]);const fe=i,V=fe?w:"sfw",Ce=fe?Ut:Dt,{data:ce,isLoading:Se,isError:Be,isFetching:be}=At(I,l,C,V),H=$e.useMemo(()=>ce?.shows??[],[ce?.shows]),Le=ce?.hasNext??!1;N(()=>{if(!s){d&&!p&&P(null);return}const n=s.toUpperCase();if(p&&(p.work.id?.toUpperCase()===n||p.work._id?.toUpperCase()===n)){d&&P(null);return}const c=H.find(x=>(x.id||x._id)?.toUpperCase()===n);c?(!d||(d.id||d._id)!==(c.id||c._id))&&P(c):(!d||(d.id||d._id)?.toUpperCase()!==n)&&P({_id:n,id:n,name:n})},[s,H,p,d]);const Pe=q(()=>{o("/asmr")},[o]);N(()=>{!s&&p&&U(null)},[s,p]);const{data:G}=Qe(p&&p.work.id||null),ve=p?[p.work.thumbnail,...G?.images||[]].filter(Boolean):[],W=[...H.map(n=>n.name),d?.name||"",p?.work.name||"",...G?.chapters?.map(n=>n.label)||[]].filter(Boolean),{t:K}=Ot(W,D);N(()=>{const n=p?p.work.name:d?d.name:s?s.toUpperCase():"",c=n?D?K(n):n:"",x=c?`${c} - dango`:"dango";document.title=x;try{window.history.replaceState(window.history.state,x,window.location.href)}catch{}},[d,p,s,D,K]);const Q=n=>{n.preventDefault(),L(k),u(1);const c=new URLSearchParams(S);k.trim()?c.set("q",k.trim()):c.delete("q"),c.delete("page"),g(c,{replace:!0})};N(()=>{const n=S.get("q")||"";T(c=>c===n?c:n),L(c=>c===n?c:n),u(1)},[S]);const de=n=>{n.target.checked&&!i&&A(!0)},Z=()=>{localStorage.setItem(Ie,"true"),h(!0),A(!1),u(1)},X=()=>{A(!1)},Te=q((n,c,x)=>{P(null),Y(!0),U({work:n,tracks:c,index:x})},[]);return e("div",{className:`${t.page} ${p?t.pageWithPlayer:""}`,children:[!(p&&B)&&e(F,{children:[e("header",{className:t.header,children:[e("h1",{className:t.pageTitle,children:[e(y,{name:"headphones"})," ASMR"]}),e("form",{className:t.searchForm,onSubmit:Q,children:[e("input",{className:t.searchInput,type:"text",value:k,onChange:n=>T(n.target.value),placeholder:"Search works, circles, CV… (-word excludes)","aria-label":"Search ASMR works"}),e("button",{className:t.searchBtn,type:"submit","aria-label":"Search",children:e(y,{name:"search"})})]})]}),e("div",{className:t.filterBar,children:[e("label",{className:t.filterLabel,htmlFor:"asmr-sort",children:"Sort"}),e("select",{id:"asmr-sort",className:t.sortSelect,value:C,onChange:n=>{f(n.target.value),u(1)},children:Ht.map(n=>e("optgroup",{label:n.label,children:n.options.map(c=>e("option",{value:c.value,children:c.label},c.value))},n.label))}),e("label",{className:t.filterLabel,htmlFor:"asmr-rating",children:"Type"}),e("select",{id:"asmr-rating",className:t.sortSelect,value:w,onChange:n=>{M(n.target.value),u(1)},children:Ce.map(n=>e("option",{value:n.value,children:n.label},n.value))}),e("div",{className:t.filterTogglesGroup,children:[e("div",{className:t.translateToggleWrap,children:[e("span",{className:t.filterLabel,children:"JP"}),e(ze,{id:"asmr-translate-toggle",isChecked:D,onChange:n=>_(n.target.checked)}),e("span",{className:t.filterLabel,children:"EN"})]}),!i&&e("div",{className:t.matureToggleWrap,children:[e("label",{className:t.matureLabel,htmlFor:"asmr-mature-toggle",children:"Mature"}),e(ze,{id:"asmr-mature-toggle",isChecked:!1,onChange:de})]})]})]}),Be?e("p",{className:t.statusMsg,children:"Failed to load works. Please try again."}):Se&&H.length===0?e("div",{className:t.grid,"aria-hidden":!0,children:Array.from({length:12}).map((n,c)=>e("div",{className:t.skeletonCard,children:[e("div",{className:`${t.skeletonThumb} ${t.shimmer}`}),e("div",{className:`${t.skeletonLine} ${t.shimmer}`,style:{width:"88%"}}),e("div",{className:`${t.skeletonLine} ${t.shimmer}`,style:{width:"55%"}})]},c))}):H.length===0?e("p",{className:t.statusMsg,children:"No works found."}):e(F,{children:[e("div",{className:`${t.grid} ${be?t.fetching:""}`,children:H.map(n=>{const c=D?{...n,name:K(n.name)}:n,x=Ze(n),se=Ye(x),ee=pe.has(se),le=`/asmr/${encodeURIComponent(x)}`;return e("div",{className:t.asmrCardWrap,children:[e(wt,{item:{id:se,title:c.name,thumbnail:n.thumbnail||"",typeBadge:x||void 0,isAdult:Re(n)},linkTo:le,hoverIcon:"info",layout:"horizontal",showInfoButton:!0,display:{elements:{poster:{typeBadge:!0,chapterBadge:!1,adultBadge:!0},info:{title:!0,mobileBadges:!0,progress:!1,meta:!1}}},onOpenDetails:z=>re(z,{rjCode:x,title:c.name,thumbnail:n.thumbnail||"",isAdult:Re(n),rating:n.rating,listenTarget:le}),onPopupHoverIntent:z=>z?Ne():O(),rawThumbnail:!0}),e("button",{className:`${t.bookmarkBtn} ${ee?t.bookmarked:""}`,onClick:z=>{z.preventDefault(),z.stopPropagation(),ne({rjCode:x,title:n.name,thumbnail:n.thumbnail||"",isAdult:Re(n)})},title:ee?"Remove from listening list":"Add to listening list","aria-label":ee?"Remove from listening list":"Add to listening list","aria-pressed":ee,children:e(y,{name:ee?"check":"plus",size:12})})]},n._id||n.id)})}),e("nav",{className:t.pagination,children:[e("button",{className:t.pageBtn,disabled:l<=1,onClick:()=>u(n=>Math.max(1,n-1)),children:"Previous"}),e("span",{className:t.pageIndicator,children:["Page ",l]}),e("button",{className:t.pageBtn,disabled:!Le,onClick:()=>u(n=>n+1),children:"Next"})]})]})]}),d&&e(Lt,{work:d,onClose:Pe,onPlay:Te,t:K}),$&&e(xt,{data:$.data,anchorRect:$.rect,bookmarked:pe.has(Ye($.data.rjCode)),onToggleBookmark:()=>ne({rjCode:$.data.rjCode,title:$.data.title,thumbnail:$.data.thumbnail||"",isAdult:$.data.isAdult}),onMouseEnter:Ne,onMouseLeave:O,onRequestClose:ge}),ae&&e($t,{isOpen:ae,onClose:()=>ie(!1),onSuccess:()=>{J.invalidateQueries({queryKey:["asmrBrowse"]}),J.invalidateQueries({queryKey:["asmrWork"]})}}),v&&e(xe,{isOpen:v,title:"Content Warning",onClose:X,children:e("div",{style:{padding:"var(--space-4)",textAlign:"center"},children:[e("p",{children:"This section contains mature content intended for adult audiences."}),e("p",{children:["By proceeding, you confirm that you are ",e("strong",{children:"18 years of age or older"})," (or the age of majority in your jurisdiction) and wish to view this content."]}),e("p",{style:{fontSize:"var(--font-size-xs)",color:"var(--text-secondary)",marginTop:"var(--space-4)"},children:["You can reset this preference at any time in the ",e("strong",{children:"Settings"})," page."]}),e("div",{style:{marginTop:"var(--space-4)",display:"flex",gap:"var(--space-2-5)",justifyContent:"center"},children:[e(he,{variant:"secondary",onClick:X,children:"Go Back"}),e(he,{onClick:Z,children:"I'm 18+, Continue"})]})]})}),p&&e(Pt,{title:p.work.name,images:ve,chapters:G?.chapters||[],tracks:p.tracks,trackIndex:p.index,expanded:B,isAdult:!!p.work.isAdult,rjCode:p.work.id||p.work._id,t:K,onTrackChange:n=>U(c=>c&&{...c,index:n}),onExpandedChange:Y,onClose:()=>{U(null),Y(!0),s&&o("/asmr")}})]})};export{ea as default};
|
package/client/dist/assets/{AsmrResetProgressModal-CKYm-8cp.js → AsmrResetProgressModal-C9R7HlNa.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as a,u as i}from"./vendor-core-8R2fFbyN.js";import{R as l}from"./ResetProgressModal-
|
|
1
|
+
import{d as a,u as i}from"./vendor-core-8R2fFbyN.js";import{R as l}from"./ResetProgressModal-CByRM1Fh.js";import{s as f,n as R}from"./useAsmr-D6cSjbvt.js";const p=({workId:e,title:m,onClose:o})=>{const[r,s]=a(!1),t=f(),n=R();return i(l,{isOpen:!!e,itemName:m,progressKind:"listening",listLabel:"my listening list",alsoRemove:r,onAlsoRemoveChange:s,onClose:()=>{s(!1),o()},onConfirm:()=>{e&&(t.mutate({workId:e}),r&&n.mutate({id:e}),s(!1),o())}})};export{p as A};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as t,A as y,d as S,h as P,q as I,T as ce,$ as Bt}from"./vendor-core-8R2fFbyN.js";import{I as K}from"./vendor-icons-CDMuNDeL.js";import{S as _e,g as Lt,e as Tt,B as se}from"./index-
|
|
1
|
+
import{u as t,A as y,d as S,h as P,q as I,T as ce,$ as Bt}from"./vendor-core-8R2fFbyN.js";import{I as K}from"./vendor-icons-CDMuNDeL.js";import{S as _e,g as Lt,e as Tt,B as se}from"./index-B5SLDCAi.js";import{u as Nt}from"./vendor-query-BUTye89G.js";import{f as we}from"./useProviders-D3L1Chqc.js";const It="_controls_13898_1",Pt="_titleContainer_13898_9",Mt="_scheduleInfo_13898_15",$t="_status_13898_23",At="_nextEpisode_13898_35",Rt="_watchlistBtn_13898_45",Ft="_inList_13898_72",Dt="_queueBtn_13898_83",Ot="_queueActive_13898_95",qt="_modeToggleBtn_13898_101",Ht="_modeToggleActive_13898_108",zt="_nativeToggleBtn_13898_119",Wt="_nativeToggleActive_13898_132",Vt="_markWatchedBtn_13898_153",Ut="_markWatchedDone_13898_167",Kt="_completeSeriesBtn_13898_178",Gt="_providerAndEpisodeRow_13898_192",Jt="_episodeActions_13898_199",Qt="_desktopEpisodeActions_13898_206",Xt="_mobileEpisodeActions_13898_213",jt="_episodeNavBtn_13898_217",Yt="_primary_13898_247",Zt="_secondary_13898_257",en="_episodePickerBtn_13898_261",tn="_queueCountdown_13898_265",nn="_speedBoostBadge_13898_280",rn="_videoContainer_13898_311",on="_loadingOverlay_13898_324",sn="_loadingDots_13898_338",cn="_dot_13898_343",an="_bounce_13898_1",ln="_bufferingOverlay_13898_372",un="_bufferingSpinner_13898_381",dn="_spin_13898_920",pn="_videoIframe_13898_396",fn="_videoElementHidden_13898_419",mn="_upscalerCanvas_13898_424",_n="_upscalerActive_13898_437",hn="_upscalerStatusBadge_13898_441",gn="_subtitleOverlay_13898_456",vn="_controlsOverlay_13898_468",yn="_hidden_13898_498",bn="_centerPlayPause_13898_504",wn="_bottomControls_13898_536",Sn="_progressBarContainer_13898_553",Cn="_progressBar_13898_553",kn="_scrubbing_13898_576",xn="_watchedBar_13898_581",En="_bufferedBar_13898_582",Bn="_thumb_13898_604",Ln="_timeBubble_13898_625",Tn="_skipSegment_13898_647",Nn="_op_13898_661",In="_ed_13898_665",Pn="_recap_13898_669",Mn="_bottomControlsRow_13898_673",$n="_controlBtn_13898_681",An="_timeDisplay_13898_705",Rn="_leftControls_13898_714",Fn="_rightControls_13898_715",Dn="_middleControls_13898_716",On="_skipControls_13898_722",qn="_skipBtn_13898_728",Hn="_volumeContainer_13898_752",zn="_volumeSlider_13898_759",Wn="_settingsMenu_13898_837",Vn="_slideUp_13898_1",Un="_qualityListInMenu_13898_876",Kn="_ccOptionsContainer_13898_877",Gn="_qualityItemInMenu_13898_885",Jn="_ccItem_13898_886",Qn="_active_13898_907",Xn="_sourceLoader_13898_914",jn="_spinner_13898_920",Yn="_skipBubble_13898_971",Zn="_skipIcon_13898_975",er="_skipText_13898_978",tr="_watchBtn_13898_990",nr="_errorOverlay_13898_1036",rr="_retryButton_13898_1046",or="_skipIndicatorContainer_13898_1073",sr="_leftSkip_13898_1073",ir="_rightSkip_13898_1076",cr="_sourceSelectionContainer_13898_1081",ar="_slideUpIn_13898_1",lr="_providerSelectContainer_13898_1096",ur="_providerSelect_13898_1096",dr="_sourceSelect_13898_1081",pr="_sourceButtons_13898_1152",fr="_sourceButton_13898_1152",mr="_detailsBox_13898_1184",_r="_detailsToggleBtn_13898_1197",hr="_detailsGridContainer_13898_1221",gr="_fadeIn_13898_1",vr="_detailItem_13898_1233",yr="_animeStatus_13898_1253",br="_genresList_13898_1266",wr="_genreTag_13898_1273",Sr="_loadingDetails_13898_1291",Cr="_descriptionSection_13898_1298",kr="_description_13898_1298",xr="_epJumpControls_13898_1334",Er="_epRangeButtons_13898_1345",Br="_metaTags_13898_1351",Lr="_epRangeBtn_13898_1358",Tr="_epJumpInputGroup_13898_1373",Nr="_fullscreenActive_13898_1405",Ir="_skipRipple_13898_1",Pr="_errorSubtext_13898_1511",fs={controls:It,titleContainer:Pt,scheduleInfo:Mt,status:$t,nextEpisode:At,watchlistBtn:Rt,inList:Ft,queueBtn:Dt,queueActive:Ot,modeToggleBtn:qt,modeToggleActive:Ht,nativeToggleBtn:zt,nativeToggleActive:Wt,markWatchedBtn:Vt,markWatchedDone:Ut,completeSeriesBtn:Kt,providerAndEpisodeRow:Gt,episodeActions:Jt,desktopEpisodeActions:Qt,mobileEpisodeActions:Xt,episodeNavBtn:jt,primary:Yt,secondary:Zt,episodePickerBtn:en,queueCountdown:tn,speedBoostBadge:nn,videoContainer:rn,loadingOverlay:on,loadingDots:sn,dot:cn,bounce:an,bufferingOverlay:ln,bufferingSpinner:un,spin:dn,videoIframe:pn,videoElementHidden:fn,upscalerCanvas:mn,upscalerActive:_n,upscalerStatusBadge:hn,subtitleOverlay:gn,controlsOverlay:vn,hidden:yn,centerPlayPause:bn,bottomControls:wn,progressBarContainer:Sn,progressBar:Cn,scrubbing:kn,watchedBar:xn,bufferedBar:En,thumb:Bn,timeBubble:Ln,skipSegment:Tn,op:Nn,ed:In,recap:Pn,bottomControlsRow:Mn,controlBtn:$n,timeDisplay:An,leftControls:Rn,rightControls:Fn,middleControls:Dn,skipControls:On,skipBtn:qn,volumeContainer:Hn,volumeSlider:zn,settingsMenu:Wn,slideUp:Vn,qualityListInMenu:Un,ccOptionsContainer:Kn,qualityItemInMenu:Gn,ccItem:Jn,active:Qn,sourceLoader:Xn,spinner:jn,skipBubble:Yn,skipIcon:Zn,skipText:er,watchBtn:tr,errorOverlay:nr,retryButton:rr,skipIndicatorContainer:or,leftSkip:sr,rightSkip:ir,sourceSelectionContainer:cr,slideUpIn:ar,providerSelectContainer:lr,providerSelect:ur,sourceSelect:dr,sourceButtons:pr,sourceButton:fr,detailsBox:mr,detailsToggleBtn:_r,detailsGridContainer:hr,fadeIn:gr,detailItem:vr,animeStatus:yr,genresList:br,genreTag:wr,loadingDetails:Sr,descriptionSection:Cr,description:kr,epJumpControls:xr,epRangeButtons:Er,metaTags:Br,epRangeBtn:Lr,epJumpInputGroup:Tr,fullscreenActive:Nr,skipRipple:Ir,errorSubtext:Pr},Mr="_playerPageLayout_xfhzl_1",$r="_episodeSidebar_xfhzl_15",Ar="_playerMain_xfhzl_28",Rr="_videoPlayerWrapper_xfhzl_36",Fr="_playerInfoHeader_xfhzl_52",Dr="_playerAnimeCard_xfhzl_58",Or="_playerInfoContainer_xfhzl_70",qr="_videoTitleSection_xfhzl_94",Hr="_theaterMode_xfhzl_276",ms={playerPageLayout:Mr,episodeSidebar:$r,playerMain:Ar,videoPlayerWrapper:Rr,playerInfoHeader:Fr,playerAnimeCard:Dr,playerInfoContainer:Or,videoTitleSection:qr,theaterMode:Hr},zr="_shell_41rxp_1",Wr="_stage_41rxp_37",Vr="_shellFill_41rxp_85",Ur="_shellFullscreen_41rxp_93",Kr="_uiLayer_41rxp_107",Gr="_volumeWrap_41rxp_118",Jr="_volumeSlider_41rxp_124",Z={shell:zr,stage:Wr,shellFill:Vr,shellFullscreen:Ur,uiLayer:Kr,volumeWrap:Gr,volumeSlider:Jr},Qr=.8,Xr=5,_s=2e3,Ve="autoplayEnabled",jr=(e,n)=>n>0&&e>=n*Qr,hs=(e,n)=>e>Xr&&!jr(e,n),gs=()=>{try{return localStorage.getItem(Ve)==="true"}catch{return!1}},vs=e=>{try{localStorage.setItem(Ve,String(e))}catch{}},ys=e=>e.seekInduced?"none":e.autoplayEnabled&&e.hasNext?"advance":e.hasNext?"prompt-next":e.isFinal?"prompt-complete":"none",Yr=e=>(e.language??e.lang??"").toLowerCase(),Zr=e=>(e.label??"").toLowerCase(),eo=e=>`${e.language??e.lang??""}|||${e.label??""}`,to=e=>Yr(e).startsWith("en")||Zr(e).includes("english");function bs(e,n){if(e.length===0||n?.enabled===!1)return-1;const r=n?.lastKey??null;if(r){const o=e.findIndex(l=>eo(l)===r);if(o>=0)return o}const s=e.findIndex(to);return s>=0?s:0}const J={fontSize:1.8,position:0,bgOpacity:.5,bgColor:"#000000",textColor:"#ffffff",edge:"shadow",bold:!1},xe=(e,n,r)=>Math.max(n,Math.min(r,e)),Ee=e=>typeof e=="string"&&/^#[0-9a-fA-F]{6}$/.test(e),Se=(e,n,r,s)=>{try{const o=localStorage.getItem(e);if(o===null)return n;const l=parseFloat(o);return Number.isFinite(l)?xe(l,r,s):n}catch{return n}};function no(){let e=J.edge,n=J.bgColor,r=J.textColor,s=J.bold;try{const o=localStorage.getItem("subtitleEdge");(o==="shadow"||o==="outline"||o==="none")&&(e=o);const l=localStorage.getItem("subtitleBgColor");Ee(l)&&(n=l);const m=localStorage.getItem("subtitleTextColor");Ee(m)&&(r=m);const b=localStorage.getItem("subtitleBold");b!==null&&(s=b==="true")}catch{}return{fontSize:Se("subtitleFontSize",J.fontSize,.5,10),position:Se("subtitlePosition",J.position,0,100),bgOpacity:Se("subtitleBgOpacity",J.bgOpacity,0,1),bgColor:n,textColor:r,edge:e,bold:s}}function Ue(e,n){const r=`rgba(0, 0, 0, ${xe(n,0,1)})`;if(!Ee(e))return r;const s=parseInt(e.slice(1,3),16),o=parseInt(e.slice(3,5),16),l=parseInt(e.slice(5,7),16);return`rgba(${s}, ${o}, ${l}, ${xe(n,0,1)})`}function Ke(e,n){return e==="none"?n<=0?"0 1px 3px rgba(0, 0, 0, 0.9)":"none":e==="outline"?["-1px 0 0 black","1px 0 0 black","0 -1px 0 black","0 1px 0 black","-1px -1px 0 black","1px -1px 0 black","-1px 1px 0 black","1px 1px 0 black","0 0 6px rgba(0, 0, 0, 0.9)"].join(", "):"0 0 4px black, 0 1px 2px rgba(0, 0, 0, 0.8)"}function ws(e){return`
|
|
2
2
|
video::cue {
|
|
3
3
|
font-size: ${e.fontSize}rem !important;
|
|
4
4
|
color: ${e.textColor} !important;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as D,A as G,h as O,q as P,g as U,u as e,L as Pe,T as Y,S as ie,a as te,_ as je}from"./vendor-core-8R2fFbyN.js";import{b as Ze,u as Je,a as et}from"./vendor-query-BUTye89G.js";import{S as De,A as Ee,P as tt}from"./SkeletonGrid-CLEPY9nP.js";import{A as oe}from"./AnimeCard-CJy1SXH3.js";import{I as F}from"./vendor-icons-CDMuNDeL.js";import{u as ke,a as le,b as at,c as nt,t as rt,d as We,s as ot,f as Se,B as ze,e as re,g as st,h as Le,i as lt,j as it,k as ct,l as dt,m as ut,n as ht,o as mt,p as pt,q as gt}from"./index-BXwhFWB_.js";import{u as vt}from"./vendor-ui-CUDCvRS_.js";import{E as Ce}from"./ErrorMessage-z4f4WGgP.js";import{R as Oe}from"./ResetProgressModal-CcStlbhP.js";import{Q as _t}from"./QueueRail-O7f4RqjB.js";import{M as _e}from"./MediaCard-B5584Cq9.js";import{u as Fe,M as Ve}from"./useMangaPopup-B8nnpvyi.js";import{M as ft}from"./MangaResetProgressModal-QjZyIAjl.js";import{u as Ge,a as bt,m as we,i as Ue,b as qe,c as He,d as yt,e as Nt}from"./useMangaLibrary-C9Lci5N4.js";import{u as Tt}from"./useProviders-B5Qr4I1y.js";import{u as St}from"./useMatureConsent-CT7-KfzG.js";import{u as Qe,a as $e,T as wt}from"./useTv-Dm8MCYlL.js";import{T as kt}from"./TvPopup-BekfiNcX.js";import{u as Ct,a as It,b as At,t as Rt,i as Lt,c as $t}from"./useTvLibrary-B7jEk2Q7.js";import{A as xt}from"./AsmrResetProgressModal-CKYm-8cp.js";import{u as Mt,a as Bt,b as Pt}from"./useAsmr-DIwIsJXF.js";import"./useAnimeInfoData-DJ7A4B4T.js";import"./QueueOptionsButton-Ba0dg_82.js";import"./useIsMobile-Dm_b6Ob3.js";const Dt="_sectionWrapper_2p2l1_9",Et="_sectionTitleNoMargin_2p2l1_13",Wt="_carousel_2p2l1_178",B={"section-header":"_section-header_2p2l1_1",sectionWrapper:Dt,sectionTitleNoMargin:Et,"title-wrapper":"_title-wrapper_2p2l1_17","header-controls":"_header-controls_2p2l1_24","header-select":"_header-select_2p2l1_30","collapse-button":"_collapse-button_2p2l1_79","title-link":"_title-link_2p2l1_98","continue-watching":"_continue-watching_2p2l1_117","nav-arrows":"_nav-arrows_2p2l1_139","nav-button":"_nav-button_2p2l1_148","carousel-container":"_carousel-container_2p2l1_178",carousel:Wt,"carousel-inner":"_carousel-inner_2p2l1_187","carousel-card":"_carousel-card_2p2l1_192"};function fe({align:a="start",containScroll:o="trimSnaps",scrollFraction:i=.8,threshold:t=.6,onReachThreshold:n}={}){const[c,s]=vt({align:a,containScroll:o,dragFree:!0}),[N,p]=D(!1),v=G({scrollFraction:i,threshold:t,onReachThreshold:n}),m=G(!1);O(()=>{v.current={scrollFraction:i,threshold:t,onReachThreshold:n}});const _=P(u=>{p(u.canScrollPrev()||u.canScrollNext())},[]);O(()=>{if(!s)return;const u=()=>{const l=s.scrollProgress();l>=v.current.threshold&&!m.current?(m.current=!0,v.current.onReachThreshold?.()):l<v.current.threshold&&(m.current=!1),_(s)};return s.on("init",u),s.on("reInit",u),s.on("scroll",u),s.on("resize",u),()=>{s.off("init",u),s.off("reInit",u),s.off("scroll",u),s.off("resize",u)}},[s,_]);const b=P(u=>{const l=u.containerNode().firstElementChild;if(!l)return 1;const h=u.rootNode().getBoundingClientRect().width,I=l.getBoundingClientRect().width;return I?Math.max(1,Math.round(h/I)):1},[]),r=P((u,l=!1)=>{if(!s)return;const h=Math.max(1,Math.round(b(s)*v.current.scrollFraction)),I=s.selectedScrollSnap()+(u==="left"?-h:h);s.scrollTo(I,l)},[s,b]),k=P((u=!1)=>{s?.scrollTo(0,u)},[s]);return{emblaRef:c,api:s,canScroll:N,stepBy:r,scrollToStart:k}}const ee=({title:a,eyebrow:o,titleLink:i,loading:t,emptyState:n,carousel:c,layout:s,collapsible:N,defaultExpanded:p=!0,onReachThreshold:v,scrollThreshold:m,isFetchingNextPage:_,resetScrollOnShrink:b,itemCount:r=0,highlight:k,headerActions:u,loadingSkeleton:l,skeletonCount:h=7,children:I})=>{const{lowEndMode:R}=ke(),{emblaRef:T,stepBy:E,scrollToStart:C}=fe({onReachThreshold:v,threshold:m}),[x,W]=U.useState(p);U.useEffect(()=>{W(p)},[p]);const M=U.useRef(0);return U.useEffect(()=>{b&&r>0&&x&&(r<=M.current||M.current===0)&&C(),r>0&&(M.current=r)},[r,b,x,C]),!t&&r===0&&!n&&!N?null:e("section",{className:`${B.sectionWrapper} ${k?B["continue-watching"]:""}`,children:[e("div",{className:B["section-header"],children:[e("div",{className:B["title-wrapper"],children:[e("div",{className:"title-stack",children:[o&&e("div",{className:"section-eyebrow",children:o}),i?e(Pe,{to:i,className:B["title-link"],children:e("div",{className:`section-title ${B.sectionTitleNoMargin}`,children:a})}):e("div",{className:`section-title ${B.sectionTitleNoMargin}`,children:a})]}),c&&r>0&&x&&e("div",{className:B["nav-arrows"],children:[e("button",{className:B["nav-button"],type:"button","aria-label":"Scroll left",onClick:L=>{L.preventDefault(),E("left",R)},children:e(F,{name:"chevron-left"})}),e("button",{className:B["nav-button"],type:"button","aria-label":"Scroll right",onClick:L=>{L.preventDefault(),E("right",R)},children:e(F,{name:"chevron-right"})})]})]}),e("div",{className:B["header-controls"],children:[u,N&&e("button",{className:B["collapse-button"],type:"button",onClick:()=>W(L=>!L),"aria-expanded":x,"aria-label":x?`Collapse ${a}`:`Expand ${a}`,children:x?e(F,{name:"chevron-up"}):e(F,{name:"chevron-down"})})]})]}),x&&(c?!t&&r===0&&n?e("div",{children:n}):e("div",{className:B["carousel-container"],children:e("div",{className:B.carousel,ref:T,children:e("div",{className:B["carousel-inner"],children:[t&&r===0?Array.from({length:h}).map((L,A)=>e("div",{className:B["carousel-card"],children:l},A)):U.Children.map(I,(L,A)=>e("div",{className:B["carousel-card"],children:L},U.isValidElement(L)&&L.key!=null?L.key:`slide-${A}`)),_&&l&&e("div",{className:B["carousel-card"],children:l})]})})}):e("div",{className:"grid-container",children:t&&r===0?e(De,{count:6,layout:s}):r>0?I:t?null:e("div",{style:{gridColumn:"1 / -1"},children:n})}))]})},zt=({title:a,eyebrow:o,animeList:i,continueWatching:t,titleLink:n,onRemove:c,loading:s,emptyState:N,carousel:p,cardConfig:v,layout:m,onReachThreshold:_,scrollThreshold:b,isFetchingNextPage:r,collapsible:k,defaultExpanded:u=!0})=>{const l=m||"vertical";return e(ee,{title:a,eyebrow:o,titleLink:n,loading:s,emptyState:N,carousel:p,layout:l,collapsible:k,defaultExpanded:u,onReachThreshold:_,scrollThreshold:b,isFetchingNextPage:r,resetScrollOnShrink:t,highlight:t,itemCount:i.length,loadingSkeleton:e(Ee,{layout:l}),skeletonCount:7,children:p?i.map(h=>e(oe,{anime:h,continueWatching:t,onRemove:c,config:v,layout:l},h._id)):i.map(h=>e(oe,{anime:h,continueWatching:t,onRemove:c,config:v,layout:l},h._id))})},xe=U.memo(zt),Ot="_sectionWrapper_c8uv6_2",Ft="_sectionTitleNoMargin_c8uv6_6",Vt="_timeSelect_c8uv6_80",Gt="_carouselContainer_c8uv6_111",Ut="_carousel_c8uv6_111",qt="_carouselInner_c8uv6_122",Ht="_carouselItem_c8uv6_127",Qt="_rankCard_c8uv6_164",Yt="_rankPill_c8uv6_168",Xt="_rankGold_c8uv6_179",Kt="_rankSilver_c8uv6_183",jt="_rankBronze_c8uv6_187",Zt="_skeletonPoster_c8uv6_198",Jt="_skeletonText_c8uv6_199",f={sectionWrapper:Ot,sectionTitleNoMargin:Ft,"section-header":"_section-header_c8uv6_10","title-wrapper":"_title-wrapper_c8uv6_18","nav-arrows":"_nav-arrows_c8uv6_40","nav-button":"_nav-button_c8uv6_49",timeSelect:Vt,carouselContainer:Gt,carousel:Ut,carouselInner:qt,carouselItem:Ht,rankCard:Qt,rankPill:Yt,rankGold:Xt,rankSilver:Kt,rankBronze:jt,skeletonPoster:Zt,skeletonText:Jt},Me="TRENDING_DESC",ea="POPULARITY_DESC",ta=10;function aa({title:a,eyebrow:o}){const{lowEndMode:i}=ke(),[t,n]=le("trending_sort",Me),c=[{value:Me,label:"Trending"},{value:ea,label:"All Time"}],{data:s,fetchNextPage:N,hasNextPage:p,isFetchingNextPage:v,isLoading:m,isError:_,error:b}=at(t,ta),r=Y(()=>s?.pages.flatMap(h=>h)||[],[s]),k=P(()=>{p&&!v&&!m&&N()},[p,v,m,N]),{emblaRef:u,stepBy:l}=fe({onReachThreshold:k});return e("section",{className:f.sectionWrapper,children:[e("div",{className:f["section-header"],children:[e("div",{className:f["title-wrapper"],children:[e("div",{className:"title-stack",children:[o&&e("div",{className:"section-eyebrow",children:o}),e("div",{className:`section-title ${f.sectionTitleNoMargin}`,children:a})]}),e("div",{className:f["nav-arrows"],children:[e("button",{className:f["nav-button"],type:"button",onClick:h=>{h.preventDefault(),l("left",i)},"aria-label":"Scroll left",children:e(F,{name:"chevron-left"})}),e("button",{className:f["nav-button"],type:"button",onClick:h=>{h.preventDefault(),l("right",i)},"aria-label":"Scroll right",children:e(F,{name:"chevron-right"})})]})]}),e("div",{className:f["header-actions"],children:e("select",{className:f.timeSelect,value:t,onChange:h=>n(h.currentTarget.value),children:c.map(h=>e("option",{value:h.value,children:h.label},h.value))})})]}),m?e("div",{className:f.carouselContainer,children:e("div",{className:f.carousel,children:e("div",{className:f.carouselInner,children:Array.from({length:7}).map((h,I)=>e("div",{className:f.carouselItem,children:[e("div",{className:f.skeletonPoster}),e("div",{className:f.skeletonText})]},I))})})}):_?e(Ce,{message:b instanceof Error?b.message:"An unknown error occurred"}):e("div",{className:f.carouselContainer,children:e("div",{className:f.carousel,ref:u,children:e("div",{className:f.carouselInner,children:[r.map((h,I)=>e("div",{className:f.carouselItem,children:[e("div",{className:f.rankCard,children:e(oe,{anime:h})}),e("div",{className:`${f.rankPill} ${I===0?f.rankGold:I===1?f.rankSilver:I===2?f.rankBronze:""}`,children:I+1})]},h._id)),v&&e("div",{className:f.carouselItem,style:{minWidth:"150px",display:"flex",alignItems:"center",justifyContent:"center"},children:e("div",{className:f.skeletonPoster})})]})})})]})}const na=[{value:"TV",label:"TV"},{value:"ONA",label:"ONA"},{value:"OVA",label:"OVA"},{value:"MOVIE",label:"Movie"},{value:"ALL",label:"All"},{value:"ADULT",label:"Mature"}],ra=10;function oa({eyebrow:a}){const{lowEndMode:o}=ke(),[i,t]=le("latest_releases_format","TV"),{data:n,fetchNextPage:c,hasNextPage:s,isFetchingNextPage:N,isLoading:p,isError:v,error:m}=nt(i,ra),_=Y(()=>n?.pages.flatMap(u=>u)||[],[n]),b=P(()=>{s&&!N&&!p&&c()},[s,N,p,c]),{emblaRef:r,stepBy:k}=fe({onReachThreshold:b});return e("section",{className:f.sectionWrapper,children:[e("div",{className:f["section-header"],children:[e("div",{className:f["title-wrapper"],children:[e("div",{className:"title-stack",children:[a&&e("div",{className:"section-eyebrow",children:a}),e("div",{className:`section-title ${f.sectionTitleNoMargin}`,children:"Latest Releases"})]}),e("div",{className:f["nav-arrows"],children:[e("button",{className:f["nav-button"],type:"button",onClick:u=>{u.preventDefault(),k("left",o)},"aria-label":"Scroll left",children:e(F,{name:"chevron-left"})}),e("button",{className:f["nav-button"],type:"button",onClick:u=>{u.preventDefault(),k("right",o)},"aria-label":"Scroll right",children:e(F,{name:"chevron-right"})})]})]}),e("div",{className:f["header-actions"],children:e("select",{className:f.timeSelect,value:i,onChange:u=>t(u.currentTarget.value),children:na.map(u=>e("option",{value:u.value,children:u.label},u.value))})})]}),p?e("div",{className:f.carouselContainer,children:e("div",{className:f.carousel,children:e("div",{className:f.carouselInner,children:Array.from({length:7}).map((u,l)=>e("div",{className:f.carouselItem,children:[e("div",{className:f.skeletonPoster}),e("div",{className:f.skeletonText})]},l))})})}):v?e(Ce,{message:m instanceof Error?m.message:"An unknown error occurred"}):e("div",{className:f.carouselContainer,children:e("div",{className:f.carousel,ref:r,children:e("div",{className:f.carouselInner,children:[_.map(u=>e("div",{className:f.carouselItem,children:e(oe,{anime:u})},u._id)),N&&e("div",{className:f.carouselItem,style:{minWidth:"150px",display:"flex",alignItems:"center",justifyContent:"center"},children:e("div",{className:f.skeletonPoster})})]})})})]})}const sa="_scheduleSection_10dfe_1",la="_sectionTitleRow_10dfe_5",ia="_sectionTitleNoMargin_10dfe_11",ca="_sectionHeader_10dfe_15",da="_headerActions_10dfe_25",ua="_timeSelect_10dfe_31",ha="_daySelectorContainer_10dfe_62",ma="_daySelector_10dfe_62",pa="_daySelectorInner_10dfe_79",ga="_dayBtn_10dfe_90",va="_active_10dfe_113",_a="_dayMonth_10dfe_121",fa="_dayNum_10dfe_129",ba="_dayName_10dfe_135",ya="_navArrows_10dfe_148",Na="_navButton_10dfe_157",Ta="_carouselContainer_10dfe_181",Sa="_carousel_10dfe_181",wa="_carouselInner_10dfe_193",ka="_carouselCard_10dfe_198",$={scheduleSection:sa,sectionTitleRow:la,sectionTitleNoMargin:ia,sectionHeader:ca,headerActions:da,timeSelect:ua,daySelectorContainer:ha,daySelector:ma,daySelectorInner:pa,dayBtn:ga,active:va,dayMonth:_a,dayNum:fa,dayName:ba,navArrows:ya,navButton:Na,carouselContainer:Ta,carousel:Sa,carouselInner:wa,carouselCard:ka},ue=a=>{const o=a.getFullYear(),i=String(a.getMonth()+1).padStart(2,"0"),t=String(a.getDate()).padStart(2,"0");return`${o}-${i}-${t}`},Ca=async(a,o)=>await rt.data.schedule.query({date:a,format:o}),Ia=({eyebrow:a})=>{const[o,i]=D(()=>ue(new Date)),[t,n]=le("schedule_format","TV"),{emblaRef:c,canScroll:s,stepBy:N,scrollToStart:p}=fe(),v=G(null),m=G(!0),{data:_=[],isLoading:b,error:r}=Ze({queryKey:["schedule",o,t],queryFn:()=>Ca(o,t),staleTime:1e3*60*5}),k=Y(()=>{const l=[],h=new Date,I=ue(h),R=new Date(h);R.setDate(h.getDate()-1);const T=ue(R),E=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];for(let C=-6;C<=6;C++){const x=new Date;x.setDate(h.getDate()+C),l.push(x)}return l.map(C=>{const x=ue(C),L=x===I?"Today":x===T?"Yest":E[C.getDay()],A=C.getDate(),X=new Intl.DateTimeFormat("en-US",{month:"short"}).format(C);return{dateString:x,dayLabel:L,dayNum:A,monthName:X}})},[]);O(()=>{if(m.current){m.current=!1;return}if(v.current){const l=v.current.querySelector(`[data-date="${o}"]`);l&&l.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})}},[o]),O(()=>{p(!0)},[o,p]);const u=[{value:"TV",label:"TV"},{value:"ONA",label:"ONA"},{value:"OVA",label:"OVA"},{value:"MOVIE",label:"Movie"},{value:"ALL",label:"All"},{value:"ADULT",label:"Mature"}];return e("div",{className:$.scheduleSection,children:[e("div",{className:$.sectionHeader,children:[e("div",{className:$.sectionTitleRow,children:[e("div",{className:"title-stack",children:[a&&e("div",{className:"section-eyebrow",children:a}),e("h2",{className:`section-title ${$.sectionTitleNoMargin}`,children:"Episode Schedule"})]}),_.length>0&&s&&e("div",{className:$.navArrows,children:[e("button",{className:$.navButton,onClick:()=>N("left"),"aria-label":"Scroll left",children:e(F,{name:"chevron-left"})}),e("button",{className:$.navButton,onClick:()=>N("right"),"aria-label":"Scroll right",children:e(F,{name:"chevron-right"})})]})]}),e("div",{className:$.headerActions,children:e("select",{className:$.timeSelect,value:t,onChange:l=>n(l.target.value),children:u.map(l=>e("option",{value:l.value,children:l.label},l.value))})})]}),e("div",{className:$.daySelectorContainer,children:e("div",{className:$.daySelector,ref:v,children:e("div",{className:$.daySelectorInner,children:k.map(l=>e("button",{type:"button","data-date":l.dateString,className:`${$.dayBtn} ${o===l.dateString?$.active:""}`,onClick:()=>i(l.dateString),children:[e("span",{className:$.dayMonth,children:l.monthName}),e("span",{className:$.dayNum,children:l.dayNum}),e("span",{className:$.dayName,children:l.dayLabel})]},l.dateString))})})}),e("div",{className:$.carouselContainer,children:e("div",{className:$.carousel,ref:c,children:e("div",{className:$.carouselInner,children:b?Array.from({length:7}).map((l,h)=>e("div",{className:$.carouselCard,children:e(Ee,{layout:"vertical"})},h)):r?e("div",{style:{width:"100%"},children:e(Ce,{message:r instanceof Error?r.message:"An unknown error occurred"})}):_.length===0?e("p",{style:{textAlign:"center",marginTop:"1rem",width:"100%"},children:"No episodes scheduled for this day."}):_.map(l=>e("div",{className:$.carouselCard,children:e(oe,{anime:l,continueWatching:!1,layout:"vertical"},l._id)},l._id))})})})]})},Aa="_bannerContainer_1r6xz_1",Ra="_hero_1r6xz_28",La="_ambient_1r6xz_37",$a="_ambientShow_1r6xz_49",xa="_scrim_1r6xz_53",Ma="_progressLine_1r6xz_69",Ba="_paused_1r6xz_89",Pa="_dots_1r6xz_103",Da="_dot_1r6xz_103",Ea="_dotActive_1r6xz_132",Wa="_viewport_1r6xz_138",za="_track_1r6xz_145",Oa="_slide_1r6xz_151",Fa="_slideInner_1r6xz_159",Va="_poster_1r6xz_169",Ga="_info_1r6xz_179",Ua="_kicker_1r6xz_183",qa="_featureLabel_1r6xz_190",Ha="_scoreChip_1r6xz_202",Qa="_rise_1r6xz_220",Ya="_active_1r6xz_224",Xa="_metaRow_1r6xz_280",Ka="_metaItem_1r6xz_291",ja="_metaDivider_1r6xz_297",Za="_title_1r6xz_304",Ja="_genres_1r6xz_320",en="_genreTag_1r6xz_328",tn="_summary_1r6xz_339",an="_actions_1r6xz_351",nn="_watchBtn_1r6xz_358",rn="_detailsBtn_1r6xz_380",on="_navArrow_1r6xz_401",sn="_prevArrow_1r6xz_434",ln="_nextArrow_1r6xz_438",y={bannerContainer:Aa,hero:Ra,ambient:La,ambientShow:$a,scrim:xa,progressLine:Ma,paused:Ba,dots:Pa,dot:Da,dotActive:Ea,viewport:Wa,track:za,slide:Oa,slideInner:Fa,poster:Va,info:Ga,kicker:Ua,featureLabel:qa,scoreChip:Ha,rise:Qa,active:Ya,metaRow:Xa,metaItem:Ka,metaDivider:ja,title:Za,genres:Ja,genreTag:en,summary:tn,actions:an,watchBtn:nn,detailsBtn:rn,navArrow:on,prevArrow:sn,nextArrow:ln},cn=8e3,he=()=>e("div",{className:"skeleton",style:{width:"100vw",maxWidth:"100vw",position:"relative",left:"50%",right:"50%",marginLeft:"-50vw",marginRight:"-50vw",height:"clamp(480px, 72vh, 660px)",marginTop:"calc(-1 * var(--header-height))",marginBottom:"2.5rem"}}),be=({slides:a,posterClassName:o})=>{const[i,t]=D(0),[n,c]=D(0),[s,N]=D(!1),[p,v]=D(null),[m,_]=D(0),[b,r]=D({front:"",back:"",flip:!1}),k=G(0),u=G(0),l=G(new Set),h=G(null),I=G(0),R=P(d=>d.bannerSrc,[]),T=P(()=>{c(d=>d+1)},[]),E=P(d=>{h.current!==null&&(window.clearTimeout(h.current),h.current=null),v(null),T();const w=R(a[d]);r(S=>S.flip?{front:w,back:S.back,flip:!1}:{front:S.front,back:w,flip:!0}),t(d)},[T,a,R]),C=P(d=>{if(a.length===0)return;const w=(d%a.length+a.length)%a.length;l.current.has(R(a[w]))?E(w):v(w)},[a,R,E]);O(()=>{let d=!1;return a.forEach(w=>{const S=R(w);if(!S||l.current.has(S))return;const g=new Image;g.src=S;const z=()=>{d||l.current.has(S)||(l.current.add(S),_(q=>q+1))};g.onload=z,g.onerror=z}),()=>{d=!0}},[a,R]),O(()=>{if(a.length!==0&&!b.front){const d=R(a[0]);r({front:d,back:"",flip:!1})}},[a,b.front,R]),O(()=>{if(p!==null){if(p<0||p>=a.length){v(null);return}l.current.has(R(a[p]))&&E(p)}},[p,m,a,R,E]),O(()=>{if(p===null)return;h.current!==null&&window.clearTimeout(h.current);const d=p;return h.current=window.setTimeout(()=>{h.current=null,E(d)},2500),()=>{h.current!==null&&(window.clearTimeout(h.current),h.current=null)}},[p,E]);const x=P(d=>{C(d)},[C]),W=P(()=>{C(I.current+1)},[C]),M=P(()=>{C(I.current-1)},[C]),L=G(null);if(O(()=>{const d=L.current;if(!d)return;const w=S=>{if(Math.abs(S.deltaY)>Math.abs(S.deltaX)&&Math.abs(S.deltaY)>5){S.preventDefault(),S.stopPropagation();const g=Date.now();if(g-k.current<300)return;k.current=g,T(),S.deltaY>0?W():M()}};return d.addEventListener("wheel",w,{passive:!1}),()=>d.removeEventListener("wheel",w)},[a.length,W,M,T]),O(()=>{if(a.length===0||s)return;const d=setTimeout(W,cn);return()=>clearTimeout(d)},[i,W,a.length,n,s]),O(()=>{const d=w=>{const S=w.target;S&&(S.tagName==="INPUT"||S.tagName==="TEXTAREA"||S.tagName==="SELECT"||S.isContentEditable)||(w.key==="ArrowRight"?(w.preventDefault(),W()):w.key==="ArrowLeft"&&(w.preventDefault(),M()))};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[W,M]),O(()=>{i>=a.length&&t(0)},[a.length,i]),a.length===0)return null;const A=i>=a.length?0:i;I.current=A;const X=d=>{u.current=d.touches[0].clientX},j=d=>{const S=d.changedTouches[0].clientX-u.current;Math.abs(S)>50&&(T(),S>0?M():W())};return e("div",{className:y.bannerContainer,onMouseEnter:()=>N(!0),onMouseLeave:()=>N(!1),children:e("div",{className:`${y.hero} ${s?y.paused:""}`,onTouchStart:X,onTouchEnd:j,children:[b.front&&e("img",{src:b.front,alt:"","aria-hidden":"true",className:`${y.ambient} ${b.flip?"":y.ambientShow}`}),b.back&&e("img",{src:b.back,alt:"","aria-hidden":"true",className:`${y.ambient} ${b.flip?y.ambientShow:""}`}),e("div",{className:y.scrim,"aria-hidden":"true"}),a.length>1&&e("div",{className:y.progressLine,"aria-hidden":"true"},`progress-${n}-${A}`),a.length>1&&e("div",{className:y.dots,ref:L,role:"tablist","aria-label":"Spotlight slides",children:a.map((d,w)=>e("button",{role:"tab","aria-selected":w===A,"aria-label":`Go to slide ${w+1}: ${d.title}`,className:`${y.dot} ${w===A?y.dotActive:""}`,onClick:()=>x(w),tabIndex:w===A?0:-1},d.key))}),e("div",{className:y.viewport,children:e("div",{className:y.track,style:{transform:`translateX(-${A*100}%)`},children:a.map((d,w)=>e("div",{className:`${y.slide} ${w===A?y.active:""}`,"aria-hidden":w!==A,children:e("div",{className:y.slideInner,children:[e("img",{src:d.posterSrc,alt:d.posterAlt,className:o??y.poster,decoding:"async"}),e("div",{className:y.info,children:[e("div",{className:`${y.kicker} ${y.rise}`,children:[e("span",{className:y.featureLabel,children:"Spotlight"}),d.score!==void 0&&d.score!==null&&d.score!==""&&e("span",{className:y.scoreChip,children:[e(F,{name:"star",size:12}),e("span",{children:d.score})]})]}),e(Pe,{to:d.detailTo,className:`${y.title} ${y.rise}`,"aria-label":`View details for ${d.title}`,tabIndex:w===A?0:-1,children:d.title}),d.metaItems.length>0&&e("div",{className:`${y.metaRow} ${y.rise}`,children:d.metaItems.map((S,g)=>e(U.Fragment,{children:[e("span",{className:y.metaItem,children:S}),g<d.metaItems.length-1&&e("div",{className:y.metaDivider})]},g))}),d.tags.length>0&&e("div",{className:`${y.genres} ${y.rise}`,children:d.tags.slice(0,3).map(S=>e("span",{className:y.genreTag,children:S},S))}),d.synopsis&&e("p",{className:`${y.summary} ${y.rise}`,children:d.synopsis}),e("div",{className:`${y.actions} ${y.rise}`,children:[e("button",{className:y.watchBtn,onClick:d.onPrimary,tabIndex:w===A?0:-1,children:[e(F,{name:d.primaryIcon,size:14}),e("span",{children:d.primaryLabel})]}),e("button",{className:y.detailsBtn,onClick:d.onDetails,tabIndex:w===A?0:-1,children:[e(F,{name:"info-circle",size:15}),e("span",{children:"Details"})]})]})]})]})},d.key))})}),a.length>1&&e(ie,{children:[e("button",{className:`${y.navArrow} ${y.prevArrow}`,onClick:()=>{T(),M()},"aria-label":"Previous slide",children:e(F,{name:"chevron-left",size:20})}),e("button",{className:`${y.navArrow} ${y.nextArrow}`,onClick:()=>{T(),W()},"aria-label":"Next slide",children:e(F,{name:"chevron-right",size:20})})]})]})})},dn=({animeList:a})=>{const{titlePreference:o}=We(),i=te(),t=Y(()=>a.slice(0,6).map(n=>{const c=o==="nativeName"?n.nativeName||n.name:o==="englishName"&&n.englishName||n.name;return{key:n._id,bannerSrc:n.bannerImage?Se(n.bannerImage,1280,560):Se(n.thumbnail,1280,450),posterSrc:Se(n.thumbnail,460,650),posterAlt:c,title:c,detailTo:`/anime/${n._id}`,score:n.score,metaItems:[n.type||"Anime",n.status,n.episodeCount?`${n.episodeCount} Episodes`:void 0,n.rating].filter(s=>!!s),tags:(n.genres??[]).slice(0,3).map(s=>typeof s=="string"?s:s?.name).filter(s=>!!s),synopsis:ot(n.description??""),primaryLabel:"Watch Now",primaryIcon:"play",onPrimary:()=>i(`/watch/${n._id}`),onDetails:()=>i(`/anime/${n._id}`)}}),[a,o,i]);return e(be,{slides:t})},un="_emptyState_19tmt_1",hn="_emptyStateIcon_19tmt_16",mn="_emptyStateTitle_19tmt_23",pn="_emptyStateText_19tmt_30",me={emptyState:un,emptyStateIcon:hn,emptyStateTitle:mn,emptyStateText:pn},ye=({icon:a,text:o,actionLabel:i,onAction:t,title:n="Nothing is here..."})=>e("div",{className:me.emptyState,children:[e(F,{name:a,size:48,className:me.emptyStateIcon}),e("div",{children:[e("h3",{className:me.emptyStateTitle,children:n}),e("p",{className:me.emptyStateText,children:o})]}),e(ze,{variant:"primary",size:"sm",onClick:t,style:{marginTop:"1rem"},children:i})]}),gn="_select_1dw63_1",vn={select:gn},ge=({value:a,options:o,onChange:i,ariaLabel:t,width:n})=>e("select",{className:vn.select,style:n!==void 0?{width:n}:void 0,value:a,"aria-label":t,onChange:c=>i(c.currentTarget.value),children:o.map(c=>e("option",{value:c.value,children:c.label},c.value))}),_n="_tabBar_irwbm_1",fn="_tabIndicator_irwbm_24",bn="_tabButton_irwbm_38",yn="_tabActive_irwbm_64",pe={tabBar:_n,tabIndicator:fn,tabButton:bn,tabActive:yn};function Nn({options:a,value:o,onChange:i,ariaLabel:t},n){const c=G(null),s=G(new Map),[N,p]=D({left:0,width:0}),v=P(m=>{const _=s.current.get(m),b=c.current;if(_&&b){const r=b.getBoundingClientRect(),k=_.getBoundingClientRect();p({left:k.left-r.left+b.scrollLeft,width:k.width}),_.scrollIntoView({block:"nearest",inline:"nearest"})}},[]);return je(()=>{v(o)},[o,a.length,v]),O(()=>{if(v(o),typeof ResizeObserver>"u")return;let m=0;const _=c.current;if(!_)return;const b=new ResizeObserver(()=>{cancelAnimationFrame(m),m=requestAnimationFrame(()=>v(o))});b.observe(_);let r=!1;return document.fonts?.ready&&document.fonts.ready.then(()=>{r||v(o)}),()=>{r=!0,cancelAnimationFrame(m),b.disconnect()}},[o,a.length,v]),e("div",{className:pe.tabBar,ref:m=>{c.current=m,typeof n=="function"?n(m):n&&(n.current=m)},"aria-label":t,children:[e("div",{className:pe.tabIndicator,style:{left:N.left,width:N.width}}),a.map(m=>e(ze,{ref:_=>{_&&s.current.set(m.value,_)},variant:"secondary",size:"sm",className:`${pe.tabButton} ${o===m.value?pe.tabActive:""}`,onClick:()=>i(m.value),children:m.label},m.value))]})}const ve=U.forwardRef(Nn),Tn=[{value:"popular",label:"Popular"},{value:"followed",label:"Most Followed"},{value:"rating",label:"Top Rated"}];function Sn(){const{options:a}=Tt();return Y(()=>a.filter(o=>o.kind==="manga").map(o=>o.value)[0]??"",[a])}const Be=({title:a,eyebrow:o,provider:i,sort:t,mature:n,headerActions:c})=>{const{toggle:s,bookmarkedIds:N}=Ge(),{popup:p,openPopup:v,scheduleClose:m,cancelClose:_,closePopup:b}=Fe(),{data:r,isLoading:k,fetchNextPage:u,hasNextPage:l,isFetchingNextPage:h}=bt({provider:i,query:"",sort:t,status:"",type:"",rating:n?"safe,suggestive,erotica,pornographic":"safe",mature:n}),I=Y(()=>r?.pages.flatMap(T=>T.items)??[],[r]),R=P(()=>{l&&!h&&!k&&u()},[l,h,k,u]);return i?e(ie,{children:[e(ee,{title:a,eyebrow:o,loading:k,carousel:!0,itemCount:I.length,headerActions:c,onReachThreshold:R,isFetchingNextPage:h,loadingSkeleton:e("div",{className:"skeleton",style:{aspectRatio:"3 / 4"}}),skeletonCount:7,children:I.map(T=>{const E=we(T.provider,T.id);return e(_e,{item:{id:E,title:T.title,...He(T),thumbnail:qe(T.provider,T.cover),typeBadge:T.type||void 0,chapterBadge:T.latestChapter?`Ch. ${T.latestChapter}`:null,isAdult:Ue(T)},linkTo:`/manga/${T.provider}/${encodeURIComponent(T.id)}`,hoverIcon:"info",showInfoButton:!0,display:{elements:{poster:{typeBadge:!0,chapterBadge:!0,adultBadge:!0},info:{title:!0,mobileBadges:!0,progress:!1,meta:!1}}},onOpenDetails:C=>v(C,{provider:T.provider,mangaId:T.id,title:T.title,altTitle:T.altTitle,cover:T.cover,contentRating:T.contentRating,readTarget:`/manga/${T.provider}/${encodeURIComponent(T.id)}`,mature:n}),onPopupHoverIntent:C=>C?_():m(),rawThumbnail:!0},`${T.provider}-${T.id}`)})}),p&&e(Ve,{data:p.data,anchorRect:p.rect,bookmarked:N.has(we(p.data.provider,p.data.mangaId)),onToggleBookmark:()=>s({id:p.data.mangaId,provider:p.data.provider,title:p.data.title,cover:p.data.cover,altTitle:p.data.altTitle??void 0,contentRating:p.data.contentRating}),onMouseEnter:_,onMouseLeave:m,onRequestClose:b})]}):null},wn=()=>{const a=Sn(),{hasConsent:o}=St(),[i,t]=le("manga_discover_tab","latest"),[n,c]=le("manga_trending_sort","popular");return a?e(ie,{children:[e(ve,{ariaLabel:"Discover manga",options:[{value:"latest",label:"Latest Releases"},{value:"trending",label:"Trending"}],value:i,onChange:t}),i==="latest"?e(Be,{title:"Latest Releases",eyebrow:"Fresh chapters",provider:a,sort:"latest",mature:o}):e(Be,{title:"Trending",eyebrow:"Discover",provider:a,sort:n,mature:o,headerActions:e("select",{className:B["header-select"],value:n,onChange:s=>c(s.currentTarget.value),"aria-label":"Trending sort",children:Tn.map(s=>e("option",{value:s.value,children:s.label},s.value))})})]}):null},kn=()=>{const a=te(),{data:o,isLoading:i}=yt(24),[t,n]=D(null),{popup:c,openPopup:s,scheduleClose:N,cancelClose:p,closePopup:v}=Fe(),{toggle:m,bookmarkedIds:_}=Ge(),b=o?.data??[];return e("div",{style:{paddingBottom:"2rem"},children:[e(ee,{title:"Continue Reading",eyebrow:"Pick up where you left off",titleLink:"/reading-list/Continue Reading",loading:i,carousel:!0,collapsible:!0,defaultExpanded:b.length>0,highlight:!0,itemCount:b.length,loadingSkeleton:e("div",{className:"skeleton",style:{aspectRatio:"3 / 4"}}),skeletonCount:7,emptyState:e(ye,{icon:"book",text:"You haven't read anything yet. Browse manga and open a chapter to start tracking.",actionLabel:"Browse Manga",onAction:()=>a("/manga")}),children:b.map(r=>{const k=r.page??0,u=r.pageCount??0,l=r.chapterId&&r.provider?`/manga/${r.provider}/${encodeURIComponent(r.mangaId)}/read?chapter=${encodeURIComponent(r.chapterId)}`:r.provider?`/manga/${r.provider}/${encodeURIComponent(r.mangaId)}`:"#";return e(_e,{item:{id:r.id,title:r.title,...He({title:r.title,altTitle:r.altTitle}),thumbnail:r.provider?qe(r.provider,r.cover||""):r.cover||"",chapterBadge:r.chapterNumber?`Ch. ${r.chapterNumber}`:null,isAdult:Ue(r)},linkTo:l,hoverIcon:"book",progress:u>0?{percent:k/u*100,label:`Ch. ${r.chapterNumber} · p. ${k}/${u}`}:void 0,showProgress:!0,display:{elements:{poster:{typeBadge:!1,chapterBadge:!0,adultBadge:!0,removeButton:!0},info:{title:!0,mobileBadges:!0,progress:!0,meta:!1}}},onRemove:()=>n({libId:r.id,title:r.title}),onOpenDetails:h=>s(h,{provider:r.provider||"",mangaId:r.mangaId||"",title:r.title||"",altTitle:r.altTitle,cover:r.cover||"",contentRating:r.contentRating||void 0,readTarget:l}),onPopupHoverIntent:h=>h?p():N(),rawThumbnail:!0},r.id)})}),e(ft,{mangaId:t?t.libId:null,title:t?.title,onClose:()=>n(null)}),c&&c.data.provider&&e(Ve,{data:c.data,anchorRect:c.rect,bookmarked:_.has(we(c.data.provider,c.data.mangaId)),onToggleBookmark:()=>m({id:c.data.mangaId,provider:c.data.provider,title:c.data.title,cover:c.data.cover,altTitle:c.data.altTitle??void 0,contentRating:c.data.contentRating}),onMouseEnter:p,onMouseLeave:N,onRequestClose:v}),e(wn,{})]})},Cn="_seasonGrid_bt5c7_76",In="_emptyState_bt5c7_108",H={"section-header":"_section-header_bt5c7_1","title-wrapper":"_title-wrapper_bt5c7_8","pagination-controls":"_pagination-controls_bt5c7_14",seasonGrid:Cn,emptyState:In},An=[{value:"latest",label:"Latest Releases"},{value:"trending",label:"Trending"}],Rn=[{value:"trending_week",label:"Trending Now"},{value:"trending_day",label:"Trending Today"},{value:"popular",label:"Popular All Time"},{value:"top_rated",label:"Top Rated"}],Ln=()=>{const a=te(),{data:o,isLoading:i}=Ct(24),t=It(),n=At(),[c,s]=D(null),[N,p]=D(!1),[v,m]=D(()=>localStorage.getItem("tv_home_activeTab")||"latest"),[_,b]=D("tv"),[r,k]=D("trending_week"),[u,l]=D("multi"),h=o?.data??[];U.useEffect(()=>{localStorage.setItem("tv_home_activeTab",v)},[v]);const I=r.startsWith("trending_"),R=r==="trending_day"?"day":"week",T={popular:"popularity.desc",top_rated:"vote_average.desc"},{data:E,isLoading:C}=Qe(u==="multi"?"all":u,R,1,I&&v==="trending"),{data:x,isLoading:W}=$e({type:u,sort_by:T[r]||"popularity.desc",page:1}),M=I?E?.results||[]:x?.results||[],L=I?C:W,{data:A,isLoading:X}=$e({type:_,sort_by:"primary_release_date.desc",page:1}),j=A?.results||[],d=()=>{c&&(n.mutate({mediaId:c.libId}),N&&t.mutate(c.libId),s(null),p(!1))},w=P(g=>e(wt,{item:{id:g.id,title:g.title,year:g.year,type:g.type,image:g.image,vote_average:g.vote_average,adult:g.adult}},`${g.type}-${g.id}`),[]),S=()=>{switch(v){case"latest":return e("section",{children:[e("div",{className:H["section-header"],children:[e("div",{className:H["title-wrapper"],children:e("div",{className:"title-stack",children:[e("div",{className:"section-eyebrow",children:"Fresh picks"}),e("div",{className:"section-title",style:{marginBottom:0},children:"Latest Releases"})]})}),e("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:e(ge,{ariaLabel:"Latest type",value:_,onChange:g=>b(g),options:[{value:"tv",label:"TV Shows"},{value:"movie",label:"Movies"}]})})]}),X?e("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(150px, 1fr))",gap:"var(--space-6)"},children:Array.from({length:7}).map((g,z)=>e("div",{className:"skeleton",style:{aspectRatio:"3 / 4",borderRadius:"var(--radius-lg)"}},z))}):j.length>0?e(ee,{carousel:!0,itemCount:j.length,children:j.map(w)}):e("div",{className:H.emptyState,children:e("p",{children:"No latest releases available right now."})})]});case"trending":return e("section",{children:[e("div",{className:H["section-header"],children:[e("div",{className:H["title-wrapper"],children:e("div",{className:"title-stack",children:[e("div",{className:"section-eyebrow",children:"Discover"}),e("div",{className:"section-title",style:{marginBottom:0},children:"Trending"})]})}),e("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[e(ge,{ariaLabel:"Trending sort",value:r,onChange:k,options:Rn.map(g=>({value:g.value,label:g.label}))}),e(ge,{ariaLabel:"Trending type",value:u,onChange:g=>l(g),options:[{value:"multi",label:"All"},{value:"tv",label:"TV Shows"},{value:"movie",label:"Movies"}]})]})]}),L?e("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(150px, 1fr))",gap:"var(--space-6)"},children:Array.from({length:7}).map((g,z)=>e("div",{className:"skeleton",style:{aspectRatio:"3 / 4",borderRadius:"var(--radius-lg)"}},z))}):M.length>0?e(ee,{carousel:!0,itemCount:M.length,children:M.map(w)}):e("div",{className:H.emptyState,children:e("p",{children:"No trending content available right now."})})]})}};return e("div",{style:{paddingBottom:"2rem"},children:[e(ee,{title:"Continue Watching",eyebrow:"Pick up where you left off",titleLink:"/tv-watchlist/Continue Watching",loading:i,carousel:!0,collapsible:!0,defaultExpanded:h.length>0,highlight:!0,itemCount:h.length,loadingSkeleton:e("div",{className:"skeleton",style:{aspectRatio:"3 / 4"}}),skeletonCount:7,emptyState:e(ye,{icon:"tv",text:"You haven't watched anything yet. Search TV & Movies and start watching to track progress.",actionLabel:"Browse TV & Movies",onAction:()=>a("/tv-search")}),children:h.map(g=>{const z=g.currentTime??0,q=g.duration??0,Z=g.season??g.lastSeason??1,ce=g.episode??g.lastEpisode??1,Q=g.mediaType==="movie",J=Q?"Movie":`S${Z} E${ce}`,ae=g.completed===!0||g.completed===1||q>0&&z>=q*.8,ne=ae?100:q>0&&z>0?z/q*100:0,Ne=ae?"Watched":q>0?Q?`${re(z)} / ${re(q)}`:`${J} · ${re(z)} / ${re(q)}`:J;return e(_e,{item:{id:g.id,title:g.title,thumbnail:g.poster||"",typeBadge:Q?"Movie":"TV",chapterBadge:J,isAdult:Lt({adult:g.adult===1})},linkTo:Rt(g.mediaType,g.tmdbId,Q?void 0:Z,Q?void 0:ce),hoverIcon:"play",progress:(q>0||ae)&&ne>0?{percent:ne,label:Ne}:void 0,showProgress:!0,metaRow:g.year?e("span",{style:{opacity:.75},children:g.year}):void 0,onRemove:()=>s({libId:g.id,title:g.title}),renderPopup:(de,se)=>e(kt,{item:{id:g.tmdbId??0,title:g.title||"",year:g.year||"",type:g.mediaType||"tv",image:g.poster||""},anchorRect:de,onMouseEnter:se.onMouseEnter,onMouseLeave:se.onMouseLeave,onRequestClose:se.close})},g.id)})}),e(ve,{ariaLabel:"Browse TV",options:An,value:v,onChange:m}),e("div",{className:H.tabContent,children:S()}),e(Oe,{isOpen:!!c,itemName:c?.title,progressKind:"watch",listLabel:"my TV watchlist",alsoRemove:N,onAlsoRemoveChange:p,onClose:()=>{s(null),p(!1)},onConfirm:d})]})};function $n(a){const o=a.currentTime??0,i=a.duration??0,t=(a.trackIndex??0)+1;return i>0?`Track ${t} · ${re(o)} / ${re(i)}`:a.trackLabel?`Track ${t} · ${a.trackLabel}`:`Track ${t}`}const xn=({title:a="Continue Listening",limit:o=24,titleLink:i,showEmptyState:t=!0})=>{const n=te(),{data:c,isLoading:s}=Mt(o),[N,p]=D(null),v=c?.data??[];return e(ie,{children:[e(ee,{title:a,eyebrow:"Pick up where you left off",titleLink:i??"/listening-list/Continue Listening",loading:s,carousel:!0,collapsible:!0,defaultExpanded:v.length>0,highlight:!0,itemCount:v.length,loadingSkeleton:e("div",{className:"skeleton",style:{aspectRatio:"16 / 9"}}),skeletonCount:7,emptyState:t?e(ye,{icon:"headphones",text:"You haven't listened to anything yet. Browse ASMR and play a track to start tracking.",actionLabel:"Browse ASMR",onAction:()=>n("/asmr")}):void 0,children:v.map(m=>{const _=m.currentTime??0,b=m.duration??0,r=m.rjCode||m.id;return e(_e,{item:{id:m.id,title:m.title,thumbnail:m.thumbnail||"",chapterBadge:`Track ${(m.trackIndex??0)+1}`,isAdult:!!m.isAdult},linkTo:`/asmr/${encodeURIComponent(r)}`,hoverIcon:"play",layout:"horizontal",progress:b>0?{percent:Math.min(100,_/b*100),label:$n(m)??""}:void 0,showProgress:!0,display:{elements:{poster:{typeBadge:!1,chapterBadge:!0,adultBadge:!0,removeButton:!0},info:{title:!0,mobileBadges:!0,progress:!0,meta:!1}}},onRemove:()=>p({workId:m.id,title:m.title}),rawThumbnail:!0},m.id)})}),e(xt,{workId:N?N.workId:null,title:N?.title,onClose:()=>p(null)})]})},Mn=()=>e("div",{style:{paddingBottom:"2rem"},children:e(xn,{})}),Bn={10759:"Action & Adventure",16:"Animation",35:"Comedy",80:"Crime",18:"Drama",10765:"Sci-Fi & Fantasy",9648:"Mystery",28:"Action",12:"Adventure",14:"Fantasy",27:"Horror",878:"Sci-Fi",53:"Thriller",10749:"Romance"},Pn=({items:a})=>{const o=te(),i=Y(()=>a.slice(0,6).map(t=>{const n=$t(t.type,t.id);return{key:String(t.id),bannerSrc:t.backdrop?t.backdrop:t.image,posterSrc:t.image,posterAlt:t.title,title:t.title,detailTo:n,score:t.vote_average>0?Number(t.vote_average).toFixed(1):null,metaItems:[t.type==="tv"?"TV Show":"Movie",t.year].filter(Boolean),tags:t.genre_ids.slice(0,3).map(c=>Bn[c]).filter(Boolean),synopsis:t.overview.length>200?t.overview.slice(0,200)+"...":t.overview,primaryLabel:"Watch Now",primaryIcon:"play",onPrimary:()=>o(n),onDetails:()=>o(n)}}),[a,o]);return e(be,{slides:i})},Dn=({mangaList:a})=>{const o=te(),i=Y(()=>a.slice(0,6).map(t=>({key:t.id,bannerSrc:t.cover||"",posterSrc:t.cover,posterAlt:t.title,title:t.title,detailTo:`/manga/mangadex/${t.id}`,metaItems:[t.year?String(t.year):void 0,t.status??void 0].filter(n=>!!n),tags:t.tags.slice(0,3),synopsis:t.description?.slice(0,200)||"",primaryLabel:"Read Now",primaryIcon:"book",onPrimary:()=>o(`/manga/mangadex/${t.id}`),onDetails:()=>o(`/manga/mangadex/${t.id}`)})),[a,o]);return e(be,{slides:i})},En="_posterLandscape_1smau_1",Wn={posterLandscape:En};function zn(a){const o=a.availableEpisodes?.sub;if(typeof o=="number"&&o>0)return o;const i=a.availableEpisodesDetail?.sub,t=a.availableEpisodesDetail?.dub,n=(Array.isArray(i)?i.length:0)+(Array.isArray(t)?t.length:0);return n>0?n:null}const On=({works:a})=>{const o=te(),i=Y(()=>a.slice(0,6).map((t,n)=>{const c=Bt(t),s=`/asmr/${encodeURIComponent(c)}`,N=zn(t);return{key:c||t._id||String(n),bannerSrc:t.thumbnail||"",posterSrc:t.thumbnail,posterAlt:t.name,title:t.name,detailTo:s,metaItems:[t.rating?t.rating.toUpperCase():void 0,N?`${N} track${N===1?"":"s"}`:void 0].filter(p=>!!p),tags:[],synopsis:t.description?.slice(0,160)||"",primaryLabel:"Listen Now",primaryIcon:"play",onPrimary:()=>o(s),onDetails:()=>o(s)}}),[a,o]);return e(be,{slides:i,posterClassName:Wn.posterLandscape})},Fn=[{value:"anime",label:"Anime"},{value:"manga",label:"Manga"},{value:"tv",label:"TV & Movies"},{value:"asmr",label:"ASMR"}],hr=()=>{const a=Je(),o=st(),[i,t]=U.useState(1),[n,c]=D(()=>localStorage.getItem("home_activeTab")||"latest"),[s,N]=D(()=>localStorage.getItem("season_format")||"TV"),p=G(null),{data:v}=Le(i+1,s,n==="season"),{titlePreference:m}=We(),{contentType:_,setContentType:b}=lt(),[r,k]=U.useState(null),[u,l]=U.useState(!1),h=it(),{data:I=[]}=ct(),R=dt(),T=ut(),E=ht();O(()=>{document.title="Home - dango"},[]);const{data:C,isLoading:x}=mt();O(()=>{localStorage.setItem("home_activeTab",n)},[n]),O(()=>{localStorage.setItem("season_format",s),t(1)},[s]),O(()=>{C!==void 0&&C.length===0&&n==="week"&&c("latest")},[C,n]);const{data:W,isLoading:M,fetchNextPage:L,hasNextPage:A,isFetchingNextPage:X}=pt(),j=P(()=>{A&&!X&&!M&&L()},[A,X,M,L]),{data:d,isLoading:w}=gt(),{data:S,isLoading:g}=Qe("all","week",1,_==="tv"),{data:z,isLoading:q}=Pt(_==="asmr"),{data:Z,isLoading:ce}=Nt(),Q=Y(()=>W?.pages||[],[W]),{data:J,isLoading:ae}=Le(i,s,n==="season"),ne=14,Ne=J&&J.length>=ne&&v&&v.length>0,de=et(o.continueWatching.remove.mutationOptions({onSuccess:async()=>{a.invalidateQueries(o.continueWatching.pathFilter()),await a.invalidateQueries({queryKey:["allContinueWatching"]}),A&&Q.length-1<14&&L()}})),se=P(V=>{const K=Q?.find(Te=>String(Te.id)===String(V));if(K){const Te=K[m]||K.name;k({id:V,name:Te})}},[Q,m]),Ye=P(()=>{r&&(de.mutate({showId:r.id}),u&&h.mutate({id:r.id}),k(null),l(!1))},[r,de,h,u]),Ie=[{key:"latest",label:"Latest Releases"},{key:"season",label:"Current Season"},{key:"popular",label:"Trending"}],Ae=C!==void 0&&C.length>0,Xe=Ae?[{key:"week",label:"This Week"},...Ie]:Ie,Re=n==="week"&&!Ae?"latest":n,Ke=()=>{switch(Re){case"latest":return e(oa,{eyebrow:"Fresh episodes"});case"season":return e("section",{style:{marginBottom:"2.5rem"},children:[e("div",{className:H["section-header"],ref:p,children:[e("div",{className:H["title-wrapper"],children:e("div",{className:"title-stack",children:[e("div",{className:"section-eyebrow",children:"This season"}),e("div",{className:"section-title",style:{marginBottom:0},children:"Current Season"})]})}),e("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[e(ge,{ariaLabel:"Season format",width:90,value:s,onChange:N,options:[{value:"TV",label:"TV"},{value:"ONA",label:"ONA"},{value:"OVA",label:"OVA"},{value:"MOVIE",label:"Movie"},{value:"ALL",label:"All"},{value:"ADULT",label:"Mature"}]}),e("div",{className:H["pagination-controls"],children:e(tt,{page:i,canGoNext:Ne,onChange:V=>{if(t(V),p.current){const K=p.current.getBoundingClientRect().top+window.scrollY-120;window.scrollTo({top:K,behavior:"smooth"})}},isLoading:ae})})]})]}),e("div",{className:`grid-container ${H.seasonGrid}`,style:{minHeight:"300px",alignContent:"start"},children:ae?e(De,{count:ne}):J?.slice(0,ne).map(V=>e(oe,{anime:V},V._id))})]});case"popular":return e(aa,{title:"Trending",eyebrow:"Discover"});case"week":return e(xe,{title:"This Week",eyebrow:"Aired this week",animeList:C||[],continueWatching:!1,carousel:!0,loading:x});default:return null}};return e("div",{style:{paddingBottom:"2rem"},children:[_==="anime"&&(w&&!d?.length?e(he,{}):d&&d.length>0&&e(dn,{animeList:d})),_==="tv"&&(g&&!S?.results?.length?e(he,{}):S?.results&&S.results.length>0&&e(Pn,{items:S.results})),_==="manga"&&(ce&&!Z?.length?e(he,{}):Z&&Z.length>0&&e(Dn,{mangaList:Z})),_==="asmr"&&(q&&!z?.length?e(he,{}):z&&z.length>0&&e(On,{works:z})),e(ve,{ariaLabel:"Content type",options:Fn,value:_,onChange:b}),_==="manga"?e(kn,{}):_==="tv"?e(Ln,{}):_==="asmr"?e(Mn,{}):e(ie,{children:[e(xe,{title:"Continue Watching",eyebrow:"Pick up where you left off",titleLink:"/watchlist/Continue Watching",animeList:Q,continueWatching:!0,carousel:!0,collapsible:!0,defaultExpanded:Q.length>0,onRemove:se,loading:M,onReachThreshold:j,scrollThreshold:.7,isFetchingNextPage:X,emptyState:e(ye,{icon:"history",text:"You haven't watched anything yet. Start exploring and watch something first!",actionLabel:"Explore Trending",onAction:()=>c("popular")})}),e(_t,{title:"Queue",eyebrow:"Up next",items:I,onRemove:V=>R.mutate({showId:V.showId,episodeNumber:V.episodeNumber}),showClearAll:!0,onClear:()=>T.mutate(),onReorder:V=>E.mutate(V.map(K=>({id:K.id,showId:K.showId,episodeNumber:K.episodeNumber})))}),e(ve,{ariaLabel:"Browse anime",options:Xe.map(V=>({value:V.key,label:V.label})),value:Re,onChange:c}),e("div",{className:H.tabContent,children:Ke()}),e(Ia,{eyebrow:"Never miss an episode"}),e(Oe,{isOpen:!!r,itemName:r?.name,progressKind:"watch",listLabel:"my watchlist",alsoRemove:u,onAlsoRemoveChange:l,onClose:()=>{k(null),l(!1)},onConfirm:Ye})]})]})};export{hr as default};
|
|
1
|
+
import{d as D,A as G,h as O,q as P,g as U,u as e,L as Pe,T as Y,S as ie,a as te,_ as je}from"./vendor-core-8R2fFbyN.js";import{b as Ze,u as Je,a as et}from"./vendor-query-BUTye89G.js";import{S as De,A as Ee,P as tt}from"./SkeletonGrid-BJyZkg_K.js";import{A as oe}from"./AnimeCard-B0oMgXBm.js";import{I as F}from"./vendor-icons-CDMuNDeL.js";import{u as ke,a as le,b as at,c as nt,t as rt,d as We,s as ot,f as Se,B as ze,e as re,g as st,h as Le,i as lt,j as it,k as ct,l as dt,m as ut,n as ht,o as mt,p as pt,q as gt}from"./index-B5SLDCAi.js";import{u as vt}from"./vendor-ui-CUDCvRS_.js";import{E as Ce}from"./ErrorMessage-z4f4WGgP.js";import{R as Oe}from"./ResetProgressModal-CByRM1Fh.js";import{Q as _t}from"./QueueRail-Bpla2xD8.js";import{M as _e}from"./MediaCard-DzA336CA.js";import{u as Fe,M as Ve}from"./useMangaPopup-BLwvRZn0.js";import{M as ft}from"./MangaResetProgressModal-CPMEqZyi.js";import{u as Ge,a as bt,m as we,i as Ue,b as qe,c as He,d as yt,e as Nt}from"./useMangaLibrary-DcxPn0RM.js";import{u as Tt}from"./useProviders-D3L1Chqc.js";import{u as St}from"./useMatureConsent-CT7-KfzG.js";import{u as Qe,a as $e,T as wt}from"./useTv-B546u-Rx.js";import{T as kt}from"./TvPopup-CqlVRF-Y.js";import{u as Ct,a as It,b as At,t as Rt,i as Lt,c as $t}from"./useTvLibrary-C2rPeCVT.js";import{A as xt}from"./AsmrResetProgressModal-C9R7HlNa.js";import{u as Mt,a as Bt,b as Pt}from"./useAsmr-D6cSjbvt.js";import"./useAnimeInfoData-DU9X90no.js";import"./QueueOptionsButton-1M7MdKzM.js";import"./useIsMobile-Dm_b6Ob3.js";const Dt="_sectionWrapper_2p2l1_9",Et="_sectionTitleNoMargin_2p2l1_13",Wt="_carousel_2p2l1_178",B={"section-header":"_section-header_2p2l1_1",sectionWrapper:Dt,sectionTitleNoMargin:Et,"title-wrapper":"_title-wrapper_2p2l1_17","header-controls":"_header-controls_2p2l1_24","header-select":"_header-select_2p2l1_30","collapse-button":"_collapse-button_2p2l1_79","title-link":"_title-link_2p2l1_98","continue-watching":"_continue-watching_2p2l1_117","nav-arrows":"_nav-arrows_2p2l1_139","nav-button":"_nav-button_2p2l1_148","carousel-container":"_carousel-container_2p2l1_178",carousel:Wt,"carousel-inner":"_carousel-inner_2p2l1_187","carousel-card":"_carousel-card_2p2l1_192"};function fe({align:a="start",containScroll:o="trimSnaps",scrollFraction:i=.8,threshold:t=.6,onReachThreshold:n}={}){const[c,s]=vt({align:a,containScroll:o,dragFree:!0}),[N,p]=D(!1),v=G({scrollFraction:i,threshold:t,onReachThreshold:n}),m=G(!1);O(()=>{v.current={scrollFraction:i,threshold:t,onReachThreshold:n}});const _=P(u=>{p(u.canScrollPrev()||u.canScrollNext())},[]);O(()=>{if(!s)return;const u=()=>{const l=s.scrollProgress();l>=v.current.threshold&&!m.current?(m.current=!0,v.current.onReachThreshold?.()):l<v.current.threshold&&(m.current=!1),_(s)};return s.on("init",u),s.on("reInit",u),s.on("scroll",u),s.on("resize",u),()=>{s.off("init",u),s.off("reInit",u),s.off("scroll",u),s.off("resize",u)}},[s,_]);const b=P(u=>{const l=u.containerNode().firstElementChild;if(!l)return 1;const h=u.rootNode().getBoundingClientRect().width,I=l.getBoundingClientRect().width;return I?Math.max(1,Math.round(h/I)):1},[]),r=P((u,l=!1)=>{if(!s)return;const h=Math.max(1,Math.round(b(s)*v.current.scrollFraction)),I=s.selectedScrollSnap()+(u==="left"?-h:h);s.scrollTo(I,l)},[s,b]),k=P((u=!1)=>{s?.scrollTo(0,u)},[s]);return{emblaRef:c,api:s,canScroll:N,stepBy:r,scrollToStart:k}}const ee=({title:a,eyebrow:o,titleLink:i,loading:t,emptyState:n,carousel:c,layout:s,collapsible:N,defaultExpanded:p=!0,onReachThreshold:v,scrollThreshold:m,isFetchingNextPage:_,resetScrollOnShrink:b,itemCount:r=0,highlight:k,headerActions:u,loadingSkeleton:l,skeletonCount:h=7,children:I})=>{const{lowEndMode:R}=ke(),{emblaRef:T,stepBy:E,scrollToStart:C}=fe({onReachThreshold:v,threshold:m}),[x,W]=U.useState(p);U.useEffect(()=>{W(p)},[p]);const M=U.useRef(0);return U.useEffect(()=>{b&&r>0&&x&&(r<=M.current||M.current===0)&&C(),r>0&&(M.current=r)},[r,b,x,C]),!t&&r===0&&!n&&!N?null:e("section",{className:`${B.sectionWrapper} ${k?B["continue-watching"]:""}`,children:[e("div",{className:B["section-header"],children:[e("div",{className:B["title-wrapper"],children:[e("div",{className:"title-stack",children:[o&&e("div",{className:"section-eyebrow",children:o}),i?e(Pe,{to:i,className:B["title-link"],children:e("div",{className:`section-title ${B.sectionTitleNoMargin}`,children:a})}):e("div",{className:`section-title ${B.sectionTitleNoMargin}`,children:a})]}),c&&r>0&&x&&e("div",{className:B["nav-arrows"],children:[e("button",{className:B["nav-button"],type:"button","aria-label":"Scroll left",onClick:L=>{L.preventDefault(),E("left",R)},children:e(F,{name:"chevron-left"})}),e("button",{className:B["nav-button"],type:"button","aria-label":"Scroll right",onClick:L=>{L.preventDefault(),E("right",R)},children:e(F,{name:"chevron-right"})})]})]}),e("div",{className:B["header-controls"],children:[u,N&&e("button",{className:B["collapse-button"],type:"button",onClick:()=>W(L=>!L),"aria-expanded":x,"aria-label":x?`Collapse ${a}`:`Expand ${a}`,children:x?e(F,{name:"chevron-up"}):e(F,{name:"chevron-down"})})]})]}),x&&(c?!t&&r===0&&n?e("div",{children:n}):e("div",{className:B["carousel-container"],children:e("div",{className:B.carousel,ref:T,children:e("div",{className:B["carousel-inner"],children:[t&&r===0?Array.from({length:h}).map((L,A)=>e("div",{className:B["carousel-card"],children:l},A)):U.Children.map(I,(L,A)=>e("div",{className:B["carousel-card"],children:L},U.isValidElement(L)&&L.key!=null?L.key:`slide-${A}`)),_&&l&&e("div",{className:B["carousel-card"],children:l})]})})}):e("div",{className:"grid-container",children:t&&r===0?e(De,{count:6,layout:s}):r>0?I:t?null:e("div",{style:{gridColumn:"1 / -1"},children:n})}))]})},zt=({title:a,eyebrow:o,animeList:i,continueWatching:t,titleLink:n,onRemove:c,loading:s,emptyState:N,carousel:p,cardConfig:v,layout:m,onReachThreshold:_,scrollThreshold:b,isFetchingNextPage:r,collapsible:k,defaultExpanded:u=!0})=>{const l=m||"vertical";return e(ee,{title:a,eyebrow:o,titleLink:n,loading:s,emptyState:N,carousel:p,layout:l,collapsible:k,defaultExpanded:u,onReachThreshold:_,scrollThreshold:b,isFetchingNextPage:r,resetScrollOnShrink:t,highlight:t,itemCount:i.length,loadingSkeleton:e(Ee,{layout:l}),skeletonCount:7,children:p?i.map(h=>e(oe,{anime:h,continueWatching:t,onRemove:c,config:v,layout:l},h._id)):i.map(h=>e(oe,{anime:h,continueWatching:t,onRemove:c,config:v,layout:l},h._id))})},xe=U.memo(zt),Ot="_sectionWrapper_c8uv6_2",Ft="_sectionTitleNoMargin_c8uv6_6",Vt="_timeSelect_c8uv6_80",Gt="_carouselContainer_c8uv6_111",Ut="_carousel_c8uv6_111",qt="_carouselInner_c8uv6_122",Ht="_carouselItem_c8uv6_127",Qt="_rankCard_c8uv6_164",Yt="_rankPill_c8uv6_168",Xt="_rankGold_c8uv6_179",Kt="_rankSilver_c8uv6_183",jt="_rankBronze_c8uv6_187",Zt="_skeletonPoster_c8uv6_198",Jt="_skeletonText_c8uv6_199",f={sectionWrapper:Ot,sectionTitleNoMargin:Ft,"section-header":"_section-header_c8uv6_10","title-wrapper":"_title-wrapper_c8uv6_18","nav-arrows":"_nav-arrows_c8uv6_40","nav-button":"_nav-button_c8uv6_49",timeSelect:Vt,carouselContainer:Gt,carousel:Ut,carouselInner:qt,carouselItem:Ht,rankCard:Qt,rankPill:Yt,rankGold:Xt,rankSilver:Kt,rankBronze:jt,skeletonPoster:Zt,skeletonText:Jt},Me="TRENDING_DESC",ea="POPULARITY_DESC",ta=10;function aa({title:a,eyebrow:o}){const{lowEndMode:i}=ke(),[t,n]=le("trending_sort",Me),c=[{value:Me,label:"Trending"},{value:ea,label:"All Time"}],{data:s,fetchNextPage:N,hasNextPage:p,isFetchingNextPage:v,isLoading:m,isError:_,error:b}=at(t,ta),r=Y(()=>s?.pages.flatMap(h=>h)||[],[s]),k=P(()=>{p&&!v&&!m&&N()},[p,v,m,N]),{emblaRef:u,stepBy:l}=fe({onReachThreshold:k});return e("section",{className:f.sectionWrapper,children:[e("div",{className:f["section-header"],children:[e("div",{className:f["title-wrapper"],children:[e("div",{className:"title-stack",children:[o&&e("div",{className:"section-eyebrow",children:o}),e("div",{className:`section-title ${f.sectionTitleNoMargin}`,children:a})]}),e("div",{className:f["nav-arrows"],children:[e("button",{className:f["nav-button"],type:"button",onClick:h=>{h.preventDefault(),l("left",i)},"aria-label":"Scroll left",children:e(F,{name:"chevron-left"})}),e("button",{className:f["nav-button"],type:"button",onClick:h=>{h.preventDefault(),l("right",i)},"aria-label":"Scroll right",children:e(F,{name:"chevron-right"})})]})]}),e("div",{className:f["header-actions"],children:e("select",{className:f.timeSelect,value:t,onChange:h=>n(h.currentTarget.value),children:c.map(h=>e("option",{value:h.value,children:h.label},h.value))})})]}),m?e("div",{className:f.carouselContainer,children:e("div",{className:f.carousel,children:e("div",{className:f.carouselInner,children:Array.from({length:7}).map((h,I)=>e("div",{className:f.carouselItem,children:[e("div",{className:f.skeletonPoster}),e("div",{className:f.skeletonText})]},I))})})}):_?e(Ce,{message:b instanceof Error?b.message:"An unknown error occurred"}):e("div",{className:f.carouselContainer,children:e("div",{className:f.carousel,ref:u,children:e("div",{className:f.carouselInner,children:[r.map((h,I)=>e("div",{className:f.carouselItem,children:[e("div",{className:f.rankCard,children:e(oe,{anime:h})}),e("div",{className:`${f.rankPill} ${I===0?f.rankGold:I===1?f.rankSilver:I===2?f.rankBronze:""}`,children:I+1})]},h._id)),v&&e("div",{className:f.carouselItem,style:{minWidth:"150px",display:"flex",alignItems:"center",justifyContent:"center"},children:e("div",{className:f.skeletonPoster})})]})})})]})}const na=[{value:"TV",label:"TV"},{value:"ONA",label:"ONA"},{value:"OVA",label:"OVA"},{value:"MOVIE",label:"Movie"},{value:"ALL",label:"All"},{value:"ADULT",label:"Mature"}],ra=10;function oa({eyebrow:a}){const{lowEndMode:o}=ke(),[i,t]=le("latest_releases_format","TV"),{data:n,fetchNextPage:c,hasNextPage:s,isFetchingNextPage:N,isLoading:p,isError:v,error:m}=nt(i,ra),_=Y(()=>n?.pages.flatMap(u=>u)||[],[n]),b=P(()=>{s&&!N&&!p&&c()},[s,N,p,c]),{emblaRef:r,stepBy:k}=fe({onReachThreshold:b});return e("section",{className:f.sectionWrapper,children:[e("div",{className:f["section-header"],children:[e("div",{className:f["title-wrapper"],children:[e("div",{className:"title-stack",children:[a&&e("div",{className:"section-eyebrow",children:a}),e("div",{className:`section-title ${f.sectionTitleNoMargin}`,children:"Latest Releases"})]}),e("div",{className:f["nav-arrows"],children:[e("button",{className:f["nav-button"],type:"button",onClick:u=>{u.preventDefault(),k("left",o)},"aria-label":"Scroll left",children:e(F,{name:"chevron-left"})}),e("button",{className:f["nav-button"],type:"button",onClick:u=>{u.preventDefault(),k("right",o)},"aria-label":"Scroll right",children:e(F,{name:"chevron-right"})})]})]}),e("div",{className:f["header-actions"],children:e("select",{className:f.timeSelect,value:i,onChange:u=>t(u.currentTarget.value),children:na.map(u=>e("option",{value:u.value,children:u.label},u.value))})})]}),p?e("div",{className:f.carouselContainer,children:e("div",{className:f.carousel,children:e("div",{className:f.carouselInner,children:Array.from({length:7}).map((u,l)=>e("div",{className:f.carouselItem,children:[e("div",{className:f.skeletonPoster}),e("div",{className:f.skeletonText})]},l))})})}):v?e(Ce,{message:m instanceof Error?m.message:"An unknown error occurred"}):e("div",{className:f.carouselContainer,children:e("div",{className:f.carousel,ref:r,children:e("div",{className:f.carouselInner,children:[_.map(u=>e("div",{className:f.carouselItem,children:e(oe,{anime:u})},u._id)),N&&e("div",{className:f.carouselItem,style:{minWidth:"150px",display:"flex",alignItems:"center",justifyContent:"center"},children:e("div",{className:f.skeletonPoster})})]})})})]})}const sa="_scheduleSection_10dfe_1",la="_sectionTitleRow_10dfe_5",ia="_sectionTitleNoMargin_10dfe_11",ca="_sectionHeader_10dfe_15",da="_headerActions_10dfe_25",ua="_timeSelect_10dfe_31",ha="_daySelectorContainer_10dfe_62",ma="_daySelector_10dfe_62",pa="_daySelectorInner_10dfe_79",ga="_dayBtn_10dfe_90",va="_active_10dfe_113",_a="_dayMonth_10dfe_121",fa="_dayNum_10dfe_129",ba="_dayName_10dfe_135",ya="_navArrows_10dfe_148",Na="_navButton_10dfe_157",Ta="_carouselContainer_10dfe_181",Sa="_carousel_10dfe_181",wa="_carouselInner_10dfe_193",ka="_carouselCard_10dfe_198",$={scheduleSection:sa,sectionTitleRow:la,sectionTitleNoMargin:ia,sectionHeader:ca,headerActions:da,timeSelect:ua,daySelectorContainer:ha,daySelector:ma,daySelectorInner:pa,dayBtn:ga,active:va,dayMonth:_a,dayNum:fa,dayName:ba,navArrows:ya,navButton:Na,carouselContainer:Ta,carousel:Sa,carouselInner:wa,carouselCard:ka},ue=a=>{const o=a.getFullYear(),i=String(a.getMonth()+1).padStart(2,"0"),t=String(a.getDate()).padStart(2,"0");return`${o}-${i}-${t}`},Ca=async(a,o)=>await rt.data.schedule.query({date:a,format:o}),Ia=({eyebrow:a})=>{const[o,i]=D(()=>ue(new Date)),[t,n]=le("schedule_format","TV"),{emblaRef:c,canScroll:s,stepBy:N,scrollToStart:p}=fe(),v=G(null),m=G(!0),{data:_=[],isLoading:b,error:r}=Ze({queryKey:["schedule",o,t],queryFn:()=>Ca(o,t),staleTime:1e3*60*5}),k=Y(()=>{const l=[],h=new Date,I=ue(h),R=new Date(h);R.setDate(h.getDate()-1);const T=ue(R),E=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];for(let C=-6;C<=6;C++){const x=new Date;x.setDate(h.getDate()+C),l.push(x)}return l.map(C=>{const x=ue(C),L=x===I?"Today":x===T?"Yest":E[C.getDay()],A=C.getDate(),X=new Intl.DateTimeFormat("en-US",{month:"short"}).format(C);return{dateString:x,dayLabel:L,dayNum:A,monthName:X}})},[]);O(()=>{if(m.current){m.current=!1;return}if(v.current){const l=v.current.querySelector(`[data-date="${o}"]`);l&&l.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})}},[o]),O(()=>{p(!0)},[o,p]);const u=[{value:"TV",label:"TV"},{value:"ONA",label:"ONA"},{value:"OVA",label:"OVA"},{value:"MOVIE",label:"Movie"},{value:"ALL",label:"All"},{value:"ADULT",label:"Mature"}];return e("div",{className:$.scheduleSection,children:[e("div",{className:$.sectionHeader,children:[e("div",{className:$.sectionTitleRow,children:[e("div",{className:"title-stack",children:[a&&e("div",{className:"section-eyebrow",children:a}),e("h2",{className:`section-title ${$.sectionTitleNoMargin}`,children:"Episode Schedule"})]}),_.length>0&&s&&e("div",{className:$.navArrows,children:[e("button",{className:$.navButton,onClick:()=>N("left"),"aria-label":"Scroll left",children:e(F,{name:"chevron-left"})}),e("button",{className:$.navButton,onClick:()=>N("right"),"aria-label":"Scroll right",children:e(F,{name:"chevron-right"})})]})]}),e("div",{className:$.headerActions,children:e("select",{className:$.timeSelect,value:t,onChange:l=>n(l.target.value),children:u.map(l=>e("option",{value:l.value,children:l.label},l.value))})})]}),e("div",{className:$.daySelectorContainer,children:e("div",{className:$.daySelector,ref:v,children:e("div",{className:$.daySelectorInner,children:k.map(l=>e("button",{type:"button","data-date":l.dateString,className:`${$.dayBtn} ${o===l.dateString?$.active:""}`,onClick:()=>i(l.dateString),children:[e("span",{className:$.dayMonth,children:l.monthName}),e("span",{className:$.dayNum,children:l.dayNum}),e("span",{className:$.dayName,children:l.dayLabel})]},l.dateString))})})}),e("div",{className:$.carouselContainer,children:e("div",{className:$.carousel,ref:c,children:e("div",{className:$.carouselInner,children:b?Array.from({length:7}).map((l,h)=>e("div",{className:$.carouselCard,children:e(Ee,{layout:"vertical"})},h)):r?e("div",{style:{width:"100%"},children:e(Ce,{message:r instanceof Error?r.message:"An unknown error occurred"})}):_.length===0?e("p",{style:{textAlign:"center",marginTop:"1rem",width:"100%"},children:"No episodes scheduled for this day."}):_.map(l=>e("div",{className:$.carouselCard,children:e(oe,{anime:l,continueWatching:!1,layout:"vertical"},l._id)},l._id))})})})]})},Aa="_bannerContainer_1r6xz_1",Ra="_hero_1r6xz_28",La="_ambient_1r6xz_37",$a="_ambientShow_1r6xz_49",xa="_scrim_1r6xz_53",Ma="_progressLine_1r6xz_69",Ba="_paused_1r6xz_89",Pa="_dots_1r6xz_103",Da="_dot_1r6xz_103",Ea="_dotActive_1r6xz_132",Wa="_viewport_1r6xz_138",za="_track_1r6xz_145",Oa="_slide_1r6xz_151",Fa="_slideInner_1r6xz_159",Va="_poster_1r6xz_169",Ga="_info_1r6xz_179",Ua="_kicker_1r6xz_183",qa="_featureLabel_1r6xz_190",Ha="_scoreChip_1r6xz_202",Qa="_rise_1r6xz_220",Ya="_active_1r6xz_224",Xa="_metaRow_1r6xz_280",Ka="_metaItem_1r6xz_291",ja="_metaDivider_1r6xz_297",Za="_title_1r6xz_304",Ja="_genres_1r6xz_320",en="_genreTag_1r6xz_328",tn="_summary_1r6xz_339",an="_actions_1r6xz_351",nn="_watchBtn_1r6xz_358",rn="_detailsBtn_1r6xz_380",on="_navArrow_1r6xz_401",sn="_prevArrow_1r6xz_434",ln="_nextArrow_1r6xz_438",y={bannerContainer:Aa,hero:Ra,ambient:La,ambientShow:$a,scrim:xa,progressLine:Ma,paused:Ba,dots:Pa,dot:Da,dotActive:Ea,viewport:Wa,track:za,slide:Oa,slideInner:Fa,poster:Va,info:Ga,kicker:Ua,featureLabel:qa,scoreChip:Ha,rise:Qa,active:Ya,metaRow:Xa,metaItem:Ka,metaDivider:ja,title:Za,genres:Ja,genreTag:en,summary:tn,actions:an,watchBtn:nn,detailsBtn:rn,navArrow:on,prevArrow:sn,nextArrow:ln},cn=8e3,he=()=>e("div",{className:"skeleton",style:{width:"100vw",maxWidth:"100vw",position:"relative",left:"50%",right:"50%",marginLeft:"-50vw",marginRight:"-50vw",height:"clamp(480px, 72vh, 660px)",marginTop:"calc(-1 * var(--header-height))",marginBottom:"2.5rem"}}),be=({slides:a,posterClassName:o})=>{const[i,t]=D(0),[n,c]=D(0),[s,N]=D(!1),[p,v]=D(null),[m,_]=D(0),[b,r]=D({front:"",back:"",flip:!1}),k=G(0),u=G(0),l=G(new Set),h=G(null),I=G(0),R=P(d=>d.bannerSrc,[]),T=P(()=>{c(d=>d+1)},[]),E=P(d=>{h.current!==null&&(window.clearTimeout(h.current),h.current=null),v(null),T();const w=R(a[d]);r(S=>S.flip?{front:w,back:S.back,flip:!1}:{front:S.front,back:w,flip:!0}),t(d)},[T,a,R]),C=P(d=>{if(a.length===0)return;const w=(d%a.length+a.length)%a.length;l.current.has(R(a[w]))?E(w):v(w)},[a,R,E]);O(()=>{let d=!1;return a.forEach(w=>{const S=R(w);if(!S||l.current.has(S))return;const g=new Image;g.src=S;const z=()=>{d||l.current.has(S)||(l.current.add(S),_(q=>q+1))};g.onload=z,g.onerror=z}),()=>{d=!0}},[a,R]),O(()=>{if(a.length!==0&&!b.front){const d=R(a[0]);r({front:d,back:"",flip:!1})}},[a,b.front,R]),O(()=>{if(p!==null){if(p<0||p>=a.length){v(null);return}l.current.has(R(a[p]))&&E(p)}},[p,m,a,R,E]),O(()=>{if(p===null)return;h.current!==null&&window.clearTimeout(h.current);const d=p;return h.current=window.setTimeout(()=>{h.current=null,E(d)},2500),()=>{h.current!==null&&(window.clearTimeout(h.current),h.current=null)}},[p,E]);const x=P(d=>{C(d)},[C]),W=P(()=>{C(I.current+1)},[C]),M=P(()=>{C(I.current-1)},[C]),L=G(null);if(O(()=>{const d=L.current;if(!d)return;const w=S=>{if(Math.abs(S.deltaY)>Math.abs(S.deltaX)&&Math.abs(S.deltaY)>5){S.preventDefault(),S.stopPropagation();const g=Date.now();if(g-k.current<300)return;k.current=g,T(),S.deltaY>0?W():M()}};return d.addEventListener("wheel",w,{passive:!1}),()=>d.removeEventListener("wheel",w)},[a.length,W,M,T]),O(()=>{if(a.length===0||s)return;const d=setTimeout(W,cn);return()=>clearTimeout(d)},[i,W,a.length,n,s]),O(()=>{const d=w=>{const S=w.target;S&&(S.tagName==="INPUT"||S.tagName==="TEXTAREA"||S.tagName==="SELECT"||S.isContentEditable)||(w.key==="ArrowRight"?(w.preventDefault(),W()):w.key==="ArrowLeft"&&(w.preventDefault(),M()))};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[W,M]),O(()=>{i>=a.length&&t(0)},[a.length,i]),a.length===0)return null;const A=i>=a.length?0:i;I.current=A;const X=d=>{u.current=d.touches[0].clientX},j=d=>{const S=d.changedTouches[0].clientX-u.current;Math.abs(S)>50&&(T(),S>0?M():W())};return e("div",{className:y.bannerContainer,onMouseEnter:()=>N(!0),onMouseLeave:()=>N(!1),children:e("div",{className:`${y.hero} ${s?y.paused:""}`,onTouchStart:X,onTouchEnd:j,children:[b.front&&e("img",{src:b.front,alt:"","aria-hidden":"true",className:`${y.ambient} ${b.flip?"":y.ambientShow}`}),b.back&&e("img",{src:b.back,alt:"","aria-hidden":"true",className:`${y.ambient} ${b.flip?y.ambientShow:""}`}),e("div",{className:y.scrim,"aria-hidden":"true"}),a.length>1&&e("div",{className:y.progressLine,"aria-hidden":"true"},`progress-${n}-${A}`),a.length>1&&e("div",{className:y.dots,ref:L,role:"tablist","aria-label":"Spotlight slides",children:a.map((d,w)=>e("button",{role:"tab","aria-selected":w===A,"aria-label":`Go to slide ${w+1}: ${d.title}`,className:`${y.dot} ${w===A?y.dotActive:""}`,onClick:()=>x(w),tabIndex:w===A?0:-1},d.key))}),e("div",{className:y.viewport,children:e("div",{className:y.track,style:{transform:`translateX(-${A*100}%)`},children:a.map((d,w)=>e("div",{className:`${y.slide} ${w===A?y.active:""}`,"aria-hidden":w!==A,children:e("div",{className:y.slideInner,children:[e("img",{src:d.posterSrc,alt:d.posterAlt,className:o??y.poster,decoding:"async"}),e("div",{className:y.info,children:[e("div",{className:`${y.kicker} ${y.rise}`,children:[e("span",{className:y.featureLabel,children:"Spotlight"}),d.score!==void 0&&d.score!==null&&d.score!==""&&e("span",{className:y.scoreChip,children:[e(F,{name:"star",size:12}),e("span",{children:d.score})]})]}),e(Pe,{to:d.detailTo,className:`${y.title} ${y.rise}`,"aria-label":`View details for ${d.title}`,tabIndex:w===A?0:-1,children:d.title}),d.metaItems.length>0&&e("div",{className:`${y.metaRow} ${y.rise}`,children:d.metaItems.map((S,g)=>e(U.Fragment,{children:[e("span",{className:y.metaItem,children:S}),g<d.metaItems.length-1&&e("div",{className:y.metaDivider})]},g))}),d.tags.length>0&&e("div",{className:`${y.genres} ${y.rise}`,children:d.tags.slice(0,3).map(S=>e("span",{className:y.genreTag,children:S},S))}),d.synopsis&&e("p",{className:`${y.summary} ${y.rise}`,children:d.synopsis}),e("div",{className:`${y.actions} ${y.rise}`,children:[e("button",{className:y.watchBtn,onClick:d.onPrimary,tabIndex:w===A?0:-1,children:[e(F,{name:d.primaryIcon,size:14}),e("span",{children:d.primaryLabel})]}),e("button",{className:y.detailsBtn,onClick:d.onDetails,tabIndex:w===A?0:-1,children:[e(F,{name:"info-circle",size:15}),e("span",{children:"Details"})]})]})]})]})},d.key))})}),a.length>1&&e(ie,{children:[e("button",{className:`${y.navArrow} ${y.prevArrow}`,onClick:()=>{T(),M()},"aria-label":"Previous slide",children:e(F,{name:"chevron-left",size:20})}),e("button",{className:`${y.navArrow} ${y.nextArrow}`,onClick:()=>{T(),W()},"aria-label":"Next slide",children:e(F,{name:"chevron-right",size:20})})]})]})})},dn=({animeList:a})=>{const{titlePreference:o}=We(),i=te(),t=Y(()=>a.slice(0,6).map(n=>{const c=o==="nativeName"?n.nativeName||n.name:o==="englishName"&&n.englishName||n.name;return{key:n._id,bannerSrc:n.bannerImage?Se(n.bannerImage,1280,560):Se(n.thumbnail,1280,450),posterSrc:Se(n.thumbnail,460,650),posterAlt:c,title:c,detailTo:`/anime/${n._id}`,score:n.score,metaItems:[n.type||"Anime",n.status,n.episodeCount?`${n.episodeCount} Episodes`:void 0,n.rating].filter(s=>!!s),tags:(n.genres??[]).slice(0,3).map(s=>typeof s=="string"?s:s?.name).filter(s=>!!s),synopsis:ot(n.description??""),primaryLabel:"Watch Now",primaryIcon:"play",onPrimary:()=>i(`/watch/${n._id}`),onDetails:()=>i(`/anime/${n._id}`)}}),[a,o,i]);return e(be,{slides:t})},un="_emptyState_19tmt_1",hn="_emptyStateIcon_19tmt_16",mn="_emptyStateTitle_19tmt_23",pn="_emptyStateText_19tmt_30",me={emptyState:un,emptyStateIcon:hn,emptyStateTitle:mn,emptyStateText:pn},ye=({icon:a,text:o,actionLabel:i,onAction:t,title:n="Nothing is here..."})=>e("div",{className:me.emptyState,children:[e(F,{name:a,size:48,className:me.emptyStateIcon}),e("div",{children:[e("h3",{className:me.emptyStateTitle,children:n}),e("p",{className:me.emptyStateText,children:o})]}),e(ze,{variant:"primary",size:"sm",onClick:t,style:{marginTop:"1rem"},children:i})]}),gn="_select_1dw63_1",vn={select:gn},ge=({value:a,options:o,onChange:i,ariaLabel:t,width:n})=>e("select",{className:vn.select,style:n!==void 0?{width:n}:void 0,value:a,"aria-label":t,onChange:c=>i(c.currentTarget.value),children:o.map(c=>e("option",{value:c.value,children:c.label},c.value))}),_n="_tabBar_irwbm_1",fn="_tabIndicator_irwbm_24",bn="_tabButton_irwbm_38",yn="_tabActive_irwbm_64",pe={tabBar:_n,tabIndicator:fn,tabButton:bn,tabActive:yn};function Nn({options:a,value:o,onChange:i,ariaLabel:t},n){const c=G(null),s=G(new Map),[N,p]=D({left:0,width:0}),v=P(m=>{const _=s.current.get(m),b=c.current;if(_&&b){const r=b.getBoundingClientRect(),k=_.getBoundingClientRect();p({left:k.left-r.left+b.scrollLeft,width:k.width}),_.scrollIntoView({block:"nearest",inline:"nearest"})}},[]);return je(()=>{v(o)},[o,a.length,v]),O(()=>{if(v(o),typeof ResizeObserver>"u")return;let m=0;const _=c.current;if(!_)return;const b=new ResizeObserver(()=>{cancelAnimationFrame(m),m=requestAnimationFrame(()=>v(o))});b.observe(_);let r=!1;return document.fonts?.ready&&document.fonts.ready.then(()=>{r||v(o)}),()=>{r=!0,cancelAnimationFrame(m),b.disconnect()}},[o,a.length,v]),e("div",{className:pe.tabBar,ref:m=>{c.current=m,typeof n=="function"?n(m):n&&(n.current=m)},"aria-label":t,children:[e("div",{className:pe.tabIndicator,style:{left:N.left,width:N.width}}),a.map(m=>e(ze,{ref:_=>{_&&s.current.set(m.value,_)},variant:"secondary",size:"sm",className:`${pe.tabButton} ${o===m.value?pe.tabActive:""}`,onClick:()=>i(m.value),children:m.label},m.value))]})}const ve=U.forwardRef(Nn),Tn=[{value:"popular",label:"Popular"},{value:"followed",label:"Most Followed"},{value:"rating",label:"Top Rated"}];function Sn(){const{options:a}=Tt();return Y(()=>a.filter(o=>o.kind==="manga").map(o=>o.value)[0]??"",[a])}const Be=({title:a,eyebrow:o,provider:i,sort:t,mature:n,headerActions:c})=>{const{toggle:s,bookmarkedIds:N}=Ge(),{popup:p,openPopup:v,scheduleClose:m,cancelClose:_,closePopup:b}=Fe(),{data:r,isLoading:k,fetchNextPage:u,hasNextPage:l,isFetchingNextPage:h}=bt({provider:i,query:"",sort:t,status:"",type:"",rating:n?"safe,suggestive,erotica,pornographic":"safe",mature:n}),I=Y(()=>r?.pages.flatMap(T=>T.items)??[],[r]),R=P(()=>{l&&!h&&!k&&u()},[l,h,k,u]);return i?e(ie,{children:[e(ee,{title:a,eyebrow:o,loading:k,carousel:!0,itemCount:I.length,headerActions:c,onReachThreshold:R,isFetchingNextPage:h,loadingSkeleton:e("div",{className:"skeleton",style:{aspectRatio:"3 / 4"}}),skeletonCount:7,children:I.map(T=>{const E=we(T.provider,T.id);return e(_e,{item:{id:E,title:T.title,...He(T),thumbnail:qe(T.provider,T.cover),typeBadge:T.type||void 0,chapterBadge:T.latestChapter?`Ch. ${T.latestChapter}`:null,isAdult:Ue(T)},linkTo:`/manga/${T.provider}/${encodeURIComponent(T.id)}`,hoverIcon:"info",showInfoButton:!0,display:{elements:{poster:{typeBadge:!0,chapterBadge:!0,adultBadge:!0},info:{title:!0,mobileBadges:!0,progress:!1,meta:!1}}},onOpenDetails:C=>v(C,{provider:T.provider,mangaId:T.id,title:T.title,altTitle:T.altTitle,cover:T.cover,contentRating:T.contentRating,readTarget:`/manga/${T.provider}/${encodeURIComponent(T.id)}`,mature:n}),onPopupHoverIntent:C=>C?_():m(),rawThumbnail:!0},`${T.provider}-${T.id}`)})}),p&&e(Ve,{data:p.data,anchorRect:p.rect,bookmarked:N.has(we(p.data.provider,p.data.mangaId)),onToggleBookmark:()=>s({id:p.data.mangaId,provider:p.data.provider,title:p.data.title,cover:p.data.cover,altTitle:p.data.altTitle??void 0,contentRating:p.data.contentRating}),onMouseEnter:_,onMouseLeave:m,onRequestClose:b})]}):null},wn=()=>{const a=Sn(),{hasConsent:o}=St(),[i,t]=le("manga_discover_tab","latest"),[n,c]=le("manga_trending_sort","popular");return a?e(ie,{children:[e(ve,{ariaLabel:"Discover manga",options:[{value:"latest",label:"Latest Releases"},{value:"trending",label:"Trending"}],value:i,onChange:t}),i==="latest"?e(Be,{title:"Latest Releases",eyebrow:"Fresh chapters",provider:a,sort:"latest",mature:o}):e(Be,{title:"Trending",eyebrow:"Discover",provider:a,sort:n,mature:o,headerActions:e("select",{className:B["header-select"],value:n,onChange:s=>c(s.currentTarget.value),"aria-label":"Trending sort",children:Tn.map(s=>e("option",{value:s.value,children:s.label},s.value))})})]}):null},kn=()=>{const a=te(),{data:o,isLoading:i}=yt(24),[t,n]=D(null),{popup:c,openPopup:s,scheduleClose:N,cancelClose:p,closePopup:v}=Fe(),{toggle:m,bookmarkedIds:_}=Ge(),b=o?.data??[];return e("div",{style:{paddingBottom:"2rem"},children:[e(ee,{title:"Continue Reading",eyebrow:"Pick up where you left off",titleLink:"/reading-list/Continue Reading",loading:i,carousel:!0,collapsible:!0,defaultExpanded:b.length>0,highlight:!0,itemCount:b.length,loadingSkeleton:e("div",{className:"skeleton",style:{aspectRatio:"3 / 4"}}),skeletonCount:7,emptyState:e(ye,{icon:"book",text:"You haven't read anything yet. Browse manga and open a chapter to start tracking.",actionLabel:"Browse Manga",onAction:()=>a("/manga")}),children:b.map(r=>{const k=r.page??0,u=r.pageCount??0,l=r.chapterId&&r.provider?`/manga/${r.provider}/${encodeURIComponent(r.mangaId)}/read?chapter=${encodeURIComponent(r.chapterId)}`:r.provider?`/manga/${r.provider}/${encodeURIComponent(r.mangaId)}`:"#";return e(_e,{item:{id:r.id,title:r.title,...He({title:r.title,altTitle:r.altTitle}),thumbnail:r.provider?qe(r.provider,r.cover||""):r.cover||"",chapterBadge:r.chapterNumber?`Ch. ${r.chapterNumber}`:null,isAdult:Ue(r)},linkTo:l,hoverIcon:"book",progress:u>0?{percent:k/u*100,label:`Ch. ${r.chapterNumber} · p. ${k}/${u}`}:void 0,showProgress:!0,display:{elements:{poster:{typeBadge:!1,chapterBadge:!0,adultBadge:!0,removeButton:!0},info:{title:!0,mobileBadges:!0,progress:!0,meta:!1}}},onRemove:()=>n({libId:r.id,title:r.title}),onOpenDetails:h=>s(h,{provider:r.provider||"",mangaId:r.mangaId||"",title:r.title||"",altTitle:r.altTitle,cover:r.cover||"",contentRating:r.contentRating||void 0,readTarget:l}),onPopupHoverIntent:h=>h?p():N(),rawThumbnail:!0},r.id)})}),e(ft,{mangaId:t?t.libId:null,title:t?.title,onClose:()=>n(null)}),c&&c.data.provider&&e(Ve,{data:c.data,anchorRect:c.rect,bookmarked:_.has(we(c.data.provider,c.data.mangaId)),onToggleBookmark:()=>m({id:c.data.mangaId,provider:c.data.provider,title:c.data.title,cover:c.data.cover,altTitle:c.data.altTitle??void 0,contentRating:c.data.contentRating}),onMouseEnter:p,onMouseLeave:N,onRequestClose:v}),e(wn,{})]})},Cn="_seasonGrid_bt5c7_76",In="_emptyState_bt5c7_108",H={"section-header":"_section-header_bt5c7_1","title-wrapper":"_title-wrapper_bt5c7_8","pagination-controls":"_pagination-controls_bt5c7_14",seasonGrid:Cn,emptyState:In},An=[{value:"latest",label:"Latest Releases"},{value:"trending",label:"Trending"}],Rn=[{value:"trending_week",label:"Trending Now"},{value:"trending_day",label:"Trending Today"},{value:"popular",label:"Popular All Time"},{value:"top_rated",label:"Top Rated"}],Ln=()=>{const a=te(),{data:o,isLoading:i}=Ct(24),t=It(),n=At(),[c,s]=D(null),[N,p]=D(!1),[v,m]=D(()=>localStorage.getItem("tv_home_activeTab")||"latest"),[_,b]=D("tv"),[r,k]=D("trending_week"),[u,l]=D("multi"),h=o?.data??[];U.useEffect(()=>{localStorage.setItem("tv_home_activeTab",v)},[v]);const I=r.startsWith("trending_"),R=r==="trending_day"?"day":"week",T={popular:"popularity.desc",top_rated:"vote_average.desc"},{data:E,isLoading:C}=Qe(u==="multi"?"all":u,R,1,I&&v==="trending"),{data:x,isLoading:W}=$e({type:u,sort_by:T[r]||"popularity.desc",page:1}),M=I?E?.results||[]:x?.results||[],L=I?C:W,{data:A,isLoading:X}=$e({type:_,sort_by:"primary_release_date.desc",page:1}),j=A?.results||[],d=()=>{c&&(n.mutate({mediaId:c.libId}),N&&t.mutate(c.libId),s(null),p(!1))},w=P(g=>e(wt,{item:{id:g.id,title:g.title,year:g.year,type:g.type,image:g.image,vote_average:g.vote_average,adult:g.adult}},`${g.type}-${g.id}`),[]),S=()=>{switch(v){case"latest":return e("section",{children:[e("div",{className:H["section-header"],children:[e("div",{className:H["title-wrapper"],children:e("div",{className:"title-stack",children:[e("div",{className:"section-eyebrow",children:"Fresh picks"}),e("div",{className:"section-title",style:{marginBottom:0},children:"Latest Releases"})]})}),e("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:e(ge,{ariaLabel:"Latest type",value:_,onChange:g=>b(g),options:[{value:"tv",label:"TV Shows"},{value:"movie",label:"Movies"}]})})]}),X?e("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(150px, 1fr))",gap:"var(--space-6)"},children:Array.from({length:7}).map((g,z)=>e("div",{className:"skeleton",style:{aspectRatio:"3 / 4",borderRadius:"var(--radius-lg)"}},z))}):j.length>0?e(ee,{carousel:!0,itemCount:j.length,children:j.map(w)}):e("div",{className:H.emptyState,children:e("p",{children:"No latest releases available right now."})})]});case"trending":return e("section",{children:[e("div",{className:H["section-header"],children:[e("div",{className:H["title-wrapper"],children:e("div",{className:"title-stack",children:[e("div",{className:"section-eyebrow",children:"Discover"}),e("div",{className:"section-title",style:{marginBottom:0},children:"Trending"})]})}),e("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[e(ge,{ariaLabel:"Trending sort",value:r,onChange:k,options:Rn.map(g=>({value:g.value,label:g.label}))}),e(ge,{ariaLabel:"Trending type",value:u,onChange:g=>l(g),options:[{value:"multi",label:"All"},{value:"tv",label:"TV Shows"},{value:"movie",label:"Movies"}]})]})]}),L?e("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(150px, 1fr))",gap:"var(--space-6)"},children:Array.from({length:7}).map((g,z)=>e("div",{className:"skeleton",style:{aspectRatio:"3 / 4",borderRadius:"var(--radius-lg)"}},z))}):M.length>0?e(ee,{carousel:!0,itemCount:M.length,children:M.map(w)}):e("div",{className:H.emptyState,children:e("p",{children:"No trending content available right now."})})]})}};return e("div",{style:{paddingBottom:"2rem"},children:[e(ee,{title:"Continue Watching",eyebrow:"Pick up where you left off",titleLink:"/tv-watchlist/Continue Watching",loading:i,carousel:!0,collapsible:!0,defaultExpanded:h.length>0,highlight:!0,itemCount:h.length,loadingSkeleton:e("div",{className:"skeleton",style:{aspectRatio:"3 / 4"}}),skeletonCount:7,emptyState:e(ye,{icon:"tv",text:"You haven't watched anything yet. Search TV & Movies and start watching to track progress.",actionLabel:"Browse TV & Movies",onAction:()=>a("/tv-search")}),children:h.map(g=>{const z=g.currentTime??0,q=g.duration??0,Z=g.season??g.lastSeason??1,ce=g.episode??g.lastEpisode??1,Q=g.mediaType==="movie",J=Q?"Movie":`S${Z} E${ce}`,ae=g.completed===!0||g.completed===1||q>0&&z>=q*.8,ne=ae?100:q>0&&z>0?z/q*100:0,Ne=ae?"Watched":q>0?Q?`${re(z)} / ${re(q)}`:`${J} · ${re(z)} / ${re(q)}`:J;return e(_e,{item:{id:g.id,title:g.title,thumbnail:g.poster||"",typeBadge:Q?"Movie":"TV",chapterBadge:J,isAdult:Lt({adult:g.adult===1})},linkTo:Rt(g.mediaType,g.tmdbId,Q?void 0:Z,Q?void 0:ce),hoverIcon:"play",progress:(q>0||ae)&&ne>0?{percent:ne,label:Ne}:void 0,showProgress:!0,metaRow:g.year?e("span",{style:{opacity:.75},children:g.year}):void 0,onRemove:()=>s({libId:g.id,title:g.title}),renderPopup:(de,se)=>e(kt,{item:{id:g.tmdbId??0,title:g.title||"",year:g.year||"",type:g.mediaType||"tv",image:g.poster||""},anchorRect:de,onMouseEnter:se.onMouseEnter,onMouseLeave:se.onMouseLeave,onRequestClose:se.close})},g.id)})}),e(ve,{ariaLabel:"Browse TV",options:An,value:v,onChange:m}),e("div",{className:H.tabContent,children:S()}),e(Oe,{isOpen:!!c,itemName:c?.title,progressKind:"watch",listLabel:"my TV watchlist",alsoRemove:N,onAlsoRemoveChange:p,onClose:()=>{s(null),p(!1)},onConfirm:d})]})};function $n(a){const o=a.currentTime??0,i=a.duration??0,t=(a.trackIndex??0)+1;return i>0?`Track ${t} · ${re(o)} / ${re(i)}`:a.trackLabel?`Track ${t} · ${a.trackLabel}`:`Track ${t}`}const xn=({title:a="Continue Listening",limit:o=24,titleLink:i,showEmptyState:t=!0})=>{const n=te(),{data:c,isLoading:s}=Mt(o),[N,p]=D(null),v=c?.data??[];return e(ie,{children:[e(ee,{title:a,eyebrow:"Pick up where you left off",titleLink:i??"/listening-list/Continue Listening",loading:s,carousel:!0,collapsible:!0,defaultExpanded:v.length>0,highlight:!0,itemCount:v.length,loadingSkeleton:e("div",{className:"skeleton",style:{aspectRatio:"16 / 9"}}),skeletonCount:7,emptyState:t?e(ye,{icon:"headphones",text:"You haven't listened to anything yet. Browse ASMR and play a track to start tracking.",actionLabel:"Browse ASMR",onAction:()=>n("/asmr")}):void 0,children:v.map(m=>{const _=m.currentTime??0,b=m.duration??0,r=m.rjCode||m.id;return e(_e,{item:{id:m.id,title:m.title,thumbnail:m.thumbnail||"",chapterBadge:`Track ${(m.trackIndex??0)+1}`,isAdult:!!m.isAdult},linkTo:`/asmr/${encodeURIComponent(r)}`,hoverIcon:"play",layout:"horizontal",progress:b>0?{percent:Math.min(100,_/b*100),label:$n(m)??""}:void 0,showProgress:!0,display:{elements:{poster:{typeBadge:!1,chapterBadge:!0,adultBadge:!0,removeButton:!0},info:{title:!0,mobileBadges:!0,progress:!0,meta:!1}}},onRemove:()=>p({workId:m.id,title:m.title}),rawThumbnail:!0},m.id)})}),e(xt,{workId:N?N.workId:null,title:N?.title,onClose:()=>p(null)})]})},Mn=()=>e("div",{style:{paddingBottom:"2rem"},children:e(xn,{})}),Bn={10759:"Action & Adventure",16:"Animation",35:"Comedy",80:"Crime",18:"Drama",10765:"Sci-Fi & Fantasy",9648:"Mystery",28:"Action",12:"Adventure",14:"Fantasy",27:"Horror",878:"Sci-Fi",53:"Thriller",10749:"Romance"},Pn=({items:a})=>{const o=te(),i=Y(()=>a.slice(0,6).map(t=>{const n=$t(t.type,t.id);return{key:String(t.id),bannerSrc:t.backdrop?t.backdrop:t.image,posterSrc:t.image,posterAlt:t.title,title:t.title,detailTo:n,score:t.vote_average>0?Number(t.vote_average).toFixed(1):null,metaItems:[t.type==="tv"?"TV Show":"Movie",t.year].filter(Boolean),tags:t.genre_ids.slice(0,3).map(c=>Bn[c]).filter(Boolean),synopsis:t.overview.length>200?t.overview.slice(0,200)+"...":t.overview,primaryLabel:"Watch Now",primaryIcon:"play",onPrimary:()=>o(n),onDetails:()=>o(n)}}),[a,o]);return e(be,{slides:i})},Dn=({mangaList:a})=>{const o=te(),i=Y(()=>a.slice(0,6).map(t=>({key:t.id,bannerSrc:t.cover||"",posterSrc:t.cover,posterAlt:t.title,title:t.title,detailTo:`/manga/mangadex/${t.id}`,metaItems:[t.year?String(t.year):void 0,t.status??void 0].filter(n=>!!n),tags:t.tags.slice(0,3),synopsis:t.description?.slice(0,200)||"",primaryLabel:"Read Now",primaryIcon:"book",onPrimary:()=>o(`/manga/mangadex/${t.id}`),onDetails:()=>o(`/manga/mangadex/${t.id}`)})),[a,o]);return e(be,{slides:i})},En="_posterLandscape_1smau_1",Wn={posterLandscape:En};function zn(a){const o=a.availableEpisodes?.sub;if(typeof o=="number"&&o>0)return o;const i=a.availableEpisodesDetail?.sub,t=a.availableEpisodesDetail?.dub,n=(Array.isArray(i)?i.length:0)+(Array.isArray(t)?t.length:0);return n>0?n:null}const On=({works:a})=>{const o=te(),i=Y(()=>a.slice(0,6).map((t,n)=>{const c=Bt(t),s=`/asmr/${encodeURIComponent(c)}`,N=zn(t);return{key:c||t._id||String(n),bannerSrc:t.thumbnail||"",posterSrc:t.thumbnail,posterAlt:t.name,title:t.name,detailTo:s,metaItems:[t.rating?t.rating.toUpperCase():void 0,N?`${N} track${N===1?"":"s"}`:void 0].filter(p=>!!p),tags:[],synopsis:t.description?.slice(0,160)||"",primaryLabel:"Listen Now",primaryIcon:"play",onPrimary:()=>o(s),onDetails:()=>o(s)}}),[a,o]);return e(be,{slides:i,posterClassName:Wn.posterLandscape})},Fn=[{value:"anime",label:"Anime"},{value:"manga",label:"Manga"},{value:"tv",label:"TV & Movies"},{value:"asmr",label:"ASMR"}],hr=()=>{const a=Je(),o=st(),[i,t]=U.useState(1),[n,c]=D(()=>localStorage.getItem("home_activeTab")||"latest"),[s,N]=D(()=>localStorage.getItem("season_format")||"TV"),p=G(null),{data:v}=Le(i+1,s,n==="season"),{titlePreference:m}=We(),{contentType:_,setContentType:b}=lt(),[r,k]=U.useState(null),[u,l]=U.useState(!1),h=it(),{data:I=[]}=ct(),R=dt(),T=ut(),E=ht();O(()=>{document.title="Home - dango"},[]);const{data:C,isLoading:x}=mt();O(()=>{localStorage.setItem("home_activeTab",n)},[n]),O(()=>{localStorage.setItem("season_format",s),t(1)},[s]),O(()=>{C!==void 0&&C.length===0&&n==="week"&&c("latest")},[C,n]);const{data:W,isLoading:M,fetchNextPage:L,hasNextPage:A,isFetchingNextPage:X}=pt(),j=P(()=>{A&&!X&&!M&&L()},[A,X,M,L]),{data:d,isLoading:w}=gt(),{data:S,isLoading:g}=Qe("all","week",1,_==="tv"),{data:z,isLoading:q}=Pt(_==="asmr"),{data:Z,isLoading:ce}=Nt(),Q=Y(()=>W?.pages||[],[W]),{data:J,isLoading:ae}=Le(i,s,n==="season"),ne=14,Ne=J&&J.length>=ne&&v&&v.length>0,de=et(o.continueWatching.remove.mutationOptions({onSuccess:async()=>{a.invalidateQueries(o.continueWatching.pathFilter()),await a.invalidateQueries({queryKey:["allContinueWatching"]}),A&&Q.length-1<14&&L()}})),se=P(V=>{const K=Q?.find(Te=>String(Te.id)===String(V));if(K){const Te=K[m]||K.name;k({id:V,name:Te})}},[Q,m]),Ye=P(()=>{r&&(de.mutate({showId:r.id}),u&&h.mutate({id:r.id}),k(null),l(!1))},[r,de,h,u]),Ie=[{key:"latest",label:"Latest Releases"},{key:"season",label:"Current Season"},{key:"popular",label:"Trending"}],Ae=C!==void 0&&C.length>0,Xe=Ae?[{key:"week",label:"This Week"},...Ie]:Ie,Re=n==="week"&&!Ae?"latest":n,Ke=()=>{switch(Re){case"latest":return e(oa,{eyebrow:"Fresh episodes"});case"season":return e("section",{style:{marginBottom:"2.5rem"},children:[e("div",{className:H["section-header"],ref:p,children:[e("div",{className:H["title-wrapper"],children:e("div",{className:"title-stack",children:[e("div",{className:"section-eyebrow",children:"This season"}),e("div",{className:"section-title",style:{marginBottom:0},children:"Current Season"})]})}),e("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[e(ge,{ariaLabel:"Season format",width:90,value:s,onChange:N,options:[{value:"TV",label:"TV"},{value:"ONA",label:"ONA"},{value:"OVA",label:"OVA"},{value:"MOVIE",label:"Movie"},{value:"ALL",label:"All"},{value:"ADULT",label:"Mature"}]}),e("div",{className:H["pagination-controls"],children:e(tt,{page:i,canGoNext:Ne,onChange:V=>{if(t(V),p.current){const K=p.current.getBoundingClientRect().top+window.scrollY-120;window.scrollTo({top:K,behavior:"smooth"})}},isLoading:ae})})]})]}),e("div",{className:`grid-container ${H.seasonGrid}`,style:{minHeight:"300px",alignContent:"start"},children:ae?e(De,{count:ne}):J?.slice(0,ne).map(V=>e(oe,{anime:V},V._id))})]});case"popular":return e(aa,{title:"Trending",eyebrow:"Discover"});case"week":return e(xe,{title:"This Week",eyebrow:"Aired this week",animeList:C||[],continueWatching:!1,carousel:!0,loading:x});default:return null}};return e("div",{style:{paddingBottom:"2rem"},children:[_==="anime"&&(w&&!d?.length?e(he,{}):d&&d.length>0&&e(dn,{animeList:d})),_==="tv"&&(g&&!S?.results?.length?e(he,{}):S?.results&&S.results.length>0&&e(Pn,{items:S.results})),_==="manga"&&(ce&&!Z?.length?e(he,{}):Z&&Z.length>0&&e(Dn,{mangaList:Z})),_==="asmr"&&(q&&!z?.length?e(he,{}):z&&z.length>0&&e(On,{works:z})),e(ve,{ariaLabel:"Content type",options:Fn,value:_,onChange:b}),_==="manga"?e(kn,{}):_==="tv"?e(Ln,{}):_==="asmr"?e(Mn,{}):e(ie,{children:[e(xe,{title:"Continue Watching",eyebrow:"Pick up where you left off",titleLink:"/watchlist/Continue Watching",animeList:Q,continueWatching:!0,carousel:!0,collapsible:!0,defaultExpanded:Q.length>0,onRemove:se,loading:M,onReachThreshold:j,scrollThreshold:.7,isFetchingNextPage:X,emptyState:e(ye,{icon:"history",text:"You haven't watched anything yet. Start exploring and watch something first!",actionLabel:"Explore Trending",onAction:()=>c("popular")})}),e(_t,{title:"Queue",eyebrow:"Up next",items:I,onRemove:V=>R.mutate({showId:V.showId,episodeNumber:V.episodeNumber}),showClearAll:!0,onClear:()=>T.mutate(),onReorder:V=>E.mutate(V.map(K=>({id:K.id,showId:K.showId,episodeNumber:K.episodeNumber})))}),e(ve,{ariaLabel:"Browse anime",options:Xe.map(V=>({value:V.key,label:V.label})),value:Re,onChange:c}),e("div",{className:H.tabContent,children:Ke()}),e(Ia,{eyebrow:"Never miss an episode"}),e(Oe,{isOpen:!!r,itemName:r?.name,progressKind:"watch",listLabel:"my watchlist",alsoRemove:u,onAlsoRemoveChange:l,onClose:()=>{k(null),l(!1)},onConfirm:Ye})]})]})};export{hr as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as R,T as i,d as W,u as e,L as P}from"./vendor-core-8R2fFbyN.js";import{b as C,u as O,a as A}from"./vendor-query-BUTye89G.js";import{t as p,Z as F,d as V,z as S,f as k}from"./index-BXwhFWB_.js";import{I as l}from"./vendor-icons-CDMuNDeL.js";const Y="_header_1j07c_1",q="_fadeIn_1j07c_1",H="_personaBadge_1j07c_9",z="_personaInfo_1j07c_37",E="_personaLabel_1j07c_42",U="_personaValue_1j07c_51",K="_statsGrid_1j07c_57",Q="_slideUpIn_1j07c_1",Z="_statCard_1j07c_65",J="_statIcon_1j07c_82",X="_statInfo_1j07c_98",ee="_statValue_1j07c_103",ae="_statLabel_1j07c_112",te="_wideSection_1j07c_120",se="_sectionHeader_1j07c_132",ne="_yearSelect_1j07c_147",re="_heatmapLayout_1j07c_176",ce="_dayLabels_1j07c_183",le="_heatmapWrapper_1j07c_195",oe="_heatmapMonthLabels_1j07c_201",ie="_heatmapGrid_1j07c_212",de="_heatBox_1j07c_220",he="_hiddenBox_1j07c_229",me="_level0_1j07c_240",pe="_level1_1j07c_243",_e="_level2_1j07c_247",ue="_level3_1j07c_251",ge="_level4_1j07c_255",Ne="_heatmapFooter_1j07c_260",ve="_heatLegend_1j07c_267",ye="_chartsContainer_1j07c_277",be="_chartWrapper_1j07c_285",je="_hourlyChart_1j07c_312",fe="_hourlyBarContainer_1j07c_320",Ce="_hourlyBar_1j07c_320",Se="_hourlyLabel_1j07c_346",ke="_chartSubtext_1j07c_353",Le="_popScale_1j07c_365",Be="_popTrack_1j07c_369",we="_popThumb_1j07c_377",Ie="_popLabels_1j07c_389",De="_popDescription_1j07c_399",xe="_seasonalChart_1j07c_414",Te="_seasonalBarContainer_1j07c_422",Me="_seasonalBar_1j07c_422",$e="_seasonalLabel_1j07c_444",Ge="_genreList_1j07c_452",Re="_genreRow_1j07c_459",We="_genreInfo_1j07c_465",Pe="_genreName_1j07c_472",Oe="_genreCount_1j07c_479",Ae="_genreBarBg_1j07c_486",Fe="_genreBar_1j07c_486",Ve="_warningSection_1j07c_499",Ye="_warningHeader_1j07c_510",qe="_droppedGrid_1j07c_526",He="_droppedCard_1j07c_532",ze="_droppedName_1j07c_549",Ee="_droppedDate_1j07c_556",Ue="_genreGrid_1j07c_597",Ke="_genreCard_1j07c_609",Qe="_rankBadge_1j07c_618",Ze="_rankNumber_1j07c_631",Je="_genreTitle_1j07c_637",Xe="_genreStats_1j07c_645",ea="_posterRow_1j07c_653",aa="_miniPoster_1j07c_660",ta="_genreCardSkeleton_1j07c_674",sa="_pulse_1j07c_1",na="_skeletonRank_1j07c_682",ra="_skeletonTitle_1j07c_696",ca="_skeletonStats_1j07c_709",la="_skeletonPosters_1j07c_721",oa="_recSection_1j07c_752",ia="_recSubtext_1j07c_763",da="_recGrid_1j07c_769",ha="_recCard_1j07c_775",ma="_recCover_1j07c_790",pa="_recInfo_1j07c_798",_a="_recTitle_1j07c_805",ua="_recMatch_1j07c_816",ga="_recMeta_1j07c_822",Na="_recWhy_1j07c_827",va="_recNote_1j07c_832",ya="_recAddBtn_1j07c_838",a={header:Y,fadeIn:q,personaBadge:H,personaInfo:z,personaLabel:E,personaValue:U,statsGrid:K,slideUpIn:Q,statCard:Z,statIcon:J,statInfo:X,statValue:ee,statLabel:ae,wideSection:te,sectionHeader:se,yearSelect:ne,heatmapLayout:re,dayLabels:ce,heatmapWrapper:le,heatmapMonthLabels:oe,heatmapGrid:ie,heatBox:de,hiddenBox:he,level0:me,level1:pe,level2:_e,level3:ue,level4:ge,heatmapFooter:Ne,heatLegend:ve,chartsContainer:ye,chartWrapper:be,hourlyChart:je,hourlyBarContainer:fe,hourlyBar:Ce,hourlyLabel:Se,chartSubtext:ke,popScale:Le,popTrack:Be,popThumb:we,popLabels:Ie,popDescription:De,seasonalChart:xe,seasonalBarContainer:Te,seasonalBar:Me,seasonalLabel:$e,genreList:Ge,genreRow:Re,genreInfo:We,genreName:Pe,genreCount:Oe,genreBarBg:Ae,genreBar:Fe,warningSection:Ve,warningHeader:Ye,droppedGrid:qe,droppedCard:He,droppedName:ze,droppedDate:Ee,genreGrid:Ue,genreCard:Ke,rankBadge:Qe,rankNumber:Ze,genreTitle:Je,genreStats:Xe,posterRow:ea,miniPoster:aa,genreCardSkeleton:ta,pulse:sa,skeletonRank:na,skeletonTitle:ra,skeletonStats:ca,skeletonPosters:la,recSection:oa,recSubtext:ia,recGrid:da,recCard:ha,recCover:ma,recInfo:pa,recTitle:_a,recMatch:ua,recMeta:ga,recWhy:Na,recNote:va,recAddBtn:ya},Sa=()=>{R(()=>{document.title="Insights - dango"},[]);const{data:n,isLoading:L,isError:B}=C({queryKey:["insights"],queryFn:async()=>await p.insights.summary.query()}),{data:w,isLoading:_}=F(),{titlePreference:I}=V(),u=O(),{data:g}=C({queryKey:["insights-recommendations"],queryFn:async()=>await p.insights.recommendations.query(),staleTime:300*1e3,retry:1}),N=A({mutationFn:async t=>{await p.watchlist.add.mutate({id:String(t.id),name:t.title,thumbnail:t.cover||"",status:"Plan to Watch",type:t.format})},onSuccess:()=>{u.invalidateQueries({queryKey:["watchlist"]}),u.invalidateQueries({queryKey:["insights-recommendations"]}),S.success("Added to Plan to Watch")},onError:()=>S.error("Could not add to watchlist")}),v=i(()=>[...g?.candidates||[]].sort((t,s)=>s.matchPct-t.matchPct).slice(0,6),[g]),y=t=>{const s=t.name||t.englishName||t.nativeName||"";switch(I){case"nativeName":return t.nativeName||s;case"englishName":return t.englishName||s;default:return s}},[d,D]=W(new Date().getFullYear()),x=i(()=>{if(!n?.activityGrid)return[new Date().getFullYear()];const t=new Set(n.activityGrid.map(s=>parseInt(s.day.split("-")[0])));return t.add(new Date().getFullYear()),Array.from(t).sort((s,r)=>r-s)},[n]),b=i(()=>{if(!n?.activityGrid)return[];const t=new Map(n.activityGrid.map(m=>[m.day,m.count])),s=[],r=new Date(d,0,1),o=new Date(d,11,31),h=r.getDay(),c=new Date(r);for(c.setDate(c.getDate()-h);(c<=o||c.getDay()!==0)&&!(c>o&&c.getDay()===0);){const m=c.getFullYear(),$=String(c.getMonth()+1).padStart(2,"0"),G=String(c.getDate()).padStart(2,"0"),j=`${m}-${$}-${G}`,f=c<r||c>o;s.push({date:j,count:f?0:t.get(j)||0,month:c.getMonth(),isOutOfRange:f}),c.setDate(c.getDate()+1)}return s},[n,d]),T=i(()=>n?.seasonality?.length?Math.max(...n.seasonality.map(t=>t.seconds),1):0,[n]),M=i(()=>n?.hourlyDist?.length?Math.max(...n.hourlyDist.map(t=>t.count),1):0,[n]);return L||_?e("div",{className:a.loading,children:"Analyzing your anime lifestyle..."}):B?e("div",{className:a.error,children:"Could not load insights. Data might be syncing."}):n?e("div",{className:"page-container",children:[e("div",{className:a.header,children:[e("h2",{className:"section-title",children:"Watch Insights"}),e("div",{className:a.personaBadge,children:[e(l,{name:"user-astronaut"}),e("div",{className:a.personaInfo,children:[e("span",{className:a.personaLabel,children:"Your Persona"}),e("span",{className:a.personaValue,children:n.persona})]})]})]}),e("div",{className:a.statsGrid,children:[e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(138, 79, 255, 0.2)",color:"var(--accent)"},children:e(l,{name:"clock"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:[n.totalHours,"h"]}),e("span",{className:a.statLabel,children:"Watch Time"})]})]}),e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(167, 139, 250, 0.2)",color:"#a78bfa"},children:e(l,{name:"bookmark"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:n.totalAnime}),e("span",{className:a.statLabel,children:"Total Anime"})]})]}),e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(34, 197, 94, 0.2)",color:"#22c55e"},children:e(l,{name:"check-circle"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:n.totalEpisodes}),e("span",{className:a.statLabel,children:"Episodes Watched"})]})]}),e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(34, 197, 94, 0.2)",color:"#22c55e"},children:e(l,{name:"check-circle"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:[n.completionRate,"%"]}),e("span",{className:a.statLabel,children:"Completion Rate"})]})]}),e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(45, 212, 191, 0.2)",color:"#2dd4bf"},children:e(l,{name:"tv"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:n.completedAnime}),e("span",{className:a.statLabel,children:"Completed Shows"})]})]}),e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(239, 68, 68, 0.2)",color:"#ef4444"},children:e(l,{name:"fire"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:n.bingeFactor}),e("span",{className:a.statLabel,children:"Max Daily Binge"})]})]}),e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(59, 130, 246, 0.2)",color:"#3b82f6"},children:e(l,{name:"history"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:[n.avgSessionMinutes,"m"]}),e("span",{className:a.statLabel,children:"Avg. Session"})]})]}),e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(251, 191, 36, 0.2)",color:"#fbbf24"},children:e(l,{name:"layer-group"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:[n.avgCompletionDays,"d"]}),e("span",{className:a.statLabel,children:"Avg. Speed"})]})]})]}),e("div",{className:a.wideSection,children:[e("div",{className:a.sectionHeader,children:[e("h3",{children:"Activity"}),e("select",{className:a.yearSelect,value:d,onChange:t=>D(Number(t.currentTarget.value)),children:x.map(t=>e("option",{value:t,children:t},t))})]}),e("div",{className:a.heatmapLayout,children:[e("div",{className:a.dayLabels,children:[e("span",{style:{gridRow:2},children:"Mon"}),e("span",{style:{gridRow:4},children:"Wed"}),e("span",{style:{gridRow:6},children:"Fri"})]}),e("div",{className:a.heatmapWrapper,children:[e("div",{className:a.heatmapMonthLabels,children:(()=>{const t=[];let s=-1;return b.forEach((r,o)=>{if(r.month!==s&&!r.isOutOfRange){const h=Math.floor(o/7)+1;h>(t.length>0?t[t.length-1].props.style.gridColumn+2:-1)&&(t.push(e("span",{style:{gridColumn:h,whiteSpace:"nowrap"},children:new Date(0,r.month).toLocaleString("default",{month:"short"})},o)),s=r.month)}}),t})()}),e("div",{className:a.heatmapGrid,children:b.map((t,s)=>{let r=0;return t.count>0&&!t.isOutOfRange&&(r=1),t.count>2&&!t.isOutOfRange&&(r=2),t.count>5&&!t.isOutOfRange&&(r=3),t.count>10&&!t.isOutOfRange&&(r=4),e("div",{className:`${a.heatBox} ${a[`level${r}`]} ${t.isOutOfRange?a.hiddenBox:""}`,title:t.isOutOfRange?"":`${t.count} episodes on ${t.date}`},s)})}),e("div",{className:a.heatmapFooter,children:e("div",{className:a.heatLegend,children:[e("span",{children:"Less"}),e("div",{className:`${a.heatBox} ${a.level0}`}),e("div",{className:`${a.heatBox} ${a.level1}`}),e("div",{className:`${a.heatBox} ${a.level2}`}),e("div",{className:`${a.heatBox} ${a.level3}`}),e("div",{className:`${a.heatBox} ${a.level4}`}),e("span",{children:"More"})]})})]})]})]}),e("div",{className:a.chartsContainer,children:[e("div",{className:a.chartWrapper,children:[e("h3",{children:"Time Distribution (24h)"}),e("div",{className:a.hourlyChart,children:n.hourlyDist?.map((t,s)=>e("div",{className:a.hourlyBarContainer,children:[e("div",{className:a.hourlyBar,style:{height:`${t.count/M*100||2}%`,width:"100%",maxWidth:"12px"},title:`${t.count} watches at ${t.hour}:00`}),e("span",{className:a.hourlyLabel,style:{visibility:s%4===0?"visible":"hidden"},children:t.hour})]},s))}),e("div",{className:a.chartSubtext,children:(()=>{if(!n.hourlyDist?.length)return"Watch more to see your peak hours!";const t=parseInt([...n.hourlyDist].sort((s,r)=>r.count-s.count)[0].hour);return t>=6&&t<19?"You prefer daytime watching ☀️":"You're a confirmed Night Owl 🦉"})()})]}),e("div",{className:a.chartWrapper,children:[e("h3",{children:"Popularity Bias"}),e("div",{className:a.popScale,children:[e("div",{className:a.popTrack,children:e("div",{className:a.popThumb,style:{left:`${Math.max(0,Math.min(100,100-n.popularityScore*10))}%`}})}),e("div",{className:a.popLabels,children:[e("span",{children:"Mainstream"}),e("span",{children:"Underground"})]})]}),e("p",{className:a.popDescription,children:["Your taste score is ",e("strong",{children:[n.popularityScore,"/10"]}),".",n.popularityScore>=5?" You follow the big hits!":" You're a connoisseur of the obscure!"]})]}),e("div",{className:a.chartWrapper,children:[e("h3",{children:"Monthly Activity"}),e("div",{className:a.seasonalChart,children:n.seasonality?.map((t,s)=>e("div",{className:a.seasonalBarContainer,children:[e("div",{className:a.seasonalBar,style:{height:`${t.seconds/T*100||5}%`,width:"100%",maxWidth:"24px"},title:`${Math.round(t.seconds/3600)}h in ${new Date(0,s).toLocaleString("default",{month:"long"})}`}),e("span",{className:a.seasonalLabel,children:new Date(0,s).toLocaleString("default",{month:"short"})})]},s))})]})]}),e("div",{className:a.genreGrid,children:_?Array.from({length:4}).map((t,s)=>e("div",{className:a.genreCardSkeleton,children:[e("div",{className:a.skeletonRank}),e("div",{className:a.skeletonTitle}),e("div",{className:a.skeletonStats}),e("div",{className:a.skeletonPosters})]},s)):w?.map(t=>e("div",{className:a.genreCard,children:[e("div",{className:a.rankBadge,children:e("span",{className:a.rankNumber,children:t.rank})}),e("h3",{className:a.genreTitle,children:t.name}),e("div",{className:a.genreStats,children:[e("span",{children:[t.count," episodes"]}),e("span",{children:t.meanScore>0?`${t.meanScore.toFixed(1)} avg score`:"—"}),e("span",{children:t.timeWatched})]}),e("div",{className:a.posterRow,children:t.topShows.map(s=>e("img",{src:k(s.thumbnail),alt:y(s),className:a.miniPoster,title:y(s),loading:"lazy",decoding:"async"},s.id))})]},t.name))}),v.length>0&&e("div",{className:a.recSection,children:[e("h3",{children:"Recommended For You"}),e("p",{className:a.recSubtext,children:"From your library taste — updates automatically as you watch"}),e("div",{className:a.recGrid,children:v.map(t=>e("div",{className:a.recCard,children:[t.cover&&e("img",{src:k(t.cover),alt:t.title,className:a.recCover,loading:"lazy",decoding:"async"}),e("div",{className:a.recInfo,children:[e(P,{to:`/anime/${t.id}`,className:a.recTitle,children:t.title}),e("span",{className:a.recMatch,children:[t.matchPct,"% match"]}),e("span",{className:a.recMeta,children:[t.year,t.format,t.episodes?`${t.episodes}ep`:null].filter(Boolean).join(" · ")}),e("span",{className:a.recWhy,children:["Shares ",t.sharedGenres.join(", "),t.exemplars.length>0&&` — like ${t.exemplars.join(", ")}`]}),t.kind==="continue"&&e("span",{className:a.recNote,children:"Continue — you watched the earlier part."}),t.kind==="sequel"&&t.prequelTitle&&e("span",{className:a.recNote,children:['Sequel — start with "',t.prequelTitle,'" first.']}),e("button",{className:a.recAddBtn,onClick:()=>N.mutate(t),disabled:N.isPending,children:"+ Plan to Watch"})]})]},t.id))})]}),n.droppedShows?.length>0&&e("div",{className:a.warningSection,children:[e("div",{className:a.warningHeader,children:[e(l,{name:"exclamation-triangle"}),e("h3",{children:"Dusty Watchlist (Inactive 90+ days)"})]}),e("div",{className:a.droppedGrid,children:n.droppedShows.map(t=>e("div",{className:a.droppedCard,children:[e("span",{className:a.droppedName,children:t.name}),e("span",{className:a.droppedDate,children:["Last watched: ",new Date(t.lastActivity).toLocaleDateString()]})]},t.id))})]})]}):null};export{Sa as default};
|
|
1
|
+
import{h as R,T as i,d as W,u as e,L as P}from"./vendor-core-8R2fFbyN.js";import{b as C,u as O,a as A}from"./vendor-query-BUTye89G.js";import{t as p,Z as F,d as V,z as S,f as k}from"./index-B5SLDCAi.js";import{I as l}from"./vendor-icons-CDMuNDeL.js";const Y="_header_1j07c_1",q="_fadeIn_1j07c_1",H="_personaBadge_1j07c_9",z="_personaInfo_1j07c_37",E="_personaLabel_1j07c_42",U="_personaValue_1j07c_51",K="_statsGrid_1j07c_57",Q="_slideUpIn_1j07c_1",Z="_statCard_1j07c_65",J="_statIcon_1j07c_82",X="_statInfo_1j07c_98",ee="_statValue_1j07c_103",ae="_statLabel_1j07c_112",te="_wideSection_1j07c_120",se="_sectionHeader_1j07c_132",ne="_yearSelect_1j07c_147",re="_heatmapLayout_1j07c_176",ce="_dayLabels_1j07c_183",le="_heatmapWrapper_1j07c_195",oe="_heatmapMonthLabels_1j07c_201",ie="_heatmapGrid_1j07c_212",de="_heatBox_1j07c_220",he="_hiddenBox_1j07c_229",me="_level0_1j07c_240",pe="_level1_1j07c_243",_e="_level2_1j07c_247",ue="_level3_1j07c_251",ge="_level4_1j07c_255",Ne="_heatmapFooter_1j07c_260",ve="_heatLegend_1j07c_267",ye="_chartsContainer_1j07c_277",be="_chartWrapper_1j07c_285",je="_hourlyChart_1j07c_312",fe="_hourlyBarContainer_1j07c_320",Ce="_hourlyBar_1j07c_320",Se="_hourlyLabel_1j07c_346",ke="_chartSubtext_1j07c_353",Le="_popScale_1j07c_365",Be="_popTrack_1j07c_369",we="_popThumb_1j07c_377",Ie="_popLabels_1j07c_389",De="_popDescription_1j07c_399",xe="_seasonalChart_1j07c_414",Te="_seasonalBarContainer_1j07c_422",Me="_seasonalBar_1j07c_422",$e="_seasonalLabel_1j07c_444",Ge="_genreList_1j07c_452",Re="_genreRow_1j07c_459",We="_genreInfo_1j07c_465",Pe="_genreName_1j07c_472",Oe="_genreCount_1j07c_479",Ae="_genreBarBg_1j07c_486",Fe="_genreBar_1j07c_486",Ve="_warningSection_1j07c_499",Ye="_warningHeader_1j07c_510",qe="_droppedGrid_1j07c_526",He="_droppedCard_1j07c_532",ze="_droppedName_1j07c_549",Ee="_droppedDate_1j07c_556",Ue="_genreGrid_1j07c_597",Ke="_genreCard_1j07c_609",Qe="_rankBadge_1j07c_618",Ze="_rankNumber_1j07c_631",Je="_genreTitle_1j07c_637",Xe="_genreStats_1j07c_645",ea="_posterRow_1j07c_653",aa="_miniPoster_1j07c_660",ta="_genreCardSkeleton_1j07c_674",sa="_pulse_1j07c_1",na="_skeletonRank_1j07c_682",ra="_skeletonTitle_1j07c_696",ca="_skeletonStats_1j07c_709",la="_skeletonPosters_1j07c_721",oa="_recSection_1j07c_752",ia="_recSubtext_1j07c_763",da="_recGrid_1j07c_769",ha="_recCard_1j07c_775",ma="_recCover_1j07c_790",pa="_recInfo_1j07c_798",_a="_recTitle_1j07c_805",ua="_recMatch_1j07c_816",ga="_recMeta_1j07c_822",Na="_recWhy_1j07c_827",va="_recNote_1j07c_832",ya="_recAddBtn_1j07c_838",a={header:Y,fadeIn:q,personaBadge:H,personaInfo:z,personaLabel:E,personaValue:U,statsGrid:K,slideUpIn:Q,statCard:Z,statIcon:J,statInfo:X,statValue:ee,statLabel:ae,wideSection:te,sectionHeader:se,yearSelect:ne,heatmapLayout:re,dayLabels:ce,heatmapWrapper:le,heatmapMonthLabels:oe,heatmapGrid:ie,heatBox:de,hiddenBox:he,level0:me,level1:pe,level2:_e,level3:ue,level4:ge,heatmapFooter:Ne,heatLegend:ve,chartsContainer:ye,chartWrapper:be,hourlyChart:je,hourlyBarContainer:fe,hourlyBar:Ce,hourlyLabel:Se,chartSubtext:ke,popScale:Le,popTrack:Be,popThumb:we,popLabels:Ie,popDescription:De,seasonalChart:xe,seasonalBarContainer:Te,seasonalBar:Me,seasonalLabel:$e,genreList:Ge,genreRow:Re,genreInfo:We,genreName:Pe,genreCount:Oe,genreBarBg:Ae,genreBar:Fe,warningSection:Ve,warningHeader:Ye,droppedGrid:qe,droppedCard:He,droppedName:ze,droppedDate:Ee,genreGrid:Ue,genreCard:Ke,rankBadge:Qe,rankNumber:Ze,genreTitle:Je,genreStats:Xe,posterRow:ea,miniPoster:aa,genreCardSkeleton:ta,pulse:sa,skeletonRank:na,skeletonTitle:ra,skeletonStats:ca,skeletonPosters:la,recSection:oa,recSubtext:ia,recGrid:da,recCard:ha,recCover:ma,recInfo:pa,recTitle:_a,recMatch:ua,recMeta:ga,recWhy:Na,recNote:va,recAddBtn:ya},Sa=()=>{R(()=>{document.title="Insights - dango"},[]);const{data:n,isLoading:L,isError:B}=C({queryKey:["insights"],queryFn:async()=>await p.insights.summary.query()}),{data:w,isLoading:_}=F(),{titlePreference:I}=V(),u=O(),{data:g}=C({queryKey:["insights-recommendations"],queryFn:async()=>await p.insights.recommendations.query(),staleTime:300*1e3,retry:1}),N=A({mutationFn:async t=>{await p.watchlist.add.mutate({id:String(t.id),name:t.title,thumbnail:t.cover||"",status:"Plan to Watch",type:t.format})},onSuccess:()=>{u.invalidateQueries({queryKey:["watchlist"]}),u.invalidateQueries({queryKey:["insights-recommendations"]}),S.success("Added to Plan to Watch")},onError:()=>S.error("Could not add to watchlist")}),v=i(()=>[...g?.candidates||[]].sort((t,s)=>s.matchPct-t.matchPct).slice(0,6),[g]),y=t=>{const s=t.name||t.englishName||t.nativeName||"";switch(I){case"nativeName":return t.nativeName||s;case"englishName":return t.englishName||s;default:return s}},[d,D]=W(new Date().getFullYear()),x=i(()=>{if(!n?.activityGrid)return[new Date().getFullYear()];const t=new Set(n.activityGrid.map(s=>parseInt(s.day.split("-")[0])));return t.add(new Date().getFullYear()),Array.from(t).sort((s,r)=>r-s)},[n]),b=i(()=>{if(!n?.activityGrid)return[];const t=new Map(n.activityGrid.map(m=>[m.day,m.count])),s=[],r=new Date(d,0,1),o=new Date(d,11,31),h=r.getDay(),c=new Date(r);for(c.setDate(c.getDate()-h);(c<=o||c.getDay()!==0)&&!(c>o&&c.getDay()===0);){const m=c.getFullYear(),$=String(c.getMonth()+1).padStart(2,"0"),G=String(c.getDate()).padStart(2,"0"),j=`${m}-${$}-${G}`,f=c<r||c>o;s.push({date:j,count:f?0:t.get(j)||0,month:c.getMonth(),isOutOfRange:f}),c.setDate(c.getDate()+1)}return s},[n,d]),T=i(()=>n?.seasonality?.length?Math.max(...n.seasonality.map(t=>t.seconds),1):0,[n]),M=i(()=>n?.hourlyDist?.length?Math.max(...n.hourlyDist.map(t=>t.count),1):0,[n]);return L||_?e("div",{className:a.loading,children:"Analyzing your anime lifestyle..."}):B?e("div",{className:a.error,children:"Could not load insights. Data might be syncing."}):n?e("div",{className:"page-container",children:[e("div",{className:a.header,children:[e("h2",{className:"section-title",children:"Watch Insights"}),e("div",{className:a.personaBadge,children:[e(l,{name:"user-astronaut"}),e("div",{className:a.personaInfo,children:[e("span",{className:a.personaLabel,children:"Your Persona"}),e("span",{className:a.personaValue,children:n.persona})]})]})]}),e("div",{className:a.statsGrid,children:[e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(138, 79, 255, 0.2)",color:"var(--accent)"},children:e(l,{name:"clock"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:[n.totalHours,"h"]}),e("span",{className:a.statLabel,children:"Watch Time"})]})]}),e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(167, 139, 250, 0.2)",color:"#a78bfa"},children:e(l,{name:"bookmark"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:n.totalAnime}),e("span",{className:a.statLabel,children:"Total Anime"})]})]}),e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(34, 197, 94, 0.2)",color:"#22c55e"},children:e(l,{name:"check-circle"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:n.totalEpisodes}),e("span",{className:a.statLabel,children:"Episodes Watched"})]})]}),e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(34, 197, 94, 0.2)",color:"#22c55e"},children:e(l,{name:"check-circle"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:[n.completionRate,"%"]}),e("span",{className:a.statLabel,children:"Completion Rate"})]})]}),e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(45, 212, 191, 0.2)",color:"#2dd4bf"},children:e(l,{name:"tv"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:n.completedAnime}),e("span",{className:a.statLabel,children:"Completed Shows"})]})]}),e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(239, 68, 68, 0.2)",color:"#ef4444"},children:e(l,{name:"fire"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:n.bingeFactor}),e("span",{className:a.statLabel,children:"Max Daily Binge"})]})]}),e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(59, 130, 246, 0.2)",color:"#3b82f6"},children:e(l,{name:"history"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:[n.avgSessionMinutes,"m"]}),e("span",{className:a.statLabel,children:"Avg. Session"})]})]}),e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(251, 191, 36, 0.2)",color:"#fbbf24"},children:e(l,{name:"layer-group"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:[n.avgCompletionDays,"d"]}),e("span",{className:a.statLabel,children:"Avg. Speed"})]})]})]}),e("div",{className:a.wideSection,children:[e("div",{className:a.sectionHeader,children:[e("h3",{children:"Activity"}),e("select",{className:a.yearSelect,value:d,onChange:t=>D(Number(t.currentTarget.value)),children:x.map(t=>e("option",{value:t,children:t},t))})]}),e("div",{className:a.heatmapLayout,children:[e("div",{className:a.dayLabels,children:[e("span",{style:{gridRow:2},children:"Mon"}),e("span",{style:{gridRow:4},children:"Wed"}),e("span",{style:{gridRow:6},children:"Fri"})]}),e("div",{className:a.heatmapWrapper,children:[e("div",{className:a.heatmapMonthLabels,children:(()=>{const t=[];let s=-1;return b.forEach((r,o)=>{if(r.month!==s&&!r.isOutOfRange){const h=Math.floor(o/7)+1;h>(t.length>0?t[t.length-1].props.style.gridColumn+2:-1)&&(t.push(e("span",{style:{gridColumn:h,whiteSpace:"nowrap"},children:new Date(0,r.month).toLocaleString("default",{month:"short"})},o)),s=r.month)}}),t})()}),e("div",{className:a.heatmapGrid,children:b.map((t,s)=>{let r=0;return t.count>0&&!t.isOutOfRange&&(r=1),t.count>2&&!t.isOutOfRange&&(r=2),t.count>5&&!t.isOutOfRange&&(r=3),t.count>10&&!t.isOutOfRange&&(r=4),e("div",{className:`${a.heatBox} ${a[`level${r}`]} ${t.isOutOfRange?a.hiddenBox:""}`,title:t.isOutOfRange?"":`${t.count} episodes on ${t.date}`},s)})}),e("div",{className:a.heatmapFooter,children:e("div",{className:a.heatLegend,children:[e("span",{children:"Less"}),e("div",{className:`${a.heatBox} ${a.level0}`}),e("div",{className:`${a.heatBox} ${a.level1}`}),e("div",{className:`${a.heatBox} ${a.level2}`}),e("div",{className:`${a.heatBox} ${a.level3}`}),e("div",{className:`${a.heatBox} ${a.level4}`}),e("span",{children:"More"})]})})]})]})]}),e("div",{className:a.chartsContainer,children:[e("div",{className:a.chartWrapper,children:[e("h3",{children:"Time Distribution (24h)"}),e("div",{className:a.hourlyChart,children:n.hourlyDist?.map((t,s)=>e("div",{className:a.hourlyBarContainer,children:[e("div",{className:a.hourlyBar,style:{height:`${t.count/M*100||2}%`,width:"100%",maxWidth:"12px"},title:`${t.count} watches at ${t.hour}:00`}),e("span",{className:a.hourlyLabel,style:{visibility:s%4===0?"visible":"hidden"},children:t.hour})]},s))}),e("div",{className:a.chartSubtext,children:(()=>{if(!n.hourlyDist?.length)return"Watch more to see your peak hours!";const t=parseInt([...n.hourlyDist].sort((s,r)=>r.count-s.count)[0].hour);return t>=6&&t<19?"You prefer daytime watching ☀️":"You're a confirmed Night Owl 🦉"})()})]}),e("div",{className:a.chartWrapper,children:[e("h3",{children:"Popularity Bias"}),e("div",{className:a.popScale,children:[e("div",{className:a.popTrack,children:e("div",{className:a.popThumb,style:{left:`${Math.max(0,Math.min(100,100-n.popularityScore*10))}%`}})}),e("div",{className:a.popLabels,children:[e("span",{children:"Mainstream"}),e("span",{children:"Underground"})]})]}),e("p",{className:a.popDescription,children:["Your taste score is ",e("strong",{children:[n.popularityScore,"/10"]}),".",n.popularityScore>=5?" You follow the big hits!":" You're a connoisseur of the obscure!"]})]}),e("div",{className:a.chartWrapper,children:[e("h3",{children:"Monthly Activity"}),e("div",{className:a.seasonalChart,children:n.seasonality?.map((t,s)=>e("div",{className:a.seasonalBarContainer,children:[e("div",{className:a.seasonalBar,style:{height:`${t.seconds/T*100||5}%`,width:"100%",maxWidth:"24px"},title:`${Math.round(t.seconds/3600)}h in ${new Date(0,s).toLocaleString("default",{month:"long"})}`}),e("span",{className:a.seasonalLabel,children:new Date(0,s).toLocaleString("default",{month:"short"})})]},s))})]})]}),e("div",{className:a.genreGrid,children:_?Array.from({length:4}).map((t,s)=>e("div",{className:a.genreCardSkeleton,children:[e("div",{className:a.skeletonRank}),e("div",{className:a.skeletonTitle}),e("div",{className:a.skeletonStats}),e("div",{className:a.skeletonPosters})]},s)):w?.map(t=>e("div",{className:a.genreCard,children:[e("div",{className:a.rankBadge,children:e("span",{className:a.rankNumber,children:t.rank})}),e("h3",{className:a.genreTitle,children:t.name}),e("div",{className:a.genreStats,children:[e("span",{children:[t.count," episodes"]}),e("span",{children:t.meanScore>0?`${t.meanScore.toFixed(1)} avg score`:"—"}),e("span",{children:t.timeWatched})]}),e("div",{className:a.posterRow,children:t.topShows.map(s=>e("img",{src:k(s.thumbnail),alt:y(s),className:a.miniPoster,title:y(s),loading:"lazy",decoding:"async"},s.id))})]},t.name))}),v.length>0&&e("div",{className:a.recSection,children:[e("h3",{children:"Recommended For You"}),e("p",{className:a.recSubtext,children:"From your library taste — updates automatically as you watch"}),e("div",{className:a.recGrid,children:v.map(t=>e("div",{className:a.recCard,children:[t.cover&&e("img",{src:k(t.cover),alt:t.title,className:a.recCover,loading:"lazy",decoding:"async"}),e("div",{className:a.recInfo,children:[e(P,{to:`/anime/${t.id}`,className:a.recTitle,children:t.title}),e("span",{className:a.recMatch,children:[t.matchPct,"% match"]}),e("span",{className:a.recMeta,children:[t.year,t.format,t.episodes?`${t.episodes}ep`:null].filter(Boolean).join(" · ")}),e("span",{className:a.recWhy,children:["Shares ",t.sharedGenres.join(", "),t.exemplars.length>0&&` — like ${t.exemplars.join(", ")}`]}),t.kind==="continue"&&e("span",{className:a.recNote,children:"Continue — you watched the earlier part."}),t.kind==="sequel"&&t.prequelTitle&&e("span",{className:a.recNote,children:['Sequel — start with "',t.prequelTitle,'" first.']}),e("button",{className:a.recAddBtn,onClick:()=>N.mutate(t),disabled:N.isPending,children:"+ Plan to Watch"})]})]},t.id))})]}),n.droppedShows?.length>0&&e("div",{className:a.warningSection,children:[e("div",{className:a.warningHeader,children:[e(l,{name:"exclamation-triangle"}),e("h3",{children:"Dusty Watchlist (Inactive 90+ days)"})]}),e("div",{className:a.droppedGrid,children:n.droppedShows.map(t=>e("div",{className:a.droppedCard,children:[e("span",{className:a.droppedName,children:t.name}),e("span",{className:a.droppedDate,children:["Last watched: ",new Date(t.lastActivity).toLocaleDateString()]})]},t.id))})]})]}):null};export{Sa as default};
|