@serifpersia/dango 3.3.4 → 3.3.6

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 (62) hide show
  1. package/README.md +1 -1
  2. package/client/dist/assets/AnimeCard-OKU7LaSN.js +1 -0
  3. package/client/dist/assets/{AnimeInfo-0huPAq0O.js → AnimeInfo-BCyLw0yz.js} +1 -1
  4. package/client/dist/assets/{AnimeInfoPage-Dqr5QH6R.js → AnimeInfoPage-BZWl-TJY.js} +2 -2
  5. package/client/dist/assets/{Asmr-B6ZiqkmU.js → Asmr-4S6uoevp.js} +1 -1
  6. package/client/dist/assets/{AsmrResetProgressModal-Cqsoo3XC.js → AsmrResetProgressModal-C8i6weqW.js} +1 -1
  7. package/client/dist/assets/{AvSyncCalibrator-C1_iBSyL.css → AvSyncCalibrator-BPa6KaGC.css} +1 -1
  8. package/client/dist/assets/AvSyncCalibrator-oK6LlG61.js +10 -0
  9. package/client/dist/assets/Home-CQ4Ikeja.js +1 -0
  10. package/client/dist/assets/{Insights-ZlgPrzGD.js → Insights-DiAo0UAc.js} +1 -1
  11. package/client/dist/assets/{LibraryListPage-CCiee-Ot.js → LibraryListPage-B0MDTnEc.js} +1 -1
  12. package/client/dist/assets/{ListeningList-ctAz_6Zi.js → ListeningList-Dxkhy6E2.js} +1 -1
  13. package/client/dist/assets/{Manga-BI9WMTx5.js → Manga-pJEpcUpo.js} +1 -1
  14. package/client/dist/assets/{MangaInfoPage-DcrEr7Sk.js → MangaInfoPage-BEQsjTHH.js} +1 -1
  15. package/client/dist/assets/{MangaReadPage-SYg63m48.js → MangaReadPage-C0WAtK-1.js} +1 -1
  16. package/client/dist/assets/{MangaResetProgressModal-DX-1PS4h.js → MangaResetProgressModal-WjKH_G_f.js} +1 -1
  17. package/client/dist/assets/{Mature-Dqh_9SA3.js → Mature-Ckx99wFj.js} +1 -1
  18. package/client/dist/assets/{MediaCard-Be1ST9oj.js → MediaCard-DszKDA4s.js} +1 -1
  19. package/client/dist/assets/{Music-zsPwT8_5.js → Music-CU6TBHF5.js} +1 -1
  20. package/client/dist/assets/{OptionListMenu-Drc_vybW.js → OptionListMenu-CkK2BvEz.js} +1 -1
  21. package/client/dist/assets/Player-C3yWQkXb.js +56 -0
  22. package/client/dist/assets/{PlayerSettings-Cwoji-P7.js → PlayerSettings-CBdTzo0E.js} +1 -1
  23. package/client/dist/assets/{QueueOptionsButton-B6BMq66e.js → QueueOptionsButton-DKWi-9kd.js} +1 -1
  24. package/client/dist/assets/{QueueRail-VxpUDBSm.js → QueueRail-DAcIex5B.js} +1 -1
  25. package/client/dist/assets/{Radio-B2Q_Egj7.js → Radio-BhTsgGGd.js} +1 -1
  26. package/client/dist/assets/{ReadingList-O0QPwXu7.js → ReadingList-BLnkwB--.js} +1 -1
  27. package/client/dist/assets/{ResetProgressModal-CR_ovLAu.js → ResetProgressModal-8mcLXaAb.js} +1 -1
  28. package/client/dist/assets/{Search-C8e2nlDD.js → Search-DxX021dj.js} +1 -1
  29. package/client/dist/assets/{Settings-BgPWBl2V.js → Settings-bSA7BG7h.js} +1 -1
  30. package/client/dist/assets/{SkeletonGrid-CtHKKMLj.js → SkeletonGrid-Du10CNfq.js} +1 -1
  31. package/client/dist/assets/{Trackers-Bfoiyuzy.js → Trackers-BXSONaRD.js} +1 -1
  32. package/client/dist/assets/Tv-C2SWcVzN.css +1 -0
  33. package/client/dist/assets/Tv-DJTbg4VW.js +4 -0
  34. package/client/dist/assets/{TvInfo-D_scgw_h.js → TvInfo-Z0c1Wh3i.js} +1 -1
  35. package/client/dist/assets/{TvPopup-YTI7dEbJ.js → TvPopup-CP41CncZ.js} +1 -1
  36. package/client/dist/assets/{TvSearch-CxU33UOf.js → TvSearch-BlqTQYJa.js} +1 -1
  37. package/client/dist/assets/TvWatchlist-COCWPkgh.js +1 -0
  38. package/client/dist/assets/{Watchlist-P6YMZUdF.js → Watchlist-BHLshSPX.js} +1 -1
  39. package/client/dist/assets/{hls-C4cG9wQw.js → hls-B_yo8-yR.js} +1 -1
  40. package/client/dist/assets/index-lo-bz7f2.js +178 -0
  41. package/client/dist/assets/{useAnimeInfoData-DeuwDSnI.js → useAnimeInfoData-CbNnHRj8.js} +1 -1
  42. package/client/dist/assets/{useAsmr-CbMVRjmV.js → useAsmr-BEcgHwxg.js} +1 -1
  43. package/client/dist/assets/{useAsmrPopup-D91Q3CBg.js → useAsmrPopup-BXD3y2m1.js} +1 -1
  44. package/client/dist/assets/{useMangaLibrary-BPvFb1lU.js → useMangaLibrary-BXhgN-dl.js} +1 -1
  45. package/client/dist/assets/{useMangaPopup-BOL2mQJs.js → useMangaPopup-BvgtZ53s.js} +1 -1
  46. package/client/dist/assets/{useProviders-BsRGONMA.js → useProviders-xlftutIo.js} +1 -1
  47. package/client/dist/assets/{useTv-D37MfTHA.js → useTv-DTqrJEWp.js} +1 -1
  48. package/client/dist/assets/{useTvLibrary-Cwxgy_Bg.js → useTvLibrary-BHeWSd1F.js} +1 -1
  49. package/client/dist/index.html +1 -1
  50. package/package.json +2 -2
  51. package/server/dist/controllers/tv-library.controller.js +9 -5
  52. package/server/dist/repositories/tv.repository.js +10 -8
  53. package/server/dist/sync.js +19 -1
  54. package/server/package.json +1 -1
  55. package/client/dist/assets/AnimeCard-B5A20jAI.js +0 -1
  56. package/client/dist/assets/AvSyncCalibrator-C8ZoIwMY.js +0 -10
  57. package/client/dist/assets/Home-thJhPfs1.js +0 -1
  58. package/client/dist/assets/Player-BEtAYps2.js +0 -56
  59. package/client/dist/assets/Tv-Ca0fCdko.js +0 -3
  60. package/client/dist/assets/Tv-CuEl3Iol.css +0 -1
  61. package/client/dist/assets/TvWatchlist-B4X1fWEH.js +0 -1
  62. package/client/dist/assets/index-IZgh1beL.js +0 -178
