PageSourceSearch

https://buske.ai/assets/SharedRedirect-DUJj8O9d.js

js buske.ai collected 2026-10-05 11:53:24 UTC 2,459 bytes, 1 lines download raw bytes

1import{n as u,e as g,r as h,j as s,L as j}from"./react-vendor-BXTNdvBF.js";import{$ as p,T as S,B as _,f as b,G as N,Y as y,aK as w}from"./index-DVCmV4wM.js";import"./supabase-vendor-Blds1cMP.js";const E="buskeai.sharedAnuncio";function k(e){return w(e||{})}function L(e){return[e==null?void 0:e.localizacao_logradouro,e==null?void 0:e.localizacao_bairro,e==null?void 0:e.localizacao_cidade,e==null?void 0:e.localizacao_estado_sigla].map(o=>typeof o=="string"?o.trim():"").filter(Boolean).join("|")}function P(){const{shareId:e}=u(),c=g(),[o,l]=h.useState(null);return h.useEffect(()=>{if(!e){l("Link de compartilhamento inválido.");return}(async()=>{var d;try{const n=await fetch(`${N}/api/share/${e}`),r=await n.json();if(!n.ok||!(r!=null&&r.success)||!(r!=null&&r.anuncio))throw new Error((r==null?void 0:r.error)||"Link expirado ou inválido.");const a=new URLSearchParams,x=r.filtros||{};if(Object.entries(x).forEach(([i,t])=>{if(!(t==null||t==="")){if(Array.isArray(t)){t.length>0&&a.set(i,t.join(","));return}typeof t!="object"&&a.set(i,String(t))}}),!a.get("anuncio_tipo")&&((d=r.anuncio)!=null&&d.anuncio_tipo)&&a.set("anuncio_tipo",r.anuncio.anuncio_tipo),!a.get("localizacao_pairs")){const i=L(r.anuncio);i&&a.set("localizacao_pairs",i)}const m=k(r.anuncio),f=y(a);sessionStorage.setItem(E,JSON.stringify(m)),sessionStorage.setItem("buskeai.lastSearchUrl",f),c(f,{replace:!0,state:{sharedAnuncio:m}})}catch(n){l(n.message||"Link expirado ou inválido.")}})()},[c,e]),s.jsxs(s.Fragment,{children:[s.jsx(p,{title:"Redirecionando compartilhamento | Buske.ai",description:"Redirecionamento de link compartilhado.",robots:"noindex, nofollow"}),s.jsx("div",{className:"min-h-screen flex flex-col items-center justify-center bg-muted/40 px-4 text-center",children:o?s.jsxs("div",{className:"max-w-md space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-center gap-2 text-destructive",children:[s.jsx(S,{className:"h-6 w-6"}),s.jsx("h1",{className:"text-lg font-semibold",children:"Não foi possível abrir o compartilhamento"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:o}),s.jsx(_,{asChild:!0,children:s.jsx(j,{to:"/",children:"Ir para a busca"})})]}):s.jsxs("div",{className:"flex flex-col items-center gap-3",children:[s.jsx(b,{className:"h-8 w-8 animate-spin text-primary"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Carregando anúncio compartilhado..."})]})})]})}export{P 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.