const i=["Draft","Scoped","Planned","InProgress","Released","Deployed","Completed","Blocked","Cancelled"],l=["Feature","Bug","Refactor","Research","Chore","Initiative"],o=["P0","P1","P2","P3"],u=["Inbox","Triaged","Refining","ReadyForPlanning","ReadyForDispatch","Dispatched"],p=["XS","S","M","L","XL"],h=[{key:"all",label:"All",description:"All backlog items"},{key:"inbox",label:"Inbox",description:"Needs triage or refinement"},{key:"planning",label:"Ready For Planning",description:"Ready for a repository-aware plan"},{key:"dispatch",label:"Ready For Dispatch",description:"Ready to launch work"},{key:"blocked",label:"Blocked",description:"Blocked or dependency-constrained"}];function r(a){return a.split(/\r?\n|,/).map(n=>n.trim()).filter(Boolean)}function c(a){return(a||[]).join(`
`)}function d(a){return(a||[]).map(n=>`${n.playbookId}:${n.deliveryMode}`).join(`
`)}function f(a){return r(a).map(n=>{const[s,t]=n.split(":",2).map(e=>e.trim());return s?{playbookId:s,deliveryMode:t||"InlineFullContent"}:null}).filter(n=>n!==null)}function g(a){const n=[];return n.push(`Backlog Item: ${a.title}`),n.push(`Kind: ${a.kind}`),n.push(`Priority: ${a.priority}`),n.push(`Backlog State: ${a.backlogState}`),a.description&&(n.push(""),n.push("Context"),n.push(a.description)),a.refinementSummary&&(n.push(""),n.push("Refinement Summary"),n.push(a.refinementSummary)),a.acceptanceCriteria.length>0&&(n.push(""),n.push("Acceptance Criteria"),a.acceptanceCriteria.forEach(s=>n.push(`- ${s}`))),a.nonGoals.length>0&&(n.push(""),n.push("Non-Goals"),a.nonGoals.forEach(s=>n.push(`- ${s}`))),a.rolloutConstraints.length>0&&(n.push(""),n.push("Rollout Constraints"),a.rolloutConstraints.forEach(s=>n.push(`- ${s}`))),n.push(""),n.push("Turn this refined backlog item into a practical implementation plan, call out risks, and identify the best dispatch shape."),n.join(`
`)}function m(a){const n=[];return n.push(`Implement backlog item: ${a.title}`),a.description&&(n.push(""),n.push(a.description)),a.refinementSummary&&(n.push(""),n.push("Refinement Summary"),n.push(a.refinementSummary)),a.acceptanceCriteria.length>0&&(n.push(""),n.push("Acceptance Criteria"),a.acceptanceCriteria.forEach(s=>n.push(`- ${s}`))),a.nonGoals.length>0&&(n.push(""),n.push("Non-Goals"),a.nonGoals.forEach(s=>n.push(`- ${s}`))),a.rolloutConstraints.length>0&&(n.push(""),n.push("Constraints"),a.rolloutConstraints.forEach(s=>n.push(`- ${s}`))),n.join(`
`)}function k(a){const n=[];return n.push(`Backlog-derived release notes for ${a.title}`),a.description&&(n.push(""),n.push(a.description)),a.refinementSummary&&(n.push(""),n.push("Refinement Summary"),n.push(a.refinementSummary)),a.acceptanceCriteria.length>0&&(n.push(""),n.push("Acceptance Criteria"),a.acceptanceCriteria.forEach(s=>n.push(`- ${s}`))),a.rolloutConstraints.length>0&&(n.push(""),n.push("Rollout Constraints"),a.rolloutConstraints.forEach(s=>n.push(`- ${s}`))),a.evidenceLinks.length>0&&(n.push(""),n.push("Evidence Links"),a.evidenceLinks.forEach(s=>n.push(`- ${s}`))),n.join(`
`)}function y(a){return a.status==="Blocked"||a.blockedByObjectiveIds.length>0?"blocked":a.backlogState==="ReadyForDispatch"||a.backlogState==="Dispatched"?"dispatch":a.backlogState==="ReadyForPlanning"?"planning":a.backlogState==="Inbox"||a.backlogState==="Triaged"||a.backlogState==="Refining"?"inbox":"all"}function S(a){switch(a){case"P0":return 0;case"P1":return 1;case"P2":return 2;case"P3":return 3;default:return 99}}export{h as B,l as O,S as a,o as b,u as c,p as d,i as e,g as f,y as g,m as h,k as i,d as j,c as k,f as p,r as s};
