1import{r as j,j as e}from"./vendor-react-O1HtssjF.js";import{a as ve,u as V,b as re}from"./vendor-query-C57Ujfuk.js";import{d as fe,e as Q,P as je,B as w,I as ge,p as le,M as be}from"./index-BdhET6SP.js";import{u as ye,a as $,P}from"./Paginacao-CZw70aUF.js";import{M as Ce}from"./ModuleGuide-CtXUng11.js";import{F as Ne,a as F}from"./FilterBar-BPvYexHa.js";import{S as X}from"./Select-lL9lAka9.js";import{I as Ie}from"./ImportGuard-DlkTIBdK.js";import{B as z}from"./BilingualHeader-DP1u2D5J.js";import{E as H}from"./EmptyState-ChWRgcPM.js";import{g as we}from"./error-messages-DvyZ16QK.js";import{e as Se,a as Ee}from"./export-table-CJFcKh3x.js";import{D as ie,_ as Y,j as B,$ as ke,a0 as Te}from"./vendor-icons-qfsiYizf.js";import"./vendor-radix-AQo14B1u.js";import"./vendor-datefns-RsZNnTnu.js";import"./vendor-openai-PX4_LG7y.js";import"./project-source-CMo6RtDm.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},p=new s.Error().stack;p&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[p]="71370837-6b01-4d20-9d0c-ed876099b1b6",s._sentryDebugIdIdentifier="sentry-dbid-71370837-6b01-4d20-9d0c-ed876099b1b6")}catch{}})();const R=["must","should","could","wont"],f={must:{label:"Obrigatório",en:"Must have",cls:"v2-danger",color:"var(--v2-color-danger-700)"},should:{label:"Importante",en:"Should have",cls:"v2-warn",color:"var(--v2-color-warning-700)"},could:{label:"Desejável",en:"Could have",cls:"",color:"var(--v2-color-primary-700)"},wont:{label:"Não agora",en:"Won't have",cls:"v2-muted",color:"var(--v2-text-subtle)"}},K=["basico","desempenho","atrativo","indiferente","reverso"],y={basico:{label:"Básico",color:"var(--v2-text-strong)",desc:"Esperado pelo usuário: a ausência causa insatisfação"},desempenho:{label:"Desempenho",color:"var(--v2-color-primary-700)",desc:"Mais é melhor: a satisfação cresce proporcionalmente"},atrativo:{label:"Atrativo",color:"var(--v2-color-success-700)",desc:"Não esperado: a presença encanta o usuário"},indiferente:{label:"Indiferente",color:"var(--v2-text-subtle)",desc:"Não afeta a satisfação de forma relevante"},reverso:{label:"Reverso",color:"var(--v2-color-warning-700)",desc:"Presença incomoda: parte dos usuários prefere sem"}},S={work_item:"Item do tracker",activity:"Atividade"},G=[{key:"high",label:"Alto (⥠100)",min:100,max:1/0},{key:"mid",label:"Médio (10 a 100)",min:10,max:100},{key:"low",label:"Baixo (< 10)",min:0,max:10},{key:"none",label:"Sem RICE",min:null,max:null}];function b(s){return s==null||s===""?"":String(s)}function oo(){const s=ve(),{toast:p}=fe(),[n,m]=j.useState({organizationId:null,projectId:null,moscow:"",kano:"",riceBand:""}),[c,i]=j.useState(!0),[l,t]=j.useState("moscow"),[a,r]=j.useState(""),[x,d]=j.useState(null),{data:ce=[]}=V({queryKey:["/api/organizations"]}),{data:A=[]}=V({queryKey:["/api/projects"]}),D=j.useMemo(()=>A.filter(o=>!n.organizationId||o.organizationId===n.organizationId),[A,n.organizationId]);j.useEffect(()=>{n.projectId&&!D.find(o=>o.id===n.projectId)&&m(o=>({...o,projectId:null}))},[D,n.projectId]);const C=n.projectId??"",de=C?`?projectId=${C}`:"",J=["/api/prioritization",C],{data:O,isLoading:M,isError:E,refetch:pe}=V({queryKey:J,queryFn:async()=>(await Q("GET",`/api/prioritization${de}`)).json()}),L=(O==null?void 0:O.items)??[],k=!!(n.moscow||n.kano||n.riceBand||a.trim()),v=j.useMemo(()=>{const o=h=>{if(!n.riceBand)return!0;const I=G.find(T=>T.key===n.riceBand);return I.min===null?h.rice===null:h.rice!==null&&h.rice>=I.min&&h.rice<I.max},u=a.trim().toLowerCase();return[...L.filter(h=>(!n.moscow||h.moscow===n.moscow)&&(!n.kano||h.kano===n.kano)&&(!u||(h.itemTitle??"").toLowerCase().includes(u))&&o(h))].sort((h,I)=>{const T=h.rice??-1,_=I.rice??-1;return T!==_?c?_-T:T-_:(h.itemTitle??"").localeCompare(I.itemTitle??"")})},[L,n.moscow,n.kano,n.riceBand,c,a]),Z=()=>s.invalidateQueries({queryKey:J}),ee=o=>p({title:"Não foi possÃvel salvar",description:we(o),variant:"destructive"}),q=re({mutationFn:async({item:o,patch:u})=>
1{const g={projectId:o.projectId??C,itemType:o.itemType,itemRef:o.itemRef,itemTitle:o.itemTitle,moscow:o.moscow,riceReach:o.riceReach,riceImpact:o.riceImpact,riceConfidence:o.riceConfidence,riceEffort:o.riceEffort,kano:o.kano,notes:o.notes??null,...u};return(await Q("POST","/api/prioritization",g)).json()},onSuccess:()=>{Z(),d(null)},onError:ee}),ue=re({mutationFn:async o=>(await Q("DELETE",`/api/prioritization/${o}`)).json(),onSuccess:Z,onError:ee}),N=A.find(o=>o.id===C),me=[...C?[]:[{key:"projectName",header:"Projeto",format:o=>o??""}],{key:"itemTitle",header:"Item",format:o=>o??""},{key:"itemType",header:"Tipo",format:o=>S[o]??String(o??"")},{key:"moscow",header:"MoSCoW",format:o=>{var u;return(o?(u=f[o])==null?void 0:u.label:"")??""}},{key:"riceReach",header:"Reach",format:o=>o==null?"":Number(o)},{key:"riceImpact",header:"Impact",format:o=>o==null?"":Number(o)},{key:"riceConfidence",header:"Confidence",format:o=>o==null?"":Number(o)},{key:"riceEffort",header:"Effort",format:o=>o==null?"":Number(o)},{key:"rice",header:"Score RICE",format:o=>o==null?"":Number(o)},{key:"kano",header:"Kano",format:o=>{var u;return(o?(u=y[o])==null?void 0:u.label:"")??""}}],oe=o=>{(o==="csv"?Se:Ee)(v,me,{filename:`priorizacao-${(N==null?void 0:N.name)??"todos-projetos"}`.replace(/\s+/g,"-").toLowerCase(),meta:{Escopo:N?le(N):"Todos os projetos",MoSCoW:n.moscow?f[n.moscow].label:"Todos",Kano:n.kano?y[n.kano].label:"Todos",RICE:n.riceBand?G.find(g=>g.key===n.riceBand).label:"Todos",Total:String(v.length)}})},W=ye(56),xe=j.useMemo(()=>v.filter(o=>o.moscow),[v]),he=j.useMemo(()=>v.filter(o=>o.kano),[v]),se=$(xe,W),te=$(v,W),ae=$(he,W),ne=$(v,W);return e.jsxs(je,{children:[e.jsxs("div",{className:"v2-page-head",children:[e.jsxs("div",{className:"v2-page-head-title",children:[e.jsx("h1",{children:"Engine de Priorização"}),e.jsxs("div",{className:"v2-sub",children:["Pontue os itens do projeto por ",e.jsx("strong",{children:"MoSCoW"}),","," ",e.jsx("strong",{children:"RICE"})," e ",e.jsx("strong",{children:"Kano"})," · o score é uma anotação, sempre editável"]})]}),e.jsxs("div",{className:"v2-page-head-actions",children:[e.jsx(w,{variant:"ghost",size:"sm",leftIcon:e.jsx(ie,{className:"h-4 w-4"}),onClick:()=>oe("csv"),disabled:v.length===0,children:"CSV"}),e.jsx(w,{variant:"ghost",size:"sm",leftIcon:e.jsx(ie,{className:"h-4 w-4"}),onClick:()=>oe("xlsx"),disabled:v.length===0,children:"XLSX"})]})]}),e.jsx(Ne,{value:n,onChange:m,organizations:ce,projects:D.map(o=>({id:o.id,name:le(o)})),resultCount:v.length,labels:{results:o=>{const u=v.filter(g=>g.scoreId).length;return`${o} ${o===1?"item":"itens"} · ${u} pontuado${u===1?"":"s"}`}},onClear:()=>m(o=>({organizationId:null,projectId:o.projectId,moscow:"",kano:"",riceBand:""})),slots:e.jsxs(e.Fragment,{children:[e.jsx(F,{label:"Buscar",children:e.jsx(ge,{type:"search",value:a,onChange:o=>r(o.target.value),placeholder:"Buscar por nomeâ¦","aria-label":"Buscar item por nome"})}),e.jsx(F,{label:"MoSCoW",children:e.jsxs(X,{"aria-label":"MoSCoW",value:n.moscow??"",onChange:o=>m({...n,moscow:o.target.value}),children:[e.jsx("option",{value:"",children:"Todo MoSCoW"}),R.map(o=>e.jsx("option",{value:o,children:f[o].label},o))]})}),e.jsx(F,{label:"Faixa RICE",children:e.jsxs(X,{"aria-label":"Faixa RICE",value:n.riceBand??"",onChange:o=>m({...n,riceBand:o.target.value}),children:[e.jsx("option",{value:"",children:"Toda faixa RICE"}),G.map(o=>e.jsx("option",{value:o.key,children:o.label},o.key))]})}),e.jsx(F,{label:"Kano",children:e.jsxs(X,{"aria-label":"Kano",value:n.kano??"",onChange:o=>m({...n,kano:o.target.value}),children:[e.jsx("option",{value:"",children:"Todo Kano"}),K.map(o=>e.jsx("option",{value:o,children:y[o].label},o))]})})]})}),e.jsxs("div",{style:{marginTop:14},children:[e.jsx("div",{className:"v2-kpis",children:R.map(o=>{const u=f[o],g=L.filter(h=>h.moscow===o).length;return e.jsxs("div",{className:"v2-kpi",children:[e.jsxs("div",{className:"v2-kpi-label",children:[u.label,e.jsxs("span",{style:{color:u.color,letterSpacing:0,textTransform:"none"},children:["· ",u.en]})]}),e.jsx("div",{className:"v2-kpi-value",style:{color:u.color},children:g}),e.jsx("div",{className:"v2-kpi-foot",children:k?g===1?"item no escopo (sem filtro)":"itens no escopo (sem filtro)":g===1?"item neste bucket":"itens neste bucket"})]},o)})}),e.jsxs(Ie,{project:N,noun:"itens",genero:"masculino",children:[e.jsxs("div",{className:"v2-tab-pill v2-mb-4",style:{display:"inline-flex"},children:[e.jsx("button",{className:l==="moscow"?"v2-active":"",onClick:()=>
1t("moscow"),children:"MoSCoW"}),e.jsx("button",{className:l==="rice"?"v2-active":"",onClick:()=>t("rice"),children:"RICE"}),e.jsx("button",{className:l==="kano"?"v2-active":"",onClick:()=>t("kano"),children:"Kano"}),e.jsx("button",{className:l==="todos"?"v2-active":"",onClick:()=>t("todos"),children:"Todos"})]}),E&&e.jsx(Me,{onTentarDeNovo:()=>pe()}),!E&&l==="moscow"&&e.jsxs(e.Fragment,{children:[e.jsx($e,{rows:se.itens,universo:v,loading:M,temFiltroAtivo:k,onScore:()=>t("todos"),onScoreItem:d}),e.jsx(P,{estado:se,rotulo:"pontuados"})]}),!E&&l==="rice"&&e.jsxs(e.Fragment,{children:[e.jsx(Pe,{rows:te.itens,loading:M,temFiltroAtivo:k,onScoreItem:d}),e.jsx(P,{estado:te,rotulo:"itens"})]}),!E&&l==="kano"&&e.jsxs(e.Fragment,{children:[e.jsx(Fe,{rows:ae.itens,loading:M,temFiltroAtivo:k,onScoreItem:d}),e.jsx(P,{estado:ae,rotulo:"classificados"})]}),!E&&l==="todos"&&e.jsxs(e.Fragment,{children:[e.jsx(ze,{rows:ne.itens,loading:M,temFiltroAtivo:k,sortRiceDesc:c,onToggleSort:()=>i(o=>!o),onUpsert:(o,u)=>q.mutate({item:o,patch:u}),onClear:o=>o.scoreId&&ue.mutate(o.scoreId),onScoreItem:d}),e.jsx(P,{estado:ne,rotulo:"itens"})]})]})]}),e.jsx(be,{open:!!x,onClose:()=>d(null),title:`Pontuar · ${(x==null?void 0:x.itemTitle)??"(sem tÃtulo)"}`,children:x&&e.jsx(Be,{item:x,submitting:q.isPending,onCancel:()=>d(null),onSubmit:o=>q.mutate({item:x,patch:o})})}),e.jsx(Ce,{moduleKey:"priorizacao",title:"Como funciona Priorização",howItWorks:e.jsxs(e.Fragment,{children:[e.jsxs("p",{style:{margin:"0 0 8px"},children:["A priorização é uma camada de ",e.jsx("b",{children:"pontuação manual"})," sobre os itens do projeto: tanto os ",e.jsx("b",{children:"itens do tracker"})," (sincronizados) quanto as ",e.jsx("b",{children:"atividades"})," manuais. Você não cria itens aqui: você os"," ",e.jsx("b",{children:"pontua"}),". Por isso o score é sempre editável, mesmo quando o projeto é sincronizado e os itens são somente-leitura."]}),e.jsxs("p",{style:{margin:"0 0 8px"},children:[e.jsx("b",{children:"MoSCoW"})," classifica a obrigatoriedade: Obrigatório (Must), Importante (Should), Desejável (Could) e Não agora (Won't)."]}),e.jsxs("p",{style:{margin:"0 0 8px"},children:[e.jsx("b",{children:"RICE"})," dá um score objetivo:"," ",e.jsx("b",{children:"(Alcance à Impacto à Confiança) ÷ Esforço"}),". Confiança vai de 0 a 1 (ex.: 0,8 = 80%). Ordene a tabela por esse score para ver o que entrega mais valor por unidade de esforço."]}),e.jsxs("p",{style:{margin:0},children:[e.jsx("b",{children:"Kano"})," registra como o item é percebido pelo usuário (básico, desempenho, atrativo, indiferente ou reverso)."]})]}),terms:[{term:"Must",pt:"Obrigatório, sem ele a entrega falha",origin:"manual"},{term:"Reach",pt:"Alcance: quantas pessoas/eventos o item afeta",origin:"manual"},{term:"Impact",pt:"Impacto por pessoa afetada",origin:"manual"},{term:"Confidence",pt:"Confiança na estimativa (0 a 1)",origin:"manual"},{term:"Effort",pt:"Esforço estimado (pessoa-mês)",origin:"manual"},{term:"RICE",pt:"(Alcance à Impacto à Confiança) ÷ Esforço",origin:"calculated"}]})]})}function ze({rows:s,loading:p,temFiltroAtivo:n,sortRiceDesc:m,onToggleSort:c,onUpsert:i,onClear:l,onScoreItem:t}){return e.jsx("div",{className:"v2-t-wrap",children:e.jsxs("table",{className:"v2-clean",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Item"}),e.jsx("th",{style:{width:140},children:"MoSCoW"}),e.jsx("th",{style:{width:80},children:e.jsx(z,{sigla:"Reach",pt:"Alcance"})}),e.jsx("th",{style:{width:80},children:e.jsx(z,{sigla:"Impact",pt:"Impacto"})}),e.jsx("th",{style:{width:90},children:e.jsx(z,{sigla:"Conf.",pt:"Confiança (0 a 1)"})}),e.jsx("th",{style:{width:80},children:e.jsx(z,{sigla:"Effort",pt:"Esforço (pessoa-mês)"})}),e.jsx("th",{style:{width:110},children:e.jsxs("button",{type:"button",onClick:c,className:"v2-th-sort",title:`Ordenar por Score RICE (${m?"desc":"asc"})`,style:{display:"inline-flex",alignItems:"center",gap:4,background:"transparent",border:"none",cursor:"pointer",font:"inherit",color:"inherit"},children:[e.jsx(z,{sigla:"Score RICE",pt:"Pontuação"}),e.jsx(ke,{className:"h-3 w-3",style:{transform:m?"none":"scaleY(-1)"}})]})}),e.jsx("th",{style:{width:140},children:"Kano"}),e.jsx("th",{style:{width:70}})]})}),e.jsxs("tbody",{children:[s.map(a=>e.jsx(Re,{item:a,onUpsert:i,onClear:()=>l(a),onScore:()=>t(a)},`${a.projectId??""}|${a.itemType}|${a.itemRef}`)),s.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:9,children:e.jsx(H,{icon:e.jsx(Y,{className:"h-6 w-6"}),hasActiveFilters:n,title:p?"Carregandoâ¦":"Nenhum item para priorizar",description:p?void 0:"Os itens vêm do backlog e das atividades: vincule itens ao projeto para pontuá-los aqui.",filteredTitle:p?"Carregandoâ¦":"Nenhum item com esses filtros",filteredDescription:p?void 0:"Tente afrouxar os filtros acima."})})})]})]})})}function Re({item:s,onUpsert:p,onClear:n,onScore:m}){const c=i=>({type:"number",min:0,defaultValue:b(s[i]),className:"v2-input",style:{width:"100%",padding:"4px 6px",fontSize:12.5},onBlur:l=>{const t=l.target.value.trim(),a=t===""?null:Number(t),r=s[i]==null?null:Number(s[i]);a!==r&&p(s,{[i]:a})}});return e.jsxs("tr",{children:[e.jsxs("td",{children:[e.jsx("div",{style:{fontWeight:500},children:s.itemTitle??"(sem tÃtulo)"}),e.jsxs("div",{style:{fontSize:"var(--v2-text-xs)",color:"var(--v2-text-subtle)"},children:[s.projectName?`${s.projectName} · `:"",S[s.itemType],s.status?` · ${s.status}`:""]})]}),e.jsx("td",{children:e.jsxs("select",{className:`v2-badge ${s.moscow?f[s.moscow].cls:""}`,style:{border:"1px solid var(--v2-border)",cursor:"pointer",font:"inherit"},value:s.moscow??"",onChange:i=>p(s,{moscow:i.target.value||null}),"aria-label":"MoSCoW",children:[e.jsx("option",{value:"",children:"-"}),R.map(i=>e.jsx("option",{value:i,children:f[i].label},i))]})}),e.jsx("td",{children:e.jsx("input",{"aria-label":"Reach",...c("riceReach")},`r-${b(s.riceReach)}`)}),e.jsx("td",{children:e.jsx("input",{"aria-label":"Impact",...c("riceImpact")},`i-${b(s.riceImpact)}`)}),e.jsx("td",{children:e.jsx("input",{"aria-label":"Confidence",step:"0.05",max:1,...c("riceConfidence")},`c-${b(s.riceConfidence)}`)}),e.jsx("td",{children:e.jsx("input",{"aria-label":"Effort",step:"0.5",...c("riceEffort")},`e-${b(s.riceEffort)}`)}),e.jsx("td",{style:{fontFamily:"var(--v2-font-mono)",fontWeight:600,fontSize:13,color:s.rice==null?"var(--v2-text-subtle)":"var(--v2-text)"},children:s.rice==null?"-":s.rice}),e.jsx("td",{children:e.jsxs("select",{className:"v2-select",style:{padding:"4px 6px",fontSize:12.5},value:s.kano??"",onChange:i=>p(s,{kano:i.target.value||null}),"aria-label":"Kano",children:[e.jsx("option",{value:"",children:"-"}),K.map(i=>e.jsx("option",{value:i,children:y[i].label},i))]})}),e.jsx("td",{children:e.jsxs("div",{style:{display:"flex",gap:4,justifyContent:"flex-end"},children:[e.jsx("button",{className:"v2-icon-btn",onClick:m,"aria-label":"Pontuar item",title:"Pontuar este item (MoSCoW · RICE · Kano)",children:e.jsx(B,{className:"h-3 w-3",style:{color:"var(--v2-text-subtle)"}})}),s.scoreId&&e.jsx("button",{className:"v2-icon-btn",onClick:n,"aria-label":"Limpar pontuação",title:"Limpar pontuação deste item",children:e.jsx(Te,{className:"h-3 w-3",style:{color:"var(--v2-text-subtle)"}})})]})})]})}function Me({onTentarDeNovo:s}){return e.jsx("div",{className:"v2-card",children:e.jsx(H,{style:{padding:32},icon:e.jsx(Y,{className:"h-6 w-6"}),hasActiveFilters:!1,title:"Não foi possÃvel carregar a priorização",description:"O servidor não respondeu. Os itens continuam salvos; isto é uma falha de leitura.",action:e.jsx("button",{type:"button",className:"v2-btn",onClick:s,children:"Tentar de novo"})})})}
1function U({loading:s,temFiltroAtivo:p}){return e.jsx("div",{className:"v2-card",children:e.jsx(H,{style:{padding:32},icon:e.jsx(Y,{className:"h-6 w-6"}),hasActiveFilters:p,title:s?"Carregandoâ¦":"Nenhum item para priorizar",description:s?void 0:"Os itens vêm do backlog e das atividades: vincule itens ao projeto para pontuá-los aqui.",filteredTitle:s?"Carregandoâ¦":"Nenhum item com esses filtros",filteredDescription:s?void 0:"Tente afrouxar os filtros acima."})})}const We={must:"M",should:"S",could:"C",wont:"W"};function $e({rows:s,universo:p,loading:n,temFiltroAtivo:m,onScore:c,onScoreItem:i}){if(s.length===0)return e.jsx(U,{loading:n,temFiltroAtivo:m});const l=p.filter(t=>!t.moscow);return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[l.length>0&&e.jsx("div",{className:"v2-card v2-card-tight",children:e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,flexWrap:"wrap"},children:[e.jsxs("div",{children:[e.jsxs("div",{style:{fontWeight:700,fontSize:14,color:"var(--v2-text-strong)"},children:["Sem pontuação (",l.length,")"]}),e.jsxs("div",{style:{fontSize:12,color:"var(--v2-text-subtle)"},children:[l.length===1?"Este item ainda não foi":"Estes itens ainda não foram"," ","classificado",l.length===1?"":"s"," no MoSCoW: por isso não"," ",l.length===1?"aparece":"aparecem"," nos buckets abaixo."," ",p.length!==s.length?"A contagem é do resultado inteiro, não só desta página.":""]})]}),c&&e.jsx(w,{size:"sm",variant:"secondary",onClick:c,children:"Pontuar na aba Todos"})]})}),R.map(t=>{const a=f[t],r=s.filter(d=>d.moscow===t),x=p.filter(d=>d.moscow===t).length;return e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:10},children:[e.jsx("div",{style:{width:32,height:32,borderRadius:"var(--v2-radius-8)",background:"var(--v2-surface-muted)",border:"1.5px solid var(--v2-border)",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:800,fontSize:14,color:a.color},children:We[t]}),e.jsxs("div",{children:[e.jsxs("div",{style:{fontWeight:700,color:a.color,fontSize:14},children:[a.label," ",e.jsxs("span",{style:{fontWeight:600,color:"var(--v2-text-subtle)",fontSize:12.5},children:["· ",a.en]})]}),e.jsx("div",{style:{fontSize:12,color:"var(--v2-text-subtle)"},children:r.length===x?`${r.length} ${r.length===1?"item":"itens"}`:`${r.length} de ${x} nesta página`})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[r.map(d=>e.jsx("div",{className:"v2-card v2-card-tight",style:{borderLeft:`3px solid ${a.color}`},children:e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:8},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:600,color:"var(--v2-text-strong)",fontSize:13.5},children:d.itemTitle??"(sem tÃtulo)"}),e.jsxs("div",{style:{fontSize:"var(--v2-text-xs)",color:"var(--v2-text-subtle)",marginTop:2},children:[d.projectName?`${d.projectName} · `:"",S[d.itemType],d.status?` · ${d.status}`:""," · RICE:"," ",e.jsx("span",{style:{fontFamily:"var(--v2-font-mono)",fontWeight:600,color:d.rice==null?"var(--v2-text-subtle)":"var(--v2-color-primary-700)"},children:d.rice==null?"-":d.rice})]})]}),e.jsx(w,{size:"sm",variant:"ghost",leftIcon:e.jsx(B,{className:"h-3 w-3"}),onClick:()=>i(d),title:"Pontuar este item (MoSCoW · RICE · Kano)",children:"Pontuar"})]})},`${d.projectId??""}|${d.itemType}|${d.itemRef}`)),r.length===0&&e.jsx("div",{style:{color:"var(--v2-text-subtle)",fontSize:13,padding:"10px 0"},children:"Nenhum item nesta categoria"})]})]},t)})]})}function Pe({rows:s,loading:p,temFiltroAtivo:n,onScoreItem:m}){const c=j.useMemo(()=>[...s].sort((t,a)=>{const r=t.rice??-1,x=a.rice??-1;return r!==x?x-r:(t.itemTitle??"").localeCompare(a.itemTitle??"")}),[s]);if(s.length===0)return e.jsx(U,{loading:p,temFiltroAtivo:n});let i=-1;const l={padding:"10px 12px",textAlign:"right",fontFamily:"var(--v2-font-mono)",color:"var(--v2-text)"};return e.jsxs("div",{children:[e.jsx("div",{className:"v2-t-wrap",style:{overflowX:"auto"},children:e.jsxs("table",{style:{borderCollapse:"collapse",width:"100%",fontSize:13},children:[e.jsx("thead",{children:e.jsx("tr",{style:{borderBottom:"2px s
1olid var(--v2-border-strong)"},children:[{en:"#"},{en:"Item"},{en:"MoSCoW"},{en:"Reach",pt:"Alcance"},{en:"Impact",pt:"Impacto"},{en:"Conf.",pt:"Confiança"},{en:"Effort",pt:"Esforço"},{en:"Score RICE",pt:"Pontuação"},{en:"Kano"},{en:""}].map((t,a)=>e.jsxs("th",{style:{padding:"10px 12px",textAlign:t.en==="Item"||t.en==="#"||t.en==="MoSCoW"||t.en==="Kano"?"left":"right",fontWeight:600,fontSize:"var(--v2-text-xs)",color:"var(--v2-text-muted)",textTransform:"uppercase",letterSpacing:"0.06em",whiteSpace:"nowrap",verticalAlign:"bottom"},children:[e.jsx("div",{children:t.en}),t.pt&&e.jsx("div",{style:{fontSize:"var(--v2-text-xs)",fontWeight:500,color:"var(--v2-text-subtle)",textTransform:"none",letterSpacing:0,marginTop:1},children:t.pt})]},a))})}),e.jsx("tbody",{children:c.map((t,a)=>{t.rice!=null&&(i+=1);const r=t.rice==null?"var(--v2-text-subtle)":i<3?"var(--v2-color-primary-600)":i<6?"var(--v2-color-primary-400)":"var(--v2-text-muted)";return e.jsxs("tr",{style:{background:a%2===0?"transparent":"var(--v2-surface-sunken)",borderBottom:"1px solid var(--v2-border)"},children:[e.jsx("td",{style:{padding:"10px 12px",color:"var(--v2-text-subtle)",fontFamily:"var(--v2-font-mono)",fontSize:12},children:a+1}),e.jsxs("td",{style:{padding:"10px 12px",fontWeight:600,color:"var(--v2-text-strong)",maxWidth:320},children:[e.jsx("div",{children:t.itemTitle??"(sem tÃtulo)"}),e.jsxs("div",{style:{fontSize:"var(--v2-text-xs)",color:"var(--v2-text-subtle)",marginTop:2},children:[t.projectName?`${t.projectName} · `:"",S[t.itemType]]})]}),e.jsx("td",{style:{padding:"10px 12px"},children:t.moscow?e.jsx("span",{className:`v2-badge ${f[t.moscow].cls}`,children:f[t.moscow].label}):e.jsx("span",{style:{color:"var(--v2-text-subtle)"},children:"-"})}),e.jsx("td",{style:l,children:t.riceReach==null?"-":Number(t.riceReach)}),e.jsx("td",{style:l,children:t.riceImpact==null?"-":Number(t.riceImpact)}),e.jsx("td",{style:l,children:t.riceConfidence==null?"-":Number(t.riceConfidence)}),e.jsx("td",{style:l,children:t.riceEffort==null?"-":Number(t.riceEffort)}),e.jsx("td",{style:{padding:"10px 12px",textAlign:"right"},children:e.jsx("span",{style:{fontSize:15,fontWeight:800,fontFamily:"var(--v2-font-mono)",color:r},children:t.rice==null?"-":t.rice})}),e.jsx("td",{style:{padding:"10px 12px",color:"var(--v2-text-muted)",fontSize:12},children:t.kano?y[t.kano].label:"-"}),e.jsx("td",{style:{padding:"10px 12px"},children:e.jsx("button",{className:"v2-icon-btn",onClick:()=>m(t),"aria-label":"Pontuar item",title:"Pontuar este item (MoSCoW · RICE · Kano)",children:e.jsx(B,{className:"h-3 w-3",style:{color:"var(--v2-text-subtle)"}})})})]},`${t.projectId??""}|${t.itemType}|${t.itemRef}`)})})]})}),e.jsxs("div",{style:{marginTop:16,padding:"12px 16px",background:"var(--v2-color-primary-50)",borderRadius:"var(--v2-radius-8)",fontSize:12.5,color:"var(--v2-color-primary-800)"},children:[e.jsx("strong",{children:"RICE = (Alcance à Impacto à Confiança) ÷ Esforço."})," Alcance: pessoas/eventos atingidos · Impacto por pessoa · Confiança de 0 a 1 · Esforço em pessoa-mês. Score calculado no backend."]})]})}function Fe({rows:s,loading:p,temFiltroAtivo:n,onScoreItem:m}){if(s.length===0)return e.jsx(U,{loading:p,temFiltroAtivo:n});const c=s.filter(i=>i.kano);return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[c.length===0&&e.jsxs("div",{style:{color:"var(--v2-text-subtle)",fontSize:13,padding:"4px 0"},children:["Nenhum item classificado no Kano ainda: use a aba ",e.jsx("strong",{children:"Todos"})," para pontuar."]}),K.map(i=>{const l=y[i],t=s.filter(a=>a.kano===i);return t.length===0?null:e.jsxs("div",{children:[e.jsxs("div",{style:{marginBottom:8},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:3},children:[e.jsx("span",{style:{fontWeight:700,fontSize:14,color:l.color},children:l.label}),e.jsx("span",{className:"v2-badge",children:t.length})]}),e.jsx("div",{style:{fontSize:12,color:"var(--v2-text-subtle)"},children:l.desc})]}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:t.map(a=>e.jsxs("div",{className:"v2-card v2-card-tight",style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:600,color:"var(--v2-text-strong)",fontSize:13},children:a.itemTitle??"(sem tÃtulo)"}),e.jsxs("div",{style:{fontSize:"var(--v2-text-xs)",color:"var(--v2-text-subtle)",marginTop:2},children:[a.projectName?`${a.projectName} · `:"",S[a.itemType],a.moscow?e.jsxs(e.Fragment,{children:[" · MoSCoW: ",e.jsx("strong",{style:{color:f[a.moscow].color},children:f[a.moscow].label})]}):null]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexShrink:0},children:[e.jsx("span",{style:{fontSize:13,fontWeight:700,fontFamily:"var(--v2-font-mono)",color:a.rice==null?"var(--v2-text-subtle)":"var(--v2-color-primary-600)"},children:a.rice==null?"-":a.rice}),e.jsx("button",{className:"v2-icon-btn",onClick:()=>m(a),"aria-label":"Pontuar item",title:"Pontuar este item (MoSCoW · RICE · Kano)",children:e.jsx(B,{className:"h-3 w-3",style:{color:"var(--v2-text-subtle)"}})})]})]},`${a.projectId??""}|${a.itemType}|${a.itemRef}`))})]},i)})]})}function Be({item:s,onSubmit:p,onCancel:n,submitting:m}){const[c,i]=j.useState({moscow:s.moscow??"",riceReach:b(s.riceReach),riceImpact:b(s.riceImpact),riceConfidence:b(s.riceConfidence),riceEffort:b(s.riceEffort),kano:s.kano??"",notes:s.notes??""}),l=(r,x)=>i(d=>({...d,[r]:x})),t=r=>r.trim()===""?null:Number(r),a=()=>{p({moscow:c.moscow||null,riceReach:t(c.riceReach),riceImpact:t(c.riceImpact),riceConfidence:t(c.riceConfidence),riceEffort:t(c.riceEffort),kano:c.kano||null,notes:c.notes.trim()||null})};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"v2-col v2-gap-4",children:[e.jsxs("div",{style:{fontSize:12.5,color:"var(--v2-text-muted)"},children:[s.projectName?e.jsxs(e.Fragment,{children:["Projeto: ",e.jsx("b",{children:s.projectName})," ·"," "]}):null,S[s.itemType],s.status?` · ${s.status}`:""]}
1),e.jsxs("div",{className:"v2-grid-2",children:[e.jsxs("div",{className:"v2-field",children:[e.jsx("label",{className:"v2-field-label",children:"MoSCoW"}),e.jsxs("select",{className:"v2-select",value:c.moscow,onChange:r=>l("moscow",r.target.value),children:[e.jsx("option",{value:"",children:"Sem classificação"}),R.map(r=>e.jsxs("option",{value:r,children:[f[r].label," · ",f[r].en]},r))]})]}),e.jsxs("div",{className:"v2-field",children:[e.jsx("label",{className:"v2-field-label",children:"Kano"}),e.jsxs("select",{className:"v2-select",value:c.kano,onChange:r=>l("kano",r.target.value),children:[e.jsx("option",{value:"",children:"Sem classificação"}),K.map(r=>e.jsx("option",{value:r,children:y[r].label},r))]})]})]}),e.jsxs("div",{className:"v2-grid-2",children:[e.jsxs("div",{className:"v2-field",children:[e.jsx("label",{className:"v2-field-label",children:"Reach · Alcance"}),e.jsx("input",{className:"v2-input",type:"number",min:0,value:c.riceReach,onChange:r=>l("riceReach",r.target.value),placeholder:"Ex: 500"})]}),e.jsxs("div",{className:"v2-field",children:[e.jsx("label",{className:"v2-field-label",children:"Impact · Impacto"}),e.jsx("input",{className:"v2-input",type:"number",min:0,value:c.riceImpact,onChange:r=>l("riceImpact",r.target.value),placeholder:"Ex: 2"})]})]}),e.jsxs("div",{className:"v2-grid-2",children:[e.jsxs("div",{className:"v2-field",children:[e.jsx("label",{className:"v2-field-label",children:"Confidence · Confiança (0 a 1)"}),e.jsx("input",{className:"v2-input",type:"number",min:0,max:1,step:"0.05",value:c.riceConfidence,onChange:r=>l("riceConfidence",r.target.value),placeholder:"Ex: 0.8"})]}),e.jsxs("div",{className:"v2-field",children:[e.jsx("label",{className:"v2-field-label",children:"Effort · Esforço (pessoa-mês)"}),e.jsx("input",{className:"v2-input",type:"number",min:0,step:"0.5",value:c.riceEffort,onChange:r=>l("riceEffort",r.target.value),placeholder:"Ex: 1.5"})]})]}),e.jsxs("div",{className:"v2-field",children:[e.jsx("label",{className:"v2-field-label",children:"Notas"}),e.jsx("textarea",{className:"v2-input",style:{minHeight:56,resize:"vertical"},value:c.notes,onChange:r=>l("notes",r.target.value),placeholder:"Contexto da pontuação (opcional)â¦"})]})]}),e.jsxs("div",{className:"v2-mt-6",style:{display:"flex",justifyContent:"flex-end",gap:8},children:[e.jsx(w,{variant:"ghost",onClick:n,children:"Cancelar"}),e.jsx(w,{onClick:a,disabled:m,children:"Salvar pontuação"})]})]})}export{oo as default}; 2//# sourceMappingURL=priorizacao-DKM4EO2C.js.map
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.