1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/directory-map-DYIw8jRZ.js","assets/app-CHNeYYe9.js","assets/app-CcxQ6Z9I.css","assets/mapkit-loader-Bj5-mtA5.js","assets/legacy-i18n-CSRMgxmn.js","assets/loader-circle-ExgbCRKo.js","assets/createLucideIcon-DFbm86lT.js"])))=>i.map(i=>d[i]); 2import{u as ut,r as T,j as o,c as Ge,L as at,g as A,h as $s,w as Bs,a as Ls,b as qt,x as Ds,_ as Cr,H as Ps,v as Fs}from"./app-CHNeYYe9.js";import{u as As,b as Os,l as Ws,C as Vs,P as qs}from"./index-DlU-b2Ic.js";import{T as Us,L as Gs}from"./language-footer-select-C5ggn2Mv.js";import{d as Ks,c as Qs,b as Ys,D as Xs}from"./dialog-CTMojMnN.js";import{L as lt}from"./loader-circle-ExgbCRKo.js";import{L as Nr}from"./list-CNu4QLEW.js";import{c as xo}from"./createLucideIcon-DFbm86lT.js";import{s as Tr,b as Zs}from"./specializations-DPXp43z3.js";import{S as Xo}from"./star-Cr8ovJjz.js";import{B as En}from"./building-2-hML6HHk7.js";import{M as nt}from"./map-pin-BqcuTPhn.js";import{A as on}from"./arrow-right-Ce9roGiA.js";import{C as Js,a as Ln}from"./chevron-right-BMCMEcwg.js";import{S as nn}from"./search-B-pF7VvE.js";import{C as el}from"./cta-section-BAQEOM7w.js";import{c as tl,S as nl,a as ol,b as rl}from"./sheet-DTfgBJf4.js";import{g as sl}from"./legacy-i18n-CSRMgxmn.js";import{u as ll}from"./seo-n_oxLeBm.js";import{d as il}from"./index-DR3SJk-M.js";
2import{X as st}from"./x-1JHAFA1U.js";import{C as no}from"./check-B0gTgWqG.js";/* empty css */import"./app-logo-icon-BYdiXbXT.js";import"./chevron-down-Dqc54jlU.js";import"./menu-htjLR-3G.js";import"./button-DrZeo7ph.js";import"./index-DNnrQnrO.js";import"./utils-DmMR6ugC.js";import"./checkbox-BdYlC2eh.js";import"./index-D6OEDMBw.js";import"./index-CfEQ4CwO.js";import"./index-D2FMdoIn.js";import"./index-CARSVpdp.js";import"./IconCheck-vmBoN1rh.js";import"./createReactComponent-BywYx__d.js";import"./label-CEo4oEbI.js";import"./index-D-q4aC2b.js";import"./index-Xf5AejSH.js";import"./pro-space-access-BvoH9_Jz.js";import"./index-7GXKiMn0.js";import"./monitor-J09yf7ii.js";import"./index-D7Bcrx24.js";import"./index-BIfe663z.js";import"./index-BoE6jL9Q.js";import"./IconX-D5Jodp7g.js";import"./index-GXopm7lD.js";import"./index-Dvn6N3aY.js";import"./animations-BRb141Xe.js";const al=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],Hn=xo("House",al);const cl=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]],ul=xo("Map",cl);const dl=[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]],Mn=xo("SlidersHorizontal",dl);function oo(n){const e=String(n.getMonth()+1).padStart(2,"0"),t=String(n.getDate()).padStart(2,"0");return`${n.getFullYear()}-${e}-${t}`}function Zo(n,e){const t=new Date(n);return t.setDate(t.getDate()+e),t}function ml({open:n,section:e=null,aggregations:t,selection:r,resultsCount:i,query:s="",availabilityHorizonDays:a,onOpenChange:u,onApply:c,onClear:m}){const{t:h}=ut(),[x,v]=T.useState(r),[S,d]=T.useState(null),[C,j]=T.useState(!1),g={types:T.useRef(null),cities:T.useRef(null),areas:T.useRef(null),modes:T.useRef(null),amenities:T.useRef(null),ratings:T.useRef(null),availability:T.useRef(null)};T.useEffect(()=>{n?v(r):d(null)},[n,r]),T.useEffect(()=>{if(!n)return;const b=new URLSearchParams;s.trim()&&b.set("q",s.trim()),x.types.length===1?b.set("type",x.types[0]):x.types.length>1&&b.set("types",x.types.join(",")),x.ville&&b.set("ville",x.ville),x.quartier&&b.set("quartier",x.quartier),x.modes.length===1?b.set("mode",x.modes[0]):x.modes.length>1&&b.set("modes",x.modes.join(",")),x.amenities.length>0&&b.set("amenities",x.amenities.join(",")),x.rating!==null&&b.set("rating",String(x.rating)),x.date!==null&&(b.set("date",x.date),x.slot!==null&&b.set("slot",x.slot));const f=new AbortController;j(!0);const y=window.setTimeout(()=>{fetch(`/api/directory/count?${b.toString()}`,{signal:f.signal,headers:{Accept:"application/json"}}).then(z=>{if(!z.ok)throw new Error(`Directory count request failed with status ${z.status}`);return z.json()}).then(z=>{f.signal.aborted||(d(z.count??null),j(!1))}).catch(()=>{f.signal.aborted||(d(null),j(!1))})},250);return()=>{window.clearTimeout(y),f.abort()}},[n,x,s]),T.useEffect(()=>{if(!n||!e)return;const b=window.setTimeout(()=>{g[e].current?.scrollIntoView({block:"start",behavior:"smooth"})},60);return()=>window.clearTimeout(b)},[n,e]);const p=b=>{v(f=>({...f,types:f.types.includes(b)?f.types.filter(y=>y!==b):[...f.types,b]}))},w=b=>{v(f=>({...f,amenities:f.amenities.includes(b)?f.amenities.filter(y=>y!==b):[...f.amenities,b]}))},k=b=>{v(f=>({...f,modes:f.modes.includes(b)?f.modes.filter(y=>y!==b):[...f.modes,b]}))},I=S??i;return o.jsx(Ks,{open:n,onOpenChange:u,children:o.jsxs(Qs,{className:"flex max-h-[85dvh] flex-col gap-0 overflow-hidden border border-border bg-background p-0 ring-0 sm:max-w-[600px] dark:bg-background",children:[o.jsx(Ys,{className:"border-b border-border px-6 py-4",children:o.jsx(Xs,{className:"text-base font-semibold text-foreground",children:h("Filtres")})}),o.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto px-6 py-2",children:[o.jsx(_t,{ref:g.types,title:h("Type dâétablissement"),empty:t.types.length===0,children:o.jsx("div",{className:"flex flex-wrap gap-2",children:t.types.map(b=>o.jsx(Ve,{label:b.label,count:b.count,active:x.types.includes(b.slug),onClick:()=>p(b.slug)},b.slug))})}),o.jsx(_t,{ref:g.cities,title:h("Ville"),empty:t.cities.length===0,children:o.jsx("div",{className:"flex flex-wrap gap-2",children:t.cities.map(b=>o.jsx(Ve,{label:b.label,count:b.count,active:x.ville===b.value,onClick:()=>v(f=>({...f,ville:f.ville===b.value?"":b.value,quartier:""}))},b.value))})}),o.jsx(_t,{ref:g.areas,title:h("Quartier"),empty:t.areas.length===0,children:o.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.jsx(Ve,{label:h("Tous les quartiers"),active:x.quartier==="",onClick:()=>v(b=>({...b,quartier:""}))}),t.areas.map(b=>o.jsx(Ve,{label:b.label,count:b.count,active:x.quartier===b.value,onClick:()=>v(f=>({...f,quartier:f.quartier===b.value?"":b.value}))},b.value))]})}),o.jsx(_t,{ref:g.modes,title:h("Lieu de la prestation"),children:o.jsx("div",{className:"flex flex-wrap gap-2",children:t.modes.map(b=>o.jsx(Ve,{label:b.label,count:b.count,active:x.modes.includes(b.value),onClick:()=>k(b.value)},b.value))})}),o.jsx(_t,{ref:g.ratings,title:h("Note minimum"),children:o.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.jsx(Ve,{label:h("Toutes les n
2otes"),active:x.rating===null,onClick:()=>v(b=>({...b,rating:null}))}),t.ratings.map(b=>o.jsx(Ve,{label:b.label,count:b.count,active:x.rating===b.value,onClick:()=>v(f=>({...f,rating:f.rating===b.value?null:b.value}))},b.value))]})}),o.jsx(_t,{ref:g.amenities,title:h("Commodités"),empty:t.amenities.length===0,children:o.jsx("div",{className:"flex flex-wrap gap-2",children:t.amenities.map(b=>o.jsx(Ve,{label:b.label,count:b.count,active:x.amenities.includes(b.value),onClick:()=>w(b.value)},b.value))})}),o.jsx(fl,{ref:g.availability,draft:x,horizonDays:a,onChange:v})]}),o.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-border bg-background px-6 py-4",children:[o.jsx("button",{type:"button",onClick:m,className:"text-xs font-medium text-foreground/70 underline underline-offset-4 transition-colors duration-fast ease-soft hover:text-foreground",children:h("Tout effacer")}),o.jsxs("button",{type:"button",onClick:()=>c(x),className:"inline-flex h-10 items-center justify-center gap-2 rounded-xl bg-foreground px-5 text-sm font-semibold text-background transition-opacity duration-base ease-soft hover:opacity-90",children:[C&&o.jsx(lt,{className:"size-3.5 animate-spin opacity-70"}),I===0?h("Aucun résultat"):h("Voir les :count résultats",{count:I})]})]})]})})}function fl(n){const e=Ge.c(86),{ref:t,draft:r,horizonDays:i,onChange:s}=n,{t:a}=ut(),u=T.useRef(null);let c,m,h;if(e[0]!==i){const V=new Date;m=oo(V),h=oo(Zo(V,1)),c=oo(Zo(V,Math.max(0,i-1))),e[0]=i,e[1]=c,e[2]=m,e[3]=h}else c=e[1],m=e[2],h=e[3];const x=c;let v,S;e[4]!==r.date?(v=()=>{r.date!==null&&u.current?.scrollIntoView({block:"nearest",behavior:"smooth"})},S=[r.date],e[4]=r.date,e[5]=v,e[6]=S):(v=e[5],S=e[6]),T.useEffect(v,S);let d;e[7]!==s?(d=V=>{s(Y=>({...Y,date:V,slot:V===null?null:Y.slot}))},e[7]=s,e[8]=d):d=e[8];const C=d;let j;e[9]!==a?(j=a("Matin · 9 h-12 h"),e[9]=a,e[10]=j):j=e[10];let g;e[11]!==j?(g={value:"morning",label:j},e[11]=j,e[12]=g):g=e[12];let p;e[13]!==a?(p=a("Après-midi · 12 h-17 h"),e[13]=a,e[14]=p):p=e[14];let w;e[15]!==p?(w={value:"afternoon",label:p},e[15]=p,e[16]=w):w=e[16];let k;e[17]!==a?(k=a("Soir · 17 h-22 h"),e[17]=a,e[18]=k):k=e[18];let I;e[19]!==k?(I={value:"evening",label:k},e[19]=k,e[20]=I):I=e[20];let b;e[21]!==I||e[22]!==g||e[23]!==w?(b=[g,w,I],e[21]=I,e[22]=g,e[23]=w,e[24]=b):b=e[24];const f=b;let y;e[25]!==a?(y=a("Disponibilité"),e[25]=a,e[26]=y):y=e[26];let z;e[27]!==a?(z=a("Indicatif â le salon confirme le créneau à la réservation."),e[27]=a,e[28]=z):z=e[28];let B;e[29]!==a?(B=a("Nâimporte quand"),e[29]=a,e[30]=B):B=e[30];const $=r.date===null;let _;e[31]!==C?(_=()=>C(null),e[31]=C,e[32]=_):_=e[32];let D;e[33]!==B||e[34]!==$||e[35]!==_?(D=o.jsx(Ve,{label:B,active:$,onClick:_}),e[33]=B,e[34]=$,e[35]=_,e[36]=D):D=e[36];let L;e[37]!==a?(L=a("Aujourdâhui"),e[37]=a,e[38]=L):L=e[38];const W=r.date===m;let F;e[39]!==r.date||e[40]!==C||e[41]!==m?(F=()=>C(r.date===m?null:m),e[39]=r.date,e[40]=C,e[41]=m,e[42]=F):F=e[42];let U;e[43]!==L||e[44]!==W||e[45]!==F?(U=o.jsx(Ve,{label:L,active:W,onClick:F}),e[43]=L,e[44]=W,e[45]=F,e[46]=U):U=e[46];let J;e[47]!==a?(J=a("Demain"),e[47]=a,e[48]=J):J=e[48];const xe=r.date===h;let re;e[49]!==r.date||e[50]!==C||e[51]!==h?(re=()=>C(r.date===h?null:h),e[49]=r.date,e[50]=C,e[51]=h,e[52]=re):re=e[52];let ie;e[53]!==J||e[54]!==xe||e[55]!==re?(ie=o.jsx(Ve,{label:J,active:xe,onClick:re}),e[53]=J,e[54]=xe,e[55]=re,e[56]=ie):ie=e[56];let he;e[57]!==D||e[58]!==U||e[59]!==ie?(he=o.jsxs("div",{className:"flex flex-wrap gap-2",children:[D,U,ie]}),e[57]=D,e[58]=U,e[59]=ie,e[60]=he):he=e[60];let ae;e[61]!==a?(ae=a("Une autre date"),e[61]=a,e[62]=ae):ae=e[62];const pe=r.date??"";let Se;e[63]!==C?(Se=V=>C(V.target.value||null),e[63]=C,e[64]=Se):Se=e[64];let de;e[65]!==x||e[66]!==pe||e[67]!==Se||e[68]!==m?(de=o.jsx("input",{type:"date",value:pe,min:m,max:x,onChange:Se,className:"h-8 rounded-lg border border-border bg-background px-2 text-xs text-foreground transition-colors duration-fast ease-soft hover:border-foreground
2/40 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring"}),e[65]=x,e[66]=pe,e[67]=Se,e[68]=m,e[69]=de):de=e[69];let ke;e[70]!==ae||e[71]!==de?(ke=o.jsxs("label",{className:"mt-3 flex flex-wrap items-center gap-2 text-xs font-medium text-foreground/80",children:[ae,de]}),e[70]=ae,e[71]=de,e[72]=ke):ke=e[72];let M;e[73]!==r.date||e[74]!==r.slot||e[75]!==s||e[76]!==a||e[77]!==f?(M=r.date!==null&&o.jsxs("div",{ref:u,className:"mt-4 flex flex-wrap gap-2",children:[o.jsx(Ve,{label:a("Toute la journée"),active:r.slot===null,onClick:()=>s(pl)}),f.map(V=>o.jsx(Ve,{label:V.label,active:r.slot===V.value,onClick:()=>s(Y=>({...Y,slot:Y.slot===V.value?null:V.value}))},V.value))]}),e[73]=r.date,e[74]=r.slot,e[75]=s,e[76]=a,e[77]=f,e[78]=M):M=e[78];let q;return e[79]!==t||e[80]!==y||e[81]!==z||e[82]!==he||e[83]!==ke||e[84]!==M?(q=o.jsxs(_t,{ref:t,title:y,hint:z,children:[he,ke,M]}),e[79]=t,e[80]=y,e[81]=z,e[82]=he,e[83]=ke,e[84]=M,e[85]=q):q=e[85],q}function pl(n){return{...n,slot:null}}function _t(n){const e=Ge.c(11),{ref:t,title:r,hint:i,empty:s,children:a}=n;if(s===void 0?!1:s)return null;let c;e[0]!==r?(c=o.jsx("h3",{className:"text-sm font-semibold text-foreground",children:r}),e[0]=r,e[1]=c):c=e[1];let m;e[2]!==i?(m=i&&o.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:i}),e[2]=i,e[3]=m):m=e[3];let h;e[4]!==a?(h=o.jsx("div",{className:"mt-3",children:a}),e[4]=a,e[5]=h):h=e[5];let x;return e[6]!==t||e[7]!==c||e[8]!==m||e[9]!==h?(x=o.jsxs("div",{ref:t,className:"scroll-mt-2 border-b border-border/70 py-5 last:border-b-0",children:[c,m,h]}),e[6]=t,e[7]=c,e[8]=m,e[9]=h,e[10]=x):x=e[10],x}function Ve(n){const e=Ge.c(9),{label:t,count:r,active:i,onClick:s}=n,a=`inline-flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-xs font-medium transition-colors duration-fast ease-soft focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none ${i?"border-foreground bg-foreground text-background":"border-border bg-background text-foreground hover:border-foreground
2/50 hover:bg-muted"}`;let u;e[0]!==i||e[1]!==r?(u=r!==void 0&&o.jsx("span",{className:i?"text-background/75":"text-muted-foreground/90",children:r}),e[0]=i,e[1]=r,e[2]=u):u=e[2];let c;return e[3]!==i||e[4]!==t||e[5]!==s||e[6]!==a||e[7]!==u?(c=o.jsxs("button",{type:"button",onClick:s,"aria-pressed":i,className:a,children:[t,u]}),e[3]=i,e[4]=t,e[5]=s,e[6]=a,e[7]=u,e[8]=c):c=e[8],c}function hl(n){const e=Ge.c(28),{mobileView:t,onChangeView:r,onOpenFilters:i}=n,{t:s}=ut();let a;e[0]!==r?(a=()=>r("list"),e[0]=r,e[1]=a):a=e[1];const u=`inline-flex h-10 flex-1 items-center justify-center gap-1 rounded-xl text-xs font-medium transition-all duration-200 active:scale-95 ${t==="list"?"bg-foreground text-background":"text-muted-foreground hover:bg-muted/20 hover:text-foreground"}`;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(Nr,{className:"size-3.5"}),e[2]=c):c=e[2];let m;e[3]!==s?(m=s("Liste"),e[3]=s,e[4]=m):m=e[4];let h;e[5]!==a||e[6]!==u||e[7]!==m?(h=o.jsxs("button",{type:"button",onClick:a,className:u,children:[c,m]}),e[5]=a,e[6]=u,e[7]=m,e[8]=h):h=e[8];let x;e[9]!==r?(x=()=>r("map"),e[9]=r,e[10]=x):x=e[10];const v=`inline-flex h-10 flex-1 items-center justify-center gap-1 rounded-xl text-xs font-medium transition-all duration-200 active:scale-95 ${t==="map"?"bg-foreground text-background":"text-muted-foreground hover:bg-muted/20 hover:text-foreground"}`;let S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx(ul,{className:"size-3.5"}),e[11]=S):S=e[11];let d;e[12]!==s?(d=s("Carte"),e[12]=s,e[13]=d):d=e[13];let C;e[14]!==x||e[15]!==v||e[16]!==d?(C=o.jsxs("button",{type:"button",onClick:x,className:v,children:[S,d]}),e[14]=x,e[15]=v,e[16]=d,e[17]=C):C=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(Mn,{className:"size-3.5"}),e[18]=j):j=e[18];let g;e[19]!==s?(g=s("Filtres"),e[19]=s,e[20]=g):g=e[20];let p;e[21]!==i||e[22]!==g?(p=o.jsxs("button",{type:"button",onClick:i,className:"inline-flex h-10 flex-1 items-center justify-center gap-1 rounded-xl text-xs font-medium text-muted-foreground transition-all duration-200 hover:bg-muted/20 hover:text-foreground active:scale-95",children:[j,g]}),e[21]=i,e[22]=g,e[23]=p):p=e[23];let w;return e[24]!==C||e[25]!==p||e[26]!==h?(w=o.jsx("div",{className:"pointer-events-none fixed inset-x-3 bottom-[max(1.25rem,calc(env(safe-area-inset-bottom)+0.875rem))] z-[700]",children:o.jsxs("div",{className:"pointer-events-auto mx-auto flex w-full max-w-sm items-center gap-1 rounded-2xl border border-border/70 bg-background/95 p-1 shadow-[0_18px_40px_-22px_rgba(0,0,0,0.55)] backdrop-blur",children:[h,C,p]})}),e[24]=C,e[25]=p,e[26]=h,e[27]=w):w=e[27],w}function gl(n){const e=Ge.c(15),{pagination:t,hidden:r}=n,i=r===void 0?!1:r,{t:s}=ut();if(i||t.lastPage<=1)return null;let a;e[0]!==s?(a=s("Pagination des résultats"),e[0]=s,e[1]=a):a=e[1];let u;e[2]!==t.prevUrl||e[3]!==s?(u=t.prevUrl?o.jsx(at,{href:t.prevUrl,rel:"prev",preserveScroll:!1,"aria-label":s("Page précédente"),className:"flex h-9 min-w-9 items-center justify-center rounded-full border border-border px-3 text-sm transition-colors hover:bg-muted",children:"â¹"}):null,e[2]=t.prevUrl,e[3]=s,e[4]=u):u=e[4];let c;e[5]!==t.pages?(c=t.pages.map(xl),e[5]=t.pages,e[6]=c):c=e[6];let m;e[7]!==t.nextUrl||e[8]!==s?(m=t.nextUrl?o.jsx(at,{href:t.nextUrl,rel:"next",preserveScroll:!1,"aria-label":s("Page suivante"),className:"flex h-9 min-w-9 items-center justify-center rounded-full border border-border px-3 text-sm transition-colors hover:bg-muted",children:"âº"}):null,e[7]=t.nextUrl,e[8]=s,e[9]=m):m=e[9];let h;return e[10]!==a||e[11]!==u||e[12]!==c||e[13]!==m?(h=o.jsxs("nav",{"aria-label":a,className:"flex items-center justify-center gap-1 border-t border-border/40 px-5 py-6 sm:px-8",children:[u,c,m]}),e[10]=a,e[11]=u,e[12]=c,e[13]=m,e[14]=h):h=e[14],h}function xl(n){return o.jsx(at,{href:n.url,preserveScroll:!1,"aria-current":n.current?"page":void 0,className:`flex h-9 min-w-9 items-center justify-center rounded-full px-3 text-sm transition-colors ${n.current?"bg-foreground text-background":"border border-border hover:bg-muted"}`,children:n.page},n.page)}const Fn=0,St=1,Kt=2,Ir=4;function Jo(n){return()=>n}function bl(n){n()}function zr(n,e){return t=>n(e(t))}function er(n,e){return()=>n(e)}function vl(n,e){return t=>n(e,t)}function bo(n){return n!==void 0}function yl(...n){return()=>{n.map(bl)}}function Qt(){}function An(n,e){return e(n),n}function jl(n,e){return e(n)}function je(...n){return n}function ue(n,e){return n(St,e)}function ee(n,e){n(Fn,e)}function vo(n){n(Kt)}function we(n){return n(Ir)}function O(n,e){return ue(n,vl(e,Fn))}function ot(n,e){const t=n(St,r=>{t(),e(r)});return t}function tr(n){let e,t;return r=>i=>{e=i,t&&clearTimeout(t),t=setTimeout(()=>{r(e)},n)}}function Rr(n,e){return n===e}function ye(n=Rr){let e;return t=>r=>{n(e,r)||(e=r,t(r))}}function K(n){return e=>t=>{n(t)&&e(t)}}function P(n){return e=>zr(e,n)}function it(n){return e=>()=>{e(n)}}function R(n,...e){const t=wl(...e);return((r,i)=>{switch(r){case Kt:vo(n);return;case St:return ue(n,t(i))}})}function ct(n,e){return t=>r=>{t(e=n(e,r))}}function Ht(n){return e=>t=>{n>0?n--:e(t)}}function bt(n){let e=null,t;return r=>i=>{e=i,!t&&(t=setTimeout(()=>{t=void 0,r(e)},n))}}function te(...n){const e=new Array(n.length);let t=0,r=null;const i=2**n.length-1;
2return n.forEach((s,a)=>{const u=2**a;ue(s,c=>{const m=t;t|=u,e[a]=c,m!==i&&t===i&&r&&(r(),r=null)})}),s=>a=>{const u=()=>{s([a].concat(e))};t===i?u():r=u}}function wl(...n){return e=>n.reduceRight(jl,e)}function kl(n){let e,t;const r=()=>e?.();return function(i,s){switch(i){case St:return s?t===s?void 0:(r(),t=s,e=ue(n,s),e):(r(),Qt);case Kt:r(),t=null;return}}}function H(n){let e=n;const t=oe();return((r,i)=>{switch(r){case Fn:e=i;break;case St:{i(e);break}case Ir:return e}return t(r,i)})}function He(n,e){return An(H(e),t=>O(n,t))}function oe(){const n=[];return((e,t)=>{switch(e){case Fn:n.slice().forEach(r=>{r(t)});return;case Kt:n.splice(0,n.length);return;case St:return n.push(t),()=>{const r=n.indexOf(t);r>-1&&n.splice(r,1)}}})}function Ue(n){return An(oe(),e=>O(n,e))}function le(n,e=[],{singleton:t}={singleton:!0}){return{constructor:n,dependencies:e,id:Sl(),singleton:t}}const Sl=()=>Symbol();function Cl(n){const e=new Map,t=({constructor:r,dependencies:i,id:s,singleton:a})=>{if(a&&e.has(s))return e.get(s);const u=r(i.map(c=>t(c)));return a&&e.set(s,u),u};return t(n)}function Te(...n){const e=oe(),t=new Array(n.length);let r=0;const i=2**n.length-1;return n.forEach((s,a)=>{const u=2**a;ue(s,c=>{t[a]=c,r|=u,r===i&&ee(e,t)})}),function(s,a){switch(s){case Kt:{vo(e);return}case St:return r===i&&a(t),ue(e,a)}}}function G(n,e=Rr){return R(n,ye(e))}function co(...n){return function(e,t){switch(e){case Kt:return;case St:return yl(...n.map(r=>ue(r,t)))}}}const ze={DEBUG:0,INFO:1,WARN:2,ERROR:3},Nl={[ze.DEBUG]:"debug",[ze.ERROR]:"error",[ze.INFO]:"log",[ze.WARN]:"warn"},Tl=()=>typeof globalThis>"u"?window:globalThis,Ct=le(()=>{const n=H(ze.ERROR);return{log:H((e,t,r=ze.INFO)=>{const i=Tl().VIRTUOSO_LOG_LEVEL??we(n);r>=i&&console[Nl[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",e,t)}),logLevel:n}},[],{singleton:!0});function Mt(n,e,t){return yo(n,e,t).callbackRef}function yo(n,e,t){const r=A.useRef(null);let i=a=>{};const s=A.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(a=>{const u=()=>{const c=a[0].target;c.offsetParent!==null&&n(c)};t?u():requestAnimationFrame(u)}):null,[n,t]);return i=a=>{a&&e?(s?.observe(a),r.current=a):(r.current&&s?.unobserve(r.current),r.current=null)},{callbackRef:i,ref:r}}function Il(n,e,t,r,i,s,a,u,c){const m=A.useCallback(h=>{const x=zl(h.children,e,u?"offsetWidth":"offsetHeight",i);let v=h.parentElement;for(;v.dataset.virtuosoScroller===void 0;)v=v.parentElement;const S=v.lastElementChild.dataset.viewportType==="window";let d;S&&(d=v.ownerDocument.defaultView);const C=a?u?a.scrollLeft:a.scrollTop:S?u?d.scrollX||d.document.documentElement.scrollLeft:d.scrollY||d.document.documentElement.scrollTop:u?v.scrollLeft:v.scrollTop,j=a?u?a.scrollWidth:a.scrollHeight:S?u?d.document.documentElement.scrollWidth:d.document.documentElement.scrollHeight:u?v.scrollWidth:v.scrollHeight,g=a?u?a.offsetWidth:a.offsetHeight:S?u?d.innerWidth:d.innerHeight:u?v.offsetWidth:v.offsetHeight;r({scrollHeight:j,scrollTop:Math.max(C,0),viewportHeight:g}),s?.(u?nr("column-gap",getComputedStyle(h).columnGap,i):nr("row-gap",getComputedStyle(h).rowGap,i)),x!==null&&n(x)},[n,e,i,s,a,r,u]);return yo(m,t,c)}function zl(n,e,t,r){const i=n.length;if(i===0)return null;const s=[];for(let a=0;a<i;a++){const u=n.item(a);if(u.dataset.index===void 0)continue;const c=parseInt(u.dataset.index),m=parseFloat(u.dataset.knownSize),h=e(u,t);if(h===0&&r("Zero-sized element, this should not happen",{child:u},ze.ERROR),h===m)continue;const x=s[s.length-1];s.length===0||x.size!==h||x.endIndex!==c-1?s.push({endIndex:c,size:h,startIndex:c}):s[s.length-1].endIndex++}return s}function nr(n,e,t){return e!=="normal"&&e?.endsWith("px")!==!0&&t(`${n} was not resolved to pixel value correctly`,e,ze.WARN),e==="normal"?0:parseInt(e??"0",10)}function _r(n,e,t){const r=A.useRef(null),i=A.useCallback(c=>{if(!c?.offsetParent)return;const m=c.getBoundingClientRect(),h=m.width;let x,v;if(e){const S=e.getBoundingClientRect(),d=m.top-S.top;v=S.height-Math.max(0,d),x=d+e.scrollTop}else{const S=a.current.ownerDocument.defaultView;v=S.innerHeight-Math.max(0,m.top),x=m.top+S.scrollY}r.current={listHeight:m.height,offsetTop:x,visibleHeight:v,visibleWidth:h},n(r.current)},[n,e]),{callbackRef:s,ref:a}=yo(i,!0,t),u=A.useCallback(()=>{i(a.current)},[i,a]);return A.useEffect(()=>{if(e){e.addEventListener("scroll",u);const m=new ResizeObserver(()=>{requestAnimationFrame(u)});return m.observe(e),()=>{e.removeEventListener("scroll",u),m.unobserve(e)}}const c=a.current?.ownerDocument.defaultView;return c?.addEventListener("scroll",u),c?.addEventListener("resize",u),()=>{c?.removeEventListener("scroll",u),c?.removeEventListener("resize",u)}},[u,e,a]),s}const Le=le(()=>{const n=oe(),e=oe(),t=H(0),r=oe(),i=H(0),s=oe(),a=oe(),u=H(0),c=H(0),m=H(0),h=H(0),x=oe(),v=oe(),S=H(!1),d=H(!1),C=H(!1);return O(R(n,P(({scrollTop:j})=>j)),e),O(R(n,P(({scrollHeight:j})=>j)),a),O(e,i),{deviation:t,fixedFooterHeight:m,fixedHeaderHeight:c,footerHeight:h,headerHeight:u,horizontalDirection:d,scrollBy:v,scrollC
2ontainerState:n,scrollHeight:a,scrollingInProgress:S,scrollTo:x,scrollTop:e,skipAnimationFrameInResizeObserver:C,smoothScrollTargetReached:r,statefulScrollTop:i,viewportHeight:s}},[],{singleton:!0}),ln={lvl:0};function Er(n,e){const t=n.length;if(t===0)return[];let{index:r,value:i}=e(n[0]);const s=[];for(let a=1;a<t;a++){const{index:u,value:c}=e(n[a]);s.push({end:u-1,start:r,value:i}),r=u,i=c}return s.push({end:1/0,start:r,value:i}),s}function fe(n){return n===ln}function an(n,e){if(!fe(n))return e===n.k?n.v:e<n.k?an(n.l,e):an(n.r,e)}function rt(n,e,t="k"){if(fe(n))return[-1/0,void 0];if(Number(n[t])===e)return[n.k,n.v];if(Number(n[t])<e){const r=rt(n.r,e,t);return r[0]===-1/0?[n.k,n.v]:r}return rt(n.l,e,t)}function qe(n,e,t){return fe(n)?$r(e,t,1):e===n.k?Ie(n,{k:e,v:t}):e<n.k?or(Ie(n,{l:qe(n.l,e,t)})):or(Ie(n,{r:qe(n.r,e,t)}))}function Ut(){return ln}function Gt(n,e,t){if(fe(n))return[];const r=rt(n,e)[0];return Rl(mo(n,r,t))}function uo(n,e){if(fe(n))return ln;const{k:t,l:r,r:i}=n;if(e===t){if(fe(r))return i;if(fe(i))return r;const[s,a]=Mr(r);return $n(Ie(n,{k:s,l:Hr(r),v:a}))}return e<t?$n(Ie(n,{l:uo(r,e)})):$n(Ie(n,{r:uo(i,e)}))}function Et(n){return fe(n)?[]:[...Et(n.l),{k:n.k,v:n.v},...Et(n.r)]}function mo(n,e,t){if(fe(n))return[];const{k:r,l:i,r:s,v:a}=n;let u=[];return r>e&&(u=u.concat(mo(i,e,t))),r>=e&&r<=t&&u.push({k:r,v:a}),r<=t&&(u=u.concat(mo(s,e,t))),u}function $n(n){const{l:e,lvl:t,r}=n;if(r.lvl>=t-1&&e.lvl>=t-1)return n;if(t>r.lvl+1){if(ro(e))return Br(Ie(n,{lvl:t-1}));if(!fe(e)&&!fe(e.r))return Ie(e.r,{l:Ie(e,{r:e.r.l}),lvl:t,r:Ie(n,{l:e.r.r,lvl:t-1})});throw new Error("Unexpected empty nodes")}if(ro(n))return fo(Ie(n,{lvl:t-1}));if(!fe(r)&&!fe(r.l)){const i=r.l,s=ro(i)?r.lvl-1:r.lvl;return Ie(i,{l:Ie(n,{lvl:t-1,r:i.l}),lvl:i.lvl+1,r:fo(Ie(r,{l:i.r,lvl:s}))})}throw new Error("Unexpected empty nodes")}function Ie(n,e){return $r(e.k!==void 0?e.k:n.k,e.v!==void 0?e.v:n.v,e.lvl!==void 0?e.lvl:n.lvl,e.l!==void 0?e.l:n.l,e.r!==void 0?e.r:n.r)}function Hr(n){return fe(n.r)?n.l:$n(Ie(n,{r:Hr(n.r)}))}function ro(n){return fe(n)||n.lvl>n.r.lvl}function Mr(n){return fe(n.r)?[n.k,n.v]:Mr(n.r)}function $r(n,e,t,r=ln,i=ln){return{k:n,l:r,lvl:t,r:i,v:e}}function or(n){return fo(Br(n))}function Br(n){const{l:e}=n;return!fe(e)&&e.lvl===n.lvl?Ie(e,{r:Ie(n,{l:e.r})}):n}function fo(n){const{lvl:e,r:t}=n;return!fe(t)&&!fe(t.r)&&t.lvl===e&&t.r.lvl===e?Ie(t,{l:Ie(n,{r:t.l}),lvl:e+1}):n}function Rl(n){return Er(n,({k:e,v:t})=>({index:e,value:t}))}function Lr(n,e){return!!(n&&n.startIndex===e.startIndex&&n.endIndex===e.endIndex)}function cn(n,e){return!!(n&&n[0]===e[0]&&n[1]===e[1])}const jo=le(()=>({recalcInProgress:H(!1)}),[],{singleton:!0});function Dr(n,e,t){return n[Dn(n,e,t)]}function Dn(n,e,t,r=0){let i=n.length-1;for(;r<=i;){const s=Math.floor((r+i)/2),a=n[s],u=t(a,e);if(u===0)return s;if(u===-1){if(i-r<2)return s-1;i=s-1}else{if(i===r)return s;r=s+1}}throw new Error(`Failed binary finding record in array - ${n.join(",")}, searched for ${e}`)}function _l(n,e,t,r){const i=Dn(n,e,r),s=Dn(n,t,r,i);return n.slice(i,s+1)}function kt(n,e){return Math.round(n.getBoundingClientRect()[e])}function On(n){return!fe(n.groupOffsetTree)}function wo({index:n},e){return e===n?0:e<n?-1:1}function El(){return{groupIndices:[],groupOffsetTree:Ut(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Ut()}}function Hl(n,e){let t=fe(n)?0:1/0;for(const r of e){const{endIndex:i,size:s,startIndex:a}=r;if(t=Math.min(t,a),fe(n)){n=qe(n,0,s);continue}const u=Gt(n,a-1,i+1);if(u.some(Fl(r)))continue;let c=!1,m=!1;for(const{end:h,start:x,value:v}of u)c?(i>=x||s===v)&&(n=uo(n,x)):(m=v!==s,c=!0),h>i&&i>=x&&v!==s&&(n=qe(n,i+1,v));m&&(n=qe(n,a,s))}return[n,t]}function Ml(n){return typeof n.groupIndex<"u"}function $l({offset:n},e){return e===n?0:e<n?-1:1}function un(n,e,t){if(e.length===0)return 0;const{index:r,offset:i,size:s}=Dr(e,n,wo),a=n-r,u=s*a+(a-1)*t+i;return u>0?u+t:u}function Pr(n,e){if(!On(e))return n;let t=0;for(;e.groupIndices[t]<=n+t;)t++;return n+t}function Fr(n,e,t){if(Ml(n))return e.groupIndices[n.groupIndex]+1;const r=n.index==="LAST"?t:n.index;let i=Pr(r,e);return i=Math.max(0,i,Math.min(t,i)),i}function Bl(n,e,t,r=0){return r>0&&(e=Math.max(e,Dr(n,r,wo).offset)),Er(_l(n,e,t,$l),Pl)}function Ll(n,[e,t,r,i]){e.length>0&&r("received item sizes",e,ze.DEBUG);const s=n.sizeTree;let a=s,u=0;if(t.length>0&&fe(s)&&e.length===2){const v=e[0].size,S=e[1].size;a=t.reduce((d,C)=>qe(qe(d,C,v),C+1,S),a)}else[a,u]=Hl(a,e);
2if(a===s)return n;const{lastIndex:c,lastOffset:m,lastSize:h,offsetTree:x}=po(n.offsetTree,u,a,i);return{groupIndices:t,groupOffsetTree:t.reduce((v,S)=>qe(v,S,un(S,x,i)),Ut()),lastIndex:c,lastOffset:m,lastSize:h,offsetTree:x,sizeTree:a}}function Dl(n){return Et(n).map(({k:e,v:t},r,i)=>{const s=i[r+1];return{endIndex:s!==void 0?s.k-1:1/0,size:t,startIndex:e}})}function rr(n,e){let t=0,r=0;for(;t<n;)t+=e[r+1]-e[r]-1,r++;return r-(t===n?0:1)}function po(n,e,t,r){let i=n,s=0,a=0,u=0,c=0;if(e!==0){c=Dn(i,e-1,wo),u=i[c].offset;const m=rt(t,e-1);s=m[0],a=m[1],i.length&&i[c].size===rt(t,e)[1]&&(c-=1),i=i.slice(0,c+1)}else i=[];for(const{start:m,value:h}of Gt(t,e,1/0)){const x=m-s,v=x*a+u+x*r;i.push({index:m,offset:v,size:h}),s=m,u=v,a=h}return{lastIndex:s,lastOffset:u,lastSize:a,offsetTree:i}}function Pl(n){return{index:n.index,value:n}}function Fl(n){const{endIndex:e,size:t,startIndex:r}=n;return i=>i.start===r&&(i.end===e||i.end===1/0)&&i.value===t}const Al={offsetHeight:"height",offsetWidth:"width"},dt=le(([{log:n},{recalcInProgress:e}])=>{const t=oe(),r=oe(),i=He(r,0),s=oe(),a=oe(),u=H(0),c=H([]),m=H(void 0),h=H(void 0),x=H(void 0),v=H(void 0),S=H((f,y)=>kt(f,Al[y])),d=H(void 0),C=H(0),j=El(),g=He(R(t,te(c,n,C),ct(Ll,j),ye()),j),p=He(R(c,ye(),ct((f,y)=>({current:y,prev:f.current}),{current:[],prev:[]}),P(({prev:f})=>f)),[]);O(R(c,K(f=>f.length>0),te(g,C),P(([f,y,z])=>{const B=f.reduce(($,_,D)=>qe($,_,un(_,y.offsetTree,z)||D),Ut());return{...y,groupIndices:f,groupOffsetTree:B}})),g),O(R(r,te(g),K(([f,{lastIndex:y}])=>f<y),P(([f,{lastIndex:y,lastSize:z}])=>[{endIndex:y,size:z,startIndex:f}])),t),O(m,h);const w=He(R(m,P(f=>f===void 0)),!0);O(R(h,K(f=>f!==void 0&&fe(we(g).sizeTree)),P(f=>{const y=we(x),z=we(c).length>0;return y!==void 0&&y!==0?z?[{endIndex:0,size:y,startIndex:0},{endIndex:1,size:f,startIndex:1}]:[]:[{endIndex:0,size:f,startIndex:0}]})),t),O(R(v,K(f=>f!==void 0&&f.length>0&&fe(we(g).sizeTree)),P(f=>{const y=[];let z=f[0],B=0;for(let $=1;$<f.length;$++){const _=f[$];_!==z&&(y.push({endIndex:$-1,size:z,startIndex:B}),z=_,B=$)}return y.push({endIndex:f.length-1,size:z,startIndex:B}),y})),t),O(R(c,te(x,h),K(([,f,y])=>f!==void 0&&y!==void 0),P(([f,y,z])=>{const B=[];for(let $=0;$<f.length;$++){const _=f[$],D=f[$+1];B.push({startIndex:_,endIndex:_,size:y}),D!==void 0&&B.push({startIndex:_+1,endIndex:D-1,size:z})}return B})),t);const k=Ue(R(t,te(g),ct(({sizes:f},[y,z])=>({changed:z!==f,sizes:z}),{changed:!1,sizes:j}),P(f=>f.changed)));ue(R(u,ct((f,y)=>({diff:f.prev-y,prev:y}),{diff:0,prev:0}),P(f=>f.diff)),f=>{const{groupIndices:y}=we(g);if(f>0)ee(e,!0),ee(s,f+rr(f,y));else if(f<0){const z=we(p);z.length>0&&(f-=rr(-f,z)),ee(a,f)}}),ue(R(u,te(n)),([f,y])=>{f<0&&y("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:u},ze.ERROR)});const I=Ue(s);O(R(s,te(g),P(([f,y])=>{const z=y.groupIndices.length>0,B=[],$=y.lastSize;if(z){const _=an(y.sizeTree,0);let D=0,L=0;for(;D<f;){const F=y.groupIndices[L],U=y.groupIndices.length===L+1?1/0:y.groupIndices[L+1]-F-1;B.push({endIndex:F,size:_,startIndex:F}),B.push({endIndex:F+1+U-1,size:$,startIndex:F+1}),L++,D+=U+1}const W=Et(y.sizeTree);return D!==f&&W.shift(),W.reduce((F,{k:U,v:J})=>{let xe=F.ranges;return F.prevSize!==0&&(xe=[...F.ranges,{endIndex:U+f-1,size:F.prevSize,startIndex:F.prevIndex}]),{prevIndex:U+f,prevSize:J,ranges:xe}},{prevIndex:f,prevSize:0,ranges:B}).ranges}return Et(y.sizeTree).reduce((_,{k:D,v:L})=>({prevIndex:D+f,prevSize:L,ranges:[..._.ranges,{endIndex:D+f-1,size:_.prevSize,startIndex:_.prevIndex}]}),{prevIndex:0,prevSize:$,ranges:[]}).ranges})),t);const b=Ue(R(a,te(g,C),P(([f,{offsetTree:y},z])=>{const B=-f;return un(B,y,z)})));return O(R(a,te(g,C),P(([f,y,z])=>{if(y.groupIndices.length>0){if(fe(y.sizeTree))return y;let $=Ut();const _=we(p);let D=0,L=0,W=0;for(;D<-f;){W=_[L];const F=_[L+1]-W-1;L++,D+=F+1}if($=Et(y.sizeTree).reduce((F,{k:U,v:J})=>qe(F,Math.max(0,U+f),J),$),D!==-f){const F=an(y.sizeTree,W);$=qe($,0,F);const U=rt(y.sizeTree,-f+1)[1];$=qe($,1,U)}return{...y,sizeTree:$,...po(y.offsetTree,0,$,z)}}const B=Et(y.sizeTree).reduce(($,{k:_,v:D})=>qe($,Math.max(0,_+f),D),Ut());return{...y,sizeTree:B,...po(y.offsetTree,0,B,z)}})),g),{beforeUnshiftWith:I,data:d,defaultItemSize:h,firstItemIndex:u,fixedItemSize:m,fixedGroupSize:
2x,gap:C,groupIndices:c,heightEstimates:v,itemSize:S,listRefresh:k,shiftWith:a,shiftWithOffset:b,sizeRanges:t,sizes:g,statefulTotalCount:i,totalCount:r,trackItemSizes:w,unshiftWith:s}},je(Ct,jo),{singleton:!0});function Ol(n){return n.reduce((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e),{groupIndices:[],totalCount:0})}const Ar=le(([{groupIndices:n,sizes:e,totalCount:t},{headerHeight:r,scrollTop:i}])=>{const s=oe(),a=oe(),u=Ue(R(s,P(Ol)));return O(R(u,P(c=>c.totalCount)),t),O(R(u,P(c=>c.groupIndices)),n),O(R(Te(i,e,r),K(([c,m])=>On(m)),P(([c,m,h])=>rt(m.groupOffsetTree,Math.max(c-h,0),"v")[0]),ye(),P(c=>[c])),a),{groupCounts:s,topItemsIndexes:a}},je(dt,Le)),Nt=le(([{log:n}])=>{const e=H(!1),t=Ue(R(e,K(r=>r),ye()));return ue(e,r=>{r&&we(n)("props updated",{},ze.DEBUG)}),{didMount:t,propsReady:e}},je(Ct),{singleton:!0}),Wl=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function Or(n){const e=typeof n=="number"?{index:n}:n;return e.align||(e.align="start"),(!e.behavior||!Wl)&&(e.behavior="auto"),e.offset===void 0&&(e.offset=0),e}const pn=le(([{gap:n,listRefresh:e,sizes:t,totalCount:r},{fixedFooterHeight:i,fixedHeaderHeight:s,footerHeight:a,headerHeight:u,scrollingInProgress:c,scrollTo:m,smoothScrollTargetReached:h,viewportHeight:x},{log:v}])=>{const S=oe(),d=oe(),C=H(0);let j=null,g=null,p=null;function w(){j!==null&&(j(),j=null),p!==null&&(p(),p=null),g&&(clearTimeout(g),g=null),ee(c,!1)}return O(R(S,te(t,x,r,C,u,a,v),te(n,s,i),P(([[k,I,b,f,y,z,B,$],_,D,L])=>{const W=Or(k),{align:F,behavior:U,offset:J}=W,xe=f-1,re=Fr(W,I,xe);let ie=un(re,I.offsetTree,_)+z;F==="end"?(ie+=D+rt(I.sizeTree,re)[1]-b+L,re===xe&&(ie+=B)):F==="center"?ie+=(D+rt(I.sizeTree,re)[1]-b+L)/2:ie-=y,J!==void 0&&J!==0&&(ie+=J);const he=ae=>{w(),ae?($("retrying to scroll to",{location:k},ze.DEBUG),ee(S,k)):(ee(d,!0),$("list did not change, scroll successful",{},ze.DEBUG))};if(w(),U==="smooth"){let ae=!1;p=ue(e,pe=>{ae=ae||pe}),j=ot(h,()=>{he(ae)})}else j=ot(R(e,Vl(150)),he);return g=setTimeout(()=>{w()},1200),ee(c,!0),$("scrolling from index to",{behavior:U,index:re,top:ie},ze.DEBUG),{behavior:U,top:ie}})),m),{scrollTargetReached:d,scrollToIndex:S,topListHeight:C}},je(dt,Le,Ct),{singleton:!0});function Vl(n){return e=>{const t=setTimeout(()=>{e(!1)},n);return r=>{r&&(e(!0),clearTimeout(t))}}}function ko(n,e){n===0?e():requestAnimationFrame(()=>{ko(n-1,e)})}function So(n,e){const t=e-1;return typeof n=="number"?n:n.index==="LAST"?t:n.index}const hn=le(([{defaultItemSize:n,listRefresh:e,sizes:t},{scrollTop:r},{scrollTargetReached:i,scrollToIndex:s},{didMount:a}])=>{const u=H(!0),c=H(0),m=H(!0);return O(R(a,te(c),K(([h,x])=>x!==0),it(!1)),u),O(R(a,te(c),K(([h,x])=>x!==0),it(!1)),m),ue(R(Te(e,a),te(u,t,n,m),K(([[,h],x,{sizeTree:v},S,d])=>h&&(!fe(v)||bo(S))&&!x&&!d),te(c)),([,h])=>{ot(i,()=>{ee(m,!0)}),ko(4,()=>{ot(r,()=>{ee(u,!0)}),ee(s,h)})}),{initialItemFinalLocationReached:m,initialTopMostItemIndex:c,scrolledToInitialItem:u}},je(dt,Le,pn,Nt),{singleton:!0});function Wr(n,e){return Math.abs(n-e)<1.01}const dn="up",rn="down",ql="none",Ul={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},Gl=0,gn=le(([{footerHeight:n,headerHeight:e,scrollBy:t,scrollContainerState:r,scrollTop:i,viewportHeight:s}])=>{const a=H(!1),u=H(!0),c=oe(),m=oe(),h=H(4),x=H(Gl),v=He(R(co(R(G(i),Ht(1),it(!0)),R(G(i),Ht(1),it(!1),tr(100))),ye()),!1),S=He(R(co(R(t,it(!0)),R(t,it(!1),tr(200))),ye()),!1);O(R(Te(G(i),G(x)),P(([p,w])=>p<=w),ye()),u),O(R(u,bt(50)),m);const d=Ue(R(Te(r,G(s),G(e),G(n),G(h)),ct((p,[{scrollHeight:w,scrollTop:k},I,b,f,y])=>{const z=k+I-w>-y,B={scrollHeight:w,scrollTop:k,viewportHeight:I};if(z){let _,D;return k>p.state.scrollTop?(_="SCROLLED_DOWN",D=p.state.scrollTop-k):(_="SIZE_DECREASED",D=p.state.scrollTop-k||p.scrollTopDelta),{atBottom:!0,atBottomBecause:_,scrollTopDelta:D,state:B}}let $;return B.scrollHeight>p.state.scrollHeight?$="SIZE_INCREASED":I<p.state.viewportHeight?$="VIEWPORT_HEIGHT_DECREASING":k<p.state.scrollTop?$="SCROLLING_UPWARDS":$="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:$,state:B}},Ul),ye((p,w)=>p!==void 0&&p.atBottom===w.atBottom))),C=He(R(r,ct((p,{scrollHeight:w,scrollTop:k,viewportHe
2ight:I})=>{if(!Wr(p.scrollHeight,w)){const b=w-(k+I)<1;return p.scrollTop!==k&&b?{changed:!0,jump:p.scrollTop-k,scrollHeight:w,scrollTop:k}:{changed:!0,jump:0,scrollHeight:w,scrollTop:k}}return{changed:!1,jump:0,scrollHeight:w,scrollTop:k}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),K(p=>p.changed),P(p=>p.jump)),0);O(R(d,P(p=>p.atBottom)),a),O(R(a,bt(50)),c);const j=H(rn);O(R(r,P(({scrollTop:p})=>p),ye(),ct((p,w)=>we(S)?{direction:p.direction,prevScrollTop:w}:{direction:w<p.prevScrollTop?dn:rn,prevScrollTop:w},{direction:rn,prevScrollTop:0}),P(p=>p.direction)),j),O(R(r,bt(50),it(ql)),j);const g=H(0);return O(R(v,K(p=>!p),it(0)),g),O(R(i,bt(100),te(v),K(([p,w])=>w),ct(([p,w],[k])=>[w,k],[0,0]),P(([p,w])=>w-p)),g),{atBottomState:d,atBottomStateChange:c,atBottomThreshold:h,atTopStateChange:m,atTopThreshold:x,isAtBottom:a,isAtTop:u,isScrolling:v,lastJumpDueToItemResize:C,scrollDirection:j,scrollVelocity:g}},je(Le)),mn="top",fn="bottom",sr="none";function lr(n,e,t){return typeof n=="number"?t===dn&&e===mn||t===rn&&e===fn?n:0:t===dn?e===mn?n.main:n.reverse:e===fn?n.main:n.reverse}function ir(n,e){return typeof n=="number"?n:n[e]??0}const Co=le(([{deviation:n,fixedHeaderHeight:e,headerHeight:t,scrollTop:r,viewportHeight:i}])=>{const s=oe(),a=H(0),u=H(0),c=H(0),m=He(R(Te(G(r),G(i),G(t),G(s,cn),G(c),G(a),G(e),G(n),G(u)),P(([h,x,v,[S,d],C,j,g,p,w])=>{const k=h-p,I=j+g,b=Math.max(v-k,0);let f=sr;const y=ir(w,mn),z=ir(w,fn);return S-=p,S+=v+g,d+=v+g,d-=p,S>h+I-y&&(f=dn),d<h-b+x+z&&(f=rn),f!==sr?[Math.max(k-v-lr(C,mn,f)-y,0),k-b-g+x+lr(C,fn,f)+z]:null}),K(h=>h!==null),ye(cn)),[0,0]);return{increaseViewportBy:u,listBoundary:s,overscan:c,topListHeight:a,visibleRange:m}},je(Le),{singleton:!0});function Kl(n,e,t){if(On(e)){const r=Pr(n,e);return[{index:rt(e.groupOffsetTree,r)[0],offset:0,size:0},{data:t?.[0],index:r,offset:0,size:0}]}return[{data:t?.[0],index:n,offset:0,size:0}]}const so={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Bn(n,e,t,r,i,s){const{lastIndex:a,lastOffset:u,lastSize:c}=i;let m=0,h=0;if(n.length>0){m=n[0].offset;const C=n[n.length-1];h=C.offset+C.size}const x=t-a,v=u+x*c+(x-1)*r,S=m,d=v-h;return{bottom:h,firstItemIndex:s,items:ar(n,i,s),offsetBottom:d,offsetTop:m,top:S,topItems:ar(e,i,s),topListHeight:e.reduce((C,j)=>j.size+C,0),totalCount:t}}function Vr(n,e,t,r,i,s){let a=0;if(t.groupIndices.length>0)for(const h of t.groupIndices){if(h-a>=n)break;a++}const u=n+a,c=So(e,u),m=Array.from({length:u}).map((h,x)=>({data:s[x+c],index:x+c,offset:0,size:0}));return Bn(m,[],u,i,t,r)}function ar(n,e,t){if(n.length===0)return[];if(!On(e))return n.map(m=>({...m,index:m.index+t,originalIndex:m.index}));const r=n[0].index,i=n[n.length-1].index,s=[],a=Gt(e.groupOffsetTree,r,i);let u,c=0;for(const m of n){(!u||u.end<m.index)&&(u=a.shift(),c=e.groupIndices.indexOf(u.start));let h;m.index===u.start?h={index:c,type:"group"}:h={groupIndex:c,index:m.index-(c+1)+t},s.push({...h,data:m.data,offset:m.offset,originalIndex:m.index,size:m.size})}return s}function cr(n,e){return n===void 0?0:typeof n=="number"?n:n[e]??0}const $t=le(([{data:n,firstItemIndex:e,gap:t,sizes:r,totalCount:i},s,{listBoundary:a,topListHeight:u,visibleRange:c},{initialTopMostItemIndex:m,scrolledToInitialItem:h},{topListHeight:x},v,{didMount:S},{recalcInProgress:d}])=>{const C=H([]),j=H(0),g=oe(),p=H(0);O(s.topItemsIndexes,C);const w=He(R(Te(S,d,G(c,cn),G(i),G(r),G(m),h,G(C),G(e),G(t),G(p),n),K(([f,y,,z,,,,,,,,B])=>{const $=B!==void 0&&B.length!==z;return f&&!y&&!$}),P(([,,[f,y],z,B,$,_,D,L,W,F,U])=>{const J=B,{offsetTree:xe,sizeTree:re}=J,ie=we(j);if(z===0)return{...so,totalCount:z};if(f===0&&y===0)return ie===0?{...so,totalCount:z}:Vr(ie,$,B,L,W,U||[]);if(fe(re))return ie>0?null:Bn(Kl(So($,z),J,U),[],z,W,J,L);const he=[];if(D.length>0){const q=D[0],V=D[D.length-1];let Y=0;for(const ne of Gt(re,q,V)){const X=ne.value,se=Math.max(ne.start,q),ge=Math.min(ne.end,V);for(let ce=se;ce<=ge;ce++)he.push({data:U?.[ce],index:ce,offset:Y,size:X}),Y+=X}}if(!_)return Bn([],he,z,W,J,L);const ae=D.length>0?D[D.length-1]+1:0,pe=Bl(xe,f,y,ae);if(pe.length===0)return null;const Se=z-1,de=An([],q=>{for(const V of pe){const Y=V.value;let ne=Y.offset,X=V.start;const se=Y.size;if(Y.offset<f){X+=Math.floor((f-Y.offset+W)/(se+W));const ce=X-V.start;ne+=ce*se+ce*W}X<ae&&(ne+=(ae-X)*se,X=ae);const ge=Math.min(V.end,Se);for(let ce=X;ce<=ge&&!(ne>=y);ce++)q.push({data:U?.[ce],index:ce,offset:ne,size:se}),ne+=se+W}}),ke=cr(F,mn),M=cr(F,fn);if(de.length>0&&(ke>0||M>0)){const q=de[0],V=de[de.length-1];if(ke>0&&q.index>ae){const Y=Math.min(ke,q.index-ae),ne=[];let X=q.offset;for(let se=q.index-1;se>=q.index-Y;se--){const ge=Gt(re,se,se)[0]?.value??q.size;X-=ge+W,ne.unshift({data:U?.[se],index:se,offset:X,size:ge})}de.unshift(...ne)}if(M>0&&V.index<Se){const Y=Math.min(M,Se-V.index);let ne=V.offset+V.size+W;for(let X=V.index+1;X<=V.index+Y;X++){const se=Gt(re,X,X)[0]?.value??V.size;de.push({data:U?.[X],index:X,offset:ne,size:se}),ne+=se+W}}}return Bn(de,he,z,W,J,L)}),K(f=>f!==null),ye()),so);O(R(n,K(bo),P(f=>f?.length)),i),O(R(w,P(f=>
2f.topListHeight)),x),O(x,u),O(R(w,P(f=>[f.top,f.bottom])),a),O(R(w,P(f=>f.items)),g);const k=Ue(R(w,K(({items:f})=>f.length>0),te(i,n),K(([{items:f},y])=>f[f.length-1].originalIndex===y-1),P(([,f,y])=>[f-1,y]),ye(cn),P(([f])=>f))),I=Ue(R(w,bt(200),K(({items:f,topItems:y})=>f.length>0&&f[0].originalIndex===y.length),P(({items:f})=>f[0].index),ye())),b=Ue(R(w,K(({items:f})=>f.length>0),P(({items:f})=>{let y=0,z=f.length-1;for(;f[y].type==="group"&&y<z;)y++;for(;f[z].type==="group"&&z>y;)z--;return{endIndex:f[z].index,startIndex:f[y].index}}),ye(Lr)));return{endReached:k,initialItemCount:j,itemsRendered:g,listState:w,minOverscanItemCount:p,rangeChanged:b,startReached:I,topItemsIndexes:C,...v}},je(dt,Ar,Co,hn,pn,gn,Nt,jo),{singleton:!0}),qr=le(([{fixedFooterHeight:n,fixedHeaderHeight:e,footerHeight:t,headerHeight:r},{listState:i}])=>{const s=oe(),a=He(R(Te(t,n,r,e,i),P(([u,c,m,h,x])=>u+c+m+h+x.offsetBottom+x.bottom)),0);return O(G(a),s),{totalListHeight:a,totalListHeightChanged:s}},je(Le,$t),{singleton:!0}),Ql=le(([{viewportHeight:n},{totalListHeight:e}])=>{const t=H(!1),r=He(R(Te(t,n,e),K(([i])=>i),P(([,i,s])=>Math.max(0,i-s)),bt(0),ye()),0);return{alignToBottom:t,paddingTopAddition:r}},je(Le,qr),{singleton:!0}),Ur=le(()=>({context:H(null)})),Yl=({itemBottom:n,itemTop:e,locationParams:{align:t,behavior:r,...i},viewportBottom:s,viewportTop:a})=>e<a?{...i,align:t??"start",...r!==void 0?{behavior:r}:{}}:n>s?{...i,align:t??"end",...r!==void 0?{behavior:r}:{}}:null,Gr=le(([{gap:n,sizes:e,totalCount:t},{fixedFooterHeight:r,fixedHeaderHeight:i,headerHeight:s,scrollingInProgress:a,scrollTop:u,viewportHeight:c},{scrollToIndex:m}])=>{const h=oe();return O(R(h,te(e,c,t,s,i,r,u),te(n),P(([[x,v,S,d,C,j,g,p],w])=>{const{calculateViewLocation:k=Yl,done:I,...b}=x,f=Fr(x,v,d-1),y=un(f,v.offsetTree,w)+C+j,z=y+rt(v.sizeTree,f)[1],B=p+j,$=p+S-g,_=k({itemBottom:z,itemTop:y,locationParams:b,viewportBottom:$,viewportTop:B});return _!==null?I&&ot(R(a,K(D=>!D),Ht(we(a)?1:2)),I):I?.(),_}),K(x=>x!==null)),m),{scrollIntoView:h}},je(dt,Le,pn,$t,Ct),{singleton:!0});function ur(n){return n===!1?!1:n==="smooth"?"smooth":"auto"}const Xl=(n,e)=>typeof n=="function"?ur(n(e)):e&&ur(n),Zl=le(([{listRefresh:n,totalCount:e,fixedItemSize:t,data:r},{atBottomState:i,isAtBottom:s},{scrollToIndex:a},{scrolledToInitialItem:u},{didMount:c,propsReady:m},{log:h},{scrollingInProgress:x},{context:v},{scrollIntoView:S}])=>{const d=H(!1),C=oe();let j=null;function g(I){ee(a,{align:"end",behavior:I,index:"LAST"})}ue(R(Te(R(G(e),Ht(1)),c),te(G(d),s,u,x),P(([[I,b],f,y,z,B])=>{let $=b&&z,_="auto";return $&&(_=Xl(f,y||B),$=$&&_!==!1),{followOutputBehavior:_,shouldFollow:$,totalCount:I}}),K(({shouldFollow:I})=>I)),({followOutputBehavior:I,totalCount:b})=>{j!==null&&(j(),j=null),we(t)!==void 0?requestAnimationFrame(()=>{we(h)("following output to ",{totalCount:b},ze.DEBUG),g(I)}):j=ot(n,()=>{we(h)("following output to ",{totalCount:b},ze.DEBUG),g(I),j=null})});function p(I){const b=ot(i,f=>{I&&!f.atBottom&&f.notAtBottomBecause==="SIZE_INCREASED"&&j===null&&(we(h)("scrolling to bottom due to increased size",{},ze.DEBUG),g("auto"))});setTimeout(b,100)}ue(R(Te(G(d),e,m),K(([I,,b])=>I!==!1&&b),ct(({value:I},[,b])=>({refreshed:I===b,value:b}),{refreshed:!1,value:0}),K(({refreshed:I})=>I),te(d,e)),([,I])=>{we(u)&&p(I!==!1)}),ue(C,()=>{p(we(d)!==!1)}),ue(Te(G(d),i),([I,b])=>{I!==!1&&!b.atBottom&&b.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&g("auto")});const w=H(null),k=oe();return O(co(R(G(r),P(I=>I?.length??0)),R(G(e))),k),ue(R(Te(R(k,Ht(1)),c),te(G(w),u,x,v),P(([[I,b],f,y,z,B])=>b&&y&&f?.({context:B,totalCount:I,scrollingInProgress:z})),K(I=>!!I),bt(0)),I=>{j!==null&&(j(),j=null),we(t)!==void 0?requestAnimationFrame(()=>{we(h)("scrolling into view",{}),ee(S,I)}):j=ot(n,()=>{we(h)("scrolling into view",{}),ee(S,I),j=null})}),{autoscrollToBottom:C,followOutput:d,scrollIntoViewOnChange:w}},je(dt,gn,pn,hn,Nt,Ct,Le,Ur,Gr)),Jl=le(([{data:n,firstItemIndex:e,gap:t,sizes:r},{initialTopMostItemIndex:i},{initialItemCount:s,listState:a},{didMount:u}])=>(O(R(u,te(s),K(([,c])=>c!==0),te(i,r,e,t,n),P(([[,c],m,h,x,v,S=[]])=>Vr(c,m,h,x,v,S))),a),{}),je(dt,hn,$t,Nt),{singleton:!0}
2),ei=le(([{didMount:n},{scrollTo:e},{listState:t}])=>{const r=H(0);return ue(R(n,te(r),K(([,i])=>i!==0),P(([,i])=>({top:i}))),i=>{ot(R(t,Ht(1),K(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{ee(e,i)})})}),{initialScrollTop:r}},je(Nt,Le,$t),{singleton:!0}),Kr=le(([{scrollVelocity:n}])=>{const e=H(!1),t=oe(),r=H(!1);return O(R(n,te(r,e,t),K(([i,s])=>s!==!1&&s!==void 0),P(([i,s,a,u])=>{const{enter:c,exit:m}=s;if(a){if(m(i,u))return!1}else if(c(i,u))return!0;return a}),ye()),e),ue(R(Te(e,n,t),te(r)),([[i,s,a],u])=>{i&&u!==!1&&u!==void 0&&u.change&&u.change(s,a)}),{isSeeking:e,scrollSeekConfiguration:r,scrollSeekRangeChanged:t,scrollVelocity:n}},je(gn),{singleton:!0}),No=le(([{scrollContainerState:n,scrollTo:e}])=>{const t=oe(),r=oe(),i=oe(),s=H(!1),a=H(void 0);return O(R(Te(t,r),P(([{scrollTop:u,viewportHeight:c},{offsetTop:m,listHeight:h}])=>({scrollHeight:h,scrollTop:Math.max(0,u-m),viewportHeight:c}))),n),O(R(e,te(r),P(([u,{offsetTop:c}])=>({...u,top:u.top+c}))),i),{customScrollParent:a,useWindowScroll:s,windowScrollContainerState:t,windowScrollTo:i,windowViewportRect:r}},je(Le)),ti=le(([{sizeRanges:n,sizes:e},{headerHeight:t,scrollTop:r},{initialTopMostItemIndex:i},{didMount:s},{useWindowScroll:a,windowScrollContainerState:u,windowViewportRect:c}])=>{const m=oe(),h=H(void 0),x=H(null),v=H(null);return O(u,x),O(c,v),ue(R(m,te(e,r,a,x,v,t)),([S,d,C,j,g,p,w])=>{const k=Dl(d.sizeTree);j&&g!==null&&p!==null&&(C=g.scrollTop-p.offsetTop),C-=w,S({ranges:k,scrollTop:C})}),O(R(h,K(bo),P(ni)),i),O(R(s,te(h),K(([,S])=>S!==void 0),ye(),P(([,S])=>S.ranges)),n),{getState:m,restoreStateFrom:h}},je(dt,Le,hn,Nt,No));function ni(n){return{align:"start",index:0,offset:n.scrollTop}}const oi=le(([{topItemsIndexes:n}])=>{const e=H(0);return O(R(e,K(t=>t>=0),P(t=>Array.from({length:t}).map((r,i)=>i))),n),{topItemCount:e}},je($t));function Qr(n){let e=!1,t;return(()=>(e||(e=!0,t=n()),t))}const ri=Qr(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),si=le(([{deviation:n,scrollBy:e,scrollingInProgress:t,scrollTop:r},{isAtBottom:i,isScrolling:s,lastJumpDueToItemResize:a,scrollDirection:u},{listState:c},{beforeUnshiftWith:m,gap:h,shiftWithOffset:x,sizes:v},{log:S},{recalcInProgress:d}])=>{const C=Ue(R(c,te(a),ct(([,g,p,w],[{bottom:k,items:I,offsetBottom:b,totalCount:f},y])=>{const z=k+b;let B=0;return p===f&&g.length>0&&I.length>0&&(I[0].originalIndex===0&&g[0].originalIndex===0||(B=z-w,B!==0&&(B+=y))),[B,I,f,z]},[0,[],0,0]),K(([g])=>g!==0),te(r,u,t,i,S,d),K(([,g,p,w,,,k])=>!k&&!w&&g!==0&&p===dn),P(([[g],,,,,p])=>(p("Upward scrolling compensation",{amount:g},ze.DEBUG),g))));function j(g){g>0?(ee(e,{behavior:"auto",top:-g}),ee(n,0)):(ee(n,0),ee(e,{behavior:"auto",top:-g}))}return ue(R(C,te(n,s)),([g,p,w])=>{w&&ri()?ee(n,p-g):j(-g)}),ue(R(Te(He(s,!1),n,d),K(([g,p,w])=>!g&&!w&&p!==0),P(([g,p])=>p),bt(1)),j),O(R(x,P(g=>({top:-g}))),e),ue(R(m,te(v,h),P(([g,{groupIndices:p,lastSize:w,sizeTree:k},I])=>{function b($){return $*(w+I)}if(p.length===0)return b(g);let f=0;const y=an(k,0);let z=0,B=0;for(;z<g;){z++,f+=y;let $=p.length===B+1?1/0:p[B+1]-p[B]-1;z+$>g&&(f-=y,$=g-z+1),z+=$,f+=b($),B++}return f})),g=>{ee(n,g),requestAnimationFrame(()=>{ee(e,{top:g}),requestAnimationFrame(()=>{ee(n,0),ee(d,!1)})})}),{deviation:n}},je(Le,gn,$t,dt,Ct,jo)),li=le(([n,e,t,r,i,s,a,u,c,m,h])=>({...n,...e,...t,...r,...i,...s,...a,...u,...c,...m,...h}),je(Co,Jl,Nt,Kr,qr,ei,Ql,No,Gr,Ct,Ur)),Yr=le(([{data:n,defaultItemSize:e,firstItemIndex:t,fixedItemSize:r,fixedGroupSize:i,gap:s,groupIndices:a,heightEstimates:u,itemSize:c,sizeRanges:m,sizes:h,statefulTotalCount:x,totalCount:v,trackItemSizes:S},{initialItemFinalLocationReached:d,initialTopMostItemIndex:C,scrolledToInitialItem:j},g,p,w,k,{scrollToIndex:I},b,{topItemCount:f},{groupCounts:y},z])=>{const{listState:B,minOverscanItemCount:$,topItemsIndexes:_,rangeChanged:D,...L}=k;return O(D,z.scrollSeekRangeChanged),O(R(z.windowViewportRect,P(W=>W.visibleHeight)),g.viewportHeight),{data:n,defaultItemHeight:e,firstItemIndex:t,fixedItemHeight:r,fixedGroupHeight:i,gap:s,groupCounts:y,heightEstimates:u,initialItemFinalLocationReached:d,initialTopM
2ostItemIndex:C,scrolledToInitialItem:j,sizeRanges:m,topItemCount:f,topItemsIndexes:_,totalCount:v,...w,groupIndices:a,itemSize:c,listState:B,minOverscanItemCount:$,scrollToIndex:I,statefulTotalCount:x,trackItemSizes:S,rangeChanged:D,...L,...z,...g,sizes:h,...p}},je(dt,hn,Le,ti,Zl,$t,pn,si,oi,Ar,li));function ii(n,e){const t={},r={};let i=0;const s=n.length;for(;i<s;)r[n[i]]=1,i+=1;for(const a in e)Object.hasOwn(r,a)||(t[a]=e[a]);return t}const Rn=typeof document<"u"?A.useLayoutEffect:A.useEffect;function Xr(n,e,t){const r=Object.keys(e.required||{}),i=Object.keys(e.optional||{}),s=Object.keys(e.methods||{}),a=Object.keys(e.events||{}),u=A.createContext({});function c(j,g){j.propsReady!==void 0&&ee(j.propsReady,!1);for(const p of r){const w=j[e.required[p]];ee(w,g[p])}for(const p of i)if(p in g){const w=j[e.optional[p]];ee(w,g[p])}j.propsReady!==void 0&&ee(j.propsReady,!0)}function m(j){return s.reduce((g,p)=>(g[p]=w=>{const k=j[e.methods[p]];ee(k,w)},g),{})}function h(j){return a.reduce((g,p)=>(g[p]=kl(j[e.events[p]]),g),{})}const x=A.forwardRef(function(j,g){const{children:p,...w}=j,[k]=A.useState(()=>An(Cl(n),f=>{c(f,w)})),[I]=A.useState(er(h,k));Rn(()=>{for(const f of a)f in w&&ue(I[f],w[f]);return()=>{Object.values(I).map(vo)}},[w,I,k]),Rn(()=>{c(k,w)}),A.useImperativeHandle(g,Jo(m(k)));const b=t;return o.jsx(u.Provider,{value:k,children:t!==void 0?o.jsx(b,{...ii([...r,...i,...a],w),children:p}):p})}),v=j=>{const g=A.useContext(u);return A.useCallback(p=>{ee(g[j],p)},[g,j])},S=j=>{const g=A.useContext(u)[j],p=A.useCallback(w=>ue(g,w),[g]);return A.useSyncExternalStore(p,()=>we(g),()=>we(g))},d=j=>{const g=A.useContext(u)[j],[p,w]=A.useState(er(we,g));return Rn(()=>ue(g,k=>{k!==p&&w(Jo(k))}),[g,p]),p},C=parseInt(A.version)>=18?S:d;return{Component:x,useEmitter:(j,g)=>{const p=A.useContext(u)[j];Rn(()=>ue(p,g),[g,p])},useEmitterValue:C,usePublisher:v}}const Zr=A.createContext(void 0),Jr=A.createContext(void 0),lo="-webkit-sticky",dr="sticky",To=Qr(()=>{if(typeof document>"u")return dr;const n=document.createElement("div");return n.style.position=lo,n.style.position===lo?lo:dr}),es=typeof document<"u"?A.useLayoutEffect:A.useEffect;function io(n){return"self"in n}function ai(n){return"body"in n}function ts(n,e,t,r=Qt,i,s){const a=A.useRef(null),u=A.useRef(null),c=A.useRef(null),m=A.useCallback(v=>{let S,d,C;const j=v.target;if(ai(j)||io(j)){const p=io(j)?j:j.defaultView;C=s===!0?p.scrollX:p.scrollY,S=s===!0?p.document.documentElement.scrollWidth:p.document.documentElement.scrollHeight,d=s===!0?p.innerWidth:p.innerHeight}else C=s===!0?j.scrollLeft:j.scrollTop,S=s===!0?j.scrollWidth:j.scrollHeight,d=s===!0?j.offsetWidth:j.offsetHeight;const g=()=>{n({scrollHeight:S,scrollTop:Math.max(C,0),viewportHeight:d})};v.suppressFlushSync===!0?g():$s.flushSync(g),u.current!==null&&(C===u.current||C<=0||C===S-d)&&(u.current=null,e(!0),c.current&&(clearTimeout(c.current),c.current=null))},[n,e,s]);A.useEffect(()=>{const v=i||a.current;return r(i||a.current),m({suppressFlushSync:!0,target:v}),v.addEventListener("scroll",m,{passive:!0}),()=>{r(null),v.removeEventListener("scroll",m)}},[a,m,t,r,i]);function h(v){const S=a.current;if(!S||(s===!0?"offsetWidth"in S&&S.offsetWidth===0:"offsetHeight"in S&&S.offsetHeight===0))return;const d=v.behavior==="smooth";let C,j,g;io(S)?(j=Math.max(kt(S.document.documentElement,s===!0?"width":"height"),s===!0?S.document.documentElement.scrollWidth:S.document.documentElement.scrollHeight),C=s===!0?S.innerWidth:S.innerHeight,g=s===!0?window.scrollX:window.scrollY):(j=S[s===!0?"scrollWidth":"scrollHeight"],C=kt(S,s===!0?"width":"height"),g=S[s===!0?"scrollLeft":"scrollTop"]);const p=j-C;if(v.top=Math.ceil(Math.max(Math.min(p,v.top),0)),Wr(C,j)||v.top===g){n({scrollHeight:j,scrollTop:g,viewportHeight:C}),d&&e(!0);return}d?(u.current=v.top,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,u.current=null,e(!0)},1e3)):u.current=null,s===!0&&(v={...v.behavior!==void 0?{behavior:v.behavior}:{},left:v.top}),S.scrollTo(v)}function x(v){s===!0&&(v={...v.behavior!==void 0?{behavior:v.behavior}:{}
2,...v.top!==void 0?{left:v.top}:{}}),a.current.scrollBy(v)}return{scrollByCallback:x,scrollerRef:a,scrollToCallback:h}}function Io(n){return n}const ci=le(()=>{const n=H(u=>`Item ${u}`),e=H(u=>`Group ${u}`),t=H({}),r=H(Io),i=H("div"),s=H(Qt),a=(u,c=null)=>He(R(t,P(m=>m[u]),ye()),c);return{components:t,computeItemKey:r,EmptyPlaceholder:a("EmptyPlaceholder"),FooterComponent:a("Footer"),GroupComponent:a("Group","div"),groupContent:e,HeaderComponent:a("Header"),HeaderFooterTag:i,ItemComponent:a("Item","div"),itemContent:n,ListComponent:a("List","div"),ScrollerComponent:a("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:a("ScrollSeekPlaceholder"),TopItemListComponent:a("TopItemList")}}),ui=le(([n,e])=>({...n,...e}),je(Yr,ci)),di=({height:n})=>o.jsx("div",{style:{height:n}}),mi={overflowAnchor:"none",position:To(),zIndex:1},ns={overflowAnchor:"none"},fi={...ns,display:"inline-block",height:"100%"},mr=A.memo(function({showTopList:n=!1}){const e=Q("listState"),t=Xe("sizeRanges"),r=Q("useWindowScroll"),i=Q("customScrollParent"),s=Xe("windowScrollContainerState"),a=Xe("scrollContainerState"),u=i||r?s:a,c=Q("itemContent"),m=Q("context"),h=Q("groupContent"),x=Q("trackItemSizes"),v=Q("itemSize"),S=Q("log"),d=Xe("gap"),C=Q("horizontalDirection"),{callbackRef:j}=Il(t,v,x,n?Qt:u,S,d,i,C,Q("skipAnimationFrameInResizeObserver")),[g,p]=A.useState(0);Ro("deviation",L=>{g!==L&&p(L)});const w=Q("EmptyPlaceholder"),k=Q("ScrollSeekPlaceholder")??di,I=Q("ListComponent"),b=Q("ItemComponent"),f=Q("GroupComponent"),y=Q("computeItemKey"),z=Q("isSeeking"),B=Q("groupIndices").length>0,$=Q("alignToBottom"),_=Q("initialItemFinalLocationReached"),D=n?{}:{boxSizing:"border-box",...C?{display:"inline-block",height:"100%",marginLeft:g!==0?g:$?"auto":0,paddingLeft:e.offsetTop,paddingRight:e.offsetBottom,whiteSpace:"nowrap"}:{marginTop:g!==0?g:$?"auto":0,paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},..._?{}:{visibility:"hidden"}};return!n&&e.totalCount===0&&w!==null&&w!==void 0?o.jsx(w,{...Ee(w,m)}):o.jsx(I,{...Ee(I,m),"data-testid":n?"virtuoso-top-item-list":"virtuoso-item-list",ref:j,style:D,children:(n?e.topItems:e.items).map(L=>{const W=L.originalIndex,F=y(W+e.firstItemIndex,L.data,m);return z?T.createElement(k,{...Ee(k,m),height:L.size,index:L.index,key:F,type:L.type||"item",...L.type==="group"?{}:{groupIndex:L.groupIndex}}):L.type==="group"?T.createElement(f,{...Ee(f,m),"data-index":W,"data-item-index":L.index,"data-known-size":L.size,key:F,style:mi},h(L.index,m)):T.createElement(b,{...Ee(b,m),...xi(b,L.data),"data-index":W,"data-item-group-index":L.groupIndex,"data-item-index":L.index,"data-known-size":L.size,key:F,style:C?fi:ns},B?c(L.index,L.groupIndex,L.data,m):c(L.index,L.data,m))})})}),pi={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},hi={outline:"none",overflowX:"auto",position:"relative"},zo=n=>({height:"100%",position:"absolute",top:0,width:"100%",...n?{display:"flex",flexDirection:"column"}:void 0}),os=(n,e,t=0)=>({...zo(n),position:e?"relative":"absolute",top:e?-t:0}),gi={position:To(),top:0,width:"100%",zIndex:1};function Ee(n,e){if(typeof n!="string")return{context:e}}function xi(n,e){return{item:typeof n=="string"?void 0:e}}const bi=A.memo(function(){const n=Q("HeaderComponent"),e=Xe("headerHeight"),t=Q("HeaderFooterTag"),r=Mt(A.useMemo(()=>s=>{e(kt(s,"height"))},[e]),!0,Q("skipAnimationFrameInResizeObserver")),i=Q("context");return n!=null?o.jsx(t,{ref:r,children:o.jsx(n,{...Ee(n,i)})}):null}),vi=A.memo(function(){const n=Q("FooterComponent"),e=Xe("footerHeight"),t=Q("HeaderFooterTag"),r=Mt(A.useMemo(()=>s=>{e(kt(s,"height"))},[e]),!0,Q("skipAnimationFrameInResizeObserver")),i=Q("context");return n!=null?o.jsx(t,{ref:r,children:o.jsx(n,{...Ee(n,i)})}):null});function rs({useEmitter:n,useEmitterValue:e,usePublisher:t}){return A.memo(function({children:r,style:i,context:s,...a}){const u=t("scrollContainerState"),c=e("ScrollerComponent"),m=t("smoothScrollTargetReached"),h=e("scrollerRef"),x=e("horizontalDirection")||!1,{scrollByCallback:v,scrollerRef:S,scrollToCallback:d}=ts(u,m,c,h,void 0,x);return n("scrollTo",d),n("scrollBy",v),o.jsx(c,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:S,style:{...x?hi:pi,...i},tabIndex:0,...a,...Ee(c,s),children:r})})}function ss({useEmitter:n,useEmitterValue:e,usePublisher:t}){return A.memo(function({children:r,style:i,context:s,...a}){const u=t("windowScrollContainerState"),c=e("ScrollerComponent"),m=t("smoothScrollTargetReached"),h=e("totalListHeight"),x=e("deviation"),v=e("customScrollParent"),S=A.useRef(null),d=e("scrollerRef"),{scrollByCallback:C,scrollerRef:j,scrollToCallback:g}=ts(u,m,c,d,v);return es(()=>(j.current=v||S.current?.ownerDocument.defaultView,()=>{j.current=null}),[j,v]),n("windowScrollTo",g),n("scrollBy",C),o.jsx(c,{ref:S,"data-virtuoso-scroller":!0,style:{position:"relative",...i,...h!==0?{height:h+x}:void 0},...a,...Ee(c,s),children:r})})}const yi=({children:n})=>
2{const e=A.useContext(Zr),t=Xe("viewportHeight"),r=Xe("fixedItemHeight"),i=Q("alignToBottom"),s=Q("horizontalDirection"),a=A.useMemo(()=>zr(t,c=>kt(c,s?"width":"height")),[t,s]),u=Mt(a,!0,Q("skipAnimationFrameInResizeObserver"));return A.useEffect(()=>{e&&(t(e.viewportHeight),r(e.itemHeight))},[e,t,r]),o.jsx("div",{"data-viewport-type":"element",ref:u,style:zo(i),children:n})},ji=({children:n})=>{const e=A.useContext(Zr),t=Xe("windowViewportRect"),r=Xe("fixedItemHeight"),i=Q("customScrollParent"),s=Q("useWindowScroll"),a=Q("topListHeight"),u=_r(t,i,Q("skipAnimationFrameInResizeObserver")),c=Q("alignToBottom");return A.useEffect(()=>{e&&(r(e.itemHeight),t({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,t,r]),o.jsx("div",{"data-viewport-type":"window",ref:u,style:os(c,s,a),children:n})},wi=({children:n})=>{const e=Q("TopItemListComponent")??"div",t=Q("headerHeight"),r={...gi,marginTop:`${t}px`},i=Q("context");return o.jsx(e,{style:r,...Ee(e,i),children:n})},ki=A.memo(function(n){const e=Q("useWindowScroll"),t=Q("topItemsIndexes").length>0,r=Q("customScrollParent"),i=Q("context");return o.jsxs(r||e?Ni:Ci,{...n,context:i,children:[t&&o.jsx(wi,{children:o.jsx(mr,{showTopList:!0})}),o.jsxs(r||e?ji:yi,{children:[o.jsx(bi,{}),o.jsx(mr,{}),o.jsx(vi,{})]})]})}),{Component:Si,useEmitter:Ro,useEmitterValue:Q,usePublisher:Xe}=Xr(ui,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},ki),Ci=rs({useEmitter:Ro,useEmitterValue:Q,usePublisher:Xe}),Ni=ss({useEmitter:Ro,useEmitterValue:Q,usePublisher:Xe}),Ti=Si,Ii=le(()=>{const n=H(m=>o.jsxs("td",{children:["Item $",m]})),e=H(null),t=H(m=>o.jsxs("td",{colSpan:1e3,children:["Group ",m]})),r=H(null),i=H(null),s=H({}),a=H(Io),u=H(Qt),c=(m,h=null)=>He(R(s,P(x=>x[m]),ye()),h);return{components:s,computeItemKey:a,context:e,EmptyPlaceholder:c("EmptyPlaceholder"),FillerRow:c("FillerRow"),fixedFooterContent:i,fixedHeaderContent:r,itemContent:n,groupContent:t,ScrollerComponent:c("Scroller","div"),scrollerRef:u,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder"),TableBodyComponent:c("TableBody","tbody"),TableComponent:c("Table","table"),TableFooterComponent:c("TableFoot","tfoot"),TableHeadComponent:c("TableHead","thead"),TableRowComponent:c("TableRow","tr"),GroupComponent:c("Group","tr")}});je(Yr,Ii);To();const fr={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},zi={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0}
2,{ceil:pr,floor:Pn,max:sn,min:ao,round:hr}=Math;function gr(n,e,t){return Array.from({length:e-n+1}).map((r,i)=>({data:t===null?null:t[i+n],index:i+n}))}function Ri(n){return{...zi,items:n}}function _n(n,e){return n!==void 0&&n.width===e.width&&n.height===e.height}function _i(n,e){return n!==void 0&&n.column===e.column&&n.row===e.row}const Ei=le(([{increaseViewportBy:n,listBoundary:e,overscan:t,visibleRange:r},{footerHeight:i,headerHeight:s,scrollBy:a,scrollContainerState:u,scrollTo:c,scrollTop:m,smoothScrollTargetReached:h,viewportHeight:x},v,S,{didMount:d,propsReady:C},{customScrollParent:j,useWindowScroll:g,windowScrollContainerState:p,windowScrollTo:w,windowViewportRect:k},I])=>{const b=H(0),f=H(0),y=H(fr),z=H({height:0,width:0}),B=H({height:0,width:0}),$=oe(),_=oe(),D=H(0),L=H(null),W=H({column:0,row:0}),F=oe(),U=oe(),J=H(!1),xe=H(0),re=H(!0),ie=H(!1),he=H(!1);ue(R(d,te(xe),K(([M,q])=>q!==0)),()=>{ee(re,!1)}),ue(R(Te(d,re,B,z,xe,ie),K(([M,q,V,Y,,ne])=>M&&!q&&V.height!==0&&Y.height!==0&&!ne)),([,,,,M])=>{ee(ie,!0),ko(1,()=>{ee($,M)}),ot(R(m),()=>{ee(e,[0,0]),ee(re,!0)})}),O(R(U,K(M=>M!=null&&M.scrollTop>0),it(0)),f),ue(R(d,te(U),K(([,M])=>M!=null)),([,M])=>{M&&(ee(z,M.viewport),ee(B,M.item),ee(W,M.gap),M.scrollTop>0&&(ee(J,!0),ot(R(m,Ht(1)),q=>{ee(J,!1)}),ee(c,{top:M.scrollTop})))}),O(R(z,P(({height:M})=>M)),x),O(R(Te(G(z,_n),G(B,_n),G(W,(M,q)=>M!==void 0&&M.column===q.column&&M.row===q.row),G(m)),P(([M,q,V,Y])=>({gap:V,item:q,scrollTop:Y,viewport:M}))),F),O(R(Te(G(b),r,G(W,_i),G(B,_n),G(z,_n),G(L),G(f),G(J),G(re),G(xe)),K(([,,,,,,,M])=>!M),P(([M,[q,V],Y,ne,X,se,ge,,ce,Re])=>{const{column:me,row:Me}=Y,{height:Ce,width:_e}=ne,{width:Ne}=X;if(ge===0&&(M===0||Ne===0))return fr;if(_e===0){const vt=So(Re,M),It=vt+Math.max(ge-1,0);return Ri(gr(vt,It,se))}const $e=ls(Ne,_e,me);let Fe,Be;ce?q===0&&V===0&&ge>0?(Fe=0,Be=ge-1):(Fe=$e*Pn((q+Me)/(Ce+Me)),Be=$e*pr((V+Me)/(Ce+Me))-1,Be=ao(M-1,sn(Be,$e-1)),Fe=ao(Be,sn(0,Fe))):(
2Fe=0,Be=-1);const Ke=gr(Fe,Be,se),{bottom:Qe,top:mt}=xr(X,Y,ne,Ke),Yt=pr(M/$e),Tt=Yt*Ce+(Yt-1)*Me-Qe;return{bottom:Qe,itemHeight:Ce,items:Ke,itemWidth:_e,offsetBottom:Tt,offsetTop:mt,top:mt}})),y),O(R(L,K(M=>M!==null),P(M=>M.length)),b),O(R(Te(z,B,y,W),K(([M,q,{items:V}])=>V.length>0&&q.height!==0&&M.height!==0),P(([M,q,{items:V},Y])=>{const{bottom:ne,top:X}=xr(M,Y,q,V);return[X,ne]}),ye(cn)),e);const ae=H(!1);O(R(m,te(ae),P(([M,q])=>q||M!==0)),ae);const pe=Ue(R(Te(y,b),K(([{items:M}])=>M.length>0),te(ae),K(([[M,q],V])=>{const Y=M.items[M.items.length-1].index===q-1;return(V||M.bottom>0&&M.itemHeight>0&&M.offsetBottom===0&&M.items.length===q)&&Y}),P(([[,M]])=>M-1),ye())),Se=Ue(R(G(y),K(({items:M})=>M.length>0&&M[0].index===0),it(0),ye())),de=Ue(R(G(y),te(J),K(([{items:M},q])=>M.length>0&&!q),P(([{items:M}])=>({endIndex:M[M.length-1].index,startIndex:M[0].index})),ye(Lr),bt(0)));O(de,S.scrollSeekRangeChanged),O(R($,te(z,B,b,W),P(([M,q,V,Y,ne])=>{const X=Or(M),{align:se,behavior:ge,offset:ce}=X;let Re=X.index;Re==="LAST"&&(Re=Y-1),Re=sn(0,Re,ao(Y-1,Re));let me=ho(q,ne,V,Re);return se==="end"?me=hr(me-q.height+V.height):se==="center"&&(me=hr(me-q.height/2+V.height/2)),ce!==void 0&&ce!==0&&(me+=ce),{behavior:ge,top:me}})),c);const ke=He(R(y,P(M=>M.offsetBottom+M.bottom)),0);return O(R(k,P(M=>({height:M.visibleHeight,width:M.visibleWidth}))),z),{customScrollParent:j,data:L,deviation:D,footerHeight:i,gap:W,headerHeight:s,increaseViewportBy:n,initialItemCount:f,itemDimensions:B,overscan:t,restoreStateFrom:U,scrollBy:a,scrollContainerState:u,scrollHeight:_,scrollTo:c,scrollToIndex:$,scrollTop:m,smoothScrollTargetReached:h,totalCount:b,useWindowScroll:g,viewportDimensions:z,windowScrollContainerState:p,windowScrollTo:w,windowViewportRect:k,...S,gridState:y,horizontalDirection:he,initialTopMostItemIndex:xe,totalListHeight:ke,...v,endReached:pe,propsReady:C,rangeChanged:de,startReached:Se,stateChanged:F,stateRestoreInProgress:J,...I}},je(Co,Le,gn,Kr,Nt,No,Ct));function ls(n,e,t){return sn(1,Pn((n+t)/(Pn(e)+t)))}function xr(n,e,t,r){const{height:i}=t;if(i===void 0||r.length===0)return{bottom:0,top:0};const s=ho(n,e,t,r[0].index);return{bottom:ho(n,e,t,r[r.length-1].index)+i,top:s}}function ho(n,e,t,r){const i=ls(n.width,t.width,e.column),s=Pn(r/i),a=s*t.height+sn(0,s-1)*e.row;return a>0?a+e.row:a}const Hi=le(()=>{const n=H(x=>`Item ${x}`),e=H({}),t=H(null),r=H("virtuoso-grid-item"),i=H("virtuoso-grid-list"),s=H(Io),a=H("div"),u=H(Qt),c=(x,v=null)=>He(R(e,P(S=>S[x]),ye()),v),m=H(!1),h=H(!1);return O(G(h),m),{components:e,computeItemKey:s,context:t,FooterComponent:c("Footer"),HeaderComponent:c("Header"),headerFooterTag:a,itemClassName:r,ItemComponent:c("Item","div"),itemContent:n,listClassName:i,ListComponent:c("List","div"),readyStateChanged:m,reportReadyState:h,ScrollerComponent:c("Scroller","div"),scrollerRef:u,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder","div")}}),Mi=le(([n,e])=>({...n,...e}),je(Ei,Hi)),$i=A.memo(function(){const n=ve("gridState"),e=ve("listClassName"),t=ve("itemClassName"),r=ve("itemContent"),i=ve("computeItemKey"),s=ve("isSeeking"),a=Ze("scrollHeight"),u=ve("ItemComponent"),c=ve("ListComponent"),m=ve("ScrollSeekPlaceholder"),h=ve("context"),x=Ze("itemDimensions"),v=Ze("gap"),S=ve("log"),d=ve("stateRestoreInProgress"),C=Ze("reportReadyState"),j=Mt(A.useMemo(()=>g=>{const p=g.parentElement.parentElement.scrollHeight;a(p);const w=g.firstChild;if(w!==null){const{height:k,width:I}=w.getBoundingClientRect();x({height:k,width:I})}v({column:br("column-gap",getComputedStyle(g).columnGap,S),row:br("row-gap",getComputedStyle(g).rowGap,S)})},[a,x,v,S]),!0,!1);return es(()=>{n.itemHeight>0&&n.itemWidth>0&&C(!0)},[n]),d?null:o.jsx(c,{className:e,ref:j,...Ee(c,h),"data-testid":"virtuoso-item-list",style:{paddingBottom:n.offsetBottom,paddingTop:n.offsetTop},children:n.items.map(g=>{const p=i(g.index,g.data,h);return s?o.jsx(m,{...Ee(m,h),height:n.itemHeight,index:g.index,width:n.itemWidth},p):T.createElement(u,{...Ee(u,h),className:t,"data-index":g.index,key:p},r(g.index,g.data,h))})})}),Bi=A.memo(function(){const n=ve("HeaderComponent"),e=Ze("headerHeight"),t=ve("headerFooterTag"),r=Mt(A.useMemo(()=>s=>{e(kt(s,"height"))},[e]),!0,!1),i=ve("context");return n!=null?o.jsx(t,{ref:r,children:o.jsx(n,{...Ee(n,i)})}):null}),Li=A.memo(function(){const n=ve("FooterComponent"),e=Ze("footerHeight"),t=ve("headerFooterTag"),r=Mt(A.useMemo(()=>s=>{e(kt(s,"height"))},[e]),!0,!1),i=ve("context");return n!=null?o.jsx(t,{ref:r,children:o.jsx(n,{...Ee(n,i)})}):null}),Di=({children:n})=>{const e=A.useContext(Jr),t=Ze("itemDimensions"),r=Ze("viewportDimensions"),i=Mt(A.useMemo(()=>s=>{r(s.getBoundingClientRect())},[r]),!0,!1);return A.useEffect(()=>
2{e&&(r({height:e.viewportHeight,width:e.viewportWidth}),t({height:e.itemHeight,width:e.itemWidth}))},[e,r,t]),o.jsx("div",{ref:i,style:zo(!1),children:n})},Pi=({children:n})=>{const e=A.useContext(Jr),t=Ze("windowViewportRect"),r=Ze("itemDimensions"),i=ve("customScrollParent"),s=ve("useWindowScroll"),a=_r(t,i,!1);return A.useEffect(()=>{e&&(r({height:e.itemHeight,width:e.itemWidth}),t({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:e.viewportWidth}))},[e,t,r]),o.jsx("div",{ref:a,style:os(!1,s),children:n})},Fi=A.memo(function({...n}){const e=ve("useWindowScroll"),t=ve("customScrollParent"),r=t||e?Oi:Ai,i=t||e?Pi:Di,s=ve("context");return o.jsx(r,{...n,...Ee(r,s),children:o.jsxs(i,{children:[o.jsx(Bi,{}),o.jsx($i,{}),o.jsx(Li,{})]})})}),{useEmitter:is,useEmitterValue:ve,usePublisher:Ze}=Xr(Mi,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},Fi),Ai=rs({useEmitter:is,useEmitterValue:ve,usePublisher:Ze}),Oi=ss({useEmitter:is,useEmitterValue:ve,usePublisher:Ze});function br(n,e,t){return e!=="normal"&&e?.endsWith("px")!==!0&&t(`${n} was not resolved to pixel value correctly`,e,ze.WARN),e==="normal"?0:parseInt(e??"0",10)}function xt(n){const e=Ge.c(6);let t,r;e[0]!==n?({children:t,...r}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let i;return e[3]!==t||e[4]!==r?(i=o.jsx("a",{target:"_blank",rel:"noopener noreferrer",...r,children:t}),e[3]=t,e[4]=r,e[5]=i):i=e[5],i}const vr=(n,e)=>new Intl.NumberFormat(e,{style:"currency",currency:"EUR",minimumFractionDigits:Number.isInteger(n)?0:2,maximumFractionDigits:2}).format(n),Wi=(n,e)=>{if(n<60)return e(":count min",{count:n});const t=Math.floor(n/60),r=n%60;return r===0?e(":count h",{count:t}):e(":hours h :minutes",{hours:t,minutes:r})};function yr(n){const e=Ge.c(23),{salon:t,onSelect:r}=n,{t:i,locale:s}=ut();let a;e[0]!==t.highlighted_services?(a=t.highlighted_services??[],e[0]=t.highlighted_services,e[1]=a):a=e[1];const u=a;if(u.length===0){if(t.min_service_price==null)return null;let h;e[2]!==s||e[3]!==t.min_service_price||e[4]!==i?(h=i("dès :price",{price:vr(t.min_service_price,s)}),e[2]=s,e[3]=t.min_service_price,e[4]=i,e[5]=h):h=e[5];let x;return e[6]!==h?(x=o.jsx("p",{className:"mt-3 text-[13px] text-muted-foreground",children:h}),e[6]=h,e[7]=x):x=e[7],x}let c;if(e[8]!==s||e[9]!==r||e[10]!==t.booking_url||e[11]!==t.username||e[12]!==u||e[13]!==i){let h;e[15]!==s||e[16]!==r||e[17]!==t.booking_url||e[18]!==t.username||e[19]!==i?(h=(x,v)=>o.jsxs(xt,{href:t.booking_url?`/salon/${t.username}/book?services=${x.id}`:`/salon/${t.username}`,onClick:r,className:`flex items-baseline justify-between gap-3 px-3 py-2.5 transition-colors hover:bg-muted/70 ${v>0?"border-t border-border/40":""}`,children:[o.jsxs("span",{className:"min-w-0",children:[o.jsx("span",{className:"block truncate text-[13px] text-foreground",children:x.name}),o.jsx("span",{className:"block text-[12px] text-muted-foreground",children:Wi(x.duration,i)})]}),o.jsx("span",{className:"shrink-0 text-[13px] font-semibold whitespace-nowrap",children:vr(x.price,s)})]},x.id),e[15]=s,e[16]=r,e[17]=t.booking_url,e[18]=t.username,e[19]=i,e[20]=h):h=e[20],c=u.map(h),e[8]=s,e[9]=r,e[10]=t.booking_url,e[11]=t.username,e[12]=u,e[13]=i,e[14]=c}else c=e[14];let m;return e[21]!==c?(m=o.jsx("div",{className:"mt-3 overflow-hidden rounded-xl bg-muted/40",children:c}),e[21]=c,e[22]=m):m=e[22],m}const as=T.forwardRef((n,e)=>{const t=Ge.c(150),{salon:r,isHighlighted:i,isLast:s,index:a,onHover:u}=n,{t:c}=ut();let m,h,x,v,S,d,C,j,g,p,w,k,I,b,f;if(t[0]!==a||t[1]!==i||t[2]!==s||t[3]!==u||t[4]!==e||t[5]!==r||t[6]!==c){const he=Tr(r.type_names,r.type_name);let ae;t[22]!==a||t[23]!==r.name||t[24]!==r.username?(ae=()=>{Bs({list_name:"directory",item_id:r.username,item_name:r.name,index:a})},t[22]=a,t[23]=r.name,t[24]=r.username,t[25]=ae):ae=t[25],m=ae,b=e,f=`transition-colors duration-fast ease-soft sm:rounded-2xl sm:p-2 @[470px]:flex @[470px]:h-full @[470px]:flex-col ${i?"bg-muted/55 sm:bg-muted/65":"hover:bg-muted/30 sm:hover:bg-muted/45"} ${s?"":"border-b border-border/50 sm:border-b-0"}`,t[26]!==u?(x=()=>u(!0),v=()=>u(!1),t[26]=u,t[27]=x,t[28]=v):(x=t[27],v=t[28]);let pe;t[29]!==m||t[30]!==r?(pe=o.jsx(jr,{salon:r,onSelect:m,aspectClass:"aspect-[16/10]",placeholderClass:"text-5xl"}),t[29]=m,t[30]=r,t[31]=pe):pe=t[31];let Se;t[32]!==r.reviews_count||t[33]!==r.reviews_global_average?(Se=r.reviews_count>0&&r.reviews_global_average&&o.jsxs("div",{className:"pointer-events-none absolute top-2.5 right-2.5 inline-flex items-center gap-1 rounded-full bg-background/95 px-2 py-1 text-[11px] font-semibold text-foreground shadow-[0_4px_14px_-6px_rgba(0,0,0,0.5)] backdrop-blur",children:[o.jsx(Xo,{className:"size-3 fill-amber-500 text-amber-500"}),o.jsx("span",{children:r.reviews_global_average.toFixed(1).replace(".",",")}),o.jsxs("span",{className:"text-muted-foreground",children:["(",r.reviews_count,")"]})]}),t[32]=r.reviews_count,t[33]=r.reviews_global_average,t[34]=Se):Se=t[34];let de;t[35]!==r.has_commercial_location||t[36]!==r.offers_home_service||t[37]!==c?(de=(r.has_commercial_location||r.offers_home_service)&&o.jsxs("div",{className:"pointer-events-none absolute top-2.5 left-2.5 flex flex-wrap items-center gap-1",children:[r.has_commercial_location&&o.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-background/95 px-2 py-1 text-[10px] font-medium text-foreground shadow-[0_4px_14px_-6px_rgba(0,0,0,0.5)] backdrop-blur",children:[o.jsx(En,{className:"size-2.5",strokeWidth:2}),c("En salon")]}),r.offers_home_service&&o.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-background/95 px-2 py-1 text-[10px] font-medium text-foreground shadow-[0_4px_14px_-6px_rgba(0,0,0,0.5)] backdrop-blur",children:[o.jsx(Hn,{className:"size-2.5",strokeWidth:2}),c("à domicile")]})]}),t[35]=r.has_commercial_location,t[36]=r.offers_home_service,t[37]=c,t[38]=de):de=t[38];let ke;t[39]!==pe||t[40]!==Se||t[41]!==de?(ke=o.jsxs("div",{className:"group/photo relative overflow-hidden rounded-2xl border border-border/60 bg-muted/20",children:[pe,Se,de]}),t[39]=pe,t[40]=Se,t[41]=de,t[42]=ke):ke=t[42];const M=`/salon/${r.username}`;let q;t[43]!==r.name?(q=o.jsx("h3",{className:"truncate text-[15px] leading-tight font-semibold text-foreground",title:r.name,children:r.name}),t[43]=r.name,t[44]=q):q=t[44];const V=he.labels.length>0&&o.jsxs("p",{className:"mt-0.5 truncate text-[12px] text-muted-foreground",children:[he.labels.slice(0,2).join(" · "),he.extraCount>0&&` +${he.extraCount}`]});let Y;t[45]!==r.address_line1||t[46]!==r.city||t[47]!==r.postal_code?(Y=(r.address_line1||r.city)&&o.jsxs("p",{className:"mt-1 inline-flex items-center gap-1 text-[12px] text-muted-foreground",children:[o.jsx(nt,{className:"size-3 shrink-0",strokeWidth:1.75}),o.jsxs("span",{className:"truncate",children:[r.city,r.postal_code&&` (${r.postal_code})`]})]}),t[45]=r.address_line1,t[46]=r.city,t[47]=r.postal_code,t[48]=Y):Y=t[48];let ne;t[49]!==q||t[50]!==V||t[51]!==Y?(ne=o.jsx("div",{className:"flex items-start justify-between gap-2",children:o.jsxs("div",{className:"min-w-0 flex-1",children:[q,V,Y]})}),t[49]=q,t[50]=V,t[51]=Y,t[52]=ne):ne=t[52];let X;
2t[53]!==m||t[54]!==r.name||t[55]!==M||t[56]!==ne?(X=o.jsx(xt,{href:M,onClick:m,className:"mt-3 block transition-opacity active:opacity-70","aria-label":r.name,children:ne}),t[53]=m,t[54]=r.name,t[55]=M,t[56]=ne,t[57]=X):X=t[57],t[58]!==ke||t[59]!==X?(S=o.jsx("div",{className:"block sm:hidden",children:o.jsxs("div",{className:"group/card px-3 pt-3 pb-2",children:[ke,X]})}),t[58]=ke,t[59]=X,t[60]=S):S=t[60],t[61]!==m||t[62]!==r?(d=o.jsx("div",{className:"px-3 sm:hidden",children:o.jsx(yr,{salon:r,onSelect:m})}),t[61]=m,t[62]=r,t[63]=d):d=t[63];const se=`/salon/${r.username}`;let ge;t[64]!==c?(ge=c("Plus d'informations"),t[64]=c,t[65]=ge):ge=t[65];let ce;t[66]!==m||t[67]!==se||t[68]!==ge?(ce=o.jsx(xt,{href:se,onClick:m,className:"text-[12px] font-medium text-muted-foreground underline-offset-4 transition-colors hover:text-foreground hover:underline",children:ge}),t[66]=m,t[67]=se,t[68]=ge,t[69]=ce):ce=t[69];let Re;t[70]!==m||t[71]!==r.is_claimed||t[72]!==r.name||t[73]!==r.username||t[74]!==c?(Re=r.is_claimed!==!1&&o.jsxs(xt,{href:`/salon/${r.username}`,onClick:m,className:"inline-flex h-9 min-w-[100px] shrink-0 items-center justify-center gap-1.5 rounded-xl bg-foreground px-4 text-[12px] font-semibold text-background shadow-sm transition-all duration-200 hover:opacity-90 active:scale-95","aria-label":c("Réserver chez :name",{name:r.name}),children:[c("Réserver"),o.jsx(on,{className:"size-3.5"})]}),t[70]=m,t[71]=r.is_claimed,t[72]=r.name,t[73]=r.username,t[74]=c,t[75]=Re):Re=t[75],t[76]!==ce||t[77]!==Re?(C=o.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 pt-3 pb-3 sm:hidden",children:[ce,Re]}),t[76]=ce,t[77]=Re,t[78]=C):C=t[78],k="hidden gap-4 sm:flex @[470px]:min-h-0 @[470px]:flex-1 @[470px]:flex-col @[470px]:gap-0",t[79]!==m||t[80]!==r?(I=o.jsx("div",{className:"group/photo relative w-[32%] max-w-[224px] min-w-[128px] shrink-0 self-start overflow-hidden rounded-xl bg-muted/20 @[470px]:w-full @[470px]:max-w-none @[470px]:self-stretch",children:o.jsx(jr,{salon:r,onSelect:m,aspectClass:"aspect-[4/3] @[470px]:aspect-video",placeholderClass:"text-3xl",withArrows:!0})}),t[79]=m,t[80]=r,t[81]=I):I=t[81],g="flex min-w-0 flex-1 flex-col @[470px]:mt-3";const me=`/salon/${r.username}`;let Me;t[82]!==m||t[83]!==r.name||t[84]!==me?(Me=o.jsx(xt,{href:me,onClick:m,className:"truncate text-[15px] leading-snug font-semibold text-foreground transition-colors duration-fast ease-soft hover:text-foreground/70",title:r.name,children:r.name}),t[82]=m,t[83]=r.name,t[84]=me,t[85]=Me):Me=t[85];let Ce;t[86]!==r.reviews_count||t[87]!==r.reviews_global_average?(Ce=r.reviews_count>0&&r.reviews_global_average?o.jsxs("span",{className:"inline-flex shrink-0 items-baseline gap-1 text-[13px]",children:[o.jsx(Xo,{className:"size-3.5 translate-y-0.5 fill-amber-500 text-amber-500"}),o.jsx("span",{className:"font-medium",children:r.reviews_global_average.toFixed(1).replace(".",",")})]}):null,t[86]=r.reviews_count,t[87]=r.reviews_global_average,t[88]=Ce):Ce=t[88],t[89]!==Me||t[90]!==Ce?(p=o.jsxs("div",{className:"flex min-w-0 items-baseline justify-between gap-2",children:[Me,Ce]}),t[89]=Me,t[90]=Ce,t[91]=p):p=t[91];const _e=r.city?`${r.city}${r.postal_code?` (${r.postal_code})`:""}`:null;let Ne;t[92]!==r.reviews_count||t[93]!==c?(Ne=r.reviews_count>0?`${r.reviews_count} ${c("avis")}`:null,t[92]=r.reviews_count,t[93]=c,t[94]=Ne):Ne=t[94];let $e;t[95]!==_e||t[96]!==Ne?($e=[_e,Ne].filter(Boolean),t[95]=_e,t[96]=Ne,t[97]=$e):$e=t[97];const Fe=$e.join(" ⢠");t[98]!==Fe?(w=o.jsx("p",{className:"mt-0.5 truncate text-[13px] text-muted-foreground",children:Fe}),t[98]=Fe,t[99]=w):w=t[99],j="mt-0.5 truncate text-[13px] text-muted-foreground",h=he.labels.length>0?he.labels.join(", "):null,t[0]=a,t[1]=i,t[2]=s,t[3]=u,t[4]=e,t[5]=r,t[6]=c,t[7]=m,t[8]=h,t[9]=x,t[10]=v,t[11]=S,t[12]=d,t[13]=C,t[14]=j,t[15]=g,t[16]=p,t[17]=w,t[18]=k,t[19]=I,t[20]=b,t[21]=f}else m=t[7],h=t[8],x=t[9],v=t[10],S=t[11],d=t[12],C=t[13],j=t[14],g=t[15],p=t[16],w=t[17],k=t[18],I=t[19],b=t[20],f=t[21];let y;t[100]!==r.has_commercial_location||t[101]!==c?(y=r.has_commercial_location?c("En salon"):null,t[100]=r.has_commercial_location,t[101]=c,t[102]=y):y=t[102];let z;t[103]!==r.offers_home_service||t[104]!==c?(z=r.offers_home_service?c("à domicile"):null,t[103]=r.offers_home_service,t[104]=c,t[105]=z):z=t[105];let B;
2t[106]!==h||t[107]!==y||t[108]!==z?(B=[h,y,z].filter(Boolean),t[106]=h,t[107]=y,t[108]=z,t[109]=B):B=t[109];const $=B.join(" ⢠");let _;t[110]!==$||t[111]!==j?(_=o.jsx("p",{className:j,children:$}),t[110]=$,t[111]=j,t[112]=_):_=t[112];let D;t[113]!==m||t[114]!==r?(D=o.jsx(yr,{salon:r,onSelect:m}),t[113]=m,t[114]=r,t[115]=D):D=t[115];const L=`/salon/${r.username}`;let W;t[116]!==c?(W=c("Plus d'informations"),t[116]=c,t[117]=W):W=t[117];let F;t[118]!==m||t[119]!==L||t[120]!==W?(F=o.jsx(xt,{href:L,onClick:m,className:"text-xs text-muted-foreground underline underline-offset-4 transition-colors duration-fast ease-soft hover:text-foreground",children:W}),t[118]=m,t[119]=L,t[120]=W,t[121]=F):F=t[121];let U;t[122]!==m||t[123]!==r.is_claimed||t[124]!==r.username||t[125]!==c?(U=r.is_claimed!==!1&&o.jsxs(xt,{href:`/salon/${r.username}`,onClick:m,className:"inline-flex shrink-0 items-center justify-center gap-1.5 rounded-lg bg-foreground px-4 py-2 text-xs font-medium text-background transition-all duration-base ease-soft hover:opacity-90",children:[c("Réserver"),o.jsx(on,{className:"size-3"})]}),t[122]=m,t[123]=r.is_claimed,t[124]=r.username,t[125]=c,t[126]=U):U=t[126];let J;t[127]!==F||t[128]!==U?(J=o.jsxs("div",{className:"mt-auto flex flex-row items-center justify-between pt-3",children:[F,U]}),t[127]=F,t[128]=U,t[129]=J):J=t[129];let xe;t[130]!==_||t[131]!==D||t[132]!==J||t[133]!==g||t[134]!==p||t[135]!==w?(xe=o.jsxs("div",{className:g,children:[p,w,_,D,J]}),t[130]=_,t[131]=D,t[132]=J,t[133]=g,t[134]=p,t[135]=w,t[136]=xe):xe=t[136];let re;t[137]!==xe||t[138]!==k||t[139]!==I?(re=o.jsxs("div",{className:k,children:[I,xe]}),t[137]=xe,t[138]=k,t[139]=I,t[140]=re):re=t[140];let ie;return t[141]!==x||t[142]!==v||t[143]!==S||t[144]!==d||t[145]!==C||t[146]!==re||t[147]!==b||t[148]!==f?(ie=o.jsxs("div",{ref:b,className:f,onMouseEnter:x,onMouseLeave:v,children:[S,d,C,re]}),t[141]=x,t[142]=v,t[143]=S,t[144]=d,t[145]=C,t[146]=re,t[147]=b,t[148]=f,t[149]=ie):ie=t[149],ie});as.displayName="SalonCard";function jr(n){const e=Ge.c(46),{salon:t,onSelect:r,aspectClass:i,placeholderClass:s,withArrows:a}=n,u=a===void 0?!1:a,{t:c}=ut();let m;e[0]!==t.gallery_photos?(m=t.gallery_photos??[],e[0]=t.gallery_photos,e[1]=m):m=e[1];let h;e[2]!==m?(h=m.filter(Boolean),e[2]=m,e[3]=h):h=e[3];const x=h,v=t.cover_photo??t.logo_path??null;let S;e[4]!==v||e[5]!==x?(S=x.length>0?x:v?[v]:[],e[4]=v,e[5]=x,e[6]=S):S=e[6];const d=S,C=T.useRef(null),[j,g]=T.useState(0);let p,w;e[7]!==d.length?(p=()=>{const _=C.current;if(!_||d.length<=1)return;const D=()=>{const L=Math.round(_.scrollLeft/Math.max(1,_.clientWidth));g(Math.min(d.length-1,Math.max(0,L)))};return _.addEventListener("scroll",D,{passive:!0}),()=>_.removeEventListener("scroll",D)},w=[d.length],e[7]=d.length,e[8]=p,e[9]=w):(p=e[8],w=e[9]),T.useEffect(p,w);let k;e[10]!==d.length?(k=_=>{const D=C.current;if(!D)return;const L=Math.min(d.length-1,Math.max(0,_));D.scrollTo({left:L*D.clientWidth,behavior:"smooth"}),g(L)},e[10]=d.length,e[11]=k):k=e[11];const I=k;if(d.length===0){const _=`/salon/${t.username}`,D=`block w-full ${i}`,L=t.name,W=`font-serif text-muted-foreground/40 ${s}`;let F;e[12]!==t.name?(F=t.name.charAt(0),e[12]=t.name,e[13]=F):F=e[13];let U;e[14]!==W||e[15]!==F?(U=o.jsx("div",{className:"flex h-full w-full items-center justify-center bg-[linear-gradient(145deg,rgba(255,255,255,0.06),rgba(255,255,255,0.02))]",children:o.jsx("span",{className:W,children:F})}),e[14]=W,e[15]=F,e[16]=U):U=e[16];let J;return e[17]!==r||e[18]!==t.name||e[19]!==U||e[20]!==_||e[21]!==D?(J=o.jsx(xt,{href:_,onClick:r,className:D,"aria-label":L,children:U}),e[17]=r,e[18]=t.name,e[19]=U,e[20]=_,e[21]=D,e[22]=J):J=e[22],J}const b=`w-full snap-x snap-mandatory overflow-x-auto ${i} [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden`;let f;if(e[23]!==r||e[24]!==t.name||e[25]!==t.username||e[26]!==d){let _;e[28]!==r||e[29]!==t.name||e[30]!==t.username?(_=(D,L)=>o.jsx(xt,{href:`/salon/${t.username}`,onClick:r,className:"shrink-0 snap-start",style:{width:"100%"},"aria-label":t.name,children:o.jsx("img",{src:D,alt:t.name,className:"h-full w-full object-cover",loading:"lazy",draggable:!1})},`${D}-${L}`),e[28]=r,e[29]=t.name,e[30]=t.username,e[31]=_):_=e[31],f=d.map(_),e[23]=r,e[24]=t.name,e[25]=t.username,e[26]=d,e[27]=f}else f=e[27];let y;e[32]!==f?(y=o.jsx("div",{className:"flex h-full",children:f}),e[32]=f,e[33]=y):y=e[33];let z;e[34]!==y||e[35]!==b?(z=o.jsx("div",{ref:C,"data-no-swipe-toggle":!0,className:b,children:y}),e[34]=y,e[35]=b,e[36]=z):z=e[36];let B;e[37]!==j||e[38]!==I||e[39]!==d||e[40]!==c||e[41]!==u?(B=d.length>1&&o.jsxs(o.Fragment,{children:[u&&o.jsxs(o.Fragment,{children:[o.jsx(wr,{side:"left",label:c("Photo précédente"),disabled:j===0,onClick:()=>I(j-1)}),o.jsx(wr,{side:"right",label:c("Photo suivante"),disabled:j===d.length-1,onClick:()=>I(j+1)})]}),o.jsx("div",{className:"pointer-events-none absolute bottom-2.5 left-1/2 flex -translate-x-1/2 items-center gap-1",children:d.map((_,D)=>o.jsx("span",{className:`size-1.5 rounded-full transition-all duration-200 ${D===j?"w-3 bg-white":"bg-white/55"}`},D))})]}),e[37]=j,e[38]=I,e[39]=d,e[40]=c,e[41]=u,e[42]=B):B=e[42];let $;return e[43]!==z||e[44]!==B?($=o.jsxs(o.Fragment,{children:[z,B]}),e[43]=z,e[44]=B,e[45]=$):$=e[45],$}function wr(n){const e=Ge.c(8),{side:t,label:r,disabled:i,onClick:s}=n,a=t==="left"?Js:Ln,u=`absolute top-1/2 z-10 inline-flex size-7 -translate-y-1/2 items-center justify-center rounded-full bg-background/90 text-foreground opacity-0 shadow-[0_4px_14px_-6px_rgba(0,0,0,0.6)] backdrop-blur transition-opacity duration-200 group-hover/photo:opacity-100 hover:bg-background focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none disabled:pointer-events-none disabled:opacity-0 ${t==="left"?"left-2":"right-2"}`;let c;e[0]!==a?(c=o.jsx(a,{className:"size-4",strokeWidth:2}),e[0]=a,e[1]=c):c=e[1];let m;return e[2]!==i||e[3]!==r||e[4]!==s||e[5]!==u||e[6]!==c?(m=o.jsx("button",{type:"button",onClick:s,disabled:i,"aria-label":r,className:u,children:c}),e[2]=i,e[3]=r,e[4]=s,e[5]=u,e[6]=c,e[7]=m):m=e[7],m}function Vi(){const n=Ge.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx("div",{className:"animate-pulse",children:[0,1,2,3,4].map(qi)}),n[0]=e):e=n[0],e}function qi(n){return o.jsxs("div",{className:"border-b border-border/50 px-3 pt-3 pb-3 sm:px-8 sm:py-6",children:[o.jsxs("div",{className:"sm:hidden",children:[o.jsx("div",{className:"aspect-[16/10] w-full rounded-2xl bg-muted/40"}),o.jsxs("div",{className:"mt-3 space-y-2",children:[o.jsx("div",{className:"h-4 w-2/3 rounded bg-muted/40"}),o.jsx("div",{className:"h-3 w-1/3 rounded bg-muted/30"}
2),o.jsx("div",{className:"h-3 w-1/2 rounded bg-muted/30"})]})]}),o.jsxs("div",{className:"hidden gap-5 sm:flex",children:[o.jsx("div",{className:"size-36 w-48 shrink-0 rounded-xl bg-muted/40"}),o.jsxs("div",{className:"flex-1 space-y-2.5",children:[o.jsx("div",{className:"h-5 w-1/3 rounded bg-muted/40"}),o.jsx("div",{className:"h-3 w-1/4 rounded bg-muted/30"}),o.jsx("div",{className:"h-3 w-1/2 rounded bg-muted/30"}),o.jsx("div",{className:"h-3 w-2/3 rounded bg-muted/25"})]})]})]},n)}function Ui(n){const e=Ge.c(42),{visibleEstablishments:t,establishments:r,searchPending:i,mapAreaActive:s,hoveredSlug:a,setHoveredSlug:u,cardRefs:c,hasActiveFilters:m,clearFilters:h,scrollParent:x}=n,v=x===void 0?null:x,{t:S}=ut();if(i&&t.length===0){let p;return e[0]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(Vi,{}),e[0]=p):p=e[0],p}if(t.length===0){let p;e[1]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx("div",{className:"mx-auto flex size-14 items-center justify-center rounded-full bg-muted/30",children:o.jsx(nn,{className:"size-6 text-muted-foreground/50",strokeWidth:1.5})}),e[1]=p):p=e[1];let w;e[2]!==r||e[3]!==s||e[4]!==S?(w=s&&r.length>0?S("Aucun salon visible dans cette zone"):S("Aucun salon trouvé"),e[2]=r,e[3]=s,e[4]=S,e[5]=w):w=e[5];let k;e[6]!==w?(k=o.jsx("p",{className:"mt-4 text-sm font-medium text-foreground",children:w}),e[6]=w,e[7]=k):k=e[7];let I;e[8]!==r||e[9]!==s||e[10]!==S?(I=s&&r.length>0?S("Dézoomez ou déplacez la carte pour voir plus de résultats."):S("Essayez d'élargir votre zone ou de retirer un filtre."),e[8]=r,e[9]=s,e[10]=S,e[11]=I):I=e[11];let b;e[12]!==I?(b=o.jsx("p",{className:"mx-auto mt-1.5 max-w-xs text-xs text-muted-foreground",children:I}),e[12]=I,e[13]=b):b=e[13];let f;e[14]!==h||e[15]!==m||e[16]!==S?(f=m&&o.jsx("button",{type:"button",onClick:h,className:"mt-4 text-xs font-medium text-foreground underline underline-offset-4",children:S("Effacer les filtres")}),e[14]=h,e[15]=m,e[16]=S,e[17]=f):f=e[17];let y;return e[18]!==k||e[19]!==b||e[20]!==f?(y=o.jsxs("div",{className:"animate-in px-5 py-16 text-center duration-300 fade-in sm:px-8",children:[p,k,b,f]}),e[18]=k,e[19]=b,e[20]=f,e[21]=y):y=e[21],y}let d;e[22]!==c.current||e[23]!==a||e[24]!==u||e[25]!==t.length?(d=(p,w)=>o.jsx(as,{salon:p,index:w,isHighlighted:a===p.slug,onHover:k=>u(k?p.slug:null),isLast:w===t.length-1,ref:k=>{k?c.current.set(p.slug,k):c.current.delete(p.slug)}}),e[22]=c.current,e[23]=a,e[24]=u,e[25]=t.length,e[26]=d):d=e[26];const C=d;if(t.length>200){let p;e[27]!==v?(p=v?{customScrollParent:v}:{useWindowScroll:!0},e[27]=v,e[28]=p):p=e[28];let w;e[29]!==C?(w=(I,b)=>C(b,I),e[29]=C,e[30]=w):w=e[30];let k;return e[31]!==p||e[32]!==w||e[33]!==t?(k=o.jsx(Ti,{...p,data:t,computeItemKey:Gi,itemContent:w}),e[31]=p,e[32]=w,e[33]=t,e[34]=k):k=e[34],k}let j;if(e[35]!==C||e[36]!==t){let p;e[38]!==C?(p=(w,k)=>o.jsx("div",{className:"animate-in duration-300 fill-mode-both fade-in slide-in-from-bottom-1 motion-reduce:animate-none @[470px]:h-full",style:{animationDelay:`${Math.min(k,14)*28}ms`},children:C(w,k)},w.slug),e[38]=C,e[39]=p):p=e[39],j=t.map(p),e[35]=C,e[36]=t,e[37]=j}else j=e[37];let g;return e[40]!==j?(g=o.jsx("div",{className:"lg:space-y-1 lg:pt-2 @[470px]:grid @[470px]:grid-cols-2 @[470px]:space-y-0 @[470px]:gap-x-5 @[470px]:gap-y-7 @[470px]:px-2",children:j}),e[40]=j,e[41]=g):g=e[41],g}function Gi(n,e){return e.slug}function Ki(n){const e=Ge.c(52),{seoContent:t,crossLinks:r,areaLinks:i}=n;let s;e[0]!==i?(s=i===void 0?[]:i,e[0]=i,e[1]=s):s=e[1];const a=s,{t:u}=ut(),[c,m]=T.useState(!1);let h,x,v,S,d,C,j,g,p,w,k;if(e[2]!==a||e[3]!==r||e[4]!==t.heading||e[5]!==t.paragraphs||e[6]!==c||e[7]!==u){k=r.filter(ea),h=r.filter(Ji),w="border-t border-border/40 px-5 py-8 sm:px-8",e[19]!==t.heading?(x=o.jsx("h2",{className:"font-serif text-lg font-normal tracking-tight md:text-xl",children:t.heading}),e[19]=t.heading,e[20]=x):x=e[20],e[21]!==t.paragraphs[0]||e[22]!==t.paragraphs.length||e[23]!==c?(v=t.paragraphs.length>0&&o.jsx("p",{className:`mt-3 text-sm leading-relaxed text-muted-foreground ${c?"":"line-clamp-3"}`,children:t.paragraphs[0]}),e[21]=t.paragraphs[0],e[22]=t.paragraphs.length,e[23]=c,e[24]=v):v=e[24],S="overflow-hidden transition-[max-height] duration-500 ease-in-out";const y=c?"2000px":"0px";e[25]!==y?(d={maxHeight:y},e[25]=y,e[26]=d):d=e[26],e[27]!==t.paragraphs?(C=t.paragraphs.slice(1).map(Zi),e[27]=t.paragraphs,e[28]=C):C=e[28],e[29]!==a||e[30]!==u?(j=a.length>0&&o.jsxs("div",{className:"mt-8",children:[o.jsx("h3",{className:"text-xs font-semibold tracking-wider text-muted-foreground
2/60 uppercase",children:u("Explorer par quartier")}),o.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:a.map(Xi)})]}),e[29]=a,e[30]=u,e[31]=j):j=e[31],g=k.length>0&&o.jsxs("div",{className:"mt-8",children:[o.jsx("h3",{className:"text-xs font-semibold tracking-wider text-muted-foreground/60 uppercase",children:u("Explorer par type")}),o.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:k.map(Yi)})]}),p=h.length>0&&o.jsxs("div",{className:"mt-6",children:[o.jsx("h3",{className:"text-xs font-semibold tracking-wider text-muted-foreground/60 uppercase",children:u("Explorer par ville")}),o.jsx("div",{className:"mt-3 columns-2 gap-x-8 sm:columns-3",children:h.map(Qi)})]}),e[2]=a,e[3]=r,e[4]=t.heading,e[5]=t.paragraphs,e[6]=c,e[7]=u,e[8]=h,e[9]=x,e[10]=v,e[11]=S,e[12]=d,e[13]=C,e[14]=j,e[15]=g,e[16]=p,e[17]=w,e[18]=k}else h=e[8],x=e[9],v=e[10],S=e[11],d=e[12],C=e[13],j=e[14],g=e[15],p=e[16],w=e[17],k=e[18];let I;e[32]!==S||e[33]!==d||e[34]!==C||e[35]!==j||e[36]!==g||e[37]!==p?(I=o.jsxs("div",{className:S,style:d,children:[C,j,g,p]}),e[32]=S,e[33]=d,e[34]=C,e[35]=j,e[36]=g,e[37]=p,e[38]=I):I=e[38];let b;e[39]!==a.length||e[40]!==h||e[41]!==t.paragraphs.length||e[42]!==c||e[43]!==u||e[44]!==k?(b=(t.paragraphs.length>1||k.length>0||h.length>0||a.length>0)&&o.jsx("button",{type:"button",onClick:()=>m(!c),className:"mt-3 text-xs font-medium text-muted-foreground underline underline-offset-4 transition-colors duration-300 hover:text-foreground",children:u(c?"Afficher moins":"Afficher tout")}),e[39]=a.length,e[40]=h,e[41]=t.paragraphs.length,e[42]=c,e[43]=u,e[44]=k,e[45]=b):b=e[45];let f;return e[46]!==x||e[47]!==v||e[48]!==I||e[49]!==b||e[50]!==w?(f=o.jsxs("div",{className:w,children:[x,v,I,b]}),e[46]=x,e[47]=v,e[48]=I,e[49]=b,e[50]=w,e[51]=f):f=e[51],f}function Qi(n){return o.jsx(at,{href:n.href,className:"mb-1.5 block truncate text-sm text-muted-foreground transition-colors duration-300 hover:text-foreground",children:n.label},n.href)}function Yi(n){return o.jsxs(at,{href:n.href,className:"inline-flex items-center gap-1 rounded-full border border-border/60 px-3 py-1.5 text-xs font-medium text-muted-foreground transition-all duration-300 hover:-translate-y-0.5 hover:border-foreground
2/20 hover:text-foreground",children:[n.label,o.jsx(Ln,{className:"size-3"})]},n.href)}function Xi(n){return o.jsxs(at,{href:n.href,className:"inline-flex items-center gap-1.5 rounded-full border border-border/60 px-3 py-1.5 text-xs font-medium text-muted-foreground transition-all duration-300 hover:-translate-y-0.5 hover:border-foreground/20 hover:text-foreground",children:[n.label,o.jsx("span",{className:"text-muted-foreground/60",children:n.count})]},n.href)}function Zi(n,e){return o.jsx("p",{className:"mt-3 text-sm leading-relaxed text-muted-foreground",children:n},e)}function Ji(n){return n.group==="cities"}function ea(n){return n.group==="types"}const ta=T.lazy(()=>Cr(()=>import("./directory-map-DYIw8jRZ.js"),__vite__mapDeps([0,1,2,3,4,5,6])).then(n=>({default:n.DirectoryMap}))),na=n=>n.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,""),kr=n=>n.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim(),go=["salon","domicile"],Sr=(n,e="")=>{const t=n?.length?n:e?[e]:[];return go.filter(r=>t.includes(r))};function Xa({establishments:n,mapPins:e,pagination:t,types:r,cities:i,filters:s,sortOptions:a,availabilityHorizonDays:u,aggregations:c,totalCount:m,seoContent:h,crossLinks:x,areaLinks:v,canRegister:S=!0}){const{t:d}=ut(),C=Ls(),{auth:j,name:g}=C.props,[p,w]=T.useState(s.q),[k,I]=T.useState(s.ville),[b,f]=T.useState(s.types?.length?s.types:s.type?[s.type]:[]),[y,z]=T.useState(()=>Sr(s.modes,s.mode)),[B,$]=T.useState(!1),[_,D]=T.useState(()=>typeof window>"u"?!0:window.matchMedia("(min-width: 1024px)").matches),L=T.useRef(void 0),[W,F]=T.useState(!1),U=T.useRef(null),J=T.useRef(null),xe=T.useRef(null),[re,ie]=T.useState(!1),[he,ae]=T.useState(!1),pe=T.useRef(null),Se=T.useRef(null),[de,ke]=T.useState([]),[M,q]=T.useState(!1),V=T.useRef(null),Y=T.useRef(void 0),ne=T.useRef(null),X=T.useRef(null),[se,ge]=T.useState(0),[ce,Re]=T.useState(!1),me=T.useCallback((l=8)=>{if(typeof navigator<"u"&&typeof navigator.vibrate=="function")try{navigator.vibrate(l)}catch{}},[]),[Me,Ce]=T.useState(!1),[_e,Ne]=T.useState(!1),$e=T.useRef(null),Fe=T.useRef(null),[Be,Ke]=T.useState([]),[Qe,mt]=T.useState(!1),[Yt,Tt]=T.useState(null),vt=T.useRef(void 0),It=T.useRef(0),{continueToProSpace:cs,proDialogOpen:us,requestProSpaceAccess:_o,setProDialogOpen:ds,setSkipProDialogPrompt:ms,skipProDialogPrompt:fs}=As(),Wn=i.slice(0,8),xn=W||_e||B,[Eo,Xt]=T.useState(null),[ps,bn]=T.useState(null),Ho=T.useRef(new Map),[Ae,vn]=T.useState("list"),[yn,Vn]=T.useState(null),[qn,Mo]=T.useState(null),hs=_||Ae==="map",$o=T.useRef(_);$o.current=_;const Zt=T.useRef(!1),[gs,Bt]=T.useState(!1),xs=T.useRef(null),Bo=T.useRef(null),Lo=T.useRef(null),[Ye,Un]=T.useState(n),[Gn,jn]=T.useState(!1),[Lt,Kn]=T.useState(!1),Je=T.useRef(void 0),wn=T.useRef(null),yt=T.useRef(null),Jt=T.useRef(!1),ft=T.useMemo(()=>Sr(s.modes,s.mode),[s]),en=T.useMemo(()=>`${s.type}|${(s.types??[]).join(",")}|${s.ville}|${s.q}|${ft.join(",")}`,[s.type,s.types,s.ville,s.q,ft]),Do=T.useRef(en),kn=T.useCallback(()=>{It.current+=1,wn.current?.abort()},[]),[bs,Sn]=T.useState(!1),[vs,ys]=T.useState(null),Qn=T.useCallback((l=null)=>{ys(l),Sn(!0)},[]),[pt,Po]=T.useState(null),Fo=T.useMemo(()=>Lt?Ye:e,[Lt,Ye,e]),js=T.useCallback(l=>{const N=new URL(window.location.href);l==="recommended"?N.searchParams.delete("sort"):N.searchParams.set("sort",l);const E=N.pathname.replace(/\/page-\d+\/?$/,"");qt.visit(`${E}${N.search}`,{preserveScroll:!0,preserveState:!1})},[]),Ao=T.useMemo(()=>{const l=kr(k);return l.length<2?[]:i.filter(N=>kr(N).includes(l)).slice(0,6).map(N=>({name:N,region:"",country:"Belgique",lat:void 0,lng:void 0}))},[i,k]),jt=T.useMemo(()=>Be.length>0?Be:Ao,[Be,Ao]);T.useEffect(()=>{Un(n),Kn(!1),jn(!1),bn(null),Vn(null),Mo(null),yt.current=null,Zt.current=!1,Jt.current=!1,Bt(!1),kn(),Je.current&&clearTimeout(Je.current)},[n,kn]),T.useEffect(()=>{Ds({list_name:"directory",items_count:n.length,filters:{type:s.type??"",types:s.types??[],city:s.ville??"",query:s.q??""}})},[n,s.type,s.types,s.ville,s.q]);const Cn=T.useCallback(()=>{const l=new URLSearchParams;return s.q&&l.set("q",s.q),(s.types?.length??0)>1?l.set("types",s.types.join(",")):s.type?l.set("type",s.type):(s.types?.length??0)===1&&l.set("type",s.types[0]),s.ville&&l.set("ville",s.ville),ft.length===1?l.set("mode",ft[0]):ft.length>1&&l.set("modes",ft.join(",")),s.quartier&&l.set("quartier",s.quartier),s.amenities?.length&&l.set("amenities",s.amenities.join(",")),s.rating!==null&&l.set("rating",String(s.rating)),s.date!==null&&(l.set("date",s.date),s.slot!==null&&l.set("slot",s.slot)),l},[s.q,s.type,s.types,s.ville,s.quartier,s.amenities,s.rating,s.date,s.slot,ft]),ws=T.useCallback(async l=>{Jt.current=!0;const N=Cn();N.set("lat",l.latitude.toString()),N.set("lng",l.longitude.toString());const E=await fetch(`/api/directory/nearest?${N.toString()}`);if(!E.ok)return null;const be=(await E.json()).establishments?.[0];if(!be)return null;const et=be.latitude??be.home_service_lat,Oe=be.longitude??be.home_service_lng;return et==null||Oe==null?null:[Number(et),Number(Oe)]},[Cn]),zt=T.useCallback(async l=>{wn.current?.abort();const N=new AbortController;wn.current=N,jn(!0);try{const E=Cn();E.set("north",l.north.toString()),E.set("south",l.south.toString()),E.set("east",l.east.toString()),E.set("west",l.west.toString());const Z=await fetch(`/api/directory/establishments?${E.toString()}`,{signal:N.signal});if(!Z.ok)throw new Error(`Directory bounds request failed with status ${Z.status}`);const be=await Z.json();if(N.signal.aborted)return;Un(be.establishments??[]),Kn(!0)}catch{}finally{N.signal.aborted||jn(!1)}},[Cn]),ks=T.useCallback(l=>{const N=l;if(Po(N),!Zt.current){Zt.current=!0,yt.current=N;return}const E=yt.current;if(E&&Math.abs(E.north-N.north)<.002&&Math.abs(E.south-N.south)<.002&&Math.abs(E.east-N.east)<.002&&Math.abs(E.west-N.west)<.002){Jt.current=!1;return}if(Jt.current){Jt.current=!1,Bt(!1),yt.current=N,zt(N);return}if(!$o.current){Bt(!0);return}Je.current&&clearTimeout(Je.current),Je.current=setTimeout(()=>{yt.current=N,zt(N)},400)},[zt]),Ss=T.useCallback(()=>{Bt(!1),pt&&(yt.current=pt,zt(pt))},[pt,zt]);T.useEffect(()=>{Do.current!==en&&(Do.current=en,!(!pt||!Lt)&&(Je.current&&clearTimeout(Je.current),yt.current=pt,zt(pt)))}
2,[en,pt,Lt,zt]);const Yn=T.useRef(null),Nn=T.useRef(null);T.useEffect(()=>{Cr(async()=>{const{loadMapKit:l}=await import("./mapkit-loader-Bj5-mtA5.js");return{loadMapKit:l}},__vite__mapDeps([3,1,2,4])).then(({loadMapKit:l})=>l()).then(l=>{const N=sl();Yn.current=new l.Search({language:N,getsUserLocation:!1});const E=new l.Geocoder({language:N});Nn.current=E;const Z=s.ville.trim();Z&&!Yt&&E.lookup(Z,(be,et)=>{if(be||!et?.results?.length)return;const Oe=et.results[0];Tt([Oe.coordinate.latitude,Oe.coordinate.longitude])},{limitToCountries:"BE,FR"})}).catch(l=>{console.warn("MapKit directory search unavailable:",l),Yn.current=null,Nn.current=null})},[]);const Xn=T.useCallback(async l=>{const N=++It.current,E=()=>It.current!==N;if(l.length<2){Ke([]);return}const Z=Yn.current,be=Nn.current;if(!Z||!be){Ke([]);return}mt(!0),Z.autocomplete(l,(et,Oe)=>{if(E())return;if(et||!Oe?.results?.length){Ke([]),mt(!1);return}const zn=Oe.results.slice(0,6).map(gt=>new Promise(wt=>{const tt=gt.displayLines?.join(", ")??"";if(!tt){wt(null);return}be.lookup(tt,(Rt,We)=>{if(Rt||!We?.results?.length){wt({name:gt.displayLines?.[0]??"",region:gt.displayLines?.[1]??"",country:"Belgique"});return}const Vt=We.results[0];wt({name:Vt.locality??gt.displayLines?.[0]??"",region:Vt.administrativeAreaCode??Vt.administrativeArea??"",country:Vt.country??"Belgique",lat:Vt.coordinate.latitude,lng:Vt.coordinate.longitude})},{limitToCountries:"BE,FR"})}));Promise.all(zn).then(gt=>{if(E())return;const wt=gt.filter(tt=>tt!==null);Ke(wt),mt(!1)})},{limitToCountries:"BE,FR"})},[]),De=T.useCallback(l=>{const N=(l.q??p).trim(),E=l.types??b,Z=(l.ville??k).trim(),be=l.ville===void 0||l.ville.trim()===k.trim(),et=l.quartier!==void 0?l.quartier:be?s.quartier??"":"",Oe=l.modes??y,to=l.amenities??s.amenities??[],zn=l.rating!==void 0?l.rating:s.rating??null,gt=l.date!==void 0?l.date:s.date??null,wt=l.slot!==void 0?l.slot:s.slot??null;let tt="/salons";const Rt=Z?na(Z):null;E.length===1&&Rt?tt=`/salons/${E[0]}/${Rt}`:E.length===1?tt=`/salons/${E[0]}`:Rt&&(tt=`/salons/all/${Rt}`),et&&Rt&&(tt=`${tt}/${et}`);const We={};N&&(We.q=N),Oe.length===1?We.mode=Oe[0]:Oe.length>1&&(We.modes=Oe.join(",")),E.length>1&&(We.types=E.join(",")),to.length>0&&(We.amenities=to.join(",")),zn!==null&&(We.rating=String(zn)),gt!==null&&(We.date=gt,wt!==null&&(We.slot=wt)),s.sort&&s.sort!=="recommended"&&(We.sort=s.sort),qt.get(tt,We,{preserveState:!0,preserveScroll:!0})},[p,b,k,y,s.rating,s.sort,s.date,s.slot,s.quartier,s.amenities]),Dt=l=>{w(l),L.current&&clearTimeout(L.current),L.current=setTimeout(()=>{const N=l.trim();N&&Fs({search_term:N,results_count:Ye.length,filters:{type:s.type??"",types:s.types??[],city:s.ville??""}}),De({q:l})},300)};T.useEffect(()=>{p.trim()!==s.q&&w(s.q),f(s.types?.length?s.types:s.type?[s.type]:[]),z(ft),k.trim()!==s.ville&&I(s.ville)},[s.q,s.type,s.types,ft,s.ville]),T.useEffect(()=>{const l=()=>ae(!0),N=()=>ae(!1),E=qt.on("start",l),Z=qt.on("finish",N);return()=>{E(),Z()}},[]),T.useEffect(()=>{Y.current&&clearTimeout(Y.current);const l=p.trim();if(l.length<2){ke([]),q(!1),Ke([]);return}return Y.current=setTimeout(async()=>{V.current?.abort();const N=new AbortController;V.current=N,q(!0),Xn(l);try{const E=new URLSearchParams({q:l,limit:"6"}),Z=await fetch(`/api/v1/client/discovery/search?${E.toString()}`,{signal:N.signal,headers:{Accept:"application/json"}});if(!Z.ok)throw new Error("smart-search HTTP "+Z.status);const be=await Z.json();ke(be.salons??[])}catch(E){E.name!=="AbortError"&&ke([])}finally{V.current===N&&q(!1)}},220),()=>{Y.current&&clearTimeout(Y.current),V.current?.abort()}},[p,Xn]);const Zn=T.useMemo(()=>{const l=p.trim().toLowerCase();return l.length<1?[]:r.filter(N=>N.name.toLowerCase().includes(l))},[p,r]),Oo=T.useRef(!0);T.useEffect(()=>{if(Oo.current){Oo.current=!1;return}if(re||W||_e)return;const l=Lo.current;l&&l.scrollTo({top:0,behavior:"smooth"})},[s.q,s.type,s.types,s.ville,s.mode]),T.useEffect(()=>{Ae==="map"&&(Zt.current=!1,Bt(!1),typeof window<"u"&&window.requestAnimationFrame(()=>{window.dispatchEvent(new Event("resize")),window.setTimeout(()=>{window.dispatchEvent(new Event("resize"))},180),window.setTimeout(()=>{window.dispatchEvent(new Event("resize"))},500)}))},[Ae]),T.useEffect(()=>{const l=s.ville.trim();if(!l)return;const N=Nn.current;N&&N.lookup(l,(E,Z)=>{if(E||!Z?.results?.length)return;const be=Z.results[0];Tt([be.coordinate.latitude,be.coordinate.longitude])},{limitToCountries:"BE,FR"})},[s.ville]),T.useEffect(()=>{if(typeof window>"u")return;const l=window.matchMedia("(min-width: 1024px)"),N=E=>{D(E.matches)};return D(l.matches),l.addEventListener("change",N),()=>l.removeEventListener("change",N)},[]),T.useEffect(()=>()=>{L.current&&clearTimeout(L.current),vt.current&&clearTimeout(vt.current),Je.current&&clearTimeout(Je.current),kn()},[kn]);const Cs=l=>{const N=[];f(N),De({types:N})},Tn=l=>{const N=y.includes(l)?y.filter(E=>E!==l):[...y,l].sort((E,Z)=>go.indexOf(E)-go.indexOf(Z));z(N),De({modes:N})}
2,ht=(l,N)=>{I(l),N&&Tt(N),Ce(!1),Ne(!1),Ke([]),$e.current?.blur(),De({ville:l})},tn=()=>{I(""),Tt(null),Ke([]),It.current+=1,mt(!1),De({ville:""})},Wo=l=>{I(l),Ce(!0),vt.current&&clearTimeout(vt.current),l.length>=2?vt.current=setTimeout(()=>Xn(l),250):(Ke([]),mt(!1))},Ns=l=>{l.key==="Enter"&&(l.preventDefault(),L.current&&clearTimeout(L.current),De({q:p}),F(!1),U.current?.blur()),l.key==="Escape"&&(F(!1),U.current?.blur())},Ts=l=>{if(l.key==="Enter"){l.preventDefault();const N=jt[0];if(N){const Z=N.lat!=null&&N.lng!=null;ht(N.name,Z?[N.lat,N.lng]:void 0);return}const E=k.trim();E&&ht(E)}l.key==="Escape"&&(Ce(!1),Ne(!1),$e.current?.blur())},Is=l=>{F(!1),U.current?.blur(),f([l]),w(""),De({types:[l],q:""})},Pt=()=>{w(""),f([]),z([]),I(""),bn(null),Tt(null),Ke([]),Po(null),yt.current=null,It.current+=1,wn.current?.abort(),Je.current&&clearTimeout(Je.current),mt(!1),jn(!1),Kn(!1),Bt(!1),Zt.current=!1,Un(n),qt.get("/salons",{},{preserveState:!0,preserveScroll:!0})},Jn=s.quartierLabel?`${s.quartierLabel}, ${s.ville}`:s.ville,Ft=!!(p||b.length>0||y.length>0||k||s.quartier||(s.amenities?.length??0)>0||s.rating!==null||s.date!==null),zs=()=>{F(!1),Ce(!1),Ne(!1),U.current?.blur(),$e.current?.blur()};T.useEffect(()=>{const l=N=>{const E=N.target;if(W){const Z=U.current?.contains(E),be=J.current?.contains(E);!Z&&!be&&F(!1)}if(_e){const Z=$e.current?.contains(E),be=Fe.current?.contains(E);!Z&&!be&&(Ce(!1),Ne(!1))}};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[W,_e]);const Vo=T.useCallback(l=>{const N=Ho.current.get(l);N&&(N.scrollIntoView({behavior:"smooth",block:"center"}),Xt(l),setTimeout(()=>Xt(null),2e3))},[]),Rs=l=>{if(me([5,30,5]),bn(y.includes("domicile")?l:null),Vn(l),Mo(Fo.find(N=>N.slug===l)??null),!_){Xt(l);return}Vo(l)};T.useEffect(()=>{y.includes("domicile")||bn(null)},[y]);const At=_e&&k.length>=2,In=_e&&k.length<2&&Wn.length>0,Ot=Lt&&pt!==null,Pe=T.useMemo(()=>yn?Ye.find(l=>l.slug===yn)??(qn?.slug===yn?qn:null):null,[yn,Ye,qn]),eo=T.useMemo(()=>Pe?Tr(Pe.type_names,Pe.type_name):null,[Pe]),Wt=Ot?Ye.length:m,_s=y.map(l=>d(l==="salon"?"En salon":"à domicile")),qo=b.length===1?r.find(l=>l.slug===b[0])?.name??"":b.length>1?`${b.length} ${d("spécialisations")}`:"",Es=W?p:p||qo,Uo="directory-search-input",Go="directory-search-dropdown",Ko="directory-city-input",Qo="directory-city-dropdown",Hs=Zs(r),Yo=j.user?.role,Ms=Yo==="pro"?{href:il(),label:d("Dashboard")}:Yo==="client"?{href:Os(),label:d("Mon compte")}:{href:Ws(),label:d("Mon compte")};return o.jsxs(o.Fragment,{children:[o.jsx(Ps,{title:ll()}),o.jsxs("div",{className:"bg-background text-foreground",children:[o.jsx(Vs,{brandName:g,specializationItems:Hs,accountAction:Ms,onProSpaceAccess:_o}),o.jsxs("div",{className:"directory-page-enter flex min-h-dvh flex-col lg:h-dvh lg:min-h-0 lg:overflow-hidden",style:{paddingTop:"var(--ch-safe-top)"},children:[o.jsx("div",{ref:xe,className:"directory-page-enter-search relative z-30 hidden border-b border-border/60 lg:block",children:o.jsx("div",{className:"w-full px-5 py-4 sm:px-8 lg:px-10",children:o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-stretch sm:gap-0",children:[o.jsxs("div",{className:"relative flex-1 sm:border-r sm:border-border/40",children:[o.jsx("label",{htmlFor:Uo,className:"absolute top-1.5 left-3.5 text-[10px] font-medium tracking-wider text-muted-foreground/50 uppercase",children:d("Que cherchez-vous ?")}),o.jsx(nn,{className:"absolute bottom-2.5 left-3.5 size-3.5 text-muted-foreground/40",strokeWidth:1.5}),o.jsx("input",{id:Uo,ref:U,type:"text",value:Es,onChange:l=>Dt(l.target.value),onKeyDown:Ns,onFocus:()=>{F(!0),Ne(!1),Ce(!1)},autoComplete:"off","aria-expanded":W,"aria-controls":Go,placeholder:d("Coiffeur, manucure, spa..."),className:"w-full rounded-lg border border-border/70 bg-background/80 pt-6 pr-8 pb-2.5 pl-9 text-sm transition-[border-color,background-color,transform] duration-300 placeholder:text-muted-foreground/40 focus:border-foreground
2/25 focus:bg-background focus:outline-none sm:rounded-none sm:rounded-l-lg sm:border-r-0"}),(p||qo)&&o.jsx("button",{onClick:()=>{if(p){Dt("");return}b.length>0&&Cs()},className:"absolute right-2.5 bottom-2.5 rounded p-0.5 text-muted-foreground/50 transition-colors duration-300 hover:text-foreground",children:o.jsx(st,{className:"size-3.5"})}),W&&o.jsxs("div",{id:Go,ref:J,className:"absolute top-full right-0 left-0 z-50 mt-1.5 max-h-[50dvh] animate-in overflow-y-auto rounded-xl border border-border/70 bg-background/95 shadow-[0_28px_50px_-36px_rgba(0,0,0,0.8)] backdrop-blur duration-300 fade-in slide-in-from-top-2",children:[o.jsx("p",{className:"px-4 py-2.5 text-[10px] font-semibold tracking-wider text-muted-foreground/50 uppercase",children:d("Catégories")}),r.map(l=>o.jsxs("button",{onClick:()=>Is(l.slug),className:`flex w-full items-center justify-between px-4 py-3 text-left transition-colors duration-300 hover:bg-muted/30 ${b.includes(l.slug)?"bg-muted/20 font-medium":""}`,children:[o.jsx("span",{className:"text-sm",children:l.name}),o.jsx(Ln,{className:"size-3.5 text-muted-foreground/40"})]},l.slug))]})]}),o.jsxs("div",{className:"relative flex-1",children:[o.jsx("label",{htmlFor:Ko,className:"absolute top-1.5 left-3.5 text-[10px] font-medium tracking-wider text-muted-foreground/50 uppercase",children:d("Où")}),o.jsx(nt,{className:"absolute bottom-2.5 left-3.5 size-3.5 text-muted-foreground/40",strokeWidth:1.5}),o.jsx("input",{id:Ko,ref:$e,type:"text",value:k,onChange:l=>Wo(l.target.value),onKeyDown:Ts,onFocus:()=>{Ce(!0),Ne(!0),F(!1)},autoComplete:"off","aria-expanded":Me&&_e,"aria-controls":Qo,placeholder:d("Ville ou code postal..."),className:"w-full rounded-lg border border-border/70 bg-background/80 pt-6 pr-8 pb-2.5 pl-9 text-sm transition-[border-color,background-color,transform] duration-300 placeholder:text-muted-foreground/40 focus:border-foreground
2/25 focus:bg-background focus:outline-none sm:rounded-none sm:rounded-r-lg"}),Qe&&o.jsx(lt,{className:"absolute right-3 bottom-3 size-3.5 animate-spin text-muted-foreground/40"}),!Qe&&k&&o.jsx("button",{onClick:tn,className:"absolute right-2.5 bottom-2.5 rounded p-0.5 text-muted-foreground/50 transition-colors duration-300 hover:text-foreground",children:o.jsx(st,{className:"size-3.5"})}),Me&&_e&&(At||In)&&o.jsxs("div",{id:Qo,ref:Fe,className:"absolute top-full right-0 left-0 z-50 mt-1.5 max-h-[50dvh] animate-in overflow-y-auto rounded-xl border border-border/70 bg-background/95 shadow-[0_28px_50px_-36px_rgba(0,0,0,0.8)] backdrop-blur duration-300 fade-in slide-in-from-top-2",children:[At&&jt.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"px-4 py-2.5 text-[10px] font-semibold tracking-wider text-muted-foreground/50 uppercase",children:d("Résultats")}),jt.map((l,N)=>o.jsxs("button",{onClick:()=>{const E=l.lat!=null&&l.lng!=null;ht(l.name,E?[l.lat,l.lng]:void 0)},className:"flex w-full items-start gap-2.5 px-4 py-3 text-left transition-colors duration-300 hover:bg-muted/30",children:[o.jsx(nt,{className:"mt-0.5 size-3.5 shrink-0 text-muted-foreground/40",strokeWidth:1.5}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium",children:l.name}),o.jsxs("p",{className:"text-xs text-muted-foreground/50",children:[l.region?`${l.region}, `:"",l.country]})]})]},`${l.name}-${l.country}-${N}`))]}),At&&!Qe&&jt.length===0&&o.jsxs("p",{className:"px-4 py-4 text-center text-xs text-muted-foreground/50",children:[d("Aucun résultat pour")," ","« ",k," »"]}),In&&o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"px-4 py-2.5 text-[10px] font-semibold tracking-wider text-muted-foreground/50 uppercase",children:d("Villes populaires")}),Wn.map(l=>o.jsxs("button",{onClick:()=>ht(l),className:"flex w-full items-start gap-2.5 px-4 py-3 text-left transition-colors duration-300 hover:bg-muted/30",children:[o.jsx(nt,{className:"mt-0.5 size-3.5 shrink-0 text-muted-foreground/40",strokeWidth:1.5}),o.jsx("div",{children:o.jsx("p",{className:"text-sm font-medium",children:l})})]},l))]})]})]})]}),o.jsxs("div",{className:"flex flex-wrap items-stretch gap-2 sm:items-center",children:[o.jsxs("button",{onClick:()=>Tn("salon"),className:`inline-flex min-h-11 flex-1 items-center justify-center gap-1 rounded-lg border px-3 py-2 text-sm font-medium transition-all duration-300 hover:-translate-y-0.5 sm:h-full sm:min-h-10 sm:flex-none sm:text-xs ${y.includes("salon")?"border-foreground bg-foreground text-background":"border-border/60 text-muted-foreground hover:border-foreground
2/20 hover:text-foreground"}`,children:[o.jsx(En,{className:"size-3"}),d("En salon")]}),o.jsxs("button",{onClick:()=>Tn("domicile"),className:`inline-flex min-h-11 flex-1 items-center justify-center gap-1 rounded-lg border px-3 py-2 text-sm font-medium transition-all duration-300 hover:-translate-y-0.5 sm:h-full sm:min-h-10 sm:flex-none sm:text-xs ${y.includes("domicile")?"border-foreground bg-foreground text-background":"border-border/60 text-muted-foreground hover:border-foreground/20 hover:text-foreground"}`,children:[o.jsx(Hn,{className:"size-3"}),d("à domicile")]}),Ft&&o.jsx("button",{onClick:Pt,className:"shrink-0 text-xs text-muted-foreground underline underline-offset-4 transition-colors duration-300 hover:text-foreground",children:d("Réinitialiser")})]})]})})}),!_&&re&&o.jsx("div",{className:"fixed inset-0 z-20 bg-transparent lg:hidden",onPointerDownCapture:l=>{l.preventDefault(),l.stopPropagation(),ie(!1),pe.current?.blur()},onClickCapture:l=>{l.preventDefault(),l.stopPropagation()},"aria-hidden":!0}),!_&&Ae!=="map"&&o.jsxs("div",{ref:Se,className:"sticky top-0 z-30 bg-background/90 px-3 py-2 shadow-[0_8px_18px_-14px_rgba(0,0,0,0.25)] backdrop-blur-xl sm:px-5 lg:hidden",style:{backdropFilter:"blur(18px) saturate(160%)",WebkitBackdropFilter:"blur(18px) saturate(160%)"},children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("div",{className:"relative flex-1",children:[he?o.jsx(lt,{className:"absolute top-1/2 left-3 size-4 -translate-y-1/2 animate-spin text-muted-foreground/60",strokeWidth:1.75}):o.jsx(nn,{className:"absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground/55",strokeWidth:1.75}),o.jsx("input",{ref:pe,type:"search",inputMode:"search",enterKeyHint:"search",value:p,onChange:l=>Dt(l.target.value),onFocus:()=>ie(!0),onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),L.current&&clearTimeout(L.current),De({q:p}),pe.current?.blur(),ie(!1))},placeholder:k?d("Coiffeur, manucure, spa à :city",{city:k}):d("Coiffeur, manucure, spa..."),autoComplete:"off",className:"h-11 w-full rounded-xl border border-border/70 bg-background/95 pr-9 pl-10 text-sm placeholder:text-muted-foreground/45 focus:border-foreground
2/30 focus:outline-none"}),p&&!he&&o.jsx("button",{type:"button",onClick:()=>{Dt(""),pe.current?.focus()},className:"absolute top-1/2 right-2 -translate-y-1/2 rounded-full p-1 text-muted-foreground/55 transition-colors hover:bg-muted/40 hover:text-foreground","aria-label":d("Effacer"),children:o.jsx(st,{className:"size-3.5"})})]}),o.jsxs("button",{type:"button",onClick:()=>$(!0),className:`relative flex h-11 w-11 shrink-0 items-center justify-center rounded-xl border transition-colors duration-200 active:scale-95 ${Ft?"border-foreground/40 bg-foreground/5 text-foreground":"border-border/70 bg-background/95 text-muted-foreground hover:text-foreground"}`,"aria-label":d("Filtres"),children:[o.jsx(Mn,{className:"size-4",strokeWidth:1.75}),Ft&&o.jsx("span",{className:"absolute top-1.5 right-1.5 size-1.5 rounded-full bg-foreground"})]})]}),re&&o.jsxs("div",{className:"absolute inset-x-3 top-full mt-1 max-h-[68dvh] animate-in overflow-y-auto rounded-2xl border border-border/70 bg-background/98 shadow-[0_24px_48px_-28px_rgba(0,0,0,0.55)] duration-200 fade-in slide-in-from-top-2 sm:inset-x-5",children:[(b.length>0||k)&&o.jsxs("div",{className:"border-b border-border/40 bg-foreground
2/[0.02] px-4 pt-3 pb-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("p",{className:"text-[10px] font-semibold tracking-wider text-muted-foreground/55 uppercase",children:d("Filtres actifs")}),o.jsx("button",{type:"button",onPointerDown:l=>l.preventDefault(),onClick:()=>{me(),Pt(),pe.current?.focus()},className:"text-[11px] font-medium text-muted-foreground underline underline-offset-2 hover:text-foreground",children:d("Effacer")})]}),o.jsxs("div",{className:"mt-2 flex flex-wrap gap-1.5",children:[b.map(l=>{const N=r.find(E=>E.slug===l);return N?o.jsxs("button",{type:"button",onPointerDown:E=>E.preventDefault(),onClick:()=>{me();const E=b.filter(Z=>Z!==l);f(E),De({types:E}),pe.current?.focus()},className:"inline-flex items-center gap-1 rounded-full border border-foreground bg-foreground px-3 py-1 text-[12px] font-medium text-background transition-all duration-200 active:scale-95",children:[o.jsx(no,{className:"size-3",strokeWidth:2.5}),N.name,o.jsx(st,{className:"size-3 opacity-70",strokeWidth:2})]},l):null}),k&&o.jsxs("button",{type:"button",onPointerDown:l=>l.preventDefault(),onClick:()=>{me(),tn(),pe.current?.focus()},className:"inline-flex items-center gap-1 rounded-full border border-foreground bg-foreground px-3 py-1 text-[12px] font-medium text-background transition-all duration-200 active:scale-95",children:[o.jsx(nt,{className:"size-3",strokeWidth:2.5}),k,o.jsx(st,{className:"size-3 opacity-70",strokeWidth:2})]})]})]}),p.trim().length<2?o.jsx("div",{className:"px-4 pt-3 pb-3",children:o.jsx("p",{className:"text-[11px] text-muted-foreground/70",children:b.length>0||k?d("Continuez à taper pour ajouter d'autres filtresâ¦"):d("Tapez le nom d'un salon, une catégorie ou une villeâ¦")})}):o.jsxs(o.Fragment,{children:[Zn.length>0&&o.jsxs("div",{className:"px-4 pt-3 pb-2",children:[o.jsx("p",{className:"text-[10px] font-semibold tracking-wider text-muted-foreground/55 uppercase",children:d("Catégories")}),o.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:Zn.map(l=>{const N=b.includes(l.slug);return o.jsxs("button",{type:"button",onPointerDown:E=>E.preventDefault(),onClick:()=>{me();const E=N?b.filter(Z=>Z!==l.slug):[...b,l.slug];f(E),De({types:E}),pe.current?.focus()},className:`inline-flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-[12px] font-medium transition-all duration-200 active:scale-95 ${N?"border-foreground bg-foreground text-background":"border-border/70 bg-background text-foreground hover:border-foreground
2/40"}`,"aria-pressed":N,children:[N&&o.jsx(no,{className:"size-3",strokeWidth:2.5}),l.name]},l.slug)})})]}),(M||de.length>0)&&o.jsxs("div",{className:"border-t border-border/40 px-4 pt-3 pb-1",children:[o.jsx("p",{className:"text-[10px] font-semibold tracking-wider text-muted-foreground/55 uppercase",children:d("Ãtablissements")}),M&&de.length===0&&o.jsxs("p",{className:"mt-2 inline-flex items-center gap-1.5 text-[12px] text-muted-foreground/70",children:[o.jsx(lt,{className:"size-3 animate-spin"}),d("Rechercheâ¦")]}),o.jsx("div",{className:"-mx-2 mt-1",children:de.map(l=>o.jsxs(at,{href:`/salon/${l.username}`,onClick:()=>{me(),ie(!1)},className:"flex items-center gap-3 rounded-lg px-2 py-2 transition-colors hover:bg-muted/40 active:bg-muted/60",children:[o.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border/60 bg-muted/30",children:l.logo_path?o.jsx("img",{src:l.logo_path,alt:"",className:"h-full w-full object-cover",loading:"lazy"}):o.jsx("span",{className:"text-[12px] font-semibold text-muted-foreground/60",children:l.name.charAt(0)})}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"truncate text-[13px] font-medium text-foreground",children:l.name}),l.city&&o.jsx("p",{className:"truncate text-[11px] text-muted-foreground",children:l.city})]}),o.jsx(on,{className:"size-3.5 shrink-0 text-muted-foreground/40"})]},l.username))})]}),(Be.length>0||Qe)&&o.jsxs("div",{className:"border-t border-border/40 px-4 pt-3 pb-3",children:[o.jsx("p",{className:"text-[10px] font-semibold tracking-wider text-muted-foreground/55 uppercase",children:d("Villes")}),Qe&&Be.length===0&&o.jsxs("p",{className:"mt-2 inline-flex items-center gap-1.5 text-[12px] text-muted-foreground/70",children:[o.jsx(lt,{className:"size-3 animate-spin"}),d("Rechercheâ¦")]}),o.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:Be.map(l=>{const N=k.trim().toLowerCase()===l.name.toLowerCase();return o.jsxs("button",{type:"button",onPointerDown:E=>E.preventDefault(),onClick:()=>{if(me(),N)tn();else{const E=l.lat!=null&&l.lng!=null?[l.lat,l.lng]:void 0;ht(l.name,E)}pe.current?.focus()},className:`inline-flex items-center gap-1 rounded-full border px-3 py-1.5 text-[12px] font-medium transition-all duration-200 active:scale-95 ${N?"border-foreground bg-foreground text-background":"border-border/60 bg-background text-foreground hover:border-foreground
2/40"}`,"aria-pressed":N,children:[N?o.jsx(no,{className:"size-3",strokeWidth:2.5}):o.jsx(nt,{className:"size-3 text-muted-foreground/60",strokeWidth:1.75}),o.jsx("span",{className:"truncate",children:l.name}),l.region&&l.region!==l.name&&o.jsx("span",{className:`text-[10px] ${N?"text-background/70":"text-muted-foreground/55"}`,children:l.region})]},`${l.name}-${l.region}-${l.country}`)})})]}),!M&&!Qe&&Zn.length===0&&de.length===0&&Be.length===0&&o.jsxs("div",{className:"px-4 py-6 text-center",children:[o.jsx("p",{className:"text-[12px] text-muted-foreground",children:d("Aucun résultat pour « :q »",{q:p})}),o.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground/60",children:d("Essayez avec un autre mot-clé.")})]})]})]})]}),!_&&Ae!=="map"&&Ft&&!re&&o.jsx("div",{className:"border-b border-border/40 bg-background/85 lg:hidden",style:{backdropFilter:"blur(14px) saturate(150%)",WebkitBackdropFilter:"blur(14px) saturate(150%)"},children:o.jsxs("div",{className:"flex [scrollbar-width:none] items-center gap-1.5 overflow-x-auto px-3 py-2 [-ms-overflow-style:none] sm:px-5 [&::-webkit-scrollbar]:hidden",children:[b.map(l=>{const N=r.find(E=>E.slug===l);return N?o.jsxs("button",{type:"button",onClick:()=>{me();const E=b.filter(Z=>Z!==l);f(E),De({types:E})},className:"inline-flex shrink-0 items-center gap-1 rounded-full border border-foreground bg-foreground px-3 py-1 text-[12px] font-medium text-background transition-all duration-200 active:scale-95","aria-label":d("Retirer :name",{name:N.name}),children:[N.name,o.jsx(st,{className:"size-3 opacity-70",strokeWidth:2.5})]},l):null}),k&&o.jsxs("button",{type:"button",onClick:()=>{me(),tn()},className:"inline-flex shrink-0 items-center gap-1 rounded-full border border-foreground bg-foreground px-3 py-1 text-[12px] font-medium text-background transition-all duration-200 active:scale-95","aria-label":d("Retirer :name",{name:k}),children:[o.jsx(nt,{className:"size-3",strokeWidth:2.5}),k,o.jsx(st,{className:"size-3 opacity-70",strokeWidth:2.5})]}),_s.map(l=>o.jsx("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-full border border-border/60 bg-background/80 px-3 py-1 text-[12px] font-medium text-muted-foreground",children:l},l)),o.jsx("button",{type:"button",onClick:()=>{me(),Pt()},className:"ml-auto shrink-0 text-[11px] font-medium text-muted-foreground underline underline-offset-2 hover:text-foreground",children:d("Tout effacer")})]})}),o.jsx(tl,{open:B,onOpenChange:$,children:o.jsxs(nl,{side:"bottom",className:"max-h-[85dvh] overflow-y-auto rounded-t-2xl",onOpenAutoFocus:l=>l.preventDefault(),children:[o.jsx(ol,{className:"pb-2",children:o.jsx(rl,{children:d("Filtres")})}),o.jsxs("div",{className:"flex flex-col gap-4 px-4 pb-6",children:[o.jsxs("div",{className:"relative",children:[o.jsx("label",{htmlFor:"sheet-search-input",className:"mb-1.5 block text-[10px] font-medium tracking-wider text-muted-foreground/50 uppercase",children:d("Que cherchez-vous ?")}),o.jsxs("div",{className:"relative",children:[o.jsx(nn,{className:"absolute top-1/2 left-3 size-3.5 -translate-y-1/2 text-muted-foreground/40",strokeWidth:1.5}),o.jsx("input",{id:"sheet-search-input",type:"text",value:p,onChange:l=>Dt(l.target.value),onKeyDown:l=>{l.stopPropagation(),l.key==="Enter"&&(l.preventDefault(),l.target.blur(),L.current&&clearTimeout(L.current),De({q:p}),$(!1))},onKeyUp:l=>l.stopPropagation(),onKeyPress:l=>l.stopPropagation(),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,placeholder:d("Coiffeur, manucure, spa..."),className:"w-full rounded-lg border border-border/70 bg-background/80 py-3 pr-8 pl-9 text-sm placeholder:text-muted-foreground/40 focus:border-foreground
2/25 focus:bg-background focus:outline-none"}),p&&o.jsx("button",{onClick:()=>Dt(""),className:"absolute top-1/2 right-2.5 -translate-y-1/2 rounded p-0.5 text-muted-foreground/50 transition-colors hover:text-foreground",children:o.jsx(st,{className:"size-3.5"})})]}),o.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:r.slice(0,6).map(l=>{const N=b.includes(l.slug);return o.jsx("button",{onClick:()=>{const E=N?b.filter(Z=>Z!==l.slug):[...b,l.slug];f(E),w(""),De({types:E,q:""})},className:`inline-flex items-center rounded-full border px-2.5 py-1 text-xs transition-all ${N?"border-neutral-900 bg-neutral-900 text-white dark:border-white dark:bg-white dark:text-neutral-900":"border-border/60 text-muted-foreground"}`,children:l.name},l.slug)})})]}),o.jsxs("div",{className:"relative",children:[o.jsx("label",{htmlFor:"sheet-city-input",className:"mb-1.5 block text-[10px] font-medium tracking-wider text-muted-foreground/50 uppercase",children:d("Où")}),o.jsxs("div",{className:"relative",children:[o.jsx(nt,{className:"absolute top-1/2 left-3 size-3.5 -translate-y-1/2 text-muted-foreground/40",strokeWidth:1.5}),o.jsx("input",{id:"sheet-city-input",type:"text",value:k,onChange:l=>Wo(l.target.value),onKeyDown:l=>{if(l.stopPropagation(),l.key==="Enter"){l.preventDefault(),l.target.blur();const N=jt[0];if(N){const E=N.lat!=null&&N.lng!=null;ht(N.name,E?[N.lat,N.lng]:void 0)}else k.trim()&&ht(k.trim());Ne(!1)}},onKeyUp:l=>l.stopPropagation(),onKeyPress:l=>l.stopPropagation(),onFocus:()=>{Ce(!0),Ne(!0)},autoComplete:"off",autoCorrect:"off",spellCheck:!1,placeholder:d("Ville ou code postal..."),className:"w-full rounded-lg border border-border/70 bg-background/80 py-3 pr-8 pl-9 text-sm placeholder:text-muted-foreground/40 focus:border-foreground
2/25 focus:bg-background focus:outline-none"}),Qe&&o.jsx(lt,{className:"absolute top-1/2 right-3 size-3.5 -translate-y-1/2 animate-spin text-muted-foreground/40"}),!Qe&&k&&o.jsx("button",{onClick:tn,className:"absolute top-1/2 right-2.5 -translate-y-1/2 rounded p-0.5 text-muted-foreground/50 transition-colors hover:text-foreground",children:o.jsx(st,{className:"size-3.5"})})]}),_e&&(At||In)&&o.jsxs("div",{className:"mt-2 max-h-48 overflow-y-auto rounded-xl border border-border/70 bg-background/95",children:[At&&jt.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"px-3 py-2 text-[10px] font-semibold tracking-wider text-muted-foreground/50 uppercase",children:d("Résultats")}),jt.map((l,N)=>o.jsxs("button",{onClick:()=>{const E=l.lat!=null&&l.lng!=null;ht(l.name,E?[l.lat,l.lng]:void 0),Ne(!1)},className:"flex w-full items-start gap-2 px-3 py-2.5 text-left transition-colors hover:bg-muted/30",children:[o.jsx(nt,{className:"mt-0.5 size-3.5 shrink-0 text-muted-foreground/40",strokeWidth:1.5}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium",children:l.name}),o.jsxs("p",{className:"text-xs text-muted-foreground/50",children:[l.region?`${l.region}, `:"",l.country]})]})]},`sheet-${l.name}-${l.country}-${N}`))]}),At&&!Qe&&jt.length===0&&o.jsxs("p",{className:"px-3 py-3 text-center text-xs text-muted-foreground/50",children:[d("Aucun résultat pour")," ","« ",k," »"]}),In&&o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"px-3 py-2 text-[10px] font-semibold tracking-wider text-muted-foreground/50 uppercase",children:d("Villes populaires")}),Wn.map(l=>o.jsxs("button",{onClick:()=>{ht(l),Ne(!1)},className:"flex w-full items-start gap-2 px-3 py-2.5 text-left transition-colors hover:bg-muted/30",children:[o.jsx(nt,{className:"mt-0.5 size-3.5 shrink-0 text-muted-foreground/40",strokeWidth:1.5}),o.jsx("p",{className:"text-sm font-medium",children:l})]},`sheet-pop-${l}`))]})]})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs("button",{onClick:()=>Tn("salon"),className:`inline-flex min-h-11 flex-1 items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-sm font-medium transition-all ${y.includes("salon")?"border-foreground bg-foreground text-background":"border-border/60 text-muted-foreground"}`,children:[o.jsx(En,{className:"size-3.5"}),d("En salon")]}),o.jsxs("button",{onClick:()=>Tn("domicile"),className:`inline-flex min-h-11 flex-1 items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-sm font-medium transition-all ${y.includes("domicile")?"border-foreground bg-foreground text-background":"border-border/60 text-muted-foreground"}`,children:[o.jsx(Hn,{className:"size-3.5"}),d("à domicile")]})]}),o.jsxs("button",{type:"button",onClick:()=>{$(!1),Qn("ratings")},className:"inline-flex min-h-11 items-center justify-between rounded-lg border border-border/60 px-3 py-2 text-sm transition-colors hover:bg-muted/30",children:[o.jsxs("span",{className:"flex items-center gap-1.5",children:[o.jsx(Mn,{className:"size-3.5"}),d("Note et disponibilité")]}),o.jsx(Ln,{className:"size-4 text-muted-foreground/50"})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[Ft&&o.jsx("button",{onClick:()=>{Pt()},className:"text-xs text-muted-foreground underline underline-offset-4 transition-colors hover:text-foreground",children:d("Réinitialiser")}),o.jsxs("button",{onClick:()=>$(!1),className:"ml-auto inline-flex items-center justify-center gap-1.5 rounded-lg bg-foreground px-5 py-2.5 text-sm font-medium text-background transition-opacity hover:opacity-90",children:[d("Voir les résultats"),o.jsx("span",{className:"rounded-full bg-background/20 px-1.5 py-0.5 text-[11px]",children:Ot?Ye.length:m})]})]})]})]})}),o.jsx("div",{className:`fixed inset-0 z-20 bg-background/15 backdrop-blur-lg transition-opacity duration-300 ${xn?"pointer-events-auto opacity-100":"pointer-events-none opacity-0"}`,"aria-hidden":!xn,onClick:zs}),o.jsx("main",{className:"directory-page-enter-main isolate flex min-h-0 w-full flex-1 overflow-hidden bg-background/70 lg:bg-transparent","aria-label":d("Résultats de l'annuaire"),onTouchStart:l=>{if(_)return;if(l.target.closest("[data-no-swipe-toggle]")){ne.current=null;return}const N=l.touches[0];ne.current={x:N.clientX,y:N.clientY,t:Date.now()}},onTouchEnd:l=>{if(_)return;const N=ne.current;if(!N)return;ne.current=null;const E=l.changedTouches[0],Z=E.clientX-N.x,be=E.clientY-N.y;Date.now()-N.t>600||Math.abs(Z)<60||Math.abs(be)>30||(Z<0&&Ae!=="map"?(me(),vn("map")):Z>0&&Ae!=="list"&&(me(),vn("list")))},children:o.jsxs("div",{ref:xs,className:"relative min-h-0 flex-1 self-stretch lg:grid lg:h-full lg:grid-cols-[minmax(0,40%)_minmax(0,1fr)] lg:gap-6 lg:pr-6 lg:pb-4",children:[o.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 z-10 hidden w-[58%] bg-gradient-to-r from-background/32 via-background/10 to-transparent","aria-hidden":!0}),o.jsxs("section",{ref:Lo,className:`z-20 h-full min-h-0 flex-col overflow-hidden bg-background/82 backdrop-blur ${Ae==="map"?"hidden lg:flex":"flex"} lg:h-full lg:min-h-0 lg:overflow-hidden lg:bg-transparent lg:pl-6 lg:backdrop-blur-none`,children:[o.jsxs("div",{className:"flex items-center justify-between gap-3 bg-background px-5 py-2.5 shadow-[inset_0_1px_0_rgba(0,0,0,0.04)] sm:border-b sm:border-border/60 sm:bg-background/85 sm:px-8 sm:py-3 sm:shadow-none lg:flex-wrap lg:gap-y-2",children:[o.jsxs("div",{className:"min-w-0 shrink lg:order-1",children:[o.jsxs("p",{className:"truncate text-xs text-muted-foreground lg:hidden","aria-live":"polite",children:[o.jsx("span",{className:"font-medium text-foreground",children:Wt})," ",s.q?`${d("résultats pour")} « ${s.q} »`:s.ville?`${d(Wt!==1?"résultats à ":"résultat à ")} ${Jn}`:Ot?`${d(Wt!==1?"résultats":"résultat")} ${d("dans cette zone")}`:`${d(Wt!==1?"résultats":"résultat")} ${d("en Belgique")}`]}),o.jsx("h1",{className:"sr-only lg:not-sr-only lg:block lg:truncate lg:text-sm lg:font-semibold",children:s.q?`${d("Résultats pour")} « ${s.q} »`:s.type?(r.find(l=>l.slug===s.type)?.name??d("Résultats"))+(s.ville?` ${d("à ")} ${Jn}`:""):s.ville?`${d("Salons à ")} ${Jn}`:d("Tous les établissements")}),o.jsxs("p",{className:"mt-0.5 hidden truncate text-xs whitespace-nowrap text-muted-foreground lg:block","aria-live":"polite",children:[Wt," ",d(Wt!==1?"résultats":"résultat"),Ot?` ${d("dans cette zone")}`:s.ville?"":` ${d("en Belgique")}`]}),Gn&&o.jsxs("p",{className:"mt-1 inline-flex items-center gap-1 text-[11px] text-muted-foreground
2/70",children:[o.jsx(lt,{className:"size-3 animate-spin"}),d("Mise à jour de la zone...")]})]}),o.jsxs("div",{className:"hidden min-w-0 items-center gap-1.5 overflow-x-auto lg:order-3 lg:flex lg:basis-full [&::-webkit-scrollbar]:hidden",children:[[["types",d("Type"),b.length>0,!0],["cities",d("Ville"),!!k,!0],["areas",d("Quartier"),!!s.quartier,c.areas.length>0],["availability",d("Quand"),s.date!==null,!0]].filter(([,,,l])=>l).map(([l,N,E])=>o.jsx("button",{type:"button",onClick:()=>Qn(l),"aria-pressed":E,className:`inline-flex h-8 shrink-0 items-center rounded-full border px-3 text-xs transition-colors duration-fast ease-soft ${E?"border-foreground bg-foreground text-background":"border-border hover:bg-muted/40"}`,children:N},l)),o.jsxs("button",{type:"button",onClick:()=>Qn(null),className:"inline-flex h-8 shrink-0 items-center gap-1 rounded-full border border-border px-3 text-xs transition-colors duration-fast ease-soft hover:bg-muted/40",children:[o.jsx(Mn,{className:"size-3"}),d("Filtres")]})]}),!Ot&&o.jsxs("label",{className:"flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground lg:order-2",children:[o.jsx("span",{className:"sr-only",children:d("Trier par")}),o.jsx("select",{value:s.sort,onChange:l=>js(l.target.value),className:"h-8 rounded-lg border border-border bg-background px-2 text-xs text-foreground transition-colors hover:border-foreground
2/40 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":d("Trier les résultats"),children:a.map(l=>o.jsx("option",{value:l.value,children:l.label},l.value))})]})]}),o.jsxs("div",{ref:Bo,className:"@container relative flex-1 overflow-y-auto overscroll-contain pb-24 lg:pb-0",onTouchStart:l=>{if(_)return;const N=l.currentTarget;N.scrollTop>0||(X.current={y:l.touches[0].clientY,scrollTop:N.scrollTop})},onTouchMove:l=>{if(_||!X.current)return;if(l.currentTarget.scrollTop>0){X.current=null,ge(0);return}const E=l.touches[0].clientY-X.current.y;E>0&&ge(Math.min(120,E*.5))},onTouchEnd:()=>{if(_||!X.current)return;const l=se;X.current=null,l>=70?(me([8,40,8]),Re(!0),ge(50),qt.reload({onFinish:()=>{Re(!1),ge(0)}})):ge(0)},style:{transform:se>0?`translateY(${se}px)`:void 0,transition:X.current?"none":"transform 220ms ease-out"},children:[!_&&(se>0||ce)&&o.jsx("div",{className:"pointer-events-none absolute -top-12 right-0 left-0 flex items-center justify-center",style:{height:"48px"},children:o.jsx("div",{className:"flex size-10 items-center justify-center rounded-full border border-border/60 bg-background/95 shadow-sm backdrop-blur",style:{transform:ce?"rotate(0deg)":`rotate(${Math.min(360,se*4)}deg)`,transition:ce?"none":void 0},children:ce?o.jsx(lt,{className:"size-4 animate-spin text-foreground/70"}):o.jsx(on,{className:`size-4 ${se>=70?"text-foreground":"text-muted-foreground/60"}`,style:{transform:"rotate(90deg)",transition:"color 150ms"}})})}),o.jsx(Ui,{visibleEstablishments:Ye,establishments:n,searchPending:he,mapAreaActive:Ot,hoveredSlug:Eo,setHoveredSlug:Xt,cardRefs:Ho,hasActiveFilters:Ft,clearFilters:Pt,scrollParent:Bo.current}),o.jsx(ml,{open:bs,section:vs,aggregations:c,resultsCount:m,query:s.q??"",availabilityHorizonDays:u,selection:{types:b,ville:k,quartier:s.quartier??"",modes:y,amenities:s.amenities??[],rating:s.rating??null,date:s.date??null,slot:s.slot??null},onOpenChange:Sn,onApply:l=>{Sn(!1),De({types:l.types,ville:l.ville,quartier:l.quartier,modes:l.modes,amenities:l.amenities,rating:l.rating,date:l.date,slot:l.slot})},onClear:()=>{Sn(!1),Pt()}}),o.jsx(gl,{pagination:t,hidden:Lt}),o.jsx(Ki,{seoContent:h,crossLinks:x,areaLinks:v}),o.jsx(el,{headline:d("Vous êtes professionnel ?"),subheadline:d("Inscrivez votre salon gratuitement et apparaissez dans notre annuaire."),canRegister:S}),o.jsx("footer",{className:"border-t border-border/70",children:o.jsxs("div",{className:"flex flex-col gap-4 px-5 py-8 text-sm text-muted-foreground sm:px-8",children:[o.jsxs("p",{children:["©"," ",new Date().getFullYear()," ",g,"."," ",d("Tous droits réservés.")]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-5",children:[o.jsx(at,{href:"/conditions-generales",className:"transition-colors hover:text-foreground",children:d("Conditions")}),o.jsx(at,{href:"/confidentialite",className:"transition-colors hover:text-foreground",children:d("Confidentialité")}),o.jsx("button",{type:"button",onClick:_o,className:"transition-colors hover:text-foreground",children:d("Espace pro")}),o.jsx(Us,{}),o.jsx(Gs,{compact:!0})]})]})})]})]}),o.jsxs("section",{className:`relative h-full min-h-0 flex-col overflow-hidden bg-muted/10 ${Ae==="list"?"hidden lg:flex":"flex"} lg:mt-4 lg:h-[calc(100%-1rem)] lg:overflow-hidden lg:rounded-xl lg:border lg:border-border/60`,children:[o.jsx("div",{className:"pointer-events-none absolute top-5 right-5 z-20 hidden lg:block",children:o.jsxs("div",{className:"pointer-events-auto rounded-2xl border border-border/60 bg-background/88 px-4 py-3 shadow-[0_16px_42px_-20px_rgba(0,0,0,0.55)] backdrop-blur-xl",children:[o.jsx("p",{className:"text-[11px] font-semibold tracking-[0.08em] text-muted-foreground/65 uppercase",children:d("Carte interactive")}),o.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground/70",children:d("Déplacez la carte pour raffiner les résultats")}),Gn?o.jsxs("p",{className:"mt-2 inline-flex items-center gap-1 text-[11px] text-muted-foreground/70",children:[o.jsx(lt,{className:"size-3 animate-spin"}),d("Mise à jour...")]}
2):o.jsxs("p",{className:"mt-2 text-xs text-muted-foreground/70",children:[Ye.length," ",Ye.length!==1?d("visibles"):d("visible")]})]})}),!_&&Ae==="map"&&o.jsxs("div",{className:"flex items-center justify-between border-b border-border/60 bg-background/85 px-5 py-2 sm:px-8 lg:hidden",children:[o.jsxs("p",{className:"text-xs text-muted-foreground","aria-live":"polite",children:[Ye.length," ",Ye.length!==1?d("résultats"):d("résultat")]}),Gn&&o.jsxs("p",{className:"inline-flex items-center gap-1 text-[11px] text-muted-foreground/70",children:[o.jsx(lt,{className:"size-3 animate-spin"}),d("Mise à jour...")]})]}),hs&&o.jsxs("div",{className:"relative h-full min-h-0 flex-1",children:[gs&&!_&&o.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-3 z-10 flex justify-center",children:o.jsxs("button",{type:"button",onClick:Ss,className:"pointer-events-auto inline-flex items-center gap-1.5 rounded-full border border-border/70 bg-background/95 px-4 py-2 text-xs font-medium shadow-lg backdrop-blur transition-all duration-200 hover:bg-background",children:[o.jsx(nn,{className:"size-3.5"}),d("Rechercher ici")]})}),o.jsx(T.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center bg-muted/10",children:o.jsx("p",{className:"text-sm text-muted-foreground",children:d("Chargement de la carte...")})}),children:o.jsx(ta,{establishments:Fo,hoveredSlug:Eo,selectedSlug:ps,showHomeServiceRadius:y.includes("domicile"),onMarkerHover:l=>Xt(l),onMarkerClick:Rs,fallbackCenter:Yt,onBoundsChange:ks,onUserLocated:ws,fitKey:en})})]}),!_&&Ae==="map"&&Pe&&!xn&&o.jsx("div",{className:"pointer-events-none absolute inset-x-3 bottom-[calc(env(safe-area-inset-bottom)+4.75rem)] z-[620] sm:inset-x-6",children:o.jsxs("div",{className:"pointer-events-auto rounded-2xl border border-border/70 bg-background/95 p-3 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.55)] backdrop-blur",children:[o.jsxs("div",{className:"flex items-start justify-between gap-3",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("p",{className:"truncate text-sm font-semibold",children:Pe.name}),o.jsxs("p",{className:"mt-0.5 flex items-center gap-1 text-xs text-muted-foreground",children:[o.jsx(nt,{className:"size-3 shrink-0",strokeWidth:1.5}),o.jsx("span",{className:"truncate",children:Pe.city?`${Pe.postal_code?`${Pe.postal_code} `:""}${Pe.city}`:d("Adresse non renseignée")})]}),o.jsxs("div",{className:"mt-2 flex flex-wrap gap-1.5",children:[eo?.labels.map(l=>o.jsx("span",{className:"inline-flex items-center rounded-full border border-foreground
2/10 bg-foreground/[0.04] px-2.5 py-1 text-[11px] font-medium text-foreground",children:l},l)),(eo?.extraCount??0)>0&&o.jsxs("span",{className:"inline-flex items-center rounded-full border border-border/60 bg-background/80 px-2 py-1 text-[11px] font-medium text-muted-foreground",children:["+",eo?.extraCount]}),Pe.has_commercial_location&&o.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-border/60 bg-background/80 px-2.5 py-1 text-[11px] font-medium text-muted-foreground",children:[o.jsx(En,{className:"size-3"}),d("En salon")]}),Pe.offers_home_service&&o.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-border/60 bg-background/80 px-2.5 py-1 text-[11px] font-medium text-muted-foreground",children:[o.jsx(Hn,{className:"size-3"}),d("à domicile")]})]})]}),o.jsx("button",{type:"button",onClick:()=>Vn(null),className:"rounded p-1 text-muted-foreground transition-colors duration-200 hover:text-foreground","aria-label":d("Fermer le panneau salon"),children:o.jsx(st,{className:"size-4"})})]}),o.jsxs("div",{className:"mt-3 flex gap-2",children:[o.jsxs("button",{type:"button",onClick:()=>{vn("list"),setTimeout(()=>Vo(Pe.slug),120)},className:"inline-flex flex-1 items-center justify-center gap-1 rounded-lg border border-border/70 px-3 py-2 text-xs font-medium text-foreground transition-colors duration-200 hover:bg-muted/25",children:[o.jsx(Nr,{className:"size-3.5"}),d("Voir la liste")]}),o.jsxs(at,{href:`/salon/${Pe.username}`,className:"inline-flex flex-1 items-center justify-center gap-1 rounded-lg bg-foreground px-3 py-2 text-xs font-medium text-background transition-opacity duration-200 hover:opacity-90",children:[d("Réserver"),o.jsx(on,{className:"size-3.5"})]})]})]})})]})]})}),!_&&!xn&&!B&&o.jsx(hl,{mobileView:Ae,onChangeView:l=>{Ae!==l&&me(),vn(l)},onOpenFilters:()=>{me(),$(!0)}})]})]}),o.jsx(qs,{canRegister:S,isPro:j.user?.role==="pro",onContinue:cs,onOpenChange:ds,open:us,onSkipPromptChange:ms,skipPrompt:fs})]})}export{Xa 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.