"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,n=(e=require("wheel-gestures"))&&"object"==typeof e&&"default"in e?e.default:e,t={active:!0,breakpoints:{},wheelDraggingClass:"is-wheel-dragging",forceWheelAxis:void 0,target:void 0};function o(e){var i;void 0===e&&(e={});var s=function(){};return{name:"wheelGestures",options:e,init:function(r,a){var u,m,c=a.mergeOptions,l=a.optionsAtMedia,d=c(t,o.globalOptions),v=c(d,e);i=l(v);var g=r.internalEngine(),p=null!=(u=i.target)?u:r.containerNode().parentNode,f=null!=(m=i.forceWheelAxis)?m:g.options.axis,h=n({preventWheelAction:f,reverseSign:[!0,!0,!1]});function x(){A=("x"===f?g.containerRect.width:g.containerRect.height)/2}var M,E=h.observe(p),w=h.on("wheel",(function(e){var n=e.axisDelta,t=n[0],o=n[1],r="x"===f?o:t,a=e.isEnding&&!e.isMomentum||e.isMomentum&&e.previous&&!e.previous.isMomentum;Math.abs("x"===f?t:o)>Math.abs(r)&&!b&&!e.isMomentum&&!D&&function(e){try{O(M=new MouseEvent("mousedown",e.event))}catch(e){return s()}b=!0,y=0,document.documentElement.addEventListener("mousemove",X,!0),document.documentElement.addEventListener("mouseup",X,!0),document.documentElement.addEventListener("mousedown",X,!0),i.wheelDraggingClass&&p.classList.add(i.wheelDraggingClass)}(e),D&&e.isEnding&&(D=!1),b&&(function(e){var n=P(e);if(n.isAtBoundary&&!e.isMomentum){if((y+=Math.abs(n.primaryAxisDelta))>A)return D=!0,L(e),!0}else y=0;return!1}(e)||(a?L(e):O(Y("mousemove",e))))})),b=!1,y=0,A=0,D=!1;function L(e){b=!1,O(Y("mouseup",e)),C(),i.wheelDraggingClass&&p.classList.remove(i.wheelDraggingClass)}function C(){document.documentElement.removeEventListener("mousemove",X,!0),document.documentElement.removeEventListener("mouseup",X,!0),document.documentElement.removeEventListener("mousedown",X,!0)}function X(e){b&&e.isTrusted&&e.stopImmediatePropagation()}function Y(e,n){var t,o;if(f===g.options.axis){var i=n.axisMovement;t=i[0],o=i[1]}else{var s=n.axisMovement;o=s[0],t=s[1]}if(P(n).isAtBoundary){var r=Math.min(y/A,1),a=y*(t>0?-1:1)*(.25+.5*r);t+=a,o+=a}if(!g.options.skipSnaps&&!g.options.dragFree){var u=g.containerRect.width,m=g.containerRect.height;t=t<0?Math.max(t,-u):Math.min(t,u),o=o<0?Math.max(o,-m):Math.min(o,m)}return new MouseEvent(e,{clientX:M.clientX+t,clientY:M.clientY+o,screenX:M.screenX+t,screenY:M.screenY+o,movementX:t,movementY:o,button:0,bubbles:!0,cancelable:!0,composed:!0})}function O(e){r.containerNode().dispatchEvent(e)}function P(e){var n=e.axisDelta,t=n[0],o=n[1],i=r.scrollProgress(),s="x"===f?t:o;return{isAtBoundary:s<0&&!(i<1)||s>0&&!(i>0),primaryAxisDelta:s}}x(),r.on("resize",x),s=function(){E(),w(),r.off("resize",x),C()}},destroy:function(){return s()}}}o.globalOptions=void 0,exports.WheelGesturesPlugin=o,exports.default=o; //# sourceMappingURL=embla-carousel-wheel-gestures.cjs.production.min.js.map