diff --git a/dist/bigger-picture.min.js b/dist/bigger-picture.min.js index c1a24de..53f5660 100644 --- a/dist/bigger-picture.min.js +++ b/dist/bigger-picture.min.js @@ -1 +1 @@ -var BiggerPicture=function(){function t(){}const n=t=>t;function e(t,n){for(const e in n)t[e]=n[e];return t}function o(t){return t()}function r(t){t.forEach(o)}function i(t){return"function"==typeof t}function s(t,n){return t!=t?n==n:t!==n}function c(n,e,o){n.$$.on_destroy.push(((n,...e)=>{if(null==n)return t;const o=n.subscribe(...e);return o.unsubscribe?()=>o.unsubscribe():o})(e,o))}function u(t,n,e){return t.set(e),n}function l(n){return n&&i(n.destroy)?n.destroy:t}let a=()=>globalThis.performance.now(),p=t=>requestAnimationFrame(t);const f=new Set;function d(t){f.forEach((n=>{n.c(t)||(f.delete(n),n.f())})),0!==f.size&&p(d)}function m(t){let n;return 0===f.size&&p(d),{promise:new Promise((e=>{f.add(n={c:t,f:e})})),abort(){f.delete(n)}}}function h(t,n){t.appendChild(n)}function b(t,n,e){t.insertBefore(n,e||null)}function g(t){t.parentNode.removeChild(t)}function x(t){return document.createElement(t)}function v(){return document.createTextNode("")}function w(t,n,e,o){return t.addEventListener(n,e,o),()=>t.removeEventListener(n,e,o)}function y(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function $(t,n,e,o){null===e?t.style.removeProperty(n):t.style.setProperty(n,e)}function k(t,n,e){t.classList[e?"add":"remove"](n)}let _,M,S=0,P={};function z(t,n,e,o,r,i,s,c=0){const u=16.666/o;let l="{\n";for(let t=0;1>=t;t+=u){const o=n+(e-n)*i(t);l+=100*t+`%{${s(o,1-o)}}\n`}const a=l+`100% {${s(e,1-e)}}\n}`,p=`_bp_${Math.round(1e9*Math.random())}_${c}`;if(!P[p]){if(!_){const t=x("style");document.head.appendChild(t),_=t.sheet}P[p]=1,_.insertRule(`@keyframes ${p} ${a}`,_.cssRules.length)}const f=t.style.animation||"";return t.style.animation=`${f?f+", ":""}${p} ${o}ms linear ${r}ms 1 both`,S+=1,p}function A(t,n){t.style.animation=(t.style.animation||"").split(", ").filter(n?t=>0>t.indexOf(n):t=>-1===t.indexOf("_bp")).join(", "),n&&!--S&&p((()=>{if(S)return;let t=_.cssRules.length;for(;t--;)_.deleteRule(t);P={}}))}function T(t){M=t}const I=[],C=[],N=[],E=[],O=Promise.resolve();let R=0;function q(t){N.push(t)}const F=new Set;let j,B=0;function D(){const t=M;do{for(;I.length>B;){const t=I[B];B++,T(t),J(t.$$)}for(T(null),I.length=0,B=0;C.length;)C.pop()();for(let t=0;N.length>t;t+=1){const n=N[t];F.has(n)||(F.add(n),n())}N.length=0}while(I.length);for(;E.length;)E.pop()();R=0,F.clear(),T(t)}function J(t){if(null!==t.t){t.update(),r(t.before_update);const n=t.u;t.u=[-1],t.t&&t.t.p(t.ctx,n),t.after_update.forEach(q)}}function K(){return j||(j=Promise.resolve(),j.then((()=>{j=null}))),j}function L(t,n,e){t.dispatchEvent(((t,n,e=0)=>{const o=document.createEvent("CustomEvent");return o.initCustomEvent(t,e,0,n),o})(`${n?"intro":"outro"}${e}`))}const W=new Set;let G;function H(){G={r:0,c:[],p:G}}function Q(){G.r||r(G.c),G=G.p}function U(t,n){t&&t.i&&(W.delete(t),t.i(n))}function V(t,n,e,o){if(t&&t.o){if(W.has(t))return;W.add(t),G.c.push((()=>{W.delete(t),o&&(e&&t.d(1),o())})),t.o(n)}}const X={duration:0};function Y(e,o,r){let s,c,u=o(e,r),l=0,p=0;function f(){s&&A(e,s)}function d(){const{delay:o=0,duration:r=300,l:i=n,g:d=t,css:h}=u||X;h&&(s=z(e,0,1,r,o,i,h,p++)),d(0,1);const b=a()+o,g=b+r;c&&c.abort(),l=1,q((()=>L(e,1,"start"))),c=m((t=>{if(l){if(t>=g)return d(1,0),L(e,1,"end"),f(),l=0;if(t>=b){const n=i((t-b)/r);d(n,1-n)}}return l}))}let h=0;return{start(){h||(h=1,A(e),i(u)?(u=u(),K().then(d)):d())},invalidate(){h=0},end(){l&&(f(),l=0)}}}function Z(e,o,s){let c,u=o(e,s),l=1;const p=G;function f(){const{delay:o=0,duration:i=300,l:s=n,g:f=t,css:d}=u||X;d&&(c=z(e,1,0,i,o,s,d));const h=a()+o,b=h+i;q((()=>L(e,0,"start"))),m((t=>{if(l){if(t>=b)return f(0,1),L(e,0,"end"),--p.r||r(p.c),0;if(t>=h){const n=s((t-h)/i);f(1-n,n)}}return l}))}return p.r+=1,i(u)?K().then((()=>{u=u(),f()})):f(),{end(t){t&&u.g&&u.g(1,0),l&&(c&&A(e,c),l=0)}}}function tt(t){t&&t.c()}function nt(t,n,e,s){const{t:c,on_mount:u,on_destroy:l,after_update:a}=t.$$;c&&c.m(n,e),s||q((()=>{const n=u.map(o).filter(i);l?l.push(...n):r(n),t.$$.on_mount=[]})),a.forEach(q)}function et(t,n){const e=t.$$;null!==e.t&&(r(e.on_destroy),e.t&&e.t.d(n),e.on_destroy=e.t=null,e.ctx=[])}function ot(n,e,o,i,s,c,u,l=[-1]){const a=M;T(n);const p=n.$$={t:null,ctx:null,v:c,update:t,not_equal:s,bound:{},on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:{},u:l,skip_bound:0,root:e.target||a.$$.root};u&&u(p.root);let f=0;p.ctx=o?o(n,e.v||{},((t,e,...o)=>{const r=o.length?o[0]:e;return p.ctx&&s(p.ctx[t],p.ctx[t]=r)&&(!p.skip_bound&&p.bound[t]&&p.bound[t](r),f&&((t,n)=>{-1===t.$$.u[0]&&(I.push(t),R||(R=1,O.then(D)),t.$$.u.fill(0)),t.$$.u[n/31|0]|=1<{const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}$set(t){this.$$set&&0!==Object.keys(t).length&&(this.$$.skip_bound=1,this.$$set(t),this.$$.skip_bound=0)}}function it(t){const n=t-1;return n*n*n+1}function st(t,{delay:n=0,duration:e=400,l:o=it,x:r=0,y:i=0,opacity:s=0}={}){const c=getComputedStyle(t),u=+c.opacity,l="none"===c.transform?"":c.transform,a=u*(1-s);return{delay:n,duration:e,l:o,css(t,n){return`\n\t\t\ttransform: ${l} translate(${(1-t)*r}px, ${(1-t)*i}px);\n\t\t\topacity: ${u-a*n}`}}}const ct=[];function ut(n,e=t){let o;const r=new Set;function i(t){if(s(n,t)&&(n=t,o)){const t=!ct.length;for(const t of r)t[1](),ct.push(t,n);if(t){for(let t=0;ct.length>t;t+=2)ct[t][0](ct[t+1]);ct.length=0}}}return{set:i,update(t){i(t(n))},subscribe(s,c=t){const u=[s,c];return r.add(u),1===r.size&&(o=e(i)||t),s(n),()=>{r.delete(u),0===r.size&&(o(),o=null)}}}}function lt(t,n){if(t===n||t!=t)return()=>t;const e=typeof t;if(Array.isArray(t)){const e=n.map(((n,e)=>lt(t[e],n)));return t=>e.map((n=>n(t)))}if("number"===e){const e=n-t;return n=>t+n*e}}function at(t,o={}){const r=ut(t);let i,s=t;function c(c,u){if(null==t)return r.set(t=c),Promise.resolve();s=c;let l=i,p=0,{delay:f=0,duration:d=400,l:h=n,interpolate:b=lt}=e(e({},o),u);if(0===d)return l&&(l.abort(),l=null),r.set(t=s),Promise.resolve();const g=a()+f;let x;return i=m((n=>{if(g>n)return 1;p||(x=b(t,c),"function"==typeof d&&(d=d(t,c)),p=1),l&&(l.abort(),l=null);const e=n-g;return e>d?(r.set(t=c),0):(r.set(t=x(h(e/d))),1)})),i.promise}return{set:c,update(n,e){return c(n(s,t),e)},subscribe:r.subscribe}}const pt=ut(0),ft=globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches,dt=t=>({l:it,duration:ft?0:t});function mt(t){let n,e,o,r,i=!t[2]&&ht();return{c(){n=x("div"),i&&i.c(),y(n,"class","bp-load"),$(n,"background-image","url("+t[0]+")")},m(t,e){b(t,n,e),i&&i.m(n,null),r=1},p(e,o){(t=e)[2]?i&&(i.d(1),i=null):i||(i=ht(),i.c(),i.m(n,null)),(!r||1&o)&&$(n,"background-image","url("+t[0]+")")},i(i){r||(q((()=>{o&&o.end(1),e=Y(n,st,{duration:t[1]?400:0}),e.start()})),r=1)},o(t){e&&e.invalidate(),t&&(o=Z(n,st,{duration:480})),r=0},d(t){t&&g(n),i&&i.d(),t&&o&&o.end()}}}function ht(t){let n,e;return{c(){n=x("span"),e=x("span"),y(n,"class","bp-bar"),y(e,"class","bp-o")},m(t,o){b(t,n,o),b(t,e,o)},d(t){t&&g(n),t&&g(e)}}}function bt(t){let n,e=(!t[1]||t[2])&&mt(t);return{c(){e&&e.c(),n=v()},m(t,o){e&&e.m(t,o),b(t,n,o)},p(t,[o]){!t[1]||t[2]?e?(e.p(t,o),6&o&&U(e,1)):(e=mt(t),e.c(),U(e,1),e.m(n.parentNode,n)):e&&(H(),V(e,1,1,(()=>{e=null})),Q())},i(t){U(e)},o(t){V(e)},d(t){e&&e.d(t),t&&g(n)}}}function gt(t,n,e){let o;c(t,pt,(t=>e(2,o=t)));let{thumb:r}=n,{loaded:i}=n;return t.$$set=t=>{"thumb"in t&&e(0,r=t.thumb),"loaded"in t&&e(1,i=t.loaded)},[r,i,o]}class xt extends rt{constructor(t){super(),ot(this,t,gt,bt,s,{thumb:0,loaded:1})}}function vt(t){let n,e,o,r,i,s;return{c(){n=x("img"),y(n,"srcset",e=t[7].img),y(n,"sizes",o=t[8].sizes||t[1]+"px"),y(n,"alt",r=t[7].alt)},m(t,e){b(t,n,e),s=1},p(t,e){(!s||2&e[0]&&o!==(o=t[8].sizes||t[1]+"px"))&&y(n,"sizes",o)},i(t){s||(i&&i.end(1),s=1)},o(t){i=Z(n,st,{}),s=0},d(t){t&&g(n),t&&i&&i.end()}}}function wt(t){let n,e;return n=new xt({v:{thumb:t[7].thumb,loaded:t[2]}}),{c(){tt(n.$$.t)},m(t,o){nt(n,t,o),e=1},p(t,e){const o={};4&e[0]&&(o.loaded=t[2]),n.$set(o)},i(t){e||(U(n.$$.t,t),e=1)},o(t){V(n.$$.t,t),e=0},d(t){et(n,t)}}}function yt(t){let n,e,o,i,s,c,u=t[2]&&vt(t),a=t[3]&&wt(t);return{c(){n=x("div"),e=x("div"),u&&u.c(),o=v(),a&&a.c(),y(e,"class","bp-img"),$(e,"background-image","url("+t[7].thumb+")"),$(e,"width",t[0][0]+"px"),$(e,"height",t[0][1]+"px"),$(e,"transform","translate3d("+(t[0][0]/-2+t[6][0])+"px, "+(t[0][1]/-2+t[6][1])+"px, 0)"),y(n,"class","bp-img-wrap"),k(n,"bp-drag",t[4]),k(n,"bp-close",t[5])},m(r,p){b(r,n,p),h(n,e),u&&u.m(e,null),h(e,o),a&&a.m(e,null),i=1,s||(c=[l(t[16].call(null,n)),w(n,"wheel",t[12]),w(n,"pointerdown",t[13]),w(n,"pointermove",t[14]),w(n,"pointerup",t[15]),w(n,"pointercancel",t[15])],s=1)},p(t,r){t[2]?u?(u.p(t,r),4&r[0]&&U(u,1)):(u=vt(t),u.c(),U(u,1),u.m(e,o)):u&&(H(),V(u,1,1,(()=>{u=null})),Q()),t[3]?a?(a.p(t,r),8&r[0]&&U(a,1)):(a=wt(t),a.c(),U(a,1),a.m(e,null)):a&&(H(),V(a,1,1,(()=>{a=null})),Q()),(!i||1&r[0])&&$(e,"width",t[0][0]+"px"),(!i||1&r[0])&&$(e,"height",t[0][1]+"px"),(!i||65&r[0])&&$(e,"transform","translate3d("+(t[0][0]/-2+t[6][0])+"px, "+(t[0][1]/-2+t[6][1])+"px, 0)"),16&r[0]&&k(n,"bp-drag",t[4]),32&r[0]&&k(n,"bp-close",t[5])},i(t){i||(U(u),U(a),i=1)},o(t){V(u),V(a),i=0},d(t){t&&g(n),u&&u.d(),a&&a.d(),s=0,r(c)}}}function $t(t,n,e){let o,r,i,s;c(t,pt,(t=>e(21,i=t)));let{v:u}=n,{$:l}=n,{k:a,_:p,M:f,next:d,zoomed:m,container:h}=u;c(t,m,(t=>e(20,o=t)));let b,g,x,v,w,y,$,k,_,M,S=a.maxZoom||p.maxZoom||10,P=u.S(a),z=P[0],A=0;const T=+a.width,I=[],C=new Map,N=at(P,dt(400));c(t,N,(t=>e(0,s=t)));const E=at([0,0],dt(400));c(t,E,(t=>e(6,r=t)));const O=([t,n],o=s)=>{const r=(o[0]-h.w)/2,i=(o[1]-h.h)/2;return 0>r?t=0:t>r?l?(t=v?r+(t-r)/10:r)>r+20&&e(4,v=f()):t=r:-r>t&&(l?-r-20>(t=v?-r-(-r-t)/10:-r)&&e(4,v=d()):t=-r),0>i?n=0:n>i?n=i:-i>n&&(n=-i),[t,n]},R=(t,n=S)=>{if(i)return;const o=P[0]*S,[c,u]=s;let l=c+c*n,p=u+u*n;if(n>0)l>o&&(l=o,p=P[1]*S),l>T&&(l=T,p=+a.height);else if(P[0]>l)return N.set(P),E.set([0,0]);let{x:f,y:d,width:m,height:h}=t.target.getBoundingClientRect();const b=t.clientX-f-m/2,g=t.clientY-d-h/2;f=l/m*-b+b,d=p/h*-g+g;const x=[l,p];N.set(x).then((()=>{e(1,z=Math.round(Math.max(z,l)))})),E.set(O([r[0]+f,r[1]+d],x))};return t.$$set=t=>{"$"in t&&e(18,l=t.$)},t.$$.update=()=>{if(524289&t.$$.u[0]&&m.set(s[0]-10>P[0]),3670016&t.$$.u[0]&&i&&o&&!p.intro){const t=dt(480);E.set([0,0],t),N.set(P,t),e(5,M=1)}},[s,z,b,g,v,M,r,a,p,m,N,E,t=>{p.inline&&!o||(t.preventDefault(),R(t,t.deltaY/-300))},t=>{2!==t.button&&(t.preventDefault(),e(4,v=1),C.set(t.pointerId,t),y=t.clientX,$=t.clientY,k=r[0],_=r[1])},t=>{if(C.size>1)return x=1,e(4,v=0),p.noPinch?.(h)||(t=>{const[n,e]=C.set(t.pointerId,t).values(),o=Math.hypot(n.clientX-e.clientX,n.clientY-e.clientY);R(t,-.03*((A||o)-o)),A=o})(t);if(!v)return;let n=t.clientX,r=t.clientY;I.push({x:n,y:r}),n-=y,r-=$,o||(n>40&&e(4,v=f()),-40>n&&e(4,v=d()),-90>r&&!p.noClose&&u.close()),w=I.length>2,o&&w&&!i&&E.set(O([k+n,_+r]),{duration:0})},function(t){if(C.delete(t.pointerId),x)return x=C.size,void(A=0);if(v){if(e(4,v=0),t.target===this&&!p.noClose)return u.close();if(w){const[t,n,e]=I.slice(-3);Math.hypot(n.x-e.x,n.y-e.y)>5&&E.set(O([r[0]-5*(t.x-e.x),r[1]-5*(t.y-e.y)]))}else p.onImageClick?.(h.el,a)||R(t,o?-S:S);w=0,I.length=0}},()=>{u.P((()=>{e(19,P=u.S(a)),!p.inline&&l||(N.set(P),E.set([0,0]))})),u.A(a).then((()=>{e(2,b=1),u.T()})),setTimeout((()=>{e(3,g=!b)}),250)},u,l,P,o,i]}class kt extends rt{constructor(t){super(),ot(this,t,$t,yt,s,{v:17,$:18},null,[-1,-1])}}function _t(t){let n,e,o,i,s,c;return o=new xt({v:{thumb:t[2].thumb,loaded:t[0]}}),{c(){n=x("div"),e=x("iframe"),tt(o.$$.t),y(e,"allow","autoplay; fullscreen"),y(e,"title",t[2].title),y(n,"class","bp-if"),$(n,"width",t[1][0]+"px"),$(n,"height",t[1][1]+"px")},m(r,u){b(r,n,u),h(n,e),nt(o,n,null),i=1,s||(c=[l(t[3].call(null,e)),w(e,"load",t[5])],s=1)},p(t,[e]){const r={};1&e&&(r.loaded=t[0]),o.$set(r),(!i||2&e)&&$(n,"width",t[1][0]+"px"),(!i||2&e)&&$(n,"height",t[1][1]+"px")},i(t){i||(U(o.$$.t,t),i=1)},o(t){V(o.$$.t,t),i=0},d(t){t&&g(n),et(o),s=0,r(c)}}}function Mt(t,n,e){let o,r,{v:i}=n;const{k:s}=i,c=()=>e(1,r=i.S(s));return c(),i.P(c),[o,r,s,t=>t.src=s.iframe,i,()=>e(0,o=1)]}class St extends rt{constructor(t){super(),ot(this,t,Mt,_t,s,{v:4})}}function Pt(t){let n,e,o,r,i;return e=new xt({v:{thumb:t[2].thumb,loaded:t[0]}}),{c(){n=x("div"),tt(e.$$.t),y(n,"class","bp-vid"),$(n,"width",t[1][0]+"px"),$(n,"height",t[1][1]+"px"),$(n,"background-image","url("+t[2].thumb+")")},m(s,c){b(s,n,c),nt(e,n,null),o=1,r||(i=l(t[3].call(null,n)),r=1)},p(t,[r]){const i={};1&r&&(i.loaded=t[0]),e.$set(i),(!o||2&r)&&$(n,"width",t[1][0]+"px"),(!o||2&r)&&$(n,"height",t[1][1]+"px")},i(t){o||(U(e.$$.t,t),o=1)},o(t){V(e.$$.t,t),o=0},d(t){t&&g(n),et(e),r=0,i()}}}function zt(t,n,e){let o,r,{v:i}=n;const{k:s}=i,c=()=>e(1,r=i.S(s));c(),i.P(c);const u=(t,n)=>{for(const e in n)y(t,e,n[e])};return[o,r,s,t=>{let n;const r=(t,e)=>{Array.isArray(e)||(e=JSON.parse(e));for(const o of e){n||(n=x(o.type?.includes("audio")?"audio":"video"),u(n,{controls:1,autoplay:1,playsinline:1,tabindex:"0"}));const e=x(t);u(e,o),h(n,e)}};r("source",s.sources),r("track",s.tracks||[]),w(n,"canplay",(()=>e(0,o=1))),h(t,n)},i]}class At extends rt{constructor(t){super(),ot(this,t,zt,Pt,s,{v:4})}}function Tt(n){let e,o,i,c,u,a,p,f,d,m,v=n[6].i,$=Rt(n),_=n[0].length>1&&qt(n);return{c(){e=x("div"),o=x("div"),$.c(),c=x("div"),u=x("button"),_&&_.c(),y(u,"class","bp-x"),y(u,"title","Close"),y(u,"aria-label","Close"),y(c,"class","bp-controls"),y(e,"class","bp-wrap"),k(e,"bp-zoomed",n[10]),k(e,"bp-inline",n[8]),k(e,"bp-small",n[7]),k(e,"bp-noclose",n[5].noClose)},m(t,r){b(t,e,r),h(e,o),$.m(e,null),h(e,c),h(c,u),_&&_.m(c,null),f=1,d||(m=[w(u,"click",n[1]),l(p=n[14].call(null,e))],d=1)},p(n,o){64&o[0]&&s(v,v=n[6].i)?(H(),V($,1,1,t),Q(),$=Rt(n),$.c(),U($),$.m(e,c)):$.p(n,o),n[0].length>1?_?_.p(n,o):(_=qt(n),_.c(),_.m(c,null)):_&&(_.d(1),_=null),1024&o[0]&&k(e,"bp-zoomed",n[10]),256&o[0]&&k(e,"bp-inline",n[8]),128&o[0]&&k(e,"bp-small",n[7]),32&o[0]&&k(e,"bp-noclose",n[5].noClose)},i(t){f||(i&&i.end(1),U($),a&&a.end(1),f=1)},o(t){i=Z(o,st,{duration:480}),V($),a=Z(c,st,{}),f=0},d(t){t&&g(e),t&&i&&i.end(),$.d(t),_&&_.d(),t&&a&&a.end(),d=0,r(m)}}}function It(n){let e,o=n[6].html+"";return{c(){e=x("div"),y(e,"class","bp-html")},m(t,n){b(t,e,n),e.innerHTML=o},p(t,n){64&n[0]&&o!==(o=t[6].html+"")&&(e.innerHTML=o)},i:t,o:t,d(t){t&&g(e)}}}function Ct(n){let e,o;return e=new St({v:{v:n[13]()}}),{c(){tt(e.$$.t)},m(t,n){nt(e,t,n),o=1},p:t,i(t){o||(U(e.$$.t,t),o=1)},o(t){V(e.$$.t,t),o=0},d(t){et(e,t)}}}function Nt(n){let e,o;return e=new At({v:{v:n[13]()}}),{c(){tt(e.$$.t)},m(t,n){nt(e,t,n),o=1},p:t,i(t){o||(U(e.$$.t,t),o=1)},o(t){V(e.$$.t,t),o=0},d(t){et(e,t)}}}function Et(t){let n,e;return n=new kt({v:{v:t[13](),$:t[7]}}),{c(){tt(n.$$.t)},m(t,o){nt(n,t,o),e=1},p(t,e){const o={};128&e[0]&&(o.$=t[7]),n.$set(o)},i(t){e||(U(n.$$.t,t),e=1)},o(t){V(n.$$.t,t),e=0},d(t){et(n,t)}}}function Ot(t){let n,e,o,r=t[6].caption+"";return{c(){n=x("div"),y(n,"class","bp-cap"),y(n,"tabindex","0")},m(t,e){b(t,n,e),n.innerHTML=r,o=1},p(t,e){(!o||64&e[0])&&r!==(r=t[6].caption+"")&&(n.innerHTML=r)},i(t){o||(e&&e.end(1),o=1)},o(t){e=Z(n,st,{duration:200}),o=0},d(t){t&&g(n),t&&e&&e.end()}}}function Rt(t){let n,e,o,i,s,c,u,l,a;const p=[Et,Nt,Ct,It],f=[];function d(t,n){return t[6].img?0:t[6].sources?1:t[6].iframe?2:3}e=d(t),o=f[e]=p[e](t);let m=t[6].caption&&Ot(t);return{c(){n=x("div"),o.c(),m&&m.c(),c=v(),y(n,"class","bp-inner")},m(o,r){b(o,n,r),f[e].m(n,null),m&&m.m(o,r),b(o,c,r),u=1,l||(a=[w(n,"pointerdown",t[21]),w(n,"pointerup",t[22])],l=1)},p(t,r){let i=e;e=d(t),e===i?f[e].p(t,r):(H(),V(f[i],1,1,(()=>{f[i]=null})),Q(),o=f[e],o?o.p(t,r):(o=f[e]=p[e](t),o.c()),U(o,1),o.m(n,null)),t[6].caption?m?(m.p(t,r),64&r[0]&&U(m,1)):(m=Ot(t),m.c(),U(m,1),m.m(c.parentNode,c)):m&&(H(),V(m,1,1,(()=>{m=null})),Q())},i(e){u||(U(o),q((()=>{s&&s.end(1),i=Y(n,t[12],1),i.start()})),U(m),u=1)},o(e){V(o),i&&i.invalidate(),s=Z(n,t[12],0),V(m),u=0},d(t){t&&g(n),f[e].d(),t&&s&&s.end(),m&&m.d(t),t&&g(c),l=0,r(a)}}}function qt(t){let n,e,o,i,s,c=`${t[4]+1} / ${t[0].length}`;return{c(){n=x("div"),e=x("button"),o=x("button"),y(n,"class","bp-count"),y(e,"class","bp-prev"),y(e,"title","Previous"),y(e,"aria-label","Previous"),y(o,"class","bp-next"),y(o,"title","Next"),y(o,"aria-label","Next")},m(r,u){b(r,n,u),n.innerHTML=c,b(r,e,u),b(r,o,u),i||(s=[w(e,"click",t[2]),w(o,"click",t[3])],i=1)},p(t,e){17&e[0]&&c!==(c=`${t[4]+1} / ${t[0].length}`)&&(n.innerHTML=c)},d(t){t&&g(n),t&&g(e),t&&g(o),i=0,r(s)}}}function Ft(t){let n,e,o=t[0]&&Tt(t);return{c(){o&&o.c(),n=v()},m(t,r){o&&o.m(t,r),b(t,n,r),e=1},p(t,e){t[0]?o?(o.p(t,e),1&e[0]&&U(o,1)):(o=Tt(t),o.c(),U(o,1),o.m(n.parentNode,n)):o&&(H(),V(o,1,1,(()=>{o=null})),Q())},i(t){e||(U(o),e=1)},o(t){V(o),e=0},d(t){o&&o.d(t),t&&g(n)}}}function jt(t,n,e){let o,r;c(t,pt,(t=>e(26,o=t)));let{items:i}=n,{target:s}=n;const l=document.documentElement;let a,p,f,d,m,h,b,g,v,y,$;const k=t=>$=t,_={},M=ut(0);c(t,M,(t=>e(10,r=t)));const S=()=>{p.onClose?.(),u(pt,o=1,o),e(0,i=null),d?.focus({preventScroll:1})},P=()=>A(a-1),z=()=>A(a+1),A=t=>{b=t-a,e(4,a=T(t))},T=t=>(t+i.length)%i.length,I=t=>{const{key:n,shiftKey:e}=t;if("Escape"===n)!p.noClose&&S();else if("ArrowRight"===n)z();else if("ArrowLeft"===n)P();else if("Tab"===n){const{activeElement:n}=document;if(e||!n.controls){t.preventDefault();const{focusWrap:o=_.el}=p,r=[...o.querySelectorAll("*")].filter((t=>t.tabIndex>=0));let i=r.indexOf(n);i+=r.length+(e?-1:1),r[i%r.length].focus()}}},C=({width:t=1920,height:n=1080})=>{const{scale:e=.99}=p,o=Math.min(1,_.w/t*e,_.h/n*e);return[Math.round(t*o),Math.round(n*o)]},N=()=>{if(i){const t=i[T(a+1)],n=i[T(a-1)];!t.preload&&E(t),!n.preload&&E(n)}},E=t=>{if(t.img){const n=x("img");return n.sizes=p.sizes||C(t)[0]+"px",n.srcset=t.img,t.preload=1,n.decode()}};return t.$$set=t=>{"items"in t&&e(0,i=t.items),"target"in t&&e(15,s=t.target)},t.$$.update=()=>{1835121&t.$$.u[0]&&i&&(e(6,v=i[a]),e(19,y=v.hasOwnProperty("html")),f&&(y&&k(null),p.onUpdate?.(_.el,v)))},[i,S,P,z,a,p,v,m,h,g,r,M,(t,n)=>f&&i?st(t,{x:(b>0?20:-20)*(n?1:-1),duration:250}):(e(18,f=n),p.intro?st(t,{y:n?10:-10}):(t=>{let n;if(y){const e=t.firstChild.firstChild;n=[e.clientWidth,e.clientHeight]}else n=C(v);const e=(v.element||d).getBoundingClientRect(),o=e.left-(_.w-e.width)/2,r=e.top-(_.h-e.height)/2,i=e.width/n[0],s=e.height/n[1];return{duration:480,l:it,css:(t,n)=>`transform:translate3d(${o*n}px, ${r*n}px, 0) scale3d(${i+t*(1-i)}, ${s+t*(1-s)}, 1)`}})(t)),()=>({k:v,S:C,A:E,T:N,_:p,M:P,next:z,close:S,P:k,zoomed:M,container:_}),t=>{let n,r;e(20,_.el=t,_),p.onOpen?.(_.el,v),h||(n=w(globalThis,"keydown",I));const i=new ResizeObserver((t=>{r&&(e(20,_.w=t[0].contentRect.width,_),e(20,_.h=t[0].contentRect.height,_),e(7,m=769>_.w),$?.(),p.onResize?.(_.el,v)),r=1}));return i.observe(t),{destroy(){i.disconnect(),n?.(),u(pt,o=0,o),l.classList.remove("bp-lock"),p.onClosed?.()}}},s,t=>{e(5,p=t),e(8,h=p.inline);const n=p.items;!h&&l.scrollHeight>l.clientHeight&&l.classList.add("bp-lock"),d=document.activeElement,e(20,_.w=s.offsetWidth,_),e(20,_.h=s===document.body?globalThis.innerHeight:s.clientHeight,_),e(7,m=769>_.w),e(4,a=p.position||0),e(0,i=Array.isArray(n)?n.map(((t,n)=>(p.el&&p.el===t.element&&e(4,a=n),{i:n,...t}))):(n.length?[...n]:[n]).map(((t,n)=>(p.el===t&&e(4,a=n),{element:t,i:n,...t.dataset}))))},A,f,y,_,t=>e(9,g=t.target),function(t){2!==t.button&&t.target===this&&g===this&&!p.noClose&&S()}]}class Bt extends rt{constructor(t){super(),ot(this,t,jt,Ft,s,{items:0,target:15,open:16,close:1,M:2,next:3,setPosition:17},null,[-1,-1])}get items(){return this.$$.ctx[0]}get target(){return this.$$.ctx[15]}get open(){return this.$$.ctx[16]}get close(){return this.$$.ctx[1]}get M(){return this.$$.ctx[2]}get next(){return this.$$.ctx[3]}get setPosition(){return this.$$.ctx[17]}}return t=>new Bt({...t,v:t})}(); +var BiggerPicture=function(){function t(){}const n=t=>t;function e(t,n){for(const e in n)t[e]=n[e];return t}function o(t){return t()}function r(t){t.forEach(o)}function i(t){return"function"==typeof t}function s(t,n){return t!=t?n==n:t!==n}function c(n,e,o){n.$$.on_destroy.push(((n,...e)=>{if(null==n)return t;const o=n.subscribe(...e);return o.unsubscribe?()=>o.unsubscribe():o})(e,o))}function u(t,n,e){return t.set(e),n}function l(n){return n&&i(n.destroy)?n.destroy:t}let a=()=>globalThis.performance.now(),p=t=>requestAnimationFrame(t);const f=new Set;function d(t){f.forEach((n=>{n.c(t)||(f.delete(n),n.f())})),0!==f.size&&p(d)}function m(t){let n;return 0===f.size&&p(d),{promise:new Promise((e=>{f.add(n={c:t,f:e})})),abort(){f.delete(n)}}}function h(t,n){t.appendChild(n)}function b(t,n,e){t.insertBefore(n,e||null)}function g(t){t.parentNode.removeChild(t)}function x(t){return document.createElement(t)}function v(){return document.createTextNode("")}function w(t,n,e,o){return t.addEventListener(n,e,o),()=>t.removeEventListener(n,e,o)}function y(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function $(t,n,e,o){null===e?t.style.removeProperty(n):t.style.setProperty(n,e)}function k(t,n,e){t.classList[e?"add":"remove"](n)}let _,M,S=0,P={};function z(t,n,e,o,r,i,s,c=0){const u=16.666/o;let l="{\n";for(let t=0;1>=t;t+=u){const o=n+(e-n)*i(t);l+=100*t+`%{${s(o,1-o)}}\n`}const a=l+`100% {${s(e,1-e)}}\n}`,p=`_bp_${Math.round(1e9*Math.random())}_${c}`;if(!P[p]){if(!_){const t=x("style");document.head.appendChild(t),_=t.sheet}P[p]=1,_.insertRule(`@keyframes ${p} ${a}`,_.cssRules.length)}const f=t.style.animation||"";return t.style.animation=`${f?f+", ":""}${p} ${o}ms linear ${r}ms 1 both`,S+=1,p}function A(t,n){t.style.animation=(t.style.animation||"").split(", ").filter(n?t=>0>t.indexOf(n):t=>-1===t.indexOf("_bp")).join(", "),n&&!--S&&p((()=>{if(S)return;let t=_.cssRules.length;for(;t--;)_.deleteRule(t);P={}}))}function T(t){M=t}const I=[],C=[],N=[],E=[],O=Promise.resolve();let R=0;function q(t){N.push(t)}const F=new Set;let j,B=0;function D(){const t=M;do{for(;I.length>B;){const t=I[B];B++,T(t),J(t.$$)}for(T(null),I.length=0,B=0;C.length;)C.pop()();for(let t=0;N.length>t;t+=1){const n=N[t];F.has(n)||(F.add(n),n())}N.length=0}while(I.length);for(;E.length;)E.pop()();R=0,F.clear(),T(t)}function J(t){if(null!==t.t){t.update(),r(t.before_update);const n=t.u;t.u=[-1],t.t&&t.t.p(t.ctx,n),t.after_update.forEach(q)}}function K(){return j||(j=Promise.resolve(),j.then((()=>{j=null}))),j}function L(t,n,e){t.dispatchEvent(((t,n,e=0)=>{const o=document.createEvent("CustomEvent");return o.initCustomEvent(t,e,0,n),o})(`${n?"intro":"outro"}${e}`))}const W=new Set;let G;function H(){G={r:0,c:[],p:G}}function Q(){G.r||r(G.c),G=G.p}function U(t,n){t&&t.i&&(W.delete(t),t.i(n))}function V(t,n,e,o){if(t&&t.o){if(W.has(t))return;W.add(t),G.c.push((()=>{W.delete(t),o&&(e&&t.d(1),o())})),t.o(n)}}const X={duration:0};function Y(e,o,r){let s,c,u=o(e,r),l=0,p=0;function f(){s&&A(e,s)}function d(){const{delay:o=0,duration:r=300,l:i=n,g:d=t,css:h}=u||X;h&&(s=z(e,0,1,r,o,i,h,p++)),d(0,1);const b=a()+o,g=b+r;c&&c.abort(),l=1,q((()=>L(e,1,"start"))),c=m((t=>{if(l){if(t>=g)return d(1,0),L(e,1,"end"),f(),l=0;if(t>=b){const n=i((t-b)/r);d(n,1-n)}}return l}))}let h=0;return{start(){h||(h=1,A(e),i(u)?(u=u(),K().then(d)):d())},invalidate(){h=0},end(){l&&(f(),l=0)}}}function Z(e,o,s){let c,u=o(e,s),l=1;const p=G;function f(){const{delay:o=0,duration:i=300,l:s=n,g:f=t,css:d}=u||X;d&&(c=z(e,1,0,i,o,s,d));const h=a()+o,b=h+i;q((()=>L(e,0,"start"))),m((t=>{if(l){if(t>=b)return f(0,1),L(e,0,"end"),--p.r||r(p.c),0;if(t>=h){const n=s((t-h)/i);f(1-n,n)}}return l}))}return p.r+=1,i(u)?K().then((()=>{u=u(),f()})):f(),{end(t){t&&u.g&&u.g(1,0),l&&(c&&A(e,c),l=0)}}}function tt(t){t&&t.c()}function nt(t,n,e,s){const{t:c,on_mount:u,on_destroy:l,after_update:a}=t.$$;c&&c.m(n,e),s||q((()=>{const n=u.map(o).filter(i);l?l.push(...n):r(n),t.$$.on_mount=[]})),a.forEach(q)}function et(t,n){const e=t.$$;null!==e.t&&(r(e.on_destroy),e.t&&e.t.d(n),e.on_destroy=e.t=null,e.ctx=[])}function ot(n,e,o,i,s,c,u,l=[-1]){const a=M;T(n);const p=n.$$={t:null,ctx:null,v:c,update:t,not_equal:s,bound:{},on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:{},u:l,skip_bound:0,root:e.target||a.$$.root};u&&u(p.root);let f=0;p.ctx=o?o(n,e.v||{},((t,e,...o)=>{const r=o.length?o[0]:e;return p.ctx&&s(p.ctx[t],p.ctx[t]=r)&&(!p.skip_bound&&p.bound[t]&&p.bound[t](r),f&&((t,n)=>{-1===t.$$.u[0]&&(I.push(t),R||(R=1,O.then(D)),t.$$.u.fill(0)),t.$$.u[n/31|0]|=1<{const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}$set(t){this.$$set&&0!==Object.keys(t).length&&(this.$$.skip_bound=1,this.$$set(t),this.$$.skip_bound=0)}}function it(t){const n=t-1;return n*n*n+1}function st(t,{delay:n=0,duration:e=400,l:o=it,x:r=0,y:i=0,opacity:s=0}={}){const c=getComputedStyle(t),u=+c.opacity,l="none"===c.transform?"":c.transform,a=u*(1-s);return{delay:n,duration:e,l:o,css(t,n){return`\n\t\t\ttransform: ${l} translate(${(1-t)*r}px, ${(1-t)*i}px);\n\t\t\topacity: ${u-a*n}`}}}const ct=[];function ut(n,e=t){let o;const r=new Set;function i(t){if(s(n,t)&&(n=t,o)){const t=!ct.length;for(const t of r)t[1](),ct.push(t,n);if(t){for(let t=0;ct.length>t;t+=2)ct[t][0](ct[t+1]);ct.length=0}}}return{set:i,update(t){i(t(n))},subscribe(s,c=t){const u=[s,c];return r.add(u),1===r.size&&(o=e(i)||t),s(n),()=>{r.delete(u),0===r.size&&(o(),o=null)}}}}function lt(t,n){if(t===n||t!=t)return()=>t;const e=typeof t;if(Array.isArray(t)){const e=n.map(((n,e)=>lt(t[e],n)));return t=>e.map((n=>n(t)))}if("number"===e){const e=n-t;return n=>t+n*e}}function at(t,o={}){const r=ut(t);let i,s=t;function c(c,u){if(null==t)return r.set(t=c),Promise.resolve();s=c;let l=i,p=0,{delay:f=0,duration:d=400,l:h=n,interpolate:b=lt}=e(e({},o),u);if(0===d)return l&&(l.abort(),l=null),r.set(t=s),Promise.resolve();const g=a()+f;let x;return i=m((n=>{if(g>n)return 1;p||(x=b(t,c),"function"==typeof d&&(d=d(t,c)),p=1),l&&(l.abort(),l=null);const e=n-g;return e>d?(r.set(t=c),0):(r.set(t=x(h(e/d))),1)})),i.promise}return{set:c,update(n,e){return c(n(s,t),e)},subscribe:r.subscribe}}const pt=ut(0),ft=globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches,dt=t=>({l:it,duration:ft?0:t});function mt(t){let n,e,o,r,i=!t[2]&&ht();return{c(){n=x("div"),i&&i.c(),y(n,"class","bp-load"),$(n,"background-image","url("+t[0]+")")},m(t,e){b(t,n,e),i&&i.m(n,null),r=1},p(e,o){(t=e)[2]?i&&(i.d(1),i=null):i||(i=ht(),i.c(),i.m(n,null)),(!r||1&o)&&$(n,"background-image","url("+t[0]+")")},i(i){r||(q((()=>{o&&o.end(1),e=Y(n,st,{duration:t[1]?400:0}),e.start()})),r=1)},o(t){e&&e.invalidate(),t&&(o=Z(n,st,{duration:480})),r=0},d(t){t&&g(n),i&&i.d(),t&&o&&o.end()}}}function ht(t){let n,e;return{c(){n=x("span"),e=x("span"),y(n,"class","bp-bar"),y(e,"class","bp-o")},m(t,o){b(t,n,o),b(t,e,o)},d(t){t&&g(n),t&&g(e)}}}function bt(t){let n,e=(!t[1]||t[2])&&mt(t);return{c(){e&&e.c(),n=v()},m(t,o){e&&e.m(t,o),b(t,n,o)},p(t,[o]){!t[1]||t[2]?e?(e.p(t,o),6&o&&U(e,1)):(e=mt(t),e.c(),U(e,1),e.m(n.parentNode,n)):e&&(H(),V(e,1,1,(()=>{e=null})),Q())},i(t){U(e)},o(t){V(e)},d(t){e&&e.d(t),t&&g(n)}}}function gt(t,n,e){let o;c(t,pt,(t=>e(2,o=t)));let{thumb:r}=n,{loaded:i}=n;return t.$$set=t=>{"thumb"in t&&e(0,r=t.thumb),"loaded"in t&&e(1,i=t.loaded)},[r,i,o]}class xt extends rt{constructor(t){super(),ot(this,t,gt,bt,s,{thumb:0,loaded:1})}}function vt(t){let n,e,o,r,i,s;return{c(){n=x("img"),y(n,"srcset",e=t[7].img),y(n,"sizes",o=t[8].sizes||t[1]+"px"),y(n,"alt",r=t[7].alt)},m(t,e){b(t,n,e),s=1},p(t,e){(!s||2&e[0]&&o!==(o=t[8].sizes||t[1]+"px"))&&y(n,"sizes",o)},i(t){s||(i&&i.end(1),s=1)},o(t){i=Z(n,st,{}),s=0},d(t){t&&g(n),t&&i&&i.end()}}}function wt(t){let n,e;return n=new xt({v:{thumb:t[7].thumb,loaded:t[2]}}),{c(){tt(n.$$.t)},m(t,o){nt(n,t,o),e=1},p(t,e){const o={};4&e[0]&&(o.loaded=t[2]),n.$set(o)},i(t){e||(U(n.$$.t,t),e=1)},o(t){V(n.$$.t,t),e=0},d(t){et(n,t)}}}function yt(t){let n,e,o,i,s,c,u=t[2]&&vt(t),a=t[3]&&wt(t);return{c(){n=x("div"),e=x("div"),u&&u.c(),o=v(),a&&a.c(),y(e,"class","bp-img"),$(e,"background-image","url("+t[7].thumb+")"),$(e,"width",t[0][0]+"px"),$(e,"height",t[0][1]+"px"),$(e,"transform","translate3d("+(t[0][0]/-2+t[6][0])+"px, "+(t[0][1]/-2+t[6][1])+"px, 0)"),y(n,"class","bp-img-wrap"),k(n,"bp-drag",t[4]),k(n,"bp-close",t[5])},m(r,p){b(r,n,p),h(n,e),u&&u.m(e,null),h(e,o),a&&a.m(e,null),i=1,s||(c=[l(t[16].call(null,n)),w(n,"wheel",t[12]),w(n,"pointerdown",t[13]),w(n,"pointermove",t[14]),w(n,"pointerup",t[15]),w(n,"pointercancel",t[15])],s=1)},p(t,r){t[2]?u?(u.p(t,r),4&r[0]&&U(u,1)):(u=vt(t),u.c(),U(u,1),u.m(e,o)):u&&(H(),V(u,1,1,(()=>{u=null})),Q()),t[3]?a?(a.p(t,r),8&r[0]&&U(a,1)):(a=wt(t),a.c(),U(a,1),a.m(e,null)):a&&(H(),V(a,1,1,(()=>{a=null})),Q()),(!i||1&r[0])&&$(e,"width",t[0][0]+"px"),(!i||1&r[0])&&$(e,"height",t[0][1]+"px"),(!i||65&r[0])&&$(e,"transform","translate3d("+(t[0][0]/-2+t[6][0])+"px, "+(t[0][1]/-2+t[6][1])+"px, 0)"),16&r[0]&&k(n,"bp-drag",t[4]),32&r[0]&&k(n,"bp-close",t[5])},i(t){i||(U(u),U(a),i=1)},o(t){V(u),V(a),i=0},d(t){t&&g(n),u&&u.d(),a&&a.d(),s=0,r(c)}}}function $t(t,n,e){let o,r,i,s;c(t,pt,(t=>e(21,i=t)));let{v:u}=n,{$:l}=n,{k:a,_:p,M:f,next:d,zoomed:m,container:h}=u;c(t,m,(t=>e(20,o=t)));let b,g,x,v,w,y,$,k,_,M,S=a.maxZoom||p.maxZoom||10,P=u.S(a),z=P[0],A=0;const T=+a.width,I=[],C=new Map,N=at(P,dt(400));c(t,N,(t=>e(0,s=t)));const E=at([0,0],dt(400));c(t,E,(t=>e(6,r=t)));const O=([t,n],o=s)=>{const r=(o[0]-h.w)/2,i=(o[1]-h.h)/2;return 0>r?t=0:t>r?l?(t=v?r+(t-r)/10:r)>r+20&&e(4,v=f()):t=r:-r>t&&(l?-r-20>(t=v?-r-(-r-t)/10:-r)&&e(4,v=d()):t=-r),0>i?n=0:n>i?n=i:-i>n&&(n=-i),[t,n]},R=(t,n=S)=>{if(i)return;const o=P[0]*S,[c,u]=s;let l=c+c*n,p=u+u*n;if(n>0)l>o&&(l=o,p=P[1]*S),l>T&&(l=T,p=+a.height);else if(P[0]>l)return N.set(P),E.set([0,0]);let{x:f,y:d,width:m,height:h}=t.target.getBoundingClientRect();const b=t.clientX-f-m/2,g=t.clientY-d-h/2;f=l/m*-b+b,d=p/h*-g+g;const x=[l,p];N.set(x).then((()=>{e(1,z=Math.round(Math.max(z,l)))})),E.set(O([r[0]+f,r[1]+d],x))};return t.$$set=t=>{"$"in t&&e(18,l=t.$)},t.$$.update=()=>{if(524289&t.$$.u[0]&&m.set(s[0]-10>P[0]),3670016&t.$$.u[0]&&i&&o&&!p.intro){const t=dt(480);E.set([0,0],t),N.set(P,t),e(5,M=1)}},[s,z,b,g,v,M,r,a,p,m,N,E,t=>{p.inline&&!o||(t.preventDefault(),R(t,t.deltaY/-300))},t=>{2!==t.button&&(t.preventDefault(),e(4,v=1),C.set(t.pointerId,t),y=t.clientX,$=t.clientY,k=r[0],_=r[1])},t=>{if(C.size>1)return x=1,e(4,v=0),p.noPinch?.(h.el)||(t=>{const[n,e]=C.set(t.pointerId,t).values(),o=Math.hypot(n.clientX-e.clientX,n.clientY-e.clientY);R(t,-.03*((A||o)-o)),A=o})(t);if(!v)return;let n=t.clientX,r=t.clientY;I.push({x:n,y:r}),n-=y,r-=$,o||(n>40&&e(4,v=f()),-40>n&&e(4,v=d()),-90>r&&!p.noClose&&u.close()),w=I.length>2,o&&w&&!i&&E.set(O([k+n,_+r]),{duration:0})},function(t){if(C.delete(t.pointerId),x)return x=C.size,void(A=0);if(v){if(e(4,v=0),t.target===this&&!p.noClose)return u.close();if(w){const[t,n,e]=I.slice(-3);Math.hypot(n.x-e.x,n.y-e.y)>5&&E.set(O([r[0]-5*(t.x-e.x),r[1]-5*(t.y-e.y)]))}else p.onImageClick?.(h.el,a)||R(t,o?-S:S);w=0,I.length=0}},()=>{u.P((()=>{e(19,P=u.S(a)),!p.inline&&l||(N.set(P),E.set([0,0]))})),u.A(a).then((()=>{e(2,b=1),u.T()})),setTimeout((()=>{e(3,g=!b)}),250)},u,l,P,o,i]}class kt extends rt{constructor(t){super(),ot(this,t,$t,yt,s,{v:17,$:18},null,[-1,-1])}}function _t(t){let n,e,o,i,s,c;return o=new xt({v:{thumb:t[2].thumb,loaded:t[0]}}),{c(){n=x("div"),e=x("iframe"),tt(o.$$.t),y(e,"allow","autoplay; fullscreen"),y(e,"title",t[2].title),y(n,"class","bp-if"),$(n,"width",t[1][0]+"px"),$(n,"height",t[1][1]+"px")},m(r,u){b(r,n,u),h(n,e),nt(o,n,null),i=1,s||(c=[l(t[3].call(null,e)),w(e,"load",t[5])],s=1)},p(t,[e]){const r={};1&e&&(r.loaded=t[0]),o.$set(r),(!i||2&e)&&$(n,"width",t[1][0]+"px"),(!i||2&e)&&$(n,"height",t[1][1]+"px")},i(t){i||(U(o.$$.t,t),i=1)},o(t){V(o.$$.t,t),i=0},d(t){t&&g(n),et(o),s=0,r(c)}}}function Mt(t,n,e){let o,r,{v:i}=n;const{k:s}=i,c=()=>e(1,r=i.S(s));return c(),i.P(c),[o,r,s,t=>t.src=s.iframe,i,()=>e(0,o=1)]}class St extends rt{constructor(t){super(),ot(this,t,Mt,_t,s,{v:4})}}function Pt(t){let n,e,o,r,i;return e=new xt({v:{thumb:t[2].thumb,loaded:t[0]}}),{c(){n=x("div"),tt(e.$$.t),y(n,"class","bp-vid"),$(n,"width",t[1][0]+"px"),$(n,"height",t[1][1]+"px"),$(n,"background-image","url("+t[2].thumb+")")},m(s,c){b(s,n,c),nt(e,n,null),o=1,r||(i=l(t[3].call(null,n)),r=1)},p(t,[r]){const i={};1&r&&(i.loaded=t[0]),e.$set(i),(!o||2&r)&&$(n,"width",t[1][0]+"px"),(!o||2&r)&&$(n,"height",t[1][1]+"px")},i(t){o||(U(e.$$.t,t),o=1)},o(t){V(e.$$.t,t),o=0},d(t){t&&g(n),et(e),r=0,i()}}}function zt(t,n,e){let o,r,{v:i}=n;const{k:s}=i,c=()=>e(1,r=i.S(s));c(),i.P(c);const u=(t,n)=>{for(const e in n)y(t,e,n[e])};return[o,r,s,t=>{let n;const r=(t,e)=>{Array.isArray(e)||(e=JSON.parse(e));for(const o of e){n||(n=x(o.type?.includes("audio")?"audio":"video"),u(n,{controls:1,autoplay:1,playsinline:1,tabindex:"0"}));const e=x(t);u(e,o),h(n,e)}};r("source",s.sources),r("track",s.tracks||[]),w(n,"canplay",(()=>e(0,o=1))),h(t,n)},i]}class At extends rt{constructor(t){super(),ot(this,t,zt,Pt,s,{v:4})}}function Tt(n){let e,o,i,c,u,a,p,f,d,m,v=n[6].i,$=Rt(n),_=n[0].length>1&&qt(n);return{c(){e=x("div"),o=x("div"),$.c(),c=x("div"),u=x("button"),_&&_.c(),y(u,"class","bp-x"),y(u,"title","Close"),y(u,"aria-label","Close"),y(c,"class","bp-controls"),y(e,"class","bp-wrap"),k(e,"bp-zoomed",n[10]),k(e,"bp-inline",n[8]),k(e,"bp-small",n[7]),k(e,"bp-noclose",n[5].noClose)},m(t,r){b(t,e,r),h(e,o),$.m(e,null),h(e,c),h(c,u),_&&_.m(c,null),f=1,d||(m=[w(u,"click",n[1]),l(p=n[14].call(null,e))],d=1)},p(n,o){64&o[0]&&s(v,v=n[6].i)?(H(),V($,1,1,t),Q(),$=Rt(n),$.c(),U($),$.m(e,c)):$.p(n,o),n[0].length>1?_?_.p(n,o):(_=qt(n),_.c(),_.m(c,null)):_&&(_.d(1),_=null),1024&o[0]&&k(e,"bp-zoomed",n[10]),256&o[0]&&k(e,"bp-inline",n[8]),128&o[0]&&k(e,"bp-small",n[7]),32&o[0]&&k(e,"bp-noclose",n[5].noClose)},i(t){f||(i&&i.end(1),U($),a&&a.end(1),f=1)},o(t){i=Z(o,st,{duration:480}),V($),a=Z(c,st,{}),f=0},d(t){t&&g(e),t&&i&&i.end(),$.d(t),_&&_.d(),t&&a&&a.end(),d=0,r(m)}}}function It(n){let e,o=n[6].html+"";return{c(){e=x("div"),y(e,"class","bp-html")},m(t,n){b(t,e,n),e.innerHTML=o},p(t,n){64&n[0]&&o!==(o=t[6].html+"")&&(e.innerHTML=o)},i:t,o:t,d(t){t&&g(e)}}}function Ct(n){let e,o;return e=new St({v:{v:n[13]()}}),{c(){tt(e.$$.t)},m(t,n){nt(e,t,n),o=1},p:t,i(t){o||(U(e.$$.t,t),o=1)},o(t){V(e.$$.t,t),o=0},d(t){et(e,t)}}}function Nt(n){let e,o;return e=new At({v:{v:n[13]()}}),{c(){tt(e.$$.t)},m(t,n){nt(e,t,n),o=1},p:t,i(t){o||(U(e.$$.t,t),o=1)},o(t){V(e.$$.t,t),o=0},d(t){et(e,t)}}}function Et(t){let n,e;return n=new kt({v:{v:t[13](),$:t[7]}}),{c(){tt(n.$$.t)},m(t,o){nt(n,t,o),e=1},p(t,e){const o={};128&e[0]&&(o.$=t[7]),n.$set(o)},i(t){e||(U(n.$$.t,t),e=1)},o(t){V(n.$$.t,t),e=0},d(t){et(n,t)}}}function Ot(t){let n,e,o,r=t[6].caption+"";return{c(){n=x("div"),y(n,"class","bp-cap"),y(n,"tabindex","0")},m(t,e){b(t,n,e),n.innerHTML=r,o=1},p(t,e){(!o||64&e[0])&&r!==(r=t[6].caption+"")&&(n.innerHTML=r)},i(t){o||(e&&e.end(1),o=1)},o(t){e=Z(n,st,{duration:200}),o=0},d(t){t&&g(n),t&&e&&e.end()}}}function Rt(t){let n,e,o,i,s,c,u,l,a;const p=[Et,Nt,Ct,It],f=[];function d(t,n){return t[6].img?0:t[6].sources?1:t[6].iframe?2:3}e=d(t),o=f[e]=p[e](t);let m=t[6].caption&&Ot(t);return{c(){n=x("div"),o.c(),m&&m.c(),c=v(),y(n,"class","bp-inner")},m(o,r){b(o,n,r),f[e].m(n,null),m&&m.m(o,r),b(o,c,r),u=1,l||(a=[w(n,"pointerdown",t[21]),w(n,"pointerup",t[22])],l=1)},p(t,r){let i=e;e=d(t),e===i?f[e].p(t,r):(H(),V(f[i],1,1,(()=>{f[i]=null})),Q(),o=f[e],o?o.p(t,r):(o=f[e]=p[e](t),o.c()),U(o,1),o.m(n,null)),t[6].caption?m?(m.p(t,r),64&r[0]&&U(m,1)):(m=Ot(t),m.c(),U(m,1),m.m(c.parentNode,c)):m&&(H(),V(m,1,1,(()=>{m=null})),Q())},i(e){u||(U(o),q((()=>{s&&s.end(1),i=Y(n,t[12],1),i.start()})),U(m),u=1)},o(e){V(o),i&&i.invalidate(),s=Z(n,t[12],0),V(m),u=0},d(t){t&&g(n),f[e].d(),t&&s&&s.end(),m&&m.d(t),t&&g(c),l=0,r(a)}}}function qt(t){let n,e,o,i,s,c=`${t[4]+1} / ${t[0].length}`;return{c(){n=x("div"),e=x("button"),o=x("button"),y(n,"class","bp-count"),y(e,"class","bp-prev"),y(e,"title","Previous"),y(e,"aria-label","Previous"),y(o,"class","bp-next"),y(o,"title","Next"),y(o,"aria-label","Next")},m(r,u){b(r,n,u),n.innerHTML=c,b(r,e,u),b(r,o,u),i||(s=[w(e,"click",t[2]),w(o,"click",t[3])],i=1)},p(t,e){17&e[0]&&c!==(c=`${t[4]+1} / ${t[0].length}`)&&(n.innerHTML=c)},d(t){t&&g(n),t&&g(e),t&&g(o),i=0,r(s)}}}function Ft(t){let n,e,o=t[0]&&Tt(t);return{c(){o&&o.c(),n=v()},m(t,r){o&&o.m(t,r),b(t,n,r),e=1},p(t,e){t[0]?o?(o.p(t,e),1&e[0]&&U(o,1)):(o=Tt(t),o.c(),U(o,1),o.m(n.parentNode,n)):o&&(H(),V(o,1,1,(()=>{o=null})),Q())},i(t){e||(U(o),e=1)},o(t){V(o),e=0},d(t){o&&o.d(t),t&&g(n)}}}function jt(t,n,e){let o,r;c(t,pt,(t=>e(26,o=t)));let{items:i}=n,{target:s}=n;const l=document.documentElement;let a,p,f,d,m,h,b,g,v,y,$;const k=t=>$=t,_={},M=ut(0);c(t,M,(t=>e(10,r=t)));const S=()=>{p.onClose?.(),u(pt,o=1,o),e(0,i=null),d?.focus({preventScroll:1})},P=()=>A(a-1),z=()=>A(a+1),A=t=>{b=t-a,e(4,a=T(t))},T=t=>(t+i.length)%i.length,I=t=>{const{key:n,shiftKey:e}=t;if("Escape"===n)!p.noClose&&S();else if("ArrowRight"===n)z();else if("ArrowLeft"===n)P();else if("Tab"===n){const{activeElement:n}=document;if(e||!n.controls){t.preventDefault();const{focusWrap:o=_.el}=p,r=[...o.querySelectorAll("*")].filter((t=>t.tabIndex>=0));let i=r.indexOf(n);i+=r.length+(e?-1:1),r[i%r.length].focus()}}},C=({width:t=1920,height:n=1080})=>{const{scale:e=.99}=p,o=Math.min(1,_.w/t*e,_.h/n*e);return[Math.round(t*o),Math.round(n*o)]},N=()=>{if(i){const t=i[T(a+1)],n=i[T(a-1)];!t.preload&&E(t),!n.preload&&E(n)}},E=t=>{if(t.img){const n=x("img");return n.sizes=p.sizes||C(t)[0]+"px",n.srcset=t.img,t.preload=1,n.decode()}};return t.$$set=t=>{"items"in t&&e(0,i=t.items),"target"in t&&e(15,s=t.target)},t.$$.update=()=>{1835121&t.$$.u[0]&&i&&(e(6,v=i[a]),e(19,y=v.hasOwnProperty("html")),f&&(y&&k(null),p.onUpdate?.(_.el,v)))},[i,S,P,z,a,p,v,m,h,g,r,M,(t,n)=>f&&i?st(t,{x:(b>0?20:-20)*(n?1:-1),duration:250}):(e(18,f=n),p.intro?st(t,{y:n?10:-10}):(t=>{let n;if(y){const e=t.firstChild.firstChild;n=[e.clientWidth,e.clientHeight]}else n=C(v);const e=(v.element||d).getBoundingClientRect(),o=e.left-(_.w-e.width)/2,r=e.top-(_.h-e.height)/2,i=e.width/n[0],s=e.height/n[1];return{duration:480,l:it,css:(t,n)=>`transform:translate3d(${o*n}px, ${r*n}px, 0) scale3d(${i+t*(1-i)}, ${s+t*(1-s)}, 1)`}})(t)),()=>({k:v,S:C,A:E,T:N,_:p,M:P,next:z,close:S,P:k,zoomed:M,container:_}),t=>{let n,r;e(20,_.el=t,_),p.onOpen?.(_.el,v),h||(n=w(globalThis,"keydown",I));const i=new ResizeObserver((t=>{r&&(e(20,_.w=t[0].contentRect.width,_),e(20,_.h=t[0].contentRect.height,_),e(7,m=769>_.w),$?.(),p.onResize?.(_.el,v)),r=1}));return i.observe(t),{destroy(){i.disconnect(),n?.(),u(pt,o=0,o),l.classList.remove("bp-lock"),p.onClosed?.()}}},s,t=>{e(5,p=t),e(8,h=p.inline);const n=p.items;!h&&l.scrollHeight>l.clientHeight&&l.classList.add("bp-lock"),d=document.activeElement,e(20,_.w=s.offsetWidth,_),e(20,_.h=s===document.body?globalThis.innerHeight:s.clientHeight,_),e(7,m=769>_.w),e(4,a=p.position||0),e(0,i=Array.isArray(n)?n.map(((t,n)=>(p.el&&p.el===t.element&&e(4,a=n),{i:n,...t}))):(n.length?[...n]:[n]).map(((t,n)=>(p.el===t&&e(4,a=n),{element:t,i:n,...t.dataset}))))},A,f,y,_,t=>e(9,g=t.target),function(t){2!==t.button&&t.target===this&&g===this&&!p.noClose&&S()}]}class Bt extends rt{constructor(t){super(),ot(this,t,jt,Ft,s,{items:0,target:15,open:16,close:1,M:2,next:3,setPosition:17},null,[-1,-1])}get items(){return this.$$.ctx[0]}get target(){return this.$$.ctx[15]}get open(){return this.$$.ctx[16]}get close(){return this.$$.ctx[1]}get M(){return this.$$.ctx[2]}get next(){return this.$$.ctx[3]}get setPosition(){return this.$$.ctx[17]}}return t=>new Bt({...t,v:t})}(); diff --git a/dist/bigger-picture.min.mjs b/dist/bigger-picture.min.mjs index 81af7ab..1a9ff34 100644 --- a/dist/bigger-picture.min.mjs +++ b/dist/bigger-picture.min.mjs @@ -1 +1 @@ -function t(){}const n=t=>t;function e(t,n){for(const e in n)t[e]=n[e];return t}function o(t){return t()}function r(t){t.forEach(o)}function i(t){return"function"==typeof t}function s(t,n){return t!=t?n==n:t!==n}function u(n,e,o){n.$$.on_destroy.push(((n,...e)=>{if(null==n)return t;const o=n.subscribe(...e);return o.unsubscribe?()=>o.unsubscribe():o})(e,o))}function c(t,n,e){return t.set(e),n}function l(n){return n&&i(n.destroy)?n.destroy:t}let a=()=>globalThis.performance.now(),p=t=>requestAnimationFrame(t);const f=new Set;function d(t){f.forEach((n=>{n.c(t)||(f.delete(n),n.f())})),0!==f.size&&p(d)}function m(t){let n;return 0===f.size&&p(d),{promise:new Promise((e=>{f.add(n={c:t,f:e})})),abort(){f.delete(n)}}}function h(t,n){t.appendChild(n)}function b(t,n,e){t.insertBefore(n,e||null)}function g(t){t.parentNode.removeChild(t)}function x(t){return document.createElement(t)}function w(){return document.createTextNode("")}function v(t,n,e,o){return t.addEventListener(n,e,o),()=>t.removeEventListener(n,e,o)}function y(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function $(t,n,e,o){null===e?t.style.removeProperty(n):t.style.setProperty(n,e)}function k(t,n,e){t.classList[e?"add":"remove"](n)}let _,M,S=0,P={};function z(t,n,e,o,r,i,s,u=0){const c=16.666/o;let l="{\n";for(let t=0;1>=t;t+=c){const o=n+(e-n)*i(t);l+=100*t+`%{${s(o,1-o)}}\n`}const a=l+`100% {${s(e,1-e)}}\n}`,p=`_bp_${Math.round(1e9*Math.random())}_${u}`;if(!P[p]){if(!_){const t=x("style");document.head.appendChild(t),_=t.sheet}P[p]=1,_.insertRule(`@keyframes ${p} ${a}`,_.cssRules.length)}const f=t.style.animation||"";return t.style.animation=`${f?f+", ":""}${p} ${o}ms linear ${r}ms 1 both`,S+=1,p}function A(t,n){t.style.animation=(t.style.animation||"").split(", ").filter(n?t=>0>t.indexOf(n):t=>-1===t.indexOf("_bp")).join(", "),n&&!--S&&p((()=>{if(S)return;let t=_.cssRules.length;for(;t--;)_.deleteRule(t);P={}}))}function T(t){M=t}const I=[],C=[],N=[],E=[],O=Promise.resolve();let R=0;function q(t){N.push(t)}const F=new Set;let j,D=0;function J(){const t=M;do{for(;I.length>D;){const t=I[D];D++,T(t),K(t.$$)}for(T(null),I.length=0,D=0;C.length;)C.pop()();for(let t=0;N.length>t;t+=1){const n=N[t];F.has(n)||(F.add(n),n())}N.length=0}while(I.length);for(;E.length;)E.pop()();R=0,F.clear(),T(t)}function K(t){if(null!==t.t){t.update(),r(t.before_update);const n=t.u;t.u=[-1],t.t&&t.t.p(t.ctx,n),t.after_update.forEach(q)}}function L(){return j||(j=Promise.resolve(),j.then((()=>{j=null}))),j}function W(t,n,e){t.dispatchEvent(((t,n,e=0)=>{const o=document.createEvent("CustomEvent");return o.initCustomEvent(t,e,0,n),o})(`${n?"intro":"outro"}${e}`))}const B=new Set;let G;function H(){G={r:0,c:[],p:G}}function Q(){G.r||r(G.c),G=G.p}function U(t,n){t&&t.i&&(B.delete(t),t.i(n))}function V(t,n,e,o){if(t&&t.o){if(B.has(t))return;B.add(t),G.c.push((()=>{B.delete(t),o&&(e&&t.d(1),o())})),t.o(n)}}const X={duration:0};function Y(e,o,r){let s,u,c=o(e,r),l=0,p=0;function f(){s&&A(e,s)}function d(){const{delay:o=0,duration:r=300,l:i=n,g:d=t,css:h}=c||X;h&&(s=z(e,0,1,r,o,i,h,p++)),d(0,1);const b=a()+o,g=b+r;u&&u.abort(),l=1,q((()=>W(e,1,"start"))),u=m((t=>{if(l){if(t>=g)return d(1,0),W(e,1,"end"),f(),l=0;if(t>=b){const n=i((t-b)/r);d(n,1-n)}}return l}))}let h=0;return{start(){h||(h=1,A(e),i(c)?(c=c(),L().then(d)):d())},invalidate(){h=0},end(){l&&(f(),l=0)}}}function Z(e,o,s){let u,c=o(e,s),l=1;const p=G;function f(){const{delay:o=0,duration:i=300,l:s=n,g:f=t,css:d}=c||X;d&&(u=z(e,1,0,i,o,s,d));const h=a()+o,b=h+i;q((()=>W(e,0,"start"))),m((t=>{if(l){if(t>=b)return f(0,1),W(e,0,"end"),--p.r||r(p.c),0;if(t>=h){const n=s((t-h)/i);f(1-n,n)}}return l}))}return p.r+=1,i(c)?L().then((()=>{c=c(),f()})):f(),{end(t){t&&c.g&&c.g(1,0),l&&(u&&A(e,u),l=0)}}}function tt(t){t&&t.c()}function nt(t,n,e,s){const{t:u,on_mount:c,on_destroy:l,after_update:a}=t.$$;u&&u.m(n,e),s||q((()=>{const n=c.map(o).filter(i);l?l.push(...n):r(n),t.$$.on_mount=[]})),a.forEach(q)}function et(t,n){const e=t.$$;null!==e.t&&(r(e.on_destroy),e.t&&e.t.d(n),e.on_destroy=e.t=null,e.ctx=[])}function ot(n,e,o,i,s,u,c,l=[-1]){const a=M;T(n);const p=n.$$={t:null,ctx:null,v:u,update:t,not_equal:s,bound:{},on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:{},u:l,skip_bound:0,root:e.target||a.$$.root};c&&c(p.root);let f=0;p.ctx=o?o(n,e.v||{},((t,e,...o)=>{const r=o.length?o[0]:e;return p.ctx&&s(p.ctx[t],p.ctx[t]=r)&&(!p.skip_bound&&p.bound[t]&&p.bound[t](r),f&&((t,n)=>{-1===t.$$.u[0]&&(I.push(t),R||(R=1,O.then(J)),t.$$.u.fill(0)),t.$$.u[n/31|0]|=1<{const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}$set(t){this.$$set&&0!==Object.keys(t).length&&(this.$$.skip_bound=1,this.$$set(t),this.$$.skip_bound=0)}}function it(t){const n=t-1;return n*n*n+1}function st(t,{delay:n=0,duration:e=400,l:o=it,x:r=0,y:i=0,opacity:s=0}={}){const u=getComputedStyle(t),c=+u.opacity,l="none"===u.transform?"":u.transform,a=c*(1-s);return{delay:n,duration:e,l:o,css(t,n){return`\n\t\t\ttransform: ${l} translate(${(1-t)*r}px, ${(1-t)*i}px);\n\t\t\topacity: ${c-a*n}`}}}const ut=[];function ct(n,e=t){let o;const r=new Set;function i(t){if(s(n,t)&&(n=t,o)){const t=!ut.length;for(const t of r)t[1](),ut.push(t,n);if(t){for(let t=0;ut.length>t;t+=2)ut[t][0](ut[t+1]);ut.length=0}}}return{set:i,update(t){i(t(n))},subscribe(s,u=t){const c=[s,u];return r.add(c),1===r.size&&(o=e(i)||t),s(n),()=>{r.delete(c),0===r.size&&(o(),o=null)}}}}function lt(t,n){if(t===n||t!=t)return()=>t;const e=typeof t;if(Array.isArray(t)){const e=n.map(((n,e)=>lt(t[e],n)));return t=>e.map((n=>n(t)))}if("number"===e){const e=n-t;return n=>t+n*e}}function at(t,o={}){const r=ct(t);let i,s=t;function u(u,c){if(null==t)return r.set(t=u),Promise.resolve();s=u;let l=i,p=0,{delay:f=0,duration:d=400,l:h=n,interpolate:b=lt}=e(e({},o),c);if(0===d)return l&&(l.abort(),l=null),r.set(t=s),Promise.resolve();const g=a()+f;let x;return i=m((n=>{if(g>n)return 1;p||(x=b(t,u),"function"==typeof d&&(d=d(t,u)),p=1),l&&(l.abort(),l=null);const e=n-g;return e>d?(r.set(t=u),0):(r.set(t=x(h(e/d))),1)})),i.promise}return{set:u,update(n,e){return u(n(s,t),e)},subscribe:r.subscribe}}const pt=ct(0),ft=globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches,dt=t=>({l:it,duration:ft?0:t});function mt(t){let n,e,o,r,i=!t[2]&&ht();return{c(){n=x("div"),i&&i.c(),y(n,"class","bp-load"),$(n,"background-image","url("+t[0]+")")},m(t,e){b(t,n,e),i&&i.m(n,null),r=1},p(e,o){(t=e)[2]?i&&(i.d(1),i=null):i||(i=ht(),i.c(),i.m(n,null)),(!r||1&o)&&$(n,"background-image","url("+t[0]+")")},i(i){r||(q((()=>{o&&o.end(1),e=Y(n,st,{duration:t[1]?400:0}),e.start()})),r=1)},o(t){e&&e.invalidate(),t&&(o=Z(n,st,{duration:480})),r=0},d(t){t&&g(n),i&&i.d(),t&&o&&o.end()}}}function ht(t){let n,e;return{c(){n=x("span"),e=x("span"),y(n,"class","bp-bar"),y(e,"class","bp-o")},m(t,o){b(t,n,o),b(t,e,o)},d(t){t&&g(n),t&&g(e)}}}function bt(t){let n,e=(!t[1]||t[2])&&mt(t);return{c(){e&&e.c(),n=w()},m(t,o){e&&e.m(t,o),b(t,n,o)},p(t,[o]){!t[1]||t[2]?e?(e.p(t,o),6&o&&U(e,1)):(e=mt(t),e.c(),U(e,1),e.m(n.parentNode,n)):e&&(H(),V(e,1,1,(()=>{e=null})),Q())},i(t){U(e)},o(t){V(e)},d(t){e&&e.d(t),t&&g(n)}}}function gt(t,n,e){let o;u(t,pt,(t=>e(2,o=t)));let{thumb:r}=n,{loaded:i}=n;return t.$$set=t=>{"thumb"in t&&e(0,r=t.thumb),"loaded"in t&&e(1,i=t.loaded)},[r,i,o]}class xt extends rt{constructor(t){super(),ot(this,t,gt,bt,s,{thumb:0,loaded:1})}}function wt(t){let n,e,o,r,i,s;return{c(){n=x("img"),y(n,"srcset",e=t[7].img),y(n,"sizes",o=t[8].sizes||t[1]+"px"),y(n,"alt",r=t[7].alt)},m(t,e){b(t,n,e),s=1},p(t,e){(!s||2&e[0]&&o!==(o=t[8].sizes||t[1]+"px"))&&y(n,"sizes",o)},i(t){s||(i&&i.end(1),s=1)},o(t){i=Z(n,st,{}),s=0},d(t){t&&g(n),t&&i&&i.end()}}}function vt(t){let n,e;return n=new xt({v:{thumb:t[7].thumb,loaded:t[2]}}),{c(){tt(n.$$.t)},m(t,o){nt(n,t,o),e=1},p(t,e){const o={};4&e[0]&&(o.loaded=t[2]),n.$set(o)},i(t){e||(U(n.$$.t,t),e=1)},o(t){V(n.$$.t,t),e=0},d(t){et(n,t)}}}function yt(t){let n,e,o,i,s,u,c=t[2]&&wt(t),a=t[3]&&vt(t);return{c(){n=x("div"),e=x("div"),c&&c.c(),o=w(),a&&a.c(),y(e,"class","bp-img"),$(e,"background-image","url("+t[7].thumb+")"),$(e,"width",t[0][0]+"px"),$(e,"height",t[0][1]+"px"),$(e,"transform","translate3d("+(t[0][0]/-2+t[6][0])+"px, "+(t[0][1]/-2+t[6][1])+"px, 0)"),y(n,"class","bp-img-wrap"),k(n,"bp-drag",t[4]),k(n,"bp-close",t[5])},m(r,p){b(r,n,p),h(n,e),c&&c.m(e,null),h(e,o),a&&a.m(e,null),i=1,s||(u=[l(t[16].call(null,n)),v(n,"wheel",t[12]),v(n,"pointerdown",t[13]),v(n,"pointermove",t[14]),v(n,"pointerup",t[15]),v(n,"pointercancel",t[15])],s=1)},p(t,r){t[2]?c?(c.p(t,r),4&r[0]&&U(c,1)):(c=wt(t),c.c(),U(c,1),c.m(e,o)):c&&(H(),V(c,1,1,(()=>{c=null})),Q()),t[3]?a?(a.p(t,r),8&r[0]&&U(a,1)):(a=vt(t),a.c(),U(a,1),a.m(e,null)):a&&(H(),V(a,1,1,(()=>{a=null})),Q()),(!i||1&r[0])&&$(e,"width",t[0][0]+"px"),(!i||1&r[0])&&$(e,"height",t[0][1]+"px"),(!i||65&r[0])&&$(e,"transform","translate3d("+(t[0][0]/-2+t[6][0])+"px, "+(t[0][1]/-2+t[6][1])+"px, 0)"),16&r[0]&&k(n,"bp-drag",t[4]),32&r[0]&&k(n,"bp-close",t[5])},i(t){i||(U(c),U(a),i=1)},o(t){V(c),V(a),i=0},d(t){t&&g(n),c&&c.d(),a&&a.d(),s=0,r(u)}}}function $t(t,n,e){let o,r,i,s;u(t,pt,(t=>e(21,i=t)));let{v:c}=n,{$:l}=n,{k:a,_:p,M:f,next:d,zoomed:m,container:h}=c;u(t,m,(t=>e(20,o=t)));let b,g,x,w,v,y,$,k,_,M,S=a.maxZoom||p.maxZoom||10,P=c.S(a),z=P[0],A=0;const T=+a.width,I=[],C=new Map,N=at(P,dt(400));u(t,N,(t=>e(0,s=t)));const E=at([0,0],dt(400));u(t,E,(t=>e(6,r=t)));const O=([t,n],o=s)=>{const r=(o[0]-h.w)/2,i=(o[1]-h.h)/2;return 0>r?t=0:t>r?l?(t=w?r+(t-r)/10:r)>r+20&&e(4,w=f()):t=r:-r>t&&(l?-r-20>(t=w?-r-(-r-t)/10:-r)&&e(4,w=d()):t=-r),0>i?n=0:n>i?n=i:-i>n&&(n=-i),[t,n]},R=(t,n=S)=>{if(i)return;const o=P[0]*S,[u,c]=s;let l=u+u*n,p=c+c*n;if(n>0)l>o&&(l=o,p=P[1]*S),l>T&&(l=T,p=+a.height);else if(P[0]>l)return N.set(P),E.set([0,0]);let{x:f,y:d,width:m,height:h}=t.target.getBoundingClientRect();const b=t.clientX-f-m/2,g=t.clientY-d-h/2;f=l/m*-b+b,d=p/h*-g+g;const x=[l,p];N.set(x).then((()=>{e(1,z=Math.round(Math.max(z,l)))})),E.set(O([r[0]+f,r[1]+d],x))};return t.$$set=t=>{"$"in t&&e(18,l=t.$)},t.$$.update=()=>{if(524289&t.$$.u[0]&&m.set(s[0]-10>P[0]),3670016&t.$$.u[0]&&i&&o&&!p.intro){const t=dt(480);E.set([0,0],t),N.set(P,t),e(5,M=1)}},[s,z,b,g,w,M,r,a,p,m,N,E,t=>{p.inline&&!o||(t.preventDefault(),R(t,t.deltaY/-300))},t=>{2!==t.button&&(t.preventDefault(),e(4,w=1),C.set(t.pointerId,t),y=t.clientX,$=t.clientY,k=r[0],_=r[1])},t=>{if(C.size>1)return x=1,e(4,w=0),p.noPinch?.(h)||(t=>{const[n,e]=C.set(t.pointerId,t).values(),o=Math.hypot(n.clientX-e.clientX,n.clientY-e.clientY);R(t,-.03*((A||o)-o)),A=o})(t);if(!w)return;let n=t.clientX,r=t.clientY;I.push({x:n,y:r}),n-=y,r-=$,o||(n>40&&e(4,w=f()),-40>n&&e(4,w=d()),-90>r&&!p.noClose&&c.close()),v=I.length>2,o&&v&&!i&&E.set(O([k+n,_+r]),{duration:0})},function(t){if(C.delete(t.pointerId),x)return x=C.size,void(A=0);if(w){if(e(4,w=0),t.target===this&&!p.noClose)return c.close();if(v){const[t,n,e]=I.slice(-3);Math.hypot(n.x-e.x,n.y-e.y)>5&&E.set(O([r[0]-5*(t.x-e.x),r[1]-5*(t.y-e.y)]))}else p.onImageClick?.(h.el,a)||R(t,o?-S:S);v=0,I.length=0}},()=>{c.P((()=>{e(19,P=c.S(a)),!p.inline&&l||(N.set(P),E.set([0,0]))})),c.A(a).then((()=>{e(2,b=1),c.T()})),setTimeout((()=>{e(3,g=!b)}),250)},c,l,P,o,i]}class kt extends rt{constructor(t){super(),ot(this,t,$t,yt,s,{v:17,$:18},null,[-1,-1])}}function _t(t){let n,e,o,i,s,u;return o=new xt({v:{thumb:t[2].thumb,loaded:t[0]}}),{c(){n=x("div"),e=x("iframe"),tt(o.$$.t),y(e,"allow","autoplay; fullscreen"),y(e,"title",t[2].title),y(n,"class","bp-if"),$(n,"width",t[1][0]+"px"),$(n,"height",t[1][1]+"px")},m(r,c){b(r,n,c),h(n,e),nt(o,n,null),i=1,s||(u=[l(t[3].call(null,e)),v(e,"load",t[5])],s=1)},p(t,[e]){const r={};1&e&&(r.loaded=t[0]),o.$set(r),(!i||2&e)&&$(n,"width",t[1][0]+"px"),(!i||2&e)&&$(n,"height",t[1][1]+"px")},i(t){i||(U(o.$$.t,t),i=1)},o(t){V(o.$$.t,t),i=0},d(t){t&&g(n),et(o),s=0,r(u)}}}function Mt(t,n,e){let o,r,{v:i}=n;const{k:s}=i,u=()=>e(1,r=i.S(s));return u(),i.P(u),[o,r,s,t=>t.src=s.iframe,i,()=>e(0,o=1)]}class St extends rt{constructor(t){super(),ot(this,t,Mt,_t,s,{v:4})}}function Pt(t){let n,e,o,r,i;return e=new xt({v:{thumb:t[2].thumb,loaded:t[0]}}),{c(){n=x("div"),tt(e.$$.t),y(n,"class","bp-vid"),$(n,"width",t[1][0]+"px"),$(n,"height",t[1][1]+"px"),$(n,"background-image","url("+t[2].thumb+")")},m(s,u){b(s,n,u),nt(e,n,null),o=1,r||(i=l(t[3].call(null,n)),r=1)},p(t,[r]){const i={};1&r&&(i.loaded=t[0]),e.$set(i),(!o||2&r)&&$(n,"width",t[1][0]+"px"),(!o||2&r)&&$(n,"height",t[1][1]+"px")},i(t){o||(U(e.$$.t,t),o=1)},o(t){V(e.$$.t,t),o=0},d(t){t&&g(n),et(e),r=0,i()}}}function zt(t,n,e){let o,r,{v:i}=n;const{k:s}=i,u=()=>e(1,r=i.S(s));u(),i.P(u);const c=(t,n)=>{for(const e in n)y(t,e,n[e])};return[o,r,s,t=>{let n;const r=(t,e)=>{Array.isArray(e)||(e=JSON.parse(e));for(const o of e){n||(n=x(o.type?.includes("audio")?"audio":"video"),c(n,{controls:1,autoplay:1,playsinline:1,tabindex:"0"}));const e=x(t);c(e,o),h(n,e)}};r("source",s.sources),r("track",s.tracks||[]),v(n,"canplay",(()=>e(0,o=1))),h(t,n)},i]}class At extends rt{constructor(t){super(),ot(this,t,zt,Pt,s,{v:4})}}function Tt(n){let e,o,i,u,c,a,p,f,d,m,w=n[6].i,$=Rt(n),_=n[0].length>1&&qt(n);return{c(){e=x("div"),o=x("div"),$.c(),u=x("div"),c=x("button"),_&&_.c(),y(c,"class","bp-x"),y(c,"title","Close"),y(c,"aria-label","Close"),y(u,"class","bp-controls"),y(e,"class","bp-wrap"),k(e,"bp-zoomed",n[10]),k(e,"bp-inline",n[8]),k(e,"bp-small",n[7]),k(e,"bp-noclose",n[5].noClose)},m(t,r){b(t,e,r),h(e,o),$.m(e,null),h(e,u),h(u,c),_&&_.m(u,null),f=1,d||(m=[v(c,"click",n[1]),l(p=n[14].call(null,e))],d=1)},p(n,o){64&o[0]&&s(w,w=n[6].i)?(H(),V($,1,1,t),Q(),$=Rt(n),$.c(),U($),$.m(e,u)):$.p(n,o),n[0].length>1?_?_.p(n,o):(_=qt(n),_.c(),_.m(u,null)):_&&(_.d(1),_=null),1024&o[0]&&k(e,"bp-zoomed",n[10]),256&o[0]&&k(e,"bp-inline",n[8]),128&o[0]&&k(e,"bp-small",n[7]),32&o[0]&&k(e,"bp-noclose",n[5].noClose)},i(t){f||(i&&i.end(1),U($),a&&a.end(1),f=1)},o(t){i=Z(o,st,{duration:480}),V($),a=Z(u,st,{}),f=0},d(t){t&&g(e),t&&i&&i.end(),$.d(t),_&&_.d(),t&&a&&a.end(),d=0,r(m)}}}function It(n){let e,o=n[6].html+"";return{c(){e=x("div"),y(e,"class","bp-html")},m(t,n){b(t,e,n),e.innerHTML=o},p(t,n){64&n[0]&&o!==(o=t[6].html+"")&&(e.innerHTML=o)},i:t,o:t,d(t){t&&g(e)}}}function Ct(n){let e,o;return e=new St({v:{v:n[13]()}}),{c(){tt(e.$$.t)},m(t,n){nt(e,t,n),o=1},p:t,i(t){o||(U(e.$$.t,t),o=1)},o(t){V(e.$$.t,t),o=0},d(t){et(e,t)}}}function Nt(n){let e,o;return e=new At({v:{v:n[13]()}}),{c(){tt(e.$$.t)},m(t,n){nt(e,t,n),o=1},p:t,i(t){o||(U(e.$$.t,t),o=1)},o(t){V(e.$$.t,t),o=0},d(t){et(e,t)}}}function Et(t){let n,e;return n=new kt({v:{v:t[13](),$:t[7]}}),{c(){tt(n.$$.t)},m(t,o){nt(n,t,o),e=1},p(t,e){const o={};128&e[0]&&(o.$=t[7]),n.$set(o)},i(t){e||(U(n.$$.t,t),e=1)},o(t){V(n.$$.t,t),e=0},d(t){et(n,t)}}}function Ot(t){let n,e,o,r=t[6].caption+"";return{c(){n=x("div"),y(n,"class","bp-cap"),y(n,"tabindex","0")},m(t,e){b(t,n,e),n.innerHTML=r,o=1},p(t,e){(!o||64&e[0])&&r!==(r=t[6].caption+"")&&(n.innerHTML=r)},i(t){o||(e&&e.end(1),o=1)},o(t){e=Z(n,st,{duration:200}),o=0},d(t){t&&g(n),t&&e&&e.end()}}}function Rt(t){let n,e,o,i,s,u,c,l,a;const p=[Et,Nt,Ct,It],f=[];function d(t,n){return t[6].img?0:t[6].sources?1:t[6].iframe?2:3}e=d(t),o=f[e]=p[e](t);let m=t[6].caption&&Ot(t);return{c(){n=x("div"),o.c(),m&&m.c(),u=w(),y(n,"class","bp-inner")},m(o,r){b(o,n,r),f[e].m(n,null),m&&m.m(o,r),b(o,u,r),c=1,l||(a=[v(n,"pointerdown",t[21]),v(n,"pointerup",t[22])],l=1)},p(t,r){let i=e;e=d(t),e===i?f[e].p(t,r):(H(),V(f[i],1,1,(()=>{f[i]=null})),Q(),o=f[e],o?o.p(t,r):(o=f[e]=p[e](t),o.c()),U(o,1),o.m(n,null)),t[6].caption?m?(m.p(t,r),64&r[0]&&U(m,1)):(m=Ot(t),m.c(),U(m,1),m.m(u.parentNode,u)):m&&(H(),V(m,1,1,(()=>{m=null})),Q())},i(e){c||(U(o),q((()=>{s&&s.end(1),i=Y(n,t[12],1),i.start()})),U(m),c=1)},o(e){V(o),i&&i.invalidate(),s=Z(n,t[12],0),V(m),c=0},d(t){t&&g(n),f[e].d(),t&&s&&s.end(),m&&m.d(t),t&&g(u),l=0,r(a)}}}function qt(t){let n,e,o,i,s,u=`${t[4]+1} / ${t[0].length}`;return{c(){n=x("div"),e=x("button"),o=x("button"),y(n,"class","bp-count"),y(e,"class","bp-prev"),y(e,"title","Previous"),y(e,"aria-label","Previous"),y(o,"class","bp-next"),y(o,"title","Next"),y(o,"aria-label","Next")},m(r,c){b(r,n,c),n.innerHTML=u,b(r,e,c),b(r,o,c),i||(s=[v(e,"click",t[2]),v(o,"click",t[3])],i=1)},p(t,e){17&e[0]&&u!==(u=`${t[4]+1} / ${t[0].length}`)&&(n.innerHTML=u)},d(t){t&&g(n),t&&g(e),t&&g(o),i=0,r(s)}}}function Ft(t){let n,e,o=t[0]&&Tt(t);return{c(){o&&o.c(),n=w()},m(t,r){o&&o.m(t,r),b(t,n,r),e=1},p(t,e){t[0]?o?(o.p(t,e),1&e[0]&&U(o,1)):(o=Tt(t),o.c(),U(o,1),o.m(n.parentNode,n)):o&&(H(),V(o,1,1,(()=>{o=null})),Q())},i(t){e||(U(o),e=1)},o(t){V(o),e=0},d(t){o&&o.d(t),t&&g(n)}}}function jt(t,n,e){let o,r;u(t,pt,(t=>e(26,o=t)));let{items:i}=n,{target:s}=n;const l=document.documentElement;let a,p,f,d,m,h,b,g,w,y,$;const k=t=>$=t,_={},M=ct(0);u(t,M,(t=>e(10,r=t)));const S=()=>{p.onClose?.(),c(pt,o=1,o),e(0,i=null),d?.focus({preventScroll:1})},P=()=>A(a-1),z=()=>A(a+1),A=t=>{b=t-a,e(4,a=T(t))},T=t=>(t+i.length)%i.length,I=t=>{const{key:n,shiftKey:e}=t;if("Escape"===n)!p.noClose&&S();else if("ArrowRight"===n)z();else if("ArrowLeft"===n)P();else if("Tab"===n){const{activeElement:n}=document;if(e||!n.controls){t.preventDefault();const{focusWrap:o=_.el}=p,r=[...o.querySelectorAll("*")].filter((t=>t.tabIndex>=0));let i=r.indexOf(n);i+=r.length+(e?-1:1),r[i%r.length].focus()}}},C=({width:t=1920,height:n=1080})=>{const{scale:e=.99}=p,o=Math.min(1,_.w/t*e,_.h/n*e);return[Math.round(t*o),Math.round(n*o)]},N=()=>{if(i){const t=i[T(a+1)],n=i[T(a-1)];!t.preload&&E(t),!n.preload&&E(n)}},E=t=>{if(t.img){const n=x("img");return n.sizes=p.sizes||C(t)[0]+"px",n.srcset=t.img,t.preload=1,n.decode()}};return t.$$set=t=>{"items"in t&&e(0,i=t.items),"target"in t&&e(15,s=t.target)},t.$$.update=()=>{1835121&t.$$.u[0]&&i&&(e(6,w=i[a]),e(19,y=w.hasOwnProperty("html")),f&&(y&&k(null),p.onUpdate?.(_.el,w)))},[i,S,P,z,a,p,w,m,h,g,r,M,(t,n)=>f&&i?st(t,{x:(b>0?20:-20)*(n?1:-1),duration:250}):(e(18,f=n),p.intro?st(t,{y:n?10:-10}):(t=>{let n;if(y){const e=t.firstChild.firstChild;n=[e.clientWidth,e.clientHeight]}else n=C(w);const e=(w.element||d).getBoundingClientRect(),o=e.left-(_.w-e.width)/2,r=e.top-(_.h-e.height)/2,i=e.width/n[0],s=e.height/n[1];return{duration:480,l:it,css:(t,n)=>`transform:translate3d(${o*n}px, ${r*n}px, 0) scale3d(${i+t*(1-i)}, ${s+t*(1-s)}, 1)`}})(t)),()=>({k:w,S:C,A:E,T:N,_:p,M:P,next:z,close:S,P:k,zoomed:M,container:_}),t=>{let n,r;e(20,_.el=t,_),p.onOpen?.(_.el,w),h||(n=v(globalThis,"keydown",I));const i=new ResizeObserver((t=>{r&&(e(20,_.w=t[0].contentRect.width,_),e(20,_.h=t[0].contentRect.height,_),e(7,m=769>_.w),$?.(),p.onResize?.(_.el,w)),r=1}));return i.observe(t),{destroy(){i.disconnect(),n?.(),c(pt,o=0,o),l.classList.remove("bp-lock"),p.onClosed?.()}}},s,t=>{e(5,p=t),e(8,h=p.inline);const n=p.items;!h&&l.scrollHeight>l.clientHeight&&l.classList.add("bp-lock"),d=document.activeElement,e(20,_.w=s.offsetWidth,_),e(20,_.h=s===document.body?globalThis.innerHeight:s.clientHeight,_),e(7,m=769>_.w),e(4,a=p.position||0),e(0,i=Array.isArray(n)?n.map(((t,n)=>(p.el&&p.el===t.element&&e(4,a=n),{i:n,...t}))):(n.length?[...n]:[n]).map(((t,n)=>(p.el===t&&e(4,a=n),{element:t,i:n,...t.dataset}))))},A,f,y,_,t=>e(9,g=t.target),function(t){2!==t.button&&t.target===this&&g===this&&!p.noClose&&S()}]}class Dt extends rt{constructor(t){super(),ot(this,t,jt,Ft,s,{items:0,target:15,open:16,close:1,M:2,next:3,setPosition:17},null,[-1,-1])}get items(){return this.$$.ctx[0]}get target(){return this.$$.ctx[15]}get open(){return this.$$.ctx[16]}get close(){return this.$$.ctx[1]}get M(){return this.$$.ctx[2]}get next(){return this.$$.ctx[3]}get setPosition(){return this.$$.ctx[17]}}function Jt(t){return new Dt({...t,v:t})}export{Jt as default}; +function t(){}const n=t=>t;function e(t,n){for(const e in n)t[e]=n[e];return t}function o(t){return t()}function r(t){t.forEach(o)}function i(t){return"function"==typeof t}function s(t,n){return t!=t?n==n:t!==n}function u(n,e,o){n.$$.on_destroy.push(((n,...e)=>{if(null==n)return t;const o=n.subscribe(...e);return o.unsubscribe?()=>o.unsubscribe():o})(e,o))}function c(t,n,e){return t.set(e),n}function l(n){return n&&i(n.destroy)?n.destroy:t}let a=()=>globalThis.performance.now(),p=t=>requestAnimationFrame(t);const f=new Set;function d(t){f.forEach((n=>{n.c(t)||(f.delete(n),n.f())})),0!==f.size&&p(d)}function m(t){let n;return 0===f.size&&p(d),{promise:new Promise((e=>{f.add(n={c:t,f:e})})),abort(){f.delete(n)}}}function h(t,n){t.appendChild(n)}function b(t,n,e){t.insertBefore(n,e||null)}function g(t){t.parentNode.removeChild(t)}function x(t){return document.createElement(t)}function w(){return document.createTextNode("")}function v(t,n,e,o){return t.addEventListener(n,e,o),()=>t.removeEventListener(n,e,o)}function y(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function $(t,n,e,o){null===e?t.style.removeProperty(n):t.style.setProperty(n,e)}function k(t,n,e){t.classList[e?"add":"remove"](n)}let _,M,S=0,P={};function z(t,n,e,o,r,i,s,u=0){const c=16.666/o;let l="{\n";for(let t=0;1>=t;t+=c){const o=n+(e-n)*i(t);l+=100*t+`%{${s(o,1-o)}}\n`}const a=l+`100% {${s(e,1-e)}}\n}`,p=`_bp_${Math.round(1e9*Math.random())}_${u}`;if(!P[p]){if(!_){const t=x("style");document.head.appendChild(t),_=t.sheet}P[p]=1,_.insertRule(`@keyframes ${p} ${a}`,_.cssRules.length)}const f=t.style.animation||"";return t.style.animation=`${f?f+", ":""}${p} ${o}ms linear ${r}ms 1 both`,S+=1,p}function A(t,n){t.style.animation=(t.style.animation||"").split(", ").filter(n?t=>0>t.indexOf(n):t=>-1===t.indexOf("_bp")).join(", "),n&&!--S&&p((()=>{if(S)return;let t=_.cssRules.length;for(;t--;)_.deleteRule(t);P={}}))}function T(t){M=t}const I=[],C=[],N=[],E=[],O=Promise.resolve();let R=0;function q(t){N.push(t)}const F=new Set;let j,D=0;function J(){const t=M;do{for(;I.length>D;){const t=I[D];D++,T(t),K(t.$$)}for(T(null),I.length=0,D=0;C.length;)C.pop()();for(let t=0;N.length>t;t+=1){const n=N[t];F.has(n)||(F.add(n),n())}N.length=0}while(I.length);for(;E.length;)E.pop()();R=0,F.clear(),T(t)}function K(t){if(null!==t.t){t.update(),r(t.before_update);const n=t.u;t.u=[-1],t.t&&t.t.p(t.ctx,n),t.after_update.forEach(q)}}function L(){return j||(j=Promise.resolve(),j.then((()=>{j=null}))),j}function W(t,n,e){t.dispatchEvent(((t,n,e=0)=>{const o=document.createEvent("CustomEvent");return o.initCustomEvent(t,e,0,n),o})(`${n?"intro":"outro"}${e}`))}const B=new Set;let G;function H(){G={r:0,c:[],p:G}}function Q(){G.r||r(G.c),G=G.p}function U(t,n){t&&t.i&&(B.delete(t),t.i(n))}function V(t,n,e,o){if(t&&t.o){if(B.has(t))return;B.add(t),G.c.push((()=>{B.delete(t),o&&(e&&t.d(1),o())})),t.o(n)}}const X={duration:0};function Y(e,o,r){let s,u,c=o(e,r),l=0,p=0;function f(){s&&A(e,s)}function d(){const{delay:o=0,duration:r=300,l:i=n,g:d=t,css:h}=c||X;h&&(s=z(e,0,1,r,o,i,h,p++)),d(0,1);const b=a()+o,g=b+r;u&&u.abort(),l=1,q((()=>W(e,1,"start"))),u=m((t=>{if(l){if(t>=g)return d(1,0),W(e,1,"end"),f(),l=0;if(t>=b){const n=i((t-b)/r);d(n,1-n)}}return l}))}let h=0;return{start(){h||(h=1,A(e),i(c)?(c=c(),L().then(d)):d())},invalidate(){h=0},end(){l&&(f(),l=0)}}}function Z(e,o,s){let u,c=o(e,s),l=1;const p=G;function f(){const{delay:o=0,duration:i=300,l:s=n,g:f=t,css:d}=c||X;d&&(u=z(e,1,0,i,o,s,d));const h=a()+o,b=h+i;q((()=>W(e,0,"start"))),m((t=>{if(l){if(t>=b)return f(0,1),W(e,0,"end"),--p.r||r(p.c),0;if(t>=h){const n=s((t-h)/i);f(1-n,n)}}return l}))}return p.r+=1,i(c)?L().then((()=>{c=c(),f()})):f(),{end(t){t&&c.g&&c.g(1,0),l&&(u&&A(e,u),l=0)}}}function tt(t){t&&t.c()}function nt(t,n,e,s){const{t:u,on_mount:c,on_destroy:l,after_update:a}=t.$$;u&&u.m(n,e),s||q((()=>{const n=c.map(o).filter(i);l?l.push(...n):r(n),t.$$.on_mount=[]})),a.forEach(q)}function et(t,n){const e=t.$$;null!==e.t&&(r(e.on_destroy),e.t&&e.t.d(n),e.on_destroy=e.t=null,e.ctx=[])}function ot(n,e,o,i,s,u,c,l=[-1]){const a=M;T(n);const p=n.$$={t:null,ctx:null,v:u,update:t,not_equal:s,bound:{},on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:{},u:l,skip_bound:0,root:e.target||a.$$.root};c&&c(p.root);let f=0;p.ctx=o?o(n,e.v||{},((t,e,...o)=>{const r=o.length?o[0]:e;return p.ctx&&s(p.ctx[t],p.ctx[t]=r)&&(!p.skip_bound&&p.bound[t]&&p.bound[t](r),f&&((t,n)=>{-1===t.$$.u[0]&&(I.push(t),R||(R=1,O.then(J)),t.$$.u.fill(0)),t.$$.u[n/31|0]|=1<{const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}$set(t){this.$$set&&0!==Object.keys(t).length&&(this.$$.skip_bound=1,this.$$set(t),this.$$.skip_bound=0)}}function it(t){const n=t-1;return n*n*n+1}function st(t,{delay:n=0,duration:e=400,l:o=it,x:r=0,y:i=0,opacity:s=0}={}){const u=getComputedStyle(t),c=+u.opacity,l="none"===u.transform?"":u.transform,a=c*(1-s);return{delay:n,duration:e,l:o,css(t,n){return`\n\t\t\ttransform: ${l} translate(${(1-t)*r}px, ${(1-t)*i}px);\n\t\t\topacity: ${c-a*n}`}}}const ut=[];function ct(n,e=t){let o;const r=new Set;function i(t){if(s(n,t)&&(n=t,o)){const t=!ut.length;for(const t of r)t[1](),ut.push(t,n);if(t){for(let t=0;ut.length>t;t+=2)ut[t][0](ut[t+1]);ut.length=0}}}return{set:i,update(t){i(t(n))},subscribe(s,u=t){const c=[s,u];return r.add(c),1===r.size&&(o=e(i)||t),s(n),()=>{r.delete(c),0===r.size&&(o(),o=null)}}}}function lt(t,n){if(t===n||t!=t)return()=>t;const e=typeof t;if(Array.isArray(t)){const e=n.map(((n,e)=>lt(t[e],n)));return t=>e.map((n=>n(t)))}if("number"===e){const e=n-t;return n=>t+n*e}}function at(t,o={}){const r=ct(t);let i,s=t;function u(u,c){if(null==t)return r.set(t=u),Promise.resolve();s=u;let l=i,p=0,{delay:f=0,duration:d=400,l:h=n,interpolate:b=lt}=e(e({},o),c);if(0===d)return l&&(l.abort(),l=null),r.set(t=s),Promise.resolve();const g=a()+f;let x;return i=m((n=>{if(g>n)return 1;p||(x=b(t,u),"function"==typeof d&&(d=d(t,u)),p=1),l&&(l.abort(),l=null);const e=n-g;return e>d?(r.set(t=u),0):(r.set(t=x(h(e/d))),1)})),i.promise}return{set:u,update(n,e){return u(n(s,t),e)},subscribe:r.subscribe}}const pt=ct(0),ft=globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches,dt=t=>({l:it,duration:ft?0:t});function mt(t){let n,e,o,r,i=!t[2]&&ht();return{c(){n=x("div"),i&&i.c(),y(n,"class","bp-load"),$(n,"background-image","url("+t[0]+")")},m(t,e){b(t,n,e),i&&i.m(n,null),r=1},p(e,o){(t=e)[2]?i&&(i.d(1),i=null):i||(i=ht(),i.c(),i.m(n,null)),(!r||1&o)&&$(n,"background-image","url("+t[0]+")")},i(i){r||(q((()=>{o&&o.end(1),e=Y(n,st,{duration:t[1]?400:0}),e.start()})),r=1)},o(t){e&&e.invalidate(),t&&(o=Z(n,st,{duration:480})),r=0},d(t){t&&g(n),i&&i.d(),t&&o&&o.end()}}}function ht(t){let n,e;return{c(){n=x("span"),e=x("span"),y(n,"class","bp-bar"),y(e,"class","bp-o")},m(t,o){b(t,n,o),b(t,e,o)},d(t){t&&g(n),t&&g(e)}}}function bt(t){let n,e=(!t[1]||t[2])&&mt(t);return{c(){e&&e.c(),n=w()},m(t,o){e&&e.m(t,o),b(t,n,o)},p(t,[o]){!t[1]||t[2]?e?(e.p(t,o),6&o&&U(e,1)):(e=mt(t),e.c(),U(e,1),e.m(n.parentNode,n)):e&&(H(),V(e,1,1,(()=>{e=null})),Q())},i(t){U(e)},o(t){V(e)},d(t){e&&e.d(t),t&&g(n)}}}function gt(t,n,e){let o;u(t,pt,(t=>e(2,o=t)));let{thumb:r}=n,{loaded:i}=n;return t.$$set=t=>{"thumb"in t&&e(0,r=t.thumb),"loaded"in t&&e(1,i=t.loaded)},[r,i,o]}class xt extends rt{constructor(t){super(),ot(this,t,gt,bt,s,{thumb:0,loaded:1})}}function wt(t){let n,e,o,r,i,s;return{c(){n=x("img"),y(n,"srcset",e=t[7].img),y(n,"sizes",o=t[8].sizes||t[1]+"px"),y(n,"alt",r=t[7].alt)},m(t,e){b(t,n,e),s=1},p(t,e){(!s||2&e[0]&&o!==(o=t[8].sizes||t[1]+"px"))&&y(n,"sizes",o)},i(t){s||(i&&i.end(1),s=1)},o(t){i=Z(n,st,{}),s=0},d(t){t&&g(n),t&&i&&i.end()}}}function vt(t){let n,e;return n=new xt({v:{thumb:t[7].thumb,loaded:t[2]}}),{c(){tt(n.$$.t)},m(t,o){nt(n,t,o),e=1},p(t,e){const o={};4&e[0]&&(o.loaded=t[2]),n.$set(o)},i(t){e||(U(n.$$.t,t),e=1)},o(t){V(n.$$.t,t),e=0},d(t){et(n,t)}}}function yt(t){let n,e,o,i,s,u,c=t[2]&&wt(t),a=t[3]&&vt(t);return{c(){n=x("div"),e=x("div"),c&&c.c(),o=w(),a&&a.c(),y(e,"class","bp-img"),$(e,"background-image","url("+t[7].thumb+")"),$(e,"width",t[0][0]+"px"),$(e,"height",t[0][1]+"px"),$(e,"transform","translate3d("+(t[0][0]/-2+t[6][0])+"px, "+(t[0][1]/-2+t[6][1])+"px, 0)"),y(n,"class","bp-img-wrap"),k(n,"bp-drag",t[4]),k(n,"bp-close",t[5])},m(r,p){b(r,n,p),h(n,e),c&&c.m(e,null),h(e,o),a&&a.m(e,null),i=1,s||(u=[l(t[16].call(null,n)),v(n,"wheel",t[12]),v(n,"pointerdown",t[13]),v(n,"pointermove",t[14]),v(n,"pointerup",t[15]),v(n,"pointercancel",t[15])],s=1)},p(t,r){t[2]?c?(c.p(t,r),4&r[0]&&U(c,1)):(c=wt(t),c.c(),U(c,1),c.m(e,o)):c&&(H(),V(c,1,1,(()=>{c=null})),Q()),t[3]?a?(a.p(t,r),8&r[0]&&U(a,1)):(a=vt(t),a.c(),U(a,1),a.m(e,null)):a&&(H(),V(a,1,1,(()=>{a=null})),Q()),(!i||1&r[0])&&$(e,"width",t[0][0]+"px"),(!i||1&r[0])&&$(e,"height",t[0][1]+"px"),(!i||65&r[0])&&$(e,"transform","translate3d("+(t[0][0]/-2+t[6][0])+"px, "+(t[0][1]/-2+t[6][1])+"px, 0)"),16&r[0]&&k(n,"bp-drag",t[4]),32&r[0]&&k(n,"bp-close",t[5])},i(t){i||(U(c),U(a),i=1)},o(t){V(c),V(a),i=0},d(t){t&&g(n),c&&c.d(),a&&a.d(),s=0,r(u)}}}function $t(t,n,e){let o,r,i,s;u(t,pt,(t=>e(21,i=t)));let{v:c}=n,{$:l}=n,{k:a,_:p,M:f,next:d,zoomed:m,container:h}=c;u(t,m,(t=>e(20,o=t)));let b,g,x,w,v,y,$,k,_,M,S=a.maxZoom||p.maxZoom||10,P=c.S(a),z=P[0],A=0;const T=+a.width,I=[],C=new Map,N=at(P,dt(400));u(t,N,(t=>e(0,s=t)));const E=at([0,0],dt(400));u(t,E,(t=>e(6,r=t)));const O=([t,n],o=s)=>{const r=(o[0]-h.w)/2,i=(o[1]-h.h)/2;return 0>r?t=0:t>r?l?(t=w?r+(t-r)/10:r)>r+20&&e(4,w=f()):t=r:-r>t&&(l?-r-20>(t=w?-r-(-r-t)/10:-r)&&e(4,w=d()):t=-r),0>i?n=0:n>i?n=i:-i>n&&(n=-i),[t,n]},R=(t,n=S)=>{if(i)return;const o=P[0]*S,[u,c]=s;let l=u+u*n,p=c+c*n;if(n>0)l>o&&(l=o,p=P[1]*S),l>T&&(l=T,p=+a.height);else if(P[0]>l)return N.set(P),E.set([0,0]);let{x:f,y:d,width:m,height:h}=t.target.getBoundingClientRect();const b=t.clientX-f-m/2,g=t.clientY-d-h/2;f=l/m*-b+b,d=p/h*-g+g;const x=[l,p];N.set(x).then((()=>{e(1,z=Math.round(Math.max(z,l)))})),E.set(O([r[0]+f,r[1]+d],x))};return t.$$set=t=>{"$"in t&&e(18,l=t.$)},t.$$.update=()=>{if(524289&t.$$.u[0]&&m.set(s[0]-10>P[0]),3670016&t.$$.u[0]&&i&&o&&!p.intro){const t=dt(480);E.set([0,0],t),N.set(P,t),e(5,M=1)}},[s,z,b,g,w,M,r,a,p,m,N,E,t=>{p.inline&&!o||(t.preventDefault(),R(t,t.deltaY/-300))},t=>{2!==t.button&&(t.preventDefault(),e(4,w=1),C.set(t.pointerId,t),y=t.clientX,$=t.clientY,k=r[0],_=r[1])},t=>{if(C.size>1)return x=1,e(4,w=0),p.noPinch?.(h.el)||(t=>{const[n,e]=C.set(t.pointerId,t).values(),o=Math.hypot(n.clientX-e.clientX,n.clientY-e.clientY);R(t,-.03*((A||o)-o)),A=o})(t);if(!w)return;let n=t.clientX,r=t.clientY;I.push({x:n,y:r}),n-=y,r-=$,o||(n>40&&e(4,w=f()),-40>n&&e(4,w=d()),-90>r&&!p.noClose&&c.close()),v=I.length>2,o&&v&&!i&&E.set(O([k+n,_+r]),{duration:0})},function(t){if(C.delete(t.pointerId),x)return x=C.size,void(A=0);if(w){if(e(4,w=0),t.target===this&&!p.noClose)return c.close();if(v){const[t,n,e]=I.slice(-3);Math.hypot(n.x-e.x,n.y-e.y)>5&&E.set(O([r[0]-5*(t.x-e.x),r[1]-5*(t.y-e.y)]))}else p.onImageClick?.(h.el,a)||R(t,o?-S:S);v=0,I.length=0}},()=>{c.P((()=>{e(19,P=c.S(a)),!p.inline&&l||(N.set(P),E.set([0,0]))})),c.A(a).then((()=>{e(2,b=1),c.T()})),setTimeout((()=>{e(3,g=!b)}),250)},c,l,P,o,i]}class kt extends rt{constructor(t){super(),ot(this,t,$t,yt,s,{v:17,$:18},null,[-1,-1])}}function _t(t){let n,e,o,i,s,u;return o=new xt({v:{thumb:t[2].thumb,loaded:t[0]}}),{c(){n=x("div"),e=x("iframe"),tt(o.$$.t),y(e,"allow","autoplay; fullscreen"),y(e,"title",t[2].title),y(n,"class","bp-if"),$(n,"width",t[1][0]+"px"),$(n,"height",t[1][1]+"px")},m(r,c){b(r,n,c),h(n,e),nt(o,n,null),i=1,s||(u=[l(t[3].call(null,e)),v(e,"load",t[5])],s=1)},p(t,[e]){const r={};1&e&&(r.loaded=t[0]),o.$set(r),(!i||2&e)&&$(n,"width",t[1][0]+"px"),(!i||2&e)&&$(n,"height",t[1][1]+"px")},i(t){i||(U(o.$$.t,t),i=1)},o(t){V(o.$$.t,t),i=0},d(t){t&&g(n),et(o),s=0,r(u)}}}function Mt(t,n,e){let o,r,{v:i}=n;const{k:s}=i,u=()=>e(1,r=i.S(s));return u(),i.P(u),[o,r,s,t=>t.src=s.iframe,i,()=>e(0,o=1)]}class St extends rt{constructor(t){super(),ot(this,t,Mt,_t,s,{v:4})}}function Pt(t){let n,e,o,r,i;return e=new xt({v:{thumb:t[2].thumb,loaded:t[0]}}),{c(){n=x("div"),tt(e.$$.t),y(n,"class","bp-vid"),$(n,"width",t[1][0]+"px"),$(n,"height",t[1][1]+"px"),$(n,"background-image","url("+t[2].thumb+")")},m(s,u){b(s,n,u),nt(e,n,null),o=1,r||(i=l(t[3].call(null,n)),r=1)},p(t,[r]){const i={};1&r&&(i.loaded=t[0]),e.$set(i),(!o||2&r)&&$(n,"width",t[1][0]+"px"),(!o||2&r)&&$(n,"height",t[1][1]+"px")},i(t){o||(U(e.$$.t,t),o=1)},o(t){V(e.$$.t,t),o=0},d(t){t&&g(n),et(e),r=0,i()}}}function zt(t,n,e){let o,r,{v:i}=n;const{k:s}=i,u=()=>e(1,r=i.S(s));u(),i.P(u);const c=(t,n)=>{for(const e in n)y(t,e,n[e])};return[o,r,s,t=>{let n;const r=(t,e)=>{Array.isArray(e)||(e=JSON.parse(e));for(const o of e){n||(n=x(o.type?.includes("audio")?"audio":"video"),c(n,{controls:1,autoplay:1,playsinline:1,tabindex:"0"}));const e=x(t);c(e,o),h(n,e)}};r("source",s.sources),r("track",s.tracks||[]),v(n,"canplay",(()=>e(0,o=1))),h(t,n)},i]}class At extends rt{constructor(t){super(),ot(this,t,zt,Pt,s,{v:4})}}function Tt(n){let e,o,i,u,c,a,p,f,d,m,w=n[6].i,$=Rt(n),_=n[0].length>1&&qt(n);return{c(){e=x("div"),o=x("div"),$.c(),u=x("div"),c=x("button"),_&&_.c(),y(c,"class","bp-x"),y(c,"title","Close"),y(c,"aria-label","Close"),y(u,"class","bp-controls"),y(e,"class","bp-wrap"),k(e,"bp-zoomed",n[10]),k(e,"bp-inline",n[8]),k(e,"bp-small",n[7]),k(e,"bp-noclose",n[5].noClose)},m(t,r){b(t,e,r),h(e,o),$.m(e,null),h(e,u),h(u,c),_&&_.m(u,null),f=1,d||(m=[v(c,"click",n[1]),l(p=n[14].call(null,e))],d=1)},p(n,o){64&o[0]&&s(w,w=n[6].i)?(H(),V($,1,1,t),Q(),$=Rt(n),$.c(),U($),$.m(e,u)):$.p(n,o),n[0].length>1?_?_.p(n,o):(_=qt(n),_.c(),_.m(u,null)):_&&(_.d(1),_=null),1024&o[0]&&k(e,"bp-zoomed",n[10]),256&o[0]&&k(e,"bp-inline",n[8]),128&o[0]&&k(e,"bp-small",n[7]),32&o[0]&&k(e,"bp-noclose",n[5].noClose)},i(t){f||(i&&i.end(1),U($),a&&a.end(1),f=1)},o(t){i=Z(o,st,{duration:480}),V($),a=Z(u,st,{}),f=0},d(t){t&&g(e),t&&i&&i.end(),$.d(t),_&&_.d(),t&&a&&a.end(),d=0,r(m)}}}function It(n){let e,o=n[6].html+"";return{c(){e=x("div"),y(e,"class","bp-html")},m(t,n){b(t,e,n),e.innerHTML=o},p(t,n){64&n[0]&&o!==(o=t[6].html+"")&&(e.innerHTML=o)},i:t,o:t,d(t){t&&g(e)}}}function Ct(n){let e,o;return e=new St({v:{v:n[13]()}}),{c(){tt(e.$$.t)},m(t,n){nt(e,t,n),o=1},p:t,i(t){o||(U(e.$$.t,t),o=1)},o(t){V(e.$$.t,t),o=0},d(t){et(e,t)}}}function Nt(n){let e,o;return e=new At({v:{v:n[13]()}}),{c(){tt(e.$$.t)},m(t,n){nt(e,t,n),o=1},p:t,i(t){o||(U(e.$$.t,t),o=1)},o(t){V(e.$$.t,t),o=0},d(t){et(e,t)}}}function Et(t){let n,e;return n=new kt({v:{v:t[13](),$:t[7]}}),{c(){tt(n.$$.t)},m(t,o){nt(n,t,o),e=1},p(t,e){const o={};128&e[0]&&(o.$=t[7]),n.$set(o)},i(t){e||(U(n.$$.t,t),e=1)},o(t){V(n.$$.t,t),e=0},d(t){et(n,t)}}}function Ot(t){let n,e,o,r=t[6].caption+"";return{c(){n=x("div"),y(n,"class","bp-cap"),y(n,"tabindex","0")},m(t,e){b(t,n,e),n.innerHTML=r,o=1},p(t,e){(!o||64&e[0])&&r!==(r=t[6].caption+"")&&(n.innerHTML=r)},i(t){o||(e&&e.end(1),o=1)},o(t){e=Z(n,st,{duration:200}),o=0},d(t){t&&g(n),t&&e&&e.end()}}}function Rt(t){let n,e,o,i,s,u,c,l,a;const p=[Et,Nt,Ct,It],f=[];function d(t,n){return t[6].img?0:t[6].sources?1:t[6].iframe?2:3}e=d(t),o=f[e]=p[e](t);let m=t[6].caption&&Ot(t);return{c(){n=x("div"),o.c(),m&&m.c(),u=w(),y(n,"class","bp-inner")},m(o,r){b(o,n,r),f[e].m(n,null),m&&m.m(o,r),b(o,u,r),c=1,l||(a=[v(n,"pointerdown",t[21]),v(n,"pointerup",t[22])],l=1)},p(t,r){let i=e;e=d(t),e===i?f[e].p(t,r):(H(),V(f[i],1,1,(()=>{f[i]=null})),Q(),o=f[e],o?o.p(t,r):(o=f[e]=p[e](t),o.c()),U(o,1),o.m(n,null)),t[6].caption?m?(m.p(t,r),64&r[0]&&U(m,1)):(m=Ot(t),m.c(),U(m,1),m.m(u.parentNode,u)):m&&(H(),V(m,1,1,(()=>{m=null})),Q())},i(e){c||(U(o),q((()=>{s&&s.end(1),i=Y(n,t[12],1),i.start()})),U(m),c=1)},o(e){V(o),i&&i.invalidate(),s=Z(n,t[12],0),V(m),c=0},d(t){t&&g(n),f[e].d(),t&&s&&s.end(),m&&m.d(t),t&&g(u),l=0,r(a)}}}function qt(t){let n,e,o,i,s,u=`${t[4]+1} / ${t[0].length}`;return{c(){n=x("div"),e=x("button"),o=x("button"),y(n,"class","bp-count"),y(e,"class","bp-prev"),y(e,"title","Previous"),y(e,"aria-label","Previous"),y(o,"class","bp-next"),y(o,"title","Next"),y(o,"aria-label","Next")},m(r,c){b(r,n,c),n.innerHTML=u,b(r,e,c),b(r,o,c),i||(s=[v(e,"click",t[2]),v(o,"click",t[3])],i=1)},p(t,e){17&e[0]&&u!==(u=`${t[4]+1} / ${t[0].length}`)&&(n.innerHTML=u)},d(t){t&&g(n),t&&g(e),t&&g(o),i=0,r(s)}}}function Ft(t){let n,e,o=t[0]&&Tt(t);return{c(){o&&o.c(),n=w()},m(t,r){o&&o.m(t,r),b(t,n,r),e=1},p(t,e){t[0]?o?(o.p(t,e),1&e[0]&&U(o,1)):(o=Tt(t),o.c(),U(o,1),o.m(n.parentNode,n)):o&&(H(),V(o,1,1,(()=>{o=null})),Q())},i(t){e||(U(o),e=1)},o(t){V(o),e=0},d(t){o&&o.d(t),t&&g(n)}}}function jt(t,n,e){let o,r;u(t,pt,(t=>e(26,o=t)));let{items:i}=n,{target:s}=n;const l=document.documentElement;let a,p,f,d,m,h,b,g,w,y,$;const k=t=>$=t,_={},M=ct(0);u(t,M,(t=>e(10,r=t)));const S=()=>{p.onClose?.(),c(pt,o=1,o),e(0,i=null),d?.focus({preventScroll:1})},P=()=>A(a-1),z=()=>A(a+1),A=t=>{b=t-a,e(4,a=T(t))},T=t=>(t+i.length)%i.length,I=t=>{const{key:n,shiftKey:e}=t;if("Escape"===n)!p.noClose&&S();else if("ArrowRight"===n)z();else if("ArrowLeft"===n)P();else if("Tab"===n){const{activeElement:n}=document;if(e||!n.controls){t.preventDefault();const{focusWrap:o=_.el}=p,r=[...o.querySelectorAll("*")].filter((t=>t.tabIndex>=0));let i=r.indexOf(n);i+=r.length+(e?-1:1),r[i%r.length].focus()}}},C=({width:t=1920,height:n=1080})=>{const{scale:e=.99}=p,o=Math.min(1,_.w/t*e,_.h/n*e);return[Math.round(t*o),Math.round(n*o)]},N=()=>{if(i){const t=i[T(a+1)],n=i[T(a-1)];!t.preload&&E(t),!n.preload&&E(n)}},E=t=>{if(t.img){const n=x("img");return n.sizes=p.sizes||C(t)[0]+"px",n.srcset=t.img,t.preload=1,n.decode()}};return t.$$set=t=>{"items"in t&&e(0,i=t.items),"target"in t&&e(15,s=t.target)},t.$$.update=()=>{1835121&t.$$.u[0]&&i&&(e(6,w=i[a]),e(19,y=w.hasOwnProperty("html")),f&&(y&&k(null),p.onUpdate?.(_.el,w)))},[i,S,P,z,a,p,w,m,h,g,r,M,(t,n)=>f&&i?st(t,{x:(b>0?20:-20)*(n?1:-1),duration:250}):(e(18,f=n),p.intro?st(t,{y:n?10:-10}):(t=>{let n;if(y){const e=t.firstChild.firstChild;n=[e.clientWidth,e.clientHeight]}else n=C(w);const e=(w.element||d).getBoundingClientRect(),o=e.left-(_.w-e.width)/2,r=e.top-(_.h-e.height)/2,i=e.width/n[0],s=e.height/n[1];return{duration:480,l:it,css:(t,n)=>`transform:translate3d(${o*n}px, ${r*n}px, 0) scale3d(${i+t*(1-i)}, ${s+t*(1-s)}, 1)`}})(t)),()=>({k:w,S:C,A:E,T:N,_:p,M:P,next:z,close:S,P:k,zoomed:M,container:_}),t=>{let n,r;e(20,_.el=t,_),p.onOpen?.(_.el,w),h||(n=v(globalThis,"keydown",I));const i=new ResizeObserver((t=>{r&&(e(20,_.w=t[0].contentRect.width,_),e(20,_.h=t[0].contentRect.height,_),e(7,m=769>_.w),$?.(),p.onResize?.(_.el,w)),r=1}));return i.observe(t),{destroy(){i.disconnect(),n?.(),c(pt,o=0,o),l.classList.remove("bp-lock"),p.onClosed?.()}}},s,t=>{e(5,p=t),e(8,h=p.inline);const n=p.items;!h&&l.scrollHeight>l.clientHeight&&l.classList.add("bp-lock"),d=document.activeElement,e(20,_.w=s.offsetWidth,_),e(20,_.h=s===document.body?globalThis.innerHeight:s.clientHeight,_),e(7,m=769>_.w),e(4,a=p.position||0),e(0,i=Array.isArray(n)?n.map(((t,n)=>(p.el&&p.el===t.element&&e(4,a=n),{i:n,...t}))):(n.length?[...n]:[n]).map(((t,n)=>(p.el===t&&e(4,a=n),{element:t,i:n,...t.dataset}))))},A,f,y,_,t=>e(9,g=t.target),function(t){2!==t.button&&t.target===this&&g===this&&!p.noClose&&S()}]}class Dt extends rt{constructor(t){super(),ot(this,t,jt,Ft,s,{items:0,target:15,open:16,close:1,M:2,next:3,setPosition:17},null,[-1,-1])}get items(){return this.$$.ctx[0]}get target(){return this.$$.ctx[15]}get open(){return this.$$.ctx[16]}get close(){return this.$$.ctx[1]}get M(){return this.$$.ctx[2]}get next(){return this.$$.ctx[3]}get setPosition(){return this.$$.ctx[17]}}function Jt(t){return new Dt({...t,v:t})}export{Jt as default}; diff --git a/dist/bigger-picture.mjs b/dist/bigger-picture.mjs index 203002b..d16a9bc 100644 --- a/dist/bigger-picture.mjs +++ b/dist/bigger-picture.mjs @@ -1267,7 +1267,7 @@ function instance$3($$self, $$props, $$invalidate) { if (pointerCache.size > 1) { isPinch = true; $$invalidate(4, pointerDown = false); - return opts.noPinch?.(container) || handlePinch(e); + return opts.noPinch?.(container.el) || handlePinch(e); } if (!pointerDown) { diff --git a/dist/bigger-picture.umd.js b/dist/bigger-picture.umd.js index 1c9d5c6..caca1b9 100644 --- a/dist/bigger-picture.umd.js +++ b/dist/bigger-picture.umd.js @@ -1272,7 +1272,7 @@ if (pointerCache.size > 1) { isPinch = true; $$invalidate(4, pointerDown = false); - return opts.noPinch?.(container) || handlePinch(e); + return opts.noPinch?.(container.el) || handlePinch(e); } if (!pointerDown) { diff --git a/package.json b/package.json index 7d848b3..f3ede4d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bigger-picture", - "version": "1.1.0", + "version": "1.1.1", "main": "dist/bigger-picture.umd.js", "module": "dist/bigger-picture.mjs", "svelte": "src/bigger-picture.js",