mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-31 01:47:17 +02:00
1 line
No EOL
57 KiB
JavaScript
1 line
No EOL
57 KiB
JavaScript
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[35706],{30133:(e,t,n)=>{n.d(t,{Ap:()=>eH,CC:()=>ec,Jj:()=>eg,_X:()=>es,gi:()=>$,q7:()=>eR});var i=n(63696);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach(function(t){c(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function a(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function o(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(){return(u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function d(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},s=Object.keys(e);for(i=0;i<s.length;i++)n=s[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function b(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var n,i=h(e);return n=t?Reflect.construct(i,arguments,h(this).constructor):i.apply(this,arguments),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return b(e)}(this,n)}}function f(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return v(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,void 0):void 0}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function g(e,t){return e(t={exports:{}},t.exports),t.exports}function y(){}function k(){}function O(e){return e.map(function(e){return!1===e?null:e}).join(" ").replace(/\s+/g," ").trim()}function w(e){return"".concat(e,"%")}function T(e,t,n){if(e===t)return!0;var i=H[F(e)],r=H[F(t)];return!(!i||i!==r)&&i(e,t,n)}function C(e){return function(t,n,i){if(!i)return e(t,n,[]);for(var r,s=i.length;r=i[--s];)if(r[0]===t&&r[1]===n)return!0;return e(t,n,i)}}function E(e){var t=[];for(var n in e)"constructor"!==n&&t.push(n);return t}function _(e,t){return!1!==t.clone&&t.isMergeableObject(e)?P(Array.isArray(e)?[]:{},e,t):e}function M(e,t,n){return e.concat(t).map(function(e){return _(e,n)})}function P(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||M,n.isMergeableObject=n.isMergeableObject||B;var i,r,s=Array.isArray(t);return s===Array.isArray(e)?s?n.arrayMerge(e,t,n):(r={},(i=n).isMergeableObject(e)&&Object.keys(e).forEach(function(t){r[t]=_(e[t],i)}),Object.keys(t).forEach(function(n){i.isMergeableObject(t[n])&&e[n]?r[n]=P(e[n],t[n],i):r[n]=_(t[n],i)}),r):_(t,n)}function N(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return{}},n=function(n){function r(e,n){var i;return a(this,r),(i=l.call(this,e,n)).state=t(s({},n.state)),i.updateStateProps=i.updateStateProps.bind(b(i)),i}d(r,n);var l=S(r);return o(r,[{key:"componentDidMount",value:function(){this.context.subscribe(this.updateStateProps)}},{key:"shouldComponentUpdate",value:function(e,t){return!W(t,this.state)||!W(e,this.props)}},{key:"componentWillUnmount",value:function(){this.context.unsubscribe(this.updateStateProps)}},{key:"updateStateProps",value:function(){this.setState(t(s({},this.context.state)))}},{key:"render",value:function(){var t=this,n=V(this.state,this.props);return i.createElement(e,u({ref:function(e){t.instance=e}},n,{carouselStore:{getStoreState:this.context.getStoreState,masterSpinnerError:this.context.masterSpinnerError,masterSpinnerSuccess:this.context.masterSpinnerSuccess,setStoreState:this.context.setStoreState,subscribeMasterSpinner:this.context.subscribeMasterSpinner,unsubscribeAllMasterSpinner:this.context.unsubscribeAllMasterSpinner,unsubscribeMasterSpinner:this.context.unsubscribeMasterSpinner}}),this.props.children)}}]),r}(i.Component);return c(n,"contextType",Z),c(n,"propTypes",{children:I.children}),c(n,"defaultProps",{children:null}),n}k.resetWarningCache=y;var D=function(){function e(e,t,n,i,r,s){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==s){var a=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:k,resetWarningCache:y};return n.PropTypes=n,n},x=g(function(e){e.exports=D()}),j="loading",A="success",R="error",I={children:x.oneOfType([x.arrayOf(x.node),x.node]),direction:x.oneOf(["forward","backward"]),height:function(e,t){var n=e[t];return"vertical"!==e.orientation||null!==n&&"number"==typeof n?null:Error("Missing required property '".concat(t,"' when orientation is vertical. You must supply a number representing the height in pixels"))},orientation:x.oneOf(["horizontal","vertical"]),isBgImage:function(e,t){return!0===e[t]&&"img"===e.tag?Error("HTML img elements should not have a backgroundImage. Please use ".concat(t," for other block-level HTML tags, like div, a, section, etc...")):null}},L=function(e){var t=e.min;return Math.min(e.max,Math.max(t,e.x))},q=["carouselStore","className","currentSlide","disabled","onClick","step","totalSlides","visibleSlides","infinite"],z=function(e){function t(e){var i;return a(this,t),(i=n.call(this,e)).handleOnClick=i.handleOnClick.bind(b(i)),i}d(t,e);var n=S(t);return o(t,[{key:"handleOnClick",value:function(e){var t=this.props,n=t.carouselStore,i=t.currentSlide,r=t.onClick,s=t.step,a=t.infinite,l=t.visibleSlides,o=t.totalSlides-l,c=Math.max(i-s,0);a&&(c=0===i?o:c),n.setStoreState({currentSlide:c,isPlaying:!1},null!==r&&r.call(this,e))}},{key:"render",value:function(){var e=this.props,n=(e.carouselStore,e.className),r=(e.currentSlide,e.disabled,e.onClick,e.step,e.totalSlides,e.visibleSlides,e.infinite),s=m(e,q),a=O(["buttonBack___1mlaL","carousel__back-button",n]),l=t.setDisabled(this.props.disabled,this.props.currentSlide,r);return i.createElement("button",u({type:"button","aria-label":"previous",className:a,onClick:this.handleOnClick,disabled:l},s),this.props.children)}}],[{key:"setDisabled",value:function(e,t,n){return null!==e?e:0===t&&!n}}]),t}(i.Component);c(z,"propTypes",{carouselStore:x.object.isRequired,children:I.children.isRequired,className:x.string,currentSlide:x.number.isRequired,disabled:x.bool,onClick:x.func,step:x.number.isRequired,totalSlides:x.number.isRequired,visibleSlides:x.number.isRequired,infinite:x.bool}),c(z,"defaultProps",{className:null,disabled:null,onClick:null,infinite:!1});var F=g(function(e,t){var n={}.toString,i="undefined"!=typeof window?window.Node:Function;e.exports=t=function(e){var t=typeof e;if("object"!=t)return t;if("object"==(t=r[n.call(e)]))return e instanceof Map?"map":e instanceof Set?"set":"object";if(t)return t;if(e instanceof i)switch(e.nodeType){case 1:return"element";case 3:return"text-node";case 9:return"document";case 11:return"document-fragment";default:return"dom-node"}};var r=t.types={"[object Function]":"function","[object Date]":"date","[object RegExp]":"regexp","[object Arguments]":"arguments","[object Array]":"array","[object Set]":"set","[object String]":"string","[object Null]":"null","[object Undefined]":"undefined","[object Number]":"number","[object Boolean]":"boolean","[object Object]":"object","[object Map]":"map","[object Text]":"text-node","[object Uint8Array]":"bit-array","[object Uint16Array]":"bit-array","[object Uint32Array]":"bit-array","[object Uint8ClampedArray]":"bit-array","[object Error]":"error","[object FormData]":"form-data","[object File]":"file","[object Blob]":"blob"}}),H=(F.types,{});H.number=function(e,t){return e!=e&&t!=t},H.function=function(e,t,n){return e.toString()===t.toString()&&H.object(e,t,n)&&T(e.prototype,t.prototype)},H.date=function(e,t){return+e==+t},H.regexp=function(e,t){return e.toString()===t.toString()},H.element=function(e,t){return e.outerHTML===t.outerHTML},H.textnode=function(e,t){return e.textContent===t.textContent},H.arguments=H["bit-array"]=H.array=C(function(e,t,n){var i=e.length;if(i!==t.length)return!1;for(n.push([e,t]);i--;)if(!T(e[i],t[i],n))return!1;return!0}),H.object=C(function(e,t,n){if("function"==typeof e.equal)return n.push([e,t]),e.equal(t,n);var i=E(e),r=E(t),s=i.length;if(s!==r.length)return!1;for(i.sort(),r.sort();s--;)if(i[s]!==r[s])return!1;for(n.push([e,t]),s=i.length;s--;){var a=i[s];if(!T(e[a],t[a],n))return!1}return!0});var W=T,B=function(e){var t;return!!e&&"object"==typeof e&&!("[object RegExp]"===(t=Object.prototype.toString.call(e))||"[object Date]"===t||e.$$typeof===U)},U="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;P.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,n){return P(e,n,t)},{})};var Y,V=P,Z=i.createContext(),X=function e(t){return Object.freeze(t),Object.getOwnPropertyNames(t).forEach(function(n){!t.hasOwnProperty(n)||null===t[n]||"object"!=typeof t[n]&&"function"!=typeof t[n]||Object.isFrozen(t[n])||e(t[n])}),t},K={masterSpinnerFinished:!1},G=function(){function e(t){a(this,e),this.state=X(V(K,t)),this.subscriptions=[],this.masterSpinnerSubscriptions={},this.setStoreState=this.setStoreState.bind(this),this.getStoreState=this.getStoreState.bind(this),this.subscribe=this.subscribe.bind(this),this.unsubscribe=this.unsubscribe.bind(this),this.updateSubscribers=this.updateSubscribers.bind(this),this.subscribeMasterSpinner=this.subscribeMasterSpinner.bind(this),this.unsubscribeMasterSpinner=this.unsubscribeMasterSpinner.bind(this),this.unsubscribeAllMasterSpinner=this.unsubscribeAllMasterSpinner.bind(this),this.masterSpinnerSuccess=this.masterSpinnerSuccess.bind(this),this.masterSpinnerError=this.masterSpinnerError.bind(this)}return o(e,[{key:"setStoreState",value:function(e,t){this.state=X(V(this.state,e)),this.updateSubscribers(t)}},{key:"getStoreState",value:function(){return V({},this.state)}},{key:"subscribe",value:function(e){this.subscriptions.push(e)}},{key:"unsubscribe",value:function(e){var t=this.subscriptions.indexOf(e);-1!==t&&this.subscriptions.splice(t,1)}},{key:"updateSubscribers",value:function(e){this.subscriptions.forEach(function(e){return e()}),"function"==typeof e&&e(this.getStoreState())}},{key:"subscribeMasterSpinner",value:function(e){-1===Object.keys(this.masterSpinnerSubscriptions).indexOf(e)&&(this.masterSpinnerSubscriptions[e]={success:!1,error:!1,complete:!1})}},{key:"unsubscribeMasterSpinner",value:function(e){return -1!==Object.keys(this.masterSpinnerSubscriptions).indexOf(e)&&(this.setMasterSpinnerFinished(),delete this.masterSpinnerSubscriptions[e])}},{key:"unsubscribeAllMasterSpinner",value:function(){this.masterSpinnerSubscriptions={},this.setMasterSpinnerFinished()}},{key:"masterSpinnerSuccess",value:function(e){this.masterSpinnerSubscriptions[e].success=!0,this.masterSpinnerSubscriptions[e].complete=!0,this.setMasterSpinnerFinished()}},{key:"masterSpinnerError",value:function(e){this.masterSpinnerSubscriptions[e].error=!0,this.masterSpinnerSubscriptions[e].complete=!0,this.setMasterSpinnerFinished()}},{key:"setMasterSpinnerFinished",value:function(){this.setStoreState({masterSpinnerFinished:this.isMasterSpinnerFinished()})}},{key:"isMasterSpinnerFinished",value:function(){var e=this;return 0===Object.keys(this.masterSpinnerSubscriptions).filter(function(t){return!0!==e.masterSpinnerSubscriptions[t].complete}).length}}]),e}(),Q=["children","className","currentSlide","disableAnimation","disableKeyboard","hasMasterSpinner","interval","isPageScrollLocked","isPlaying","lockOnWindowScroll","naturalSlideHeight","naturalSlideWidth","orientation","playDirection","step","dragStep","tag","totalSlides","touchEnabled","dragEnabled","visibleSlides","infinite","isIntrinsicHeight"],$=(c(Y=function(e){function t(e){if(a(this,t),r=n.call(this,e),e.isIntrinsicHeight&&"horizontal"!==e.orientation)throw Error('isIntrinsicHeight can only be used in "horizontal" orientation. See Readme for more information.');var i,r,s={currentSlide:e.currentSlide,disableAnimation:e.disableAnimation,disableKeyboard:e.disableKeyboard,hasMasterSpinner:e.hasMasterSpinner,imageErrorCount:0,imageSuccessCount:0,interval:e.interval,isPageScrollLocked:e.isPageScrollLocked,isPlaying:e.isPlaying,lockOnWindowScroll:e.lockOnWindowScroll,masterSpinnerThreshold:0,naturalSlideHeight:e.naturalSlideHeight,naturalSlideWidth:e.naturalSlideWidth,orientation:e.orientation,playDirection:e.playDirection,privateUnDisableAnimation:!1,slideSize:100/e.totalSlides*(i=e.visibleSlides)/i,slideTraySize:100*e.totalSlides/e.visibleSlides,step:e.step,dragStep:e.dragStep,totalSlides:e.totalSlides,touchEnabled:e.touchEnabled,dragEnabled:e.dragEnabled,visibleSlides:e.visibleSlides,infinite:e.infinite,isIntrinsicHeight:e.isIntrinsicHeight};return r.carouselStore=new G(s),r}d(t,e);var n=S(t);return o(t,[{key:"componentDidUpdate",value:function(e){var t,n=this,i={};["currentSlide","disableAnimation","disableKeyboard","hasMasterSpinner","interval","isPlaying","naturalSlideHeight","naturalSlideWidth","lockOnWindowScroll","orientation","playDirection","step","dragStep","totalSlides","touchEnabled","dragEnabled","visibleSlides"].forEach(function(t){e[t]!==n.props[t]&&(i[t]=n.props[t])}),this.props.currentSlide===e.currentSlide||this.props.disableAnimation||(i.disableAnimation=!0,i.privateUnDisableAnimation=!0),this.props.totalSlides===e.totalSlides&&this.props.visibleSlides===e.visibleSlides||(i.slideSize=100/this.props.totalSlides*(t=this.props.visibleSlides)/t,i.slideTraySize=100*this.props.totalSlides/this.props.visibleSlides),this.carouselStore.state.currentSlide>=this.props.totalSlides&&(i.currentSlide=Math.max(this.props.totalSlides-1,0)),Object.keys(i).length>0&&this.carouselStore.setStoreState(i)}},{key:"componentWillUnmount",value:function(){this.carouselStore.unsubscribeAllMasterSpinner()}},{key:"getStore",value:function(){return this.carouselStore}},{key:"render",value:function(){var e=this.props,t=(e.children,e.className,e.currentSlide,e.disableAnimation,e.disableKeyboard,e.hasMasterSpinner,e.interval,e.isPageScrollLocked,e.isPlaying,e.lockOnWindowScroll,e.naturalSlideHeight,e.naturalSlideWidth,e.orientation,e.playDirection,e.step,e.dragStep,e.tag),n=(e.totalSlides,e.touchEnabled,e.dragEnabled,e.visibleSlides,e.infinite,e.isIntrinsicHeight,m(e,Q)),r=O(["carousel",this.props.className]);return i.createElement(t,u({className:r},n),i.createElement(Z.Provider,{value:this.carouselStore},this.props.children))}}]),t}(i.Component),"propTypes",{children:I.children.isRequired,className:x.string,currentSlide:x.number,disableAnimation:x.bool,disableKeyboard:x.bool,hasMasterSpinner:x.bool,interval:x.number,isPageScrollLocked:x.bool,isPlaying:x.bool,lockOnWindowScroll:x.bool,naturalSlideHeight:x.number.isRequired,naturalSlideWidth:x.number.isRequired,orientation:I.orientation,playDirection:I.direction,step:x.number,dragStep:x.number,tag:x.string,totalSlides:x.number.isRequired,touchEnabled:x.bool,dragEnabled:x.bool,visibleSlides:x.number,infinite:x.bool,isIntrinsicHeight:x.bool}),c(Y,"defaultProps",{className:null,currentSlide:0,disableAnimation:!1,disableKeyboard:!1,hasMasterSpinner:!1,interval:5e3,isPageScrollLocked:!1,isPlaying:!1,lockOnWindowScroll:!1,orientation:"horizontal",playDirection:"forward",step:1,dragStep:1,tag:"div",touchEnabled:!0,dragEnabled:!0,visibleSlides:1,infinite:!1,isIntrinsicHeight:!1}),Y);Z.Consumer;var J,ee,et,en,ei,er,es=N(z,function(e){return{currentSlide:e.currentSlide,step:e.step,totalSlides:e.totalSlides,visibleSlides:e.visibleSlides,infinite:e.infinite}}),ea=["carouselStore","className","currentSlide","disabled","onClick","totalSlides"],el=(N((c(J=function(e){function t(){var e;return a(this,t),(e=n.call(this)).handleOnClick=e.handleOnClick.bind(b(e)),e}d(t,e);var n=S(t);return o(t,[{key:"handleOnClick",value:function(e){var t=this.props,n=t.carouselStore,i=t.onClick;n.setStoreState({currentSlide:0,isPlaying:!1},null!==i&&i.call(this,e))}},{key:"render",value:function(){var e=this.props,t=(e.carouselStore,e.className),n=e.currentSlide,r=e.disabled,s=(e.onClick,e.totalSlides,m(e,ea)),a=O(["buttonFirst___2rhFr","carousel__first-button",t]);return i.createElement("button",u({type:"button","aria-label":"first",className:a,onClick:this.handleOnClick,disabled:null!==r?r:0===n},s),this.props.children)}}]),t}(i.Component),"propTypes",{carouselStore:x.object.isRequired,children:I.children.isRequired,className:x.string,currentSlide:x.number.isRequired,disabled:x.bool,onClick:x.func,totalSlides:x.number.isRequired}),c(J,"defaultProps",{className:null,disabled:null,onClick:null}),J),function(e){return{currentSlide:e.currentSlide,totalSlides:e.totalSlides}}),"buttonNext___2mOCa"),eo=["carouselStore","className","currentSlide","disabled","onClick","step","totalSlides","visibleSlides","infinite"],ec=N((c(ee=function(e){function t(e){var i;return a(this,t),(i=n.call(this,e)).handleOnClick=i.handleOnClick.bind(b(i)),i}d(t,e);var n=S(t);return o(t,[{key:"handleOnClick",value:function(e){var t=this.props,n=t.currentSlide,i=t.onClick,r=t.step,s=t.carouselStore,a=t.infinite,l=t.totalSlides-t.visibleSlides,o=Math.min(r+n,l);a&&(o=l===n?0:o),s.setStoreState({currentSlide:o,isPlaying:!1},null!==i&&i.call(this,e))}},{key:"render",value:function(){var e=this.props,n=(e.carouselStore,e.className),r=e.currentSlide,s=e.disabled,a=(e.onClick,e.step,e.totalSlides),l=e.visibleSlides,o=e.infinite,c=m(e,eo),d=O([el,"carousel__next-button",n]),h=t.setDisabled(s,r,l,a,o);return i.createElement("button",u({type:"button","aria-label":"next",className:d,onClick:this.handleOnClick,disabled:h},c),this.props.children)}}],[{key:"setDisabled",value:function(e,t,n,i,r){return null!==e?e:t>=i-n&&!r}}]),t}(i.PureComponent),"propTypes",{carouselStore:x.object.isRequired,children:I.children.isRequired,className:x.string,currentSlide:x.number.isRequired,disabled:x.bool,onClick:x.func,step:x.number.isRequired,totalSlides:x.number.isRequired,visibleSlides:x.number.isRequired,infinite:x.bool}),c(ee,"defaultProps",{className:null,disabled:null,onClick:null,infinite:!1}),ee),function(e){return{currentSlide:e.currentSlide,step:e.step,totalSlides:e.totalSlides,visibleSlides:e.visibleSlides,infinite:e.infinite}}),eu=["carouselStore","className","currentSlide","disabled","onClick","totalSlides","visibleSlides"],ed=(N((c(et=function(e){function t(){var e;return a(this,t),(e=n.call(this)).handleOnClick=e.handleOnClick.bind(b(e)),e}d(t,e);var n=S(t);return o(t,[{key:"handleOnClick",value:function(e){var t=this.props,n=t.carouselStore,i=t.onClick,r=t.totalSlides,s=t.visibleSlides;n.setStoreState({currentSlide:r-s,isPlaying:!1},null!==i&&i.call(this,e))}},{key:"render",value:function(){var e=this.props,t=(e.carouselStore,e.className),n=e.currentSlide,r=e.disabled,s=(e.onClick,e.totalSlides),a=e.visibleSlides,l=m(e,eu),o=O(["buttonLast___2yuh0","carousel__last-button",t]);return i.createElement("button",u({type:"button","aria-label":"last",className:o,onClick:this.handleOnClick,disabled:null!==r?r:n>=s-a},l),this.props.children)}}]),t}(i.Component),"propTypes",{carouselStore:x.object.isRequired,children:I.children.isRequired,className:x.string,currentSlide:x.number.isRequired,disabled:x.bool,onClick:x.func,totalSlides:x.number.isRequired,visibleSlides:x.number.isRequired}),c(et,"defaultProps",{className:null,disabled:null,onClick:null}),et),function(e){return{currentSlide:e.currentSlide,totalSlides:e.totalSlides,visibleSlides:e.visibleSlides}}),"buttonNext___3Lm3s"),eh=["carouselStore","children","childrenPaused","childrenPlaying","className","isPlaying","onClick"],ep=(N((c(en=function(e){function t(e){var i;return a(this,t),(i=n.call(this,e)).handleOnClick=i.handleOnClick.bind(b(i)),i}d(t,e);var n=S(t);return o(t,[{key:"handleOnClick",value:function(e){var t=this.props.onClick;this.props.carouselStore.setStoreState({isPlaying:!this.props.isPlaying},null!==t&&t.call(this,e))}},{key:"render",value:function(){var e=this.props,t=(e.carouselStore,e.children,e.childrenPaused),n=e.childrenPlaying,r=e.className,s=e.isPlaying,a=(e.onClick,m(e,eh)),l=O([ed,"carousel__play-button",r]);return i.createElement("button",u({type:"button","aria-label":"play",className:l,onClick:this.handleOnClick},a),s&&n,!s&&t,this.props.children)}}]),t}(i.PureComponent),"propTypes",{carouselStore:x.object.isRequired,children:x.node,childrenPaused:x.node,childrenPlaying:x.node,className:x.string,isPlaying:x.bool.isRequired,onClick:x.func}),c(en,"defaultProps",{children:null,childrenPaused:null,childrenPlaying:null,className:null,onClick:null}),en),function(e){return{isPlaying:e.isPlaying}}),{dot:"dot___3c3SI"}),em=["carouselStore","children","className","currentSlide","disabled","onClick","selected","slide","totalSlides","visibleSlides"],eb=N((c(ei=function(e){function t(e){var i;return a(this,t),(i=n.call(this,e)).handleOnClick=i.handleOnClick.bind(b(i)),i}d(t,e);var n=S(t);return o(t,[{key:"handleOnClick",value:function(e){var t=this.props,n=t.carouselStore,i=t.onClick,r=t.slide,s=t.totalSlides,a=t.visibleSlides;n.setStoreState({currentSlide:r>=s-a?s-a:r,isPlaying:!1},null!==i&&i.call(this,e))}},{key:"render",value:function(){var e=this.props,t=(e.carouselStore,e.children,e.className),n=e.currentSlide,r=e.disabled,s=(e.onClick,e.selected),a=e.slide,l=(e.totalSlides,e.visibleSlides),o=m(e,em),c=a>=n&&a<n+l,d="boolean"==typeof s?s:c,h=O([ep.dot,d&&ep.dotSelected,"carousel__dot","carousel__dot--".concat(a),d&&"carousel__dot--selected",t]);return i.createElement("button",u({"aria-label":"slide dot",type:"button",onClick:this.handleOnClick,className:h,disabled:"boolean"==typeof r?r:!0===c},o),this.props.children)}}]),t}(i.Component),"propTypes",{carouselStore:x.object.isRequired,children:I.children,className:x.string,currentSlide:x.number.isRequired,disabled:x.bool,onClick:x.func,selected:x.bool,slide:x.number.isRequired,totalSlides:x.number.isRequired,visibleSlides:x.number.isRequired}),c(ei,"defaultProps",{children:null,className:null,disabled:null,onClick:null,selected:null}),ei),function(e){return{currentSlide:e.currentSlide,totalSlides:e.totalSlides,visibleSlides:e.visibleSlides}}),eS={},ef=["renderDots"],ev=["carouselStore","children","className","currentSlide","dotNumbers","totalSlides","visibleSlides","disableActiveDots","showAsSelectedForCurrentSlideOnly","renderDots"],eg=N((c(er=function(e){function t(){return a(this,t),n.apply(this,arguments)}d(t,e);var n=S(t);return o(t,[{key:"renderDots",value:function(){var e=this.props,t=e.currentSlide,n=e.totalSlides,r=e.visibleSlides,s=e.disableActiveDots,a=e.showAsSelectedForCurrentSlideOnly,l=e.renderDots;if(l){var o=this.props;return o.renderDots,l(m(o,ef))}for(var c=[],u=0;u<n;u+=1){var d=u>=t&&u<t+r,h=u===t,p=a?h:d,b=u>=n-r?n-r:u;c.push(i.createElement(eb,{key:u,slide:b,selected:p,disabled:!!s&&p},i.createElement("span",{className:O["carousel__dot-group-dot"]},this.props.dotNumbers&&u+1)))}return c}},{key:"render",value:function(){var e=this.props,t=(e.carouselStore,e.children),n=e.className,r=(e.currentSlide,e.dotNumbers,e.totalSlides,e.visibleSlides,e.disableActiveDots,e.showAsSelectedForCurrentSlideOnly,e.renderDots,m(e,ev)),s=O([eS.DotGroup,"carousel__dot-group",n]);return i.createElement("div",u({className:s},r),this.renderDots(),t)}}]),t}(i.Component),"propTypes",{children:I.children,className:x.string,currentSlide:x.number.isRequired,carouselStore:x.object.isRequired,totalSlides:x.number.isRequired,visibleSlides:x.number.isRequired,dotNumbers:x.bool,disableActiveDots:x.bool,showAsSelectedForCurrentSlideOnly:x.bool,renderDots:x.func}),c(er,"defaultProps",{children:null,className:null,dotNumbers:!1,disableActiveDots:!0,showAsSelectedForCurrentSlideOnly:!1,renderDots:null}),er),function(e){return{currentSlide:e.currentSlide,totalSlides:e.totalSlides,visibleSlides:e.visibleSlides}}),ey={image:"image___xtQGH"},ek=["src","alt"],eO=["carouselStore","children","className","hasMasterSpinner","isBgImage","onError","onLoad","renderError","renderLoading","style","tag"],ew=function(e){function t(e){var i;return a(this,t),(i=n.call(this,e)).state={imageStatus:j},i.handleImageLoad=i.handleImageLoad.bind(b(i)),i.handleImageError=i.handleImageError.bind(b(i)),i.image=null,i}d(t,e);var n=S(t);return o(t,[{key:"componentDidMount",value:function(){t.subscribeMasterSpinner(this.props),this.initImage()}},{key:"componentDidUpdate",value:function(e){e.src!==this.props.src&&(t.unsubscribeMasterSpinner(e),t.subscribeMasterSpinner(this.props),this.initImage())}},{key:"componentWillUnmount",value:function(){t.unsubscribeMasterSpinner(this.props),this.image.removeEventListener("load",this.handleImageLoad),this.image.removeEventListener("error",this.handleImageError),this.image=null}},{key:"initImage",value:function(){if(this.setState({imageStatus:j}),this.image=document.createElement("img"),this.image.addEventListener("load",this.handleImageLoad,!1),this.image.addEventListener("error",this.handleImageError,!1),this.image.src=this.props.src,this.image.readyState||this.image.complete){var e=this.image.src;this.image.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",this.image.src=e}}},{key:"handleImageLoad",value:function(e){this.setState({imageStatus:A}),this.props.hasMasterSpinner&&this.props.carouselStore.masterSpinnerSuccess(this.props.src),this.props.onLoad&&this.props.onLoad(e)}},{key:"handleImageError",value:function(e){this.setState({imageStatus:R}),this.props.hasMasterSpinner&&this.props.carouselStore.masterSpinnerError(this.props.src),this.props.onError&&this.props.onError(e)}},{key:"tempTag",value:function(){return"img"===this.props.tag?"div":this.props.tag}},{key:"customRender",value:function(e){return"function"==typeof this.props[e]?this.props[e]():this.props.children}},{key:"renderLoading",value:function(e){var t=this.tempTag(),n=O([ey.image,ey.imageLoading,"carousel__image",this.props.isBgImage&&"carousel__image--with-background","carousel__image--loading",this.props.className]);return i.createElement(t,u({className:n},e),this.customRender("renderLoading"))}},{key:"renderError",value:function(e){var t=this.tempTag(),n=O([ey.image,ey.imageError,"carousel__image",this.props.isBgImage&&"carousel__image--with-background","carousel__image--error",this.props.className]);return i.createElement(t,u({className:n},e),this.customRender("renderError"))}},{key:"renderSuccess",value:function(e){var t=this.props,n=t.style,r=t.tag,s=O([ey.image,"carousel__image",this.props.isBgImage&&"carousel__image--with-background","carousel__image--success",this.props.className]),a=u({},n),l=e;if("img"!==r){var o=e.src;e.alt,l=m(e,ek),a=u({},n,{backgroundImage:'url("'.concat(o,'")'),backgroundSize:"cover"})}return i.createElement(r,u({className:s,style:a},l),this.props.children)}},{key:"render",value:function(){var e=this.props,t=(e.carouselStore,e.children,e.className,e.hasMasterSpinner,e.isBgImage,e.onError,e.onLoad,e.renderError,e.renderLoading,e.style,e.tag,m(e,eO));switch(this.state.imageStatus){case j:return this.renderLoading(t);case A:return this.renderSuccess(t);case R:return this.renderError(t);default:throw Error("unknown value for this.state.imageStatus")}}}],[{key:"subscribeMasterSpinner",value:function(e){e.hasMasterSpinner&&e.carouselStore.subscribeMasterSpinner(e.src)}},{key:"unsubscribeMasterSpinner",value:function(e){e.hasMasterSpinner&&e.carouselStore.unsubscribeMasterSpinner(e.src)}}]),t}(i.Component);c(ew,"propTypes",{alt:x.string,carouselStore:x.object.isRequired,children:I.children,className:x.string,hasMasterSpinner:x.bool.isRequired,isBgImage:I.isBgImage,onError:x.func,onLoad:x.func,renderError:x.func,renderLoading:x.func,src:x.string.isRequired,style:x.object,tag:x.string}),c(ew,"defaultProps",{alt:"",children:null,className:null,isBgImage:!1,onError:null,onLoad:null,renderError:null,renderLoading:null,style:null,tag:"img"});var eT,eC,eE,e_,eM=N(ew,function(e){return{hasMasterSpinner:e.hasMasterSpinner,orientation:e.orientation}}),eP=["className"],eN=(c(eT=function(e){function t(){return a(this,t),n.apply(this,arguments)}d(t,e);var n=S(t);return o(t,[{key:"render",value:function(){var e=this.props,t=e.className,n=m(e,eP),r=O(["spinner___27VUp","carousel__spinner",t]);return i.createElement("div",u({className:r},n))}}]),t}(i.PureComponent),"propTypes",{className:x.string}),c(eT,"defaultProps",{className:null}),eT),eD={container:"container___2O72F",overlay:"overlay___IV4qY",hover:"hover___MYy31",zoom:"zoom___3kqYk",loading:"loading___1pvNI",imageLoadingSpinnerContainer:"imageLoadingSpinnerContainer___3UIPD"},ex=["alt","bgImageProps","bgImageTag","carouselStore","className","imageClassName","overlayClassName","isPinchZoomEnabled","spinner","src","srcZoomed","tag"],ej=(N((c(eC=function(e){function t(e){var i;return a(this,t),(i=n.call(this,e)).state={isImageLoading:!0,isHovering:!1,isZooming:!1,x:null,y:null,scale:1},i.tpCache={},i.handleImageComplete=i.handleImageComplete.bind(b(i)),i.handleOnMouseMove=i.handleOnMouseMove.bind(b(i)),i.handleOnMouseOut=i.handleOnMouseOut.bind(b(i)),i.handleOnMouseOver=i.handleOnMouseOver.bind(b(i)),i.handleOnTouchEnd=i.handleOnTouchEnd.bind(b(i)),i.handleOnTouchMove=i.handleOnTouchMove.bind(b(i)),i.handleOnTouchStart=i.handleOnTouchStart.bind(b(i)),i}d(t,e);var n=S(t);return o(t,[{key:"componentDidUpdate",value:function(e,t){!1===t.isZooming&&!0===this.state.isZooming&&this.props.carouselStore.setStoreState({isPageScrollLocked:!0}),!0===t.isZooming&&!1===this.state.isZooming&&this.props.carouselStore.setStoreState({isPageScrollLocked:!1})}},{key:"handleImageComplete",value:function(){this.setState({isImageLoading:!1})}},{key:"handleOnMouseOver",value:function(){this.state.isZooming||this.setState({isHovering:!0,scale:2})}},{key:"handleOnMouseOut",value:function(){this.state.isZooming||this.setState({isHovering:!1,scale:1})}},{key:"handleOnMouseMove",value:function(e){if(!this.state.isZooming){var t=w(e.nativeEvent.offsetX/e.target.offsetWidth*100),n=w(e.nativeEvent.offsetY/e.target.offsetHeight*100);this.setState({x:t,y:n})}}},{key:"handleOnTouchStart",value:function(e){var t=this;this.props.isPinchZoomEnabled&&(f(e.targetTouches).forEach(function(e){t.tpCache[e.identifier]={clientX:e.clientX,clientY:e.clientY}}),this.setState(function(e){return{isZooming:e.isZooming||Object.keys(t.tpCache).length>1}}))}},{key:"handleOnTouchMove",value:function(e){var n=this;if(this.state.isZooming){e.persist();var i=f(e.targetTouches).filter(function(e){return n.tpCache[e.identifier]}).slice(0,2);if(2===i.length){e.stopPropagation();var r=e.target.getBoundingClientRect(),a=i[0].identifier,l=i[1].identifier,o={x1:this.tpCache[a].clientX,y1:this.tpCache[a].clientY,x2:this.tpCache[l].clientX,y2:this.tpCache[l].clientY};o.distance=t.distanceBetweenTwoTouches(s({},o));var c=t.midpointBetweenTwoTouches(s({},o));o.cx=c.x,o.cy=c.y;var u={x1:i[0].clientX,y1:i[0].clientY,x2:i[1].clientX,y2:i[1].clientY};u.distance=t.distanceBetweenTwoTouches(s({},u));var d=t.midpointBetweenTwoTouches(s({},u));u.cx=d.x,u.cy=d.y;var h=w(L({min:0,max:100,x:(u.cx-r.left)/r.width*100})),p=w(L({min:0,max:100,x:(u.cy-r.top)/r.height*100})),m=function(e){return L({min:1,max:3,x:e.scale+(u.distance-o.distance)/100})};this.setState(function(e){return{isZooming:1!==m(e),scale:m(e),x:h,y:p}})}}}},{key:"handleOnTouchEnd",value:function(e){var t=this;this.props.isPinchZoomEnabled&&(f(e.changedTouches).forEach(function(e){delete t.tpCache[e.identifier]}),0===Object.keys(this.tpCache).length&&this.setState({isZooming:!1}))}},{key:"renderLoading",value:function(){if(this.state.isImageLoading){var e=this.props.spinner;return i.createElement("div",{className:O([eD.imageLoadingSpinnerContainer,"carousel__image-loading-spinner-container"])},e&&e(),!e&&i.createElement(eN,null))}return null}},{key:"render",value:function(){var e=this.props,t=e.alt,n=e.bgImageProps,r=e.bgImageTag,s=(e.carouselStore,e.className),a=e.imageClassName,l=e.overlayClassName,o=(e.isPinchZoomEnabled,e.spinner,e.src),c=e.srcZoomed,d=e.tag,h=m(e,ex),p=O([eD.container,s]),b=O([eD.image,"carousel__zoom-image",a]),S=O([eD.overlay,"carousel__zoom-image-overlay",this.state.isHovering&&eD.hover,this.state.isZooming&&eD.zoom,this.state.isHovering&&"carousel__zoom-image-overlay--hovering",this.state.isZooming&&"carousel__zoom-image-overlay--zooming",l]),f={};return(this.state.isHovering||this.state.isZooming)&&(f.transformOrigin="".concat(this.state.x," ").concat(this.state.y),f.transform="scale(".concat(this.state.scale,")")),i.createElement(d,u({className:p},h),i.createElement(eM,u({alt:t,className:b,tag:r,src:o,onLoad:this.handleImageComplete,onError:this.handleImageComplete},n)),i.createElement(eM,{className:S,tag:"div",src:c||o,style:f,isBgImage:!0,onFocus:this.handleOnMouseOver,onMouseOver:this.handleOnMouseOver,onBlur:this.handleOnMouseOut,onMouseOut:this.handleOnMouseOut,onMouseMove:this.handleOnMouseMove,onTouchStart:this.handleOnTouchStart,onTouchEnd:this.handleOnTouchEnd,onTouchMove:this.handleOnTouchMove}),this.renderLoading())}}],[{key:"midpointBetweenTwoTouches",value:function(e){var t=e.x1,n=e.y1;return{x:(t+e.x2)/2,y:(n+e.y2)/2}}},{key:"distanceBetweenTwoTouches",value:function(e){var t=e.x1,n=e.y1;return Math.sqrt(Math.pow(e.x2-t,2)+Math.pow(e.y2-n,2))}}]),t}(i.Component),"propTypes",{alt:x.string,bgImageProps:x.object,bgImageTag:x.string,carouselStore:x.object.isRequired,className:x.string,imageClassName:x.string,overlayClassName:x.string,spinner:x.func,src:x.string.isRequired,srcZoomed:x.string,tag:x.string,isPinchZoomEnabled:x.bool}),c(eC,"defaultProps",{alt:void 0,bgImageProps:{},bgImageTag:"div",className:null,imageClassName:null,overlayClassName:null,isPinchZoomEnabled:!0,spinner:null,srcZoomed:null,tag:"div"}),eC),function(){return{}}),{slide:"slide___3-Nqo",slideHorizontal:"slideHorizontal___1NzNV",slideInner:"slideInner___2mfX9",focusRing:"focusRing___1airF"}),eA=["ariaLabel","carouselStore","children","className","classNameHidden","classNameVisible","currentSlide","index","innerClassName","innerTag","naturalSlideHeight","naturalSlideWidth","onBlur","onFocus","orientation","slideSize","style","tabIndex","tag","totalSlides","visibleSlides","isIntrinsicHeight"],eR=N((c(eE=function(e){function t(e){var i;return a(this,t),(i=n.call(this,e)).handleOnFocus=i.handleOnFocus.bind(b(i)),i.handleOnBlur=i.handleOnBlur.bind(b(i)),i.state={focused:!1},i}d(t,e);var n=S(t);return o(t,[{key:"isVisible",value:function(){var e=this.props,t=e.currentSlide,n=e.index,i=e.visibleSlides;return n>=t&&n<t+i}},{key:"handleOnFocus",value:function(e){var t=this,n=this.props.onFocus;this.setState({focused:!0},function(){null!==n&&n.call(t,e)})}},{key:"handleOnBlur",value:function(e){var t=this,n=this.props.onBlur;this.setState({focused:!1},function(){null!==n&&n.call(t,e)})}},{key:"renderFocusRing",value:function(){return this.state.focused?i.createElement("div",{className:[ej.focusRing,"carousel__slide-focus-ring"].join(" ")}):null}},{key:"render",value:function(){var e=this,t=this.props,n=t.ariaLabel,r=(t.carouselStore,t.children,t.className),s=t.classNameHidden,a=t.classNameVisible,l=(t.currentSlide,t.index,t.innerClassName),o=t.innerTag,c=t.naturalSlideHeight,d=t.naturalSlideWidth,h=(t.onBlur,t.onFocus,t.orientation),p=t.slideSize,b=t.style,S=t.tabIndex,f=t.tag,v=t.totalSlides,g=(t.visibleSlides,t.isIntrinsicHeight),y=m(t,eA),k={};"horizontal"===h?(k.width=w(p),k.paddingBottom=w(100*c/(d*v))):(k.width=w(100),k.paddingBottom=w(100*c/d));var T={};g&&("horizontal"===h?k.height="unset":k.width="unset",k.paddingBottom="unset",T.position="unset");var C=u({},k,b),E=this.isVisible(),_=O([ej.slide,"horizontal"===h&&ej.slideHorizontal,"carousel__slide",this.state.focused&&"carousel__slide--focused",E&&a,E&&"carousel__slide--visible",!E&&s,!E&&"carousel__slide--hidden",r]),M=O([ej.slideInner,"carousel__inner-slide",l]),P=this.isVisible()?0:-1;return i.createElement(f,u({ref:function(t){e.tagRef=t},tabIndex:"number"==typeof S?S:P,"aria-selected":this.isVisible(),"aria-label":n,role:"option",onFocus:this.handleOnFocus,onBlur:this.handleOnBlur,className:_,style:C},y),i.createElement(o,{ref:function(t){e.innerTagRef=t},className:M,style:T},this.props.children,this.renderFocusRing()))}}]),t}(i.PureComponent),"propTypes",{ariaLabel:x.string,carouselStore:x.object,children:I.children,className:x.string,classNameHidden:x.string,classNameVisible:x.string,currentSlide:x.number.isRequired,index:x.number.isRequired,innerClassName:x.string,innerTag:x.string,naturalSlideHeight:x.number.isRequired,naturalSlideWidth:x.number.isRequired,onBlur:x.func,onFocus:x.func,orientation:I.orientation.isRequired,slideSize:x.number.isRequired,style:x.object,tabIndex:x.number,tag:x.string,totalSlides:x.number.isRequired,visibleSlides:x.number.isRequired,isIntrinsicHeight:x.bool}),c(eE,"defaultProps",{ariaLabel:"slide",carouselStore:null,children:null,className:null,classNameHidden:null,classNameVisible:null,innerClassName:null,innerTag:"div",onBlur:null,onFocus:null,style:{},tabIndex:null,tag:"div",isIntrinsicHeight:!1}),eE),function(e){return{currentSlide:e.currentSlide,naturalSlideHeight:e.naturalSlideHeight,naturalSlideWidth:e.naturalSlideWidth,orientation:e.orientation,slideSize:e.slideSize,totalSlides:e.totalSlides,visibleSlides:e.visibleSlides,isIntrinsicHeight:e.isIntrinsicHeight}}),eI=function(){function e(){a(this,e)}return o(e,[{key:"parents",value:function(e,t){return null===e.parentNode?t:this.parents(e.parentNode,t.concat([e]))}},{key:"scrollParent",value:function(t){for(var n=this.parents(t.parentNode,[]),i=0;i<n.length;i+=1)if(e.scroll(n[i]))return n[i];return document.scrollingElement||document.documentElement}},{key:"getScrollParent",value:function(t){return e.isNodeValid(t)?this.scrollParent(t):null}}],[{key:"style",value:function(e,t){return getComputedStyle(e,null).getPropertyValue(t)}},{key:"overflow",value:function(t){return e.style(t,"overflow")+e.style(t,"overflow-y")+e.style(t,"overflow-x")}},{key:"scroll",value:function(t){return/(auto|scroll)/.test(e.overflow(t))}},{key:"isNodeValid",value:function(e){return e instanceof HTMLElement||e instanceof SVGElement}}]),e}(),eL={horizontalSlider:"horizontalSlider___281Ls",horizontalSliderTray:"horizontalSliderTray___1L-0W",verticalSlider:"verticalSlider___34ZFD",verticalSliderTray:"verticalSliderTray___267D8",verticalTray:"verticalTray___12Key",verticalSlideTrayWrap:"verticalSlideTrayWrap___2nO7o",sliderTray:"sliderTray___-vHFQ",sliderAnimation:"sliderAnimation___300FY",masterSpinnerContainer:"masterSpinnerContainer___1Z6hB"},eq=["ariaLabel","carouselStore","children","className","classNameAnimation","classNameTray","classNameTrayWrap","currentSlide","disableAnimation","disableKeyboard","dragEnabled","hasMasterSpinner","interval","isPageScrollLocked","isPlaying","lockOnWindowScroll","masterSpinnerFinished","moveThreshold","naturalSlideHeight","naturalSlideWidth","onMasterSpinner","orientation","playDirection","privateUnDisableAnimation","slideSize","slideTraySize","spinner","style","tabIndex","totalSlides","touchEnabled","trayProps","trayTag","visibleSlides","isIntrinsicHeight"],ez=["dragStep","step","infinite","preventVerticalScrollOnTouch","preventingVerticalScroll","horizontalPixelThreshold","verticalPixelThreshold"],eF=["className","onClickCapture","onMouseDown","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","ref","style"],eH=N((c(e_=function(e){function t(e){var i;return a(this,t),(i=n.call(this,e)).getSliderRef=i.getSliderRef.bind(b(i)),i.handleDocumentScroll=i.handleDocumentScroll.bind(b(i)),i.handleOnClickCapture=i.handleOnClickCapture.bind(b(i)),i.handleOnKeyDown=i.handleOnKeyDown.bind(b(i)),i.handleOnMouseDown=i.handleOnMouseDown.bind(b(i)),i.handleOnMouseMove=i.handleOnMouseMove.bind(b(i)),i.handleOnMouseUp=i.handleOnMouseUp.bind(b(i)),i.handleOnTouchCancel=i.handleOnTouchCancel.bind(b(i)),i.handleOnTouchEnd=i.handleOnTouchEnd.bind(b(i)),i.handleOnTouchMove=i.handleOnTouchMove.bind(b(i)),i.handleOnTouchStart=i.handleOnTouchStart.bind(b(i)),i.playBackward=i.playBackward.bind(b(i)),i.playForward=i.playForward.bind(b(i)),i.callCallback=i.callCallback.bind(b(i)),i.blockWindowScroll=i.blockWindowScroll.bind(b(i)),i.state={cancelNextClick:!1,deltaX:0,deltaY:0,isBeingMouseDragged:!1,isBeingTouchDragged:!1,preventingVerticalScroll:!1,startX:0,startY:0},i.interval=null,i.isDocumentScrolling=null,i.moveTimer=null,i.originalOverflow=null,i.scrollParent=null,i.scrollStopTimer=null,i}d(t,e);var n=S(t);return o(t,[{key:"componentDidMount",value:function(){this.props.lockOnWindowScroll&&window.addEventListener("scroll",this.handleDocumentScroll,!1),(this.props.touchEnabled||this.props.preventVerticalScrollOnTouch)&&window.addEventListener("touchmove",this.blockWindowScroll,!1),document.documentElement.addEventListener("mouseleave",this.handleOnMouseUp,!1),document.documentElement.addEventListener("mousemove",this.handleOnMouseMove,!1),document.documentElement.addEventListener("mouseup",this.handleOnMouseUp,!1),this.props.isPlaying&&this.play()}},{key:"componentDidUpdate",value:function(e){!e.isPlaying&&this.props.isPlaying&&this.play(),e.isPlaying&&!this.props.isPlaying&&this.stop(),!e.isPageScrollLocked&&this.props.isPageScrollLocked&&this.lockScroll(),e.isPageScrollLocked&&!this.props.isPageScrollLocked&&this.unlockScroll(),!1===e.privateUnDisableAnimation&&!0===this.props.privateUnDisableAnimation&&this.props.carouselStore.setStoreState({privateUnDisableAnimation:!1,disableAnimation:!1})}},{key:"componentWillUnmount",value:function(){document.documentElement.removeEventListener("mouseleave",this.handleOnMouseUp,!1),document.documentElement.removeEventListener("mousemove",this.handleOnMouseMove,!1),document.documentElement.removeEventListener("mouseup",this.handleOnMouseUp,!1),window.removeEventListener("scroll",this.handleDocumentScroll,!1),window.removeEventListener("touchmove",this.blockWindowScroll,!1),this.stop(),window.cancelAnimationFrame.call(window,this.moveTimer),window.clearTimeout(this.scrollStopTimer),this.isDocumentScrolling=null,this.moveTimer=null,this.scrollStopTimer=null}},{key:"getSliderRef",value:function(e){this.sliderTrayElement=e}},{key:"fakeOnDragStart",value:function(e){var t=e.screenX,n=e.screenY,i=e.touchDrag,r=e.mouseDrag;this.props.carouselStore.setStoreState({isPlaying:!1}),window.cancelAnimationFrame.call(window,this.moveTimer),"vertical"===this.props.orientation&&this.props.carouselStore.setStoreState({isPageScrollLocked:!0}),this.setState({isBeingTouchDragged:void 0!==i&&i,isBeingMouseDragged:void 0!==r&&r,startX:t,startY:n})}},{key:"fakeOnDragMove",value:function(e,t){var n=this;this.moveTimer=window.requestAnimationFrame.call(window,function(){n.setState(function(i){return{deltaX:e-i.startX,deltaY:t-i.startY,preventingVerticalScroll:Math.abs(t-i.startY)<=n.props.verticalPixelThreshold&&Math.abs(e-i.startX)>=n.props.horizontalPixelThreshold}})})}},{key:"fakeOnDragEnd",value:function(){window.cancelAnimationFrame.call(window,this.moveTimer),this.computeCurrentSlide(),"vertical"===this.props.orientation&&this.props.carouselStore.setStoreState({isPageScrollLocked:!1}),this.setState({deltaX:0,deltaY:0,isBeingTouchDragged:!1,isBeingMouseDragged:!1}),this.isDocumentScrolling=!this.props.lockOnWindowScroll&&null}},{key:"callCallback",value:function(e,t){var n=this.props.trayProps;n&&"function"==typeof n[e]&&(t.persist(),n[e](t))}},{key:"handleOnMouseDown",value:function(e){if(!this.props.dragEnabled)return void this.callCallback("onMouseDown",e);e.preventDefault(),this.fakeOnDragStart({screenX:e.screenX,screenY:e.screenY,mouseDrag:!0}),this.callCallback("onMouseDown",e)}},{key:"handleOnMouseMove",value:function(e){this.state.isBeingMouseDragged&&(this.setState({cancelNextClick:!0}),e.preventDefault(),this.fakeOnDragMove(e.screenX,e.screenY))}},{key:"handleOnMouseUp",value:function(e){this.state.isBeingMouseDragged&&(e.preventDefault(),this.fakeOnDragEnd())}},{key:"handleOnClickCapture",value:function(e){if(!this.state.cancelNextClick)return void this.callCallback("onClickCapture",e);e.preventDefault(),this.setState({cancelNextClick:!1}),this.callCallback("onClickCapture",e)}},{key:"handleOnTouchStart",value:function(e){if(!this.props.touchEnabled)return void this.callCallback("onTouchStart",e);"vertical"===this.props.orientation&&e.preventDefault();var t=e.targetTouches[0];this.fakeOnDragStart({screenX:t.screenX,screenY:t.screenY,touchDrag:!0}),this.callCallback("onTouchStart",e)}},{key:"handleDocumentScroll",value:function(){var e=this;this.props.touchEnabled&&(this.isDocumentScrolling=!0,window.clearTimeout(this.scrollStopTimer),this.scrollStopTimer=window.setTimeout(function(){e.isDocumentScrolling=!1},66))}},{key:"handleOnTouchMove",value:function(e){if(!this.props.touchEnabled||this.props.lockOnWindowScroll&&this.isDocumentScrolling)return void this.callCallback("onTouchMove",e);window.cancelAnimationFrame.call(window,this.moveTimer);var t=e.targetTouches[0];t&&(this.fakeOnDragMove(t.screenX,t.screenY),this.callCallback("onTouchMove",e))}},{key:"forward",value:function(){var e=this.props;return Math.min(e.currentSlide+e.step,e.totalSlides-e.visibleSlides)}},{key:"backward",value:function(){var e=this.props;return Math.max(e.currentSlide-e.step,0)}},{key:"handleOnKeyDown",value:function(e){var t=e.keyCode,n=this.props,i=n.carouselStore,r=n.currentSlide,s=n.disableKeyboard,a=n.totalSlides,l=n.visibleSlides,o={};!0===s||a<=l||(37===t&&(e.preventDefault(),this.focus(),o.currentSlide=Math.max(0,r-1),o.isPlaying=!1),39===t&&(e.preventDefault(),this.focus(),o.currentSlide=Math.min(a-l,r+1),o.isPlaying=!1),i.setStoreState(o))}},{key:"playForward",value:function(){var e=this.props,t=e.carouselStore,n=e.currentSlide;t.setStoreState({currentSlide:this.forward()===n?0:this.forward()})}},{key:"playBackward",value:function(){var e=this.props,t=e.carouselStore,n=e.currentSlide,i=e.totalSlides,r=e.visibleSlides;t.setStoreState({currentSlide:this.backward()===n?i-r:this.backward()})}},{key:"play",value:function(){var e=this.props.playDirection;this.interval=setInterval("forward"===e?this.playForward:this.playBackward,this.props.interval)}},{key:"stop",value:function(){window.clearInterval(this.interval),this.interval=null}},{key:"lockScroll",value:function(){var e=new eI;this.scrollParent=e.getScrollParent(this.sliderTrayElement),this.scrollParent&&(this.originalOverflow=this.originalOverflow||this.scrollParent.style.overflow,this.scrollParent.style.overflow="hidden")}},{key:"unlockScroll",value:function(){this.scrollParent&&(this.scrollParent.style.overflow=this.originalOverflow,this.originalOverflow=null,this.scrollParent=null)}},{key:"blockWindowScroll",value:function(e){this.state.preventingVerticalScroll&&(e.preventDefault(),e.stopImmediatePropagation())}},{key:"computeCurrentSlide",value:function(){var e=t.slideSizeInPx(this.props.orientation,this.sliderTrayElement.clientWidth,this.sliderTrayElement.clientHeight,this.props.totalSlides),n=t.slidesMoved(this.props.moveThreshold,this.props.orientation,this.state.deltaX,this.state.deltaY,e,this.props.dragStep),i=this.props.totalSlides-Math.min(this.props.totalSlides,this.props.visibleSlides),r=L({min:0,max:i,x:this.props.currentSlide+n});this.props.infinite&&(this.props.currentSlide>=i&&n>0&&(r=0),0===this.props.currentSlide&&n<0&&(r=i)),this.props.carouselStore.setStoreState({currentSlide:r})}},{key:"focus",value:function(){this.sliderElement.focus()}},{key:"handleOnTouchEnd",value:function(e){this.endTouchMove(),this.callCallback("onTouchEnd",e)}},{key:"handleOnTouchCancel",value:function(e){this.endTouchMove(),this.callCallback("onTouchCancel",e)}},{key:"endTouchMove",value:function(){this.props.touchEnabled&&this.fakeOnDragEnd()}},{key:"renderMasterSpinner",value:function(){var e=this.props,t=e.hasMasterSpinner,n=e.masterSpinnerFinished,r=e.spinner;return t&&!n?("function"==typeof this.props.onMasterSpinner&&this.props.onMasterSpinner(),i.createElement("div",{className:O([eL.masterSpinnerContainer,"carousel__master-spinner-container"])},r&&r(),!r&&i.createElement(eN,null))):null}},{key:"render",value:function(){var e=this,t=this.props,n=t.ariaLabel,r=(t.carouselStore,t.children),s=t.className,a=t.classNameAnimation,l=t.classNameTray,o=t.classNameTrayWrap,c=t.currentSlide,d=t.disableAnimation,h=(t.disableKeyboard,t.dragEnabled,t.hasMasterSpinner,t.interval,t.isPageScrollLocked,t.isPlaying,t.lockOnWindowScroll,t.masterSpinnerFinished,t.moveThreshold,t.naturalSlideHeight),p=t.naturalSlideWidth,b=(t.onMasterSpinner,t.orientation),S=(t.playDirection,t.privateUnDisableAnimation,t.slideSize),f=t.slideTraySize,v=(t.spinner,t.style),g=t.tabIndex,y=(t.totalSlides,t.touchEnabled,t.trayProps),k=t.trayTag,T=t.visibleSlides,C=t.isIntrinsicHeight,E=m(t,eq),_=u({},v),M={};"vertical"===b&&(M.height=0,M.paddingBottom=w(100*h*T/p),M.width=w(100));var P={},N=w(-(S*c*1));(this.state.isBeingTouchDragged||this.state.isBeingMouseDragged||d)&&(P.transition="none"),C&&(P.display="flex",P.alignItems="stretch"),"vertical"===b?(P.transform="translateY(".concat(N,") translateY(").concat(this.state.deltaY,"px)"),P.width=w(100),P.flexDirection="column"):(P.width=w(f),P.transform="translateX(".concat(N,") translateX(").concat(this.state.deltaX,"px)"),P.flexDirection="row");var D=O(["vertical"===b?eL.verticalSlider:eL.horizontalSlider,"carousel__slider","vertical"===b?"carousel__slider--vertical":"carousel__slider--horizontal",s]),x=O([eL.sliderTrayWrap,"carousel__slider-tray-wrapper","vertical"===b?eL.verticalSlideTrayWrap:eL.horizontalTrayWrap,"vertical"===b?"carousel__slider-tray-wrap--vertical":"carousel__slider-tray-wrap--horizontal",o]),j=O([eL.sliderTray,a||eL.sliderAnimation,"carousel__slider-tray","vertical"===b?eL.verticalTray:eL.horizontalTray,"vertical"===b?"carousel__slider-tray--vertical":"carousel__slider-tray--horizontal",l]),A=(E.dragStep,E.step,E.infinite,E.preventVerticalScrollOnTouch,E.preventingVerticalScroll,E.horizontalPixelThreshold,E.verticalPixelThreshold,m(E,ez)),R=(y.className,y.onClickCapture,y.onMouseDown,y.onTouchCancel,y.onTouchEnd,y.onTouchMove,y.onTouchStart,y.ref,y.style,m(y,eF));return i.createElement("div",u({ref:function(t){e.sliderElement=t},className:D,"aria-live":"polite","aria-label":n,style:_,tabIndex:null!==g?g:0,onKeyDown:this.handleOnKeyDown,role:"listbox"},A),i.createElement("div",{className:x,style:M},i.createElement(k,u({ref:this.getSliderRef,className:j,style:P,onTouchStart:this.handleOnTouchStart,onTouchMove:this.handleOnTouchMove,onTouchEnd:this.handleOnTouchEnd,onTouchCancel:this.handleOnTouchCancel,onMouseDown:this.handleOnMouseDown,onClickCapture:this.handleOnClickCapture},R),r),this.renderMasterSpinner()))}}],[{key:"slideSizeInPx",value:function(e,t,n,i){return("horizontal"===e?t:n)/i}},{key:"slidesMoved",value:function(e,t,n,i,r,s){var a="horizontal"===t?n:i,l=Math.abs(Math.round(a/r)),o=Math.max(Math.abs(a)>=r*e?s:0,l);if(a<0)return o;var c=-o;return 0===c?0:c}}]),t}(i.Component),"propTypes",{ariaLabel:x.string,carouselStore:x.object.isRequired,children:x.node.isRequired,className:x.string,classNameAnimation:x.string,classNameTray:x.string,classNameTrayWrap:x.string,currentSlide:x.number.isRequired,disableAnimation:x.bool,disableKeyboard:x.bool,dragEnabled:x.bool.isRequired,dragStep:x.number,hasMasterSpinner:x.bool.isRequired,infinite:x.bool,interval:x.number.isRequired,isPageScrollLocked:x.bool.isRequired,isPlaying:x.bool.isRequired,lockOnWindowScroll:x.bool.isRequired,preventVerticalScrollOnTouch:x.bool,horizontalPixelThreshold:x.number,verticalPixelThreshold:x.number,masterSpinnerFinished:x.bool.isRequired,moveThreshold:x.number,naturalSlideHeight:x.number.isRequired,naturalSlideWidth:x.number.isRequired,onMasterSpinner:x.func,orientation:I.orientation.isRequired,playDirection:I.direction.isRequired,privateUnDisableAnimation:x.bool,slideSize:x.number.isRequired,slideTraySize:x.number.isRequired,spinner:x.func,step:x.number.isRequired,style:x.object,tabIndex:x.number,totalSlides:x.number.isRequired,touchEnabled:x.bool.isRequired,trayProps:x.shape({className:x.string,onClickCapture:x.func,onMouseDown:x.func,onTouchCancel:x.func,onTouchEnd:x.func,onTouchMove:x.func,onTouchStart:x.func,ref:x.shape({}),style:x.string}),trayTag:x.string,visibleSlides:x.number,isIntrinsicHeight:x.bool}),c(e_,"defaultProps",{ariaLabel:"slider",className:null,classNameAnimation:null,classNameTray:null,classNameTrayWrap:null,disableAnimation:!1,disableKeyboard:!1,dragStep:1,infinite:!1,preventVerticalScrollOnTouch:!0,horizontalPixelThreshold:15,verticalPixelThreshold:10,moveThreshold:.1,onMasterSpinner:null,privateUnDisableAnimation:!1,spinner:null,style:{},tabIndex:null,trayProps:{},trayTag:"div",visibleSlides:1,isIntrinsicHeight:!1}),e_),function(e){return{currentSlide:e.currentSlide,disableAnimation:e.disableAnimation,privateUnDisableAnimation:e.privateUnDisableAnimation,disableKeyboard:e.disableKeyboard,dragEnabled:e.dragEnabled,hasMasterSpinner:e.hasMasterSpinner,infinite:e.infinite,interval:e.interval,isPageScrollLocked:e.isPageScrollLocked,isPlaying:e.isPlaying,lockOnWindowScroll:e.lockOnWindowScroll,preventingVerticalScroll:e.preventingVerticalScroll,masterSpinnerFinished:e.masterSpinnerFinished,naturalSlideHeight:e.naturalSlideHeight,naturalSlideWidth:e.naturalSlideWidth,orientation:e.orientation,playDirection:e.playDirection,slideSize:e.slideSize,slideTraySize:e.slideTraySize,step:e.step,dragStep:e.dragStep,totalSlides:e.totalSlides,touchEnabled:e.touchEnabled,visibleSlides:e.visibleSlides,isIntrinsicHeight:e.isIntrinsicHeight}})},13488:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(63696),r=function(){return(r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function s(e){var t=i.useState(!1),n=t[0],s=t[1],a=i.useState(!1),l=a[0],o=a[1],c=encodeURIComponent(e.id),u="string"==typeof e.playlistCoverId?encodeURIComponent(e.playlistCoverId):null,d=e.title,h=e.poster||"hqdefault",p="&"+e.params,m=e.muted?"&mute=1":"",b=e.announce||"Watch",S=e.webp?"webp":"jpg",f=e.webp?"vi_webp":"vi",v=e.thumbnail||(e.playlist?"https://i.ytimg.com/"+f+"/"+u+"/"+h+"."+S:"https://i.ytimg.com/"+f+"/"+c+"/"+h+"."+S),g=e.noCookie?"https://www.youtube-nocookie.com":"https://www.youtube.com";g=e.cookie?"https://www.youtube.com":"https://www.youtube-nocookie.com";var y=e.playlist?g+"/embed/videoseries?autoplay=1"+m+"&list="+c+p:g+"/embed/"+c+"?autoplay=1&state=1"+m+p,k=e.activatedClass||"lyt-activated",O=e.adNetwork||!1,w=e.aspectHeight||9,T=e.aspectWidth||16,C=e.iframeClass||"",E=e.playerClass||"lty-playbtn",_=e.wrapperClass||"yt-lite",M=e.onIframeAdded||function(){},P=e.rel?"prefetch":"preload";return i.useEffect(function(){l&&M()},[l]),i.createElement(i.Fragment,null,i.createElement("link",{rel:P,href:v,as:"image"}),i.createElement(i.Fragment,null,n&&i.createElement(i.Fragment,null,i.createElement("link",{rel:"preconnect",href:g}),i.createElement("link",{rel:"preconnect",href:"https://www.google.com"}),O&&i.createElement(i.Fragment,null,i.createElement("link",{rel:"preconnect",href:"https://static.doubleclick.net"}),i.createElement("link",{rel:"preconnect",href:"https://googleads.g.doubleclick.net"})))),i.createElement("article",{onPointerOver:function(){n||s(!0)},onClick:function(){l||o(!0)},className:_+" "+(l?k:""),"data-title":d,style:r({backgroundImage:"url("+v+")"},{"--aspect-ratio":w/T*100+"%"})},i.createElement("button",{type:"button",className:E,"aria-label":b+" "+d}),l&&i.createElement("iframe",{className:C,title:d,width:"560",height:"315",frameBorder:"0",allow:"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,src:y})))}},43023:(e,t,n)=>{n.d(t,{R:()=>a,x:()=>l});var i=n(63696);let r={},s=i.createContext(r);function a(e){let t=i.useContext(s);return i.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),i.createElement(s.Provider,{value:t},e.children)}}}]); |