PageSourceSearch

https://www.absoluteanime.com/!bin/minify.php?f=%2F%21bin%2Fskin3%…2Fskin3%2Fjs%2Faudio-player.js&v=1781232584

js absoluteanime.com collected 2026-09-24 19:21:58 UTC 78,040 bytes, 531 lines download raw bytes

1document.querySelector('#navbar ul.primary')?.addEventListener('mouseover',function(e){const mobileNav=document.getElementById('mobile-navbar');if(mobileNav?.offsetParent)return;const li=e.target.closest('#navbar ul.primary > li');if(!li||li.querySelector('ul'))return;const request=li.className.replace(/\s*active\s*/,'');const url=path.skin+'toolbar-extras.php?request='+request+'&path='+encodeURIComponent(window.location.pathname);fetch(url).then(r=>r.text()).then(response=>{if(li.classList.contains(request)&&response?.length>0&&!li.querySelector('ul')){li.insertAdjacentHTML('beforeend',response);const sub=li.querySelector('ul');if(sub){const overflow=sub.getBoundingClientRect().right+16-window.innerWidth;if(overflow>0){sub.style.width=(sub.offsetWidth-overflow)+'px';sub.style.boxSizing='border-box'}}}})});(function(){let overlay;let showCount=0;const navbar=document.querySelector('#navbar ul.primary');if(!navbar){return}
2function showOverlay(){if(!overlay){overlay=document.createElement('div');overlay.id='aa_wrapper_overlay';Object.assign(overlay.style,{position:'fixed',top:'0',left:'0',right:'0',bottom:'0',backgroundColor:'rgba(1, 1, 1, 0.2)',opacity:'0',zIndex:'4',transition:'opacity 0.15s',pointerEvents:'none'});document.getElementById('aa_wrapper').before(overlay)}
3showCount++;overlay.style.display='';requestAnimationFrame(()=>{overlay.style.opacity='1'})}
4function hideOverlay(){if(!overlay){return}
5const count=++showCount;overlay.style.opacity='0';overlay.addEventListener('transitionend',function(){if(showCount===count){overlay.style.display='none'}},{once:!0})}
6navbar.addEventListener('mouseover',function(e){const li=e.target.closest('#navbar ul.primary > li');if(li&&!li.classList.contains('search')&&!li.classList.contains('dark-mode-toggle')){showOverlay()}});navbar.addEventListener('mouseleave',function(){hideOverlay()})})();const searchField=document.getElementById('q');if(searchField){searchField.autocomplete='off';if(searchField.value.length>0){searchField.style.backgroundImage='none'}}
7if(window.history.navigationMode){window.history.navigationMode='compatible'}(function(){const ulPrimary=document.querySelector('#navbar ul.primary');if(!ulPrimary)return;const items=()=>ulPrimary.querySelectorAll('li');const searchItem=()=>ulPrimary.querySelector('li.search');function slideToggle(el){if(el.offsetHeight>0){el.style.maxHeight=el.scrollHeight+'px';requestAnimationFrame(()=>{requestAnimationFrame(()=>{el.style.maxHeight='0'})});el.addEventListener('transitionend',function(){if(el.style.maxHeight==='0px')el.style.display='none'},{once:!0})}else{el.style.display='block';el.style.maxHeight='0';requestAnimationFrame(()=>{requestAnimationFrame(()=>{el.style.maxHeight=el.scrollHeight+'px'})});el.addEventListener('transitionend',function(){el.style.maxHeight=''},{once:!0})}}
8const mobileNav=document.getElementById('mobile-navbar');function isMobile(){return mobileNav?.offsetParent}
9function updateOverflow(){if(isMobile()){ulPrimary.style.transition='max-height 0.3s ease';ulPrimary.style.overflow='hidden'}else{ulPrimary.style.transition='';ulPrimary.style.overflow=''}}
10updateOverflow();window.addEventListener('resize',updateOverflow);const menuBtn=document.querySelector('#mobile-navbar .menu-btn a');const searchBtn=document.querySelector('#mobile-navbar .search-btn a');if(menuBtn){menuBtn.addEventListener('click',function(e){e.preventDefault();const wasOpenInMenu=ulPrimary.offsetHeight>0&&!searchItem()?.offsetParent;if(ulPrimary.offsetHeight>0&&searchItem()?.offsetParent){ulPrimary.style.display='none';ulPrimary.style.maxHeight=''}
11items().forEach(li=>{li.style.display=''});if(searchItem())searchItem().style.display='none';slideToggle(ulPrimary);menuBtn.setAttribute('aria-expanded',wasOpenInMenu?'false':'true');if(searchBtn)searchBtn.setAttribute('aria-expanded','false');})}
12if(searchBtn){searchBtn.addEventListener('click',function(e){e.preventDefault();const wasOpenInSearch=ulPrimary.offsetHeight>0&&!!searchItem()?.offsetParent;if(ulPrimary.offsetHeight>0&&searchItem()&&!searchItem().offsetParent){ulPrimary.style.display='none';ulPrimary.style.maxHeight=''}
13items().forEach(li=>{li.style.display='none'});if(searchItem())searchItem().style.display='';slideToggle(ulPrimary);searchBtn.setAttribute('aria-expanded',wasOpenInSearch?'false':'true');if(menuBtn)menuBtn.setAttribute('aria-expanded','false');})}})();const AADialog=(function(){let dialog=null;const DIALOG_CSS=`
14		#aa-dialog {
15			border: none;
16			border-radius: 8px;
17			padding: 0;
18			max-width: 880px;
19			max-height: 80vh;
20			width: 90vw;
21			box-shadow: 0 4px 24px var(--shadow-medium);
22			background: var(--bg-primary);
23			display: flex;
24			flex-direction: column;
25		}
26		#aa-dialog:not([open]) {
27			display: none;
28		}
29		#aa-dialog[open] {
30			display: flex;
31		}
32		#aa-dialog::backdrop {
33			background: rgba(0,0,0,0.5);
34		}
35		#aa-dialog .aa-dialog-bar {
36			display: flex;
37			justify-content: space-between;
38			flex-shrink: 0;
39			position: absolute;
40			top: 0;
41			left: 0;
42			right: 0;
43			z-index: 2;
44			pointer-events: none;
45		}
46		#aa-dialog .aa-dialog-bar > * {
47			pointer-events: auto;
48		}
49		#aa-dialog .aa-dialog-close,
50		#aa-dialog .aa-dialog-popout {
51			background: rgba(0,0,0,0.5);
52			border: none;
53			color: #fff;
54			cursor: pointer;
55			width: 32px;
56			height: 32px;
57			line-height: 32px;
58			text-align: center;
59			text-decoration: none;
60			font-size: 24px;
61			padding: 0;
62		}
63		#aa-dialog .aa-dialog-close {
64			border-radius: 0 8px 0 8px;
65		}
66		#aa-dialog .aa-dialog-popout {
67			border-radius: 8px 0 8px 0;
68			font-size: 18px;
69			line-height: 30px;
70		}
71		#aa-dialog .aa-dialog-close:hover,
72		#aa-dialog .aa-dialog-popout:hover {
73			background: rgba(0,0,0,0.8);
74		}
75		#aa-dialog .aa-dialog-content {
76			padding: 1em;
77			overflow-y: auto;
78			flex: 1;
79			color: var(--text-primary);
80		}
81		@media (pointer: fine) {
82			#aa-dialog .aa-dialog-bar {
83				opacity: 0;
84				transition: opacity 0.2s;
85			}
86			#aa-dialog .aa-dialog-content:hover ~ .aa-dialog-bar,
87			#aa-dialog .aa-dialog-bar:hover {
88				opacity: 1;
89			}
90		}
91	`;const DIALOG_HTML=`
92		<dialog id="aa-dialog">
93			<div class="aa-dialog-content"></div>
94			<div class="aa-dialog-bar">
95				<a class="aa-dialog-popout" href="#" aria-label="Open in new window" title="Open in new window" target="_blank">\uD83D\uDDD7</a>
96				<button class="aa-dialog-close" aria-label="Close" title="Close">&times;</button>
97			</div>
98		</dialog>
99	`;function get(){if(!dialog){const template=document.createElement('template');template.innerHTML=DIALOG_HTML.trim();dialog=template.content.firstChild;dialog.querySelector('.aa-dialog-close').addEventListener('click',()=>dialog.close());dialog.addEventListener('click',(e)=>{if(e.target===dialog){dialog.close()}});if(!document.getElementById('aa-dialog-styles')){const style=document.createElement('style');style.id='aa-dialog-styles';style.textContent=DIALOG_CSS.trim();document.head.appendChild(style)}
100document.body.appendChild(dialog)}
101return dialog}
102function open(href,extraData){const el=get();const content=el.querySelector('.aa-dialog-content');const popout=el.querySelector('.aa-dialog-popout');el.style.height='';content.style.padding='';content.innerHTML='<div class="loading-section" style="min-height:200px;"></div>';if(popout)popout.href=href;el.showModal();const url=new URL(href,location.origin);if(extraData){Object.entries(extraData).forEach(([k,v])=>url.searchParams.set(k,v))}
103fetch(url).then(r=>r.text()).then(html=>{content.innerHTML=html;content.querySelectorAll('script').forEach(old=>{const s=document.createElement('script');s.textContent=old.textContent;old.replaceWith(s)})})}
104function openIframe(href){const el=get();const content=el.querySelector('.aa-dialog-content');const popout=el.querySelector('.aa-dialog-popout');if(popout)popout.href=href;el.style.height='80vh';content.style.padding='0';content.innerHTML='<iframe src="'+href+'" style="width:100%;height:calc(80vh - 30px);border:0;"></iframe>';el.showModal()}
105function close(){if(dialog){dialog.close()}}
106return{get,open,openIframe,close}})();function openDialog(href,extraData){AADialog.open(href,extraData)}
107function openDialogIframe(href){AADialog.openIframe(href)}
108const AALightbox=(function(){let overlay,imgEl,vidEl,caption,counter,btnPrev,btnNext,btnClose,btnPopout,btnOverlayPrev,btnOverlayNext;let group=[];let currentIdx=0;const VIDEO_EXT_RE=/\.(?:webm|mp4|m4v|ogv|mov|avi|mpe?g)(?:[?#]|$)/i;function isVideoSrc(src){return typeof src==='string'&&VIDEO_EXT_RE.test(src)}
109const LANG_LABELS={eng:'English',english:'English',jpn:'Japanese',japanese:'Japanese'};function videoLabelFromHref(href){try{const url=new URL(href,document.location.href);const filename=url.pathname.split('/').pop()||'';const stem=filename.replace(/\.[^.]+$/,'').replace(/^-+/,'');if(!stem)return'';const lastDash=stem.lastIndexOf('-');if(lastDash>0){const tail=stem.slice(lastDash+1).toLowerCase();if(LANG_LABELS[tail])return LANG_LABELS[tail]+' clip'}
110return stem.split(/[-_]/).map(w=>w?w.charAt(0).toUpperCase()+w.slice(1):'').join(' ').trim()}catch(_){return''}}
111const LIGHTBOX_CSS=`
112		#aa-lightbox {
113			display: none;
114			position: fixed;
115			top: 0; left: 0; right: 0; bottom: 0;
116			z-index: 9999;
117			align-items: center;
118			justify-content: center;
119		}
120		#aa-lightbox.active {
121			display: flex;
122		}
123		#aa-lightbox.closing {
124			display: flex;
125			animation: lb-fade-out 0.2s ease-in forwards;
126		}
127		@keyframes lb-fade-out {
128			from { opacity: 1; }
129			to { opacity: 0; }
130		}
131		#aa-lightbox .lb-backdrop {
132			position: absolute;
133			top: 0; left: 0; right: 0; bottom: 0;
134			background: rgba(0,0,0,0.70);
135		}
136		#aa-lightbox .lb-content {
137			position: relative;
138			max-width: 95vw;
139			max-height: 90vh;
140			display: flex;
141			flex-direction: column;
142			align-items: center;
143			background: #000;
144			border-radius: 8px;
145			box-shadow: 0 4px 24px rgba(0,0,0,0.4);
146			animation: lb-zoom-in 0.2s ease-out;
147		}
148		@keyframes lb-zoom-in {
149			from { transform: scale(0.85); opacity: 0; }
150			to { transform: scale(1); opacity: 1; }
151		}
152		#aa-lightbox .lb-bar {
153			display: flex;
154			justify-content: space-between;
155			position: absolute;
156			top: 0; left: 0; right: 0;
157			z-index: 2;
158			pointer-events: none;
159		}
160		#aa-lightbox .lb-bar > * {
161			pointer-events: auto;
162		}
163		#aa-lightbox .lb-close,
164		#aa-lightbox .lb-popout {
165			background: rgba(0,0,0,0.5);
166			border: none;
167			color: #fff;
168			cursor: pointer;
169			width: 32px;
170			height: 32px;
171			line-height: 32px;
172			text-align: center;
173			text-decoration: none;
174			font-size: 24px;
175			padding: 0;
176		}
177		#aa-lightbox .lb-close {
178			border-radius: 0 8px 0 8px;
179		}
180		#aa-lightbox .lb-popout {
181			border-radius: 8px 0 8px 0;
182			font-size: 18px;
183			line-height: 30px;
184		}
185		#aa-lightbox .lb-close:hover,
186		#aa-lightbox .lb-popout:hover {
187			background: rgba(0,0,0,0.8);
188		}
189		@media (pointer: fine) {
190			#aa-lightbox .lb-bar {
191				opacity: 0;
192				transition: opacity 0.2s;
193			}
194			#aa-lightbox .lb-content:hover .lb-bar,
195			#aa-lightbox .lb-bar:hover {
196				opacity: 1;
197			}
198		}
199		#aa-lightbox .lb-image,
200		#aa-lightbox .lb-video {
201			max-width: 95vw;
202			max-height: 85vh;
203			object-fit: contain;
204			border-radius: 8px 8px 0 0;
205			transition: width 0.2s ease, height 0.2s ease;
206		}
207		#aa-lightbox .lb-video {
208			background: #000;
209		}
210		#aa-lightbox .lb-image[hidden],
211		#aa-lightbox .lb-video[hidden] {
212			display: none;
213		}
214		#aa-lightbox .lb-footer {
215			background: #111;
216			width: 100%;
217			padding: 6px 12px;
218			box-sizing: border-box;
219			border-radius: 0 0 8px 8px;
220			display: flex;
221			justify-content: space-between;
222			align-items: center;
223		}
224		#aa-lightbox .lb-caption {
225			color: #ccc;
226			font-size: 0.9em;
227		}
228		#aa-lightbox .lb-nav {
229			display: flex;
230			align-items: center;
231			gap: 8px;
232			white-space: nowrap;
233		}
234		#aa-lightbox .lb-counter {
235			color: #888;
236			font-size: 0.85em;
237		}
238		#aa-lightbox .lb-prev,
239		#aa-lightbox .lb-next {
240			background: none;
241			border: none;
242			color: #aaa;
243			cursor: pointer;
244			font-size: 1.4em;
245			padding: 2px 6px;
246		}
247		#aa-lightbox .lb-prev:hover,
248		#aa-lightbox .lb-next:hover {
249			color: #fff;
250		}
251		#aa-lightbox .lb-overlay-prev,
252		#aa-lightbox .lb-overlay-next {
253			position: absolute;
254			top: 50%;
255			transform: translateY(-50%);
256			background: rgba(0,0,0,0.4);
257			border: none;
258			color: #fff;
259			cursor: pointer;
260			font-size: 2em;
261			padding: 12px 8px;
262			opacity: 0.6;
263			z-index: 2;
264		}
265		#aa-lightbox .lb-overlay-prev {
266			left: 0;
267			border-radius: 0 4px 4px 0;
268		}
269		#aa-lightbox .lb-overlay-next {
270			right: 0;
271			border-radius: 4px 0 0 4px;
272		}
273		#aa-lightbox .lb-overlay-prev:hover,
274		#aa-lightbox .lb-overlay-next:hover {
275			opacity: 1;
276		}
277	`;const LIGHTBOX_HTML=`
278		<div id="aa-lightbox">
279			<div class="lb-backdrop"></div>
280			<div class="lb-content">
281				<div class="lb-bar">
282					<a class="lb-popout" aria-label="Open in new window" title="Open in new window" target="_blank">\uD83D\uDDD7</a>
283					<button class="lb-close" aria-label="Close" title="Close">&times;</button>
284				</div>
285				<button class="lb-overlay-prev" aria-label="Previous image" title="Previous">&#10094;</button>
286				<button class="lb-overlay-next" aria-label="Next image" title="Next">&#10095;</button>
287				<img class="lb-image" alt="">
288				<video class="lb-video" controls preload="metadata" hidden></video>
289				<div class="lb-footer">
290					<span class="lb-caption"></span>
291					<div class="lb-nav">
292						<button class="lb-prev" aria-label="Previous image" title="Previous">&#10094;</button>
293						<span class="lb-counter"></span>
294						<button class="lb-next" aria-label="Next image" title="Next">&#10095;</button>
295					</div>
296				</div>
297			</div>
298		</div>
299	`;function init(){if(!document.getElementById('aa-lightbox-styles')){const style=document.createElement('style');style.id='aa-lightbox-styles';style.textContent=LIGHTBOX_CSS.trim();document.head.appendChild(style)}
300const template=document.createElement('template');template.innerHTML=LIGHTBOX_HTML.trim();overlay=template.content.firstChild;document.body.appendChild(overlay);imgEl=overlay.querySelector('.lb-image');vidEl=overlay.querySelector('.lb-video');caption=overlay.querySelector('.lb-caption');counter=overlay.querySelector('.lb-counter');btnPrev=overlay.querySelector('.lb-prev');btnNext=overlay.querySelector('.lb-next');btnClose=overlay.querySelector('.lb-close');btnPopout=overlay.querySelector('.lb-popout');btnOverlayPrev=overlay.querySelector('.lb-overlay-prev');btnOverlayNext=overlay.querySelector('.lb-overlay-next');btnClose.addEventListener('click',close);overlay.querySelector('.lb-backdrop').addEventListener('click',close);btnPrev.addEventListener('click',()=>navigate(-1));btnNext.addEventListener('click',()=>navigate(1));btnOverlayPrev.addEventListener('click',()=>navigate(-1));btnOverlayNext.addEventListener('click',()=>navigate(1));document.addEventListener('keydown',function(e){if(!overlay.classList.contains('active')){return}
301if(e.key==='Escape')close();else if(e.key==='ArrowLeft')navigate(-1);else if(e.key==='ArrowRight')navigate(1);})}
302function getCaption(link){const show_xxx=window.show_adult_content||!1;const img=link.querySelector('img');const imgClass=img?.className||'';if(!show_xxx&&imgClass.includes('warn-')){return'[image hidden]'}
303const href=link.getAttribute('href')||link.getAttribute('src')||'';let text;if(isVideoSrc(href)){text=(link.getAttribute('title')||'').trim()||(link.getAttribute('aria-label')||'').replace(/^Play\s+/i,'').trim()||videoLabelFromHref(href)||link.textContent.trim()}else{text=link.title||(img?.title||'').replace(/\(\d+×\d+\)/,'').trim()||(img?.alt||'').replace(/\(\d+×\d+\)/,'').trim()||link.textContent.trim()}
304if(!text){const parts=document.title.split('\u2022');text=parts[0].trim()+(parts[1]?' ('+parts[1].trim()+')':'')}
305return text}
306function getSrc(link){const show_xxx=window.show_adult_content||!1;const img=link.querySelector('img');if(!show_xxx&&link.querySelector('[class*="warn-"]')){return img?.dataset.obscuredSrc||'/!bin/hidden.webp'}
307return link.getAttribute('src')||link.getAttribute('href')}
308function open(link){if(!overlay)init();const dlb=link.dataset.lightbox;const rel=link.getAttribute('rel');let candidates;if(dlb){candidates=Array.from(document.querySelectorAll('[data-lightbox="'+dlb+'"]'))}else if(rel?.startsWith('lightbox')){candidates=Array.from(document.querySelectorAll('[rel="'+rel
308+'"]'))}else{candidates=[link]}
309const seen=new Set();const keyFor=a=>{try{return new URL(a.href,document.location.href).href}catch(_){return a.href||''}};seen.add(keyFor(link));group=[link];for(const a of candidates){if(a===link)continue;const k=keyFor(a);if(seen.has(k))continue;seen.add(k);group.push(a)}
310group.sort((a,b)=>(a.compareDocumentPosition(b)&Node.DOCUMENT_POSITION_FOLLOWING)?-1:1);currentIdx=group.indexOf(link);if(currentIdx===-1)currentIdx=0;show(currentIdx);overlay.classList.add('active');document.body.style.overflow='hidden'}
311function show(idx){const link=group[idx];const src=getSrc(link);if(isVideoSrc(src)){imgEl.hidden=!0;imgEl.removeAttribute('src');imgEl.style.width='';imgEl.style.height='';vidEl.hidden=!1;vidEl.style.width='';vidEl.style.height='';vidEl.onloadedmetadata=function(){const maxW=window.innerWidth*0.95;const maxH=window.innerHeight*0.85;const scale=Math.min(1,maxW/vidEl.videoWidth,maxH/vidEl.videoHeight);vidEl.style.width=Math.round(vidEl.videoWidth*scale)+'px';vidEl.style.height=Math.round(vidEl.videoHeight*scale)+'px'};vidEl.src=src;vidEl.load()}else{vidEl.pause();vidEl.removeAttribute('src');vidEl.load();vidEl.hidden=!0;imgEl.hidden=!1;const oldW=imgEl.offsetWidth;const oldH=imgEl.offsetHeight;if(oldW&&oldH){imgEl.style.width=oldW+'px';imgEl.style.height=oldH+'px'}
312const img=new Image();img.onload=function(){imgEl.src=src;const maxW=window.innerWidth*0.95;const maxH=window.innerHeight*0.85;const scale=Math.min(1,maxW/img.naturalWidth,maxH/img.naturalHeight);const newW=Math.round(img.naturalWidth*scale);const newH=Math.round(img.naturalHeight*scale);requestAnimationFrame(()=>{requestAnimationFrame(()=>{imgEl.style.width=newW+'px';imgEl.style.height=newH+'px'})})};img.src=src}
313btnPopout.href=src;caption.textContent=getCaption(link);const hasNav=group.length>1;counter.textContent=hasNav?(idx+1)+' / '+group.length:'';btnPrev.style.display=hasNav?'':'none';btnNext.style.display=hasNav?'':'none';btnOverlayPrev.style.display=hasNav?'':'none';btnOverlayNext.style.display=hasNav?'':'none'}
314function navigate(dir){if(group.length<=1){return}
315currentIdx=(currentIdx+dir+group.length)%group.length;show(currentIdx)}
316function close(){overlay.classList.remove('active');overlay.classList.add('closing');overlay.addEventListener('animationend',function(){overlay.classList.remove('closing');document.body.style.overflow='';imgEl.src='';vidEl.pause();vidEl.removeAttribute('src');vidEl.load()},{once:!0})}
317return{open}})();function openImg(obj){AALightbox.open(obj);return!1}
318const AATooltip=(function(){const el=document.createElement('div');el.id='aa-tooltip';document.body.appendChild(el);let activeAnchor=null;let activeBubble=null;let abortCtrl=null;let mode=null;let hideTimer=null;let hovering=!1;el.addEventListener('mouseenter',()=>{hovering=!0;clearTimeout(hideTimer)});el.addEventListener('mouseleave',()=>{hovering=!1;hide()});function hideBubbles(){if(activeBubble){activeBubble.classList.remove('active');activeBubble=null}}
319function hideNow(){clearTimeout(hideTimer);activeAnchor=null;mode=null;hovering=!1;if(abortCtrl){abortCtrl.abort();abortCtrl=null}
320el.style.display='none';el.innerHTML=''}
321function hide(){clearTimeout(hideTimer);hideTimer=setTimeout(()=>{if(!hovering){hideNow()}},200)}
322function hideAll(){hideNow();hideBubbles()}
323function positionAtElement(anchor){const rect=anchor.getBoundingClientRect();el.style.left=rect.right+'px';el.style.top=(rect.top-el.offsetHeight-9)+'px';el.className='tail-bottom'}
324function positionCentered(anchor){const rect=anchor.getBoundingClientRect();const vw=window.innerWidth;const idealX=rect.left+rect.width/2-el.offsetWidth/2;const clampedX=Math.min(Math.max(5,idealX),vw-el.offsetWidth-5);el.style.left=clampedX+'px';el.style.top=(rect.top-el.offsetHeight-9)+'px';el.className='tail-center';const tailTarget=rect.left+rect.width/2-clampedX;el.style.setProperty('--tail-offset',tailTarget+'px')}
325function positionAtMouse(e){const vw=window.innerWidth;let x=e.clientX+10;let y=e.clientY-el.offsetHeight-10;let flippedX=!1,flippedY=!1;if(x+el.offsetWidth>
325vw-10){x=e.clientX-el.offsetWidth-15;flippedX=!0}
326if(y<10){y=e.clientY+10;flippedY=!0}
327if(y<10)y=10;el.style.left=x+'px';el.style.top=y+'px';el.className=(flippedY?'tail-top':'tail-bottom')+(flippedX?' tail-right':'')}
328function show(anchor,content,options){hideAll();activeAnchor=anchor;mode=options?.position||'element';el.innerHTML=content;el.style.display='block';if(mode==='mouse'&&options?.event){positionAtMouse(options.event)}else if(mode==='center'){positionCentered(anchor)}else{positionAtElement(anchor)}
329if(options?.onShow)options.onShow();}
330function track(e){if(!activeAnchor||mode!=='mouse'||el.style.display==='none'){return}
331positionAtMouse(e)}
332function isActive(anchor){return activeAnchor===anchor}
333function registerBubble(wrapper,options){const delay=options?.delay||300;let hideTimer=null;wrapper.addEventListener('mouseenter',()=>{hideNow();clearTimeout(hideTimer);if(activeBubble&&activeBubble!==wrapper)activeBubble.classList.remove('active');activeBubble=wrapper;wrapper.classList.add('active')});wrapper.addEventListener('mouseleave',()=>{hideTimer=setTimeout(()=>{wrapper.classList.remove('active');if(activeBubble===wrapper)activeBubble=null},delay)})}
334function setActive(anchor){hideAll();activeAnchor=anchor}
335function setAbortController(ctrl){abortCtrl=ctrl}
336return{show,hide,hideNow,hideAll,track,isActive,setActive,registerBubble,setAbortController}})();function setCookie(name,value,days){days??=28;let expires='';if(days||days===0){const date=new Date();date.setTime(date.getTime()+(days*86400000));expires='; expires='+date.toUTCString()}
337document.cookie=name+'='+encodeURIComponent(value)+expires+'; path=/; SameSite=Lax';return value}
338function getCookie(name,defaultVal){defaultVal=(typeof defaultVal==='undefined')?'':defaultVal;const match=document.cookie.match('(?:^|; )'+name.replace(/([.$?*|{}()\[\]\\\/+^])/g,'\\$1')+'=([^;]*)');const value=match?decodeURIComponent(match[1]):undefined;if(value===undefined){return defaultVal}
339if(typeof defaultVal==='number'&&typeof value==='string'){return value.match(/^\s*[0-9]+/)?parseInt(value,10):defaultVal}
340if(typeof defaultVal==='boolean'&&typeof value==='string'){return value.match(/false|0/i)?!1:Boolean(value)}
341return value}
342function setLocal(name,value,_days){if(value===''||value===null||value===undefined){try{localStorage.removeItem(name)}catch(_){}
343return value}
344try{localStorage.setItem(name,String(value))}catch(_){}
345return value}
346function getLocal(name,defaultVal){defaultVal=(typeof defaultVal==='undefined')?'':defaultVal;let value;try{value=localStorage.getItem(name)}catch(_){}
347if(value===null||value===undefined){return defaultVal}
348if(typeof defaultVal==='number'){return value.match(/^\s*-?[0-9]+/)?parseInt(value,10):defaultVal}
349if(typeof defaultVal==='boolean'){return value.match(/false|^0$/i)?!1:Boolean(value)}
350return value}
351function migrateCookieToLocal(name){try{if(localStorage.getItem(name)!==null)return}catch(_){return}
352const match=document.cookie.match('(?:^|; )'+name.replace(/([.$?*|{}()\[\]\\\/+^])/g,'\\$1')+'=([^;]*)');if(!match)return;try{localStorage.setItem(name,decodeURIComponent(match[1]))}catch(_){}
353document.cookie=name+'=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; SameSite=Lax'}
354function socialPopup(obj){let url='',w=500,h=400;const getMeta=(prop)=>document.querySelector(`meta[property="${prop}"]`)?.getAttribute('content')||'';if(typeof obj==='string'){url=obj}else if(obj.matches('[class^="twitter"]')){url='https://x.com/intent/tweet?text='+encodeURIComponent(getMeta('og:title')+' '+getMeta('og:url'))}else if(obj.matches('[class^="fb-"], [class^="facebook-"]')){url='https://www.facebook.com/sharer/sharer.php?app_id=257832210900002&kid_directed_site=0&sdk=joey&u='+encodeURIComponent(getMeta('og:url'))+'&display=popup&ref=plugin&src=share_button';w=640;h=624}
355if(url){window.open(url,'popupwindow','scrollbars=yes,width='+w+',height='+h).focus();return!0}
356return!1}
357function submitFormOverlay(form,event){const overlay=document.getElementById('ajax-overlay-content');const ajaxInput=form.querySelector('input[name="ajax-overlay"]');if(ajaxInput?.value&&overlay){event.preventDefault();const formData=new FormData(form);const submitBtn=form.querySelector('input[type="submit"], button[type="submit"]');if(submitBtn){if(submitBtn.name)formData.append(submitBtn.name,submitBtn.value);submitBtn.disabled=!0;const label=submitBtn.tagName==='BUTTON'?'textContent':'value';submitBtn.dataset.originalLabel=submitBtn[label];submitBtn[label]='Submitting…';submitBtn.classList.add('button-submitting')}
358overlay.style.opacity='0.5';if(submitBtn){submitBtn.style.opacity='1'}
359fetch(form.action,{method:'POST',body:new URLSearchParams(formData)}).then(r=>r.text()).then(html=>{const content=document.querySelector('#aa-dialog .aa-dialog-content');if(content){content.innerHTML=html;content.querySelectorAll('script').forEach(old=>{const s=document.createElement('script');s.textContent=old.textContent;old.replaceWith(s)})}}).catch(()=>
359{if(submitBtn){const label=submitBtn.tagName==='BUTTON'?'textContent':'value';submitBtn.disabled=!1;submitBtn[label]=submitBtn.dataset.originalLabel;submitBtn.classList.remove('button-submitting')}
360overlay.style.opacity=''})}}
361function checkEmail(email){if(!email)return!0;const filter=/^[^ @<>]+@[^ @<>]+\.[a-z]{2,}$/i;if(!filter.test(email.trim())){return confirm("You seem to have provided an invalid e-mail address.\nDo you want to send your message anyway?")}
362return!0}
363function registerTooltips(){document.querySelectorAll('.bubble-icon, .more').forEach(trigger=>{if(trigger.classList.contains('bubble-icon')&&trigger.closest('.more')){return}
364const bubble=trigger.nextElementSibling;if(!bubble||!bubble.classList.contains('bubble')){return}
365const wrapper=document.createElement('span');wrapper.className='tooltip-wrapper';trigger.before(wrapper);wrapper.appendChild(trigger);wrapper.appendChild(bubble);AATooltip.registerBubble(wrapper,{delay:bubble.querySelector('a')?500:300})});document.querySelectorAll('a.contact-option').forEach(a=>{a.addEventListener('mouseenter',()=>{AATooltip.show(a,'<a href="/about/contact" style="text-decoration:none;">\u2709 contact me</a>',{position:'center'})});a.addEventListener('mouseleave',()=>{if(AATooltip.isActive(a))AATooltip.hide();})});document.querySelectorAll('a[href*="amazon.com"], a[href*="amzn.to"]').forEach(a=>{if(/(?:amzn\.to)|(?:absoluteanime-20)/.test(a.href)){a.addEventListener('mouseenter',()=>{AATooltip.show(a,'This is an affiliate link. As an Amazon Associate I earn from qualifying purchases.',{position:'center'})});a.addEventListener('mouseleave',()=>{if(AATooltip.isActive(a))AATooltip.hide();})}});const main=document.getElementById('aa_main');if(main){function getPreviewLink(target){const a=target&&target.closest&&target.closest('a[href]');if(!a||!a.closest('.aa_section_content, .ustv-intro')){return null}
366if(a.dataset.preview==='')return a;
366if(a.dataset.preview==='no')return null;const href=a.getAttribute('href');const lastDot=href.lastIndexOf('.');const noExt=lastDot===-1||lastDot<href.lastIndexOf('/');const eligible=!(a.querySelector('img')||a.hasAttribute('onclick')||a.closest('.aa-pagination')||a.matches('.no-preview, .ext, .contact-option, .question, [data-no-preview]')||href.startsWith('#')||href.includes('!')||href.startsWith('mailto:')||(!noExt&&!/\.(htm|html|php)/.test(href))||(href.includes('//')&&!href.includes('absoluteanime.com')))&&a.href.includes('absoluteanime.com')&&a.href.split('#')[0]!==location.href.split('#')[0];a.dataset.preview=eligible?'':'no';return eligible?a:null}
367const previewCache=new Map();main.addEventListener('mouseover',function(e){const link=getPreviewLink(e.target);if(!link||link.closest('.bubble, .tooltip-wrapper, #aa-tooltip')||AATooltip.isActive(link)){return}
368const url=link.pathname+(link.search?link.search+'&':'?')+'preview=1'+(typeof show_adult_content!=='undefined'&&show_adult_content?'&show-nsfw=1':'');if(previewCache.has(url)){AATooltip.show(link,previewCache.get(url),{position:'mouse',event:e});return}
369AATooltip.setActive(link);const ctrl=new AbortController();AATooltip.setAbortController(ctrl);fetch(url,{signal:ctrl.signal}).then(r=>r.text()).then(content=>{if(!content||/^<!DOCTYPE/i.test(content)||/^<(?:html|script)/i.test(content)){return}
370content=content.replace(/\s*<div .*?style='display:none'>[\s\S]+<\/div>\s*/g,'');content=content.replace(/\s*<script[\s\S]+<\/script>\s*/g,'');content=content.replace(/$\s+^/g,'');if(!content){return}
371previewCache.set(url,content);if(AATooltip.isActive(link)){AATooltip.show(link,content,{position:'mouse',event:e})}}).catch(err=>{if(err.name!=='AbortError')console.log('Preview:',err);})});main.addEventListener('mousemove',function(e){AATooltip.track(e)});main.addEventListener('mouseout',function(e){const link=e.target.closest('a[data-preview=""]');if(!link){return}
372const related=e.relatedTarget;if(related&&link.contains(related)){return}
373AATooltip.hideNow()})}}
374function processConfigForm(){if(!document.getElementById('aa_main')){return}
375const html=document.documentElement;const bg_src_dir=path.root+'!bin/skin3/bg-art/blurred/';function syncCheckboxes(name,checked){document.querySelectorAll(`input[name=${name}]`).forEach(el=>el.checked=checked)}
376syncCheckboxes('bg_opaque',getLocal('bg_opaque',!1));syncCheckboxes('bg_art_off',getLocal('bg_art_off',!1));const bgFile=getLocal('bg_art_file','');if(bgFile){document.querySelectorAll(`input[name=bg_art_file][value="${CSS.escape(bgFile)}"]`).forEach(el=>{el.checked=!0})}
377document.getElementById('aa_wrapper').addEventListener('change',function(e){if(e.target.matches('input[name=bg_opaque]')){const opaque=e.target.checked;setLocal('bg_opaque',opaque?'1':'');html.classList.toggle('opaque',opaque);html.classList.toggle('alpha',!opaque);syncCheckboxes('bg_opaque',opaque)}else if(e.target.matches('input[name=bg_art_off]')){const off=e.target.checked;setLocal('bg_art_off',off?'1':'');syncCheckboxes('bg_art_off',off);html.classList.toggle('show-bg-art',!off)}});document.getElementById('aa_main').addEventListener('change',function(e){if(e.target.matches('input[name=bg_art_file]')){const bg_src=e.target.value;setLocal('bg_art_file',bg_src);setLocal('bg_art_off','');if(bg_src==='random'){html.style.removeProperty('--bg-art-url')}else{html.style.setProperty('--bg-art-url',"url('"+bg_src_dir+bg_src+"')")}
378html.classList.add('show-bg-art');syncCheckboxes('bg_art_off',!1)}});document.getElementById('aa_main').addEventListener('click',function(e){const restoreLink=e.target.closest('form.aa-config .restore-defaults a');if(restoreLink){e.preventDefault();syncCheckboxes('bg_opaque',!1);syncCheckboxes('bg_art_off',!1);document.querySelector('input[name=bg_opaque]').dispatchEvent(new Event('change',{bubbles:!0}));document.querySelector('input[name=bg_art_off]').dispatchEvent(new Event('change',{bubbles:!0}));setLocal('bg_art_file','');html.style.removeProperty('--bg-art-url');setDarkModeState('system')}})}
379let _settingDarkMode=!1;function setDarkModeState(mode){if(_settingDarkMode)return;_settingDarkMode=!0;const systemDark=matchMedia('(prefers-color-scheme:dark)').matches;const isDark=mode==='dark'||(mode==='system'&&systemDark);document.documentElement.classList.toggle('dark-mode',isDark);if(mode==='system'){setLocal('dark-mode','')}else{setLocal('dark-mode',mode==='dark'?'1':'0')}
380const titles={light:'Light Mode',system:'Auto Dark Mode (System Preference)',dark:'Dark Mode'};
380document.querySelectorAll('#dark-mode-btn, #dark-mode-btn-mobile').forEach(btn=>{btn.dataset.mode=mode;btn.title=titles[mode];btn.setAttribute('aria-pressed',isDark?'true':'false')});document.querySelectorAll('input[name=dark_mode], input[name=dark_mode_sidebar]').forEach(el=>{if(el.type==='checkbox'){el.checked=isDark}else if(el.type==='radio'){el.checked=el.value===mode}});const disqusThread=document.getElementById('disqus_thread');if(disqusThread){disqusThread.dataset.colorScheme=isDark?'dark':'light';if(typeof DISQUS!=='undefined'){DISQUS.reset({reload:!0})}}
381_settingDarkMode=!1}
382function cycleDarkMode(){const btn=document.getElementById('dark-mode-btn');const current=btn?.dataset.mode||'system';const systemDark=matchMedia('(prefers-color-scheme:dark)').matches;if(current==='system'){setDarkModeState(systemDark?'light':'dark')}else{setDarkModeState('system')}}
383function copyToClipboard(txt){if(navigator.clipboard){navigator.clipboard.writeText(txt)}else{const temp=document.createElement('textarea');document.body.appendChild(temp);temp.value=txt;temp.select();document.execCommand('copy');temp.remove()}}
384function domReady(){const LOCAL_VIDEO_RE=/\.(?:webm|mp4|m4v|ogv|mov|avi|mpe?g)(?:[?#]|$)/i;function isLocalVideoLink(a){if(!a||!a.href)return!1;try{const url=new URL(a.href,document.location.href);return url.hostname===document.location.hostname&&LOCAL_VIDEO_RE.test(url.pathname)}catch(_){return!1}}
385document.body.addEventListener('click',function(e){if(e.ctrlKey||e.metaKey||e.shiftKey||e.button===1)return;const link=e.target.closest('a[data-lightbox], a[rel^="lightbox"]');if(link){e.preventDefault();AALightbox.open(link);return}
386const vidLink=e.target.closest('a[href]');if(vidLink&&!vidLink.hasAttribute('download')&&isLocalVideoLink(vidLink)){e.preventDefault();AALightbox.open(vidLink)}});document.body.addEventListener('click',function(e){const url=e.target.closest('span.dead-link[data-href]')?.dataset.href;if(url&&confirm('This link is marked dead:\n\n'+url+'\n\nTry opening it anyway?')){window.open(url,'_blank','noopener')}});const darkValue=(function(){try{return localStorage.getItem('dark-mode')}catch(_){return null}})();const darkModeState=darkValue==='1'?'dark':darkValue==='0'?'light':'system';setDarkModeState(darkModeState);document.querySelectorAll('#dark-mode-btn, #dark-mode-btn-mobile').forEach(btn=>{btn.addEventListener('click',cycleDarkMode)});document.addEventListener('change',function(e){if(e.target.matches('input[name=dark_mode], input[name=dark_mode_sidebar]')){setDarkModeState(e.target.value)}});registerTooltips();processConfigForm();if(!document.getElementById('section-adult_confirmation')&&document.querySelectorAll("img[class^='warn-'],img[class*=' warn-']").length>0){fetch(path.php+'warn.php?ajax=true').then(r=>r.text()).then(html=>{document.getElementById('aa_main').insertAdjacentHTML('afterbegin',html);document.getElementById('aa_main').querySelectorAll('#section-adult_confirmation script').forEach(old=>{const s=document.createElement('script');s.textContent=old.textContent;old.replaceWith(s)})})}
387function addSocialLinks(){function truncate(text,maxLen){return text.length>maxLen?text.substring(0,maxLen-3)+'...':text}
388document.querySelectorAll('.aa_site_updates dt a').forEach(a=>{const dt=a.closest('dt');const txt=dt.nextElementSibling.textContent.trim();const dateOnly=dt.id.replace(/^update_/,'');const url='https://www.absoluteanime.com/updates?on='+dateOnly+'#'+dt.id;const shares=[{cls:'bsky',label:'bsky',base:'https://bsky.app/intent/compose?text=',maxLen:300},{cls:'tweet',label:'tweet',base:'https://x.com/intent/tweet?text=',maxLen:280},];const links=shares.map(s=>{const post=truncate(txt,s.maxLen-url.length-1)+' '+url;const link=document.createElement('a');link.href=s.base+encodeURIComponent(post);link.className=s.cls;link.textContent=s.label;link.addEventListener('click',function(e){e.preventDefault();socialPopup(this.href)});return link});a.after(...links)});document.querySelectorAll('.aa_site_updates dd').forEach(dd=>{const dtId=dd.previousElementSibling.id;const dateOnly=dtId.replace(/^update_/,'');const append="\n\nhttps://www.absoluteanime.com/updates?on="+dateOnly+"#"+dtId;const txt=dd.textContent.trim();dd.dataset.copyText=(txt+append).trim()});document.querySelectorAll('.aa_site_updates dt a:first-of-type').forEach(a=>{a.addEventListener('click',function(){copyToClipboard(this.closest('dt').nextElementSibling.dataset.copyText);return!1})});document.querySelectorAll('.aa_site_updates dt a.tweet').forEach(a=>{a.addEventListener('click',function(){const txt=decodeURIComponent(this.getAttribute('href').replace(/^.*?text=/,''));copyToClipboard(txt)})})}
389addSocialLinks();const dateRequest=window.location.hash?.match(/^#update_(\d{4}-\d{2}-\d{2})$/)?.[1];if(dateRequest&&!document.getElementById('update_'+dateRequest)){fetch('/updates?'+ne
389w URLSearchParams({date:dateRequest.substring(0,7),ajax:'html-load'})).then(r=>r.text()).then(html=>{if(html){document.querySelector('#aa_main main').innerHTML=html;addSocialLinks()}}).catch(err=>console.log(err))}
390document.body.addEventListener('click',function(event){const formLink=event.target.closest('a[href*="/about/contact"], a[href*="/about/add-anime"], a[href*="/about/add-char"], a[href*="/about/add-hdloader"]');if(formLink&&formLink.host===location.host&&formLink.target!=='_blank'&&!formLink.closest('#aa-dialog')&&!window.matchMedia("(max-width: 767px)").matches){event.preventDefault();openDialog(formLink.href,{'ajax-overlay':1});return}
391const dialogLink=event.target.closest('a.acp-dialog');if(dialogLink){event.preventDefault();openDialogIframe(dialogLink.href);return}
392const rebuildLink=event.target.closest('a.rebuild-thumbs');if(rebuildLink&&!rebuildLink.classList.contains('running')){event.preventDefault();const origText=rebuildLink.textContent;rebuildLink.classList.add('running');rebuildLink.textContent='⏳ Rebuilding…';rebuildLink.style.pointerEvents='none';rebuildLink.style.opacity='0.6';const url=rebuildLink.href+(rebuildLink.href.includes('?')?'&':'?')+'ajax=1';fetch(url).then(r=>r.json()).then(d=>{const total=d.images||0;const built=d.rebuilt?d.rebuilt.length:0;const skipped=d.skipped||0;const fmt=n=>n.toLocaleString();alert(d.error||('Rebuilt '+fmt(built)+' of '+fmt(total)+' thumb(s)'+(skipped?' ('+fmt(skipped)+' already current)':'')))}).catch(err=>alert('Rebuild failed: '+err)).finally(()=>{rebuildLink.classList.remove('running');rebuildLink.textContent=origText;rebuildLink.style.pointerEvents='';rebuildLink.style.opacity=''})}});const scrollToTop=document.querySelector('.scrollToTop');if(scrollToTop){window.addEventListener('scroll',function(){scrollToTop.style.display=window.scrollY>100?'':'none'});scrollToTop.addEventListener('click',function(e){e.preventDefault();const reduceMotion=window.matchMedia('(prefers-reduced-motion: reduce)').matches;window.scrollTo({top:0,behavior:reduceMotion?'auto':'smooth'})})}
393let discordBtn=document.getElementById('discord-chat-btn');if(!discordBtn&&document.getElementById('aa_main')){discordBtn=document.createElement('img');Object.assign(discordBtn,{src:'/!bin/discord-84x84.webp',id:'discord-chat-btn',alt:'',title:'Click to Load'});document.body.appendChild(discordBtn)}
394if(discordBtn){discordBtn.addEventListener('click',function(){this.remove();const script=document.createElement('script');script.src='https://cdn.jsdelivr.net/npm/@widgetbot/crate@3';script.onload=function(){const crate=new Crate({server:'662398180255596544',channel:'662398197817409556',shard:'https://e.widgetbot.io',});crate.toggle(!0)};document.head.appendChild(script)})}
395const sidebar=document.getElementById('aa_sidebar');const filePath=sidebar?.dataset.filePath;if(filePath&&!sidebar.querySelector('.local-only')){const safeFilePath=filePath.split('/').map(encodeURIComponent).join('/');fetch(`/!bin/page.php?ajax=json-is-registered&filePath=${safeFilePath}`).then(r=>r.json()).then(result=>{if(result.is_founder&&result.admin_html){const anchor=sidebar.querySelector('.aa_social_icons')||sidebar.querySelector('.aa_nav-config');anchor?.insertAdjacentHTML('beforebegin',result.admin_html)}}).catch(err=>console.log('json-is-registered error:',err))}}
396domReady();(function(){const supportsIO="IntersectionObserver" in window;function readInitialView(){const hashView=new URLSearchParams(location.hash.slice(1)).get("view");const queryView=new URLSearchParams(location.search).get("view");let v=hashView||queryView;if(!v){try{v=localStorage.getItem("listView")}catch(_){v=null}}
397return v==="portrait"?"portrait":"list"}
398const initialView=readInitialView();document.body.classList.add(initialView==="portrait"?"view-portrait":"view-list");function urlFor(el){if(el.dataset.bg){return el.dataset.bg}
399return document.body.classList.contains("view-portrait")?el.dataset.bgPortrait:el.dataset.bgList}
400function promote(el){const url=urlFor(el);if(url){el.style.backgroundImage="url('"+url+"')"}}
401const bgObserver=supportsIO?new IntersectionObserver(function(entries){entries.forEac
401h(function(entry){if(!entry.isIntersecting){return}
402const el=entry.target;promote(el);if(el.dataset.bg){delete el.dataset.bg}
403bgObserver.unobserve(el)})},{rootMargin:"300px 0px"}):null;function observeThumbs(root){const targets=root.querySelectorAll("[data-bg], [data-bg-list]");if(!supportsIO){targets.forEach(function(el){promote(el);if(el.dataset.bg){delete el.dataset.bg}});return}
404targets.forEach(function(el){bgObserver.observe(el)})}
405observeThumbs(document);function setView(view){const isPortrait=view==="portrait";document.body.classList.toggle("view-portrait",isPortrait);document.body.classList.toggle("view-list",!isPortrait);document.querySelectorAll("table.aa_section_grid a[data-bg-list]").forEach(function(el){if(el.style.backgroundImage){promote(el)}});try{localStorage.setItem("listView",view)}catch(_){}}
406const viewToggleBtn=document.getElementById("view-toggle");if(viewToggleBtn){viewToggleBtn.addEventListener("click",function(){const next=document.body.classList.contains("view-portrait")?"list":"portrait";setView(next)})}
407const table=document.querySelector("table.aa_section_grid");if(!table){return}
408const blocks=Array.from(table.querySelectorAll("tbody[data-block], template[data-block]"));let loadedBlocks=1;function loadBlock(node){if(node.tagName!=="TEMPLATE"){node.classList.add("loaded");return node}
409const tbody=document.createElement("tbody");tbody.dataset.block=node.dataset.block;tbody.classList.add("loaded");tbody.appendChild(node.content.cloneNode(!0));node.parentNode.insertBefore(tbody,node);node.parentNode.removeChild(node);observeThumbs(tbody);return tbody}
410window.showAllBlocks=function(){for(let i=loadedBlocks;i<blocks.length;i++){blocks[i]=loadBlock(blocks[i])}
411loadedBlocks=blocks.length};if(blocks.length>1){window.addEventListener("scroll",function(){if(loadedBlocks>=blocks.length){return}
412if(table.getBoundingClientRect().bottom-window.innerHeight<400){blocks[loadedBlocks]=loadBlock(blocks[loadedBlocks]);loadedBlocks++}});let totalRows=table.querySelectorAll("tbody[data-block] tr").length;blocks.forEach(function(b){if(b.tagName==="TEMPLATE"){totalRows+=b.content.querySelectorAll("tr").length}});if(totalRows<=5000){const schedule=window.requestIdleCallback||((cb)=>setTimeout(()=>cb(null),50));const promoteRest=function(deadline){let budget=3;while(loadedBlocks<blocks.length&&budget-->0){blocks[loadedBlocks]=loadBlock(blocks[loadedBlocks]);loadedBlocks++;if(deadline&&deadline.timeRemaining&&deadline.timeRemaining()<5){break}}
413if(loadedBlocks<blocks.length){schedule(promoteRest)}};schedule(promoteRest)}}})();function initListFilter(){const form=document.querySelector("form.filter");if(!form){return}
414const alphaJump=document.getElementById("alpha-jump");if(alphaJump){alphaJump.addEventListener("change",function(){if(alphaJump.value){location.href=alphaJump.value}})}
415const filterToggle=document.getElementById("filter-toggle");if(filterToggle){filterToggle.addEventListener("click",function(){const expanded=form.classList.toggle("expanded");filterToggle.setAttribute("aria-expanded",String(expanded));filterToggle.setAttribute("title",expanded?"Hide filter options":"Show filter options")})}
416const input=document.getElementById("list-filter-text");if(!input){return}
417const textpos=form.querySelector("[name=textpos]");const langSelect=form.querySelector("[name=lang]");const genreSelect=form.querySelector("[name=genre]");const formatSelect=form.querySelector("[name=format]");const countEl=document.getElementById("filter-count");const pageLetter=(input.dataset.page||"").toLowerCase();const isNumberPage=pageLetter==="0-9"||pageLetter==="0";const defaults={lang:"uj",genre:"any",textpos:"start"};let userChangedTextpos=!1;let hasFiltered=!1;form.addEventListener("submit",function(e){e.preventDefault()});if(formatSelect){formatSelect.addEventListener("change",function(){const url=new URL(location.href);if(formatSelect.value==="chars"){url.searchParams.delete("format")}else{url.searchParams.set("format",formatSelect.value)}
418location.href=url.pathname+url.search+url.hash})}
419input.addEventListener("input",function(){if(userChangedTextpos||isNumberPage){return}
420const val=input.value.toLowerCase();if(val&&val[0]!==pageLetter){textpos.value="any"}else{textpos.value="start"}});const wrapper=document.createElement("span");wrapper.style.cssText="position:relative;display:inline-block;vertical-align:middle;";input.parentNode.insertBefore(wrapper,input);wrapper.appendChild(input);const clearBtn=document.createElement("span");clearBtn.textContent="×";clearBtn.title="Clear filter";clearBtn.style.cssText="position:absolute;right:3px;top:50%;transform:translateY(-50%);cursor:pointer;font-size:11px;color:#FFF;background:#C00;border-radius:50%;width:14px;
420height:14px;line-height:14px;text-align:center;display:none;";clearBtn.addEventListener("click",function(){input.value="";clearBtn.style.display="none";updateHashAndFilter();input.focus()});input.addEventListener("input",function(){clearBtn.style.display=input.value?"":"none"});input.style.paddingRight="18px";wrapper.appendChild(clearBtn);function updateHash(){const params=new URLSearchParams();if(langSelect&&langSelect.value!==defaults.lang){params.set("lang",langSelect.value)}
421if(genreSelect&&genreSelect.value.toLowerCase()!==defaults.genre){params.set("genre",genreSelect.value)}
422if(textpos.value!==defaults.textpos){params.set("textpos",textpos.value)}
423if(input.value){params.set("text",input.value)}
424const hash=params.toString();history.replaceState(null,"",hash?"#"+hash:location.pathname+location.search)}
425function readHash(){const hash=new URLSearchParams(location.hash.slice(1));const query=new URLSearchParams(location.search);const get=(key)=>hash.get(key)||query.get(key);if(langSelect){langSelect.value=get("lang")||defaults.lang}
426if(genreSelect){genreSelect.value=get("genre")||defaults.genre}
427textpos.value=get("textpos")||defaults.textpos;input.value=get("text")||"";clearBtn.style.display=input.value?"":"none";userChangedTextpos=!!(hash.get("textpos")||query.get("textpos"))}
428function filterRows(){const query=input.value.toLowerCase();const pos=textpos.value;const langVal=langSelect?langSelect.value:"";const genreVal=genreSelect?genreSelect.value.toLowerCase():"";const queryGenre=(new URLSearchParams(location.search).get("genre")||"").toLowerCase()||defaults.genre;const needsAllBlocks=query||(langVal&&langVal!=="uj")||(genreVal!==queryGenre);if(needsAllBlocks&&window.showAllBlocks){window.showAllBlocks()}
429const rows=document.querySelectorAll("table.aa_section_grid tr:not(.header)");const totalCount=rows.length;if(!needsAllBlocks&&!hasFiltered){countEl.textContent="Showing "+totalCount.toLocaleString()+" of "+totalCount.toLocaleString();return}
430if(needsAllBlocks){hasFiltered=!0}
431let visibleCount=0;let stripe=0;rows.forEach(function(row){let show=!0;if(show&&langVal&&langVal!=="uj"){const rowLang=row.dataset.lang||"";if(!rowLang.includes(langVal)){show=!1}}
432if(show&&genreVal&&genreVal!=="any"){const rowGenre=row.dataset.genre||"";if(!rowGenre.includes(genreVal)){show=!1}}
433if(show&&query){const text=row.textContent.toLowerCase();const match=pos==="start"?text.trimStart().startsWith(query):pos==="end"?text.trimEnd().endsWith(query):text.includes(query);if(!match){show=!1}}
434row.style.display=show?"":"none";if(show){const enSpan=row.querySelector(".anime-en");const jpSpan=row.querySelector(".anime-jp");const sepSpan=row.querySelector(".anime-sep");if(enSpan&&jpSpan){const showEn=langVal!=="j";const showJp=langVal!=="u";enSpan.style.display=showEn?"":"none";jpSpan.style.display=showJp?"":"none";if(sepSpan){sepSpan.style.display=(showEn&&showJp)?"":"none"}}}
435if(show){stripe++;row.className=stripe%2===0?"even":"odd";visibleCount++}});countEl.textContent="Showing "+visibleCount.toLocaleString()+" of "+totalCount.toLocaleString()}
436function updateHashAndFilter(){updateHash();filterRows()}
437input.addEventListener("input",updateHashAndFilter);textpos.addEventListener("change",function(){userChangedTextpos=!0;updateHashAndFilter()});if(langSelect){langSelect.addEventListener("change",updateHashAndFilter)}
438if(genreSelect){genreSelect.addEventListener("change",updateHashAndFilter)}
439window.addEventListener("hashchange",function(){readHash();filterRows()});readHash();filterRows()}
440if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",initListFilter)}else{initListFilter()}(function(){if(!document.querySelector("a.anime-link")){return}
441var pop=null;var anchorEl=null;function build(){var el=document.createElement("div");el.className="anime-popover";el.setAttribute("role","menu");el.hidden=!0;el.innerHTML='<div class="anime-popover-head">'+'<span class="anime-popover-title"></span>'+'<button type="button" class="anime-popover-close" aria-label="Close">×</button>'+'</div>'+'<a class="anime-popover-item" data-act="visit" role="menuitem">Visit Anime</a>
441'+'<a class="anime-popover-item" data-act="filter" role="menuitem">List Characters</a>';el.addEventListener("click",function(e){if(e.target.closest(".anime-popover-head")){close();return}
442if(e.target.closest(".anime-popover-item")){setTimeout(close,0)}});document.body.appendChild(el);return el}
443function close(){if(!pop||pop.hidden){return}
444pop.hidden=!0;anchorEl=null;document.removeEventListener("keydown",onKey,!0)}
445function onKey(e){if(e.key==="Escape"){var returnTo=anchorEl;close();if(returnTo){returnTo.focus({preventScroll:!0})}}}
446function place(link){var r=link.getBoundingClientRect();var doc=document.documentElement;var pw=pop.offsetWidth,ph=pop.offsetHeight;var left=Math.max(8,Math.min(r.left,doc.clientWidth-pw-8));var top=r.bottom+4;if(top+ph>doc.clientHeight-4&&r.top-ph-4>0){top=r.top-ph-4}
447pop.style.left=left+"px";pop.style.top=top+"px"}
448function open(link){if(!pop){pop=build()}
449anchorEl=link;pop.querySelector(".anime-popover-title").textContent=link.textContent.trim();var visit=pop.querySelector('[data-act="visit"]');visit.href=link.href;pop.querySelector('[data-act="filter"]').href=link.dataset.filterHref;var thumb=link.dataset.thumb;if(thumb){visit.style.setProperty("--anime-thumb",'url("'+thumb+'")');visit.classList.remove("is-empty")}else{visit.style.removeProperty("--anime-thumb");visit.classList.add("is-empty")}
450pop.hidden=!1;place(link);document.addEventListener("keydown",onKey,!0);visit.focus({preventScroll:!0})}
451document.addEventListener("click",function(e){var link=e.target.closest?e.target.closest("a.anime-link"):null;if(link){if(e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey){return}
452if(document.body.classList.contains("view-portrait")){return}
453e.preventDefault();if(anchorEl===link&&pop&&!pop.hidden){close();return}
454open(link);return}
455if(pop&&!pop.hidden&&!e.target.closest(".anime-popover")){close()}});window.addEventListener("resize",close);window.addEventListener("scroll",close,!0)})();(function(){'use strict';var DEBOUNCE_MS=200;var MIN_QUERY=1;var endpoint='/!index/typeahead.php';var navbar=document.querySelector('#navbar ul.primary');if(!navbar)return;var timer=null;var inflight=null;var lastResults=new WeakMap();var activeIndex=new WeakMap();function getLi(el){return el&&el.closest?el.closest('#navbar ul.primary > li'):null}
456function getResults(li){return li&&li.querySelector('.navbar-search-results')}
457function getType(input,li){return input.dataset.searchType||(li&&li.classList.contains('anime')?'anime':'chars')}
458function setActiveIndex(input,results,idx){var lis=results.querySelectorAll('li[role="option"]');if(!lis.length){activeIndex.delete(input);return}
459if(idx<0)idx=lis.length-1;if(idx>=lis.length)idx=0;activeIndex.set(input,idx);lis.forEach(function(li,i){li.classList.toggle('navbar-search-active',i===idx)});var active=lis[idx];if(active&&active.scrollIntoView){active.scrollIntoView({block:'nearest'})}}
460navbar.addEventListener('input',function(e){var input=e.target.closest('.navbar-search-input');if(!input)return;clearTimeout(timer);var li=getLi(input);var results=getResults(li);if(!results)return;var q=input.value.trim();if(q.length<MIN_QUERY){if(inflight)inflight.abort();results.innerHTML='';lastResults.delete(input);activeIndex.delete(input);return}
461var type=getType(input,li);timer=setTimeout(function(){runQuery(input,type,q,results)},DEBOUNCE_MS)});navbar.addEventListener('keydown',function(e){var input=e.target.closest('.navbar-search-input');if(!input)return;if(e.key==='Escape'){input.blur();var liEsc=getLi(input);if(liEsc)liEsc.classList.remove('force-open');return}
462var li=getLi(input);var results=getResults(li);if((e.key==='ArrowDown'||e.key==='ArrowUp')&&results){var items=lastResults.get(input);if(items&&items.length){e.preventDefault();var cur=activeIndex.get(input);if(cur===undefined)cur=0;setActiveIndex(input,results,cur+(e.key==='ArrowDown'?1:-1))}
463return}
464if(e.key!=='Enter')return;e.preventDefault();var resultsItems=lastResults.get(input);if(resultsItems&&resultsItems.length){var idx=activeIndex.get(input);
464if(idx===undefined||idx<0||idx>=resultsItems.length)idx=0;if(resultsItems[idx]&&resultsItems[idx].href){window.location.href=resultsItems[idx].href;return}}
465var type=getType(input,li);var q=input.value.trim();if(!q)return;runQuery(input,type,q,results,function(items){if(items&&items.length&&items[0].href){window.location.href=items[0].href}else{window.location.href='/'+type+'/'}})});navbar.addEventListener('focusin',function(e){var input=e.target.closest('.navbar-search-input');if(!input)return;var li=getLi(input);if(li)li.classList.add('force-open');});navbar.addEventListener('focusout',function(e){var input=e.target.closest('.navbar-search-input');if(!input)return;var li=getLi(input);if(!li)return;setTimeout(function(){if(!li.contains(document.activeElement)){li.classList.remove('force-open')}},0)});navbar.addEventListener('click',function(e){if(e.target.closest('.navbar-search-results a')){var li=getLi(e.target);if(li)li.classList.remove('force-open');}});document.addEventListener('click',function(e){if(navbar.contains(e.target))return;navbar.querySelectorAll('.force-open').forEach(function(li){li.classList.remove('force-open')})});navbar.addEventListener('mouseover',function(e){var hoveredLi=e.target.closest('#navbar ul.primary > li');if(!hoveredLi)return;navbar.querySelectorAll(':scope > li.force-open').forEach(function(li){if(li===hoveredLi)return;li.classList.remove('force-open');var input=li.querySelector('.navbar-search-input');if(input&&document.activeElement===input)input.blur();})});function runQuery(input,type,q,results,done){if(inflight)inflight.abort();inflight=(typeof AbortController!=='undefined')?new AbortController():null;var url=endpoint+'?type='+encodeURIComponent(type)+'&q='+encodeURIComponent(q)+'&limit=50';fetch(url,inflight?{signal:inflight.signal}:undefined).then(function(r){return r.ok?r.json():Promise.reject(r.status)}).then(function(data){var items=(data&&data.results)||[];lastResults.set(input,items);if(results){render(results,items);setActiveIndex(input,results,0)}
466if(done)done(items);}).catch(function(err){if(err&&err.name==='AbortError')return;if(results)results.innerHTML='<li class="navbar-search-error">Search failed.</li>';if(done)done(null);})}
467function render(results,items){if(!items||!items.length){results.innerHTML='<li class="navbar-search-empty">No matches.</li>';return}
468var html='';for(var i=0;i<items.length;i++){var it=items[i];var ctx=it.context?'<span class="navbar-search-context">'+esc(it.context)+'</span>':'';var bg=it.thumb?' style="background-image:url('+esc(it.thumb)+')"':'';html+='<li role="option"><a href="'+esc(it.href)+'"'+bg+'>'+'<span class="navbar-search-name">'+esc(it.name)+'</span>'+ctx+'</a></li>'}
469results.innerHTML=html}
470function esc(s){return String(s).replace(/[&<>"']/g,function(c){return{'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'}[c]})}})();(function(){'use strict';const input=document.querySelector('.gallery-search');const resultsEl=document.querySelector('.gallery-search-results');if(!input||!resultsEl)return;const grid=document.querySelector('.aa-gallery');const wrap=document.createElement('span');wrap.style.cssText='position:relative;display:block;max-width:480px;margin:0.75em auto 1.5em;';input.parentNode.insertBefore(wrap,input);wrap.appendChild(input);input.style.width='100%';input.style.maxWidth='none';input.style.margin='0';input.style.paddingRight='1.6em';const clearBtn=document.createElement('span');clearBtn.textContent='×';clearBtn.title='Clear search';clearBtn.style.cssText='position:absolute;right:6px;top:50%;transform:translateY(-50%);cursor:pointer;font-size:11px;color:#FFF;background:#C00;border-radius:50%;width:14px;height:14px;line-height:14px;text-align:center;display:none;';clearBtn.addEventListener('click',()=>{input.value='';clearBtn.style.display='none';runFilter();input.focus()});wrap.appendChild(clearBtn);let index=null;let loading=null;function ensureIndex(){if(index)return Promise.resolve(index);if(loading)return loading;loading=fetch('/gallery?index=json',{credentials:'same-origin'}).then(r=>r.ok?r.json():Promise.reject(r.status)).then(data=>{index=(data&&data.results)||[];return index}).catch(()=>{loading=null;return[]});return loading}
471const ACCENT_RE=/[À-ɏ]/g;const ACCENT_MAP=(()=>{const m={};'àáâãäåāăą'.split('').forEach(c=>m[c]='a');'èéêëēĕėęě'.split('').forEach(c=>m[c]='e');'ìíîïīĭį'.split('').forEach(c=>m[c]='i');
471'òóôõöōŏőø'.split('').forEach(c=>m[c]='o');'ùúûüūŭůűų'.split('').forEach(c=>m[c]='u');'ýÿŷ'.split('').forEach(c=>m[c]='y');'ñńņň'.split('').forEach(c=>m[c]='n');'çćĉċč'.split('').forEach(c=>m[c]='c');return m})();function normalize(s){return String(s).toLowerCase().replace(ACCENT_RE,c=>ACCENT_MAP[c]||c).replace(/[^a-z0-9]+/g,' ').trim()}
472function setOriginalViewHidden(hidden){if(grid)grid.hidden=hidden;resultsEl.hidden=!hidden}
473function render(matches){if(!matches.length){resultsEl.innerHTML='<li class="gallery-search-empty">No matching galleries.</li>';return}
474const LIMIT=120;const shown=matches.slice(0,LIMIT);const overflow=matches.length-shown.length;let html='';for(const m of shown){const thumb=m.thumb?' style="background-image:url(\''+esc(m.thumb)+'\')"':'';html+='<li><a href="'+esc(m.href)+'">'+'<b class="bg"'+thumb+'></b>'+'<span class="gallery-search-name">'+esc(m.name)+'</span>'+'<span class="gallery-search-count">×'+(m.count||0)+'</span>'+'</a></li>'}
475if(overflow>0){html+='<li class="gallery-search-more">+'+overflow+' more — refine your search to see them.</li>'}
476resultsEl.innerHTML=html}
477function esc(s){return String(s).replace(/[&<>"']/g,c=>({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'}[c]))}
478function runFilter(){const qRaw=input.value;const q=normalize(qRaw);if(q===''){setOriginalViewHidden(!1);resultsEl.innerHTML='';return}
479ensureIndex().then(items=>{const startsWith=[];const contains=[];for(const it of items){const n=normalize(it.name);const pos=n.indexOf(q);if(pos===0)startsWith.push(it);else if(pos>0)contains.push(it);}
480startsWith.sort((a,b)=>a.name.localeCompare(b.name));contains.sort((a,b)=>a.name.localeCompare(b.name));render(startsWith.concat(contains));setOriginalViewHidden(!0)})}
481input.addEventListener('focus',ensureIndex,{once:!0});let debounce=null;input.addEventListener('input',()=>{clearTimeout(debounce);clearBtn.style.display=input.value?'':'none';debounce=setTimeout(runFilter,120)});input.addEventListener('keydown',e=>{if(e.key==='Escape'){input.value='';clearBtn.style.display='none';runFilter()}})})();function loadSections(ajaxUrl){document.querySelectorAll('#aa_main section').forEach(s=>{s.insertAdjacentHTML('afterbegin','<div class="loading-section"></div>')});fetch(ajaxUrl).then(r=>r.text()).then(function(data){const updateUrl=function(url,prependPath){if(url.indexOf('mailto:')===0||url.indexOf('://')>=0||url.indexOf('/')===0||url.indexOf('#')===0){return url}
482const lastSlash=prependPath.lastIndexOf('/');if(lastSlash>0&&lastSlash!==prependPath.length-1){prependPath=prependPath.substr(0,prependPath.lastIndexOf('/')+1)}
483return prependPath+url}
484data=data.replace(/(<a[ \t]+.*?href=")([^"]+)("[^>]*>)/g,function(match,sm1,sm2,sm3){return sm1+updateUrl(sm2,ajaxUrl)+sm3});data=data.replace(/(<img[ \t]+.*?src=")([^"]+)("[^>]*>)/g,function(match,sm1,sm2,sm3){return sm1+updateUrl(sm2,ajaxUrl)+sm3});data=data.replace(/(<iframe[ \t]+.*?src=")([^"]+)("[^>]*>.*?<\/iframe>)/g,function(match,sm1,sm2,sm3){return sm1+updateUrl(sm2,ajaxUrl)+sm3});if(data.indexOf('<html')===0||data.indexOf('<!DOCTYPE')===0){data=data.replace(/^\s*<(?:html|!DOCTYPE)[^>]*>[^]*?<body[^>]*>/i,'');data=data.replace(/<\/body>[^]*?<\/html>\s*$/i,'')}
485if(data.indexOf('<section')!==0){data='<section>'+data+'</section>'}
486document.querySelectorAll('#aa_main section').forEach(s=>s.remove());document.getElementById('aa_main').insertAdjacentHTML('beforeend',data);window.scrollTo(0,0);const body=document.body;const origClass=body.dataset.origClass;if(origClass){body.className=origClass}
487const headTitle=document.querySelector('head title');const origTitle=headTitle.dataset.origTitle;if(origTitle){document.title=origTitle}else{headTitle.dataset.origTitle=document.title}
488const sectionWithClass=document.querySelector('#aa_main section[data-body-class]');if(sectionWithClass){body.dataset.origClass=body.className;body.classList.add(sectionWithClass.dataset.bodyClass)}
489const sectionWithTitle=document.querySelector('#aa_main section[data-page-title]');if(sectionWithTitle){document.title=sectionWithTitle.dataset.pageTitle+' \u2022 '+document.title}
490domReady();if(typeof show_adult_content=='undefined'||!show_adult_content){const adultImgs=[...document.querySelectorAll('img[class*=warn]')].filter(img=>{const s=getComputedStyle(img);return s.visibility==='hidden'||s.display==='none'});
490adultImgs.forEach(img=>{if(img.dataset.realSrc&&img.dataset.realSrc!==img.src){return}
491img.dataset.realSrc=img.src;img.src='/!bin/null.gif'});setTimeout(function(){adultImgs.forEach(img=>{Object.assign(img.style,{opacity:'0',display:'',visibility:'visible',transition:'opacity 400ms'});requestAnimationFrame(()=>{img.style.opacity='1'});img.classList.add('aa_adult_img_alt')})},500)}
492if(history.replaceState){const current_url=window.location.href;const desired_url=ajaxUrl.split('?')[0];history.replaceState({},"",desired_url);history.replaceState({},"",current_url)}})}
493function createElement(html){const t=document.createElement('template');t.innerHTML=html.trim();return t.content.firstElementChild}
494function loadHtml(el,url,callback){fetch(url).then(r=>r.text()).then(html=>{el.innerHTML=html;if(callback)callback.call(el,html,'success');}).catch(()=>{if(callback)callback.call(el,'','error');})}
495function animateProp(el,props,duration){const names=Object.keys(props).map(p=>p.replace(/([A-Z])/g,'-$1').toLowerCase());el.style.transition=names.map(p=>`${p} ${duration}ms`).join(', ');requestAnimationFrame(()=>{for(const[k,v]of Object.entries(props)){el.style[k]=typeof v==='number'?v+'px':v}});el.addEventListener('transitionend',function handler(){el.style.transition='';el.removeEventListener('transitionend',handler)})}
496const fileExplorerSidebar=function executeFileExplorerSidebar(){const self=this;this.root=path.root;this.fesb=createElement('<div id="fesb" class="fileexplorer" style="width:var(--fesb-dragbar-w)"></div>');document.getElementById('aa_wrapper').before(this.fesb);this.outerBar=createElement('<div class="outer-dragbar"></div>');this.folderArea=createElement('<div id="fesb-folders"></div>');this.innerBar=createElement('<div class="inner-dragbar" style="height:var(--fesb-dragbar-w);position:absolute;left:0;right:var(--fesb-dragbar-w);cursor:row-resize"></div>');this.fileArea=createElement('<div id="fesb-files"></div>');this.fesb.append(this.outerBar,createElement('<div id="fesb-toggle">&#128194;</div>'),this.folderArea,this.innerBar,this.fileArea);this.closeAtW=50;const fesbCS=getComputedStyle(document.documentElement);this.closedW=parseFloat(fesbCS.getPropertyValue('--fesb-dragbar-w'))||4;this.defaultW=parseFloat(fesbCS.getPropertyValue('--fesb-default-w'))||200;this.speed=200;this.minDragY=64;this.leavesSep='|';this.showAdult=typeof admin!=='undefined'&&admin.showAdult;this.initialW=getLocal('fileExplorer-width',self.defaultW);this.foldersScroll=getLocal('fileExplorer-foldersScrollTop',0);this.filesScroll=getLocal('fileExplorer-filesScrollTop',0);this.splitY=getLocal('fileExplorer-splitY',self.innerBar.getBoundingClientRect().top);this._savedW=self.initialW;this.applySearchFilter=function(searchText=null){const replaceRegEx=/[_-]/g;const links=document.querySelectorAll('ul.main-file-list li a');const search=self.folderArea.querySelector('form.filter input[name="search"]');if(searchText===null){searchText=search?search.value:''}
497searchText=searchText.toLowerCase().replace(replaceRegEx,' ').trim();if(searchText===""){links.forEach(a=>{a.parentElement.style.display=''});if(search){search.value='';search.setAttribute('value','')}
498return}
499links.forEach(a=>{const text=a.textContent.toLowerCase().replace(replaceRegEx,' ');if(text.indexOf(searchText)>-1){let p=a.closest('li');while(p){p.style.display='';p=p.parentElement.closest('li')}}else{a.parentElement.style.display='none'}})};this.folderArea.addEventListener('input',function(e){const input=e.target.closest('form.filter input[name="search"]');if(input)self.applySearchFilter(input.value);});this.folderArea.addEventListener('reset',function(e){if(e.target.closest('form.filter'))self.applySearchFilter('');});this.limitVal=function(val,min,max){return val<min?min:(val>max?max:val)}
500this.limitFileExplorerW=function(w){return self.limitVal(w,self.closedW,window.innerWidth*0.8)}
501this.isFileExplorerClosed=function(){return self.fesb.offsetWidth<=self.closedW}
502this.setOuterDragbar=function(w,animate,save){let newW=self.limitFileExplorerW(w);save=typeof save!=='undefined'?save:!0;if(newW>self.closeAtW){if(save){setLocal('fileExplorer-width',newW);setLocal('fileExplorer-closed',!1);self.fesb.classList.add('opened');self.fesb.classList.remove('closed')}
503if(self.folderArea.textContent===''){self.folderArea.classList.add('loading');loadHtml(self.folderArea,self.root+"!index/frame-dirs.ajax.php",self.folderListLoaded)}
504if(self.fileArea.textContent===''){self.fileArea.classList.add('loading');loadHtml(self.fileArea,self.root+"!index/frame-files.ajax.php"+(self.showAdult?'?showAdult=1':''),self.fileListLoaded)}}else{newW=self.closedW;if(save){setLocal('fileExplorer-closed',!0);self.fesb.classList.add('closed');self.fesb.classList.remove('opened')}}
505if(animate){animateProp(self.fesb,{width:newW},self.speed);document.querySelectorAll('.fesb-adjustment').forEach(el=>{animateProp(el,{marginLeft:newW},self.speed)})}else{self.fesb.style.width=newW+'px';document.querySelectorAll('.fesb-adjustment').forEach(el=>{el.style.marginLeft=newW+'px'})}}
506this.openFileExplorer=function(animate){setLocal('fileExplorer-closed',!1);self.fesb.classList.add('opened');self.fesb.classList.remove('closed');if(this.isFileExplorerClosed()){let w=self._savedW;w=(w<=self.closedW)?self.defaultW:w;self.setOuterDragbar(w,animate)}}
507this.closeFileExplorer=function(animate){setLocal('fileExplorer-closed',!0);self.fesb.classList.add('closed');self.fesb.classList.remove('opened');if(!self.isFileExplorerClosed()){self._savedW=self.fesb.offsetWidth;self.setOuterDragbar(self.closedW,animate,!1)}}
508this.setInnerDragbar=function(y){const newY=self.limitVal(y,self.minDragY,window.innerHeight-self.minDragY);if(newY!==self.minDragY){setLocal('fileExplorer-splitY',newY)}
509self.innerBar.style.top=newY+'px';self.folderArea.style.bottom=(self.fesb.offsetHeight-newY-2)+'px';self.fileArea.style.top=(newY+self.innerBar.offsetHeight)+'px'}
510this.folderListLoaded=function(response,status){self.folderArea.classList.remove('loading');if(status==='success'){const leavesStr=getLocal('fileExplorer-openedLeaves','');const leavesArr=leavesStr.split(self.leavesSep);for(let i=0;i<leavesArr.length;i++){const a=self.folderArea.querySelector('a[href="'+leavesArr[i]+'"]');if(a){const em=a.previousElementSibling;if(em&&em.tagName==='EM')em.innerHTML='\u2013';const ul=a.nextElementSibling;if(ul&&ul.tagName==='UL')ul.style.display=''}}
511self.folderArea.scrollTop=self.foldersScroll;self.applySearchFilter()}}
512this.fileListLoaded=function(response,status){self.fileArea.classList.remove('loading');if(status==='success'){setLocal('fileExplorer-filesScrollTop',0);self.fileArea.scrollTop=self.filesScroll;self.fileArea.querySelectorAll('li.imgFile a').forEach(a=>{a.classList.add('cboxElement');a.setAttribute('data-lightbox','fesb-files');a.setAttribute('target','_blank')});if(self.fileArea.dataset.doflash){delete self.fileArea.dataset.doflash;Object.assign(self.fileArea.style,{transition:'opacity 100ms',opacity:'0.3'});setTimeout(()=>{self.fileArea.style.opacity='1';self.fileArea.addEventListener('transitionend',function handler(){self.fileArea.style.transition='';self.fileArea.removeEventListener('transitionend',handler)})},100)}
513if(typeof self.afterFileListLoaded==='function'){self.afterFileListLoaded()}}}
514this.loadFolder=function(dir){const query="?ajax=true&dir="+encodeURIComponent(dir)+(self.showAdult?'&showAdult=1':'');self.fileArea.classList.add('loading');self.fileArea.dataset.dir=dir;self.fileArea.dataset.doflash='true';loadHtml(self.fileArea,self.root+"!index/frame-files.ajax.php"+query,self.fileListLoaded)}
515this.init=function(){self.setInnerDragbar(self.splitY);if(getLocal('fileExplorer-closed',!0)){self.closeFileExplorer(!1)}else{self.openFileExplorer(!1)}
516self.fesb.addEventListener('change',function(e){if(e.target.closest('form.filter select')){e.target.closest('form').dispatchEvent(new Event('submit',{bubbles:!0,cancelable:!0}))}});self.fesb.addEventListener('submit',function(e){const form=e.target.closest('form.filter');if(!form){return}
517e.preventDefault();const filter=form.querySelector('select[name="filter"]').value;const query='?ajax=true&filter='+filter+'&search='+encodeURIComponent(form.querySelector('input[name="search"]').value);self.folderArea.classList.add('loading');loadHtml(self.folderArea,self.root+"!index/frame-dirs.ajax.php"+query,self.folderListLoaded)});self.folderArea.addEventListener('click',function(e){const link=e.target.closest('li a[href]');if(link){e.preventDefault();self.loadFolder(link.getAttribute('href'));return}
518const em=e.target.closest('li > em');if(em){e.preventDefault();const ul=[...em.parentElement.children].find(c=>c.tagName==='UL');if(ul){const hidden=getComputedStyle(ul).display==='none';ul.style.display=hidden?'block':'none';em.innerHTML=hidden?'\u2013':'+';const leavesStr=getLocal('fileExplorer-openedLeaves','');const leavesArr=leavesStr?leavesStr.split(self.leavesSep):[];const a=em.nextElementSibling;const thisNode=(a&&a.getAttribute('href'))?a.getAttribute('href').trim():'';const nodeIdx=leavesArr.indexOf(thisNode);
518if(!hidden){if(nodeIdx>=0){leavesArr.splice(nodeIdx,1);setLocal('fileExplorer-openedLeaves',leavesArr.join(self.leavesSep))}}else{if(nodeIdx===-1){leavesArr.push(thisNode);setLocal('fileExplorer-openedLeaves',leavesArr.join(self.leavesSep))}}}}});self.fileArea.addEventListener('click',function(e){const fileHead=e.target.closest('div.fileHead');if(fileHead){e.preventDefault();const emEl=fileHead.querySelector('em');const ul=fileHead.nextElementSibling;if(ul&&ul.tagName==='UL'){const hidden=getComputedStyle(ul).display==='none';ul.style.display=hidden?'block':'none';if(emEl)emEl.innerHTML=hidden?'\u2013':'+'}
519return}
520const adultBtn=e.target.closest('span.adultAlt, a.show-adult');if(adultBtn){e.preventDefault();const str=prompt("WARNING: Adult content! If you wish to view such material, and are allowed to do so, please type \u201cI agree\u201d","");if(str&&str.toLowerCase()==="i agree"){show_adult_content=!0;if(typeof processAdultVerification==='function'){processAdultVerification(str)}else{document.body.classList.add('show-adult');setCookie('adult',!0);const dir=self.fileArea.dataset.dir||self.fileArea.querySelector('.dirFileHead')?.dataset.dir;const orderLink=self.fileArea.querySelector('ul#order a[data-order]');const order=orderLink?.dataset.order==='name'?'type':'name';const query="?ajax=true&dir="+encodeURIComponent(dir)+(order==='name'?'&order=name':'')+(self.showAdult?'&showAdult=1':'');self.fileArea.classList.add('loading');self.fileArea.dataset.dir=dir;loadHtml(self.fileArea,self.root+"!index/frame-files.ajax.php"+query,self.fileListLoaded)}}
521return}
522const link=e.target.closest('li a');if(!link){return}
523if(link.hasAttribute('data-order')){e.preventDefault();const dir=self.fileArea.dataset.dir||self.fileArea.querySelector('.dirFileHead')?.dataset.dir;const order=link.dataset.order;const query="?ajax=true&dir="+encodeURIComponent(dir)+(order==='name'?'&order=name':'&order=type')+(self.showAdult?'&showAdult=1':'');link.dataset.order=order==='name'?'type':'name';self.fileArea.classList.add('loading');loadHtml(self.fileArea,self.root+"!index/frame-files.ajax.php"+query,self.fileListLoaded);return}
524const href=link.getAttribute('href');const li=link.closest('li');let mediaType='',playerType=li.classList.contains('sndFile')?'audio':(li.classList.contains('vidFile')?'video':'');if(playerType==='audio'){mediaType=href.match(/\.mp3/i)?'mpeg':(href.match(/\.ogg/i)?'ogg':(href.match(/\.wav/i)?'wav':''))}else if(playerType==='video'){mediaType=href.match(/\.mp4/i)?'mp4':(href.match(/\.ogg/i)?'ogg':(href.match(/\.webm/i)?'webm':''))}
525if(playerType){e.preventDefault();const display=href.replace(/^.*\//,'');const player=mediaType?'<'+playerType+' controls><source src="'+href+'" type="'+playerType+'/'+mediaType+'"></'+playerType+'>':'';openDialog('about:blank');const content=document.querySelector('#aa-dialog .aa-dialog-content');if(content){content.innerHTML='<div class="av-player"><h1><a href="'+href+'">'+display+'</a></h1>'+player+'</div>'}
526return}
527if((href.search(/\.(?:html|htm|php)/)>0||href.indexOf('.')===-1)&&document.location.href.search(/\/files(?:\.html)?(#.*?)?$/)>=0){e.preventDefault();if(href.indexOf('files')<0){document.location.hash=href.replace(/#%^\[\]{}\\"<>/,'')}else if(history.pushState){history.pushState({},document.title,window.location.pathname+window.location.search)}else{document.location.hash=''}
528const query=(href.indexOf('?')>=0?'&':'?')+'ajax=sections';loadSections(href+query)}});const toggleBtn=self.fesb.querySelector('#fesb-toggle');[self.outerBar,toggleBtn].forEach(el=>el.addEventListener('mousedown',function(e){e.preventDefault();const startX=e.clientX;let dragged=!1;const isToggle=!!e.target.closest('#fesb-toggle');const onMove=function(e){const x=e.touches?e.touches[0].clientX:e.clientX;if(!dragged&&Math.abs(x-startX)<4){return}
529dragged=!0;self.fesb.style.width=self.limitFileExplorerW(x)+'px';document.querySelectorAll('.fesb-adjustment').forEach(el=>{el.style.marginLeft=self.fesb.offsetWidth+'px'})};const onUp=function(){document.removeEventListener('mousemove',onMove);document.removeEventListener('mouseup',onUp);document.removeEventListener('touchmove',onMove);document.removeEventListener('touchend',onUp);if(dragged){const endW=self.fesb.offsetWidth;self.setOuterDragbar(endW,endW>self.closedW&&endW<=self.closeAtW)}else if(isToggle){if(self.isFileExplorerClosed()){self.openFileExplorer(!0)}else{self.closeFileExplorer(!0)}}};document.addEventListener('mousemove',onMove);document.addEventListener('mouseup',onUp);document.addEventListener('touchmove',onMove);document.addEventListener('touchend',onUp)}
529));self.innerBar.addEventListener('mousedown',function(e){e.preventDefault();const onMove=function(e){const y=e.touches?e.touches[0].clientY:e.clientY;self.setInnerDragbar(y)};const onUp=function(){document.removeEventListener('mousemove',onMove);document.removeEventListener('mouseup',onUp);document.removeEventListener('touchmove',onMove);document.removeEventListener('touchend',onUp)};document.addEventListener('mousemove',onMove);document.addEventListener('mouseup',onUp);document.addEventListener('touchmove',onMove);document.addEventListener('touchend',onUp)});window.addEventListener('resize',function(){self.setInnerDragbar(self.innerBar.getBoundingClientRect().top)});self.folderArea.addEventListener('scroll',function(){setLocal('fileExplorer-foldersScrollTop',self.folderArea.scrollTop)});self.fileArea.addEventListener('scroll',function(){setLocal('fileExplorer-filesScrollTop',self.fileArea.scrollTop)});return this}}
530const fesb=new fileExplorerSidebar().init();document.addEventListener('click',function(e){var btn=e.target.closest('.audio-toggle');if(!btn)return;var li=btn.closest('li');if(!li)return;var audio=li.querySelector('audio');if(!audio)return;var wasOpen=li.classList.contains('is-open');var list=li.parentElement;if(list){list.querySelectorAll('li.is-open').forEach(function(other){if(other===li)return;other.classList.remove('is-open');var otherAudio=other.querySelector('audio');if(otherAudio)otherAudio.pause();var otherBtn=other.querySelector('.audio-toggle');if(otherBtn)otherBtn.setAttribute('aria-expanded','false');})}
531if(wasOpen){li.classList.remove('is-open');audio.pause();btn.setAttribute('aria-expanded','false')}else{li.classList.add('is-open');btn.setAttribute('aria-expanded','true');var p=audio.play();if(p&&typeof p.catch==='function')p.catch(function(){})}})

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.