'),window.customElements.define("img-comparison-slider",d))})()})();class ScrollToTop{constructor(selector='.dugme-yukari'){this.elements=document.querySelectorAll(selector);this.bindEvents()} bindEvents(){this.elements.forEach(element=>{element.addEventListener('click',this.scrollToTop)})} scrollToTop(){window.scrollTo({top:0,behavior:'smooth'})}} document.addEventListener('DOMContentLoaded',()=>{new ScrollToTop()});class ImageGallery{constructor(rootElement){this.root=rootElement;this.container=this.root.querySelector('.imageGallery-container');this.images=Array.from(this.container.querySelectorAll('img'));this.currentIndex=0;this.lastTap=0;this.zoomLevel=1;this.zoomOrigin={x:0,y:0};this.panPosition={x:0,y:0};this.lastPanPosition={x:0,y:0};this.isPanning=!1;this.hasShownPulseAnimation=!1;this.isMobile=this.checkIfMobile();this.createModal();this.createPulseAnimation();this.setupEventListeners()} checkIfMobile(){return window.innerWidth<=768} createModal(){this.modal=document.createElement('div');this.modal.className='imageGallery-modal';this.modal.id='imageGalleryModal';const modalContent=document.createElement('div');modalContent.className='modal-content';this.modalImage=document.createElement('img');this.modalImage.className='modal-image';this.modalImage.alt='Büyük Resim';this.modalCaption=document.createElement('div');this.modalCaption.className='modal-caption';this.closeBtn=document.createElement('span');this.closeBtn.className='close';this.closeBtn.innerHTML='×';this.prevBtn=document.createElement('span');this.prevBtn.className='prev';this.prevBtn.innerHTML='❮';this.nextBtn=document.createElement('span');this.nextBtn.className='next';this.nextBtn.innerHTML='❯';const spinner=document.createElementNS('http://www.w3.org/2000/svg','svg');spinner.setAttribute('class','spinner');spinner.setAttribute('viewBox','0 0 50 50');const circle=document.createElementNS('http://www.w3.org/2000/svg','circle');circle.setAttribute('cx','25');circle.setAttribute('cy','25');circle.setAttribute('r','20');circle.setAttribute('fill','none');circle.setAttribute('stroke','#fff');circle.setAttribute('stroke-width','5');circle.setAttribute('stroke-linecap','round');spinner.appendChild(circle);modalContent.appendChild(spinner);modalContent.appendChild(this.modalImage);this.modal.appendChild(modalContent);this.modal.appendChild(this.closeBtn);this.modal.appendChild(this.prevBtn);this.modal.appendChild(this.nextBtn);this.modal.appendChild(this.modalCaption);document.body.appendChild(this.modal)} setupEventListeners(){this.images.forEach((img,index)=>{img.addEventListener('click',()=>this.openModal(index))});this.closeBtn.addEventListener('click',(e)=>{e.stopPropagation();this.closeModal()});this.prevBtn.addEventListener('click',(e)=>{e.stopPropagation();this.showImage(this.currentIndex-1,'prev')});this.nextBtn.addEventListener('click',(e)=>{e.stopPropagation();this.showImage(this.currentIndex+1,'next')});document.addEventListener('keydown',(e)=>this.handleKeyPress(e));this.modal.addEventListener('click',(e)=>{if(e.target===this.modal)this.closeModal();});this.modalImage.addEventListener('touchstart',(e)=>this.handleTouchStart(e),{passive:!1});this.modalImage.addEventListener('touchmove',(e)=>this.handleTouchMove(e),{passive:!1});this.modalImage.addEventListener('touchend',(e)=>this.handleTouchEnd(e),{passive:!1});window.addEventListener('resize',()=>{this.isMobile=this.checkIfMobile()})} openModal(index){this.modal.style.display='block';const direction=index>this.currentIndex?'next':'prev';this.showImage(index,direction)} closeModal(){this.modal.style.display='none';this.resetZoom();this.hasShownPulseAnimation=!1} showImage(index,direction){const oldIndex=this.currentIndex;this.currentIndex=(index+this.images.length)%this.images.length;const newSrc=this.images[this.currentIndex].getAttribute('data-img-big');const newCaption=this.images[this.currentIndex].getAttribute('alt');const spinner=this.modal.querySelector('.spinner');spinner.classList.add('active');if(direction==='prev'){this.modalImage.classList.add('slide-right')}else{this.modalImage.classList.add('slide-left')} this.modalCaption.classList.remove('active');const newImage=document.createElement('img');newImage.className='modal-image';newImage.alt='Büyük Resim';newImage.onload=()=>{setTimeout(()=>{spinner.classList.remove('active');if(direction==='prev'){newImage.classList.add('slide-left')}else{newImage.classList.add('slide-right')} this.modal.querySelector('.modal-content').appendChild(newImage);setTimeout(()=>{newImage.classList.add('active');newImage.classList.remove('slide-left','slide-right');this.modalImage.remove();this.modalImage=newImage;this.modalCaption.textContent=newCaption;this.modalCaption.classList.add('active');this.resetZoom();this.setupImageTouchListeners();if(this.isMobile&&!this.hasShownPulseAnimation){setTimeout(()=>{this.togglePulseAnimation(!0);setTimeout(()=>this.togglePulseAnimation(!1),2000);this.hasShownPulseAnimation=!0},1000)}},50)},300)};newImage.src=newSrc} togglePulseAnimation(show){if(this.isMobile&&this.pulseContainer){this.pulseContainer.style.display=show?'block':'none'}} setupImageTouchListeners(){this.modalImage.addEventListener('touchstart',(e)=>this.handleTouchStart(e),{passive:!1});this.modalImage.addEventListener('touchmove',(e)=>this.handleTouchMove(e),{passive:!1});this.modalImage.addEventListener('touchend',(e)=>this.handleTouchEnd(e),{passive:!1})} handleKeyPress(e){if(this.modal.style.display==='block'){if(e.key==='Escape')this.closeModal();if(e.key==='ArrowLeft')this.showImage(this.currentIndex-1,'prev');if(e.key==='ArrowRight')this.showImage(this.currentIndex+1,'next');}} handleTouchStart(e){if(e.target!==this.modalImage)return;e.preventDefault();const currentTime=new Date().getTime();const tapLength=currentTime-this.lastTap;if(tapLength<300&&tapLength>0){this.handleDoubleTap(e)}else if(this.zoomLevel>1){this.isPanning=!0;this.lastPanPosition={x:e.touches[0].clientX,y:e.touches[0].clientY}} this.lastTap=currentTime} handleTouchMove(e){if(!this.isPanning)return;e.preventDefault();const currentX=e.touches[0].clientX;const currentY=e.touches[0].clientY;const deltaX=currentX-this.lastPanPosition.x;const deltaY=currentY-this.lastPanPosition.y;this.panPosition.x+=deltaX;this.panPosition.y+=deltaY;this.applyTransform();this.lastPanPosition={x:currentX,y:currentY}} handleTouchEnd(e){if(e.target!==this.modalImage)return;e.preventDefault();this.isPanning=!1} handleDoubleTap(e){if(this.zoomLevel===1){this.zoomIn(e)}else{this.zoomOut()}} zoomIn(e){const touch=e.touches[0];const imageRect=this.modalImage.getBoundingClientRect();const x=touch.clientX-imageRect.left;const y=touch.clientY-imageRect.top;this.zoomLevel=2;this.zoomOrigin={x,y};this.panPosition={x:0,y:0};this.applyTransform()} zoomOut(){this.zoomLevel=1;this.panPosition={x:0,y:0};this.applyTransform()} resetZoom(){this.zoomLevel=1;this.zoomOrigin={x:0,y:0};this.panPosition={x:0,y:0};this.applyTransform()} applyTransform(){const{x,y}=this.zoomOrigin;const{x:panX,y:panY}=this.panPosition;this.modalImage.style.transformOrigin=`${x}px ${y}px`;this.modalImage.style.transform=`scale(${this.zoomLevel}) translate(${panX}px, ${panY}px)`} createPulseAnimation(){if(!this.isMobile)return;this.pulseContainer=document.createElement('div');this.pulseContainer.className='pulse-container';const circle1=document.createElement('div');circle1.className='pulse-circle';const circle2=document.createElement('div');circle2.className='pulse-circle';this.pulseContainer.appendChild(circle1);this.pulseContainer.appendChild(circle2);this.modal.appendChild(this.pulseContainer)}} document.addEventListener('DOMContentLoaded',()=>{const galleryRoots=document.querySelectorAll('.imageGallery-root');galleryRoots.forEach(root=>new ImageGallery(root))});const DEFAULT_OPTIONS={rootMargin:'0px',threshold:0.1};class ImageLazyLoader{constructor(options={}){this.options={...DEFAULT_OPTIONS,...options};this.images=[];this.observer=null;this.loadedImages=new WeakSet();this.init()} static isIntersectionObserverSupported(){return'IntersectionObserver' in window&&'IntersectionObserverEntry' in window&&'intersectionRatio' in window.IntersectionObserverEntry.prototype} init(){if(ImageLazyLoader.isIntersectionObserverSupported()){this.observer=new IntersectionObserver(this.onIntersection.bind(this),{rootMargin:this.options.rootMargin,threshold:this.options.threshold})} this.loadImages()} loadImages(){this.images=Array.from(document.querySelectorAll('img[data-src]'));if(this.observer){this.images.forEach(img=>{if(!this.loadedImages.has(img)){this.observer.observe(img)}})}else{this.loadAllImages()}} onIntersection(entries){entries.forEach(entry=>{if(entry.isIntersecting){this.loadImage(entry.target);this.observer.unobserve(entry.target)}})} loadImage(img){if(!this.loadedImages.has(img)){const src=img.getAttribute('data-src');if(src){img.src=src;img.removeAttribute('data-src');this.loadedImages.add(img)}}} loadAllImages(){this.images.forEach(img=>this.loadImage(img))}} document.addEventListener('DOMContentLoaded',()=>{new ImageLazyLoader()});(()=>{'use strict';const tooltip=document.createElement('div');tooltip.classList.add('statusbar-tooltip');document.body.appendChild(tooltip);const getFullUrl=(path)=>{try{return new URL(path,window.location.href).href}catch{return window.location.origin+path}};const handleClick=(event,url)=>{if(event.ctrlKey||event.metaKey){window.open(url,'_blank')}else{window.location.href=url} event.preventDefault()};const handleMouseUp=(event,url)=>{if(event.button===1){window.open(url,'_blank');event.preventDefault()}};const showTooltip=(event,url)=>{const fullUrl=getFullUrl(url);tooltip.style.display='block';tooltip.textContent=fullUrl};const hideTooltip=()=>{tooltip.style.display='none'};const addListeners=(element)=>{const url=element.dataset.clicktogo;if(!url)return;const fullUrl=getFullUrl(url);element.addEventListener('click',(e)=>handleClick(e,fullUrl));element.addEventListener('mouseup',(e)=>handleMouseUp(e,fullUrl));element.addEventListener('mouseover',(e)=>showTooltip(e,url));element.addEventListener('mouseout',hideTooltip);element.addEventListener('focus',(e)=>showTooltip(e,url));element.addEventListener('blur',hideTooltip)};document.querySelectorAll('.clicktogo').forEach(addListeners)})()