var b=e=>{throw TypeError(e)};var u=(e,t,a)=>t.has(e)||b("Cannot "+a);var d=(e,t,a)=>(u(e,t,"read from private field"),a?a.call(e):t.get(e)),p=(e,t,a)=>t.has(e)?b("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,a),y=(e,t,a,s)=>(u(e,t,"write to private field"),s?s.call(e,a):t.set(e,a),a),r=(e,t,a)=>(u(e,t,"access private method"),a);var l,h,i,g,A,q,m,B,T;class F{constructor(t){p(this,i);p(this,l);p(this,h);y(this,h,t),y(this,l,d(this,h).querySelectorAll("[data-tab]"))}init(){r(this,i,g).call(this),r(this,i,A).call(this)}handleVariationChange(t){t.closest("[data-tab-content]")}}l=new WeakMap,h=new WeakMap,i=new WeakSet,g=function(){const t=this;d(this,l).forEach(function(a){a.addEventListener("click",function(){var s;r(s=t,i,q).call(s,this)})})},A=function(){const t=Array.from(d(this,l)).find(a=>a.classList.contains("active"));t&&r(this,i,m).call(this,t)},q=function(t,a=!1){if(t.classList.contains("active"))return;d(this,l).forEach(n=>n.classList.remove("active")),document.querySelectorAll("[data-tab-content]").forEach(n=>{n.classList.remove("active"),r(this,i,T).call(this,n)}),t.classList.add("active");const o=t.getAttribute("data-tab"),c=document.getElementById(o);if(c&&(r(this,i,B).call(this,c,400),c.classList.add("active")),r(this,i,m).call(this,t),!a&&c){const n=c.querySelector("[data-fluent-cart-pricing-table-variant]");n&&n.click()}},m=function(t){const a=document.querySelector("[data-tab-active-bar]");if(!a)return;const s=t.getBoundingClientRect(),o=t.parentElement.getBoundingClientRect();a.style.left=`${s.left-o.left}px`,a.style.width=`${s.width}px`,a.style.height=`${s.height}px`},B=function(t,a=400){t.style.opacity="0",t.style.display="block";const s=performance.now(),o=c=>{const n=c-s,f=Math.min(n/a,1);t.style.opacity=f,f<1&&requestAnimationFrame(o)};requestAnimationFrame(o)},T=function(t,a=400){const s=performance.now(),o=parseFloat(getComputedStyle(t).opacity),c=n=>{const f=n-s,v=Math.min(f/a,1);t.style.opacity=o*(1-v),v>=1?t.style.display="none":requestAnimationFrame(c)};requestAnimationFrame(c)};export{F};
