@serifpersia/dango 3.5.0 → 3.5.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.
Files changed (72) hide show
  1. package/README.md +1 -15
  2. package/client/dist/assets/{AnimeCard-CpMObnqU.js → AnimeCard-B2ErWl4t.js} +1 -1
  3. package/client/dist/assets/{AnimeInfo-DkDW8o1k.js → AnimeInfo-Dfd4zWTx.js} +1 -1
  4. package/client/dist/assets/AnimeInfoPage-_DAHOnnx.js +2 -0
  5. package/client/dist/assets/{Asmr-B08Aimrk.js → Asmr-CppKRwf3.js} +2 -2
  6. package/client/dist/assets/{AsmrResetProgressModal-CZMbyJZz.js → AsmrResetProgressModal-DqZ8um_v.js} +1 -1
  7. package/client/dist/assets/{AvSyncCalibrator-VoOEtoX9.js → AvSyncCalibrator-DH6KEsbi.js} +1 -1
  8. package/client/dist/assets/{Home-C3Vck_99.js → Home-bqn1BmP7.js} +1 -1
  9. package/client/dist/assets/Insights-KlshyXuf.js +1 -0
  10. package/client/dist/assets/{LibraryListPage-CUzEUs5k.js → LibraryListPage-Ba7501DJ.js} +1 -1
  11. package/client/dist/assets/{ListeningList-CoeQ17lz.js → ListeningList-CycltWkq.js} +1 -1
  12. package/client/dist/assets/Manga-C3foLd_W.js +1 -0
  13. package/client/dist/assets/{MangaInfoPage-wqYZN_sT.js → MangaInfoPage-CKgBcwjP.js} +1 -1
  14. package/client/dist/assets/{MangaReadPage-BbyExwBN.js → MangaReadPage-B0Nr5zbg.js} +1 -1
  15. package/client/dist/assets/{MangaResetProgressModal-Dg0xhJQI.js → MangaResetProgressModal-C9YlH9oi.js} +1 -1
  16. package/client/dist/assets/{Mature-ZKR5vMIv.js → Mature-DVvlLfAy.js} +1 -1
  17. package/client/dist/assets/{MediaCard-9NGAjN3E.js → MediaCard-Auk42bqx.js} +1 -1
  18. package/client/dist/assets/Music-BeCMeHS7.js +1 -0
  19. package/client/dist/assets/{OptionListMenu-DcHg1QsF.js → OptionListMenu-AHGTsUIM.js} +1 -1
  20. package/client/dist/assets/{Player-V9IueAzT.js → Player-Diz4QXSs.js} +6 -6
  21. package/client/dist/assets/{PlayerSettings-BZtjBWWq.js → PlayerSettings-B8CsR3hI.js} +1 -1
  22. package/client/dist/assets/QueueOptionsButton-tpZ79_8s.js +1 -0
  23. package/client/dist/assets/{QueueRail-CO2ocUNx.js → QueueRail-CvrVAD_w.js} +1 -1
  24. package/client/dist/assets/{Radio-CJ-ra4vb.js → Radio-s_2zeYYn.js} +1 -1
  25. package/client/dist/assets/{ReadingList-CSvUUtZ3.js → ReadingList-DLKfiYLy.js} +1 -1
  26. package/client/dist/assets/{ResetProgressModal-5FOWMuqi.js → ResetProgressModal-jPtyfyf0.js} +1 -1
  27. package/client/dist/assets/{Search-q0GUdNMS.js → Search-UfzxfJ8k.js} +1 -1
  28. package/client/dist/assets/Settings-CLP_y7EE.js +21 -0
  29. package/client/dist/assets/{Settings-AuFxQcJF.css → Settings-CwIWLSfY.css} +1 -1
  30. package/client/dist/assets/{SkeletonGrid-DY_7CXpX.js → SkeletonGrid-21to5FX0.js} +1 -1
  31. package/client/dist/assets/ToggleSwitch-BPil0d_k.css +1 -0
  32. package/client/dist/assets/ToggleSwitch-CN_ppEc9.js +1 -0
  33. package/client/dist/assets/{Trackers-Dn7P6AfI.js → Trackers-QqnmwIKk.js} +1 -1
  34. package/client/dist/assets/{Tv-BfaWoR72.js → Tv-D3yVtdDx.js} +4 -4
  35. package/client/dist/assets/{TvInfo-CgEVN57T.js → TvInfo-gue0nYi0.js} +1 -1
  36. package/client/dist/assets/{TvPopup-B-vYyDQF.js → TvPopup-CkXBuHHD.js} +1 -1
  37. package/client/dist/assets/{TvSearch-CnnVkms6.js → TvSearch-DLP_3Nf2.js} +1 -1
  38. package/client/dist/assets/{TvWatchlist-BLVF_row.js → TvWatchlist-DzgVXuh9.js} +1 -1
  39. package/client/dist/assets/{Watchlist-wd9cCDOK.js → Watchlist-DeO4iNhW.js} +1 -1
  40. package/client/dist/assets/{hls-Bej65gvf.js → hls-D3SWhYIU.js} +1 -1
  41. package/client/dist/assets/index-BGCpLf49.js +178 -0
  42. package/client/dist/assets/index-w_r2lTCe.css +1 -0
  43. package/client/dist/assets/{useAnimeInfoData-ZmMruFBq.js → useAnimeInfoData-CWRGC9fX.js} +1 -1
  44. package/client/dist/assets/{useAsmr-z-txLq1s.js → useAsmr-5n3wPm5z.js} +1 -1
  45. package/client/dist/assets/{useAsmrPopup-DU55UhPN.js → useAsmrPopup-BxGzhLmJ.js} +1 -1
  46. package/client/dist/assets/{useMangaLibrary-D92WQbf5.js → useMangaLibrary-DUteTFgU.js} +1 -1
  47. package/client/dist/assets/{useMangaPopup-TJOA229J.js → useMangaPopup-BWU1Tz5e.js} +1 -1
  48. package/client/dist/assets/{useProviders-fmZrOyDC.js → useProviders-mkl-w-e4.js} +1 -1
  49. package/client/dist/assets/{useTv-CmfxzpS-.js → useTv-Dl-E6HBp.js} +1 -1
  50. package/client/dist/assets/{useTvLibrary-0y9NZnsk.js → useTvLibrary-BVECcmlW.js} +1 -1
  51. package/client/dist/index.html +2 -2
  52. package/package.json +2 -2
  53. package/server/dist/app-hono.js +0 -6
  54. package/server/dist/config.js +0 -1
  55. package/server/dist/lib/{discord-roles-sync.service.js → recommendations.service.js} +0 -149
  56. package/server/dist/server.js +0 -2
  57. package/server/dist/shipped-defaults.js +0 -1
  58. package/server/dist/trpc/routers/discord.js +0 -4
  59. package/server/dist/trpc/routers/insights.js +1 -31
  60. package/server/dist/trpc/routers/settings.js +0 -10
  61. package/server/package.json +1 -1
  62. package/client/dist/assets/AnimeInfoPage-l0wIHS7j.js +0 -2
  63. package/client/dist/assets/Insights-nW34Wbg1.js +0 -1
  64. package/client/dist/assets/Manga-CeSb5K2w.js +0 -1
  65. package/client/dist/assets/Map-BtXwpBOC.js +0 -1
  66. package/client/dist/assets/Map-CXFqXmsZ.css +0 -1
  67. package/client/dist/assets/Music-CljVJFCj.js +0 -1
  68. package/client/dist/assets/QueueOptionsButton-CzzisJ3N.js +0 -1
  69. package/client/dist/assets/Settings-CyT9Lyhz.js +0 -21
  70. package/client/dist/assets/index-Cc1Up_NI.css +0 -1
  71. package/client/dist/assets/index-Dk0ASzEz.js +0 -178
  72. package/server/dist/utils/machine-id.js +0 -39
package/README.md CHANGED
@@ -6,9 +6,7 @@ _A local-first anime web app focused on performance, privacy, and personal libra
6
6
 