@@ -1,178 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Home-thJhPfs1.js","assets/vendor-core-8R2fFbyN.js","assets/vendor-query-BXRECSI6.js","assets/vendor-icons-CDMuNDeL.js","assets/AnimeCard-B5A20jAI.js","assets/useAnimeInfoData-DeuwDSnI.js","assets/QueueOptionsButton-B6BMq66e.js","assets/vendor-ui-CUDCvRS_.js","assets/QueueOptionsButton-CM15uQn8.css","assets/MediaCard-Be1ST9oj.js","assets/useIsMobile-Dm_b6Ob3.js","assets/MediaCard-DB6Yjgky.css","assets/SkeletonGrid-CtHKKMLj.js","assets/SkeletonGrid-DhPYefXr.css","assets/ErrorMessage-z4f4WGgP.js","assets/ErrorMessage-CXoRbrLN.css","assets/ResetProgressModal-CR_ovLAu.js","assets/QueueRail-VxpUDBSm.js","assets/QueueRail-BUYEjdaq.css","assets/useMangaPopup-BOL2mQJs.js","assets/useMangaLibrary-BPvFb1lU.js","assets/MangaResetProgressModal-DX-1PS4h.js","assets/useProviders-BsRGONMA.js","assets/useMatureConsent-CT7-KfzG.js","assets/useTv-D37MfTHA.js","assets/TvPopup-YTI7dEbJ.js","assets/useTvLibrary-Cwxgy_Bg.js","assets/AsmrResetProgressModal-Cqsoo3XC.js","assets/useAsmr-CbMVRjmV.js","assets/Home-DtRtTuI9.css","assets/Watchlist-P6YMZUdF.js","assets/Watchlist.module-XGtVQr1d.js","assets/Watchlist-BiDEU0iV.css","assets/Settings-BgPWBl2V.js","assets/Settings-AuFxQcJF.css","assets/Player-BEtAYps2.js","assets/AvSyncCalibrator-C8ZoIwMY.js","assets/AvSyncCalibrator-C1_iBSyL.css","assets/hls-C4cG9wQw.js","assets/AnimeMetaDetails-BPvv5xIl.js","assets/AnimeMetaDetails-BwNQnRCd.css","assets/SynopsisText-BcpwT5iw.js","assets/SynopsisText-CYv2W3yR.css","assets/Player-B036Ic3m.css","assets/Search-C8e2nlDD.js","assets/Search.module-CMEai-B-.js","assets/Search-Cs45oAwI.css","assets/Mature-Dqh_9SA3.js","assets/Mature-DJmUUtlF.css","assets/Asmr-B6ZiqkmU.js","assets/Asmr.module-ChUXDZKx.js","assets/Asmr-Cq2ua6Zk.css","assets/useAsmrPopup-D91Q3CBg.js","assets/Manga-BI9WMTx5.js","assets/Manga.module-BcfOdsNP.js","assets/Manga-Dp_-l1Pw.css","assets/MangaInfoPage-DcrEr7Sk.js","assets/MangaReadPage-SYg63m48.js","assets/ReadingList-O0QPwXu7.js","assets/LibraryListPage-CCiee-Ot.js","assets/Radio-B2Q_Egj7.js","assets/Radio.module-DGSZLpKM.js","assets/Radio-CCHNFN7R.css","assets/Music-zsPwT8_5.js","assets/Music-BGH_0voi.css","assets/TvSearch-CxU33UOf.js","assets/TvInfo-D_scgw_h.js","assets/TvInfo-Bu36xJyO.css","assets/Tv-Ca0fCdko.js","assets/OptionListMenu-Drc_vybW.js","assets/Tv-CuEl3Iol.css","assets/TvWatchlist-B4X1fWEH.js","assets/ListeningList-ctAz_6Zi.js","assets/Trackers-Bfoiyuzy.js","assets/Trackers-D5XBOCDp.css","assets/Insights-ZlgPrzGD.js","assets/Insights-DKtoVe6L.css","assets/Map-Dj51g5zL.js","assets/Map-CXFqXmsZ.css","assets/AnimeInfoPage-Dqr5QH6R.js","assets/PlayerRedirect-D70t8VUW.js","assets/VirtualKeyboard-6ZNTym4R.js","assets/VirtualKeyboard-KIPc5ZGH.css"])))=>i.map(i=>d[i]);
2
- import{N as Tt,k as D,A as q,q as R,h as _,S as F,d as v,X as te,x as ne,g as Te,u as t,L as K,$ as Ze,a as Xe,c as Ee,e as Et,f as Ct,D as $t,P as De,i as Pt,j as S,l as Re,z as I,T as le,m as Lt,B as At}from"./vendor-core-8R2fFbyN.js";import{u as O,a as j,b as M,c as Ce,Q as Ot,d as Dt}from"./vendor-query-BXRECSI6.js";import{I as g}from"./vendor-icons-CDMuNDeL.js";(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).observe(document,{childList:!0,subtree:!0});function r(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(o){if(o.ep)return;o.ep=!0;const a=r(o);fetch(o.href,a)}})();const Rt="modulepreload",qt=function(e){return"/"+e},qe={},x=function(n,r,s){let o=Promise.resolve();if(r&&r.length>0){let d=function(u){return Promise.all(u.map(l=>Promise.resolve(l).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),c=i?.nonce||i?.getAttribute("nonce");o=d(r.map(u=>{if(u=qt(u),u in qe)return;qe[u]=!0;const l=u.endsWith(".css"),m=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${m}`))return;const h=document.createElement("link");if(h.rel=l?"stylesheet":Rt,l||(h.as="script"),h.crossOrigin="",h.href=u,c&&h.setAttribute("nonce",c),document.head.appendChild(h),l)return new Promise((b,P)=>{h.addEventListener("load",b),h.addEventListener("error",()=>P(new Error(`Unable to preload CSS for ${u}`)))})}))}function a(i){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=i,window.dispatchEvent(c),!c.defaultPrevented)throw i}return o.then(i=>{for(const c of i||[])c.status==="rejected"&&a(c.reason);return n().catch(a)})};let Mt={data:""},Bt=e=>{if(typeof window=="object"){let n=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return n.nonce=window.__nonce__,n.parentNode||(e||document.head).appendChild(n),n.firstChild}return e||Mt},Ft=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Kt=/\/\*[^]*?\*\/| +/g,Me=/\n+/g,X=(e,n)=>{let r="",s="",o="";for(let a in e){let i=e[a];a[0]=="@"?a[1]=="i"?r=a+" "+i+";":s+=a[1]=="f"?X(i,a):a+"{"+X(i,a[1]=="k"?"":n)+"}":typeof i=="object"?s+=X(i,n?n.replace(/([^,])+/g,c=>a.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,d=>/&/.test(d)?d.replace(/&/g,c):c?c+" "+d:d)):a):i!=null&&(a=a[1]=="-"?a:a.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=X.p?X.p(a,i):a+":"+i+";")}return r+(n&&o?n+"{"+o+"}":o)+s},Z={},et=e=>{if(typeof e=="object"){let n="";for(let r in e)n+=r+et(e[r]);return n}return e},jt=(e,n,r,s,o)=>{let a=et(e),i=Z[a]||(Z[a]=(d=>{let u=0,l=11;for(;u<d.length;)l=101*l+d.charCodeAt(u++)>>>0;return"go"+l})(a));if(!Z[i]){let d=a!==e?e:(u=>{let l,m,h=[{}];for(;l=Ft.exec(u.replace(Kt,""));)l[4]?h.shift():l[3]?(m=l[3].replace(Me," ").trim(),h.unshift(h[0][m]=h[0][m]||{})):h[0][l[1]]=l[2].replace(Me," ").trim();return h[0]})(e);Z[i]=X(o?{["@keyframes "+i]:d}:d,r?"":"."+i)}let c=r&&Z.g;return r&&(Z.g=Z[i]),((d,u,l,m)=>{m?u.data=u.data.replace(m,d):u.data.indexOf(d)===-1&&(u.data=l?d+u.data:u.data+d)})(Z[i],n,s,c),i},zt=(e,n,r)=>e.reduce((s,o,a)=>{let i=n[a];if(i&&i.call){let c=i(r),d=c&&c.props&&c.props.className||/^go/.test(c)&&c;i=d?"."+d:c&&typeof c=="object"?c.props?"":X(c,""):c===!1?"":c}return s+o+(i??"")},"");function ve(e){let n=this||{},r=e.call?e(n.p):e;return jt(r.unshift?r.raw?zt(r,[].slice.call(arguments,1),n.p):r.reduce((s,o)=>Object.assign(s,o&&o.call?o(n.p):o),{}):r,Bt(n.target),n.g,n.o,n.k)}let tt,ke,Ne;ve.bind({g:1});let J=ve.bind({k:1});function Wt(e,n,r,s){X.p=n,tt=e,ke=r,Ne=s}function ee(e,n){let r=this||{};return function(){let s=arguments;function o(a,i){let c=Object.assign({},a),d=c.className||o.className;r.p=Object.assign({theme:ke&&ke()},c),r.o=/go\d/.test(d),c.className=ve.apply(r,s)+(d?" "+d:"");let u=e;return e[0]&&(u=c.as||e,delete c.as),Ne&&u[0]&&Ne(c),tt(u,c)}return o}}var Ut=e=>typeof e=="function",ge=(e,n)=>Ut(e)?e(n):e,Vt=(()=>{let e=0;return()=>(++e).toString()})(),nt=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let n=matchMedia("(prefers-reduced-motion: reduce)");e=!n||n.matches}return e}})(),Qt=20,$e="default",rt=(e,n)=>{let{toastLimit:r}=e.settings;switch(n.type){case 0:return{...e,toasts:[n.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(i=>i.id===n.toast.id?{...i,...n.toast}:i)};case 2:let{toast:s}=n;return rt(e,{type:e.toasts.find(i=>i.id===s.id)?1:0,toast:s});case 3:let{toastId:o}=n;return{...e,toasts:e.toasts.map(i=>i.id===o||o===void 0?{...i,dismissed:!0,visible:!1}:i)};case 4:return n.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(i=>i.id!==n.toastId)};case 5:return{...e,pausedAt:n.time};case 6:let a=n.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(i=>({...i,pauseDuration:i.pauseDuration+a}))}}},pe=[],st={toasts:[],pausedAt:void 0,settings:{toastLimit:Qt}},V={},ot=(e,n=$e)=>{V[n]=rt(V[n]||st,e),pe.forEach(([r,s])=>{r===n&&s(V[n])})},at=e=>Object.keys(V).forEach(n=>ot(e,n)),Ht=e=>Object.keys(V).find(n=>V[n].toasts.some(r=>r.id===e)),ye=(e=$e)=>n=>{ot(n,e)},Jt={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},Yt=(e={},n=$e)=>{let[r,s]=v(V[n]||st),o=q(V[n]);_(()=>(o.current!==V[n]&&s(V[n]),pe.push([n,s]),()=>{let i=pe.findIndex(([c])=>c===n);i>-1&&pe.splice(i,1)}),[n]);let a=r.toasts.map(i=>{var c,d,u;return{...e,...e[i.type],...i,removeDelay:i.removeDelay||((c=e[i.type])==null?void 0:c.removeDelay)||e?.removeDelay,duration:i.duration||((d=e[i.type])==null?void 0:d.duration)||e?.duration||Jt[i.type],style:{...e.style,...(u=e[i.type])==null?void 0:u.style,...i.style}}});return{...r,toasts:a}},Gt=(e,n="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:n,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:r?.id||Vt()}),de=e=>(n,r)=>{let s=Gt(n,e,r);return ye(s.toasterId||Ht(s.id))({type:2,toast:s}),s.id},$=(e,n)=>de("blank")(e,n);$.error=de("error");$.success=de("success");$.loading=de("loading");$.custom=de("custom");$.dismiss=(e,n)=>{let r={type:3,toastId:e};n?ye(n)(r):at(r)};$.dismissAll=e=>$.dismiss(void 0,e);$.remove=(e,n)=>{let r={type:4,toastId:e};n?ye(n)(r):at(r)};$.removeAll=e=>$.remove(void 0,e);$.promise=(e,n,r)=>{let s=$.loading(n.loading,{...r,...r?.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let a=n.success?ge(n.success,o):void 0;return a?$.success(a,{id:s,...r,...r?.success}):$.dismiss(s),o}).catch(o=>{let a=n.error?ge(n.error,o):void 0;a?$.error(a,{id:s,...r,...r?.error}):$.dismiss(s)}),e};var Zt=1e3,Xt=(e,n="default")=>{let{toasts:r,pausedAt:s}=Yt(e,n),o=q(new Map).current,a=R((m,h=Zt)=>{if(o.has(m))return;let b=setTimeout(()=>{o.delete(m),i({type:4,toastId:m})},h);o.set(m,b)},[]);_(()=>{if(s)return;let m=Date.now(),h=r.map(b=>{if(b.duration===1/0)return;let P=(b.duration||0)+b.pauseDuration-(m-b.createdAt);if(P<0){b.visible&&$.dismiss(b.id);return}return setTimeout(()=>$.dismiss(b.id,n),P)});return()=>{h.forEach(b=>b&&clearTimeout(b))}},[r,s,n]);let i=R(ye(n),[n]),c=R(()=>{i({type:5,time:Date.now()})},[i]),d=R((m,h)=>{i({type:1,toast:{id:m,height:h}})},[i]),u=R(()=>{s&&i({type:6,time:Date.now()})},[s,i]),l=R((m,h)=>{let{reverseOrder:b=!1,gutter:P=8,defaultPosition:z}=h||{},B=r.filter(w=>(w.position||z)===(m.position||z)&&w.height),Q=B.findIndex(w=>w.id===m.id),W=B.filter((w,C)=>C<Q&&w.visible).length;return B.filter(w=>w.visible).slice(...b?[W+1]:[0,W]).reduce((w,C)=>w+(C.height||0)+P,0)},[r]);return _(()=>{r.forEach(m=>{if(m.dismissed)a(m.id,m.removeDelay);else{let h=o.get(m.id);h&&(clearTimeout(h),o.delete(m.id))}})},[r,a]),{toasts:r,handlers:{updateHeight:d,startPause:c,endPause:u,calculateOffset:l}}},en=J`
3
- from {
4
- transform: scale(0) rotate(45deg);
5
- opacity: 0;
6
- }
7
- to {
8
- transform: scale(1) rotate(45deg);
9
- opacity: 1;
10
- }`,tn=J`
11
- from {
12
- transform: scale(0);
13
- opacity: 0;
14
- }
15
- to {
16
- transform: scale(1);
17
- opacity: 1;
18
- }`,nn=J`
19
- from {
20
- transform: scale(0) rotate(90deg);
21
- opacity: 0;
22
- }
23
- to {
24
- transform: scale(1) rotate(90deg);
25
- opacity: 1;
26
- }`,rn=ee("div")`
27
- width: 20px;
28
- opacity: 0;
29
- height: 20px;
30
- border-radius: 10px;
31
- background: ${e=>e.primary||"#ff4b4b"};
32
- position: relative;
33
- transform: rotate(45deg);
34
-
35
- animation: ${en} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
36
- forwards;
37
- animation-delay: 100ms;
38
-
39
- &:after,
40
- &:before {
41
- content: '';
42
- animation: ${tn} 0.15s ease-out forwards;
43
- animation-delay: 150ms;
44
- position: absolute;
45
- border-radius: 3px;
46
- opacity: 0;
47
- background: ${e=>e.secondary||"#fff"};
48
- bottom: 9px;
49
- left: 4px;
50
- height: 2px;
51
- width: 12px;
52
- }
53
-
54
- &:before {
55
- animation: ${nn} 0.15s ease-out forwards;
56
- animation-delay: 180ms;
57
- transform: rotate(90deg);
58
- }
59
- `,sn=J`
60
- from {
61
- transform: rotate(0deg);
62
- }
63
- to {
64
- transform: rotate(360deg);
65
- }
66
- `,on=ee("div")`
67
- width: 12px;
68
- height: 12px;
69
- box-sizing: border-box;
70
- border: 2px solid;
71
- border-radius: 100%;
72
- border-color: ${e=>e.secondary||"#e0e0e0"};
73
- border-right-color: ${e=>e.primary||"#616161"};
74
- animation: ${sn} 1s linear infinite;
75
- `,an=J`
76
- from {
77
- transform: scale(0) rotate(45deg);
78
- opacity: 0;
79
- }
80
- to {
81
- transform: scale(1) rotate(45deg);
82
- opacity: 1;
83
- }`,cn=J`
84
- 0% {
85
- height: 0;
86
- width: 0;
87
- opacity: 0;
88
- }
89
- 40% {
90
- height: 0;
91
- width: 6px;
92
- opacity: 1;
93
- }
94
- 100% {
95
- opacity: 1;
96
- height: 10px;
97
- }`,ln=ee("div")`
98
- width: 20px;
99
- opacity: 0;
100
- height: 20px;
101
- border-radius: 10px;
102
- background: ${e=>e.primary||"#61d345"};
103
- position: relative;
104
- transform: rotate(45deg);
105
-
106
- animation: ${an} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
107
- forwards;
108
- animation-delay: 100ms;
109
- &:after {
110
- content: '';
111
- box-sizing: border-box;
112
- animation: ${cn} 0.2s ease-out forwards;
113
- opacity: 0;
114
- animation-delay: 200ms;
115
- position: absolute;
116
- border-right: 2px solid;
117
- border-bottom: 2px solid;
118
- border-color: ${e=>e.secondary||"#fff"};
119
- bottom: 6px;
120
- left: 6px;
121
- height: 10px;
122
- width: 6px;
123
- }
124
- `,dn=ee("div")`
125
- position: absolute;
126
- `,un=ee("div")`
127
- position: relative;
128
- display: flex;
129
- justify-content: center;
130
- align-items: center;
131
- min-width: 20px;
132
- min-height: 20px;
133
- `,mn=J`
134
- from {
135
- transform: scale(0.6);
136
- opacity: 0.4;
137
- }
138
- to {
139
- transform: scale(1);
140
- opacity: 1;
141
- }`,hn=ee("div")`
142
- position: relative;
143
- transform: scale(0.6);
144
- opacity: 0.4;
145
- min-width: 20px;
146
- animation: ${mn} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
147
- forwards;
148
- `,pn=({toast:e})=>{let{icon:n,type:r,iconTheme:s}=e;return n!==void 0?typeof n=="string"?D(hn,null,n):n:r==="blank"?null:D(un,null,D(on,{...s}),r!=="loading"&&D(dn,null,r==="error"?D(rn,{...s}):D(ln,{...s})))},gn=e=>`
149
- 0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
150
- 100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
151
- `,fn=e=>`
152
- 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
153
- 100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
154
- `,vn="0%{opacity:0;} 100%{opacity:1;}",yn="0%{opacity:1;} 100%{opacity:0;}",_n=ee("div")`
155
- display: flex;
156
- align-items: center;
157
- background: #fff;
158
- color: #363636;
159
- line-height: 1.3;
160
- will-change: transform;
161
- box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
162
- max-width: 350px;
163
- pointer-events: auto;
164
- padding: 8px 10px;
165
- border-radius: 8px;
166
- `,bn=ee("div")`
167
- display: flex;
168
- justify-content: center;
169
- margin: 4px 10px;
170
- color: inherit;
171
- flex: 1 1 auto;
172
- white-space: pre-line;
173
- `,wn=(e,n)=>{let r=e.includes("top")?1:-1,[s,o]=nt()?[vn,yn]:[gn(r),fn(r)];return{animation:n?`${J(s)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${J(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Sn=Tt(({toast:e,position:n,style:r,children:s})=>{let o=e.height?wn(e.position||n||"top-center",e.visible):{opacity:0},a=D(pn,{toast:e}),i=D(bn,{...e.ariaProps},ge(e.message,e));return D(_n,{className:e.className,style:{...o,...r,...e.style}},typeof s=="function"?s({icon:a,message:i}):D(F,null,a,i))});Wt(D);var kn=({id:e,className:n,style:r,onHeightUpdate:s,children:o})=>{let a=R(i=>{if(i){let c=()=>{let d=i.getBoundingClientRect().height;s(e,d)};c(),new MutationObserver(c).observe(i,{subtree:!0,childList:!0,characterData:!0})}},[e,s]);return D("div",{ref:a,className:n,style:r},o)},Nn=(e,n)=>{let r=e.includes("top"),s=r?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:nt()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${n*(r?1:-1)}px)`,...s,...o}},In=ve`
174
- z-index: 9999;
175
- > * {
176
- pointer-events: auto;
177
- }
178
- `,me=16,xn=({reverseOrder:e,position:n="top-center",toastOptions:r,gutter:s,children:o,toasterId:a,containerStyle:i,containerClassName:c})=>{let{toasts:d,handlers:u}=Xt(r,a);return D("div",{"data-rht-toaster":a||"",style:{position:"fixed",zIndex:9999,top:me,left:me,right:me,bottom:me,pointerEvents:"none",...i},className:c,onMouseEnter:u.startPause,onMouseLeave:u.endPause},d.map(l=>{let m=l.position||n,h=u.calculateOffset(l,{reverseOrder:e,gutter:s,defaultPosition:n}),b=Nn(m,h);return D(kn,{id:l.id,key:l.id,onHeightUpdate:u.updateHeight,className:l.visible?In:"",style:b},l.type==="custom"?ge(l.message,l):o?o(l):D(Sn,{toast:l,position:m}))}))},f=$;const ce=new Map,Tn=500,En=(e,n,r)=>{if(!e||e.trim()==="")return"/placeholder.svg";if(e.includes("/api/image-proxy")){let i=e;if(n&&!i.includes("w=")){const c=i.includes("?")?"&":"?";i+=`${c}w=${n}`}if(r&&!i.includes("h=")){const c=i.includes("?")?"&":"?";i+=`${c}h=${r}`}return i}let s=e;s.includes("aln.youtube-anime.com")&&(s=s.replace(/https?:\/\/allanime\.day\/aln\.youtube-anime\.com/,"https://aln.youtube-anime.com"),s.includes("/images/mcovers")&&(s=s.replace("/images/mcovers","/mcovers")),s.includes("/images/images2")&&(s=s.replace("/images/images2","/images2"))),s.includes("allanime.day/s4.anilist.co")&&(s=s.replace(/https?:\/\/allanime\.day\/s4\.anilist\.co/,"https://s4.anilist.co")),s.includes("wp.youtube-anime.com/s4.anilist.co")&&(s=s.replace(/https?:\/\/wp\.youtube-anime\.com\/s4\.anilist\.co/,"https://s4.anilist.co"));const o=`${s}-${n}-${r}`;if(ce.has(o))return ce.get(o);let a;if(s.startsWith("https://s4.anilist.co"))a=s,n&&(a+=`${a.includes("?")?"&":"?"}w=${n}`),r&&(a+=`${a.includes("?")?"&":"?"}h=${r}`);else if(s.includes("animepahe")){a=`/api/image-proxy?url=${encodeURIComponent(s)}`;const i=localStorage.getItem("animepahe_cookie"),c=localStorage.getItem("animepahe_ua");i&&(a+=`&cookie=${encodeURIComponent(i)}`),c&&(a+=`&ua=${encodeURIComponent(c)}`)}else if(s.startsWith("http"))a=`/api/image-proxy?url=${encodeURIComponent(s)}`,n&&(a+=`&w=${n}`),r?a+=`&h=${r}`:n||(a+="&w=300");else{const c=`${s.startsWith("mcovers")||s.startsWith("images2")?"https://aln.youtube-anime.com":"https://aln.youtube-anime.com/images"}/${s}`;a=`/api/image-proxy?url=${encodeURIComponent(c)}`,n&&(a+=`&w=${n}`),r?a+=`&h=${r}`:n||(a+="&w=300")}return ce.size>Tn&&ce.clear(),ce.set(o,a),a},Na=e=>{if(isNaN(e)||e<=0)return"00:00";const n=new Date(e*1e3).toISOString().slice(11,19);return parseInt(n.slice(0,2),10)>0?n:n.slice(3)};function Ia(e){return e?e.replace(/<[^>]*>?/gm,"").replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").trim():""}function xa(e){return e==null?e:e>10?Number((e/10).toFixed(1)):e}const it=te(void 0),Cn=()=>{const e=ne(it);if(e===void 0)throw new Error("useTitlePreference must be used within a TitlePreferenceProvider");return e},Ie={lan:new Set,animepahe:new Set,jasmr:new Set};function be(e){for(const n of[...Ie[e]])try{n()}catch(r){console.error(`auth-bus listener failed (${e}):`,r)}}function ct(e,n){return Ie[e].add(n),()=>{Ie[e].delete(n)}}const $n=e=>new Promise(n=>setTimeout(n,e)),y=async(e,n)=>{const r={"Content-Type":"application/json"};if(e.startsWith("/")||typeof window<"u"&&e.startsWith(window.location.origin)){const a=localStorage.getItem("animepahe_ua"),i=localStorage.getItem("animepahe_cookie"),c=localStorage.getItem("jasmr_ua"),d=localStorage.getItem("jasmr_cookie");a&&(r["x-animepahe-ua"]=a),i&&(r["x-animepahe-cookie"]=i),c&&(r["x-jasmr-ua"]=c),d&&(r["x-jasmr-cookie"]=d)}let o=await fetch(e,{...n,headers:{...r,...n?.headers}});for(let a=0;o.status===503&&a<8;a++)await $n(Math.min(500*2**a,4e3)),o=await fetch(e,{...n,headers:{...r,...n?.headers}});if(!o.ok){const a=await o.text().catch(()=>"");let i={};try{i=JSON.parse(a)}catch{}const c=typeof i.error=="string"?i.error:"";throw o.status===403&&c==="AUTH_REQUIRED"&&i.provider==="animepahe"&&be("animepahe"),o.status===403&&c==="AUTH_REQUIRED"&&i.provider==="jasmr"&&be("jasmr"),o.status===401&&c==="LAN_AUTH_REQUIRED"&&be("lan"),new Error(c||`Failed to fetch from ${e}`)}return o.json()},Ta=()=>M({queryKey:["spotlight"],queryFn:()=>y("/api/spotlight"),staleTime:1e3*60*5,retry:1}),Ea=(e="TRENDING_DESC",n=10)=>Ce({queryKey:["trendingList",e,n],queryFn:({pageParam:r=1})=>y(`/api/popular-list?sort=${e}&page=${r}&size=${n}`),initialPageParam:1,getNextPageParam:(r,s)=>r.length>=n?s.length+1:void 0}),Ca=(e="TV",n=12)=>Ce({queryKey:["latestReleases",e,n],queryFn:({pageParam:r=1})=>y(`/api/latest-releases?format=${e}&page=${r}&size=${n}`),initialPageParam:1,getNextPageParam:(r,s)=>r.length>=n?s.length+1:void 0}),$a=(e,n="TV",r=!0)=>M({queryKey:["currentSeason",e,n],queryFn:()=>y(`/api/seasonal?page=${e}&format=${n}&size=14`),enabled:r,staleTime:1e3*60*5}),Pa=(e,n,r=14)=>M({queryKey:["searchAnime",e,n,r],queryFn:async()=>{const s=new URLSearchParams(e);return s.set("page",n.toString()),s.set("limit",r.toString()),y(`/api/search?${s.toString()}`)},enabled:e!=null}),La=()=>M({queryKey:["queue"],queryFn:()=>y("/api/queue")}),Pn=()=>{const e=O();return j({mutationFn:async n=>y("/api/queue/add",{method:"POST",body:JSON.stringify(n)}),onSuccess:n=>{n.queued?f.success("Added to queue"):f.success("Removed from queue"),e.invalidateQueries({queryKey:["queue"]}),e.invalidateQueries({queryKey:["queue-remaining"]})},onError:n=>{f.error(`Failed to update queue: ${n.message}`)}})},Aa=()=>{const e=O();return j({mutationFn:async n=>{await y("/api/queue/remove",{method:"POST",body:JSON.stringify(n)})},onSuccess:()=>{f.success("Removed from queue"),e.invalidateQueries({queryKey:["queue"]}),e.invalidateQueries({queryKey:["queue-remaining"]}),e.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{f.error(`Failed to remove: ${n.message}`)}})},Oa=(e,n=!0)=>M({queryKey:["queue-remaining",e],queryFn:()=>y(`/api/queue/remaining/${e}`),enabled:!!e&&n,staleTime:1e3*60}),Da=()=>{const e=O();return j({mutationFn:async({episodeNumbers:n,...r})=>y("/api/queue/batch",{method:"POST",body:JSON.stringify({...r,episodeNumbers:n})}),onSuccess:(n,r)=>{const s=n.added??r.episodeNumbers.length;f.success(`${s} ${s===1?"episode":"episodes"} added to queue`),e.invalidateQueries({queryKey:["queue"]}),e.invalidateQueries({queryKey:["queue-remaining"]})},onError:n=>{f.error(`Failed to update queue: ${n.message}`)}})},Ra=()=>{const e=O();return j({mutationFn:async({showId:n,episodeNumbers:r})=>{await y("/api/queue/remove-many",{method:"POST",body:JSON.stringify({showId:n,episodeNumbers:r})})},onSuccess:()=>{f.success("Removed from queue"),e.invalidateQueries({queryKey:["queue"]}),e.invalidateQueries({queryKey:["queue-remaining"]}),e.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{f.error(`Failed to remove: ${n.message}`)}})},qa=()=>{const e=O();return j({mutationFn:async()=>{await y("/api/queue/clear",{method:"POST"})},onSuccess:()=>{f.success("Queue cleared"),e.invalidateQueries({queryKey:["queue"]}),e.invalidateQueries({queryKey:["queue-remaining"]}),e.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{f.error(`Failed to clear queue: ${n.message}`)}})},Ma=()=>{const e=O();return j({mutationFn:async n=>{await y("/api/queue/reorder",{method:"POST",body:JSON.stringify({items:n})})},onMutate:async n=>{await e.cancelQueries({queryKey:["queue"]});const r=e.getQueryData(["queue"]);return e.setQueryData(["queue"],s=>{if(!s)return s;const o=new Map(s.map(a=>[a.id,a]));return n.map((a,i)=>{const c=o.get(a.id);return c?{...c,queue_order:i}:void 0}).filter(a=>!!a)}),{previousQueue:r}},onError:(n,r,s)=>{s?.previousQueue&&e.setQueryData(["queue"],s.previousQueue)},onSettled:()=>{e.invalidateQueries({queryKey:["queue"]})}})},Ba=(e,n="",r,s=14)=>M({queryKey:["watchlist",e,n,r,s],queryFn:async()=>{const o=new URLSearchParams(n);return o.set("status",e),o.set("page",String(r)),o.set("limit",String(s)),y(`/api/watchlist?${o.toString()}`)}}),Fa=(e="")=>Ce({queryKey:["allContinueWatching",e],queryFn:async({pageParam:n=1})=>{const r=new URLSearchParams(e);return r.set("page",String(n)),r.set("limit","14"),await y(`/api/continue-watching/all?${r.toString()}`)},initialPageParam:1,getNextPageParam:n=>{if(!(n.data.length===0||n.page*n.limit>=n.total))return n.page+1},select:n=>({...n,pages:n.pages.flatMap(r=>r.data)})}),Ka=(e="",n,r=14)=>M({queryKey:["allContinueWatching",e,n,r],queryFn:async()=>{const s=new URLSearchParams(e);return s.set("page",String(n)),s.set("limit",String(r)),y(`/api/continue-watching/all?${s.toString()}`)}}),ja=()=>{const e=O();return j({mutationFn:async n=>{await y("/api/watchlist/remove",{method:"POST",body:JSON.stringify({id:n})})},onSuccess:()=>{f.success("Removed from watchlist"),e.invalidateQueries({queryKey:["watchlist"]})},onError:n=>{f.error(`Failed to remove: ${n.message}`)}})},za=()=>{const e=O();return j({mutationFn:async({ids:n,status:r})=>y("/api/watchlist/batch-status",{method:"POST",body:JSON.stringify({ids:n,status:r})}),onSuccess:n=>{f.success(`Status updated for ${n.updated??0} items`),e.invalidateQueries({queryKey:["watchlist"]}),e.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{f.error(`Failed to update statuses: ${n.message}`)}})},Wa=()=>{const e=O();return j({mutationFn:async n=>y("/api/watchlist/remove-many",{method:"POST",body:JSON.stringify({ids:n})}),onSuccess:n=>{const r=n.removed??0;f.success(`Removed ${r} ${r===1?"item":"items"} from watchlist`),e.invalidateQueries({queryKey:["watchlist"]}),e.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{f.error(`Failed to remove: ${n.message}`)}})},Ua=()=>{const e=O();return j({mutationFn:async n=>y("/api/continue-watching/remove-many",{method:"POST",body:JSON.stringify({ids:n})}),onSuccess:n=>{const r=n.removed??0;f.success(`Removed ${r} ${r===1?"item":"items"} from continue watching`),e.invalidateQueries({queryKey:["allContinueWatching"]})},onError:n=>{f.error(`Failed to remove: ${n.message}`)}})},lt=(e=!0)=>M({queryKey:["notifications"],queryFn:()=>y("/api/notifications"),enabled:e,refetchInterval:3e4}),dt=(e=!0)=>M({queryKey:["system-notifications"],queryFn:()=>y("/api/system-notifications"),enabled:e,refetchInterval:3e4}),ut=(e=!0)=>M({queryKey:["discovery-status"],queryFn:()=>y("/api/discovery/status"),enabled:e,refetchInterval:n=>n.state.data?.running?2e3:!1}),Ln=()=>{const e=O();return j({mutationFn:async()=>y("/api/discovery/refresh",{method:"POST"}),onSuccess:n=>{e.setQueryData(["discovery-status"],{running:n.running,state:n.state,total:n.total,done:n.done,lastRunAt:n.lastRunAt}),e.invalidateQueries({queryKey:["notifications"]})},onError:()=>{e.invalidateQueries({queryKey:["discovery-status"]})}})},An=()=>{const e=O();return j({mutationFn:async({showId:n,episodeNumber:r})=>{await y("/api/notifications/dismiss",{method:"POST",body:JSON.stringify({showId:n,episodeNumber:r})})},onSuccess:()=>{e.invalidateQueries({queryKey:["notifications"]})}})},On=()=>{const e=O();return j({mutationFn:async n=>{await y("/api/notifications/clear-all",{method:"POST",body:JSON.stringify({showId:n})})},onSuccess:()=>{e.invalidateQueries({queryKey:["notifications"]})}})},Va=()=>M({queryKey:["thisWeekSchedule"],queryFn:()=>y("/api/continue-watching/this-week"),staleTime:1e3*60*5}),Qa=()=>M({queryKey:["genresAndTags"],queryFn:()=>y("/api/genres-and-tags"),staleTime:1e3*60*60}),Ha=()=>M({queryKey:["genreCards"],queryFn:()=>y("/api/insights/genre-cards")}),Dn="_container_z68uz_1",Rn="_bellBtn_z68uz_7",qn="_badge_z68uz_56",Mn="_dropdown_z68uz_96",Bn="_dropdownHeader_z68uz_127",Fn="_clearAllBtn_z68uz_141",Kn="_discoveryStatusRow_z68uz_156",jn="_statusDot_z68uz_167",zn="_statusDotRunning_z68uz_174",Wn="_statusDotOk_z68uz_179",Un="_statusDotInfo_z68uz_183",Vn="_statusDotError_z68uz_187",Qn="_statusDotIdle_z68uz_191",Hn="_list_z68uz_205",Jn="_item_z68uz_219",Yn="_thumbnail_z68uz_234",Gn="_itemInfo_z68uz_243",Zn="_itemTitle_z68uz_248",Xn="_itemMeta_z68uz_259",er="_systemItemMeta_z68uz_269",tr="_removeItem_z68uz_286",nr="_queueItem_z68uz_316",rr="_emptyState_z68uz_320",p={container:Dn,bellBtn:Rn,badge:qn,dropdown:Mn,dropdownHeader:Bn,clearAllBtn:Fn,discoveryStatusRow:Kn,statusDot:jn,statusDotRunning:zn,statusDotOk:Wn,statusDotInfo:Un,statusDotError:Vn,statusDotIdle:Qn,list:Hn,item:Jn,thumbnail:Yn,itemInfo:Gn,itemTitle:Zn,itemMeta:Xn,systemItemMeta:er,removeItem:tr,queueItem:nr,emptyState:rr},sr=({notification:e})=>{const n=An(),r=Pn(),[s,o]=Te.useState(!1),a=l=>{l.preventDefault(),l.stopPropagation(),n.mutate({showId:e.showId,episodeNumber:e.episodeNumber})},i=()=>{n.mutate({showId:e.showId,episodeNumber:e.episodeNumber})},c=l=>{l.preventDefault(),l.stopPropagation(),o(!0),r.mutate({showId:e.showId,episodeNumber:e.episodeNumber,showName:e.name,showThumbnail:e.thumbnail,nativeName:e.nativeName,englishName:e.englishName}),n.mutate({showId:e.showId,episodeNumber:e.episodeNumber}),window.setTimeout(()=>o(!1),1e3)},{titlePreference:d}=Cn(),u=d==="nativeName"?e.nativeName||e.name:d==="englishName"&&e.englishName||e.name;return t(K,{to:`/watch/${e.showId}/${e.episodeNumber}`,className:p.item,onClick:i,children:[t("img",{src:En(e.thumbnail,48,64),alt:e.name,className:p.thumbnail,loading:"lazy",decoding:"async"}),t("div",{className:p.itemInfo,children:[t("span",{className:p.itemTitle,children:u}),t("span",{className:p.itemMeta,children:["New Episode ",e.episodeNumber]})]}),t("button",{className:`${p.removeItem} ${p.queueItem}`,onClick:c,"aria-label":"Add notification to queue",children:s?t(g,{name:"check"}):t(g,{name:"plus"})}),t("button",{className:p.removeItem,onClick:a,"aria-label":"Remove notification",children:t(g,{name:"times"})})]})};function we({width:e="100%",height:n="1em",variant:r="rectangular",className:s="",style:o}){return t("div",{className:`skeleton skeleton-${r} ${s}`,style:{width:e,height:n,...o}})}const or=({count:e=3})=>t(F,{children:Array.from({length:e}).map((n,r)=>t("div",{className:p.item,style:{borderBottom:"1px solid var(--border-primary)",pointerEvents:"none"},children:[t("div",{className:p.thumbnail,style:{overflow:"hidden"},children:t(we,{width:"100%",height:"100%",variant:"rectangular"})}),t("div",{className:p.itemInfo,children:[t(we,{width:"80%",height:"1rem",variant:"text",style:{marginBottom:"4px"}}),t(we,{width:"40%",height:"0.7rem",variant:"rectangular",style:{borderRadius:"var(--radius-sm)"}})]})]},r))}),ar=()=>{const{data:e=[],isLoading:n}=lt(),{data:r=[]}=dt(),{data:s}=ut(),o=On(),a=O(),[i,c]=v(null);_(()=>{a.invalidateQueries({queryKey:["notifications"]})},[a]);const d=()=>{o.mutate(void 0)},u=r.find(l=>l.id===i)??null;return t("div",{className:p.dropdown,children:[t("div",{className:p.dropdownHeader,children:[t("h4",{children:"Notifications"}),e.length>0&&t("button",{className:p.clearAllBtn,onClick:d,children:"Clear All"})]}),t("div",{className:p.discoveryStatusRow,children:s?.running?t(F,{children:[t("span",{className:`${p.statusDot} ${p.statusDotRunning}`,"aria-hidden":"true"}),t("span",{children:s.total>0?`Checking ${Math.min(s.done,s.total)}/${s.total} shows...`:"Checking for new episodes..."})]}):s?.state==="complete"?t(F,{children:[t("span",{className:`${p.statusDot} ${p.statusDotOk}`,"aria-hidden":"true"}),t("span",{children:["Discovery complete — checked ",s.total," ",s.total===1?"show":"shows"]})]}):s?.state==="empty"?t(F,{children:[t("span",{className:`${p.statusDot} ${p.statusDotInfo}`,"aria-hidden":"true"}),t("span",{children:"No shows set to Watching — nothing to check"})]}):s?.state==="error"?t(F,{children:[t("span",{className:`${p.statusDot} ${p.statusDotError}`,"aria-hidden":"true"}),t("span",{children:"Last check failed — will retry automatically"})]}):t(F,{children:[t("span",{className:`${p.statusDot} ${p.statusDotIdle}`,"aria-hidden":"true"}),t("span",{children:s?.lastRunAt?`Last checked ${Math.max(1,Math.round((Date.now()-s.lastRunAt)/1e3))}s ago`:"Auto-checks every few minutes"})]})}),t("div",{className:p.list,children:n&&r.length===0?t(or,{count:4}):t(F,{children:[r.map(l=>t("div",{className:p.item,children:[t("div",{className:p.thumbnail,style:{background:"transparent",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:0,boxShadow:"none"},children:t(g,{name:"info-circle",size:32,color:"#6c9fff"})}),t("div",{className:p.itemInfo,children:[t("span",{className:p.itemTitle,children:l.title}),t("button",{type:"button",className:p.systemItemMeta,onClick:()=>c(l.id),title:"View full status",children:l.message.length>40?l.message.slice(0,40)+"…":l.message})]}),t("button",{className:p.removeItem,disabled:!0,style:{opacity:.3,cursor:"not-allowed"},"aria-hidden":"true",children:t(g,{name:"plus"})}),t("button",{className:p.removeItem,disabled:!0,style:{opacity:.3,cursor:"not-allowed"},"aria-hidden":"true",children:t(g,{name:"times"})})]},l.id)),r.length>0&&e.length>0&&t("div",{className:p.notificationDivider}),e.length>0?e.map(l=>t(sr,{notification:l},l.id)):!n&&r.length===0&&t("div",{className:p.emptyState,children:"No new notifications"})]})}),u&&Ze(t("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0, 0, 0, 0.6)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,padding:"1rem",backdropFilter:"blur(3px)"},onClick:()=>c(null),children:t("div",{style:{backgroundColor:"var(--bg-secondary)",padding:"1.5rem",borderRadius:"var(--radius-lg)",maxWidth:"420px",width:"100%",boxShadow:"var(--shadow-xl)",border:"1px solid var(--border-primary)"},onClick:l=>l.stopPropagation(),children:[t("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem",marginBottom:"1rem"},children:[t(g,{name:"info-circle",color:"#6c9fff"}),t("span",{style:{color:"#fff",fontWeight:600,fontSize:"1rem"},children:u.title})]}),t("p",{style:{color:"var(--text-secondary)",marginBottom:"1.5rem",lineHeight:1.5},children:u.message}),t("div",{style:{display:"flex",justifyContent:"flex-end"},children:t("button",{type:"button",onClick:()=>c(null),style:{background:"var(--primary-color)",color:"#fff",border:"none",padding:"0.5rem 1rem",borderRadius:"var(--radius-md)",cursor:"pointer",fontWeight:600},children:"OK"})})]})}),document.body)]})},ir=()=>{const[e,n]=v(!1),r=q(null),s=O(),o=Ln(),{data:a=[]}=lt(),{data:i=[]}=dt(),{data:c}=ut(),d=a.length+i.length,u=d>5?"5+":d,l=q(!1);_(()=>{const h=b=>{r.current&&!r.current.contains(b.target)&&n(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[]),_(()=>{const h=!!c?.running;l.current&&!h&&(s.invalidateQueries({queryKey:["notifications"]}),s.invalidateQueries({queryKey:["discovery-status"]})),l.current=h},[c?.running,s]);const m=()=>{const h=!e;n(h),h&&o.mutate()};return t("div",{className:p.container,ref:r,children:[t("button",{className:p.bellBtn,onClick:m,"aria-label":"Notifications",children:[t(g,{name:"bell"}),d>0&&t("span",{className:p.badge,children:u})]}),e&&t(ar,{})]})},mt=te(void 0),ht=()=>{const e=ne(mt);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},Ja=[{id:"iris",label:"Taro (default)",blurb:"Deep purple",swatch:"#7d6df0"},{id:"mochi",label:"Mochi",blurb:"Monochrome pearl",swatch:"#f0f0f0"},{id:"sakura",label:"Sakura",blurb:"Soft pink",swatch:"#e0b0e0"}],Be={iris:"/logo.png",mochi:"/logo-mochi.png",sakura:"/logo-sakura.png"},pt=({className:e})=>{const{theme:n}=ht(),r=Be[n]||Be.iris;return t("img",{src:r,alt:"dango",className:e,decoding:"async",style:{height:"var(--logo-height, 75px)",width:"auto",display:"block",objectFit:"contain"}})},gt=te(void 0),Pe=()=>{const e=ne(gt);if(e===void 0)throw new Error("useSidebar must be used within a SidebarProvider");return e},ft=te(void 0),vt=()=>{const e=ne(ft);if(e===void 0)throw new Error("useContentType must be used within a ContentTypeProvider");return e},xe="virtual-keyboard:hide",Fe="virtual-keyboard:enabled-change",yt="virtual_keyboard_enabled",cr=!1;function Ke(){const e=localStorage.getItem(yt);return e===null?cr:e==="true"}const je=e=>e instanceof HTMLInputElement&&e.type==="text"&&!e.disabled&&!e.readOnly;function lr(){window.dispatchEvent(new CustomEvent(xe))}function dr(){const[e,n]=v(!1),[r,s]=v(Ke),o=q(null);return _(()=>{const a=l=>{r&&je(l.target)&&(o.current=l.target,n(!0))},i=l=>{l.target===o.current&&window.setTimeout(()=>{if(je(document.activeElement)){o.current=document.activeElement,n(!0);return}o.current=null,n(!1)},0)},c=()=>{o.current=null,n(!1)},d=l=>{if(l.key!==yt)return;const m=l.newValue==="true";s(m),m||c()},u=()=>{const l=Ke();s(l),l||c()};return document.addEventListener("focusin",a),document.addEventListener("focusout",i),window.addEventListener(xe,c),window.addEventListener("storage",d),window.addEventListener(Fe,u),()=>{document.removeEventListener("focusin",a),document.removeEventListener("focusout",i),window.removeEventListener(xe,c),window.removeEventListener("storage",d),window.removeEventListener(Fe,u)}},[r]),{activeInputRef:o,isVisible:r&&e,hide:()=>n(!1)}}const ur="_header_rlbx9_1",mr="_hidden_rlbx9_21",hr="_scrolled_rlbx9_25",pr="_logo_rlbx9_31",gr="_headerInner_rlbx9_44",fr="_leftSection_rlbx9_54",vr="_desktopNav_rlbx9_60",yr="_navLink_rlbx9_67",_r="_navLinkActive_rlbx9_83",br="_rightSection_rlbx9_102",wr="_searchWrapper_rlbx9_108",Sr="_searchInput_rlbx9_114",kr="_searchButton_rlbx9_146",Nr="_searchIcon_rlbx9_170",Ir="_profileBtn_rlbx9_180",xr="_profileImg_rlbx9_213",Tr="_hamburgerBtn_rlbx9_219",Er="_mobileSearchBar_rlbx9_247",Cr="_mobileSearchInner_rlbx9_283",$r="_mobileSearchIcon_rlbx9_293",Pr="_mobileSearchInput_rlbx9_300",k={header:ur,hidden:mr,scrolled:hr,logo:pr,headerInner:gr,leftSection:fr,desktopNav:vr,navLink:yr,navLinkActive:_r,rightSection:br,searchWrapper:wr,searchInput:Sr,searchButton:kr,searchIcon:Nr,profileBtn:Ir,profileImg:xr,hamburgerBtn:Tr,mobileSearchBar:Er,mobileSearchInner:Cr,mobileSearchIcon:$r,mobileSearchInput:Pr},Lr=async()=>{const e=await fetch("/api/auth/settings/sync");if(!e.ok)return null;const r=(await e.json()).actualActiveProvider;if(r==="github"){const s=await fetch("/api/auth/github/status");if(s.ok){const o=await s.json();if(o.authenticated&&o.user)return{name:o.user.name||o.user.login,picture:o.user.avatarUrl,provider:"github"}}}if(r==="google"){const s=await fetch("/api/auth/user");if(s.ok){const o=await s.json();if(o)return{name:o.name,picture:o.picture,email:o.email,provider:"google"}}}return null},Ar=()=>{const{toggleSidebar:e}=Pe(),{contentType:n}=vt(),[r,s]=v(""),[o,a]=v(!0),[i,c]=v(!1),[d,u]=v(!0),[l,m]=v(!1),h=Xe(),b=Ee(),P=q(null),z=q(!1),B=q(null),Q=q(null),W=q(null),{data:w}=M({queryKey:["sync-profile"],queryFn:Lr,staleTime:3e4});_(()=>{const L=()=>{P.current&&(window.clearTimeout(P.current),P.current=null)},G=()=>{z.current||(z.current=!0,B.current=requestAnimationFrame(()=>{z.current=!1,B.current=null;const H=window.scrollY<=10;u(ie=>ie===H?ie:H),a(ie=>ie||!0),L(),H||(P.current=window.setTimeout(()=>{a(!1)},2500))}))},Oe=H=>{(H.metaKey||H.ctrlKey)&&H.key==="k"?(H.preventDefault(),C.current?.focus()):H.key==="Escape"&&document.activeElement===C.current&&C.current?.blur()};return window.addEventListener("scroll",G,{passive:!0}),window.addEventListener("keydown",Oe),()=>{window.removeEventListener("scroll",G),window.removeEventListener("keydown",Oe),L(),B.current!==null&&(cancelAnimationFrame(B.current),B.current=null),z.current=!1}},[i]);const C=Te.useRef(null),oe=()=>window.innerWidth<=1024,_e=()=>{oe()?(m(!0),setTimeout(()=>W.current?.focus(),50)):document.activeElement===C.current&&r.trim()?ae():C.current?.focus()},Y=L=>{Q.current?.contains(L.relatedTarget)||m(!1)},ue=n==="manga"?"Search manga...":n==="tv"?"Search TV & movies...":n==="asmr"?"Search ASMR...":"Search anime...",ae=L=>{lr();const G=r.trim();G&&h(n==="manga"?`/manga?q=${encodeURIComponent(G)}`:n==="tv"?`/tv-search?q=${encodeURIComponent(G)}`:n==="asmr"?`/asmr?q=${encodeURIComponent(G)}`:`/search?query=${encodeURIComponent(G)}`)};return t(F,{children:[t("header",{className:`${k.header} ${o?"":k.hidden} ${d?"":k.scrolled}`,children:t("div",{className:k.headerInner,children:[t("div",{className:k.leftSection,children:[t("button",{className:k.hamburgerBtn,onClick:e,"aria-label":"Menu",children:t(g,{name:"bars"})}),t(K,{to:"/",className:k.logo,"aria-label":"Ani-Web Home",children:t(pt,{})}),t("nav",{className:k.desktopNav,children:[t(K,{to:"/",className:`${k.navLink} ${b.pathname==="/"?k.navLinkActive:""}`,children:"Home"}),t(K,{to:"/watchlist",className:`${k.navLink} ${b.pathname==="/watchlist"?k.navLinkActive:""}`,children:"Watchlist"}),t(K,{to:"/insights",className:`${k.navLink} ${b.pathname==="/insights"?k.navLinkActive:""}`,children:"Insights"}),t(K,{to:"/settings",className:`${k.navLink} ${b.pathname.startsWith("/settings")?k.navLinkActive:""}`,children:"Settings"})]})]}),t("div",{className:k.rightSection,children:[t("div",{className:k.searchWrapper,children:[t("input",{ref:C,type:"text","data-virtual-keyboard":"true",className:k.searchInput,placeholder:ue,value:r,onChange:L=>s(L.target.value),onFocus:()=>c(!0),onBlur:()=>c(!1),onKeyDown:L=>{L.key==="Enter"&&ae()}}),t("button",{type:"button",className:k.searchButton,"aria-label":"Search",onMouseDown:L=>L.preventDefault(),onClick:_e,children:t(g,{name:"search",className:k.searchIcon})})]}),t(ir,{}),t(K,{to:"/settings?tab=sync",className:k.profileBtn,"aria-label":"Sync settings",children:w?.picture?t("img",{src:w.picture,alt:w.name,className:k.profileImg,referrerPolicy:"no-referrer",decoding:"async"}):w?.provider==="github"?t(g,{name:"github"}):t(g,{name:"cloud"})})]})]})}),l&&t("div",{className:k.mobileSearchBar,ref:Q,onBlur:Y,children:t("div",{className:k.mobileSearchInner,children:[t(g,{name:"search",className:k.mobileSearchIcon}),t("input",{ref:W,type:"text","data-virtual-keyboard":"true",className:k.mobileSearchInput,placeholder:ue,value:r,onChange:L=>s(L.target.value),onKeyDown:L=>{L.key==="Enter"?(ae(),m(!1)):L.key==="Escape"&&m(!1)}})]})})]})},Or="_sidebar_153jc_1",Dr="_open_153jc_20",Rr="_sidebarHeader_153jc_25",qr="_closeBtn_153jc_33",Mr="_logo_153jc_57",Br="_navSection_153jc_69",Fr="_navLink_153jc_75",Kr="_active_153jc_108",jr="_overlay_153jc_118",zr="_versionInfo_153jc_138",U={sidebar:Or,open:Dr,sidebarHeader:Rr,closeBtn:qr,logo:Mr,navSection:Br,navLink:Fr,active:Kr,overlay:jr,versionInfo:zr},Wr="dango-client",Ur="3.3.4",Vr="module",Qr={node:">=22.12.0"},Hr={start:"vite",dev:"vite",build:"tsc && vite build",lint:"eslint .",test:"vitest run",preview:"vite preview","start:prod":"vite preview",format:"prettier --write ."},Jr={"@floating-ui/react":"^0.27.20","@tanstack/react-query":"^5.99.2","anime4k-webgpu-async":"^2.0.0","embla-carousel-react":"^8.6.0","hls.js":"^1.5.13",preact:"^10.29.1","react-hot-toast":"^2.6.0","react-router":"^8.3.0","react-simple-maps":"^5.0.3"},Yr={"@preact/preset-vite":"^2.10.5","@webgpu/types":"^0.1.72","eslint-plugin-react-hooks":"^7.1.1","eslint-plugin-react-refresh":"^0.5.2",vite:"^7.3.1",vitest:"^5.0.0"},Le={name:Wr,private:!0,version:Ur,type:Vr,engines:Qr,scripts:Hr,dependencies:Jr,devDependencies:Yr},Gr=()=>{const{isOpen:e,setIsOpen:n}=Pe(),{contentType:r}=vt(),[s,o]=v(()=>localStorage.getItem("agreedToViewMature")==="true");_(()=>{const l=()=>o(localStorage.getItem("agreedToViewMature")==="true");return window.addEventListener("storage",l),window.addEventListener("focus",l),()=>{window.removeEventListener("storage",l),window.removeEventListener("focus",l)}},[]);const a=()=>{n(!1)},i=r==="manga",c=r==="tv",d=r==="asmr",u=[{to:"/",icon:t(g,{name:"home"}),label:"Home"},i?{to:"/manga",icon:t(g,{name:"book"}),label:"Manga"}:c?{to:"/tv-search",icon:t(g,{name:"tv"}),label:"TV and Movies"}:d?{to:"/asmr",icon:t(g,{name:"headphones"}),label:"ASMR"}:{to:"/search",icon:t(g,{name:"search"}),label:"Search"},i?{to:"/reading-list",icon:t(g,{name:"bookmark"}),label:"Reading List"}:c?{to:"/tv-watchlist",icon:t(g,{name:"clock"}),label:"TV Watchlist"}:d?{to:"/listening-list",icon:t(g,{name:"history"}),label:"Listening List"}:{to:"/watchlist",icon:t(g,{name:"clock"}),label:"Watchlist"},{to:"/insights",icon:t(g,{name:"chart-pie"}),label:"Insights"},{to:"/trackers",icon:t(g,{name:"sync-alt"}),label:"Trackers"},{to:"/radio",icon:t(g,{name:"broadcast-tower"}),label:"Radio"},{to:"/music",icon:t(g,{name:"headphones"}),label:"Music"},...s?[{to:"/mature",icon:t(g,{name:"pepper-hot"}),label:"Mature"}]:[],{to:"/settings",icon:t(g,{name:"cog"}),label:"Settings"}];return t(F,{children:[t("aside",{className:`${U.sidebar} ${e?U.open:""} sidebar`,children:[t("div",{className:U.sidebarHeader,children:[t("button",{className:U.closeBtn,onClick:()=>n(!1),"aria-label":"Close menu",children:"×"}),t(K,{to:"/",className:U.logo,onClick:a,children:t(pt,{})})]}),t("nav",{className:U.navSection,children:u.map(l=>t(Et,{to:l.to,className:({isActive:m})=>`${U.navLink} ${m?U.active:""}`,onClick:a,end:l.to==="/",children:[l.icon,t("span",{children:l.label})]},l.to))}),t("div",{className:U.versionInfo,children:["v",Le.version]})]}),e&&t("div",{className:U.overlay,onClick:()=>n(!1),"aria-label":"Close sidebar"})]})},Zr="_footer_1p5nb_1",Xr="_footerInner_1p5nb_15",es="_brandSection_1p5nb_27",ts="_logoRow_1p5nb_39",ns="_logoText_1p5nb_59",rs="_brandMeta_1p5nb_65",ss="_brandTagline_1p5nb_74",os="_statusPill_1p5nb_81",as="_statusDot_1p5nb_94",is="_linksGrid_1p5nb_102",cs="_linkColumn_1p5nb_110",ls="_columnTitle_1p5nb_116",ds="_bottomBar_1p5nb_140",us="_copyright_1p5nb_150",ms="_brand_1p5nb_27",hs="_heartIcon_1p5nb_166",ps="_backToTop_1p5nb_171",T={footer:Zr,footerInner:Xr,brandSection:es,logoRow:ts,logoText:ns,brandMeta:rs,brandTagline:ss,statusPill:os,statusDot:as,linksGrid:is,linkColumn:cs,columnTitle:ls,bottomBar:ds,copyright:us,brand:ms,heartIcon:hs,backToTop:ps},ze={iris:"/logo.png",mochi:"/logo-mochi.png",sakura:"/logo-sakura.png"},gs=()=>{const{theme:e}=ht(),n=ze[e]||ze.iris,r=new Date().getFullYear(),s=()=>{window.scrollTo({top:0,behavior:"smooth"})};return t("footer",{className:T.footer,children:[t("div",{className:T.footerInner,children:[t("div",{className:T.brandSection,children:[t("div",{className:T.logoRow,children:t("img",{src:n,className:T.logoText,alt:"dango",loading:"lazy",decoding:"async"})}),t("div",{className:T.brandMeta,children:[t("div",{className:T.statusPill,children:[t("span",{className:T.statusDot}),t("span",{children:["v",Le.version]})]}),t("p",{className:T.brandTagline,children:"Fast, local anime streaming."})]})]}),t("div",{className:T.linksGrid,children:[t("div",{className:T.linkColumn,children:[t("h4",{className:T.columnTitle,children:"Navigation"}),t(K,{to:"/",children:"Home"}),t(K,{to:"/watchlist",children:"Watchlist"}),t(K,{to:"/settings",children:"Settings"})]}),t("div",{className:T.linkColumn,children:[t("h4",{className:T.columnTitle,children:"Features"}),t(K,{to:"/search",children:"Search Anime"}),t(K,{to:"/trackers",children:"Trackers"}),t(K,{to:"/insights",children:"Insights"})]}),t("div",{className:T.linkColumn,children:[t("h4",{className:T.columnTitle,children:"Community"}),t("a",{href:"https://discord.gg/2FTSPXCsvn",target:"_blank",rel:"noopener noreferrer",children:[t(g,{name:"discord",style:{marginRight:"6px"}})," Discord"]}),t("a",{href:"https://github.com/serifpersia/dango",target:"_blank",rel:"noopener noreferrer",children:[t(g,{name:"github",style:{marginRight:"6px"}})," GitHub"]})]}),t("div",{className:T.linkColumn,children:[t("h4",{className:T.columnTitle,children:"Project"}),t("a",{href:"https://github.com/serifpersia/dango/releases",target:"_blank",rel:"noopener noreferrer",children:"Releases"}),t("a",{href:"https://github.com/serifpersia/dango/issues",target:"_blank",rel:"noopener noreferrer",children:"Feedback"})]})]})]}),t("div",{className:T.bottomBar,children:[t("p",{className:T.copyright,children:["© ",r," ",t("span",{className:T.brand,children:"dango"})," • Crafted with"," ",t(g,{name:"heart",className:T.heartIcon})," by"," ",t("a",{href:"https://github.com/serifpersia",target:"_blank",rel:"noopener noreferrer",children:"serifpersia"})]}),t("button",{className:T.backToTop,onClick:s,"aria-label":"Back to top",children:[t(g,{name:"chevron-up",size:14}),t("span",{children:"Top"})]})]})]})},fs=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():Math.random().toString(36).slice(2)+Date.now().toString(36),fe="https://script.google.com/macros/s/AKfycbxpllCbhqNjqFN02er9WV-0Tv-Y9br13UqXZqGHzSMetAgqKaFX5oFKGHgxji1fxJ6udw/exec",vs=()=>{const e=navigator.userAgent;let n="Unknown Browser",r="Unknown OS";return e.includes("Firefox")?n="Firefox":e.includes("SamsungBrowser")?n="Samsung Browser":e.includes("Opera")||e.includes("OPR")?n="Opera":e.includes("Trident")?n="Internet Explorer":e.includes("Edge")?n="Edge":e.includes("Chrome")?n="Chrome":e.includes("Safari")&&(n="Safari"),e.includes("Windows")?r="Windows":e.includes("Mac")?r="MacOS":e.includes("Linux")?r="Linux":e.includes("Android")?r="Android":(e.includes("iPhone")||e.includes("iPad")||e.includes("iPod"))&&(r="iOS"),`${n} on ${r}`},ys=async()=>{localStorage.removeItem("last_telemetry_ping");const e=localStorage.getItem("installation_id");if(e&&fe)try{await fetch(fe,{method:"POST",mode:"no-cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,action:"delete"})})}catch(n){console.error("Telemetry delete request failed:",n)}};let Se=!1;const _s=async()=>{if(!Se){Se=!0,localStorage.setItem("last_telemetry_ping",Date.now().toString());try{let e=localStorage.getItem("installation_id");if(!e)try{const r=await(await fetch("/api/installation-id")).json();r.id&&(e=r.id,localStorage.setItem("installation_id",e))}catch(n){console.error("Failed to fetch hardware ID:",n)}e||(e=fs(),localStorage.setItem("installation_id",e)),await fetch(fe,{method:"POST",mode:"no-cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,version:Le.version,userAgent:vs(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone})})}catch(e){console.error("Telemetry ping failed:",e)}finally{Se=!1}}},bs=()=>{const[e,n]=v(!1);return _(()=>{if(!localStorage.getItem("telemetry_notice_v2")){const s=setTimeout(()=>n(!0),3e3);return()=>clearTimeout(s)}},[]),_(()=>{if(!(localStorage.getItem("telemetry_enabled")!=="false")||!fe)return;const s=localStorage.getItem("last_telemetry_ping"),o=Date.now(),a=1440*60*1e3;s&&o-parseInt(s)<a||_s()},[]),{showTelemetryModal:e,setShowTelemetryModal:n}},ws="_overlay_1juub_1",Ss="_fadeIn_1juub_1",ks="_content_1juub_11",Ns="_modalIn_1juub_1",Is="_sm_1juub_29",xs="_md_1juub_33",Ts="_lg_1juub_37",Es="_title_1juub_41",Cs="_body_1juub_48",$s="_footer_1juub_52",re={overlay:ws,fadeIn:Ss,content:ks,modalIn:Ns,sm:Is,md:xs,lg:Ts,title:Es,body:Cs,footer:$s};function _t({children:e}){return t("h2",{className:re.title,children:e})}function bt({children:e}){return t("div",{className:re.body,children:e})}function wt({children:e}){return t("div",{className:re.footer,children:e})}function se({isOpen:e,onClose:n,title:r,children:s,footer:o,width:a="md"}){const i=q(null);return _(()=>{if(!e)return;const c=u=>{u.key==="Escape"&&n?.()};document.addEventListener("keydown",c);const d=document.body.style.overflow;return document.body.style.overflow="hidden",i.current?.focus(),()=>{document.removeEventListener("keydown",c),document.body.style.overflow=d}},[e,n]),e?Ze(t("div",{role:"presentation",onMouseDown:c=>c.stopPropagation(),children:[t("div",{className:re.overlay,onClick:()=>n?.(),"aria-hidden":"true"}),t("div",{ref:i,className:`${re.content} ${re[a]}`,role:"dialog","aria-modal":"true","aria-label":r,tabIndex:-1,children:[r&&t(_t,{children:r}),t(bt,{children:s}),o&&t(wt,{children:o})]})]}),document.body):null}se.Header=_t;se.Body=bt;se.Actions=wt;const Ps="_slider_1f1gi_15",We={switch:"_switch_1f1gi_1",slider:Ps},Ls=({isChecked:e,onChange:n,id:r,disabled:s=!1})=>t("label",{className:We.switch,htmlFor:r,children:[t("input",{type:"checkbox",id:r,checked:e,onChange:n,disabled:s}),t("span",{className:We.slider})]}),As="_container_1hh92_1",Os="_description_1hh92_8",Ds="_dataList_1hh92_14",Rs="_dataTitle_1hh92_20",qs="_toggleRow_1hh92_39",Ms="_toggleLabel_1hh92_46",Bs="_actions_1hh92_50",Fs="_okButton_1hh92_55",Ks="_previewToggle_1hh92_71",js="_chevron_1hh92_89",zs="_chevronOpen_1hh92_94",Ws="_previewBox_1hh92_98",Us="_previewItem_1hh92_107",Vs="_previewKey_1hh92_114",Qs="_previewVal_1hh92_118",N={container:As,description:Os,dataList:Ds,dataTitle:Rs,toggleRow:qs,toggleLabel:Ms,actions:Bs,okButton:Fs,previewToggle:Ks,chevron:js,chevronOpen:zs,previewBox:Ws,previewItem:Us,previewKey:Vs,previewVal:Qs},Hs="3.3.4",Js={version:Hs},Ys=()=>{const e=navigator.userAgent;return e.includes("Firefox")?"Firefox":e.includes("SamsungBrowser")?"Samsung Browser":e.includes("Opera")||e.includes("OPR")?"Opera":e.includes("Edge")?"Edge":e.includes("Chrome")?"Chrome":e.includes("Safari")?"Safari":"Unknown"},Gs=()=>{const e=navigator.userAgent;return e.includes("Windows")?"Windows":e.includes("Mac")?"macOS":e.includes("Linux")?"Linux":e.includes("Android")?"Android":e.includes("iPhone")||e.includes("iPad")?"iOS":"Unknown"},Zs=({isOpen:e,onClose:n})=>{const[r,s]=v(!0),[o,a]=v(!1),i=()=>{localStorage.setItem("telemetry_enabled",String(r)),localStorage.setItem("telemetry_notice_v2","true"),r||ys(),n()};return t(se,{isOpen:e,onClose:()=>{},title:"Telemetry",children:t("div",{className:N.container,children:[t("p",{className:N.description,children:"Dango collects anonymous usage data to help track how many people use the app. This information is used to measure the project's install base and popularity. Participation is completely optional."}),t("div",{className:N.dataList,children:[t("p",{className:N.dataTitle,children:"What is collected:"}),t("ul",{children:[t("li",{children:"Browser type and operating system"}),t("li",{children:"Your timezone (e.g. Europe/Berlin)"}),t("li",{children:"Anonymous timestamps (first seen / last seen)"})]})]}),t("button",{className:N.previewToggle,onClick:()=>a(!o),children:[t("span",{children:"See exactly what data is sent"}),t(g,{name:"chevron-down",className:`${N.chevron} ${o?N.chevronOpen:""}`})]}),o&&t("div",{className:N.previewBox,children:[t("div",{className:N.previewItem,children:[t("span",{className:N.previewKey,children:"Browser:"}),t("span",{className:N.previewVal,children:Ys()})]}),t("div",{className:N.previewItem,children:[t("span",{className:N.previewKey,children:"OS:"}),t("span",{className:N.previewVal,children:Gs()})]}),t("div",{className:N.previewItem,children:[t("span",{className:N.previewKey,children:"Timezone:"}),t("span",{className:N.previewVal,children:Intl.DateTimeFormat().resolvedOptions().timeZone})]}),t("div",{className:N.previewItem,children:[t("span",{className:N.previewKey,children:"App Version:"}),t("span",{className:N.previewVal,children:Js.version})]})]}),t("div",{className:N.toggleRow,children:[t("span",{className:N.toggleLabel,children:"Send anonymous telemetry"}),t(Ls,{isChecked:r,onChange:c=>s(c.target.checked),id:"telemetry-notice-toggle"})]}),t("div",{className:N.actions,children:t("button",{className:N.okButton,onClick:i,children:"Ok"})})]})})},Xs="_promoWrapper_1vfnt_1",eo="_visible_1vfnt_11",to="_panel_1vfnt_16",no="_closeBtn_1vfnt_29",ro="_header_1vfnt_55",so="_discordIcon_1vfnt_62",oo="_headerText_1vfnt_74",ao="_body_1vfnt_89",io="_rolePreview_1vfnt_96",co="_badge_1vfnt_103",lo="_badgeRank_1vfnt_111",uo="_badgeDere_1vfnt_117",mo="_actions_1vfnt_123",ho="_btnJoin_1vfnt_129",po="_btnSettings_1vfnt_155",go="_skipLink_1vfnt_180",fo="_hint_1vfnt_200",E={promoWrapper:Xs,visible:eo,panel:to,closeBtn:no,header:ro,discordIcon:so,headerText:oo,body:ao,rolePreview:io,badge:co,badgeRank:lo,badgeDere:uo,actions:mo,btnJoin:ho,btnSettings:po,skipLink:go,hint:fo},Ue="discord_community_promo_dismissed",vo=4500;function yo({workerUrl:e}){const n=Xe(),[r,s]=v(!1),o=q(!1);_(()=>{if(localStorage.getItem(Ue)==="true"||localStorage.getItem("dango_discord_user"))return;const c=setTimeout(()=>s(!0),vo);return()=>clearTimeout(c)},[]);const a=()=>{o.current||(o.current=!0,s(!1),localStorage.setItem(Ue,"true"))},i=()=>{a(),n("/settings?tab=community")};return e?t("div",{className:`${E.promoWrapper} ${r?E.visible:""}`,"aria-live":"polite",children:t("div",{className:E.panel,children:[t("button",{className:E.closeBtn,onClick:a,"aria-label":"Dismiss",children:"✕"}),t("div",{className:E.header,children:[t("div",{className:E.discordIcon,children:t("svg",{width:"20",height:"16",viewBox:"0 0 71 55",fill:"white","aria-hidden":"true",children:t("path",{d:"M60.1 4.9A58.5 58.5 0 0 0 45.5.3a.22.22 0 0 0-.23.11 40.8 40.8 0 0 0-1.8 3.7 54 54 0 0 0-16.2 0 37.5 37.5 0 0 0-1.83-3.7.23.23 0 0 0-.23-.11A58.3 58.3 0 0 0 10.9 4.9a.2.2 0 0 0-.1.08C1.58 18.73-1 32.23.31 45.55a.24.24 0 0 0 .09.17 58.8 58.8 0 0 0 17.7 8.95.23.23 0 0 0 .25-.08 42 42 0 0 0 3.61-5.88.22.22 0 0 0-.12-.31 38.7 38.7 0 0 1-5.53-2.64.23.23 0 0 1-.02-.37 29 29 0 0 0 1.1-.86.22.22 0 0 1 .23-.03c11.6 5.3 24.14 5.3 35.6 0a.22.22 0 0 1 .23.03c.36.3.73.58 1.1.86a.23.23 0 0 1-.02.37 36.4 36.4 0 0 1-5.53 2.64.22.22 0 0 0-.12.31 47.1 47.1 0 0 0 3.61 5.88.22.22 0 0 0 .25.08 58.6 58.6 0 0 0 17.72-8.95.23.23 0 0 0 .09-.16c1.47-15.27-2.47-28.65-10.46-40.47a.18.18 0 0 0-.09-.09ZM23.73 37.55c-3.49 0-6.37-3.21-6.37-7.15s2.82-7.15 6.37-7.15c3.58 0 6.42 3.24 6.37 7.15 0 3.94-2.82 7.15-6.37 7.15Zm23.54 0c-3.49 0-6.37-3.21-6.37-7.15s2.82-7.15 6.37-7.15c3.58 0 6.42 3.24 6.37 7.15 0 3.94-2.79 7.15-6.37 7.15Z"})})}),t("div",{className:E.headerText,children:[t("h4",{children:"Join the Dango Community"}),t("p",{children:"Earn roles based on your watch stats"})]})]}),t("div",{className:E.body,children:[t("p",{style:{margin:"0 0 6px"},children:"Connect your Discord account and earn exclusive server roles based on how much you watch:"}),t("div",{className:E.rolePreview,children:[t("span",{className:`${E.badge} ${E.badgeRank}`,children:"S-Rank"}),t("span",{className:`${E.badge} ${E.badgeRank}`,children:"F–A Rank"}),t("span",{className:`${E.badge} ${E.badgeDere}`,children:"Tsundere"}),t("span",{className:`${E.badge} ${E.badgeDere}`,children:"Kamidere…"})]})]}),t("div",{className:E.actions,children:[t("a",{className:E.btnJoin,href:"https://discord.gg/6yPAZjDzg8",target:"_blank",rel:"noopener noreferrer",children:[t("svg",{width:"16",height:"12",viewBox:"0 0 71 55",fill:"currentColor","aria-hidden":"true",children:t("path",{d:"M60.1 4.9A58.5 58.5 0 0 0 45.5.3a.22.22 0 0 0-.23.11 40.8 40.8 0 0 0-1.8 3.7 54 54 0 0 0-16.2 0 37.5 37.5 0 0 0-1.83-3.7.23.23 0 0 0-.23-.11A58.3 58.3 0 0 0 10.9 4.9a.2.2 0 0 0-.1.08C1.58 18.73-1 32.23.31 45.55a.24.24 0 0 0 .09.17 58.8 58.8 0 0 0 17.7 8.95.23.23 0 0 0 .25-.08 42 42 0 0 0 3.61-5.88.22.22 0 0 0-.12-.31 38.7 38.7 0 0 1-5.53-2.64.23.23 0 0 1-.02-.37 29 29 0 0 0 1.1-.86.22.22 0 0 1 .23-.03c11.6 5.3 24.14 5.3 35.6 0a.22.22 0 0 1 .23.03c.36.3.73.58 1.1.86a.23.23 0 0 1-.02.37 36.4 36.4 0 0 1-5.53 2.64.22.22 0 0 0-.12.31 47.1 47.1 0 0 0 3.61 5.88.22.22 0 0 0 .25.08 58.6 58.6 0 0 0 17.72-8.95.23.23 0 0 0 .09-.16c1.47-15.27-2.47-28.65-10.46-40.47a.18.18 0 0 0-.09-.09ZM23.73 37.55c-3.49 0-6.37-3.21-6.37-7.15s2.82-7.15 6.37-7.15c3.58 0 6.42 3.24 6.37 7.15 0 3.94-2.82 7.15-6.37 7.15Zm23.54 0c-3.49 0-6.37-3.21-6.37-7.15s2.82-7.15 6.37-7.15c3.58 0 6.42 3.24 6.37 7.15 0 3.94-2.79 7.15-6.37 7.15Z"})}),"Join Discord Server"]}),t("button",{className:E.btnSettings,onClick:i,children:[t("span",{children:"⚙"})," Get Roles & Settings"]})]}),t("button",{className:E.skipLink,onClick:a,children:"Skip — don't show again"}),t("p",{className:E.hint,children:"You can always find this in Settings → Community"})]})}):null}const _o=async e=>(await y(`/api/settings?key=${e}`)).value,bo=async({key:e,value:n})=>y("/api/settings",{method:"POST",body:JSON.stringify({key:e,value:n})}),Ae=e=>M({queryKey:["settings",e],queryFn:()=>_o(e)}),St=()=>{const e=O();return j({mutationFn:bo,onSuccess:()=>{f.success("Setting updated!"),e.invalidateQueries({queryKey:["settings"]})},onError:n=>{f.error(`Failed to update setting: ${n.message}`)}})};function wo(){const e=Ee(),{data:n}=Ae("discordRPCEnabled"),r=q("");r.current||(r.current=typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`tab-${Date.now()}-${Math.random().toString(36).slice(2)}`),_(()=>{if(n===!1||n==="false")return;const s=r.current,o=()=>fetch("/api/discord/heartbeat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:s})}).catch(()=>{});o();const a=setInterval(o,15e3),i=()=>{navigator.sendBeacon("/api/discord/heartbeat",new Blob([JSON.stringify({sessionId:s,bye:!0})],{type:"application/json"}))};return window.addEventListener("pagehide",i),()=>{clearInterval(a),window.removeEventListener("pagehide",i)}},[n]),_(()=>{if(n===!1||n==="false")return;const s=e.pathname;if(s.startsWith("/watch/")||s.startsWith("/player/"))return;let o="home";s.startsWith("/search")||s.startsWith("/mature")?o="search":s.startsWith("/watchlist")?o="watchlist":s.startsWith("/anime/")?o="anime":s.startsWith("/insights")?o="insights":s.startsWith("/settings")?o="settings":s.startsWith("/map")?o="map":s.startsWith("/trackers")?o="trackers":s.startsWith("/asmr")?o="asmr":s.startsWith("/manga")?o="manga":s.startsWith("/radio")?o="radio":s.startsWith("/music")?o="music":s.startsWith("/tv")&&(o="tv"),fetch("/api/discord/status",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({page:o})}).catch(()=>{})},[e.pathname,n])}function kt(e,n){const[r,s]=v(()=>{try{const a=localStorage.getItem(e);if(a===null)return n;if(typeof n=="string")return a;try{return JSON.parse(a)}catch{return a}}catch{return n}});_(()=>{const a=i=>{if(i.key===e)try{if(i.newValue===null){s(n);return}if(typeof n=="string"){s(i.newValue);return}try{s(JSON.parse(i.newValue))}catch{s(i.newValue)}}catch{}};return window.addEventListener("storage",a),()=>window.removeEventListener("storage",a)},[e,n]);const o=R(a=>{s(i=>{const c=typeof a=="function"?a(i):a;try{typeof c=="string"?localStorage.setItem(e,c):localStorage.setItem(e,JSON.stringify(c))}catch{}return c})},[e]);return[r,o]}const Nt=te(void 0),So=()=>{const e=ne(Nt);if(!e)throw new Error("useAnimePaheCookie must be used within an AnimePaheCookieProvider");return e},ko="_container_e96gf_1",No="_field_e96gf_9",Io="_textarea_e96gf_20",xo="_input_e96gf_40",To="_button_e96gf_58",Eo="_secondaryButton_e96gf_78",Co="_actions_e96gf_95",$o="_hint_e96gf_104",Po="_link_e96gf_117",A={container:ko,field:No,textarea:Io,input:xo,button:To,secondaryButton:Eo,actions:Co,hint:$o,link:Po},Lo="https://github.com/serifpersia/dango/releases/latest/download/dango-extension.zip",Ao=e=>{try{return JSON.parse(e.detail)}catch{return null}},Oo=({isOpen:e,onClose:n,onSuccess:r})=>{const[s,o]=v(1),[a,i]=v(navigator.userAgent),[c,d]=v(""),[u,l]=v(!1),m=q(null),h=navigator.userAgent,b=/android/i.test(h),P=/firefox|fxios/i.test(h)&&!b,z=!P&&!b&&/chrome|chromium|edg|brave/i.test(h),B=P||z;_(()=>{e&&(o(1),i(navigator.userAgent),d(""),l(!1))},[e]),_(()=>()=>{m.current&&(window.removeEventListener("dango:pahe-cookie",m.current),m.current=null)},[]);const Q=()=>{localStorage.setItem("animepahe_ua",a),window.open("https://animepahe.pw","_blank","noopener,noreferrer"),o(2)},W=()=>{if(u)return;l(!0);const C=window.setTimeout(()=>{l(!1),m.current&&(window.removeEventListener("dango:pahe-cookie",m.current),m.current=null),f.error("Helper not detected — install it via about:debugging first.")},3e3),oe=_e=>{window.clearTimeout(C),window.removeEventListener("dango:pahe-cookie",oe),m.current=null,l(!1);const Y=Ao(_e);if(Y?.ok&&Y.cookie)d(Y.cookie),f.success("Cookie extracted from helper!");else if(Y?.error==="NO_COOKIE"){const ue=Y.debug?.stores?.length??0,ae=Y.debug?.names??[];f.error(`Helper found no cf_clearance (checked ${ue} stores, saw: ${ae.join(", ")||"none"}) — solve the challenge on the AnimePahe tab first.`)}else f.error("Helper request failed — try again.")};m.current=oe,window.addEventListener("dango:pahe-cookie",oe),window.dispatchEvent(new CustomEvent("dango:get-pahe-cookie"))},w=()=>{const C=c.trim();if(!C){f.error("Please enter the cf_clearance cookie");return}try{localStorage.setItem("animepahe_cookie",C),f.success("Cookie updated successfully! Reloading…"),r?.(),n(),window.setTimeout(()=>window.location.reload(),1e3)}catch{f.error("Failed to save cookie")}};return t(se,{isOpen:e,onClose:n,title:"AnimePahe Verification Required",children:t("div",{className:A.container,children:s===1?t(F,{children:[t("p",{children:"AnimePahe requires a manual verification to bypass Cloudflare/DDoS-Guard protection."}),t("div",{className:A.field,children:[t("label",{children:"Your User-Agent (will be used for requests):"}),t("textarea",{value:a,readOnly:!0,rows:3,className:A.textarea})]}),t("div",{className:A.actions,children:[t("button",{className:A.secondaryButton,onClick:n,children:"Cancel"}),t("button",{className:A.button,onClick:Q,children:"Start Verification (Opens AnimePahe)"})]})]}):t(F,{children:[t("p",{children:["1. Solve the challenge on the ",t("strong",{children:"AnimePahe tab"})," (keep that tab open).",t("br",{}),"2. Copy the ",t("strong",{children:"cf_clearance"})," cookie value using one of these:",t("br",{}),t("br",{}),t("strong",{children:"Chrome / Edge — DevTools:"})," press ",t("code",{children:"F12"})," →"," ",t("strong",{children:"Application"})," → ",t("strong",{children:"Cookies"})," →"," ",t("code",{children:"https://animepahe.pw"}),". Find ",t("strong",{children:"cf_clearance"}),", double-click its ",t("strong",{children:"Value"})," to select it, then copy.",t("br",{}),t("br",{}),t("strong",{children:"Firefox — Storage Inspector:"})," press ",t("code",{children:"F12"})," →"," ",t("strong",{children:"Storage"})," → ",t("strong",{children:"Cookies"})," →"," ",t("code",{children:"https://animepahe.pw"}),". Find ",t("strong",{children:"cf_clearance"}),", right-click the value → ",t("strong",{children:"Copy Value"}),".",t("br",{}),t("br",{}),t("strong",{children:"Either browser — extension:"})," open"," ",t("strong",{children:"Cookie Manager"})," while on the AnimePahe tab, find"," ",t("strong",{children:"cf_clearance"}),", and copy its value (or use the extension's export).",t("br",{}),t("br",{}),"3. Paste it below. Copy ",t("strong",{children:"only the value"})," — remove any"," ",t("code",{children:"cf_clearance="})," prefix or quotes if they were included."]}),B&&t("div",{className:A.hint,children:[t("strong",{children:"Dango helper (one-time setup):"})," ",P?t(F,{children:["type ",t("code",{children:"about:debugging"})," in the address bar →"," ",t("strong",{children:"This Firefox"})," → ",t("strong",{children:"Load Temporary Add-on"})," ","→ open the ",t("code",{children:"dango-extension/firefox"})," folder and pick"," ",t("code",{children:"manifest.json"}),". (Temporary helpers unload when Firefox closes — repeat after a restart.)"]}):t(F,{children:["type ",t("code",{children:"chrome://extensions"})," in the address bar → enable"," ",t("strong",{children:"Developer mode"})," → ",t("strong",{children:"Load unpacked"})," → open the ",t("code",{children:"dango-extension/chrome"})," folder. (Unpacked helpers show a developer-mode notice — expected.)"]})," ","Use this link to download the extension and extract it:"," ",t("a",{href:Lo,target:"_blank",rel:"noreferrer",className:A.link,children:"dango-extension.zip"}),". Then click Extract below and the field fills itself.",t("div",{className:A.actions,children:t("button",{className:A.button,onClick:W,disabled:u,type:"button",children:u?"Extracting…":"Extract cookie from helper"})})]}),t("div",{className:A.field,children:[t("label",{children:"cf_clearance cookie value:"}),t("input",{type:"text",value:c,onChange:C=>d(C.target.value),placeholder:"e.g. xxxxxxxx.xxxxxxxx.xxxxxxx-xxxxxxx",className:A.input})]}),t("div",{className:A.actions,children:[t("button",{className:A.secondaryButton,onClick:n,children:"Cancel"}),t("button",{className:A.secondaryButton,onClick:()=>o(1),children:"Back"}),t("button",{className:A.button,onClick:w,children:"Submit"})]})]})})})};function Do(){const[e,n]=v(!1);return _(()=>{const r=window.setTimeout(()=>n(!0),120);return()=>window.clearTimeout(r)},[]),e?t("div",{className:"top-progress-bar",role:"progressbar","aria-label":"Loading"}):null}class Ro extends Ct{state={hasError:!1};static getDerivedStateFromError(n){return{hasError:!0}}componentDidCatch(n,r){console.error("Uncaught error:",n,r)}render(){return this.state.hasError?t("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100vh",width:"100%",backgroundColor:"#1a1b1c",color:"#fff",textAlign:"center",padding:"2rem"},children:[t(g,{name:"exclamation-triangle",style:{fontSize:"4rem",color:"#ff4d4d",marginBottom:"1rem"}}),t("h1",{style:{marginBottom:"1rem"},children:"Something went wrong"}),t("p",{style:{color:"#aaa",marginBottom:"2rem"},children:"The application encountered an unexpected error."}),t("button",{onClick:()=>{this.setState({hasError:!1}),window.location.href="/"},style:{padding:"0.8rem 1.5rem",backgroundColor:"var(--accent, #3d5afe)",color:"#fff",border:"none",borderRadius:"0.5rem",cursor:"pointer",display:"flex",alignItems:"center",gap:"0.5rem",fontSize:"1rem",transition:"background-color 0.2s"},onMouseOver:n=>n.currentTarget.style.backgroundColor="#536dfe",onMouseOut:n=>n.currentTarget.style.backgroundColor="var(--accent, #3d5afe)",children:[t(g,{name:"home"}),"Go back Home"]})]}):this.props.children}}const It=te(void 0),qo=({children:e})=>{const[n,r]=v(!1),s=R(()=>r(!0),[]),o=R(()=>r(!1),[]);return _(()=>ct("lan",s),[s]),t(It.Provider,{value:{isOpen:n,openModal:s,closeModal:o},children:e})},Mo=()=>{const e=ne(It);if(!e)throw new Error("useLanAuth must be used within a LanAuthProvider");return e},Bo="_container_88bss_1",Fo="_field_88bss_8",Ko="_input_88bss_19",jo="_actions_88bss_37",he={container:Bo,field:Fo,input:Ko,actions:jo},Ve=$t(({variant:e="primary",size:n="md",loading:r,children:s,className:o="",disabled:a,...i},c)=>{const d=["btn",`btn-${e}`,n!=="md"&&`btn-${n}`,r&&"btn-loading",o].filter(Boolean).join(" ");return t("button",{className:d,disabled:a||r,ref:c,...i,children:r?t("span",{className:"btn-spinner"}):s})}),zo=({isOpen:e,onClose:n,onSuccess:r})=>{const[s,o]=v(""),[a,i]=v(!1);Te.useEffect(()=>{e&&o("")},[e]);const c=async()=>{if(!s){f.error("Please enter your password");return}i(!0);try{const d=await fetch("/api/auth/app-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:s})}),u=await d.json().catch(()=>({}));if(!d.ok){f.error(u.error||"Login failed");return}f.success("Authenticated successfully"),r(),n(),window.location.reload()}catch{f.error("Network error")}finally{i(!1)}};return t(se,{isOpen:e,onClose:n,title:"LAN Authentication Required",children:t("div",{className:he.container,children:[t("p",{children:"This instance is protected. Enter the password to access from this device."}),t("div",{className:he.field,children:[t("label",{htmlFor:"lan-password",children:"Password"}),t("input",{id:"lan-password",type:"password",value:s,onChange:d=>o(d.target.value),placeholder:"Enter password...",className:he.input,onKeyDown:d=>d.key==="Enter"&&c()})]}),t("div",{className:he.actions,children:[t(Ve,{variant:"secondary",onClick:n,disabled:a,children:"Cancel"}),t(Ve,{variant:"primary",onClick:c,loading:a,children:"Unlock"})]})]})})},Wo=I(()=>x(()=>import("./Home-thJhPfs1.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29]))),Uo=I(()=>x(()=>import("./Watchlist-P6YMZUdF.js"),__vite__mapDeps([30,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,31,32]))),Vo=I(()=>x(()=>import("./Settings-BgPWBl2V.js"),__vite__mapDeps([33,1,2,3,34]))),Qe=I(()=>x(()=>import("./Player-BEtAYps2.js"),__vite__mapDeps([35,1,2,36,3,37,38,23,10,17,18,6,7,8,22,39,40,41,42,43]))),Qo=I(()=>x(()=>import("./Search-C8e2nlDD.js"),__vite__mapDeps([44,1,3,4,5,2,6,7,8,9,10,11,12,13,14,15,45,46]))),Ho=I(()=>x(()=>import("./Mature-Dqh_9SA3.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,23,22,45,46,48]))),He=I(()=>x(()=>import("./Asmr-B6ZiqkmU.js"),__vite__mapDeps([49,1,3,2,9,7,10,11,28,50,51,52,38]))),Jo=I(()=>x(()=>import("./Manga-BI9WMTx5.js"),__vite__mapDeps([53,1,3,14,15,9,7,10,11,19,20,2,22,54,55]))),Yo=I(()=>x(()=>import("./MangaInfoPage-DcrEr7Sk.js"),__vite__mapDeps([56,1,3,14,15,20,2,54,55]))),Go=I(()=>x(()=>import("./MangaReadPage-SYg63m48.js"),__vite__mapDeps([57,1,14,3,15,2,20,54,55]))),Zo=I(()=>x(()=>import("./ReadingList-O0QPwXu7.js"),__vite__mapDeps([58,1,9,7,3,10,11,59,12,13,14,15,31,32,19,20,2,21,16]))),Xo=I(()=>x(()=>import("./Radio-B2Q_Egj7.js"),__vite__mapDeps([60,1,3,2,50,51,61,62]))),ea=I(()=>x(()=>import("./Music-zsPwT8_5.js"),__vite__mapDeps([63,1,3,50,51,61,62,2,64]))),Je=I(()=>x(()=>import("./TvSearch-CxU33UOf.js"),__vite__mapDeps([65,1,3,24,9,7,10,11,25,26,2,12,13,14,15,45,46]))),ta=I(()=>x(()=>import("./TvInfo-D_scgw_h.js"),__vite__mapDeps([66,1,3,23,26,2,67]))),na=I(()=>x(()=>import("./Tv-Ca0fCdko.js"),__vite__mapDeps([68,1,3,36,2,37,69,23,22,26,38,10,41,42,70]))),ra=I(()=>x(()=>import("./TvWatchlist-B4X1fWEH.js"),__vite__mapDeps([71,1,9,7,3,10,11,59,12,13,14,15,31,32,16,25,26,2]))),sa=I(()=>x(()=>import("./ListeningList-ctAz_6Zi.js"),__vite__mapDeps([72,1,9,7,3,10,11,59,12,13,14,15,31,32,52,28,2,50,51,27,16]))),oa=I(()=>x(()=>import("./Trackers-Bfoiyuzy.js"),__vite__mapDeps([73,1,2,3,74]))),aa=I(()=>x(()=>import("./Insights-ZlgPrzGD.js"),__vite__mapDeps([75,1,2,3,76]))),ia=I(()=>x(()=>import("./Map-Dj51g5zL.js"),__vite__mapDeps([77,1,3,78]))),ca=I(()=>x(()=>import("./AnimeInfoPage-Dqr5QH6R.js"),__vite__mapDeps([79,1,2,3]))),la=I(()=>x(()=>import("./PlayerRedirect-D70t8VUW.js"),__vite__mapDeps([80,1]))),da=I(()=>x(()=>import("./VirtualKeyboard-6ZNTym4R.js"),__vite__mapDeps([81,1,82])));function ua(){const{isOpen:e,closeModal:n,onSuccess:r}=So(),{isOpen:s,setIsOpen:o}=Pe(),{isOpen:a,openModal:i,closeModal:c}=Mo(),d=Ee(),u=dr(),{showTelemetryModal:l,setShowTelemetryModal:m}=bs();wo();const[h,b]=v("");_(()=>{y("/api/discord-roles-config").then(w=>{w.workerUrl&&b(w.workerUrl)}).catch(()=>{})},[]);const[P,z]=v(!1);_(()=>{fetch("/api/auth/app-status").then(w=>w.json()).then(w=>{w.hasPassword&&!w.isAuthenticated&&(z(!0),i())}).catch(()=>{})},[i]);const[B,Q]=kt("lan_auth_notice_shown","false"),W=q(!1);return _(()=>{if(B==="true"||W.current)return;W.current=!0,Q("true");const w=setTimeout(()=>{f("Optional LAN lock is available. Set a password in Settings to protect access from other devices on your network.",{duration:1e4,icon:"🔒"})},3e3);return()=>clearTimeout(w)},[B,Q]),_(()=>{window.scrollTo(0,0)},[d.pathname]),_(()=>{const w=C=>{s&&C.key==="Escape"&&o(!1)};return s?document.body.classList.add("sidebar-open"):document.body.classList.remove("sidebar-open"),window.addEventListener("keydown",w),()=>{window.removeEventListener("keydown",w),document.body.classList.remove("sidebar-open")}},[s,o]),t("div",{className:"app-container",children:[t(Oo,{isOpen:e,onClose:n,onSuccess:r}),t(Zs,{isOpen:l,onClose:()=>m(!1)}),t(zo,{isOpen:a,onClose:P?()=>{}:c,onSuccess:()=>{z(!1),c()}}),h&&t(yo,{workerUrl:h}),t(xn,{position:"top-center",toastOptions:{style:{background:"var(--bg-elevated)",color:"var(--text-primary)",border:"1px solid var(--border-primary)"},success:{style:{background:"var(--accent)",color:"var(--accent-text)"},iconTheme:{primary:"var(--accent-text)",secondary:"var(--accent)"}},error:{style:{background:"rgba(153, 42, 42, 0.95)",color:"#fff"}}}}),t(Ar,{}),t(Gr,{}),t("main",{className:"main-content",children:t(Ro,{children:t(De,{fallback:t(Do,{}),children:t(Pt,{children:[t(S,{path:"/",element:t(Wo,{})}),t(S,{path:"/watchlist/:filter?",element:t(Uo,{})}),t(S,{path:"/reading-list/:filter?",element:t(Zo,{})}),t(S,{path:"/search",element:t(Qo,{})}),t(S,{path:"/mature",element:t(Ho,{})}),t(S,{path:"/asmr",element:t(He,{})}),t(S,{path:"/asmr/:rj",element:t(He,{})}),t(S,{path:"/manga",element:t(Jo,{})}),t(S,{path:"/manga/:provider/:id",element:t(Yo,{})}),t(S,{path:"/manga/:provider/:id/read",element:t(Go,{})}),t(S,{path:"/radio",element:t(Xo,{})}),t(S,{path:"/music",element:t(ea,{})}),t(S,{path:"/tv",element:t(Je,{})}),t(S,{path:"/tv/:id",element:t(ta,{})}),t(S,{path:"/tv/:id/watch",element:t(na,{})}),t(S,{path:"/tv-search",element:t(Je,{})}),t(S,{path:"/tv-watchlist/:filter?",element:t(ra,{})}),t(S,{path:"/listening-list/:filter?",element:t(sa,{})}),t(S,{path:"/settings",element:t(Vo,{})}),t(S,{path:"/trackers",element:t(oa,{})}),t(S,{path:"/mal",element:t(Re,{to:"/trackers",replace:!0})}),t(S,{path:"/insights",element:t(aa,{})}),t(S,{path:"/map",element:t(ia,{})}),t(S,{path:"/anime/:id",element:t(ca,{})}),t(S,{path:"/watch/:id",element:t(Qe,{})}),t(S,{path:"/watch/:id/:episodeNumber",element:t(Qe,{})}),t(S,{path:"/player/:id/:episodeNumber?",element:t(la,{})}),t(S,{path:"*",element:t(Re,{to:"/",replace:!0})})]})})})}),t(gs,{}),u.isVisible&&t(De,{fallback:null,children:t(da,{activeInputRef:u.activeInputRef,isVisible:u.isVisible,onClose:u.hide})})]})}function ma(){return t(qo,{children:t(ua,{})})}const ha=({children:e})=>{const[n,r]=v(!1),s=R(()=>{r(a=>!a)},[]),o=le(()=>({isOpen:n,setIsOpen:r,toggleSidebar:s}),[n,s]);return t(gt.Provider,{value:o,children:e})},pa=({children:e})=>{const[n,r]=kt("dango_content_type","anime"),s=le(()=>({contentType:n,setContentType:r}),[n,r]);return t(ft.Provider,{value:s,children:e})},ga=({children:e})=>{const[n,r]=v("englishName"),[s,o]=v(!0);_(()=>{(async()=>{try{const c=await fetch("/api/settings?key=titlePreference");if(c.ok){const d=await c.json();d.value&&r(d.value)}}catch(c){console.error("Error fetching title preference in context:",c)}finally{o(!1)}})()},[]);const a=le(()=>({titlePreference:n,setTitlePreference:r,loading:s}),[n,s]);return t(it.Provider,{value:a,children:e})},xt=te(void 0),Ya=()=>{const e=ne(xt);if(e===void 0)throw new Error("useLowEndMode must be used within a LowEndModeProvider");return e},fa=({children:e})=>{const{data:n,isLoading:r}=Ae("lowEndMode"),s=St(),[o,a]=v(!1);_(()=>{n!==void 0&&a(n==="true"||n===!0)},[n]),_(()=>{o?document.body.classList.add("low-end"):document.body.classList.remove("low-end")},[o]);const i=R(d=>{a(d),s.mutate({key:"lowEndMode",value:String(d)})},[s]),c=le(()=>({lowEndMode:o,setLowEndMode:i,loading:r}),[o,i,r]);return t(xt.Provider,{value:c,children:e})},va=["iris","mochi","sakura"];function Ye(e){e==="iris"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e)}const ya=({children:e})=>{const{data:n,isLoading:r}=Ae("theme"),s=St(),[o,a]=v("iris");_(()=>{typeof n=="string"&&va.includes(n)&&a(n)},[n]),_(()=>{Ye(o)},[o]);const i=R(d=>{d!==o&&(a(d),Ye(d),s.mutate({key:"theme",value:d}))},[s,o]),c=le(()=>({theme:o,setTheme:i,loading:r}),[o,i,r]);return t(mt.Provider,{value:c,children:e})},_a=({children:e})=>{const[n,r]=v(!1),[s,o]=v(void 0),a=R(c=>{o(()=>c),r(!0)},[]),i=R(()=>{r(!1),o(void 0)},[]);return _(()=>ct("animepahe",()=>a()),[a]),t(Nt.Provider,{value:{isOpen:n,openModal:a,closeModal:i,onSuccess:s},children:e})},ba=new Ot({defaultOptions:{queries:{staleTime:1e3*60*5,refetchOnWindowFocus:!1,refetchIntervalInBackground:!1,retry:1}}}),Ge=document.getElementById("root");Ge&&Lt(t(At,{children:t(Dt,{client:ba,children:t(_a,{children:t(ha,{children:t(pa,{children:t(ga,{children:t(fa,{children:t(ya,{children:t(ma,{})})})})})})})})}),Ge);export{Ra as $,Ua as A,Ve as B,za as C,$ as D,ht as E,Ja as F,Ke as G,Js as H,vs as I,Fe as J,_s as K,ys as L,se as M,xa as N,Oo as O,Pa as P,lr as Q,A as R,we as S,Ls as T,ct as U,yt as V,Pe as W,Ha as X,Do as Y,Da as Z,x as _,kt as a,Oa as a0,Ea as b,Ca as c,Cn as d,Na as e,En as f,$a as g,vt as h,ja as i,La as j,Aa as k,qa as l,Ma as m,Va as n,Fa as o,Ta as p,y as q,Qa as r,Ia as s,Ka as t,Ya as u,Ba as v,Ae as w,St as x,Wa as y,f as z};