@lanaco/lnc-react-ui 4.0.110 → 4.0.111
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const D=require("react/jsx-runtime"),N=require("react"),Pe=require("./_commonjsHelpers-DKOUU3wS.cjs"),fe=require("./index-BPVoEhTF.cjs"),Ce=require("./index-gY9e_8LL.cjs"),Le=require("./useDetectMobile-zkbzoOGV.cjs"),te=require("./emotion-styled.browser.esm-BtEseadx.cjs"),ne=require("./consts-goSZX3xP.cjs"),re=require("./utils-CZynEOC_.cjs"),De=require("./Button.cjs");var Oe={},ie={},me={},le={},Se;function ke(){return Se||(Se=1,function(t){(function(n,r){r(t,N,fe.propTypesExports)})(Pe.commonjsGlobal,function(n,r,i){Object.defineProperty(n,"__esModule",{value:!0}),n.setHasSupportToCaptureOption=E;var e=a(r),o=a(i);function a(l){return l&&l.__esModule?l:{default:l}}var s=Object.assign||function(l){for(var p=1;p<arguments.length;p++){var S=arguments[p];for(var u in S)Object.prototype.hasOwnProperty.call(S,u)&&(l[u]=S[u])}return l};function f(l,p){var S={};for(var u in l)p.indexOf(u)>=0||Object.prototype.hasOwnProperty.call(l,u)&&(S[u]=l[u]);return S}function h(l,p){if(!(l instanceof p))throw new TypeError("Cannot call a class as a function")}var m=function(){function l(p,S){for(var u=0;u<S.length;u++){var g=S[u];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(p,g.key,g)}}return function(p,S,u){return S&&l(p.prototype,S),u&&l(p,u),p}}();function v(l,p){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:l}function _(l,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);l.prototype=Object.create(p&&p.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(l,p):l.__proto__=p)}var b=!1;function E(l){b=l}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){E(!0)}}))}catch{}function X(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return b?l:l.capture}function ue(l){if("touches"in l){var p=l.touches[0],S=p.pageX,u=p.pageY;return{x:S,y:u}}var g=l.screenX,T=l.screenY;return{x:g,y:T}}var x=function(l){_(p,l);function p(){var S;h(this,p);for(var u=arguments.length,g=Array(u),T=0;T<u;T++)g[T]=arguments[T];var w=v(this,(S=p.__proto__||Object.getPrototypeOf(p)).call.apply(S,[this].concat(g)));return w._handleSwipeStart=w._handleSwipeStart.bind(w),w._handleSwipeMove=w._handleSwipeMove.bind(w),w._handleSwipeEnd=w._handleSwipeEnd.bind(w),w._onMouseDown=w._onMouseDown.bind(w),w._onMouseMove=w._onMouseMove.bind(w),w._onMouseUp=w._onMouseUp.bind(w),w._setSwiperRef=w._setSwiperRef.bind(w),w}return m(p,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,X({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,X({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(u){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(u))}},{key:"_onMouseMove",value:function(u){this.mouseDown&&this._handleSwipeMove(u)}},{key:"_onMouseUp",value:function(u){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(u)}},{key:"_handleSwipeStart",value:function(u){var g=ue(u),T=g.x,w=g.y;this.moveStart={x:T,y:w},this.props.onSwipeStart(u)}},{key:"_handleSwipeMove",value:function(u){if(this.moveStart){var g=ue(u),T=g.x,w=g.y,Y=T-this.moveStart.x,we=w-this.moveStart.y;this.moving=!0;var Me=this.props.onSwipeMove({x:Y,y:we},u);Me&&u.cancelable&&u.preventDefault(),this.movePosition={deltaX:Y,deltaY:we}}}},{key:"_handleSwipeEnd",value:function(u){this.props.onSwipeEnd(u);var g=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-g?this.props.onSwipeLeft(1,u):this.movePosition.deltaX>g&&this.props.onSwipeRight(1,u),this.movePosition.deltaY<-g?this.props.onSwipeUp(1,u):this.movePosition.deltaY>g&&this.props.onSwipeDown(1,u)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(u){this.swiper=u,this.props.innerRef(u)}},{key:"render",value:function(){var u=this.props;u.tagName;var g=u.className,T=u.style,w=u.children;u.allowMouseEvents,u.onSwipeUp,u.onSwipeDown,u.onSwipeLeft,u.onSwipeRight,u.onSwipeStart,u.onSwipeMove,u.onSwipeEnd,u.innerRef,u.tolerance;var Y=f(u,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return e.default.createElement(this.props.tagName,s({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:g,style:T},Y),w)}}]),p}(r.Component);x.displayName="ReactSwipe",x.propTypes={tagName:o.default.string,className:o.default.string,style:o.default.object,children:o.default.node,allowMouseEvents:o.default.bool,onSwipeUp:o.default.func,onSwipeDown:o.default.func,onSwipeLeft:o.default.func,onSwipeRight:o.default.func,onSwipeStart:o.default.func,onSwipeMove:o.default.func,onSwipeEnd:o.default.func,innerRef:o.default.func,tolerance:o.default.number.isRequired},x.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},n.default=x})}(le)),le}(function(t){(function(n,r){r(t,ke())})(Pe.commonjsGlobal,function(n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=e(r);function e(o){return o&&o.__esModule?o:{default:o}}n.default=i.default})})(me);var j={};Object.defineProperty(j,"__esModule",{value:!0});j.default=void 0;var A=Ae(Ce.classnamesExports);function Ae(t){return t&&t.__esModule?t:{default:t}}function We(t,n,r){return n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}var ze={ROOT:function(n){return(0,A.default)(We({"carousel-root":!0},n||"",!!n))},CAROUSEL:function(n){return(0,A.default)({carousel:!0,"carousel-slider":n})},WRAPPER:function(n,r){return(0,A.default)({"thumbs-wrapper":!n,"slider-wrapper":n,"axis-horizontal":r==="horizontal","axis-vertical":r!=="horizontal"})},SLIDER:function(n,r){return(0,A.default)({thumbs:!n,slider:n,animated:!r})},ITEM:function(n,r,i){return(0,A.default)({thumb:!n,slide:n,selected:r,previous:i})},ARROW_PREV:function(n){return(0,A.default)({"control-arrow control-prev":!0,"control-disabled":n})},ARROW_NEXT:function(n){return(0,A.default)({"control-arrow control-next":!0,"control-disabled":n})},DOT:function(n){return(0,A.default)({dot:!0,selected:n})}};j.default=ze;var q={},oe={};Object.defineProperty(oe,"__esModule",{value:!0});oe.outerWidth=void 0;var xe=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};oe.outerWidth=xe;var H={};Object.defineProperty(H,"__esModule",{value:!0});H.default=void 0;var Ne=function(n,r,i){var e=n===0?n:n+r,o=i==="horizontal"?[e,0,0]:[0,e,0],a="translate3d",s="("+o.join(",")+")";return a+s};H.default=Ne;var K={};Object.defineProperty(K,"__esModule",{value:!0});K.default=void 0;var He=function(){return window};K.default=He;Object.defineProperty(q,"__esModule",{value:!0});q.default=void 0;var I=Fe(N),W=ae(j),$e=oe,ge=ae(H),Ue=ae(me),V=ae(K);function ae(t){return t&&t.__esModule?t:{default:t}}function Re(){if(typeof WeakMap!="function")return null;var t=new WeakMap;return Re=function(){return t},t}function Fe(t){if(t&&t.__esModule)return t;if(t===null||U(t)!=="object"&&typeof t!="function")return{default:t};var n=Re();if(n&&n.has(t))return n.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var o=i?Object.getOwnPropertyDescriptor(t,e):null;o&&(o.get||o.set)?Object.defineProperty(r,e,o):r[e]=t[e]}return r.default=t,n&&n.set(t,r),r}function U(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?U=function(r){return typeof r}:U=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},U(t)}function ce(){return ce=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},ce.apply(this,arguments)}function je(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function qe(t,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Ke(t,n,r){return n&&qe(t.prototype,n),t}function Be(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&de(t,n)}function de(t,n){return de=Object.setPrototypeOf||function(i,e){return i.__proto__=e,i},de(t,n)}function Xe(t){var n=Ve();return function(){var i=J(t),e;if(n){var o=J(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return Ye(this,e)}}function Ye(t,n){return n&&(U(n)==="object"||typeof n=="function")?n:O(t)}function O(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ve(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function J(t){return J=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},J(t)}function P(t,n,r){return n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}var Ze=function(n){return n.hasOwnProperty("key")},ve=function(t){Be(r,t);var n=Xe(r);function r(i){var e;return je(this,r),e=n.call(this,i),P(O(e),"itemsWrapperRef",void 0),P(O(e),"itemsListRef",void 0),P(O(e),"thumbsRef",void 0),P(O(e),"setItemsWrapperRef",function(o){e.itemsWrapperRef=o}),P(O(e),"setItemsListRef",function(o){e.itemsListRef=o}),P(O(e),"setThumbsRef",function(o,a){e.thumbsRef||(e.thumbsRef=[]),e.thumbsRef[a]=o}),P(O(e),"updateSizes",function(){if(!(!e.props.children||!e.itemsWrapperRef||!e.thumbsRef)){var o=I.Children.count(e.props.children),a=e.itemsWrapperRef.clientWidth,s=e.props.thumbWidth?e.props.thumbWidth:(0,$e.outerWidth)(e.thumbsRef[0]),f=Math.floor(a/s),h=f<o,m=h?o-f:0;e.setState(function(v,_){return{itemSize:s,visibleItems:f,firstItem:h?e.getFirstItem(_.selectedItem):0,lastPosition:m,showArrows:h}})}}),P(O(e),"handleClickItem",function(o,a,s){if(!Ze(s)||s.key==="Enter"){var f=e.props.onSelectItem;typeof f=="function"&&f(o,a)}}),P(O(e),"onSwipeStart",function(){e.setState({swiping:!0})}),P(O(e),"onSwipeEnd",function(){e.setState({swiping:!1})}),P(O(e),"onSwipeMove",function(o){var a=o.x;if(!e.state.itemSize||!e.itemsWrapperRef||!e.state.visibleItems)return!1;var s=0,f=I.Children.count(e.props.children),h=-(e.state.firstItem*100)/e.state.visibleItems,m=Math.max(f-e.state.visibleItems,0),v=-m*100/e.state.visibleItems;h===s&&a>0&&(a=0),h===v&&a<0&&(a=0);var _=e.itemsWrapperRef.clientWidth,b=h+100/(_/a);return e.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(E){e.itemsListRef.style[E]=(0,ge.default)(b,"%",e.props.axis)}),!0}),P(O(e),"slideRight",function(o){e.moveTo(e.state.firstItem-(typeof o=="number"?o:1))}),P(O(e),"slideLeft",function(o){e.moveTo(e.state.firstItem+(typeof o=="number"?o:1))}),P(O(e),"moveTo",function(o){o=o<0?0:o,o=o>=e.state.lastPosition?e.state.lastPosition:o,e.setState({firstItem:o})}),e.state={selectedItem:i.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},e}return Ke(r,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(e){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==e.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,V.default)().addEventListener("resize",this.updateSizes),(0,V.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,V.default)().removeEventListener("resize",this.updateSizes),(0,V.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(e){var o=e;return e>=this.state.lastPosition&&(o=this.state.lastPosition),e<this.state.firstItem+this.state.visibleItems&&(o=this.state.firstItem),e<this.state.firstItem&&(o=e),o}},{key:"renderItems",value:function(){var e=this;return this.props.children.map(function(o,a){var s=W.default.ITEM(!1,a===e.state.selectedItem),f={key:a,ref:function(m){return e.setThumbsRef(m,a)},className:s,onClick:e.handleClickItem.bind(e,a,e.props.children[a]),onKeyDown:e.handleClickItem.bind(e,a,e.props.children[a]),"aria-label":"".concat(e.props.labels.item," ").concat(a+1),style:{width:e.props.thumbWidth}};return I.default.createElement("li",ce({},f,{role:"button",tabIndex:0}),o)})}},{key:"render",value:function(){var e=this;if(!this.props.children)return null;var o=I.Children.count(this.props.children)>1,a=this.state.showArrows&&this.state.firstItem>0,s=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,f={},h=-this.state.firstItem*(this.state.itemSize||0),m=(0,ge.default)(h,"px",this.props.axis),v=this.props.transitionTime+"ms";return f={WebkitTransform:m,MozTransform:m,MsTransform:m,OTransform:m,transform:m,msTransform:m,WebkitTransitionDuration:v,MozTransitionDuration:v,MsTransitionDuration:v,OTransitionDuration:v,transitionDuration:v,msTransitionDuration:v},I.default.createElement("div",{className:W.default.CAROUSEL(!1)},I.default.createElement("div",{className:W.default.WRAPPER(!1),ref:this.setItemsWrapperRef},I.default.createElement("button",{type:"button",className:W.default.ARROW_PREV(!a),onClick:function(){return e.slideRight()},"aria-label":this.props.labels.leftArrow}),o?I.default.createElement(Ue.default,{tagName:"ul",className:W.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:f,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):I.default.createElement("ul",{className:W.default.SLIDER(!1,this.state.swiping),ref:function(b){return e.setItemsListRef(b)},style:f},this.renderItems()),I.default.createElement("button",{type:"button",className:W.default.ARROW_NEXT(!s),onClick:function(){return e.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),r}(I.Component);q.default=ve;P(ve,"displayName","Thumbs");P(ve,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350});var se={};Object.defineProperty(se,"__esModule",{value:!0});se.default=void 0;var Ge=function(){return document};se.default=Ge;var R={};Object.defineProperty(R,"__esModule",{value:!0});R.setPosition=R.getPosition=R.isKeyboardEvent=R.defaultStatusFormatter=R.noop=void 0;var Je=N,Qe=et(H);function et(t){return t&&t.__esModule?t:{default:t}}var tt=function(){};R.noop=tt;var nt=function(n,r){return"".concat(n," of ").concat(r)};R.defaultStatusFormatter=nt;var rt=function(n){return n?n.hasOwnProperty("key"):!1};R.isKeyboardEvent=rt;var it=function(n,r){if(r.infiniteLoop&&++n,n===0)return 0;var i=Je.Children.count(r.children);if(r.centerMode&&r.axis==="horizontal"){var e=-n*r.centerSlidePercentage,o=i-1;return n&&(n!==o||r.infiniteLoop)?e+=(100-r.centerSlidePercentage)/2:n===o&&(e+=100-r.centerSlidePercentage),e}return-n*100};R.getPosition=it;var ot=function(n,r){var i={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(e){i[e]=(0,Qe.default)(n,"%",r)}),i};R.setPosition=ot;var C={};Object.defineProperty(C,"__esModule",{value:!0});C.fadeAnimationHandler=C.slideStopSwipingHandler=C.slideSwipeAnimationHandler=C.slideAnimationHandler=void 0;var Ee=N,at=st(H),L=R;function st(t){return t&&t.__esModule?t:{default:t}}function be(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);n&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,i)}return r}function z(t){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?be(Object(r),!0).forEach(function(i){ut(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):be(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function ut(t,n,r){return n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}var lt=function(n,r){var i={},e=r.selectedItem,o=e,a=Ee.Children.count(n.children)-1,s=n.infiniteLoop&&(e<0||e>a);if(s)return o<0?n.centerMode&&n.centerSlidePercentage&&n.axis==="horizontal"?i.itemListStyle=(0,L.setPosition)(-(a+2)*n.centerSlidePercentage-(100-n.centerSlidePercentage)/2,n.axis):i.itemListStyle=(0,L.setPosition)(-(a+2)*100,n.axis):o>a&&(i.itemListStyle=(0,L.setPosition)(0,n.axis)),i;var f=(0,L.getPosition)(e,n),h=(0,at.default)(f,"%",n.axis),m=n.transitionTime+"ms";return i.itemListStyle={WebkitTransform:h,msTransform:h,OTransform:h,transform:h},r.swiping||(i.itemListStyle=z(z({},i.itemListStyle),{},{WebkitTransitionDuration:m,MozTransitionDuration:m,OTransitionDuration:m,transitionDuration:m,msTransitionDuration:m})),i};C.slideAnimationHandler=lt;var ft=function(n,r,i,e){var o={},a=r.axis==="horizontal",s=Ee.Children.count(r.children),f=0,h=(0,L.getPosition)(i.selectedItem,r),m=r.infiniteLoop?(0,L.getPosition)(s-1,r)-100:(0,L.getPosition)(s-1,r),v=a?n.x:n.y,_=v;h===f&&v>0&&(_=0),h===m&&v<0&&(_=0);var b=h+100/(i.itemSize/_),E=Math.abs(v)>r.swipeScrollTolerance;return r.infiniteLoop&&E&&(i.selectedItem===0&&b>-100?b-=s*100:i.selectedItem===s-1&&b<-s*100&&(b+=s*100)),(!r.preventMovementUntilSwipeScrollTolerance||E||i.swipeMovementStarted)&&(i.swipeMovementStarted||e({swipeMovementStarted:!0}),o.itemListStyle=(0,L.setPosition)(b,r.axis)),E&&!i.cancelClick&&e({cancelClick:!0}),o};C.slideSwipeAnimationHandler=ft;var ct=function(n,r){var i=(0,L.getPosition)(r.selectedItem,n),e=(0,L.setPosition)(i,n.axis);return{itemListStyle:e}};C.slideStopSwipingHandler=ct;var dt=function(n,r){var i=n.transitionTime+"ms",e="ease-in-out",o={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:e,msTransitionTimingFunction:e,MozTransitionTimingFunction:e,WebkitTransitionTimingFunction:e,OTransitionTimingFunction:e};return r.swiping||(o=z(z({},o),{},{WebkitTransitionDuration:i,MozTransitionDuration:i,OTransitionDuration:i,transitionDuration:i,msTransitionDuration:i})),{slideStyle:o,selectedStyle:z(z({},o),{},{opacity:1,position:"relative"}),prevStyle:z({},o)}};C.fadeAnimationHandler=dt;Object.defineProperty(ie,"__esModule",{value:!0});ie.default=void 0;var y=mt(N),pt=B(me),k=B(j),ht=B(q),Z=B(se),G=B(K),$=R,Q=C;function B(t){return t&&t.__esModule?t:{default:t}}function Te(){if(typeof WeakMap!="function")return null;var t=new WeakMap;return Te=function(){return t},t}function mt(t){if(t&&t.__esModule)return t;if(t===null||F(t)!=="object"&&typeof t!="function")return{default:t};var n=Te();if(n&&n.has(t))return n.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var o=i?Object.getOwnPropertyDescriptor(t,e):null;o&&(o.get||o.set)?Object.defineProperty(r,e,o):r[e]=t[e]}return r.default=t,n&&n.set(t,r),r}function F(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?F=function(r){return typeof r}:F=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},F(t)}function pe(){return pe=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},pe.apply(this,arguments)}function _e(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);n&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,i)}return r}function M(t){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?_e(Object(r),!0).forEach(function(i){c(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_e(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function vt(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function yt(t,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function wt(t,n,r){return n&&yt(t.prototype,n),t}function St(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&he(t,n)}function he(t,n){return he=Object.setPrototypeOf||function(i,e){return i.__proto__=e,i},he(t,n)}function gt(t){var n=_t();return function(){var i=ee(t),e;if(n){var o=ee(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return bt(this,e)}}function bt(t,n){return n&&(F(n)==="object"||typeof n=="function")?n:d(t)}function d(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _t(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function ee(t){return ee=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},ee(t)}function c(t,n,r){return n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}var ye=function(t){St(r,t);var n=gt(r);function r(i){var e;vt(this,r),e=n.call(this,i),c(d(e),"thumbsRef",void 0),c(d(e),"carouselWrapperRef",void 0),c(d(e),"listRef",void 0),c(d(e),"itemsRef",void 0),c(d(e),"timer",void 0),c(d(e),"animationHandler",void 0),c(d(e),"setThumbsRef",function(a){e.thumbsRef=a}),c(d(e),"setCarouselWrapperRef",function(a){e.carouselWrapperRef=a}),c(d(e),"setListRef",function(a){e.listRef=a}),c(d(e),"setItemsRef",function(a,s){e.itemsRef||(e.itemsRef=[]),e.itemsRef[s]=a}),c(d(e),"autoPlay",function(){y.Children.count(e.props.children)<=1||(e.clearAutoPlay(),e.props.autoPlay&&(e.timer=setTimeout(function(){e.increment()},e.props.interval)))}),c(d(e),"clearAutoPlay",function(){e.timer&&clearTimeout(e.timer)}),c(d(e),"resetAutoPlay",function(){e.clearAutoPlay(),e.autoPlay()}),c(d(e),"stopOnHover",function(){e.setState({isMouseEntered:!0},e.clearAutoPlay)}),c(d(e),"startOnLeave",function(){e.setState({isMouseEntered:!1},e.autoPlay)}),c(d(e),"isFocusWithinTheCarousel",function(){return e.carouselWrapperRef?!!((0,Z.default)().activeElement===e.carouselWrapperRef||e.carouselWrapperRef.contains((0,Z.default)().activeElement)):!1}),c(d(e),"navigateWithKeyboard",function(a){if(e.isFocusWithinTheCarousel()){var s=e.props.axis,f=s==="horizontal",h={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},m=f?h.ArrowRight:h.ArrowDown,v=f?h.ArrowLeft:h.ArrowUp;m===a.keyCode?e.increment():v===a.keyCode&&e.decrement()}}),c(d(e),"updateSizes",function(){if(!(!e.state.initialized||!e.itemsRef||e.itemsRef.length===0)){var a=e.props.axis==="horizontal",s=e.itemsRef[0];if(s){var f=a?s.clientWidth:s.clientHeight;e.setState({itemSize:f}),e.thumbsRef&&e.thumbsRef.updateSizes()}}}),c(d(e),"setMountState",function(){e.setState({hasMount:!0}),e.updateSizes()}),c(d(e),"handleClickItem",function(a,s){if(y.Children.count(e.props.children)!==0){if(e.state.cancelClick){e.setState({cancelClick:!1});return}e.props.onClickItem(a,s),a!==e.state.selectedItem&&e.setState({selectedItem:a})}}),c(d(e),"handleOnChange",function(a,s){y.Children.count(e.props.children)<=1||e.props.onChange(a,s)}),c(d(e),"handleClickThumb",function(a,s){e.props.onClickThumb(a,s),e.moveTo(a)}),c(d(e),"onSwipeStart",function(a){e.setState({swiping:!0}),e.props.onSwipeStart(a)}),c(d(e),"onSwipeEnd",function(a){e.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),e.props.onSwipeEnd(a),e.clearAutoPlay(),e.state.autoPlay&&e.autoPlay()}),c(d(e),"onSwipeMove",function(a,s){e.props.onSwipeMove(s);var f=e.props.swipeAnimationHandler(a,e.props,e.state,e.setState.bind(d(e)));return e.setState(M({},f)),!!Object.keys(f).length}),c(d(e),"decrement",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;e.moveTo(e.state.selectedItem-(typeof a=="number"?a:1))}),c(d(e),"increment",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;e.moveTo(e.state.selectedItem+(typeof a=="number"?a:1))}),c(d(e),"moveTo",function(a){if(typeof a=="number"){var s=y.Children.count(e.props.children)-1;a<0&&(a=e.props.infiniteLoop?s:0),a>s&&(a=e.props.infiniteLoop?0:s),e.selectItem({selectedItem:a}),e.state.autoPlay&&e.state.isMouseEntered===!1&&e.resetAutoPlay()}}),c(d(e),"onClickNext",function(){e.increment(1)}),c(d(e),"onClickPrev",function(){e.decrement(1)}),c(d(e),"onSwipeForward",function(){e.increment(1),e.props.emulateTouch&&e.setState({cancelClick:!0})}),c(d(e),"onSwipeBackwards",function(){e.decrement(1),e.props.emulateTouch&&e.setState({cancelClick:!0})}),c(d(e),"changeItem",function(a){return function(s){(!(0,$.isKeyboardEvent)(s)||s.key==="Enter")&&e.moveTo(a)}}),c(d(e),"selectItem",function(a){e.setState(M({previousItem:e.state.selectedItem},a),function(){e.setState(e.animationHandler(e.props,e.state))}),e.handleOnChange(a.selectedItem,y.Children.toArray(e.props.children)[a.selectedItem])}),c(d(e),"getInitialImage",function(){var a=e.props.selectedItem,s=e.itemsRef&&e.itemsRef[a],f=s&&s.getElementsByTagName("img")||[];return f[0]}),c(d(e),"getVariableItemHeight",function(a){var s=e.itemsRef&&e.itemsRef[a];if(e.state.hasMount&&s&&s.children.length){var f=s.children[0].getElementsByTagName("img")||[];if(f.length>0){var h=f[0];if(!h.complete){var m=function b(){e.forceUpdate(),h.removeEventListener("load",b)};h.addEventListener("load",m)}}var v=f[0]||s.children[0],_=v.clientHeight;return _>0?_:null}return null});var o={initialized:!1,previousItem:i.selectedItem,selectedItem:i.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:i.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return e.animationHandler=typeof i.animationHandler=="function"&&i.animationHandler||i.animationHandler==="fade"&&Q.fadeAnimationHandler||Q.slideAnimationHandler,e.state=M(M({},o),e.animationHandler(i,o)),e}return wt(r,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(e,o){!e.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!e.autoFocus&&this.props.autoFocus&&this.forceFocus(),o.swiping&&!this.state.swiping&&this.setState(M({},this.props.stopSwipingHandler(this.props,this.state))),(e.selectedItem!==this.props.selectedItem||e.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),e.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var e=this;this.bindEvents(),this.state.autoPlay&&y.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var o=e.getInitialImage();o&&!o.complete?o.addEventListener("load",e.setMountState):e.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var e=this.carouselWrapperRef;this.props.stopOnHover&&e&&(e.addEventListener("mouseenter",this.stopOnHover),e.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var e=this.carouselWrapperRef;this.props.stopOnHover&&e&&(e.removeEventListener("mouseenter",this.stopOnHover),e.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,G.default)().addEventListener("resize",this.updateSizes),(0,G.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,Z.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,G.default)().removeEventListener("resize",this.updateSizes),(0,G.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var e=this.getInitialImage();e&&e.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,Z.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var e;(e=this.carouselWrapperRef)===null||e===void 0||e.focus()}},{key:"renderItems",value:function(e){var o=this;return this.props.children?y.Children.map(this.props.children,function(a,s){var f=s===o.state.selectedItem,h=s===o.state.previousItem,m=f&&o.state.selectedStyle||h&&o.state.prevStyle||o.state.slideStyle||{};o.props.centerMode&&o.props.axis==="horizontal"&&(m=M(M({},m),{},{minWidth:o.props.centerSlidePercentage+"%"})),o.state.swiping&&o.state.swipeMovementStarted&&(m=M(M({},m),{},{pointerEvents:"none"}));var v={ref:function(b){return o.setItemsRef(b,s)},key:"itemKey"+s+(e?"clone":""),className:k.default.ITEM(!0,s===o.state.selectedItem,s===o.state.previousItem),onClick:o.handleClickItem.bind(o,s,a),style:m};return y.default.createElement("li",v,o.props.renderItem(a,{isSelected:s===o.state.selectedItem,isPrevious:s===o.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var e=this,o=this.props,a=o.showIndicators,s=o.labels,f=o.renderIndicator,h=o.children;return a?y.default.createElement("ul",{className:"control-dots"},y.Children.map(h,function(m,v){return f&&f(e.changeItem(v),v===e.state.selectedItem,v,s.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?y.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,y.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||y.Children.count(this.props.children)===0?null:y.default.createElement(ht.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var e=this;if(!this.props.children||y.Children.count(this.props.children)===0)return null;var o=this.props.swipeable&&y.Children.count(this.props.children)>1,a=this.props.axis==="horizontal",s=this.props.showArrows&&y.Children.count(this.props.children)>1,f=s&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,h=s&&(this.state.selectedItem<y.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,m=this.renderItems(!0),v=m.shift(),_=m.pop(),b={className:k.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},E={};if(a){if(b.onSwipeLeft=this.onSwipeForward,b.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var X=this.getVariableItemHeight(this.state.selectedItem);E.height=X||"auto"}}else b.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,b.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,b.style=M(M({},b.style),{},{height:this.state.itemSize}),E.height=this.state.itemSize;return y.default.createElement("div",{"aria-label":this.props.ariaLabel,className:k.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},y.default.createElement("div",{className:k.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,f,this.props.labels.leftArrow),y.default.createElement("div",{className:k.default.WRAPPER(!0,this.props.axis),style:E},o?y.default.createElement(pt.default,pe({tagName:"ul",innerRef:this.setListRef},b,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&_,this.renderItems(),this.props.infiniteLoop&&v):y.default.createElement("ul",{className:k.default.SLIDER(!0,this.state.swiping),ref:function(x){return e.setListRef(x)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&_,this.renderItems(),this.props.infiniteLoop&&v)),this.props.renderArrowNext(this.onClickNext,h,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),r}(y.default.Component);ie.default=ye;c(ye,"displayName","Carousel");c(ye,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:$.noop,onClickThumb:$.noop,onChange:$.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(n,r,i){return y.default.createElement("button",{type:"button","aria-label":i,className:k.default.ARROW_PREV(!r),onClick:n})},renderArrowNext:function(n,r,i){return y.default.createElement("button",{type:"button","aria-label":i,className:k.default.ARROW_NEXT(!r),onClick:n})},renderIndicator:function(n,r,i,e){return y.default.createElement("li",{className:k.default.DOT(r),onClick:n,onKeyDown:n,value:i,key:i,role:"button",tabIndex:0,"aria-label":"".concat(e," ").concat(i+1)})},renderItem:function(n){return n},renderThumbs:function(n){var r=y.Children.map(n,function(i){var e=i;if(i.type!=="img"&&(e=y.Children.toArray(i.props.children).find(function(o){return o.type==="img"})),!!e)return e});return r.filter(function(i){return i}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):r},statusFormatter:$.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:Q.slideSwipeAnimationHandler,stopSwipingHandler:Q.slideStopSwipingHandler});var Pt={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Carousel",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"CarouselProps",{enumerable:!0,get:function(){return r.CarouselProps}}),Object.defineProperty(t,"Thumbs",{enumerable:!0,get:function(){return i.default}});var n=e(ie),r=Pt,i=e(q);function e(o){return o&&o.__esModule?o:{default:o}}})(Oe);const Ot=te.styled.div`
|
|
1
|
+
"use strict";const k=require("react/jsx-runtime"),N=require("react"),Pe=require("./_commonjsHelpers-DKOUU3wS.cjs"),fe=require("./index-BPVoEhTF.cjs"),Ce=require("./index-gY9e_8LL.cjs"),te=require("./emotion-styled.browser.esm-BtEseadx.cjs"),ne=require("./consts-goSZX3xP.cjs"),re=require("./utils-CZynEOC_.cjs"),Le=require("./Button.cjs");var Oe={},ie={},me={},le={},Se;function ke(){return Se||(Se=1,function(t){(function(n,r){r(t,N,fe.propTypesExports)})(Pe.commonjsGlobal,function(n,r,i){Object.defineProperty(n,"__esModule",{value:!0}),n.setHasSupportToCaptureOption=E;var e=a(r),o=a(i);function a(l){return l&&l.__esModule?l:{default:l}}var s=Object.assign||function(l){for(var p=1;p<arguments.length;p++){var S=arguments[p];for(var u in S)Object.prototype.hasOwnProperty.call(S,u)&&(l[u]=S[u])}return l};function f(l,p){var S={};for(var u in l)p.indexOf(u)>=0||Object.prototype.hasOwnProperty.call(l,u)&&(S[u]=l[u]);return S}function h(l,p){if(!(l instanceof p))throw new TypeError("Cannot call a class as a function")}var m=function(){function l(p,S){for(var u=0;u<S.length;u++){var g=S[u];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(p,g.key,g)}}return function(p,S,u){return S&&l(p.prototype,S),u&&l(p,u),p}}();function v(l,p){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:l}function _(l,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);l.prototype=Object.create(p&&p.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(l,p):l.__proto__=p)}var b=!1;function E(l){b=l}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){E(!0)}}))}catch{}function X(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return b?l:l.capture}function ue(l){if("touches"in l){var p=l.touches[0],S=p.pageX,u=p.pageY;return{x:S,y:u}}var g=l.screenX,T=l.screenY;return{x:g,y:T}}var x=function(l){_(p,l);function p(){var S;h(this,p);for(var u=arguments.length,g=Array(u),T=0;T<u;T++)g[T]=arguments[T];var w=v(this,(S=p.__proto__||Object.getPrototypeOf(p)).call.apply(S,[this].concat(g)));return w._handleSwipeStart=w._handleSwipeStart.bind(w),w._handleSwipeMove=w._handleSwipeMove.bind(w),w._handleSwipeEnd=w._handleSwipeEnd.bind(w),w._onMouseDown=w._onMouseDown.bind(w),w._onMouseMove=w._onMouseMove.bind(w),w._onMouseUp=w._onMouseUp.bind(w),w._setSwiperRef=w._setSwiperRef.bind(w),w}return m(p,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,X({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,X({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(u){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(u))}},{key:"_onMouseMove",value:function(u){this.mouseDown&&this._handleSwipeMove(u)}},{key:"_onMouseUp",value:function(u){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(u)}},{key:"_handleSwipeStart",value:function(u){var g=ue(u),T=g.x,w=g.y;this.moveStart={x:T,y:w},this.props.onSwipeStart(u)}},{key:"_handleSwipeMove",value:function(u){if(this.moveStart){var g=ue(u),T=g.x,w=g.y,Y=T-this.moveStart.x,we=w-this.moveStart.y;this.moving=!0;var Me=this.props.onSwipeMove({x:Y,y:we},u);Me&&u.cancelable&&u.preventDefault(),this.movePosition={deltaX:Y,deltaY:we}}}},{key:"_handleSwipeEnd",value:function(u){this.props.onSwipeEnd(u);var g=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-g?this.props.onSwipeLeft(1,u):this.movePosition.deltaX>g&&this.props.onSwipeRight(1,u),this.movePosition.deltaY<-g?this.props.onSwipeUp(1,u):this.movePosition.deltaY>g&&this.props.onSwipeDown(1,u)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(u){this.swiper=u,this.props.innerRef(u)}},{key:"render",value:function(){var u=this.props;u.tagName;var g=u.className,T=u.style,w=u.children;u.allowMouseEvents,u.onSwipeUp,u.onSwipeDown,u.onSwipeLeft,u.onSwipeRight,u.onSwipeStart,u.onSwipeMove,u.onSwipeEnd,u.innerRef,u.tolerance;var Y=f(u,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return e.default.createElement(this.props.tagName,s({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:g,style:T},Y),w)}}]),p}(r.Component);x.displayName="ReactSwipe",x.propTypes={tagName:o.default.string,className:o.default.string,style:o.default.object,children:o.default.node,allowMouseEvents:o.default.bool,onSwipeUp:o.default.func,onSwipeDown:o.default.func,onSwipeLeft:o.default.func,onSwipeRight:o.default.func,onSwipeStart:o.default.func,onSwipeMove:o.default.func,onSwipeEnd:o.default.func,innerRef:o.default.func,tolerance:o.default.number.isRequired},x.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},n.default=x})}(le)),le}(function(t){(function(n,r){r(t,ke())})(Pe.commonjsGlobal,function(n,r){Object.defineProperty(n,"__esModule",{value:!0});var i=e(r);function e(o){return o&&o.__esModule?o:{default:o}}n.default=i.default})})(me);var j={};Object.defineProperty(j,"__esModule",{value:!0});j.default=void 0;var A=De(Ce.classnamesExports);function De(t){return t&&t.__esModule?t:{default:t}}function Ae(t,n,r){return n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}var We={ROOT:function(n){return(0,A.default)(Ae({"carousel-root":!0},n||"",!!n))},CAROUSEL:function(n){return(0,A.default)({carousel:!0,"carousel-slider":n})},WRAPPER:function(n,r){return(0,A.default)({"thumbs-wrapper":!n,"slider-wrapper":n,"axis-horizontal":r==="horizontal","axis-vertical":r!=="horizontal"})},SLIDER:function(n,r){return(0,A.default)({thumbs:!n,slider:n,animated:!r})},ITEM:function(n,r,i){return(0,A.default)({thumb:!n,slide:n,selected:r,previous:i})},ARROW_PREV:function(n){return(0,A.default)({"control-arrow control-prev":!0,"control-disabled":n})},ARROW_NEXT:function(n){return(0,A.default)({"control-arrow control-next":!0,"control-disabled":n})},DOT:function(n){return(0,A.default)({dot:!0,selected:n})}};j.default=We;var q={},oe={};Object.defineProperty(oe,"__esModule",{value:!0});oe.outerWidth=void 0;var ze=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};oe.outerWidth=ze;var H={};Object.defineProperty(H,"__esModule",{value:!0});H.default=void 0;var xe=function(n,r,i){var e=n===0?n:n+r,o=i==="horizontal"?[e,0,0]:[0,e,0],a="translate3d",s="("+o.join(",")+")";return a+s};H.default=xe;var K={};Object.defineProperty(K,"__esModule",{value:!0});K.default=void 0;var Ne=function(){return window};K.default=Ne;Object.defineProperty(q,"__esModule",{value:!0});q.default=void 0;var I=Ue(N),W=ae(j),He=oe,ge=ae(H),$e=ae(me),V=ae(K);function ae(t){return t&&t.__esModule?t:{default:t}}function Re(){if(typeof WeakMap!="function")return null;var t=new WeakMap;return Re=function(){return t},t}function Ue(t){if(t&&t.__esModule)return t;if(t===null||U(t)!=="object"&&typeof t!="function")return{default:t};var n=Re();if(n&&n.has(t))return n.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var o=i?Object.getOwnPropertyDescriptor(t,e):null;o&&(o.get||o.set)?Object.defineProperty(r,e,o):r[e]=t[e]}return r.default=t,n&&n.set(t,r),r}function U(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?U=function(r){return typeof r}:U=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},U(t)}function ce(){return ce=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},ce.apply(this,arguments)}function Fe(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function je(t,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function qe(t,n,r){return n&&je(t.prototype,n),t}function Ke(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&de(t,n)}function de(t,n){return de=Object.setPrototypeOf||function(i,e){return i.__proto__=e,i},de(t,n)}function Be(t){var n=Ye();return function(){var i=J(t),e;if(n){var o=J(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return Xe(this,e)}}function Xe(t,n){return n&&(U(n)==="object"||typeof n=="function")?n:O(t)}function O(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ye(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function J(t){return J=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},J(t)}function P(t,n,r){return n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}var Ve=function(n){return n.hasOwnProperty("key")},ve=function(t){Ke(r,t);var n=Be(r);function r(i){var e;return Fe(this,r),e=n.call(this,i),P(O(e),"itemsWrapperRef",void 0),P(O(e),"itemsListRef",void 0),P(O(e),"thumbsRef",void 0),P(O(e),"setItemsWrapperRef",function(o){e.itemsWrapperRef=o}),P(O(e),"setItemsListRef",function(o){e.itemsListRef=o}),P(O(e),"setThumbsRef",function(o,a){e.thumbsRef||(e.thumbsRef=[]),e.thumbsRef[a]=o}),P(O(e),"updateSizes",function(){if(!(!e.props.children||!e.itemsWrapperRef||!e.thumbsRef)){var o=I.Children.count(e.props.children),a=e.itemsWrapperRef.clientWidth,s=e.props.thumbWidth?e.props.thumbWidth:(0,He.outerWidth)(e.thumbsRef[0]),f=Math.floor(a/s),h=f<o,m=h?o-f:0;e.setState(function(v,_){return{itemSize:s,visibleItems:f,firstItem:h?e.getFirstItem(_.selectedItem):0,lastPosition:m,showArrows:h}})}}),P(O(e),"handleClickItem",function(o,a,s){if(!Ve(s)||s.key==="Enter"){var f=e.props.onSelectItem;typeof f=="function"&&f(o,a)}}),P(O(e),"onSwipeStart",function(){e.setState({swiping:!0})}),P(O(e),"onSwipeEnd",function(){e.setState({swiping:!1})}),P(O(e),"onSwipeMove",function(o){var a=o.x;if(!e.state.itemSize||!e.itemsWrapperRef||!e.state.visibleItems)return!1;var s=0,f=I.Children.count(e.props.children),h=-(e.state.firstItem*100)/e.state.visibleItems,m=Math.max(f-e.state.visibleItems,0),v=-m*100/e.state.visibleItems;h===s&&a>0&&(a=0),h===v&&a<0&&(a=0);var _=e.itemsWrapperRef.clientWidth,b=h+100/(_/a);return e.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(E){e.itemsListRef.style[E]=(0,ge.default)(b,"%",e.props.axis)}),!0}),P(O(e),"slideRight",function(o){e.moveTo(e.state.firstItem-(typeof o=="number"?o:1))}),P(O(e),"slideLeft",function(o){e.moveTo(e.state.firstItem+(typeof o=="number"?o:1))}),P(O(e),"moveTo",function(o){o=o<0?0:o,o=o>=e.state.lastPosition?e.state.lastPosition:o,e.setState({firstItem:o})}),e.state={selectedItem:i.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},e}return qe(r,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(e){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==e.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,V.default)().addEventListener("resize",this.updateSizes),(0,V.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,V.default)().removeEventListener("resize",this.updateSizes),(0,V.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(e){var o=e;return e>=this.state.lastPosition&&(o=this.state.lastPosition),e<this.state.firstItem+this.state.visibleItems&&(o=this.state.firstItem),e<this.state.firstItem&&(o=e),o}},{key:"renderItems",value:function(){var e=this;return this.props.children.map(function(o,a){var s=W.default.ITEM(!1,a===e.state.selectedItem),f={key:a,ref:function(m){return e.setThumbsRef(m,a)},className:s,onClick:e.handleClickItem.bind(e,a,e.props.children[a]),onKeyDown:e.handleClickItem.bind(e,a,e.props.children[a]),"aria-label":"".concat(e.props.labels.item," ").concat(a+1),style:{width:e.props.thumbWidth}};return I.default.createElement("li",ce({},f,{role:"button",tabIndex:0}),o)})}},{key:"render",value:function(){var e=this;if(!this.props.children)return null;var o=I.Children.count(this.props.children)>1,a=this.state.showArrows&&this.state.firstItem>0,s=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,f={},h=-this.state.firstItem*(this.state.itemSize||0),m=(0,ge.default)(h,"px",this.props.axis),v=this.props.transitionTime+"ms";return f={WebkitTransform:m,MozTransform:m,MsTransform:m,OTransform:m,transform:m,msTransform:m,WebkitTransitionDuration:v,MozTransitionDuration:v,MsTransitionDuration:v,OTransitionDuration:v,transitionDuration:v,msTransitionDuration:v},I.default.createElement("div",{className:W.default.CAROUSEL(!1)},I.default.createElement("div",{className:W.default.WRAPPER(!1),ref:this.setItemsWrapperRef},I.default.createElement("button",{type:"button",className:W.default.ARROW_PREV(!a),onClick:function(){return e.slideRight()},"aria-label":this.props.labels.leftArrow}),o?I.default.createElement($e.default,{tagName:"ul",className:W.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:f,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):I.default.createElement("ul",{className:W.default.SLIDER(!1,this.state.swiping),ref:function(b){return e.setItemsListRef(b)},style:f},this.renderItems()),I.default.createElement("button",{type:"button",className:W.default.ARROW_NEXT(!s),onClick:function(){return e.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),r}(I.Component);q.default=ve;P(ve,"displayName","Thumbs");P(ve,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350});var se={};Object.defineProperty(se,"__esModule",{value:!0});se.default=void 0;var Ze=function(){return document};se.default=Ze;var R={};Object.defineProperty(R,"__esModule",{value:!0});R.setPosition=R.getPosition=R.isKeyboardEvent=R.defaultStatusFormatter=R.noop=void 0;var Ge=N,Je=Qe(H);function Qe(t){return t&&t.__esModule?t:{default:t}}var et=function(){};R.noop=et;var tt=function(n,r){return"".concat(n," of ").concat(r)};R.defaultStatusFormatter=tt;var nt=function(n){return n?n.hasOwnProperty("key"):!1};R.isKeyboardEvent=nt;var rt=function(n,r){if(r.infiniteLoop&&++n,n===0)return 0;var i=Ge.Children.count(r.children);if(r.centerMode&&r.axis==="horizontal"){var e=-n*r.centerSlidePercentage,o=i-1;return n&&(n!==o||r.infiniteLoop)?e+=(100-r.centerSlidePercentage)/2:n===o&&(e+=100-r.centerSlidePercentage),e}return-n*100};R.getPosition=rt;var it=function(n,r){var i={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(e){i[e]=(0,Je.default)(n,"%",r)}),i};R.setPosition=it;var C={};Object.defineProperty(C,"__esModule",{value:!0});C.fadeAnimationHandler=C.slideStopSwipingHandler=C.slideSwipeAnimationHandler=C.slideAnimationHandler=void 0;var Ee=N,ot=at(H),L=R;function at(t){return t&&t.__esModule?t:{default:t}}function be(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);n&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,i)}return r}function z(t){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?be(Object(r),!0).forEach(function(i){st(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):be(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function st(t,n,r){return n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}var ut=function(n,r){var i={},e=r.selectedItem,o=e,a=Ee.Children.count(n.children)-1,s=n.infiniteLoop&&(e<0||e>a);if(s)return o<0?n.centerMode&&n.centerSlidePercentage&&n.axis==="horizontal"?i.itemListStyle=(0,L.setPosition)(-(a+2)*n.centerSlidePercentage-(100-n.centerSlidePercentage)/2,n.axis):i.itemListStyle=(0,L.setPosition)(-(a+2)*100,n.axis):o>a&&(i.itemListStyle=(0,L.setPosition)(0,n.axis)),i;var f=(0,L.getPosition)(e,n),h=(0,ot.default)(f,"%",n.axis),m=n.transitionTime+"ms";return i.itemListStyle={WebkitTransform:h,msTransform:h,OTransform:h,transform:h},r.swiping||(i.itemListStyle=z(z({},i.itemListStyle),{},{WebkitTransitionDuration:m,MozTransitionDuration:m,OTransitionDuration:m,transitionDuration:m,msTransitionDuration:m})),i};C.slideAnimationHandler=ut;var lt=function(n,r,i,e){var o={},a=r.axis==="horizontal",s=Ee.Children.count(r.children),f=0,h=(0,L.getPosition)(i.selectedItem,r),m=r.infiniteLoop?(0,L.getPosition)(s-1,r)-100:(0,L.getPosition)(s-1,r),v=a?n.x:n.y,_=v;h===f&&v>0&&(_=0),h===m&&v<0&&(_=0);var b=h+100/(i.itemSize/_),E=Math.abs(v)>r.swipeScrollTolerance;return r.infiniteLoop&&E&&(i.selectedItem===0&&b>-100?b-=s*100:i.selectedItem===s-1&&b<-s*100&&(b+=s*100)),(!r.preventMovementUntilSwipeScrollTolerance||E||i.swipeMovementStarted)&&(i.swipeMovementStarted||e({swipeMovementStarted:!0}),o.itemListStyle=(0,L.setPosition)(b,r.axis)),E&&!i.cancelClick&&e({cancelClick:!0}),o};C.slideSwipeAnimationHandler=lt;var ft=function(n,r){var i=(0,L.getPosition)(r.selectedItem,n),e=(0,L.setPosition)(i,n.axis);return{itemListStyle:e}};C.slideStopSwipingHandler=ft;var ct=function(n,r){var i=n.transitionTime+"ms",e="ease-in-out",o={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:e,msTransitionTimingFunction:e,MozTransitionTimingFunction:e,WebkitTransitionTimingFunction:e,OTransitionTimingFunction:e};return r.swiping||(o=z(z({},o),{},{WebkitTransitionDuration:i,MozTransitionDuration:i,OTransitionDuration:i,transitionDuration:i,msTransitionDuration:i})),{slideStyle:o,selectedStyle:z(z({},o),{},{opacity:1,position:"relative"}),prevStyle:z({},o)}};C.fadeAnimationHandler=ct;Object.defineProperty(ie,"__esModule",{value:!0});ie.default=void 0;var y=ht(N),dt=B(me),D=B(j),pt=B(q),Z=B(se),G=B(K),$=R,Q=C;function B(t){return t&&t.__esModule?t:{default:t}}function Te(){if(typeof WeakMap!="function")return null;var t=new WeakMap;return Te=function(){return t},t}function ht(t){if(t&&t.__esModule)return t;if(t===null||F(t)!=="object"&&typeof t!="function")return{default:t};var n=Te();if(n&&n.has(t))return n.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var o=i?Object.getOwnPropertyDescriptor(t,e):null;o&&(o.get||o.set)?Object.defineProperty(r,e,o):r[e]=t[e]}return r.default=t,n&&n.set(t,r),r}function F(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?F=function(r){return typeof r}:F=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},F(t)}function pe(){return pe=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},pe.apply(this,arguments)}function _e(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);n&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,i)}return r}function M(t){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?_e(Object(r),!0).forEach(function(i){c(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_e(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function mt(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function vt(t,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function yt(t,n,r){return n&&vt(t.prototype,n),t}function wt(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&he(t,n)}function he(t,n){return he=Object.setPrototypeOf||function(i,e){return i.__proto__=e,i},he(t,n)}function St(t){var n=bt();return function(){var i=ee(t),e;if(n){var o=ee(this).constructor;e=Reflect.construct(i,arguments,o)}else e=i.apply(this,arguments);return gt(this,e)}}function gt(t,n){return n&&(F(n)==="object"||typeof n=="function")?n:d(t)}function d(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function bt(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function ee(t){return ee=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},ee(t)}function c(t,n,r){return n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}var ye=function(t){wt(r,t);var n=St(r);function r(i){var e;mt(this,r),e=n.call(this,i),c(d(e),"thumbsRef",void 0),c(d(e),"carouselWrapperRef",void 0),c(d(e),"listRef",void 0),c(d(e),"itemsRef",void 0),c(d(e),"timer",void 0),c(d(e),"animationHandler",void 0),c(d(e),"setThumbsRef",function(a){e.thumbsRef=a}),c(d(e),"setCarouselWrapperRef",function(a){e.carouselWrapperRef=a}),c(d(e),"setListRef",function(a){e.listRef=a}),c(d(e),"setItemsRef",function(a,s){e.itemsRef||(e.itemsRef=[]),e.itemsRef[s]=a}),c(d(e),"autoPlay",function(){y.Children.count(e.props.children)<=1||(e.clearAutoPlay(),e.props.autoPlay&&(e.timer=setTimeout(function(){e.increment()},e.props.interval)))}),c(d(e),"clearAutoPlay",function(){e.timer&&clearTimeout(e.timer)}),c(d(e),"resetAutoPlay",function(){e.clearAutoPlay(),e.autoPlay()}),c(d(e),"stopOnHover",function(){e.setState({isMouseEntered:!0},e.clearAutoPlay)}),c(d(e),"startOnLeave",function(){e.setState({isMouseEntered:!1},e.autoPlay)}),c(d(e),"isFocusWithinTheCarousel",function(){return e.carouselWrapperRef?!!((0,Z.default)().activeElement===e.carouselWrapperRef||e.carouselWrapperRef.contains((0,Z.default)().activeElement)):!1}),c(d(e),"navigateWithKeyboard",function(a){if(e.isFocusWithinTheCarousel()){var s=e.props.axis,f=s==="horizontal",h={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},m=f?h.ArrowRight:h.ArrowDown,v=f?h.ArrowLeft:h.ArrowUp;m===a.keyCode?e.increment():v===a.keyCode&&e.decrement()}}),c(d(e),"updateSizes",function(){if(!(!e.state.initialized||!e.itemsRef||e.itemsRef.length===0)){var a=e.props.axis==="horizontal",s=e.itemsRef[0];if(s){var f=a?s.clientWidth:s.clientHeight;e.setState({itemSize:f}),e.thumbsRef&&e.thumbsRef.updateSizes()}}}),c(d(e),"setMountState",function(){e.setState({hasMount:!0}),e.updateSizes()}),c(d(e),"handleClickItem",function(a,s){if(y.Children.count(e.props.children)!==0){if(e.state.cancelClick){e.setState({cancelClick:!1});return}e.props.onClickItem(a,s),a!==e.state.selectedItem&&e.setState({selectedItem:a})}}),c(d(e),"handleOnChange",function(a,s){y.Children.count(e.props.children)<=1||e.props.onChange(a,s)}),c(d(e),"handleClickThumb",function(a,s){e.props.onClickThumb(a,s),e.moveTo(a)}),c(d(e),"onSwipeStart",function(a){e.setState({swiping:!0}),e.props.onSwipeStart(a)}),c(d(e),"onSwipeEnd",function(a){e.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),e.props.onSwipeEnd(a),e.clearAutoPlay(),e.state.autoPlay&&e.autoPlay()}),c(d(e),"onSwipeMove",function(a,s){e.props.onSwipeMove(s);var f=e.props.swipeAnimationHandler(a,e.props,e.state,e.setState.bind(d(e)));return e.setState(M({},f)),!!Object.keys(f).length}),c(d(e),"decrement",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;e.moveTo(e.state.selectedItem-(typeof a=="number"?a:1))}),c(d(e),"increment",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;e.moveTo(e.state.selectedItem+(typeof a=="number"?a:1))}),c(d(e),"moveTo",function(a){if(typeof a=="number"){var s=y.Children.count(e.props.children)-1;a<0&&(a=e.props.infiniteLoop?s:0),a>s&&(a=e.props.infiniteLoop?0:s),e.selectItem({selectedItem:a}),e.state.autoPlay&&e.state.isMouseEntered===!1&&e.resetAutoPlay()}}),c(d(e),"onClickNext",function(){e.increment(1)}),c(d(e),"onClickPrev",function(){e.decrement(1)}),c(d(e),"onSwipeForward",function(){e.increment(1),e.props.emulateTouch&&e.setState({cancelClick:!0})}),c(d(e),"onSwipeBackwards",function(){e.decrement(1),e.props.emulateTouch&&e.setState({cancelClick:!0})}),c(d(e),"changeItem",function(a){return function(s){(!(0,$.isKeyboardEvent)(s)||s.key==="Enter")&&e.moveTo(a)}}),c(d(e),"selectItem",function(a){e.setState(M({previousItem:e.state.selectedItem},a),function(){e.setState(e.animationHandler(e.props,e.state))}),e.handleOnChange(a.selectedItem,y.Children.toArray(e.props.children)[a.selectedItem])}),c(d(e),"getInitialImage",function(){var a=e.props.selectedItem,s=e.itemsRef&&e.itemsRef[a],f=s&&s.getElementsByTagName("img")||[];return f[0]}),c(d(e),"getVariableItemHeight",function(a){var s=e.itemsRef&&e.itemsRef[a];if(e.state.hasMount&&s&&s.children.length){var f=s.children[0].getElementsByTagName("img")||[];if(f.length>0){var h=f[0];if(!h.complete){var m=function b(){e.forceUpdate(),h.removeEventListener("load",b)};h.addEventListener("load",m)}}var v=f[0]||s.children[0],_=v.clientHeight;return _>0?_:null}return null});var o={initialized:!1,previousItem:i.selectedItem,selectedItem:i.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:i.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return e.animationHandler=typeof i.animationHandler=="function"&&i.animationHandler||i.animationHandler==="fade"&&Q.fadeAnimationHandler||Q.slideAnimationHandler,e.state=M(M({},o),e.animationHandler(i,o)),e}return yt(r,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(e,o){!e.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!e.autoFocus&&this.props.autoFocus&&this.forceFocus(),o.swiping&&!this.state.swiping&&this.setState(M({},this.props.stopSwipingHandler(this.props,this.state))),(e.selectedItem!==this.props.selectedItem||e.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),e.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var e=this;this.bindEvents(),this.state.autoPlay&&y.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var o=e.getInitialImage();o&&!o.complete?o.addEventListener("load",e.setMountState):e.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var e=this.carouselWrapperRef;this.props.stopOnHover&&e&&(e.addEventListener("mouseenter",this.stopOnHover),e.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var e=this.carouselWrapperRef;this.props.stopOnHover&&e&&(e.removeEventListener("mouseenter",this.stopOnHover),e.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,G.default)().addEventListener("resize",this.updateSizes),(0,G.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,Z.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,G.default)().removeEventListener("resize",this.updateSizes),(0,G.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var e=this.getInitialImage();e&&e.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,Z.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var e;(e=this.carouselWrapperRef)===null||e===void 0||e.focus()}},{key:"renderItems",value:function(e){var o=this;return this.props.children?y.Children.map(this.props.children,function(a,s){var f=s===o.state.selectedItem,h=s===o.state.previousItem,m=f&&o.state.selectedStyle||h&&o.state.prevStyle||o.state.slideStyle||{};o.props.centerMode&&o.props.axis==="horizontal"&&(m=M(M({},m),{},{minWidth:o.props.centerSlidePercentage+"%"})),o.state.swiping&&o.state.swipeMovementStarted&&(m=M(M({},m),{},{pointerEvents:"none"}));var v={ref:function(b){return o.setItemsRef(b,s)},key:"itemKey"+s+(e?"clone":""),className:D.default.ITEM(!0,s===o.state.selectedItem,s===o.state.previousItem),onClick:o.handleClickItem.bind(o,s,a),style:m};return y.default.createElement("li",v,o.props.renderItem(a,{isSelected:s===o.state.selectedItem,isPrevious:s===o.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var e=this,o=this.props,a=o.showIndicators,s=o.labels,f=o.renderIndicator,h=o.children;return a?y.default.createElement("ul",{className:"control-dots"},y.Children.map(h,function(m,v){return f&&f(e.changeItem(v),v===e.state.selectedItem,v,s.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?y.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,y.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||y.Children.count(this.props.children)===0?null:y.default.createElement(pt.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var e=this;if(!this.props.children||y.Children.count(this.props.children)===0)return null;var o=this.props.swipeable&&y.Children.count(this.props.children)>1,a=this.props.axis==="horizontal",s=this.props.showArrows&&y.Children.count(this.props.children)>1,f=s&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,h=s&&(this.state.selectedItem<y.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,m=this.renderItems(!0),v=m.shift(),_=m.pop(),b={className:D.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},E={};if(a){if(b.onSwipeLeft=this.onSwipeForward,b.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var X=this.getVariableItemHeight(this.state.selectedItem);E.height=X||"auto"}}else b.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,b.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,b.style=M(M({},b.style),{},{height:this.state.itemSize}),E.height=this.state.itemSize;return y.default.createElement("div",{"aria-label":this.props.ariaLabel,className:D.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},y.default.createElement("div",{className:D.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,f,this.props.labels.leftArrow),y.default.createElement("div",{className:D.default.WRAPPER(!0,this.props.axis),style:E},o?y.default.createElement(dt.default,pe({tagName:"ul",innerRef:this.setListRef},b,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&_,this.renderItems(),this.props.infiniteLoop&&v):y.default.createElement("ul",{className:D.default.SLIDER(!0,this.state.swiping),ref:function(x){return e.setListRef(x)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&_,this.renderItems(),this.props.infiniteLoop&&v)),this.props.renderArrowNext(this.onClickNext,h,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),r}(y.default.Component);ie.default=ye;c(ye,"displayName","Carousel");c(ye,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:$.noop,onClickThumb:$.noop,onChange:$.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(n,r,i){return y.default.createElement("button",{type:"button","aria-label":i,className:D.default.ARROW_PREV(!r),onClick:n})},renderArrowNext:function(n,r,i){return y.default.createElement("button",{type:"button","aria-label":i,className:D.default.ARROW_NEXT(!r),onClick:n})},renderIndicator:function(n,r,i,e){return y.default.createElement("li",{className:D.default.DOT(r),onClick:n,onKeyDown:n,value:i,key:i,role:"button",tabIndex:0,"aria-label":"".concat(e," ").concat(i+1)})},renderItem:function(n){return n},renderThumbs:function(n){var r=y.Children.map(n,function(i){var e=i;if(i.type!=="img"&&(e=y.Children.toArray(i.props.children).find(function(o){return o.type==="img"})),!!e)return e});return r.filter(function(i){return i}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):r},statusFormatter:$.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:Q.slideSwipeAnimationHandler,stopSwipingHandler:Q.slideStopSwipingHandler});var _t={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Carousel",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"CarouselProps",{enumerable:!0,get:function(){return r.CarouselProps}}),Object.defineProperty(t,"Thumbs",{enumerable:!0,get:function(){return i.default}});var n=e(ie),r=_t,i=e(q);function e(o){return o&&o.__esModule?o:{default:o}}})(Oe);const Pt=te.styled.div`
|
|
2
2
|
position: relative;
|
|
3
3
|
|
|
4
4
|
& .image-carousel {
|
|
@@ -67,9 +67,10 @@
|
|
|
67
67
|
@media (max-width: ${ne.MOBILE_SIZE_PX+"px"}) {
|
|
68
68
|
display: none;
|
|
69
69
|
}
|
|
70
|
-
`;const
|
|
70
|
+
`;const Ot=te.styled.div`
|
|
71
71
|
position: relative;
|
|
72
72
|
border-radius: 0.75rem;
|
|
73
|
+
cursor: pointer;
|
|
73
74
|
|
|
74
75
|
background: ${t=>re.isDefinedNotEmptyString(t==null?void 0:t.backgroundColor)?t==null?void 0:t.backgroundColor:`linear-gradient(
|
|
75
76
|
to top left,
|
|
@@ -100,13 +101,12 @@
|
|
|
100
101
|
|
|
101
102
|
@media (max-width: ${ne.MOBILE_SIZE_PX+"px"}) {
|
|
102
103
|
border-radius: unset;
|
|
103
|
-
cursor: pointer;
|
|
104
104
|
|
|
105
105
|
& img {
|
|
106
106
|
border-radius: unset;
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
`,
|
|
109
|
+
`,Rt=te.styled.div`
|
|
110
110
|
border-radius: 0.75rem;
|
|
111
111
|
position: absolute;
|
|
112
112
|
top: 0;
|
|
@@ -155,4 +155,4 @@
|
|
|
155
155
|
display: none;
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
-
`,Ie=N.forwardRef(({carouselItems:t=[],onSelectItem:n=()=>{},onButtonAction:r=()=>{}},i)=>
|
|
158
|
+
`,Ie=N.forwardRef(({carouselItems:t=[],onSelectItem:n=()=>{},onButtonAction:r=()=>{}},i)=>k.jsx(Pt,{ref:i,children:k.jsx(Oe.Carousel,{autoPlay:!0,infiniteLoop:!0,showArrows:!1,showStatus:!1,showThumbs:!1,transitionTime:500,onClickItem:e=>{n(t==null?void 0:t[e])},children:t&&(t==null?void 0:t.map((e,o)=>k.jsxs(Ot,{backgroundColor:e==null?void 0:e.backgroundColor,children:[k.jsx("img",{loading:"lazy",src:e.imageUrl}),k.jsx(Rt,{backgroundColor:e==null?void 0:e.backgroundColor,children:k.jsxs("div",{className:"banner-content",children:[k.jsxs("div",{className:"banner-text",children:[k.jsx("div",{className:"banner-title",children:e.title}),e.description]}),re.isDefinedNotEmptyString(e==null?void 0:e.buttonText)&&k.jsx(Le,{color:"neutral",className:"banner-action",onClick:a=>{a==null||a.stopPropagation(),r(e)},children:e.buttonText})]})})]},`banner-${o+1}`)))})}));Ie.propTypes={items:fe.PropTypes.array,handleClick:fe.PropTypes.func};module.exports=Ie;
|
|
@@ -3,13 +3,12 @@ import F, { forwardRef as Ce } from "react";
|
|
|
3
3
|
import { c as Oe } from "./_commonjsHelpers-DaMA6jEr.js";
|
|
4
4
|
import { p as Le, P as Se } from "./index-S5Cd7WrG.js";
|
|
5
5
|
import { a as ke } from "./index-Bq3leL2e.js";
|
|
6
|
-
import { u as De } from "./useDetectMobile-Bkvj0VMa.js";
|
|
7
6
|
import { s as te } from "./emotion-styled.browser.esm-BNN1dTl3.js";
|
|
8
7
|
import { M as ne } from "./consts-BuFChS64.js";
|
|
9
8
|
import { k as re } from "./utils-BbgAIA9N.js";
|
|
10
|
-
import
|
|
9
|
+
import De from "./Button.js";
|
|
11
10
|
var Re = {}, ie = {}, me = {}, fe = {}, ge;
|
|
12
|
-
function
|
|
11
|
+
function Ae() {
|
|
13
12
|
return ge || (ge = 1, function(t) {
|
|
14
13
|
(function(n, r) {
|
|
15
14
|
r(t, F, Le);
|
|
@@ -144,11 +143,11 @@ function We() {
|
|
|
144
143
|
if (this.moveStart) {
|
|
145
144
|
var g = ue(u), T = g.x, w = g.y, Y = T - this.moveStart.x, we = w - this.moveStart.y;
|
|
146
145
|
this.moving = !0;
|
|
147
|
-
var
|
|
146
|
+
var Me = this.props.onSwipeMove({
|
|
148
147
|
x: Y,
|
|
149
148
|
y: we
|
|
150
149
|
}, u);
|
|
151
|
-
|
|
150
|
+
Me && u.cancelable && u.preventDefault(), this.movePosition = { deltaX: Y, deltaY: we };
|
|
152
151
|
}
|
|
153
152
|
}
|
|
154
153
|
}, {
|
|
@@ -227,7 +226,7 @@ function We() {
|
|
|
227
226
|
}
|
|
228
227
|
(function(t) {
|
|
229
228
|
(function(n, r) {
|
|
230
|
-
r(t,
|
|
229
|
+
r(t, Ae());
|
|
231
230
|
})(Oe, function(n, r) {
|
|
232
231
|
Object.defineProperty(n, "__esModule", {
|
|
233
232
|
value: !0
|
|
@@ -246,16 +245,16 @@ Object.defineProperty(K, "__esModule", {
|
|
|
246
245
|
value: !0
|
|
247
246
|
});
|
|
248
247
|
K.default = void 0;
|
|
249
|
-
var D =
|
|
250
|
-
function
|
|
248
|
+
var D = We(ke);
|
|
249
|
+
function We(t) {
|
|
251
250
|
return t && t.__esModule ? t : { default: t };
|
|
252
251
|
}
|
|
253
|
-
function
|
|
252
|
+
function ze(t, n, r) {
|
|
254
253
|
return n in t ? Object.defineProperty(t, n, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[n] = r, t;
|
|
255
254
|
}
|
|
256
|
-
var
|
|
255
|
+
var Ne = {
|
|
257
256
|
ROOT: function(n) {
|
|
258
|
-
return (0, D.default)(
|
|
257
|
+
return (0, D.default)(ze({
|
|
259
258
|
"carousel-root": !0
|
|
260
259
|
}, n || "", !!n));
|
|
261
260
|
},
|
|
@@ -307,41 +306,41 @@ var xe = {
|
|
|
307
306
|
});
|
|
308
307
|
}
|
|
309
308
|
};
|
|
310
|
-
K.default =
|
|
309
|
+
K.default = Ne;
|
|
311
310
|
var j = {}, oe = {};
|
|
312
311
|
Object.defineProperty(oe, "__esModule", {
|
|
313
312
|
value: !0
|
|
314
313
|
});
|
|
315
314
|
oe.outerWidth = void 0;
|
|
316
|
-
var
|
|
315
|
+
var xe = function(n) {
|
|
317
316
|
var r = n.offsetWidth, i = getComputedStyle(n);
|
|
318
317
|
return r += parseInt(i.marginLeft) + parseInt(i.marginRight), r;
|
|
319
318
|
};
|
|
320
|
-
oe.outerWidth =
|
|
319
|
+
oe.outerWidth = xe;
|
|
321
320
|
var x = {};
|
|
322
321
|
Object.defineProperty(x, "__esModule", {
|
|
323
322
|
value: !0
|
|
324
323
|
});
|
|
325
324
|
x.default = void 0;
|
|
326
|
-
var
|
|
325
|
+
var He = function(n, r, i) {
|
|
327
326
|
var e = n === 0 ? n : n + r, o = i === "horizontal" ? [e, 0, 0] : [0, e, 0], a = "translate3d", s = "(" + o.join(",") + ")";
|
|
328
327
|
return a + s;
|
|
329
328
|
};
|
|
330
|
-
x.default =
|
|
329
|
+
x.default = He;
|
|
331
330
|
var q = {};
|
|
332
331
|
Object.defineProperty(q, "__esModule", {
|
|
333
332
|
value: !0
|
|
334
333
|
});
|
|
335
334
|
q.default = void 0;
|
|
336
|
-
var
|
|
335
|
+
var $e = function() {
|
|
337
336
|
return window;
|
|
338
337
|
};
|
|
339
|
-
q.default =
|
|
338
|
+
q.default = $e;
|
|
340
339
|
Object.defineProperty(j, "__esModule", {
|
|
341
340
|
value: !0
|
|
342
341
|
});
|
|
343
342
|
j.default = void 0;
|
|
344
|
-
var
|
|
343
|
+
var I = Ke(F), A = ae(K), Ue = oe, be = ae(x), Fe = ae(me), V = ae(q);
|
|
345
344
|
function ae(t) {
|
|
346
345
|
return t && t.__esModule ? t : { default: t };
|
|
347
346
|
}
|
|
@@ -352,7 +351,7 @@ function Ee() {
|
|
|
352
351
|
return t;
|
|
353
352
|
}, t;
|
|
354
353
|
}
|
|
355
|
-
function
|
|
354
|
+
function Ke(t) {
|
|
356
355
|
if (t && t.__esModule)
|
|
357
356
|
return t;
|
|
358
357
|
if (t === null || $(t) !== "object" && typeof t != "function")
|
|
@@ -386,20 +385,20 @@ function ce() {
|
|
|
386
385
|
return t;
|
|
387
386
|
}, ce.apply(this, arguments);
|
|
388
387
|
}
|
|
389
|
-
function
|
|
388
|
+
function je(t, n) {
|
|
390
389
|
if (!(t instanceof n))
|
|
391
390
|
throw new TypeError("Cannot call a class as a function");
|
|
392
391
|
}
|
|
393
|
-
function
|
|
392
|
+
function qe(t, n) {
|
|
394
393
|
for (var r = 0; r < n.length; r++) {
|
|
395
394
|
var i = n[r];
|
|
396
395
|
i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(t, i.key, i);
|
|
397
396
|
}
|
|
398
397
|
}
|
|
399
|
-
function
|
|
400
|
-
return n &&
|
|
398
|
+
function Be(t, n, r) {
|
|
399
|
+
return n && qe(t.prototype, n), t;
|
|
401
400
|
}
|
|
402
|
-
function
|
|
401
|
+
function Xe(t, n) {
|
|
403
402
|
if (typeof n != "function" && n !== null)
|
|
404
403
|
throw new TypeError("Super expression must either be null or a function");
|
|
405
404
|
t.prototype = Object.create(n && n.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), n && de(t, n);
|
|
@@ -409,8 +408,8 @@ function de(t, n) {
|
|
|
409
408
|
return i.__proto__ = e, i;
|
|
410
409
|
}, de(t, n);
|
|
411
410
|
}
|
|
412
|
-
function
|
|
413
|
-
var n =
|
|
411
|
+
function Ye(t) {
|
|
412
|
+
var n = Ge();
|
|
414
413
|
return function() {
|
|
415
414
|
var i = J(t), e;
|
|
416
415
|
if (n) {
|
|
@@ -418,10 +417,10 @@ function Ve(t) {
|
|
|
418
417
|
e = Reflect.construct(i, arguments, o);
|
|
419
418
|
} else
|
|
420
419
|
e = i.apply(this, arguments);
|
|
421
|
-
return
|
|
420
|
+
return Ve(this, e);
|
|
422
421
|
};
|
|
423
422
|
}
|
|
424
|
-
function
|
|
423
|
+
function Ve(t, n) {
|
|
425
424
|
return n && ($(n) === "object" || typeof n == "function") ? n : O(t);
|
|
426
425
|
}
|
|
427
426
|
function O(t) {
|
|
@@ -429,7 +428,7 @@ function O(t) {
|
|
|
429
428
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
430
429
|
return t;
|
|
431
430
|
}
|
|
432
|
-
function
|
|
431
|
+
function Ge() {
|
|
433
432
|
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
|
|
434
433
|
if (typeof Proxy == "function") return !0;
|
|
435
434
|
try {
|
|
@@ -447,14 +446,14 @@ function J(t) {
|
|
|
447
446
|
function P(t, n, r) {
|
|
448
447
|
return n in t ? Object.defineProperty(t, n, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[n] = r, t;
|
|
449
448
|
}
|
|
450
|
-
var
|
|
449
|
+
var Ze = function(n) {
|
|
451
450
|
return n.hasOwnProperty("key");
|
|
452
451
|
}, ve = /* @__PURE__ */ function(t) {
|
|
453
|
-
|
|
454
|
-
var n =
|
|
452
|
+
Xe(r, t);
|
|
453
|
+
var n = Ye(r);
|
|
455
454
|
function r(i) {
|
|
456
455
|
var e;
|
|
457
|
-
return
|
|
456
|
+
return je(this, r), e = n.call(this, i), P(O(e), "itemsWrapperRef", void 0), P(O(e), "itemsListRef", void 0), P(O(e), "thumbsRef", void 0), P(O(e), "setItemsWrapperRef", function(o) {
|
|
458
457
|
e.itemsWrapperRef = o;
|
|
459
458
|
}), P(O(e), "setItemsListRef", function(o) {
|
|
460
459
|
e.itemsListRef = o;
|
|
@@ -462,7 +461,7 @@ var Je = function(n) {
|
|
|
462
461
|
e.thumbsRef || (e.thumbsRef = []), e.thumbsRef[a] = o;
|
|
463
462
|
}), P(O(e), "updateSizes", function() {
|
|
464
463
|
if (!(!e.props.children || !e.itemsWrapperRef || !e.thumbsRef)) {
|
|
465
|
-
var o =
|
|
464
|
+
var o = I.Children.count(e.props.children), a = e.itemsWrapperRef.clientWidth, s = e.props.thumbWidth ? e.props.thumbWidth : (0, Ue.outerWidth)(e.thumbsRef[0]), f = Math.floor(a / s), h = f < o, m = h ? o - f : 0;
|
|
466
465
|
e.setState(function(v, _) {
|
|
467
466
|
return {
|
|
468
467
|
itemSize: s,
|
|
@@ -474,7 +473,7 @@ var Je = function(n) {
|
|
|
474
473
|
});
|
|
475
474
|
}
|
|
476
475
|
}), P(O(e), "handleClickItem", function(o, a, s) {
|
|
477
|
-
if (!
|
|
476
|
+
if (!Ze(s) || s.key === "Enter") {
|
|
478
477
|
var f = e.props.onSelectItem;
|
|
479
478
|
typeof f == "function" && f(o, a);
|
|
480
479
|
}
|
|
@@ -490,7 +489,7 @@ var Je = function(n) {
|
|
|
490
489
|
var a = o.x;
|
|
491
490
|
if (!e.state.itemSize || !e.itemsWrapperRef || !e.state.visibleItems)
|
|
492
491
|
return !1;
|
|
493
|
-
var s = 0, f =
|
|
492
|
+
var s = 0, f = I.Children.count(e.props.children), h = -(e.state.firstItem * 100) / e.state.visibleItems, m = Math.max(f - e.state.visibleItems, 0), v = -m * 100 / e.state.visibleItems;
|
|
494
493
|
h === s && a > 0 && (a = 0), h === v && a < 0 && (a = 0);
|
|
495
494
|
var _ = e.itemsWrapperRef.clientWidth, b = h + 100 / (_ / a);
|
|
496
495
|
return e.itemsListRef && ["WebkitTransform", "MozTransform", "MsTransform", "OTransform", "transform", "msTransform"].forEach(function(E) {
|
|
@@ -513,7 +512,7 @@ var Je = function(n) {
|
|
|
513
512
|
lastPosition: 0
|
|
514
513
|
}, e;
|
|
515
514
|
}
|
|
516
|
-
return
|
|
515
|
+
return Be(r, [{
|
|
517
516
|
key: "componentDidMount",
|
|
518
517
|
value: function() {
|
|
519
518
|
this.setupThumbs();
|
|
@@ -565,7 +564,7 @@ var Je = function(n) {
|
|
|
565
564
|
width: e.props.thumbWidth
|
|
566
565
|
}
|
|
567
566
|
};
|
|
568
|
-
return /* @__PURE__ */
|
|
567
|
+
return /* @__PURE__ */ I.default.createElement("li", ce({}, f, {
|
|
569
568
|
role: "button",
|
|
570
569
|
tabIndex: 0
|
|
571
570
|
}), o);
|
|
@@ -577,7 +576,7 @@ var Je = function(n) {
|
|
|
577
576
|
var e = this;
|
|
578
577
|
if (!this.props.children)
|
|
579
578
|
return null;
|
|
580
|
-
var o =
|
|
579
|
+
var o = I.Children.count(this.props.children) > 1, a = this.state.showArrows && this.state.firstItem > 0, s = this.state.showArrows && this.state.firstItem < this.state.lastPosition, f = {}, h = -this.state.firstItem * (this.state.itemSize || 0), m = (0, be.default)(h, "px", this.props.axis), v = this.props.transitionTime + "ms";
|
|
581
580
|
return f = {
|
|
582
581
|
WebkitTransform: m,
|
|
583
582
|
MozTransform: m,
|
|
@@ -591,19 +590,19 @@ var Je = function(n) {
|
|
|
591
590
|
OTransitionDuration: v,
|
|
592
591
|
transitionDuration: v,
|
|
593
592
|
msTransitionDuration: v
|
|
594
|
-
}, /* @__PURE__ */
|
|
593
|
+
}, /* @__PURE__ */ I.default.createElement("div", {
|
|
595
594
|
className: A.default.CAROUSEL(!1)
|
|
596
|
-
}, /* @__PURE__ */
|
|
595
|
+
}, /* @__PURE__ */ I.default.createElement("div", {
|
|
597
596
|
className: A.default.WRAPPER(!1),
|
|
598
597
|
ref: this.setItemsWrapperRef
|
|
599
|
-
}, /* @__PURE__ */
|
|
598
|
+
}, /* @__PURE__ */ I.default.createElement("button", {
|
|
600
599
|
type: "button",
|
|
601
600
|
className: A.default.ARROW_PREV(!a),
|
|
602
601
|
onClick: function() {
|
|
603
602
|
return e.slideRight();
|
|
604
603
|
},
|
|
605
604
|
"aria-label": this.props.labels.leftArrow
|
|
606
|
-
}), o ? /* @__PURE__ */
|
|
605
|
+
}), o ? /* @__PURE__ */ I.default.createElement(Fe.default, {
|
|
607
606
|
tagName: "ul",
|
|
608
607
|
className: A.default.SLIDER(!1, this.state.swiping),
|
|
609
608
|
onSwipeLeft: this.slideLeft,
|
|
@@ -614,13 +613,13 @@ var Je = function(n) {
|
|
|
614
613
|
style: f,
|
|
615
614
|
innerRef: this.setItemsListRef,
|
|
616
615
|
allowMouseEvents: this.props.emulateTouch
|
|
617
|
-
}, this.renderItems()) : /* @__PURE__ */
|
|
616
|
+
}, this.renderItems()) : /* @__PURE__ */ I.default.createElement("ul", {
|
|
618
617
|
className: A.default.SLIDER(!1, this.state.swiping),
|
|
619
618
|
ref: function(b) {
|
|
620
619
|
return e.setItemsListRef(b);
|
|
621
620
|
},
|
|
622
621
|
style: f
|
|
623
|
-
}, this.renderItems()), /* @__PURE__ */
|
|
622
|
+
}, this.renderItems()), /* @__PURE__ */ I.default.createElement("button", {
|
|
624
623
|
type: "button",
|
|
625
624
|
className: A.default.ARROW_NEXT(!s),
|
|
626
625
|
onClick: function() {
|
|
@@ -630,7 +629,7 @@ var Je = function(n) {
|
|
|
630
629
|
})));
|
|
631
630
|
}
|
|
632
631
|
}]), r;
|
|
633
|
-
}(
|
|
632
|
+
}(I.Component);
|
|
634
633
|
j.default = ve;
|
|
635
634
|
P(ve, "displayName", "Thumbs");
|
|
636
635
|
P(ve, "defaultProps", {
|
|
@@ -649,55 +648,55 @@ Object.defineProperty(se, "__esModule", {
|
|
|
649
648
|
value: !0
|
|
650
649
|
});
|
|
651
650
|
se.default = void 0;
|
|
652
|
-
var
|
|
651
|
+
var Je = function() {
|
|
653
652
|
return document;
|
|
654
653
|
};
|
|
655
|
-
se.default =
|
|
654
|
+
se.default = Je;
|
|
656
655
|
var R = {};
|
|
657
656
|
Object.defineProperty(R, "__esModule", {
|
|
658
657
|
value: !0
|
|
659
658
|
});
|
|
660
659
|
R.setPosition = R.getPosition = R.isKeyboardEvent = R.defaultStatusFormatter = R.noop = void 0;
|
|
661
|
-
var
|
|
662
|
-
function
|
|
660
|
+
var Qe = F, et = tt(x);
|
|
661
|
+
function tt(t) {
|
|
663
662
|
return t && t.__esModule ? t : { default: t };
|
|
664
663
|
}
|
|
665
|
-
var
|
|
664
|
+
var nt = function() {
|
|
666
665
|
};
|
|
667
|
-
R.noop =
|
|
668
|
-
var
|
|
666
|
+
R.noop = nt;
|
|
667
|
+
var rt = function(n, r) {
|
|
669
668
|
return "".concat(n, " of ").concat(r);
|
|
670
669
|
};
|
|
671
|
-
R.defaultStatusFormatter =
|
|
672
|
-
var
|
|
670
|
+
R.defaultStatusFormatter = rt;
|
|
671
|
+
var it = function(n) {
|
|
673
672
|
return n ? n.hasOwnProperty("key") : !1;
|
|
674
673
|
};
|
|
675
|
-
R.isKeyboardEvent =
|
|
676
|
-
var
|
|
674
|
+
R.isKeyboardEvent = it;
|
|
675
|
+
var ot = function(n, r) {
|
|
677
676
|
if (r.infiniteLoop && ++n, n === 0)
|
|
678
677
|
return 0;
|
|
679
|
-
var i =
|
|
678
|
+
var i = Qe.Children.count(r.children);
|
|
680
679
|
if (r.centerMode && r.axis === "horizontal") {
|
|
681
680
|
var e = -n * r.centerSlidePercentage, o = i - 1;
|
|
682
681
|
return n && (n !== o || r.infiniteLoop) ? e += (100 - r.centerSlidePercentage) / 2 : n === o && (e += 100 - r.centerSlidePercentage), e;
|
|
683
682
|
}
|
|
684
683
|
return -n * 100;
|
|
685
684
|
};
|
|
686
|
-
R.getPosition =
|
|
687
|
-
var
|
|
685
|
+
R.getPosition = ot;
|
|
686
|
+
var at = function(n, r) {
|
|
688
687
|
var i = {};
|
|
689
688
|
return ["WebkitTransform", "MozTransform", "MsTransform", "OTransform", "transform", "msTransform"].forEach(function(e) {
|
|
690
|
-
i[e] = (0,
|
|
689
|
+
i[e] = (0, et.default)(n, "%", r);
|
|
691
690
|
}), i;
|
|
692
691
|
};
|
|
693
|
-
R.setPosition =
|
|
692
|
+
R.setPosition = at;
|
|
694
693
|
var C = {};
|
|
695
694
|
Object.defineProperty(C, "__esModule", {
|
|
696
695
|
value: !0
|
|
697
696
|
});
|
|
698
697
|
C.fadeAnimationHandler = C.slideStopSwipingHandler = C.slideSwipeAnimationHandler = C.slideAnimationHandler = void 0;
|
|
699
|
-
var Te = F,
|
|
700
|
-
function
|
|
698
|
+
var Te = F, st = ut(x), L = R;
|
|
699
|
+
function ut(t) {
|
|
701
700
|
return t && t.__esModule ? t : { default: t };
|
|
702
701
|
}
|
|
703
702
|
function _e(t, n) {
|
|
@@ -714,21 +713,21 @@ function W(t) {
|
|
|
714
713
|
for (var n = 1; n < arguments.length; n++) {
|
|
715
714
|
var r = arguments[n] != null ? arguments[n] : {};
|
|
716
715
|
n % 2 ? _e(Object(r), !0).forEach(function(i) {
|
|
717
|
-
|
|
716
|
+
lt(t, i, r[i]);
|
|
718
717
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : _e(Object(r)).forEach(function(i) {
|
|
719
718
|
Object.defineProperty(t, i, Object.getOwnPropertyDescriptor(r, i));
|
|
720
719
|
});
|
|
721
720
|
}
|
|
722
721
|
return t;
|
|
723
722
|
}
|
|
724
|
-
function
|
|
723
|
+
function lt(t, n, r) {
|
|
725
724
|
return n in t ? Object.defineProperty(t, n, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[n] = r, t;
|
|
726
725
|
}
|
|
727
|
-
var
|
|
726
|
+
var ft = function(n, r) {
|
|
728
727
|
var i = {}, e = r.selectedItem, o = e, a = Te.Children.count(n.children) - 1, s = n.infiniteLoop && (e < 0 || e > a);
|
|
729
728
|
if (s)
|
|
730
729
|
return o < 0 ? n.centerMode && n.centerSlidePercentage && n.axis === "horizontal" ? i.itemListStyle = (0, L.setPosition)(-(a + 2) * n.centerSlidePercentage - (100 - n.centerSlidePercentage) / 2, n.axis) : i.itemListStyle = (0, L.setPosition)(-(a + 2) * 100, n.axis) : o > a && (i.itemListStyle = (0, L.setPosition)(0, n.axis)), i;
|
|
731
|
-
var f = (0, L.getPosition)(e, n), h = (0,
|
|
730
|
+
var f = (0, L.getPosition)(e, n), h = (0, st.default)(f, "%", n.axis), m = n.transitionTime + "ms";
|
|
732
731
|
return i.itemListStyle = {
|
|
733
732
|
WebkitTransform: h,
|
|
734
733
|
msTransform: h,
|
|
@@ -742,8 +741,8 @@ var ct = function(n, r) {
|
|
|
742
741
|
msTransitionDuration: m
|
|
743
742
|
})), i;
|
|
744
743
|
};
|
|
745
|
-
C.slideAnimationHandler =
|
|
746
|
-
var
|
|
744
|
+
C.slideAnimationHandler = ft;
|
|
745
|
+
var ct = function(n, r, i, e) {
|
|
747
746
|
var o = {}, a = r.axis === "horizontal", s = Te.Children.count(r.children), f = 0, h = (0, L.getPosition)(i.selectedItem, r), m = r.infiniteLoop ? (0, L.getPosition)(s - 1, r) - 100 : (0, L.getPosition)(s - 1, r), v = a ? n.x : n.y, _ = v;
|
|
748
747
|
h === f && v > 0 && (_ = 0), h === m && v < 0 && (_ = 0);
|
|
749
748
|
var b = h + 100 / (i.itemSize / _), E = Math.abs(v) > r.swipeScrollTolerance;
|
|
@@ -753,15 +752,15 @@ var dt = function(n, r, i, e) {
|
|
|
753
752
|
cancelClick: !0
|
|
754
753
|
}), o;
|
|
755
754
|
};
|
|
756
|
-
C.slideSwipeAnimationHandler =
|
|
757
|
-
var
|
|
755
|
+
C.slideSwipeAnimationHandler = ct;
|
|
756
|
+
var dt = function(n, r) {
|
|
758
757
|
var i = (0, L.getPosition)(r.selectedItem, n), e = (0, L.setPosition)(i, n.axis);
|
|
759
758
|
return {
|
|
760
759
|
itemListStyle: e
|
|
761
760
|
};
|
|
762
761
|
};
|
|
763
|
-
C.slideStopSwipingHandler =
|
|
764
|
-
var
|
|
762
|
+
C.slideStopSwipingHandler = dt;
|
|
763
|
+
var pt = function(n, r) {
|
|
765
764
|
var i = n.transitionTime + "ms", e = "ease-in-out", o = {
|
|
766
765
|
position: "absolute",
|
|
767
766
|
display: "block",
|
|
@@ -793,28 +792,28 @@ var ht = function(n, r) {
|
|
|
793
792
|
prevStyle: W({}, o)
|
|
794
793
|
};
|
|
795
794
|
};
|
|
796
|
-
C.fadeAnimationHandler =
|
|
795
|
+
C.fadeAnimationHandler = pt;
|
|
797
796
|
Object.defineProperty(ie, "__esModule", {
|
|
798
797
|
value: !0
|
|
799
798
|
});
|
|
800
799
|
ie.default = void 0;
|
|
801
|
-
var y =
|
|
800
|
+
var y = vt(F), ht = B(me), k = B(K), mt = B(j), G = B(se), Z = B(q), H = R, Q = C;
|
|
802
801
|
function B(t) {
|
|
803
802
|
return t && t.__esModule ? t : { default: t };
|
|
804
803
|
}
|
|
805
|
-
function
|
|
804
|
+
function Ie() {
|
|
806
805
|
if (typeof WeakMap != "function") return null;
|
|
807
806
|
var t = /* @__PURE__ */ new WeakMap();
|
|
808
|
-
return
|
|
807
|
+
return Ie = function() {
|
|
809
808
|
return t;
|
|
810
809
|
}, t;
|
|
811
810
|
}
|
|
812
|
-
function
|
|
811
|
+
function vt(t) {
|
|
813
812
|
if (t && t.__esModule)
|
|
814
813
|
return t;
|
|
815
814
|
if (t === null || U(t) !== "object" && typeof t != "function")
|
|
816
815
|
return { default: t };
|
|
817
|
-
var n =
|
|
816
|
+
var n = Ie();
|
|
818
817
|
if (n && n.has(t))
|
|
819
818
|
return n.get(t);
|
|
820
819
|
var r = {}, i = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
@@ -853,7 +852,7 @@ function Pe(t, n) {
|
|
|
853
852
|
}
|
|
854
853
|
return r;
|
|
855
854
|
}
|
|
856
|
-
function
|
|
855
|
+
function M(t) {
|
|
857
856
|
for (var n = 1; n < arguments.length; n++) {
|
|
858
857
|
var r = arguments[n] != null ? arguments[n] : {};
|
|
859
858
|
n % 2 ? Pe(Object(r), !0).forEach(function(i) {
|
|
@@ -864,20 +863,20 @@ function I(t) {
|
|
|
864
863
|
}
|
|
865
864
|
return t;
|
|
866
865
|
}
|
|
867
|
-
function
|
|
866
|
+
function yt(t, n) {
|
|
868
867
|
if (!(t instanceof n))
|
|
869
868
|
throw new TypeError("Cannot call a class as a function");
|
|
870
869
|
}
|
|
871
|
-
function
|
|
870
|
+
function wt(t, n) {
|
|
872
871
|
for (var r = 0; r < n.length; r++) {
|
|
873
872
|
var i = n[r];
|
|
874
873
|
i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(t, i.key, i);
|
|
875
874
|
}
|
|
876
875
|
}
|
|
877
|
-
function
|
|
878
|
-
return n &&
|
|
876
|
+
function St(t, n, r) {
|
|
877
|
+
return n && wt(t.prototype, n), t;
|
|
879
878
|
}
|
|
880
|
-
function
|
|
879
|
+
function gt(t, n) {
|
|
881
880
|
if (typeof n != "function" && n !== null)
|
|
882
881
|
throw new TypeError("Super expression must either be null or a function");
|
|
883
882
|
t.prototype = Object.create(n && n.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), n && he(t, n);
|
|
@@ -887,8 +886,8 @@ function he(t, n) {
|
|
|
887
886
|
return i.__proto__ = e, i;
|
|
888
887
|
}, he(t, n);
|
|
889
888
|
}
|
|
890
|
-
function
|
|
891
|
-
var n =
|
|
889
|
+
function bt(t) {
|
|
890
|
+
var n = Pt();
|
|
892
891
|
return function() {
|
|
893
892
|
var i = ee(t), e;
|
|
894
893
|
if (n) {
|
|
@@ -896,10 +895,10 @@ function _t(t) {
|
|
|
896
895
|
e = Reflect.construct(i, arguments, o);
|
|
897
896
|
} else
|
|
898
897
|
e = i.apply(this, arguments);
|
|
899
|
-
return
|
|
898
|
+
return _t(this, e);
|
|
900
899
|
};
|
|
901
900
|
}
|
|
902
|
-
function
|
|
901
|
+
function _t(t, n) {
|
|
903
902
|
return n && (U(n) === "object" || typeof n == "function") ? n : d(t);
|
|
904
903
|
}
|
|
905
904
|
function d(t) {
|
|
@@ -907,7 +906,7 @@ function d(t) {
|
|
|
907
906
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
908
907
|
return t;
|
|
909
908
|
}
|
|
910
|
-
function
|
|
909
|
+
function Pt() {
|
|
911
910
|
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
|
|
912
911
|
if (typeof Proxy == "function") return !0;
|
|
913
912
|
try {
|
|
@@ -926,11 +925,11 @@ function c(t, n, r) {
|
|
|
926
925
|
return n in t ? Object.defineProperty(t, n, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[n] = r, t;
|
|
927
926
|
}
|
|
928
927
|
var ye = /* @__PURE__ */ function(t) {
|
|
929
|
-
|
|
930
|
-
var n =
|
|
928
|
+
gt(r, t);
|
|
929
|
+
var n = bt(r);
|
|
931
930
|
function r(i) {
|
|
932
931
|
var e;
|
|
933
|
-
|
|
932
|
+
yt(this, r), e = n.call(this, i), c(d(e), "thumbsRef", void 0), c(d(e), "carouselWrapperRef", void 0), c(d(e), "listRef", void 0), c(d(e), "itemsRef", void 0), c(d(e), "timer", void 0), c(d(e), "animationHandler", void 0), c(d(e), "setThumbsRef", function(a) {
|
|
934
933
|
e.thumbsRef = a;
|
|
935
934
|
}), c(d(e), "setCarouselWrapperRef", function(a) {
|
|
936
935
|
e.carouselWrapperRef = a;
|
|
@@ -1009,7 +1008,7 @@ var ye = /* @__PURE__ */ function(t) {
|
|
|
1009
1008
|
}), c(d(e), "onSwipeMove", function(a, s) {
|
|
1010
1009
|
e.props.onSwipeMove(s);
|
|
1011
1010
|
var f = e.props.swipeAnimationHandler(a, e.props, e.state, e.setState.bind(d(e)));
|
|
1012
|
-
return e.setState(
|
|
1011
|
+
return e.setState(M({}, f)), !!Object.keys(f).length;
|
|
1013
1012
|
}), c(d(e), "decrement", function() {
|
|
1014
1013
|
var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1;
|
|
1015
1014
|
e.moveTo(e.state.selectedItem - (typeof a == "number" ? a : 1));
|
|
@@ -1041,7 +1040,7 @@ var ye = /* @__PURE__ */ function(t) {
|
|
|
1041
1040
|
(!(0, H.isKeyboardEvent)(s) || s.key === "Enter") && e.moveTo(a);
|
|
1042
1041
|
};
|
|
1043
1042
|
}), c(d(e), "selectItem", function(a) {
|
|
1044
|
-
e.setState(
|
|
1043
|
+
e.setState(M({
|
|
1045
1044
|
previousItem: e.state.selectedItem
|
|
1046
1045
|
}, a), function() {
|
|
1047
1046
|
e.setState(e.animationHandler(e.props, e.state));
|
|
@@ -1083,9 +1082,9 @@ var ye = /* @__PURE__ */ function(t) {
|
|
|
1083
1082
|
selectedStyle: {},
|
|
1084
1083
|
prevStyle: {}
|
|
1085
1084
|
};
|
|
1086
|
-
return e.animationHandler = typeof i.animationHandler == "function" && i.animationHandler || i.animationHandler === "fade" && Q.fadeAnimationHandler || Q.slideAnimationHandler, e.state =
|
|
1085
|
+
return e.animationHandler = typeof i.animationHandler == "function" && i.animationHandler || i.animationHandler === "fade" && Q.fadeAnimationHandler || Q.slideAnimationHandler, e.state = M(M({}, o), e.animationHandler(i, o)), e;
|
|
1087
1086
|
}
|
|
1088
|
-
return
|
|
1087
|
+
return St(r, [{
|
|
1089
1088
|
key: "componentDidMount",
|
|
1090
1089
|
value: function() {
|
|
1091
1090
|
this.props.children && this.setupCarousel();
|
|
@@ -1093,7 +1092,7 @@ var ye = /* @__PURE__ */ function(t) {
|
|
|
1093
1092
|
}, {
|
|
1094
1093
|
key: "componentDidUpdate",
|
|
1095
1094
|
value: function(e, o) {
|
|
1096
|
-
!e.children && this.props.children && !this.state.initialized && this.setupCarousel(), !e.autoFocus && this.props.autoFocus && this.forceFocus(), o.swiping && !this.state.swiping && this.setState(
|
|
1095
|
+
!e.children && this.props.children && !this.state.initialized && this.setupCarousel(), !e.autoFocus && this.props.autoFocus && this.forceFocus(), o.swiping && !this.state.swiping && this.setState(M({}, this.props.stopSwipingHandler(this.props, this.state))), (e.selectedItem !== this.props.selectedItem || e.centerMode !== this.props.centerMode) && (this.updateSizes(), this.moveTo(this.props.selectedItem)), e.autoPlay !== this.props.autoPlay && (this.props.autoPlay ? this.setupAutoPlay() : this.destroyAutoPlay(), this.setState({
|
|
1097
1096
|
autoPlay: this.props.autoPlay
|
|
1098
1097
|
}));
|
|
1099
1098
|
}
|
|
@@ -1156,9 +1155,9 @@ var ye = /* @__PURE__ */ function(t) {
|
|
|
1156
1155
|
var o = this;
|
|
1157
1156
|
return this.props.children ? y.Children.map(this.props.children, function(a, s) {
|
|
1158
1157
|
var f = s === o.state.selectedItem, h = s === o.state.previousItem, m = f && o.state.selectedStyle || h && o.state.prevStyle || o.state.slideStyle || {};
|
|
1159
|
-
o.props.centerMode && o.props.axis === "horizontal" && (m =
|
|
1158
|
+
o.props.centerMode && o.props.axis === "horizontal" && (m = M(M({}, m), {}, {
|
|
1160
1159
|
minWidth: o.props.centerSlidePercentage + "%"
|
|
1161
|
-
})), o.state.swiping && o.state.swipeMovementStarted && (m =
|
|
1160
|
+
})), o.state.swiping && o.state.swipeMovementStarted && (m = M(M({}, m), {}, {
|
|
1162
1161
|
pointerEvents: "none"
|
|
1163
1162
|
}));
|
|
1164
1163
|
var v = {
|
|
@@ -1196,7 +1195,7 @@ var ye = /* @__PURE__ */ function(t) {
|
|
|
1196
1195
|
}, {
|
|
1197
1196
|
key: "renderThumbs",
|
|
1198
1197
|
value: function() {
|
|
1199
|
-
return !this.props.showThumbs || !this.props.children || y.Children.count(this.props.children) === 0 ? null : /* @__PURE__ */ y.default.createElement(
|
|
1198
|
+
return !this.props.showThumbs || !this.props.children || y.Children.count(this.props.children) === 0 ? null : /* @__PURE__ */ y.default.createElement(mt.default, {
|
|
1200
1199
|
ref: this.setThumbsRef,
|
|
1201
1200
|
onSelectItem: this.handleClickThumb,
|
|
1202
1201
|
selectedItem: this.state.selectedItem,
|
|
@@ -1226,7 +1225,7 @@ var ye = /* @__PURE__ */ function(t) {
|
|
|
1226
1225
|
E.height = X || "auto";
|
|
1227
1226
|
}
|
|
1228
1227
|
} else
|
|
1229
|
-
b.onSwipeUp = this.props.verticalSwipe === "natural" ? this.onSwipeBackwards : this.onSwipeForward, b.onSwipeDown = this.props.verticalSwipe === "natural" ? this.onSwipeForward : this.onSwipeBackwards, b.style =
|
|
1228
|
+
b.onSwipeUp = this.props.verticalSwipe === "natural" ? this.onSwipeBackwards : this.onSwipeForward, b.onSwipeDown = this.props.verticalSwipe === "natural" ? this.onSwipeForward : this.onSwipeBackwards, b.style = M(M({}, b.style), {}, {
|
|
1230
1229
|
height: this.state.itemSize
|
|
1231
1230
|
}), E.height = this.state.itemSize;
|
|
1232
1231
|
return /* @__PURE__ */ y.default.createElement("div", {
|
|
@@ -1242,7 +1241,7 @@ var ye = /* @__PURE__ */ function(t) {
|
|
|
1242
1241
|
}, this.renderControls(), this.props.renderArrowPrev(this.onClickPrev, f, this.props.labels.leftArrow), /* @__PURE__ */ y.default.createElement("div", {
|
|
1243
1242
|
className: k.default.WRAPPER(!0, this.props.axis),
|
|
1244
1243
|
style: E
|
|
1245
|
-
}, o ? /* @__PURE__ */ y.default.createElement(
|
|
1244
|
+
}, o ? /* @__PURE__ */ y.default.createElement(ht.default, pe({
|
|
1246
1245
|
tagName: "ul",
|
|
1247
1246
|
innerRef: this.setListRef
|
|
1248
1247
|
}, b, {
|
|
@@ -1339,7 +1338,7 @@ c(ye, "defaultProps", {
|
|
|
1339
1338
|
swipeAnimationHandler: Q.slideSwipeAnimationHandler,
|
|
1340
1339
|
stopSwipingHandler: Q.slideStopSwipingHandler
|
|
1341
1340
|
});
|
|
1342
|
-
var
|
|
1341
|
+
var Ot = {};
|
|
1343
1342
|
(function(t) {
|
|
1344
1343
|
Object.defineProperty(t, "__esModule", {
|
|
1345
1344
|
value: !0
|
|
@@ -1359,12 +1358,12 @@ var Rt = {};
|
|
|
1359
1358
|
return i.default;
|
|
1360
1359
|
}
|
|
1361
1360
|
});
|
|
1362
|
-
var n = e(ie), r =
|
|
1361
|
+
var n = e(ie), r = Ot, i = e(j);
|
|
1363
1362
|
function e(o) {
|
|
1364
1363
|
return o && o.__esModule ? o : { default: o };
|
|
1365
1364
|
}
|
|
1366
1365
|
})(Re);
|
|
1367
|
-
const
|
|
1366
|
+
const Rt = te.div`
|
|
1368
1367
|
position: relative;
|
|
1369
1368
|
|
|
1370
1369
|
& .image-carousel {
|
|
@@ -1435,9 +1434,10 @@ te.div`
|
|
|
1435
1434
|
display: none;
|
|
1436
1435
|
}
|
|
1437
1436
|
`;
|
|
1438
|
-
const
|
|
1437
|
+
const Et = te.div`
|
|
1439
1438
|
position: relative;
|
|
1440
1439
|
border-radius: 0.75rem;
|
|
1440
|
+
cursor: pointer;
|
|
1441
1441
|
|
|
1442
1442
|
background: ${(t) => re(t == null ? void 0 : t.backgroundColor) ? t == null ? void 0 : t.backgroundColor : `linear-gradient(
|
|
1443
1443
|
to top left,
|
|
@@ -1468,13 +1468,12 @@ const Tt = te.div`
|
|
|
1468
1468
|
|
|
1469
1469
|
@media (max-width: ${ne + "px"}) {
|
|
1470
1470
|
border-radius: unset;
|
|
1471
|
-
cursor: pointer;
|
|
1472
1471
|
|
|
1473
1472
|
& img {
|
|
1474
1473
|
border-radius: unset;
|
|
1475
1474
|
}
|
|
1476
1475
|
}
|
|
1477
|
-
`,
|
|
1476
|
+
`, Tt = te.div`
|
|
1478
1477
|
border-radius: 0.75rem;
|
|
1479
1478
|
position: absolute;
|
|
1480
1479
|
top: 0;
|
|
@@ -1526,51 +1525,47 @@ const Tt = te.div`
|
|
|
1526
1525
|
`, It = Ce(
|
|
1527
1526
|
({ carouselItems: t = [], onSelectItem: n = () => {
|
|
1528
1527
|
}, onButtonAction: r = () => {
|
|
1529
|
-
} }, i) => {
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1528
|
+
} }, i) => /* @__PURE__ */ N(Rt, { ref: i, children: /* @__PURE__ */ N(
|
|
1529
|
+
Re.Carousel,
|
|
1530
|
+
{
|
|
1531
|
+
autoPlay: !0,
|
|
1532
|
+
infiniteLoop: !0,
|
|
1533
|
+
showArrows: !1,
|
|
1534
|
+
showStatus: !1,
|
|
1535
|
+
showThumbs: !1,
|
|
1536
|
+
transitionTime: 500,
|
|
1537
|
+
onClickItem: (e) => {
|
|
1538
|
+
n(t == null ? void 0 : t[e]);
|
|
1539
|
+
},
|
|
1540
|
+
children: t && (t == null ? void 0 : t.map((e, o) => /* @__PURE__ */ le(
|
|
1541
|
+
Et,
|
|
1542
|
+
{
|
|
1543
|
+
backgroundColor: e == null ? void 0 : e.backgroundColor,
|
|
1544
|
+
children: [
|
|
1545
|
+
/* @__PURE__ */ N("img", { loading: "lazy", src: e.imageUrl }),
|
|
1546
|
+
/* @__PURE__ */ N(Tt, { backgroundColor: e == null ? void 0 : e.backgroundColor, children: /* @__PURE__ */ le("div", { className: "banner-content", children: [
|
|
1547
|
+
/* @__PURE__ */ le("div", { className: "banner-text", children: [
|
|
1548
|
+
/* @__PURE__ */ N("div", { className: "banner-title", children: e.title }),
|
|
1549
|
+
e.description
|
|
1550
|
+
] }),
|
|
1551
|
+
re(e == null ? void 0 : e.buttonText) && /* @__PURE__ */ N(
|
|
1552
|
+
De,
|
|
1553
|
+
{
|
|
1554
|
+
color: "neutral",
|
|
1555
|
+
className: "banner-action",
|
|
1556
|
+
onClick: (a) => {
|
|
1557
|
+
a == null || a.stopPropagation(), r(e);
|
|
1558
|
+
},
|
|
1559
|
+
children: e.buttonText
|
|
1560
|
+
}
|
|
1561
|
+
)
|
|
1562
|
+
] }) })
|
|
1563
|
+
]
|
|
1542
1564
|
},
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
children: [
|
|
1548
|
-
/* @__PURE__ */ N("img", { loading: "lazy", src: o.imageUrl }),
|
|
1549
|
-
/* @__PURE__ */ N(Mt, { backgroundColor: o == null ? void 0 : o.backgroundColor, children: /* @__PURE__ */ le("div", { className: "banner-content", children: [
|
|
1550
|
-
/* @__PURE__ */ le("div", { className: "banner-text", children: [
|
|
1551
|
-
/* @__PURE__ */ N("div", { className: "banner-title", children: o.title }),
|
|
1552
|
-
o.description
|
|
1553
|
-
] }),
|
|
1554
|
-
re(o == null ? void 0 : o.buttonText) && /* @__PURE__ */ N(
|
|
1555
|
-
Ae,
|
|
1556
|
-
{
|
|
1557
|
-
color: "neutral",
|
|
1558
|
-
className: "banner-action",
|
|
1559
|
-
onClick: (s) => {
|
|
1560
|
-
var f;
|
|
1561
|
-
(f = s == null ? void 0 : s.target) == null || f.blur(), r(o);
|
|
1562
|
-
},
|
|
1563
|
-
children: o.buttonText
|
|
1564
|
-
}
|
|
1565
|
-
)
|
|
1566
|
-
] }) })
|
|
1567
|
-
]
|
|
1568
|
-
},
|
|
1569
|
-
`banner-${a + 1}`
|
|
1570
|
-
)))
|
|
1571
|
-
}
|
|
1572
|
-
) });
|
|
1573
|
-
}
|
|
1565
|
+
`banner-${o + 1}`
|
|
1566
|
+
)))
|
|
1567
|
+
}
|
|
1568
|
+
) })
|
|
1574
1569
|
);
|
|
1575
1570
|
It.propTypes = {
|
|
1576
1571
|
items: Se.array,
|
|
@@ -26,4 +26,4 @@
|
|
|
26
26
|
/* Safari and Chrome */
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
`,S=s.memo(h.DetailedProductCard),R=s.forwardRef((r,f)=>{const{icon:a,title:
|
|
29
|
+
`,S=s.memo(h.DetailedProductCard),R=s.forwardRef((r,f)=>{const{icon:a,title:j,buttonLink:c,items:t,buttonText:w,limit:o=4,gap:C,onSelectCard:u=()=>{},onButtonAction:P=()=>{},isLoading:N=!1,getImage:d=()=>{},negotiableText:m,freeText:g,options:l,onSelectOption:p=()=>{},productsToolbarName:q="All"}=r,b=M.useDetectMobile(),k=s.useMemo(()=>i.jsx(i.Fragment,{children:b===!0?t==null?void 0:t.map((e,n)=>i.jsx(S,{title:e==null?void 0:e.name,price:e==null?void 0:e.price,sellingPrice:e==null?void 0:e.sellingPrice,currency:e==null?void 0:e.currency,image:e==null?void 0:e.image,sellerUuid:e==null?void 0:e.sellerUuid,uuid:e==null?void 0:e.uuid,isSponsored:e==null?void 0:e.isSponsored,imageComponent:e==null?void 0:e.imageComponent,onSelectCard:()=>u(e==null?void 0:e.uuid),imageUrl:d(e==null?void 0:e.image,e==null?void 0:e.uuid,e==null?void 0:e.sellerUuid)||null,isFree:e==null?void 0:e.isFree,isNegotiable:e==null?void 0:e.isNegotiable,negotiableText:m,freeText:g},n)):t==null?void 0:t.slice(0,o).map((e,n)=>i.jsx(S,{title:e==null?void 0:e.name,price:e==null?void 0:e.price,sellingPrice:e==null?void 0:e.sellingPrice,currency:e==null?void 0:e.currency,image:e==null?void 0:e.image,sellerUuid:e==null?void 0:e.sellerUuid,uuid:e==null?void 0:e.uuid,location:e==null?void 0:e.location,isSponsored:e==null?void 0:e.isSponsored,imageComponent:e==null?void 0:e.imageComponent,onSelectCard:()=>u(e==null?void 0:e.uuid),imageUrl:d(e==null?void 0:e.image,e==null?void 0:e.uuid,e==null?void 0:e.sellerUuid)||null,isFree:e==null?void 0:e.isFree,isNegotiable:e==null?void 0:e.isNegotiable,negotiableText:m,freeText:g},n))}),[t,b,o]);return i.jsxs(F.TitleWithOptionsSectionWrapper,{ref:f,children:[i.jsxs("div",{className:"regular-title",children:[i.jsxs("div",{className:"regular-title-text",children:[y.isDefinedNotEmptyString(a)&&i.jsx("i",{className:a}),i.jsx("span",{children:j})]}),y.isDefinedNotEmptyString(c)&&i.jsx(U,{type:"button",btnType:"tinted",color:"gray",onClick:e=>{var n;(n=e==null?void 0:e.target)==null||n.blur(),P(c)},borderRadius:"curved",className:"button-link",children:w})]}),(l==null?void 0:l.length)>0&&i.jsx(T.SelectBar,{items:l,onRemove:e=>{p(e)},onSelect:e=>{p(e)},labelKey:"name",valueKey:"code",noMargin:!0,productsToolbarName:q}),i.jsx(E,{limit:o,gap:C,children:i.jsx(h.SuspenseDetailedProductCard,{isLoading:N,limit:o,keyPrefix:"explore-landing",children:k})})]})});module.exports=R;
|
|
@@ -42,15 +42,15 @@ const W = F.div`
|
|
|
42
42
|
title: h,
|
|
43
43
|
buttonLink: d,
|
|
44
44
|
items: o,
|
|
45
|
-
buttonText:
|
|
45
|
+
buttonText: w,
|
|
46
46
|
limit: l = 4,
|
|
47
|
-
gap:
|
|
48
|
-
onSelectCard:
|
|
47
|
+
gap: C,
|
|
48
|
+
onSelectCard: c = () => {
|
|
49
49
|
},
|
|
50
50
|
onButtonAction: P = () => {
|
|
51
51
|
},
|
|
52
52
|
isLoading: k = !1,
|
|
53
|
-
getImage:
|
|
53
|
+
getImage: m = () => {
|
|
54
54
|
},
|
|
55
55
|
negotiableText: u,
|
|
56
56
|
freeText: p,
|
|
@@ -70,8 +70,8 @@ const W = F.div`
|
|
|
70
70
|
uuid: e == null ? void 0 : e.uuid,
|
|
71
71
|
isSponsored: e == null ? void 0 : e.isSponsored,
|
|
72
72
|
imageComponent: e == null ? void 0 : e.imageComponent,
|
|
73
|
-
onSelectCard: () =>
|
|
74
|
-
imageUrl:
|
|
73
|
+
onSelectCard: () => c(e == null ? void 0 : e.uuid),
|
|
74
|
+
imageUrl: m(e == null ? void 0 : e.image, e == null ? void 0 : e.uuid, e == null ? void 0 : e.sellerUuid) || null,
|
|
75
75
|
isFree: e == null ? void 0 : e.isFree,
|
|
76
76
|
isNegotiable: e == null ? void 0 : e.isNegotiable,
|
|
77
77
|
negotiableText: u,
|
|
@@ -91,8 +91,8 @@ const W = F.div`
|
|
|
91
91
|
location: e == null ? void 0 : e.location,
|
|
92
92
|
isSponsored: e == null ? void 0 : e.isSponsored,
|
|
93
93
|
imageComponent: e == null ? void 0 : e.imageComponent,
|
|
94
|
-
onSelectCard: () =>
|
|
95
|
-
imageUrl:
|
|
94
|
+
onSelectCard: () => c(e == null ? void 0 : e.uuid),
|
|
95
|
+
imageUrl: m(e == null ? void 0 : e.image, e == null ? void 0 : e.uuid, e == null ? void 0 : e.sellerUuid) || null,
|
|
96
96
|
isFree: e == null ? void 0 : e.isFree,
|
|
97
97
|
isNegotiable: e == null ? void 0 : e.isNegotiable,
|
|
98
98
|
negotiableText: u,
|
|
@@ -118,7 +118,7 @@ const W = F.div`
|
|
|
118
118
|
},
|
|
119
119
|
borderRadius: "curved",
|
|
120
120
|
className: "button-link",
|
|
121
|
-
children:
|
|
121
|
+
children: w
|
|
122
122
|
}
|
|
123
123
|
)
|
|
124
124
|
] }),
|
|
@@ -138,11 +138,11 @@ const W = F.div`
|
|
|
138
138
|
productsToolbarName: N
|
|
139
139
|
}
|
|
140
140
|
),
|
|
141
|
-
/* @__PURE__ */ i(W, { limit: l, gap:
|
|
141
|
+
/* @__PURE__ */ i(W, { limit: l, gap: C, children: /* @__PURE__ */ i(
|
|
142
142
|
O,
|
|
143
143
|
{
|
|
144
144
|
isLoading: k,
|
|
145
|
-
|
|
145
|
+
limit: l,
|
|
146
146
|
keyPrefix: "explore-landing",
|
|
147
147
|
children: v
|
|
148
148
|
}
|