System.register(["./index-legacy-26fae7cb-1706882452509.js"],(function(t,n){"use strict";var e,i,o,a,s;return{setters:[t=>{e=t.d,i=t.r,o=t.e,a=t.y,s=t.f}],execute:function(){var n=document.createElement("style");n.textContent="._wrap_3lsnj_1{max-width:100%;overflow:hidden;display:flex;align-items:center}._wrap_3lsnj_1._isAnitaion_3lsnj_7 ._notice_3lsnj_7,._wrap_3lsnj_1:hover ._notice_3lsnj_7{width:auto;overflow:initial}._notice_3lsnj_7{transition-duration:5s;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition-timing-function:linear}\n",document.head.appendChild(n);const r="_wrap_3lsnj_1",l="_isAnitaion_3lsnj_7",c="_notice_3lsnj_7",u=t=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{t()}))}))};t("T",e({name:"TheNoticeBar",props:{text:{type:String,default:""},isAnimation:{type:Boolean,default:!1}},setup(t){const n=i(),e=i(),d=o({isActive:!1,wrapWidth:0,contentWidth:0,contentStyle:{transitionDuration:"0s",transform:"translateX(0px)"},time:null}),_=()=>{!d.isActive&&e.value&&n.value&&(d.isActive=!0,d.contentWidth=e.value.getBoundingClientRect().width,d.wrapWidth=n.value.getBoundingClientRect().width,m())},m=()=>{if(d.contentWidth<=d.wrapWidth||!d.isActive)return d.contentStyle.transitionDuration="0s",void(d.contentStyle.transform="translateX(0px)");d.contentStyle.transitionDuration="5s",d.contentStyle.transform="translateX(-100%)",d.time=setTimeout((()=>{d.contentStyle.transitionDuration="0s",d.contentStyle.transform=`translateX(${d.wrapWidth}px)`,u(m)}),5e3)},p=()=>{clearTimeout(d.time),d.isActive=!1,d.contentStyle.transitionDuration="0s",d.contentStyle.transform="translateX(0px)",d.time=null};return a((()=>t.isAnimation),(t=>{u(t?_:p)})),()=>s("div",{ref:n,class:[r,t.isAnimation?l:""],onMouseenter:()=>!t.isAnimation&&_(),onMouseleave:()=>!t.isAnimation&&p()},[s("div",{ref:e,style:d.contentStyle,class:c},[t.text])])}}))}}}));
