import{c as v,r as b,j as x}from"./app-BiexncSX.js";import{B as D}from"./button-Cwvd_D5X.js";import{c as S}from"./utils-DvRnx1Xn.js";function k(r){const e=v.c(18),{stayDays:t,selectedDays:a,setSelectedDays:n}=r;let c;e[0]!==a||e[1]!==n?(c=s=>{a.includes(s)?n(a.filter(l=>l!==s)):n([...a,s])},e[0]=a,e[1]=n,e[2]=c):c=e[2];const o=c,h=E;let m;e[3]!==n||e[4]!==t?(m=()=>{const s=new Set(t.filter(w).map(y));n(l=>l.filter(p=>s.has(p)))},e[3]=n,e[4]=t,e[5]=m):m=e[5];let f;if(e[6]!==t?(f=[t],e[6]=t,e[7]=f):f=e[7],b.useEffect(m,f),t.length<=0)return;let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=x.jsx("p",{className:"text-xs text-neutral-500",children:"Select days"}),e[8]=d):d=e[8];let i;if(e[9]!==a||e[10]!==t||e[11]!==o){let s;e[13]!==a||e[14]!==o?(s=l=>{const p=h(l),g=l.available;return x.jsx(D,{size:"sm",onClick:()=>g&&o(l.date),className:S("rounded-sm border diagonal-gray bg-diagonal text-xs hover:bg-diagonal hover:text-block hover:ring-4 ring-main/40",g?a.includes(l.date)?"bg-main  text-white border-main":"text-neutral-500 ":"opacity-50 cursor-not-allowed text-neutral-400 hover:bg-diagonal hover:ring-0 hover:text-neutral-400"),children:p},l.date)},e[13]=a,e[14]=o,e[15]=s):s=e[15],i=t.map(s),e[9]=a,e[10]=t,e[11]=o,e[12]=i}else i=e[12];let u;return e[16]!==i?(u=x.jsxs("div",{className:"space-y-2",children:[d,x.jsx("div",{className:"flex flex-wrap gap-2",children:i})]}),e[16]=i,e[17]=u):u=e[17],u}function y(r){return r.date}function w(r){return r.available}function E(r){return new Date(r.date).toLocaleDateString("en-US",{month:"short",day:"numeric"})}export{k as U};
