UNPKG

@fancyapps/ui

Version:

Robust JavaScript UI Component Library

4 lines 100 kB
!/*! License details at fancyapps.com/license */function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).window=e.window||{})}(this,function(e){"use strict";let t,n,o,i,l=e=>"string"==typeof e,a=e=>e&&null!==e&&e instanceof Element&&"nodeType"in e,r=function(e){if(!(e&&e instanceof Element&&e.offsetParent))return!1;let t=e.scrollHeight>e.clientHeight,n=window.getComputedStyle(e).overflowY,o=-1!==n.indexOf("hidden"),i=-1!==n.indexOf("visible");return t&&!o&&!i},s=function(e,t){return!e||e===document.body||t&&e===t?null:r(e)?e:s(e.parentElement,t)},c=function(e){var t=new DOMParser().parseFromString(e,"text/html").body;if(t.childElementCount>1){for(var n=document.createElement("div");t.firstChild;)n.appendChild(t.firstChild);return n}let o=t.firstChild;if(o&&!(o instanceof HTMLElement)){var n=document.createElement("div");return n.appendChild(o),n}return o},u=function(e=0,t=0,n=0){return Math.max(Math.min(t,n),e)},d=e=>"object"==typeof e&&null!==e&&e.constructor===Object&&"[object Object]"===Object.prototype.toString.call(e);function f(e){return d(e)||Array.isArray(e)}function g(e,t){let n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&n.every(n=>{let o=e[n],i=t[n];return"function"==typeof o?`${o}`==`${i}`:f(o)&&f(i)?g(o,i):o===i})}let p=1/60*3e3,m=function(e){for(let t of R)t.getState()===h.Running&&t.tick(O?e-O:0);O=e,A=window.requestAnimationFrame(m)},h=((v={})[v.Initializing=0]="Initializing",v[v.Running=1]="Running",v[v.Paused=2]="Paused",v[v.Completed=3]="Completed",v[v.Destroyed=4]="Destroyed",v);var v,y,b,E,w,x,M,L,S,T,P=((y=P||{})[y.Spring=0]="Spring",y[y.Ease=1]="Ease",y);let C=((b={})[b.Loop=0]="Loop",b[b.Reverse=1]="Reverse",b),R=new Set,A=null,O=0;function z(){let e=h.Initializing,t=P.Ease,n=0,o=0,i=z.Easings.Linear,l=500,a=0,r=0,s=0,c=0,d=1/0,f=.01,v=.01,y=!1,b={},E=null,w={},x={},M={},L=0,S=0,T=C.Loop,O=z.Easings.Linear,k=new Map;function I(e,...t){for(let n of k.get(e)||[])n(...t)}function $(e){return o=0,e?E=setTimeout(()=>{_()},e):_(),D}function _(){e=h.Running,I("start",w,x)}function F(){if(e=h.Completed,M={},I("end",w),e===h.Completed)if(n<L){if(n++,T===C.Reverse){let e={...b};b={...x},x=e}$(S)}else n=0;return D}let D={getState:function(){return e},easing:function(e){return i=e,t=P.Ease,M={},D},duration:function(e){return l=e,D},spring:function(e={}){t=P.Spring;let{velocity:n,mass:o,tension:i,friction:l,restDelta:u,restSpeed:g,maxSpeed:p,clamp:m}={velocity:0,mass:1,tension:170,friction:26,restDelta:.1,restSpeed:.1,maxSpeed:1/0,clamp:!0,...e};return a=n,r=o,s=i,c=l,v=u,f=g,d=p,y=m,M={},D},isRunning:function(){return e===h.Running},isSpring:function(){return t===P.Spring},from:function(e){return w={...e},D},to:function(e){return x=e,D},repeat:function(e,t=0,n=C.Loop,o){return L=e,S=t,T=n,O=o||i,D},on:function(e,t){return k.set(e,[...k.get(e)||[],t]),D},off:function(e,t){return k.has(e)&&k.set(e,k.get(e).filter(e=>e!==t)),D},start:function(t){return e=h.Initializing,g(b={...w},x)||(R.add(this),A||(A=window.requestAnimationFrame(m)),$(t)),D},pause:function(){return E&&(clearTimeout(E),E=null),e===h.Running&&(e=h.Paused,I("pause",w)),D},end:F,tick:function(n){n>p&&(n=p),o+=n;let m=0,E=!1;if(e!==h.Running)return D;if(t===P.Ease){E=1===(m=u(0,o/l,1));let e=T===C.Reverse?O:i;for(let t in w)w[t]=b[t]+(x[t]-b[t])*e(m)}if(t===P.Spring){let e=.001*n,t=0;for(let n in w){let o=x[n],i=w[n];if(!("number"==typeof o&&!isNaN(o))||!("number"==typeof i&&!isNaN(i)))continue;if(Math.abs(o-i)<=v){w[n]=o,M[n]=0;continue}M[n]||("object"==typeof a&&"number"==typeof a[n]?M[n]=a[n]:"number"==typeof a?M[n]=a:M[n]=0);let l=M[n],g=(l=u(-1*Math.abs(d),l,Math.abs(d)))*r*c,p=Math.abs(o-i)*s;l+=((i>o?-1:1)*p-g)/r*e,i+=l*e;let m=w[n]>o?i<o:i>o,h=Math.abs(l)<f&&Math.abs(o-i)<=v;y&&m&&(h=!0),h?(i=o,l=0):t++,w[n]=i,M[n]=l}E=!t}let L={...x};return I("step",w,b,x,m),E&&e===h.Running&&g(x,L)&&(e=h.Completed,F()),D},getStartValues:function(){return b},getCurrentValues:function(){return w},getCurrentVelocities:function(){return M},getEndValues:function(){return x},destroy:function(){e=h.Destroyed,E&&(clearTimeout(E),E=null),b=w=x={},R.delete(this)}};return D}function k(e){let t=[];for(let n of"undefined"!=typeof TouchEvent&&e instanceof TouchEvent?e.touches:e instanceof MouseEvent&&"mouseup"!==e.type?[e]:[])t.push({x:n.clientX,y:n.clientY,ts:Date.now()});return t}function I(e){let t=[];for(let n of"undefined"!=typeof TouchEvent&&e instanceof TouchEvent?e.changedTouches:e instanceof MouseEvent?[e]:[])t.push({x:n.clientX,y:n.clientY,ts:Date.now()});return t}function $(e){let t=e[0],n=e[1]||t;return{x:(t.x+n.x)/2,y:(t.y+n.y)/2,ts:n.ts}}function _(e){let t=e[0],n=e[1]||e[0];return t&&n?-1*Math.sqrt((n.x-t.x)*(n.x-t.x)+(n.y-t.y)*(n.y-t.y)):0}z.destroy=()=>{for(let e of R)e.destroy();A&&(cancelAnimationFrame(A),A=null)},z.Easings={Linear:function(e){return e},EaseIn:function(e){return 0===e?0:Math.pow(2,10*e-10)},EaseOut:function(e){return 1===e?1:1-Math.pow(2,-10*e)},EaseInOut:function(e){return 0===e?0:1===e?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2}};let F=e=>{e.cancelable&&e.preventDefault()},D={passive:!1},H={panThreshold:5,swipeThreshold:3,ignore:["textarea","input","select","[contenteditable]","[data-selectable]","[data-draggable]"]},V=!1,j=!0,N=(e,t)=>{let n,o,i,l={...H,...t},a=[],r=[],s=[],c=!1,u=!1,d=!1,f=0,g=0,p=0,m=0,h=0,v=0,y=0,b=0,E=0,w=[],x=0,M=0,L=new Map;function S(e){let t=_(r),l=_(s),d=Math.abs(y)>Math.abs(b)?y:b,f={srcEvent:i,isPanRecognized:c,isSwipeRecognized:u,firstTouch:a,previousTouch:s,currentTouch:r,deltaX:p,deltaY:m,offsetX:h,offsetY:v,velocityX:y,velocityY:b,velocity:d,angle:E,axis:o,scale:t&&l?t/l:0,center:n};for(let t of L.get(e)||[])t(f)}function T(e){let t=Date.now();w=w.filter(e=>!e.ts||e.ts>t-100),e&&w.push(e)}function P(){if(y=0,b=0,w.length>3){let e=w[0],t=w[w.length-1];if(e&&t){let n=t.x-e.x,o=t.y-e.y,i=e.ts&&t.ts?t.ts-e.ts:0;i>0&&(y=Math.abs(n)>3?n/(i/30):0,b=Math.abs(o)>3?o/(i/30):0)}}}function C(e){if(e instanceof MouseEvent){if(V)return}else V=!0;let t=e.composedPath()[0],o=l.ignore.join(",");if(t.matches(o)||t.closest(o)||"undefined"!=typeof MouseEvent&&e instanceof MouseEvent&&(!e.buttons||0!==e.button))return;e instanceof MouseEvent&&F(e);let p=Date.now(),m=p-(f||p);d=m>0&&m<=250,f=p,clearTimeout(x),i=e,e instanceof MouseEvent&&(window.addEventListener("mousemove",R),window.addEventListener("mouseup",A)),window.addEventListener("blur",O),a=[...r=k(e)],s=[],g=r.length,n=$(r),1===g&&(c=!1,u=!1),g&&T($(r)),S("start")}function R(e){if(!a.length||e.defaultPrevented)return;i=e,s=[...r],g=(r=k(e)).length;let t=n=$(r),u=$(s);if(p=t.x-u.x,m=t.y-u.y,T(t),P(),S("move"),r.length>1&&Math.abs(_(r)-_(s))>=.1&&S("pinch"),!c&&a.length){let e=$(a);h=t.x-e.x,v=t.y-e.y,(c=Math.abs(h)>l.panThreshold||Math.abs(v)>l.panThreshold)&&(j=!1,clearTimeout(M),M=0,o=(E=Math.abs(180*Math.atan2(v,h)/Math.PI))>45&&E<135?"y":"x",a=[...r],s=[...r],window.getSelection()?.removeAllRanges(),S("panstart"))}c&&(p||m)&&S("pan")}function A(e){if(i=e,!a.length)return;let t=k(e),o=I(e);if(g=t.length,n=$(o),o.length&&T($(o)),P(),s=[...r],r=[...t],a=[...t],t.length>0)S("end"),c=!1,u=!1,w=[];else{let e=l.swipeThreshold;(Math.abs(y)>e||Math.abs(b)>e)&&(u=!0),c&&S("panend"),u&&S("swipe"),c||u||(S("tap"),d?S("doubleTap"):x=setTimeout(function(){S("singleTap")},250)),S("end"),z()}}function O(){clearTimeout(x),z(),c&&S("panend"),S("end")}function z(){c=!1,u=!1,d=!1,g=0,w=[],r=[],s=[],a=[],p=0,m=0,h=0,v=0,y=0,b=0,E=0,o=void 0,window.removeEventListener("mousemove",R),window.removeEventListener("mouseup",A),window.removeEventListener("blur",O),j||M||(M=setTimeout(()=>{j=!0,M=0},100))}function N(e){let t=e.target;V=!1,t&&!e.defaultPrevented&&(j||(F(e),e.stopPropagation()))}let q={init:function(){if(e)return e.addEventListener("click",N,D),e.addEventListener("mousedown",C,D),e.addEventListener("touchstart",C,D),e.addEventListener("touchmove",R,D),e.addEventListener("touchend",A),e.addEventListener("touchcancel",A),q},on:function(e,t){return L.set(e,[...L.get(e)||[],t]),q},off:function(e,t){return L.has(e)&&L.set(e,L.get(e).filter(e=>e!==t)),q},isPointerDown:()=>g>0,destroy:function(){clearTimeout(x),clearTimeout(M),M=0,e&&(e.removeEventListener("click",N,D),e.removeEventListener("mousedown",C,D),e.removeEventListener("touchstart",C,D),e.removeEventListener("touchmove",R,D),e.removeEventListener("touchend",A),e.removeEventListener("touchcancel",A)),e=null,z()}};return q};N.isClickAllowed=()=>j;let q={IMAGE_ERROR:"This image couldn't be loaded. <br /> Please try again later.",MOVE_UP:"Move up",MOVE_DOWN:"Move down",MOVE_LEFT:"Move left",MOVE_RIGHT:"Move right",ZOOM_IN:"Zoom in",ZOOM_OUT:"Zoom out",TOGGLE_FULL:"Toggle zoom level",TOGGLE_1TO1:"Toggle zoom level",ITERATE_ZOOM:"Toggle zoom level",ROTATE_CCW:"Rotate counterclockwise",ROTATE_CW:"Rotate clockwise",FLIP_X:"Flip horizontally",FLIP_Y:"Flip vertically",RESET:"Reset"},B=(e,t="")=>{e&&e.classList&&t.split(" ").forEach(t=>{t&&e.classList.add(t)})},W=(e,t="")=>{e&&e.classList&&t.split(" ").forEach(t=>{t&&e.classList.remove(t)})},Z=(e,t="",n)=>{e&&e.classList&&t.split(" ").forEach(t=>{t&&e.classList.toggle(t,n||!1)})},G=1e4,Y=e=>{e.cancelable&&e.preventDefault()},X=(e,t=G)=>Math.round(((e=parseFloat(e+"")||0)+Number.EPSILON)*t)/t,U=((E={}).Reset="reset",E.Zoom="zoom",E.ZoomIn="zoomIn",E.ZoomOut="zoomOut",E.ZoomTo="zoomTo",E.ToggleCover="toggleCover",E.ToggleFull="toggleFull",E.ToggleMax="toggleMax",E.IterateZoom="iterateZoom",E.Pan="pan",E.Swipe="swipe",E.Move="move",E.MoveLeft="moveLeft",E.MoveRight="moveRight",E.MoveUp="moveUp",E.MoveDown="moveDown",E.RotateCCW="rotateCCW",E.RotateCW="rotateCW",E.FlipX="flipX",E.FlipY="flipY",E),K=((w={}).Cover="cover",w.Full="full",w.Max="max",w),J={x:0,y:0,scale:1,angle:0,flipX:1,flipY:1},Q=((x={})[x.Init=0]="Init",x[x.Loading=1]="Loading",x[x.Error=2]="Error",x[x.Ready=3]="Ready",x[x.Destroyed=4]="Destroyed",x),ee={bounds:!0,classes:{container:"f-panzoom",wrapper:"f-panzoom__wrapper",content:"f-panzoom__content",viewport:"f-panzoom__viewport"},clickAction:U.ToggleFull,dblClickAction:!1,gestures:{},height:"auto",l10n:q,maxScale:4,minScale:1,mouseMoveFactor:1,panMode:"drag",protected:!1,singleClickAction:!1,spinnerTpl:'<div class="f-spinner"></div>',wheelAction:U.Zoom,width:"auto"},et=0,en=0,eo=0,ei=(e,n={},o={})=>{let i,r,d,f,g,p,m,h,v=Q.Init,y={...ee,...n},b={},E={...J},w={...J},x=[];function M(e){let t=y[e];return t&&"function"==typeof t?t(ew):t}function L(){return e&&e.parentElement&&i&&v===Q.Ready}let S=new Map;function T(e,...t){let n=[...S.get(e)||[]];for(let o of(y.on&&n.push(y.on[e]),n))o&&o instanceof Function&&o(ew,...t);"*"!==e&&T("*",e,...t)}function P(e){if(!L()||s(e.target))return;let t=Date.now(),n=u(-1,[-e.deltaX||0,-e.deltaY||0,-e.detail||0].reduce(function(e,t){return Math.abs(t)>Math.abs(e)?t:e}),1);T("wheel",e,n);let o=M("wheelAction");if(!o||e.defaultPrevented)return;let i=w.scale,l=i*(n>0?1.5:.5);if(o===U.Zoom){let o=100>Math.abs(e.deltaY)&&100>Math.abs(e.deltaX);if(t-en<(o?200:45))return void Y(e);en=t;let a=q(),r=ea();if(X(l)<X(a)&&X(i)<=X(a)?(eo+=Math.abs(n),l=a):X(l)>X(r)&&X(i)>=X(r)?(eo+=Math.abs(n),l=r):(eo=0,l=u(a,l,r)),eo>7)return}switch(Y(e),o){case U.Pan:eu(o,{srcEvent:e,deltaX:-(2*e.deltaX),deltaY:-(2*e.deltaY)});break;case U.Zoom:eu(U.ZoomTo,{srcEvent:e,scale:l,center:{x:e.clientX,y:e.clientY}});break;default:eu(o,{srcEvent:e})}}function C(n){let o=n.composedPath()[0];if(!N.isClickAllowed()||!a(o)||n.defaultPrevented||!e?.contains(o)||o.hasAttribute("disabled")||o.hasAttribute("aria-disabled"))return;let l=o.closest("[data-panzoom-action]"),r=l?.dataset?.panzoomAction,s=l?.dataset?.panzoomValue||"";if(r){switch(r){case U.ZoomTo:case U.ZoomIn:case U.ZoomOut:eu(r,{scale:parseFloat(s||"")||void 0});break;case U.MoveLeft:case U.MoveRight:eu(r,{deltaX:parseFloat(s||"")||void 0});break;case U.MoveUp:case U.MoveDown:eu(r,{deltaY:parseFloat(s||"")||void 0});break;default:eu(r)}return}if(!i?.contains(o))return;let c={srcEvent:n};if(eu(M("clickAction"),c),M("dblClickAction")){let e=Date.now(),n=e-(et||e);et=e,n>0&&n<=250?(t&&(clearTimeout(t),t=void 0),eu(M("dblClickAction"),c)):t=setTimeout(()=>{eu(M("singleClickAction"),c)},250)}}function R(e){if(h=e,!L()||!H()||E.scale<=1||w.scale<=1||(i?.dataset.animationName||"").indexOf("zoom")>-1)return;let t=V(w.scale);if(!t)return;let{x:n,y:o}=t;eu(U.Pan,{deltaX:n-w.x,deltaY:o-w.y})}function A(){e&&(W(e,"is-loading"),e.querySelector(".f-spinner")?.remove())}function O(){if(!e||!r)return;if(A(),r instanceof HTMLImageElement&&!(r.complete&&r.naturalWidth)){v=Q.Error,i?.classList.add("has-error"),T("error");return}T("loaded");let{width:t,height:n}=F();r instanceof HTMLImageElement&&(r.setAttribute("width",t+""),r.setAttribute("height",n+"")),i&&(W(i,"has-error"),r instanceof HTMLImageElement&&(i.setAttribute("width",t+""),i.setAttribute("height",n+""),i.style.aspectRatio=`${t/n||""}`)),p=z().on("start",(e,t)=>{w={...J,...t},void 0!==t.angle&&(t.angle=90*Math.round(t.angle/90)),void 0!==t.flipX&&(t.flipX=t.flipX>0?1:-1),void 0!==t.flipY&&(t.flipY=t.flipY>0?1:-1),ec(),T("animationStart")}).on("pause",e=>{w={...J,...e}}).on("step",e=>{if(!L())return void p?.end();if(E={...J,...e},H()||!M("bounds")||ey()||w.scale>E.scale||w.scale<K())return void ed();let t=er(w.scale),n=!1,o=!1,i=!1,l=!1;E.x<t.x[0]&&(n=!0),E.x>t.x[1]&&(o=!0),E.y<t.y[0]&&(l=!0),E.y>t.y[1]&&(i=!0);let a=!1,r=!1,s=!1,c=!1;w.x<t.x[0]&&(a=!0),w.x>t.x[1]&&(r=!0),w.y<t.y[0]&&(c=!0),w.y>t.y[1]&&(s=!0);let d=!1;(o&&r||n&&a)&&(w.x=u(t.x[0],w.x,t.x[1]),d=!0),(i&&s||l&&c)&&(w.y=u(t.y[0],w.y,t.y[1]),d=!0),d&&p&&p.spring({tension:94,friction:17,maxSpeed:555*w.scale,restDelta:.1,restSpeed:.1,velocity:p.getCurrentVelocities()}).from(E).to(w).start(),ed()}).on("end",()=>{es(),p?.isRunning()||(ec(),T("animationEnd"))}),function(){let e=M("gestures");e&&f&&r&&(g=N(f,e).on("start",e=>{if(!p)return;let t=e.srcEvent;H()||((E.scale>1||e.currentTouch.length>1)&&(t?.stopPropagation(),p.pause()),1===e.currentTouch.length&&T("touchStart"))}).on("move",e=>{!H()&&(1!==w.scale||e.currentTouch.length>1)&&(e.srcEvent.preventDefault(),e.srcEvent.stopPropagation())}).on("pan",e=>{if(!L()||H())return;let t=e.srcEvent;(1!==w.scale||e.currentTouch.length>1)&&(Y(t),eu(U.Pan,e))}).on("swipe",e=>{!(!L()||H())&&w.scale>1&&eu(U.Swipe,e)}).on("tap",e=>{T("click",e)}).on("singleTap",e=>{T("singleClick",e)}).on("doubleTap",e=>{T("dblClick",e)}).on("pinch",e=>{H()||(e.scale>K()?eu(U.ZoomIn,e):e.scale<K()?eu(U.ZoomOut,e):eu(U.Pan,e))}).on("end",e=>{H()||(e.currentTouch.length?(e.srcEvent.stopPropagation(),Y(e.srcEvent),p?.end()):(ec(),es(),T("touchEnd")))}).init())}(),f&&(f.addEventListener("wheel",P,{passive:!1}),x.push(()=>{f?.removeEventListener("wheel",P,{passive:!1})})),e?.addEventListener("click",C),document?.addEventListener("mousemove",R),x.push(()=>{e?.removeEventListener("click",C),document?.removeEventListener("mousemove",R)});let o=k();E={...o},w={...o},v=Q.Ready,ed(),ec(),T("ready"),requestAnimationFrame(()=>{A(),f&&(f.style.visibility="")})}function k(){let e={...M("startPos")||{}},t=e.scale,n=1;n="string"==typeof t?j(t):"number"==typeof t?t:K();let o={...J,...e,scale:n},i=H()?V(n):void 0;if(i){let{x:e,y:t}=i;o.x=e,o.y=t}return o}function _(){let e={top:0,left:0,width:0,height:0};if(i){let t=i.getBoundingClientRect();w.angle%180==90?(e.top=t.top+.5*t.height-.5*t.width,e.left=t.left+.5*t.width-.5*t.height,e.width=t.height,e.height=t.width):(e.top=t.top,e.left=t.left,e.width=t.width,e.height=t.height)}return e}function F(){let e=M("width"),t=M("height");if(r&&"auto"===e){let t=r.getAttribute("width");e=t?parseFloat(t+""):void 0!==r.dataset.width?parseFloat(r.dataset.width+""):f instanceof HTMLImageElement?f.naturalWidth:r instanceof HTMLImageElement?r.naturalWidth:r.getBoundingClientRect().width}else e=l(e)?parseFloat(e):e;if(r&&"auto"===t){let e=r.getAttribute("height");t=e?parseFloat(e+""):void 0!==r.dataset.height?parseFloat(r.dataset.height+""):f instanceof HTMLImageElement?f.naturalHeight:r instanceof HTMLImageElement?r.naturalHeight:r.getBoundingClientRect().height}else t=l(t)?parseFloat(t):t;return{width:e,height:t}}function D(){let e=_();return{width:e.width,height:e.height}}function H(){return"mousemove"===M("panMode")&&matchMedia("(hover: hover)").matches}function V(e){let t=h||M("event"),n=i?.getBoundingClientRect();if(!t||!n||e<=1)return{x:0,y:0};let o=(t.clientX||0)-n.left,l=(t.clientY||0)-n.top,{width:a,height:r}=D(),s=er(e);if(e>1){let t=M("mouseMoveFactor");t>1&&(e*=t)}let c=a*e,d=r*e,f=(c-a)*.5-o/a*100/100*(c-a),g=(d-r)*.5-l/r*100/100*(d-r);return{x:f=u(s.x[0],f,s.x[1]),y:g=u(s.y[0],g,s.y[1])}}function j(t="base"){if(!e)return 1;let n=e.getBoundingClientRect(),o=_(),{width:i,height:l}=F(),a=e=>{if("number"==typeof e)return e;switch(e){case"min":case"base":return 1;case"cover":return Math.max(n.height/o.height,n.width/o.width)||1;case"full":case"max":{let e=w.angle%180==90?l:i;return e&&o.width?e/o.width:1}}},r=M("minScale"),s=M("maxScale"),c=Math.min(a("full"),a(r)),d="number"==typeof s?a("full")*s:Math.min(a("full"),a(s));switch(t){case"min":return c;case"base":return u(c,1,d);case"cover":return a("cover");case"full":return Math.min(d,a("full"));case"max":return d}}function q(){return j("min")}function K(){return j("base")}function ei(){return j("cover")}function el(){return j("full")}function ea(){return j("max")}function er(t){let n={x:[0,0],y:[0,0]},o=e?.getBoundingClientRect();if(!o)return n;let i=_(),l=o.width,a=o.height,r=i.width,s=i.height,c=t=void 0===t?w.scale:t,u=t;if(H()&&t>1){let e=M("mouseMoveFactor");e>1&&(r*t>l+.01&&(c*=e),s*t>a+.01&&(u*=e))}return r*=c,s*=u,t>1&&(r>l&&(n.x[0]=(l-r)*.5,n.x[1]=(r-l)*.5),n.x[0]-=(i.left-o.left)*.5,n.x[1]-=(i.left-o.left)*.5,n.x[0]-=(i.left+i.width-o.right)*.5,n.x[1]-=(i.left+i.width-o.right)*.5,s>a&&(n.y[0]=(a-s)*.5,n.y[1]=(s-a)*.5),n.y[0]-=(i.top-o.top)*.5,n.y[1]-=(i.top-o.top)*.5,n.y[0]-=(i.top+i.height-o.bottom)*.5,n.y[1]-=(i.top+i.height-o.bottom)*.5),n}function es(){if(!L()||!M("bounds")||!p)return;let e=q(),t=ea(),n=u(e,w.scale,t);if(w.scale<e-.01||w.scale>t+.01)return void eu(U.ZoomTo,{scale:n});if(p.isRunning()||ey())return;let o=er(n);w.x<o.x[0]||w.x>o.x[1]||w.y<o.y[0]||w.y>o.y[1]?(w.x=u(o.x[0],w.x,o.x[1]),w.y=u(o.y[0],w.y,o.y[1]),p.spring({tension:170,friction:17,restDelta:.001,restSpeed:.001,maxSpeed:1/0,velocity:p.getCurrentVelocities()}),p.from(E).to(w).start()):ed()}function ec(){if(!L())return;let t=ev(),n=ey(),o=eb(),l=eE(),a=eg(),r=ep();Z(i,"is-fullsize",l),Z(i,"is-expanded",o),Z(i,"is-dragging",n),Z(i,"can-drag",t),Z(i,"will-zoom-in",a),Z(i,"will-zoom-out",r);let s=em(),c=eh(),u=!L();for(let t of e?.querySelectorAll("[data-panzoom-action]")||[]){let e=t.dataset.panzoomAction,n=!1;if(u)n=!0;else switch(e){case U.ZoomIn:s||(n=!0);break;case U.ZoomOut:c||(n=!0);break;case U.ToggleFull:s||c||(n=!0);let o=t.querySelector("g");o&&(o.style.display=l?"none":"");break;case U.ToggleCover:case U.ToggleMax:s||c||(n=!0)}n?(t.setAttribute("aria-disabled",""),t.setAttribute("tabindex","-1")):(t.removeAttribute("aria-disabled"),t.removeAttribute("tabindex"))}}function eu(t,n){if(!e||!r||!p||t===U.Swipe&&Math.abs(p.getCurrentVelocities().scale)>.01)return;let o={...w},i=er(H()?w.scale:E.scale),l=p.getCurrentVelocities(),a=_();n=n||{};let s=(n.currentTouch?.length||0)>1,c=n.velocityX||0,d=n.velocityY||0,f=n.center;!f&&n.srcEvent&&(f=$(I(n.srcEvent)));let g=n.deltaX||0,m=n.deltaY||0;switch(t){case U.MoveRight:g=n.deltaX||100;break;case U.MoveLeft:g=n.deltaX||-100;break;case U.MoveUp:m=n.deltaY||-100;break;case U.MoveDown:m=n.deltaY||100}let h=[];switch(t){case U.Reset:(w={...J}).scale=K();break;case U.Pan:case U.Move:case U.MoveLeft:case U.MoveRight:case U.MoveUp:case U.MoveDown:if(ey()){let e=1,t=1;w.x<=i.x[0]&&c<=0&&(e=.2*Math.max(.01,1-Math.abs(1/a.width*Math.abs(w.x-i.x[0])))),w.x>=i.x[1]&&c>=0&&(e=.2*Math.max(.01,1-Math.abs(1/a.width*Math.abs(w.x-i.x[1])))),w.y<=i.y[0]&&d<=0&&(t=.2*Math.max(.01,1-Math.abs(1/a.height*Math.abs(w.y-i.y[0])))),w.y>=i.y[1]&&d>=0&&(t=.2*Math.max(.01,1-Math.abs(1/a.height*Math.abs(w.y-i.y[1])))),w.x+=g*e,w.y+=m*t}else w.x=u(i.x[0],w.x+g,i.x[1]),w.y=u(i.y[0],w.y+m,i.y[1]);break;case U.Swipe:let v=(e=0)=>Math.sign(e)*Math.pow(Math.abs(e),1.5);w.x+=u(-1e3,v(c),1e3),w.y+=u(-1e3,v(d),1e3),d&&!c&&(w.x=u(i.x[0],w.x,i.x[1])),!d&&c&&(w.y=u(i.y[0],w.y,i.y[1])),l.x=c,l.y=d;break;case U.ZoomTo:w.scale=n.scale||1;break;case U.ZoomIn:w.scale=w.scale*(n.scale||2),s||(w.scale=Math.min(w.scale,ea()));break;case U.ZoomOut:w.scale=w.scale*(n.scale||.5),s||(w.scale=Math.max(w.scale,q()));break;case U.ToggleCover:h=[K(),ei()];break;case U.ToggleFull:h=[K(),el()];break;case U.ToggleMax:h=[K(),ea()];break;case U.IterateZoom:h=[K(),el(),ea()];break;case U.Zoom:let y=el();w.scale>=y-.05?w.scale=K():w.scale=Math.min(y,w.scale*(n.scale||2));break;case U.RotateCW:w.angle+=90;break;case U.RotateCCW:w.angle-=90;break;case U.FlipX:w.flipX*=-1;break;case U.FlipY:w.flipY*=-1}if(void 0!==E.angle&&Math.abs(E.angle)>=360&&(w.angle-=360*Math.floor(E.angle/360),E.angle-=360*Math.floor(E.angle/360)),h.length){let e=h.findIndex(e=>e>w.scale+1/G);w.scale=h[e]||h[0]}if(s&&(w.scale=u(q()*(s?.8:1),w.scale,ea()*(s?1.6:1))),H()){let e=V(w.scale);if(e){let{x:t,y:n}=e;w.x=t,w.y=n}}else if(w.scale!==o.scale){let t=0,n=0;if(f)t=f.x,n=f.y;else{let o=e.getBoundingClientRect();t=o.x+.5*o.width,n=o.y+.5*o.height}let l=t-a.left,r=n-a.top;l-=.5*a.width,r-=.5*a.height;let c=(l-o.x)/o.scale,d=(r-o.y)/o.scale;w.x=l-c*w.scale,w.y=r-d*w.scale,!s&&M("bounds")&&(i=er(),w.x=u(i.x[0],w.x,i.x[1]),w.y=u(i.y[0],w.y,i.y[1]))}if(t===U.Swipe){let e=500*w.scale;p.spring({tension:94,friction:17,maxSpeed:e,restDelta:.1,restSpeed:.1,velocity:l})}else t===U.Pan||s?p.spring({tension:900,friction:17,restDelta:.01,restSpeed:.01,maxSpeed:1}):p.spring({tension:170,friction:17,restDelta:.001,restSpeed:.001,maxSpeed:1/0,velocity:l});t===U.Reset||0===n.velocity?E={...w}:p.from(E).to(w).start(),T("action",t)}function ed(){if(!r)return;if(i){let{width:e,height:t}=F();i.style.maxWidth=`min(${e}px, 100%)`,i.style.maxHeight=`min(${t}px, 100%)`}let{x:t,y:n,scale:o,angle:l,flipX:a,flipY:s}=E,c=`translate3d(${t}px, ${n}px, 0)`;1!==a||1!==s?c+=` scaleX(${o*a}) scaleY(${o*s})`:1!==o&&(c+=` scale(${o})`),l%360!=0&&(c+=` rotate(${l}deg)`);let u=function(){let{width:t,height:n}=F(),{width:o,height:i}=D();if(!e)return{x:0,y:0,width:0,height:0,scale:0,flipX:0,flipY:0,angle:0,fitWidth:o,fitHeight:i,fullWidth:t,fullHeight:n};let{x:l,y:a,scale:r,angle:s,flipX:c,flipY:u}=E,d=1/el(),f=t,g=n,p=E.scale*d,m=w.scale*d,h=Math.max(o,i),v=Math.min(o,i);t>n?(f=h,g=v):(f=v,g=h),p=t>n?h*r/t||1:h*r/n||1;let y=f?t*m:0,b=g?n*m:0,x=f&&g?t*p/y:0;return{x:l=l+.5*f-.5*y,y:a=a+.5*g-.5*b,width:y,height:b,scale:x,flipX:c,flipY:u,angle:s,fitWidth:o,fitHeight:i,fullWidth:t,fullHeight:n}}();if(u){let{x:e,y:t,width:n,height:o,scale:i,flipX:a,flipY:r}=u,s=`translate(${X(e)}px, ${X(t)}px)`;1!==a||1!==r?s+=` scaleX(${X(i*a)}) scaleY(${X(i*r)})`:s+=` scale(${X(i)})`,0!==l&&(s+=` rotate(${l}deg)`),f&&(f.style.width=`${X(n)}px`,f.style.height=`${X(o)}px`,f.style.transform=`${s}`)}T("render")}function ef(){let e=w.scale,t=void 0,n=M("clickAction"),o=K();if(n){let i=[];switch(n){case U.ZoomIn:o=e*(t||2);break;case U.ZoomOut:o=e*(t||.5);break;case U.ToggleCover:i=[K(),ei()];break;case U.ToggleFull:i=[K(),el()];break;case U.ToggleMax:i=[K(),ea()];break;case U.IterateZoom:i=[K(),el(),ea()];break;case U.Zoom:let l=el();o=e>=l-.05?K():Math.min(l,e*(t||2))}if(i.length){let t=i.findIndex(t=>t>e+1/G);o=i[t]||K()}}return u(q(),o,ea())}function eg(){return!!(L()&&ef()>w.scale)}function ep(){return!!(L()&&ef()<w.scale)}function em(){return!!(L()&&w.scale<ea())}function eh(){return!!(L()&&w.scale>q())}function ev(){return!!(L()&&eb()&&g&&!H())}function ey(){return!!(L()&&g?.isPointerDown()&&!H())}function eb(){return!!(L()&&w.scale>K())}function eE(){return!!(L()&&w.scale>=el())}let ew={canDrag:ev,canZoomIn:em,canZoomOut:eh,destroy:function(){for(let e of(T("destroy"),Object.values(b)))e?.destroy(ew);for(let e of x)e();return i&&(i.style.aspectRatio="",i.style.maxWidth="",i.style.maxHeight=""),f&&(f.style.width="",f.style.height="",f.style.transform=""),i=void 0,r=void 0,f=void 0,E={...J},w={...J},p?.destroy(),p=void 0,g?.destroy(),g=void 0,v=Q.Destroyed,ew},emit:T,execute:eu,getBoundaries:er,getContainer:function(){return e},getContent:function(){return r},getFullDim:F,getGestures:function(){return g},getMousemovePos:V,getOptions:function(){return y},getScale:j,getStartPosition:k,getState:function(){return v},getTransform:function(e){return!0===e?w:E},getTween:function(){return p},getViewport:function(){return f},getWrapper:function(){return i},init:function(){return v=Q.Init,T("init"),function(){for(let[e,t]of Object.entries({...o,...y.plugins||{}}))if(e&&!b[e]&&t instanceof Function){let n=t();n.init(ew),b[e]=n}T("initPlugins")}(),function(){let t={...ee.classes,...M("classes")};if(e&&(B(e,t.container),r=e.querySelector("."+t.content))){if(r.setAttribute("draggable","false"),(i=e.querySelector("."+t.wrapper))||(B(i=document.createElement("div"),t.wrapper),r.insertAdjacentElement("beforebegin",i),i.insertAdjacentElement("afterbegin",r)),(f=e.querySelector("."+t.viewport))||(B(f=document.createElement("div"),t.viewport),f.insertAdjacentElement("afterbegin",r),i.insertAdjacentElement("beforeend",f)),(d=r.cloneNode(!0)).removeAttribute("id"),i.insertAdjacentElement("afterbegin",d),r instanceof HTMLPictureElement&&(r=r.querySelector("img")),d instanceof HTMLPictureElement&&(d=d.querySelector("img")),f instanceof HTMLPictureElement&&(f=f.querySelector("img")),f&&(f.style.visibility="hidden",M("protected"))){f.addEventListener("contextmenu",e=>{e.preventDefault()});let e=document.createElement("div");B(e,"f-panzoom__protected"),f.appendChild(e)}T("initLayout")}}(),function(){if(e&&i&&!m){let e=null;(m=new ResizeObserver(()=>{L()&&(e=e||requestAnimationFrame(()=>{L()&&(ec(),es(),T("refresh")),e=null}))})).observe(i),x.push(()=>{m?.disconnect(),m=void 0,e&&(cancelAnimationFrame(e),e=null)})}}(),function(){if(!e||!r)return;if(!(r instanceof HTMLImageElement&&d instanceof HTMLImageElement))return O();let t=()=>{r&&r instanceof HTMLImageElement&&r.decode().then(()=>{O()}).catch(()=>{O()})};if(v=Q.Loading,e.classList.add("is-loading"),T("loading"),d.src&&d.complete)return t();(function(){if(!e||e?.querySelector(".f-spinner"))return;let t=c(M("spinnerTpl"));t&&(t.classList.add("f-spinner"),e.classList.add("is-loading"),i?.insertAdjacentElement("afterbegin",t))})(),d.addEventListener("load",t,!1),d.addEventListener("error",t,!1),x.push(()=>{d?.removeEventListener("load",t,!1),d?.removeEventListener("error",t,!1)})}(),ew},isDragging:ey,isExpanded:eb,isFullsize:eE,localize:function(e,t=[]){let n=M("l10n")||{};e=String(e).replace(/\{\{(\w+)\}\}/g,(e,t)=>n[t]||e);for(let n=0;n<t.length;n++)e=e.split(t[n][0]).join(t[n][1]);return e.replace(/\{\{(.*?)\}\}/g,(e,t)=>t)},off:function(e,t){for(let n of e instanceof Array?e:[e])S.has(n)&&S.set(n,S.get(n).filter(e=>e!==t));return ew},on:function(e,t){for(let n of e instanceof Array?e:[e])S.set(n,[...S.get(n)||[],t]);return ew},version:"6.0.29",willZoomIn:eg,willZoomOut:ep};return ew};ei.l10n={en_EN:q},ei.getDefaults=()=>ee;let el=(e,t)=>{let n=[];return e.childNodes.forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&(!t||e.matches(t))&&n.push(e)}),n},ea=(e,...t)=>{let n=t.length;for(let o=0;o<n;o++)Object.entries(t[o]||{}).forEach(([t,n])=>{let o=Array.isArray(n)?[]:{};e[t]||Object.assign(e,{[t]:o}),d(n)?Object.assign(e[t],ea(e[t],n)):Array.isArray(n)?Object.assign(e,{[t]:[...n]}):Object.assign(e,{[t]:n})});return e},er=function(e=0,t=0,n=0,o=0,i=0,l=!1){let a=(e-t)/(n-t)*(i-o)+o;return l?o<i?u(o,a,i):u(i,a,o):a},es={...q,ERROR:"Something went wrong. <br /> Please try again later.",NEXT:"Next page",PREV:"Previous page",GOTO:"Go to page #%d",DOWNLOAD:"Download",TOGGLE_FULLSCREEN:"Toggle full-screen mode",TOGGLE_EXPAND:"Toggle full-size mode",TOGGLE_THUMBS:"Toggle thumbnails",TOGGLE_AUTOPLAY:"Toggle slideshow"},ec=e=>{e.cancelable&&e.preventDefault()},eu=((M={})[M.Init=0]="Init",M[M.Ready=1]="Ready",M[M.Destroyed=2]="Destroyed",M),ed=((L={})[L.Loading=0]="Loading",L[L.Loaded=1]="Loaded",L[L.Error=2]="Error",L),ef={adaptiveHeight:!1,center:!0,classes:{container:"f-carousel",isEnabled:"is-enabled",isLTR:"is-ltr",isRTL:"is-rtl",isHorizontal:"is-horizontal",isVertical:"is-vertical",hasAdaptiveHeight:"has-adaptive-height",viewport:"f-carousel__viewport",slide:"f-carousel__slide",isSelected:"is-selected"},dragFree:!1,enabled:!0,errorTpl:'<div class="f-html">{{ERROR}}</div>',fill:!1,infinite:!0,initialPage:0,l10n:es,rtl:!1,slides:[],slidesPerPage:"auto",spinnerTpl:'<div class="f-spinner"></div>',transition:"fade",tween:{clamp:!0,mass:1,tension:160,friction:25,restDelta:1,restSpeed:1,velocity:0},vertical:!1},eg=0,ep=(e,t={},o={})=>{let i,r,f,g,p;eg++;let m=eu.Init,h={...ef},v={...ef},y={},b=null,E=null,w=!1,x=!1,M=!1,L=!1,S="height",T=0,P=!0,C=0,R=0,A=0,O=0,k="*",I=[],$=[],_=new Set,F=[],D=[],H=0,V=0,j=0;function q(e,...t){let n=v[e];return n&&n instanceof Function?n(ek,...t):n}function G(e,t=[]){let n=q("l10n")||{};e=String(e).replace(/\{\{(\w+)\}\}/g,(e,t)=>n[t]||e);for(let n=0;n<t.length;n++)e=e.split(t[n][0]).join(t[n][1]);return e.replace(/\{\{(.*?)\}\}/g,(e,t)=>t)}let Y=new Map;function X(e,...t){let n=[...Y.get(e)||[]];for(let o of(v.on&&n.push(v.on[e]),n))o&&o instanceof Function&&o(ek,...t);"*"!==e&&X("*",e,...t)}function U(){let e=ea({},ef,h);ea(e,ef,h);let t="",n=h.breakpoints||{};if(n)for(let[o,i]of Object.entries(n))window.matchMedia(o).matches&&(t+=o,ea(e,i));if(void 0===p||t!==p){if(p=t,m!==eu.Init){let t=D[C]?.slides[0]?.index;for(let n of(void 0===t&&(t=v.initialSlide),e.initialSlide=t,e.slides=[],I))n.isVirtual&&e.slides.push(n)}eA(),!1!==(v=e).enabled&&(m=eu.Init,X("init"),function(){for(let[e,t]of Object.entries({...o,...v.plugins||{}}))if(e&&!y[e]&&t instanceof Function){let n=t();n.init(ek,ep),y[e]=n}X("initPlugins")}(),function(){if(!b)return;let e=q("classes")||{};B(b,e.container);let t=q("style");if(t&&d(t))for(let[e,n]of Object.entries(t))b.style.setProperty(e,n);(E=b.querySelector(`.${e.viewport}`))||(B(E=document.createElement("div"),e.viewport),E.append(...el(b,`.${e.slide}`)),b.insertAdjacentElement("afterbegin",E)),b.carousel=ek,X("initLayout")}(),function(){if(!E)return;let e=q("classes")||{};for(let t of(I=[],[...el(E,`.${e.slide}`)].forEach(e=>{e.parentElement&&I.push(eh({el:e,isVirtual:!1,...e.dataset||{}}))}),em(q("slides")),I))X("addSlide",t);for(let e of I){let t=e.el;t?.parentElement&&(B(t,v.classes.slide),B(t,e.class),eP(e),X("attachSlideEl",e))}X("initSlides")}(),eE(),function(){if(b&&(b.addEventListener("click",eL,{passive:!1}),document.addEventListener("mousemove",K),!f)){let e=null;(f=new ResizeObserver(t=>{e||(e=requestAnimationFrame(()=>{(function(e){if(!b)return;if(m===eu.Init){let t=e[0]?.contentBoxSize[0],n=t?.blockSize||0,o=t?.inlineSize||0;H=n,V=o,m=eu.Ready,B(b,(q("classes")||{}).isEnabled),eR(),r=z().on("start",()=>{i&&i.isPointerDown()||(ee(),eR())}).on("step",e=>{let t=T;(T=e.pos)!==t&&(P=!1,eR())}).on("end",e=>{!i?.isPointerDown()&&(T=e.pos,r&&!x&&(T<A||T>O)?r.spring({clamp:!0,mass:1,tension:200,friction:25,velocity:0,restDelta:1,restSpeed:1}).from({pos:T}).to({pos:u(A,T,O)}).start():P||(P=!0,X("settle")))}),J(),et(),X("ready");return}if(m!==eu.Ready)return;let t=D.length;eE(),J();let n=b.getBoundingClientRect(),o=n.height,l=n.width;if(!(t>1&&(L&&.5>Math.abs(o-H)||!L&&.5>Math.abs(l-V))))H=o,V=l,(!L||o)&&(L||l)&&b&&E&&(t===D.length&&i?.isPointerDown()||(q("dragFree")&&(x||T>A&&T<O)?(ee(),eR()):eC(C,{transition:!1})))})(t),e=null}))})).observe(b)}}())}}function K(e){n=e}function J(){if(!E)return;let e=q("gestures");if(!1===e){i&&(i.destroy(),i=void 0);return}i||(i=N(E,e).on("start",e=>{if(!r)return;let{srcEvent:t}=e;L&&s(t.target),r.pause(),r.getCurrentVelocities().pos=0;let n=D[C]?.slides[0];n&&_.has(n.index)&&n.el&&(T=(n.offset||0)+(function(e){let t=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return{width:t.m41||0,height:t.m42||0}}(n.el)[S]||0)*(M&&!L?1:-1)),ex(),!x&&(T<A||T>O)&&r.spring({clamp:!0,mass:1,tension:500,friction:25,velocity:r.getCurrentVelocities()?.pos||0,restDelta:1,restSpeed:1}).from({pos:T}).to({pos:u(A,T,O)}).start()}).on("move",e=>{let{srcEvent:t,axis:n}=e,o=e.srcEvent.target;o&&s(o)||(n||(t.stopPropagation(),t.stopImmediatePropagation()),("y"===n&&L||"x"===n&&!L)&&(ec(t),t.stopPropagation()))}).on("panstart",e=>{e?.axis===(L?"y":"x")&&B(E,"is-dragging")}).on("panend",()=>{W(E,"is-dragging")}).on("pan",e=>{let{deltaX:t,deltaY:n,currentTouch:o,axis:i}=e;if(!r||o.length>1||"y"===i&&!L||"x"===i&&L)return;let l=M&&!L?1:-1,a=L?n:t,s=r?.isRunning()?r.getEndValues().pos:T,c=1;!x&&(s<=A&&a*l<0?c=.2*Math.max(.01,1-Math.abs(1/ei()*Math.abs(s-A))):s>=O&&a*l>0&&(c=.2*Math.max(.01,1-Math.abs(1/ei()*Math.abs(s-O))))),s+=a*c*l,r.spring({clamp:!0,mass:1,tension:700,friction:25,velocity:r.getCurrentVelocities()?.pos||0,restDelta:1,restSpeed:1}).from({pos:T}).to({pos:s}).start()}).on("end",e=>{let{axis:t,velocityX:n,velocityY:o,currentTouch:i}=e,l=D.length,a=q("dragFree");if(i.length>0||!r||!l)return;let s=q("vertical")?o:n,c=r?.isRunning()?r.getEndValues().pos:T,d=M&&!L?1:-1;if(c+=s*(a?5:1)*d,!x&&(s*d<=0&&c<A||s*d>=0&&c>O)){let e=0;Math.abs(s)>0&&(e=2*Math.abs(s),e=Math.min(.3*ei(),e)),c=u(A+-1*e,c,O+e),r.spring({clamp:!0,mass:1,tension:380,friction:25,velocity:-1*s,restDelta:1,restSpeed:1}).from({pos:T}).to({pos:c}).start();return}if(a||y.Autoscroll?.isEnabled())return void(Math.abs(s)>10?r.spring({clamp:!0,mass:1,tension:150,friction:25,velocity:-1*s,restDelta:1,restSpeed:1}).from({pos:T}).to({pos:c}).start():r.isRunning()||P||(P=!0,X("settle")));if(!(a||y.Autoscroll?.isEnabled())&&(!(e.offsetX||e.offsetY)||"y"===t&&!L||"x"===t&&L))return void eC(C,{transition:"tween"});let f=eo(c);Math.abs(s)>10&&f===C&&(s>0?f+=M&&!L?1:-1:f+=M&&!L?-1:1),eC(f,{transition:"tween",tween:{velocity:-1*s}})}).init())}function Q(e="*"){let t=[];for(let n of I)("*"===e||n.class&&n.class.includes(e)||n.el&&n.el?.classList.contains(e))&&t.push(n);g=void 0,k=e,$=[...t]}function ee(){if(!r)return;let e=eo(r?.isRunning()?r.getEndValues().pos:T);e!==C&&(g=C,C=e,eP(),et(),en(),X("change",C,g))}function et(){if(!b)return;for(let e of(Z(E,"is-draggable",!!i&&D.length>0),b.querySelectorAll("[data-carousel-index]")))e.innerHTML=C+"";for(let e of b.querySelectorAll("[data-carousel-page]"))e.innerHTML=C+1+"";for(let e of b.querySelectorAll("[data-carousel-pages]"))e.innerHTML=D.length+"";for(let e of b.querySelectorAll("[data-carousel-go-prev]"))e.toggleAttribute("aria-disabled",!eO()),eO()?e.removeAttribute("tabindex"):e.setAttribute("tabindex","-1");for(let e of b.querySelectorAll("[data-carousel-go-next]"))e.toggleAttribute("aria-disabled",!ez()),ez()?e.removeAttribute("tabindex"):e.setAttribute("tabindex","-1");let e=!1,t=D[C]?.slides[0];for(let n of(t&&(t.downloadSrc||"image"===t.type&&t.src)&&(e=!0),b.querySelectorAll("[data-carousel-download]")))n.toggleAttribute("aria-disabled",!e)}function en(e){e||(e=D[C]?.slides[0]);let t=e.el;if(t)for(let n of t.querySelectorAll("[data-slide-index]"))n.innerHTML=e.index+1+""}function eo(e){if(!D.length||!r)return 0;let t=es(),n=e;x?n-=Math.floor((e-D[0]?.pos)/t)*t:n=u(D[0]?.pos,e,D[D.length-1]?.pos);let o=new Map,i=0;for(let e of D){let l=Math.abs(e.pos-n),a=Math.min(l,Math.abs(e.pos-n-t),Math.abs(e.pos-n+t));o.set(i,a),i++}return parseInt((o.size>0?[...o.entries()].reduce((e,t)=>t[1]<e[1]?t:e):[C,0])[0])}function ei(){return E&&E.getBoundingClientRect()[S]||0}function es(e=!0){return $.reduce((e,t)=>e+t.dim,0)+($.length-(x&&e?0:1))*j}function ed(e){let t=es(),n=ei();if(!E)return[];let o=[];if(!t||!n)return[];e=void 0===e?T:e,x&&(e-=Math.floor(e/t)*t);let i=0,l=0;if(w){let e=E.getBoundingClientRect();i=Math.abs(e.left),l=Math.abs(window.innerWidth-e.right)}let a=0;for(let r of $){let s=(t=0)=>{!(o.indexOf(r)>-1)&&(r.pos=a-e+t||0,r.offset+t>e-r.dim-i+.51&&r.offset+t<e+n+l-.51&&o.push(r))};r.offset=a,x&&(s(t),s(-1*t)),s(),a+=r.dim+j}return o}function em(e,t){let n=[];for(let t of Array.isArray(e)?e:[e]){let e=eh({...t,isVirtual:!0});n.push(e)}for(let e of(I.splice(void 0===t?I.length:t,0,...n),eb(),n))!function(e){if(!e)return;let t=e.el;t||(e.el=t=document.createElement("div"));let n=e.html?e.html instanceof HTMLElement?e.html:c(e.html):void 0;n&&(B(n,"f-html"),e.htmlEl=n,B(t,"has-html"),t.append(n),X("contentReady",e))}(e);return Q(k),n}function eh(e){return(l(e)||e instanceof HTMLElement)&&(e={html:e}),{index:-1,el:void 0,class:"",isVirtual:!0,dim:0,pos:0,offset:0,html:"",src:"",...e}}function ev(e){if(!E||!e)return;let t=e.el;if(t){if(t.setAttribute("index",e.index+""),t.parentElement!==E){let n;for(let o of(B(t,v.classes.slide),B(t,e.class),eP(e),I))if(o.index>e.index){n=o.el;break}E.insertBefore(t,n&&E.contains(n)?n:null),X("attachSlideEl",e)}return en(e),t}}function ey(e){let t=e?.el;t&&(t.remove(),ew(t),X("detachSlideEl",e))}function eb(){for(let e=0;e<I.length;e++){let t=I[e],n=t.el;n&&(t.index!==e&&ew(n),n.setAttribute("index",`${e}`)),t.index=e}}function eE(){if(!b||!E)return;M=q("rtl"),S=(L=q("vertical"))?"height":"width";let e=q("classes");Z(b,e.isLTR,!M),Z(b,e.isRTL,M),Z(b,e.isHorizontal,!L),Z(b,e.isVertical,L),Z(b,e.hasAdaptiveHeight,q("adaptiveHeight")),w="visible"===window.getComputedStyle(E).getPropertyValue("overflow-"+(L?"y":"x"));let t=E.getBoundingClientRect();if(!t.width&&!t.height)return;j=E&&parseFloat(getComputedStyle(E).getPropertyValue("--f-carousel-gap"))||0;let n=function(){let e=0;if(E){let t=document.createElement("div");B(t,v.classes.slide),E.appendChild(t),e=t.getBoundingClientRect()[S],t.remove(),t=void 0}return e}();for(let e of $){let t=e.el,o=0;if(!e.isVirtual&&t&&a(t)){let e=!1;t.parentElement&&t.parentElement===E||(E.appendChild(t),e=!0),o=t.getBoundingClientRect()[S],e&&t.parentElement?.removeChild(t)}else o=n;e.dim=o}if(x=!1,q("infinite")){x=!0;let e=es(),t=ei();if(w){let e=E.getBoundingClientRect();t+=e.left,t+=e.right-e.width}for(let n=0;n<$.length;n++){let o=$[n]?.dim+j;if(e-o<t&&e-o-t<o){x=!1;break}}}if(!function(){let e;if(!b)return;eb();let t=ei(),n=es(!1),o=q("slidesPerPage");o="auto"===o?1/0:parseFloat(o+""),D=[];let i=0,l=0;for(let e of $)(!D.length||i+e.dim-t>.05||l>=o)&&(D.push({index:D.length,slides:[],dim:0,offset:0,pos:0}),i=0,l=0),D[D.length-1]?.slides.push(e),i+=e.dim+j,l++;let a=q("center"),r=q("fill"),s=0;for(let e of D){for(let t of(e.dim=(e.slides.length-1)*j,e.slides))e.dim+=t.dim;e.offset=s,e.pos=s,!1!==a&&(e.pos-=(t-e.dim)*.5),r&&!x&&n>t&&(e.pos=u(0,e.pos,n-t)),s+=e.dim+j}let c=[];for(let t of D){let n={...t};e&&.1>Math.abs(n.pos-e.pos)?(e.dim+=n.dim,e.slides=[...e.slides,...n.slides]):(e=n,n.index=c.length,c.push(n))}D=c,et()}(),A=D[0]?.pos||0,O=D[D.length-1]?.pos||0,m===eu.Init){g=void 0,C=q("initialPage");let e=q("initialSlide")||void 0;void 0!==e&&(C=ek.getPageIndex(e)||0),C=u(0,C,D.length-1),R=T=D[C]?.pos||0}else{let e=r?.isRunning()?r.getEndValues().pos:T;(e<A||e>O)&&(C=u(0,C,D.length-1),R=D[C||0]?.pos||0)}X("refresh")}function ew(e){if(!e||!a(e))return;let t=parseInt(e.getAttribute("index")||"-1"),n="";for(let t of Array.from(e.classList)){let e=t.match(/^f-(\w+)(Out|In)$/);e&&e[1]&&(n=e[1]+"")}if(!e||!n)return;let o=[`f-${n}Out`,`f-${n}In`,"to-prev","to-next","from-prev","from-next"];e.removeEventListener("animationend",eM),W(e,o.join(" ")),_.delete(t)}function ex(){if(!E)return;let e=_.size;for(let e of $)ew(e.el);_.clear(),e&&eR()}function eM(e){"f-"===e.animationName.substring(0,2)&&(ew(e.target),!_.size&&(W(b,"in-transition"),!P&&.5>Math.abs(ek.getPosition(!0)-R)&&(P=!0,X("settle"))),eR())}function eL(e){if(e.defaultPrevented)return;let t=e.composedPath()[0];if(t.closest("[data-carousel-go-prev]")){ec(e),ek.prev();return}if(t.closest("[data-carousel-go-next]")){ec(e),ek.next();return}let n=t.closest("[data-carousel-go-to]");if(n){ec(e),ek.goTo(parseFloat(n.dataset.carouselGoTo||"")||0);return}if(t.closest("[data-carousel-download]")){ec(e);let t=D[C]?.slides[0];if(t&&(t.downloadSrc||"image"===t.type&&t.src)){let e=t.downloadFilename,n=document.createElement("a"),o=t.downloadSrc||t.src||"";n.href=o,n.target="_blank",n.download=e||o,n.click()}return}X("click",e)}function eS(e){let t=e.el;t&&t.querySelector(".f-spinner")?.remove()}function eT(e){let t=e.el;t&&(t.querySelector(".f-html.is-error")?.remove(),W(t,"has-error"))}function eP(e){e||(e=D[C]?.slides[0]);let t=e?.el;if(!t)return;let n=q("formatCaption",e);void 0===n&&(n=e.caption),n=n||"";let o=q("captionEl");if(o&&o instanceof HTMLElement){if(e.index!==C)return;if(l(n)&&(o.innerHTML=G(n+"")),n instanceof HTMLElement){if(n.parentElement===o)return;o.innerHTML="",n.parentElement&&(n=n.cloneNode(!0)),o.append(n)}return}if(!n)return;let i=e.captionEl||t.querySelector(".f-caption");!i&&n instanceof HTMLElement&&n.classList.contains("f-caption")&&(i=n),!i&&(B(i=document.createElement("div"),"f-caption"),l(n)?i.innerHTML=G(n+""):n instanceof HTMLElement&&(n.parentElement&&(n=n.cloneNode(!0)),i.append(n)));let a=`f-caption-${eg}_${e.index}`;i.setAttribute("id",a),i.dataset.selectable="true",B(t,"has-caption"),t.setAttribute("aria-labelledby",a),e.captionEl=i,t.insertAdjacentElement("beforeend",i)}function eC(e,t={}){let{transition:n,tween:o}={...{transition:v.transition,tween:v.tween},...t||{}};if(!b||!r)return;let i=D.length;if(!i||function(e,t){if(!b||!r||!t||!l(t)||"tween"===t||D[C]?.slides.length>1)return!1;let n=D.length,o=e>C?1:-1;e=x?(e%n+n)%n:u(0,e,n-1),M&&(o*=-1);let i=D[C]?.slides[0],a=i?.index,s=D[e]?.slides[0],c=s?.index,d=D[e]?.pos;if(void 0===c||void 0===a||a===c||T===d||Math.abs(ei()-(s?.dim||0))>1)return!1;P=!1,r.pause(),ex(),B(b,"in-transition"),T=R=d;let f=ev(i),g=ev(s);return ee(),f&&(_.add(a),f.style.transform="",f.addEventListener("animationend",eM),W(f,v.classes.isSelected),f.inert=!1,B(f,`f-${t}Out to-${o>0?"next":"prev"}`)),g&&(_.add(c),g.style.transform="",g.addEventListener("animationend",eM),B(g,v.classes.isSelected),g.inert=!1,B(g,`f-${t}In from-${o>0?"prev":"next"}`)),eR(),!0}(e,n))return;e=x?(e%i+i)%i:u(0,e,i-1),R=D[e||0]?.pos||0;let a=r.isRunning()?r.getEndValues().pos:T;if(1>Math.abs(R-a)){T=R,C!==e&&(eP(),et(),en(),g=C,X("change",C=e,g)),eR(),P||(P=!0,X("settle"));return}if(r.pause(),ex(),x){let e=es(),t=Math.floor((a-D[0]?.pos)/e),n=R+t*e,o=n-e;R=[n+e,n,o].reduce(function(e,t){return Math.abs(t-a)<Math.abs(e-a)?t:e})}if(!1!==n&&d(o))return void r.spring(ea({},v.tween,o)).from({pos:T}).to({pos:R}).start();T=R,ee(),eR(),P||(P=!0,X("settle"))}function eR(){let e;if(!b||!E)return;let t=D[C];F=ed();let n=new Set,o=[];for(let i of $){if(i.isVirtual&&!_.has(i.index)&&0>F.indexOf(i))continue;let l=ev(i);if(!l)continue;o.push(i);let a=t?.slides?.indexOf(i)>-1;if(a&&n.add(l),q("adaptiveHeight")&&a){let t=(l.firstElementChild||l).getBoundingClientRect().height;e=void 0==e?t:Math.max(e,t)}}E&&e&&(E.style.height=`${e}px`),[...el(E,`.${v.classes.slide}`)].forEach(e=>{let t=I[parseInt(e.getAttribute("index")||"-1")];t||e.remove();let o=n.has(e);if(Z(e,v.classes.isSelected,o),e.inert=0>F.indexOf(t),t.isVirtual&&!_.has(t.index)&&0>F.indexOf(t))return void ey(t);let i=t.pos?Math.round(1e4*t.pos)/1e4:0,l=0,a=0,r=0,s=0,c=v.setTransform||void 0;_.has(t.index)||(l=L?0:M?-1*i:i,a=L?i:0,r=er(l,0,t.dim,0,100),s=er(a,0,t.dim,0,100)),c instanceof Function&&!_.has(t.index)?c(ek,t,{x:l,y:a,xPercent:r,yPercent:s}):e.style.transform=l||a?`translate3d(${r}%, ${s}%,0)`:""}),X("render",o)}function eA(){for(let e of(b?.removeEventListener("click",eL),ex(),document.removeEventListener("mousemove",K),f?.disconnect(),f=void 0,I))e.el&&a(e.el)&&(e.state=void 0,eS(e),eT(e),ey(e),e.isVirtual?(e.el?.remove(),e.el=void 0):(e.el.style.transform="",E?.appendChild(e.el)));for(let e of Object.values(y))e?.destroy();for(let[e,t]of(y={},i?.destroy(),i=void 0,r?.destroy(),r=void 0,Object.entries(v.classes||{})))"container"!==e&&W(b,t);W(E,"is-draggable")}function eO(){return x||C>0}function ez(){return x||C<D.length-1}let ek={add:function(e,t){let n=T,o=C,i=es(),l=Math.floor(((r?.isRunning()?r.getEndValues().pos:T)-D[0]?.pos)/i);for(let n of em(e,t))X("addSlide",n);return Q(k),eE(),r&&(o===C&&(n-=l*i),n===(R=D[C||0]?.pos||0)?T=R:r.spring({clamp:!0,mass:1,tension:300,friction:25,restDelta:1,restSpeed:1}).from({pos:n}).to({pos:R}).start()),eR(),ek},canGoPrev:eO,canGoNext:ez,destroy:function(){return X("destroy"),window.removeEventListener("resize",U),eA(),Y.clear(),b=null,D=[],I=[],v={...ef},y={},$=[],p="",k="*",m=eu.Destroyed,ek},emit:X,filter:function(e="*"){return Q(e),eE(),eR(),X("filter",e),ek},getContainer:function(){return b},getGapDim:function(){return j},getGestures:function(){return i},getLastMouseMove:function(){return n},getOption:function(e){return q(e)},getOptions:function(){return v},getPage:function(){return D[C]},getPageIndex:function(e){if(void 0!==e){for(let t of D||[])for(let n of t.slides)if(n.index===e)return t.index;return -1}return C},getPageProgress:function(e,t){void 0===e&&(e=C);let n=D[e];if(!n)return e>C?-1:1;let o=es(),i=j,l=n.pos,a=ek.getPosition();if(x&&!0!==t){let e=Math.floor((a-D[0]?.pos)/o);a-=e*o,l=[l+o,l,l-o].reduce(function(e,t){return Math.abs(t-a)<Math.abs(e-a)?t:e})}return(a-l)/(n.dim+i)},getPageVisibility:function(e){void 0===e&&(e=C);let t=D[e];if(!t)return e>C?-1:1;let n=ek.getPosition(),o=ei(),i=t.pos;if(x){let e=ek.getPosition(),t=es(),n=i+Math.floor((e-D[0]?.pos)/t)*t,o=n-t;i=[n+t,n,o].reduce(function(t,n){return Math.abs(n-e)<Math.abs(t-e)?n:t})}return i>n&&i+t.dim<n+o?1:i<n?(i+t.dim-n)/t.dim:i+t.dim>n+o?(n+o-i)/t.dim:0},getPages:function(){return D},getPlugins:function(){return y},getPosition:function(e){let t=T;if(x&&!0!==e){let e=es();t-=Math.floor((T-D[0]?.pos||0)/e)*e}return t},getSlides:function(){return I},getState:function(){return m},getTotalSlideDim:es,getTween:function(){return r},getViewport:function(){return E},getViewportDim:ei,getVisibleSlides:function(e){return void 0===e?F:ed(e)},goTo:eC,hasNavigated:function(){return void 0!==g},hideError:eT,hideLoading:eS,init:function(){if(!e||!a(e))throw Error("No Element found");return m!==eu.Init&&(eA(),m=eu.Init),b=e,h=t,window.removeEventListener("resize",U),h.breakpoints&&window.addEventListener("resize",U),U(),ek},isInfinite:function(){return x},isInTransition:function(){return _.size>0},isRTL:function(){return M},isSettled:function(){return P},isVertical:function(){return L},localize:function(e,t=[]){return G(e,t)},next:function(e={}){return eC(C+1,e),ek},off:function(e,t){for(let n of e instanceof Array?e:[e])Y.has(n)&&Y.set(n,Y.get(n).filter(e=>e!==t));return ek},on:function(e,t){for(let n of e instanceof Array?e:[e])Y.set(n,[...Y.get(n)||[],t]);return ek},prev:function(e={}){return eC(C-1,e),ek},remove:function(e){void 0===e&&(e=I.length-1);let t=I[e];return t&&(X("removeSlide",t),t.el&&(ew(t.el),t.el.remove(),t.el=void 0),I.splice(e,1),Q(k),eE(),eR()),ek},setPosition:function(e){T=e,ee(),eR()},showError:function(e,t){eS(e),eT(e);let n=e.el;if(n){let o=document.createElement("div");B(o,"f-html"),B(o,"is-error"),o.innerHTML=G(t||"<p>{{ERROR}}</p>"),e.htmlEl=o,B(n,"has-html"),B(n,"has-error"),n.insertAdjacentElement("afterbegin",o),X("contentReady",e)}return ek},showLoading:function(e){let t=e.el,n=t?.querySelector(".f-spinner");if(!t||n)return ek;let o=c(q("spinnerTpl"));return o&&(B(o,"f-spinner"),t.insertAdjacentElement("beforeend",o)),ek},version:"6.0.29"};return ek};ep.l10n={en_EN:es},ep.getDefaults=()=>ef;let em=(e=!0,t="--f-scrollbar-compensate",n="--f-body-margin",o="hide-scrollbar")=>{let i=document,l=i.body,a=i.documentElement;if(e){if(l.classList.contains(o))return;let e=window.innerWidth-a.getBoundingClientRect().width;e<0&&(e=0),a.style.setProperty(t,`${e}px`);let i=parseFloat(window.getComputedStyle(l).marginRight);i&&l.style.setProperty(n,`${i}px`),l.classList.add(o)}else l.classList.remove(o),l.style.setProperty(n,""),i.documentElement.style.setProperty(t,"")};function eh(){return!!("undefined"!=typeof window&&window.document&&window.document.createElement)}let ev=function(e="",t="",n=""){return e.split(t).join(n)},ey={tpl:e=>`<img class="f-panzoom__content" ${e.srcset?'data-lazy-srcset="{{srcset}}"':""} ${e.sizes?'data-lazy-sizes="{{sizes}}"':""} data-lazy-src="{{src}}" alt="{{alt}}" />`},eb=()=>{let e;function t(t,n){let o=e?.getOptions().Zoomable,i=(d(o)?{...ey,...o}:ey)[t];return i&&"function"==typeof i&&n?i(n):i}function n(){e&&(e.on("addSlide",a),e.on("removeSlide",r),e.on("attachSlideEl",s),e.on("click",i),e.on("change",o))}function o(){c()}function i(e,t){let n=t.target;n&&!t.defaultPrevented&&n.dataset.panzoomAction&&u(n.dataset.panzoomAction)}function a(n,o){if(!e)return;let i=o.el;if(!i)return;let a=o.src||o.lazySrc||"",r=o.alt||o.caption||`Image #${o.index}`,s=o.srcset||o.lazySrcset||"",u=o.sizes||o.lazySizes||"";if(a&&l(a)&&!o.html&&(!o.type||"image"===o.type)){o.type="image",o.thumbSrc=o.thumbSrc||a;let e=t("tpl",o);e=ev(e,"{{src}}",a+""),e=ev(e,"{{alt}}",r+""),e=ev(e,"{{srcset}}",s+""),e=ev(e,"{{sizes}}",u+""),i.insertAdjacentHTML("afterbegin",e)}if(!i.querySelector(".f-panzoom__content"))return;let d=ei(i,{width:o.width&&"auto"!==o.width?parseFloat(o.width+""):"auto",height:o.height&&"auto"!==o.height?parseFloat(o.height+""):"auto",classes:{container:"f-zoomable"},event:()=>e?.getLastMouseMove(),spinnerTpl:()=>e?.getOption("spinnerTpl")||"",...t("Panzoom")});d.on("*",(t,n,...i)=>{e&&("loading"===n&&(o.state=0),"loaded"===n&&(o.state=1),"error"===n&&(o.state=2,e?.showError(o,"{{IMAGE_ERROR}}")),e.emit(`panzoom:${n}`,o,...i),"ready"===n&&e.emit("contentReady",o),o.index===e?.getPageIndex()&&c())}),o.panzoomRef=d}function r(e,t){t.panzoomRef&&(t.panzoomRef.destroy(),t.panzoomRef=void 0)}function s(e,t){let n=t.panzoomRef;if(n)switch(n.getState()){case Q.Init:n.init();break;case Q.Ready:n.execute(U.ZoomTo,{...n.getStartPosition(),velo