7
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-897cff?style=for-the-badge)](https://opensource.org/licenses/MIT)
8
8
  ![Github stars](https://img.shields.io/github/stars/serifpersia/dango.svg?style=for-the-badge&color=897cff)
9
- [![App version](https://img.shields.io/badge/dango-3.5.0-897cff?style=for-the-badge)](https://github.com/serifpersia/dango)
10
-
11
- ![Users](https://dango-users-badge.ramiserifpersia.workers.dev)
9
+ [![App version](https://img.shields.io/badge/dango-3.5.1-897cff?style=for-the-badge)](https://github.com/serifpersia/dango)
12
10
 
13
11
  [![Provider Status](https://dango-users-badge.ramiserifpersia.workers.dev/?provider=all)](https://dango-users-badge.ramiserifpersia.workers.dev/?view=status)
14
12
 
@@ -237,18 +235,6 @@ Bidirectional sync is fully supported:
237
235
 
238
236
  ---
239
237
 
240
- ## Community
241
-
242
- Need help configuring your setup, troubleshooting builds, discussing feature requests or simply just chat about anime?
243
-
244
- <div align="left">
245
-
246
- [![Join Discord](https://invidget.switchblade.xyz/2FTSPXCsvn)](https://discord.gg/2FTSPXCsvn)
247
-
248
- </div>
249
-
250
- ---
251
-
252
238
  ## Disclaimer & Legal
253
239
 
254
240
  dango is an open-source, local-first web app. It does not host or distribute unauthorized media or copyrighted video assets. Users are solely responsible for ensuring their usage aligns with relevant local laws and digital copyright regulations.
@@ -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-DfaOB3Rn.js";import{I as o}from"./vendor-icons-DrybRNxP.js";import{u as I}from"./useAnimeInfoData-ZmMruFBq.js";import{d as R,s as z,g as M}from"./index-Dk0ASzEz.js";import{Q as _}from"./QueueOptionsButton-CzzisJ3N.js";import{p as a,a as x,m as $,M as L}from"./MediaCard-9NGAjN3E.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
+ 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-DfaOB3Rn.js";import{I as o}from"./vendor-icons-DrybRNxP.js";import{u as I}from"./useAnimeInfoData-CWRGC9fX.js";import{d as R,s as z,g as M}from"./index-BGCpLf49.js";import{Q as _}from"./QueueOptionsButton-tpZ79_8s.js";import{p as a,a as x,m as $,M as L}from"./MediaCard-Auk42bqx.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{o as C,a as I,d as S,h as p,T,u as e}from"./vendor-core-DfaOB3Rn.js";import{I as s}from"./vendor-icons-DrybRNxP.js";import{u as b}from"./useAnimeInfoData-ZmMruFBq.js";import{d as B,e as w,f as d,s as M,M as x,B as u}from"./index-Dk0ASzEz.js";import{A}from"./AnimeMetaDetails-BogOi_bM.js";import{S as D}from"./SynopsisText-B3Sa5pRv.js";import{Q as G}from"./QueueOptionsButton-CzzisJ3N.js";import"./vendor-query-BBT5_sHx.js";import"./useIsMobile-Dvx1uJ82.js";import"./vendor-ui-3qrARCPr.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 Oe(){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}=w();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:M(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(x,{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{Oe as default};
1
+ import{o as C,a as I,d as S,h as p,T,u as e}from"./vendor-core-DfaOB3Rn.js";import{I as s}from"./vendor-icons-DrybRNxP.js";import{u as b}from"./useAnimeInfoData-CWRGC9fX.js";import{d as B,e as w,f as d,s as M,M as x,B as u}from"./index-BGCpLf49.js";import{A}from"./AnimeMetaDetails-BogOi_bM.js";import{S as D}from"./SynopsisText-B3Sa5pRv.js";import{Q as G}from"./QueueOptionsButton-tpZ79_8s.js";import"./vendor-query-BBT5_sHx.js";import"./useIsMobile-Dvx1uJ82.js";import"./vendor-ui-3qrARCPr.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 Oe(){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}=w();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:M(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(x,{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{Oe as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AnimeInfo-Dfd4zWTx.js","assets/vendor-core-DfaOB3Rn.js","assets/vendor-icons-DrybRNxP.js","assets/useAnimeInfoData-CWRGC9fX.js","assets/vendor-query-BBT5_sHx.js","assets/index-BGCpLf49.js","assets/index-w_r2lTCe.css","assets/QueueOptionsButton-tpZ79_8s.js","assets/vendor-ui-3qrARCPr.js","assets/QueueOptionsButton-CM15uQn8.css","assets/AnimeMetaDetails-BogOi_bM.js","assets/AnimeMetaDetails-BwNQnRCd.css","assets/SynopsisText-B3Sa5pRv.js","assets/useIsMobile-Dvx1uJ82.js","assets/SynopsisText-CYv2W3yR.css","assets/AnimeInfo-BFWtHlPC.css"])))=>i.map(i=>d[i]);
2
+ import{Y as r,_ as t}from"./index-BGCpLf49.js";import{u as o,P as e,z as i}from"./vendor-core-DfaOB3Rn.js";import"./vendor-query-BBT5_sHx.js";import"./vendor-icons-DrybRNxP.js";const a=i(()=>t(()=>import("./AnimeInfo-Dfd4zWTx.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15])));function p(){return o(e,{fallback:o(r,{}),children:o(a,{})})}export{p as default};
@@ -1,2 +1,2 @@
1
- import{T as Ve,u as e,A as _,d as g,h as w,a as Ge,g as _e,q as Q,S as O,$ as Je,o as gt,p as ft}from"./vendor-core-DfaOB3Rn.js";import{I as y}from"./vendor-icons-DrybRNxP.js";import{u as bt}from"./vendor-query-BBT5_sHx.js";import{g as we,t as je,W as vt,B as Le,M as Fe,X as B,z as te,Y as yt,T as ze}from"./index-Dk0ASzEz.js";import{M as kt}from"./MediaCard-9NGAjN3E.js";import{c as Qe,a as Xe,d as wt,e as Ze,f as et,g as Nt,h as Ct,i as St,j as Tt,k as Ye,l as $e}from"./useAsmr-z-txLq1s.js";import{a as t}from"./Asmr.module-CdWlioTY.js";import{u as At,A as Mt}from"./useAsmrPopup-DU55UhPN.js";import{l as xt}from"./hls-Bej65gvf.js";import{p as ae}from"./page.module-C1MlZzf3.js";import"./vendor-ui-3qrARCPr.js";import"./useIsMobile-Dvx1uJ82.js";import"./usePopup-DS9jMzp6.js";const Lt=({work:s,onClose:i,onPlay:C,t:f})=>{const{data:c,isLoading:m}=Qe(s.id||null),v=Xe(s),{data:A}=wt(v||void 0),{toggle:k,bookmarkedIds:T}=Ze(),{data:R}=et(v||void 0),I=v?T.has(v):!!A?.inLibrary,N=Ve(()=>(c?.description||s.description||"").split(`
2
- `).map(o=>{const l=o.indexOf(":");return l===-1?null:{label:o.slice(0,l),value:o.slice(l+1).trim()}}).filter(o=>!!o&&!!o.value),[c?.description,s.description]),b=c?.tracks||[],M=s.thumbnail||c?.images?.[0],S=Ve(()=>{const o=R?.progress??[];return o.length>0?o.reduce((l,x)=>l.updatedAt>=x.updatedAt?l:x):null},[R]),u=S&&S.trackIndex<b.length?S.trackIndex:null;return e("div",{className:t.detailOverlay,onClick:i,children:e("div",{className:t.detailModal,onClick:o=>o.stopPropagation(),children:[e("button",{className:t.detailClose,onClick:i,"aria-label":"Close",children:e(y,{name:"times"})}),e("div",{className:t.detailHeader,children:[M?e("img",{className:t.detailCover,src:M,alt:s.name,decoding:"async"}):e("div",{className:`${t.detailCover} ${t.thumbPlaceholder}`}),e("div",{className:t.detailInfo,children:[e("h2",{className:t.detailTitle,children:f?f(s.name):s.name}),e("p",{className:t.detailRj,children:s.id}),N.map(o=>o.label==="Tags"?e("p",{className:t.metaRow,children:[e("span",{className:t.metaLabel,children:"Tags"}),e("span",{className:t.tagChips,children:o.value.split(", ").map(l=>e("span",{className:t.tagChip,children:l},l))})]},o.label):e("p",{className:t.metaRow,children:[e("span",{className:t.metaLabel,children:o.label}),o.value]},o.label))]})]}),e("div",{className:t.tracksSection,children:[e("h3",{className:t.tracksHeading,children:m?"Loading tracks…":`Tracks (${b.length})`}),!m&&(b.length>0?e("ul",{className:t.trackList,children:b.map((o,l)=>e("li",{children:e("button",{className:t.trackRow,onClick:()=>C(s,b,l),children:[e(y,{name:"play",className:t.trackIcon}),e("span",{className:t.trackLabel,children:o.resolutionStr}),e("span",{className:t.trackType,children:o.hls?"HLS":"MP3"})]})},o.link))}):e("p",{className:t.noTracks,children:"No audio streams available for this work."}))]}),e("div",{className:t.detailActions,children:[!m&&b.length>0&&e("button",{className:t.playAllBtn,onClick:()=>C(s,b,0),children:[e(y,{name:"play"})," Play from start"]}),!m&&u!==null&&S&&e("button",{className:t.playAllBtn,onClick:()=>C(s,b,u),children:[e(y,{name:"history"})," Resume track ",u+1," ·"," ",we(S.currentTime),S.duration>0?` / ${we(S.duration)}`:""]}),v&&e("button",{className:t.playAllBtn,onClick:()=>k({rjCode:v,title:s.name,thumbnail:s.thumbnail||"",isAdult:!!s.isAdult}),"aria-pressed":I,children:[e(y,{name:I?"check":"plus"})," ",I?"In listening list":"Add to listening list"]})]})]})})},Pt=({title:s,images:i,chapters:C,tracks:f,trackIndex:c,expanded:m,isAdult:v,rjCode:A,t:k,onTrackChange:T,onExpandedChange:R,onClose:I})=>{const N=_(null),b=_(null),[M,S]=g(!1),[u,o]=g(0),[l,x]=g(0),[p,q]=g(0),[L,X]=g(!0),[F,K]=g(0),[j,ne]=g(new Set),[H,Z]=g(!1),[he,$]=g(!0),ee=_("");ee.current||(ee.current=typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`asmr-${Date.now()}-${Math.random().toString(36).slice(2)}`);const[U,Ne]=g(()=>{const a=parseFloat(localStorage.getItem("asmrVolume")||"");return Number.isFinite(a)?a:1}),pe=_(U);w(()=>{pe.current=U},[U]);const ge=Ge(),z=_e.useMemo(()=>A?Nt(A):"",[A]),Ce=Ct(),re=St(),{data:se}=et(z||void 0),[Pe,le]=g(!1),G=_(""),W=_(null),fe=_(0),Y=_(0),oe=_(0),ie=f[c],V=ie?.link,Se=ie?.hls,be=ie?.resolutionStr||"",ce=i.length>0,de=`${z}:${c}`,ue=_e.useMemo(()=>(se?.progress??[]).find(r=>r.trackIndex===c)??null,[se,c]),n=_({workId:"",trackIndex:0,trackLabel:""}),d=_(se);d.current=se,n.current={workId:z,trackIndex:c,trackLabel:be};const P=Q((a,r,h,E=!1)=>{!a.workId||!h||h<10||!E&&Math.abs(r-fe.current)<5||(fe.current=r,Ce.mutate({workId:a.workId,trackIndex:a.trackIndex,trackLabel:a.trackLabel,currentTime:Math.floor(r),duration:Math.floor(h),title:s,thumbnail:i[0]||"",rjCode:a.workId,isAdult:v?1:0}))},[Ce,s,i,v]),me=Q((a=!1)=>{W.current&&(clearTimeout(W.current),W.current=null),P(n.current,Y.current,oe.current,a)},[P]),J=_(me);J.current=me;const ve=_(P);ve.current=P;const D=Q(()=>{b.current&&(b.current.destroy(),b.current=null)},[]);w(()=>{const a=N.current;if(!a||!V)return;const r={workId:z,trackIndex:c,trackLabel:be},h=()=>{W.current&&(clearTimeout(W.current),W.current=null),ve.current(r,Y.current,oe.current,!0)};o(0),x(0),q(0),S(!1),Y.current=0,oe.current=0,fe.current=0,D();const E=d.current?.progress?.find(xe=>xe.trackIndex===c),Me=E?.currentTime||0,Ie=E?.duration||0,ke=Me>=10&&Ie-Me>=15;if(Se){let xe=!1;return(async()=>{const Be=await xt();if(!xe)if(Be&&Be.isSupported()){const Re=new Be({enableWorker:!0});b.current=Re,Re.loadSource(V),Re.attachMedia(a),ke||a.play().catch(()=>S(!1))}else a.src=V,a.load(),a.volume=pe.current,ke||a.play().catch(()=>S(!1))})(),()=>{xe=!0,D(),a.removeAttribute("src"),h()}}else a.src=V;return a.load(),a.volume=pe.current,ke||a.play().catch(()=>S(!1)),()=>{D(),a.removeAttribute("src"),h()}},[V,Se,D,z,c,be]),w(()=>()=>D(),[D]),w(()=>{const a=()=>{document.visibilityState==="hidden"&&J.current()},r=()=>J.current();return document.addEventListener("visibilitychange",a),window.addEventListener("pagehide",r),()=>{document.removeEventListener("visibilitychange",a),window.removeEventListener("pagehide",r)}},[]),w(()=>{if(!ue||G.current===de||!(l>0))return;const a=ue.currentTime||0,r=ue.duration||l;if(G.current=de,!(a>=10&&r-a>=15&&Y.current<a))return;const h=N.current;h&&(h.currentTime=a,Y.current=a,o(a),h.play().catch(()=>{}))},[ue,l,de]),w(()=>{const a=N.current;a&&(a.volume=U)},[U]),w(()=>{if(m)return document.body.classList.add("asmr-player-open"),()=>document.body.classList.remove("asmr-player-open")},[m]),w(()=>{K(0)},[i]),w(()=>{m&&$(!0)},[m]),w(()=>{H&&$(!0)},[H]);const Te=Q(a=>{if(!s||f.length===0)return;const r=f[c],h=r?`${r.resolutionStr} (${c+1}/${f.length})`:"",E=N.current,Me=E?E.currentTime:0,Ie=E&&E.duration||0,ke=i[0]||"";je.discord.asmrPresence.mutate({title:s,trackLabel:h,isPlaying:a,thumbnail:ke,thumbnails:i,currentTime:Me,duration:Ie,isAdult:!!v,rjCode:A||"",sessionId:ee.current}).catch(()=>{}),je.discord.heartbeat.mutate({sessionId:ee.current}).catch(()=>{})},[s,f,c,i,v,A]);w(()=>{Te(M)},[Te,M,c,s,m]),w(()=>{if(!M)return;const a=window.setInterval(()=>Te(!0),15e3);return()=>window.clearInterval(a)},[M,Te]),w(()=>{const a=ee.current,r=()=>vt(a),h=()=>r(),E=()=>{document.visibilityState==="hidden"&&r()};return window.addEventListener("pagehide",h),window.addEventListener("beforeunload",h),document.addEventListener("visibilitychange",E),()=>{window.removeEventListener("pagehide",h),window.removeEventListener("beforeunload",h),document.removeEventListener("visibilitychange",E),r()}},[]);const Ae=Q(a=>{ne(r=>{if(r.has(a))return r;const h=new Set(r);return h.add(a),h})},[]),at=Q((a,r)=>{a&&a.complete&&a.naturalWidth>0&&Ae(r)},[Ae]);w(()=>{if(!m)return;const a=r=>{if(r.key==="Escape"){H?Z(!1):R(!1);return}!L||i.length<2||(r.key==="ArrowLeft"&&K(h=>Math.max(0,h-1)),r.key==="ArrowRight"&&K(h=>Math.min(i.length-1,h+1)))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[m,L,i.length,H,R]);const nt=()=>{const a=N.current;a&&(a.paused?a.play().catch(()=>{}):a.pause())},rt=a=>{const r=N.current;if(!r||!l)return;const h=parseFloat(a.target.value);r.currentTime=h,o(h)},st=()=>{me(!0),c<f.length-1?T(c+1):le(!0)},lt=a=>{const r=a.currentTarget.currentTime;Y.current=r,o(r),W.current&&clearTimeout(W.current),W.current=setTimeout(()=>J.current(),5e3)},ot=()=>{S(!1),J.current()},it=a=>{const r=a.currentTarget.duration;oe.current=Number.isFinite(r)?r:0,x(a.currentTarget.duration)},ct=Q(()=>{z&&re.mutate({rjCode:z,title:s,thumbnail:i[0]||"",status:"Completed",isAdult:!!v,silent:!0}),le(!1),I(),ge("/")},[z,re,s,i,v,I,ge]),dt=C.reduce((a,r,h)=>u>=r.time?h:a,-1),ut=a=>{const r=N.current;r&&(r.currentTime=a,o(a))},De=a=>{const r=N.current;if(!r)return;const h=Number.isFinite(r.currentTime)?r.currentTime:u,E=Math.max(0,Math.min(l||1/0,h+a));r.currentTime=E,o(E),$(!0)},Oe=l?Math.min(100,u/l*100):0,mt=l?Math.min(100,Math.max(Oe,p/l*100)):0,ht=e(O,{children:[e("div",{className:t.playerButtons,children:[e("button",{className:t.playerBtn,onClick:()=>T(Math.max(0,c-1)),disabled:c===0,"aria-label":"Previous track",children:e(y,{name:"step-backward"})}),e("button",{className:`${t.playerBtn} ${t.seekBtn}`,onClick:()=>De(-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":M?"Pause":"Play",children:M?e(y,{name:"pause"}):e(y,{name:"play"})}),e("button",{className:`${t.playerBtn} ${t.seekBtn}`,onClick:()=>De(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(f.length-1,c+1)),disabled:c>=f.length-1,"aria-label":"Next track",children:e(y,{name:"step-forward"})})]}),e("div",{className:t.seekRow,children:[e("span",{className:t.timeLabel,children:we(u)}),e("input",{className:t.seekBar,type:"range",min:0,max:l||0,step:.1,value:Math.min(u,l||0),onChange:rt,style:{"--played-percent":`${Oe}%`,"--buffered-percent":`${mt}%`},"aria-label":"Seek"}),e("span",{className:t.timeLabel,children:we(l)})]})]}),He=e(O,{children:[e("button",{className:`${t.playerBtn} ${t.playerToggle}`,onClick:()=>R(!m),"aria-label":m?"Minimize player":"Expand player",title:m?"Minimize to browse":"Expand",children:m?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:[ie?.resolutionStr||"",f.length>1?` (${c+1}/${f.length})`:""]})]}),e("div",{className:t.playerControls,children:ht}),e("div",{className:t.playerRight,children:[U===0?e(y,{name:"volume-mute",className:t.volumeIcon}):U<.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:U,onChange:a=>{const r=parseFloat(a.target.value);Ne(r),localStorage.setItem("asmrVolume",String(r))},style:{"--volume-percent":`${U*100}%`},"aria-label":"Volume"})]}),e("div",{className:t.playerActions,children:[m&&ce&&e("button",{className:t.playerBtn,onClick:()=>X(a=>!a),"aria-label":L?"Hide images":"Show images",title:L?"Hide images":"Show images",children:L?e(y,{name:"eye-slash"}):e(y,{name:"image"})}),m&&C.length>0&&e("button",{className:`${t.playerBtn} ${H?t.playerBtnActive:""}`,onClick:()=>Z(a=>!a),"aria-label":H?"Hide bookmarks":"Show bookmarks",title:"Timestamps",children:e(y,{name:"list-ol"})}),e("button",{className:t.playerBtn,onClick:I,"aria-label":"Close player",children:e(y,{name:"times"})})]})]}),Ue=e("audio",{ref:N,preload:"metadata",onPlay:()=>S(!0),onPause:ot,onTimeUpdate:lt,onLoadedMetadata:it,onProgress:a=>{const r=a.currentTarget;r.buffered.length>0&&q(r.buffered.end(r.buffered.length-1))},onEnded:st}),qe=e(Fe,{isOpen:Pe,onClose:()=>le(!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(Le,{variant:"secondary",onClick:()=>le(!1),children:"Close"}),e(Le,{onClick:ct,children:"Mark Completed & Back to Home"})]})]})});if(!m)return Je(e(O,{children:[Ue,e("div",{className:t.playerBar,children:He}),qe]}),document.body);const ye=Math.min(F,Math.max(0,i.length-1)),We=i[ye],pt=L&&ce&&!!We&&!j.has(We);return Je(e(O,{children:[Ue,qe,e("div",{className:`${t.npOverlay} ${he?"":t.npOverlayControlsHidden}`,children:[e("div",{className:`${t.npStage} ${!L||!ce?t.npStageBlank:""}`,onClick:()=>$(a=>!a),children:L&&ce&&e(O,{children:[e("div",{className:t.sliderViewport,children:[e("div",{className:t.sliderTrack,style:{transform:`translateX(-${ye*100}%)`},children:i.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:()=>Ae(a),onError:()=>Ae(a),className:`${t.slideImg} ${j.has(a)?t.slideImgLoaded:""}`})},a))}),pt&&e("span",{className:t.slideSpinner,"aria-label":"Loading image"})]}),i.length>1&&e(O,{children:[e("button",{className:`${t.npArrow} ${t.npArrowLeft}`,onClick:a=>{a.stopPropagation(),K(r=>Math.max(0,r-1)),$(!0)},disabled:ye===0,"aria-label":"Previous image",children:e(y,{name:"chevron-left"})}),e("button",{className:`${t.npArrow} ${t.npArrowRight}`,onClick:a=>{a.stopPropagation(),K(r=>Math.min(i.length-1,r+1)),$(!0)},disabled:ye===i.length-1,"aria-label":"Next image",children:e(y,{name:"chevron-right"})}),e("span",{className:t.npImageCount,onClick:a=>a.stopPropagation(),children:[ye+1," / ",i.length]})]})]})}),e("div",{className:`${t.playerBar} ${t.playerBarDocked} ${he?"":t.playerBarDockedHidden}`,onClick:a=>a.stopPropagation(),children:[He,H&&e(O,{children:[e("div",{className:t.npBackdrop,onClick:()=>Z(!1)}),e("div",{className:t.chapterPanel,children:C.map((a,r)=>e("button",{className:`${t.chapterRow} ${r===dt?t.chapterRowActive:""}`,title:k?k(a.label):a.label,onClick:()=>{ut(a.time),Z(!1)},children:[e("span",{className:t.chapterRowTime,children:we(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)},It="https://github.com/serifpersia/dango/releases/latest/download/dango-extension.zip",Bt=s=>{try{return JSON.parse(s.detail)}catch{return null}},Rt=({isOpen:s,onClose:i,onSuccess:C})=>{const[f,c]=g(1),[m,v]=g(typeof navigator<"u"?navigator.userAgent:""),[A,k]=g(""),[T,R]=g(!1),[I,N]=g(!1),b=_(null),M=typeof navigator<"u"?navigator.userAgent:"",S=/android/i.test(M),u=/firefox|fxios/i.test(M)&&!S,o=!u&&!S&&/chrome|chromium|edg|brave/i.test(M),l=u||o;w(()=>{s&&(c(1),v(typeof navigator<"u"?navigator.userAgent:""),k(""),R(!1),N(!1))},[s]),w(()=>()=>{b.current&&(window.removeEventListener("dango:jasmr-cookie",b.current),b.current=null)},[]);const x=async()=>{localStorage.setItem("jasmr_ua",m),window.open("https://japaneseasmr.com","_blank","noopener,noreferrer"),c(2)},p=()=>{if(I)return;N(!0);const L=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`,X=window.setTimeout(()=>{N(!1),b.current&&(window.removeEventListener("dango:jasmr-cookie",b.current),b.current=null),te.error("Helper not detected — install it via about:debugging first.")},3e3),F=K=>{const j=Bt(K);if(!(!j||j.requestId!==L))if(window.clearTimeout(X),window.removeEventListener("dango:jasmr-cookie",F),b.current=null,N(!1),j?.ok&&j.cookie)k(j.cookie),te.success("Cookie extracted from helper!");else if(j?.error==="NO_COOKIE"){const ne=j.debug?.stores?.length??0,H=j.debug?.names??[];te.error(`Helper found no cf_clearance (checked ${ne} stores, saw: ${H.join(", ")||"none"}) — solve the challenge on the JapaneseASMR tab first.`)}else te.error("Helper request failed — try again.")};b.current=F,window.addEventListener("dango:jasmr-cookie",F),window.dispatchEvent(new CustomEvent("dango:get-jasmr-cookie",{detail:{requestId:L}}))},q=async()=>{if(!A.trim()){te.error("Please enter the cf_clearance cookie");return}R(!0);try{localStorage.setItem("jasmr_cookie",A.trim()),te.success("Cookie updated successfully!"),C?.(),i()}catch{te.error("Failed to save cookie")}finally{R(!1)}};return e(Fe,{isOpen:s,onClose:i,title:"JapaneseASMR Verification Required",children:e("div",{className:B.container,children:f===1?e(O,{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:B.field,children:[e("label",{children:"Your User-Agent (must match the browser you solve the challenge with):"}),e("textarea",{value:m,onChange:L=>v(L.target.value),rows:3,className:B.textarea})]}),e("div",{className:B.actions,children:[e("button",{className:B.secondaryButton,onClick:i,children:"Cancel"}),e("button",{className:B.button,onClick:x,children:"Start Verification (Opens JapaneseASMR)"})]})]}):e(O,{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."]}),l&&e("div",{className:B.hint,children:[e("strong",{children:"Dango helper (one-time setup):"})," ",u?e(O,{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(O,{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:It,target:"_blank",rel:"noreferrer",className:B.link,children:"dango-extension.zip"}),". Then click Extract below and the field fills itself.",e("div",{className:B.actions,children:e("button",{className:B.button,onClick:p,disabled:I,type:"button",children:I?"Extracting…":"Extract cookie from helper"})})]}),e("div",{className:B.field,children:[e("label",{children:"cf_clearance cookie value:"}),e("input",{type:"text",value:A,onChange:L=>k(L.target.value),placeholder:"e.g. xxxxxxxx.xxxxxxxx.xxxxxxx-xxxxxxx",className:B.input})]}),e("div",{className:B.actions,children:[e("button",{className:B.secondaryButton,onClick:i,children:"Cancel"}),e("button",{className:B.secondaryButton,onClick:()=>c(1),children:"Back"}),e("button",{className:B.button,onClick:q,disabled:T,children:T?"Saving...":"Submit"})]})]})})})},tt="asmrTranslateCache",$t=10080*60*1e3;function Et(){try{const s=localStorage.getItem(tt);if(!s)return new Map;const i=JSON.parse(s);return new Map(Object.entries(i))}catch{return new Map}}function _t(s){try{const i={};for(const[C,f]of s)i[C]=f;localStorage.setItem(tt,JSON.stringify(i))}catch{}}function Ke(s){return/[\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FAF]/.test(s)}async function jt(s){const i=s.map(c=>c.trim()).filter(Boolean);if(i.length===0)return new Map;const C=await je.settings.translate.mutate({texts:i,source:"ja",target:"en"}),f=new Map;for(const[c,m]of Object.entries(C.translations||{}))f.set(c,m);for(const c of i)f.has(c)||f.set(c,c);return f}function Ft(s,i){const[C,f]=g(new Map),[c,m]=g(!1),v=_(null),A=s.join("");return w(()=>{const T=A?A.split(""):[];if(!i||T.length===0){f(new Map),m(!1);return}const R=Array.from(new Set(T.map(u=>u.trim()).filter(Boolean).filter(Ke)));if(R.length===0){f(new Map);return}v.current||(v.current=Et());const I=Date.now(),N=new Map,b=[];for(const u of R){const o=v.current.get(u);o&&I-o.ts<$t?N.set(u,o.t):b.push(u)}if(b.length===0){f(N);return}let M=!1;m(!0);const S=[];for(let u=0;u<b.length;u+=15)S.push(b.slice(u,u+15));return(async()=>{const u=new Map;for(const l of S){try{const x=await jt(l);for(const[p,q]of x)u.set(p,q)}catch{}await new Promise(x=>setTimeout(x,120))}if(M)return;if(v.current){for(const[l,x]of u)v.current.set(l,{t:x,ts:Date.now()});_t(v.current)}const o=new Map([...N,...u]);f(o),m(!1)})(),()=>{M=!0}},[i,A]),{t:T=>!i||!T||!Ke(T)?T:C.get(T.trim())||T,map:C,isTranslating:c}}const Dt=[{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"}]}],Ot=[{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 / グロ"}],Ht=[{value:"sfw",label:"SFW / 全年齢"}],Ee="agreedToViewMature",ta=()=>{const{rj:s}=gt(),i=Ge(),[C,f]=ft(),[c,m]=g(()=>localStorage.getItem(Ee)==="true"),[v,A]=g(!1),[k,T]=g(()=>C.get("q")||""),[R,I]=g(()=>C.get("q")||""),[N,b]=g("latest"),[M,S]=g("sfw"),[u,o]=g(1),[l,x]=g(null),[p,q]=g(null),[L,X]=g(!0),[F,K]=g(()=>localStorage.getItem("asmrTranslateEN")==="true"),[j,ne]=g(!1),H=bt(),{toggle:Z,bookmarkedIds:he}=Ze(),{popup:$,openPopup:ee,scheduleClose:U,cancelClose:Ne,closePopup:pe}=At();w(()=>yt("jasmr",()=>ne(!0)),[]),w(()=>{localStorage.setItem("asmrTranslateEN",String(F))},[F]),w(()=>{const n=()=>m(localStorage.getItem(Ee)==="true");return window.addEventListener("focus",n),window.addEventListener("storage",n),()=>{window.removeEventListener("focus",n),window.removeEventListener("storage",n)}},[]);const ge=c,z=ge?M:"sfw",Ce=ge?Ot:Ht,{data:re,isLoading:se,isError:Pe,isFetching:le}=Tt(R,u,N,z),G=_e.useMemo(()=>re?.shows??[],[re?.shows]),W=re?.hasNext??!1;w(()=>{if(!s){l&&!p&&x(null);return}const n=s.toUpperCase();if(p&&(p.work.id?.toUpperCase()===n||p.work._id?.toUpperCase()===n)){l&&x(null);return}const d=G.find(P=>(P.id||P._id)?.toUpperCase()===n);d?(!l||(l.id||l._id)!==(d.id||d._id))&&x(d):(!l||(l.id||l._id)?.toUpperCase()!==n)&&x({_id:n,id:n,name:n})},[s,G,p,l]);const fe=Q(()=>{i("/asmr")},[i]);w(()=>{!s&&p&&q(null)},[s,p]);const{data:Y}=Qe(p&&p.work.id||null),oe=p?[p.work.thumbnail,...Y?.images||[]].filter(Boolean):[],ie=[...G.map(n=>n.name),l?.name||"",p?.work.name||"",...Y?.chapters?.map(n=>n.label)||[]].filter(Boolean),{t:V}=Ft(ie,F);w(()=>{const n=p?p.work.name:l?l.name:s?s.toUpperCase():"",d=n?F?V(n):n:"",P=d?`${d} - dango`:"dango";document.title=P;try{window.history.replaceState(window.history.state,P,window.location.href)}catch{}},[l,p,s,F,V]);const Se=n=>{n.preventDefault(),I(k),o(1);const d=new URLSearchParams(C);k.trim()?d.set("q",k.trim()):d.delete("q"),d.delete("page"),f(d,{replace:!0})};w(()=>{const n=C.get("q")||"";T(d=>d===n?d:n),I(d=>d===n?d:n),o(1)},[C]);const be=n=>{n.target.checked&&!c&&A(!0)},ce=()=>{localStorage.setItem(Ee,"true"),m(!0),A(!1),o(1)},de=()=>{A(!1)},ue=Q((n,d,P)=>{x(null),X(!0),q({work:n,tracks:d,index:P})},[]);return e("div",{className:`${ae.page} ${p?ae.pageWithPlayer:""}`,children:[!(p&&L)&&e(O,{children:[e("header",{className:ae.header,children:[e("h1",{className:ae.pageTitle,children:[e(y,{name:"headphones"})," ASMR"]}),e("form",{className:ae.searchForm,onSubmit:Se,children:[e("input",{className:ae.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:ae.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:N,onChange:n=>{b(n.target.value),o(1)},children:Dt.map(n=>e("optgroup",{label:n.label,children:n.options.map(d=>e("option",{value:d.value,children:d.label},d.value))},n.label))}),e("label",{className:t.filterLabel,htmlFor:"asmr-rating",children:"Type"}),e("select",{id:"asmr-rating",className:t.sortSelect,value:M,onChange:n=>{S(n.target.value),o(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:F,onChange:n=>K(n.target.checked)}),e("span",{className:t.filterLabel,children:"EN"})]}),!c&&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:be})]})]})]}),Pe?e("p",{className:t.statusMsg,children:"Failed to load works. Please try again."}):se&&G.length===0?e("div",{className:t.grid,"aria-hidden":!0,children:Array.from({length:12}).map((n,d)=>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%"}})]},d))}):G.length===0?e("p",{className:t.statusMsg,children:"No works found."}):e(O,{children:[e("div",{className:`${t.grid} ${le?t.fetching:""}`,children:G.map(n=>{const d=F?{...n,name:V(n.name)}:n,P=Xe(n),me=Ye(P),J=he.has(me),ve=`/asmr/${encodeURIComponent(P)}`;return e("div",{className:t.asmrCardWrap,children:[e(kt,{item:{id:me,title:d.name,thumbnail:n.thumbnail||"",typeBadge:P||void 0,isAdult:$e(n)},linkTo:ve,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:D=>ee(D,{rjCode:P,title:d.name,thumbnail:n.thumbnail||"",isAdult:$e(n),rating:n.rating,listenTarget:ve}),onPopupHoverIntent:D=>D?Ne():U(),rawThumbnail:!0}),e("button",{className:`${t.bookmarkBtn} ${J?t.bookmarked:""}`,onClick:D=>{D.preventDefault(),D.stopPropagation(),Z({rjCode:P,title:n.name,thumbnail:n.thumbnail||"",isAdult:$e(n)})},title:J?"Remove from listening list":"Add to listening list","aria-label":J?"Remove from listening list":"Add to listening list","aria-pressed":J,children:e(y,{name:J?"check":"plus",size:12})})]},n._id||n.id)})}),e("nav",{className:t.pagination,children:[e("button",{className:t.pageBtn,disabled:u<=1,onClick:()=>o(n=>Math.max(1,n-1)),children:"Previous"}),e("span",{className:t.pageIndicator,children:["Page ",u]}),e("button",{className:t.pageBtn,disabled:!W,onClick:()=>o(n=>n+1),children:"Next"})]})]})]}),l&&e(Lt,{work:l,onClose:fe,onPlay:ue,t:V}),$&&e(Mt,{data:$.data,anchorRect:$.rect,bookmarked:he.has(Ye($.data.rjCode)),onToggleBookmark:()=>Z({rjCode:$.data.rjCode,title:$.data.title,thumbnail:$.data.thumbnail||"",isAdult:$.data.isAdult}),onMouseEnter:Ne,onMouseLeave:U,onRequestClose:pe}),j&&e(Rt,{isOpen:j,onClose:()=>ne(!1),onSuccess:()=>{H.invalidateQueries({queryKey:["asmrBrowse"]}),H.invalidateQueries({queryKey:["asmrWork"]})}}),v&&e(Fe,{isOpen:v,title:"Content Warning",onClose:de,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(Le,{variant:"secondary",onClick:de,children:"Go Back"}),e(Le,{onClick:ce,children:"I'm 18+, Continue"})]})]})}),p&&e(Pt,{title:p.work.name,images:oe,chapters:Y?.chapters||[],tracks:p.tracks,trackIndex:p.index,expanded:L,isAdult:!!p.work.isAdult,rjCode:p.work.id||p.work._id,t:V,onTrackChange:n=>q(d=>d&&{...d,index:n}),onExpandedChange:X,onClose:()=>{q(null),X(!0),s&&i("/asmr")}})]})};export{ta as default};
1
+ import{T as Ve,u as e,A as _,d as g,h as w,a as Qe,g as _e,q as G,S as D,$ as Je,o as gt,p as ft}from"./vendor-core-DfaOB3Rn.js";import{I as y}from"./vendor-icons-DrybRNxP.js";import{u as bt}from"./vendor-query-BBT5_sHx.js";import{T as ze}from"./ToggleSwitch-CN_ppEc9.js";import{g as we,t as je,O as vt,B as Le,M as Fe,P as B,z as te,Q as yt}from"./index-BGCpLf49.js";import{M as kt}from"./MediaCard-Auk42bqx.js";import{c as Ge,a as Ze,d as wt,e as Xe,f as et,g as Nt,h as Ct,i as St,j as Tt,k as Ye,l as $e}from"./useAsmr-5n3wPm5z.js";import{a as t}from"./Asmr.module-CdWlioTY.js";import{u as At,A as Mt}from"./useAsmrPopup-BxGzhLmJ.js";import{l as xt}from"./hls-D3SWhYIU.js";import{p as ae}from"./page.module-C1MlZzf3.js";import"./vendor-ui-3qrARCPr.js";import"./useIsMobile-Dvx1uJ82.js";import"./usePopup-DS9jMzp6.js";const Lt=({work:s,onClose:i,onPlay:C,t:f})=>{const{data:c,isLoading:m}=Ge(s.id||null),v=Ze(s),{data:A}=wt(v||void 0),{toggle:k,bookmarkedIds:T}=Xe(),{data:R}=et(v||void 0),I=v?T.has(v):!!A?.inLibrary,N=Ve(()=>(c?.description||s.description||"").split(`
2
+ `).map(o=>{const l=o.indexOf(":");return l===-1?null:{label:o.slice(0,l),value:o.slice(l+1).trim()}}).filter(o=>!!o&&!!o.value),[c?.description,s.description]),b=c?.tracks||[],M=s.thumbnail||c?.images?.[0],S=Ve(()=>{const o=R?.progress??[];return o.length>0?o.reduce((l,x)=>l.updatedAt>=x.updatedAt?l:x):null},[R]),u=S&&S.trackIndex<b.length?S.trackIndex:null;return e("div",{className:t.detailOverlay,onClick:i,children:e("div",{className:t.detailModal,onClick:o=>o.stopPropagation(),children:[e("button",{className:t.detailClose,onClick:i,"aria-label":"Close",children:e(y,{name:"times"})}),e("div",{className:t.detailHeader,children:[M?e("img",{className:t.detailCover,src:M,alt:s.name,decoding:"async"}):e("div",{className:`${t.detailCover} ${t.thumbPlaceholder}`}),e("div",{className:t.detailInfo,children:[e("h2",{className:t.detailTitle,children:f?f(s.name):s.name}),e("p",{className:t.detailRj,children:s.id}),N.map(o=>o.label==="Tags"?e("p",{className:t.metaRow,children:[e("span",{className:t.metaLabel,children:"Tags"}),e("span",{className:t.tagChips,children:o.value.split(", ").map(l=>e("span",{className:t.tagChip,children:l},l))})]},o.label):e("p",{className:t.metaRow,children:[e("span",{className:t.metaLabel,children:o.label}),o.value]},o.label))]})]}),e("div",{className:t.tracksSection,children:[e("h3",{className:t.tracksHeading,children:m?"Loading tracks…":`Tracks (${b.length})`}),!m&&(b.length>0?e("ul",{className:t.trackList,children:b.map((o,l)=>e("li",{children:e("button",{className:t.trackRow,onClick:()=>C(s,b,l),children:[e(y,{name:"play",className:t.trackIcon}),e("span",{className:t.trackLabel,children:o.resolutionStr}),e("span",{className:t.trackType,children:o.hls?"HLS":"MP3"})]})},o.link))}):e("p",{className:t.noTracks,children:"No audio streams available for this work."}))]}),e("div",{className:t.detailActions,children:[!m&&b.length>0&&e("button",{className:t.playAllBtn,onClick:()=>C(s,b,0),children:[e(y,{name:"play"})," Play from start"]}),!m&&u!==null&&S&&e("button",{className:t.playAllBtn,onClick:()=>C(s,b,u),children:[e(y,{name:"history"})," Resume track ",u+1," ·"," ",we(S.currentTime),S.duration>0?` / ${we(S.duration)}`:""]}),v&&e("button",{className:t.playAllBtn,onClick:()=>k({rjCode:v,title:s.name,thumbnail:s.thumbnail||"",isAdult:!!s.isAdult}),"aria-pressed":I,children:[e(y,{name:I?"check":"plus"})," ",I?"In listening list":"Add to listening list"]})]})]})})},Pt=({title:s,images:i,chapters:C,tracks:f,trackIndex:c,expanded:m,isAdult:v,rjCode:A,t:k,onTrackChange:T,onExpandedChange:R,onClose:I})=>{const N=_(null),b=_(null),[M,S]=g(!1),[u,o]=g(0),[l,x]=g(0),[p,q]=g(0),[L,Z]=g(!0),[F,K]=g(0),[j,ne]=g(new Set),[H,X]=g(!1),[he,$]=g(!0),ee=_("");ee.current||(ee.current=typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`asmr-${Date.now()}-${Math.random().toString(36).slice(2)}`);const[U,Ne]=g(()=>{const a=parseFloat(localStorage.getItem("asmrVolume")||"");return Number.isFinite(a)?a:1}),pe=_(U);w(()=>{pe.current=U},[U]);const ge=Qe(),z=_e.useMemo(()=>A?Nt(A):"",[A]),Ce=Ct(),re=St(),{data:se}=et(z||void 0),[Pe,le]=g(!1),Q=_(""),W=_(null),fe=_(0),Y=_(0),oe=_(0),ie=f[c],V=ie?.link,Se=ie?.hls,be=ie?.resolutionStr||"",ce=i.length>0,de=`${z}:${c}`,ue=_e.useMemo(()=>(se?.progress??[]).find(r=>r.trackIndex===c)??null,[se,c]),n=_({workId:"",trackIndex:0,trackLabel:""}),d=_(se);d.current=se,n.current={workId:z,trackIndex:c,trackLabel:be};const P=G((a,r,h,E=!1)=>{!a.workId||!h||h<10||!E&&Math.abs(r-fe.current)<5||(fe.current=r,Ce.mutate({workId:a.workId,trackIndex:a.trackIndex,trackLabel:a.trackLabel,currentTime:Math.floor(r),duration:Math.floor(h),title:s,thumbnail:i[0]||"",rjCode:a.workId,isAdult:v?1:0}))},[Ce,s,i,v]),me=G((a=!1)=>{W.current&&(clearTimeout(W.current),W.current=null),P(n.current,Y.current,oe.current,a)},[P]),J=_(me);J.current=me;const ve=_(P);ve.current=P;const O=G(()=>{b.current&&(b.current.destroy(),b.current=null)},[]);w(()=>{const a=N.current;if(!a||!V)return;const r={workId:z,trackIndex:c,trackLabel:be},h=()=>{W.current&&(clearTimeout(W.current),W.current=null),ve.current(r,Y.current,oe.current,!0)};o(0),x(0),q(0),S(!1),Y.current=0,oe.current=0,fe.current=0,O();const E=d.current?.progress?.find(xe=>xe.trackIndex===c),Me=E?.currentTime||0,Ie=E?.duration||0,ke=Me>=10&&Ie-Me>=15;if(Se){let xe=!1;return(async()=>{const Be=await xt();if(!xe)if(Be&&Be.isSupported()){const Re=new Be({enableWorker:!0});b.current=Re,Re.loadSource(V),Re.attachMedia(a),ke||a.play().catch(()=>S(!1))}else a.src=V,a.load(),a.volume=pe.current,ke||a.play().catch(()=>S(!1))})(),()=>{xe=!0,O(),a.removeAttribute("src"),h()}}else a.src=V;return a.load(),a.volume=pe.current,ke||a.play().catch(()=>S(!1)),()=>{O(),a.removeAttribute("src"),h()}},[V,Se,O,z,c,be]),w(()=>()=>O(),[O]),w(()=>{const a=()=>{document.visibilityState==="hidden"&&J.current()},r=()=>J.current();return document.addEventListener("visibilitychange",a),window.addEventListener("pagehide",r),()=>{document.removeEventListener("visibilitychange",a),window.removeEventListener("pagehide",r)}},[]),w(()=>{if(!ue||Q.current===de||!(l>0))return;const a=ue.currentTime||0,r=ue.duration||l;if(Q.current=de,!(a>=10&&r-a>=15&&Y.current<a))return;const h=N.current;h&&(h.currentTime=a,Y.current=a,o(a),h.play().catch(()=>{}))},[ue,l,de]),w(()=>{const a=N.current;a&&(a.volume=U)},[U]),w(()=>{if(m)return document.body.classList.add("asmr-player-open"),()=>document.body.classList.remove("asmr-player-open")},[m]),w(()=>{K(0)},[i]),w(()=>{m&&$(!0)},[m]),w(()=>{H&&$(!0)},[H]);const Te=G(a=>{if(!s||f.length===0)return;const r=f[c],h=r?`${r.resolutionStr} (${c+1}/${f.length})`:"",E=N.current,Me=E?E.currentTime:0,Ie=E&&E.duration||0,ke=i[0]||"";je.discord.asmrPresence.mutate({title:s,trackLabel:h,isPlaying:a,thumbnail:ke,thumbnails:i,currentTime:Me,duration:Ie,isAdult:!!v,rjCode:A||"",sessionId:ee.current}).catch(()=>{}),je.discord.heartbeat.mutate({sessionId:ee.current}).catch(()=>{})},[s,f,c,i,v,A]);w(()=>{Te(M)},[Te,M,c,s,m]),w(()=>{if(!M)return;const a=window.setInterval(()=>Te(!0),15e3);return()=>window.clearInterval(a)},[M,Te]),w(()=>{const a=ee.current,r=()=>vt(a),h=()=>r(),E=()=>{document.visibilityState==="hidden"&&r()};return window.addEventListener("pagehide",h),window.addEventListener("beforeunload",h),document.addEventListener("visibilitychange",E),()=>{window.removeEventListener("pagehide",h),window.removeEventListener("beforeunload",h),document.removeEventListener("visibilitychange",E),r()}},[]);const Ae=G(a=>{ne(r=>{if(r.has(a))return r;const h=new Set(r);return h.add(a),h})},[]),at=G((a,r)=>{a&&a.complete&&a.naturalWidth>0&&Ae(r)},[Ae]);w(()=>{if(!m)return;const a=r=>{if(r.key==="Escape"){H?X(!1):R(!1);return}!L||i.length<2||(r.key==="ArrowLeft"&&K(h=>Math.max(0,h-1)),r.key==="ArrowRight"&&K(h=>Math.min(i.length-1,h+1)))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[m,L,i.length,H,R]);const nt=()=>{const a=N.current;a&&(a.paused?a.play().catch(()=>{}):a.pause())},rt=a=>{const r=N.current;if(!r||!l)return;const h=parseFloat(a.target.value);r.currentTime=h,o(h)},st=()=>{me(!0),c<f.length-1?T(c+1):le(!0)},lt=a=>{const r=a.currentTarget.currentTime;Y.current=r,o(r),W.current&&clearTimeout(W.current),W.current=setTimeout(()=>J.current(),5e3)},ot=()=>{S(!1),J.current()},it=a=>{const r=a.currentTarget.duration;oe.current=Number.isFinite(r)?r:0,x(a.currentTarget.duration)},ct=G(()=>{z&&re.mutate({rjCode:z,title:s,thumbnail:i[0]||"",status:"Completed",isAdult:!!v,silent:!0}),le(!1),I(),ge("/")},[z,re,s,i,v,I,ge]),dt=C.reduce((a,r,h)=>u>=r.time?h:a,-1),ut=a=>{const r=N.current;r&&(r.currentTime=a,o(a))},Oe=a=>{const r=N.current;if(!r)return;const h=Number.isFinite(r.currentTime)?r.currentTime:u,E=Math.max(0,Math.min(l||1/0,h+a));r.currentTime=E,o(E),$(!0)},De=l?Math.min(100,u/l*100):0,mt=l?Math.min(100,Math.max(De,p/l*100)):0,ht=e(D,{children:[e("div",{className:t.playerButtons,children:[e("button",{className:t.playerBtn,onClick:()=>T(Math.max(0,c-1)),disabled:c===0,"aria-label":"Previous track",children:e(y,{name:"step-backward"})}),e("button",{className:`${t.playerBtn} ${t.seekBtn}`,onClick:()=>Oe(-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":M?"Pause":"Play",children:M?e(y,{name:"pause"}):e(y,{name:"play"})}),e("button",{className:`${t.playerBtn} ${t.seekBtn}`,onClick:()=>Oe(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(f.length-1,c+1)),disabled:c>=f.length-1,"aria-label":"Next track",children:e(y,{name:"step-forward"})})]}),e("div",{className:t.seekRow,children:[e("span",{className:t.timeLabel,children:we(u)}),e("input",{className:t.seekBar,type:"range",min:0,max:l||0,step:.1,value:Math.min(u,l||0),onChange:rt,style:{"--played-percent":`${De}%`,"--buffered-percent":`${mt}%`},"aria-label":"Seek"}),e("span",{className:t.timeLabel,children:we(l)})]})]}),He=e(D,{children:[e("button",{className:`${t.playerBtn} ${t.playerToggle}`,onClick:()=>R(!m),"aria-label":m?"Minimize player":"Expand player",title:m?"Minimize to browse":"Expand",children:m?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:[ie?.resolutionStr||"",f.length>1?` (${c+1}/${f.length})`:""]})]}),e("div",{className:t.playerControls,children:ht}),e("div",{className:t.playerRight,children:[U===0?e(y,{name:"volume-mute",className:t.volumeIcon}):U<.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:U,onChange:a=>{const r=parseFloat(a.target.value);Ne(r),localStorage.setItem("asmrVolume",String(r))},style:{"--volume-percent":`${U*100}%`},"aria-label":"Volume"})]}),e("div",{className:t.playerActions,children:[m&&ce&&e("button",{className:t.playerBtn,onClick:()=>Z(a=>!a),"aria-label":L?"Hide images":"Show images",title:L?"Hide images":"Show images",children:L?e(y,{name:"eye-slash"}):e(y,{name:"image"})}),m&&C.length>0&&e("button",{className:`${t.playerBtn} ${H?t.playerBtnActive:""}`,onClick:()=>X(a=>!a),"aria-label":H?"Hide bookmarks":"Show bookmarks",title:"Timestamps",children:e(y,{name:"list-ol"})}),e("button",{className:t.playerBtn,onClick:I,"aria-label":"Close player",children:e(y,{name:"times"})})]})]}),Ue=e("audio",{ref:N,preload:"metadata",onPlay:()=>S(!0),onPause:ot,onTimeUpdate:lt,onLoadedMetadata:it,onProgress:a=>{const r=a.currentTarget;r.buffered.length>0&&q(r.buffered.end(r.buffered.length-1))},onEnded:st}),qe=e(Fe,{isOpen:Pe,onClose:()=>le(!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(Le,{variant:"secondary",onClick:()=>le(!1),children:"Close"}),e(Le,{onClick:ct,children:"Mark Completed & Back to Home"})]})]})});if(!m)return Je(e(D,{children:[Ue,e("div",{className:t.playerBar,children:He}),qe]}),document.body);const ye=Math.min(F,Math.max(0,i.length-1)),We=i[ye],pt=L&&ce&&!!We&&!j.has(We);return Je(e(D,{children:[Ue,qe,e("div",{className:`${t.npOverlay} ${he?"":t.npOverlayControlsHidden}`,children:[e("div",{className:`${t.npStage} ${!L||!ce?t.npStageBlank:""}`,onClick:()=>$(a=>!a),children:L&&ce&&e(D,{children:[e("div",{className:t.sliderViewport,children:[e("div",{className:t.sliderTrack,style:{transform:`translateX(-${ye*100}%)`},children:i.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:()=>Ae(a),onError:()=>Ae(a),className:`${t.slideImg} ${j.has(a)?t.slideImgLoaded:""}`})},a))}),pt&&e("span",{className:t.slideSpinner,"aria-label":"Loading image"})]}),i.length>1&&e(D,{children:[e("button",{className:`${t.npArrow} ${t.npArrowLeft}`,onClick:a=>{a.stopPropagation(),K(r=>Math.max(0,r-1)),$(!0)},disabled:ye===0,"aria-label":"Previous image",children:e(y,{name:"chevron-left"})}),e("button",{className:`${t.npArrow} ${t.npArrowRight}`,onClick:a=>{a.stopPropagation(),K(r=>Math.min(i.length-1,r+1)),$(!0)},disabled:ye===i.length-1,"aria-label":"Next image",children:e(y,{name:"chevron-right"})}),e("span",{className:t.npImageCount,onClick:a=>a.stopPropagation(),children:[ye+1," / ",i.length]})]})]})}),e("div",{className:`${t.playerBar} ${t.playerBarDocked} ${he?"":t.playerBarDockedHidden}`,onClick:a=>a.stopPropagation(),children:[He,H&&e(D,{children:[e("div",{className:t.npBackdrop,onClick:()=>X(!1)}),e("div",{className:t.chapterPanel,children:C.map((a,r)=>e("button",{className:`${t.chapterRow} ${r===dt?t.chapterRowActive:""}`,title:k?k(a.label):a.label,onClick:()=>{ut(a.time),X(!1)},children:[e("span",{className:t.chapterRowTime,children:we(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)},It="https://github.com/serifpersia/dango/releases/latest/download/dango-extension.zip",Bt=s=>{try{return JSON.parse(s.detail)}catch{return null}},Rt=({isOpen:s,onClose:i,onSuccess:C})=>{const[f,c]=g(1),[m,v]=g(typeof navigator<"u"?navigator.userAgent:""),[A,k]=g(""),[T,R]=g(!1),[I,N]=g(!1),b=_(null),M=typeof navigator<"u"?navigator.userAgent:"",S=/android/i.test(M),u=/firefox|fxios/i.test(M)&&!S,o=!u&&!S&&/chrome|chromium|edg|brave/i.test(M),l=u||o;w(()=>{s&&(c(1),v(typeof navigator<"u"?navigator.userAgent:""),k(""),R(!1),N(!1))},[s]),w(()=>()=>{b.current&&(window.removeEventListener("dango:jasmr-cookie",b.current),b.current=null)},[]);const x=async()=>{localStorage.setItem("jasmr_ua",m),window.open("https://japaneseasmr.com","_blank","noopener,noreferrer"),c(2)},p=()=>{if(I)return;N(!0);const L=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`,Z=window.setTimeout(()=>{N(!1),b.current&&(window.removeEventListener("dango:jasmr-cookie",b.current),b.current=null),te.error("Helper not detected — install it via about:debugging first.")},3e3),F=K=>{const j=Bt(K);if(!(!j||j.requestId!==L))if(window.clearTimeout(Z),window.removeEventListener("dango:jasmr-cookie",F),b.current=null,N(!1),j?.ok&&j.cookie)k(j.cookie),te.success("Cookie extracted from helper!");else if(j?.error==="NO_COOKIE"){const ne=j.debug?.stores?.length??0,H=j.debug?.names??[];te.error(`Helper found no cf_clearance (checked ${ne} stores, saw: ${H.join(", ")||"none"}) — solve the challenge on the JapaneseASMR tab first.`)}else te.error("Helper request failed — try again.")};b.current=F,window.addEventListener("dango:jasmr-cookie",F),window.dispatchEvent(new CustomEvent("dango:get-jasmr-cookie",{detail:{requestId:L}}))},q=async()=>{if(!A.trim()){te.error("Please enter the cf_clearance cookie");return}R(!0);try{localStorage.setItem("jasmr_cookie",A.trim()),te.success("Cookie updated successfully!"),C?.(),i()}catch{te.error("Failed to save cookie")}finally{R(!1)}};return e(Fe,{isOpen:s,onClose:i,title:"JapaneseASMR Verification Required",children:e("div",{className:B.container,children:f===1?e(D,{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:B.field,children:[e("label",{children:"Your User-Agent (must match the browser you solve the challenge with):"}),e("textarea",{value:m,onChange:L=>v(L.target.value),rows:3,className:B.textarea})]}),e("div",{className:B.actions,children:[e("button",{className:B.secondaryButton,onClick:i,children:"Cancel"}),e("button",{className:B.button,onClick:x,children:"Start Verification (Opens JapaneseASMR)"})]})]}):e(D,{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."]}),l&&e("div",{className:B.hint,children:[e("strong",{children:"Dango helper (one-time setup):"})," ",u?e(D,{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(D,{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:It,target:"_blank",rel:"noreferrer",className:B.link,children:"dango-extension.zip"}),". Then click Extract below and the field fills itself.",e("div",{className:B.actions,children:e("button",{className:B.button,onClick:p,disabled:I,type:"button",children:I?"Extracting…":"Extract cookie from helper"})})]}),e("div",{className:B.field,children:[e("label",{children:"cf_clearance cookie value:"}),e("input",{type:"text",value:A,onChange:L=>k(L.target.value),placeholder:"e.g. xxxxxxxx.xxxxxxxx.xxxxxxx-xxxxxxx",className:B.input})]}),e("div",{className:B.actions,children:[e("button",{className:B.secondaryButton,onClick:i,children:"Cancel"}),e("button",{className:B.secondaryButton,onClick:()=>c(1),children:"Back"}),e("button",{className:B.button,onClick:q,disabled:T,children:T?"Saving...":"Submit"})]})]})})})},tt="asmrTranslateCache",$t=10080*60*1e3;function Et(){try{const s=localStorage.getItem(tt);if(!s)return new Map;const i=JSON.parse(s);return new Map(Object.entries(i))}catch{return new Map}}function _t(s){try{const i={};for(const[C,f]of s)i[C]=f;localStorage.setItem(tt,JSON.stringify(i))}catch{}}function Ke(s){return/[\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FAF]/.test(s)}async function jt(s){const i=s.map(c=>c.trim()).filter(Boolean);if(i.length===0)return new Map;const C=await je.settings.translate.mutate({texts:i,source:"ja",target:"en"}),f=new Map;for(const[c,m]of Object.entries(C.translations||{}))f.set(c,m);for(const c of i)f.has(c)||f.set(c,c);return f}function Ft(s,i){const[C,f]=g(new Map),[c,m]=g(!1),v=_(null),A=s.join("");return w(()=>{const T=A?A.split(""):[];if(!i||T.length===0){f(new Map),m(!1);return}const R=Array.from(new Set(T.map(u=>u.trim()).filter(Boolean).filter(Ke)));if(R.length===0){f(new Map);return}v.current||(v.current=Et());const I=Date.now(),N=new Map,b=[];for(const u of R){const o=v.current.get(u);o&&I-o.ts<$t?N.set(u,o.t):b.push(u)}if(b.length===0){f(N);return}let M=!1;m(!0);const S=[];for(let u=0;u<b.length;u+=15)S.push(b.slice(u,u+15));return(async()=>{const u=new Map;for(const l of S){try{const x=await jt(l);for(const[p,q]of x)u.set(p,q)}catch{}await new Promise(x=>setTimeout(x,120))}if(M)return;if(v.current){for(const[l,x]of u)v.current.set(l,{t:x,ts:Date.now()});_t(v.current)}const o=new Map([...N,...u]);f(o),m(!1)})(),()=>{M=!0}},[i,A]),{t:T=>!i||!T||!Ke(T)?T:C.get(T.trim())||T,map:C,isTranslating:c}}const Ot=[{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"}]}],Dt=[{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 / グロ"}],Ht=[{value:"sfw",label:"SFW / 全年齢"}],Ee="agreedToViewMature",aa=()=>{const{rj:s}=gt(),i=Qe(),[C,f]=ft(),[c,m]=g(()=>localStorage.getItem(Ee)==="true"),[v,A]=g(!1),[k,T]=g(()=>C.get("q")||""),[R,I]=g(()=>C.get("q")||""),[N,b]=g("latest"),[M,S]=g("sfw"),[u,o]=g(1),[l,x]=g(null),[p,q]=g(null),[L,Z]=g(!0),[F,K]=g(()=>localStorage.getItem("asmrTranslateEN")==="true"),[j,ne]=g(!1),H=bt(),{toggle:X,bookmarkedIds:he}=Xe(),{popup:$,openPopup:ee,scheduleClose:U,cancelClose:Ne,closePopup:pe}=At();w(()=>yt("jasmr",()=>ne(!0)),[]),w(()=>{localStorage.setItem("asmrTranslateEN",String(F))},[F]),w(()=>{const n=()=>m(localStorage.getItem(Ee)==="true");return window.addEventListener("focus",n),window.addEventListener("storage",n),()=>{window.removeEventListener("focus",n),window.removeEventListener("storage",n)}},[]);const ge=c,z=ge?M:"sfw",Ce=ge?Dt:Ht,{data:re,isLoading:se,isError:Pe,isFetching:le}=Tt(R,u,N,z),Q=_e.useMemo(()=>re?.shows??[],[re?.shows]),W=re?.hasNext??!1;w(()=>{if(!s){l&&!p&&x(null);return}const n=s.toUpperCase();if(p&&(p.work.id?.toUpperCase()===n||p.work._id?.toUpperCase()===n)){l&&x(null);return}const d=Q.find(P=>(P.id||P._id)?.toUpperCase()===n);d?(!l||(l.id||l._id)!==(d.id||d._id))&&x(d):(!l||(l.id||l._id)?.toUpperCase()!==n)&&x({_id:n,id:n,name:n})},[s,Q,p,l]);const fe=G(()=>{i("/asmr")},[i]);w(()=>{!s&&p&&q(null)},[s,p]);const{data:Y}=Ge(p&&p.work.id||null),oe=p?[p.work.thumbnail,...Y?.images||[]].filter(Boolean):[],ie=[...Q.map(n=>n.name),l?.name||"",p?.work.name||"",...Y?.chapters?.map(n=>n.label)||[]].filter(Boolean),{t:V}=Ft(ie,F);w(()=>{const n=p?p.work.name:l?l.name:s?s.toUpperCase():"",d=n?F?V(n):n:"",P=d?`${d} - dango`:"dango";document.title=P;try{window.history.replaceState(window.history.state,P,window.location.href)}catch{}},[l,p,s,F,V]);const Se=n=>{n.preventDefault(),I(k),o(1);const d=new URLSearchParams(C);k.trim()?d.set("q",k.trim()):d.delete("q"),d.delete("page"),f(d,{replace:!0})};w(()=>{const n=C.get("q")||"";T(d=>d===n?d:n),I(d=>d===n?d:n),o(1)},[C]);const be=n=>{n.target.checked&&!c&&A(!0)},ce=()=>{localStorage.setItem(Ee,"true"),m(!0),A(!1),o(1)},de=()=>{A(!1)},ue=G((n,d,P)=>{x(null),Z(!0),q({work:n,tracks:d,index:P})},[]);return e("div",{className:`${ae.page} ${p?ae.pageWithPlayer:""}`,children:[!(p&&L)&&e(D,{children:[e("header",{className:ae.header,children:[e("h1",{className:ae.pageTitle,children:[e(y,{name:"headphones"})," ASMR"]}),e("form",{className:ae.searchForm,onSubmit:Se,children:[e("input",{className:ae.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:ae.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:N,onChange:n=>{b(n.target.value),o(1)},children:Ot.map(n=>e("optgroup",{label:n.label,children:n.options.map(d=>e("option",{value:d.value,children:d.label},d.value))},n.label))}),e("label",{className:t.filterLabel,htmlFor:"asmr-rating",children:"Type"}),e("select",{id:"asmr-rating",className:t.sortSelect,value:M,onChange:n=>{S(n.target.value),o(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:F,onChange:n=>K(n.target.checked)}),e("span",{className:t.filterLabel,children:"EN"})]}),!c&&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:be})]})]})]}),Pe?e("p",{className:t.statusMsg,children:"Failed to load works. Please try again."}):se&&Q.length===0?e("div",{className:t.grid,"aria-hidden":!0,children:Array.from({length:12}).map((n,d)=>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%"}})]},d))}):Q.length===0?e("p",{className:t.statusMsg,children:"No works found."}):e(D,{children:[e("div",{className:`${t.grid} ${le?t.fetching:""}`,children:Q.map(n=>{const d=F?{...n,name:V(n.name)}:n,P=Ze(n),me=Ye(P),J=he.has(me),ve=`/asmr/${encodeURIComponent(P)}`;return e("div",{className:t.asmrCardWrap,children:[e(kt,{item:{id:me,title:d.name,thumbnail:n.thumbnail||"",typeBadge:P||void 0,isAdult:$e(n)},linkTo:ve,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:O=>ee(O,{rjCode:P,title:d.name,thumbnail:n.thumbnail||"",isAdult:$e(n),rating:n.rating,listenTarget:ve}),onPopupHoverIntent:O=>O?Ne():U(),rawThumbnail:!0}),e("button",{className:`${t.bookmarkBtn} ${J?t.bookmarked:""}`,onClick:O=>{O.preventDefault(),O.stopPropagation(),X({rjCode:P,title:n.name,thumbnail:n.thumbnail||"",isAdult:$e(n)})},title:J?"Remove from listening list":"Add to listening list","aria-label":J?"Remove from listening list":"Add to listening list","aria-pressed":J,children:e(y,{name:J?"check":"plus",size:12})})]},n._id||n.id)})}),e("nav",{className:t.pagination,children:[e("button",{className:t.pageBtn,disabled:u<=1,onClick:()=>o(n=>Math.max(1,n-1)),children:"Previous"}),e("span",{className:t.pageIndicator,children:["Page ",u]}),e("button",{className:t.pageBtn,disabled:!W,onClick:()=>o(n=>n+1),children:"Next"})]})]})]}),l&&e(Lt,{work:l,onClose:fe,onPlay:ue,t:V}),$&&e(Mt,{data:$.data,anchorRect:$.rect,bookmarked:he.has(Ye($.data.rjCode)),onToggleBookmark:()=>X({rjCode:$.data.rjCode,title:$.data.title,thumbnail:$.data.thumbnail||"",isAdult:$.data.isAdult}),onMouseEnter:Ne,onMouseLeave:U,onRequestClose:pe}),j&&e(Rt,{isOpen:j,onClose:()=>ne(!1),onSuccess:()=>{H.invalidateQueries({queryKey:["asmrBrowse"]}),H.invalidateQueries({queryKey:["asmrWork"]})}}),v&&e(Fe,{isOpen:v,title:"Content Warning",onClose:de,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(Le,{variant:"secondary",onClick:de,children:"Go Back"}),e(Le,{onClick:ce,children:"I'm 18+, Continue"})]})]})}),p&&e(Pt,{title:p.work.name,images:oe,chapters:Y?.chapters||[],tracks:p.tracks,trackIndex:p.index,expanded:L,isAdult:!!p.work.isAdult,rjCode:p.work.id||p.work._id,t:V,onTrackChange:n=>q(d=>d&&{...d,index:n}),onExpandedChange:Z,onClose:()=>{q(null),Z(!0),s&&i("/asmr")}})]})};export{aa as default};
@@ -1 +1 @@
1
- import{d as a,u as i}from"./vendor-core-DfaOB3Rn.js";import{R as l}from"./ResetProgressModal-5FOWMuqi.js";import{s as f,n as R}from"./useAsmr-z-txLq1s.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
+ import{d as a,u as i}from"./vendor-core-DfaOB3Rn.js";import{R as l}from"./ResetProgressModal-jPtyfyf0.js";import{s as f,n as R}from"./useAsmr-5n3wPm5z.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 r,A as b,d as C,h as A,q as B,T as pe,$ as At}from"./vendor-core-DfaOB3Rn.js";import{B as re,M as $t,S as ye,h as Ft,Z as Rt,t as Je,W as Dt,g as Ot}from"./index-Dk0ASzEz.js";import{I as Q}from"./vendor-icons-DrybRNxP.js";import{u as qt}from"./vendor-query-BBT5_sHx.js";const Ht="_controls_ov6ol_1",Vt="_titleContainer_ov6ol_9",Wt="_scheduleInfo_ov6ol_15",Ut="_status_ov6ol_23",zt="_nextEpisode_ov6ol_35",Kt="_watchlistBtn_ov6ol_45",Gt="_inList_ov6ol_72",Xt="_queueBtn_ov6ol_83",Jt="_queueActive_ov6ol_95",Qt="_modeToggleBtn_ov6ol_101",jt="_modeToggleActive_ov6ol_108",Yt="_nativeToggleBtn_ov6ol_119",Zt="_nativeToggleActive_ov6ol_132",en="_markWatchedBtn_ov6ol_153",tn="_markWatchedDone_ov6ol_167",nn="_completeSeriesBtn_ov6ol_178",rn="_providerAndEpisodeRow_ov6ol_192",on="_episodeActions_ov6ol_199",sn="_desktopEpisodeActions_ov6ol_206",an="_mobileEpisodeActions_ov6ol_213",cn="_episodeNavBtn_ov6ol_217",ln="_primary_ov6ol_247",un="_secondary_ov6ol_257",dn="_episodePickerBtn_ov6ol_261",pn="_queueCountdown_ov6ol_265",fn="_speedBoostBadge_ov6ol_280",mn="_videoContainer_ov6ol_311",hn="_loadingOverlay_ov6ol_324",vn="_loadingDots_ov6ol_338",_n="_dot_ov6ol_343",gn="_bounce_ov6ol_1",yn="_bufferingOverlay_ov6ol_372",bn="_bufferingSpinner_ov6ol_381",wn="_spin_ov6ol_921",Sn="_videoIframe_ov6ol_396",Cn="_videoElementHidden_ov6ol_419",kn="_upscalerCanvas_ov6ol_424",En="_upscalerActive_ov6ol_437",Ln="_upscalerStatusBadge_ov6ol_441",Tn="_subtitleOverlay_ov6ol_456",xn="_controlsOverlay_ov6ol_468",Bn="_hidden_ov6ol_498",Nn="_centerPlayPause_ov6ol_504",In="_bottomControls_ov6ol_536",Pn="_progressBarContainer_ov6ol_553",Mn="_progressBar_ov6ol_553",An="_scrubbing_ov6ol_576",$n="_watchedBar_ov6ol_581",Fn="_bufferedBar_ov6ol_582",Rn="_thumb_ov6ol_604",Dn="_timeBubble_ov6ol_625",On="_skipSegment_ov6ol_648",qn="_op_ov6ol_662",Hn="_ed_ov6ol_666",Vn="_recap_ov6ol_670",Wn="_bottomControlsRow_ov6ol_674",Un="_controlBtn_ov6ol_682",zn="_timeDisplay_ov6ol_706",Kn="_leftControls_ov6ol_715",Gn="_rightControls_ov6ol_716",Xn="_middleControls_ov6ol_717",Jn="_skipControls_ov6ol_723",Qn="_skipBtn_ov6ol_729",jn="_volumeContainer_ov6ol_753",Yn="_volumeSlider_ov6ol_760",Zn="_settingsMenu_ov6ol_838",er="_slideUp_ov6ol_1",tr="_qualityListInMenu_ov6ol_877",nr="_ccOptionsContainer_ov6ol_878",rr="_qualityItemInMenu_ov6ol_886",or="_ccItem_ov6ol_887",sr="_active_ov6ol_908",ar="_sourceLoader_ov6ol_915",cr="_spinner_ov6ol_921",ir="_watchBtn_ov6ol_980",lr="_errorOverlay_ov6ol_1026",ur="_retryButton_ov6ol_1036",dr="_sourceSelectionContainer_ov6ol_1064",pr="_slideUpIn_ov6ol_1",fr="_providerSelectContainer_ov6ol_1079",mr="_providerSelect_ov6ol_1079",hr="_sourceSelect_ov6ol_1064",vr="_sourceButtons_ov6ol_1135",_r="_sourceButton_ov6ol_1135",gr="_detailsBox_ov6ol_1167",yr="_detailsToggleBtn_ov6ol_1180",br="_detailsGridContainer_ov6ol_1204",wr="_fadeIn_ov6ol_1",Sr="_detailItem_ov6ol_1216",Cr="_animeStatus_ov6ol_1236",kr="_genresList_ov6ol_1249",Er="_genreTag_ov6ol_1256",Lr="_loadingDetails_ov6ol_1274",Tr="_descriptionSection_ov6ol_1281",xr="_description_ov6ol_1281",Br="_epJumpControls_ov6ol_1317",Nr="_epRangeButtons_ov6ol_1328",Ir="_metaTags_ov6ol_1334",Pr="_epRangeBtn_ov6ol_1341",Mr="_epJumpInputGroup_ov6ol_1356",Ar="_fullscreenActive_ov6ol_1388",$r="_errorSubtext_ov6ol_1432",bs={controls:Ht,titleContainer:Vt,scheduleInfo:Wt,status:Ut,nextEpisode:zt,watchlistBtn:Kt,inList:Gt,queueBtn:Xt,queueActive:Jt,modeToggleBtn:Qt,modeToggleActive:jt,nativeToggleBtn:Yt,nativeToggleActive:Zt,markWatchedBtn:en,markWatchedDone:tn,completeSeriesBtn:nn,providerAndEpisodeRow:rn,episodeActions:on,desktopEpisodeActions:sn,mobileEpisodeActions:an,episodeNavBtn:cn,primary:ln,secondary:un,episodePickerBtn:dn,queueCountdown:pn,speedBoostBadge:fn,videoContainer:mn,loadingOverlay:hn,loadingDots:vn,dot:_n,bounce:gn,bufferingOverlay:yn,bufferingSpinner:bn,spin:wn,videoIframe:Sn,videoElementHidden:Cn,upscalerCanvas:kn,upscalerActive:En,upscalerStatusBadge:Ln,subtitleOverlay:Tn,controlsOverlay:xn,hidden:Bn,centerPlayPause:Nn,bottomControls:In,progressBarContainer:Pn,progressBar:Mn,scrubbing:An,watchedBar:$n,bufferedBar:Fn,thumb:Rn,timeBubble:Dn,skipSegment:On,op:qn,ed:Hn,recap:Vn,bottomControlsRow:Wn,controlBtn:Un,timeDisplay:zn,leftControls:Kn,rightControls:Gn,middleControls:Xn,skipControls:Jn,skipBtn:Qn,volumeContainer:jn,volumeSlider:Yn,settingsMenu:Zn,slideUp:er,qualityListInMenu:tr,ccOptionsContainer:nr,qualityItemInMenu:rr,ccItem:or,active:sr,sourceLoader:ar,spinner:cr,watchBtn:ir,errorOverlay:lr,retryButton:ur,sourceSelectionContainer:dr,slideUpIn:pr,providerSelectContainer:fr,providerSelect:mr,sourceSelect:hr,sourceButtons:vr,sourceButton:_r,detailsBox:gr,detailsToggleBtn:yr,detailsGridContainer:br,fadeIn:wr,detailItem:Sr,animeStatus:Cr,genresList:kr,genreTag:Er,loadingDetails:Lr,descriptionSection:Tr,description:xr,epJumpControls:Br,epRangeButtons:Nr,metaTags:Ir,epRangeBtn:Pr,epJumpInputGroup:Mr,fullscreenActive:Ar,errorSubtext:$r},Fr="_playerPageLayout_6lomc_1",Rr="_episodeSidebar_6lomc_15",Dr="_playerMain_6lomc_28",Or="_videoPlayerWrapper_6lomc_36",qr="_playerInfoHeader_6lomc_52",Hr="_playerAnimeCard_6lomc_58",Vr="_playerInfoContainer_6lomc_70",Wr="_videoTitleSection_6lomc_94",Ur="_theaterMode_6lomc_276",zr="_theaterAmbient_6lomc_310",Kr={playerPageLayout:Fr,episodeSidebar:Rr,playerMain:Dr,videoPlayerWrapper:Or,playerInfoHeader:qr,playerAnimeCard:Hr,playerInfoContainer:Vr,videoTitleSection:Wr,theaterMode:Ur,theaterAmbient:zr},Gr="_shell_41rxp_1",Xr="_stage_41rxp_37",Jr="_shellFill_41rxp_85",Qr="_shellFullscreen_41rxp_93",jr="_uiLayer_41rxp_107",Yr="_volumeWrap_41rxp_118",Zr="_volumeSlider_41rxp_124",ae={shell:Gr,stage:Xr,shellFill:Jr,shellFullscreen:Qr,uiLayer:jr,volumeWrap:Yr,volumeSlider:Zr},eo=.8,to=5,ws=2e3,Ze="autoplayEnabled",no=(e,n)=>n>0&&e>=n*eo,Ss=(e,n)=>e>to&&!no(e,n),Cs=()=>{try{return localStorage.getItem(Ze)==="true"}catch{return!1}},ks=e=>{try{localStorage.setItem(Ze,String(e))}catch{}},ro=["finished","completed","complete","ended"],Es=(e,n,t)=>e.length>0&&!!n&&e[e.length-1]===n&&ro.some(s=>String(t||"").trim().toLowerCase().includes(s)),Ls=e=>e.seekInduced?"none":e.autoplayEnabled&&e.hasNext?"advance":e.hasNext?"prompt-next":e.isFinal?"prompt-complete":"none",oo=e=>(e.language??e.lang??"").toLowerCase(),so=e=>(e.label??"").toLowerCase(),ao=e=>`${e.language??e.lang??""}|||${e.label??""}`,co=e=>oo(e).startsWith("en")||so(e).includes("english");function Ts(e,n){if(e.length===0||n?.enabled===!1)return-1;const t=n?.lastKey??null;if(t){const o=e.findIndex(i=>ao(i)===t);if(o>=0)return o}const s=e.findIndex(co);return s>=0?s:0}const Z={fontSize:1.8,position:0,bgOpacity:.5,bgColor:"#000000",textColor:"#ffffff",edge:"shadow",bold:!1},Be=(e,n,t)=>Math.max(n,Math.min(t,e)),Ne=e=>typeof e=="string"&&/^#[0-9a-fA-F]{6}$/.test(e),ke=(e,n,t,s)=>{try{const o=localStorage.getItem(e);if(o===null)return n;const i=parseFloat(o);return Number.isFinite(i)?Be(i,t,s):n}catch{return n}};function io(){let e=Z.edge,n=Z.bgColor,t=Z.textColor,s=Z.bold;try{const o=localStorage.getItem("subtitleEdge");(o==="shadow"||o==="outline"||o==="none")&&(e=o);const i=localStorage.getItem("subtitleBgColor");Ne(i)&&(n=i);const p=localStorage.getItem("subtitleTextColor");Ne(p)&&(t=p);const _=localStorage.getItem("subtitleBold");_!==null&&(s=_==="true")}catch{}return{fontSize:ke("subtitleFontSize",Z.fontSize,.5,10),position:ke("subtitlePosition",Z.position,0,100),bgOpacity:ke("subtitleBgOpacity",Z.bgOpacity,0,1),bgColor:n,textColor:t,edge:e,bold:s}}function et(e,n){const t=`rgba(0, 0, 0, ${Be(n,0,1)})`;if(!Ne(e))return t;const s=parseInt(e.slice(1,3),16),o=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16);return`rgba(${s}, ${o}, ${i}, ${Be(n,0,1)})`}function tt(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 xs(e){return`
1
+ import{u as r,A as b,d as C,h as A,q as B,T as pe,$ as At}from"./vendor-core-DfaOB3Rn.js";import{B as re,M as $t,S as ye,h as Ft,R as Rt,t as Je,O as Dt,g as Ot}from"./index-BGCpLf49.js";import{I as Q}from"./vendor-icons-DrybRNxP.js";import{u as qt}from"./vendor-query-BBT5_sHx.js";const Ht="_controls_ov6ol_1",Vt="_titleContainer_ov6ol_9",Wt="_scheduleInfo_ov6ol_15",Ut="_status_ov6ol_23",zt="_nextEpisode_ov6ol_35",Kt="_watchlistBtn_ov6ol_45",Gt="_inList_ov6ol_72",Xt="_queueBtn_ov6ol_83",Jt="_queueActive_ov6ol_95",Qt="_modeToggleBtn_ov6ol_101",jt="_modeToggleActive_ov6ol_108",Yt="_nativeToggleBtn_ov6ol_119",Zt="_nativeToggleActive_ov6ol_132",en="_markWatchedBtn_ov6ol_153",tn="_markWatchedDone_ov6ol_167",nn="_completeSeriesBtn_ov6ol_178",rn="_providerAndEpisodeRow_ov6ol_192",on="_episodeActions_ov6ol_199",sn="_desktopEpisodeActions_ov6ol_206",an="_mobileEpisodeActions_ov6ol_213",cn="_episodeNavBtn_ov6ol_217",ln="_primary_ov6ol_247",un="_secondary_ov6ol_257",dn="_episodePickerBtn_ov6ol_261",pn="_queueCountdown_ov6ol_265",fn="_speedBoostBadge_ov6ol_280",mn="_videoContainer_ov6ol_311",hn="_loadingOverlay_ov6ol_324",vn="_loadingDots_ov6ol_338",_n="_dot_ov6ol_343",gn="_bounce_ov6ol_1",yn="_bufferingOverlay_ov6ol_372",bn="_bufferingSpinner_ov6ol_381",wn="_spin_ov6ol_921",Sn="_videoIframe_ov6ol_396",Cn="_videoElementHidden_ov6ol_419",kn="_upscalerCanvas_ov6ol_424",En="_upscalerActive_ov6ol_437",Ln="_upscalerStatusBadge_ov6ol_441",Tn="_subtitleOverlay_ov6ol_456",xn="_controlsOverlay_ov6ol_468",Bn="_hidden_ov6ol_498",Nn="_centerPlayPause_ov6ol_504",In="_bottomControls_ov6ol_536",Pn="_progressBarContainer_ov6ol_553",Mn="_progressBar_ov6ol_553",An="_scrubbing_ov6ol_576",$n="_watchedBar_ov6ol_581",Fn="_bufferedBar_ov6ol_582",Rn="_thumb_ov6ol_604",Dn="_timeBubble_ov6ol_625",On="_skipSegment_ov6ol_648",qn="_op_ov6ol_662",Hn="_ed_ov6ol_666",Vn="_recap_ov6ol_670",Wn="_bottomControlsRow_ov6ol_674",Un="_controlBtn_ov6ol_682",zn="_timeDisplay_ov6ol_706",Kn="_leftControls_ov6ol_715",Gn="_rightControls_ov6ol_716",Xn="_middleControls_ov6ol_717",Jn="_skipControls_ov6ol_723",Qn="_skipBtn_ov6ol_729",jn="_volumeContainer_ov6ol_753",Yn="_volumeSlider_ov6ol_760",Zn="_settingsMenu_ov6ol_838",er="_slideUp_ov6ol_1",tr="_qualityListInMenu_ov6ol_877",nr="_ccOptionsContainer_ov6ol_878",rr="_qualityItemInMenu_ov6ol_886",or="_ccItem_ov6ol_887",sr="_active_ov6ol_908",ar="_sourceLoader_ov6ol_915",cr="_spinner_ov6ol_921",ir="_watchBtn_ov6ol_980",lr="_errorOverlay_ov6ol_1026",ur="_retryButton_ov6ol_1036",dr="_sourceSelectionContainer_ov6ol_1064",pr="_slideUpIn_ov6ol_1",fr="_providerSelectContainer_ov6ol_1079",mr="_providerSelect_ov6ol_1079",hr="_sourceSelect_ov6ol_1064",vr="_sourceButtons_ov6ol_1135",_r="_sourceButton_ov6ol_1135",gr="_detailsBox_ov6ol_1167",yr="_detailsToggleBtn_ov6ol_1180",br="_detailsGridContainer_ov6ol_1204",wr="_fadeIn_ov6ol_1",Sr="_detailItem_ov6ol_1216",Cr="_animeStatus_ov6ol_1236",kr="_genresList_ov6ol_1249",Er="_genreTag_ov6ol_1256",Lr="_loadingDetails_ov6ol_1274",Tr="_descriptionSection_ov6ol_1281",xr="_description_ov6ol_1281",Br="_epJumpControls_ov6ol_1317",Nr="_epRangeButtons_ov6ol_1328",Ir="_metaTags_ov6ol_1334",Pr="_epRangeBtn_ov6ol_1341",Mr="_epJumpInputGroup_ov6ol_1356",Ar="_fullscreenActive_ov6ol_1388",$r="_errorSubtext_ov6ol_1432",bs={controls:Ht,titleContainer:Vt,scheduleInfo:Wt,status:Ut,nextEpisode:zt,watchlistBtn:Kt,inList:Gt,queueBtn:Xt,queueActive:Jt,modeToggleBtn:Qt,modeToggleActive:jt,nativeToggleBtn:Yt,nativeToggleActive:Zt,markWatchedBtn:en,markWatchedDone:tn,completeSeriesBtn:nn,providerAndEpisodeRow:rn,episodeActions:on,desktopEpisodeActions:sn,mobileEpisodeActions:an,episodeNavBtn:cn,primary:ln,secondary:un,episodePickerBtn:dn,queueCountdown:pn,speedBoostBadge:fn,videoContainer:mn,loadingOverlay:hn,loadingDots:vn,dot:_n,bounce:gn,bufferingOverlay:yn,bufferingSpinner:bn,spin:wn,videoIframe:Sn,videoElementHidden:Cn,upscalerCanvas:kn,upscalerActive:En,upscalerStatusBadge:Ln,subtitleOverlay:Tn,controlsOverlay:xn,hidden:Bn,centerPlayPause:Nn,bottomControls:In,progressBarContainer:Pn,progressBar:Mn,scrubbing:An,watchedBar:$n,bufferedBar:Fn,thumb:Rn,timeBubble:Dn,skipSegment:On,op:qn,ed:Hn,recap:Vn,bottomControlsRow:Wn,controlBtn:Un,timeDisplay:zn,leftControls:Kn,rightControls:Gn,middleControls:Xn,skipControls:Jn,skipBtn:Qn,volumeContainer:jn,volumeSlider:Yn,settingsMenu:Zn,slideUp:er,qualityListInMenu:tr,ccOptionsContainer:nr,qualityItemInMenu:rr,ccItem:or,active:sr,sourceLoader:ar,spinner:cr,watchBtn:ir,errorOverlay:lr,retryButton:ur,sourceSelectionContainer:dr,slideUpIn:pr,providerSelectContainer:fr,providerSelect:mr,sourceSelect:hr,sourceButtons:vr,sourceButton:_r,detailsBox:gr,detailsToggleBtn:yr,detailsGridContainer:br,fadeIn:wr,detailItem:Sr,animeStatus:Cr,genresList:kr,genreTag:Er,loadingDetails:Lr,descriptionSection:Tr,description:xr,epJumpControls:Br,epRangeButtons:Nr,metaTags:Ir,epRangeBtn:Pr,epJumpInputGroup:Mr,fullscreenActive:Ar,errorSubtext:$r},Fr="_playerPageLayout_6lomc_1",Rr="_episodeSidebar_6lomc_15",Dr="_playerMain_6lomc_28",Or="_videoPlayerWrapper_6lomc_36",qr="_playerInfoHeader_6lomc_52",Hr="_playerAnimeCard_6lomc_58",Vr="_playerInfoContainer_6lomc_70",Wr="_videoTitleSection_6lomc_94",Ur="_theaterMode_6lomc_276",zr="_theaterAmbient_6lomc_310",Kr={playerPageLayout:Fr,episodeSidebar:Rr,playerMain:Dr,videoPlayerWrapper:Or,playerInfoHeader:qr,playerAnimeCard:Hr,playerInfoContainer:Vr,videoTitleSection:Wr,theaterMode:Ur,theaterAmbient:zr},Gr="_shell_41rxp_1",Xr="_stage_41rxp_37",Jr="_shellFill_41rxp_85",Qr="_shellFullscreen_41rxp_93",jr="_uiLayer_41rxp_107",Yr="_volumeWrap_41rxp_118",Zr="_volumeSlider_41rxp_124",ae={shell:Gr,stage:Xr,shellFill:Jr,shellFullscreen:Qr,uiLayer:jr,volumeWrap:Yr,volumeSlider:Zr},eo=.8,to=5,ws=2e3,Ze="autoplayEnabled",no=(e,n)=>n>0&&e>=n*eo,Ss=(e,n)=>e>to&&!no(e,n),Cs=()=>{try{return localStorage.getItem(Ze)==="true"}catch{return!1}},ks=e=>{try{localStorage.setItem(Ze,String(e))}catch{}},ro=["finished","completed","complete","ended"],Es=(e,n,t)=>e.length>0&&!!n&&e[e.length-1]===n&&ro.some(s=>String(t||"").trim().toLowerCase().includes(s)),Ls=e=>e.seekInduced?"none":e.autoplayEnabled&&e.hasNext?"advance":e.hasNext?"prompt-next":e.isFinal?"prompt-complete":"none",oo=e=>(e.language??e.lang??"").toLowerCase(),so=e=>(e.label??"").toLowerCase(),ao=e=>`${e.language??e.lang??""}|||${e.label??""}`,co=e=>oo(e).startsWith("en")||so(e).includes("english");function Ts(e,n){if(e.length===0||n?.enabled===!1)return-1;const t=n?.lastKey??null;if(t){const o=e.findIndex(i=>ao(i)===t);if(o>=0)return o}const s=e.findIndex(co);return s>=0?s:0}const Z={fontSize:1.8,position:0,bgOpacity:.5,bgColor:"#000000",textColor:"#ffffff",edge:"shadow",bold:!1},Be=(e,n,t)=>Math.max(n,Math.min(t,e)),Ne=e=>typeof e=="string"&&/^#[0-9a-fA-F]{6}$/.test(e),ke=(e,n,t,s)=>{try{const o=localStorage.getItem(e);if(o===null)return n;const i=parseFloat(o);return Number.isFinite(i)?Be(i,t,s):n}catch{return n}};function io(){let e=Z.edge,n=Z.bgColor,t=Z.textColor,s=Z.bold;try{const o=localStorage.getItem("subtitleEdge");(o==="shadow"||o==="outline"||o==="none")&&(e=o);const i=localStorage.getItem("subtitleBgColor");Ne(i)&&(n=i);const p=localStorage.getItem("subtitleTextColor");Ne(p)&&(t=p);const _=localStorage.getItem("subtitleBold");_!==null&&(s=_==="true")}catch{}return{fontSize:ke("subtitleFontSize",Z.fontSize,.5,10),position:ke("subtitlePosition",Z.position,0,100),bgOpacity:ke("subtitleBgOpacity",Z.bgOpacity,0,1),bgColor:n,textColor:t,edge:e,bold:s}}function et(e,n){const t=`rgba(0, 0, 0, ${Be(n,0,1)})`;if(!Ne(e))return t;const s=parseInt(e.slice(1,3),16),o=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16);return`rgba(${s}, ${o}, ${i}, ${Be(n,0,1)})`}function tt(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 xs(e){return`
2
2
  video::cue {
3
3
  font-size: ${e.fontSize}rem !important;
4
4
  color: ${e.textColor} !important;