import{r as a,j as s}from"./jsx-runtime-CgWCn3gT.js";import{l as r}from"./styled-components.browser.esm-CQ4IZagM.js";import{l as d,I as u}from"./legacy-shell-D4JdMu14.js";import{u as c}from"./useTranslation-CksCcIr-.js";function p(e){const[n,t]=a.useState(()=>new Date);return a.useEffect(()=>{if(!e)return;const i=setInterval(()=>t(new Date),60*1e3);return()=>clearInterval(i)},[e]),n}function B(e){const{i18n:n}=c(),t=n.language||"en",i=p(!!e);return a.useMemo(()=>e?d(e,{locale:t,now:i}):null,[e,t,i])}const f=[];function v(e){const{i18n:n}=c(),t=n.language||"en",i=!!(e&&e.length),o=p(i);return a.useMemo(()=>i?e.map(l=>l?d(l,{locale:t,now:o}):null):f,[e,i,t,o])}const y=({promotion:e})=>{const{t:n}=c();return!e||!e.offPercent?null:s.jsxs(x,{$active:e.active,children:[s.jsx(u,{name:"IcTicketPercent",size:12}),s.jsx("span",{children:n("{{off}}% off",{off:e.offPercent})}),e.ruleText?s.jsxs("span",{className:"rule",children:[s.jsx("span",{className:"sep",children:"·"}),s.jsx("span",{children:e.ruleText})]}):null]})},C=({active:e,listText:n,currentText:t})=>!e||!n||n===t?s.jsx(w,{children:t}):s.jsxs(g,{children:[s.jsx(h,{children:n}),s.jsx(m,{children:t})]}),x=r.span.withConfig({componentId:"sc-1r0ldgq-0"})(["display:inline-flex;align-items:center;gap:4px;height:22px;padding:0 8px;border-radius:11px;font-size:12px;white-space:nowrap;font-weight:",";border:1px solid ",";color:#F5559B;background:",";.sep{opacity:0.6;}.rule{display:inline-flex;align-items:center;gap:4px;}@media (max-width:768px){flex-wrap:wrap;height:auto;min-height:22px;padding:2px 8px;max-width:100%;gap:2px 8px;.sep{display:none;}}"],({$active:e})=>e?600:500,({$active:e})=>e?"#F5559B":"#FFADD2",({$active:e})=>e?"#FFF0F6":"transparent"),g=r.span.withConfig({componentId:"sc-1r0ldgq-1"})(["display:inline-flex;flex-direction:column;align-items:flex-start;vertical-align:middle;line-height:1.2;"]),h=r.span.withConfig({componentId:"sc-1r0ldgq-2"})(["color:#A9AEB8;text-decoration:line-through;font-size:0.85em;"]),m=r.span.withConfig({componentId:"sc-1r0ldgq-3"})(["color:#F5559B;font-weight:600;"]),w=r.span.withConfig({componentId:"sc-1r0ldgq-4"})([""]);export{y as P,B as a,C as b,v as u};
