@serifpersia/dango 3.9.7 → 3.9.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -4
- package/client/dist/assets/{AnimeCard-q5F_tD6Q.js → AnimeCard-DewqpGzh.js} +1 -1
- package/client/dist/assets/{AnimeInfo-Y4TzTq4q.js → AnimeInfo-D_Q7e5se.js} +1 -1
- package/client/dist/assets/{AnimeInfoPage-Bu8q7_fN.js → AnimeInfoPage-CDzqc1kE.js} +2 -2
- package/client/dist/assets/{Asmr-DuW_Jtwk.js → Asmr-DdJXXv44.js} +1 -1
- package/client/dist/assets/{AsmrPopup-DmXAjIpT.js → AsmrPopup-Cty7WqGl.js} +1 -1
- package/client/dist/assets/{AsmrResetProgressModal-YlpGKOw-.js → AsmrResetProgressModal-CH8if1av.js} +1 -1
- package/client/dist/assets/{Home-B2O7RdNh.js → Home-fOOTJ5Mv.js} +1 -1
- package/client/dist/assets/{Insights-CT77CDrU.js → Insights-BXIIjvKu.js} +1 -1
- package/client/dist/assets/{LibraryListPage-AJ6hG1L-.js → LibraryListPage-YiGRUJUu.js} +1 -1
- package/client/dist/assets/{ListeningList-GOx1Ir_v.js → ListeningList-D-mxqb0Z.js} +1 -1
- package/client/dist/assets/{Manga-CQKVrxz_.js → Manga-CHGPAvJO.js} +1 -1
- package/client/dist/assets/{MangaInfoPage-BB5cQkBO.js → MangaInfoPage-B2Gpavli.js} +1 -1
- package/client/dist/assets/{MangaReadPage-BDpps3lc.js → MangaReadPage-FFlXE7Ul.js} +1 -1
- package/client/dist/assets/{MangaResetProgressModal-CaJT2NHH.js → MangaResetProgressModal-COfIc2jG.js} +1 -1
- package/client/dist/assets/{Mature-BMXpX3iD.js → Mature-D6KQl_hq.js} +1 -1
- package/client/dist/assets/{MatureConsentModal-C5vPRV5i.js → MatureConsentModal-DpjUSNog.js} +1 -1
- package/client/dist/assets/{MediaCard-MAnVN0Zz.js → MediaCard-Btm1P5WW.js} +1 -1
- package/client/dist/assets/{OptionListMenu-CcJ9TOV5.js → OptionListMenu-DonnPx8t.js} +1 -1
- package/client/dist/assets/{Player-BTtTwYJ2.js → Player-CB8UTo30.js} +2 -2
- package/client/dist/assets/{PlayerProvider-BpSlL46d.js → PlayerProvider-BsAg1WEi.js} +1 -1
- package/client/dist/assets/{PlayerSettings-delaSmdG.js → PlayerSettings-Df7CLn-j.js} +1 -1
- package/client/dist/assets/{QueueOptionsButton-DzBTJGGX.js → QueueOptionsButton-Cj6B0P07.js} +1 -1
- package/client/dist/assets/{QueueRail-BT1sLDAw.js → QueueRail-uj185PNp.js} +1 -1
- package/client/dist/assets/{ReadingList-DmbVYPKy.js → ReadingList-DyLy-7tv.js} +1 -1
- package/client/dist/assets/{ResetProgressModal-BDobxv1I.js → ResetProgressModal-DLr68mM9.js} +1 -1
- package/client/dist/assets/{Search-CxUcaFfI.js → Search-CbPH9KuK.js} +1 -1
- package/client/dist/assets/{Settings-CoTHeSKq.js → Settings-BcE3qLnj.js} +2 -2
- package/client/dist/assets/{SkeletonGrid-9Q4VuO4S.js → SkeletonGrid-m9giJrDw.js} +1 -1
- package/client/dist/assets/{Trackers-DC4EDgyt.js → Trackers-CL19Dz3a.js} +1 -1
- package/client/dist/assets/{Tv-DCnM78Kk.js → Tv-Cvwf6kfG.js} +1 -1
- package/client/dist/assets/{TvInfo-foHQYICS.js → TvInfo-CF-V57eQ.js} +1 -1
- package/client/dist/assets/{TvPopup-DkLU-7pw.js → TvPopup-Fvqq_zfz.js} +1 -1
- package/client/dist/assets/{TvSearch-BwEGJcbq.js → TvSearch-DBBMShrK.js} +1 -1
- package/client/dist/assets/{TvWatchlist-CP92PPZB.js → TvWatchlist-DtRMYBcN.js} +1 -1
- package/client/dist/assets/{VirtualKeyboard-CsmRu3E6.js → VirtualKeyboard-BAit8w5c.js} +1 -1
- package/client/dist/assets/{WatchAlong-CpfZx3Le.js → WatchAlong-x0fVpDw5.js} +1 -1
- package/client/dist/assets/{WatchAlongPanel-Bhu29HGV.js → WatchAlongPanel-BFgij___.js} +1 -1
- package/client/dist/assets/{Watchlist-9ikxJknw.js → Watchlist-BQAmkXi4.js} +1 -1
- package/client/dist/assets/index-Arw9bJwh.js +178 -0
- package/client/dist/assets/index-DmkNa-gz.css +1 -0
- package/client/dist/assets/{libraryInvalidation-DGrdMoRs.js → libraryInvalidation-D2FVJJH7.js} +1 -1
- package/client/dist/assets/{playbackCompletion-Z40dSXOE.js → playbackCompletion-D5cbxqOy.js} +1 -1
- package/client/dist/assets/{useAnimeInfoData-CD7YsaT8.js → useAnimeInfoData-Yk3cvLlr.js} +1 -1
- package/client/dist/assets/{useMangaLibrary--4Q_E3hs.js → useMangaLibrary-B_1FyESm.js} +1 -1
- package/client/dist/assets/{useMangaPopup-E_GgQXOf.js → useMangaPopup-DO8o1xwG.js} +1 -1
- package/client/dist/assets/{useProviders-jAVzdvgi.js → useProviders-BSr5s-nS.js} +1 -1
- package/client/dist/assets/{useTv-C5QkCKNu.js → useTv-B3PUkZ51.js} +1 -1
- package/client/dist/assets/{useTvLibrary-DPJOHbp1.js → useTvLibrary-DGLxk33P.js} +1 -1
- package/client/dist/assets/{useWatchAlongPlayer-CGkmzN8r.js → useWatchAlongPlayer-Wd4W4HZk.js} +1 -1
- package/client/dist/favicon.svg +4 -10
- package/client/dist/index.html +3 -3
- package/client/dist/logo.svg +6 -0
- package/package.json +2 -2
- package/server/dist/server.js +204 -204
- package/server/package.json +1 -1
- package/client/dist/assets/index-COFMCQUU.css +0 -1
- package/client/dist/assets/index-CipsDH5j.js +0 -178
- package/client/dist/repo_logo.svg +0 -33
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Home-B2O7RdNh.js","assets/vendor-core-DfaOB3Rn.js","assets/vendor-query-BBT5_sHx.js","assets/MediaCard-MAnVN0Zz.js","assets/vendor-icons-C1Pj_eSX.js","assets/vendor-ui-3qrARCPr.js","assets/useIsMobile-Dvx1uJ82.js","assets/MatureConsentModal-C5vPRV5i.js","assets/MatureConsentModal-CqewXc0q.css","assets/MediaCard-CJ-18Ma8.css","assets/AnimeCard-q5F_tD6Q.js","assets/useAnimeInfoData-CD7YsaT8.js","assets/QueueOptionsButton-DzBTJGGX.js","assets/QueueOptionsButton-CM15uQn8.css","assets/playbackCompletion-Z40dSXOE.js","assets/SkeletonGrid-9Q4VuO4S.js","assets/SkeletonGrid-BisPI38I.css","assets/ErrorMessage-hMt90aG4.js","assets/ErrorMessage-CXoRbrLN.css","assets/ResetProgressModal-BDobxv1I.js","assets/QueueRail-BT1sLDAw.js","assets/QueueRail-CcHdXRmS.css","assets/useMangaPopup-E_GgQXOf.js","assets/useMangaLibrary--4Q_E3hs.js","assets/libraryInvalidation-DGrdMoRs.js","assets/usePopup-DS9jMzp6.js","assets/MangaResetProgressModal-CaJT2NHH.js","assets/useProviders-jAVzdvgi.js","assets/useTv-C5QkCKNu.js","assets/TvPopup-DkLU-7pw.js","assets/useTvLibrary-DPJOHbp1.js","assets/AsmrResetProgressModal-YlpGKOw-.js","assets/AsmrPopup-DmXAjIpT.js","assets/Home-D_Hd4SUo.css","assets/Watchlist-9ikxJknw.js","assets/LibraryListPage.module-r6k9nyT9.js","assets/LibraryListPage-DmdjNa2U.css","assets/ActiveFilterChips-olGfwxle.js","assets/ActiveFilterChips-QjkplDN2.css","assets/Watchlist-DW7kUORr.css","assets/Settings-CoTHeSKq.js","assets/ToggleSwitch-CN_ppEc9.js","assets/ToggleSwitch-BPil0d_k.css","assets/Settings-B57LhIVH.css","assets/Player-BTtTwYJ2.js","assets/PlayerProvider-BpSlL46d.js","assets/PlayerProvider-ZeplRma-.css","assets/useWatchAlongPlayer-CGkmzN8r.js","assets/useWatchAlongPlayer-Dk7zB7P4.css","assets/AnimeMetaDetails-B3-A7O5H.js","assets/AnimeMetaDetails-BwNQnRCd.css","assets/SynopsisText-B3Sa5pRv.js","assets/SynopsisText-CYv2W3yR.css","assets/WatchAlongPanel-Bhu29HGV.js","assets/WatchAlongPanel-DWb8lSzW.css","assets/Player-1LfYnRyR.css","assets/WatchAlong-CpfZx3Le.js","assets/Search-CxUcaFfI.js","assets/Search.module-C_qwCdHS.js","assets/Search-DCKK3seW.css","assets/Mature-BMXpX3iD.js","assets/Mature-DJmUUtlF.css","assets/Asmr-DuW_Jtwk.js","assets/useAsmrPopup-BBmHrx9v.js","assets/page.module-C1MlZzf3.js","assets/page-DRvjODkg.css","assets/Asmr-Do89pEHG.css","assets/Manga-CQKVrxz_.js","assets/Manga.module-depGEacJ.js","assets/Manga-CqAceKxR.css","assets/MangaInfoPage-BB5cQkBO.js","assets/MangaReadPage-BDpps3lc.js","assets/ReadingList-DmbVYPKy.js","assets/LibraryListPage-AJ6hG1L-.js","assets/TvSearch-BwEGJcbq.js","assets/TvInfo-foHQYICS.js","assets/TvInfo-Bu36xJyO.css","assets/Tv-DCnM78Kk.js","assets/OptionListMenu-CcJ9TOV5.js","assets/Tv-C-bNPNTQ.css","assets/TvWatchlist-CP92PPZB.js","assets/ListeningList-GOx1Ir_v.js","assets/Trackers-DC4EDgyt.js","assets/Trackers-BC636V59.css","assets/Insights-CT77CDrU.js","assets/Insights-DEicrokg.css","assets/AnimeInfoPage-Bu8q7_fN.js","assets/PlayerRedirect-fv2tzEUu.js","assets/VirtualKeyboard-CsmRu3E6.js","assets/VirtualKeyboard-CejCi3pJ.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{N as Dr,k as ae,A as K,q as Y,h as _,S as me,d as v,u as o,X as ye,x as ve,T as De,$ as Mn,g as Mt,L as de,a as jn,c as ut,e as Rr,f as $r,D as Mr,i as jr,P as tn,j as Br,l as B,m as nn,z as V,n as Fr,B as Wr}from"./vendor-core-DfaOB3Rn.js";import{s as Ce,i as Kr,q as Hr,u as se,a as ue,b as U,c as dt,Q as Ur,d as Qr}from"./vendor-query-BBT5_sHx.js";import{I as N}from"./vendor-icons-C1Pj_eSX.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const s of a)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(a){const s={};return a.integrity&&(s.integrity=a.integrity),a.referrerPolicy&&(s.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?s.credentials="include":a.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(a){if(a.ep)return;a.ep=!0;const s=n(a);fetch(a.href,s)}})();const zr="modulepreload",Vr=function(e){return"/"+e},rn={},G=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let l=function(u){return Promise.all(u.map(d=>Promise.resolve(d).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");a=l(n.map(u=>{if(u=Vr(u),u in rn)return;rn[u]=!0;const d=u.endsWith(".css"),m=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${m}`))return;const p=document.createElement("link");if(p.rel=d?"stylesheet":zr,d||(p.as="script"),p.crossOrigin="",p.href=u,c&&p.setAttribute("nonce",c),document.head.appendChild(p),d)return new Promise((h,g)=>{p.addEventListener("load",h),p.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(i){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=i,window.dispatchEvent(c),!c.defaultPrevented)throw i}return a.then(i=>{for(const c of i||[])c.status==="rejected"&&s(c.reason);return t().catch(s)})};let Gr={data:""},Jr=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||Gr},Yr=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Zr=/\/\*[^]*?\*\/| +/g,on=/\n+/g,Te=(e,t)=>{let n="",r="",a="";for(let s in e){let i=e[s];s[0]=="@"?s[1]=="i"?n=s+" "+i+";":r+=s[1]=="f"?Te(i,s):s+"{"+Te(i,s[1]=="k"?"":t)+"}":typeof i=="object"?r+=Te(i,t?t.replace(/([^,])+/g,c=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,c):c?c+" "+l:l)):s):i!=null&&(s=s[1]=="-"?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),a+=Te.p?Te.p(s,i):s+":"+i+";")}return n+(t&&a?t+"{"+a+"}":a)+r},Se={},Bn=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+Bn(e[n]);return t}return e},Xr=(e,t,n,r,a)=>{let s=Bn(e),i=Se[s]||(Se[s]=(l=>{let u=0,d=11;for(;u<l.length;)d=101*d+l.charCodeAt(u++)>>>0;return"go"+d})(s));if(!Se[i]){let l=s!==e?e:(u=>{let d,m,p=[{}];for(;d=Yr.exec(u.replace(Zr,""));)d[4]?p.shift():d[3]?(m=d[3].replace(on," ").trim(),p.unshift(p[0][m]=p[0][m]||{})):p[0][d[1]]=d[2].replace(on," ").trim();return p[0]})(e);Se[i]=Te(a?{["@keyframes "+i]:l}:l,n?"":"."+i)}let c=n&&Se.g;return n&&(Se.g=Se[i]),((l,u,d,m)=>{m?u.data=u.data.replace(m,l):u.data.indexOf(l)===-1&&(u.data=d?l+u.data:u.data+l)})(Se[i],t,r,c),i},eo=(e,t,n)=>e.reduce((r,a,s)=>{let i=t[s];if(i&&i.call){let c=i(n),l=c&&c.props&&c.props.className||/^go/.test(c)&&c;i=l?"."+l:c&&typeof c=="object"?c.props?"":Te(c,""):c===!1?"":c}return r+a+(i??"")},"");function mt(e){let t=this||{},n=e.call?e(t.p):e;return Xr(n.unshift?n.raw?eo(n,[].slice.call(arguments,1),t.p):n.reduce((r,a)=>Object.assign(r,a&&a.call?a(t.p):a),{}):n,Jr(t.target),t.g,t.o,t.k)}let Fn,Pt,Nt;mt.bind({g:1});let ke=mt.bind({k:1});function to(e,t,n,r){Te.p=t,Fn=e,Pt=n,Nt=r}function Ne(e,t){let n=this||{};return function(){let r=arguments;function a(s,i){let c=Object.assign({},s),l=c.className||a.className;n.p=Object.assign({theme:Pt&&Pt()},c),n.o=/go\d/.test(l),c.className=mt.apply(n,r)+(l?" "+l:"");let u=e;return e[0]&&(u=c.as||e,delete c.as),Nt&&u[0]&&Nt(c),Fn(u,c)}return a}}var no=e=>typeof e=="function",it=(e,t)=>no(e)?e(t):e,ro=(()=>{let e=0;return()=>(++e).toString()})(),Wn=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),oo=20,jt="default",Kn=(e,t)=>{let{toastLimit:n}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,n)};case 1:return{...e,toasts:e.toasts.map(i=>i.id===t.toast.id?{...i,...t.toast}:i)};case 2:let{toast:r}=t;return Kn(e,{type:e.toasts.find(i=>i.id===r.id)?1:0,toast:r});case 3:let{toastId:a}=t;return{...e,toasts:e.toasts.map(i=>i.id===a||a===void 0?{...i,dismissed:!0,visible:!1}:i)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(i=>i.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let s=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(i=>({...i,pauseDuration:i.pauseDuration+s}))}}},ot=[],Hn={toasts:[],pausedAt:void 0,settings:{toastLimit:oo}},fe={},Un=(e,t=jt)=>{fe[t]=Kn(fe[t]||Hn,e),ot.forEach(([n,r])=>{n===t&&r(fe[t])})},Qn=e=>Object.keys(fe).forEach(t=>Un(e,t)),ao=e=>Object.keys(fe).find(t=>fe[t].toasts.some(n=>n.id===e)),pt=(e=jt)=>t=>{Un(t,e)},so={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},io=(e={},t=jt)=>{let[n,r]=v(fe[t]||Hn),a=K(fe[t]);_(()=>(a.current!==fe[t]&&r(fe[t]),ot.push([t,r]),()=>{let i=ot.findIndex(([c])=>c===t);i>-1&&ot.splice(i,1)}),[t]);let s=n.toasts.map(i=>{var c,l,u;return{...e,...e[i.type],...i,removeDelay:i.removeDelay||((c=e[i.type])==null?void 0:c.removeDelay)||e?.removeDelay,duration:i.duration||((l=e[i.type])==null?void 0:l.duration)||e?.duration||so[i.type],style:{...e.style,...(u=e[i.type])==null?void 0:u.style,...i.style}}});return{...n,toasts:s}},co=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:n?.id||ro()}),Ve=e=>(t,n)=>{let r=co(t,e,n);return pt(r.toasterId||ao(r.id))({type:2,toast:r}),r.id},X=(e,t)=>Ve("blank")(e,t);X.error=Ve("error");X.success=Ve("success");X.loading=Ve("loading");X.custom=Ve("custom");X.dismiss=(e,t)=>{let n={type:3,toastId:e};t?pt(t)(n):Qn(n)};X.dismissAll=e=>X.dismiss(void 0,e);X.remove=(e,t)=>{let n={type:4,toastId:e};t?pt(t)(n):Qn(n)};X.removeAll=e=>X.remove(void 0,e);X.promise=(e,t,n)=>{let r=X.loading(t.loading,{...n,...n?.loading});return typeof e=="function"&&(e=e()),e.then(a=>{let s=t.success?it(t.success,a):void 0;return s?X.success(s,{id:r,...n,...n?.success}):X.dismiss(r),a}).catch(a=>{let s=t.error?it(t.error,a):void 0;s?X.error(s,{id:r,...n,...n?.error}):X.dismiss(r)}),e};var lo=1e3,uo=(e,t="default")=>{let{toasts:n,pausedAt:r}=io(e,t),a=K(new Map).current,s=Y((m,p=lo)=>{if(a.has(m))return;let h=setTimeout(()=>{a.delete(m),i({type:4,toastId:m})},p);a.set(m,h)},[]);_(()=>{if(r)return;let m=Date.now(),p=n.map(h=>{if(h.duration===1/0)return;let g=(h.duration||0)+h.pauseDuration-(m-h.createdAt);if(g<0){h.visible&&X.dismiss(h.id);return}return setTimeout(()=>X.dismiss(h.id,t),g)});return()=>{p.forEach(h=>h&&clearTimeout(h))}},[n,r,t]);let i=Y(pt(t),[t]),c=Y(()=>{i({type:5,time:Date.now()})},[i]),l=Y((m,p)=>{i({type:1,toast:{id:m,height:p}})},[i]),u=Y(()=>{r&&i({type:6,time:Date.now()})},[r,i]),d=Y((m,p)=>{let{reverseOrder:h=!1,gutter:g=8,defaultPosition:w}=p||{},A=n.filter(k=>(k.position||w)===(m.position||w)&&k.height),O=A.findIndex(k=>k.id===m.id),J=A.filter((k,L)=>L<O&&k.visible).length;return A.filter(k=>k.visible).slice(...h?[J+1]:[0,J]).reduce((k,L)=>k+(L.height||0)+g,0)},[n]);return _(()=>{n.forEach(m=>{if(m.dismissed)s(m.id,m.removeDelay);else{let p=a.get(m.id);p&&(clearTimeout(p),a.delete(m.id))}})},[n,s]),{toasts:n,handlers:{updateHeight:l,startPause:c,endPause:u,calculateOffset:d}}},mo=ke`
|
|
3
|
-
from {
|
|
4
|
-
transform: scale(0) rotate(45deg);
|
|
5
|
-
opacity: 0;
|
|
6
|
-
}
|
|
7
|
-
to {
|
|
8
|
-
transform: scale(1) rotate(45deg);
|
|
9
|
-
opacity: 1;
|
|
10
|
-
}`,po=ke`
|
|
11
|
-
from {
|
|
12
|
-
transform: scale(0);
|
|
13
|
-
opacity: 0;
|
|
14
|
-
}
|
|
15
|
-
to {
|
|
16
|
-
transform: scale(1);
|
|
17
|
-
opacity: 1;
|
|
18
|
-
}`,ho=ke`
|
|
19
|
-
from {
|
|
20
|
-
transform: scale(0) rotate(90deg);
|
|
21
|
-
opacity: 0;
|
|
22
|
-
}
|
|
23
|
-
to {
|
|
24
|
-
transform: scale(1) rotate(90deg);
|
|
25
|
-
opacity: 1;
|
|
26
|
-
}`,fo=Ne("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: ${mo} 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: ${po} 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: ${ho} 0.15s ease-out forwards;
|
|
56
|
-
animation-delay: 180ms;
|
|
57
|
-
transform: rotate(90deg);
|
|
58
|
-
}
|
|
59
|
-
`,go=ke`
|
|
60
|
-
from {
|
|
61
|
-
transform: rotate(0deg);
|
|
62
|
-
}
|
|
63
|
-
to {
|
|
64
|
-
transform: rotate(360deg);
|
|
65
|
-
}
|
|
66
|
-
`,yo=Ne("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: ${go} 1s linear infinite;
|
|
75
|
-
`,vo=ke`
|
|
76
|
-
from {
|
|
77
|
-
transform: scale(0) rotate(45deg);
|
|
78
|
-
opacity: 0;
|
|
79
|
-
}
|
|
80
|
-
to {
|
|
81
|
-
transform: scale(1) rotate(45deg);
|
|
82
|
-
opacity: 1;
|
|
83
|
-
}`,bo=ke`
|
|
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
|
-
}`,wo=Ne("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: ${vo} 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: ${bo} 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
|
-
`,_o=Ne("div")`
|
|
125
|
-
position: absolute;
|
|
126
|
-
`,ko=Ne("div")`
|
|
127
|
-
position: relative;
|
|
128
|
-
display: flex;
|
|
129
|
-
justify-content: center;
|
|
130
|
-
align-items: center;
|
|
131
|
-
min-width: 20px;
|
|
132
|
-
min-height: 20px;
|
|
133
|
-
`,Eo=ke`
|
|
134
|
-
from {
|
|
135
|
-
transform: scale(0.6);
|
|
136
|
-
opacity: 0.4;
|
|
137
|
-
}
|
|
138
|
-
to {
|
|
139
|
-
transform: scale(1);
|
|
140
|
-
opacity: 1;
|
|
141
|
-
}`,So=Ne("div")`
|
|
142
|
-
position: relative;
|
|
143
|
-
transform: scale(0.6);
|
|
144
|
-
opacity: 0.4;
|
|
145
|
-
min-width: 20px;
|
|
146
|
-
animation: ${Eo} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
147
|
-
forwards;
|
|
148
|
-
`,To=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?ae(So,null,t):t:n==="blank"?null:ae(ko,null,ae(yo,{...r}),n!=="loading"&&ae(_o,null,n==="error"?ae(fo,{...r}):ae(wo,{...r})))},Po=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
|
-
`,No=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
|
-
`,Io="0%{opacity:0;} 100%{opacity:1;}",xo="0%{opacity:1;} 100%{opacity:0;}",Co=Ne("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
|
-
`,Ao=Ne("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
|
-
`,Oo=(e,t)=>{let n=e.includes("top")?1:-1,[r,a]=Wn()?[Io,xo]:[Po(n),No(n)];return{animation:t?`${ke(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${ke(a)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},qo=Dr(({toast:e,position:t,style:n,children:r})=>{let a=e.height?Oo(e.position||t||"top-center",e.visible):{opacity:0},s=ae(To,{toast:e}),i=ae(Ao,{...e.ariaProps},it(e.message,e));return ae(Co,{className:e.className,style:{...a,...n,...e.style}},typeof r=="function"?r({icon:s,message:i}):ae(me,null,s,i))});to(ae);var Lo=({id:e,className:t,style:n,onHeightUpdate:r,children:a})=>{let s=Y(i=>{if(i){let c=()=>{let l=i.getBoundingClientRect().height;r(e,l)};c(),new MutationObserver(c).observe(i,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return ae("div",{ref:s,className:t,style:n},a)},Do=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},a=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:Wn()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...a}},Ro=mt`
|
|
174
|
-
z-index: 9999;
|
|
175
|
-
> * {
|
|
176
|
-
pointer-events: auto;
|
|
177
|
-
}
|
|
178
|
-
`,Ye=16,zn=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:a,toasterId:s,containerStyle:i,containerClassName:c})=>{let{toasts:l,handlers:u}=uo(n,s);return ae("div",{"data-rht-toaster":s||"",style:{position:"fixed",zIndex:9999,top:Ye,left:Ye,right:Ye,bottom:Ye,pointerEvents:"none",...i},className:c,onMouseEnter:u.startPause,onMouseLeave:u.endPause},l.map(d=>{let m=d.position||t,p=u.calculateOffset(d,{reverseOrder:e,gutter:r,defaultPosition:t}),h=Do(m,p);return ae(Lo,{id:d.id,key:d.id,onHeightUpdate:u.updateHeight,className:d.visible?Ro:"",style:h},d.type==="custom"?it(d.message,d):a?a(d):ae(qo,{toast:d,position:m}))}))},I=X;const $o="_fadeImage_1bp3x_1",Mo="_loaded_1bp3x_6",an={fadeImage:$o,loaded:Mo},jo=({className:e,onLoad:t,onError:n,...r})=>{const a=r.src,[s,i]=v(null),c=s!==null&&s===a;return o("img",{...r,className:`${e??""} ${an.fadeImage} ${c?an.loaded:""}`,onLoad:l=>{i(a),t?.(l)},onError:l=>{i(a),n?.(l)}})};function ht(e){const t={subscribe(n){let r=null,a=!1,s=!1,i=!1;function c(){if(r===null){i=!0;return}s||(s=!0,typeof r=="function"?r():r&&r.unsubscribe())}return r=e({next(l){var u;a||(u=n.next)===null||u===void 0||u.call(n,l)},error(l){var u;a||(a=!0,(u=n.error)===null||u===void 0||u.call(n,l),c())},complete(){var l;a||(a=!0,(l=n.complete)===null||l===void 0||l.call(n),c())}}),i&&c(),{unsubscribe:c}},pipe(...n){return n.reduce(Bo,t)}};return t}function Bo(e,t){return t(e)}function Fo(e){const t=new AbortController;return new Promise((n,r)=>{let a=!1;function s(){a||(a=!0,i.unsubscribe())}t.signal.addEventListener("abort",()=>{r(t.signal.reason)});const i=e.subscribe({next(c){a=!0,n(c),s()},error(c){r(c)},complete(){t.abort(),s()}})})}function Wo(e){return t=>{let n=0,r=null;const a=[];function s(){r||(r=t.subscribe({next(c){for(const u of a){var l;(l=u.next)===null||l===void 0||l.call(u,c)}},error(c){for(const u of a){var l;(l=u.error)===null||l===void 0||l.call(u,c)}},complete(){for(const l of a){var c;(c=l.complete)===null||c===void 0||c.call(l)}}}))}function i(){if(n===0&&r){const c=r;r=null,c.unsubscribe()}}return ht(c=>(n++,a.push(c),s(),{unsubscribe(){n--,i();const l=a.findIndex(u=>u===c);l>-1&&a.splice(l,1)}}))}}function Ko(e){let t=e;const n=[],r=i=>{t!==void 0&&i.next(t),n.push(i)},a=i=>{n.splice(n.indexOf(i),1)},s=ht(i=>(r(i),()=>{a(i)}));return s.next=i=>{if(t!==i){t=i;for(const c of n)c.next(i)}},s.get=()=>t,s}function Ho(e){return ht(t=>{function n(r=0,a=e.op){const s=e.links[r];if(!s)throw new Error("No more links to execute - did you forget to add an ending link?");return s({op:a,next(i){return n(r+1,i)}})}return n().subscribe(t)})}function Ue(e){"@babel/helpers - typeof";return Ue=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ue(e)}function Uo(e,t){if(Ue(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ue(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qo(e){var t=Uo(e,"string");return Ue(t)=="symbol"?t:t+""}function ce(e,t,n){return(t=Qo(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ee(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sn(Object(n),!0).forEach(function(r){ce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sn(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pe(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}function zo(e){return typeof e=="function"}function Vo(){return Object.create(null)}const Go=typeof Symbol=="function"&&!!Symbol.asyncIterator;function Jo(e){return Go&&Pe(e)&&Symbol.asyncIterator in e}const Yo=e=>e(),Vn=()=>{},cn=e=>{Object.freeze&&Object.freeze(e)};function Gn(e,t,n){var r;const a=t.join(".");return(r=n[a])!==null&&r!==void 0||(n[a]=new Proxy(Vn,{get(s,i){if(!(typeof i!="string"||i==="then"))return Gn(e,[...t,i],n)},apply(s,i,c){const l=t[t.length-1];if(l==="valueOf"||l==="toString"||l==="toJSON")return`tRPC.proxy(${t.slice(0,-1).join(".")})`;let u={args:c,path:t};return l==="call"?u={args:c.length>=2?[c[1]]:[],path:t.slice(0,-1)}:l==="apply"&&(u={args:c.length>=2?c[1]:[],path:t.slice(0,-1)}),cn(u.args),cn(u.path),e(u)}})),n[a]}const Jn=e=>Gn(e,[],Vo()),Zo=e=>new Proxy(Vn,{get(t,n){if(n!=="then")return e(n)}});function Qe(e){"@babel/helpers - typeof";return Qe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qe(e)}function Xo(e,t){if(Qe(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Qe(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ea(e){var t=Xo(e,"string");return Qe(t)=="symbol"?t:t+""}function It(e,t,n){return(t=ea(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ln(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ze(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ln(Object(n),!0).forEach(function(r){It(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ln(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var ta=class extends Error{constructor(e){super(na(e)),Object.assign(this,e)}};function na(e){if("message"in e)return String(e.message)}function ra(e){if(e instanceof Error)return e;const t=typeof e;if(!(t==="undefined"||t==="function"||e===null)){if(t!=="object")return new Error(String(e));if(Pe(e))return new ta(e)}}var un=class extends Error{constructor(e){var t,n,r;const a=ra(e.cause),s=(t=(n=e.message)!==null&&n!==void 0?n:a?.message)!==null&&t!==void 0?t:e.code;super(s,{cause:a}),It(this,"cause",void 0),It(this,"code",void 0),this.code=e.code,this.name="TRPCError",(r=this.cause)!==null&&r!==void 0||(this.cause=a)}};function oa(e,t){if("error"in e){const n=t.deserialize(e.error);return{ok:!1,error:Ze(Ze({},e),{},{error:n})}}return{ok:!0,result:Ze(Ze({},e.result),(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)})}}var wt=class extends Error{constructor(){super("Unable to transform response from server")}};function aa(e,t){let n;try{n=oa(e,t)}catch{throw new wt}if(!n.ok&&(!Pe(n.error.error)||typeof n.error.error.code!="number"))throw new wt;if(n.ok&&!Pe(n.result))throw new wt;return n}function sa(e){return typeof e=="function"}async function ia(e,t){const{_def:n}=e;let r=n.procedures[t];for(;!r;){const a=Object.keys(n.lazy).find(s=>t===s||t.startsWith(s+"."));if(!a)return null;await n.lazy[a].load(),r=n.procedures[t]}return r}async function ca(e){const{type:t,path:n}=e,r=await ia(e.router,n);if(!r||!sa(r)||r._def.type!==t&&!e.allowMethodOverride)throw new un({code:"NOT_FOUND",message:`No "${t}"-procedure on path "${n}"`});if(r._def.type!==t&&e.allowMethodOverride&&r._def.type==="subscription")throw new un({code:"METHOD_NOT_SUPPORTED",message:"Method override is not supported for subscriptions"});return r(e)}function la(e){return e instanceof ct}function ua(e){return Pe(e)&&Pe(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function da(e,t){return typeof e=="string"?e:Pe(e)&&typeof e.message=="string"?e.message:t}var ct=class at extends Error{constructor(t,n){var r,a;const s=n?.cause;super(t,{cause:s}),ce(this,"cause",void 0),ce(this,"shape",void 0),ce(this,"data",void 0),ce(this,"meta",void 0),this.meta=n?.meta,this.cause=s,this.shape=n==null||(r=n.result)===null||r===void 0?void 0:r.error,this.data=n==null||(a=n.result)===null||a===void 0?void 0:a.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,at.prototype)}static from(t,n={}){const r=t;return la(r)?(n.meta&&(r.meta=ee(ee({},r.meta),n.meta)),r):ua(r)?new at(r.error.message,ee(ee({},n),{},{result:r,cause:n.cause})):new at(da(r,"Unknown error"),ee(ee({},n),{},{cause:r}))}};function ma(e){const t=e;return t?"input"in t?t:{input:t,output:t}:{input:{serialize:n=>n,deserialize:n=>n},output:{serialize:n=>n,deserialize:n=>n}}}const dn=e=>typeof e=="function";function pa(e){if(e)return e;if(typeof window<"u"&&dn(window.fetch))return window.fetch.bind(window);if(typeof globalThis<"u"&&dn(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}function ha(...e){const t=new AbortController,n=e.length;let r=0;const a=()=>{++r===n&&t.abort()};for(const s of e)s?.aborted?a():s?.addEventListener("abort",a,{once:!0});return t.signal}function fa(...e){const t=new AbortController;for(const n of e)n?.aborted?t.abort():n?.addEventListener("abort",()=>t.abort(),{once:!0});return t.signal}function ga(e){return{url:e.url.toString(),fetch:e.fetch,transformer:ma(e.transformer),methodOverride:e.methodOverride}}function ya(e){const t={};for(let n=0;n<e.length;n++){const r=e[n];t[n]=r}return t}const va={query:"GET",mutation:"POST",subscription:"PATCH"};function Yn(e){return"input"in e?e.transformer.input.serialize(e.input):ya(e.inputs.map(t=>e.transformer.input.serialize(t)))}const Zn=e=>{const t=e.url.split("?");let n=t[0].replace(/\/$/,"")+"/"+e.path;const r=[];if(t[1]&&r.push(t[1]),"inputs"in e&&r.push("batch=1"),e.type==="query"||e.type==="subscription"){const a=Yn(e);a!==void 0&&e.methodOverride!=="POST"&&r.push(`input=${encodeURIComponent(JSON.stringify(a))}`)}return r.length&&(n+="?"+r.join("&")),n},ba=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=Yn(e);return t!==void 0?JSON.stringify(t):void 0},wa=e=>Sa(ee(ee({},e),{},{contentTypeHeader:"application/json",getUrl:Zn,getBody:ba}));var _a=class extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}};const ka=e=>{var t;if(e?.aborted)throw(t=e.throwIfAborted)===null||t===void 0||t.call(e),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new _a};async function Ea(e){var t,n;ka(e.signal);const r=e.getUrl(e),a=e.getBody(e),s=(t=e.methodOverride)!==null&&t!==void 0?t:va[e.type],i=await(async()=>{const l=await e.headers();return Symbol.iterator in l?Object.fromEntries(l):l})(),c=ee(ee(ee({},e.contentTypeHeader&&s!=="GET"?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{[(n=e.trpcAcceptHeaderKey)!==null&&n!==void 0?n:"trpc-accept"]:e.trpcAcceptHeader}:void 0),i);return pa(e.fetch)(r,{method:s,signal:e.signal,body:a,headers:c})}async function Sa(e){const t={},n=await Ea(e);t.response=n;const r=await n.json();return t.responseJSON=r,{json:r,meta:t}}const mn=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function pn(e){let t=null,n=null;const r=()=>{clearTimeout(n),n=null,t=null};function a(c){const l=[[]];let u=0;for(;;){const p=c[u];if(!p)break;const h=l[l.length-1];if(p.aborted){var d;(d=p.reject)===null||d===void 0||d.call(p,new Error("Aborted")),u++;continue}if(e.validate(h.concat(p).map(g=>g.key))){h.push(p),u++;continue}if(h.length===0){var m;(m=p.reject)===null||m===void 0||m.call(p,new Error("Input is too big for a single dispatch")),u++;continue}l.push([])}return l}function s(){const c=a(t);r();for(const l of c){if(!l.length)continue;const u={items:l};for(const d of l)d.batch=u;e.fetch(u.items.map(d=>d.key)).then(async d=>{await Promise.all(d.map(async(p,h)=>{const g=u.items[h];try{var w;const O=await Promise.resolve(p);(w=g.resolve)===null||w===void 0||w.call(g,O)}catch(O){var A;(A=g.reject)===null||A===void 0||A.call(g,O)}g.batch=null,g.reject=null,g.resolve=null}));for(const p of u.items){var m;(m=p.reject)===null||m===void 0||m.call(p,new Error("Missing result")),p.batch=null}}).catch(d=>{for(const p of u.items){var m;(m=p.reject)===null||m===void 0||m.call(p,d),p.batch=null}})}}function i(c){var l;const u={aborted:!1,key:c,batch:null,resolve:mn,reject:mn},d=new Promise((m,p)=>{var h;u.reject=p,u.resolve=m,(h=t)!==null&&h!==void 0||(t=[]),t.push(u)});return(l=n)!==null&&l!==void 0||(n=setTimeout(s)),d}return{load:i}}function Ta(e){var t,n;const r=ga(e),a=(t=e.maxURLLength)!==null&&t!==void 0?t:1/0,s=(n=e.maxItems)!==null&&n!==void 0?n:1/0;return()=>{const i=l=>({validate(u){if(a===1/0&&s===1/0)return!0;if(u.length>s)return!1;const d=u.map(p=>p.path).join(","),m=u.map(p=>p.input);return Zn(ee(ee({},r),{},{type:l,path:d,inputs:m,signal:null})).length<=a},async fetch(u){const d=u.map(g=>g.path).join(","),m=u.map(g=>g.input),p=ha(...u.map(g=>g.signal)),h=await wa(ee(ee({},r),{},{path:d,inputs:m,type:l,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:u}):e.headers:{}},signal:p}));return(Array.isArray(h.json)?h.json:u.map(()=>h.json)).map(g=>({meta:h.meta,json:g}))}}),c={query:pn(i("query")),mutation:pn(i("mutation"))};return({op:l})=>ht(u=>{if(l.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const d=new AbortController,m=c[l.type].load(ee(ee({},l),{},{signal:fa(l.signal,d.signal)}));let p=!1,h;return m.then(g=>{p=!0,h=g;const w=aa(g.json,r.transformer.output);if(!w.ok){u.error(ct.from(w.error,{meta:g.meta}));return}u.next({context:g.meta,result:w.result}),u.complete()}).catch(g=>{p=!0,u.error(ct.from(g,{meta:h?.meta}))}),()=>{p||d.abort()}})}}const Xn=(e,...t)=>typeof e=="function"?e(...t):e;function Pa(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}async function Na(e){const t=await Xn(e.url);return e.connectionParams?t+`${t.includes("?")?"&":"?"}connectionParams=1`:t}async function Ia(e,t){const n={method:"connectionParams",data:await Xn(e)};return t.encode(n)}function xa(e){const{promise:t,resolve:n,reject:r}=Pa();return e.addEventListener("open",()=>{e.removeEventListener("error",r),n()}),e.addEventListener("error",r),t}function Ca(e,{intervalMs:t,pongTimeoutMs:n}){let r,a;function s(){r=setTimeout(()=>{e.send("PING"),a=setTimeout(()=>{e.close()},n)},t)}function i(){clearTimeout(r),s()}function c(){clearTimeout(a),i()}e.addEventListener("open",s),e.addEventListener("message",({data:l})=>{clearTimeout(r),s(),l==="PONG"&&c()}),e.addEventListener("close",()=>{clearTimeout(r),clearTimeout(a)})}var Aa=class xt{constructor(t){var n;if(ce(this,"id",++xt.connectCount),ce(this,"WebSocketPonyfill",void 0),ce(this,"urlOptions",void 0),ce(this,"keepAliveOpts",void 0),ce(this,"encoder",void 0),ce(this,"wsObservable",Ko(null)),ce(this,"openPromise",null),this.WebSocketPonyfill=(n=t.WebSocketPonyfill)!==null&&n!==void 0?n:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive,this.encoder=t.encoder}get ws(){return this.wsObservable.get()}set ws(t){this.wsObservable.next(t)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++xt.connectCount;const t=Na(this.urlOptions).then(n=>new this.WebSocketPonyfill(n));this.openPromise=t.then(async n=>{this.ws=n,n.binaryType="arraybuffer",n.addEventListener("message",function({data:r}){r==="PING"&&this.send("PONG")}),this.keepAliveOpts.enabled&&Ca(n,this.keepAliveOpts),n.addEventListener("close",()=>{this.ws===n&&(this.ws=null)}),await xa(n),this.urlOptions.connectionParams&&n.send(await Ia(this.urlOptions.connectionParams,this.encoder))});try{await this.openPromise}finally{this.openPromise=null}}async close(){try{await this.openPromise}finally{var t;(t=this.ws)===null||t===void 0||t.close()}}};ce(Aa,"connectCount",0);var er=class{constructor(e){ce(this,"links",void 0),ce(this,"runtime",void 0),ce(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(t=>t(this.runtime))}$request(e){var t;return Ho({links:this.links,op:ee(ee({},e),{},{context:(t=e.context)!==null&&t!==void 0?t:{},id:++this.requestId})}).pipe(Wo())}async requestAsPromise(e){try{const t=this.$request(e);return(await Fo(t)).result.data}catch(t){throw ct.from(t)}}query(e,t,n){return this.requestAsPromise({type:"query",path:e,input:t,context:n?.context,signal:n?.signal})}mutation(e,t,n){return this.requestAsPromise({type:"mutation",path:e,input:t,context:n?.context,signal:n?.signal})}subscription(e,t,n){return this.$request({type:"subscription",path:e,input:t,context:n.context,signal:n.signal}).subscribe({next(r){switch(r.result.type){case"state":var a;(a=n.onConnectionStateChange)===null||a===void 0||a.call(n,r.result);break;case"started":var s;(s=n.onStarted)===null||s===void 0||s.call(n,{context:r.context});break;case"stopped":var i;(i=n.onStopped)===null||i===void 0||i.call(n);break;case"data":case void 0:var c;(c=n.onData)===null||c===void 0||c.call(n,r.result.data)}},error(r){var a;(a=n.onError)===null||a===void 0||a.call(n,r)},complete(){var r;(r=n.onComplete)===null||r===void 0||r.call(n)}})}};const tr=Symbol.for("trpc_untypedClient"),Oa={query:"query",mutate:"mutation",subscribe:"subscription"},qa=e=>Oa[e];function La(e){const t=Jn(({path:n,args:r})=>{const a=[...n],s=qa(a.pop()),i=a.join(".");return e[s](i,...r)});return Zo(n=>n===tr?e:t[n])}function Da(e){return La(new er(e))}function Ra(e){return e[tr]}function ze(e){"@babel/helpers - typeof";return ze=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ze(e)}function $a(e,t){if(ze(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ze(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ma(e){var t=$a(e,"string");return ze(t)=="symbol"?t:t+""}function ja(e,t,n){return(t=Ma(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function M(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hn(Object(n),!0).forEach(function(r){ja(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hn(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ba(e){var t,n,r,a=2;for(typeof Symbol<"u"&&(n=Symbol.asyncIterator,r=Symbol.iterator);a--;){if(n&&(t=e[n])!=null)return t.call(e);if(r&&(t=e[r])!=null)return new st(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function st(e){function t(n){if(Object(n)!==n)return Promise.reject(new TypeError(n+" is not an object."));var r=n.done;return Promise.resolve(n.value).then(function(a){return{value:a,done:r}})}return st=function(r){this.s=r,this.n=r.next},st.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(r){var a=this.s.return;return a===void 0?Promise.resolve({value:r,done:!0}):t(a.apply(this.s,arguments))},throw:function(r){var a=this.s.return;return a===void 0?Promise.reject(r):t(a.apply(this.s,arguments))}},new st(e)}function Fa(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function Wa(e,t){if(e==null)return{};var n,r,a=Fa(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}const Ka=["cursor","direction"];function ft(e){return{path:e.path.join(".")}}function Ha(e){return e.length>=3}function Ua(e){return Ha(e)?{type:"prefixed",prefix:e[0],path:e[1],args:e[2]}:{type:"unprefixed",prefix:void 0,path:e[0],args:e[1]}}function Bt(e,t,n){var r;const a=Ua(e);let s=(r=a.args)===null||r===void 0?void 0:r.input;if(n){var i,c;s=M(M(M({},(i=(c=a.args)===null||c===void 0?void 0:c.input)!==null&&i!==void 0?i:{}),n.pageParam!==void 0?{cursor:n.pageParam}:{}),{},{direction:n.direction})}return[a.path.join("."),s,t?.trpc]}async function Qa(e,t,n){const r=t.getQueryCache().build(t,{queryKey:n});r.setState({data:[],status:"success"});const a=[];var s=!1,i=!1,c;try{for(var l=Ba(e),u;s=!(u=await l.next()).done;s=!1){const d=u.value;a.push(d),r.setState({data:[...a]})}}catch(d){i=!0,c=d}finally{try{s&&l.return!=null&&await l.return()}finally{if(i)throw c}}return a}function we(e){const t=Yo(()=>{const{input:n,type:r}=e,a=e.path.flatMap(s=>s.split("."));if(!n&&r==="any")return a.length?[a]:[];if(r==="infinite"&&Pe(n)&&("direction"in n||"cursor"in n)){const{cursor:s,direction:i}=n;return[a,{input:Wa(n,Ka),type:"infinite"}]}return[a,M(M({},typeof n<"u"&&n!==Ce&&{input:n}),r&&r!=="any"&&{type:r})]});return e.prefix&&t.unshift([e.prefix]),t}function nr(e){const t=[e.path.flatMap(n=>n.split("."))];return e.prefix&&t.unshift([e.prefix]),t}function Ft(e){return zo(e)?e():e}function za(e){var t;const{input:n,query:r,path:a,queryKey:s,opts:i}=e,c=n===Ce,l=async u=>{var d;const m=M(M({},i),{},{trpc:M(M({},i?.trpc),!(i==null||(d=i.trpc)===null||d===void 0)&&d.abortOnUnmount?{signal:u.signal}:{signal:null})});return await r(...Bt(s,m,{direction:u.direction,pageParam:u.pageParam}))};return Object.assign(Kr(M(M({},i??{}),{},{queryKey:s,queryFn:c?Ce:l,initialPageParam:(t=i?.initialCursor)!==null&&t!==void 0?t:n?.cursor})),{trpc:ft({path:a})})}function Va(e){var t,n;const{mutate:r,path:a,prefix:s,opts:i,overrides:c}=e,l=Ft(e.queryClient),u=nr({path:a,prefix:(t=i?.keyPrefix)!==null&&t!==void 0?t:s}),d=l.defaultMutationOptions(l.getMutationDefaults(u)),m=(n=c?.onSuccess)!==null&&n!==void 0?n:(h=>h.originalFn()),p=async h=>await r(...Bt([...u,{input:h}],i));return M(M({},i),{},{mutationKey:u,mutationFn:p,onSuccess(...h){var g,w;return m({originalFn:()=>{var O,J,k;return(O=i==null||(J=i.onSuccess)===null||J===void 0?void 0:J.call(i,...h))!==null&&O!==void 0?O:d==null||(k=d.onSuccess)===null||k===void 0?void 0:k.call(d,...h)},queryClient:l,meta:(g=(w=i?.meta)!==null&&w!==void 0?w:d?.meta)!==null&&g!==void 0?g:{}})},trpc:ft({path:a})})}function Ga(e){const{input:t,query:n,path:r,queryKey:a,opts:s}=e,i=Ft(e.queryClient),c=t===Ce,l=async u=>{var d;const m=M(M({},s),{},{trpc:M(M({},s?.trpc),!(s==null||(d=s.trpc)===null||d===void 0)&&d.abortOnUnmount?{signal:u.signal}:{signal:null})}),p=u.queryKey,h=await n(...Bt(p,m));return Jo(h)?Qa(h,i,p):h};return Object.assign(Hr(M(M({},s),{},{queryKey:a,queryFn:c?Ce:l})),{trpc:ft({path:r})})}const Ja=e=>{const{subscribe:t,path:n,queryKey:r,input:a,opts:s={}}=e,i="enabled"in s?!!s.enabled:a!==Ce,c=l=>t(n.join("."),a===Ce?void 0:a,l);return M(M({},s),{},{enabled:i,subscribe:c,queryKey:r,trpc:ft({path:n})})};function Ya(e){const t=e.keyPrefix,n=r=>(a,s,i)=>"router"in e?Promise.resolve(Ft(e.ctx)).then(c=>ca({router:e.router,path:a,getRawInput:async()=>s,ctx:c,type:r,signal:void 0,batchIndex:0})):(e.client instanceof er?e.client:Ra(e.client))[r](a,s,i);return Jn(({args:r,path:a})=>{const s=[...a],i=s.pop(),[c,l]=r;return{"~types":void 0,pathKey:()=>we({path:s,type:"any",prefix:t}),pathFilter:()=>M(M({},c),{},{queryKey:we({path:s,type:"any",prefix:t})}),queryOptions:()=>Ga({input:c,opts:l,path:s,queryClient:e.queryClient,queryKey:we({path:s,input:c,type:"query",prefix:t}),query:n("query")}),queryKey:()=>we({path:s,input:c,type:"query",prefix:t}),queryFilter:()=>M(M({},l),{},{queryKey:we({path:s,input:c,type:"query",prefix:t})}),infiniteQueryOptions:()=>za({input:c,opts:l,path:s,queryKey:we({path:s,input:c,type:"infinite",prefix:t}),query:n("query")}),infiniteQueryKey:()=>we({path:s,input:c,type:"infinite",prefix:t}),infiniteQueryFilter:()=>M(M({},l),{},{queryKey:we({path:s,input:c,type:"infinite",prefix:t})}),mutationOptions:()=>{var u;return Va({opts:c,path:s,prefix:t,queryClient:e.queryClient,mutate:n("mutation"),overrides:(u=e.overrides)===null||u===void 0?void 0:u.mutations})},mutationKey:()=>nr({path:s,prefix:t}),subscriptionOptions:()=>Ja({opts:l,path:s,input:c,queryKey:we({path:s,input:c,type:"any",prefix:t}),subscribe:n("subscription")})}[i]()})}function Za(){const e=ye(null),t=ye(null),n=s=>{const i=De(()=>Ya({client:s.trpcClient,queryClient:s.queryClient,keyPrefix:s.keyPrefix}),[s.trpcClient,s.queryClient,s.keyPrefix]);return ae(e.Provider,{value:s.trpcClient},ae(t.Provider,{value:i},s.children))};n.displayName="TRPCProvider";function r(){const s=ve(t);if(!s)throw new Error("useTRPC() can only be used inside of a <TRPCProvider>");return s}function a(){const s=ve(e);if(!s)throw new Error("useTRPCClient() can only be used inside of a <TRPCProvider>");return s}return{TRPCProvider:n,useTRPC:r,useTRPCClient:a}}const Ct={lan:new Set,animepahe:new Set,jasmr:new Set};function xe(e){for(const t of[...Ct[e]])try{t()}catch(n){console.error(`auth-bus listener failed (${e}):`,n)}}function rr(e,t){return Ct[e].add(t),()=>{Ct[e].delete(t)}}let lt="default";function or(){return lt}function Xa(e){lt=e}const es=new Set(["playerVideoDelayMs","playerVideoDelayEnabled","anime4kEnabled"]);function Xe(e){return lt==="default"||es.has(e)?e:`dango:profile:${lt}:${e}`}const ne={keyFor:Xe,getItem:e=>localStorage.getItem(Xe(e)),setItem:(e,t)=>localStorage.setItem(Xe(e),t),removeItem:e=>localStorage.removeItem(Xe(e))};function ts(){localStorage.setItem("dango:profile-session-change",`${Date.now()}-${Math.random()}`),window.location.assign("/")}const ns=(e,t)=>new Promise((n,r)=>{t?.throwIfAborted();const a=()=>{clearTimeout(s),r(t?.reason)},s=setTimeout(()=>{t?.removeEventListener("abort",a),n()},e);t?.addEventListener("abort",a,{once:!0})}),Wt=async(e,t)=>{const n=e instanceof Request?e:void 0,r=new Headers(n?.headers);(!t?.body||!(t.body instanceof FormData))&&r.set("Content-Type","application/json");const a=n?.url??e.toString(),s=a.startsWith("/")&&!a.startsWith("//")||typeof window<"u"&&new URL(a,window.location.origin).origin===window.location.origin;if(s){!a.includes("/api/profiles/status")&&!a.includes("/api/profiles/login")&&!a.includes("/api/auth/app-")&&r.set("x-dango-profile-id",or());let m=ne.getItem("animepahe_ua"),p=ne.getItem("animepahe_cookie");p&&m&&m!==navigator.userAgent&&(ne.removeItem("animepahe_cookie"),ne.removeItem("animepahe_ua"),p=null,m=null,I.error("Your browser changed. Verify AnimePahe again to refresh its cookie."),xe("animepahe"));const h=ne.getItem("jasmr_ua"),g=ne.getItem("jasmr_cookie");m&&r.set("x-animepahe-ua",m),p&&r.set("x-animepahe-cookie",p),h&&r.set("x-jasmr-ua",h),g&&r.set("x-jasmr-cookie",g)}new Headers(t?.headers).forEach((m,p)=>r.set(p,m));const i={...t,headers:r},c=(t?.method??n?.method??"GET").toUpperCase(),l=t?.signal??n?.signal,u=s&&(c==="GET"||c==="HEAD");let d=await fetch(e,i);s&&d.status===409&&(await d.clone().json().catch(()=>null))?.error==="PROFILE_CHANGED"&&window.location.reload(),s&&d.status===401&&!a.includes("/api/profiles/")&&(await d.clone().json().catch(()=>null))?.error==="PROFILE_AUTH_REQUIRED"&&window.dispatchEvent(new Event("dango:profile-auth-required"));for(let m=0;u&&d.status===503&&d.headers.get("x-dango-not-ready")==="1"&&m<3;m++)await d.body?.cancel(),await ns(500*2**m,l),d=await fetch(e,i);return d},Oe=async(e,t)=>{const n=await Wt(e,t);if(!n.ok){const r=await n.text().catch(()=>"");let a={};try{a=JSON.parse(r)}catch{}const s=typeof a.error=="string"?a.error:"";throw n.status===403&&s==="AUTH_REQUIRED"&&a.provider==="animepahe"&&xe("animepahe"),n.status===403&&s==="AUTH_REQUIRED"&&a.provider==="jasmr"&&xe("jasmr"),n.status===401&&s==="LAN_AUTH_REQUIRED"&&xe("lan"),new Error(s||`Failed to fetch from ${e}`)}return n.json()};async function rs(e,t){const n=await Wt(e,t);if(n.status===401)try{(await n.clone().json())?.error==="LAN_AUTH_REQUIRED"&&xe("lan")}catch{}return await os(n),n}async function os(e){try{if(!e.headers.get("content-type")?.includes("json"))return;const t=await e.clone().json(),n=Array.isArray(t)?t:[t];for(const r of n){const a=r?.error;if(!a||typeof a!="object")continue;const s=a.data?.cause;(a.message==="AUTH_REQUIRED"||s?.code==="AUTH_REQUIRED")&&(s?.provider==="animepahe"||s?.provider==="jasmr")&&xe(s.provider),(a.message==="LAN_AUTH_REQUIRED"||s?.code==="LAN_AUTH_REQUIRED")&&xe("lan")}}catch{}}const{TRPCProvider:as,useTRPC:j}=Za(),re=Da({links:[Ta({url:"/api/trpc",fetch:rs})]}),ss="_overlay_5hzq9_1",is="_fadeIn_5hzq9_1",cs="_content_5hzq9_11",ls="_modalIn_5hzq9_1",us="_sm_5hzq9_29",ds="_md_5hzq9_33",ms="_lg_5hzq9_37",ps="_title_5hzq9_41",hs="_closeButton_5hzq9_48",fs="_body_5hzq9_74",gs="_footer_5hzq9_78",qe={overlay:ss,fadeIn:is,content:cs,modalIn:ls,sm:us,md:ds,lg:ms,title:ps,closeButton:hs,body:fs,footer:gs};function ar({children:e}){return o("h2",{className:qe.title,children:e})}function sr({children:e}){return o("div",{className:qe.body,children:e})}function ir({children:e}){return o("div",{className:qe.footer,children:e})}function Re({isOpen:e,onClose:t,title:n,children:r,footer:a,width:s="md"}){const i=K(null),[c,l]=v(document.body);return _(()=>{if(!e)return;const u=()=>l(document.fullscreenElement??document.body);return u(),document.addEventListener("fullscreenchange",u),()=>document.removeEventListener("fullscreenchange",u)},[e]),_(()=>{if(!e)return;const u=m=>{m.key==="Escape"&&t?.()};document.addEventListener("keydown",u);const d=document.body.style.overflow;return document.body.style.overflow="hidden",i.current?.focus(),()=>{document.removeEventListener("keydown",u),document.body.style.overflow=d}},[e,t]),e?Mn(o("div",{role:"presentation",onMouseDown:u=>u.stopPropagation(),children:[o("div",{className:qe.overlay,onClick:()=>t?.(),"aria-hidden":"true"}),o("div",{ref:i,className:`${qe.content} ${qe[s]}`,role:"dialog","aria-modal":"true","aria-label":n,tabIndex:-1,children:[n&&o(ar,{children:n}),o(sr,{children:r}),a&&o(ir,{children:a})]})]}),c):null}Re.Header=ar;Re.Body=sr;Re.Actions=ir;const je=new Map,ys=500,cr=(e,t,n)=>{if(!e||e.trim()==="")return"/placeholder.svg";if(e.includes("/api/image-proxy")){let i=e;if(t&&!i.includes("w=")){const c=i.includes("?")?"&":"?";i+=`${c}w=${t}`}if(n&&!i.includes("h=")){const c=i.includes("?")?"&":"?";i+=`${c}h=${n}`}return i}let r=e;r.includes("aln.youtube-anime.com")&&(r=r.replace(/https?:\/\/allanime\.day\/aln\.youtube-anime\.com/,"https://aln.youtube-anime.com"),r.includes("/images/mcovers")&&(r=r.replace("/images/mcovers","/mcovers")),r.includes("/images/images2")&&(r=r.replace("/images/images2","/images2"))),r.includes("allanime.day/s4.anilist.co")&&(r=r.replace(/https?:\/\/allanime\.day\/s4\.anilist\.co/,"https://s4.anilist.co")),r.includes("wp.youtube-anime.com/s4.anilist.co")&&(r=r.replace(/https?:\/\/wp\.youtube-anime\.com\/s4\.anilist\.co/,"https://s4.anilist.co"));const a=`${r}-${t}-${n}`;if(je.has(a))return je.get(a);let s;if(r.startsWith("https://s4.anilist.co"))s=r,t&&(s+=`${s.includes("?")?"&":"?"}w=${t}`),n&&(s+=`${s.includes("?")?"&":"?"}h=${n}`);else if(r.includes("animepahe")){s=`/api/image-proxy?url=${encodeURIComponent(r)}`;const i=ne.getItem("animepahe_cookie"),c=ne.getItem("animepahe_ua");i&&(s+=`&cookie=${encodeURIComponent(i)}`),c&&(s+=`&ua=${encodeURIComponent(c)}`)}else if(r.startsWith("http"))s=`/api/image-proxy?url=${encodeURIComponent(r)}`,t&&(s+=`&w=${t}`),n?s+=`&h=${n}`:t||(s+="&w=300");else{const c=`${r.startsWith("mcovers")||r.startsWith("images2")?"https://aln.youtube-anime.com":"https://aln.youtube-anime.com/images"}/${r}`;s=`/api/image-proxy?url=${encodeURIComponent(c)}`,t&&(s+=`&w=${t}`),n?s+=`&h=${n}`:t||(s+="&w=300")}return je.size>ys&&je.clear(),je.set(a,s),s},gd=e=>{if(isNaN(e)||e<=0)return"00:00";const t=new Date(e*1e3).toISOString().slice(11,19);return parseInt(t.slice(0,2),10)>0?t:t.slice(3)};function yd(e){return e?e.replace(/<[^>]*>?/gm,"").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").trim():""}function vd(e){return e==null?e:e>10?Number((e/10).toFixed(1)):e}const vs=(...e)=>e.filter(Boolean).join(" ");function bs(e,t,n="..."){return e?e.length>t?e.slice(0,t)+n:e:""}const lr=ye(void 0),ur=()=>{const e=ve(lr);if(e===void 0)throw new Error("useTitlePreference must be used within a TitlePreferenceProvider");return e},x={watchlist:"watchlist",continueWatching:"allContinueWatching",queueRemaining:"queue-remaining",suggestedEpisode:"suggestedEpisode",trendingList:"trendingList",latestReleases:"latestReleases",thisWeekSchedule:"thisWeekSchedule",schedule:"schedule",genreCards:"genreCards",queue:"queue",playerData:"player-data",showData:"show-data",showMeta:"show-meta",videoSources:"video-sources",tvSources:"tv-sources",tvLibrary:"tv-library",tvContinueWatching:"tv-continue-watching",tvProgress:"tv-progress",mangaLibrary:"manga-library",mangaContinueReading:"manga-continue-reading",mangaProgress:"manga-progress",mangaBrowse:"mangaBrowse",mangaBrowseInfinite:"mangaBrowseInfinite",mangaDetail:"mangaDetail",mangaPages:"mangaPages",asmrLibrary:"asmr-library",asmrContinueListening:"asmr-continue-listening",asmrProgress:"asmr-progress",asmrBrowse:"asmrBrowse",asmrWork:"asmrWork",trackerStatus:"trackerStatus",anilistClientId:"anilistClientId",malClientConfig:"malClientConfig",notifications:"notifications",settings:"settings",insights:"insights",insightsRecommendations:"insights-recommendations",providers:"providers",syncProfile:"sync-profile"},bd=()=>{const e=j(),t=U({...e.data.spotlight.queryOptions(),staleTime:1e3*60*5,retry:1});return{...t,data:t.data}},wd=(e="TRENDING_DESC",t=10)=>dt({queryKey:[x.trendingList,e,t],queryFn:({pageParam:n=1})=>re.data.popularList.query({sort:e,page:n,size:t}),initialPageParam:1,getNextPageParam:(n,r)=>n.length>=t?r.length+1:void 0}),_d=(e="TV",t=12)=>dt({queryKey:[x.latestReleases,e,t],queryFn:({pageParam:n=1})=>re.data.latestReleases.query({format:e,page:n,size:t}),initialPageParam:1,getNextPageParam:(n,r)=>n.length>=t?r.length+1:void 0}),kd=(e,t="TV",n=!0)=>{const r=j();return U({...r.data.seasonal.queryOptions({page:e,format:t}),enabled:n,staleTime:1e3*60*5})},ws=["query","sortBy","type","status","season","year","country","genres","excludeGenres","excludeTags","minScore","minEpisodes","adult"],Ed=(e,t,n=14)=>{const r=j(),a=new URLSearchParams(e),s={page:t,limit:n};for(const i of ws){const c=a.get(i);c!==null&&(s[i]=c)}return U({...r.data.search.queryOptions(s),enabled:e!=null})},Sd=()=>{const e=j();return U(e.queue.list.queryOptions())},_s=()=>{const e=j(),t=se();return ue(e.queue.add.mutationOptions({onSuccess:n=>{n.queued?I.success("Added to queue"):I.success("Removed from queue"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:[x.queueRemaining]})},onError:n=>{I.error(`Failed to update queue: ${n.message}`)}}))},Td=()=>{const e=j(),t=se();return ue(e.queue.remove.mutationOptions({onSuccess:()=>{I.success("Removed from queue"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:[x.queueRemaining]}),t.invalidateQueries({queryKey:[x.continueWatching]})},onError:n=>{I.error(`Failed to remove: ${n.message}`)}}))},Pd=(e,t=!0)=>U({queryKey:[x.queueRemaining,e],queryFn:()=>re.watchlist.queueRemaining.query({showId:e}),enabled:!!e&&t,staleTime:1e3*60}),Nd=()=>{const e=j(),t=se();return ue(e.queue.addBatch.mutationOptions({onSuccess:(n,r)=>{const a=n.added??r.episodeNumbers.length;I.success(`${a} ${a===1?"episode":"episodes"} added to queue`),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:[x.queueRemaining]})},onError:n=>{I.error(`Failed to update queue: ${n.message}`)}}))},Id=()=>{const e=j(),t=se();return ue(e.queue.removeMany.mutationOptions({onSuccess:()=>{I.success("Removed from queue"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:[x.queueRemaining]}),t.invalidateQueries({queryKey:[x.continueWatching]})},onError:n=>{I.error(`Failed to remove: ${n.message}`)}}))},xd=()=>{const e=j(),t=se();return ue(e.queue.clear.mutationOptions({onSuccess:()=>{I.success("Queue cleared"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:[x.queueRemaining]}),t.invalidateQueries({queryKey:[x.continueWatching]})},onError:n=>{I.error(`Failed to clear queue: ${n.message}`)}}))},Cd=()=>{const e=j(),t=se(),n=e.queue.list.queryOptions().queryKey;return ue(e.queue.reorder.mutationOptions({onMutate:async r=>{await t.cancelQueries({queryKey:n});const a=t.getQueryData(n);return t.setQueryData(n,s=>{if(!s)return s;const i=new Map(s.map(c=>[c.id,c]));return r.map((c,l)=>{const u=i.get(c.id??-1);return u?{...u,queue_order:l}:void 0}).filter(c=>!!c)}),{previousQueue:a}},onError:(r,a,s)=>{s?.previousQueue&&t.setQueryData(n,s.previousQueue)},onSettled:()=>{t.invalidateQueries(e.queue.pathFilter())}}))},ks=["status","showMature","query","type","season","year","genres","excludeGenres","sortBy","titlePreference"];function Kt(e,t,n){const r=new URLSearchParams(e),a={page:t,limit:n};for(const s of ks){const i=r.get(s);i!==null&&(a[s]=i)}return a}const Ad=(e,t="",n,r=14)=>U({queryKey:[x.watchlist,e,t,n,r],queryFn:async()=>{const a=new URLSearchParams(t);return a.set("status",e),await re.watchlist.list.query(Kt(a.toString(),n,r))}}),Od=(e="")=>dt({queryKey:[x.continueWatching,e],queryFn:async({pageParam:t=1})=>await re.watchlist.continueWatchingAll.query(Kt(e,t,14)),initialPageParam:1,getNextPageParam:t=>{if(!(t.data.length===0||t.page*t.limit>=t.total))return t.page+1},select:t=>({...t,pages:t.pages.flatMap(n=>n.data)})}),qd=(e="",t,n=14)=>U({queryKey:[x.continueWatching,e,t,n],queryFn:async()=>await re.watchlist.continueWatchingAll.query(Kt(e,t,n))}),Ld=()=>{const e=j(),t=se();return ue(e.watchlist.remove.mutationOptions({onSuccess:()=>{I.success("Removed from watchlist"),t.invalidateQueries(e.watchlist.pathFilter()),t.invalidateQueries({queryKey:[x.watchlist]})},onError:n=>{I.error(`Failed to remove: ${n.message}`)}}))},Dd=()=>{const e=j(),t=se();return ue(e.watchlist.batchStatus.mutationOptions({onSuccess:n=>{I.success(`Status updated for ${n.updated??0} items`),t.invalidateQueries(e.watchlist.pathFilter()),t.invalidateQueries({queryKey:[x.watchlist]}),t.invalidateQueries({queryKey:[x.continueWatching]})},onError:n=>{I.error(`Failed to update statuses: ${n.message}`)}}))},Rd=()=>{const e=j(),t=se();return ue(e.watchlist.removeMany.mutationOptions({onSuccess:n=>{const r=n.removed??0;I.success(`Removed ${r} ${r===1?"item":"items"} from watchlist`),t.invalidateQueries(e.watchlist.pathFilter()),t.invalidateQueries({queryKey:[x.watchlist]}),t.invalidateQueries({queryKey:[x.continueWatching]})},onError:n=>{I.error(`Failed to remove: ${n.message}`)}}))},$d=()=>{const e=j(),t=se();return ue(e.continueWatching.removeMany.mutationOptions({onSuccess:n=>{const r=n.removed??0;I.success(`Removed ${r} ${r===1?"item":"items"} from continue watching`),t.invalidateQueries(e.continueWatching.pathFilter()),t.invalidateQueries({queryKey:[x.continueWatching]})},onError:n=>{I.error(`Failed to remove: ${n.message}`)}}))},dr=(e=!0)=>{const t=j();return U({...t.notifications.list.queryOptions(),enabled:e,refetchInterval:3e4})},mr=(e=!0)=>{const t=j();return U({...t.data.systemNotifications.queryOptions(),enabled:e,refetchInterval:3e4})},pr=(e=!0)=>{const t=j();return U({...t.discovery.status.queryOptions(),enabled:e,refetchInterval:n=>n.state.data?.running?2e3:!1})},Es=()=>{const e=j(),t=se(),n=e.discovery.status.queryOptions().queryKey;return ue(e.discovery.refresh.mutationOptions({onSuccess:r=>{t.setQueryData(n,{running:r.running,state:r.state,total:r.total,done:r.done,lastRunAt:r.lastRunAt}),t.invalidateQueries(e.notifications.pathFilter()),t.invalidateQueries({queryKey:[x.notifications]})},onError:()=>{t.invalidateQueries({queryKey:n})}}))},Ss=()=>{const e=j(),t=se();return ue(e.notifications.dismiss.mutationOptions({onSuccess:()=>{t.invalidateQueries(e.notifications.pathFilter())}}))},Ts=()=>{const e=j(),t=se();return ue(e.notifications.clearAll.mutationOptions({onSuccess:()=>{t.invalidateQueries(e.notifications.pathFilter())}}))},Md=()=>{const e=j();return U({...e.continueWatching.thisWeek.queryOptions(),staleTime:1e3*60*5})},jd=()=>{const e=j();return U({...e.data.genresAndTags.queryOptions(),staleTime:1e3*60*60})},Bd=()=>U({queryKey:[x.genreCards],queryFn:()=>re.insights.genreCards.query()}),Ps="_container_1x6po_1",Ns="_bellBtn_1x6po_7",Is="_badge_1x6po_39",xs="_dropdown_1x6po_67",Cs="_dropdownHeader_1x6po_98",As="_headerSubtitle_1x6po_106",Os="_headerActions_1x6po_113",qs="_closeBtn_1x6po_119",Ls="_sectionHeading_1x6po_132",Ds="_clearAllBtn_1x6po_148",Rs="_discoveryStatusRow_1x6po_166",$s="_statusDot_1x6po_177",Ms="_statusDotRunning_1x6po_184",js="_statusDotOk_1x6po_189",Bs="_statusDotError_1x6po_197",Fs="_statusDotIdle_1x6po_201",Ws="_list_1x6po_216",Ks="_item_1x6po_230",Hs="_itemTitleLink_1x6po_241",Us="_systemItemMeta_1x6po_248",Qs="_removeItem_1x6po_249",zs="_modalButton_1x6po_251",Vs="_systemItem_1x6po_248",Gs="_systemIcon_1x6po_264",Js="_thumbnail_1x6po_275",Ys="_itemInfo_1x6po_284",Zs="_itemTitle_1x6po_241",Xs="_itemMeta_1x6po_300",ei="_queueItem_1x6po_365",ti="_fullMessage_1x6po_379",ni="_emptyState_1x6po_385",ri="_emptyIcon_1x6po_403",P={container:Ps,bellBtn:Ns,badge:Is,dropdown:xs,dropdownHeader:Cs,headerSubtitle:As,headerActions:Os,closeBtn:qs,sectionHeading:Ls,clearAllBtn:Ds,discoveryStatusRow:Rs,statusDot:$s,statusDotRunning:Ms,statusDotOk:js,statusDotError:Bs,statusDotIdle:Fs,list:Ws,item:Ks,itemTitleLink:Hs,systemItemMeta:Us,removeItem:Qs,modalButton:zs,systemItem:Vs,systemIcon:Gs,thumbnail:Js,itemInfo:Ys,itemTitle:Zs,itemMeta:Xs,queueItem:ei,fullMessage:ti,emptyState:ni,emptyIcon:ri},oi=({notification:e})=>{const t=Ss(),n=_s(),[r,a]=Mt.useState(!1),s=u=>{u.preventDefault(),u.stopPropagation(),t.mutate({showId:e.showId,episodeNumber:e.episodeNumber})},i=u=>{u.preventDefault(),u.stopPropagation(),a(!0),n.mutate({showId:e.showId,episodeNumber:e.episodeNumber,showName:e.name,showThumbnail:e.thumbnail,nativeName:e.nativeName,englishName:e.englishName}),t.mutate({showId:e.showId,episodeNumber:e.episodeNumber}),window.setTimeout(()=>a(!1),1e3)},{titlePreference:c}=ur(),l=c==="nativeName"?e.nativeName||e.name:c==="englishName"&&e.englishName||e.name;return o("div",{className:P.item,children:[o("img",{src:cr(e.thumbnail,48,64),alt:e.name,className:P.thumbnail,loading:"lazy",decoding:"async"}),o("div",{className:P.itemInfo,children:[o(de,{to:`/watch/${e.showId}/${e.episodeNumber}`,className:P.itemTitleLink,onClick:()=>t.mutate({showId:e.showId,episodeNumber:e.episodeNumber}),children:o("span",{className:P.itemTitle,children:l})}),o("span",{className:P.itemMeta,children:["New Episode ",e.episodeNumber]})]}),o("button",{className:`${P.removeItem} ${P.queueItem}`,onClick:i,title:"Add to queue","aria-label":"Add notification to queue",children:r?o(N,{name:"check"}):o(N,{name:"plus"})}),o("button",{className:P.removeItem,onClick:s,title:"Dismiss","aria-label":"Remove notification",children:o(N,{name:"times"})})]})};function _t({width:e="100%",height:t="1em",variant:n="rectangular",className:r="",style:a}){return o("div",{className:`skeleton skeleton-${n} ${r}`,style:{width:e,height:t,...a}})}const ai=({count:e=3})=>o(me,{children:Array.from({length:e}).map((t,n)=>o("div",{className:P.item,style:{borderBottom:"1px solid var(--border-primary)",pointerEvents:"none"},children:[o("div",{className:P.thumbnail,style:{overflow:"hidden"},children:o(_t,{width:"100%",height:"100%",variant:"rectangular"})}),o("div",{className:P.itemInfo,children:[o(_t,{width:"80%",height:"1rem",variant:"text",style:{marginBottom:"4px"}}),o(_t,{width:"40%",height:"0.7rem",variant:"rectangular",style:{borderRadius:"var(--radius-sm)"}})]})]},n))}),si=({onClose:e})=>{const{data:t=[],isLoading:n}=dr(),{data:r=[]}=mr(),{data:a}=pr(),s=Ts(),i=se(),[c,l]=v(null),u=K(null);_(()=>{u.current?.focus();const h=g=>{g.key==="Escape"&&e()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e]),_(()=>{i.invalidateQueries({queryKey:[x.notifications]})},[i]);const d=r.find(h=>h.id===c)??null,m=t.length+r.length,p=a?.running?a.total>0?`Checking ${Math.min(a.done,a.total)}/${a.total} shows...`:"Checking for new episodes...":a?.state==="complete"?`Discovery complete · checked ${a.total} ${a.total===1?"show":"shows"}`:a?.state==="empty"?"No shows set to Watching":a?.state==="error"?"Last check failed · will retry automatically":a?.lastRunAt?`Last checked ${Math.max(1,Math.round((Date.now()-a.lastRunAt)/1e3))}s ago`:"Auto-checks every few minutes";return o("div",{id:"notification-panel",ref:u,className:P.dropdown,role:"dialog","aria-label":"Notifications",tabIndex:-1,children:[o("div",{className:P.dropdownHeader,children:[o("div",{children:[o("h4",{children:"Notifications"}),o("span",{className:P.headerSubtitle,children:[m," updates"]})]}),o("div",{className:P.headerActions,children:[t.length>0&&o("button",{className:P.clearAllBtn,onClick:()=>s.mutate(void 0),children:"Clear all"}),o("button",{type:"button",className:P.closeBtn,onClick:e,title:"Close","aria-label":"Close notifications",children:o(N,{name:"times"})})]})]}),o("div",{className:P.discoveryStatusRow,children:[o("span",{className:`${P.statusDot} ${a?.running?P.statusDotRunning:a?.state==="complete"?P.statusDotOk:a?.state==="error"?P.statusDotError:P.statusDotIdle}`,"aria-hidden":"true"}),o("span",{children:p})]}),o("div",{className:P.list,children:n&&m===0?o(ai,{count:4}):o(me,{children:[r.length>0&&o("section",{"aria-labelledby":"system-notifications-heading",children:[o("h5",{id:"system-notifications-heading",className:P.sectionHeading,children:"App updates"}),r.map(h=>o("div",{className:`${P.item} ${P.systemItem}`,children:[o("div",{className:P.systemIcon,children:o(N,{name:"info-circle",size:20})}),o("div",{className:P.itemInfo,children:[o("span",{className:P.itemTitle,children:h.title}),o("button",{type:"button",className:P.systemItemMeta,onClick:()=>l(h.id),title:"View full message",children:[bs(h.message,72,"…")," ",o("span",{children:"Read more"})]})]})]},h.id))]}),t.length>0&&o("section",{"aria-labelledby":"new-episodes-heading",children:[o("h5",{id:"new-episodes-heading",className:P.sectionHeading,children:"New episodes"}),t.map(h=>o(oi,{notification:h},h.id))]}),!n&&m===0&&o("div",{className:P.emptyState,children:[o("span",{className:P.emptyIcon,children:o(N,{name:"bell",size:22})}),o("strong",{children:"You’re all caught up"}),o("span",{children:"New episode alerts and app updates will show up here."})]})]})}),o(Re,{isOpen:!!d,onClose:()=>l(null),title:d?.title,width:"sm",footer:o("button",{type:"button",className:P.modalButton,onClick:()=>l(null),children:"OK"}),children:d&&o("p",{className:P.fullMessage,children:d.message})})]})},ii="notification-panel",ci=()=>{const[e,t]=v(!1),n=K(null),r=se(),a=j(),s=Es(),{data:i=[]}=dr(),{data:c=[]}=mr(),{data:l}=pr(),u=i.length+c.length,d=u>9?"9+":u,m=K(!1);_(()=>{const h=g=>{n.current&&!n.current.contains(g.target)&&t(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[]),_(()=>{const h=!!l?.running;m.current&&!h&&(r.invalidateQueries(a.notifications.pathFilter()),r.invalidateQueries(a.discovery.pathFilter()),r.invalidateQueries({queryKey:[x.continueWatching]}),r.invalidateQueries({queryKey:[x.thisWeekSchedule]}),r.invalidateQueries(a.continueWatching.pathFilter()),r.invalidateQueries({queryKey:[x.notifications]})),m.current=h},[l?.running,r,a]);const p=()=>{const h=!e;t(h),h&&s.mutate()};return o("div",{className:P.container,ref:n,children:[o("button",{className:P.bellBtn,onClick:p,"aria-haspopup":"dialog","aria-expanded":e,"aria-controls":ii,"aria-label":"Notifications",children:[o(N,{name:"bell"}),u>0&&o("span",{className:P.badge,"aria-hidden":"true",children:d})]}),e&&o(si,{onClose:()=>t(!1)})]})},gt=e=>{const t=j();return U({...t.settings.getByKey.queryOptions({key:e}),select:n=>n.value})},hr=()=>{const e=j(),t=se();return ue(e.settings.set.mutationOptions({onSuccess:()=>{I.success("Setting updated!"),t.invalidateQueries(e.settings.pathFilter()),t.invalidateQueries({queryKey:[x.settings]})},onError:n=>{I.error(`Failed to update setting: ${n.message}`)}}))},fr=ye(void 0),li=()=>{const e=ve(fr);if(e===void 0)throw new Error("useLowEndMode must be used within a LowEndModeProvider");return e},ge={x:-2.8,y:-2,w:48.6,h:14},At=15,Le={w:13.6,h:10.2},_e=[{x:0,y:.5},{x:At,y:-.9},{x:At*2,y:.3}],fn={x:Le.w/2,y:Le.h/2-.5},kt={y:Le.h/2,x1:-2,x2:At*2+Le.w+1.4},gn=(e,t,n,r=0)=>{if(n.width<=0)return-1;const a=n.width/ge.w,s=(e-n.left)/a+ge.x,i=(t-n.top)/a+ge.y;for(let c=0;c<_e.length;c++){const l=s-_e[c].x,u=i-_e[c].y;if(l>=-r&&l<=Le.w+r&&u>=-r&&u<=Le.h+r)return c}return-1},yn=7.5,vn=e=>Math.max(-1,Math.min(1,e)),ui=(e,t,n,r)=>{const a=n.width/ge.w,s=(e-n.left)/a+ge.x-r.x-fn.x,i=(t-n.top)/a+ge.y-r.y-fn.y;return{x:vn(s/yn),y:vn(i/yn)}},di=["normal","squint"],mi={normal:.72,squint:.28},bn=(e=Math.random(),t)=>{let n=0;for(const r of di)if(n+=mi[r],e<n)return r===t?r==="normal"?"squint":"normal":r;return"normal"},pi="pet",hi="sleep",fi=6e3,gi=420,yi=.5,wn=3e3,vi=3e3,bi=_e.map((e,t)=>t*260),Et={from:_e.length-2,to:_e.length-1,after:400},_n="data-dango-face",St="data-dango-hover",Tt="data-dango-cheer",kn="data-dango-nudge",wi=()=>document.querySelectorAll("svg[data-dango-gaze-origin]"),et=()=>document.querySelectorAll("[data-dango-face-slot]"),_i=e=>e.querySelectorAll("[data-dango-eye]"),ki=()=>document.querySelectorAll("[data-dango-eye]"),gr=()=>{const{data:e}=gt("dangoGaze"),{lowEndMode:t}=li();return e!=="false"&&!t},Ei=()=>{const e=gr();_(()=>{if(!e||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;const t=_e.map(()=>"normal");let n=-1,r=-1,a=!1,s=-1,i=0,c=0,l=0,u=0,d=0;const m=[],p=(b,S)=>{const y=window.setTimeout(()=>{m.splice(m.indexOf(y),1),b()},S);m.push(y)},h=(b,S,y)=>{et().forEach(W=>{Number(W.getAttribute("data-dango-face-slot"))===b&&(y?W.setAttribute(S,""):W.removeAttribute(S))})},g=b=>et().forEach(S=>S.removeAttribute(b)),w=(b,S,y)=>{g(S),requestAnimationFrame(()=>{h(b,S,!0),p(()=>g(S),y)})},A=()=>{et().forEach(b=>{const S=Number(b.getAttribute("data-dango-face-slot"));b.setAttribute(_n,r===S?pi:t[S]),n===S?b.setAttribute(St,""):b.removeAttribute(St)})},O=b=>{b!==r&&(r>=0&&h(r,Tt,!1),r=b,b>=0&&h(b,Tt,!0))},J=()=>{window.clearTimeout(d),d=window.setTimeout(()=>{O(-1),A()},gi)},k=()=>{window.clearTimeout(d),O(-1)},L=()=>{a=!1,bi.forEach((b,S)=>{p(()=>{t[S]=bn(),S===Et.from&&p(()=>w(Et.to,kn,520),Et.after),A()},b)})},te=()=>{a=!0,t.fill(hi),k(),A()},q=()=>{window.clearTimeout(u),u=window.setTimeout(te,fi)},F=()=>{a||(s=(s+1)%t.length,t[s]=bn(Math.random(),t[s]),A()),p(F,wn+Math.random()*vi)},T=()=>{const b=Array.from(wi(),D=>[D,D.getBoundingClientRect()]);b.forEach(([D,pe])=>{_i(D).forEach($e=>{const{x:yt,y:vt}=ui(c,l,pe,_e[Number($e.getAttribute("data-dango-eye"))]);$e.style.setProperty("--dango-gaze-x",yt.toFixed(3)),$e.style.setProperty("--dango-gaze-y",vt.toFixed(3))})});const S=b.find(([,D])=>c>=D.left&&c<=D.right&&l>=D.top&&l<=D.bottom)?.[1]??null,y=n,W=r,C=S?gn(c,l,S):-1,H=C>=0?C:S?gn(c,l,S,yi):-1;n=C,H>=0?(O(H),J()):k(),(y!==n||W!==r)&&A(),a&&L(),q()},$=b=>{c=b.clientX,l=b.clientY,!i&&(i=requestAnimationFrame(()=>{i=0,T()}))},Q=b=>{b.relatedTarget||(n=-1,k(),A(),q())};return A(),q(),p(F,wn),window.addEventListener("pointermove",$,{passive:!0}),window.addEventListener("pointerout",Q),()=>{cancelAnimationFrame(i),window.clearTimeout(u),window.clearTimeout(d),m.forEach(window.clearTimeout),window.removeEventListener("pointermove",$),window.removeEventListener("pointerout",Q),ki().forEach(b=>{b.style.removeProperty("--dango-gaze-x"),b.style.removeProperty("--dango-gaze-y")}),et().forEach(b=>{b.setAttribute(_n,"normal"),b.removeAttribute(St),b.removeAttribute(Tt),b.removeAttribute(kn)})}},[e])},yr=ye(void 0),Fd=()=>{const e=ve(yr);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},Wd=[{id:"iris",label:"Taro (default)",blurb:"Deep purple",swatch:"#7d6df0"},{id:"sakura",label:"Sakura",blurb:"Soft pink",swatch:"#e0b0e0"},{id:"mochi",label:"Mochi",blurb:"Monochrome pearl",swatch:"#f0f0f0"}],Si={iris:{fill:"#897cff",stroke:"#5646db"},mochi:{fill:"#e3e1ee",stroke:"#b3b1c6"},sakura:{fill:"#e1afef",stroke:"#a978a9"}},Ti="_logo_t3il2_1",Pi="_skewer_t3il2_8",Ni="_gaze_t3il2_15",Ii="_face_t3il2_20",xi="_faceNormal_t3il2_25",Ci="_facePet_t3il2_26",Ai="_faceSquint_t3il2_27",Oi="_faceSleep_t3il2_28",qi="_line_t3il2_36",Li="_sway_t3il2_44",Di="_weight_t3il2_58",Ri="_shift_t3il2_73",$i="_rock_t3il2_87",Mi="_glance_t3il2_105",ji="_blinkDouble_t3il2_129 _blink_t3il2_124",Bi="_blinkSlow_t3il2_153 _blink_t3il2_124",Fi="_bump_t3il2_172",Wi="_heart_t3il2_189",Z={logo:Ti,skewer:Pi,gaze:Ni,face:Ii,faceNormal:xi,facePet:Ci,faceSquint:Ai,faceSleep:Oi,line:qi,sway:Li,weight:Di,shift:Ri,rock:$i,glance:Mi,blinkDouble:ji,blinkSlow:Bi,bump:Fi,heart:Wi},En="var(--logo-ink)",Ki="m 7,0 c -3.9372984,0 -7.10030437,2.4883888 -7,6 0.13572675,4.751733 5.0802847,4.156395 7,4.156395 1.2538994,0 6.530451,0.392468 6.584946,-4.168088 C 13.622023,2.8853946 10.937298,0 7,0 Z",Hi="m 4.9623825,3.416 c -0.5858889,0 -0.6520292,2.3368563 -0.024765,2.3368563 0.6604959,0 0.6704653,-2.3368563 0.024765,-2.3368563 z",Ui="M 8.588001,3.416 C 8.0021121,3.416 7.9359718,5.7528563 8.563236,5.7528563 9.2237319,5.7528563 9.2337013,3.416 8.588001,3.416 Z",Qi={pet:"M 4.85,5.15 Q 5.285,4.0 5.72,5.15 M 8.25,5.15 Q 8.618,4.0 8.99,5.15",squint:"M 4.82,3.9 L 5.6,4.62 L 4.82,5.34 M 9.08,3.9 L 8.3,4.62 L 9.08,5.34",sleep:"M 4.9,4.72 Q 5.285,5.28 5.67,4.72 M 8.25,4.72 Q 8.618,5.28 9.0,4.72"},vr=[{lag:.8,hue:"iris",blink:"double",motion:"weight",glances:!1},{lag:1.4,hue:"sakura",blink:"slow",motion:"shift",glances:!1},{lag:1,hue:"mochi",blink:"slow",motion:"rock",glances:!0}],Be=(e,t)=>e+Math.random()*(t-e),zi=vr.map(()=>({blinkDelay:-Be(0,9),blinkDuration:Be(3.4,8.6),motionDelay:-Be(0,9),motionDuration:Be(5.5,11),glanceDelay:-Be(0,11)})),Vi={double:Z.blinkDouble,slow:Z.blinkSlow},Gi={weight:Z.weight,shift:Z.shift,rock:Z.rock},Ji={normal:Z.faceNormal,pet:Z.facePet,squint:Z.faceSquint,sleep:Z.faceSleep},Yi=["normal","pet","squint","sleep"],Zi=[{x:7,y:4.2,delay:0,drift:"0px"},{x:9.6,y:6.4,delay:-.3,drift:"-0.9px"},{x:4.6,y:6.1,delay:-.6,drift:"0.8px"},{x:8.2,y:3.4,delay:-.9,drift:"-0.4px"}],Ht=({className:e})=>{const t=gr();return o("svg",{viewBox:`${ge.x} ${ge.y} ${ge.w} ${ge.h}`,className:e?`${Z.logo} ${e}`:Z.logo,role:"img","aria-label":"dango","data-dango-gaze-origin":"",children:o("g",{className:t?Z.sway:void 0,children:[o("path",{className:Z.skewer,d:`M ${kt.x1},${kt.y} H ${kt.x2}`}),vr.map((n,r)=>{const{x:a,y:s}=_e[r],i=zi[r],{fill:c,stroke:l}=Si[n.hue],u=o("g",{"data-dango-eye":r,className:Z.gaze,style:{"--gaze-dur":`${(.12+n.lag*.18).toFixed(3)}s`},children:Yi.map(d=>o("g",{className:`${Z.face} ${Ji[d]}`,children:o("g",{className:t&&d==="normal"?Vi[n.blink]:void 0,style:t&&d==="normal"?{animationDelay:`${i.blinkDelay}s`,animationDuration:`${i.blinkDuration}s`}:void 0,children:d==="normal"?o(me,{children:[o("path",{fill:En,d:Hi}),o("path",{fill:En,d:Ui})]}):o("path",{className:Z.line,d:Qi[d]})})},d))});return o("g",{transform:`translate(${a} ${s})`,children:o("g",{"data-dango-face-slot":r,"data-dango-face":"normal",className:t?Gi[n.motion]:void 0,style:t?{animationDelay:`${i.motionDelay}s`,animationDuration:`${i.motionDuration}s`}:void 0,children:[o("path",{fill:c,stroke:l,strokeWidth:"0.9",strokeLinejoin:"round",paintOrder:"stroke fill",d:Ki}),o("g",{className:Z.bump,children:[t&&n.glances?o("g",{className:Z.glance,style:{animationDelay:`${i.glanceDelay}s`},children:u}):u,t&&o("g",{children:Zi.map(d=>o("text",{className:Z.heart,x:d.x,y:d.y,fill:"var(--color-danger)",style:{"--drift":d.drift,animationDelay:`${d.delay}s`},children:"♥"},d.x))})]})]})},n.hue)})]})})},br=ye(void 0),Ut=()=>{const e=ve(br);if(e===void 0)throw new Error("useSidebar must be used within a SidebarProvider");return e},wr=ye(void 0),_r=()=>{const e=ve(wr);if(e===void 0)throw new Error("useContentType must be used within a ContentTypeProvider");return e},Ot="virtual-keyboard:hide",Sn="virtual-keyboard:enabled-change",kr="virtual_keyboard_enabled",Xi=!1;function Tn(){const e=ne.getItem(kr);return e===null?Xi:e==="true"}const Pn=e=>e instanceof HTMLInputElement&&e.type==="text"&&!e.disabled&&!e.readOnly;function ec(){window.dispatchEvent(new CustomEvent(Ot))}function tc(){const[e,t]=v(!1),[n,r]=v(Tn),a=K(null);return _(()=>{const s=d=>{n&&Pn(d.target)&&(a.current=d.target,t(!0))},i=d=>{d.target===a.current&&window.setTimeout(()=>{if(Pn(document.activeElement)){a.current=document.activeElement,t(!0);return}a.current=null,t(!1)},0)},c=()=>{a.current=null,t(!1)},l=d=>{if(d.key!==kr)return;const m=d.newValue==="true";r(m),m||c()},u=()=>{const d=Tn();r(d),d||c()};return document.addEventListener("focusin",s),document.addEventListener("focusout",i),window.addEventListener(Ot,c),window.addEventListener("storage",l),window.addEventListener(Sn,u),()=>{document.removeEventListener("focusin",s),document.removeEventListener("focusout",i),window.removeEventListener(Ot,c),window.removeEventListener("storage",l),window.removeEventListener(Sn,u)}},[n]),{activeInputRef:a,isVisible:n&&e,hide:()=>t(!1)}}const nc={queryKey:[x.syncProfile],queryFn:()=>Oe("/api/profiles/current"),staleTime:3e4};function qt({image:e,name:t,size:n=72,radius:r="50%"}){const[a,s]=v(!1);_(()=>s(!1),[e]);const i={width:"100%",height:"100%",maxWidth:n,maxHeight:n,aspectRatio:"1",objectFit:"cover",borderRadius:r};return e&&!a?o("img",{src:e,alt:t,referrerPolicy:"no-referrer",onError:()=>s(!0),style:i}):o("svg",{viewBox:"0 0 24 24",role:"img","aria-label":t,style:i,fill:"currentColor",children:[o("circle",{cx:"12",cy:"8",r:"4"}),o("path",{d:"M4 21v-2a8 8 0 0 1 16 0v2z"})]})}const Qt=e=>String(e).toLowerCase()==="movie"?"movie":"tv",Kd=(e,t)=>`${Qt(e)}:${t}`,rc=(e,t)=>{const n=Qt(e);return`/tv/${t}?type=${n}`},oc=(e,t,n,r)=>{const a=new URLSearchParams;return a.set("type",Qt(e)),n!==void 0&&a.set("s",String(n)),r!==void 0&&a.set("e",String(r)),`/tv/${t}/watch?${a.toString()}`},Hd=e=>e.adult===!0||e.adult===1,Ud={10759:"Action & Adventure",16:"Animation",35:"Comedy",80:"Crime",99:"Documentary",18:"Drama",10751:"Family",10762:"Kids",9648:"Mystery",10765:"Sci-Fi & Fantasy",37:"Western"},Qd={28:"Action",12:"Adventure",16:"Animation",35:"Comedy",80:"Crime",99:"Documentary",18:"Drama",10751:"Family",14:"Fantasy",36:"History",27:"Horror",9648:"Mystery",10749:"Romance",878:"Sci-Fi",53:"Thriller",10752:"War",37:"Western"},zt=300*1e3,ac={mangadex:"https://mangadex.org/",mangapill:"https://www.mangapill.com/"},sc="Dango/3.0 (+https://github.com/serifpersia/dango)",ic=(e,t)=>`/api/proxy?url=${encodeURIComponent(t)}&referer=${encodeURIComponent(ac[e])}`,cc=(e,t)=>t&&(e==="mangadex"?`/api/image-proxy?url=${encodeURIComponent(t)}&ua=${encodeURIComponent(sc)}`:e==="mangapill"?ic(e,t):t),zd=(e,t=!0)=>{const{provider:n,query:r,page:a,sort:s,status:i,type:c,rating:l,mature:u}=e;return U({queryKey:[x.mangaBrowse,n,r,a,s,i,c,l,u],queryFn:()=>re.manga.search.query({provider:n,q:r.trim()||void 0,page:a,sort:s||void 0,status:i||void 0,type:c||void 0,rating:l||void 0,mature:u?"1":void 0}),staleTime:zt,enabled:t})},Vd=(e,t=14)=>{const{provider:n,query:r,sort:a,status:s,type:i,rating:c,mature:l}=e;return dt({queryKey:[x.mangaBrowseInfinite,n,r,a,s,i,c,l,t],queryFn:({pageParam:u=1})=>re.manga.search.query({provider:n,q:r.trim()||void 0,page:u,limit:t,sort:a||void 0,status:s||void 0,type:i||void 0,rating:c||void 0,mature:l?"1":void 0}),initialPageParam:1,getNextPageParam:(u,d)=>u.hasNext?d.length+1:void 0,staleTime:zt,enabled:!0})},Gd=(e,t,n="safe",r=!1)=>U({queryKey:[x.mangaDetail,e,t,n,r],queryFn:()=>re.manga.info.query({provider:e||"",id:t||"",rating:n,mature:r?"1":void 0}),enabled:!!e&&!!t,staleTime:zt}),Jd=(e,t,n)=>U({queryKey:[x.mangaPages,e,t],queryFn:()=>re.manga.pages.query({provider:e||"",id:t||""}),enabled:!!e&&!!t,staleTime:1800*1e3}),Yd=()=>{const e=j(),t=U({...e.manga.trending.queryOptions(),staleTime:600*1e3,retry:1});return{...t,data:t.data}};function lc(e){return String(e||"").trim().toUpperCase()}function Nn(e){return lc(e.id||e._id||"")}function Zd(e){return!!e.isAdult}const uc="_header_3lgqk_1",dc="_hidden_3lgqk_24",mc="_scrolled_3lgqk_28",pc="_logo_3lgqk_37",hc="_headerInner_3lgqk_53",fc="_leftSection_3lgqk_63",gc="_desktopNav_3lgqk_69",yc="_navLink_3lgqk_82",vc="_navLinkActive_3lgqk_101",bc="_navPill_3lgqk_107",wc="_rightSection_3lgqk_125",_c="_searchWrapper_3lgqk_131",kc="_searchIconButton_3lgqk_158",Ec="_searchIcon_3lgqk_158",Sc="_searchInput_3lgqk_185",Tc="_searchKbd_3lgqk_218",Pc="_searchKbdHidden_3lgqk_236",Nc="_searchButton_3lgqk_241",Ic="_profileBtn_3lgqk_251",xc="_profileAvatar_3lgqk_286",Cc="_profileName_3lgqk_293",Ac="_hamburgerBtn_3lgqk_302",Oc="_searchDropdown_3lgqk_330",qc="_searchDropdownNoBar_3lgqk_362",Lc="_searchDropdownHeader_3lgqk_370",Dc="_searchDropdownQuery_3lgqk_378",Rc="_searchDropdownSeeAll_3lgqk_384",$c="_searchDropdownList_3lgqk_401",Mc="_searchDropdownItem_3lgqk_415",jc="_searchDropdownThumb_3lgqk_433",Bc="_searchDropdownItemInfo_3lgqk_442",Fc="_searchDropdownItemTitle_3lgqk_449",Wc="_searchDropdownItemMeta_3lgqk_458",Kc="_mobileSearchBar_3lgqk_497",Hc="_searchIconMobile_3lgqk_568",Uc="_mobileSearchBarHidden_3lgqk_595",Qc="_mobileSearchInner_3lgqk_612",zc="_mobileSearchIcon_3lgqk_628",Vc="_mobileSearchInput_3lgqk_635",E={header:uc,hidden:dc,scrolled:mc,logo:pc,headerInner:hc,leftSection:fc,desktopNav:gc,navLink:yc,navLinkActive:vc,navPill:bc,rightSection:wc,searchWrapper:_c,searchIconButton:kc,searchIcon:Ec,searchInput:Sc,searchKbd:Tc,searchKbdHidden:Pc,searchButton:Nc,profileBtn:Ic,profileAvatar:xc,profileName:Cc,hamburgerBtn:Ac,searchDropdown:Oc,searchDropdownNoBar:qc,searchDropdownHeader:Lc,searchDropdownQuery:Dc,searchDropdownSeeAll:Rc,searchDropdownList:$c,searchDropdownItem:Mc,searchDropdownThumb:jc,searchDropdownItemInfo:Bc,searchDropdownItemTitle:Fc,searchDropdownItemMeta:Wc,mobileSearchBar:Kc,searchIconMobile:Hc,mobileSearchBarHidden:Uc,mobileSearchInner:Qc,mobileSearchIcon:zc,mobileSearchInput:Vc},In=300*1e3,Gc=()=>{const{toggleSidebar:e}=Ut(),{contentType:t}=_r(),n=j(),{titlePreference:r}=ur(),[a,s]=v(""),[i,c]=v(""),[l,u]=v(!0),[d,m]=v(!1),[p,h]=v(!0),[g,w]=v(!1),[A,O]=v({left:0,width:0,opacity:0}),[J,k]=v(!1),L=jn(),te=ut(),q=K(null),F=K(!1),T=K(null),$=K(null),Q=K(null),b=K(null),S=K(!1),y=K(null),W=K(null),C=K(null),{data:H}=U(nc),D=i.length>=2,{data:pe}=U({...n.data.search.queryOptions({query:i,page:1,limit:6}),enabled:D&&t==="anime"}),{data:$e}=U({...n.tv.search.queryOptions({q:i,page:1,type:"multi"}),enabled:D&&t==="tv"}),{data:yt}=U({queryFn:()=>re.manga.search.query({q:i,page:1,limit:6,rating:"safe"}),queryKey:[x.mangaBrowse,"",i,1,"","","","safe",!1],staleTime:In,enabled:D&&t==="manga"}),{data:vt}=U({queryFn:()=>re.asmr.browse.query({q:i,page:1}),queryKey:[x.asmrBrowse,i,1,"",""],staleTime:In,enabled:D&&t==="asmr"}),Jt=t==="anime"?(pe??[]).map(f=>({key:String(f.id),name:r==="nativeName"?f.nativeName||f.name:r==="englishName"&&f.englishName||f.name,meta:f.year,thumb:f.thumbnail?cr(f.thumbnail,48,64):void 0,href:`/anime/${f.id}`})):t==="tv"?($e?.results??[]).map(f=>({key:`${f.type}-${f.id}`,name:f.title,meta:f.year,thumb:f.image||void 0,href:rc(f.type,f.id)})):t==="manga"?(yt?.items??[]).map(f=>({key:`${f.provider}-${f.id}`,name:f.title,meta:f.year,thumb:f.cover?cc(f.provider,f.cover):void 0,href:`/manga/${f.provider}/${encodeURIComponent(f.id)}`})):(vt?.shows??[]).map(f=>({key:Nn(f),name:f.name,thumb:f.thumbnail||void 0,href:`/asmr/${encodeURIComponent(Nn(f))}`}));_(()=>{const f=window.visualViewport;if(!f)return;const oe=()=>{b.current?.style.setProperty("--vv-top",`${f.offsetTop}px`)};return oe(),f.addEventListener("scroll",oe),f.addEventListener("resize",oe),()=>{f.removeEventListener("scroll",oe),f.removeEventListener("resize",oe)}},[]),_(()=>{const f=()=>{q.current&&(window.clearTimeout(q.current),q.current=null)},oe=()=>{f(),!(window.scrollY<=10||d)&&(q.current=window.setTimeout(()=>{S.current||u(!1)},2500))},Je=()=>{F.current||(F.current=!0,T.current=requestAnimationFrame(()=>{F.current=!1,T.current=null;const le=window.scrollY<=10;h(Ee=>Ee===le?Ee:le),u(Ee=>Ee||!0),oe()}))},Me=le=>{const Ee=le.target,Lr=Ee instanceof HTMLElement&&!!Ee.closest('input, textarea, select, button, a, [role="button"], [contenteditable="true"]'),en=()=>{f(),u(!0),window.innerWidth<=1200?(w(!0),setTimeout(()=>Q.current?.focus({preventScroll:!0}),50)):setTimeout(()=>be.current?.focus({preventScroll:!0}),10)};le.key.toLowerCase()==="s"&&!le.metaKey&&!le.ctrlKey&&!le.altKey&&!Lr||(le.metaKey||le.ctrlKey)&&le.key==="k"?(le.preventDefault(),en()):le.key==="Escape"&&document.activeElement===be.current&&be.current?.blur()},Ae=b.current,Zt=()=>{S.current=!0},Xt=()=>{S.current=!1,oe()};return window.addEventListener("scroll",Je,{passive:!0}),window.addEventListener("keydown",Me),Ae?.addEventListener("pointerenter",Zt),Ae?.addEventListener("pointerleave",Xt),()=>{window.removeEventListener("scroll",Je),window.removeEventListener("keydown",Me),Ae?.removeEventListener("pointerenter",Zt),Ae?.removeEventListener("pointerleave",Xt),f(),T.current!==null&&(cancelAnimationFrame(T.current),T.current=null),F.current=!1}},[d]);const be=Mt.useRef(null);_(()=>{if(y.current&&window.clearTimeout(y.current),!a.trim()||a.trim().length<2){c(""),k(!1);return}return y.current=window.setTimeout(()=>{c(a.trim()),d&&k(!0)},500),()=>{y.current&&window.clearTimeout(y.current)}},[a,d]);const Ie=Y(()=>{k(!1)},[]);_(()=>{k(!1),w(!1)},[te.pathname,te.search]),_(()=>{const f=W.current;if(!f)return;const oe=f.querySelector(`.${E.navLinkActive}`);if(!oe){O(Ae=>({...Ae,opacity:0}));return}const Je=f.getBoundingClientRect(),Me=oe.getBoundingClientRect();O({left:Me.left-Je.left,width:Me.width,opacity:1})},[te.pathname]);const Ar=()=>window.innerWidth<=1200,Or=()=>{u(!0),Ar()?(w(!0),setTimeout(()=>Q.current?.focus({preventScroll:!0}),50)):be.current?.focus({preventScroll:!0})},qr=f=>{$.current?.contains(f.relatedTarget)||(w(!1),Ie())},Yt=t==="manga"?"Search manga...":t==="tv"?"Search TV & movies...":t==="asmr"?"Search ASMR...":"Search anime...",bt=t==="manga"?{to:"/reading-list",label:"Reading List"}:t==="tv"?{to:"/tv-watchlist",label:"TV Watchlist"}:t==="asmr"?{to:"/listening-list",label:"Listening List"}:{to:"/watchlist",label:"Watchlist"},Ge=f=>{ec();const oe=a.trim();oe&&(Ie(),be.current?.blur(),m(!1),L(t==="manga"?`/manga?q=${encodeURIComponent(oe)}`:t==="tv"?`/tv-search?q=${encodeURIComponent(oe)}`:t==="asmr"?`/asmr?q=${encodeURIComponent(oe)}`:`/search?query=${encodeURIComponent(oe)}`))};return o(me,{children:o("header",{ref:b,className:`${E.header} ${l?"":E.hidden} ${p?"":E.scrolled}`,children:[o("div",{className:E.headerInner,children:[o("div",{className:E.leftSection,children:[o("button",{className:E.hamburgerBtn,onClick:e,"aria-label":"Menu",children:o(N,{name:"bars"})}),o(de,{to:"/",className:E.logo,"aria-label":"Ani-Web Home",children:o(Ht,{})}),o("nav",{className:E.desktopNav,ref:W,children:[o("span",{className:E.navPill,style:A,"aria-hidden":"true"}),o(de,{to:"/",className:`${E.navLink} ${te.pathname==="/"?E.navLinkActive:""}`,children:"Home"}),o(de,{to:bt.to,className:`${E.navLink} ${te.pathname.startsWith(bt.to)?E.navLinkActive:""}`,children:bt.label}),t==="anime"&&o(de,{to:"/insights",className:`${E.navLink} ${te.pathname==="/insights"?E.navLinkActive:""}`,children:"Insights"})]})]}),o("div",{className:E.rightSection,children:[o("div",{className:E.searchWrapper,ref:C,onClick:()=>be.current?.focus(),children:[o("button",{type:"button",className:E.searchIconButton,"aria-label":"Search",onMouseDown:f=>f.preventDefault(),onClick:f=>{f.stopPropagation(),Ge()},children:o(N,{name:"search",className:E.searchIcon})}),o("input",{ref:be,type:"text","data-virtual-keyboard":"true",className:E.searchInput,placeholder:Yt,value:a,onChange:f=>s(f.currentTarget.value),onFocus:()=>{m(!0),u(!0),i.length>=2&&k(!0)},onBlur:f=>{m(!1),C.current?.contains(f.relatedTarget)||Ie()},onKeyDown:f=>{f.key==="Enter"?Ge():f.key==="Escape"&&(Ie(),be.current?.blur())}}),o("span",{className:`${E.searchKbd} ${a||d?E.searchKbdHidden:""}`,"aria-hidden":"true",children:"Ctrl K"}),o("button",{type:"button",className:E.searchButton,"aria-label":"Search",onMouseDown:f=>f.preventDefault(),onClick:f=>{f.stopPropagation(),Or()},children:o(N,{name:"search",className:E.searchIconMobile})}),J&&Jt.length>0&&o("div",{className:`${E.searchDropdown} ${g?"":E.searchDropdownNoBar}`,onMouseDown:f=>f.preventDefault(),onClick:f=>f.stopPropagation(),children:[o("div",{className:E.searchDropdownHeader,children:[o("span",{className:E.searchDropdownQuery,children:["Results for “",i,"”"]}),o("button",{className:E.searchDropdownSeeAll,onClick:()=>{Ie(),w(!1),m(!1),Ge()},children:"See all"})]}),o("div",{className:E.searchDropdownList,children:Jt.map(f=>o("button",{className:E.searchDropdownItem,onClick:()=>{Ie(),w(!1),m(!1),s(""),be.current?.blur(),L(f.href)},children:[f.thumb&&o(jo,{src:f.thumb,alt:f.name,className:E.searchDropdownThumb,loading:"lazy",decoding:"async"}),o("div",{className:E.searchDropdownItemInfo,children:[o("span",{className:E.searchDropdownItemTitle,children:f.name}),f.meta&&o("span",{className:E.searchDropdownItemMeta,children:f.meta})]})]},f.key))})]})]}),o(ci,{}),o(de,{to:"/settings",className:E.profileBtn,"aria-label":`${H?.name??"Profile"} — profile settings`,title:`${H?.name??"Profile"}${H?.owner?" (owner)":""} — profile settings`,children:[o("span",{className:E.profileAvatar,"aria-hidden":"true",children:o(qt,{image:H?.image,name:H?.name??"Profile"})}),o("span",{className:E.profileName,children:H?.name??"Profile"})]})]})]}),g&&o("div",{className:`${E.mobileSearchBar} ${l?"":E.mobileSearchBarHidden}`,ref:$,onBlur:qr,children:o("div",{className:E.mobileSearchInner,children:[o(N,{name:"search",className:E.mobileSearchIcon}),o("input",{ref:Q,type:"text","data-virtual-keyboard":"true",className:E.mobileSearchInput,placeholder:Yt,value:a,onChange:f=>s(f.currentTarget.value),onFocus:()=>{m(!0),u(!0)},onBlur:()=>m(!1),onKeyDown:f=>{f.key==="Enter"?(Ge(),w(!1),m(!1)):f.key==="Escape"&&(w(!1),m(!1),Ie())}})]})})]})})},Lt="agreedToViewMature";function Dt(){try{return ne.getItem(Lt)==="true"}catch{return!1}}const We=new Set;function Er(e){for(const t of We)t(e)}function tt(){Er(Dt())}function xn(e){try{e?ne.setItem(Lt,"true"):ne.removeItem(Lt)}catch{}Er(e)}function Jc(){const[e,t]=v(Dt);_(()=>(We.add(t),We.size===1&&(window.addEventListener("storage",tt),window.addEventListener("focus",tt)),t(Dt()),()=>{We.delete(t),We.size===0&&(window.removeEventListener("storage",tt),window.removeEventListener("focus",tt))}),[]);const n=Y(()=>xn(!0),[]),r=Y(()=>xn(!1),[]);return{hasConsent:e,grant:n,revoke:r}}const Yc="_sidebar_153jc_1",Zc="_open_153jc_20",Xc="_sidebarHeader_153jc_25",el="_closeBtn_153jc_33",tl="_logo_153jc_57",nl="_navSection_153jc_69",rl="_navLink_153jc_75",ol="_active_153jc_108",al="_overlay_153jc_118",sl="_versionInfo_153jc_138",he={sidebar:Yc,open:Zc,sidebarHeader:Xc,closeBtn:el,logo:tl,navSection:nl,navLink:rl,active:ol,overlay:al,versionInfo:sl},il="3.9.7",Sr={version:il},cl=()=>{const{isOpen:e,setIsOpen:t}=Ut(),{contentType:n}=_r(),{hasConsent:r}=Jc(),a=()=>{t(!1)},s=n==="manga",i=n==="tv",c=n==="asmr",l=[{to:"/",icon:o(N,{name:"home"}),label:"Home"},s?{to:"/manga",icon:o(N,{name:"book"}),label:"Manga"}:i?{to:"/tv-search",icon:o(N,{name:"tv"}),label:"TV and Movies"}:c?{to:"/asmr",icon:o(N,{name:"headphones"}),label:"ASMR"}:{to:"/search",icon:o(N,{name:"search"}),label:"Search"},s?{to:"/reading-list",icon:o(N,{name:"bookmark"}),label:"Reading List"}:i?{to:"/tv-watchlist",icon:o(N,{name:"clock"}),label:"TV Watchlist"}:c?{to:"/listening-list",icon:o(N,{name:"history"}),label:"Listening List"}:{to:"/watchlist",icon:o(N,{name:"clock"}),label:"Watchlist"},...n==="anime"?[{to:"/insights",icon:o(N,{name:"chart-pie"}),label:"Insights"}]:[],{to:"/trackers",icon:o(N,{name:"sync-alt"}),label:"Trackers"},...n==="anime"||i?[{to:"/watch-along",icon:o(N,{name:"play"}),label:"Watch along"}]:[],...r?[{to:"/mature",icon:o(N,{name:"pepper-hot"}),label:"Mature"}]:[],{to:"/settings",icon:o(N,{name:"cog"}),label:"Settings"}];return o(me,{children:[o("aside",{className:`${he.sidebar} ${e?he.open:""} sidebar`,children:[o("div",{className:he.sidebarHeader,children:[o("button",{className:he.closeBtn,onClick:()=>t(!1),"aria-label":"Close menu",children:"×"}),o(de,{to:"/",className:he.logo,onClick:a,children:o(Ht,{})})]}),o("nav",{className:he.navSection,children:l.map(u=>o(Rr,{to:u.to,className:({isActive:d})=>`${he.navLink} ${d?he.active:""}`,onClick:a,end:u.to==="/",children:[u.icon,o("span",{children:u.label})]},u.to))}),o("div",{className:he.versionInfo,children:["v",Sr.version]})]}),e&&o("div",{className:he.overlay,onClick:()=>t(!1),"aria-label":"Close sidebar"})]})},ll="_footer_1c905_1",ul="_footerInner_1c905_15",dl="_brandSection_1c905_27",ml="_logoRow_1c905_39",pl="_logoText_1c905_45",hl="_brandMeta_1c905_51",fl="_brandTagline_1c905_60",gl="_statusPill_1c905_67",yl="_statusDot_1c905_80",vl="_linksGrid_1c905_88",bl="_linkColumn_1c905_96",wl="_columnTitle_1c905_102",_l="_bottomBar_1c905_126",kl="_copyright_1c905_136",El="_brand_1c905_27",Sl="_heartIcon_1c905_152",Tl="_backToTop_1c905_157",z={footer:ll,footerInner:ul,brandSection:dl,logoRow:ml,logoText:pl,brandMeta:hl,brandTagline:fl,statusPill:gl,statusDot:yl,linksGrid:vl,linkColumn:bl,columnTitle:wl,bottomBar:_l,copyright:kl,brand:El,heartIcon:Sl,backToTop:Tl},Pl=()=>{const e=new Date().getFullYear(),t=()=>{window.scrollTo({top:0,behavior:"smooth"})};return o("footer",{className:z.footer,children:[o("div",{className:z.footerInner,children:[o("div",{className:z.brandSection,children:[o("div",{className:z.logoRow,children:o(Ht,{className:z.logoText})}),o("div",{className:z.brandMeta,children:[o("div",{className:z.statusPill,children:[o("span",{className:z.statusDot}),o("span",{children:["v",Sr.version]})]}),o("p",{className:z.brandTagline,children:"Fast, local anime streaming."})]})]}),o("div",{className:z.linksGrid,children:[o("div",{className:z.linkColumn,children:[o("h4",{className:z.columnTitle,children:"Navigation"}),o(de,{to:"/",children:"Home"}),o(de,{to:"/watchlist",children:"Watchlist"}),o(de,{to:"/settings",children:"Settings"})]}),o("div",{className:z.linkColumn,children:[o("h4",{className:z.columnTitle,children:"Features"}),o(de,{to:"/search",children:"Search Anime"}),o(de,{to:"/trackers",children:"Trackers"}),o(de,{to:"/insights",children:"Insights"})]}),o("div",{className:z.linkColumn,children:[o("h4",{className:z.columnTitle,children:"Community"}),o("a",{href:"https://discord.gg/6yT3VwTqz9",target:"_blank",rel:"noopener noreferrer",children:[o(N,{name:"discord",style:{marginRight:"6px"}})," Discord"]}),o("a",{href:"https://github.com/serifpersia/dango",target:"_blank",rel:"noopener noreferrer",children:[o(N,{name:"github",style:{marginRight:"6px"}})," GitHub"]})]}),o("div",{className:z.linkColumn,children:[o("h4",{className:z.columnTitle,children:"Project"}),o("a",{href:"https://github.com/serifpersia/dango/releases",target:"_blank",rel:"noopener noreferrer",children:"Releases"}),o("a",{href:"https://github.com/serifpersia/dango/issues",target:"_blank",rel:"noopener noreferrer",children:"Feedback"})]})]})]}),o("div",{className:z.bottomBar,children:[o("p",{className:z.copyright,children:["© ",e," ",o("span",{className:z.brand,children:"dango"})," • Crafted with"," ",o(N,{name:"heart",className:z.heartIcon})," by"," ",o("a",{href:"https://github.com/serifpersia",target:"_blank",rel:"noopener noreferrer",children:"serifpersia"})]}),o("button",{className:z.backToTop,onClick:t,"aria-label":"Back to top",children:[o(N,{name:"chevron-up",size:14}),o("span",{children:"Top"})]})]})]})};function Tr(e){return JSON.stringify({0:e??{}})}function Pr(e){return`/api/trpc/${e}?batch=1&_profile=${encodeURIComponent(or())}`}function Rt(e,t){const n=Tr(t),r=Pr(e);try{if(navigator.sendBeacon){navigator.sendBeacon(r,new Blob([n],{type:"application/json"}));return}}catch{}fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0}).catch(()=>{})}async function Xd(e,t){const n=await fetch(Pr(e),{method:"POST",headers:{"Content-Type":"application/json"},body:Tr(t),keepalive:!0});if(!n.ok)throw new Error(`tRPC request failed (HTTP ${n.status})`)}function em(e){e&&(Rt("discord.clear",{sessionId:e}),Rt("discord.heartbeat",{sessionId:e,bye:!0}))}function Nl(){const e=ut(),{data:t}=gt("discordRPCEnabled"),n=K("");n.current||(n.current=typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`tab-${Date.now()}-${Math.random().toString(36).slice(2)}`),_(()=>{if(t===!1||t==="false")return;const r=n.current,a=()=>re.discord.heartbeat.mutate({sessionId:r}).catch(()=>{});a();const s=setInterval(a,15e3),i=()=>{Rt("discord.heartbeat",{sessionId:r,bye:!0})};return window.addEventListener("pagehide",i),()=>{clearInterval(s),window.removeEventListener("pagehide",i)}},[t]),_(()=>{if(t===!1||t==="false")return;const r=e.pathname;if(r.startsWith("/watch/")||r.startsWith("/player/"))return;let a="home";r.startsWith("/search")||r.startsWith("/mature")?a="search":r.startsWith("/watchlist")?a="watchlist":r.startsWith("/anime/")?a="anime":r.startsWith("/insights")?a="insights":r.startsWith("/settings")?a="settings":r.startsWith("/trackers")?a="trackers":r.startsWith("/asmr")?a="asmr":r.startsWith("/manga")?a="manga":r.startsWith("/tv")&&(a="tv"),re.discord.pageStatus.mutate({page:a}).catch(()=>{})},[e.pathname,t])}function Vt(e,t){const[n,r]=v(()=>{try{const s=ne.getItem(e);if(s===null)return t;if(typeof t=="string")return s;try{return JSON.parse(s)}catch{return s}}catch{return t}});_(()=>{const s=i=>{if(i.key===ne.keyFor(e))try{if(i.newValue===null){r(t);return}if(typeof t=="string"){r(i.newValue);return}try{r(JSON.parse(i.newValue))}catch{r(i.newValue)}}catch{}};return window.addEventListener("storage",s),()=>window.removeEventListener("storage",s)},[e,t]);const a=Y(s=>{r(i=>{const c=typeof s=="function"?s(i):s;try{typeof c=="string"?ne.setItem(e,c):ne.setItem(e,JSON.stringify(c))}catch{}return c})},[e]);return[n,a]}const Nr=ye(void 0),Il=()=>{const e=ve(Nr);if(!e)throw new Error("useAnimePaheCookie must be used within an AnimePaheCookieProvider");return e},xl="_container_e96gf_1",Cl="_field_e96gf_9",Al="_textarea_e96gf_20",Ol="_input_e96gf_40",ql="_button_e96gf_58",Ll="_secondaryButton_e96gf_78",Dl="_actions_e96gf_95",Rl="_hint_e96gf_104",$l="_link_e96gf_117",ie={container:xl,field:Cl,textarea:Al,input:Ol,button:ql,secondaryButton:Ll,actions:Dl,hint:Rl,link:$l},Ml="https://github.com/serifpersia/dango/releases/latest/download/dango-extension.zip",jl=e=>{try{return JSON.parse(e.detail)}catch{return null}},Bl=({isOpen:e,onClose:t,onSuccess:n})=>{const[r,a]=v(1),[s,i]=v(navigator.userAgent),[c,l]=v(""),[u,d]=v(!1),m=K(null),p=navigator.userAgent,h=/android/i.test(p),g=/firefox|fxios/i.test(p)&&!h,w=!g&&!h&&/chrome|chromium|edg|brave/i.test(p),A=g||w;_(()=>{e&&(a(1),i(navigator.userAgent),l(""),d(!1))},[e]),_(()=>()=>{m.current&&(window.removeEventListener("dango:pahe-cookie",m.current),m.current=null)},[]);const O=()=>{window.open("https://animepahe.pw","_blank","noopener,noreferrer"),a(2)},J=()=>{if(u)return;d(!0);const L=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`,te=window.setTimeout(()=>{d(!1),m.current&&(window.removeEventListener("dango:pahe-cookie",m.current),m.current=null),I.error("Helper not detected - install it via about:debugging first.")},3e3),q=F=>{const T=jl(F);if(!(!T||T.requestId!==L))if(window.clearTimeout(te),window.removeEventListener("dango:pahe-cookie",q),m.current=null,d(!1),T?.ok&&T.cookie)l(T.cookie),I.success("Cookie extracted from helper!");else if(T?.error==="NO_COOKIE"){const $=T.debug?.stores?.length??0,Q=T.debug?.names??[];I.error(`Helper found no cf_clearance (checked ${$} stores, saw: ${Q.join(", ")||"none"}) - solve the challenge on the AnimePahe tab first.`)}else I.error("Helper request failed - try again.")};m.current=q,window.addEventListener("dango:pahe-cookie",q),window.dispatchEvent(new CustomEvent("dango:get-pahe-cookie",{detail:{requestId:L}}))},k=()=>{const L=c.trim();if(!L){I.error("Please enter the cf_clearance cookie");return}try{ne.setItem("animepahe_ua",s),ne.setItem("animepahe_cookie",L),I.success("Cookie updated successfully! Reloading…"),n?.(),t(),window.setTimeout(()=>window.location.reload(),1e3)}catch{I.error("Failed to save cookie")}};return o(Re,{isOpen:e,onClose:t,title:"AnimePahe Verification Required",children:o("div",{className:ie.container,children:r===1?o(me,{children:[o("p",{children:"AnimePahe requires a manual verification to bypass Cloudflare/DDoS-Guard protection."}),o("div",{className:ie.field,children:[o("label",{children:"Your User-Agent (will be used for requests):"}),o("textarea",{value:s,readOnly:!0,rows:3,className:ie.textarea})]}),o("div",{className:ie.actions,children:[o("button",{className:ie.secondaryButton,onClick:t,children:"Cancel"}),o("button",{className:ie.button,onClick:O,children:"Start Verification (Opens AnimePahe)"})]})]}):o(me,{children:[o("p",{children:["1. Solve the challenge on the ",o("strong",{children:"AnimePahe tab"})," (keep that tab open).",o("br",{}),"2. Copy the ",o("strong",{children:"cf_clearance"})," cookie value using one of these:",o("br",{}),o("br",{}),o("strong",{children:"Chrome / Edge — DevTools:"})," press ",o("code",{children:"F12"})," →"," ",o("strong",{children:"Application"})," → ",o("strong",{children:"Cookies"})," →"," ",o("code",{children:"https://animepahe.pw"}),". Find ",o("strong",{children:"cf_clearance"}),", double-click its ",o("strong",{children:"Value"})," to select it, then copy.",o("br",{}),o("br",{}),o("strong",{children:"Firefox — Storage Inspector:"})," press ",o("code",{children:"F12"})," →"," ",o("strong",{children:"Storage"})," → ",o("strong",{children:"Cookies"})," →"," ",o("code",{children:"https://animepahe.pw"}),". Find ",o("strong",{children:"cf_clearance"}),", right-click the value → ",o("strong",{children:"Copy Value"}),".",o("br",{}),o("br",{}),o("strong",{children:"Either browser — extension:"})," open"," ",o("strong",{children:"Cookie Manager"})," while on the AnimePahe tab, find"," ",o("strong",{children:"cf_clearance"}),", and copy its value (or use the extension's export).",o("br",{}),o("br",{}),"3. Paste it below. Copy ",o("strong",{children:"only the value"})," — remove any"," ",o("code",{children:"cf_clearance="})," prefix or quotes if they were included."]}),A&&o("div",{className:ie.hint,children:[o("strong",{children:"Dango helper (one-time setup):"})," ",g?o(me,{children:["type ",o("code",{children:"about:debugging"})," in the address bar →"," ",o("strong",{children:"This Firefox"})," → ",o("strong",{children:"Load Temporary Add-on"})," ","→ open the ",o("code",{children:"dango-extension/firefox"})," folder and pick"," ",o("code",{children:"manifest.json"}),". (Temporary helpers unload when Firefox closes - repeat after a restart.)"]}):o(me,{children:["type ",o("code",{children:"chrome://extensions"})," in the address bar → enable"," ",o("strong",{children:"Developer mode"})," → ",o("strong",{children:"Load unpacked"})," → open the ",o("code",{children:"dango-extension/chrome"})," folder. (Unpacked helpers show a developer-mode notice - expected.)"]})," ","Use this link to download the extension and extract it:"," ",o("a",{href:Ml,target:"_blank",rel:"noreferrer",className:ie.link,children:"dango-extension.zip"}),". Then click Extract below and the field fills itself.",o("div",{className:ie.actions,children:o("button",{className:ie.button,onClick:J,disabled:u,type:"button",children:u?"Extracting…":"Extract cookie from helper"})})]}),o("div",{className:ie.field,children:[o("label",{children:"cf_clearance cookie value:"}),o("input",{type:"text",value:c,onChange:L=>l(L.currentTarget.value),placeholder:"e.g. xxxxxxxx.xxxxxxxx.xxxxxxx-xxxxxxx",className:ie.input})]}),o("div",{className:ie.actions,children:[o("button",{className:ie.secondaryButton,onClick:t,children:"Cancel"}),o("button",{className:ie.secondaryButton,onClick:()=>a(1),children:"Back"}),o("button",{className:ie.button,onClick:k,children:"Submit"})]})]})})})};function Cn(){const[e,t]=v(!1);return _(()=>{const n=window.setTimeout(()=>t(!0),120);return()=>window.clearTimeout(n)},[]),e?o("div",{className:"top-progress-bar",role:"progressbar","aria-label":"Loading"}):null}const Fl="_screen_1pca0_1",Wl="_icon_1pca0_14",Kl="_title_1pca0_20",Hl="_text_1pca0_24",Ul="_button_1pca0_29",Fe={screen:Fl,icon:Wl,title:Kl,text:Hl,button:Ul};async function Ql(e,t){const n={message:e.message,stack:e.stack,componentStack:t.componentStack,url:typeof window<"u"?window.location.href:"",timestamp:new Date().toISOString()},r=JSON.stringify(n);try{if(navigator.sendBeacon){navigator.sendBeacon("/api/internal/client-error",new Blob([r],{type:"application/json"}));return}}catch{}fetch("/api/internal/client-error",{method:"POST",headers:{"Content-Type":"application/json"},body:r,keepalive:!0}).catch(()=>{})}class zl extends $r{state={hasError:!1};static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,n){console.error("Uncaught error:",t,n),Ql(t,n)}render(){return this.state.hasError?o("div",{className:Fe.screen,children:[o(N,{name:"exclamation-triangle",className:Fe.icon}),o("h1",{className:Fe.title,children:"Something went wrong"}),o("p",{className:Fe.text,children:"The application encountered an unexpected error."}),o("button",{onClick:()=>{this.setState({hasError:!1}),window.location.href="/"},className:Fe.button,children:[o(N,{name:"home"}),"Go back Home"]})]}):this.props.children}}const Ir=ye(void 0),Vl=()=>{const e=ve(Ir);if(!e)throw new Error("useLanAuth must be used within a LanAuthProvider");return e},Gl=({children:e})=>{const[t,n]=v(!1),r=Y(()=>n(!0),[]),a=Y(()=>n(!1),[]);return _(()=>rr("lan",r),[r]),o(Ir.Provider,{value:{isOpen:t,openModal:r,closeModal:a},children:e})},Jl="_container_88bss_1",Yl="_field_88bss_8",Zl="_input_88bss_19",Xl="_actions_88bss_37",nt={container:Jl,field:Yl,input:Zl,actions:Xl},Ke=Mr(({variant:e="primary",size:t="md",loading:n,children:r,className:a="",disabled:s,...i},c)=>{const l=vs("btn",`btn-${e}`,t!=="md"&&`btn-${t}`,n&&"btn-loading",a);return o("button",{className:l,disabled:s||n,ref:c,...i,children:n?o("span",{className:"btn-spinner"}):r})}),xr=({isOpen:e,onClose:t,onSuccess:n})=>{const[r,a]=v(""),[s,i]=v(!1);Mt.useEffect(()=>{e&&a("")},[e]);const c=async()=>{if(!r){I.error("Please enter your password");return}i(!0);try{const l=await Wt("/api/auth/app-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:r})}),u=await l.json().catch(()=>({}));if(!l.ok){I.error(u.error||"Login failed");return}I.success("Authenticated successfully"),n(),t(),window.location.reload()}catch{I.error("Network error")}finally{i(!1)}};return o(Re,{isOpen:e,onClose:t,title:"LAN Authentication Required",children:o("div",{className:nt.container,children:[o("p",{children:"This instance is protected. Enter the password to access from this device."}),o("div",{className:nt.field,children:[o("label",{htmlFor:"lan-password",children:"Password"}),o("input",{id:"lan-password",type:"password",value:r,onChange:l=>a(l.currentTarget.value),placeholder:"Enter password...",className:nt.input,onKeyDown:l=>l.key==="Enter"&&c()})]}),o("div",{className:nt.actions,children:[o(Ke,{variant:"secondary",onClick:t,disabled:s,children:"Cancel"}),o(Ke,{variant:"primary",onClick:c,loading:s,children:"Unlock"})]})]})})},eu="_notice_1d75r_1",tu={notice:eu},nu=2600,ru=1e4,ou={anilist:"Updating AniList…",mal:"Updating MyAnimeList…"};function au({enabled:e=!0}){const[t,n]=v(!1),[r,a]=v("mal"),[s,i]=v(document.fullscreenElement);return _(()=>{const c=()=>i(document.fullscreenElement);return document.addEventListener("fullscreenchange",c),()=>document.removeEventListener("fullscreenchange",c)},[]),_(()=>{if(!e||typeof EventSource>"u")return;const c=new EventSource("/api/tracker/activity"),l=new Map;let u;const d=new Set;let m=-1/0;const p=h=>{let g;try{g=JSON.parse(h.data)}catch{return}const w=g.provider;w!=="anilist"&&w!=="mal"||(g.updating===!0?(clearTimeout(l.get(w)),d.size===0&&Date.now()-m>=ru&&(m=Date.now(),a(w),n(!0),clearTimeout(u),u=setTimeout(()=>n(!1),nu)),d.add(w)):g.updating===!1&&(clearTimeout(l.get(w)),l.set(w,setTimeout(()=>d.delete(w),1500))))};return c.addEventListener("tracker-activity",p),()=>{c.removeEventListener("tracker-activity",p),c.close(),clearTimeout(u);for(const h of l.values())clearTimeout(h);n(!1)}},[e]),!e||!t?null:Mn(o("div",{className:tu.notice,role:"status","aria-live":"polite","aria-atomic":"true",children:[o(N,{name:r==="anilist"?"anilist":"myanimelist",size:15}),o("span",{children:ou[r]})]}),s||document.body)}const su=V(()=>G(()=>import("./Home-B2O7RdNh.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,30,31,32,33]))),iu=V(()=>G(()=>import("./Watchlist-9ikxJknw.js"),__vite__mapDeps([34,1,2,4,10,11,12,5,13,3,6,7,8,9,14,15,16,17,18,35,36,37,38,39]))),cu=V(()=>G(()=>import("./Settings-CoTHeSKq.js"),__vite__mapDeps([40,1,2,4,41,42,14,7,8,43]))),An=V(()=>G(()=>import("./Player-BTtTwYJ2.js"),__vite__mapDeps([44,1,45,4,46,2,47,14,48,7,8,6,20,21,12,5,13,27,49,50,51,52,53,54,55]))),lu=V(()=>G(()=>import("./WatchAlong-CpfZx3Le.js"),__vite__mapDeps([56,1,53,54,2,4]))),uu=V(()=>G(()=>import("./Search-CxUcaFfI.js"),__vite__mapDeps([57,1,4,3,5,6,7,8,9,10,11,2,12,13,14,15,16,17,18,37,38,58,59]))),du=V(()=>G(()=>import("./Mature-BMXpX3iD.js"),__vite__mapDeps([60,1,2,4,3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,27,58,59,61]))),On=V(()=>G(()=>import("./Asmr-DuW_Jtwk.js"),__vite__mapDeps([62,1,4,2,41,42,7,8,3,5,6,9,32,24,63,25,45,46,64,65,66]))),mu=V(()=>G(()=>import("./Manga-CQKVrxz_.js"),__vite__mapDeps([67,1,4,41,42,7,8,17,18,3,5,6,9,22,23,2,24,25,27,68,69,64,65]))),pu=V(()=>G(()=>import("./MangaInfoPage-BB5cQkBO.js"),__vite__mapDeps([70,1,4,17,18,68,69,23,2,24,64,65]))),hu=V(()=>G(()=>import("./MangaReadPage-BDpps3lc.js"),__vite__mapDeps([71,1,17,4,18,2,68,69,23,24,64,65]))),fu=V(()=>G(()=>import("./ReadingList-DmbVYPKy.js"),__vite__mapDeps([72,1,3,4,5,6,7,8,9,73,15,16,17,18,35,36,22,23,2,24,25,26,19]))),qn=V(()=>G(()=>import("./TvSearch-BwEGJcbq.js"),__vite__mapDeps([74,1,4,3,5,6,7,8,9,28,29,30,2,24,15,16,17,18,58,59]))),gu=V(()=>G(()=>import("./TvInfo-foHQYICS.js"),__vite__mapDeps([75,1,4,30,2,24,76]))),yu=V(()=>G(()=>import("./Tv-DCnM78Kk.js"),__vite__mapDeps([77,1,45,4,46,2,47,14,48,78,7,8,27,30,24,6,51,52,53,54,79]))),vu=V(()=>G(()=>import("./TvWatchlist-CP92PPZB.js"),__vite__mapDeps([80,1,3,4,5,6,7,8,9,73,15,16,17,18,35,36,19,29,30,2,24]))),bu=V(()=>G(()=>import("./ListeningList-GOx1Ir_v.js"),__vite__mapDeps([81,1,3,4,5,6,7,8,9,73,15,16,17,18,35,36,32,2,24,63,25,31,19]))),wu=V(()=>G(()=>import("./Trackers-DC4EDgyt.js"),__vite__mapDeps([82,1,2,4,83]))),_u=V(()=>G(()=>import("./Insights-CT77CDrU.js"),__vite__mapDeps([84,1,2,4,85]))),ku=V(()=>G(()=>import("./AnimeInfoPage-Bu8q7_fN.js"),__vite__mapDeps([86,1,2,4]))),Eu=V(()=>G(()=>import("./PlayerRedirect-fv2tzEUu.js"),__vite__mapDeps([87,1]))),Su=V(()=>G(()=>import("./VirtualKeyboard-CsmRu3E6.js"),__vite__mapDeps([88,1,2,4,89])));function Tu(){Ei();const{isOpen:e,closeModal:t,onSuccess:n}=Il(),{isOpen:r,setIsOpen:a}=Ut(),{isOpen:s,openModal:i,closeModal:c}=Vl(),l=ut(),u=jr(),d=K(new Map),m=K(l.pathname),p=K(l.key),h=K(null),[g,w]=v(!1),A=tc();Nl();const[O,J]=v(!1);_(()=>{const q=new AbortController;return Oe("/api/auth/app-status",{signal:q.signal}).then(F=>{F.hasPassword&&!F.isAuthenticated&&(J(!0),i())}).catch(()=>{q.signal.aborted||I.error("Could not check server access. The server may still be starting; reload to retry.")}),()=>q.abort()},[i]);const[k,L]=Vt("lan_auth_notice_shown","false"),te=K(!1);return _(()=>{if(k==="true"||te.current)return;te.current=!0,L("true");const q=setTimeout(()=>{I("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(q)},[k,L]),_(()=>{try{window.history.scrollRestoration="manual"}catch{}},[]),_(()=>{const q=l.key,F=d.current;if(u==="POP"){const T=F.get(q)??0;window.scrollTo({top:T,behavior:"instant"})}else l.pathname!==m.current&&window.scrollTo({top:0,behavior:"instant"});return m.current=l.pathname,()=>{F.set(q,window.scrollY)}},[l.key,l.pathname,u]),_(()=>{const q=()=>{w(!0),h.current!==null&&window.clearTimeout(h.current),h.current=window.setTimeout(()=>{w(!1),h.current=null},1e4)},F=$=>{if($.defaultPrevented||$.button!==0||$.metaKey||$.ctrlKey||$.shiftKey||$.altKey)return;const Q=$.target;if(!(Q instanceof Element))return;const b=Q.closest("a[href]");if(!b||b.hasAttribute("download")||b.getAttribute("target")==="_blank")return;const S=new URL(b.href,window.location.href);S.origin===window.location.origin&&`${S.pathname}${S.search}${S.hash}`!=`${window.location.pathname}${window.location.search}${window.location.hash}`&&q()},T=()=>q();return document.addEventListener("click",F,!0),window.addEventListener("popstate",T),()=>{document.removeEventListener("click",F,!0),window.removeEventListener("popstate",T),h.current!==null&&(window.clearTimeout(h.current),h.current=null)}},[]),_(()=>{p.current!==l.key&&(p.current=l.key,g&&(h.current!==null&&window.clearTimeout(h.current),h.current=window.setTimeout(()=>{w(!1),h.current=null},500)))},[l.key,g]),_(()=>{const q=F=>{r&&F.key==="Escape"&&a(!1)};return r?document.body.classList.add("sidebar-open"):document.body.classList.remove("sidebar-open"),window.addEventListener("keydown",q),()=>{window.removeEventListener("keydown",q),document.body.classList.remove("sidebar-open")}},[r,a]),o("div",{className:"app-container",children:[o(Bl,{isOpen:e,onClose:t,onSuccess:n}),o(xr,{isOpen:s,onClose:O?()=>{}:c,onSuccess:()=>{J(!1),c()}}),o(zn,{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"}}}}),g&&o(Cn,{}),o(au,{enabled:!O&&!s}),o(Gc,{}),o(cl,{}),o("main",{className:"main-content",children:o(zl,{children:o(tn,{fallback:o(Cn,{}),children:o(Br,{children:[o(B,{path:"/",element:o(su,{})}),o(B,{path:"/watchlist/:filter?",element:o(iu,{})}),o(B,{path:"/reading-list/:filter?",element:o(fu,{})}),o(B,{path:"/search",element:o(uu,{})}),o(B,{path:"/mature",element:o(du,{})}),o(B,{path:"/asmr",element:o(On,{})}),o(B,{path:"/asmr/:rj",element:o(On,{})}),o(B,{path:"/manga",element:o(mu,{})}),o(B,{path:"/manga/:provider/:id",element:o(pu,{})}),o(B,{path:"/manga/:provider/:id/read",element:o(hu,{})}),o(B,{path:"/tv",element:o(qn,{})}),o(B,{path:"/tv/:id",element:o(gu,{})}),o(B,{path:"/tv/:id/watch",element:o(yu,{})}),o(B,{path:"/tv-search",element:o(qn,{})}),o(B,{path:"/tv-watchlist/:filter?",element:o(vu,{})}),o(B,{path:"/listening-list/:filter?",element:o(bu,{})}),o(B,{path:"/settings",element:o(cu,{})}),o(B,{path:"/trackers",element:o(wu,{})}),o(B,{path:"/mal",element:o(nn,{to:"/trackers",replace:!0})}),o(B,{path:"/insights",element:o(_u,{})}),o(B,{path:"/anime/:id",element:o(ku,{})}),o(B,{path:"/watch/:id",element:o(An,{})}),o(B,{path:"/watch-along",element:o(lu,{})}),o(B,{path:"/watch/:id/:episodeNumber",element:o(An,{})}),o(B,{path:"/player/:id/:episodeNumber?",element:o(Eu,{})}),o(B,{path:"*",element:o(nn,{to:"/",replace:!0})})]})})})}),o(Pl,{}),A.isVisible&&o(tn,{fallback:null,children:o(Su,{activeInputRef:A.activeInputRef,isVisible:A.isVisible,onClose:A.hide})})]})}function Pu(){return o(Gl,{children:o(Tu,{})})}const Nu=({children:e})=>{const[t,n]=v(!1),r=Y(()=>{n(s=>!s)},[]),a=De(()=>({isOpen:t,setIsOpen:n,toggleSidebar:r}),[t,r]);return o(br.Provider,{value:a,children:e})},Iu=({children:e})=>{const[t,n]=Vt("dango_content_type","anime"),r=De(()=>({contentType:t,setContentType:n}),[t,n]);return o(wr.Provider,{value:r,children:e})},xu=({children:e})=>{const[t,n]=v("englishName"),[r,a]=v(!0);_(()=>{(async()=>{try{const c=await re.settings.getByKey.query({key:"titlePreference"});c.value&&n(c.value)}catch(c){console.error("Error fetching title preference in context:",c)}finally{a(!1)}})()},[]);const s=De(()=>({titlePreference:t,setTitlePreference:n,loading:r}),[t,r]);return o(lr.Provider,{value:s,children:e})},Cu=({children:e})=>{const{data:t,isLoading:n}=gt("lowEndMode"),r=hr(),a=se(),[s,i]=v(!1);_(()=>{const u=a.getDefaultOptions();a.setDefaultOptions({...u,queries:{...u.queries,gcTime:s?900*1e3:1800*1e3}})},[s,a]),_(()=>{t!==void 0&&i(t==="true"||t===!0)},[t]),_(()=>{s?document.body.classList.add("low-end"):document.body.classList.remove("low-end")},[s]);const c=Y(u=>{i(u),r.mutate({key:"lowEndMode",value:String(u)})},[r]),l=De(()=>({lowEndMode:s,setLowEndMode:c,loading:n}),[s,c,n]);return o(fr.Provider,{value:l,children:e})},Au=["iris","mochi","sakura"];function Ln(e){e==="iris"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e)}const Ou=({children:e})=>{const{data:t,isLoading:n}=gt("theme"),r=hr(),[a,s]=v("iris");_(()=>{typeof t=="string"&&Au.includes(t)&&s(t)},[t]),_(()=>{Ln(a)},[a]);const i=Y(l=>{l!==a&&(s(l),Ln(l),r.mutate({key:"theme",value:l}))},[r,a]),c=De(()=>({theme:a,setTheme:i,loading:n}),[a,i,n]);return o(yr.Provider,{value:c,children:e})},qu=({children:e})=>{const[t,n]=v(!1),[r,a]=v(void 0),s=Y(c=>{a(()=>c),n(!0)},[]),i=Y(()=>{n(!1),a(void 0)},[]);return _(()=>rr("animepahe",()=>s()),[s]),o(Nr.Provider,{value:{isOpen:t,openModal:s,closeModal:i,onSuccess:r},children:e})},Lu="_gate_10ra3_1",Du="_gateInner_10ra3_17",Ru="_gateTitle_10ra3_26",$u="_profileGrid_10ra3_34",Mu="_profileCard_10ra3_42",ju="_profileCardAvatar_10ra3_67",Bu="_addAvatar_10ra3_96",Fu="_profileCardName_10ra3_106",Wu="_ownerTag_10ra3_116",Ku="_lockBadge_10ra3_124",Hu="_gatePanel_10ra3_139",Uu="_panelAvatar_10ra3_152",Qu="_panelTitle_10ra3_158",zu="_gateForm_10ra3_164",Vu="_gateField_10ra3_170",Gu="_gateHint_10ra3_196",Ju="_gateError_10ra3_203",Yu="_backButton_10ra3_209",Zu="_form_10ra3_283",Xu="_field_10ra3_296",ed="_avatarRow_10ra3_313",td="_uploadButton_10ra3_325",nd="_fileInput_10ra3_354",rd="_profileList_10ra3_367",od="_smallAvatar_10ra3_380",ad="_profileName_10ra3_385",R={gate:Lu,gateInner:Du,gateTitle:Ru,profileGrid:$u,profileCard:Mu,profileCardAvatar:ju,addAvatar:Bu,profileCardName:Fu,ownerTag:Wu,lockBadge:Ku,gatePanel:Hu,panelAvatar:Uu,panelTitle:Qu,gateForm:zu,gateField:Vu,gateHint:Gu,gateError:Ju,backButton:Yu,form:Zu,field:Xu,avatarRow:ed,uploadButton:td,fileInput:nd,profileList:rd,smallAvatar:od,profileName:ad};function sd({children:e}){const[t,n]=v(!1),[r,a]=v(!1),[s,i]=v([]),[c,l]=v(""),[u,d]=v("pick"),[m,p]=v(""),[h,g]=v(""),[w,A]=v(!1),[O,J]=v(0),[k,L]=v(""),[te,q]=v(""),[F,T]=v("");_(()=>{let y=!1;return g(""),(async()=>{const C=await Oe("/api/auth/app-status");if(y)return;if(C.hasPassword&&!C.isAuthenticated){a(!0);return}const H=await Oe("/api/profiles/status");y||(H.current?(Xa(H.current.id),n(!0)):(i(H.profiles),l(H.profiles[0]?.id??"")))})().catch(C=>{y||g(C.message)}),()=>{y=!0}},[O]),_(()=>{const y=C=>{C.key==="dango:profile-session-change"&&window.location.reload()},W=()=>{n(!1),J(C=>C+1)};return window.addEventListener("storage",y),window.addEventListener("dango:profile-auth-required",W),()=>{window.removeEventListener("storage",y),window.removeEventListener("dango:profile-auth-required",W)}},[]);const $=async(y,W)=>{A(!0),g("");try{await Oe("/api/profiles/login",{method:"POST",body:JSON.stringify({id:y,password:W})}),ts()}catch(C){g(C.message),A(!1)}},Q=y=>{g(""),p(""),l(y.id),y.protected?d("password"):$(y.id,"")},b=()=>{d("pick"),p(""),g("")};if(t)return e;const S=s.find(y=>y.id===c);return o("div",{className:R.gate,children:[o(zn,{}),o(xr,{isOpen:r,onClose:()=>{},onSuccess:()=>{a(!1),J(y=>y+1)}}),u==="pick"&&o("section",{className:R.gateInner,children:[o("h1",{className:R.gateTitle,children:s.length?"Who's watching?":"Connecting to Dango…"}),s.length>0&&o("div",{className:R.profileGrid,children:[s.map(y=>o("button",{type:"button",className:R.profileCard,disabled:w,onClick:()=>Q(y),children:[o("span",{className:R.profileCardAvatar,children:[o(qt,{image:y.avatar??y.cloudAvatar,name:y.name,size:"100%",radius:"var(--radius-sm)"}),y.protected&&o("span",{className:R.lockBadge,"aria-hidden":"true",children:o(N,{name:"lock",size:"0.85rem"})})]}),o("span",{className:R.profileCardName,children:[y.name,y.owner&&o("span",{className:R.ownerTag,children:"Owner"})]})]},y.id)),o("button",{type:"button",className:R.profileCard,disabled:w,onClick:()=>{g(""),d("create")},children:[o("span",{className:`${R.profileCardAvatar} ${R.addAvatar}`,children:o(N,{name:"plus",size:40})}),o("span",{className:R.profileCardName,children:"Add profile"})]})]}),h&&o(me,{children:[o("p",{role:"alert",className:R.gateError,children:h}),!s.length&&o(Ke,{variant:"secondary",onClick:()=>J(y=>y+1),children:"Retry"})]})]}),u==="password"&&S&&o("section",{className:R.gatePanel,children:[o("button",{type:"button",className:R.backButton,onClick:b,children:[o(N,{name:"chevron-left"}),"Back"]}),o("div",{className:R.panelAvatar,children:o(qt,{image:S.avatar??S.cloudAvatar,name:S.name,size:"100%",radius:"18%"})}),o("h2",{className:R.panelTitle,children:S.name}),o("form",{className:R.gateForm,onSubmit:y=>{y.preventDefault(),$(c,m)},children:[o("label",{className:R.gateField,children:["Password",o("input",{type:"password",autoComplete:"current-password",required:!0,maxLength:256,value:m,onChange:y=>p(y.currentTarget.value)})]}),o(Ke,{type:"submit",className:"btn-block",loading:w,children:"Continue"})]}),h&&o("p",{role:"alert",className:R.gateError,children:h})]}),u==="create"&&o("section",{className:R.gatePanel,children:[o("button",{type:"button",className:R.backButton,onClick:b,children:[o(N,{name:"chevron-left"}),"Back"]}),o("h2",{className:R.panelTitle,children:"Add a profile"}),o("p",{className:R.gateHint,children:"Enter the owner password to create a new profile."}),o("form",{className:R.gateForm,onSubmit:async y=>{y.preventDefault(),A(!0),g("");try{const W=await Oe("/api/profiles/create",{method:"POST",body:JSON.stringify({name:te,password:F,ownerPassword:k})});i(C=>[...C,W]),L(""),q(""),T(""),d("pick"),l(W.id),W.protected?d("password"):await $(W.id,"")}catch(W){g(W.message)}finally{A(!1)}},children:[o("label",{className:R.gateField,children:["Owner password",o("input",{type:"password",autoComplete:"current-password",required:!0,maxLength:256,value:k,onChange:y=>L(y.currentTarget.value)})]}),o("label",{className:R.gateField,children:["Profile name",o("input",{required:!0,maxLength:60,value:te,onChange:y=>q(y.currentTarget.value)})]}),o("label",{className:R.gateField,children:["Profile password (optional)",o("input",{type:"password",autoComplete:"new-password",minLength:8,maxLength:256,value:F,onChange:y=>T(y.currentTarget.value)})]}),o(Ke,{type:"submit",className:"btn-block",loading:w,children:"Create profile"})]}),h&&o("p",{role:"alert",className:R.gateError,children:h})]})]})}const Cr=ye(null);function tm(){const e=ve(Cr);if(!e)throw new Error("WatchAlongProvider is missing");return e}const id=/^[0-9a-f-]{36}$/,cd=/^[0-9a-f]{64}$/;function nm(e,t){return(e.kind??"anime")===(t.kind??"anime")&&e.season===t.season&&e.showId===t.showId&&e.episode===t.episode&&e.provider===t.provider&&e.mode===t.mode&&e.source===t.source}function rm(e,t){return e.position+(e.playing?Math.max(0,t-e.updatedAt)/1e3*e.rate:0)}const $t="dango-watch-along",Gt="dango-watch-along-host";function Dn(e){if(!e||typeof e!="object")return null;const t=e;if(typeof t.id!="string"||typeof t.token!="string"||typeof t.guestToken!="string")return null;const n=He(`${t.id}.${t.guestToken}`,""),r=He(`${t.id}.${t.token}`,"");return{...n,token:r.token,host:t.host===!0}}function ld(){try{return Dn(JSON.parse(sessionStorage.getItem($t)||"null"))??Dn(JSON.parse(localStorage.getItem(Gt)||"null"))}catch{return null}}function ud(e){try{e?sessionStorage.setItem($t,JSON.stringify(e)):sessionStorage.removeItem($t),e?.host&&localStorage.setItem(Gt,JSON.stringify(e))}catch{}}function rt(){try{localStorage.removeItem(Gt)}catch{}}function dd(e){return e.kind==="tv"||e.kind==="movie"?oc(e.kind,e.showId,e.kind==="tv"?e.season:void 0,e.kind==="tv"?Number(e.episode):void 0):`/watch/${encodeURIComponent(e.showId)}/${encodeURIComponent(e.episode)}`}function He(e,t){let n=e.trim().replace(/^#/,"");if(n.includes("://")){const i=new URL(n);if(i.origin!==new URL(t).origin||!["/join","/watch-along"].includes(i.pathname))throw new Error("Use an invite from this dango watch-along service.");n=i.hash.slice(1)}const[r,a,s]=n.split(".");if(!id.test(r||"")||!cd.test(a||"")||s!==void 0)throw new Error("Paste a complete watch-along invite link or room code.");return{id:r,token:a,guestToken:a,host:!1}}function md({children:e}){const t=jn(),n=ut(),[r,a]=Vt("watchAlongName",""),[s,i]=v(ld),[c,l]=v(null),[u,d]=v(!1),[m,p]=v(""),[h,g]=v(""),[w,A]=v({offset:0,latency:0}),O=K(null),{data:J}=U({queryKey:["watch-along-config"],queryFn:()=>re.settings.watchAlong.query()}),k=J?.workerUrl.replace(/\/$/,"")||"";_(()=>{ud(s)},[s]);const L=Y(T=>{O.current?.readyState===WebSocket.OPEN&&O.current.send(JSON.stringify(T))},[]);_(()=>{if(!u)return;const T=setTimeout(()=>L({type:"name",name:r}),250);return()=>clearTimeout(T)},[u,h,r,L]);const te=Y(()=>{s?.host&&L({type:"end"}),O.current?.close(1e3,"Left room"),rt(),i(null),l(null),d(!1),p("")},[L,s]),q=async T=>{if(!k)throw new Error("Watch along is unavailable. Check your server configuration.");const $=await fetch(`${k}/rooms`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T),signal:AbortSignal.timeout(15e3)}),Q=await $.json();if(!$.ok)throw new Error(Q.error||"Could not create room");const b=He(`${Q.id}.${Q.guestToken}`,k),S=He(`${Q.id}.${Q.hostToken}`,k);p(""),l(null),i({...b,token:S.token,host:!0})},F=T=>{if(!k)throw new Error("Watch along is unavailable. Check your server configuration.");const $=He(T,k);rt(),p(""),l(null),i($)};return _(()=>{if(!s||!k)return;let T=!1,$=0,Q,b,S=Date.now();const y=async()=>{if(T)return;try{const H=await fetch(`${k}/rooms/${s.id}`,{headers:{Authorization:`Bearer ${s.token}`},signal:AbortSignal.timeout(1e4)});if(T)return;if(!H.ok){const D=await H.json();if([403,404,409].includes(H.status)){p(D.error||"Unable to join room"),rt(),i(null),l(null);return}throw new Error(D.error||"Room service unavailable")}}catch{if(T)return;p("Cannot reach the room service. Retrying…"),Q=setTimeout(y,Math.min(15e3,1e3*2**Math.min($++,4)));return}const W=new URL(`${k}/rooms/${s.id}/ws`);W.protocol=W.protocol==="https:"?"wss:":"ws:";const C=new WebSocket(W,["dango-watch-along",s.token]);O.current=C,C.onopen=()=>{S=Date.now()},C.onmessage=H=>{if(!(T||O.current!==C)){S=Date.now();try{const D=JSON.parse(H.data);if(D.type==="joined"){if(D.host!==s.host){C.close(4003,"Invalid role");return}$=0,d(!0),p(""),g(D.id),C.send(JSON.stringify({type:"ping",sentAt:Date.now()}))}else if(D.type==="state")l(pe=>pe&&pe.revision>D.state.revision?pe:D.state);else if(D.type==="pong"){const pe=Date.now()-D.sentAt;A({offset:D.serverTime-(D.sentAt+pe/2),latency:pe/2})}else D.type==="error"&&p(D.error)}catch{p("Invalid response from the room service.")}}},C.onclose=H=>{if(!(T||O.current!==C)){if(clearInterval(b),d(!1),[4003,4004,4009].includes(H.code)){p(H.reason||"Room closed"),H.code!==4009&&rt(),i(null),l(null);return}p("Connection lost. Reconnecting…"),Q=setTimeout(y,Math.min(15e3,1e3*2**Math.min($++,4)))}},C.onerror=()=>C.close(),b=setInterval(()=>{Date.now()-S>25e3?C.close():C.readyState===WebSocket.OPEN&&C.send(JSON.stringify({type:"ping",sentAt:Date.now()}))},1e4)};return y(),()=>{T=!0,clearTimeout(Q),clearInterval(b),O.current?.close(1e3,"Leaving connection"),O.current=null,d(!1)}},[s,k]),_(()=>{if(!s||s.host||!c)return;const T=dd(c.selection);`${n.pathname}${n.search}`!==T&&t(T,{replace:!0})},[s,c,n.pathname,n.search,t]),o(Cr.Provider,{value:{workerUrl:k,displayName:r,setDisplayName:a,session:s,room:c,connected:u,error:m,selfId:h,clock:w,create:q,join:F,leave:te,send:L},children:e})}try{window.history.scrollRestoration="manual"}catch{}const Rn=new Ur({defaultOptions:{queries:{staleTime:1e3*60*5,gcTime:1800*1e3,refetchOnWindowFocus:!1,refetchIntervalInBackground:!1,retry:1}}}),$n=document.getElementById("root");$n&&Fr(o(sd,{children:o(Wr,{children:o(as,{trpcClient:re,queryClient:Rn,children:o(Qr,{client:Rn,children:o(qu,{children:o(Nu,{children:o(Iu,{children:o(xu,{children:o(Cu,{children:o(Ou,{children:o(md,{children:o(Pu,{})})})})})})})})})})})}),$n);export{Tn as $,Cd as A,Ke as B,Md as C,Od as D,bd as E,Yd as F,jd as G,qd as H,Ad as I,I as J,gt as K,hr as L,Qd as M,Rd as N,$d as O,Dd as P,Re as Q,nc as R,Oe as S,Ud as T,R as U,qt as V,ts as W,Wt as X,X as Y,Fd as Z,Wd as _,Vt as a,kr as a0,Sn as a1,G as a2,_t as a3,vd as a4,ie as a5,tm as a6,Bl as a7,jo as a8,Ed as a9,ec as aa,lc as ab,em as ac,rr as ad,Zd as ae,zd as af,Gd as ag,Jd as ah,ic as ai,Qt as aj,Kd as ak,qe as al,Xd as am,nm as an,rm as ao,Ut as ap,Bd as aq,Cn as ar,Nd as as,Id as at,Pd as au,wd as b,_d as c,ur as d,Jc as e,cr as f,Vd as g,gd as h,oc as i,Hd as j,rc as k,bs as l,cc as m,Nn as n,j as o,ne as p,x as q,kd as r,yd as s,re as t,li as u,_r as v,Ld as w,Sd as x,Td as y,xd as z};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="38.4" height="13.3" viewBox="-11.85 -0.8 38.4 13.3">
|
|
2
|
-
<path
|
|
3
|
-
fill="#e1afef"
|
|
4
|
-
stroke="#a978a9"
|
|
5
|
-
stroke-width="0.9"
|
|
6
|
-
stroke-linejoin="round"
|
|
7
|
-
paint-order="stroke fill"
|
|
8
|
-
d="M 7.0022839,0 C 3.0649855,0 -0.09802047,2.4883888 0.0022839,6 c 0.13572675,4.751733 5.0802847,4.156395 7,4.156395 1.2538994,0 6.5304511,0.392468 6.5849461,-4.168088 C 13.62431,2.8853946 10.939582,0 7.0022839,0 Z" />
|
|
9
|
-
<path fill="#140f15" d="m 4.9623825,3.416 c -0.5858889,0 -0.6520292,2.3368563 -0.024765,2.3368563 0.6604959,0 0.6704653,-2.3368563 0.024765,-2.3368563 z" />
|
|
10
|
-
<path fill="#140f15" d="M 8.588001,3.416 C 8.0021121,3.416 7.9359718,5.7528563 8.563236,5.7528563 9.2237319,5.7528563 9.2337013,3.416 8.588001,3.416 Z" />
|
|
11
|
-
<g transform="translate(12.231148 1.5056648)">
|
|
12
|
-
<path
|
|
13
|
-
fill="#e3e1ee"
|
|
14
|
-
stroke="#b3b1c6"
|
|
15
|
-
stroke-width="0.9"
|
|
16
|
-
stroke-linejoin="round"
|
|
17
|
-
paint-order="stroke fill"
|
|
18
|
-
d="m 7,0 c -3.9372984,0 -7.10030437,2.4883888 -7,6 0.13572675,4.751733 5.0802847,4.156395 7,4.156395 1.2538994,0 6.530451,0.392468 6.584946,-4.168088 C 13.622023,2.8853946 10.937298,0 7,0 Z" />
|
|
19
|
-
<path fill="#140f15" d="m 3.3556746,2.945744 c -0.5858889,0 -0.6520292,2.3368563 -0.024765,2.3368563 0.6604959,0 0.6704653,-2.3368563 0.024765,-2.3368563 z" />
|
|
20
|
-
<path fill="#140f15" d="m 6.9812931,2.945744 c -0.5858889,0 -0.6520292,2.3368563 -0.024765,2.3368563 0.6604959,0 0.6704653,-2.3368563 0.024765,-2.3368563 z" />
|
|
21
|
-
</g>
|
|
22
|
-
<g transform="translate(-11.063909 1.423053)">
|
|
23
|
-
<path
|
|
24
|
-
fill="#897cff"
|
|
25
|
-
stroke="#5646db"
|
|
26
|
-
stroke-width="0.9"
|
|
27
|
-
stroke-linejoin="round"
|
|
28
|
-
paint-order="stroke fill"
|
|
29
|
-
d="m 7,0 c -3.9372984,0 -7.10030437,2.4883888 -7,6 0.13572675,4.751733 5.0802847,4.156395 7,4.156395 1.2538994,0 6.530451,0.392468 6.584946,-4.168088 C 13.622023,2.8853946 10.937298,0 7,0 Z" />
|
|
30
|
-
<path fill="#140f15" d="m 7.3136624,3.376812 c -0.5858889,0 -0.6520292,2.3368563 -0.024765,2.3368563 0.6604959,0 0.6704653,-2.3368563 0.024765,-2.3368563 z" />
|
|
31
|
-
<path fill="#140f15" d="m 10.939281,3.376812 c -0.585889,0 -0.652029,2.3368563 -0.02476,2.3368563 0.660496,0 0.670465,-2.3368563 0.02476,-2.3368563 z" />
|
|
32
|
-
</g>
|
|
33
|
-
</svg>
|