PageSourceSearch

https://slovonline.ru/assets/PlanningView-B3gsSdkF.js

js slovonline.ru collected 2026-10-02 20:48:52 UTC 22,513 bytes, 1 lines download raw bytes

1import{r as h,j as e,e as je}from"./vendor-CIikcnY8.js";import{u as se,c as ue,x as Ne,d as ge,e as we,b as F,y as fe,P as z,A as Z,D as le,m as te,S as be,z as ye,f as ie,B as ke,l as re,C as ve}from"./index-CGFDy_im.js";import{R as ne}from"./bits-CxfvXRFo.js";import{u as Ce,M as ce}from"./MentionMenu-_LkEDqRp.js";import"./mentions-Z6-aGvF_.js";const de=["on_track","at_risk","stuck","done","dropped"],ae={on_track:"To plan",at_risk:"At risk",stuck:"Not moving",done:"Achieved",dropped:"Cancelled"},Oe=10,he="orgami:goals-open",xe=()=>new Date().toISOString().slice(0,10);function oe(){const t=new Date,p=N=>N.toISOString().slice(0,10),u=(N,j)=>p(new Date(Date.UTC(N,j,1))),m=(N,j)=>p(new Date(Date.UTC(N,j+1,0))),d=t.getUTCFullYear(),r=t.getUTCMonth(),x=Math.floor(r/3)*3;return[{label:"This month",startsOn:u(d,r),endsOn:m(d,r)},{label:"This quarter",startsOn:u(d,x),endsOn:m(d,x+2)},{label:"Next quarter",startsOn:u(d,x+3),endsOn:m(d,x+5)},{label:"Half a year",startsOn:u(d,r),endsOn:m(d,r+5)},{label:"This year",startsOn:u(d,0),endsOn:m(d,11)}]}function pe(t){if(t.state==="done"||t.state==="dropped")return 0;const p=d=>{const r=new Date(Date.UTC(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()));return r.setUTCDate(r.getUTCDate()-(r.getUTCDay()+6)%7),r.getTime()},u=t.lastWeek?Date.parse(`${t.lastWeek}T00:00:00Z`):p(new Date(`${t.startsOn}T00:00:00Z`)),m=Math.floor((p(new Date)-u)/(7*864e5));return Math.max(0,m)}function Le({companies:t,people:p,projects:u,tools:m,tasks:d,taskActions:r,onOpenTask:x,onOpenHolder:N,onCreateProject:j,onStatus:C,fail:f}){const g=se(),{can:T}=ue(),w=T("planning.create"),[k,v]=h.useState([]),[b,i]=h.useState("open"),[n,S]=h.useState(!1),[P,o]=h.useState(!1),[y,I]=h.useState(""),[M,B]=h.useState(()=>Ne(he)),A=s=>B(l=>{const c=s(l);return fe(he,c),c}),L=()=>F.planning().then(s=>v(s.goals)).catch(f);h.useEffect(()=>{L()},[]),ge(L);const H=h.useMemo(()=>new Map(p.map(s=>[s.id,s])),[p]),G=h.useMemo(()=>[...u,...m],[u,m]),_=h.useMemo(()=>new Map(G.map(s=>[s.id,s])),[G]),q=s=>u.some(l=>l.id===s)?"project":"tool",Q=s=>s.state==="done"||s.state==="dropped"||s.endsOn<xe(),D=y.trim().toLowerCase(),J=s=>!D||[s.title,s.detail,...s.steps.map(l=>l.title),...s.holders.map(l=>_.get(l.id)?.name??"")].some(l=>!!l&&l.toLowerCase().includes(D))||d.some(l=>l.goalId===s.id&&l.title.toLowerCase().includes(D)),O=k.filter(s=>(b==="all"?!0:b==="over"?Q(s):!Q(s))&&J(s)),K=s=>!!D&&!s.title.toLowerCase().includes(D),U=O.length>0&&O.every(s=>M.has(s.id)),Y=k.filter(s=>!Q(s)),X=Y.filter(s=>s.state==="at_risk"||s.state==="stuck").length,R=async(s,l)=>{v(c=>c.map($=>$.id===s?{...$,...l}:$));try{const c=await F.updateGoal(s,l);v($=>$.map(V=>V.id===s?c:V)),C("Saved")}catch(c){f(c),L()}};async function E(s){o(!0);try{const l=await F.createGoal(s);v(c=>
1[...c,l]),A(c=>new Set(c).add(l.id)),S(!1),C("Added")}catch(l){f(l)}finally{o(!1)}}async function ee(s){if(await ie(g("Delete the goal “{name}”?",{name:s.title}),{okLabel:"Delete",danger:!0}))try{await F.deleteGoal(s.id),v(l=>l.filter(c=>c.id!==s.id)),C("Deleted")}catch(l){f(l)}}async function W(s){const l=s.carriedOver?g("Carry “{name}” into the next quarter? It has already been carried over {n} times.",{name:s.title,n:s.carriedOver}):g("Carry “{name}” into the next quarter?",{name:s.title});if(await ie(l,{okLabel:"Carry over"}))try{const c=await F.carryGoal(s.id);v($=>$.map(V=>V.id===s.id?c:V)),C("Carried over")}catch(c){f(c),L()}}async function a(s,l){const c=await j(l,s.companyId);c&&(await R(s.id,{holders:[...s.holders,{kind:"project",id:c.id}]}),N(c.id))}return e.jsxs("div",{className:"planning",children:[e.jsxs("header",{className:"plan-head",children:[e.jsx("div",{className:"tabs","data-help":"goal-scope",role:"tablist","aria-label":g("Which goals"),children:["open","all","over"].map(s=>e.jsxs("button",{type:"button",role:"tab","aria-selected":b===s,className:b===s?"on":"",onClick:()=>i(s),children:[g(s==="open"?"Running":s==="all"?"All":"Finished"),s==="open"&&Y.length>0&&e.jsx("span",{className:"count",children:Y.length})]},s))}),k.length>0&&e.jsx("input",{className:"team-search","data-find":!0,value:y,onChange:s=>I(s.target.value),onKeyDown:we(y,()=>I("")),placeholder:g("Search the goals…")}),X>0&&e.jsx("p",{className:"hint",children:g("{n} need attention",{n:X})}),Y.length>Oe&&e.jsx("span",{className:"gap warn",children:g("More than ten goals is a to-do list — nobody checks against it")}),O.length>0&&e.jsx("button",{type:"button",className:"link",onClick:()=>A(s=>{const l=new Set(s);for(const c of O)U?l.delete(c.id):l.add(c.id);return l}),children:g(U?"Collapse all":"Expand all")}),w&&e.jsx("button",{type:"button",className:"btn primary","data-help":"goal-new","data-hotkey":"new",disabled:P,onClick:()=>S(!0),children:g("+ Goal")})]}),w&&n&&e.jsx(Te,{companies:t,people:p,busy:P,onClose:()=>S(!1),onCreate:E}),O.length===0&&e.jsx("p",{className:"hint pad",children:k.length===0?g("No goals yet. Five to ten at a time is plenty — they are what everything else is measured against."):g(D?"Nothing matches":"Nothing here. Look at “All”.")}),e.jsx("ul",{className:"goal-list","data-help":"goal-list",children:O.map(s=>e.jsx($e,{goal:s,open:M.has(s.id)||K(s),onToggle:()=>A(l=>ve(l,s.id)),companies:t,people:p,tasks:d,taskActions:r,onOpenTask:x,personById:H,everything:G,holderById:_,tools:m,kindOf:q,onPatch:l=>R(s.id,l),onOpenHolder:N,onNewProject:l=>a(s,l),onDelete:()=>ee(s),onCarry:()=>W(s)},s.id))})]})}function Te({companies:t,people:p,busy:u,onClose:m,onCreate:d}){const r=se(),[x,N]=h.useState(""),[j,C]=h.useState(""),[f,g]=h.useState(""),[T,w]=h.useState(""),[k,v]=h.useState(()=>oe()[0]),b=()=>{x.trim()&&d({title:x.trim(),detail:j.trim(),companyId:f||null,ownerPersonId:T||null,startsOn:k.startsOn,endsOn:k.endsOn})};return je.createPortal(e.jsx("div",{className:"modal-back",onMouseDown:m,children:e.jsxs("div",{className:"modal new-goal",role:"dialog","aria-label":r("New goal"),onMouseDown:i=>i.stopPropagation(),children:[e.jsxs("header",{className:"panel-head",children:[e.jsx("h3",{children:r("New goal")}),e.jsx("button",{type:"button",className:"icon-btn",title:r("Close"),onClick:m,children:"×"})]}),e.jsxs("div",{className:"panel-body ng-body",children:[e.jsxs("label",{className:"ng-row",children:[e.jsx("span",{className:"nt-label",children:r("The goal")}),e.jsx("input",{autoFocus:!0,maxLength:300,value:x,placeholder:r("What has to be true by the end of the period…"),onChange:i=>N(i.target.value),onKeyDown:i=>{i.key==="Enter"&&b()}})]}),e.jsxs("label",{className:"ng-row",children:[e.jsx("span",{className:"nt-label",children:r("What it means")}),e.jsx("textarea",{rows:3,value:j,placeholder:r("How anybody will know it is reached…"),onChange:i=>C(i.target.value)})]}),e.jsxs("div",{className:"ng-pair",children:[e.jsxs("div",{className:"ng-row",children:[e.jsx("span",{className:"nt-label",children:r("Whose goal")}),e.jsx(z,{className:"ng-pick",value:f,options:[{value:"",label:r("The whole group")},...t.map(i=>({value:i.id,label:i.name}))],onChange:g,children:e.jsx("span",{className:f?"":"muted",children:t.find(i=>i.id===f)?.name??r("The whole group")})})]}),e.jsxs("div",{className:"ng-row",children:[e.jsx("span",{className:"nt-label",children:r("Who answers for it")}),e.jsx(z,{className:"ng-pick",value:T,searchPlaceholder:r("Search a person…"),options:[{value:"",label:r("— nobody yet —")},...p.filter(i=>i.fullName&&!i.plannedOut).map(i=>({value:i.id,label:i.fullName,sub:i.title,icon:e.jsx(Z,{person:i,size:22})}))],onChange:w,children:T&&p.find(i=>i.id===T)?e.jsxs("span",{className:"goal-owner",children:[e.jsx(Z,{person:p.find(i=>i.id===T),size:20})," ",p.find(i=>i.id===T).fullName]}):e.jsx("span",{className:"muted",children:r("— nobody yet —")})})]})]}),e.jsxs("div",{className:"ng-row",children:[e.jsx("span",{className:"nt-label",children:r("By when")}),e.jsxs("div",{className:"ng-when",children:[oe().map(i=>e.jsx("button",{type:"button",className:`goal-chip ${k.startsOn===i.startsOn&&k.endsOn===i.endsOn?"on":""}`,onClick:()=>v(i),children:r(i.label)},i.label)),e.jsxs("span",{className:"ng-own-date",children:[e.jsx("span",{className:"hint",children:r("or a date of its own")}),e.jsx(le,{value:k.endsOn,clearable:!1,onChange:i=>i&&v({...k,endsOn:i}),title:r("To")})]})]})]})]}),e.jsxs("div",{className:"actions ng-actions",children:[e.jsx("button",{type:"button",className:"btn",onClick:m,children:r("Cancel")}),e.jsx("button",{type:"button",className:"btn primary","data-hotkey":"save submit",disabled:u||!x.trim(),onClick:b,children:r("+ Goal")})]})]})}),document.body)}function Se({goalId:t,state:p,readOnly:u=!1}){const m=se(),[d,r]=h.useState(""),[x,N]=h.useState(null),[j,C]=h.useState(""),[f,g]=h.useState(!1),[T,w]=h.useState(!1),k=h.useRef(null),v=Ce({box:k,value:j,onChange:o=>C(o)});h.useEffect(()=>{let o=!0;return F.goalUpdates(t).then(y=>{o&&(r(y.week),N(y.updates),C(y.updates.find(I=>I.week===y.week)?.body??""))},()=>o&&N([])),()=>{o=!1}},[t]);const b=x?.find(o=>o.week===d)??null,i=(x??[]).filter(o=>o.week!==d),n=re(m.lang),S=o=>{const y=new Date(`${o}T00:00:00Z`),I=new Date(y.getTime()+6*864e5),M=B=>B.toLocaleDateString(n,{day:"numeric",month:"short",timeZone:"UTC"});return`${M(y)} — ${M(I)}`};async function P(){const o=j.trim();if(!(!o||o===b?.body)){w(!0);try{const y=await F.writeGoalUpdate(t,{body:o,state:p});N(I=>[y,...(I??[]).filter(M=>M.week!==y.week)])}finally{w(!1)}}}return e.jsxs("div",{className:"goal-reports",children:[e.jsxs("div",{className:"goal-work-head",children:[e.jsx("span",{className:"panel-label",children:m("This week")}),e.jsxs("span",{className:"hint",children:[S(d||new Date().toISOString().slice(0,10)),b?` · ${m("written by {who}",{who:b.byName??"—"})}`:` · ${m("not written yet")}`]})]}),u?b&&e.jsx("p",{className:"goal-report-body",children:e.jsx(ce,{text:b.body})}):e.jsxs(e.Fragment,{children:[e.jsx("textarea",{ref:k,className:"goal-report-box",rows:b||j?3:2,value:j,placeholder:m("How is it going, in your own words…"),onChange:o=>{C(o.target.value),v.onType(o.target.value,o.target.selectionStart)},onBlur:P,onKeyDown:o=>{v.onKeyDown(o)||o.key==="Enter"&&(o.metaKey||o.ctrlKey)&&o.target.blur()}}),v.menu]}),T&&e.jsx("span",{className:"hint",children:m("Saving…")}),i.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"goal-report-more","aria-expanded":f,onClick:()=>g(o=>!o),children:[e.jsx("span",{"aria-hidden":"true",children:f?"▾":"▸"}),m("Earlier weeks"),e.jsx("span",{className:"hint",children:i.length})]}),f&&e.jsx("ul",{className:"goal-report-list",children:i.map(o=>e.jsxs("li",{children:[e.jsx("span",{className:"goal-report-when",children:S(o.week)}),e.jsx("span",{className:"goal-report-body",children:e.jsx(ce,{text:o.body})}),e.jsx("span",{className:"hint",children:o.byName})]},o.id))})]})]})}function De(t,p){const u=new Date(t);return Number.isNaN(u.getTime())?t:u.toLocaleDateString(re(p),{day:"numeric",month:"short",year:"numeric"})}function me(t,p,u){const m=re(u),d=new Date(`${t}T00:00:00Z`),r=new Date(`${p}T00:00:00Z`),x=(j,C=!1)=>j.toLocaleDateString(m,{month:C?"long":"short",timeZone:"UTC"}),N=d.getUTCFullYear()===r.getUTCFullYear();return N&&d.getUTCMonth()===r.getUTCMonth()?`${x(d,!0)} ${r.getUTCFullYear()}`:`${x(d)}${N?"":` ${d.getUTCFullYear()}`} — ${x(r)} ${r.getUTCFullYear()}`}function $e({goal:t,open:p,onToggle:u,companies:m,people:d,tasks:r,taskActions:x,onOpenTask:N,personById:j,everything:C,holderById:f,tools:g,kindOf:T,onPatch:w,onOpenHolder:k,onNewProject:v,onDelete:b,onCarry:i}){const n=se(),{can:S,me:P}=ue(),o=S("planning.update"),y=S("planning.delete"),I=S("tasks.create"),M=a=>ke(P,a.kind,"update"),B=o&&S("projects.create"),[A,L]=h.useState(""),[H,G]=h.useState(""),_=h.useRef(!1),[q,Q]=h.useState(!1),D=h.useMemo(()=>r.filter(a=>a.goalId===t.id),[r,t.id]),J=h.useMemo(()=>{const a=new Set(t.holders.map(s=>s.id));return r.filter(s=>s.goalId===t.id||a.has(s.projectId??s.toolId??""))},[r,t.id,t.holders]),O=h.useMemo(()=>{const a=new Map;for(const s of J){const l=new Set([...s.assigneeIds,...s.people.map(c=>c.personId)].filter(c=>!!c));for(const c of l){const $=a.get(c)??{tasks:0,done:0};$.tasks++,s.state==="done"&&$.done++,a.set(c,$)}}return[...a.entries()].map(([s,l])=>({person:j.get(s),...l})).filter(s=>!!s.person).sort((s,l)=>l.tasks-s.tasks)},[J,j]),[K,U]=h.useState(null),[Y,X]=h.useState(!1),R=t.steps.filter(a=>a.done).length,E=t.endsOn<xe()&&t.state!=="done"&&t.state!=="dropped",ee=a=>a&&m.find(s=>
1s.id===a)?.name||"",W=a=>w({steps:a});return e.jsxs("li",{className:`goal ${t.state} ${p?"open":"folded"}`,onContextMenu:ye(()=>[o&&{heading:n("State")},...o?de.map(a=>({label:n(ae[a]),checked:t.state===a,run:()=>t.state!==a&&w({state:a})})):[],{divider:!0},o&&E&&{label:n("Carry into the next quarter"),run:i},y&&{label:n("Delete"),danger:!0,run:b}]),children:[e.jsxs("header",{className:"goal-head",children:[e.jsx("button",{type:"button",className:`goal-twist ${p?"on":""}`,"aria-expanded":p,"aria-label":n(p?"Collapse":"Expand"),title:n(p?"Collapse":"Expand"),onClick:u,children:e.jsx("span",{"aria-hidden":"true",children:"▸"})}),e.jsx("span",{className:`goal-ring ${t.progress.percent===null?"empty":t.progress.percent>=100?"full":""}`,style:{"--pct":`${t.progress.percent??0}%`},title:n("{steps} of {allSteps} steps · {tasks} of {allTasks} tasks",{steps:t.progress.stepsDone,allSteps:t.progress.steps,tasks:t.progress.tasksDone,allTasks:t.progress.tasks}),children:e.jsx("span",{className:"goal-ring-n",children:t.progress.percent===null?"—":`${t.progress.percent}%`})}),e.jsx(te,{className:"goal-title",oneClick:!0,readOnly:!o,value:t.title,placeholder:n("The goal"),onCommit:a=>a.trim()&&w({title:a.trim()})}),o?e.jsx(z,{className:`goal-status ${t.state}`,value:t.state,options:de.map(a=>({value:a,label:n(ae[a])})),onChange:a=>w({state:a}),children:e.jsx("span",{children:n(ae[t.state])})}):e.jsx(ne,{className:`goal-status ${t.state}`,children:e.jsx("span",{children:n(ae[t.state])})})]}),p&&e.jsx(te,{className:"goal-detail",oneClick:!0,multiline:!0,readOnly:!o,value:t.detail,placeholder:n("What it means, in a sentence…"),onCommit:a=>w({detail:a})}),e.jsxs("div",{className:"goal-meta",children:[o?e.jsxs("button",{type:"button",className:`goal-period ${E?"late":""}`,onClick:()=>X(a=>!a),title:`${t.startsOn} — ${t.endsOn}`,children:[me(t.startsOn,t.endsOn,n.lang),E&&` · ${n("overdue")}`]}):e.jsxs("span",{className:`goal-period ${E?"late":""}`,title:`${t.startsOn} — ${t.endsOn}`,children:[me(t.startsOn,t.endsOn,n.lang),E&&` · ${n("overdue")}`]}),pe(t)>0&&e.jsx("span",{className:"gap warn",title:n("A goal is spoken about once a week — by whoever answers for it"),children:t.lastWeek?n("silent for {n} weeks",{n:pe(t)}):n("nothing said about it yet")}),t.carriedOver>0&&e.jsx("span",{className:"goal-carried",title:n("It has been carried into another quarter {n} times",{n:t.carriedOver}),children:n("carried over ×{n}",{n:t.carriedOver})}),o?e.jsx(z,{className:"goal-pick",value:t.companyId??"",options:[{value:"",label:n("The whole group")},...m.map(a=>({value:a.id,label:a.name}))],onChange:a=>w({companyId:a||null}),children:e.jsx("span",{className:t.companyId?"":"muted",children:ee(t.companyId)||n("The whole group")})}):e.jsx(ne,{className:"goal-pick",children:e.jsx("span",{className:t.companyId?"":"muted",children:ee(t.companyId)||n("The whole group")})}),(()=>{const a=t.ownerPersonId&&j.get(t.ownerPersonId)?e.jsxs("span",{className:"goal-owner",children:[e.jsx(Z,{person:j.get(t.ownerPersonId),size:20})," ",j.get(t.ownerPersonId).fullName]}):e.jsx("span",{className:"muted matrix-warn",children:n("nobody answers for it")});return o?e.jsx(z,{className:"goal-pick",value:t.ownerPersonId??"",searchPlaceholder:n("Search a person…"),options:[{value:"",label:n("— nobody yet —")},...d.filter(s=>s.fullName&&!s.plannedOut).map(s=>({value:s.id,label:s.fullName,sub:s.title,icon:e.jsx(Z,{person:s,size:22})}))],onChange:s=>w({ownerPersonId:s||null}),children:a}):e.jsx(ne,{className:"goal-pick",children:a})})()]}),o&&Y&&e.jsxs("div",{className:"goal-dates",children:[oe().map(a=>e.jsx("button",{type:"button",className:`goal-chip ${t.startsOn===a.startsOn&&t.endsOn===a.endsOn?"on":""}`,onClick:()=>w({startsOn:a.startsOn,endsOn:a.endsOn}),children:n(a.label)},a.label)),e.jsx(le,{value:t.startsOn,clearable:!1,onChange:a=>a&&w({startsOn:a}),title:n("From")}),e.jsx(le,{value:t.endsOn,clearable:!1,onChange:a=>a&&w({endsOn:a}),title:n("To")})]}),p&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"goal-doing",children:[e.jsxs("div",{className:"goal-doing-head",children:[e.jsx("span",{className:"panel-label",children:n("Work on the goal")}),e.jsxs("span",{className:"hint",children:[t.progress.tasks>0?n("{done} of {all} tasks done",{done:t.progress.tasksDone,all:t.progress.tasks}):n("no tasks yet"),t.progress.recurring>0&&` · ${n("{n} recurring",{n:t.progress.recurring})}`]})]}),D.length>0&&e.jsxs("ul",{className:"goal-tasks",children:[D.slice(0,8).map(a=>e.jsxs("li",{children:[e.jsxs("button",{type:"button",className:"goal-task","data-ctx":`task:${a.id}`,onClick:()=>N(a.id),children:[e.jsx(be,{state:a.state,size:12}),e.jsx("span",{className:`goal-task-title ${a.state==="done"?"done":""}`,children:a.title}),a.kind==="recurring"&&e.jsx("span",{className:"goal-task-mark",children:n("recurring")}),a.dueOn&&e.jsx("span",{className:`goal-task-when ${a.late?"late":""}`,children:a.dueOn.split("-").reverse().join(".")})]}),M(a)&&e.jsx("button",{type:"button",className:"icon-btn small",title:n("Take it off the goal"),onClick:()=>x.patch(a.id,{goalId:null}),children:"×"})]},a.id)),D.length>8&&e.jsx("li",{className:"hint pad",children:n("and {n} more",{n:D.length-8})})]}),I&&e.jsx("input",{className:"goal-step-add",value:H,placeholder:n("+ A task for this goal"),onChange:a=>G(a.target.value),onKeyDown:async a=>{if(a.key!=="Enter"||!H.trim()||_.current)return;_.current=!0;const s=await x.create({title:H.trim(),goalId:t.id,departmentId:null});_.current=!1,s&&G("")}})]}),e.jsxs("div",{className:`goal-steps ${t.steps.length?"filled":""}`,children:[t.steps.length>0&&e.jsxs("div",{className:"goal-steps-head",children:[e.jsx("span",{className:"panel-label",children:n("What has to happen")}),e.jsxs("span",{className:"goal-progress",title:n("{done} of {all}",{done:R,all:t.steps.length}),children:[e.jsx("span",{className:"goal-bar",children:e.jsx("span",{style:{width:`${Math.round(R/t.steps.length*100)}%`}})}),n("{done} of {all}",{done:R,all:t.steps.length})]})]}),t.steps.map(a=>e.jsxs("label",{className:"goal-step",children:[o?e.jsx("input",{type:"checkbox",checked:a.done,onChange:s=>W(t.steps.map(l=>l.id===a.id?{...l,done:s.target.checked}:l))}):e.jsx("span",{className:`tick ${a.done?"on":""}`,role:"img","aria-label":a.done?n("Done"):n("To do")}),e.jsx(te,{className:`goal-step-title ${a.done?"done":""}`,readOnly:!o,value:a.title,placeholder:n("What has to happen"),onCommit:s=>s.trim()?W(t.steps.map(l=>l.id===a.id?{...l,title:s.trim()}:l)):W(t.steps.filter(l=>l.id!==a.id))}),o&&e.jsx("button",{type:"button",className:"icon-btn small",title:n("Remove"),onClick:()=>W(t.steps.filter(s=>s.id!==a.id)),children:"×"})]},a.id)),o&&e.jsx("input",{className:"goal-step-add",value:A,placeholder:t.steps.length?n("+ Step"):n("+ What has to happen for this to be true"),onChange:a=>L(a.target.value),onKeyDown:a=>{a.key!=="Enter"||!A.trim()||(W([...t.steps,{title:A.trim(),done:!1}]),L(""))}})]}),e.jsx(Se,{goalId:t.id,state:t.state,readOnly:!o}),O.length>0&&e.jsxs("div",{className:`goal-crew ${q?"open":""}`,children:[e.jsxs("button",{type:"button",className:"goal-crew-head","aria-expanded":q,onClick:()=>Q(a=>!a),children:[e.jsx("span",{className:"goal-crew-arrow","aria-hidden":"true",children:q?"▾":"▸"}),e.jsx("span",{className:"panel-label",children:n("Who is working on it")}),e.jsxs("span",{className:"goal-crew-faces",children:[O.slice(0,5).map(a=>e.jsx(Z,{person:a.person,size:20,title:a.person.fullName},a.person.id)),O.length>5&&e.jsxs("span",{className:"goal-crew-more",children:["+",O.length-5]})]}),e.jsx("span",{className:"hint",children:n("{n} people",{n:O.length})})]}),q&&e.jsx("ul",{className:"goal-crew-list",children:O.map(a=>e.jsxs("li",{children:[e.jsx(Z,{person:a.person,size:22}),e.jsx("span",{className:"goal-crew-name",children:a.person.fullName}),e.jsx("span",{className:"hint",children:a.person.title}),e.jsx("span",{className:"goal-crew-n",children:n("{done} of {all}",{done:a.done,all:a.tasks})})]},a.person.id))})]}),e.jsxs("div",{className:"goal-work",children:[e.jsxs("div",{className:"goal-work-head",children:[e.jsx("span",{className:"panel-label",children:n("Works on it")}),t.holders.length>0&&e.jsx("span",{className:"hint",children:n("{n} projects",{n:t.holders.length})})]}),e.jsxs("div",{className:"goal-work-row",children:[t.holders.map(a=>e.jsx("button",{type:"button",className:`goal-chip ${f.get(a.id)?.routine?"routine":""}`,"data-ctx":`holder:${a.id}`,title:n("Open"),onClick:()=>k(a.id),children:f.get(a.id)?.name||n("Untitled")},a.id)),o&&e.jsx(z,{className:"goal-pick add",value:"",keepOpen:!0,searchPlaceholder:n("Search…"),options:C.map(a=>({value:a.id,label:a.name,sub:g.some(s=>s.id===a.id)?n("Tool"):n("Project"),icon:e.jsx("span",{className:`tick ${t.holders.some(s=>s.id===a.id)?"on":""}`,"aria-hidden":"true"})})),onChange:a=>{const s=t.holders.some(l=>l.id===a);w({holders:s?t.holders.filter(l=>l.id!==a):[...t.holders,{kind:T(a),id:a}]})},children:e.jsx("span",{className:"hint",children:t.holders.length?n("+ more"):n("+ Existing work")})}),B?K===null?e.jsx("button",{type:"button",className:"link",onClick:()=>U(""),children:n("+ New project for it")}
1):e.jsx("input",{className:"goal-step-add",autoFocus:!0,value:K,placeholder:n("Name of the project…"),onChange:a=>U(a.target.value),onBlur:()=>U(null),onKeyDown:a=>{a.key==="Escape"&&U(null),!(a.key!=="Enter"||!K.trim())&&(v(K.trim()),U(null))}}):null]})]}),e.jsxs("footer",{className:"goal-foot",children:[t.note?e.jsx("span",{className:"goal-note hint",children:t.note}):e.jsx("span",{}),e.jsxs("span",{className:"goal-foot-right",children:[t.stateAt&&e.jsx("span",{className:"hint",children:n("as of {date}",{date:De(t.stateAt,n.lang)})}),o&&E&&t.state!=="done"&&t.state!=="dropped"&&e.jsx("button",{type:"button",className:"link",onClick:i,children:n("carry into the next quarter")}),y&&e.jsx("button",{type:"button",className:"link danger",onClick:b,children:n("delete")})]})]})]})]})}export{Le as PlanningView};

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.