1 line
23 KiB
JavaScript
1 line
23 KiB
JavaScript
|
|
"use strict";(globalThis.blocksyJsonP=globalThis.blocksyJsonP||[]).push([[71],{3071:function(t,e,n){n.d(e,{r:function(){return w}});var i=n(3986),o=n(4705);const r=["style"];function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach(function(e){(0,o.A)(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function l(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const u=function(){return"rtl"===document.querySelector("html").dir},d=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t)return null;if(t.getBoundingClientRect&&!t.firstElementChild)return t.getBoundingClientRect();e||(e=t);let{top:n,left:i,right:o,width:r,height:s}=t.getBoundingClientRect(),a=window.getComputedStyle(e).transform.split(/\(|,|\)/).slice(1,-1).map(function(t){return parseFloat(t)});if(6!=a.length)return t.getBoundingClientRect();var l=a;let u=l[0]*l[3]-l[1]*l[2];return{width:r/l[0],height:s/l[3],left:(i*l[3]-n*l[2]+l[2]*l[5]-l[4]*l[3])/u,right:(o*l[3]-n*l[2]+l[2]*l[5]-l[4]*l[3])/u,top:(-i*l[1]+n*l[0]+l[4]*l[1]-l[0]*l[5])/u}},c=function(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0},h=function(t){return t?t&&"[object Function]"==={}.toString.call(t)?t():t:null},p=function(t){if(!t.options.pillsContainerSelector)return;const e=t.options.pillsContainerSelector.querySelector(".active");e&&e.classList.remove("active"),t.options.pillsContainerSelector.children[t.state.previousCurrentIndex].classList.add("active"),t.options.pillsFlexyInstance&&function(t){const e=t.options.pillsFlexyInstance.flexy,n=[...t.options.pillsContainerSelector.children],i=h(e.sliderContainer),o=[...i.children].map(function(t){return d(t,h(e.options.nullifyTransformEl))}),r=d(i,h(e.options.nullifyTransformEl));let s=0;const l=o.map(function(t,e){return{left:Math.abs(t.left-r.left),top:Math.abs(t.top-r.top),right:Math.abs(t.right-r.right)}});if("horizontal"===e.options.orientation){const t=Math.min(...l.map(function(t){return t.left})),e=Math.min(...l.map(function(t){return t.right}));s=u()?l.findIndex(function(t){return t.right===e}):l.findIndex(function(e){return e.left===t})}if("vertical"===e.options.orientation){const t=Math.min(...l.map(function(t){return t.top}));s=l.findIndex(function(e){return e.top===t})}let c=0;if("horizontal"===e.options.orientation){let e=Math.round(d(i).width/d(i.firstElementChild).width);c=Math.max(t.state.previousCurrentIndex+1-e,0),i.closest('[data-type="circle"]')&&(c=Math.max(t.state.previousCurrentIndex-2,0),n.length-1-t.state.previousCurrentIndex<3&&(c=n.length-5))}else c=t.state.previousCurrentIndex;let p=Math.abs(c-s),f=Math.min(s,c)+(n.length-Math.max(s,c)),m=Math.min(p,f)*(f>=p?s>c?1:-1:s>c?-1:1);u()&&(m*=-1);let g=100*Math.round(100*e.state.positionX/e.state.slideWidth/100)*e.state.slideWidth/100+e.state.slideWidth*m;e.state=a(a({},e.state),{},{positionTarget:g})}(t)};class f{constructor(t,e){var n=this;l(this,"options",{mountListeners:!0}),l(this,"flexyInstance",null),l(this,"navigate",function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"right";const e=n.flexyInstance,i="left"===t?1:-1,o=e.state.slideWidth;let r=100*Math.round(100*e.state.positionX/o/100)*o/100+o*i;e.state=a(a({},e.state),{},{positionTarget:r})}),this.flexyInstan
|