Cube('pandav:/com/tabV2/1.2.4/Tab.jsx',['pandav:/npm/react/16.13.1'],function(a,b,c){function d(a){"@babel/helpers - typeof";return d='function'==typeof Symbol&&'symbol'==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&'function'==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?'symbol':typeof a},d(a)}function e(a,b){if(!(a instanceof b))throw new TypeError('Cannot call a class as a function')}function f(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,'value'in c&&(c.writable=!0),Object.defineProperty(a,h(c.key),c)}function g(a,b,c){return b&&f(a.prototype,b),c&&f(a,c),Object.defineProperty(a,'prototype',{writable:!1}),a}function h(a){var b=j(a,'string');return'symbol'==d(b)?b:b+''}function j(a,b){if('object'!=d(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var e=c.call(a,b||'default');if('object'!=d(e))return e;throw new TypeError('@@toPrimitive must return a primitive value.')}return('string'===b?String:Number)(a)}function k(a,b,c){return b=p(b),l(a,n()?Reflect.construct(b,c||[],p(a).constructor):b.apply(a,c))}function l(a,b){if(b&&('object'===d(b)||'function'==typeof b))return b;if(void 0!==b)throw new TypeError('Derived constructors may only return object or undefined');return m(a)}function m(a){if(void 0===a)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return a}function n(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(n=function b(){return!!a})()}function p(a){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function b(a){return a.__proto__||Object.getPrototypeOf(a)},p(a)}function q(a,b){if('function'!=typeof b&&null!==b)throw new TypeError('Super expression must either be null or a function');a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,'prototype',{writable:!1}),b&&r(a,b)}function r(a,b){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function c(a,b){return a.__proto__=b,a},r(a,b)}function s(a){for(var b=arguments,c=function c(){var e=null==b[d]?{}:b[d],f=Object.keys(e);'function'==typeof Object.getOwnPropertySymbols&&(f=f.concat(Object.getOwnPropertySymbols(e).filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),f.forEach(function(b){x(a,b,e[b])})},d=1;d<arguments.length;d++)c();return a}function t(a){var b=[];if(a.startsWith('#'))if(7>a.length)for(var c,d=1;3>=d;d++)c=a[d],b.push(parseInt(c+c,16));else for(var e=1;5>=e;e+=2)b.push(parseInt(a.slice(e,e+2),16));return b}function u(a,b,c,d){var e={};a.tabseries.forEach(function(a){return e[a.value]=a.widthWeight});for(var f,g='',h=0;h<d;h++)f=1,b&&b[h]&&(f=e[b[h].s]||1),g+=f+'fr ';return'repeat('+c+', 1fr) / '+g}function v(a,b){var c=t(a);return c[3]*=b,'rgba('.concat(c.join(','),')')}var w=c('pandav:/npm/react/16.13.1'),x=function d(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a},y=function(a){function b(a){var c;return e(this,b),c=k(this,b,[a]),c.state={currentIndex:a.config.chart.currentIndex-1},c.refresh(a),c}return q(b,a),g(b,[{key:'onAction',value:function b(a){var c=this,d=a.data.index-1,e=this.props.config.chart,f=e.stay,g=e.interval,h=0>f-g?0:f-g;this.setIndex(d),this.clearTimeout(),this.timeout=setTimeout(function(){return c.animate(c.props)},1e3*h)}},{key:'onClick',value:function b(a){var c=this,d=+a.currentTarget.dataset.id,e=this.props.config.chart,f=e.stay,g=e.interval,h=0>f-g?0:f-g,i=this.props.data||[];this.setIndex(d),this.clearTimeout(),this.timeout=setTimeout(function(){return c.animate(c.props)},1e3*h),this.props.clickCallBack&&this.props.emitEvent('click',i[d])}},{key:'handleMouseEnter',value:function b(a){var c=this.props.data||[],d=+a.currentTarget.dataset.id;this.props.emitEvent&&this.props.emitEvent('mouseEnter',c[d])}},{key:'handleMouseLeave',value:function b(a){var c=this.props.data||[],d=+a.currentTarget.dataset.id;this.props.emitEvent&&this.props.emitEvent('mouseLeave',c[d])}},{key:'getStyle',value:function e(a,b,c,d){var f=this.props.data||[],g=this.getBackground(a.background),h=this.getBackground(b.background),i=f[d],j=c.find(function(a){return a.value===i.s})||{},k=j.background,l=j.entityTranslate,m=j.textTranslate,n=k&&k.show?k:{},o=n.fillType,p=n.defaultColor,q=n.currentColor,r=n.defaultUrl,t=n.currentUrl,u=!!o&&this.getBackground({fillType:o,colors:p,url:r}),v=!!o&&this.getBackground({fillType:o,colors:q,url:t});return{style:s(s({},a),{},{background:u||g}),currentStyle:s(s({},b),{},{background:v||h}),textTranslate:m,entityTranslate:l}}},{key:'refresh',value:function b(a){this.data=a.data,this.config=a.config,this.animate(a)}},{key:'getIndex',value:function c(a,b){return isNaN(b)||0>a?0:a>=b?b-1:a}},{key:'getRelativeData',value:function a(){}},{key:'componentWillReceiveProps',value:function c(a,b){this.refresh(a);var d=this.config.chart.currentIndex-1,e=_.isEqual(this.props.data,a.data),f=_.isEqual(this.props.config,a.config);f&&e||this.setIndex(d)}},{key:'dataTogether',value:function b(a){var c=this,d=this.props.data,e=a.callbackValues,f=this.config,g=f.chart,h=f.interaction,i=g.linked,j=g.animate,k=j.stay,l=j.interval;if(i){var m=Object.values(h.callback),n=this.state.currentIndex,o=Object.entries(e)[0];if(o){var p=o[0],q=m.find(function(a){return a.target===p}).origin,r=d.findIndex(function(a){return a[q]==o[1]}),s=0>k-l?0:k-l;/^\d+(?=\.{0,1}\d+$|$)/.test(r)&&!_.isEqual(e,nextCallbackValues)&&n!==index&&(this.setIndex(index),this.clearTimeout(),this.timeout=setTimeout(function(){c.animate(c.props)},1e3*s))}}}},{key:'componentDidUpdate',value:function d(a,b,c){var e=this.props,f=this.props.callbackValues||{},g=e.data,h=a.callbackValues,i=this.config,j=i.chart,k=i.interaction;j.linked&&this.setMoverStyle()}},{key:'animate',value:function a(){var b=this,a=this.config.chart.animate;this.clearTimeout();var c;a.show&&this.data&&0<this.data.length&&(c=a.interval,this.selfTimeout=setInterval(function(){b.setIndex(b.state.currentIndex+1)},1e3*c))}},{key:'getBackground',value:function b(a){var c=a.fillType,e=a.colors,f=a.url,g='';if('color'===c){if('linear'===e.type){var h=e.linear,i=h.angle,j=h.stops,k=h.opacity;g+='linear-gradient('.concat(i,'deg,');var l=Array.isArray(j)?j:[j];return l.sort(function(c,a){return c.offset-a.offset}),g+=l.map(function(a){return v(a.color,k)+' '+a.offset+'%'}).join(','),g+=')',g}return e}return'50% 50% / 100% 100% no-repeat url(\''.concat(f,'\')')}},{key:'componentDidMount',value:function a(){var b=this.state.currentIndex,c=this.config.chart.defaultCallback;this.setMoverStyle(),this.handleClickEvents(b)}},{key:'setMoverStyle',value:function a(){if(this.mover&&this.list&&this.list.children&&0<this.list.children.length){var b=this.list.children[this.state.currentIndex],c=b.offsetWidth,d=b.offsetHeight,e=b.offsetLeft,f=b.offsetTop;this.mover.style.width=c+'px',this.mover.style.height=d+'px',this.mover.style.transform='translate3d('+e+'px,'+f+'px, 0)'}}},{key:'setIndex',value:function b(a){a>=this.data.length&&(a=0),this.setState({currentIndex:a}),this.getRelativeData(a,this.props),this.handleClickEvents(a)}},{key:'handleClickEvents',value:function b(a){var c=this.props.data||[];this.props.emitEvent&&this.props.emitEvent('click',c[a])}},{key:'clearTimeout',value:function(a){function b(){return a.apply(this,arguments)}return b.toString=function(){return a.toString()},b}(function(){this.selfTimeout&&clearInterval(this.selfTimeout),this.timeout&&clearTimeout(this.timeout),this.selfTimeout=null,this.timeout=null})},{key:'createWebKitScroll',value:function b(a){return a.show?'\n        .TabV2::-webkit-scrollbar-thumb {\n          background: '.concat(a.thumb,';\n        }\n        .TabV2::-webkit-scrollbar-track {\n          background-color: ').concat(a.track,';\n        }\n        .TabV2::-webkit-scrollbar {\n          width: ').concat(a.length,'px;\n          height:').concat(a.length,'px;\n        }\n      '):null}},{key:'render',value:function a(){var b=this,c=this.state.currentIndex,d=this.props.data||[],e=this.config,f=e.chart,g=e.tabStyle,h=e.tabSeries,i=f.grid,j=f.text,k=f.scrollbar,l=j.textVertical,m=j.writingMode,n=i.GridGap,o=i.gridLayout,p=o.column,q=o.row,r=n.rowGridGap,t=n.columnGridGap,v=g.defaultStyle,x=g.currentStyle;return w.createElement('ul',{ref:function c(a){return b.list=a},className:'TabV2',style:{width:this.props.width,height:this.props.height,display:'grid',gridTemplate:u(h,d,q,p),gridGap:r+'px '+t+'px',overflow:k.show?'scroll':'visible'}},w.createElement('style',null,this.createWebKitScroll(k)),d&&d.map(function(a,d){var e=b.getStyle(v,x,h.tabseries,d),f=e.style,g=e.currentStyle,i=e.textTranslate,n=e.entityTranslate,o=e.alignItems,p=d===c?g:f,t=p.border,u=p.text,y=p.background,z=u.textTranslate,A=u.shadow,B=u.textShadowConfig,C=i||z;return w.createElement('li',Object.assign({},{onClick:b.onClick.bind(b),onMouseEnter:b.handleMouseEnter.bind(b),onMouseLeave:b.handleMouseLeave.bind(b)},{"data-id":d,style:{display:'flex',flexDirection:'column',height:k.show?(b.props.height-(q-1)*r)/q:'auto',writingMode:m,alignItems:o||j.alignItems,justifyContent:'center',cursor:'pointer',transition:'all 0.3s linear',border:t.show?''.concat(t.borderWidth,'px solid ').concat(t.borderColor):'',transform:void 0===n?'translate(0, 0)':'translate('.concat(n.x,'px, ').concat(n.y,'px)'),background:y},key:d}),w.createElement('div',{"data-id":d,style:s(s({cursor:'pointer',transform:'tb-rl'===m&&'center'===l?'translate(0,-50%)translate3d('+C.x+'px, '+C.y+'px, 0)':'translate3d('+C.x+'px, '+C.y+'px, 0)',textShadow:A?''.concat(B.hShadow,'px ').concat(B.vShadow,'px ').concat(B.blur,'px ').concat(B.color):'none',fontStyle:u.textStyle.italic,fontWeight:u.textStyle.fontWeight},u.textStyle),{},{lineHeight:u.textStyle.lineHeight+'px',alignItems:j.alignItems,position:'absolute',top:'horizontal-tb'===m?'':'top'===l?'0%':'center'===l?'50%':'',bottom:'horizontal-tb'===m?'':'bottom'===l?'0%':'',textOrientation:'tb-rl'===m?'upright':'',textAlign:'center'==j.alignItems?j.alignItems:'flex-start'==j.alignItems?'left':'right'})},a?a.content:''))}))}},{key:'componentWillUnmount',value:function a(){this.scrollbar=null,this.clearTimeout()}}]),b}(w.Component);return a.exports=y,a.exports});