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