/* esm.sh - scroll-snap@5.0.2 */
var B={};B.d=(t,e)=>{for(var o in e)B.o(e,o)&&!B.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})};B.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var lt={};B.d(lt,{A:()=>Rt});var at=50,gt=100,mt=300,Et=.2,St=!1,At=!1,Lt=!0,Mt=function(){};function _t(t){return t<.5?2*t*t:-1+(4-2*t)*t}function Tt(t,e){var o=/([+-]?(?=\.\d|\d)(?:\d+)?(?:\.?\d*)(?:[eE][+-]?\d+)?)(px|%|vw|vh)/,r={y:{value:0,unit:"px"},x:{value:0,unit:"px"}};if(typeof e=="number")r.y.value=e;else{var a=o.exec(e);a!==null&&(r.y={value:Number(a[1]),unit:a[2]})}if(typeof t=="number")r.x.value=t;else{var n=o.exec(t);n!==null&&(r.x={value:Number(n[1]),unit:n[2]})}return r}function U(t,e){return e.unit==="vh"?Math.max(document.documentElement.clientHeight,window.innerHeight||1)/100*e.value:e.unit==="%"?t.clientHeight/100*e.value:e.value}function D(t,e){return e.unit==="vw"?Math.max(document.documentElement.clientWidth,window.innerWidth||1)/100*e.value:e.unit==="%"?t.clientWidth/100*e.value:e.value}function it(t,e,o){return Math.max(Math.min(o,e),t)}function L(t,e){var o=1e3;return Math.round(t*o/(e*o))*e}var Ot=function(t,e){var o=typeof Symbol=="function"&&t[Symbol.iterator];if(!o)return t;var r=o.call(t),a,n=[],l;try{for(;(e===void 0||e-- >0)&&!(a=r.next()).done;)n.push(a.value)}catch(c){l={error:c}}finally{try{a&&!a.done&&(o=r.return)&&o.call(r)}finally{if(l)throw l.error}}return n},Nt={right:function(t){return"data:image/svg+xml;base64,".concat(btoa('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="'.concat(t,'" d="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"/></svg>')))},left:function(t){return"data:image/svg+xml;base64,".concat(btoa('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="'.concat(t,'" d="M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"/></svg>')))},up:function(t){return"data:image/svg+xml;base64,".concat(btoa('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="'.concat(t,'" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6 1.41-1.41z"/></svg>')))},down:function(t){return"data:image/svg+xml;base64,".concat(btoa('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="'.concat(t,'" d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"/></svg>')))}};function Ut(t){var e,o=window.getComputedStyle(t).backgroundColor,r=((e=o.match(/\d+/g))===null||e===void 0?void 0:e.map(Number))||[255,255,255],a=(r[0]*299+r[1]*587+r[2]*114)/1e3;return a>128?"light":"dark"}var V=null;function Dt(t){var e={up:document.createElement("div"),down:document.createElement("div"),left:document.createElement("div"),right:document.createElement("div")};return Object.entries(e).forEach(function(o){var r=Ot(o,2),a=r[0],n=r[1],l=Ut(t),c=l==="light"?"#1a1a1a":"#ffffff",h=l==="light"?"rgba(255, 255, 255, 0.8)":"rgba(0, 0, 0, 0.8)";n.className="scroll-snap-arrow scroll-snap-arrow-".concat(a),n.style.cssText=`
      position: fixed;
      width: 40px;
      height: 40px;
      background-size: 24px;
      background-position: center;
      background-repeat: no-repeat;
      opacity: 0;
      transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
      cursor: pointer;
      z-index: 1000;
      background-image: url(`.concat(Nt[a](c),`);
      background-color: `).concat(h,`;
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      border-radius: 50%;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
      display: none;
      align-items: center;
      justify-content: center;
      pointer-events: auto;
      user-select: none;
    `),n.addEventListener("mouseenter",function(){n.style.display!=="none"&&(V=n,n.style.opacity="0.95",n.style.transform="scale(1.05)",n.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.2)")}),n.addEventListener("mouseleave",function(){n.style.display!=="none"&&(V=null,n.style.opacity="0.6",n.style.transform="scale(1)",n.style.boxShadow="0 2px 8px rgba(0, 0, 0, 0.15)")})}),e}function C(t,e,o){if(!(!o||!Object.keys(e).length)){var r=t.getBoundingClientRect(),a=16,n=20;e.up.style.top="".concat(r.top+a,"px"),e.up.style.left="".concat(r.left+r.width/2-n,"px"),e.down.style.bottom="".concat(window.innerHeight-r.bottom+a,"px"),e.down.style.left="".concat(r.left+r.width/2-n,"px"),e.left.style.left="".concat(r.left+a,"px"),e.left.style.top="".concat(r.top+r.height/2-n,"px"),e.right.style.right="".concat(window.innerWidth-r.right+a,"px"),e.right.style.top="".concat(r.top+r.height/2-n,"px"),Object.values(e).forEach(function(l){var c=Ct(t,l.className);l.style.display=c?"flex":"none",c&&(l.style.opacity=t.matches(":hover")||l===V?"0.6":"0")})}}function Ct(t,e){return e.includes("up")?t.scrollTop>0:e.includes("down")?t.scrollTop<t.scrollHeight-t.clientHeight:e.includes("left")?t.scrollLeft>0:e.includes("right")?t.scrollLeft<t.scrollWidth-t.clientWidth:!1}function k(t,e,o,r,a,n,l){var c=o==="x"?"scrollLeft":"scrollTop";n[o]&&cancelAnimationFrame(n[o]);var h=t[c],x=e[o];if(Math.abs(h-x)<1||isNaN(x)){l();return}var E,S=h;function v(A){E||(E=A);var g=A-E;if(g<a){var y=h+(x-h)*r(g/a);Math.abs(x-y)<Math.abs(x-S)&&(t[c]=y,S=y),n[o]=requestAnimationFrame(v)}else t[c]=x,n[o]=0,l()}n[o]=requestAnimationFrame(v)}function M(t,e,o,r){t.addEventListener(e,o),r.push({element:t,event:e,handler:o})}function kt(t){t.forEach(function(e){var o=e.element,r=e.event,a=e.handler;o.removeEventListener(r,a)}),t.splice(0,t.length)}function Bt(t,e,o,r){var a=t;if(!(!o||!e.contains(a.target)))switch(a.key){case"ArrowUp":t.preventDefault(),r("up");break;case"ArrowDown":t.preventDefault(),r("down");break;case"ArrowLeft":t.preventDefault(),r("left");break;case"ArrowRight":t.preventDefault(),r("right");break}}function Ht(t){var e=t.snapDestinationX,o=t.snapDestinationY,r=t.timeout,a=t.duration,n=t.threshold,l=t.easing,c=t.snapStop,h=t.showArrows,x=t.enableKeyboard;if(e&&typeof e!="string"&&typeof e!="number")throw new Error("Settings property 'snapDestinationX' is not valid, expected STRING or NUMBER but found ".concat((typeof e).toUpperCase()));if(o&&typeof o!="string"&&typeof o!="number")throw new Error("Settings property 'snapDestinationY' is not valid, expected STRING or NUMBER but found ".concat((typeof o).toUpperCase()));if(r&&(isNaN(r)||typeof r=="boolean"))throw new Error("Optional settings property 'timeout' is not valid, expected NUMBER but found ".concat((typeof r).toUpperCase()));if(r&&r<at&&console.warn("Timeout value less than ".concat(at,"ms may cause issues with momentum scrolling")),a&&(isNaN(a)||typeof a=="boolean"))throw new Error("Optional settings property 'duration' is not valid, expected NUMBER but found ".concat((typeof a).toUpperCase()));if(n&&(isNaN(n)||typeof n=="boolean"))throw new Error("Optional settings property 'threshold' is not valid, expected NUMBER but found ".concat((typeof n).toUpperCase()));if(l&&typeof l!="function")throw new Error("Optional settings property 'easing' is not valid, expected FUNCTION but found ".concat((typeof l).toUpperCase()));if(c&&typeof c!="boolean")throw new Error("Optional settings property 'snapStop' is not valid, expected BOOLEAN but found ".concat((typeof c).toUpperCase()));if(h&&typeof h!="boolean")throw new Error("Optional settings property 'showArrows' is not valid, expected BOOLEAN but found ".concat((typeof c).toUpperCase()));if(x&&typeof x!="boolean")throw new Error("Optional settings property 'enableKeyboard' is not valid, expected BOOLEAN but found ".concat((typeof c).toUpperCase()))}var Pt=function(t,e){var o=typeof Symbol=="function"&&t[Symbol.iterator];if(!o)return t;var r=o.call(t),a,n=[],l;try{for(;(e===void 0||e-- >0)&&!(a=r.next()).done;)n.push(a.value)}catch(c){l={error:c}}finally{try{a&&!a.done&&(o=r.return)&&o.call(r)}finally{if(l)throw l.error}}return n};function Rt(t,e,o){e===void 0&&(e={});var r=typeof o=="function"?o:Mt,a,n,l=null,c,h,x,E,S,v,A={x:0,y:0},g=!1,y={},K=window.innerWidth,j=window.innerHeight,d={x:!1,y:!1},p={x:0,y:0},m=[],w={x:0,y:0},R={x:0,y:0};Ht(e);var Y=e.timeout,ut=Y===void 0?gt:Y,q=e.duration,_=q===void 0?mt:q,X=e.threshold,G=X===void 0?Et:X,Q=e.snapStop,ct=Q===void 0?St:Q,J=e.showArrows,W=J===void 0?At:J,Z=e.enableKeyboard,$=Z===void 0?Lt:Z,tt=e.easing,T=tt===void 0?_t:tt;function st(i){return R[i]}function z(i,u){R[i]=u}function et(i,u){var f=function(){A[u]=null},s=i,b=A[u]!==null?s-A[u]:0;return A[u]=s,h&&clearTimeout(h),h=window.setTimeout(f,100),b}function ft(i){n=i,a=i===document.documentElement?window:i,M(a,"scroll",O,m),v=Tt(e.snapDestinationX,e.snapDestinationY),R={x:L(i.scrollLeft,Math.round(D(i,v.x))),y:L(i.scrollTop,Math.round(U(i,v.y)))}}function O(){E=et(n.scrollLeft,"x"),S=et(n.scrollTop,"y"),E!==0&&!d.x&&(w.x=Math.sign(E)),S!==0&&!d.y&&(w.y=Math.sign(S)),!(d.x&&d.y||E===0&&S===0)&&dt(n)}function dt(i){if(!i)return;p.x&&clearTimeout(p.x),p.y&&clearTimeout(p.y),c?clearTimeout(c):x={y:i.scrollTop,x:i.scrollLeft},c=window.setTimeout(vt,ut)}function pt(i,u){if(g)return!0;var f=u%1,s=f>=0?f:1+f;return i>0?s>G:1-s>G}function nt(i,u,f){var s=i==="x"?"scrollLeft":"scrollTop",b=i==="x"?"scrollWidth":"scrollHeight",N=i==="x"?"clientWidth":"clientHeight",H=n[s],F=st(i);Math.abs(H-F)<1&&(H=F);var P=H/f;if(g){var wt=Math.round(P)+u;return it(0,n[b]-n[N],wt*f)}if(!pt(u,P))return L(H,f);var I;if(ct){var bt=Math.round(F/f);I=bt+(u>0?1:-1)}else I=u>0?Math.ceil(P):Math.floor(P);return it(0,n[b]-n[N],I*f)}function vt(){if(!n)return;if(!(x.y===n.scrollTop&&x.x===n.scrollLeft)){var i={y:w.y,x:w.x},u={x:nt("x",i.x,Math.round(D(n,v.x))),y:nt("y",i.y,Math.round(U(n,v.y)))};w.x!==0&&!d.x&&(a.removeEventListener("scroll",O),d.x=!0,k(n,{x:u.x},"x",T,_,p,function(){d.x=!1,w.x=0,a.addEventListener("scroll",O),z("x",u.x),d.y||r()})),w.y!==0&&!d.y&&(a.removeEventListener("scroll",O),d.y=!0,k(n,{y:u.y},"y",T,_,p,function(){d.y=!1,w.y=0,a.addEventListener("scroll",O),z("y",u.y),d.x||r()}))}}function yt(){W&&(y=Dt(n),l||(l=document.createElement("div"),l.style.cssText=`
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        pointer-events: none;
        z-index: 999;
      `,document.body.appendChild(l)),Object.entries(y).forEach(function(i){var u=Pt(i,2),f=u[0],s=u[1];s.onclick=function(b){b.stopPropagation(),rt(f)},l.appendChild(s)}),M(t,"mouseenter",function(){return C(t,y,l)},m),M(t,"mouseleave",function(){Object.values(y).forEach(function(i){i.style.opacity="0"})},m),M(t,"scroll",function(){return C(t,y,l)},m),M(window,"scroll",function(){return C(t,y,l)},m),C(t,y,l))}function rt(i){var u=i==="up"||i==="down"?"y":"x";if(!d[u]){var f={up:{x:0,y:-1},down:{x:0,y:1},left:{x:-1,y:0},right:{x:1,y:0}};g=!0;var s={y:Math.round(U(n,v.y)),x:Math.round(D(n,v.x))},b=f[i],N={y:b.y?L(n.scrollTop+b.y*s.y,s.y):L(n.scrollTop,s.y),x:b.x?L(n.scrollLeft+b.x*s.x,s.x):L(n.scrollLeft,s.x)};w[u]=f[i][u],d[u]=!0,k(n,N,u,T,_,p,function(){d[u]=!1,w[u]=0,g=!1,z(u,N[u]),r()})}}function ht(){var i={y:Math.round(U(n,v.y)),x:Math.round(D(n,v.x))},u={y:Math.round(n.scrollTop/i.y),x:Math.round(n.scrollLeft/i.x)};requestAnimationFrame(function(){var f={y:Math.round(U(n,v.y)),x:Math.round(D(n,v.x))},s={y:u.y*f.y,x:u.x*f.x};(window.innerWidth!==K||window.innerHeight!==j)&&(g=!0,k(n,s,"x",T,_,p,function(){k(n,s,"y",T,_,p,function(){g=!1,W&&C(t,y,l)})}),K=window.innerWidth,j=window.innerHeight)})}function ot(){ft(t),$&&(t.getAttribute("tabindex")||t.setAttribute("tabindex","0"),M(t,"keydown",function(i){return Bt(i,n,$,rt)},m)),M(window,"resize",ht,m),yt()}function xt(){kt(m),m=[],W&&(Object.values(y).forEach(function(i){i.onclick=null}),l?.parentNode&&(l.parentNode.removeChild(l),l=null),y={}),p.x&&(cancelAnimationFrame(p.x),p.x=0),p.y&&(cancelAnimationFrame(p.y),p.y=0),d={x:!1,y:!1},w={x:0,y:0},a=null,n=null}return ot(),{bind:ot,unbind:xt,snap:rt}}var Wt=lt.A;export default Wt;