"use strict";(()=>{(self.webpackChunkFalcon_theme=self.webpackChunkFalcon_theme||[]).push([[372],{8372:(W,O,g)=>{g.r(O),g.d(O,{default:()=>y});var S=g(7628),u=g(9482);function y({swiper:e,extendParams:A,on:P,emit:v}){const C=(0,S.Jj)();A({mousewheel:{enabled:!1,releaseOnEdges:!1,invert:!1,forceToAxis:!1,sensitivity:1,eventsTarget:"container",thresholdDelta:null,thresholdTime:null}}),e.mousewheel={enabled:!1};let T,M=(0,u.zO)(),f;const s=[];function G(t){let r=0,i=0,a=0,o=0;return"detail"in t&&(i=t.detail),"wheelDelta"in t&&(i=-t.wheelDelta/120),"wheelDeltaY"in t&&(i=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(r=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(r=i,i=0),a=r*10,o=i*10,"deltaY"in t&&(o=t.deltaY),"deltaX"in t&&(a=t.deltaX),t.shiftKey&&!a&&(a=o,o=0),(a||o)&&t.deltaMode&&(t.deltaMode===1?(a*=40,o*=40):(a*=800,o*=800)),a&&!r&&(r=a<1?-1:1),o&&!i&&(i=o<1?-1:1),{spinX:r,spinY:i,pixelX:a,pixelY:o}}function B(){e.enabled&&(e.mouseEntered=!0)}function z(){e.enabled&&(e.mouseEntered=!1)}function X(t){return e.params.mousewheel.thresholdDelta&&t.delta<e.params.mousewheel.thresholdDelta||e.params.mousewheel.thresholdTime&&(0,u.zO)()-M<e.params.mousewheel.thresholdTime?!1:t.delta>=6&&(0,u.zO)()-M<60?!0:(t.direction<0?(!e.isEnd||e.params.loop)&&!e.animating&&(e.slideNext(),v("scroll",t.raw)):(!e.isBeginning||e.params.loop)&&!e.animating&&(e.slidePrev(),v("scroll",t.raw)),M=new C.Date().getTime(),!1)}function p(t){const n=e.params.mousewheel;if(t.direction<0){if(e.isEnd&&!e.params.loop&&n.releaseOnEdges)return!0}else if(e.isBeginning&&!e.params.loop&&n.releaseOnEdges)return!0;return!1}function b(t){let n=t,D=!0;if(!e.enabled)return;const c=e.params.mousewheel;e.params.cssMode&&n.preventDefault();let r=e.el;e.params.mousewheel.eventsTarget!=="container"&&(r=document.querySelector(e.params.mousewheel.eventsTarget));const i=r&&r.contains(n.target);if(!e.mouseEntered&&!i&&!c.releaseOnEdges)return!0;n.originalEvent&&(n=n.originalEvent);let a=0;const o=e.rtlTranslate?-1:1,d=G(n);if(c.forceToAxis)if(e.isHorizontal())if(Math.abs(d.pixelX)>Math.abs(d.pixelY))a=-d.pixelX*o;else return!0;else if(Math.abs(d.pixelY)>Math.abs(d.pixelX))a=-d.pixelY;else return!0;else a=Math.abs(d.pixelX)>Math.abs(d.pixelY)?-d.pixelX*o:-d.pixelY;if(a===0)return!0;c.invert&&(a=-a);let E=e.getTranslate()+a*c.sensitivity;if(E>=e.minTranslate()&&(E=e.minTranslate()),E<=e.maxTranslate()&&(E=e.maxTranslate()),D=e.params.loop?!0:!(E===e.minTranslate()||E===e.maxTranslate()),D&&e.params.nested&&n.stopPropagation(),!e.params.freeMode||!e.params.freeMode.enabled){const l={time:(0,u.zO)(),delta:Math.abs(a),direction:Math.sign(a),raw:t};s.length>=2&&s.shift();const m=s.length?s[s.length-1]:void 0;if(s.push(l),m?(l.direction!==m.direction||l.delta>m.delta||l.time>m.time+150)&&X(l):X(l),p(l))return!0}else{const l={time:(0,u.zO)(),delta:Math.abs(a),direction:Math.sign(a)},m=f&&l.time<f.time+500&&l.delta<=f.delta&&l.direction===f.direction;if(!m){f=void 0;let h=e.getTranslate()+a*c.sensitivity;const N=e.isBeginning,F=e.isEnd;if(h>=e.minTranslate()&&(h=e.minTranslate()),h<=e.maxTranslate()&&(h=e.maxTranslate()),e.setTransition(0),e.setTranslate(h),e.updateProgress(),e.updateActiveIndex(),e.updateSlidesClasses(),(!N&&e.isBeginning||!F&&e.isEnd)&&e.updateSlidesClasses(),e.params.loop&&e.loopFix({direction:l.direction<0?"next":"prev",byMousewheel:!0}),e.params.freeMode.sticky){clearTimeout(T),T=void 0,s.length>=15&&s.shift();const I=s.length?s[s.length-1]:void 0,H=s[0];if(s.push(l),I&&(l.delta>I.delta||l.direction!==I.direction))s.splice(0);else if(s.length>=15&&l.time-H.time<500&&H.delta-l.delta>=1&&l.delta<=6){const L=a>0?.8:.2;f=l,s.splice(0),T=(0,u.Y3)(()=>{e.slideToClosest(e.params.speed,!0,void 0,L)},0)}T||(T=(0,u.Y3)(()=>{f=l,s.splice(0),e.slideToClosest(e.params.speed,!0,void 0,.5)},500))}if(m||v("scroll",n),e.params.autoplay&&e.params.autoplayDisableOnInteraction&&e.autoplay.stop(),h===e.minTranslate()||h===e.maxTranslate())return!0}}return n.preventDefault?n.preventDefault():n.returnValue=!1,!1}function Y(t){let n=e.el;e.params.mousewheel.eventsTarget!=="container"&&(n=document.querySelector(e.params.mousewheel.eventsTarget)),n[t]("mouseenter",B),n[t]("mouseleave",z),n[t]("wheel",b)}function x(){return e.params.cssMode?(e.wrapperEl.removeEventListener("wheel",b),!0):e.mousewheel.enabled?!1:(Y("addEventListener"),e.mousewheel.enabled=!0,!0)}function _(){return e.params.cssMode?(e.wrapperEl.addEventListener(event,b),!0):e.mousewheel.enabled?(Y("removeEventListener"),e.mousewheel.enabled=!1,!0):!1}P("init",()=>{!e.params.mousewheel.enabled&&e.params.cssMode&&_(),e.params.mousewheel.enabled&&x()}),P("destroy",()=>{e.params.cssMode&&x(),e.mousewheel.enabled&&_()}),Object.assign(e.mousewheel,{enable:x,disable:_})}}}]);})();
