var __spreadArrays=this&&this.__spreadArrays||function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;for(var n=Array(t),r=0,e=0;e<i;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,r++)n[r]=o[s];return n};System.register(["./p-c0c66e97.system.js"],(function(t){"use strict";var e,i,n,r,o;return{setters:[function(t){e=t.r;i=t.c;n=t.h;r=t.H;o=t.g}],execute:function(){var s=t("cc_tabs_underline",function(){function t(t){var n=this;e(this,t);this.animating=false;this.size="md";this.border=false;this.center=false;this.color="primary";this.options=[];this.linePosition={left:0,width:0};this.handleOptionClick=function(t){return function(){var e=n._options[t];if(e.disabled||n.animating){return}n.updateOptions(t);n.changeOption.emit(e.value)}};this.changeOption=i(this,"changeOption",7)}t.prototype.setOptions=function(t,e){var i=JSON.stringify(t);var n=JSON.stringify(e);if(i!==n){this._options=t}};t.prototype.animateFromToTab=function(t){var e=this;if(this.linePosition.left===0&&this.linePosition.width===0){return}var i=t.findIndex((function(t){return!!t.active}));var n=this.wrapTabs.querySelectorAll(".tabLine__button")[i];var r=n.getBoundingClientRect();var o=this.el.getBoundingClientRect();var s=r.left-o.left;var a=this.calculateLinePosition({prevLeft:this.linePosition.left,nextWidth:r.width,nextLeft:s,side:this.linePosition.left<s?"toRight":"toLeft"});this.animating=true;this.linePosition=a.firstStep;setTimeout((function(){e.linePosition=a.secondStep;e.animating=false}),300)};t.prototype.animateDefaultLine=function(){var t=this._options.findIndex((function(t){return!!t.active}));if(t<0)return;var e=this.wrapTabs.querySelectorAll(".tabLine__button")[t];var i=e.getBoundingClientRect();var n=this.el.getBoundingClientRect();this.linePosition={left:i.left-n.left,width:i.width}};t.prototype.calculateLinePosition=function(t){var e={left:t.side==="toRight"?t.prevLeft:t.nextLeft,width:t.side==="toRight"?t.nextLeft-t.prevLeft+t.nextWidth:t.prevLeft-t.nextLeft+t.nextWidth};var i={left:t.nextLeft,width:t.nextWidth};return{firstStep:e,secondStep:i}};t.prototype.updateOptions=function(t){var e=__spreadArrays(this._options).map((function(t){return Object.assign(Object.assign({},t),{active:false})}));e[t].active=true;this._options=e};t.prototype.componentWillLoad=function(){this._options=this.options};t.prototype.componentDidLoad=function(){this.animateDefaultLine()};t.prototype.render=function(){var t=this;return n(r,null,n("div",{class:{tabLine:true,"tabLine--border":this.border,"tabLine--center":this.center},ref:function(e){return t.wrapTabs=e}},this._options.map((function(e,i){return n("button",{key:"tabItem_"+i,class:{tabLine__button:true,"tabLine__button--secondary":t.color==="secondary","tabLine__button--sm":t.size==="sm","tabLine__button--active":e.active,"tabLine__button--disabled":e.disabled},onClick:t.handleOptionClick(i)},e.text)})),n("div",{class:{tabLine__underline:true,"tabLine__underline--secondary":this.color==="secondary"},style:{left:this.linePosition.left+"px",width:this.linePosition.width+"px"}})))};Object.defineProperty(t.prototype,"el",{get:function(){return o(this)},enumerable:true,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{options:["setOptions"],_options:["animateFromToTab"]}},enumerable:true,configurable:true});Object.defineProperty(t,"style",{get:function(){return":host{display:block}.tabLine{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative}.tabLine__button{-webkit-appearance:button;padding:0;margin:0;font-family:inherit;cursor:pointer;background-color:transparent;background-image:none;color:inherit;border:none;font-size:100%;outline:0;margin-top:1.2rem;margin-bottom:1.2rem;margin-left:2.4rem;margin-right:2.4rem;font-size:1.4rem;font-weight:900;line-height:2.4rem}.tabLine__button--sm{font-size:1.1rem;line-height:1.6rem}.tabLine__button--disabled{color:var(--disabled-text);cursor:not-allowed}.tabLine__button--active{color:var(--primary)}.tabLine__button--active.tabLine__button--secondary{color:var(--secondary)}.tabLine__underline{position:absolute;background-color:var(--primary);bottom:0;height:.3rem;-webkit-transition:all .3s ease;transition:all .3s ease}.tabLine__underline--secondary{background-color:var(--secondary)}.tabLine--center{-ms-flex-pack:distribute;justify-content:space-around}.tabLine--border{border-width:0;border-bottom-width:1px;border-style:solid;border-color:var(--neutral-01)}"},enumerable:true,configurable:true});return t}())}}}));