1import{p as ot,j as e,X as Ke,d as lt,L as ee,l as Ie,B as Tt,k as Vs,G as ts,o as Ds,s as A,e as Ps,q as Ts,g as As,b as Es,V as Qe,A as Rs,S as et,Z as qs,i as H,w as rt,n as Is,c as tt,y as At,C as Et,U as Ms,x as $s,$ as Fs,a0 as Ls}from"./index-Djngj64n.js";import{r as l}from"./map-BdGKWdad.js";import{V as Os}from"./VisitCardActions-Bp9jXo7j.js";import{P as Rt}from"./PremiumBadge-DsUBaPOf.js";import{A as Bs,F as qt}from"./FavoriteButton-DwE8buUj.js";import{u as Us}from"./useInfiniteScroll-CbbRpGj6.js";import{u as Gs}from"./useCookieBannerVisible-BlCPUY_C.js";import{V as It}from"./visitMapper-DNbVDDd6.js";import Hs from"./MapView-BYfpSXw0.js";import Js from"./ProjectModal-C5puTpgg.js";import Ys from"./VirtualTourModal-BnIBxyL3.js";import{B as Mt}from"./BrandLogo-DazLt5p3.js";import{C as $t}from"./CategoryBadge-CEKawLAt.js";import{DataCorrectionModal as Xs}from"./DataCorrectionModal-B_p0mfo3.js";import Ws from"./ShareModal-seIPZ-fa.js";import{L as Zs}from"./LoginPromptModal-vu9bTzTi.js";import{U as Ks}from"./UserReportModal-CfmclxnR.js";import{f as Ft}from"./departmentHelper-B0Pbnm_M.js";import{G as Qs,i as Lt,f as ea}from"./dateHelper-DdaSc-86.js";import{f as ta}from"./numberFormatter-BRxWzTuY.js";import{g as sa}from"./urlHelper-CO2IV12a.js";import{g as Ot,s as Bt}from"./slugify-BWwtZJds.js";import{P as Ut}from"./PanoramaThumbnail-CPVTEt7N.js";import{T as Gt}from"./thumbnailCacheBustService-CnwfD64g.js";import{u as aa,T as ra}from"./useInlineThumbnailEdit-CbTBi2yg.js";import{u as oa}from"./useThumbnailViewpoints-uB0k1cgq.js";import{S as Me}from"./sparkles-CLDX4uU_.js";import{L as Ht}from"./layers-BclMJYns.js";import{S as ss}from"./send-DDoVXiv4.js";import{T as st}from"./tag-CdxdVdPw.js";import{N as la}from"./navigation-Bv8ndY8G.js";import{c as Jt}from"./seoAltGenerator-CLpqiv-F.js";import{S as ia}from"./shield-check--5JHissV.js";import{S as na}from"./shield-alert-DUA8C6iF.js";import{R as Yt}from"./refresh-cw-DEoBvRxR.js";import{D as Xt}from"./download-D9ScuCu-.js";import{C as da}from"./crown-ClvjAyZn.js";import{D as ca}from"./drone-DCFUUIWm.js";import{M as ua}from"./map-DqzOXxQw.js";import{R as ma}from"./rotate-cw-DuLixrhK.js";import{C as Wt}from"./circle-alert-TXY2tYXh.js";import{E as qe}from"./eye-off-Bh8Zx4Px.js";import{A as xa}from"./arrow-up-C7ohbbAg.js";import{D as ga}from"./database-DZbxzCBy.js";import"./supabase-sVT2aVMd.js";import"./share-2-tJGZ8kvh.js";import"./wrench-CBL-UdHz.js";import"./truck-DGhGxqcI.js";import"./package-DvgcRgoh.js";import"./LeafletMap-Bk3ib1oV.js";import"./clusterColorService-XNY-7P-X.js";/* empty css */import"./iframeHelper-CGXKWuo4.js";import"./trafficTracker-BvvudH8T.js";import"./copy-tuHg1Zu5.js";import"./code-4Zc-6DFH.js";import"./urlShortenerService-KyeerMuf.js";import"./seoImageUrl-rJZvHupd.js";import"./imageProxy-Df9YQwEg.js";import"./users-CpqWvkq9.js";import"./shopping-bag-Dot-ONPS.js";import"./bike-FHU1isY9.js";import"./building-0C9K7yPE.js";import"./newspaper-tV6OqqHR.js";import"./book-open-DpOgi2iL.js";import"./zap-BGbukqgF.js";import"./plane-B-FiatUC.js";import"./trophy-Bfq3o1wa.js";import"./target-F3mmKZDH.js";import"./store-DJyq1Awu.js";import"./radio-CF-5W2aE.js";import"./briefcase-CWlPLB5V.js";import"./hop-CN4BPybi.js";import"./palette-Bg__47O2.js";import"./shield-HWlE_r7p.js";import"./image-CRR9gXOF.js";import"./check-DfBIv9ZE.js";import"./triangle-alert-BmdgJlTs.js";import"./rotate-ccw-BvYuF5Av.js";/** 2 * @license lucide-react v0.575.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const pa=[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]],ha=ot("image-off",pa);/** 7 * @license lucide-react v0.575.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const fa=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Zt=ot("square-check",fa);/** 12 * @license lucide-react v0.575.0 - ISC 13 * 14 * This source code is licensed under the ISC license. 15 * See the LICENSE file in the root directory of this source tree. 16 */const ba=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Kt=ot("square",ba),ya=["Hotels a Lyon","Boulangeries en Ile-de-France","Restaurants a Bordeaux","Camping dans les Alpes","Decathlon en France","Opticien a Paris"],ne={category:"Secteur d'activite",subCategory:"Activite",region:"Region",department:"Departement",groupe:"Enseigne",photographer:"Photographe"},va=({onResultsReceived:J,onClear:F,isAuthenticated:te=!1,visits:Y=[],onFiltersChange:u,onFiltersClear:h})=>{const[v,se]=l.useState(""),[_,pe]=l.useState(!1),[x,ae]=l.useState(null),[p,de]=l.useState(null),[X,z]=l.useState(!1),[V,re]=l.useState(!1),[n,W]=l.useState({category:"",subCategory:"",region:"",department:"",groupe:"",ph
16otographer:""}),[D,he]=l.useState(null),oe=l.useRef(null),le=l.useRef(null),ie="https://xvjsfpvluzmkqwfojwou.supabase.co",_e="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Inh2anNmcHZsdXpta3F3Zm9qd291Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTgyMjc2MDgsImV4cCI6MjA3MzgwMzYwOH0.jxbLvdCtNkMEv_gu8GGVSyrJMNgCtdz5qyk0rcuXwNc";l.useEffect(()=>{(async()=>{const{data:c}=await A.from("ai_search_config").select("example_queries,welcome_text,filter_labels,enabled").limit(1).maybeSingle();c&&he(c)})()},[]),l.useEffect(()=>{const o=c=>{le.current&&!le.current.contains(c.target)&&z(!1)};return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[]);const fe=D?.example_queries??ya,L=D?.filter_labels??ne,ce=D?.welcome_text||"Recherche IA : decrivez ce que vous cherchez en langage naturel...",{availableRegions:ze,availableDepartments:P,availableSubCategories:O,availableGroupes:j,availablePhotographers:Z,availableCategories:ue}=l.useMemo(()=>{const o=new Set,c=new Set,w=new Set,b=new Set,K=new Set,ye=new Set;for(const y of Y){y.region&&o.add(y.region),y.department&&c.add(y.department);const ve=y.Sous_cat||y.subCategory;ve&&w.add(ve),y.groupe&&b.add(y.groupe),y.photographer&&K.add(y.photographer),y.category&&ye.add(y.category)}return{availableRegions:[...o].sort(),availableDepartments:[...c].sort(),availableSubCategories:[...w].sort(),availableGroupes:[...b].sort(),availablePhotographers:[...K].sort(),availableCategories:[...ye].sort()}},[Y]),$e=n.category?Y.filter(o=>o.category.toLowerCase().includes(n.category.toLowerCase())).map(o=>o.Sous_cat||o.subCategory).filter((o,c,w)=>!!o&&w.indexOf(o)===c).sort():O,E=n.region?[...new Set(Y.filter(o=>o.region===n.region).map(o=>o.department).filter(Boolean))].sort():P,S=async o=>{const c=(o||v).trim();if(c){pe(!0),de(null),ae(null),z(!1);try{const w=await fetch(`${ie}/functions/v1/natural-language-search`,{method:"POST",headers:{Authorization:`Bearer ${_e}`,"Content-Type":"application/json"},body:JSON.stringify({query:c})}),b=await w.json();if(!w.ok||b.error){de(b.error||"Erreur lors de la recherche");return}const K={searchParams:b.searchParams,visits:b.visits||[],total:b.total||0};ae(K),J(K.visits,K.searchParams)}catch{de("Impossible de contacter le service de recherche")}finally{pe(!1)}}},R=()=>{se(""),ae(null),de(null),F(),oe.current?.focus()},be=o=>{o.key==="Enter"&&!_&&(o.preventDefault(),S()),o.key==="Escape"&&(z(!1),oe.current?.blur())},d=l.useCallback((o,c)=>{W(w=>{const b={...w,[o]:c};return o==="category"&&(b.subCategory=""),o==="region"&&(b.department=""),b})},[]);l.useEffect(()=>{u&&u(n)},[n,u]);const q=l.useCallback(()=>{W({category:"",subCategory:"",region:"",department:"",groupe:"",photographer:""}),h?.()},[h]),N=[n.category,n.subCategory,n.region,n.department,n.groupe,n.photographer].filter(Boolean).length,B=l.useMemo(()=>{const o=[];return n.category&&o.push({key:"category",label:n.category,color:"bg-teal-50 text-teal-700 border-teal-200"}),n.subCategory&&o.push({key:"subCategory",label:n.subCategory,color:"bg-sky-50 text-sky-700 border-sky-200"}),n.region&&o.push({key:"region",label:n.region,color:"bg-emerald-50 text-emerald-700 border-emerald-200"}),n.department&&o.push({key:"department",label:n.department,color:"bg-rose-50 text-rose-700 border-rose-200"}),n.groupe&&o.push({key:"groupe",label:n.groupe,color:"bg-blue-50 text-sky-800 border-blue-200"}),n.photographer&&o.push({key:"photographer",label:n.photographer,color:"bg-slate-100 text-slate-700 border-slate-200"}),o},[n]),I=o=>{W(o==="category"?c=>({...c,category:"",subCategory:""}):o==="region"?c=>({...c,region:"",department:""}):c=>({...c,[o]:""}))},U=x?.searchParams?Object.entries(x.searchParams).filter(([o,c])=>c&&o!=="keywords"&&(typeof c=="string"?c.trim():!0)).map(([o,c])=>({key:o,val:String(c)})):[];return e.jsxs("div",{className:"mb-4",ref:le,children:[e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:`relative bg-white border rounded-2xl transition-all duration-500 ${X?"shadow-[0_8px_40px_-4px_rgba(0,121,173,0.18)] ring-2 ring-[#0079AD]/30 border-[#0079AD]/40":x?"shadow-md border-gray-200":"shadow-sm border-gray-200 hover:shadow-md hover:border-gray-300"}`,children:[e.jsxs("div",{className:"relative flex items-center",children:[e.jsx("div",{className:`absolute left-5 transition-all duration-300 ${_?"text-[#0079AD] animate-pulse":X?"text-[#0079AD]":"text-sky-500/70"}`,children:e.jsx(Me,{size:20})}
16),e.jsx("input",{ref:oe,type:"text",placeholder:ce,value:v,onChange:o=>se(o.target.value),onFocus:()=>z(!0),onKeyDown:be,disabled:_,className:"w-full pl-14 pr-36 py-4 text-[15px] text-gray-900 placeholder-gray-400 bg-transparent rounded-2xl outline-none transition-all duration-300 disabled:opacity-60"}),e.jsxs("div",{className:"absolute right-3 flex items-center gap-2",children:[(v||x)&&!_&&e.jsx("button",{onClick:R,className:"p-1.5 rounded-lg text-gray-400 hover:text-gray-700 hover:bg-gray-100 transition-all duration-200",children:e.jsx(Ke,{size:16})}),te&&e.jsxs("button",{onClick:()=>re(!V),className:`flex items-center gap-1 px-2.5 py-1.5 rounded-lg text-xs font-medium transition-all duration-300 ${V||N>0?"bg-[#0079AD]/10 text-[#0079AD] border border-[#0079AD]/30":"bg-gray-100 text-gray-500 hover:text-gray-700 hover:bg-gray-200 border border-gray-200"}`,children:[e.jsx(Ht,{size:13}),e.jsx("span",{className:"hidden sm:inline",children:"Filtres"}),N>0&&e.jsx("span",{className:"w-4 h-4 flex items-center justify-center rounded-full text-[10px] font-bold bg-[#0079AD] text-white",children:N}),e.jsx(lt,{size:12,className:`transition-transform duration-300 ${V?"rotate-180":""}`})]}),e.jsxs("button",{onClick:()=>S(),disabled:_||!v.trim(),className:`flex items-center gap-1.5 px-4 py-2 rounded-xl text-sm font-semibold transition-all duration-300 ${_?"bg-[#0079AD]/50 text-white/70 cursor-wait":v.trim()?"bg-gradient-to-r from-[#0079AD] to-[#005f87] text-white shadow-lg shadow-[#0079AD]/30 hover:shadow-[#0079AD]/50 hover:scale-[1.02] active:scale-[0.98]":"bg-gray-100 text-gray-400 cursor-not-allowed"}`,children:[_?e.jsx(ee,{size:16,className:"animate-spin"}):e.jsx(ss,{size:14}),e.jsx("span",{className:"hidden sm:inline",children:_?"Analyse...":"Rechercher"})]})]})]}),(B.length>0||x&&U.length>0)&&e.jsxs("div",{className:"px-5 pb-4 flex items-center gap-2 flex-wrap",children:[x&&U.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-[11px] text-gray-500 font-medium uppercase tracking-wider mr-1",children:"Compris :"}),U.map(({key:o,val:c})=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium bg-blue-50 text-sky-800 border border-blue-200",children:[o==="city"&&e.jsx(Ie,{size:11}),o==="category"&&e.jsx(st,{size:11}),o==="subcategory"&&e.jsx(st,{size:11}),o==="brand"&&e.jsx(Tt,{size:11}),(o==="department"||o==="region")&&e.jsx(la,{size:11}),c]},o)),e.jsxs("span",{className:"text-xs text-gray-500 ml-auto",children:[x.total," ",x.total>1?"resultats":"resultat"]})]}),!x&&B.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-[11px] text-gray-500 font-medium uppercase tracking-wider mr-1",children:"Filtres :"}),B.map(o=>e.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium border ${o.color}`,children:[o.label,e.jsx("button",{onClick:()=>I(o.key),className:"p-0.5 rounded-full hover:bg-white/10 transition-colors",children:e.jsx(Ke,{size:10})})]},o.key)),B.length>1&&e.jsx("button",{onClick:q,className:"text-[11px] text-gray-500 hover:text-red-400 ml-auto transition-colors",children:"Tout effacer"})]})]}),p&&e.jsx("div",{className:"px-5 pb-4",children:e.jsx("p",{className:"text-sm text-red-400",children:p})})]}),X&&!v&&!x&&e.jsx("div",{className:"absolute z-50 w-full mt-2 bg-white rounded-2xl shadow-[0_12px_48px_-8px_rgba(0,0,0,0.15)] border border-gray-200 overflow-hidden animate-suggestions-in",children:e.jsxs("div",{className:"p-5",children:[e.jsxs("p",{className:"text-xs font-semibold text-gray-400 uppercase tracking-wider mb-3 flex items-center gap-2",children:[e.jsx(Me,{size:12,className:"text-sky-600"}),"Exemples de recherches IA"]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:fe.map(o=>e.jsxs("button",{onClick:()=>{se(o),S(o)},className:"group flex items-center gap-1.5 px-3.5 py-2 rounded-xl text-xs font-medium bg-gray-50 text-gray-600 hover:bg-[#0079AD]/10 hover:text-[#0079AD] border border-gray-200 hover:border-[#0079AD]/30 transition-all duration-200",children:[o,e.jsx(Vs,{size:12,className:"opacity-0 -ml-1 group-hover:opacity-100 group-hover:ml-0 transition-all duration-200"})]},o))})]})})]}),te&&e.jsx("div",{className:`overflow-hidden transition-all duration-500 ease-in-out ${V?"max-h-[400px] opacity-100 mt-3":"max-h-0 opacity-0"}`,children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-lg p-5 border border-gray-100",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[e.jsx(ge,{icon:e.jsx(st,{size:14,className:"text-teal-500"}),label:L.category||ne.category,value:n.category,onChange:o=>
16d("category",o),placeholder:"Tous les secteurs",options:ue.map(o=>({value:o,label:o}))}),e.jsx(ge,{icon:e.jsx(Ht,{size:14,className:"text-sky-500"}),label:L.subCategory||ne.subCategory,value:n.subCategory,onChange:o=>d("subCategory",o),placeholder:"Toutes les activites",options:$e.map(o=>({value:o,label:o}))}),e.jsx(ge,{icon:e.jsx(ts,{size:14,className:"text-emerald-500"}),label:L.region||ne.region,value:n.region,onChange:o=>d("region",o),placeholder:"Toutes les regions",options:ze.map(o=>({value:o,label:o}))}),e.jsx(ge,{icon:e.jsx(Ie,{size:14,className:"text-rose-500"}),label:L.department||ne.department,value:n.department,onChange:o=>d("department",o),placeholder:"Tous les departements",options:E.map(o=>({value:o,label:o}))}),e.jsx(ge,{icon:e.jsx(Tt,{size:14,className:"text-sky-600"}),label:L.groupe||ne.groupe,value:n.groupe,onChange:o=>d("groupe",o),placeholder:"Toutes les enseignes",options:j.map(o=>({value:o,label:o}))}),e.jsx(ge,{icon:e.jsx(Ds,{size:14,className:"text-slate-500"}),label:L.photographer||ne.photographer,value:n.photographer,onChange:o=>d("photographer",o),placeholder:"Tous les photographes",options:Z.map(o=>({value:o,label:o}))})]}),N>0&&e.jsx("div",{className:"flex justify-end mt-4",children:e.jsxs("button",{onClick:q,className:"flex items-center gap-1.5 px-4 py-2 rounded-xl text-sm font-medium text-red-600 hover:bg-red-50 border border-red-200 hover:border-red-300 transition-all",children:[e.jsx(Ke,{size:14}),"Reinitialiser les filtres"]})})]})})]})},ge=({icon:J,label:F,value:te,onChange:Y,placeholder:u,options:h})=>e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center gap-1.5 text-[11px] font-semibold text-gray-500 uppercase tracking-wider mb-1.5",children:[J,F]}),e.jsxs("div",{className:"relative",children:[e.jsxs("select",{value:te,onChange:v=>Y(v.target.value),className:`w-full px-3 py-2.5 bg-gray-50 border border-gray-200 rounded-xl text-sm appearance-none cursor-pointer transition-all duration-200 outline-none ${te?"border-[#0079AD]/40 bg-blue-50/30 text-gray-900 font-medium":"hover:border-gray-300 focus:border-[#0079AD] focus:ring-2 focus:ring-blue-100 text-gray-700"}`,children:[e.jsx("option",{value:"",children:u}),h.map(v=>e.jsx("option",{value:v.value,children:v.label},v.value))]}),e.jsx(lt,{size:14,className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none"})]})]}),Qt=J=>{if(!J)return"";try{const F=new Date(J);return isNaN(F.getTime())?"":F.toLocaleDateString("fr-FR",{day:"numeric",month:"short",year:"numeric"})}catch{return""}},at=[{key:"thumbnail_quality",label:"Pb vignettes",icon:e.jsx(ha,{size:16}),activeGradient:"from-sky-600 to-sky-700",badgeBg:"bg-blue-100",badgeText:"text-sky-800"},{key:"google_quality",label:"Pb Google",icon:e.jsx(ts,{size:16}),activeGradient:"from-blue-500 to-blue-600",badgeBg:"bg-blue-100",badgeText:"text-blue-700"},{key:"premium_quality",label:"Pb premium",icon:e.jsx(rt,{size:16}),activeGradient:"from-sky-600 to-sky-700",badgeBg:"bg-blue-100",badgeText:"text-sky-800"},{key:"data_quality",label:"Pb data",icon:e.jsx(ga,{size:16}),activeGradient:"from-emerald-500 to-emerald-600",badgeBg:"bg-emerald-100",badgeText:"text-emerald-700"},{key:"exclude",label:"A exclure",icon:e.jsx(qe,{size:16}),activeGradient:"from-red-500 to-red-600",badgeBg:"bg-red-100",badgeText:"text-red-700"}],es={thumbnail_quality:{bg:"bg-blue-50",text:"text-sky-800",border:"border-blue-200",label:"Vignette"},google_quality:{bg:"bg-blue-50",text:"text-blue-700",border:"border-blue-200",label:"Google"},premium_quality:{bg:"bg-blue-50",text:"text-sky-800",border:"border-blue-200",label:"Premium"},data_quality:{bg:"bg-emerald-50",text:"text-emerald-700",border:"border-emerald-200",label:"Data"},exclude:{bg:"bg-red-50",text:"text-red-700",border:"border-red-200",label:"Exclure"}},Yr=()=>{const J=Ps(),[F,te]=Ts(),{getVisitsProgressive:Y}=As(),{user:u,canEdit:h,userRole:v,isAdmin:se}=Es(),{ready:_,version:pe}=oa(),x=aa(),ae=l.useRef(()=>{}),[p,de]=l.useState([]),[X,z]=l.useState([]),[V,re]=l.useState(!1),[n,W]=l.useState(null),[D,he]=l.useState(null),[oe,le]=l.useState(!0),[ie,_e]=l.useState("grid"),[fe,L]=l.useState(200),[ce,ze]=l.useState(!1),[P,O]=l.useState(!1),[j,Z]=l.useState(!1),[ue,$e]=l.useState(!1),[E,S]=l.useState(!1),[R,be]=l.useState(!1),[d,q]=l.useState(null),[N,B]=l.useState({thumbnail_quality:new Set,google_quality:new Set,premium_quality:new Set,data_quality:new Set,exclude:new Set}),[I,U]=l.useState({}),[o,c]=l.useState(null),[w,b]=l.useState(null),[K,ye]=l.useState(!1),[y,ve]=l.useState(null),[as,rs]=l.useState(!1),os=Gs(),[Fe,Le]=l.useState(new Set),[Oe,Be]=l.useState(new Set),[ls,is]=l.useState({}),[it,nt]=l.useState(null),[Ve,De]=l.useState(null),[je,we]=l.useState(""),[dt,ct]=l.useState(null),[G,Ue]=l.useState(new Set),[ut,Pe]=l.useState(null),[mt,xt]=l.useState(null),[Ne,Te]=l.useState(null),[me,Ge]=l.useState(""),[gt,pt]=l.useState({}),[Q,ht]=l.useState(!1),[k,ke]=l.useState(new Set),[T,He]=l.useState(!1),[ft,bt]=l.useState(null),[yt,ns]=l.useState(new Set),[Ae,Je]=l.useState(!1),[Ye,ds]=l.useState(!1),[ja,vt]=l.useState(!1),Ce=l.useRef(!1),xe=l.useRef(!1),[wa,jt]=l.useState(null),M=l.useRef(null),Ee=l.useCallback(()=>
16{M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{Je(!1)},5*60*1e3)},[]),cs=l.useCallback(()=>{Je(t=>{const a=!t;return a?(M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{Je(!1)},5*60*1e3)):M.current&&clearTimeout(M.current),a})},[]);l.useEffect(()=>()=>{M.current&&clearTimeout(M.current)},[]),l.useCallback(t=>{d&&xt(t)},[d]);const wt=l.useCallback(()=>{xt(null)},[]),Xe=l.useCallback(async(t,a)=>{try{const s="https://xvjsfpvluzmkqwfojwou.supabase.co",r=s&&t.startsWith("http")?`${s}/functions/v1/image-proxy?url=${encodeURIComponent(t)}&w=800&q=90&format=png`:t,i=await fetch(r);if(!i.ok)throw new Error("fetch failed");const m=await i.blob(),C=URL.createObjectURL(m),g=document.createElement("a");g.href=C,g.download=`${a}.png`,document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(C)}catch{window.open(t,"_blank")}},[]),us=l.useCallback(t=>{ke(a=>{const s=new Set(a);return s.has(t)?s.delete(t):s.add(t),s})},[]),ms=l.useMemo(()=>{const t=new Set;return Object.values(N).forEach(a=>a.forEach(s=>t.add(s))),t},[N]),Se=l.useMemo(()=>p.filter(t=>t.approved===!1&&!yt.has(t.id)),[p,yt]),xs=l.useCallback(async t=>{if(u){bt(t);try{const a=u.user_metadata?.display_name||u.email||"";await A.from("new").update({approved:!0,approved_at:new Date().toISOString(),approved_by:a}).eq('"Id de lâenregistrement"',t),ns(s=>new Set(s).add(t)),Qe.invalidateAllCaches()}catch(a){console.error("Error approving visit:",a)}finally{bt(null)}}},[u]),gs=l.useCallback(async(t,a,s)=>{nt(t);try{await A.from("data_corrections").update({status:"done",processed_at:new Date().toISOString()}).eq("id",t),U(r=>{const i={...r};return i[a]&&(i[a]=i[a].filter(m=>m.id!==t),i[a].length===0&&delete i[a]),i}),B(r=>{const i=s,m={...r};if(Object.values(I[a]||[]).filter(g=>g.id!==t&&g.report_type===i).length===0){const g=new Set(r[i]);g.delete(a),m[i]=g}return m}),ae.current()}catch(r){console.error("Error resolving correction:",r)}finally{nt(null)}},[I]),Nt=l.useCallback(async(t,a)=>{const s=je.trim();if(s){ct(t);try{await A.from("data_corrections").update({description:s}).eq("id",t),U(r=>{const i={...r};return i[a]&&(i[a]=i[a].map(m=>m.id===t?{...m,description:s}:m)),i}),De(null),we("")}catch(r){console.error("Error saving remark:",r)}finally{ct(null)}}},[je]),ps=l.useCallback(async()=>{try{const{data:t}=await A.from("hidden_visits").select("visit_id");Ue(new Set(t?.map(a=>a.visit_id)||[]))}catch(t){console.error("Error loading hidden visits:",t)}},[]),hs=l.useCallback(async(t,a)=>{if(!u)return;if(G.has(t)){Pe(t);try{await A.from("hidden_visits").delete().eq("visit_id",t),Qe.invalidateHiddenCache(),Ue(r=>{const i=new Set(r);return i.delete(t),i})}catch(r){console.error("Error unhiding visit:",r)}finally{Pe(null)}}else Te({visitId:t,visitTitle:a}),Ge("")},[u,G]),fs=l.useCallback(async()=>{if(!u||!Ne||!me.trim())return;const{visitId:t,visitTitle:a}=Ne;Pe(t),Te(null);try{const s=u.user_metadata?.display_name||u.email||"";await A.from("hidden_visits").insert({visit_id:t,hidden_by:u.id,hidden_by_name:s,reason:me.trim()}),Qe.invalidateHiddenCache(),Ue(i=>new Set(i).add(t));const r=I[t]||[];if(r.length>0){const i=r.map(m=>m.id);await A.from("data_corrections").update({status:"done",processed_at:new Date().toISOString()}).in("id",i),U(m=>{const C={...m};return delete C[t],C}),B(m=>{const C={...m};for(const g of Object.keys(C)){const Pt=new Set(m[g]);Pt.delete(t),C[g]=Pt}return C}),ae.current()}}catch(s){console.error("Error hiding visit:",s)}finally{Pe(null),Ge("")}},[u,Ne,me,I]),kt=V||P||j||ue||E||R||!!d||T,f=l.useMemo(()=>{const t=r=>r.publishedAt||r.Date_PDV||r.date||"";if(T)return Se.filter(r=>r.image&&r.image.trim()!=="").sort((r,i)=>t(i)>t(r)?1:t(i)<t(r)?-1:0);let a=V?X:p;if(G.size>0&&d!=="exclude"&&(a=a.filter(r=>!G.has(r.id))),P&&(a=a.filter(r=>r.Iframe_Overlay)),j&&(a=a.filter(r=>r.iframeVVPDrone&&r.iframeVVPDrone.trim()!=="")),ue&&(a=a.filter(r=>r.lien_VE)),E&&(a=a.filter(r=>Fe.has(r.id))),R&&(a=a.filter(r=>Oe.has(r.id))),d){const r=N[d];a=a.filter(i=>r.has(i.id))}const s=a.filter(r=>r.image&&r.image.trim()!=="");return kt?s:s.sort((r,i)=>t(i)>t(r)?1:t(i)<t(r)?-1:0)},[p,X,V,G,P,j,ue,E,R,d,Fe,Oe,N,T,Se,kt]),Ct=l.useMemo(()=>f.length>0||p.length===0?[]:p.filter(a=>a.image&&a.image.trim()!=="").sort((a,s)=>(s.publishedAt||s.Date_PDV||s.date||"")>(a.publishedAt||a.Date_PDV||a.date||"")?1:-1).slice(0,8),[f.length,p]),$=l.useMemo(()=>f.slice(0,fe),[f,fe]),We=fe<f.length,bs=l.useCallback(async()=>
16{if(k.size===0)return;const t=$.filter(a=>k.has(a.id));for(const a of t)a.image&&(await Xe(a.image,a.id),await new Promise(s=>setTimeout(s,300)));ke(new Set)},[k,$,Xe]),ys=l.useCallback(()=>{!ce&&We&&(ze(!0),setTimeout(()=>{L(t=>Math.min(t+200,f.length)),ze(!1)},100))},[ce,We,f.length]),vs=Us({hasMore:We,isLoading:ce,onLoadMore:ys,threshold:.1,rootMargin:"200px"}),St=async()=>{if(!u){Le(new Set),Be(new Set);return}try{const{data:t}=await A.from("favorites").select("visit_id").eq("user_id",u.id);Le(new Set(t?.map(a=>a.visit_id)||[]))}catch(t){console.error("Error loading user favorites:",t)}},_t=async()=>{if(!u||!se){Be(new Set);return}try{const{data:t}=await A.from("favorites").select("visit_id").neq("user_id",u.id);Be(new Set(t?.map(a=>a.visit_id)||[]))}catch(t){console.error("Error loading other favorites:",t)}},zt=(t,a)=>{Le(s=>{const r=new Set(s);return a?r.add(t):r.delete(t),r})},Re=l.useCallback(async()=>{if(!u){B({thumbnail_quality:new Set,google_quality:new Set,premium_quality:new Set,data_quality:new Set,exclude:new Set}),U({});return}try{const{data:t}=await A.from("data_corrections").select("id, visit_id, report_type, sub_type, status, description, notes, requested_by_name, created_at").eq("status","pending").order("created_at",{ascending:!1}),a={thumbnail_quality:new Set,google_quality:new Set,premium_quality:new Set,data_quality:new Set,exclude:new Set},s={};(t||[]).forEach(r=>{const i=r.report_type;a[i]&&a[i].add(r.visit_id),s[r.visit_id]||(s[r.visit_id]=[]),s[r.visit_id].push(r)}),B(a),U(s)}catch(t){console.error("Error loading problem data:",t)}},[u]);ae.current=Re,l.useEffect(()=>{L(200)},[V,X,P,j,ue,E,R,d,T]),l.useEffect(()=>{let t=!1;(async()=>{try{le(!0),await Y((s,r)=>{const i=It.mapAPIDataToVisits(s),m=new Set,C=i.filter(g=>!g.id||m.has(g.id)?!1:(m.add(g.id),!0));de(C),!xe.current&&!Ce.current&&z(C),le(!1),t||(t=!0,Promise.all([Ls().then(g=>is(g)),ps(),Re(),St().then(()=>{F.get("favoris")==="true"&&S(!0)}),_t()])),r&&ds(!0)})}catch(s){console.error("Erreur lors du chargement des donnees:",s)}finally{le(!1)}})()},[]),l.useEffect(()=>{Ye&&Promise.all([St(),_t(),Re()])},[u,se]),l.useEffect(()=>{const t=()=>{rs(window.scrollY>400)};return window.addEventListener("scroll",t),()=>window.removeEventListener("scroll",t)},[]);const js=()=>{window.scrollTo({top:0,behavior:"smooth"})},Vt=t=>ls[t]||"bg-gray-400",ws=l.useCallback((t,a)=>{const s=It.mapAPIDataToVisits(t),r=new Set,i=s.filter(m=>!m.id||r.has(m.id)?!1:(r.add(m.id),!0));Ce.current=!0,vt(!0),jt(a),z(i),xe.current=!0,re(!0)},[]),Ns=l.useCallback(()=>{Ce.current=!1,vt(!1),jt(null),z(p),xe.current=!1,re(!1)},[p]),ks=l.useCallback(t=>{if(Ce.current)return;if(!!!(t.category||t.subCategory||t.region||t.department||t.groupe||t.photographer)){z(p),xe.current=!1,re(!1);return}let s=p;t.category&&(s=s.filter(r=>r.category?.toLowerCase().includes(t.category.toLowerCase()))),t.subCategory&&(s=s.filter(r=>(r.Sous_cat||r.subCategory||"").toLowerCase().includes(t.subCategory.toLowerCase()))),t.region&&(s=s.filter(r=>r.region===t.region)),t.department&&(s=s.filter(r=>r.department===t.department)),t.groupe&&(s=s.filter(r=>r.groupe===t.groupe)),t.photographer&&(s=s.filter(r=>r.photographer===t.photographer)),z(s),xe.current=!0,re(!0)},[p]),Cs=l.useCallback(()=>{Ce.current||(z(p),xe.current=!1,re(!1))},[p]),Dt=t=>{const a=t.category||t.Categorie||"",s=t.Sous_cat||t.subCategory||"",r=Ot(a);if(!r)return;const i=s?Bt(s):"",m=i&&i!==r?`/visite-virtuelle/secteurs/${r}/${i}`:`/visite-virtuelle/secteurs/${r}`;J(m)},Ss=t=>{const a=new URLSearchParams(F);a.set("groupe",t),a.delete("category"),a.delete("subCategory"),te(a),window.scrollTo({top:0,behavior:"smooth"})},_s=t=>{W(t)},zs=t=>{const a=t.slug;if(!a)return;const s=Ot(t.category||t.Categorie||""),r=Bt(t.Sous_cat||t.subCategory||t.category||"");return`${window.location.origin}/visite-virtuelle/secteurs/${s}/${r}/${a}`},Ze=t=>{const a=zs(t);if(j&&t.iframeVVPDrone&&t.iframeVVPDrone.trim()!==""){he({title:t.title,url:t.iframeVVPDrone,shareUrl:a,shareTitle:t.title,visitSlug:t.slug});return}const s=t.iframeOverlay||t.Iframe_Overlay||t.iframeVVP||t.Iframe_VVP||t.lien_vvp||t.lien_VE||t.iFrame||t.lienVVP||t.URL_Visite;s&&he({title:t.title,url:s,shareUrl:a,shareTitle:t.title,visitSlug:t.slug})};return e.jsxs("div",{className:"min-h-screen bg-gray-100 overflow-x-hidden max-w-full",children:[e.jsx(Rs,{title:"Recherche avancee de visites virtuelles 360° en France | Webvisite",description:"Explorez des milliers de visites virtuelles 360° en France. Recherchez par ville, region, departement, categorie ou marque. Trouvez et visitez virtuellement hotels, restaurants, commerces et bien plus.",canonical:`${et}/visite-virtuelle/recherche-avancee`,type:"CollectionPage",breadcrumbs:[{name:"Accueil",url:`${et}/`},{name:"Recherche avancee",url:`${et}/visite-virtuelle/recherche-avancee`}]}),e.jsx(qs,{forceScrolled:!0}),e.jsx("header",{className:"bg-white shadow-sm border-b mt-16",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6",children:e.jsxs("div",{className:"flex justify-end md:justify-between items-center",children:[e.jsxs("nav",{className:"hidden md:flex items-center space-x-2 text-sm",children:[e.jsx(H,{to:"/",title:"Retour à lâaccueil","aria-label":"Retour à lâaccueil",className:"text-gray-600 hover:text-sky-700 transition-colors duration-300 no-underline",children:"Accueil"}),e.jsx("span",{className:"text-gray-400",children:"/"}),e.jsx("span",{className:"text-gray-900 font-bold",children:"Recherche avancée"})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("h1",{className:"text-lg font-semibold text-gray-900",children:"Recherche avancée"}),e.jsxs("p",{className:"text-sm text-gray-600 mt-1 flex items-center justify-end gap-2",children:[e.jsxs("span",{children:[ta(f.length)," ",f.length>1?"visites virtuelles":"visite virtuelle"]}),!Ye&&!oe&&e.jsx(ee,{size:14,className:"animate-spin text-sky-500"})]})]})]})})}),e.jsx("div",{className:"min-h-screen bg-gray-100",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6",children:[e.jsx(va,{onResultsReceived:ws,onClear:Ns,isAuthenticated:!!u&&v!=="viewer",visits:p,onFiltersChange:ks,onFiltersClear:Cs}),e.jsxs("div",{className:"flex flex-col gap-3 mb-6",children:[h&&(Se.length>0||Ye||at.some(t=>N[t.key].size>0))&&e.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:Se.length>0&&e.jsxs("button",{onClick:()=>{const t=!T;He(t),t&&(ht(!1),q(null),O(!1),Z(!1),S(!1),setShowDuplicatesOnly(!1))},className:`flex items-center space-x-2 px-4 py-2 rounded-lg text-sm font-medium transition-all duration-300 ${T?"bg-gradient-to-r from-teal-500 to-teal-600 text-white shadow-md":"bg-teal-50 text-teal-700 hover:bg-teal-100 border border-teal-200"}`,children:[e.jsx(ia,{size:16}),e.jsx("span",{children:"En attente d'approbation"}),e.jsx("span",{className:`${T?"bg-white/20":"bg-teal-100 text-teal-700"} px-1.5 py-0.5 rounded-full text-xs font-bold`,children:Se.length})]})}),h&&at.some(t=>N[t.key].size>0)&&e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>{ht(!Q),Q||He(!1)},className:`flex items-center space-x-2 px-4 py-2 rounded-lg text-sm font-medium transition-all duration-300 ${Q||d?"bg-gradient-to-r from-gray-700 to-gray-800 text-white shadow-md":"bg-gray-50 text-gray-600 hover:bg-gray-100"}`,children:[e.jsx(na,{size:16}),e.jsx("span",{children:"Problèmes admin"}),e.jsx("span",{className:`${Q||d?"bg-white/20":"bg-red-100 text-red-700"} px-1.5 py-0.5 rounded-full text-xs`,children:Object.values(N).reduce((t,a)=>t+a.size,0)}),e.jsx(lt,{size:14,className:`transition-transform duration-300 ${Q?"rotate-180":""}`})]}),Q&&e.jsxs("div",{className:"flex items-center gap-2 flex-wrap mt-2 pl-1",children:[at.map(t=>{const a=N[t.key].size;if(a===0)return null;const s=d===t.key;return e.jsxs("button",{onClick:()=>{const r=s?null:t.key;
16q(r),ke(new Set),r&&(O(!1),$e(!1),S(!1))},className:`flex items-center space-x-1.5 px-3 py-2 rounded-lg text-sm font-medium transition-all duration-300 ${s?`bg-gradient-to-r ${t.activeGradient} text-white shadow-md`:"bg-gray-50 text-gray-600 hover:bg-gray-100"}`,children:[t.icon,e.jsx("span",{className:"hidden sm:inline",children:t.label}),e.jsx("span",{className:`${s?"bg-white/20":`${t.badgeBg} ${t.badgeText}`} px-1.5 py-0.5 rounded-full text-xs`,children:s?f.length:a})]},t.key)}),d==="thumbnail_quality"&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>{const t=Date.now(),a=$.map(r=>r.id);Gt.setMany(a,t,u?.id);const s={};a.forEach(r=>{s[r]=t}),pt(r=>({...r,...s}))},className:"flex items-center gap-1.5 px-3 py-2 rounded-lg text-sm font-medium bg-blue-50 text-sky-800 hover:bg-blue-100 border border-blue-200 transition-all duration-200",title:"Rafraichir toutes les vignettes visibles",children:[e.jsx(Yt,{size:14}),e.jsx("span",{className:"hidden sm:inline",children:"Rafraichir tout"})]}),e.jsxs("button",{onClick:()=>{k.size===$.length?ke(new Set):ke(new Set($.map(t=>t.id)))},className:"flex items-center gap-1.5 px-3 py-2 rounded-lg text-sm font-medium bg-gray-50 text-gray-700 hover:bg-gray-100 border border-gray-200 transition-all duration-200",title:k.size===$.length?"Tout désélectionner":"Tout sélectionner",children:[k.size===$.length?e.jsx(Zt,{size:14}):e.jsx(Kt,{size:14}),e.jsx("span",{className:"hidden sm:inline",children:k.size===$.length?"Tout désélect.":"Tout sélect."})]}),k.size>0&&e.jsxs("button",{onClick:bs,className:"flex items-center gap-1.5 px-3 py-2 rounded-lg text-sm font-medium bg-blue-50 text-blue-700 hover:bg-blue-100 border border-blue-200 transition-all duration-200",title:`Télécharger ${k.size} vignette(s)`,children:[e.jsx(Xt,{size:14}),e.jsxs("span",{className:"hidden sm:inline",children:["Télécharger (",k.size,")"]})]})]})]})]}),e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[!Q&&!T&&e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("button",{onClick:()=>{const t=!P;O(t),t&&(Z(!1),S(!1),q(null))},className:`group/filter flex items-center gap-0 py-2 rounded-full text-sm font-medium transition-all duration-300 ease-out cursor-pointer ${P?"bg-gradient-to-r from-sky-600 to-sky-700 text-white shadow-md px-3 gap-1.5":"bg-gray-50 text-gray-600 hover:bg-gray-100 px-2.5 hover:gap-1.5 hover:px-3"}`,title:"Premium",children:[e.jsx(da,{size:16,className:"flex-shrink-0"}),e.jsx("span",{className:`whitespace-nowrap overflow-hidden transition-all duration-300 ease-out ${P?"max-w-[120px] opacity-100":"max-w-0 opacity-0 group-hover/filter:max-w-[120px] group-hover/filter:opacity-100"}`,children:"Premium"}),P&&e.jsx("span",{className:"bg-white/20 px-1.5 py-0.5 rounded-full text-xs ml-0.5",children:f.filter(t=>t.Iframe_Overlay&&t.Iframe_Overlay.trim()!=="").length})]}),(V?X:p).some(t=>t.iframeVVPDrone&&t.iframeVVPDrone.trim()!=="")&&e.jsxs("button",{onClick:()=>{const t=!j;Z(t),t&&(O(!1),S(!1),q(null))},className:`group/filter2 flex items-center gap-0 py-2 rounded-full text-sm font-medium transition-all duration-300 ease-out cursor-pointer ${j?"bg-gradient-to-r from-sky-500 to-sky-600 text-white shadow-md px-3 gap-1.5":"bg-gray-50 text-gray-600 hover:bg-gray-100 px-2.5 hover:gap-1.5 hover:px-3"}`,title:"Vue aérienne",children:[e.jsx(ca,{size:16,className:"flex-shrink-0"}),e.jsx("span",{className:`whitespace-nowrap overflow-hidden transition-all duration-300 ease-out ${j?"max-w-[120px] opacity-100":"max-w-0 opacity-0 group-hover/filter2:max-w-[120px] group-hover/filter2:opacity-100"}`,children:"Vue aérienne"}),j&&e.jsx("span",{className:"bg-white/20 px-1.5 py-0.5 rounded-full text-xs ml-0.5",children:f.length})]}),u&&f.some(t=>Fe.has(t.id))&&e.jsxs("button",{onClick:()=>{const t=!E;S(t),t&&(O(!1),Z(!1),q(null),be(!1))},className:`hidden sm:flex items-center space-x-1.5 px-3 py-2 rounded-lg text-sm font-medium transition-all duration-300 ${E?"bg-gradient-to-r from-yellow-400 to-yellow-500 text-white shadow-md":"bg-gray-50 text-gray-600 hover:bg-gray-100"}`,title:"Mes favoris",children:[e.jsx(rt,{size:18,className:E?"fill-current":""}),e.jsx("span",{children:"Mes favoris"})]}),se&&f.some(t=>Oe.has(t.id))&&e.jsxs("button",{onClick:()=>{const t=!R;be(t),t&&(O(!1),Z(!1),q(null),S(!1))},className:`hidden sm:flex items-center space-x-1.5 px-3 py-2 rounded-lg text-sm font-medium transition-all duration-300 ${R?"bg-gradient-to-r from-sky-500 to-sky-600 text-white shadow-md":"bg-gray-50 text-gray-600 hover:bg-gray-100"}`,title:"Autres favoris",children:[e.jsx(rt,{size:18,className:R?"fill-current":""}),e.jsx("span",{children:"Autres favoris"})]})]}),e.jsxs("div",{className:`bg-gray-50 rounded-xl p-1 flex ${Q||T?"ml-auto":""}`,children:[e.jsxs("button",{onClick:()=>_e("grid"),className:`flex items-center space-x-0 sm:space-x-2 px-2.5 sm:px-4 py-2 rounded-lg font-medium transition-all duration-300 ${ie==="grid"?"bg-white text-[#0079AD] shadow-md":"text-gray-600 hover:text-[#0079AD]"}`,title:"Grille",children:[e.jsx(Qs,{size:18,className:ie!=="grid"?"animate-view-toggle-nudge":""}),e.jsx("span",{className:"hidden sm:inline",children:"Grille"})]}),e.jsxs("button",{onClick:()=>_e("map"),className:`flex items-center space-x-0 sm:space-x-2 px-2.5 sm:px-4 py-2 rounded-lg font-medium transition-all duration-300 ${ie==="map"?"bg-white text-[#0079AD] shadow-md":"text-gray-600 hover:text-[#0079AD]"}`,title:"Carte",children:[e.jsx(ua,{size:18,className:ie!=="map"?"animate-view-toggle-nudge":""}),e.jsx("span",{className:"hidden sm:inline",children:"Carte"})]})]})]})]}),oe?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsxs("div",{className:"flex items-center space-x-3 text-gray-400",children:[e.jsx(ee,{className:"animate-spin",size:28}),e.jsx("span",{className:"text-sm font-medium",children:"Chargement des visites..."})]})}):ie==="grid"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 mb-8",children:$.map((t,a)=>e.jsxs("div",{className:"group relative cursor-pointer rounded-2xl transition-all duration-300 transform hover:-translate-y-2 hover:shadow-2xl shadow-lg isolate",style:a<12?{animationDelay:`${a*30}ms`}:void 0,onClick:()=>Ze(t),children:[e.jsxs(Ut,{src:j&&sa(t.image)||t.image,alt:Jt(t.title,t.city),visitId:t.id||"",className:`aspect-video rounded-t-2xl overflow-hidden${d?" cursor-zoom-in":""}`,imgClassName:x.editingVisitId===(t.id||"")?"":"group-hover:scale-110 transition-transform duration-300",priority:a<6,viewpointsReady:_,viewpointsVersion:pe,isEditing:x.editingVisitId===(t.id||""),editYaw:x.editingVisitId===(t.id||"")?x.editYaw:void 0,onEditYawChange:x.setEditYaw,cacheBust:gt[t.id],children:[x.editingVisitId!==(t.id||"")&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"absolute bottom-0 left-0 right-0 h-20 pointer-events-none",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 via-black/40 to-transparent"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-gray-900/50 via-trans
16parent to-transparent"})]}),e.jsxs("div",{className:"absolute top-3 left-3 z-10 flex flex-col gap-2 items-start",children:[e.jsx($t,{categoryName:t.Sous_cat||t.subCategory||t.category||"",color:Vt(t.category),mainCategory:t.category||t.Categorie||"",size:"sm",onClick:s=>{s?.stopPropagation(),Dt(t)}}),j&&t.iframeVVPDrone&&t.iframeVVPDrone.trim()!==""&&e.jsx(Bs,{})]}),e.jsx("div",{className:"absolute top-3 right-3 z-10 group/brand",children:t.groupe&&e.jsx("button",{onClick:s=>{s.stopPropagation(),Ss(t.groupe)},children:e.jsxs("div",{className:"bg-white/95 backdrop-blur-sm rounded-full shadow-lg flex items-center h-8 pl-[5px] pr-[5px] group-hover/brand:pr-3 transition-all duration-300",children:[e.jsx("div",{className:"w-[22px] h-[22px] flex-shrink-0 flex items-center justify-center rounded-full overflow-hidden",children:e.jsx(Mt,{brandName:t.groupe,className:"w-full h-full object-contain"})}),e.jsx("span",{className:"max-w-0 overflow-hidden group-hover/brand:max-w-[150px] transition-all duration-300 text-xs font-semibold text-slate-900 whitespace-nowrap ml-0 group-hover/brand:ml-2",children:t.groupe})]})})}),(t.deliveryDate||t.Date_PDV||t.date||d==="thumbnail_quality"||!u&&Lt(t.date,t.Date_PDV))&&e.jsxs("div",{className:"absolute bottom-10 left-3 z-20 flex flex-col items-start gap-1.5",children:[d==="thumbnail_quality"&&e.jsx(qt,{visitId:t.id,visitName:t.title,visitUrl:window.location.href,onToggle:zt}),h&&(t.publishedAt||t.deliveryDate||t.Date_PDV||t.date)&&e.jsxs("div",{className:"bg-black/40 backdrop-blur-sm rounded-full shadow-md flex items-center h-5 px-1.5 gap-1",children:[e.jsx(Is,{size:10,className:"flex-shrink-0 text-white"}),e.jsx("span",{className:"text-[10px] font-semibold text-white whitespace-nowrap",children:Qt(t.publishedAt)||ea(t.deliveryDate)||Qt(t.Date_PDV||t.date)})]}),!h&&Lt(t.date,t.Date_PDV)&&e.jsxs("div",{className:"badge-nouveau bg-black/40 backdrop-blur-sm rounded-full shadow-md flex items-center h-5 px-1.5 gap-1",children:[e.jsx(Me,{size:10,className:"flex-shrink-0 text-white"}),e.jsx("span",{className:"text-[10px] font-semibold text-white whitespace-nowrap",children:"Ajout récent"})]})]})]}),d==="thumbnail_quality"&&e.jsx("div",{className:"absolute top-2 right-12 z-20",onClick:s=>{s.stopPropagation(),s.preventDefault()},children:e.jsx("button",{onClick:s=>{s.stopPropagation(),s.preventDefault(),us(t.id)},className:`w-7 h-7 rounded-md flex items-center justify-center transition-all duration-200 ${k.has(t.id)?"bg-blue-500 text-white shadow-md ring-2 ring-blue-300":"bg-black/40 backdrop-blur-sm text-white/70 hover:bg-black/60 hover:text-white"}`,title:k.has(t.id)?"Désélectionner":"Sélectionner pour téléchargement",children:k.has(t.id)?e.jsx(Zt,{size:16}):e.jsx(Kt,{size:16})})}),e.jsxs("div",{className:"absolute bottom-10 right-3 z-20 flex flex-col items-end gap-2",onClick:s=>{s.stopPropagation(),s.preventDefault()},children:[h&&Ae&&t.image&&e.jsxs("button",{onClick:s=>{s.stopPropagation(),s.preventDefault(),Ee(),Xe(t.image,t.id)},className:"group/dl p-1.5 rounded-lg backdrop-blur-sm transition-all duration-200 hover:scale-110 bg-black/40 hover:bg-black/60 text-white/80 hover:text-white",title:"Télécharger la vignette en PNG",children:[e.jsx(Xt,{size:14}),e.jsx("span",{className:"absolute right-full mr-2 top-1/2 -translate-y-1/2 px-2 py-1 bg-gray-900 text-white text-xs rounded whitespace-nowrap opacity-0 group-hover/dl:opacity-100 transition-opacity duration-200 pointer-events-none",children:"Télécharger en PNG"})]}),Ae&&d==="thumbnail_quality"&&e.jsx("button",{onClick:s=>{s.stopPropagation(),s.preventDefault(),Ee(),Gt.set(t.id,void 0,u?.id),pt(r=>({...r,[t.id]:Date.now()}))},className:"p-1.5 rounded-lg backdrop-blur-sm transition-all duration-200 hover:scale-110 bg-black/40 hover:bg-black/60 text-white/80 hover:text-white",title:"Rafraichir la vignette (bypass cache)",children:e.jsx(Yt,{size:14})}),Ae&&e.jsx(ra,{visitId:t.id||"",visitTitle:t.title,imageUrl:t.image,isEditing:x.editingVisitId===(t.id||""),isSaving:x.isSaving,onStartEdit:()=>{Ee(),x.startEdit(t.id||"")},onSave:()=>{Ee(),x.saveEdit()},onCancel:x.cancelEdit,onReset:x.resetEdit}),d!=="thumbnail_quality"&&e.jsx(qt,{visitId:t.id,visitName:t.title,visitUrl:window.location.href,onToggle:zt}),(t["Panos réalisés"]||t.nb_photos||t.photos_count)&&e.jsxs("div",{className:"group/pano flex items-center bg-black/40 backdrop-blur-sm h-6 pl-2 pr-2 group-hover/pano:pr-2.5 rounded-full text-white cursor-default",children:[e.jsx(ma,{size:12,className:"flex-shrink-0"}),e.jsx("span",{className:"font-semibold text-xs ml-1.5 flex-shrink-0",children:t["Panos réalisés"]||t.nb_photos||t.photos_count}),e.jsx("span",{className:"max-w-0 overflow-hidden group-hover/pano:max-w-[80px] transition-all duration-300 text-xs font-medium whitespace-nowrap ml-0 group-hover/pano:ml-1",children:" panoramas"})]})]}),x.editingVisitId!==(t.id||"")&&e.jsx("div",{className:"absolute inset-0 bg-black/0 group-hover:bg-sky-900/30 transition-all duration-300 flex items-center justify-center pointer-events-none",children:e.jsx("div",{className:`opacity-0 group-hover:opacity-100 transition-all duration-300 transform scale-75 group-hover:scale-100 ${d?"pointer-events-auto cursor-pointer":""}`,onClick:d?s=>{s.stopPropagation(),Ze(t)}:void 0,children:e.jsx("div",{className:"bg-white/95 backdrop-blur-sm rounded-full p-4 border border-white/50 shadow-xl",children:e.jsx(tt,{className:"text-[#0079AD]",size:32})})})})]}),t.Iframe_Overlay&&e.jsx("div",{className:"absolute -top-[11px] -left-[11px] z-20",children:e.jsx(Rt,{})}),e.jsxs("div",{className:"relative bg-white p-4 -mt-7 rounded-t-2xl z-10 rounded-b-2xl overflow-hidden",children:[e.jsx("h3",{className:"font-semibold text-sm text-gray-900 mb-2 truncate",children:t.title}),e.jsx("div",{className:"flex items-center text-gray-600 mb-3 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-1 min-w-0",children:[e.jsx(Ie,{size:12,className:"flex-shrink-0"}),e.jsx("span",{className:"text-xs font-medium truncate",children:Ft(t.city||t.location,t.address,t.department)})]})}),e.jsxs("div",{className:"flex items-center justify-between mt-3",children:[e.jsx(Os,{visit:t,canEdit:h,onShare:()=>ve(t),showAdminTools:Ae,onToggleAdminTools:cs}),e.jsxs("div",{className:"flex items-center gap-1",children:[h&&ms.has(t.id)&&e.jsx(H,{to:`/backoffice?tab=data-corrections&visitId=${t.id}`,onClick:s=>s.stopPropagation(),className:"block w-2.5 h-2.5 bg-sky-600 rounded-full animate-pulse cursor-pointer hover:scale-150 transition-transform",title:"Voir la correction en attente"}),e.jsxs("button",{onClick:s=>{s.stopPropagation(),u?h?c(t):b(t):ye(!0)},className:"group/signal relative text-gray-400 hover:text-sky-600 transition-colors duration-200 p-2",title:"Signaler une erreur",children:[e.jsx(Wt,{size:14}),e.jsx("span",{className:"absolute left-1/2 -translate-x-1/2 bottom-full mb-1 px-2 py-1 bg-gray-900 text-white text-xs rounded whitespace-nowrap opacity-0 group-hover/signal:opacity-100 transition-opacity duration-200 pointer-events-none",children:"Signaler"})]})]})]})]}),h&&d&&I[t.id]&&I[t.id].length>0&&e.jsx("div",{className:"px-4 pb-4 -mt-1 space-y-2",onClick:s=>s.stopPropagation(),children:I[t.id].map(s=>{const r=es[s.report_type]||es.data_quality;return e.jsxs("div",{className:`${r.bg} border ${r.border} rounded-lg p-2.5`,children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[e.jsx("span",{className:`text-xs font-bold ${r.text} px-2 py-0.5 rounded-full border ${r.border}`,children:r.label}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:()=>{Ve===s.id?(De(null),we("")):(De(s.id),we(s.description||""))},className:`flex items-center gap-1 px-2 py-1 rounded-md text-xs font-medium transition-all border ${Ve===s.id?"bg-blue-50 text-sky-800 border-blue-200":"bg-white/70 text-gray-500 hover:text-sky-700 hover:bg-blue-50 border-gray-200 hover:border-blue-200"}`,title:s.description?"Modifier la remarque":"Ajouter une remarque",children:e.jsx(At,{size:12})}),e.jsxs("button",{onClick:()=>gs(s.id,t.id,s.report_type),disabled:it===s.id,className:"flex items-center gap-1 px-2 py-1 rounded-md text-xs font-medium transition-all bg-emerald-50 text-emerald-700 hover:bg-emerald-100 border border-emerald-200 disabled:opacity-50",children:[it===s.id?e.jsx(ee,{size:12,className:"animate-spin"}):e.jsx(Et,{size:12}),e.jsx("span",{children:"Regle"})]})]})]}),s.description&&Ve!==s.id&&e.jsx("p",{className:"text-xs text-gray-700 mb-1 leading-relaxed",children:s.description}),Ve===s.id&&e.jsxs("div",{className:"mt-1.5 mb-1.5 flex gap-1.5",children:[e.jsx("input",{type:"text",value:je,onChange:i=>we(i.target.value),onKeyDown:i=>{i.key==="Enter"&&je.trim()?Nt(s.id,t.id):i.key==="Escape"&&(De(null),we(""))},placeholder:"Ajouter une remarque...",className:"flex-1 text-xs px-2.5 py-1.5 rounded-md border border-gray-300 focus:border-sky-500 focus:ring-1 focus:ring-sky-500 outline-none bg-white",autoFocus:!0}),e.jsx("button",{onClick:()=>Nt(s.id,t.id),disabled:!je.trim()||dt===s.id,className:"flex items-center gap-1 px-2.5 py-1.5 rounded-md text-xs font-medium bg-sky-600 text-white hover:bg-sky-700 transition-colors disabled:opacity-40",children:dt===s.id?e.jsx(ee,{size:12,className:"animate-spin"}):e.jsx(ss,{size:12})})]}),e.jsxs("div",{className:"flex items-center flex-wrap gap-x-3 gap-y-1 text-[10px] text-gray-500",children:[s.requested_by_name&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ms,{size:10}),s.requested_by_name]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx($s,{size:10}),new Date(s.created_at).toLocaleDateString("fr-FR",{day:"numeric",month:"short"})," a ",new Date(s.created_at).toLocaleTimeString("fr-FR",{hour:"2-digit",minute:"2-digit"})]}),s.description&&e.jsxs("span",{className:"flex items-center gap-1 italic",children:[e.jsx(At,{size:10}),"Commente par ",s.requested_by_name||"admin"]})]})]},s.id)})}),h&&d==="exclude"&&e.jsx("div",{className:"px-4 pb-3 -mt-1",onClick:s=>s.stopPropagation(),children:e.jsxs("button",{onClick:()=>hs(t.id,t.title),disabled:ut===t.id,className:`w-full flex items-center justify-center gap-2 px-3 py-2 rounded-lg text-xs font-semibold transition-all border ${G.has(t.id)?"bg-red-50 text-red-700 border-red-200 hover:bg-red-100":"bg-gray-50 text-gray-600 border-gray-200 hover:bg-red-50 hover:text-red-600 hover:border-red-200"}
16 disabled:opacity-50`,title:G.has(t.id)?"Rendre visible sur le site":"Masquer cette visite du site",children:[ut===t.id?e.jsx(ee,{size:14,className:"animate-spin"}):G.has(t.id)?e.jsx(tt,{size:14}):e.jsx(qe,{size:14}),e.jsx("span",{children:G.has(t.id)?"Visite masquee - Cliquer pour rendre visible":"Exclure cette visite du site"})]})}),h&&T&&t.approved===!1&&e.jsx("div",{className:"px-4 pb-3 -mt-1",onClick:s=>s.stopPropagation(),children:e.jsxs("button",{onClick:()=>xs(t.id),disabled:ft===t.id,className:"w-full flex items-center justify-center gap-2 px-3 py-2.5 rounded-lg text-xs font-semibold transition-all border bg-teal-50 text-teal-700 border-teal-200 hover:bg-teal-100 hover:border-teal-300 disabled:opacity-50",children:[ft===t.id?e.jsx(ee,{size:14,className:"animate-spin"}):e.jsx(Et,{size:14}),e.jsx("span",{children:"Valider - Rendre visible pour tous"})]})})]},t.id))}),e.jsx("div",{ref:vs,className:"h-20 flex items-center justify-center",children:ce&&e.jsxs("div",{className:"flex items-center space-x-2 text-[#0079AD]",children:[e.jsx(ee,{className:"animate-spin",size:24}),e.jsx("span",{className:"text-sm font-medium",children:"Chargement..."})]})})]}):e.jsx(Hs,{visits:f,onVisitSelect:_s}),f.length===0&&!oe&&e.jsxs("div",{className:"pt-4 pb-8",children:[e.jsxs("div",{className:"flex flex-col items-center mb-6",children:[e.jsx("div",{className:"relative mb-3",children:e.jsx("div",{className:"w-12 h-12 rounded-full bg-gradient-to-br from-blue-50 to-blue-50 flex items-center justify-center border border-blue-100",children:e.jsx(Me,{size:22,className:"text-sky-500"})})}),e.jsx("p",{className:"text-sm text-gray-500 max-w-lg text-center leading-relaxed",children:"Nous n'avons pas trouvé de correspondance exacte, mais voici quelques établissements qui pourraient vous plaire :"})]}),Ct.length>0&&e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6 mb-10",children:Ct.map(t=>e.jsxs("div",{className:"group relative cursor-pointer rounded-2xl transition-all duration-300 transform hover:-translate-y-2 hover:shadow-2xl shadow-lg isolate",onClick:()=>Ze(t),children:[e.jsxs(Ut,{src:t.image,alt:Jt(t.title,t.city),visitId:t.id||"",className:"aspect-video rounded-t-2xl overflow-hidden",imgClassName:"group-hover:scale-110 transition-transform duration-300",priority:!1,viewpointsReady:_,viewpointsVersion:pe,isEditing:!1,cacheBust:gt[t.id],children:[e.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-20 pointer-events-none",children:e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 via-black/40 to-transparent"})}),e.jsx("div",{className:"absolute top-3 left-3 z-10",children:e.jsx($t,{categoryName:t.Sous_cat||t.subCategory||t.category||"",color:Vt(t.category),mainCategory:t.category||t.Categorie||"",size:"sm",onClick:a=>{a?.stopPropagation(),Dt(t)}})}),t.groupe&&e.jsx("div",{className:"absolute top-3 right-3 z-10",children:e.jsx("div",{className:"bg-white/95 backdrop-blur-sm rounded-full shadow-lg flex items-center h-8 px-[5px]",children:e.jsx("div",{className:"w-[22px] h-[22px] flex-shrink-0 flex items-center justify-center rounded-full overflow-hidden",children:e.jsx(Mt,{brandName:t.groupe,className:"w-full h-full object-contain"})})})}),e.jsx("div",{className:"absolute inset-0 bg-black/0 group-hover:bg-sky-900/30 transition-all duration-300 flex items-center justify-center pointer-events-none",children:e.jsx("div",{className:"opacity-0 group-hover:opacity-100 transition-all duration-300 transform scale-75 group-hover:scale-100",children:e.jsx("div",{className:"bg-white/95 backdrop-blur-sm rounded-full p-3 border border-white/50 shadow-xl",children:e.jsx(tt,{className:"text-[#0079AD]",size:24})})})})]}),t.Iframe_Overlay&&e.jsx("div",{className:"absolute -top-[11px] -left-[11px] z-20",children:e.jsx(Rt,{})}),e.jsxs("div",{className:"relative bg-white p-3 -mt-7 rounded-t-2xl z-10 rounded-b-2xl overflow-hidden",children:[e.jsx("h3",{className:"font-semibold text-sm text-gray-900 mb-1.5 truncate",children:t.title}),e.jsxs("div",{className:"flex items-center text-gray-600 min-w-0",children:[e.jsx(Ie,{size:12,className:"flex-shrink-0 mr-1"}),e.jsx("span",{className:"text-xs font-medium truncate",children:Ft(t.city||t.location,t.address,t.department)})]})]})]},t.id))}),(V||d||P||j||E||R||T)&&e.jsx("div",{className:"flex justify-center",children:e.jsx("button",{onClick:()=>{q(null),O(!1),Z(!1),S(!1),be(!1),He(!1),setShowDuplicatesOnly(!1)},className:"px-5 py-2.5 text-sm font-medium text-gray-700 bg-gray-100 hover:bg-gray-200 rounded-lg transition-colors duration-200",children:"Réinitialiser les filtres"})})]})]})}),e.jsxs("section",{className:"relative bg-gray-900 overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-[0.03]",style:{backgroundImage:`url("data:image/svg+xml,%3Csvg width='60' height='60' viewB
16ox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")`}}),e.jsx("div",{className:"absolute top-0 right-0 w-[500px] h-[500px] bg-sky-600/5 rounded-full -translate-y-1/2 translate-x-1/3"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-[400px] h-[400px] bg-sky-600/5 rounded-full translate-y-1/2 -translate-x-1/3"}),e.jsxs("div",{className:"relative max-w-6xl mx-auto px-6 sm:px-8 lg:px-12 py-16 md:py-24",children:[e.jsx("h2",{className:"text-xl sm:text-2xl lg:text-[1.75rem] font-bold text-white leading-[1.2] tracking-tight mb-8",children:"Visitez virtuellement avant de vous déplacer"}),e.jsxs("div",{className:"space-y-4 text-gray-400 text-sm sm:text-base leading-relaxed",children:[e.jsx("p",{children:"Bienvenue sur l'espace de recherche de Webvisite. Nous avons conçu cet outil pour vous permettre de flâner librement parmi des milliers de lieux capturés en immersion. Notre mission est de vous offrir une transparence totale : découvrez l'ambiance, les infrastructures et les services d'un établissement depuis votre écran pour préparer sereinement vos prochaines sorties."}),e.jsxs("p",{children:["Que vous souhaitiez explorer l'agencement d'une"," ",e.jsx(H,{to:"/visite-virtuelle/secteurs/service/centre-de-fitness",className:"text-gray-300 underline underline-offset-2 decoration-gray-600 hover:text-sky-500 hover:decoration-sky-500 transition-colors",children:"salle de sport"})," ","pour vérifier ses équipements, choisir la table idéale dans un"," ",e.jsx(H,{to:"/visite-virtuelle/secteurs/bar-ou-restaurant/restaurant",className:"text-gray-300 underline underline-offset-2 decoration-gray-600 hover:text-sky-500 hover:decoration-sky-500 transition-colors",children:"restaurant"})," ","au décor soigné, ou encore visiter les chambres d'un"," ",e.jsx(H,{to:"/visite-virtuelle/secteurs/hebergement/hotel",className:"text-gray-300 underline underline-offset-2 decoration-gray-600 hover:text-sky-500 hover:decoration-sky-500 transition-colors",children:"hôtel"})," ","avant de réserver votre séjour, tout est ici à portée de clic. L'immersion à 360° efface les distances et vous permet de choisir vos destinations avec confiance."]}),e.jsxs("p",{children:["Grâce à notre moteur de recherche, vous pouvez affiner votre découverte par"," ",e.jsx(H,{to:"/visite-virtuelle/regions",className:"text-gray-300 underline underline-offset-2 decoration-gray-600 hover:text-sky-500 hover:decoration-sky-500 transition-colors",children:"région"}),", par"," ",e.jsx(H,{to:"/visite-virtuelle/departements",className:"text-gray-300 underline underline-offset-2 decoration-gray-600 hover:text-sky-500 hover:decoration-sky-500 transition-colors",children:"département"})," ","ou directement par ville. Retrouvez également vos"," ",e.jsx(H,{to:"/visite-virtuelle/marque",className:"text-gray-300 underline underline-offset-2 decoration-gray-600 hover:text-sky-500 hover:decoration-sky-500 transition-colors",children:"marques favorites"})," ","et leurs points de vente partenaires. Chaque"," ",e.jsx(H,{to:"/visite-virtuelle/secteurs",className:"text-gray-300 underline underline-offset-2 decoration-gray-600 hover:text-sky-500 hover:decoration-sky-500 transition-colors",children:"visite virtuelle"})," ","est une invitation à la découverte, un moment de calme pour explorer les détails qui comptent pour vous. Que ce soit pour un futur achat, une réservation ou une simple curiosité technologique, Webvisite vous accompagne dans cette exploration visuelle unique."]})]})]})]}),e.jsx(Fs,{}),as&&e.jsx("button",{onClick:js,className:`fixed right-8 z-50 bg-black/40 backdrop-blur-sm text-white w-12 h-12 flex items-center justify-center rounded-full shadow-lg transition-all duration-300 hover:bg-black/60 hover:shadow-xl hover:scale-110 animate-in fade-in slide-in-from-bottom-4 ${os?"bottom-24":"bottom-8"}`,"aria-label":"Retour en haut",children:e.jsx(xa,{size:24})}),n&&e.jsx(Js,{project:n,onClose:()=>W(null)}),D&&e.jsx(Ys,{isOpen:!!D,onClose:()=>he(null),title:D.title,tourUrl:D.url,shareUrl:D.shareUrl,shareTitle:D.shareTitle,visitSlug:D.visitSlug}),o&&e.jsx(Xs,{visit:o,existingCorrections:I[o.id]||[],onClose:()=>{c(null),Re()}}),w&&e.jsx(Ks,{visitId:w.id,visitTitle:w.Titre||w.title||"",onClose:()=>b(null)}),K&&e.jsx(Zs,{variant:"report",onClose:()=>ye(!1)}),y&&e.jsx(Ws,{visit:y,onClose:()=>ve(null)}),mt&&d&&(()=>{const t=$.find(a=>a.id===mt);return t?.image?e.jsxs("div",{className:"fixed inset-0 z-[60] flex items-center justify-center cursor-zoom-out",onClick:wt,children:[e.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),e.jsxs("div",{className:"relative max-w-[80vw] max-h-[85vh]",onClick:a=>a.stopPropagation(),children:[e.jsx("button",{onClick:wt,className:"absolute -top-3 -right-3 z-10 w-8 h-8 rounded-full bg-white shadow-lg flex items-center justify-center text-gray-600 hover:text-gray-900 hover:bg-gray-100 transition-colors",children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),e.jsxs("div",{className:"rounded-2xl overflow-hidden shadow-2xl bg-white",children:[e.jsx("img",{src:t.image,alt:`Visite virtuelle 360 - ${t.title}${t.city?`, ${t.city}`:""}`,loading:"lazy",className:"block max-w-[80vw] max-h-[75vh] object-contain bg-gray-50"}),e.jsxs("div",{className:"px-4 py-3 bg-white border-t border-gray-100",children:[e.jsx("p",{className:"text-sm font-semibold text-gray-800 truncate",children:t.title}),t.city&&e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:t.city})]})]})]})]}):null})(),Ne&&e.jsxs("div",{className:"fixed inset-0 z-[70] flex items-center justify-center",onClick:()=>Te(null),children:[e.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),e.jsxs("div",{className:"relative bg-white rounded-2xl shadow-2xl w-full max-w-md mx-4 overflow-hidden",onClick:t=>t.stopPropagation(),children:[e.jsx("div",{className:"bg-red-50 px-6 py-4 border-b border-red-100",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"bg-red-100 rounded-full p-2",children:e.jsx(qe,{size:18,className:"text-red-600"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-gray-900 text-sm",children:"Masquer cette visite"}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5 truncate max-w-[280px]",children:Ne.visitTitle})]})]})}),e.jsxs("div",{className:"px-6 py-5",children:[e.jsxs("label",{className:"block text-sm font-semibold text-gray-700 mb-2",children:["Raison du masquage ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("textarea",{value:me,onChange:t=>Ge(t.target.value),placeholder:"Expliquez pourquoi cette visite doit etre masquee...",className:"w-full px-3 py-2.5 border border-gray-200 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-red-200 focus:border-red-300 resize-none",rows:3,autoFocus:!0}),me.trim().length===0&&e.jsxs("p",{className:"text-xs text-red-400 mt-1.5 flex items-center gap-1",children:[e.jsx(Wt,{size:10}),"Une explication est obligatoire"]})]}),e.jsxs("div",{className:"px-6 py-4 bg-gray-50 border-t border-gray-100 flex items-center justify-end gap-3",children:[e.jsx("button",{onClick:()=>Te(null),className:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800 transition-colors",children:"Annuler"}),e.jsxs("button",{onClick:fs,disabled:!me.trim(),className:"px-5 py-2 bg-red-500 hover:bg-red-600 disabled:bg-gray-300 disabled:cursor-not-allowed text-white text-sm font-semibold rounded-lg transition-colors flex items-center gap-2",children:[e.jsx(qe,{size:14}),"Masquer du site"]})]})]})]})]})};export{Yr 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.