1import{b as B,r as u,c as E,a as F,m as C,j as p,k as o,o as m,t as f,l as S,w as I,am as D,x as R,a6 as A,q as g,ak as K,al as V,F as L,n as M,A as N}from"./CzV-f8tj.js";/* empty css */const z={key:0,class:"border-b border-[#BEBEBE] py-6 px-2"},H={class:"-my-3 w-full flow-root"},T=["aria-expanded","aria-controls","id"],j={class:"font-400 text-xl capitalize"},q=["id","aria-labelledby"],G={class:"space-y-6 mt-4"},J=["aria-label"],O=["id","aria-label","aria-checked","tabindex","onClick","onMouseover","onFocus","onKeydown"],P={class:"sr-only"},Q=B({__name:"ListingFiltersRating",props:{filter:{},selectedFilters:{}},emits:["select-value"],setup(y,{expose:x,emit:h}){const _=h,t=y,r=u(!1),c=u(0),d=E(()=>r.value?c.value:t.selectedFilters?.rating||0),l=e=>{c.value=e,r.value=!0},v=e=>{const a=t.selectedFilters?.rating!==e?e:void 0;_("select-value",{code:t.filter?.code,value:a}),r.value=!1,c.value=a||0},n=u(!1),b=()=>{n.value=!n.value,n.value&&A(()=>{const e=document.getElementById(`star-rating-1-${t.filter.code}`);e&&e.focus()})};x({closeFilter:()=>{n.value=!1}});const{sessionContext:k}=F(),$=(e,a)=>{switch(e.key){case"ArrowRight":e.preventDefault(),a<5?(document.getElementById(`star-rating-${a+1}-${t.filter.code}`)?.focus(),l(a+1)):(document.getElementById(`star-rating-1-${t.filter.code}`)?.focus(),l(1));break;case"ArrowLeft":e.preventDefault(),a>1?(document.getElementById(`star-rating-${a-1}-${t.filter.code}`)?.focus(),l(a-1)):(document.getElementById(`star-rating-5-${t.filter.code}`)?.focus(),l(5));break;case"Enter":case"Space":e.preventDefault(),v(a);break;case"Home":e.preventDefault(),document.getElementById(`star-rating-1-${t.filter.code}`)?.focus(),l(1);break;case"End":e.preventDefault(),document.getElementById(`star-rating-5-${t.filter.code}`)?.focus(),l(5);break}},w=e=>{(e.key==="Enter"||e.key==="Space")&&(e.preventDefault(),b())};return(e,a)=>C(k)?.salesChannel?.translated?.customFields?.isRatingEnabled?(g(),p("div",z,[o("h3",H,[o("button",{type:"button",class:"w-full flex items-center space-x-4 text-left py-2 text-xl bg-uppababy-bodybg text-base text-black",onClick:b,onKeydown:w,"aria-expanded":n.value?"true":"false","aria-controls":`filter-panel-${t.filter.code}`,id:`filter-heading-${t.filter.code}`},[o("i",{class:m(["text-black text-xl",n.value?"i-carbon-chevron-up":"i-carbon-chevron-down"]),"aria-hidden":"true",focusable:"false"},null,2),o("span",j,f(t.filter.label),1)],40,T)]),S(D,{name:"fade",mode:"out-in"},{default:I(()=>[K(o("div",{id:`filter-panel-${t.filter.code}`,"aria-labelledby":`filter-heading-${t.filter.code}`,role:"region",tabindex:"-1"},[o("div",G,[o("div",{class:"flex",role:"radiogroup","aria-label":`${t.filter.label} filter`,onMouseleave:a[1]||(a[1]=s=>r.value=!1)},[(g(),p(L,null,M(5,s=>o("button",{key:s,id:`star-rating-${s}-${t.filter.code}`,class:m(["h-6 w-6 icon focus-visible:outline-blue-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2",{"ub-star-filled":d.value>=s,"ub-star-empty":d.value<s}]),"aria-label":`${s} out of 5 stars`,"aria-checked":d.value>=s?"true":"false",tabindex:s===1?"0":"-1",role:"radio",onClick:i=>v(s),onMouseover:i=>l(s),onFocus:i=>l(s),onBlur:a[0]||(a[0]=i=>r.value=!1),onKeydown:i=>$(i,s)},[o("span",P,"Set rating to "+f(s)+" "+f(s===1?"star":"stars"),1)],42,O)),64))],40,J)])],8,q),[[V,n.value]])]),_:1})])):R("",!0)}}),Y=N(Q,[["__scopeId","data-v-20e6a5da"]]);export{Y as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.