PageSourceSearch

https://office-supply-connect.lovable.app/assets/CategoryPage-B2sXIDJ5.js

js office-supply-connect.lovable.app collected 2026-10-03 03:34:27 UTC 20,732 bytes, 11 lines download raw bytes

1import{c as he,r as a,j as e,a1 as I,B as M,p as je,T as oe,a2 as W,X as H,a3 as Y,a4 as B,a5 as ee,a6 as se,a7 as J,I as de,a8 as me,a9 as Ne,s as ge,aa as ve,ab as be,ac as we,A as ye,L as te,a0 as le,C as ke,e as Se,ad as ze,ae as Fe,o as ae,af as Le,ag as $e,ah as Me}from"./index-CSZt44S3.js";import{P as Pe}from"./ProductCard-DTrURvwk.js";import{S as Ee,a as Ie,b as Ce,c as _e,d as re}from"./select-BsvOSc3O.js";import{S as Te}from"./slider-C5XDXaok.js";import{u as Oe,a as qe,f as K,g as Re}from"./useFilters-D00VTlUy.js";import{S as Ve}from"./sliders-horizontal-DZsPuxTE.js";import{S as He}from"./share-2-CbRRSrAA.js";import{F as De}from"./filter-DfH1hO3v.js";import"./PayPalMessage-BcdWrc4t.js";import"./timer-BQ0EKjor.js";import"./dialog-6oDXanGQ.js";import"./textarea-CrLZB4wF.js";import"./GdprConsentCheckbox-u8efYSvD.js";import"./circle-check-big-DIp3DS3p.js";import"./send-B1VgYsSr.js";import"./lock-C8f0b0J1.js";import"./map-pin-BCOXoOdl.js";import"./eye-mHpaLqZM.js";/**
2 * @license lucide-react v0.462.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 xe=he("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
7 * @license lucide-react v0.462.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 Ue=he("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);function Ge({products:f,loading:i,hasMore:h,onLoadMore:p,totalCount:j,viewMode:o,onViewModeChange:F,sortBy:x,onSortChange:u}){const c=a.useRef(null);return a.useEffect(()=>{const l=new IntersectionObserver(L=>{L[0].isIntersecting&&h&&!i&&p()},{threshold:.1,rootMargin:"100px"}),v=c.current;return v&&l.observe(v),()=>{v&&l.unobserve(v)}},[h,i,p]),i&&f.length===0?e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx(I,{className:"h-5 w-32"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(I,{className:"h-9 w-32"}),e.jsx(I,{className:"h-9 w-20"})]})]}),e.jsx("div",{className:o==="grid"?"product-grid":"space-y-4",children:Array.from({length:12}).map((l,v)=>e.jsxs("div",{className:o==="list"?"flex gap-4":"",children:[e.jsx(I,{className:o==="grid"?"aspect-square w-full":"w-40 h-40 shrink-0"}),o==="list"&&e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(I,{className:"h-4 w-20"}),e.jsx(I,{className:"h-5 w-3/4"}),e.jsx(I,{className:"h-4 w-1/2"}),e.jsx(I,{className:"h-8 w-24"})]}),o==="grid"&&e.jsxs("div",{className:"space-y-2 mt-3",children:[e.jsx(I,{className:"h-3 w-16"}),e.jsx(I,{className:"h-4 w-full"}),e.jsx(I,{className:"h-6 w-20"})]})]},v))})]}):!i&&f.length===0?e.jsxs("div",{className:"text-center py-16 bg-card rounded-lg border",children:[e.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:e.jsx(xe,{className:"h-8 w-8 text-muted-foreground"})}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Nessun prodotto trovato"}),e.jsx("p",{className:"text-muted-foreground max-w-md mx-auto",children:"Prova a modificare i filtri di ricerca o rimuovi alcuni criteri per vedere più risultati."})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-4 pb-4 border-b",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.jsx("span",{className:"font-semibold text-foreground",children:j.toLocaleString("it-IT")})," prodotti trovati"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(Ee,{value:x,onValueChange:u,children:[e.jsx(Ie,{className:"w-[180px] h-9",children:e.jsx(Ce,{placeholder:"Ordina per"})}),e.jsxs(_e,{children:[e.jsx(re,{value:"name-asc",children:"Nome A-Z"}),e.jsx(re,{value:"name-desc",children:"Nome Z-A"}),e.jsx(re,{value:"price-asc",children:"Prezzo crescente"}),e.jsx(re,{value:"price-desc",children:"Prezzo decrescente"})]})]}),e.jsxs("div",{className:"flex border rounded-md",children:[e.jsx(M,{variant:o==="grid"?"secondary":"ghost",size:"icon",className:"h-9 w-9 rounded-r-none",onClick:()=>F("grid"),children:e.jsx(xe,{className:"h-4 w-4"})}),e.jsx(M,{variant:o==="list"?"secondary":"ghost",size:"icon",className:"h-9 w-9 rounded-l-none",onClick:()=>F("list"),children:e.jsx(Ue,{className:"h-4 w-4"})})]})]})]}),e.jsx("div",{className:o==="grid"?"product-grid":"space-y-4",children:f.map(l=>
11e.jsx(Pe,{product:l,viewMode:o},l.id))}),e.jsxs("div",{ref:c,className:"h-20 flex items-center justify-center mt-8",children:[i&&f.length>0&&e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx(je,{className:"h-5 w-5 animate-spin"}),e.jsx("span",{className:"text-sm",children:"Caricamento..."})]}),!h&&f.length>0&&e.jsxs("p",{className:"text-sm text-muted-foreground bg-muted px-4 py-2 rounded-full",children:["Hai visualizzato tutti i ",j," prodotti"]})]})]})}function ue({categories:f,brands:i,selectedCategory:h,selectedBrand:p,onCategoryChange:j,onBrandChange:o,loading:F,minPrice:x=0,maxPrice:u=1e3,priceRange:c,onPriceChange:l,showPriceFilter:v=!1,availability:L="all",onAvailabilityChange:n,showAvailabilityFilter:C=!1,showBestsellerOnly:S=!1,onBestsellerChange:N}){const[q,U]=a.useState(!0),[r,D]=a.useState(!0),[w,_]=a.useState(!0),[T,P]=a.useState(!0),[y,d]=a.useState([x,u]);a.useEffect(()=>{d(c||[x,u])},[c,x,u]);const E=h||p||c||L!=="all"||S,G=()=>{j(null),o(null),l==null||l(void 0),n==null||n("all"),N==null||N(!1),d([x,u])},k=s=>{switch(s){case"available":return"Disponibile";case"unavailable":return"Esaurito";default:return"Tutti"}},b=s=>{const g=[s[0],s[1]];d(g)},O=s=>{const g=[s[0],s[1]];l==null||l(g)},$=s=>{const g=Number(s.target.value)||0,V=[Math.min(g,y[1]),y[1]];d(V),l==null||l(V)},R=s=>{const g=Number(s.target.value)||u,V=[y[0],Math.max(g,y[0])];d(V),l==null||l(V)},m=s=>new Intl.NumberFormat("it-IT",{style:"currency",currency:"EUR"}).format(s);return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:`flex items-center gap-2 p-3 rounded-lg border cursor-pointer transition-colors ${S?"bg-[hsl(var(--stock-low)/0.1)] border-[hsl(var(--stock-low)/0.3)]":"hover:bg-muted"}`,onClick:()=>N==null?void 0:N(!S),children:[e.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center ${S?"bg-[hsl(var(--stock-low)/0.2)]":"bg-muted"}`,children:e.jsx(oe,{className:`h-4 w-4 ${S?"text-[hsl(var(--stock-low))]":"text-muted-foreground"}`})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"Solo Bestseller"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"I più venduti"})]}),e.jsx(W,{checked:S,onCheckedChange:s=>N==null?void 0:N(!!s)})]}),E&&e.jsxs("div",{className:"pb-4 border-b",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-sm font-medium",children:"Filtri attivi"}),e.jsx(M,{variant:"ghost",size:"sm",onClick:G,className:"h-7 text-xs",children:"Rimuovi tutti"})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[h&&e.jsxs(M,{variant:"secondary",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>j(null),children:[h,e.jsx(H,{className:"h-3 w-3"})]}),p&&e.jsxs(M,{variant:"secondary",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>o(null),children:[p,e.jsx(H,{className:"h-3 w-3"})]}),c&&e.jsxs(M,{variant:"secondary",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>{l==null||l(void 0),d([x,u])},children:[m(c[0])," - ",m(c[1]),e.jsx(H,{className:"h-3 w-3"})]}),L!=="all"&&e.jsxs(M,{variant:"secondary",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>n==null?void 0:n("all"),children:[k(L),e.jsx(H,{className:"h-3 w-3"})]}),S&&e.jsxs(M,{variant:"secondary",size:"sm",className:"h-7 text-xs gap-1 bg-[hsl(var(--stock-low)/0.1)] text-[hsl(var(--stock-low))]",onClick:()=>N==null?void 0:N(!1),children:[e.jsx(oe,{className:"h-3 w-3"}),"Bestseller",e.jsx(H,{className:"h-3 w-3"})]})]})]}),v&&e.jsxs(Y,{open:w,onOpenChange:_,children:[e.jsxs(B,{className:"flex items-center justify-between w-full py-3 filter-title",children:["Prezzo",e.jsx(ee,{className:`h-4 w-4 transition-transform ${w?"rotate-180":""}`})]}),e.jsx(se,{children:e.jsxs("div",{className:"space-y-4 pb-4",children:[e.jsx(Te,{value:y,min:x,max:u,step:1,onValueChange:b,onValueCommit:O,className:"w-full"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx(J,{className:"text-xs text-muted-foreground mb-1 block",children:"Min"}),e.jsx(de,{type:"number",value:y[0],onChange:$,className:"h-8 text-sm",min:x,max:y[1]})]}),e.jsx("span",{className:"text-muted-foreground mt-5",children:"—"}),e.jsxs("div",{className:"flex-1",children:[e.jsx(J,{className:"text-xs text-muted-foreground mb-1 block",children:"Max"}),e.jsx(de,{type:"number",value:y[1],onChange:R,className:"h-8 text-sm",min:y[0],max:u})]})]})]})})]}),C&&e.jsxs(Y,{open:T,onOpenChange:P,children:[e.jsxs(B,{className:"flex items-center justify-between w-full py-3 filter-title border-t",children:["Disponibilità",e.jsx(ee,{className:`h-4 w-4 transition-transform ${T?"rotate-180":""}`})]}),e.jsx(se,{children:e.jsx("div",{className:"space-y-2 pb-2",children:["all","available","unavailable"].map(s=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(W,{id:`availability-${s}`,checked:L===s,onCheckedChange:g=>{g&&(n==null||n(s))}}),e.jsx(J,{htmlFor:`availability-${s}`,className:"text-sm cursor-pointer flex-1",children:k(s)})]},s))})})]}),e.jsxs(Y,{open:q,onOpenChange:U,children:[e.jsxs(B,{className:`flex items-center justify-between w-full py-3 filter-title ${v||C?"border-t":""}`,children:["Categorie",e.jsx(ee,{className:`h-4 w-4 transition-transform ${q?"rotate-180":""}`})]}),e.jsx(se,{children:e.jsx(me,{className:"h-[200px] pr-4",children:e.jsx("div",{className:"space-y-2 pb-2",children:f.map(s=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(W,{id:`cat-${s.id}`,checked:h===s.id,onCheckedChange:g=>j(g?s.id:null)}),e.jsxs(J,{htmlFor:`cat-${s.id}`,className:"text-sm cursor-pointer flex-1 flex justify-between",children:[e.jsx("span",{className:"truncate",children:s.label}),e.jsxs("span",{className:"text-muted-foreground text-xs ml-2",children:["(",s.count,")"]})]})]},s.id))})})})]}),e.jsxs(Y,{open:r,onOpenChange:D,children:[e.jsxs(B,{className:"flex items-center justify-between w-full py-3 filter-title border-t",children:["Brand",e.jsx(ee,{className:`h-4 w-4 transition-transform ${r?"rotate-180":""}`})]}),e.jsx(se,{children:e.jsx(me,{className:"h-[200px] pr-4",children:e.jsx("div",{className:"space-y-2 pb-2",children:i.map(s=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(W,{id:`brand-${s.name}`,checked:p===s.name,onCheckedChange:g=>o(g?s.name:null)}),e.jsxs(J,{htmlFor:`brand-${s.name}`,className:"text-sm cursor-pointer flex-1 flex justify-between",children:[e.jsx("span",{className:"truncate",children:s.name}),e.jsxs("span",{className:"text-muted-foreground text-xs ml-2",children:["(",s.count,")"]})]})]},s.name))})})})]})]})}function Ae(f={}){const{pageSize:i=24,category:h,brand:p,search:j,minPrice:o,maxPrice:F,sortBy:x="name-asc",availability:u="all",bestsellerOnly:c=!1}=f,[l,v]=a.useState([]),[L,n]=a.useState(!0),[C,S]=a.useState(null),[N,q]=a.useState(!0),[U,r]=a.useState(0),[D,w]=a.useState(0),{bestsellerIds:_,fetchBestsellers:T,loaded:P}=Ne(),y=a.useRef(!0),d=a.useRef({category:h,brand:p,search:j,minPrice:o,maxPrice:F,sortBy:x,availability:u,bestsellerOnly:c});a.useEffect(()=>{c&&!P&&T()},[c,P,T]);const E=a.useCallback(async(b,O=!1)=>
11{if(!(c&&!P))try{n(!0),S(null);let $="name",R=!0;x==="name-desc"?($="name",R=!1):x==="price-asc"?($="recommended_sale_price",R=!0):x==="price-desc"&&($="recommended_sale_price",R=!1);let m=ge.from("products_cache").select("*",{count:"exact"}).order($,{ascending:R}).range(b*i,(b+1)*i-1);if(h&&(m=m.eq("product_category",h)),p&&(m=m.eq("brand",p)),j&&(m=m.or(`name.ilike.%${j}%,sku.ilike.%${j}%,description.ilike.%${j}%`)),o!==void 0&&(m=m.gte("recommended_sale_price",o)),F!==void 0&&(m=m.lte("recommended_sale_price",F)),u==="available"?m=m.eq("is_active",!0):u==="unavailable"&&(m=m.eq("is_active",!1)),c&&_.size>0){const A=Array.from(_);m=m.in("id",A)}const{data:s,error:g,count:V}=await m;if(g)throw g;const X=s||[];v(O?A=>[...A,...X]:X),w(V||0),q(X.length===i)}catch($){S($ instanceof Error?$.message:"Errore nel caricamento prodotti")}finally{n(!1)}},[i,h,p,j,o,F,x,u,c,_,P]);a.useEffect(()=>{const b=d.current.category!==h||d.current.brand!==p||d.current.search!==j||d.current.minPrice!==o||d.current.maxPrice!==F||d.current.sortBy!==x||d.current.availability!==u||d.current.bestsellerOnly!==c,O=c&&P;(b||y.current||c&&O)&&(d.current={category:h,brand:p,search:j,minPrice:o,maxPrice:F,sortBy:x,availability:u,bestsellerOnly:c},r(0),E(0,!1),y.current=!1)},[h,p,j,o,F,x,u,c,P,E]);const G=a.useCallback(()=>{if(!L&&N){const b=U+1;r(b),E(b,!0)}},[L,N,U,E]),k=a.useCallback(()=>{r(0),E(0,!1)},[E]);return{products:l,loading:L,error:C,hasMore:N,loadMore:G,refresh:k,totalCount:D}}const ds=()=>{const{slug:f}=ve(),[i,h]=be(),{toast:p}=we(),j=i.get("brand"),o=i.get("sort")||"name-asc",F=i.get("view")||"grid",x=i.get("minPrice")?Number(i.get("minPrice")):void 0,u=i.get("maxPrice")?Number(i.get("maxPrice")):void 0,c=i.get("q")||"",l=i.get("availability")||"all",[v,L]=a.useState(c),[n,C]=a.useState(j),[S,N]=a.useState(F),[q,U]=a.useState(o),[r,D]=a.useState(x!==void 0&&u!==void 0?[x,u]:void 0),[w,_]=a.useState(l),{categories:T,getCategoryBySlug:P,getParentCategory:y}=Oe(),{brands:d,loading:E}=qe(),G=a.useCallback(t=>{const z=new URLSearchParams(i);Object.entries(t).forEach(([ne,Q])=>{Q===null||Q===""||Q===void 0?z.delete(ne):z.set(ne,Q)}),z.get("sort")==="name-asc"&&z.delete("sort"),z.get("view")==="grid"&&z.delete("view"),z.get("availability")==="all"&&z.delete("availability"),h(z,{replace:!0})},[i,h]);a.useEffect(()=>{var t,z;G({brand:n,sort:q,view:S,minPrice:((t=r==null?void 0:r[0])==null?void 0:t.toString())||null,maxPrice:((z=r==null?void 0:r[1])==null?void 0:z.toString())||null,q:v||null,availability:w})},[n,q,S,r,v,w,G]);const k=a.useMemo(()=>f?P(f):null,[f,P]),b=a.useMemo(()=>f?y(f):null,[f,y]),O=b!==void 0,$=k!=null&&k.name?K(k.name):"Categoria",R=a.useMemo(()=>{if(O)return[];const t=T.find(z=>z.slug===f);return(t==null?void 0:t.subcategories)||[]},[T,f,O]),m=a.useMemo(()=>O&&b?b.subcategories.map(t=>({id:t.name,label:K(t.name),count:t.count})):T.slice(0,15).map(t=>({id:t.name,label:K(t.name),count:t.count})),[T,b,O]),{products:s,loading:g,hasMore:V,loadMore:X,totalCount:A}=Ae({search:v,category:k==null?void 0:k.name,brand:n,sortBy:q,minPrice:r==null?void 0:r[0],maxPrice:r==null?void 0:r[1],availability:w}),ie=t=>{t&&(window.location.href=`/category/${Re(t)}`)},ce=t=>{D(t)},fe=async()=>{const t=window.location.href;try{await navigator.clipboard.writeText(t),p({title:"Link copiato!",description:"Il link con i filtri è stato copiato negli appunti."})}catch{p({variant:"destructive",title:"Errore",description:"Impossibile copiare il link."})}},Z=[n,r,w!=="all"?w:null].filter(Boolean).length,pe=()=>{C(null),D(void 0),_("all")};return e.jsxs(ye,{onSearch:L,searchValue:v,children:[e.jsx("div",{className:"bg-muted/50 border-b",children:e.jsx("div",{className:"container py-3",children:e.jsxs("nav",{className:"flex items-center text-sm text-muted-foreground",children:[e.jsx(te,{to:"/",className:"hover:text-foreground transition-colors",children:"Home"}),e.jsx(le,{className:"h-4 w-4 mx-2"}),e.jsx(te,{to:"/categories",className:"hover:text-foreground transition-colors",children:"Categorie"}),b&&e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"h-4 w-4 mx-2"}),e.jsx(te,{to:`/category/${b.slug}`,className:"hover:text-foreground transition-colors",children:K(b.name)})]}),e.jsx(le,{className:"h-4 w-4 mx-2"}),e.jsx("span",{className:"text-foreground font-medium",children:$})]})})}),e.jsx("div",{className:"bg-gradient-to-r from-primary/10 to-primary/5 border-b",children:e.jsxs("div",{className:"container py-6",children:[e.jsx("h1",{className:"text-2xl md:text-3xl font-bold text-foreground mb-2",children:$}),e.jsxs("p",{className:"text-muted-foreground",children:[(k==null?void 0:k.count)||A," prodotti disponibili"]})]})}),R.length>0&&e.jsxs("div",{className:"container py-6 border-b",children:[e.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Sottocategorie"}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-3",children:R.map(t=>e.jsx(te,{to:`/category/${t.slug}`,className:"group",children:e.jsx(ke,{className:"h-full transition-all hover:shadow-md hover:-translate-y-0.5",children:e.jsxs(Se,{className:"p-3",children:[e.jsx("h3",{className:"font-medium text-sm line-clamp-2 group-hover:text-primary transition-colors",children:K(t.name)}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.count," prodotti"]})]})})},t.slug))})]}),e.jsxs("div",{className:"container py-6",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-4 pb-4 border-b",children:[e.jsxs(ze,{children:[e.jsx(Fe,{asChild:!0,children:e.jsxs(M,{variant:"outline",size:"sm",className:"gap-2 lg:hidden",children:[e.jsx(Ve,{className:"h-4 w-4"}),"Filtri",Z>0&&e.jsx(ae,{variant:"secondary",className:"ml-1 h-5 w-5 p-0 flex items-center justify-center text-xs",children:Z})]})}),e.jsxs(Le,{side:"left",className:"w-80",children:[e.jsx($e,{children:e.jsx(Me,{children:"Filtra prodotti"})}),e.jsx("div",{className:"mt-4",children:e.jsx(ue,{categories:m,brands:d,selectedCategory:null,selectedBrand:n,onCategoryChange:ie,onBrandChange:C,loading:E,showPriceFilter:!0,minPrice:0,maxPrice:500,priceRange:r,onPriceChange:ce,showAvailabilityFilter:!0,availability:w,onAvailabilityChange:_})})]})]}),e.jsxs("div",{className:"hidden sm:flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Brand:"}),d.slice(0,5).map(t=>e.jsx(M,{variant:n===t.name?"default":"outline",size:"sm",className:"h-7 text-xs",onClick:()=>C(n===t.name?null:t.name),children:t.name}
11,t.name)),d.length>5&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["+",d.length-5," altri"]})]}),Z>0&&e.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[e.jsxs("span",{className:"text-sm text-muted-foreground hidden sm:inline",children:[Z," filtro",Z>1?"i":""," attivo",Z>1?"i":""]}),e.jsxs(M,{variant:"outline",size:"sm",onClick:fe,className:"h-7 text-xs gap-1",children:[e.jsx(He,{className:"h-3 w-3"}),e.jsx("span",{className:"hidden sm:inline",children:"Condividi"})]}),e.jsxs(M,{variant:"ghost",size:"sm",onClick:pe,className:"h-7 text-xs gap-1 text-destructive hover:text-destructive",children:[e.jsx(H,{className:"h-3 w-3"}),"Rimuovi filtri"]})]})]}),e.jsxs("div",{className:"flex gap-6",children:[e.jsx("aside",{className:"hidden lg:block w-64 shrink-0",children:e.jsxs("div",{className:"sticky top-36 bg-card rounded-lg border p-4",children:[e.jsxs("h3",{className:"font-semibold mb-4 flex items-center gap-2",children:[e.jsx(De,{className:"h-4 w-4"}),"Filtra prodotti"]}),e.jsx(ue,{categories:m,brands:d,selectedCategory:null,selectedBrand:n,onCategoryChange:ie,onBrandChange:C,loading:E,showPriceFilter:!0,minPrice:0,maxPrice:500,priceRange:r,onPriceChange:ce,showAvailabilityFilter:!0,availability:w,onAvailabilityChange:_})]})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[(n||r||w!=="all")&&e.jsxs("div",{className:"flex items-center gap-2 mb-4 flex-wrap",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Filtri:"}),n&&e.jsxs(ae,{variant:"secondary",className:"gap-1 cursor-pointer hover:bg-secondary/80",onClick:()=>C(null),children:["Brand: ",n,e.jsx(H,{className:"h-3 w-3"})]}),r&&e.jsxs(ae,{variant:"secondary",className:"gap-1 cursor-pointer hover:bg-secondary/80",onClick:()=>D(void 0),children:["Prezzo: €",r[0]," - €",r[1],e.jsx(H,{className:"h-3 w-3"})]}),w!=="all"&&e.jsxs(ae,{variant:"secondary",className:"gap-1 cursor-pointer hover:bg-secondary/80",onClick:()=>_("all"),children:[w==="available"?"Disponibile":"Esaurito",e.jsx(H,{className:"h-3 w-3"})]})]}),e.jsx(Ge,{products:s,loading:g,hasMore:V,onLoadMore:X,totalCount:A,viewMode:S,onViewModeChange:N,sortBy:q,onSortChange:U})]})]})]})]})};export{ds 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.