UNPKG

@fancyapps/ui

Version:

Robust JavaScript UI Component Library

4 lines 99.5 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 C)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,R=((y=R||{})[y.Spring=0]="Spring",y[y.Ease=1]="Ease",y);let P=((b={})[b.Loop=0]="Loop",b[b.Reverse=1]="Reverse",b),C=new Set,A=null,O=0;function z(){let e=h.Initializing,t=R.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=P.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===P.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=R.Ease,M={},D},duration:function(e){return l=e,D},spring:function(e={}){t=R.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===R.Spring},from:function(e){return w={...e},D},to:function(e){return x=e,D},repeat:function(e,t=0,n=P.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)||(C.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===R.Ease){E=1===(m=u(0,o/l,1));let e=T===P.Reverse?O:i;for(let t in w)w[t]=b[t]+(x[t]-b[t])*e(m)}if(t===R.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={},C.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 C)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 R(){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 P(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",C),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 C(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),R(),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)),R(),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",C),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",P,D),e.addEventListener("touchstart",P,D),e.addEventListener("touchmove",C,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",P,D),e.removeEventListener("touchstart",P,D),e.removeEventListener("touchmove",C,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=1e4,Z=e=>{e.cancelable&&e.preventDefault()},G=(e,t=W)=>Math.round(((e=parseFloat(e+"")||0)+Number.EPSILON)*t)/t,Y=((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),X=((w={}).Cover="cover",w.Full="full",w.Max="max",w),U={x:0,y:0,scale:1,angle:0,flipX:1,flipY:1},K=((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),J={bounds:!0,classes:{container:"f-panzoom",wrapper:"f-panzoom__wrapper",content:"f-panzoom__content",viewport:"f-panzoom__viewport"},clickAction:Y.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:Y.Zoom,width:"auto"},Q=0,ee=0,et=0,en=(e,n={},o={})=>{let i,r,d,f,g,p,m,h=K.Init,v={...J,...n},y={},b={...U},E={...U},w=[];function x(e){let t=v[e];return t&&"function"==typeof t?t(ep):t}let M=new Map;function L(e,...t){let n=[...M.get(e)||[]];for(let o of(v.on&&n.push(v.on[e]),n))o&&o instanceof Function&&o(ep,...t);"*"!==e&&L("*",e,...t)}function S(e){if(h!==K.Ready||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);L("wheel",e,n);let o=x("wheelAction");if(!o||e.defaultPrevented)return;let i=E.scale,l=i*(n>0?1.5:.5);if(o===Y.Zoom){let o=100>Math.abs(e.deltaY)&&100>Math.abs(e.deltaX);if(t-ee<(o?200:45))return void Z(e);ee=t;let a=F(),r=j();if(G(l)<G(a)&&G(i)<=G(a)?(et+=Math.abs(n),l=a):G(l)>G(r)&&G(i)>=G(r)?(et+=Math.abs(n),l=r):(et=0,l=u(a,l,r)),et>7)return}switch(Z(e),o){case Y.Pan:eo(o,{srcEvent:e,deltaX:-(2*e.deltaX),deltaY:-(2*e.deltaY)});break;case Y.Zoom:eo(Y.ZoomTo,{srcEvent:e,scale:l,center:{x:e.clientX,y:e.clientY}});break;default:eo(o,{srcEvent:e})}}function T(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 Y.ZoomTo:case Y.ZoomIn:case Y.ZoomOut:eo(r,{scale:parseFloat(s||"")||void 0});break;case Y.MoveLeft:case Y.MoveRight:eo(r,{deltaX:parseFloat(s||"")||void 0});break;case Y.MoveUp:case Y.MoveDown:eo(r,{deltaY:parseFloat(s||"")||void 0});break;default:eo(r)}return}if(!i?.contains(o))return;let c={srcEvent:n};if(eo(x("clickAction"),c),x("dblClickAction")){let e=Date.now(),n=e-(Q||e);Q=e,n>0&&n<=250?(t&&(clearTimeout(t),t=void 0),eo(x("dblClickAction"),c)):t=setTimeout(()=>{eo(x("singleClickAction"),c)},250)}}function R(e){if(m=e,!O()||h!==K.Ready||b.scale<=1||E.scale<=1||(i?.dataset.animationName||"").indexOf("zoom")>-1)return;let t=k(E.scale);if(!t)return;let{x:n,y:o}=t;eo(Y.Pan,{deltaX:n-E.x,deltaY:o-E.y})}function P(){if(e&&(e.querySelector(".f-spinner")?.remove(),e.classList.remove("is-loading")),!e||!i)return;if(r instanceof HTMLImageElement&&!(r.complete&&r.naturalWidth)){h=K.Error,i?.classList.add("has-error"),L("error");return}L("loaded");let{width:t,height:n}=A();r&&(r.setAttribute("width",t+""),r.setAttribute("height",n+"")),i&&(i.classList.remove("has-error"),i.setAttribute("width",t+""),i.setAttribute("height",n+""),i.style.aspectRatio=`${t/n||""}`),g=z().on("start",(e,t)=>{E={...U,...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),en(),L("animationStart")}).on("pause",e=>{E={...U,...e}}).on("step",t=>{if(h!==K.Ready||!g)return;if(!e||!e.parentElement)return void g.end();if(b={...U,...t},O()||!x("bounds")||f?.isPointerDown()||E.scale>b.scale||E.scale<D())return void ei();let n=q(E.scale),o=!1,i=!1,l=!1,a=!1;b.x<n.x[0]&&(o=!0),b.x>n.x[1]&&(i=!0),b.y<n.y[0]&&(a=!0),b.y>n.y[1]&&(l=!0);let r=!1,s=!1,c=!1,d=!1;E.x<n.x[0]&&(r=!0),E.x>n.x[1]&&(s=!0),E.y<n.y[0]&&(d=!0),E.y>n.y[1]&&(c=!0);let p=!1;(i&&s||o&&r)&&(E.x=u(n.x[0],E.x,n.x[1]),p=!0),(l&&c||a&&d)&&(E.y=u(n.y[0],E.y,n.y[1]),p=!0),p&&g.spring({tension:94,friction:17,maxSpeed:555*E.scale,restDelta:.1,restSpeed:.1,velocity:g.getCurrentVelocities()}).from(b).to(E).start(),ei()}).on("end",()=>{X(),g?.isRunning()||(en(),L("animationEnd"))}),function(){let e=x("gestures");e&&d&&r&&(f=N(d,e).on("start",e=>{if(!g)return;let t=e.srcEvent;O()||((b.scale>1||e.currentTouch.length>1)&&(t?.stopPropagation(),g.pause()),1===e.currentTouch.length&&L("touchStart"))}).on("move",e=>{!O()&&(1!==E.scale||e.currentTouch.length>1)&&(e.srcEvent.preventDefault(),e.srcEvent.stopPropagation())}).on("pan",e=>{if(O())return;let t=e.srcEvent;(1!==E.scale||e.currentTouch.length>1)&&(Z(t),eo(Y.Pan,e))}).on("swipe",e=>{!O()&&E.scale>1&&eo(Y.Swipe,e)}).on("tap",e=>{L("click",e)}).on("singleTap",e=>{L("singleClick",e)}).on("doubleTap",e=>{L("dblClick",e)}).on("pinch",e=>{O()||(e.scale>D()?eo(Y.ZoomIn,e):e.scale<D()?eo(Y.ZoomOut,e):eo(Y.Pan,e))}).on("end",e=>{O()||(e.currentTouch.length?(e.srcEvent.stopPropagation(),Z(e.srcEvent),g?.end()):(en(),X(),L("touchEnd")))}).init())}(),d&&(d.addEventListener("wheel",S,{passive:!1}),w.push(()=>{d?.removeEventListener("wheel",S,{passive:!1})})),e?.addEventListener("click",T),document?.addEventListener("mousemove",R),w.push(()=>{e?.removeEventListener("click",T),document?.removeEventListener("mousemove",R)});let o={...x("startPos")||{},...{scale:D()}};if(b={...U,...o},E={...U,...o},O()){let e=k(E.scale);if(e){let{x:t,y:n}=e;b.x=t,b.y=n,E.x=t,E.y=n}}h=K.Ready,ei(),en(),L("ready"),requestAnimationFrame(()=>{d&&(d.style.visibility="")})}function C(){let e={top:0,left:0,width:0,height:0};if(i){let t=i.getBoundingClientRect();E.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 A(){let e=x("width"),t=x("height");if(r&&"auto"===e){let t=r.getAttribute("width");e=t?parseFloat(t+""):void 0!==r.dataset.width?parseFloat(r.dataset.width+""):d instanceof HTMLImageElement?d.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+""):d instanceof HTMLImageElement?d.naturalHeight:r instanceof HTMLImageElement?r.naturalHeight:r.getBoundingClientRect().height}else t=l(t)?parseFloat(t):t;return{width:e,height:t}}function O(){return"mousemove"===x("panMode")&&matchMedia("(hover: hover)").matches}function k(e){let t=m||x("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,a=n.width,r=n.height,s=q(e);if(e>1){let t=x("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 _(t="base"){if(!e)return 1;let n=e.getBoundingClientRect(),o=C(),{width:i,height:l}=A(),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=E.angle%180==90?l:i;return e&&o.width?e/o.width:1}}},r=x("minScale"),s=x("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 F(){return _("min")}function D(){return _("base")}function H(){return _("cover")}function V(){return _("full")}function j(){return _("max")}function q(t){let n={x:[0,0],y:[0,0]},o=e?.getBoundingClientRect();if(!o)return n;let i=C(),l=o.width,a=o.height,r=i.width,s=i.height,c=t=void 0===t?E.scale:t,u=t;if(O()&&t>1){let e=x("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 X(){if(!x("bounds")||h!==K.Ready||!e?.parentElement||!g)return;let t=F(),n=j(),o=u(t,E.scale,n);if(E.scale<t-.01||E.scale>n+.01)return void eo(Y.ZoomTo,{scale:o});if(g.isRunning()||f?.isPointerDown())return;let i=q(o);E.x<i.x[0]||E.x>i.x[1]||E.y<i.y[0]||E.y>i.y[1]?(E.x=u(i.x[0],E.x,i.x[1]),E.y=u(i.y[0],E.y,i.y[1]),g.spring({tension:170,friction:17,restDelta:.001,restSpeed:.001,maxSpeed:1/0,velocity:g.getCurrentVelocities()}),g.from(b).to(E).start()):ei()}function en(){if(!e||!e.parentElement||!i)return;let t=eu(),n=ed(),o=ef(),l=eg(),a=ea(),r=er();i.classList.toggle("is-fullsize",l),i.classList.toggle("is-expanded",o),i.classList.toggle("is-dragging",n),i.classList.toggle("can-drag",t),i.classList.toggle("will-zoom-in",a),i.classList.toggle("will-zoom-out",r);let s=es(),c=ec(),u=h!==K.Ready;for(let t of e?.querySelectorAll("[data-panzoom-action]")||[]){let e=t.dataset.panzoomAction,n=!1;if(u)n=!0;else switch(e){case Y.ZoomIn:s||(n=!0);break;case Y.ZoomOut:c||(n=!0);break;case Y.ToggleFull:s||c||(n=!0);let o=t.querySelector("g");o&&(o.style.display=l?"none":"");break;case Y.ToggleCover:case Y.ToggleMax:s||c||(n=!0)}n?(t.setAttribute("aria-disabled",""),t.setAttribute("tabindex","-1")):(t.removeAttribute("aria-disabled"),t.removeAttribute("tabindex"))}}function eo(t,n){if(!e||!r||!g||t===Y.Swipe&&Math.abs(g.getCurrentVelocities().scale)>.01)return;let o={...E},i=q(O()?E.scale:b.scale),l=g.getCurrentVelocities(),a=C();n=n||{};let s=(n.currentTouch?.length||0)>1,c=n.velocityX||0,d=n.velocityY||0,p=n.center;!p&&n.srcEvent&&(p=$(I(n.srcEvent)));let m=n.deltaX||0,h=n.deltaY||0;switch(t){case Y.MoveRight:m=n.deltaX||100;break;case Y.MoveLeft:m=n.deltaX||-100;break;case Y.MoveUp:h=n.deltaY||-100;break;case Y.MoveDown:h=n.deltaY||100}let v=[];switch(t){case Y.Reset:(E={...U}).scale=D();break;case Y.Pan:case Y.Move:case Y.MoveLeft:case Y.MoveRight:case Y.MoveUp:case Y.MoveDown:if(f?.isPointerDown()){let e=1,t=1;E.x<=i.x[0]&&c<=0&&(e=.2*Math.max(.01,1-Math.abs(1/a.width*Math.abs(E.x-i.x[0])))),E.x>=i.x[1]&&c>=0&&(e=.2*Math.max(.01,1-Math.abs(1/a.width*Math.abs(E.x-i.x[1])))),E.y<=i.y[0]&&d<=0&&(t=.2*Math.max(.01,1-Math.abs(1/a.height*Math.abs(E.y-i.y[0])))),E.y>=i.y[1]&&d>=0&&(t=.2*Math.max(.01,1-Math.abs(1/a.height*Math.abs(E.y-i.y[1])))),E.x+=m*e,E.y+=h*t}else E.x=u(i.x[0],E.x+m,i.x[1]),E.y=u(i.y[0],E.y+h,i.y[1]);break;case Y.Swipe:let y=(e=0)=>Math.sign(e)*Math.pow(Math.abs(e),1.5);E.x+=u(-1e3,y(c),1e3),E.y+=u(-1e3,y(d),1e3),d&&!c&&(E.x=u(i.x[0],E.x,i.x[1])),!d&&c&&(E.y=u(i.y[0],E.y,i.y[1])),l.x=c,l.y=d;break;case Y.ZoomTo:E.scale=n.scale||1;break;case Y.ZoomIn:E.scale=E.scale*(n.scale||2),s||(E.scale=Math.min(E.scale,j()));break;case Y.ZoomOut:E.scale=E.scale*(n.scale||.5),s||(E.scale=Math.max(E.scale,F()));break;case Y.ToggleCover:v=[D(),H()];break;case Y.ToggleFull:v=[D(),V()];break;case Y.ToggleMax:v=[D(),j()];break;case Y.IterateZoom:v=[D(),V(),j()];break;case Y.Zoom:let w=V();E.scale>=w-.05?E.scale=D():E.scale=Math.min(w,E.scale*(n.scale||2));break;case Y.RotateCW:E.angle+=90;break;case Y.RotateCCW:E.angle-=90;break;case Y.FlipX:E.flipX*=-1;break;case Y.FlipY:E.flipY*=-1}if(void 0!==b.angle&&Math.abs(b.angle)>=360&&(E.angle-=360*Math.floor(b.angle/360),b.angle-=360*Math.floor(b.angle/360)),v.length){let e=v.findIndex(e=>e>E.scale+1/W);E.scale=v[e]||v[0]}if(s&&(E.scale=u(F()*(s?.8:1),E.scale,j()*(s?1.6:1))),O()){let e=k(E.scale);if(e){let{x:t,y:n}=e;E.x=t,E.y=n}}else if(E.scale!==o.scale){let t=0,n=0;if(p)t=p.x,n=p.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;E.x=l-c*E.scale,E.y=r-d*E.scale,!s&&x("bounds")&&(i=q(E.scale),E.x=u(i.x[0],E.x,i.x[1]),E.y=u(i.y[0],E.y,i.y[1]))}if(t===Y.Swipe){let e=500*E.scale;g.spring({tension:94,friction:17,maxSpeed:e,restDelta:.1,restSpeed:.1,velocity:l})}else t===Y.Pan||s?g.spring({tension:750,friction:17,restDelta:.01,restSpeed:.01,maxSpeed:1}):g.spring({tension:170,friction:17,restDelta:.001,restSpeed:.001,maxSpeed:1/0,velocity:l});t===Y.Reset&&0===n.velocity?b={...E}:g.from(b).to(E).start(),L("action",t)}function ei(){if(!i||!r)return;if(r instanceof HTMLImageElement){let{width:e,height:t}=A();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}=b,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 t=C(),n=t.width,o=t.height,{width:i,height:l}=A();if(!e)return{x:0,y:0,width:0,height:0,scale:0,flipX:0,flipY:0,angle:0,fitWidth:n,fitHeight:o,fullWidth:i,fullHeight:l};let{x:a,y:r,scale:s,angle:c,flipX:u,flipY:d}=b,f=1/V(),g=i,p=l,m=b.scale*f,h=E.scale*f,v=Math.max(n,o),y=Math.min(n,o);i>l?(g=v,p=y):(g=y,p=v),m=i>l?v*s/i||1:v*s/l||1;let w=g?i*h:0,x=p?l*h:0,M=g&&p?i*m/w:0;return{x:a=a+.5*g-.5*w,y:r=r+.5*p-.5*x,width:w,height:x,scale:M,flipX:u,flipY:d,angle:c,fitWidth:n,fitHeight:o,fullWidth:i,fullHeight:l}}();if(i&&u){let{x:e,y:t,width:n,height:o,scale:i,flipX:a,flipY:r}=u,s=`translate(${G(e)}px, ${G(t)}px)`;1!==a||1!==r?s+=` scaleX(${G(i*a)}) scaleY(${G(i*r)})`:s+=` scale(${G(i)})`,0!==l&&(s+=` rotate(${l}deg)`),d&&(d.style.width=`${G(n)}px`,d.style.height=`${G(o)}px`,d.style.transform=`${s}`)}L("render")}function el(){let e=E.scale,t=void 0,n=x("clickAction"),o=D();if(n){let i=[];switch(n){case Y.ZoomIn:o=e*(t||2);break;case Y.ZoomOut:o=e*(t||.5);break;case Y.ToggleCover:i=[D(),H()];break;case Y.ToggleFull:i=[D(),V()];break;case Y.ToggleMax:i=[D(),j()];break;case Y.IterateZoom:i=[D(),V(),j()];break;case Y.Zoom:let l=V();o=e>=l-.05?D():Math.min(l,e*(t||2))}if(i.length){let t=i.findIndex(t=>t>e+1/W);o=i[t]||D()}}return u(F(),o,j())}function ea(){return h===K.Ready&&el()>E.scale}function er(){return h===K.Ready&&el()<E.scale}function es(){return h===K.Ready&&E.scale<j()}function ec(){return h===K.Ready&&E.scale>F()}function eu(){return h===K.Ready&&ef()&&!!f&&!O()}function ed(){return h===K.Ready&&f?.isPointerDown()&&!O()}function ef(){return h===K.Ready&&E.scale>D()}function eg(){return h===K.Ready&&E.scale>=V()}let ep={canDrag:eu,canZoomIn:es,canZoomOut:ec,destroy:function(){for(let e of(L("destroy"),Object.values(y)))e?.destroy(ep);for(let e of w)e();return i&&(i.style.aspectRatio="",i.style.maxWidth="",i.style.maxHeight=""),d&&(d.style.width="",d.style.height="",d.style.transform=""),i=void 0,r=void 0,d=void 0,b={...U},E={...U},g?.destroy(),g=void 0,f?.destroy(),f=void 0,h=K.Destroyed,ep},emit:L,execute:eo,getBoundaries:q,getContainer:function(){return e},getFullDim:A,getGestures:function(){return f},getMousemovePos:k,getOptions:function(){return v},getScale:_,getState:function(){return h},getTransform:function(e){return!0===e?E:b},getTween:function(){return g},getViewport:function(){return d},getWrapper:function(){return i},init:function(){return h=K.Init,L("init"),function(){for(let[e,t]of Object.entries({...o,...v.plugins||{}}))if(e&&!y[e]&&t instanceof Function){let n=t();n.init(ep),y[e]=n}L("initPlugins")}(),function(){if(!e)return;let t={...J.classes,...x("classes")};if((B(e,t.container),r=e.querySelector("."+t.content))&&(r.setAttribute("draggable","false"),(i=e.querySelector("."+t.wrapper))||(B(i=document.createElement("div"),t.wrapper),r.insertAdjacentElement("beforebegin",i),i.insertAdjacentElement("afterbegin",r)),r instanceof HTMLImageElement||r instanceof HTMLPictureElement)){if(!(d=e.querySelector("."+t.viewport))){B(d=document.createElement("div"),t.viewport);let e=r.cloneNode(!0);e.classList.remove("is-lazyloading"),e.classList.remove("is-lazyloaded"),d.insertAdjacentElement("afterbegin",e),i.insertAdjacentElement("beforeend",d)}if(r instanceof HTMLPictureElement&&(r=r.querySelector("img")),d instanceof HTMLPictureElement&&(d=d.querySelector("img")),d.style.visibility="hidden",x("protected")){d.addEventListener("contextmenu",e=>{e.preventDefault()});let e=document.createElement("div");B(e,"f-panzoom__protected"),d.appendChild(e)}L("initLayout")}}(),function(){if(!(r&&r instanceof HTMLImageElement))return;h=K.Loading,L("loading");let t=()=>{r&&r instanceof HTMLImageElement&&r.decode().then(()=>{requestAnimationFrame(()=>{P()})}).catch(()=>{P()})};if(r.src&&r.complete)return t();(function(){let t=e?.querySelector(".f-spinner");if(!e||t)return;let n=c(x("spinnerTpl"));n&&(n.classList.add("f-spinner"),e.classList.add("is-loading"),i?.insertAdjacentElement("afterbegin",n))})(),r.addEventListener("load",t,!1),r.addEventListener("error",t,!1),w.push(()=>{r?.removeEventListener("load",t,!1),r?.removeEventListener("error",t,!1)})}(),function(){if(e&&i&&!p){let t=null;(p=new ResizeObserver(()=>{t||(t=requestAnimationFrame(()=>{e&&e.parentElement&&h===K.Ready&&(en(),X(),L("refresh")),t=null}))})).observe(i),w.push(()=>{p?.disconnect(),p=void 0,t&&(cancelAnimationFrame(t),t=null)})}}(),ep},isDragging:ed,isExpanded:ef,isFullsize:eg,localize:function(e,t=[]){let n=x("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])M.has(n)&&M.set(n,M.get(n).filter(e=>e!==t));return ep},on:function(e,t){for(let n of e instanceof Array?e:[e])M.set(n,[...M.get(n)||[],t]);return ep},version:"6.0.25",willZoomIn:ea,willZoomOut:er};return ep};en.l10n={en_EN:q},en.getDefaults=()=>J;let eo=(e,t)=>{let n=[];return e.childNodes.forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&(!t||e.matches(t))&&n.push(e)}),n},ei=(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],ei(e[t],n)):Array.isArray(n)?Object.assign(e,{[t]:[...n]}):Object.assign(e,{[t]:n})});return e},el=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},ea=(e,t="")=>{e&&e.classList&&t.split(" ").forEach(t=>{t&&e.classList.remove(t)})},er=(e,t="",n)=>{e&&e.classList&&t.split(" ").forEach(t=>{t&&e.classList.toggle(t,n||!1)})},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,R=!0,P=0,C=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 W(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 Z=new Map;function G(e,...t){let n=[...Z.get(e)||[]];for(let o of(v.on&&n.push(v.on[e]),n))o&&o instanceof Function&&o(ek,...t);"*"!==e&&G("*",e,...t)}function Y(){let e=ei({},ef,h);ei(e,ef,h);let t="",n=h.breakpoints||{};if(n)for(let[o,i]of Object.entries(n))window.matchMedia(o).matches&&(t+=o,ei(e,i));if(void 0===p||t!==p){if(p=t,m!==eu.Init){let t=D[P]?.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,G("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}G("initPlugins")}(),function(){if(!b)return;let e=q("classes")||{};B(b,e.container),B(b,e.isEnabled);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(...eo(b,`.${e.slide}`)),b.insertAdjacentElement("afterbegin",E)),b.carousel=ek,G("initLayout")}(),function(){if(!E)return;let e=q("classes")||{};for(let t of(I=[],[...eo(E,`.${e.slide}`)].forEach(e=>{e.parentElement&&I.push(eh({el:e,isVirtual:!1,...e.dataset||{}}))}),em(q("slides")),I))G("addSlide",t);for(let e of I){let t=e.el;t?.parentElement&&(B(t,v.classes.slide),B(t,e.class),eR(e),G("attachSlideEl",e))}G("initSlides")}(),eE(),function(){if(b&&(b.addEventListener("click",eL,{passive:!1}),document.addEventListener("mousemove",X),!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,r=z().on("start",()=>{i&&i.isPointerDown()||(J(),eC())}).on("step",e=>{let t=T;(T=e.pos)!==t&&(R=!1,eC())}).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():R||(R=!0,G("settle")))}),U(),eC(),Q(),G("ready");return}if(m!==eu.Ready)return;let t=D.length;eE(),U();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)?(J(),eC()):eP(P,{transition:!1})))})(t),e=null}))})).observe(b)}}())}}function X(e){n=e}function U(){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[P]?.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",()=>{ea(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/en()*Math.abs(s-A))):s>=O&&a*l>0&&(c=.2*Math.max(.01,1-Math.abs(1/en()*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*en(),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()||R||(R=!0,G("settle")));if(!(a||y.Autoscroll?.isEnabled())&&(!(e.offsetX||e.offsetY)||"y"===t&&!L||"x"===t&&L))return void eP(P,{transition:"tween"});let f=et(c);Math.abs(s)>10&&f===P&&(s>0?f+=M&&!L?1:-1:f+=M&&!L?-1:1),eP(f,{transition:"tween",tween:{velocity:-1*s}})}).init())}function K(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 J(){if(!r)return;let e=et(r?.isRunning()?r.getEndValues().pos:T);e!==P&&(g=P,P=e,eR(),Q(),ee(),G("change",P,g))}function Q(){if(!b)return;for(let e of(er(E,"is-draggable",!!i&&D.length>0),b.querySelectorAll("[data-carousel-index]")))e.innerHTML=P+"";for(let e of b.querySelectorAll("[data-carousel-page]"))e.innerHTML=P+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());for(let e of b.querySelectorAll("[data-carousel-go-next]"))e.toggleAttribute("aria-disabled",!ez());let e=!1,t=D[P]?.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 ee(e){if(!b)return;e||(e=D[P]?.slides[0]);let t=e.el;if(t)for(let n of t.querySelectorAll("[data-slide-index]"))n.innerHTML=e.index+1+""}function et(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):[P,0])[0])}function en(){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=en();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))};if(r.offset=a,x)for(let e=-1;e<=1;e++)s(t*e);else 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),G("contentReady",e))}(e);return K(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),eR(e),I))if(o.index>e.index){n=o.el;break}E.insertBefore(t,n&&E.contains(n)?n:null),G("attachSlideEl",e)}return t}}function ey(e){let t=e?.el;t&&(t.remove(),ew(t),G("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");er(b,e.isLTR,!M),er(b,e.isRTL,M),er(b,e.isHorizontal,!L),er(b,e.isVertical,L),er(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=en();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=en(),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&&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,Q()}(),A=D[0]?.pos||0,O=D[D.length-1]?.pos||0,m===eu.Init){g=void 0,P=q("initialPage");let e=q("initialSlide")||void 0;void 0!==e&&(P=ek.getPageIndex(e)||0),P=u(0,P,D.length-1),C=T=D[P]?.pos||0}else{let e=r?.isRunning()?r.getEndValues().pos:T;(e<A||e>O)&&(P=u(0,P,D.length-1),C=D[P||0]?.pos||0)}G("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),ea(e,o.join(" ")),_.delete(t)}function ex(){if(!E)return;let e=_.size;for(let e of $)ew(e.el);_.clear(),e&&eC()}function eM(e){"f-"===e.animationName.substring(0,2)&&(ew(e.target),!_.size&&(ea(b,"in-transition"),!R&&.5>Math.abs(ek.getPosition(!0)-C)&&(R=!0,G("settle"))),eC())}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[P]?.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}G("click",e)}function eS(e){let t=e.el;t&&(t.querySelector(".f-spinner")?.remove(),ea(t,"is-loading"))}function eT(e){let t=e.el;t&&(t.querySelector(".f-html.is-error")?.remove(),ea(t,"has-error"))}function eR(e){e||(e=D[P]?.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!==P)return;if(l(n)&&(o.innerHTML=W(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=W(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 eP(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[P]?.slides.length>1)return!1;let n=D.length,o=e>P?1:-1;e=x?(e%n+n)%n:u(0,e,n-1),M&&(o*=-1);let i=D[P]?.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(en()-(s?.dim||0))>1)return!1;R=!1,r.pause(),ex(),B(b,"in-transition"),T=C=d;let f=ev(i),g=ev(s);return J(),f&&(_.add(a),f.style.transform="",f.addEventListener("animationend",eM),ea(f,v.classes.isSelected),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),B(g,`f-${t}In from-${o>0?"prev":"next"}`)),eC(),!0}(e,n))return;e=x?(e%i+i)%i:u(0,e,i-1),C=D[e||0]?.pos||0;let a=r.isRunning()?r.getEndValues().pos:T;if(1>Math.abs(C-a)){T=C,P!==e&&(eR(),Q(),ee(),g=P,G("change",P=e,g)),eC(),R||(R=!0,G("settle"));return}if(r.pause(),ex(),x){let e=es(),t=Math.floor((a-D[0]?.pos)/e),n=C+t*e,o=n-e;C=[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(ei({},v.tween,o)).from({pos:T}).to({pos:C}).start();T=C,J(),eC(),R||(R=!0,G("settle"))}function eC(){let e;if(!b||!E)return;let t=D[P];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`),[...eo(E,`.${v.classes.slide}`)].forEach(e=>{let t=I[parseInt(e.getAttribute("index")||"-1")];if(t||e.remove(),er(e,v.classes.isSelected,n.has(e)),t.isVirtual&&!_.has(t.index)&&0>F.indexOf(t))return void ey(t);let o=t.pos?Math.round(1e4*t.pos)/1e4:0,i=0,l=0,a=0,r=0,s=v.setTransform||void 0;_.has(t.index)||(i=L?0:M?-1*o:o,l=L?o:0,a=el(i,0,t.dim,0,100),r=el(l,0,t.dim,0,100)),s instanceof Function&&!_.has(t.index)?s(ek,t,{x:i,y:l,xPercent:a,yPercent:r}):e.style.transform=i||l?`translate3d(${a}%, ${r}%,0)`:""}),G("render",o)}function eA(){for(let e of(b?.removeEventListener("click",eL),ex(),document.removeEventListener("mousemove",X),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&&ea(b,t);ea(E,"is-draggable")}function eO(){return x||P>0}function ez(){return x||P<D.length-1}let ek={add:function(e,t){let n=T,o=P,i=es(),l=Math.floor(((r?.isRunning()?r.getEndValues().pos:T)-D[0]?.pos)/i);for(let n of em(e,t))G("addSlide",n);return K(k),eE(),r&&(o===P&&(n-=l*i),n===(C=D[P||0]?.pos||0)?T=C:r.spring({clamp:!0,mass:1,tension:300,friction:25,restDelta:1,restSpeed:1}).from({pos:n}).to({pos:C}).start()),eC(),ek},canGoPrev:eO,canGoNext:ez,destroy:function(){return G("destroy"),window.removeEventListener("resize",Y),eA(),Z.clear(),b=null,D=[],I=[],v={...ef},y={},$=[],p="",k="*",m=eu.Destroyed,ek},emit:G,filter:function(e="*"){return K(e),eE(),eC(),G("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[P]},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 P},getPageProgress:function(e,t){void 0===e&&(e=P);let n=D[e];if(!n)return e>P?-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=P);let t=D[e];if(!t)return e>P?-1:1;let n=ek.getPosition(),o=en(),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:en,getVisibleSlides:function(e){return void 0===e?F:ed(e)},goTo:eP,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",Y),h.breakpoints&&window.addEventListener("resize",Y),Y(),ek},isInfinite:function(){return x},isInTransition:function(){return _.size>0},isRTL:function(){return M},isSettled:function(){return R},isVertical:function(){return L},localize:function(e,t=[]){return W(e,t)},next:function(e={}){return eP(P+1,e),ek},off:function(e,t){for(let n of e instanceof Array?e:[e])Z.has(n)&&Z.set(n,Z.get(n).filter(e=>e!==t));return ek},on:function(e,t){for(let n of e instanceof Array?e:[e])Z.set(n,[...Z.get(n)||[],t]);return ek},prev:function(e={}){return eP(P-1,e),ek},remove:function(e){void 0===e&&(e=I.length-1);let t=I[e];return t&&(G("removeSlide",t),t.el&&(ew(t.el),t.el.remove(),t.el=void 0),I.splice(e,1),K(k),eE(),eC()),ek},setPosition:function(e){T=e,J(),eC()},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=W(t||"<p>{{ERROR}}</p>"),e.htmlEl=o,B(n,"has-html"),B(n,"has-error"),n.insertAdjacentElement("afterbegin",o),G("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"),B(t,"is-loading"),t.insertAdjacentElement("beforeend",o)),ek},version:"6.0.25"};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";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=en(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 K.Init:n.init();break;case K.Ready:n.execute(Y.Reset,{velocity:0})}}function c(){let t=e?.getContainer();if(!t)return;let n=e?.getPage()?.slides[0].panzoomRef,o=n?.canZoomIn()||!1,i=n?.canZoomOut()||!1,l=n?.isFullsize()||!1,a=!n||n?.getState()!==K.Ready;for(let e of t?.query