1(()=>{'use strict'; 2let active=null,lastTrigger=null; 3function close(){if(active)active.close()} 4function open(event){ 5 const link=event.target.closest('[data-pm-open]');if(!link||event.ctrlKey||event.metaKey||event.shiftKey||event.altKey||event.button>0)return; 6 if(!window.HTMLDialogElement)return;event.preventDefault();if(active)close();lastTrigger=link; 7 const dialog=document.createElement('dialog');dialog.className='pm-dialog';dialog.setAttribute('aria-labelledby','pm-dialog-title'); 8 const bar=document.createElement('div');bar.className='pm-dialog-bar';const title=document.createElement('strong');title.id='pm-dialog-title';title.textContent=link.dataset.pmTitle; 9 const exit=document.createElement('button');exit.type='button';exit.className='pm-dialog-close';exit.setAttribute('aria-label',"ÐакÑÑÑÑ Ð²Ð¸Ð´ÐµÐ¾ или изобÑажение");exit.innerHTML='<svg width="22" height="22" viewBox="0 0 24 24" aria-hidden="true"><path d="m6 6 12 12M6 18 18 6" fill="none" stroke="currentColor" stroke-width="1.6"/></svg>';exit.addEventListener('click',close);bar.append(title,exit); 10 const stage=document.createElement('div');stage.className='pm-dialog-media';const video=link.dataset.pmOpen==='video';const media=document.createElement(video?'video':'img');media.src=link.href; 11 if(video){media.controls=true;media.playsInline=true;media.preload='metadata';media.poster=link.dataset.pmPoster;media.setAttribute('aria-label',link.dataset.pmTitle)}else{media.alt=link.dataset.pmTitle} 12 stage.append(media);const copy=document.createElement('div');copy.className='pm-dialog-copy';const note=document.createElement('p');note.textContent=link.dataset.pmNote;copy.append(note);dialog.append(bar,stage,copy);document.body.append(dialog);active=dialog; 13 const previousOverflow=document.body.style.overflow;document.body.style.overflow='hidden'; 14 dialog.addEventListener('close',()=>{if(video){media.pause();media.removeAttribute('src');media.load()}document.body.style.overflow=previousOverflow;dialog.remove();if(active===dialog)active=null;link.focus({preventScroll:true})},{once:true}); 15 dialog.addEventListener('click',e=>{if(e.target===dialog){const r=dialog.getBoundingClientRect();if(e.clientX<r.left||e.clientX>r.right||e.clientY<r.top||e.clientY>r.bottom)close()}}); 16 dialog.showModal();exit.focus({preventScroll:true}); 17 if(video)media.play().catch(()=>{}); 18} 19document.addEventListener('click',open); 20document.querySelectorAll('.pm-gallery').forEach(gallery=>{ 21 const grid=gallery.querySelector('.pm-grid'),nav=gallery.querySelector('.pm-navigation');if(!nav)return; 22 const cards=Array.from(grid.children),buttons=nav.querySelectorAll('button'),counter=nav.querySelector('.pm-counter'); 23 function index(){const edge=getComputedStyle(grid).direction==='rtl'?'right':'left';return cards.reduce((best,card,i)=>Math.abs(card.getBoundingClientRect()[edge]-grid.getBoundingClientRect()[edge])<Math.abs(cards[best].getBoundingClientRect()[edge]-grid.getBoundingClientRect()[edge])?i:best,0)} 24 function sync(){const frame=grid.getBoundingClientRect(),visible=cards.map((c,i)=>({i,r:c.getBoundingClientRect()})).filter(c=>c.r.left>=frame.left-6&&c.r.right<=frame.right+6).map(c=>c.i);const first=visible.length?visible[0]:index(),last=visible.length?visible[visible.length-1]:first;counter.textContent=(first+1)+(last>first?'â'+(last+1):'')+' / '+cards.length;buttons[0].disabled=first===0;buttons[1].disabled=last===cards.length-1} 25 nav.addEventListener('click',event=>{const button=event.target.closest('[data-pm-direction]');if(!button||button.disabled)return;const step=cards[1]?cards[1].offsetLeft-cards[0].offsetLeft:0;grid.scrollBy({left:step*Number(button.dataset.pmDirection),behavior:matchMedia('(prefers-reduced-motion: reduce)').matches?'instant':'smooth'})}); 26 grid.addEventListener('scroll',sync,{passive:true});window.addEventListener('resize',sync);sync(); 27}); 28document.addEventListener('visibilitychange',()=>{if(document.hidden&&active)active.querySelector('video')?.pause()}); 29window.addEventListener('pagehide',()=>{if(active)active.querySelector('video')?.pause()}); 30})();
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.