PageSourceSearch

https://otsifro.ru/.s/src/fancybox5/dist/js/chunks/photo-fancy.a1fc1b.js

js otsifro.ru collected 2026-10-08 00:56:53 UTC 2,840 bytes, 1 lines download raw bytes

1(self.webpackChunkfancybox5=self.webpackChunkfancybox5||[]).push([[521],{153:(e,t,s)=>{s.a(e,(async(e,a)=>{try{s.d(t,{PhotoGallery:()=>h});var i=s(197),r=s(2),o=e([r]);r=(o.then?(await o)():o)[0];class h{#e=new Set;#t=!1;#s=1;#a=new Map;#i=new Set;#r=!1;constructor(e){if("function"!=typeof window.getPhotoVars)return;const{currentPage:t,pageUrlMask:s,photoUrls:a}=window.getPhotoVars();if(this.#s=t,this.pageUrlMask=s,this.#a=new Map(Object.entries(a).map((e=>{let[t,s]=e;return[+t,s]}))),this.#r=this.#a.size>1&&1===this.#a.get(this.#s).length,this.#a.size){const e=this.#a.get(t).map((e=>{let[,t]=e;return t}));this.#i=new Set([e[0],e.at(-1)]),this.#e.add(t)}this.#o(e).catch((e=>console.log(e)))}async#o(e){this.#a.size>=3&&await Promise.allSettled([this.#a.has(this.#s-1)?this.#s-1:Math.max(...this.#a.keys()),this.#a.has(this.#s+1)?this.#s+1:Math.min(...this.#a.keys())].map((e=>this.#h(e)))),i.lX.bind(e,{...r.bH,...this.isTailPage&&{Toolbar:{...r.bH.Toolbar,display:{...r.bH.Toolbar.display,left:["uInfobar"]}}},Thumbs:{minCount:this.isTailPage?1:2},Carousel:{on:{ready:async()=>{await this.#g({from:0,to:-1}),await this.#g({from:0,to:1})},beforeChange:async(e,t)=>{this.isBusy&&(t.stopPropagation(),t.preventDefault())},change:async(e,t,s)=>{await this.#g({to:t,from:s})}}},on:{ready:e=>this.fancybox=e,destroy:()=>this.#n()}})}#n(){this.isBusy=!1,this.#e=new Set([this.#s])}get isTailPage(){return this.#r}get isBusy(){return this.#t}set isBusy(e){"boolean"==typeof e&&(this.#t=e)}get currentSrc(){return this.fancybox.getSlide().src}get carousel(){return this.fancybox.carousel}#d(e){let{to:t=0,from:s=0}=e;const a=this.currentSrc;let i={};if(!this.#i.has(a))return i;const r=(e,i)=>"left"===i==t<s&&e===a;for(let[e,t]of this.#a)if(t){if(r(t[0][1],"left")){i={edge:"left",newPage:e-1<1?Math.max(...this.#a.keys()):e-1};break}if(r(t.at(-1)[1],"right")){i={edge:"right",newPage:this.#a.has(e+1)?e+1:1};break}}return i}async#c(e){const t=this.#a.get(e),s=t||await this.#l(e);return s.length&&(this.#a.get(e)||this.#a.set(e,s),this.#i.add(s[0][1]),this.#i.add(s.at(-1)[1]),this.#e.add(e)),s}async#g(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{edge:t,newPage:s}=this.#d(e);if(!t||!s||this.#e.has(s))return;this.isBusy=!0;const a=(await this.#c(s)).map((e=>{let[t,s,a]=e;return{src:s,url:`/photo/0-0-${t}`,thumb:a}}));"left"===t&&(this.carousel.prependSlide(a),this.carousel.clearTransitions()),"right"===t&&this.carousel.appendSlide(a),this.isBusy=!1}async#l(e){const t=`${this.pageUrlMask.replace(/%p/g,e).replace(/%a/g,1)}`;let s=[];try{const e=await fetch(t);e.ok&&(s=await e.json())}catch(e){console.error("Error fetching images:",e)}return s}async#h(e){if(!this.#a.get(e)){const t=await this.#l(e);t.length&&(this.#a.set(e,t),this.#i.add(t[0][1]),this.#i.add(t.at(-1)[1]))}}}a()}catch(e){a(e)}}))}}]);

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.