1import{l as _,O as P,j as e,L as F,u as $,V as S,W as g,Z as A,t as f,_ as I,y as z,B as q,r as x,J as N,$ as L,a0 as n,a1 as R,a2 as V,a3 as O}from"./index-RwEbQ2Mg.js";const w="/app/chamadas";function C({status:r}){const s=N[r];return e.jsx("span",{className:"badge",style:{background:s.color},children:s.label})}function H(){const{id:r}=$(),s=Number(r),a=q(),u=_(()=>g.get(s),[s]),[d,h]=x.useState(""),[c,i]=x.useState(""),[l,j]=x.useState(!1),[p,v]=x.useState(""),[o,m]=x.useState(""),y=_(()=>g.applications(s,{status:d||void 0,category_id:c===""?void 0:c,favorite:l?!0:void 0,q:o||void 0}),[s,d,c,l,o]),D=S();async function E(t,k){try{await g.setFavorite(s,t.id,k),y.reload()}catch(M){D.erro(String(M.message))}}if(u.loading)return e.jsx("p",{className:"muted",children:"Carregandoâ¦"});if(u.error)return e.jsx("p",{className:"error",children:u.error});const b=u.data,T=y.data??[];return e.jsxs(A,{backTo:`${w}/${s}`,title:`Inscrições · ${b.title}`,actions:e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsxs("span",{className:"muted",children:[b.submitted_count," recebida(s) no total"]}),e.jsxs(F,{className:"btn",to:`${w}/${s}/painel`,children:[e.jsx(L,{size:14})," Painel"]})]}),children:[e.jsxs("div",{className:"toolbar",style:{flexWrap:"wrap",marginBottom:16},children:[e.jsxs("select",{value:d,onChange:t=>h(t.target.value),children:[e.jsx("option",{value:"",children:"Todas as situações"}),Object.keys(N).filter(t=>t!=="rascunho").map(t=>e.jsx("option",{value:t,children:N[t].label},t))]}),b.categories.length>0&&e.jsxs("select",{value:c,onChange:t=>i(t.target.value===""?"":Number(t.target.value)),children:[e.jsx("option",{value:"",children:"Todas as categorias"}),b.categories.map(t=>e.jsx("option",{value:t.id,children:t.name},t.id))]}),e.jsxs("button",{className:`seg-btn ${l?"active":""}`,onClick:()=>j(t=>!t),title:"Só a lista curta da equipe",children:[e.jsx(I,{size:13})," Favoritos"]}),e.jsxs("form",{onSubmit:t=>{t.preventDefault(),m(p.trim())},style:{display:"flex",gap:6},children:[e.jsx("input",{type:"search",placeholder:"Nome, espetáculo ou e-mailâ¦",value:p,onChange:t=>v(t.target.value),style:{minWidth:240}}),e.jsx("button",{className:"btn",type:"submit",children:"Buscar"})]}),e.jsx("span",{style:{flex:1}}),e.jsxs("span",{className:"muted",children:[T.length," nesta lista"]})]}),y.error&&e.jsx("p",{className:"error",children:y.error}),e.jsx("div",{className:"card no-pad",children:e.jsxs("table",{className:"table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{width:32}}),e.jsx("th",{children:"Quem se inscreveu"}),e.jsx("th",{children:"Proposta"}),b.categories.length>0&&e.jsx("th",{children:"Categoria"}),e.jsx("th",{children:"Situação"}),e.jsx("th",{children:"Nota"}),e.jsx("th",{children:"Enviada em"}),e.jsx("th",{})]})}),e.jsxs("tbody",{children:[T.map(t=>e.jsxs("tr",{onClick:()=>a(`${w}/${s}/inscricoes/${t.id}`),children:[e.jsx("td",{onClick:k=>k.stopPropagation(),children:e.jsx("button",{className:"icon-btn",title:t.favorite?"Tirar dos favoritos":"Marcar como favorito",onClick:()=>E(t,!t.favorite),children:e.jsx(I,{size:15,fill:t.favorite?"currentColor":"none",style:{color:t.favorite?"#ca8a04":void 0}})})}),e.jsxs("td",{children:[e.jsx("strong",{children:t.applicant_name??"â"}),e.jsxs("span",{className:"sub",children:[t.is_external?"sem conta na Gira":"cadastrado na Gira",t.contact_email?` · ${t.contact_email}`:""]})]}),e.jsx("td",{className:"muted",children:t.show_title??"â"}),b.categories.length>0&&e.jsx("td",{className:"muted",children:t.category_name??"â"}),e.jsx("td",{children:e.jsx(C,{status:t.status})}),e.jsx("td",{className:"muted",children:t.average_score!=null?`${t.average_score.toFixed(1)} (${t.review_count})`:"â"}),e.jsx("td",{className:"muted",children:f(t.submitted_at)}),e.jsx("td",{className:"muted",children:"âº"})]},t.id)),T.length===0&&!y.loading&&e.jsx("tr",{children:e.jsx("td",{colSpan:8,className:"muted",style:{padding:20},children:o||d||l||c!==""?"Nada com esses filtros.":"Nenhuma inscrição ainda. Enquanto o prazo estiver aberto, divulgue o link da chamada."})})]})]})})]})}function B({a:r}){const s=r.snapshot??{},a=!s.artist_id,u=(l,j)=>s[l]??j??null,d=l=>l?e.jsx(O,{url:String(l)}
1):null,h=l=>l===!0?"Sim":l===!1?"Não":null,c=l=>l?`${l} min`:null,i=l=>l?e.jsx("span",{style:{whiteSpace:"pre-wrap"},children:String(l)}):null;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"form-grid",children:[e.jsx(n,{label:"Quem se inscreveu",value:r.applicant_name}),e.jsx(n,{label:"Responsável pela inscrição",value:s.contact_name}),e.jsx(n,{label:"Telefone",value:u("phone",a?r.external_phone:null)}),e.jsx(n,{label:"De onde",value:[a?r.external_city??s.city:s.city,a?r.external_state??s.state:s.state,a?r.external_country??s.country:s.country].filter(Boolean).join(" / ")||null}),!a&&e.jsx(n,{label:"Grupo/companhia",value:s.group_name}),e.jsx(n,{label:"Site",value:d(s.site_url)}),e.jsx(n,{label:"Instagram",value:s.instagram}),!a&&e.jsxs(e.Fragment,{children:[e.jsx(n,{label:"Mini currÃculo",value:i(s.mini_cv),full:!0}),e.jsx(n,{label:"Destaques",value:i(s.highlights),full:!0})]})]}),e.jsxs("div",{className:"card",style:{marginTop:16},children:[e.jsx("strong",{children:"A proposta"}),e.jsxs("div",{className:"form-grid",style:{marginTop:8},children:[e.jsx(n,{label:"Espetáculo",value:r.show_title,full:!0}),!a&&e.jsx(n,{label:"SubtÃtulo",value:s.show_subtitle}),e.jsx(n,{label:"Duração",value:c(s.show_duration_min)}),e.jsx(n,{label:"Classificação",value:s.show_rating}),e.jsx(n,{label:"Sinopse",value:i(s.show_synopsis),full:!0}),e.jsx(n,{label:a?"Release / concepção":"Histórico / release",value:i(u("show_history",a?r.external_show_release:null)),full:!0}),!a&&e.jsx(n,{label:"Prêmios",value:i(s.show_awards),full:!0})]})]}),e.jsxs("div",{className:"card",style:{marginTop:16},children:[e.jsx("strong",{children:"Quem vai"}),e.jsxs("div",{className:"form-grid",style:{marginTop:8},children:[e.jsx(n,{label:"Pessoas viajando",value:s.people_count}),e.jsx(n,{label:"Ficha técnica",value:i(s.team),full:!0})]})]}),e.jsxs("div",{className:"card",style:{marginTop:16},children:[e.jsx("strong",{children:"VÃdeo, fotos e portfólio"}),e.jsxs("div",{className:"form-grid",style:{marginTop:8},children:[e.jsx(n,{label:"VÃdeo (Ãntegra)",value:d(u("show_video_full_url",a?r.external_video_url:null)),full:!0}),e.jsx(n,{label:"Teaser",value:d(s.show_video_teaser_url),full:!0}),e.jsx(n,{label:"Fotos em alta",value:d(s.show_photos_zip_url),full:!0}),e.jsx(n,{label:"Crédito das fotos",value:s.show_photos_credit}),e.jsx(n,{label:"Portfólio / clipping",value:d(s.portfolio_url),full:!0})]})]}),e.jsxs("div",{className:"card",style:{marginTop:16},children:[e.jsx("strong",{children:"Técnica"}),e.jsxs("div",{className:"form-grid",style:{marginTop:8},children:[e.jsx(n,{label:"Montagem",value:c(s.show_setup_min)}),e.jsx(n,{label:"Desmontagem",value:c(s.show_teardown_min)}),e.jsx(n,{label:"Espaço mÃnimo",value:s.show_min_stage}),e.jsx(n,{label:"Usa fogo",value:h(s.show_uses_fire)}),e.jsx(n,{label:"Usa água",value:h(s.show_uses_water)}),e.jsx(n,{label:"Necessidades técnicas / rider",value:i(s.show_tech_rider),full:!0})]}),s.congelado_em&&e.jsx("p",{className:"muted",style:{marginTop:10,marginBottom:0},children:e.jsxs("small",{children:["Material congelado em ",f(s.congelado_em)," â é o que foi entregue, mesmo que o perfil tenha mudado depois."]})})]}),r.answers.length>0&&e.jsxs("div",{className:"card",style:{marginTop:16},children:[e.jsx("strong",{children:"Respostas à s perguntas da chamada"}),e.jsx("div",{className:"form-grid",style:{marginTop:8},children:r.answers.map(l=>e.jsx(n,{label:l.question_label??"Pergunta",value:l.value,full:!0},l.id))})]}),r.documents.length>0&&e.jsxs("div",{className:"card",style:{marginTop:16},children:[e.jsx("strong",{children:"Documentos"}),e.jsx("ul",{style:{margin:"8px 0 0",paddingLeft:18},children:r.documents.map(l=>e.jsx("li",{children:l.requirement_label??l.original_name??l.file_path},l.id))})]})]})}function J(){const{id:r,applicationId:s}=$(),a=Number(r),u=Number(s),d=S(),h=_(()=>g.get(a),[a]),c=_(()=>g.application(a,u),[a,u]);if(c.loading||h.loading)return e.jsx("p",{className:"muted",children:"Carregandoâ¦"});if(c.error)return e.jsx("p",{className:"error",children:c.error});const i=c.data,l=h.data;return e.jsxs(A,{backTo:`${w}/${a}/inscricoes`,title:i.applicant_name??`Inscrição #${i.id}`,actions:e.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[e.jsx(C,{status:i.status}),e.jsx("button",{className:"icon-btn",title:i.favorite?"Tirar dos favoritos":"Marcar como favorito",onClick:async()=>{try{await g.setFavorite(a,i.id,!i.favorite),c.reload()}catch(j){d.erro(String(j.message))}},children:e.jsx(I,{size:16,fill:i.favorite?"currentColor":"none",style:{color:i.favorite?"#ca8a04":void 0}})}),i.contact_email&&e.jsxs("a",{className:"btn",href:`mailto:${i.contact_email}`,children:[e.jsx(z,{size:14})," Escrever"]})]}),children:[e.jsxs("div",{className:"toolbar",style:{marginBottom:12},children:[e.jsx("span",{className:"badge-soft",children:i.is_external?"Inscrição feita à mão (sem conta)":"Material reaproveitado da Gira"}),i.category_name&&e.jsx("span",{className:"badge-soft",children:i.category_name}),e.jsxs("span",{className:"muted",children:["enviada em ",f(i.submitted_at)]})]}),e.jsx(B,{a:i}),e.jsx(G,{callId:a,a:i,recarregar:c.reload}),e.jsx(U,{callId:a,a:i,temCategorias:l.categories.length>0,recarregar:c.reload})]})}function G({callId:r,a:s,recarregar:a}){const u=S(),[d,h]=x.useState(""),[c,i]=x.useState(""),[l,j]=x.useState(!1),[p,v]=x.useState(!1);async function o(){j(!0);try{await g.review(r,s.id,{score:d===""?null:Number(d),parecer:c||null}),u.ok("Parecer registrado."),v(!1),a()}catch(m){u.erro(String(m.message))}finally{j(!1)}}return e.jsxs("div",{className:"card",style:{marginTop:16},children:[e.jsxs("div",{className:"toolbar",style:{marginBottom:s.reviews.length?10:0},children:[e.jsxs("strong",{className:"inline-ico",children:[e.jsx(R,{size:15})," Curadoria"]}),s.average_score!=null&&e.jsxs("span",{className:"badge-soft",children:["média ",s.average_score.toFixed(1)," · ",s.review_count," parecer(es)"]}),e.jsx("span",{style:{flex:1}}),!p&&e.jsx("button",{className:"btn",onClick:()=>{h(""),i(""),v(!0)},children:"Dar meu parecer"})]}),p&&e.jsxs("div",{className:"lista-form",children:[e.jsxs("div",{className:"form-grid",children:[e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"Nota (0 a 10)"}),e.jsx("input",{type:"number",min:0,max:10,step:"0.5",value:d,onChange:m=>h(m.target.value)})]}),e.jsxs("label",{className:"field field-full",children:[e.jsx("span",{children:"Parecer"}),e.jsx("textarea",{rows:4,value:c,onChange:m=>i(m.target.value)})]})]}),e.jsx("p",{className:"muted",style:{marginTop:0},children:"Isto não vai para o inscrito. Se você já avaliou, o novo parecer substitui o seu â não cria outro."}),e.jsxs("div",{className:"toolbar",children:[e.jsx("span",{style:{flex:1}}),e.jsx("button",{className:"btn",onClick:()=>v(!1),disabled:l,children:"Cancelar"}),e.jsx("button",{className:"btn primary",onClick:o,disabled:l,children:l?"Salvandoâ¦":"Salvar parecer"})]})]}),s.reviews_hidden&&!p&&e.jsx("p",{className:"muted",style:{margin:0},children:"As notas e os pareceres dos outros curadores aparecem depois que você registrar o seu â assim a primeira nota não puxa as outras."}),!s.reviews_hidden&&s.reviews.length===0&&!p&&e.jsx("p",{className:"muted",style:{margin:0},children:"Ninguém avaliou ainda."}),s.reviews.map(m=>e.jsxs("div",{className:"parecer",children:[e.jsxs("div",{className:"parecer-head",children:[e.jsx("strong",{children:m.reviewer_name??`Curador #${m.reviewer_user_id}`}),m.score!=null&&e.jsx("span",{className:"badge-soft",children:m.score.toFixed(1)}),e.jsx("span",{className:"muted",children:f(m.updated_at)})]}),m.parecer&&e.jsx("p",{style:{whiteSpace:"pre-wrap",margin:"6px 0 0"},children:m.parecer})]},m.id))]})}function U({callId:r,a:s,temCategorias:a,recarregar:u}){const d=S(),[h,c]=x.useState(s.status==="rascunho"||s.status==="enviada"?"em_analise":s.status),[i,l]=x.useState(s.feedback??""),[j,p]=x.useState(!1);async function v(){p(!0);try{await g.decide(r,s.id,{status:h,feedback:i||null}),d.ok("Decisão registrada."),u()}catch(o){d.erro(String(o.message))}finally{p(!1)}}return e.jsxs("div",{className:"card",style:{marginTop:16},children:[e.jsx("strong",{children:"Decisão do festival"}),e.jsxs("p",{className:"muted",style:{margin:"4px 0 10px"},children:["Só o organizador decide â curador recomenda. A situação e a devolutiva abaixo são o que o inscrito enxerga.",a&&" A vaga sai da categoria em que a proposta se inscreveu."]}),e.jsxs("div",{className:"form-grid",children:[e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"Situação"}),e.jsx("select",{value:h,onChange:o=>c(o.target.value),children:V.map(o=>e.jsx("option",{value:o,children:N[o].label},o))})]}),e.jsxs("label",{className:"field field-full",children:[e.jsx("span",{children:"Devolutiva ao inscrito (opcional)"}),e.jsx("textarea",{rows:3,value:i,onChange:o=>l(o.target.value),placeholder:"O que este artista precisa saber sobre o resultado."})]})]}),e.jsxs("div",{className:"toolbar",children:[e.jsx("span",{style:{flex:1}}),e.jsx("button",{className:"btn primary",onClick:v,disabled:j,children:j?"Salvandoâ¦":"Registrar decisão"})]}),s.decisions.length>0&&e.jsxs("div",{style:{marginTop:12},children:[e.jsx("span",{className:"muted",children:"Histórico"}),e.jsx("ul",{style:{margin:"6px 0 0",paddingLeft:18},children:[...s.decisions].reverse().map(o=>e.jsxs("li",{className:"muted",children:[f(o.created_at)," · ",o.user_name??"â",":"," ",o.from_status?`${N[o.from_status].label} â `:"",e.jsx("strong",{children:N[o.to_status].label}),o.feedback&&e.jsxs("div",{style:{whiteSpace:"pre-wrap"},children:["â",o.feedback,"â"]}
1)]},o.id))})]})]})}function Q({itens:r}){const s=q();return r.length===0?e.jsx("p",{className:"muted",children:"Você ainda não se inscreveu em nenhuma chamada hospedada na Gira. Quando um festival abrir a chamada dele aqui, o link leva direto à inscrição â e o seu material já vai preenchido."}):e.jsx("div",{className:"card no-pad",children:e.jsxs("table",{className:"table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Proposta"}),e.jsx("th",{children:"Festival"}),e.jsx("th",{children:"Categoria"}),e.jsx("th",{children:"Situação"}),e.jsx("th",{children:"Enviada em"})]})}),e.jsx("tbody",{children:r.map(a=>e.jsxs("tr",{onClick:()=>s(`/app/inscricoes/enviada/${a.id}`),children:[e.jsxs("td",{children:[e.jsx("strong",{children:a.show_title??"â"}),a.feedback&&e.jsx("span",{className:"sub",children:a.feedback})]}),e.jsx("td",{className:"muted",children:a.festival_name??"â"}),e.jsx("td",{className:"muted",children:a.category_name??"â"}),e.jsx("td",{children:e.jsx(C,{status:a.status})}),e.jsx("td",{className:"muted",children:f(a.submitted_at)})]},a.id))})]})})}function Z(){const{id:r}=$(),s=_(()=>P.get(Number(r)),[r]);if(s.loading)return e.jsx("p",{className:"muted",children:"Carregandoâ¦"});if(s.error||!s.data)return e.jsx("p",{className:"error",children:s.error??"Inscrição não encontrada"});const a=s.data;return e.jsxs(A,{backTo:"/app/inscricoes/chamadas",title:a.show_title??"Inscrição",children:[e.jsx("p",{className:"muted",style:{marginTop:0},children:[a.festival_name,a.category_name,a.submitted_at&&`enviada em ${f(a.submitted_at)}`].filter(Boolean).join(" · ")}),e.jsxs("div",{className:"card",style:{marginBottom:16},children:[e.jsx("strong",{children:"Situação: "}),e.jsx(C,{status:a.status}),a.feedback&&e.jsxs("p",{style:{whiteSpace:"pre-wrap",margin:"10px 0 0"},children:[e.jsx("strong",{children:"Retorno do festival: "}),a.feedback]})]}),e.jsx(B,{a})]})}function K(){const r=_(()=>P.list(),[]);return r.error?e.jsx("p",{className:"error",children:r.error}):r.loading?e.jsx("p",{className:"muted",children:"Carregandoâ¦"}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"toolbar",children:e.jsx(F,{to:"/app/inscricoes",className:"back-link",children:"â¹ Voltar à s inscrições"})}),e.jsx(Q,{itens:r.data??[]})]})}export{J as CallApplicationView,H as CallApplications,B as MaterialDaInscricao,Z as MinhaInscricaoEnviada,Q as MyCallApplications,C as StatusInscricao,K 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.