PageSourceSearch

https://7maravilhas.pt/build/assets/summary-Cy3PGhGj.js

js 7maravilhas.pt collected 2026-10-02 12:03:25 UTC 6,622 bytes, 1 lines download raw bytes

1import{r as l,j as e,Y as i,a as g,m as j}from"./app-Dpdn6RkY.js";import{M as v}from"./main-layout-DueMfrwV.js";import{A as N}from"./arrow-left-CAD2ygqM.js";import{L as y}from"./lock-CREVs60N.js";import{C as w}from"./circle-alert-CZYoLW9F.js";import{C as p}from"./circle-check-big-6TJHb3f0.js";import{C as u}from"./chevron-right--PnwtQIO.js";import{T as d}from"./triangle-alert-pkUKihv8.js";/* empty css            */import"./index-H3WrPmOw.js";import"./primary-button-Cc1Q7518.js";import"./index-Dr1PzIeU.js";function C({category:s}){const a=s.maxVotes===0;return e.jsxs("div",{className:"bg-card border-border overflow-hidden rounded-xl border",children:[e.jsxs("div",{className:"bg-muted/30 flex items-center justify-between px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[s.isComplete?e.jsx(p,{className:"h-4 w-4 text-green-500"}):e.jsx(d,{className:"text-destructive h-4 w-4"}),e.jsx("h3",{className:"text-foreground text-sm font-semibold",children:s.shortLabel})]}),!s.isComplete&&!a&&e.jsx(i,{href:route("voting.category",{slug:s.slug}),className:"text-primary hover:text-primary/80 text-xs font-medium",children:"Completar →"})]}),e.jsx("div",{className:"p-3",children:a?e.jsx("p",{className:"text-muted-foreground py-4 text-center text-sm",children:"Sem patrimónios disponíveis nesta categoria para o seu distrito."}):s.monuments.length===0?e.jsx("p",{className:"text-muted-foreground py-4 text-center text-sm",children:"Nenhum monumento selecionado"}):e.jsx("div",{className:"space-y-1.5",children:s.monuments.map(t=>e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{className:"bg-primary text-primary-foreground flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-xs font-medium",children:t.rank}),e.jsx(i,{href:route("voting.monument",{monument:t.slug}),className:"text-foreground hover:text-primary flex-1 truncate transition-colors",children:t.name}),e.jsxs("span",{className:"text-primary bg-primary/10 shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-semibold",children:[t.points,"pts"]})]},t.id))})})]})}function q({categories:s,allComplete:a,isLocked:t,phase:h,maxVotes:S}){const[o,x]=l.useState(!1),[f,m]=l.useState(!1),[c,n]=l.useState(null),b=async()=>{if(!(!a||t||o)){x(!0),n(null);try{const r=await g.post(route("voting.submit"));r.status===200&&r.data.success?j.visit(route("voting.dashboard")):n(r.data.error||"Erro ao submeter votos")}catch{n("Erro de ligação. Por favor tente novamente.")}finally{x(!1),m(!1)}}};return e.jsx(v,{title:"Resumo da Votação",children:e.jsx("div",{className:"bg-background min-h-screen py-6",children:e.jsxs("div",{className:"container mx-auto max-w-7xl px-4",children:[e.jsxs("div",{className:"mt-6 mb-6 flex items-center justify-between",children:[e.jsxs(i,{href:route("voting.dashboard"),
1className:"text-primary hover:text-primary/80 inline-flex items-center gap-2 text-sm",children:[e.jsx(N,{className:"h-4 w-4"}),"Voltar ao Início"]}),e.jsx(i,{href:route("voting.rules"),className:"text-muted-foreground hover:text-primary text-xs transition-colors",children:"Ver Regras"})]}),e.jsxs("div",{className:"mb-6 text-center",children:[e.jsx("h1",{className:"text-foreground mb-1 text-2xl font-bold",children:"Resumo da Votação"}),e.jsxs("p",{className:"text-muted-foreground text-sm",children:["Fase ",h," • Reveja os seus votos antes de submeter"]})]}),t&&e.jsxs("div",{className:"mb-6 flex items-start gap-3 rounded-xl border border-green-200 bg-green-50 p-4",children:[e.jsx(y,{className:"mt-0.5 h-5 w-5 shrink-0 text-green-600"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-green-800",children:"Votos Submetidos"}),e.jsx("p",{className:"text-sm text-green-700",children:"Os seus votos foram submetidos com sucesso e não podem ser alterados."})]})]}),c&&e.jsxs("div",{className:"bg-destructive/10 border-destructive/20 mb-6 flex items-start gap-3 rounded-xl border p-4",children:[e.jsx(w,{className:"text-destructive mt-0.5 h-5 w-5 shrink-0"}),e.jsx("p",{className:"text-destructive text-sm",children:c})]}),e.jsx("div",{className:"mb-8 grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:s.map(r=>e.jsx(C,{category:r},r.slug))}),!t&&e.jsx("div",{className:"bg-card border-border rounded-xl border p-6 text-center",children:a?e.jsxs(e.Fragment,{children:[e.jsx(p,{className:"mx-auto mb-3 h-12 w-12 text-green-500"}),e.jsx("h2",{className:"text-foreground mb-2 text-lg font-semibold",children:"Todas as categorias completas!"}),e.jsxs("p",{className:"text-muted-foreground mx-auto mb-6 max-w-md text-sm",children:["Reveja os seus votos acima. Após submeter, ",e.jsx("strong",{children:"não poderá alterar os votos"}),"."]}),e.jsxs("button",{onClick:()=>m(!0),disabled:o,className:"bg-primary hover:bg-primary/90 text-primary-foreground inline-flex items-center gap-2 rounded-xl px-8 py-3 font-semibold transition-colors disabled:opacity-50",children:["Submeter Votos Finais",e.jsx(u,{className:"h-5 w-5"})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(d,{className:"text-destructive mx-auto mb-3 h-12 w-12"}),e.jsx("h2",{className:"text-foreground mb-2 text-lg font-semibold",children:"Votação Incompleta"}),e.jsx("p",{className:"text-muted-foreground mb-4 text-sm",children:"Complete todas as categorias antes de submeter."}
1),e.jsxs(i,{href:route("voting.dashboard"),className:"text-primary hover:text-primary/80 inline-flex items-center gap-2 font-medium",children:["Voltar ao Início",e.jsx(u,{className:"h-4 w-4"})]})]})}),f&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",children:e.jsxs("div",{className:"bg-card w-full max-w-md rounded-2xl p-6 shadow-xl",children:[e.jsx(d,{className:"text-primary mx-auto mb-4 h-12 w-12"}),e.jsx("h3",{className:"text-foreground mb-2 text-center text-lg font-bold",children:"Confirmar Submissão"}),e.jsxs("p",{className:"text-muted-foreground mb-6 text-center text-sm",children:["Após submeter, ",e.jsx("strong",{children:"não poderá voltar a editar ou alterar a ordem dos votos"}),". Tem a certeza que deseja continuar?"]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{onClick:()=>m(!1),disabled:o,className:"border-border text-foreground hover:bg-muted flex-1 rounded-lg border px-4 py-2.5 font-medium transition-colors disabled:opacity-50",children:"Cancelar"}),e.jsx("button",{onClick:b,disabled:o,className:"bg-primary text-primary-foreground hover:bg-primary/90 flex-1 rounded-lg px-4 py-2.5 font-medium transition-colors disabled:opacity-50",children:o?"A submeter...":"Confirmar"})]})]})})]})})})}export{q 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.