@serifpersia/dango 3.8.6 → 3.8.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 +1 -1
- package/client/dist/assets/{AnimeCard-DWKuN1cB.js → AnimeCard-G3oigO8B.js} +1 -1
- package/client/dist/assets/{AnimeInfo-BvNA7-QZ.js → AnimeInfo-CR4XFD0Q.js} +1 -1
- package/client/dist/assets/{AnimeInfoPage-BGg76ExO.js → AnimeInfoPage-DbT2RS0J.js} +2 -2
- package/client/dist/assets/{Asmr-C8pvBHUO.js → Asmr-BaXYabXN.js} +1 -1
- package/client/dist/assets/{AsmrPopup-BV5rbWXg.js → AsmrPopup-6ky2U3uz.js} +1 -1
- package/client/dist/assets/{AsmrResetProgressModal-Cs5wzgRU.js → AsmrResetProgressModal-DXwHSqwf.js} +1 -1
- package/client/dist/assets/Home-ZHM84CD8.js +1 -0
- package/client/dist/assets/{Home-grKghNM9.css → Home-ujV6ObHi.css} +1 -1
- package/client/dist/assets/{Insights-RSd-4osN.js → Insights-C6rMfz5x.js} +1 -1
- package/client/dist/assets/{LibraryListPage-CHHjw4Jz.js → LibraryListPage-XHeMv9aN.js} +1 -1
- package/client/dist/assets/{ListeningList-DkgZaFkg.js → ListeningList-Dm_owBjG.js} +1 -1
- package/client/dist/assets/{Manga-BAI78oiq.js → Manga-BmHoV3yQ.js} +1 -1
- package/client/dist/assets/{MangaInfoPage-CPYfuLAg.js → MangaInfoPage-Blz86W7a.js} +1 -1
- package/client/dist/assets/{MangaReadPage-DvznQu_2.js → MangaReadPage-DzEhRrLW.js} +1 -1
- package/client/dist/assets/{MangaResetProgressModal-BPci6zSM.js → MangaResetProgressModal-DdnI3zEg.js} +1 -1
- package/client/dist/assets/{Mature-Cob1Zmtu.js → Mature-DGDC_8w6.js} +1 -1
- package/client/dist/assets/{MatureConsentModal-BrKd4CBZ.js → MatureConsentModal-BXFvhDf0.js} +1 -1
- package/client/dist/assets/{MediaCard-CXZJ8wr7.js → MediaCard-DW8QbvWe.js} +1 -1
- package/client/dist/assets/{OptionListMenu-ClUReC8J.js → OptionListMenu-Dxx8rcuO.js} +1 -1
- package/client/dist/assets/Player-CQy7jQbB.js +56 -0
- package/client/dist/assets/{PlayerProvider-DzaMVhFX.js → PlayerProvider-BoJyuLEn.js} +1 -1
- package/client/dist/assets/{PlayerSettings-DnFjoot8.js → PlayerSettings-DSq0bKT6.js} +1 -1
- package/client/dist/assets/{QueueOptionsButton-BdAz_Gn-.js → QueueOptionsButton-B2p9VIz2.js} +1 -1
- package/client/dist/assets/{QueueRail-BMLyoeAe.js → QueueRail-BWcF0bqm.js} +1 -1
- package/client/dist/assets/{ReadingList-B62vvh4_.js → ReadingList-CKJ1Lt3H.js} +1 -1
- package/client/dist/assets/{ResetProgressModal-CXDZfCap.js → ResetProgressModal-BpNG6BGY.js} +1 -1
- package/client/dist/assets/{Search-CfNUqNi0.js → Search-D5OkKFDj.js} +1 -1
- package/client/dist/assets/Settings-_URnBHKL.js +21 -0
- package/client/dist/assets/{SkeletonGrid-CmHR4_Fc.js → SkeletonGrid-BVWffnlT.js} +1 -1
- package/client/dist/assets/{Trackers-BnvqfI9T.js → Trackers-D4BC2YOO.js} +1 -1
- package/client/dist/assets/Tv-B0-XYYdF.js +4 -0
- package/client/dist/assets/{Tv-D3vXCsSC.css → Tv-DT3m2nZs.css} +1 -1
- package/client/dist/assets/{TvInfo-6fZeQsh1.js → TvInfo-FWR5_kso.js} +1 -1
- package/client/dist/assets/{TvPopup-CIMgMYf0.js → TvPopup-JKZPbL5t.js} +1 -1
- package/client/dist/assets/{TvSearch-DGG4xRiv.js → TvSearch-Gddgkz5g.js} +1 -1
- package/client/dist/assets/{TvWatchlist-B6DLkxqi.js → TvWatchlist-BTTqu23j.js} +1 -1
- package/client/dist/assets/{VirtualKeyboard-D8TvygKk.js → VirtualKeyboard-BD5VOYcJ.js} +1 -1
- package/client/dist/assets/{WatchAlong-ivfsMGhR.js → WatchAlong-Czm3Pr1E.js} +1 -1
- package/client/dist/assets/{WatchAlongPanel-CvUFCFll.js → WatchAlongPanel-Dsmcqrjh.js} +1 -1
- package/client/dist/assets/{Watchlist-dsmIAzsH.js → Watchlist-BMRAdzMF.js} +1 -1
- package/client/dist/assets/index-Bi-DGtzC.js +178 -0
- package/client/dist/assets/index-RwPVmyxh.css +1 -0
- package/client/dist/assets/{libraryInvalidation-CHlEJU7b.js → libraryInvalidation-B5vX-vJv.js} +1 -1
- package/client/dist/assets/{playbackCompletion-DB_c1lex.js → playbackCompletion-Dz3OK72-.js} +1 -1
- package/client/dist/assets/{useAnimeInfoData-DrWgr6PK.js → useAnimeInfoData-CQTVAjpz.js} +1 -1
- package/client/dist/assets/{useMangaLibrary-sGh96sdT.js → useMangaLibrary-i1RAEkNy.js} +1 -1
- package/client/dist/assets/{useMangaPopup-CWDMFbSD.js → useMangaPopup-BMXrc7pH.js} +1 -1
- package/client/dist/assets/{useProviders-DphwZjpZ.js → useProviders-DbKN3TWq.js} +1 -1
- package/client/dist/assets/{useTv-DatZ0tof.js → useTv-4SqDfx-O.js} +1 -1
- package/client/dist/assets/{useTvLibrary-efdd6TIy.js → useTvLibrary-yhqRv3U7.js} +1 -1
- package/client/dist/assets/{useWatchAlongPlayer-CRf0zHFj.js → useWatchAlongPlayer-BvcoBlQi.js} +3 -3
- package/client/dist/assets/useWatchAlongPlayer-CkSxIqXL.css +1 -0
- package/client/dist/index.html +2 -2
- package/package.json +2 -2
- package/server/dist/config.js +1 -1
- package/server/dist/server.js +146 -146
- package/server/package.json +1 -1
- package/client/dist/assets/Home-C3k84yqn.js +0 -1
- package/client/dist/assets/Player-7iroOb7T.js +0 -56
- package/client/dist/assets/Settings-CxC4k-nB.js +0 -21
- package/client/dist/assets/Tv-Dht8h84V.js +0 -4
- package/client/dist/assets/index-Ej7BS74s.css +0 -1
- package/client/dist/assets/index-npJ4Ahxa.js +0 -178
- package/client/dist/assets/useWatchAlongPlayer-CzQyysyL.css +0 -1
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Home-ZHM84CD8.js","assets/vendor-core-DfaOB3Rn.js","assets/vendor-query-BBT5_sHx.js","assets/MediaCard-DW8QbvWe.js","assets/vendor-icons-DrybRNxP.js","assets/vendor-ui-3qrARCPr.js","assets/useIsMobile-Dvx1uJ82.js","assets/MatureConsentModal-BXFvhDf0.js","assets/MatureConsentModal-CqewXc0q.css","assets/MediaCard-CJ-18Ma8.css","assets/AnimeCard-G3oigO8B.js","assets/useAnimeInfoData-CQTVAjpz.js","assets/QueueOptionsButton-B2p9VIz2.js","assets/QueueOptionsButton-CM15uQn8.css","assets/playbackCompletion-Dz3OK72-.js","assets/SkeletonGrid-BVWffnlT.js","assets/SkeletonGrid-BisPI38I.css","assets/ErrorMessage-DAxegITP.js","assets/ErrorMessage-CXoRbrLN.css","assets/ResetProgressModal-BpNG6BGY.js","assets/QueueRail-BWcF0bqm.js","assets/QueueRail-CcHdXRmS.css","assets/useMangaPopup-BMXrc7pH.js","assets/useMangaLibrary-i1RAEkNy.js","assets/libraryInvalidation-B5vX-vJv.js","assets/usePopup-DS9jMzp6.js","assets/MangaResetProgressModal-DdnI3zEg.js","assets/useProviders-DbKN3TWq.js","assets/useTv-4SqDfx-O.js","assets/TvPopup-JKZPbL5t.js","assets/useTvLibrary-yhqRv3U7.js","assets/AsmrResetProgressModal-DXwHSqwf.js","assets/AsmrPopup-6ky2U3uz.js","assets/Home-ujV6ObHi.css","assets/Watchlist-BMRAdzMF.js","assets/LibraryListPage.module-r6k9nyT9.js","assets/LibraryListPage-DmdjNa2U.css","assets/ActiveFilterChips-olGfwxle.js","assets/ActiveFilterChips-QjkplDN2.css","assets/Watchlist-DW7kUORr.css","assets/Settings-_URnBHKL.js","assets/ToggleSwitch-CN_ppEc9.js","assets/ToggleSwitch-BPil0d_k.css","assets/Settings-B57LhIVH.css","assets/Player-CQy7jQbB.js","assets/PlayerProvider-BoJyuLEn.js","assets/PlayerProvider-ZeplRma-.css","assets/useWatchAlongPlayer-BvcoBlQi.js","assets/useWatchAlongPlayer-CkSxIqXL.css","assets/AnimeMetaDetails-B3-A7O5H.js","assets/AnimeMetaDetails-BwNQnRCd.css","assets/SynopsisText-B3Sa5pRv.js","assets/SynopsisText-CYv2W3yR.css","assets/WatchAlongPanel-Dsmcqrjh.js","assets/WatchAlongPanel-DWb8lSzW.css","assets/Player-1LfYnRyR.css","assets/WatchAlong-Czm3Pr1E.js","assets/Search-D5OkKFDj.js","assets/Search.module-C_qwCdHS.js","assets/Search-DCKK3seW.css","assets/Mature-DGDC_8w6.js","assets/Mature-DJmUUtlF.css","assets/Asmr-BaXYabXN.js","assets/useAsmrPopup-BBmHrx9v.js","assets/page.module-C1MlZzf3.js","assets/page-DRvjODkg.css","assets/Asmr-Do89pEHG.css","assets/Manga-BmHoV3yQ.js","assets/Manga.module-depGEacJ.js","assets/Manga-CqAceKxR.css","assets/MangaInfoPage-Blz86W7a.js","assets/MangaReadPage-DzEhRrLW.js","assets/ReadingList-CKJ1Lt3H.js","assets/LibraryListPage-XHeMv9aN.js","assets/TvSearch-Gddgkz5g.js","assets/TvInfo-FWR5_kso.js","assets/TvInfo-Bu36xJyO.css","assets/Tv-B0-XYYdF.js","assets/OptionListMenu-Dxx8rcuO.js","assets/Tv-DT3m2nZs.css","assets/TvWatchlist-BTTqu23j.js","assets/ListeningList-Dm_owBjG.js","assets/Trackers-D4BC2YOO.js","assets/Trackers-BC636V59.css","assets/Insights-C6rMfz5x.js","assets/Insights-DEicrokg.css","assets/AnimeInfoPage-DbT2RS0J.js","assets/PlayerRedirect-fv2tzEUu.js","assets/VirtualKeyboard-BD5VOYcJ.js","assets/VirtualKeyboard-CejCi3pJ.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{N as Rr,k as re,A as M,q as z,h as w,S as de,d as g,u as o,X as ye,x as ge,T as Le,$ as $n,g as $t,L as ce,a as Mn,c as ut,e as Dr,f as $r,D as Mr,i as jr,P as en,j as Fr,l as $,m as tn,z as K,n as Br,B as Wr}from"./vendor-core-DfaOB3Rn.js";import{s as Ce,i as Kr,q as Ur,u as oe,a as le,b as F,c as dt,Q as Hr,d as Qr}from"./vendor-query-BBT5_sHx.js";import{I as A}from"./vendor-icons-DrybRNxP.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();const Vr="modulepreload",zr=function(e){return"/"+e},nn={},U=function(t,n,r){let s=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");s=l(n.map(u=>{if(u=zr(u),u in nn)return;nn[u]=!0;const d=u.endsWith(".css"),m=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${m}`))return;const h=document.createElement("link");if(h.rel=d?"stylesheet":Vr,d||(h.as="script"),h.crossOrigin="",h.href=u,c&&h.setAttribute("nonce",c),document.head.appendChild(h),d)return new Promise((p,y)=>{h.addEventListener("load",p),h.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${u}`)))})}))}function a(i){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=i,window.dispatchEvent(c),!c.defaultPrevented)throw i}return s.then(i=>{for(const c of i||[])c.status==="rejected"&&a(c.reason);return t().catch(a)})};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,rn=/\n+/g,ke=(e,t)=>{let n="",r="",s="";for(let a in e){let i=e[a];a[0]=="@"?a[1]=="i"?n=a+" "+i+";":r+=a[1]=="f"?ke(i,a):a+"{"+ke(i,a[1]=="k"?"":t)+"}":typeof i=="object"?r+=ke(i,t?t.replace(/([^,])+/g,c=>a.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,c):c?c+" "+l:l)):a):i!=null&&(a=a[1]=="-"?a:a.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=ke.p?ke.p(a,i):a+":"+i+";")}return n+(t&&s?t+"{"+s+"}":s)+r},Se={},jn=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+jn(e[n]);return t}return e},Xr=(e,t,n,r,s)=>{let a=jn(e),i=Se[a]||(Se[a]=(l=>{let u=0,d=11;for(;u<l.length;)d=101*d+l.charCodeAt(u++)>>>0;return"go"+d})(a));if(!Se[i]){let l=a!==e?e:(u=>{let d,m,h=[{}];for(;d=Yr.exec(u.replace(Zr,""));)d[4]?h.shift():d[3]?(m=d[3].replace(rn," ").trim(),h.unshift(h[0][m]=h[0][m]||{})):h[0][d[1]]=d[2].replace(rn," ").trim();return h[0]})(e);Se[i]=ke(s?{["@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,s,a)=>{let i=t[a];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?"":ke(c,""):c===!1?"":c}return r+s+(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,s)=>Object.assign(r,s&&s.call?s(t.p):s),{}):n,Jr(t.target),t.g,t.o,t.k)}let Fn,Tt,It;mt.bind({g:1});let _e=mt.bind({k:1});function to(e,t,n,r){ke.p=t,Fn=e,Tt=n,It=r}function Te(e,t){let n=this||{};return function(){let r=arguments;function s(a,i){let c=Object.assign({},a),l=c.className||s.className;n.p=Object.assign({theme:Tt&&Tt()},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),It&&u[0]&&It(c),Fn(u,c)}return s}}var no=e=>typeof e=="function",at=(e,t)=>no(e)?e(t):e,ro=(()=>{let e=0;return()=>(++e).toString()})(),Bn=(()=>{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,Mt="default",Wn=(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 Wn(e,{type:e.toasts.find(i=>i.id===r.id)?1:0,toast:r});case 3:let{toastId:s}=t;return{...e,toasts:e.toasts.map(i=>i.id===s||s===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 a=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(i=>({...i,pauseDuration:i.pauseDuration+a}))}}},rt=[],Kn={toasts:[],pausedAt:void 0,settings:{toastLimit:oo}},pe={},Un=(e,t=Mt)=>{pe[t]=Wn(pe[t]||Kn,e),rt.forEach(([n,r])=>{n===t&&r(pe[t])})},Hn=e=>Object.keys(pe).forEach(t=>Un(e,t)),so=e=>Object.keys(pe).find(t=>pe[t].toasts.some(n=>n.id===e)),ht=(e=Mt)=>t=>{Un(t,e)},ao={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},io=(e={},t=Mt)=>{let[n,r]=g(pe[t]||Kn),s=M(pe[t]);w(()=>(s.current!==pe[t]&&r(pe[t]),rt.push([t,r]),()=>{let i=rt.findIndex(([c])=>c===t);i>-1&&rt.splice(i,1)}),[t]);let a=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||ao[i.type],style:{...e.style,...(u=e[i.type])==null?void 0:u.style,...i.style}}});return{...n,toasts:a}},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 ht(r.toasterId||so(r.id))({type:2,toast:r}),r.id},Y=(e,t)=>Ve("blank")(e,t);Y.error=Ve("error");Y.success=Ve("success");Y.loading=Ve("loading");Y.custom=Ve("custom");Y.dismiss=(e,t)=>{let n={type:3,toastId:e};t?ht(t)(n):Hn(n)};Y.dismissAll=e=>Y.dismiss(void 0,e);Y.remove=(e,t)=>{let n={type:4,toastId:e};t?ht(t)(n):Hn(n)};Y.removeAll=e=>Y.remove(void 0,e);Y.promise=(e,t,n)=>{let r=Y.loading(t.loading,{...n,...n?.loading});return typeof e=="function"&&(e=e()),e.then(s=>{let a=t.success?at(t.success,s):void 0;return a?Y.success(a,{id:r,...n,...n?.success}):Y.dismiss(r),s}).catch(s=>{let a=t.error?at(t.error,s):void 0;a?Y.error(a,{id:r,...n,...n?.error}):Y.dismiss(r)}),e};var lo=1e3,uo=(e,t="default")=>{let{toasts:n,pausedAt:r}=io(e,t),s=M(new Map).current,a=z((m,h=lo)=>{if(s.has(m))return;let p=setTimeout(()=>{s.delete(m),i({type:4,toastId:m})},h);s.set(m,p)},[]);w(()=>{if(r)return;let m=Date.now(),h=n.map(p=>{if(p.duration===1/0)return;let y=(p.duration||0)+p.pauseDuration-(m-p.createdAt);if(y<0){p.visible&&Y.dismiss(p.id);return}return setTimeout(()=>Y.dismiss(p.id,t),y)});return()=>{h.forEach(p=>p&&clearTimeout(p))}},[n,r,t]);let i=z(ht(t),[t]),c=z(()=>{i({type:5,time:Date.now()})},[i]),l=z((m,h)=>{i({type:1,toast:{id:m,height:h}})},[i]),u=z(()=>{r&&i({type:6,time:Date.now()})},[r,i]),d=z((m,h)=>{let{reverseOrder:p=!1,gutter:y=8,defaultPosition:E}=h||{},O=n.filter(b=>(b.position||E)===(m.position||E)&&b.height),N=O.findIndex(b=>b.id===m.id),S=O.filter((b,T)=>T<N&&b.visible).length;return O.filter(b=>b.visible).slice(...p?[S+1]:[0,S]).reduce((b,T)=>b+(T.height||0)+y,0)},[n]);return w(()=>{n.forEach(m=>{if(m.dismissed)a(m.id,m.removeDelay);else{let h=s.get(m.id);h&&(clearTimeout(h),s.delete(m.id))}})},[n,a]),{toasts:n,handlers:{updateHeight:l,startPause:c,endPause:u,calculateOffset:d}}},mo=_e`
|
|
3
|
+
from {
|
|
4
|
+
transform: scale(0) rotate(45deg);
|
|
5
|
+
opacity: 0;
|
|
6
|
+
}
|
|
7
|
+
to {
|
|
8
|
+
transform: scale(1) rotate(45deg);
|
|
9
|
+
opacity: 1;
|
|
10
|
+
}`,ho=_e`
|
|
11
|
+
from {
|
|
12
|
+
transform: scale(0);
|
|
13
|
+
opacity: 0;
|
|
14
|
+
}
|
|
15
|
+
to {
|
|
16
|
+
transform: scale(1);
|
|
17
|
+
opacity: 1;
|
|
18
|
+
}`,po=_e`
|
|
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=Te("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: ${ho} 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: ${po} 0.15s ease-out forwards;
|
|
56
|
+
animation-delay: 180ms;
|
|
57
|
+
transform: rotate(90deg);
|
|
58
|
+
}
|
|
59
|
+
`,yo=_e`
|
|
60
|
+
from {
|
|
61
|
+
transform: rotate(0deg);
|
|
62
|
+
}
|
|
63
|
+
to {
|
|
64
|
+
transform: rotate(360deg);
|
|
65
|
+
}
|
|
66
|
+
`,go=Te("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: ${yo} 1s linear infinite;
|
|
75
|
+
`,vo=_e`
|
|
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=_e`
|
|
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=Te("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=Te("div")`
|
|
125
|
+
position: absolute;
|
|
126
|
+
`,Eo=Te("div")`
|
|
127
|
+
position: relative;
|
|
128
|
+
display: flex;
|
|
129
|
+
justify-content: center;
|
|
130
|
+
align-items: center;
|
|
131
|
+
min-width: 20px;
|
|
132
|
+
min-height: 20px;
|
|
133
|
+
`,So=_e`
|
|
134
|
+
from {
|
|
135
|
+
transform: scale(0.6);
|
|
136
|
+
opacity: 0.4;
|
|
137
|
+
}
|
|
138
|
+
to {
|
|
139
|
+
transform: scale(1);
|
|
140
|
+
opacity: 1;
|
|
141
|
+
}`,ko=Te("div")`
|
|
142
|
+
position: relative;
|
|
143
|
+
transform: scale(0.6);
|
|
144
|
+
opacity: 0.4;
|
|
145
|
+
min-width: 20px;
|
|
146
|
+
animation: ${So} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
147
|
+
forwards;
|
|
148
|
+
`,Po=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?re(ko,null,t):t:n==="blank"?null:re(Eo,null,re(go,{...r}),n!=="loading"&&re(_o,null,n==="error"?re(fo,{...r}):re(wo,{...r})))},To=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
|
+
`,Io=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
|
+
`,No="0%{opacity:0;} 100%{opacity:1;}",Co="0%{opacity:1;} 100%{opacity:0;}",xo=Te("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=Te("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,s]=Bn()?[No,Co]:[To(n),Io(n)];return{animation:t?`${_e(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${_e(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},qo=Rr(({toast:e,position:t,style:n,children:r})=>{let s=e.height?Oo(e.position||t||"top-center",e.visible):{opacity:0},a=re(Po,{toast:e}),i=re(Ao,{...e.ariaProps},at(e.message,e));return re(xo,{className:e.className,style:{...s,...n,...e.style}},typeof r=="function"?r({icon:a,message:i}):re(de,null,a,i))});to(re);var Lo=({id:e,className:t,style:n,onHeightUpdate:r,children:s})=>{let a=z(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 re("div",{ref:a,className:t,style:n},s)},Ro=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},s=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:Bn()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...s}},Do=mt`
|
|
174
|
+
z-index: 9999;
|
|
175
|
+
> * {
|
|
176
|
+
pointer-events: auto;
|
|
177
|
+
}
|
|
178
|
+
`,Je=16,Qn=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:s,toasterId:a,containerStyle:i,containerClassName:c})=>{let{toasts:l,handlers:u}=uo(n,a);return re("div",{"data-rht-toaster":a||"",style:{position:"fixed",zIndex:9999,top:Je,left:Je,right:Je,bottom:Je,pointerEvents:"none",...i},className:c,onMouseEnter:u.startPause,onMouseLeave:u.endPause},l.map(d=>{let m=d.position||t,h=u.calculateOffset(d,{reverseOrder:e,gutter:r,defaultPosition:t}),p=Ro(m,h);return re(Lo,{id:d.id,key:d.id,onHeightUpdate:u.updateHeight,className:d.visible?Do:"",style:p},d.type==="custom"?at(d.message,d):s?s(d):re(qo,{toast:d,position:m}))}))},C=Y;const $o="_fadeImage_1bp3x_1",Mo="_loaded_1bp3x_6",on={fadeImage:$o,loaded:Mo},jo=({className:e,onLoad:t,onError:n,...r})=>{const s=r.src,[a,i]=g(null),c=a!==null&&a===s;return o("img",{...r,className:`${e??""} ${on.fadeImage} ${c?on.loaded:""}`,onLoad:l=>{i(s),t?.(l)},onError:l=>{i(s),n?.(l)}})};function pt(e){const t={subscribe(n){let r=null,s=!1,a=!1,i=!1;function c(){if(r===null){i=!0;return}a||(a=!0,typeof r=="function"?r():r&&r.unsubscribe())}return r=e({next(l){var u;s||(u=n.next)===null||u===void 0||u.call(n,l)},error(l){var u;s||(s=!0,(u=n.error)===null||u===void 0||u.call(n,l),c())},complete(){var l;s||(s=!0,(l=n.complete)===null||l===void 0||l.call(n),c())}}),i&&c(),{unsubscribe:c}},pipe(...n){return n.reduce(Fo,t)}};return t}function Fo(e,t){return t(e)}function Bo(e){const t=new AbortController;return new Promise((n,r)=>{let s=!1;function a(){s||(s=!0,i.unsubscribe())}t.signal.addEventListener("abort",()=>{r(t.signal.reason)});const i=e.subscribe({next(c){s=!0,n(c),a()},error(c){r(c)},complete(){t.abort(),a()}})})}function Wo(e){return t=>{let n=0,r=null;const s=[];function a(){r||(r=t.subscribe({next(c){for(const u of s){var l;(l=u.next)===null||l===void 0||l.call(u,c)}},error(c){for(const u of s){var l;(l=u.error)===null||l===void 0||l.call(u,c)}},complete(){for(const l of s){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 pt(c=>(n++,s.push(c),a(),{unsubscribe(){n--,i();const l=s.findIndex(u=>u===c);l>-1&&s.splice(l,1)}}))}}function Ko(e){let t=e;const n=[],r=i=>{t!==void 0&&i.next(t),n.push(i)},s=i=>{n.splice(n.indexOf(i),1)},a=pt(i=>(r(i),()=>{s(i)}));return a.next=i=>{if(t!==i){t=i;for(const c of n)c.next(i)}},a.get=()=>t,a}function Uo(e){return pt(t=>{function n(r=0,s=e.op){const a=e.links[r];if(!a)throw new Error("No more links to execute - did you forget to add an ending link?");return a({op:s,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 Ho(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=Ho(e,"string");return Ue(t)=="symbol"?t:t+""}function ae(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(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Z(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){ae(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 Vo(e){return typeof e=="function"}function zo(){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=()=>{},an=e=>{Object.freeze&&Object.freeze(e)};function zn(e,t,n){var r;const s=t.join(".");return(r=n[s])!==null&&r!==void 0||(n[s]=new Proxy(Vn,{get(a,i){if(!(typeof i!="string"||i==="then"))return zn(e,[...t,i],n)},apply(a,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)}),an(u.args),an(u.path),e(u)}})),n[s]}const Gn=e=>zn(e,[],zo()),Zo=e=>new Proxy(Vn,{get(t,n){if(n!=="then")return e(n)}});function He(e){"@babel/helpers - typeof";return He=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},He(e)}function Xo(e,t){if(He(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(He(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function es(e){var t=Xo(e,"string");return He(t)=="symbol"?t:t+""}function Nt(e,t,n){return(t=es(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ye(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cn(Object(n),!0).forEach(function(r){Nt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cn(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var ts=class extends Error{constructor(e){super(ns(e)),Object.assign(this,e)}};function ns(e){if("message"in e)return String(e.message)}function rs(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 ts(e)}}var ln=class extends Error{constructor(e){var t,n,r;const s=rs(e.cause),a=(t=(n=e.message)!==null&&n!==void 0?n:s?.message)!==null&&t!==void 0?t:e.code;super(a,{cause:s}),Nt(this,"cause",void 0),Nt(this,"code",void 0),this.code=e.code,this.name="TRPCError",(r=this.cause)!==null&&r!==void 0||(this.cause=s)}};function os(e,t){if("error"in e){const n=t.deserialize(e.error);return{ok:!1,error:Ye(Ye({},e),{},{error:n})}}return{ok:!0,result:Ye(Ye({},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 ss(e,t){let n;try{n=os(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 as(e){return typeof e=="function"}async function is(e,t){const{_def:n}=e;let r=n.procedures[t];for(;!r;){const s=Object.keys(n.lazy).find(a=>t===a||t.startsWith(a+"."));if(!s)return null;await n.lazy[s].load(),r=n.procedures[t]}return r}async function cs(e){const{type:t,path:n}=e,r=await is(e.router,n);if(!r||!as(r)||r._def.type!==t&&!e.allowMethodOverride)throw new ln({code:"NOT_FOUND",message:`No "${t}"-procedure on path "${n}"`});if(r._def.type!==t&&e.allowMethodOverride&&r._def.type==="subscription")throw new ln({code:"METHOD_NOT_SUPPORTED",message:"Method override is not supported for subscriptions"});return r(e)}function ls(e){return e instanceof it}function us(e){return Pe(e)&&Pe(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function ds(e,t){return typeof e=="string"?e:Pe(e)&&typeof e.message=="string"?e.message:t}var it=class ot extends Error{constructor(t,n){var r,s;const a=n?.cause;super(t,{cause:a}),ae(this,"cause",void 0),ae(this,"shape",void 0),ae(this,"data",void 0),ae(this,"meta",void 0),this.meta=n?.meta,this.cause=a,this.shape=n==null||(r=n.result)===null||r===void 0?void 0:r.error,this.data=n==null||(s=n.result)===null||s===void 0?void 0:s.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,ot.prototype)}static from(t,n={}){const r=t;return ls(r)?(n.meta&&(r.meta=Z(Z({},r.meta),n.meta)),r):us(r)?new ot(r.error.message,Z(Z({},n),{},{result:r,cause:n.cause})):new ot(ds(r,"Unknown error"),Z(Z({},n),{},{cause:r}))}};function ms(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 un=e=>typeof e=="function";function hs(e){if(e)return e;if(typeof window<"u"&&un(window.fetch))return window.fetch.bind(window);if(typeof globalThis<"u"&&un(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}function ps(...e){const t=new AbortController,n=e.length;let r=0;const s=()=>{++r===n&&t.abort()};for(const a of e)a?.aborted?s():a?.addEventListener("abort",s,{once:!0});return t.signal}function fs(...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 ys(e){return{url:e.url.toString(),fetch:e.fetch,transformer:ms(e.transformer),methodOverride:e.methodOverride}}function gs(e){const t={};for(let n=0;n<e.length;n++){const r=e[n];t[n]=r}return t}const vs={query:"GET",mutation:"POST",subscription:"PATCH"};function Jn(e){return"input"in e?e.transformer.input.serialize(e.input):gs(e.inputs.map(t=>e.transformer.input.serialize(t)))}const Yn=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 s=Jn(e);s!==void 0&&e.methodOverride!=="POST"&&r.push(`input=${encodeURIComponent(JSON.stringify(s))}`)}return r.length&&(n+="?"+r.join("&")),n},bs=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=Jn(e);return t!==void 0?JSON.stringify(t):void 0},ws=e=>ks(Z(Z({},e),{},{contentTypeHeader:"application/json",getUrl:Yn,getBody:bs}));var _s=class extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}};const Es=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 _s};async function Ss(e){var t,n;Es(e.signal);const r=e.getUrl(e),s=e.getBody(e),a=(t=e.methodOverride)!==null&&t!==void 0?t:vs[e.type],i=await(async()=>{const l=await e.headers();return Symbol.iterator in l?Object.fromEntries(l):l})(),c=Z(Z(Z({},e.contentTypeHeader&&a!=="GET"?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{[(n=e.trpcAcceptHeaderKey)!==null&&n!==void 0?n:"trpc-accept"]:e.trpcAcceptHeader}:void 0),i);return hs(e.fetch)(r,{method:a,signal:e.signal,body:s,headers:c})}async function ks(e){const t={},n=await Ss(e);t.response=n;const r=await n.json();return t.responseJSON=r,{json:r,meta:t}}const dn=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function mn(e){let t=null,n=null;const r=()=>{clearTimeout(n),n=null,t=null};function s(c){const l=[[]];let u=0;for(;;){const h=c[u];if(!h)break;const p=l[l.length-1];if(h.aborted){var d;(d=h.reject)===null||d===void 0||d.call(h,new Error("Aborted")),u++;continue}if(e.validate(p.concat(h).map(y=>y.key))){p.push(h),u++;continue}if(p.length===0){var m;(m=h.reject)===null||m===void 0||m.call(h,new Error("Input is too big for a single dispatch")),u++;continue}l.push([])}return l}function a(){const c=s(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(h,p)=>{const y=u.items[p];try{var E;const N=await Promise.resolve(h);(E=y.resolve)===null||E===void 0||E.call(y,N)}catch(N){var O;(O=y.reject)===null||O===void 0||O.call(y,N)}y.batch=null,y.reject=null,y.resolve=null}));for(const h of u.items){var m;(m=h.reject)===null||m===void 0||m.call(h,new Error("Missing result")),h.batch=null}}).catch(d=>{for(const h of u.items){var m;(m=h.reject)===null||m===void 0||m.call(h,d),h.batch=null}})}}function i(c){var l;const u={aborted:!1,key:c,batch:null,resolve:dn,reject:dn},d=new Promise((m,h)=>{var p;u.reject=h,u.resolve=m,(p=t)!==null&&p!==void 0||(t=[]),t.push(u)});return(l=n)!==null&&l!==void 0||(n=setTimeout(a)),d}return{load:i}}function Ps(e){var t,n;const r=ys(e),s=(t=e.maxURLLength)!==null&&t!==void 0?t:1/0,a=(n=e.maxItems)!==null&&n!==void 0?n:1/0;return()=>{const i=l=>({validate(u){if(s===1/0&&a===1/0)return!0;if(u.length>a)return!1;const d=u.map(h=>h.path).join(","),m=u.map(h=>h.input);return Yn(Z(Z({},r),{},{type:l,path:d,inputs:m,signal:null})).length<=s},async fetch(u){const d=u.map(y=>y.path).join(","),m=u.map(y=>y.input),h=ps(...u.map(y=>y.signal)),p=await ws(Z(Z({},r),{},{path:d,inputs:m,type:l,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:u}):e.headers:{}},signal:h}));return(Array.isArray(p.json)?p.json:u.map(()=>p.json)).map(y=>({meta:p.meta,json:y}))}}),c={query:mn(i("query")),mutation:mn(i("mutation"))};return({op:l})=>pt(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(Z(Z({},l),{},{signal:fs(l.signal,d.signal)}));let h=!1,p;return m.then(y=>{h=!0,p=y;const E=ss(y.json,r.transformer.output);if(!E.ok){u.error(it.from(E.error,{meta:y.meta}));return}u.next({context:y.meta,result:E.result}),u.complete()}).catch(y=>{h=!0,u.error(it.from(y,{meta:p?.meta}))}),()=>{h||d.abort()}})}}const Zn=(e,...t)=>typeof e=="function"?e(...t):e;function Ts(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}async function Is(e){const t=await Zn(e.url);return e.connectionParams?t+`${t.includes("?")?"&":"?"}connectionParams=1`:t}async function Ns(e,t){const n={method:"connectionParams",data:await Zn(e)};return t.encode(n)}function Cs(e){const{promise:t,resolve:n,reject:r}=Ts();return e.addEventListener("open",()=>{e.removeEventListener("error",r),n()}),e.addEventListener("error",r),t}function xs(e,{intervalMs:t,pongTimeoutMs:n}){let r,s;function a(){r=setTimeout(()=>{e.send("PING"),s=setTimeout(()=>{e.close()},n)},t)}function i(){clearTimeout(r),a()}function c(){clearTimeout(s),i()}e.addEventListener("open",a),e.addEventListener("message",({data:l})=>{clearTimeout(r),a(),l==="PONG"&&c()}),e.addEventListener("close",()=>{clearTimeout(r),clearTimeout(s)})}var As=class Ct{constructor(t){var n;if(ae(this,"id",++Ct.connectCount),ae(this,"WebSocketPonyfill",void 0),ae(this,"urlOptions",void 0),ae(this,"keepAliveOpts",void 0),ae(this,"encoder",void 0),ae(this,"wsObservable",Ko(null)),ae(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=++Ct.connectCount;const t=Is(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&&xs(n,this.keepAliveOpts),n.addEventListener("close",()=>{this.ws===n&&(this.ws=null)}),await Cs(n),this.urlOptions.connectionParams&&n.send(await Ns(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()}}};ae(As,"connectCount",0);var Xn=class{constructor(e){ae(this,"links",void 0),ae(this,"runtime",void 0),ae(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(t=>t(this.runtime))}$request(e){var t;return Uo({links:this.links,op:Z(Z({},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 Bo(t)).result.data}catch(t){throw it.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 s;(s=n.onConnectionStateChange)===null||s===void 0||s.call(n,r.result);break;case"started":var a;(a=n.onStarted)===null||a===void 0||a.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 s;(s=n.onError)===null||s===void 0||s.call(n,r)},complete(){var r;(r=n.onComplete)===null||r===void 0||r.call(n)}})}};const er=Symbol.for("trpc_untypedClient"),Os={query:"query",mutate:"mutation",subscribe:"subscription"},qs=e=>Os[e];function Ls(e){const t=Gn(({path:n,args:r})=>{const s=[...n],a=qs(s.pop()),i=s.join(".");return e[a](i,...r)});return Zo(n=>n===er?e:t[n])}function Rs(e){return Ls(new Xn(e))}function Ds(e){return e[er]}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 $s(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 Ms(e){var t=$s(e,"string");return Qe(t)=="symbol"?t:t+""}function js(e,t,n){return(t=Ms(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(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function R(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){js(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 Fs(e){var t,n,r,s=2;for(typeof Symbol<"u"&&(n=Symbol.asyncIterator,r=Symbol.iterator);s--;){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(s){return{value:s,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 s=this.s.return;return s===void 0?Promise.resolve({value:r,done:!0}):t(s.apply(this.s,arguments))},throw:function(r){var s=this.s.return;return s===void 0?Promise.reject(r):t(s.apply(this.s,arguments))}},new st(e)}function Bs(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 Ws(e,t){if(e==null)return{};var n,r,s=Bs(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}const Ks=["cursor","direction"];function ft(e){return{path:e.path.join(".")}}function Us(e){return e.length>=3}function Hs(e){return Us(e)?{type:"prefixed",prefix:e[0],path:e[1],args:e[2]}:{type:"unprefixed",prefix:void 0,path:e[0],args:e[1]}}function jt(e,t,n){var r;const s=Hs(e);let a=(r=s.args)===null||r===void 0?void 0:r.input;if(n){var i,c;a=R(R(R({},(i=(c=s.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[s.path.join("."),a,t?.trpc]}async function Qs(e,t,n){const r=t.getQueryCache().build(t,{queryKey:n});r.setState({data:[],status:"success"});const s=[];var a=!1,i=!1,c;try{for(var l=Fs(e),u;a=!(u=await l.next()).done;a=!1){const d=u.value;s.push(d),r.setState({data:[...s]})}}catch(d){i=!0,c=d}finally{try{a&&l.return!=null&&await l.return()}finally{if(i)throw c}}return s}function be(e){const t=Yo(()=>{const{input:n,type:r}=e,s=e.path.flatMap(a=>a.split("."));if(!n&&r==="any")return s.length?[s]:[];if(r==="infinite"&&Pe(n)&&("direction"in n||"cursor"in n)){const{cursor:a,direction:i}=n;return[s,{input:Ws(n,Ks),type:"infinite"}]}return[s,R(R({},typeof n<"u"&&n!==Ce&&{input:n}),r&&r!=="any"&&{type:r})]});return e.prefix&&t.unshift([e.prefix]),t}function tr(e){const t=[e.path.flatMap(n=>n.split("."))];return e.prefix&&t.unshift([e.prefix]),t}function Ft(e){return Vo(e)?e():e}function Vs(e){var t;const{input:n,query:r,path:s,queryKey:a,opts:i}=e,c=n===Ce,l=async u=>{var d;const m=R(R({},i),{},{trpc:R(R({},i?.trpc),!(i==null||(d=i.trpc)===null||d===void 0)&&d.abortOnUnmount?{signal:u.signal}:{signal:null})});return await r(...jt(a,m,{direction:u.direction,pageParam:u.pageParam}))};return Object.assign(Kr(R(R({},i??{}),{},{queryKey:a,queryFn:c?Ce:l,initialPageParam:(t=i?.initialCursor)!==null&&t!==void 0?t:n?.cursor})),{trpc:ft({path:s})})}function zs(e){var t,n;const{mutate:r,path:s,prefix:a,opts:i,overrides:c}=e,l=Ft(e.queryClient),u=tr({path:s,prefix:(t=i?.keyPrefix)!==null&&t!==void 0?t:a}),d=l.defaultMutationOptions(l.getMutationDefaults(u)),m=(n=c?.onSuccess)!==null&&n!==void 0?n:(p=>p.originalFn()),h=async p=>await r(...jt([...u,{input:p}],i));return R(R({},i),{},{mutationKey:u,mutationFn:h,onSuccess(...p){var y,E;return m({originalFn:()=>{var N,S,b;return(N=i==null||(S=i.onSuccess)===null||S===void 0?void 0:S.call(i,...p))!==null&&N!==void 0?N:d==null||(b=d.onSuccess)===null||b===void 0?void 0:b.call(d,...p)},queryClient:l,meta:(y=(E=i?.meta)!==null&&E!==void 0?E:d?.meta)!==null&&y!==void 0?y:{}})},trpc:ft({path:s})})}function Gs(e){const{input:t,query:n,path:r,queryKey:s,opts:a}=e,i=Ft(e.queryClient),c=t===Ce,l=async u=>{var d;const m=R(R({},a),{},{trpc:R(R({},a?.trpc),!(a==null||(d=a.trpc)===null||d===void 0)&&d.abortOnUnmount?{signal:u.signal}:{signal:null})}),h=u.queryKey,p=await n(...jt(h,m));return Jo(p)?Qs(p,i,h):p};return Object.assign(Ur(R(R({},a),{},{queryKey:s,queryFn:c?Ce:l})),{trpc:ft({path:r})})}const Js=e=>{const{subscribe:t,path:n,queryKey:r,input:s,opts:a={}}=e,i="enabled"in a?!!a.enabled:s!==Ce,c=l=>t(n.join("."),s===Ce?void 0:s,l);return R(R({},a),{},{enabled:i,subscribe:c,queryKey:r,trpc:ft({path:n})})};function Ys(e){const t=e.keyPrefix,n=r=>(s,a,i)=>"router"in e?Promise.resolve(Ft(e.ctx)).then(c=>cs({router:e.router,path:s,getRawInput:async()=>a,ctx:c,type:r,signal:void 0,batchIndex:0})):(e.client instanceof Xn?e.client:Ds(e.client))[r](s,a,i);return Gn(({args:r,path:s})=>{const a=[...s],i=a.pop(),[c,l]=r;return{"~types":void 0,pathKey:()=>be({path:a,type:"any",prefix:t}),pathFilter:()=>R(R({},c),{},{queryKey:be({path:a,type:"any",prefix:t})}),queryOptions:()=>Gs({input:c,opts:l,path:a,queryClient:e.queryClient,queryKey:be({path:a,input:c,type:"query",prefix:t}),query:n("query")}),queryKey:()=>be({path:a,input:c,type:"query",prefix:t}),queryFilter:()=>R(R({},l),{},{queryKey:be({path:a,input:c,type:"query",prefix:t})}),infiniteQueryOptions:()=>Vs({input:c,opts:l,path:a,queryKey:be({path:a,input:c,type:"infinite",prefix:t}),query:n("query")}),infiniteQueryKey:()=>be({path:a,input:c,type:"infinite",prefix:t}),infiniteQueryFilter:()=>R(R({},l),{},{queryKey:be({path:a,input:c,type:"infinite",prefix:t})}),mutationOptions:()=>{var u;return zs({opts:c,path:a,prefix:t,queryClient:e.queryClient,mutate:n("mutation"),overrides:(u=e.overrides)===null||u===void 0?void 0:u.mutations})},mutationKey:()=>tr({path:a,prefix:t}),subscriptionOptions:()=>Js({opts:l,path:a,input:c,queryKey:be({path:a,input:c,type:"any",prefix:t}),subscribe:n("subscription")})}[i]()})}function Zs(){const e=ye(null),t=ye(null),n=a=>{const i=Le(()=>Ys({client:a.trpcClient,queryClient:a.queryClient,keyPrefix:a.keyPrefix}),[a.trpcClient,a.queryClient,a.keyPrefix]);return re(e.Provider,{value:a.trpcClient},re(t.Provider,{value:i},a.children))};n.displayName="TRPCProvider";function r(){const a=ge(t);if(!a)throw new Error("useTRPC() can only be used inside of a <TRPCProvider>");return a}function s(){const a=ge(e);if(!a)throw new Error("useTRPCClient() can only be used inside of a <TRPCProvider>");return a}return{TRPCProvider:n,useTRPC:r,useTRPCClient:s}}const xt={lan:new Set,animepahe:new Set,jasmr:new Set};function Ne(e){for(const t of[...xt[e]])try{t()}catch(n){console.error(`auth-bus listener failed (${e}):`,n)}}function nr(e,t){return xt[e].add(t),()=>{xt[e].delete(t)}}let ct="default";function rr(){return ct}function Xs(e){ct=e}const ea=new Set(["playerVideoDelayMs","playerVideoDelayEnabled","anime4kEnabled"]);function Ze(e){return ct==="default"||ea.has(e)?e:`dango:profile:${ct}:${e}`}const ee={keyFor:Ze,getItem:e=>localStorage.getItem(Ze(e)),setItem:(e,t)=>localStorage.setItem(Ze(e),t),removeItem:e=>localStorage.removeItem(Ze(e))};function ta(){localStorage.setItem("dango:profile-session-change",`${Date.now()}-${Math.random()}`),window.location.assign("/")}const na=(e,t)=>new Promise((n,r)=>{t?.throwIfAborted();const s=()=>{clearTimeout(a),r(t?.reason)},a=setTimeout(()=>{t?.removeEventListener("abort",s),n()},e);t?.addEventListener("abort",s,{once:!0})}),Bt=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 s=n?.url??e.toString(),a=s.startsWith("/")&&!s.startsWith("//")||typeof window<"u"&&new URL(s,window.location.origin).origin===window.location.origin;if(a){!s.includes("/api/profiles/status")&&!s.includes("/api/profiles/login")&&!s.includes("/api/auth/app-")&&r.set("x-dango-profile-id",rr());let m=ee.getItem("animepahe_ua"),h=ee.getItem("animepahe_cookie");h&&m&&m!==navigator.userAgent&&(ee.removeItem("animepahe_cookie"),ee.removeItem("animepahe_ua"),h=null,m=null,C.error("Your browser changed. Verify AnimePahe again to refresh its cookie."),Ne("animepahe"));const p=ee.getItem("jasmr_ua"),y=ee.getItem("jasmr_cookie");m&&r.set("x-animepahe-ua",m),h&&r.set("x-animepahe-cookie",h),p&&r.set("x-jasmr-ua",p),y&&r.set("x-jasmr-cookie",y)}new Headers(t?.headers).forEach((m,h)=>r.set(h,m));const i={...t,headers:r},c=(t?.method??n?.method??"GET").toUpperCase(),l=t?.signal??n?.signal,u=a&&(c==="GET"||c==="HEAD");let d=await fetch(e,i);a&&d.status===409&&(await d.clone().json().catch(()=>null))?.error==="PROFILE_CHANGED"&&window.location.reload(),a&&d.status===401&&!s.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 na(500*2**m,l),d=await fetch(e,i);return d},We=async(e,t)=>{const n=await Bt(e,t);if(!n.ok){const r=await n.text().catch(()=>"");let s={};try{s=JSON.parse(r)}catch{}const a=typeof s.error=="string"?s.error:"";throw n.status===403&&a==="AUTH_REQUIRED"&&s.provider==="animepahe"&&Ne("animepahe"),n.status===403&&a==="AUTH_REQUIRED"&&s.provider==="jasmr"&&Ne("jasmr"),n.status===401&&a==="LAN_AUTH_REQUIRED"&&Ne("lan"),new Error(a||`Failed to fetch from ${e}`)}return n.json()};async function ra(e,t){const n=await Bt(e,t);if(n.status===401)try{(await n.clone().json())?.error==="LAN_AUTH_REQUIRED"&&Ne("lan")}catch{}return await oa(n),n}async function oa(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 s=r?.error;if(!s||typeof s!="object")continue;const a=s.data?.cause;(s.message==="AUTH_REQUIRED"||a?.code==="AUTH_REQUIRED")&&(a?.provider==="animepahe"||a?.provider==="jasmr")&&Ne(a.provider),(s.message==="LAN_AUTH_REQUIRED"||a?.code==="LAN_AUTH_REQUIRED")&&Ne("lan")}}catch{}}const{TRPCProvider:sa,useTRPC:D}=Zs(),te=Rs({links:[Ps({url:"/api/trpc",fetch:ra})]}),aa="_overlay_1juub_1",ia="_fadeIn_1juub_1",ca="_content_1juub_11",la="_modalIn_1juub_1",ua="_sm_1juub_29",da="_md_1juub_33",ma="_lg_1juub_37",ha="_title_1juub_41",pa="_body_1juub_48",fa="_footer_1juub_52",Oe={overlay:aa,fadeIn:ia,content:ca,modalIn:la,sm:ua,md:da,lg:ma,title:ha,body:pa,footer:fa};function or({children:e}){return o("h2",{className:Oe.title,children:e})}function sr({children:e}){return o("div",{className:Oe.body,children:e})}function ar({children:e}){return o("div",{className:Oe.footer,children:e})}function Re({isOpen:e,onClose:t,title:n,children:r,footer:s,width:a="md"}){const i=M(null),[c,l]=g(document.body);return w(()=>{if(!e)return;const u=()=>l(document.fullscreenElement??document.body);return u(),document.addEventListener("fullscreenchange",u),()=>document.removeEventListener("fullscreenchange",u)},[e]),w(()=>{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?$n(o("div",{role:"presentation",onMouseDown:u=>u.stopPropagation(),children:[o("div",{className:Oe.overlay,onClick:()=>t?.(),"aria-hidden":"true"}),o("div",{ref:i,className:`${Oe.content} ${Oe[a]}`,role:"dialog","aria-modal":"true","aria-label":n,tabIndex:-1,children:[n&&o(or,{children:n}),o(sr,{children:r}),s&&o(ar,{children:s})]})]}),c):null}Re.Header=or;Re.Body=sr;Re.Actions=ar;const Me=new Map,ya=500,ir=(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 s=`${r}-${t}-${n}`;if(Me.has(s))return Me.get(s);let a;if(r.startsWith("https://s4.anilist.co"))a=r,t&&(a+=`${a.includes("?")?"&":"?"}w=${t}`),n&&(a+=`${a.includes("?")?"&":"?"}h=${n}`);else if(r.includes("animepahe")){a=`/api/image-proxy?url=${encodeURIComponent(r)}`;const i=ee.getItem("animepahe_cookie"),c=ee.getItem("animepahe_ua");i&&(a+=`&cookie=${encodeURIComponent(i)}`),c&&(a+=`&ua=${encodeURIComponent(c)}`)}else if(r.startsWith("http"))a=`/api/image-proxy?url=${encodeURIComponent(r)}`,t&&(a+=`&w=${t}`),n?a+=`&h=${n}`:t||(a+="&w=300");else{const c=`${r.startsWith("mcovers")||r.startsWith("images2")?"https://aln.youtube-anime.com":"https://aln.youtube-anime.com/images"}/${r}`;a=`/api/image-proxy?url=${encodeURIComponent(c)}`,t&&(a+=`&w=${t}`),n?a+=`&h=${n}`:t||(a+="&w=300")}return Me.size>ya&&Me.clear(),Me.set(s,a),a},Xu=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 ed(e){return e?e.replace(/<[^>]*>?/gm,"").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").trim():""}function td(e){return e==null?e:e>10?Number((e/10).toFixed(1)):e}const ga=(...e)=>e.filter(Boolean).join(" ");function va(e,t,n="..."){return e?e.length>t?e.slice(0,t)+n:e:""}const cr=ye(void 0),lr=()=>{const e=ge(cr);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"},nd=()=>{const e=D(),t=F({...e.data.spotlight.queryOptions(),staleTime:1e3*60*5,retry:1});return{...t,data:t.data}},rd=(e="TRENDING_DESC",t=10)=>dt({queryKey:[x.trendingList,e,t],queryFn:({pageParam:n=1})=>te.data.popularList.query({sort:e,page:n,size:t}),initialPageParam:1,getNextPageParam:(n,r)=>n.length>=t?r.length+1:void 0}),od=(e="TV",t=12)=>dt({queryKey:[x.latestReleases,e,t],queryFn:({pageParam:n=1})=>te.data.latestReleases.query({format:e,page:n,size:t}),initialPageParam:1,getNextPageParam:(n,r)=>n.length>=t?r.length+1:void 0}),sd=(e,t="TV",n=!0)=>{const r=D();return F({...r.data.seasonal.queryOptions({page:e,format:t}),enabled:n,staleTime:1e3*60*5})},ba=["query","sortBy","type","status","season","year","country","genres","excludeGenres","excludeTags","minScore","minEpisodes","adult"],ad=(e,t,n=14)=>{const r=D(),s=new URLSearchParams(e),a={page:t,limit:n};for(const i of ba){const c=s.get(i);c!==null&&(a[i]=c)}return F({...r.data.search.queryOptions(a),enabled:e!=null})},id=()=>{const e=D();return F(e.queue.list.queryOptions())},wa=()=>{const e=D(),t=oe();return le(e.queue.add.mutationOptions({onSuccess:n=>{n.queued?C.success("Added to queue"):C.success("Removed from queue"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:[x.queueRemaining]})},onError:n=>{C.error(`Failed to update queue: ${n.message}`)}}))},cd=()=>{const e=D(),t=oe();return le(e.queue.remove.mutationOptions({onSuccess:()=>{C.success("Removed from queue"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:[x.queueRemaining]}),t.invalidateQueries({queryKey:[x.continueWatching]})},onError:n=>{C.error(`Failed to remove: ${n.message}`)}}))},ld=(e,t=!0)=>F({queryKey:[x.queueRemaining,e],queryFn:()=>te.watchlist.queueRemaining.query({showId:e}),enabled:!!e&&t,staleTime:1e3*60}),ud=()=>{const e=D(),t=oe();return le(e.queue.addBatch.mutationOptions({onSuccess:(n,r)=>{const s=n.added??r.episodeNumbers.length;C.success(`${s} ${s===1?"episode":"episodes"} added to queue`),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:[x.queueRemaining]})},onError:n=>{C.error(`Failed to update queue: ${n.message}`)}}))},dd=()=>{const e=D(),t=oe();return le(e.queue.removeMany.mutationOptions({onSuccess:()=>{C.success("Removed from queue"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:[x.queueRemaining]}),t.invalidateQueries({queryKey:[x.continueWatching]})},onError:n=>{C.error(`Failed to remove: ${n.message}`)}}))},md=()=>{const e=D(),t=oe();return le(e.queue.clear.mutationOptions({onSuccess:()=>{C.success("Queue cleared"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:[x.queueRemaining]}),t.invalidateQueries({queryKey:[x.continueWatching]})},onError:n=>{C.error(`Failed to clear queue: ${n.message}`)}}))},hd=()=>{const e=D(),t=oe(),n=e.queue.list.queryOptions().queryKey;return le(e.queue.reorder.mutationOptions({onMutate:async r=>{await t.cancelQueries({queryKey:n});const s=t.getQueryData(n);return t.setQueryData(n,a=>{if(!a)return a;const i=new Map(a.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:s}},onError:(r,s,a)=>{a?.previousQueue&&t.setQueryData(n,a.previousQueue)},onSettled:()=>{t.invalidateQueries(e.queue.pathFilter())}}))},_a=["status","showMature","query","type","season","year","genres","excludeGenres","sortBy","titlePreference"];function Wt(e,t,n){const r=new URLSearchParams(e),s={page:t,limit:n};for(const a of _a){const i=r.get(a);i!==null&&(s[a]=i)}return s}const pd=(e,t="",n,r=14)=>F({queryKey:[x.watchlist,e,t,n,r],queryFn:async()=>{const s=new URLSearchParams(t);return s.set("status",e),await te.watchlist.list.query(Wt(s.toString(),n,r))}}),fd=(e="")=>dt({queryKey:[x.continueWatching,e],queryFn:async({pageParam:t=1})=>await te.watchlist.continueWatchingAll.query(Wt(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)})}),yd=(e="",t,n=14)=>F({queryKey:[x.continueWatching,e,t,n],queryFn:async()=>await te.watchlist.continueWatchingAll.query(Wt(e,t,n))}),gd=()=>{const e=D(),t=oe();return le(e.watchlist.remove.mutationOptions({onSuccess:()=>{C.success("Removed from watchlist"),t.invalidateQueries(e.watchlist.pathFilter()),t.invalidateQueries({queryKey:[x.watchlist]})},onError:n=>{C.error(`Failed to remove: ${n.message}`)}}))},vd=()=>{const e=D(),t=oe();return le(e.watchlist.batchStatus.mutationOptions({onSuccess:n=>{C.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=>{C.error(`Failed to update statuses: ${n.message}`)}}))},bd=()=>{const e=D(),t=oe();return le(e.watchlist.removeMany.mutationOptions({onSuccess:n=>{const r=n.removed??0;C.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=>{C.error(`Failed to remove: ${n.message}`)}}))},wd=()=>{const e=D(),t=oe();return le(e.continueWatching.removeMany.mutationOptions({onSuccess:n=>{const r=n.removed??0;C.success(`Removed ${r} ${r===1?"item":"items"} from continue watching`),t.invalidateQueries(e.continueWatching.pathFilter()),t.invalidateQueries({queryKey:[x.continueWatching]})},onError:n=>{C.error(`Failed to remove: ${n.message}`)}}))},ur=(e=!0)=>{const t=D();return F({...t.notifications.list.queryOptions(),enabled:e,refetchInterval:3e4})},dr=(e=!0)=>{const t=D();return F({...t.data.systemNotifications.queryOptions(),enabled:e,refetchInterval:3e4})},mr=(e=!0)=>{const t=D();return F({...t.discovery.status.queryOptions(),enabled:e,refetchInterval:n=>n.state.data?.running?2e3:!1})},Ea=()=>{const e=D(),t=oe(),n=e.discovery.status.queryOptions().queryKey;return le(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})}}))},Sa=()=>{const e=D(),t=oe();return le(e.notifications.dismiss.mutationOptions({onSuccess:()=>{t.invalidateQueries(e.notifications.pathFilter())}}))},ka=()=>{const e=D(),t=oe();return le(e.notifications.clearAll.mutationOptions({onSuccess:()=>{t.invalidateQueries(e.notifications.pathFilter())}}))},_d=()=>{const e=D();return F({...e.continueWatching.thisWeek.queryOptions(),staleTime:1e3*60*5})},Ed=()=>{const e=D();return F({...e.data.genresAndTags.queryOptions(),staleTime:1e3*60*60})},Sd=()=>F({queryKey:[x.genreCards],queryFn:()=>te.insights.genreCards.query()}),Pa="_container_uyq4a_1",Ta="_bellBtn_uyq4a_7",Ia="_badge_uyq4a_39",Na="_dropdown_uyq4a_67",Ca="_dropdownHeader_uyq4a_98",xa="_headerSubtitle_uyq4a_106",Aa="_headerActions_uyq4a_113",Oa="_closeBtn_uyq4a_119",qa="_sectionHeading_uyq4a_132",La="_clearAllBtn_uyq4a_148",Ra="_discoveryStatusRow_uyq4a_166",Da="_statusDot_uyq4a_177",$a="_statusDotRunning_uyq4a_184",Ma="_statusDotOk_uyq4a_189",ja="_statusDotError_uyq4a_197",Fa="_statusDotIdle_uyq4a_201",Ba="_list_uyq4a_216",Wa="_item_uyq4a_230",Ka="_itemTitleLink_uyq4a_241",Ua="_systemItemMeta_uyq4a_248",Ha="_removeItem_uyq4a_249",Qa="_modalButton_uyq4a_251",Va="_systemItem_uyq4a_248",za="_systemIcon_uyq4a_264",Ga="_thumbnail_uyq4a_275",Ja="_itemInfo_uyq4a_284",Ya="_itemTitle_uyq4a_241",Za="_itemMeta_uyq4a_300",Xa="_queueItem_uyq4a_365",ei="_fullMessage_uyq4a_379",ti="_emptyState_uyq4a_385",ni="_emptyIcon_uyq4a_403",k={container:Pa,bellBtn:Ta,badge:Ia,dropdown:Na,dropdownHeader:Ca,headerSubtitle:xa,headerActions:Aa,closeBtn:Oa,sectionHeading:qa,clearAllBtn:La,discoveryStatusRow:Ra,statusDot:Da,statusDotRunning:$a,statusDotOk:Ma,statusDotError:ja,statusDotIdle:Fa,list:Ba,item:Wa,itemTitleLink:Ka,systemItemMeta:Ua,removeItem:Ha,modalButton:Qa,systemItem:Va,systemIcon:za,thumbnail:Ga,itemInfo:Ja,itemTitle:Ya,itemMeta:Za,queueItem:Xa,fullMessage:ei,emptyState:ti,emptyIcon:ni},ri=({notification:e})=>{const t=Sa(),n=wa(),[r,s]=$t.useState(!1),a=u=>{u.preventDefault(),u.stopPropagation(),t.mutate({showId:e.showId,episodeNumber:e.episodeNumber})},i=u=>{u.preventDefault(),u.stopPropagation(),s(!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(()=>s(!1),1e3)},{titlePreference:c}=lr(),l=c==="nativeName"?e.nativeName||e.name:c==="englishName"&&e.englishName||e.name;return o("div",{className:k.item,children:[o("img",{src:ir(e.thumbnail,48,64),alt:e.name,className:k.thumbnail,loading:"lazy",decoding:"async"}),o("div",{className:k.itemInfo,children:[o(ce,{to:`/watch/${e.showId}/${e.episodeNumber}`,className:k.itemTitleLink,onClick:()=>t.mutate({showId:e.showId,episodeNumber:e.episodeNumber}),children:o("span",{className:k.itemTitle,children:l})}),o("span",{className:k.itemMeta,children:["New Episode ",e.episodeNumber]})]}),o("button",{className:`${k.removeItem} ${k.queueItem}`,onClick:i,title:"Add to queue","aria-label":"Add notification to queue",children:r?o(A,{name:"check"}):o(A,{name:"plus"})}),o("button",{className:k.removeItem,onClick:a,title:"Dismiss","aria-label":"Remove notification",children:o(A,{name:"times"})})]})};function _t({width:e="100%",height:t="1em",variant:n="rectangular",className:r="",style:s}){return o("div",{className:`skeleton skeleton-${n} ${r}`,style:{width:e,height:t,...s}})}const oi=({count:e=3})=>o(de,{children:Array.from({length:e}).map((t,n)=>o("div",{className:k.item,style:{borderBottom:"1px solid var(--border-primary)",pointerEvents:"none"},children:[o("div",{className:k.thumbnail,style:{overflow:"hidden"},children:o(_t,{width:"100%",height:"100%",variant:"rectangular"})}),o("div",{className:k.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}=ur(),{data:r=[]}=dr(),{data:s}=mr(),a=ka(),i=oe(),[c,l]=g(null),u=M(null);w(()=>{u.current?.focus();const p=y=>{y.key==="Escape"&&e()};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[e]),w(()=>{i.invalidateQueries({queryKey:[x.notifications]})},[i]);const d=r.find(p=>p.id===c)??null,m=t.length+r.length,h=s?.running?s.total>0?`Checking ${Math.min(s.done,s.total)}/${s.total} shows...`:"Checking for new episodes...":s?.state==="complete"?`Discovery complete · checked ${s.total} ${s.total===1?"show":"shows"}`:s?.state==="empty"?"No shows set to Watching":s?.state==="error"?"Last check failed · will retry automatically":s?.lastRunAt?`Last checked ${Math.max(1,Math.round((Date.now()-s.lastRunAt)/1e3))}s ago`:"Auto-checks every few minutes";return o("div",{id:"notification-panel",ref:u,className:k.dropdown,role:"dialog","aria-label":"Notifications",tabIndex:-1,children:[o("div",{className:k.dropdownHeader,children:[o("div",{children:[o("h4",{children:"Notifications"}),o("span",{className:k.headerSubtitle,children:[m," updates"]})]}),o("div",{className:k.headerActions,children:[t.length>0&&o("button",{className:k.clearAllBtn,onClick:()=>a.mutate(void 0),children:"Clear all"}),o("button",{type:"button",className:k.closeBtn,onClick:e,title:"Close","aria-label":"Close notifications",children:o(A,{name:"times"})})]})]}),o("div",{className:k.discoveryStatusRow,children:[o("span",{className:`${k.statusDot} ${s?.running?k.statusDotRunning:s?.state==="complete"?k.statusDotOk:s?.state==="error"?k.statusDotError:k.statusDotIdle}`,"aria-hidden":"true"}),o("span",{children:h})]}),o("div",{className:k.list,children:n&&m===0?o(oi,{count:4}):o(de,{children:[r.length>0&&o("section",{"aria-labelledby":"system-notifications-heading",children:[o("h5",{id:"system-notifications-heading",className:k.sectionHeading,children:"App updates"}),r.map(p=>o("div",{className:`${k.item} ${k.systemItem}`,children:[o("div",{className:k.systemIcon,children:o(A,{name:"info-circle",size:20})}),o("div",{className:k.itemInfo,children:[o("span",{className:k.itemTitle,children:p.title}),o("button",{type:"button",className:k.systemItemMeta,onClick:()=>l(p.id),title:"View full message",children:[va(p.message,72,"…")," ",o("span",{children:"Read more"})]})]})]},p.id))]}),t.length>0&&o("section",{"aria-labelledby":"new-episodes-heading",children:[o("h5",{id:"new-episodes-heading",className:k.sectionHeading,children:"New episodes"}),t.map(p=>o(ri,{notification:p},p.id))]}),!n&&m===0&&o("div",{className:k.emptyState,children:[o("span",{className:k.emptyIcon,children:o(A,{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:k.modalButton,onClick:()=>l(null),children:"OK"}),children:d&&o("p",{className:k.fullMessage,children:d.message})})]})},ai="notification-panel",ii=()=>{const[e,t]=g(!1),n=M(null),r=oe(),s=D(),a=Ea(),{data:i=[]}=ur(),{data:c=[]}=dr(),{data:l}=mr(),u=i.length+c.length,d=u>9?"9+":u,m=M(!1);w(()=>{const p=y=>{n.current&&!n.current.contains(y.target)&&t(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]),w(()=>{const p=!!l?.running;m.current&&!p&&(r.invalidateQueries(s.notifications.pathFilter()),r.invalidateQueries(s.discovery.pathFilter()),r.invalidateQueries({queryKey:[x.continueWatching]}),r.invalidateQueries({queryKey:[x.thisWeekSchedule]}),r.invalidateQueries(s.continueWatching.pathFilter()),r.invalidateQueries({queryKey:[x.notifications]})),m.current=p},[l?.running,r,s]);const h=()=>{const p=!e;t(p),p&&a.mutate()};return o("div",{className:k.container,ref:n,children:[o("button",{className:k.bellBtn,onClick:h,"aria-haspopup":"dialog","aria-expanded":e,"aria-controls":ai,"aria-label":"Notifications",children:[o(A,{name:"bell"}),u>0&&o("span",{className:k.badge,"aria-hidden":"true",children:d})]}),e&&o(si,{onClose:()=>t(!1)})]})},yt=e=>{const t=D();return F({...t.settings.getByKey.queryOptions({key:e}),select:n=>n.value})},hr=()=>{const e=D(),t=oe();return le(e.settings.set.mutationOptions({onSuccess:()=>{C.success("Setting updated!"),t.invalidateQueries(e.settings.pathFilter()),t.invalidateQueries({queryKey:[x.settings]})},onError:n=>{C.error(`Failed to update setting: ${n.message}`)}}))},pr=ye(void 0),ci=()=>{const e=ge(pr);if(e===void 0)throw new Error("useLowEndMode must be used within a LowEndModeProvider");return e},fe={x:-2.8,y:-2,w:48.6,h:14},At=15,qe={w:13.6,h:10.2},we=[{x:0,y:.5},{x:At,y:-.9},{x:At*2,y:.3}],pn={x:qe.w/2,y:qe.h/2-.5},Et={y:qe.h/2,x1:-2,x2:At*2+qe.w+1.4},fn=(e,t,n,r=0)=>{if(n.width<=0)return-1;const s=n.width/fe.w,a=(e-n.left)/s+fe.x,i=(t-n.top)/s+fe.y;for(let c=0;c<we.length;c++){const l=a-we[c].x,u=i-we[c].y;if(l>=-r&&l<=qe.w+r&&u>=-r&&u<=qe.h+r)return c}return-1},yn=7.5,gn=e=>Math.max(-1,Math.min(1,e)),li=(e,t,n,r)=>{const s=n.width/fe.w,a=(e-n.left)/s+fe.x-r.x-pn.x,i=(t-n.top)/s+fe.y-r.y-pn.y;return{x:gn(a/yn),y:gn(i/yn)}},ui=["normal","squint"],di={normal:.72,squint:.28},vn=(e=Math.random(),t)=>{let n=0;for(const r of ui)if(n+=di[r],e<n)return r===t?r==="normal"?"squint":"normal":r;return"normal"},mi="pet",hi="sleep",pi=6e3,fi=420,yi=.5,bn=3e3,gi=3e3,vi=we.map((e,t)=>t*260),St={from:we.length-2,to:we.length-1,after:400},wn="data-dango-face",kt="data-dango-hover",Pt="data-dango-cheer",_n="data-dango-nudge",bi=()=>document.querySelectorAll("svg[data-dango-gaze-origin]"),Xe=()=>document.querySelectorAll("[data-dango-face-slot]"),wi=e=>e.querySelectorAll("[data-dango-eye]"),_i=()=>document.querySelectorAll("[data-dango-eye]"),fr=()=>{const{data:e}=yt("dangoGaze"),{lowEndMode:t}=ci();return e!=="false"&&!t},Ei=()=>{const e=fr();w(()=>{if(!e||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;const t=we.map(()=>"normal");let n=-1,r=-1,s=!1,a=-1,i=0,c=0,l=0,u=0,d=0;const m=[],h=(v,I)=>{const X=window.setTimeout(()=>{m.splice(m.indexOf(X),1),v()},I);m.push(X)},p=(v,I,X)=>{Xe().forEach(ue=>{Number(ue.getAttribute("data-dango-face-slot"))===v&&(X?ue.setAttribute(I,""):ue.removeAttribute(I))})},y=v=>Xe().forEach(I=>I.removeAttribute(v)),E=(v,I,X)=>{y(I),requestAnimationFrame(()=>{p(v,I,!0),h(()=>y(I),X)})},O=()=>{Xe().forEach(v=>{const I=Number(v.getAttribute("data-dango-face-slot"));v.setAttribute(wn,r===I?mi:t[I]),n===I?v.setAttribute(kt,""):v.removeAttribute(kt)})},N=v=>{v!==r&&(r>=0&&p(r,Pt,!1),r=v,v>=0&&p(v,Pt,!0))},S=()=>{window.clearTimeout(d),d=window.setTimeout(()=>{N(-1),O()},fi)},b=()=>{window.clearTimeout(d),N(-1)},T=()=>{s=!1,vi.forEach((v,I)=>{h(()=>{t[I]=vn(),I===St.from&&h(()=>E(St.to,_n,520),St.after),O()},v)})},H=()=>{s=!0,t.fill(hi),b(),O()},L=()=>{window.clearTimeout(u),u=window.setTimeout(H,pi)},W=()=>{s||(a=(a+1)%t.length,t[a]=vn(Math.random(),t[a]),O()),h(W,bn+Math.random()*gi)},P=()=>{const v=Array.from(bi(),q=>[q,q.getBoundingClientRect()]);v.forEach(([q,me])=>{wi(q).forEach(De=>{const{x:gt,y:vt}=li(c,l,me,we[Number(De.getAttribute("data-dango-eye"))]);De.style.setProperty("--dango-gaze-x",gt.toFixed(3)),De.style.setProperty("--dango-gaze-y",vt.toFixed(3))})});const I=v.find(([,q])=>c>=q.left&&c<=q.right&&l>=q.top&&l<=q.bottom)?.[1]??null,X=n,ue=r,V=I?fn(c,l,I):-1,G=V>=0?V:I?fn(c,l,I,yi):-1;n=V,G>=0?(N(G),S()):b(),(X!==n||ue!==r)&&O(),s&&T(),L()},j=v=>{c=v.clientX,l=v.clientY,!i&&(i=requestAnimationFrame(()=>{i=0,P()}))},Q=v=>{v.relatedTarget||(n=-1,b(),O(),L())};return O(),L(),h(W,bn),window.addEventListener("pointermove",j,{passive:!0}),window.addEventListener("pointerout",Q),()=>{cancelAnimationFrame(i),window.clearTimeout(u),window.clearTimeout(d),m.forEach(window.clearTimeout),window.removeEventListener("pointermove",j),window.removeEventListener("pointerout",Q),_i().forEach(v=>{v.style.removeProperty("--dango-gaze-x"),v.style.removeProperty("--dango-gaze-y")}),Xe().forEach(v=>{v.setAttribute(wn,"normal"),v.removeAttribute(kt),v.removeAttribute(Pt),v.removeAttribute(_n)})}},[e])},yr=ye(void 0),kd=()=>{const e=ge(yr);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},Pd=[{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"}},ki="_logo_t3il2_1",Pi="_skewer_t3il2_8",Ti="_gaze_t3il2_15",Ii="_face_t3il2_20",Ni="_faceNormal_t3il2_25",Ci="_facePet_t3il2_26",xi="_faceSquint_t3il2_27",Ai="_faceSleep_t3il2_28",Oi="_line_t3il2_36",qi="_sway_t3il2_44",Li="_weight_t3il2_58",Ri="_shift_t3il2_73",Di="_rock_t3il2_87",$i="_glance_t3il2_105",Mi="_blinkDouble_t3il2_129 _blink_t3il2_124",ji="_blinkSlow_t3il2_153 _blink_t3il2_124",Fi="_bump_t3il2_172",Bi="_heart_t3il2_189",J={logo:ki,skewer:Pi,gaze:Ti,face:Ii,faceNormal:Ni,facePet:Ci,faceSquint:xi,faceSleep:Ai,line:Oi,sway:qi,weight:Li,shift:Ri,rock:Di,glance:$i,blinkDouble:Mi,blinkSlow:ji,bump:Fi,heart:Bi},En="var(--logo-ink)",Wi="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",Ki="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",Hi={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"},gr=[{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}],je=(e,t)=>e+Math.random()*(t-e),Qi=gr.map(()=>({blinkDelay:-je(0,9),blinkDuration:je(3.4,8.6),motionDelay:-je(0,9),motionDuration:je(5.5,11),glanceDelay:-je(0,11)})),Vi={double:J.blinkDouble,slow:J.blinkSlow},zi={weight:J.weight,shift:J.shift,rock:J.rock},Gi={normal:J.faceNormal,pet:J.facePet,squint:J.faceSquint,sleep:J.faceSleep},Ji=["normal","pet","squint","sleep"],Yi=[{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"}],Kt=({className:e})=>{const t=fr();return o("svg",{viewBox:`${fe.x} ${fe.y} ${fe.w} ${fe.h}`,className:e?`${J.logo} ${e}`:J.logo,role:"img","aria-label":"dango","data-dango-gaze-origin":"",children:o("g",{className:t?J.sway:void 0,children:[o("path",{className:J.skewer,d:`M ${Et.x1},${Et.y} H ${Et.x2}`}),gr.map((n,r)=>{const{x:s,y:a}=we[r],i=Qi[r],{fill:c,stroke:l}=Si[n.hue],u=o("g",{"data-dango-eye":r,className:J.gaze,style:{"--gaze-dur":`${(.12+n.lag*.18).toFixed(3)}s`},children:Ji.map(d=>o("g",{className:`${J.face} ${Gi[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(de,{children:[o("path",{fill:En,d:Ki}),o("path",{fill:En,d:Ui})]}):o("path",{className:J.line,d:Hi[d]})})},d))});return o("g",{transform:`translate(${s} ${a})`,children:o("g",{"data-dango-face-slot":r,"data-dango-face":"normal",className:t?zi[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:Wi}),o("g",{className:J.bump,children:[t&&n.glances?o("g",{className:J.glance,style:{animationDelay:`${i.glanceDelay}s`},children:u}):u,t&&o("g",{children:Yi.map(d=>o("text",{className:J.heart,x:d.x,y:d.y,fill:"var(--color-danger)",style:{"--drift":d.drift,animationDelay:`${d.delay}s`},children:"♥"},d.x))})]})]})},n.hue)})]})})},vr=ye(void 0),Ut=()=>{const e=ge(vr);if(e===void 0)throw new Error("useSidebar must be used within a SidebarProvider");return e},br=ye(void 0),wr=()=>{const e=ge(br);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",_r="virtual_keyboard_enabled",Zi=!1;function kn(){const e=ee.getItem(_r);return e===null?Zi:e==="true"}const Pn=e=>e instanceof HTMLInputElement&&e.type==="text"&&!e.disabled&&!e.readOnly;function Xi(){window.dispatchEvent(new CustomEvent(Ot))}function ec(){const[e,t]=g(!1),[n,r]=g(kn),s=M(null);return w(()=>{const a=d=>{n&&Pn(d.target)&&(s.current=d.target,t(!0))},i=d=>{d.target===s.current&&window.setTimeout(()=>{if(Pn(document.activeElement)){s.current=document.activeElement,t(!0);return}s.current=null,t(!1)},0)},c=()=>{s.current=null,t(!1)},l=d=>{if(d.key!==_r)return;const m=d.newValue==="true";r(m),m||c()},u=()=>{const d=kn();r(d),d||c()};return document.addEventListener("focusin",a),document.addEventListener("focusout",i),window.addEventListener(Ot,c),window.addEventListener("storage",l),window.addEventListener(Sn,u),()=>{document.removeEventListener("focusin",a),document.removeEventListener("focusout",i),window.removeEventListener(Ot,c),window.removeEventListener("storage",l),window.removeEventListener(Sn,u)}},[n]),{activeInputRef:s,isVisible:n&&e,hide:()=>t(!1)}}const tc={queryKey:[x.syncProfile],queryFn:()=>We("/api/profiles/current"),staleTime:3e4};function Er({image:e,name:t}){const[n,r]=g(!1);return w(()=>r(!1),[e]),e&&!n?o("img",{src:e,alt:t,referrerPolicy:"no-referrer",onError:()=>r(!0),style:{width:"100%",height:"100%",maxWidth:72,maxHeight:72,aspectRatio:"1",objectFit:"cover",borderRadius:"50%"}}):o("svg",{viewBox:"0 0 24 24",role:"img","aria-label":t,style:{width:"100%",height:"100%",maxWidth:72,maxHeight:72,aspectRatio:"1"},fill:"currentColor",children:[o("circle",{cx:"12",cy:"8",r:"4"}),o("path",{d:"M4 21v-2a8 8 0 0 1 16 0v2z"})]})}const Ht=e=>String(e).toLowerCase()==="movie"?"movie":"tv",Td=(e,t)=>`${Ht(e)}:${t}`,nc=(e,t)=>{const n=Ht(e);return`/tv/${t}?type=${n}`},rc=(e,t,n,r)=>{const s=new URLSearchParams;return s.set("type",Ht(e)),n!==void 0&&s.set("s",String(n)),r!==void 0&&s.set("e",String(r)),`/tv/${t}/watch?${s.toString()}`},Id=e=>e.adult===!0||e.adult===1,Nd={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"},Cd={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"},Qt=300*1e3,oc={mangadex:"https://mangadex.org/",mangapill:"https://www.mangapill.com/"},sc="Dango/3.0 (+https://github.com/serifpersia/dango)",ac=(e,t)=>`/api/proxy?url=${encodeURIComponent(t)}&referer=${encodeURIComponent(oc[e])}`,ic=(e,t)=>t&&(e==="mangadex"?`/api/image-proxy?url=${encodeURIComponent(t)}&ua=${encodeURIComponent(sc)}`:e==="mangapill"?ac(e,t):t),xd=(e,t=!0)=>{const{provider:n,query:r,page:s,sort:a,status:i,type:c,rating:l,mature:u}=e;return F({queryKey:[x.mangaBrowse,n,r,s,a,i,c,l,u],queryFn:()=>te.manga.search.query({provider:n,q:r.trim()||void 0,page:s,sort:a||void 0,status:i||void 0,type:c||void 0,rating:l||void 0,mature:u?"1":void 0}),staleTime:Qt,enabled:t})},Ad=(e,t=14)=>{const{provider:n,query:r,sort:s,status:a,type:i,rating:c,mature:l}=e;return dt({queryKey:[x.mangaBrowseInfinite,n,r,s,a,i,c,l,t],queryFn:({pageParam:u=1})=>te.manga.search.query({provider:n,q:r.trim()||void 0,page:u,limit:t,sort:s||void 0,status:a||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:Qt,enabled:!0})},Od=(e,t,n="safe",r=!1)=>F({queryKey:[x.mangaDetail,e,t,n,r],queryFn:()=>te.manga.info.query({provider:e||"",id:t||"",rating:n,mature:r?"1":void 0}),enabled:!!e&&!!t,staleTime:Qt}),qd=(e,t,n)=>F({queryKey:[x.mangaPages,e,t],queryFn:()=>te.manga.pages.query({provider:e||"",id:t||""}),enabled:!!e&&!!t,staleTime:1800*1e3}),Ld=()=>{const e=D(),t=F({...e.manga.trending.queryOptions(),staleTime:600*1e3,retry:1});return{...t,data:t.data}};function cc(e){return String(e||"").trim().toUpperCase()}function Tn(e){return cc(e.id||e._id||"")}function Rd(e){return!!e.isAdult}const lc="_header_9w6in_1",uc="_hidden_9w6in_22",dc="_scrolled_9w6in_26",mc="_logo_9w6in_38",hc="_headerInner_9w6in_54",pc="_leftSection_9w6in_64",fc="_desktopNav_9w6in_70",yc="_navLink_9w6in_83",gc="_navLinkActive_9w6in_102",vc="_navPill_9w6in_108",bc="_rightSection_9w6in_126",wc="_searchWrapper_9w6in_132",_c="_searchIconButton_9w6in_159",Ec="_searchIcon_9w6in_159",Sc="_searchInput_9w6in_186",kc="_searchKbd_9w6in_219",Pc="_searchKbdHidden_9w6in_237",Tc="_searchButton_9w6in_242",Ic="_profileBtn_9w6in_252",Nc="_profileAvatar_9w6in_287",Cc="_profileName_9w6in_294",xc="_hamburgerBtn_9w6in_303",Ac="_searchDropdown_9w6in_331",Oc="_searchDropdownNoBar_9w6in_363",qc="_searchDropdownHeader_9w6in_371",Lc="_searchDropdownQuery_9w6in_379",Rc="_searchDropdownSeeAll_9w6in_385",Dc="_searchDropdownList_9w6in_402",$c="_searchDropdownItem_9w6in_416",Mc="_searchDropdownThumb_9w6in_434",jc="_searchDropdownItemInfo_9w6in_443",Fc="_searchDropdownItemTitle_9w6in_450",Bc="_searchDropdownItemMeta_9w6in_459",Wc="_mobileSearchBar_9w6in_498",Kc="_searchIconMobile_9w6in_569",Uc="_mobileSearchBarHidden_9w6in_596",Hc="_mobileSearchInner_9w6in_613",Qc="_mobileSearchIcon_9w6in_629",Vc="_mobileSearchInput_9w6in_636",_={header:lc,hidden:uc,scrolled:dc,logo:mc,headerInner:hc,leftSection:pc,desktopNav:fc,navLink:yc,navLinkActive:gc,navPill:vc,rightSection:bc,searchWrapper:wc,searchIconButton:_c,searchIcon:Ec,searchInput:Sc,searchKbd:kc,searchKbdHidden:Pc,searchButton:Tc,profileBtn:Ic,profileAvatar:Nc,profileName:Cc,hamburgerBtn:xc,searchDropdown:Ac,searchDropdownNoBar:Oc,searchDropdownHeader:qc,searchDropdownQuery:Lc,searchDropdownSeeAll:Rc,searchDropdownList:Dc,searchDropdownItem:$c,searchDropdownThumb:Mc,searchDropdownItemInfo:jc,searchDropdownItemTitle:Fc,searchDropdownItemMeta:Bc,mobileSearchBar:Wc,searchIconMobile:Kc,mobileSearchBarHidden:Uc,mobileSearchInner:Hc,mobileSearchIcon:Qc,mobileSearchInput:Vc},In=300*1e3,zc=()=>{const{toggleSidebar:e}=Ut(),{contentType:t}=wr(),n=D(),{titlePreference:r}=lr(),[s,a]=g(""),[i,c]=g(""),[l,u]=g(!0),[d,m]=g(!1),[h,p]=g(!0),[y,E]=g(!1),[O,N]=g({left:0,width:0,opacity:0}),[S,b]=g(!1),T=Mn(),H=ut(),L=M(null),W=M(!1),P=M(null),j=M(null),Q=M(null),v=M(null),I=M(!1),X=M(null),ue=M(null),V=M(null),{data:G}=F(tc),q=i.length>=2,{data:me}=F({...n.data.search.queryOptions({query:i,page:1,limit:6}),enabled:q&&t==="anime"}),{data:De}=F({...n.tv.search.queryOptions({q:i,page:1,type:"multi"}),enabled:q&&t==="tv"}),{data:gt}=F({queryFn:()=>te.manga.search.query({q:i,page:1,limit:6,rating:"safe"}),queryKey:[x.mangaBrowse,"",i,1,"","","","safe",!1],staleTime:In,enabled:q&&t==="manga"}),{data:vt}=F({queryFn:()=>te.asmr.browse.query({q:i,page:1}),queryKey:[x.asmrBrowse,i,1,"",""],staleTime:In,enabled:q&&t==="asmr"}),Gt=t==="anime"?(me??[]).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?ir(f.thumbnail,48,64):void 0,href:`/anime/${f.id}`})):t==="tv"?(De?.results??[]).map(f=>({key:`${f.type}-${f.id}`,name:f.title,meta:f.year,thumb:f.image||void 0,href:nc(f.type,f.id)})):t==="manga"?(gt?.items??[]).map(f=>({key:`${f.provider}-${f.id}`,name:f.title,meta:f.year,thumb:f.cover?ic(f.provider,f.cover):void 0,href:`/manga/${f.provider}/${encodeURIComponent(f.id)}`})):(vt?.shows??[]).map(f=>({key:Tn(f),name:f.name,thumb:f.thumbnail||void 0,href:`/asmr/${encodeURIComponent(Tn(f))}`}));w(()=>{const f=window.visualViewport;if(!f)return;const ne=()=>{v.current?.style.setProperty("--vv-top",`${f.offsetTop}px`)};return ne(),f.addEventListener("scroll",ne),f.addEventListener("resize",ne),()=>{f.removeEventListener("scroll",ne),f.removeEventListener("resize",ne)}},[]),w(()=>{const f=()=>{L.current&&(window.clearTimeout(L.current),L.current=null)},ne=()=>{f(),!(window.scrollY<=10||d)&&(L.current=window.setTimeout(()=>{I.current||u(!1)},2500))},Ge=()=>{W.current||(W.current=!0,P.current=requestAnimationFrame(()=>{W.current=!1,P.current=null;const ie=window.scrollY<=10;p(Ee=>Ee===ie?Ee:ie),u(Ee=>Ee||!0),ne()}))},$e=ie=>{const Ee=ie.target,Lr=Ee instanceof HTMLElement&&!!Ee.closest('input, textarea, select, button, a, [role="button"], [contenteditable="true"]'),Xt=()=>{f(),u(!0),window.innerWidth<=1200?(E(!0),setTimeout(()=>Q.current?.focus({preventScroll:!0}),50)):setTimeout(()=>ve.current?.focus({preventScroll:!0}),10)};ie.key.toLowerCase()==="s"&&!ie.metaKey&&!ie.ctrlKey&&!ie.altKey&&!Lr||(ie.metaKey||ie.ctrlKey)&&ie.key==="k"?(ie.preventDefault(),Xt()):ie.key==="Escape"&&document.activeElement===ve.current&&ve.current?.blur()},xe=v.current,Yt=()=>{I.current=!0},Zt=()=>{I.current=!1,ne()};return window.addEventListener("scroll",Ge,{passive:!0}),window.addEventListener("keydown",$e),xe?.addEventListener("pointerenter",Yt),xe?.addEventListener("pointerleave",Zt),()=>{window.removeEventListener("scroll",Ge),window.removeEventListener("keydown",$e),xe?.removeEventListener("pointerenter",Yt),xe?.removeEventListener("pointerleave",Zt),f(),P.current!==null&&(cancelAnimationFrame(P.current),P.current=null),W.current=!1}},[d]);const ve=$t.useRef(null);w(()=>{if(X.current&&window.clearTimeout(X.current),!s.trim()||s.trim().length<2){c(""),b(!1);return}return X.current=window.setTimeout(()=>{c(s.trim()),d&&b(!0)},500),()=>{X.current&&window.clearTimeout(X.current)}},[s,d]);const Ie=z(()=>{b(!1)},[]);w(()=>{b(!1),E(!1)},[H.pathname,H.search]),w(()=>{const f=ue.current;if(!f)return;const ne=f.querySelector(`.${_.navLinkActive}`);if(!ne){N(xe=>({...xe,opacity:0}));return}const Ge=f.getBoundingClientRect(),$e=ne.getBoundingClientRect();N({left:$e.left-Ge.left,width:$e.width,opacity:1})},[H.pathname]);const Ar=()=>window.innerWidth<=1200,Or=()=>{u(!0),Ar()?(E(!0),setTimeout(()=>Q.current?.focus({preventScroll:!0}),50)):ve.current?.focus({preventScroll:!0})},qr=f=>{j.current?.contains(f.relatedTarget)||(E(!1),Ie())},Jt=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"},ze=f=>{Xi();const ne=s.trim();ne&&(Ie(),ve.current?.blur(),m(!1),T(t==="manga"?`/manga?q=${encodeURIComponent(ne)}`:t==="tv"?`/tv-search?q=${encodeURIComponent(ne)}`:t==="asmr"?`/asmr?q=${encodeURIComponent(ne)}`:`/search?query=${encodeURIComponent(ne)}`))};return o(de,{children:o("header",{ref:v,className:`${_.header} ${l?"":_.hidden} ${h?"":_.scrolled}`,children:[o("div",{className:_.headerInner,children:[o("div",{className:_.leftSection,children:[o("button",{className:_.hamburgerBtn,onClick:e,"aria-label":"Menu",children:o(A,{name:"bars"})}),o(ce,{to:"/",className:_.logo,"aria-label":"Ani-Web Home",children:o(Kt,{})}),o("nav",{className:_.desktopNav,ref:ue,children:[o("span",{className:_.navPill,style:O,"aria-hidden":"true"}),o(ce,{to:"/",className:`${_.navLink} ${H.pathname==="/"?_.navLinkActive:""}`,children:"Home"}),o(ce,{to:bt.to,className:`${_.navLink} ${H.pathname.startsWith(bt.to)?_.navLinkActive:""}`,children:bt.label}),t==="anime"&&o(ce,{to:"/insights",className:`${_.navLink} ${H.pathname==="/insights"?_.navLinkActive:""}`,children:"Insights"}),o(ce,{to:"/settings",className:`${_.navLink} ${H.pathname.startsWith("/settings")?_.navLinkActive:""}`,children:"Settings"})]})]}),o("div",{className:_.rightSection,children:[o("div",{className:_.searchWrapper,ref:V,onClick:()=>ve.current?.focus(),children:[o("button",{type:"button",className:_.searchIconButton,"aria-label":"Search",onMouseDown:f=>f.preventDefault(),onClick:f=>{f.stopPropagation(),ze()},children:o(A,{name:"search",className:_.searchIcon})}),o("input",{ref:ve,type:"text","data-virtual-keyboard":"true",className:_.searchInput,placeholder:Jt,value:s,onChange:f=>a(f.currentTarget.value),onFocus:()=>{m(!0),u(!0),i.length>=2&&b(!0)},onBlur:f=>{m(!1),V.current?.contains(f.relatedTarget)||Ie()},onKeyDown:f=>{f.key==="Enter"?ze():f.key==="Escape"&&(Ie(),ve.current?.blur())}}),o("span",{className:`${_.searchKbd} ${s||d?_.searchKbdHidden:""}`,"aria-hidden":"true",children:"Ctrl K"}),o("button",{type:"button",className:_.searchButton,"aria-label":"Search",onMouseDown:f=>f.preventDefault(),onClick:f=>{f.stopPropagation(),Or()},children:o(A,{name:"search",className:_.searchIconMobile})}),S&&Gt.length>0&&o("div",{className:`${_.searchDropdown} ${y?"":_.searchDropdownNoBar}`,onMouseDown:f=>f.preventDefault(),onClick:f=>f.stopPropagation(),children:[o("div",{className:_.searchDropdownHeader,children:[o("span",{className:_.searchDropdownQuery,children:["Results for “",i,"”"]}),o("button",{className:_.searchDropdownSeeAll,onClick:()=>{Ie(),E(!1),m(!1),ze()},children:"See all"})]}),o("div",{className:_.searchDropdownList,children:Gt.map(f=>o("button",{className:_.searchDropdownItem,onClick:()=>{Ie(),E(!1),m(!1),a(""),ve.current?.blur(),T(f.href)},children:[f.thumb&&o(jo,{src:f.thumb,alt:f.name,className:_.searchDropdownThumb,loading:"lazy",decoding:"async"}),o("div",{className:_.searchDropdownItemInfo,children:[o("span",{className:_.searchDropdownItemTitle,children:f.name}),f.meta&&o("span",{className:_.searchDropdownItemMeta,children:f.meta})]})]},f.key))})]})]}),o(ii,{}),o(ce,{to:"/settings",className:_.profileBtn,"aria-label":`${G?.name??"Profile"} — profile settings`,title:`${G?.name??"Profile"}${G?.owner?" (owner)":""} — profile settings`,children:[o("span",{className:_.profileAvatar,"aria-hidden":"true",children:o(Er,{image:G?.image,name:G?.name??"Profile"})}),o("span",{className:_.profileName,children:G?.name??"Profile"})]})]})]}),y&&o("div",{className:`${_.mobileSearchBar} ${l?"":_.mobileSearchBarHidden}`,ref:j,onBlur:qr,children:o("div",{className:_.mobileSearchInner,children:[o(A,{name:"search",className:_.mobileSearchIcon}),o("input",{ref:Q,type:"text","data-virtual-keyboard":"true",className:_.mobileSearchInput,placeholder:Jt,value:s,onChange:f=>a(f.currentTarget.value),onFocus:()=>{m(!0),u(!0)},onBlur:()=>m(!1),onKeyDown:f=>{f.key==="Enter"?(ze(),E(!1),m(!1)):f.key==="Escape"&&(E(!1),m(!1),Ie())}})]})})]})})},qt="agreedToViewMature";function Lt(){try{return ee.getItem(qt)==="true"}catch{return!1}}const Be=new Set;function Sr(e){for(const t of Be)t(e)}function et(){Sr(Lt())}function Nn(e){try{e?ee.setItem(qt,"true"):ee.removeItem(qt)}catch{}Sr(e)}function Gc(){const[e,t]=g(Lt);w(()=>(Be.add(t),Be.size===1&&(window.addEventListener("storage",et),window.addEventListener("focus",et)),t(Lt()),()=>{Be.delete(t),Be.size===0&&(window.removeEventListener("storage",et),window.removeEventListener("focus",et))}),[]);const n=z(()=>Nn(!0),[]),r=z(()=>Nn(!1),[]);return{hasConsent:e,grant:n,revoke:r}}const Jc="_sidebar_153jc_1",Yc="_open_153jc_20",Zc="_sidebarHeader_153jc_25",Xc="_closeBtn_153jc_33",el="_logo_153jc_57",tl="_navSection_153jc_69",nl="_navLink_153jc_75",rl="_active_153jc_108",ol="_overlay_153jc_118",sl="_versionInfo_153jc_138",he={sidebar:Jc,open:Yc,sidebarHeader:Zc,closeBtn:Xc,logo:el,navSection:tl,navLink:nl,active:rl,overlay:ol,versionInfo:sl},al="3.8.8",kr={version:al},il=()=>{const{isOpen:e,setIsOpen:t}=Ut(),{contentType:n}=wr(),{hasConsent:r}=Gc(),s=()=>{t(!1)},a=n==="manga",i=n==="tv",c=n==="asmr",l=[{to:"/",icon:o(A,{name:"home"}),label:"Home"},a?{to:"/manga",icon:o(A,{name:"book"}),label:"Manga"}:i?{to:"/tv-search",icon:o(A,{name:"tv"}),label:"TV and Movies"}:c?{to:"/asmr",icon:o(A,{name:"headphones"}),label:"ASMR"}:{to:"/search",icon:o(A,{name:"search"}),label:"Search"},a?{to:"/reading-list",icon:o(A,{name:"bookmark"}),label:"Reading List"}:i?{to:"/tv-watchlist",icon:o(A,{name:"clock"}),label:"TV Watchlist"}:c?{to:"/listening-list",icon:o(A,{name:"history"}),label:"Listening List"}:{to:"/watchlist",icon:o(A,{name:"clock"}),label:"Watchlist"},...n==="anime"?[{to:"/insights",icon:o(A,{name:"chart-pie"}),label:"Insights"}]:[],{to:"/trackers",icon:o(A,{name:"sync-alt"}),label:"Trackers"},...n==="anime"||i?[{to:"/watch-along",icon:o(A,{name:"play"}),label:"Watch along"}]:[],...r?[{to:"/mature",icon:o(A,{name:"pepper-hot"}),label:"Mature"}]:[],{to:"/settings",icon:o(A,{name:"cog"}),label:"Settings"}];return o(de,{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(ce,{to:"/",className:he.logo,onClick:s,children:o(Kt,{})})]}),o("nav",{className:he.navSection,children:l.map(u=>o(Dr,{to:u.to,className:({isActive:d})=>`${he.navLink} ${d?he.active:""}`,onClick:s,end:u.to==="/",children:[u.icon,o("span",{children:u.label})]},u.to))}),o("div",{className:he.versionInfo,children:["v",kr.version]})]}),e&&o("div",{className:he.overlay,onClick:()=>t(!1),"aria-label":"Close sidebar"})]})},cl="_footer_1c905_1",ll="_footerInner_1c905_15",ul="_brandSection_1c905_27",dl="_logoRow_1c905_39",ml="_logoText_1c905_45",hl="_brandMeta_1c905_51",pl="_brandTagline_1c905_60",fl="_statusPill_1c905_67",yl="_statusDot_1c905_80",gl="_linksGrid_1c905_88",vl="_linkColumn_1c905_96",bl="_columnTitle_1c905_102",wl="_bottomBar_1c905_126",_l="_copyright_1c905_136",El="_brand_1c905_27",Sl="_heartIcon_1c905_152",kl="_backToTop_1c905_157",B={footer:cl,footerInner:ll,brandSection:ul,logoRow:dl,logoText:ml,brandMeta:hl,brandTagline:pl,statusPill:fl,statusDot:yl,linksGrid:gl,linkColumn:vl,columnTitle:bl,bottomBar:wl,copyright:_l,brand:El,heartIcon:Sl,backToTop:kl},Pl=()=>{const e=new Date().getFullYear(),t=()=>{window.scrollTo({top:0,behavior:"smooth"})};return o("footer",{className:B.footer,children:[o("div",{className:B.footerInner,children:[o("div",{className:B.brandSection,children:[o("div",{className:B.logoRow,children:o(Kt,{className:B.logoText})}),o("div",{className:B.brandMeta,children:[o("div",{className:B.statusPill,children:[o("span",{className:B.statusDot}),o("span",{children:["v",kr.version]})]}),o("p",{className:B.brandTagline,children:"Fast, local anime streaming."})]})]}),o("div",{className:B.linksGrid,children:[o("div",{className:B.linkColumn,children:[o("h4",{className:B.columnTitle,children:"Navigation"}),o(ce,{to:"/",children:"Home"}),o(ce,{to:"/watchlist",children:"Watchlist"}),o(ce,{to:"/settings",children:"Settings"})]}),o("div",{className:B.linkColumn,children:[o("h4",{className:B.columnTitle,children:"Features"}),o(ce,{to:"/search",children:"Search Anime"}),o(ce,{to:"/trackers",children:"Trackers"}),o(ce,{to:"/insights",children:"Insights"})]}),o("div",{className:B.linkColumn,children:[o("h4",{className:B.columnTitle,children:"Community"}),o("a",{href:"https://discord.gg/6yT3VwTqz9",target:"_blank",rel:"noopener noreferrer",children:[o(A,{name:"discord",style:{marginRight:"6px"}})," Discord"]}),o("a",{href:"https://github.com/serifpersia/dango",target:"_blank",rel:"noopener noreferrer",children:[o(A,{name:"github",style:{marginRight:"6px"}})," GitHub"]})]}),o("div",{className:B.linkColumn,children:[o("h4",{className:B.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:B.bottomBar,children:[o("p",{className:B.copyright,children:["© ",e," ",o("span",{className:B.brand,children:"dango"})," • Crafted with"," ",o(A,{name:"heart",className:B.heartIcon})," by"," ",o("a",{href:"https://github.com/serifpersia",target:"_blank",rel:"noopener noreferrer",children:"serifpersia"})]}),o("button",{className:B.backToTop,onClick:t,"aria-label":"Back to top",children:[o(A,{name:"chevron-up",size:14}),o("span",{children:"Top"})]})]})]})};function Pr(e){return JSON.stringify({0:e??{}})}function Tr(e){return`/api/trpc/${e}?batch=1&_profile=${encodeURIComponent(rr())}`}function Rt(e,t){const n=Pr(t),r=Tr(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 Dd(e,t){const n=await fetch(Tr(e),{method:"POST",headers:{"Content-Type":"application/json"},body:Pr(t),keepalive:!0});if(!n.ok)throw new Error(`tRPC request failed (HTTP ${n.status})`)}function $d(e){e&&(Rt("discord.clear",{sessionId:e}),Rt("discord.heartbeat",{sessionId:e,bye:!0}))}function Tl(){const e=ut(),{data:t}=yt("discordRPCEnabled"),n=M("");n.current||(n.current=typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`tab-${Date.now()}-${Math.random().toString(36).slice(2)}`),w(()=>{if(t===!1||t==="false")return;const r=n.current,s=()=>te.discord.heartbeat.mutate({sessionId:r}).catch(()=>{});s();const a=setInterval(s,15e3),i=()=>{Rt("discord.heartbeat",{sessionId:r,bye:!0})};return window.addEventListener("pagehide",i),()=>{clearInterval(a),window.removeEventListener("pagehide",i)}},[t]),w(()=>{if(t===!1||t==="false")return;const r=e.pathname;if(r.startsWith("/watch/")||r.startsWith("/player/"))return;let s="home";r.startsWith("/search")||r.startsWith("/mature")?s="search":r.startsWith("/watchlist")?s="watchlist":r.startsWith("/anime/")?s="anime":r.startsWith("/insights")?s="insights":r.startsWith("/settings")?s="settings":r.startsWith("/trackers")?s="trackers":r.startsWith("/asmr")?s="asmr":r.startsWith("/manga")?s="manga":r.startsWith("/tv")&&(s="tv"),te.discord.pageStatus.mutate({page:s}).catch(()=>{})},[e.pathname,t])}function Vt(e,t){const[n,r]=g(()=>{try{const a=ee.getItem(e);if(a===null)return t;if(typeof t=="string")return a;try{return JSON.parse(a)}catch{return a}}catch{return t}});w(()=>{const a=i=>{if(i.key===ee.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",a),()=>window.removeEventListener("storage",a)},[e,t]);const s=z(a=>{r(i=>{const c=typeof a=="function"?a(i):a;try{typeof c=="string"?ee.setItem(e,c):ee.setItem(e,JSON.stringify(c))}catch{}return c})},[e]);return[n,s]}const Ir=ye(void 0),Il=()=>{const e=ge(Ir);if(!e)throw new Error("useAnimePaheCookie must be used within an AnimePaheCookieProvider");return e},Nl="_container_e96gf_1",Cl="_field_e96gf_9",xl="_textarea_e96gf_20",Al="_input_e96gf_40",Ol="_button_e96gf_58",ql="_secondaryButton_e96gf_78",Ll="_actions_e96gf_95",Rl="_hint_e96gf_104",Dl="_link_e96gf_117",se={container:Nl,field:Cl,textarea:xl,input:Al,button:Ol,secondaryButton:ql,actions:Ll,hint:Rl,link:Dl},$l="https://github.com/serifpersia/dango/releases/latest/download/dango-extension.zip",Ml=e=>{try{return JSON.parse(e.detail)}catch{return null}},jl=({isOpen:e,onClose:t,onSuccess:n})=>{const[r,s]=g(1),[a,i]=g(navigator.userAgent),[c,l]=g(""),[u,d]=g(!1),m=M(null),h=navigator.userAgent,p=/android/i.test(h),y=/firefox|fxios/i.test(h)&&!p,E=!y&&!p&&/chrome|chromium|edg|brave/i.test(h),O=y||E;w(()=>{e&&(s(1),i(navigator.userAgent),l(""),d(!1))},[e]),w(()=>()=>{m.current&&(window.removeEventListener("dango:pahe-cookie",m.current),m.current=null)},[]);const N=()=>{window.open("https://animepahe.pw","_blank","noopener,noreferrer"),s(2)},S=()=>{if(u)return;d(!0);const T=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`,H=window.setTimeout(()=>{d(!1),m.current&&(window.removeEventListener("dango:pahe-cookie",m.current),m.current=null),C.error("Helper not detected - install it via about:debugging first.")},3e3),L=W=>{const P=Ml(W);if(!(!P||P.requestId!==T))if(window.clearTimeout(H),window.removeEventListener("dango:pahe-cookie",L),m.current=null,d(!1),P?.ok&&P.cookie)l(P.cookie),C.success("Cookie extracted from helper!");else if(P?.error==="NO_COOKIE"){const j=P.debug?.stores?.length??0,Q=P.debug?.names??[];C.error(`Helper found no cf_clearance (checked ${j} stores, saw: ${Q.join(", ")||"none"}) - solve the challenge on the AnimePahe tab first.`)}else C.error("Helper request failed - try again.")};m.current=L,window.addEventListener("dango:pahe-cookie",L),window.dispatchEvent(new CustomEvent("dango:get-pahe-cookie",{detail:{requestId:T}}))},b=()=>{const T=c.trim();if(!T){C.error("Please enter the cf_clearance cookie");return}try{ee.setItem("animepahe_ua",a),ee.setItem("animepahe_cookie",T),C.success("Cookie updated successfully! Reloading…"),n?.(),t(),window.setTimeout(()=>window.location.reload(),1e3)}catch{C.error("Failed to save cookie")}};return o(Re,{isOpen:e,onClose:t,title:"AnimePahe Verification Required",children:o("div",{className:se.container,children:r===1?o(de,{children:[o("p",{children:"AnimePahe requires a manual verification to bypass Cloudflare/DDoS-Guard protection."}),o("div",{className:se.field,children:[o("label",{children:"Your User-Agent (will be used for requests):"}),o("textarea",{value:a,readOnly:!0,rows:3,className:se.textarea})]}),o("div",{className:se.actions,children:[o("button",{className:se.secondaryButton,onClick:t,children:"Cancel"}),o("button",{className:se.button,onClick:N,children:"Start Verification (Opens AnimePahe)"})]})]}):o(de,{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."]}),O&&o("div",{className:se.hint,children:[o("strong",{children:"Dango helper (one-time setup):"})," ",y?o(de,{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(de,{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:$l,target:"_blank",rel:"noreferrer",className:se.link,children:"dango-extension.zip"}),". Then click Extract below and the field fills itself.",o("div",{className:se.actions,children:o("button",{className:se.button,onClick:S,disabled:u,type:"button",children:u?"Extracting…":"Extract cookie from helper"})})]}),o("div",{className:se.field,children:[o("label",{children:"cf_clearance cookie value:"}),o("input",{type:"text",value:c,onChange:T=>l(T.currentTarget.value),placeholder:"e.g. xxxxxxxx.xxxxxxxx.xxxxxxx-xxxxxxx",className:se.input})]}),o("div",{className:se.actions,children:[o("button",{className:se.secondaryButton,onClick:t,children:"Cancel"}),o("button",{className:se.secondaryButton,onClick:()=>s(1),children:"Back"}),o("button",{className:se.button,onClick:b,children:"Submit"})]})]})})})};function Cn(){const[e,t]=g(!1);return w(()=>{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",Bl="_icon_1pca0_14",Wl="_title_1pca0_20",Kl="_text_1pca0_24",Ul="_button_1pca0_29",Fe={screen:Fl,icon:Bl,title:Wl,text:Kl,button:Ul};async function Hl(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 Ql extends $r{state={hasError:!1};static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,n){console.error("Uncaught error:",t,n),Hl(t,n)}render(){return this.state.hasError?o("div",{className:Fe.screen,children:[o(A,{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(A,{name:"home"}),"Go back Home"]})]}):this.props.children}}const Nr=ye(void 0),Vl=()=>{const e=ge(Nr);if(!e)throw new Error("useLanAuth must be used within a LanAuthProvider");return e},zl=({children:e})=>{const[t,n]=g(!1),r=z(()=>n(!0),[]),s=z(()=>n(!1),[]);return w(()=>nr("lan",r),[r]),o(Nr.Provider,{value:{isOpen:t,openModal:r,closeModal:s},children:e})},Gl="_container_88bss_1",Jl="_field_88bss_8",Yl="_input_88bss_19",Zl="_actions_88bss_37",tt={container:Gl,field:Jl,input:Yl,actions:Zl},lt=Mr(({variant:e="primary",size:t="md",loading:n,children:r,className:s="",disabled:a,...i},c)=>{const l=ga("btn",`btn-${e}`,t!=="md"&&`btn-${t}`,n&&"btn-loading",s);return o("button",{className:l,disabled:a||n,ref:c,...i,children:n?o("span",{className:"btn-spinner"}):r})}),Cr=({isOpen:e,onClose:t,onSuccess:n})=>{const[r,s]=g(""),[a,i]=g(!1);$t.useEffect(()=>{e&&s("")},[e]);const c=async()=>{if(!r){C.error("Please enter your password");return}i(!0);try{const l=await Bt("/api/auth/app-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:r})}),u=await l.json().catch(()=>({}));if(!l.ok){C.error(u.error||"Login failed");return}C.success("Authenticated successfully"),n(),t(),window.location.reload()}catch{C.error("Network error")}finally{i(!1)}};return o(Re,{isOpen:e,onClose:t,title:"LAN Authentication Required",children:o("div",{className:tt.container,children:[o("p",{children:"This instance is protected. Enter the password to access from this device."}),o("div",{className:tt.field,children:[o("label",{htmlFor:"lan-password",children:"Password"}),o("input",{id:"lan-password",type:"password",value:r,onChange:l=>s(l.currentTarget.value),placeholder:"Enter password...",className:tt.input,onKeyDown:l=>l.key==="Enter"&&c()})]}),o("div",{className:tt.actions,children:[o(lt,{variant:"secondary",onClick:t,disabled:a,children:"Cancel"}),o(lt,{variant:"primary",onClick:c,loading:a,children:"Unlock"})]})]})})},Xl="_notice_1d75r_1",eu={notice:Xl},tu=2600,nu=1e4,ru={anilist:"Updating AniList…",mal:"Updating MyAnimeList…"};function ou({enabled:e=!0}){const[t,n]=g(!1),[r,s]=g("mal"),[a,i]=g(document.fullscreenElement);return w(()=>{const c=()=>i(document.fullscreenElement);return document.addEventListener("fullscreenchange",c),()=>document.removeEventListener("fullscreenchange",c)},[]),w(()=>{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 h=p=>{let y;try{y=JSON.parse(p.data)}catch{return}const E=y.provider;E!=="anilist"&&E!=="mal"||(y.updating===!0?(clearTimeout(l.get(E)),d.size===0&&Date.now()-m>=nu&&(m=Date.now(),s(E),n(!0),clearTimeout(u),u=setTimeout(()=>n(!1),tu)),d.add(E)):y.updating===!1&&(clearTimeout(l.get(E)),l.set(E,setTimeout(()=>d.delete(E),1500))))};return c.addEventListener("tracker-activity",h),()=>{c.removeEventListener("tracker-activity",h),c.close(),clearTimeout(u);for(const p of l.values())clearTimeout(p);n(!1)}},[e]),!e||!t?null:$n(o("div",{className:eu.notice,role:"status","aria-live":"polite","aria-atomic":"true",children:[o(A,{name:r==="anilist"?"anilist":"myanimelist",size:15}),o("span",{children:ru[r]})]}),a||document.body)}const su=K(()=>U(()=>import("./Home-ZHM84CD8.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]))),au=K(()=>U(()=>import("./Watchlist-BMRAdzMF.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]))),iu=K(()=>U(()=>import("./Settings-_URnBHKL.js"),__vite__mapDeps([40,1,2,4,41,42,7,8,43]))),xn=K(()=>U(()=>import("./Player-CQy7jQbB.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]))),cu=K(()=>U(()=>import("./WatchAlong-Czm3Pr1E.js"),__vite__mapDeps([56,1,53,54,2,4]))),lu=K(()=>U(()=>import("./Search-D5OkKFDj.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]))),uu=K(()=>U(()=>import("./Mature-DGDC_8w6.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]))),An=K(()=>U(()=>import("./Asmr-BaXYabXN.js"),__vite__mapDeps([62,1,4,2,41,42,7,8,3,5,6,9,32,24,63,25,45,46,64,65,66]))),du=K(()=>U(()=>import("./Manga-BmHoV3yQ.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]))),mu=K(()=>U(()=>import("./MangaInfoPage-Blz86W7a.js"),__vite__mapDeps([70,1,4,17,18,68,69,23,2,24,64,65]))),hu=K(()=>U(()=>import("./MangaReadPage-DzEhRrLW.js"),__vite__mapDeps([71,1,17,4,18,2,68,69,23,24,64,65]))),pu=K(()=>U(()=>import("./ReadingList-CKJ1Lt3H.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]))),On=K(()=>U(()=>import("./TvSearch-Gddgkz5g.js"),__vite__mapDeps([74,1,4,3,5,6,7,8,9,28,29,30,2,24,15,16,17,18,58,59]))),fu=K(()=>U(()=>import("./TvInfo-FWR5_kso.js"),__vite__mapDeps([75,1,4,30,2,24,76]))),yu=K(()=>U(()=>import("./Tv-B0-XYYdF.js"),__vite__mapDeps([77,1,45,4,46,2,47,14,48,78,7,8,27,30,24,6,51,52,53,54,79]))),gu=K(()=>U(()=>import("./TvWatchlist-BTTqu23j.js"),__vite__mapDeps([80,1,3,4,5,6,7,8,9,73,15,16,17,18,35,36,19,29,30,2,24]))),vu=K(()=>U(()=>import("./ListeningList-Dm_owBjG.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]))),bu=K(()=>U(()=>import("./Trackers-D4BC2YOO.js"),__vite__mapDeps([82,1,2,4,83]))),wu=K(()=>U(()=>import("./Insights-C6rMfz5x.js"),__vite__mapDeps([84,1,2,4,85]))),_u=K(()=>U(()=>import("./AnimeInfoPage-DbT2RS0J.js"),__vite__mapDeps([86,1,2,4]))),Eu=K(()=>U(()=>import("./PlayerRedirect-fv2tzEUu.js"),__vite__mapDeps([87,1]))),Su=K(()=>U(()=>import("./VirtualKeyboard-BD5VOYcJ.js"),__vite__mapDeps([88,1,2,4,89])));function ku(){Ei();const{isOpen:e,closeModal:t,onSuccess:n}=Il(),{isOpen:r,setIsOpen:s}=Ut(),{isOpen:a,openModal:i,closeModal:c}=Vl(),l=ut(),u=jr(),d=M(new Map),m=M(l.pathname),h=M(l.key),p=M(null),[y,E]=g(!1),O=ec();Tl();const[N,S]=g(!1);w(()=>{const L=new AbortController;return We("/api/auth/app-status",{signal:L.signal}).then(W=>{W.hasPassword&&!W.isAuthenticated&&(S(!0),i())}).catch(()=>{L.signal.aborted||C.error("Could not check server access. The server may still be starting; reload to retry.")}),()=>L.abort()},[i]);const[b,T]=Vt("lan_auth_notice_shown","false"),H=M(!1);return w(()=>{if(b==="true"||H.current)return;H.current=!0,T("true");const L=setTimeout(()=>{C("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(L)},[b,T]),w(()=>{try{window.history.scrollRestoration="manual"}catch{}},[]),w(()=>{const L=l.key,W=d.current;if(u==="POP"){const P=W.get(L)??0;window.scrollTo({top:P,behavior:"instant"})}else l.pathname!==m.current&&window.scrollTo({top:0,behavior:"instant"});return m.current=l.pathname,()=>{W.set(L,window.scrollY)}},[l.key,l.pathname,u]),w(()=>{const L=()=>{E(!0),p.current!==null&&window.clearTimeout(p.current),p.current=window.setTimeout(()=>{E(!1),p.current=null},1e4)},W=j=>{if(j.defaultPrevented||j.button!==0||j.metaKey||j.ctrlKey||j.shiftKey||j.altKey)return;const Q=j.target;if(!(Q instanceof Element))return;const v=Q.closest("a[href]");if(!v||v.hasAttribute("download")||v.getAttribute("target")==="_blank")return;const I=new URL(v.href,window.location.href);I.origin===window.location.origin&&`${I.pathname}${I.search}${I.hash}`!=`${window.location.pathname}${window.location.search}${window.location.hash}`&&L()},P=()=>L();return document.addEventListener("click",W,!0),window.addEventListener("popstate",P),()=>{document.removeEventListener("click",W,!0),window.removeEventListener("popstate",P),p.current!==null&&(window.clearTimeout(p.current),p.current=null)}},[]),w(()=>{h.current!==l.key&&(h.current=l.key,y&&(p.current!==null&&window.clearTimeout(p.current),p.current=window.setTimeout(()=>{E(!1),p.current=null},500)))},[l.key,y]),w(()=>{const L=W=>{r&&W.key==="Escape"&&s(!1)};return r?document.body.classList.add("sidebar-open"):document.body.classList.remove("sidebar-open"),window.addEventListener("keydown",L),()=>{window.removeEventListener("keydown",L),document.body.classList.remove("sidebar-open")}},[r,s]),o("div",{className:"app-container",children:[o(jl,{isOpen:e,onClose:t,onSuccess:n}),o(Cr,{isOpen:a,onClose:N?()=>{}:c,onSuccess:()=>{S(!1),c()}}),o(Qn,{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"}}}}),y&&o(Cn,{}),o(ou,{enabled:!N&&!a}),o(zc,{}),o(il,{}),o("main",{className:"main-content",children:o(Ql,{children:o(en,{fallback:o(Cn,{}),children:o(Fr,{children:[o($,{path:"/",element:o(su,{})}),o($,{path:"/watchlist/:filter?",element:o(au,{})}),o($,{path:"/reading-list/:filter?",element:o(pu,{})}),o($,{path:"/search",element:o(lu,{})}),o($,{path:"/mature",element:o(uu,{})}),o($,{path:"/asmr",element:o(An,{})}),o($,{path:"/asmr/:rj",element:o(An,{})}),o($,{path:"/manga",element:o(du,{})}),o($,{path:"/manga/:provider/:id",element:o(mu,{})}),o($,{path:"/manga/:provider/:id/read",element:o(hu,{})}),o($,{path:"/tv",element:o(On,{})}),o($,{path:"/tv/:id",element:o(fu,{})}),o($,{path:"/tv/:id/watch",element:o(yu,{})}),o($,{path:"/tv-search",element:o(On,{})}),o($,{path:"/tv-watchlist/:filter?",element:o(gu,{})}),o($,{path:"/listening-list/:filter?",element:o(vu,{})}),o($,{path:"/settings",element:o(iu,{})}),o($,{path:"/trackers",element:o(bu,{})}),o($,{path:"/mal",element:o(tn,{to:"/trackers",replace:!0})}),o($,{path:"/insights",element:o(wu,{})}),o($,{path:"/anime/:id",element:o(_u,{})}),o($,{path:"/watch/:id",element:o(xn,{})}),o($,{path:"/watch-along",element:o(cu,{})}),o($,{path:"/watch/:id/:episodeNumber",element:o(xn,{})}),o($,{path:"/player/:id/:episodeNumber?",element:o(Eu,{})}),o($,{path:"*",element:o(tn,{to:"/",replace:!0})})]})})})}),o(Pl,{}),O.isVisible&&o(en,{fallback:null,children:o(Su,{activeInputRef:O.activeInputRef,isVisible:O.isVisible,onClose:O.hide})})]})}function Pu(){return o(zl,{children:o(ku,{})})}const Tu=({children:e})=>{const[t,n]=g(!1),r=z(()=>{n(a=>!a)},[]),s=Le(()=>({isOpen:t,setIsOpen:n,toggleSidebar:r}),[t,r]);return o(vr.Provider,{value:s,children:e})},Iu=({children:e})=>{const[t,n]=Vt("dango_content_type","anime"),r=Le(()=>({contentType:t,setContentType:n}),[t,n]);return o(br.Provider,{value:r,children:e})},Nu=({children:e})=>{const[t,n]=g("englishName"),[r,s]=g(!0);w(()=>{(async()=>{try{const c=await te.settings.getByKey.query({key:"titlePreference"});c.value&&n(c.value)}catch(c){console.error("Error fetching title preference in context:",c)}finally{s(!1)}})()},[]);const a=Le(()=>({titlePreference:t,setTitlePreference:n,loading:r}),[t,r]);return o(cr.Provider,{value:a,children:e})},Cu=({children:e})=>{const{data:t,isLoading:n}=yt("lowEndMode"),r=hr(),s=oe(),[a,i]=g(!1);w(()=>{const u=s.getDefaultOptions();s.setDefaultOptions({...u,queries:{...u.queries,gcTime:a?900*1e3:1800*1e3}})},[a,s]),w(()=>{t!==void 0&&i(t==="true"||t===!0)},[t]),w(()=>{a?document.body.classList.add("low-end"):document.body.classList.remove("low-end")},[a]);const c=z(u=>{i(u),r.mutate({key:"lowEndMode",value:String(u)})},[r]),l=Le(()=>({lowEndMode:a,setLowEndMode:c,loading:n}),[a,c,n]);return o(pr.Provider,{value:l,children:e})},xu=["iris","mochi","sakura"];function qn(e){e==="iris"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e)}const Au=({children:e})=>{const{data:t,isLoading:n}=yt("theme"),r=hr(),[s,a]=g("iris");w(()=>{typeof t=="string"&&xu.includes(t)&&a(t)},[t]),w(()=>{qn(s)},[s]);const i=z(l=>{l!==s&&(a(l),qn(l),r.mutate({key:"theme",value:l}))},[r,s]),c=Le(()=>({theme:s,setTheme:i,loading:n}),[s,i,n]);return o(yr.Provider,{value:c,children:e})},Ou=({children:e})=>{const[t,n]=g(!1),[r,s]=g(void 0),a=z(c=>{s(()=>c),n(!0)},[]),i=z(()=>{n(!1),s(void 0)},[]);return w(()=>nr("animepahe",()=>a()),[a]),o(Ir.Provider,{value:{isOpen:t,openModal:a,closeModal:i,onSuccess:r},children:e})},qu="_gate_rmllo_1",Lu="_panel_rmllo_10",Ru="_form_rmllo_18",Du="_field_rmllo_31",$u="_avatarRow_rmllo_48",Mu="_uploadButton_rmllo_60",ju="_fileInput_rmllo_89",Fu="_profileList_rmllo_102",Bu="_smallAvatar_rmllo_115",Wu="_profileName_rmllo_120",Ae={gate:qu,panel:Lu,form:Ru,field:Du,avatarRow:$u,uploadButton:Mu,fileInput:ju,profileList:Fu,smallAvatar:Bu,profileName:Wu};function Ku({children:e}){const[t,n]=g(!1),[r,s]=g(!1),[a,i]=g([]),[c,l]=g(""),[u,d]=g(""),[m,h]=g(""),[p,y]=g(!1),[E,O]=g(0);if(w(()=>{let S=!1;return h(""),(async()=>{const T=await We("/api/auth/app-status");if(S)return;if(T.hasPassword&&!T.isAuthenticated){s(!0);return}const H=await We("/api/profiles/status");S||(H.current?(Xs(H.current.id),n(!0)):(i(H.profiles),l(H.profiles[0]?.id??"")))})().catch(T=>{S||h(T.message)}),()=>{S=!0}},[E]),w(()=>{const S=T=>{T.key==="dango:profile-session-change"&&window.location.reload()},b=()=>{n(!1),O(T=>T+1)};return window.addEventListener("storage",S),window.addEventListener("dango:profile-auth-required",b),()=>{window.removeEventListener("storage",S),window.removeEventListener("dango:profile-auth-required",b)}},[]),t)return e;const N=a.find(S=>S.id===c);return o("div",{className:Ae.gate,children:[o(Qn,{}),o(Cr,{isOpen:r,onClose:()=>{},onSuccess:()=>{s(!1),O(S=>S+1)}}),o("section",{className:Ae.panel,children:[o("h1",{children:a.length?"Choose your profile":"Connecting to Dango…"}),N&&o(de,{children:[o("div",{className:Ae.avatarRow,children:o(Er,{image:N.avatar??N.cloudAvatar,name:N.name})}),o("form",{className:Ae.form,onSubmit:async S=>{S.preventDefault(),y(!0),h("");try{await We("/api/profiles/login",{method:"POST",body:JSON.stringify({id:c,password:u})}),ta()}catch(b){h(b.message),y(!1)}},children:[o("label",{className:Ae.field,children:["Profile",o("select",{value:c,onChange:S=>{l(S.currentTarget.value),d(""),h("")},children:a.map(S=>o("option",{value:S.id,children:[S.name,S.owner?" (owner)":""]},S.id))})]}),N.protected&&o("label",{className:Ae.field,children:["Password",o("input",{type:"password",autoComplete:"current-password",required:!0,maxLength:256,value:u,onChange:S=>d(S.currentTarget.value)})]}),o(lt,{type:"submit",loading:p,children:"Continue"})]})]}),m&&o(de,{children:[o("p",{role:"alert",children:m}),o(lt,{variant:"secondary",onClick:()=>O(S=>S+1),children:"Retry"})]})]})]})}const xr=ye(null);function Md(){const e=ge(xr);if(!e)throw new Error("WatchAlongProvider is missing");return e}const Uu=/^[0-9a-f-]{36}$/,Hu=/^[0-9a-f]{64}$/;function jd(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 Fd(e,t){return e.position+(e.playing?Math.max(0,t-e.updatedAt)/1e3*e.rate:0)}const Dt="dango-watch-along",zt="dango-watch-along-host";function Ln(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=Ke(`${t.id}.${t.guestToken}`,""),r=Ke(`${t.id}.${t.token}`,"");return{...n,token:r.token,host:t.host===!0}}function Qu(){try{return Ln(JSON.parse(sessionStorage.getItem(Dt)||"null"))??Ln(JSON.parse(localStorage.getItem(zt)||"null"))}catch{return null}}function Vu(e){try{e?sessionStorage.setItem(Dt,JSON.stringify(e)):sessionStorage.removeItem(Dt),e?.host&&localStorage.setItem(zt,JSON.stringify(e))}catch{}}function nt(){try{localStorage.removeItem(zt)}catch{}}function zu(e){return e.kind==="tv"||e.kind==="movie"?rc(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 Ke(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,s,a]=n.split(".");if(!Uu.test(r||"")||!Hu.test(s||"")||a!==void 0)throw new Error("Paste a complete watch-along invite link or room code.");return{id:r,token:s,guestToken:s,host:!1}}function Gu({children:e}){const t=Mn(),n=ut(),[r,s]=Vt("watchAlongName",""),[a,i]=g(Qu),[c,l]=g(null),[u,d]=g(!1),[m,h]=g(""),[p,y]=g(""),[E,O]=g({offset:0,latency:0}),N=M(null),{data:S}=F({queryKey:["watch-along-config"],queryFn:()=>te.settings.watchAlong.query()}),b=S?.workerUrl.replace(/\/$/,"")||"";w(()=>{Vu(a)},[a]);const T=z(P=>{N.current?.readyState===WebSocket.OPEN&&N.current.send(JSON.stringify(P))},[]);w(()=>{if(!u)return;const P=setTimeout(()=>T({type:"name",name:r}),250);return()=>clearTimeout(P)},[u,p,r,T]);const H=z(()=>{a?.host&&T({type:"end"}),N.current?.close(1e3,"Left room"),nt(),i(null),l(null),d(!1),h("")},[T,a]),L=async P=>{if(!b)throw new Error("Watch along is unavailable. Check your server configuration.");const j=await fetch(`${b}/rooms`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(P),signal:AbortSignal.timeout(15e3)}),Q=await j.json();if(!j.ok)throw new Error(Q.error||"Could not create room");const v=Ke(`${Q.id}.${Q.guestToken}`,b),I=Ke(`${Q.id}.${Q.hostToken}`,b);h(""),l(null),i({...v,token:I.token,host:!0})},W=P=>{if(!b)throw new Error("Watch along is unavailable. Check your server configuration.");const j=Ke(P,b);nt(),h(""),l(null),i(j)};return w(()=>{if(!a||!b)return;let P=!1,j=0,Q,v,I=Date.now();const X=async()=>{if(P)return;try{const G=await fetch(`${b}/rooms/${a.id}`,{headers:{Authorization:`Bearer ${a.token}`},signal:AbortSignal.timeout(1e4)});if(P)return;if(!G.ok){const q=await G.json();if([403,404,409].includes(G.status)){h(q.error||"Unable to join room"),nt(),i(null),l(null);return}throw new Error(q.error||"Room service unavailable")}}catch{if(P)return;h("Cannot reach the room service. Retrying…"),Q=setTimeout(X,Math.min(15e3,1e3*2**Math.min(j++,4)));return}const ue=new URL(`${b}/rooms/${a.id}/ws`);ue.protocol=ue.protocol==="https:"?"wss:":"ws:";const V=new WebSocket(ue,["dango-watch-along",a.token]);N.current=V,V.onopen=()=>{I=Date.now()},V.onmessage=G=>{if(!(P||N.current!==V)){I=Date.now();try{const q=JSON.parse(G.data);if(q.type==="joined"){if(q.host!==a.host){V.close(4003,"Invalid role");return}j=0,d(!0),h(""),y(q.id),V.send(JSON.stringify({type:"ping",sentAt:Date.now()}))}else if(q.type==="state")l(me=>me&&me.revision>q.state.revision?me:q.state);else if(q.type==="pong"){const me=Date.now()-q.sentAt;O({offset:q.serverTime-(q.sentAt+me/2),latency:me/2})}else q.type==="error"&&h(q.error)}catch{h("Invalid response from the room service.")}}},V.onclose=G=>{if(!(P||N.current!==V)){if(clearInterval(v),d(!1),[4003,4004,4009].includes(G.code)){h(G.reason||"Room closed"),G.code!==4009&&nt(),i(null),l(null);return}h("Connection lost. Reconnecting…"),Q=setTimeout(X,Math.min(15e3,1e3*2**Math.min(j++,4)))}},V.onerror=()=>V.close(),v=setInterval(()=>{Date.now()-I>25e3?V.close():V.readyState===WebSocket.OPEN&&V.send(JSON.stringify({type:"ping",sentAt:Date.now()}))},1e4)};return X(),()=>{P=!0,clearTimeout(Q),clearInterval(v),N.current?.close(1e3,"Leaving connection"),N.current=null,d(!1)}},[a,b]),w(()=>{if(!a||a.host||!c)return;const P=zu(c.selection);`${n.pathname}${n.search}`!==P&&t(P,{replace:!0})},[a,c,n.pathname,n.search,t]),o(xr.Provider,{value:{workerUrl:b,displayName:r,setDisplayName:s,session:a,room:c,connected:u,error:m,selfId:p,clock:E,create:L,join:W,leave:H,send:T},children:e})}try{window.history.scrollRestoration="manual"}catch{}const Rn=new Hr({defaultOptions:{queries:{staleTime:1e3*60*5,gcTime:1800*1e3,refetchOnWindowFocus:!1,refetchIntervalInBackground:!1,retry:1}}}),Dn=document.getElementById("root");Dn&&Br(o(Ku,{children:o(Wr,{children:o(sa,{trpcClient:te,queryClient:Rn,children:o(Qr,{client:Rn,children:o(Ou,{children:o(Tu,{children:o(Iu,{children:o(Nu,{children:o(Cu,{children:o(Au,{children:o(Gu,{children:o(Pu,{})})})})})})})})})})})}),Dn);export{kn as $,hd as A,lt as B,_d as C,fd as D,nd as E,Ld as F,Ed as G,yd as H,pd as I,C as J,yt as K,hr as L,Cd as M,bd as N,wd as O,vd as P,Re as Q,tc as R,We as S,Nd as T,Ae as U,Er as V,ta as W,Bt as X,Y,kd as Z,Pd as _,Vt as a,_r as a0,Sn as a1,U as a2,_t as a3,td as a4,se as a5,Md as a6,jl as a7,jo as a8,ad as a9,Xi as aa,cc as ab,$d as ac,nr as ad,Rd as ae,xd as af,Od as ag,qd as ah,ac as ai,Ht as aj,Td as ak,Dd as al,jd as am,Fd as an,Ut as ao,Sd as ap,Cn as aq,ud as ar,dd as as,ld as at,rd as b,od as c,lr as d,Gc as e,ir as f,Ad as g,Xu as h,rc as i,Id as j,nc as k,va as l,ic as m,Tn as n,D as o,ee as p,x as q,sd as r,ed as s,te as t,ci as u,wr as v,gd as w,id as x,cd as y,md as z};
|