2023-10-10 13:30:19 +02:00
|
|
|
"use strict";(self.__WordPressPrivateInteractivityAPI__=self.__WordPressPrivateInteractivityAPI__||[]).push([[354],{699:function(e,t,i){var o=i(754);const n=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'];let a,r=!1,c=0;function l(e){!r&&Date.now()-c>450&&window.scrollTo(e.core.image.scrollLeftReset,e.core.image.scrollTopReset)}function g(e,t){let{naturalWidth:i,naturalHeight:o,offsetWidth:n,offsetHeight:a}=t,{x:r,y:c}=t.getBoundingClientRect();const l=i/o;let g=n/a;if("contain"===e.core.image.scaleAttr)if(l>g){const e=n/l;c+=(a-e)/2,a=e}else{const e=a*l;r+=(n-e)/2,n=e}g=n/a;let d=parseFloat("none"!==e.core.image.targetWidth?e.core.image.targetWidth:i),s=parseFloat("none"!==e.core.image.targetHeight?e.core.image.targetHeight:o),m=d/s,h=d,u=s,w=d,f=s;if(l.toFixed(2)!==m.toFixed(2)){if(l>m){const e=d/l;s-e>d?(s=e,d=e*l):s=d/l}else{const e=s*l;d-e>s?(d=e,s=e/l):d=s*l}w=d,f=s,m=d/s,g>m?(h=d,u=h/g):(u=s,h=u*g)}(n>w||a>f)&&(w=n,f=a);let b=0;window.innerWidth>480?b=80:window.innerWidth>1920&&(b=160);const x=Math.min(window.innerWidth-b,w),p=Math.min(window.innerHeight-80,f);g>x/p?(w=x,f=w/g):(f=p,w=f*g);const E=n/w,v=d*(w/h),y=s*(f/u);let A=document.getElementById("wp-lightbox-styles");A||(A=document.createElement("style"),A.id="wp-lightbox-styles",document.head.appendChild(A)),A.innerHTML=`\n\t\t:root {\n\t\t\t--wp--lightbox-initial-top-position: ${c}px;\n\t\t\t--wp--lightbox-initial-left-position: ${r}px;\n\t\t\t--wp--lightbox-container-width: ${w+1}px;\n\t\t\t--wp--lightbox-container-height: ${f+1}px;\n\t\t\t--wp--lightbox-image-width: ${v}px;\n\t\t\t--wp--lightbox-image-height: ${y}px;\n\t\t\t--wp--lightbox-scale: ${E};\n\t\t}\n\t`}(0,o.h)({state:{core:{image:{windowWidth:window.innerWidth,windowHeight:window.innerHeight}}},actions:{core:{image:{showLightbox:({context:e,event:t})=>{e.core.image.imageLoaded&&(e.core.image.initialized=!0,e.core.image.lastFocusedElement=window.document.activeElement,e.core.image.scrollDelta=0,e.core.image.lightboxEnabled=!0,g(e,t.target.previousElementSibling),e.core.image.scrollTopReset=window.pageYOffset||document.documentElement.scrollTop,e.core.image.scrollLeftReset=window.pageXOffset||document.documentElement.scrollLeft,a=l.bind(null,e),window.addEventListener("scroll",a,!1))},hideLightbox:async({context:e})=>{e.core.image.hideAnimationEnabled=!0,e.core.image.lightboxEnabled&&(setTimeout((function(){window.removeEventListener("scroll",a)}),450),e.core.image.lightboxEnabled=!1,e.core.image.lastFocusedElement.focus({preventScroll:!0}))},handleKeydown:({context:e,actions:t,event:i})=>{e.core.image.lightboxEnabled&&("Tab"!==i.key&&9!==i.keyCode||(i.shiftKey&&window.document.activeElement===e.core.image.firstFocusableElement?(i.preventDefault(),e.core.image.lastFocusableElement.focus()):i.shiftKey||window.document.activeElement!==e.core.image.lastFocusableElement||(i.preventDefault(),e.core.image.firstFocusableElement.focus())),"Escape"!==i.key&&27!==i.keyCode||t.core.image.hideLightbox({context:e,event:i}))},handleLoad:({state:e,context:t,effects:i,ref:o})=>{t.core.image.imageLoaded=!0,t.core.image.imageCurrentSrc=o.currentSrc,i.core.image.setButtonStyles({state:e,context:t,ref:o})},handleTouchStart:()=>{r=!0},handleTouchMove:({context:e,event:t})=>{e.core.image.lightboxEnabled&&t.preventDefault()},handleTouchEnd:()=>{c=Date.now(),r=!1}}}},selectors:{core:{image:{roleAttribute:({context:e})=>e.core.image.lightboxEnabled?"dialog":null,ariaModal:({context:e})=>e.core.image.lightboxEnabled?"true":null,dialogLabel:({context:e})=>e.core.image.lightboxEnabled?e.core.image.dialogLabel:null,lightboxObjectFit:({context:e})=>{if(e.core.image.initialized)return"cover"},enlargedImgSrc:({context:e})=>e.core.image.initialized?e.core.image.imageUploadedSrc:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="}}},effects:{core:{image:{setCurrentSrc:(
|