dev-process-kit 0.0.10 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/THIRD_PARTY_LICENSES.md +46 -0
- package/dist/chunks/{shared-BQFDKhM1.js → shared-BC5MlWBY.js} +155 -348
- package/dist/chunks/{shared-CDUEK_Mh.js → shared-BvuW5NtY.js} +8 -8
- package/dist/chunks/{shared-DkFF4haI.js → shared-BwaDMwUS.js} +8 -8
- package/dist/chunks/{shared-CmNWTIOz.js → shared-CLnfjHCQ.js} +1 -1
- package/dist/chunks/{shared-COrrbgIn.js → shared-C__W71Hw.js} +1 -1
- package/dist/chunks/shared-CcrRNZCH.js +30 -0
- package/dist/chunks/shared-CoDXb-Yj.js +556 -0
- package/dist/chunks/shared-D7CMQLaX.js +2323 -0
- package/dist/chunks/{shared-CQXKAPdi.js → shared-DBJaP5gF.js} +65 -48
- package/dist/chunks/shared-DUq2-pM9.js +2023 -0
- package/dist/chunks/{shared-CNbKTeSv.js → shared-DYe0OZr-.js} +4 -4
- package/dist/chunks/shared-DhwK_dh_.js +1093 -0
- package/dist/chunks/{shared-BdUyaZo-.js → shared-DkkBQzIf.js} +14 -14
- package/dist/chunks/shared-aDPp8Vry.js +1 -0
- package/dist/chunks/{shared-qb0tjbw2.js → shared-y3FwoRgh.js} +8 -8
- package/dist/components.js +1 -1
- package/dist/index.js +1 -1
- package/dist/templates/delegation-poker.js +1 -1
- package/dist/templates/event-storming.js +1 -1
- package/dist/templates/example-mapping.js +1 -1
- package/dist/templates/grill.js +1 -1
- package/dist/templates/plain.js +1 -1
- package/dist/templates/prototype.js +1 -1
- package/dist/templates/slides.js +1 -1
- package/dist/templates/task-board.js +1 -1
- package/dist/templates/usm.js +1 -1
- package/dist/templates/whiteboard.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/shared-Bd9pmv5a.js +0 -30
- package/dist/chunks/shared-C2ytkQtn.js +0 -1094
- package/dist/chunks/shared-Dmq-C6h3.js +0 -2239
- package/dist/chunks/shared-Ds5vLeFk.js +0 -556
- package/dist/chunks/shared-FtbePk3S.js +0 -1252
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ab as Ro,ac as b,ad as i,ae as f,af as c,ag as w,aw as h,an as X,ah as J,ai as V,p as $,v as Uo,av as qo,as as Io,ak as Qo,am as B,P as Ho,e as Mo,a0 as Ko,V as Fo,R as S,a3 as s,a4 as n,A as jo,a5 as y,aT as Z,aU as Yo,aF as P,K as Xo,aC as Jo,a2 as Vo,T as oo,l as Zo,aH as oe}from"./shared-BQFDKhM1.js";const eo=["working","waiting","blocked","done"],D=["todo","doing","blocked","done"],ao=["agent","human"],E=["why","what","goals","nonGoals"],T=J(c(),V(1)),ee=b({id:h,name:T,kind:i(w(ao),"agent")}),ae=b({id:h,title:T,status:i(w(D),"todo"),assignee:i(h),note:i(c()),proposed:i(X(),!1),reason:i(c())}),te=b({id:h,label:i(c()),href:T,kind:i(c()),description:i(c())}),re=b({why:i(c()),what:i(c()),goals:i(f(c()),[]),nonGoals:i(f(c()),[])}),ne=b({id:h,from:i(h),at:i(c()),title:i(c()),body:i(c()),points:i(f(c()),[])}),de=b({id:h,ref:i(T),title:T,description:i(c()),blocking:i(X(),!1),assumption:i(c())}),to=b({title:i(c(),""),status:i(w(eo)),updatedAt:i(c()),context:i(re,{}),members:i(f(ee),[]),todos:i(f(ae),[]),outputs:i(f(te),[]),log:i(f(ne),[]),questions:i(f(de),[])}),A=(e,o)=>{const a=new Set;for(const t of o){if(a.has(t))throw new Error(`duplicate ${e} id: ${t}`);a.add(t)}},u=e=>e===void 0||e.trim()===""?null:e,W=e=>e.filter(o=>o.trim()!==""),ro=e=>{const o=Ro(to,e);A("member",o.members.map(t=>t.id)),A("todo",o.todos.map(t=>t.id)),A("output",o.outputs.map(t=>t.id)),A("log",o.log.map(t=>t.id)),A("question",o.questions.map(t=>t.id));const a=new Set(o.members.map(t=>t.id));for(const t of o.todos)if(t.assignee!==void 0&&!a.has(t.assignee))throw new Error(`todo ${t.id} is assigned to ${t.assignee}, which is not in members`);for(const t of o.log){if(t.from!==void 0&&!a.has(t.from))throw new Error(`log entry ${t.id} is from ${t.from}, which is not in members`);if(u(t.title)===null&&u(t.body)===null)throw new Error(`log entry ${t.id} needs a title or a body`)}for(const t of o.questions)if(!t.blocking&&u(t.assumption)===null)throw new Error(`question ${t.id} does not block, so it needs the assumption the agent works on`);return{title:o.title,status:o.status??null,updatedAt:u(o.updatedAt),context:{why:u(o.context.why),what:u(o.context.what),goals:W(o.context.goals),nonGoals:W(o.context.nonGoals)},members:o.members,todos:o.todos.map(t=>({id:t.id,title:t.title,status:t.status,assignee:t.assignee??null,note:u(t.note),proposed:t.proposed,reason:u(t.reason),added:!1})),outputs:o.outputs.map(t=>({id:t.id,label:u(t.label),href:t.href,kind:u(t.kind),description:u(t.description)})),log:o.log.map(t=>({id:t.id,from:t.from??null,at:u(t.at),title:u(t.title),body:u(t.body),points:W(t.points)})),questions:o.questions.map((t,r)=>({id:t.id,ref:t.ref??`Q${r+1}`,title:t.title,description:u(t.description),blocking:t.blocking,assumption:u(t.assumption)})),answers:{},decisions:{}}},no=()=>({title:"",status:null,updatedAt:null,context:{why:null,what:null,goals:[],nonGoals:[]},members:[],todos:[],outputs:[],log:[],questions:[],answers:{},decisions:{}}),O=(e,o)=>o===null?void 0:e.members.find(a=>a.id===o),k=(e,o)=>e.todos.find(a=>a.id===o),so=(e,o)=>e.log.find(a=>a.id===o),io=e=>E.includes(e),N=(e,o)=>{const a=e.context[o];return typeof a=="string"||a!==null&&a.length>0},C=(e,o)=>e.questions.find(a=>a.id===o),lo=(e,o)=>{const a=e.answers[o.id];return a===void 0?!1:a.kind==="approve"||a.text.trim()!==""},R=(e,o)=>!o.proposed||e.decisions[o.id]==="accept",U=(e,o)=>R(e,o)&&O(e,o.assignee)?.kind==="human",po=(e,o,a)=>{const t={...e};return a===null?delete t[o]:t[o]=a,t},q=(e,o,a)=>({...e,answers:po(e.answers,o,a)}),se=(e,o,a)=>({...e,decisions:po(e.decisions,o,a)}),ie=(e,o,a)=>({...e,todos:e.todos.map(t=>t.id===o?a(t):t)}),m={ANSWER_QUESTION:$("ANSWER_QUESTION","question",Qo("kind",[b({kind:B("approve")}),b({kind:B("answer"),text:c()}),b({kind:B("clear")})])),DECIDE_PROPOSAL:$("DECIDE_PROPOSAL","todo",b({decision:w(["accept","decline","clear"])})),SET_TODO_STATUS:$("SET_TODO_STATUS","todo",b({status:w(D)})),ADD_TODO:$("ADD_TODO","page",b({id:h,title:J(c(),Io(),V(1)),assignee:qo(h)}),{dedupeKey:Uo}),DELETE_TODO:$("DELETE_TODO","todo",b({}))},co={type:"page",id:"task-board"},I=(e,o)=>({type:"ANSWER_QUESTION",target:{type:"question",id:e},payload:o}),uo=(e,o)=>({type:"DECIDE_PROPOSAL",target:{type:"todo",id:e},payload:{decision:o}}),bo=(e,o)=>({type:"SET_TODO_STATUS",target:{type:"todo",id:e},payload:{status:o}}),go=(e,o,a)=>({type:"ADD_TODO",target:co,payload:{id:e,title:o,assignee:a}}),ho=e=>({type:"DELETE_TODO",target:{type:"todo",id:e},payload:{}}),ko=(e,o)=>{const a=Ho(m,o);if(a===null)return null;const t=a.target.id;switch(a.type){case"ANSWER_QUESTION":{const r=C(e,t);if(r===void 0)return null;const d=a.payload;return d.kind==="clear"?q(e,t,null):d.kind==="approve"?r.assumption===null?null:q(e,t,{kind:"approve"}):q(e,t,{kind:"answer",text:d.text})}case"DECIDE_PROPOSAL":{if(k(e,t)?.proposed!==!0)return null;const{decision:r}=a.payload;return se(e,t,r==="clear"?null:r)}case"SET_TODO_STATUS":{const r=k(e,t);if(r===void 0||!U(e,r))return null;const{status:d}=a.payload;return ie(e,t,l=>({...l,status:d}))}case"ADD_TODO":{const{payload:r}=a;return k(e,r.id)!==void 0||r.assignee!==null&&O(e,r.assignee)===void 0?null:{...e,todos:[...e.todos,{id:r.id,title:r.title,status:"todo",assignee:r.assignee,note:null,proposed:!1,reason:null,added:!0}]}}case"DELETE_TODO":return k(e,t)?.added!==!0?null:{...e,todos:e.todos.filter(r=>r.id!==t)};default:return Mo(a)}},Q=Ko({en:{wholeBoard:"Whole board",statusWorking:"Working",statusWaiting:"Waiting on you",statusBlocked:"Blocked",statusDone:"Done",todoTodo:"To do",todoDoing:"In progress",todoBlocked:"Blocked",todoDone:"Done",kindAgent:"Agent",kindHuman:"Human",updatedAt:e=>`Updated ${e}`,context:"What this task is about",contextWhy:"Why",contextWhat:"What",contextGoals:"Goals",contextNonGoals:"Non-goals",noContext:"The agent has not written down why and what yet.",tabs:"Board sections",tabContext:"Context",tabLog:"Work log",tabQuestions:"Questions",openCount:e=>`${e} open`,noQuestions:"The agent has nothing to ask right now.",questions:"Questions from the agent",questionsProgress:(e,o)=>`${e} of ${o} replied`,blockingGroup:"Blocking \u2014 the agent waits for your decision",provisionalGroup:"Going ahead on an assumption \u2014 the agent adjusts if you answer otherwise",blockingTag:"Blocking",assumption:"Assumption",recommendation:"Agent recommends",approveAssumption:"OK, go with this",approveRecommendation:"OK, go with the recommendation",answerOther:"Answer differently",answerOf:e=>`Your answer to ${e}`,answerPlaceholder:"What you expect instead\u2026",blockingPlaceholder:"Your decision\u2026",approvedTag:"Approved",answeredTag:"Answered",todos:"Todo",progress:(e,o)=>`${e} of ${o} done`,noTodosYet:"No todos yet",assignee:"Assignee",unassigned:"Unassigned",memberOption:(e,o)=>`${e} (${o})`,statusOf:e=>`Status of \u201C${e}\u201D`,filterTodos:"Show todos",filterAll:"All",filterHuman:"People",doneGroup:e=>`Done (${e})`,noHumanTodos:"Nobody but the agent has a todo.",addedTag:"Added by you",changedTag:"Changed",removeAdded:"Remove this todo you added",noTodos:"There are no todos yet.",newTodo:"New todo",newTodoPlaceholder:"Add a todo for the agent\u2026",newTodoAssignee:"Assignee of the new todo",addTodo:"Add",proposedMark:"Proposed by the agent",reason:"Why",accept:"Accept",decline:"Decline",decisionOf:e=>`Decision on \u201C${e}\u201D`,acceptedTag:"Accepted",declinedTag:"Declined",undoDecision:"Undo",outputs:"Outputs",noOutputs:"Nothing has been produced yet.",copy:e=>`Copy ${e}`,copied:"Copied",log:"Conversation with the agent",logLede:"Newest first",noLog:"Nothing has been exchanged yet.",fromAgent:"Agent",latestTag:"Latest",commentOn:e=>`Comment on ${e}`,todoGroup:"Todo",logGroup:"Log",contextGroup:"Context",proposalGroup:"Proposal",questionGroup:"Question",approved:"Approve the assumption",answered:"Answer",answerCleared:"Clear the reply",accepted:"Accept the proposal",declined:"Decline the proposal",decisionCleared:"Clear the decision",statusChanged:"Change the status",todoAdded:"Add a todo",todoRemoved:"Remove the added todo",quoted:e=>`\u2192 \u201C${e}\u201D`,change:(e,o)=>`${e} \u2192 ${o}`},ja:{wholeBoard:"\u30DC\u30FC\u30C9\u5168\u4F53",statusWorking:"\u4F5C\u696D\u4E2D",statusWaiting:"\u3042\u306A\u305F\u306E\u8FD4\u7B54\u5F85\u3061",statusBlocked:"\u30D6\u30ED\u30C3\u30AF\u4E2D",statusDone:"\u5B8C\u4E86",todoTodo:"\u672A\u7740\u624B",todoDoing:"\u9032\u884C\u4E2D",todoBlocked:"\u30D6\u30ED\u30C3\u30AF",todoDone:"\u5B8C\u4E86",kindAgent:"Agent",kindHuman:"\u4EBA\u9593",updatedAt:e=>`\u66F4\u65B0 ${e}`,context:"\u3053\u306E\u30BF\u30B9\u30AF\u306E\u524D\u63D0",contextWhy:"Why \u2014 \u306A\u305C\u3084\u308B\u304B",contextWhat:"What \u2014 \u4F55\u3092\u3084\u308B\u304B",contextGoals:"\u30B4\u30FC\u30EB",contextNonGoals:"\u3084\u3089\u306A\u3044\u3053\u3068",noContext:"Agent \u306F\u307E\u3060 Why / What \u3092\u66F8\u3044\u3066\u3044\u307E\u305B\u3093\u3002",tabs:"\u30DC\u30FC\u30C9\u306E\u533A\u5206",tabContext:"Context",tabLog:"\u4F5C\u696D\u30ED\u30B0",tabQuestions:"\u8CEA\u554F",openCount:e=>`\u672A\u56DE\u7B54 ${e} \u4EF6`,noQuestions:"\u4ECA Agent \u304B\u3089\u805E\u304D\u305F\u3044\u3053\u3068\u306F\u3042\u308A\u307E\u305B\u3093\u3002",questions:"Agent \u304B\u3089\u306E\u8CEA\u554F",questionsProgress:(e,o)=>`\u8FD4\u7B54\u6E08\u307F ${e} / ${o}`,blockingGroup:"\u30D6\u30ED\u30C3\u30AB\u30FC \u2014 \u6C7A\u3081\u3066\u3082\u3089\u3046\u307E\u3067\u5148\u306B\u9032\u3081\u306A\u3044",provisionalGroup:"\u4EEE\u306E\u524D\u63D0\u3067\u9032\u884C\u4E2D \u2014 \u9055\u3048\u3070\u65B9\u91DD\u3092\u76F4\u3059",blockingTag:"\u30D6\u30ED\u30C3\u30AB\u30FC",assumption:"\u4EEE\u56DE\u7B54",recommendation:"Agent \u306E\u63A8\u5968",approveAssumption:"\u3053\u306E\u524D\u63D0\u3067 OK",approveRecommendation:"\u63A8\u5968\u3069\u304A\u308A\u3067 OK",answerOther:"\u5225\u306E\u56DE\u7B54\u3092\u3059\u308B",answerOf:e=>`${e} \u3078\u306E\u56DE\u7B54`,answerPlaceholder:"\u671F\u5F85\u3059\u308B\u56DE\u7B54\u3092\u5165\u529B\u2026",blockingPlaceholder:"\u3069\u3046\u3059\u308B\u304B\u3092\u5165\u529B\u2026",approvedTag:"\u627F\u8A8D\u6E08\u307F",answeredTag:"\u56DE\u7B54\u6E08\u307F",todos:"Todo",progress:(e,o)=>`${o} \u4EF6\u4E2D ${e} \u4EF6\u5B8C\u4E86`,noTodosYet:"Todo \u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093",assignee:"\u62C5\u5F53",unassigned:"\u672A\u5272\u308A\u5F53\u3066",memberOption:(e,o)=>`${e}\uFF08${o}\uFF09`,statusOf:e=>`\u300C${e}\u300D\u306E\u72B6\u614B`,filterTodos:"\u8868\u793A\u3059\u308B Todo",filterAll:"\u3059\u3079\u3066",filterHuman:"\u4EBA\u9593\u306E\u62C5\u5F53",doneGroup:e=>`\u5B8C\u4E86 ${e} \u4EF6`,noHumanTodos:"\u4EBA\u9593\u304C\u62C5\u5F53\u3059\u308B Todo \u306F\u3042\u308A\u307E\u305B\u3093\u3002",addedTag:"\u3042\u306A\u305F\u304C\u8FFD\u52A0",changedTag:"\u5909\u66F4\u3042\u308A",removeAdded:"\u8FFD\u52A0\u3057\u305F Todo \u3092\u53D6\u308A\u6D88\u3059",noTodos:"Todo \u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",newTodo:"\u65B0\u3057\u3044 Todo",newTodoPlaceholder:"Agent \u306B\u983C\u3080 Todo \u3092\u8FFD\u52A0\u2026",newTodoAssignee:"\u65B0\u3057\u3044 Todo \u306E\u62C5\u5F53",addTodo:"\u8FFD\u52A0",proposedMark:"Agent \u304B\u3089\u306E\u63D0\u6848",reason:"\u306A\u305C",accept:"\u627F\u8A8D",decline:"\u898B\u9001\u308A",decisionOf:e=>`\u300C${e}\u300D\u306E\u5224\u65AD`,acceptedTag:"\u627F\u8A8D\u6E08\u307F",declinedTag:"\u898B\u9001\u308A",undoDecision:"\u53D6\u308A\u6D88\u3059",outputs:"\u6210\u679C\u7269",noOutputs:"\u307E\u3060\u6210\u679C\u7269\u306F\u3042\u308A\u307E\u305B\u3093\u3002",copy:e=>`${e} \u3092\u30B3\u30D4\u30FC`,copied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F",log:"Agent \u3068\u306E\u3084\u308A\u3068\u308A",logLede:"\u65B0\u3057\u3044\u9806",noLog:"\u307E\u3060\u3084\u308A\u3068\u308A\u306F\u3042\u308A\u307E\u305B\u3093\u3002",fromAgent:"Agent",latestTag:"\u6700\u65B0",commentOn:e=>`${e} \u306B\u30B3\u30E1\u30F3\u30C8`,todoGroup:"Todo",logGroup:"\u4F5C\u696D\u30ED\u30B0",contextGroup:"Context",proposalGroup:"\u63D0\u6848",questionGroup:"\u8CEA\u554F",approved:"\u524D\u63D0\u3092\u627F\u8A8D",answered:"\u56DE\u7B54",answerCleared:"\u8FD4\u7B54\u3092\u30AF\u30EA\u30A2",accepted:"\u63D0\u6848\u3092\u627F\u8A8D",declined:"\u63D0\u6848\u3092\u898B\u9001\u308A",decisionCleared:"\u63D0\u6848\u306E\u5224\u65AD\u3092\u30AF\u30EA\u30A2",statusChanged:"\u72B6\u614B\u3092\u5909\u66F4",todoAdded:"Todo \u3092\u8FFD\u52A0",todoRemoved:"\u8FFD\u52A0\u3057\u305F Todo \u3092\u53D6\u308A\u6D88\u3057",quoted:e=>`\u2192 \u300C${e}\u300D`,change:(e,o)=>`${e} \u2192 ${o}`}}),xo=(e,o)=>{switch(o){case"working":return e.statusWorking;case"waiting":return e.statusWaiting;case"blocked":return e.statusBlocked;case"done":return e.statusDone}},z=(e,o)=>{switch(o){case"todo":return e.todoTodo;case"doing":return e.todoDoing;case"blocked":return e.todoBlocked;case"done":return e.todoDone}},le=(e,o)=>o==="agent"?e.kindAgent:e.kindHuman,L=(e,o)=>{switch(o){case"why":return e.contextWhy;case"what":return e.contextWhat;case"goals":return e.contextGoals;case"nonGoals":return e.contextNonGoals}},fo=48,H=e=>{const o=e.title??e.body??e.id;return o.length<=fo?o:`${o.slice(0,fo-1)}\u2026`},pe=(e,o,a)=>a===null?e.unassigned:O(o,a)?.name??a,mo=e=>e.title===""?"Task Context Board":e.title,vo=(e,o,a)=>{switch(a.type){case"todo":{const t=k(o,a.id);return`${t?.proposed===!0?e.proposalGroup:e.todoGroup} \xB7 ${t?.title??a.id}`}case"log":{const t=so(o,a.id);return`${e.logGroup} \xB7 ${t===void 0?a.id:H(t)}`}case"context":return`${e.contextGroup} \xB7 ${io(a.id)?L(e,a.id):a.id}`;case"question":{const t=C(o,a.id);return t===void 0?a.id:`${t.ref} \xB7 ${t.title}`}case"page":return e.wholeBoard;default:return a.id}},ce=(e,o)=>{switch(o){case"accept":return{title:e.accepted,tone:"update"};case"decline":return{title:e.declined,tone:"update"};case"clear":return{title:e.decisionCleared,tone:"delete"}}},ue=(e,o,a)=>{switch(a.type){case"ANSWER_QUESTION":{const t=S(m.ANSWER_QUESTION,a);if(t.kind==="clear")return{title:e.answerCleared,tone:"delete"};if(t.kind==="approve"){const r=C(o,a.target.id)?.assumption??null;return{title:e.approved,tone:"update",...r===null?{}:{body:e.quoted(r)}}}return{title:e.answered,tone:"update",body:e.quoted(t.text.slice(0,120))}}case"DECIDE_PROPOSAL":return ce(e,S(m.DECIDE_PROPOSAL,a).decision);case"SET_TODO_STATUS":{const{status:t}=S(m.SET_TODO_STATUS,a),r=k(o,a.target.id)?.status,d=z(e,t);return{title:e.statusChanged,tone:"update",body:r===void 0?d:e.change(z(e,r),d)}}case"ADD_TODO":{const t=S(m.ADD_TODO,a);return{title:e.todoAdded,tone:"create",targetLabel:`${e.todoGroup} \xB7 ${t.title}`,...t.assignee===null?{}:{body:`${e.assignee}: ${pe(e,o,t.assignee)}`}}}case"DELETE_TODO":return{title:e.todoRemoved,tone:"delete"};default:return{title:a.type,tone:"meta"}}},wo=(e,o,a,t)=>{let r;try{r=ue(e,t??a,o)}catch{r={title:o.type,tone:"meta"}}return{title:r.title,targetLabel:r.targetLabel??vo(e,a,o.target),tone:r.tone,...r.body===void 0?{}:{summary:r.body}}},$o=e=>`${e.type} ${Fo(e.target)} ${JSON.stringify(e.payload)}`,yo=(e,o)=>[...o.questions.map(a=>({value:`question:${a.id}`,label:`${a.ref} \xB7 ${a.title}`,group:e.questionGroup})),...o.todos.map(a=>({value:`todo:${a.id}`,label:a.title,group:a.proposed?e.proposalGroup:e.todoGroup})),...o.log.map(a=>({value:`log:${a.id}`,label:H(a),group:e.logGroup})),...E.filter(a=>N(o,a)).map(a=>({value:`context:${a}`,label:L(e,a),group:e.contextGroup}))],To=(e,o)=>o,Ao=(e,o,a)=>({parts:E.filter(t=>N(o,t)).map(t=>{const r=o.context[t];return{id:t,title:L(e,t),text:typeof r=="string"?r:null,items:typeof r=="string"||r===null?[]:r,comments:a(`context:${t}`)}})}),be=(e,o,a)=>{const t=e.answers[o.id];return{id:o.id,ref:o.ref,title:o.title,description:o.description,blocking:o.blocking,assumption:o.assumption,reply:t?.kind??"none",resolved:lo(e,o),draft:t?.kind==="answer"?t.text:"",comments:a(`question:${o.id}`)}},Oo=(e,o)=>{const a=e.questions.map(r=>be(e,r,o)),t=a.filter(r=>r.resolved).length;return{blocking:a.filter(r=>r.blocking),provisional:a.filter(r=>!r.blocking),resolved:t,total:a.length,open:a.length-t,blockingOpen:a.filter(r=>r.blocking&&!r.resolved).length}},ge=(e,o,a,t,r)=>{const d=k(a,t.id),l=O(o,t.assignee);return{id:t.id,title:t.title,note:t.note,reason:t.reason,status:t.status,statusLabel:z(e,t.status),assignee:t.assignee,assigneeName:l?.name??null,assigneeKind:l?.kind??null,editable:U(o,t),proposal:t.proposed?o.decisions[t.id]??"pending":null,added:t.added,changed:d!==void 0&&d.status!==t.status,comments:r(`todo:${t.id}`)}},So=(e,o,a,t,r="all")=>{const d=o.todos.filter(p=>R(o,p)),l=d.filter(p=>p.status==="done").length,g=o.members.some(p=>p.kind==="human"),x=g?r:"all",F=p=>p.assigneeKind==="human",G=o.todos.map(p=>ge(e,o,a,p,t)),j=x==="human"?G.filter(F):G,Y=p=>p.status==="done"&&k(a,p.id)?.status==="done";return{todos:j.filter(p=>!Y(p)),done:j.filter(Y),filter:x,canFilter:g,humanCount:G.filter(F).length,progress:{done:l,total:d.length,label:d.length===0?e.noTodosYet:e.progress(l,d.length)},statuses:D.map(p=>({value:p,label:z(e,p)})),members:o.members.map(p=>({id:p.id,label:e.memberOption(p.name,le(e,p.kind))}))}},Do=e=>{if(!/^[a-z][a-z\d+.-]*:\/\//i.test(e))return{kind:"path"};try{return{kind:"url",host:new URL(e).host}}catch{return{kind:"path"}}},Eo=e=>e.outputs.map(o=>({id:o.id,title:o.label??o.href,labelled:o.label!==null,href:o.href,kind:o.kind,description:o.description,place:Do(o.href)})),Co=(e,o,a)=>({entries:o.log.map((t,r)=>{const d=O(o,t.from);return{id:t.id,author:d===void 0?null:{name:d.name,kind:d.kind},at:t.at,title:t.title,body:t.body,points:t.points,label:H(t),latest:r===o.log.length-1,comments:a(`log:${t.id}`)}}).reverse(),status:o.status===null&&o.updatedAt===null?null:{status:o.status,label:o.status===null?null:xo(e,o.status),updatedAt:o.updatedAt}}),zo=(e,o)=>{switch(o.type){case"todo":return k(e,o.id)!==void 0;case"log":return so(e,o.id)!==void 0;case"context":return io(o.id)&&N(e,o.id);case"question":return C(e,o.id)!==void 0;case"page":return!0;default:return!1}},Lo=e=>{const o=Q(e);return{name:"task-board",label:"Task Context Board",parseBase:ro,emptyBase:no,actions:m,apply:ko,hasTarget:zo,describe:(a,t,r)=>wo(o,a,t,r),serialize:$o,resolveNavigation:To,commentTargets:a=>yo(o,a),title:mo}},_=(e,o,a,t)=>n`
|
|
1
|
+
import{ac as Ro,ad as b,ae as i,af as f,ag as c,ah as $,az as h,ao as J,ai as X,aj as V,p as w,v as qo,ay as Io,av as Qo,al as Uo,an as B,P as Ho,e as Mo,a0 as Ko,V as jo,R as S,a3 as s,a4 as n,A as Fo,a5 as y,aY as Z,aZ as Yo,aH as P,K as Jo,aE as Xo,a2 as Vo,T as oo,l as Zo,aJ as oe}from"./shared-BC5MlWBY.js";const eo=["working","waiting","blocked","done"],D=["todo","doing","blocked","done"],ao=["agent","human"],E=["why","what","goals","nonGoals"],T=X(c(),V(1)),ee=b({id:h,name:T,kind:i($(ao),"agent")}),ae=b({id:h,title:T,status:i($(D),"todo"),assignee:i(h),note:i(c()),proposed:i(J(),!1),reason:i(c())}),te=b({id:h,label:i(c()),href:T,kind:i(c()),description:i(c())}),re=b({why:i(c()),what:i(c()),goals:i(f(c()),[]),nonGoals:i(f(c()),[])}),ne=b({id:h,from:i(h),at:i(c()),title:i(c()),body:i(c()),points:i(f(c()),[])}),de=b({id:h,ref:i(T),title:T,description:i(c()),blocking:i(J(),!1),assumption:i(c())}),to=b({title:i(c(),""),status:i($(eo)),updatedAt:i(c()),context:i(re,{}),members:i(f(ee),[]),todos:i(f(ae),[]),outputs:i(f(te),[]),log:i(f(ne),[]),questions:i(f(de),[])}),A=(e,o)=>{const a=new Set;for(const t of o){if(a.has(t))throw new Error(`duplicate ${e} id: ${t}`);a.add(t)}},u=e=>e===void 0||e.trim()===""?null:e,W=e=>e.filter(o=>o.trim()!==""),ro=e=>{const o=Ro(to,e);A("member",o.members.map(t=>t.id)),A("todo",o.todos.map(t=>t.id)),A("output",o.outputs.map(t=>t.id)),A("log",o.log.map(t=>t.id)),A("question",o.questions.map(t=>t.id));const a=new Set(o.members.map(t=>t.id));for(const t of o.todos)if(t.assignee!==void 0&&!a.has(t.assignee))throw new Error(`todo ${t.id} is assigned to ${t.assignee}, which is not in members`);for(const t of o.log){if(t.from!==void 0&&!a.has(t.from))throw new Error(`log entry ${t.id} is from ${t.from}, which is not in members`);if(u(t.title)===null&&u(t.body)===null)throw new Error(`log entry ${t.id} needs a title or a body`)}for(const t of o.questions)if(!t.blocking&&u(t.assumption)===null)throw new Error(`question ${t.id} does not block, so it needs the assumption the agent works on`);return{title:o.title,status:o.status??null,updatedAt:u(o.updatedAt),context:{why:u(o.context.why),what:u(o.context.what),goals:W(o.context.goals),nonGoals:W(o.context.nonGoals)},members:o.members,todos:o.todos.map(t=>({id:t.id,title:t.title,status:t.status,assignee:t.assignee??null,note:u(t.note),proposed:t.proposed,reason:u(t.reason),added:!1})),outputs:o.outputs.map(t=>({id:t.id,label:u(t.label),href:t.href,kind:u(t.kind),description:u(t.description)})),log:o.log.map(t=>({id:t.id,from:t.from??null,at:u(t.at),title:u(t.title),body:u(t.body),points:W(t.points)})),questions:o.questions.map((t,r)=>({id:t.id,ref:t.ref??`Q${r+1}`,title:t.title,description:u(t.description),blocking:t.blocking,assumption:u(t.assumption)})),answers:{},decisions:{}}},no=()=>({title:"",status:null,updatedAt:null,context:{why:null,what:null,goals:[],nonGoals:[]},members:[],todos:[],outputs:[],log:[],questions:[],answers:{},decisions:{}}),O=(e,o)=>o===null?void 0:e.members.find(a=>a.id===o),k=(e,o)=>e.todos.find(a=>a.id===o),so=(e,o)=>e.log.find(a=>a.id===o),io=e=>E.includes(e),N=(e,o)=>{const a=e.context[o];return typeof a=="string"||a!==null&&a.length>0},z=(e,o)=>e.questions.find(a=>a.id===o),lo=(e,o)=>{const a=e.answers[o.id];return a===void 0?!1:a.kind==="approve"||a.text.trim()!==""},R=(e,o)=>!o.proposed||e.decisions[o.id]==="accept",q=(e,o)=>R(e,o)&&O(e,o.assignee)?.kind==="human",po=(e,o,a)=>{const t={...e};return a===null?delete t[o]:t[o]=a,t},I=(e,o,a)=>({...e,answers:po(e.answers,o,a)}),se=(e,o,a)=>({...e,decisions:po(e.decisions,o,a)}),ie=(e,o,a)=>({...e,todos:e.todos.map(t=>t.id===o?a(t):t)}),m={ANSWER_QUESTION:w("ANSWER_QUESTION","question",Uo("kind",[b({kind:B("approve")}),b({kind:B("answer"),text:c()}),b({kind:B("clear")})])),DECIDE_PROPOSAL:w("DECIDE_PROPOSAL","todo",b({decision:$(["accept","decline","clear"])})),SET_TODO_STATUS:w("SET_TODO_STATUS","todo",b({status:$(D)})),ADD_TODO:w("ADD_TODO","page",b({id:h,title:X(c(),Qo(),V(1)),assignee:Io(h)}),{dedupeKey:qo}),DELETE_TODO:w("DELETE_TODO","todo",b({}))},co={type:"page",id:"task-board"},Q=(e,o)=>({type:"ANSWER_QUESTION",target:{type:"question",id:e},payload:o}),uo=(e,o)=>({type:"DECIDE_PROPOSAL",target:{type:"todo",id:e},payload:{decision:o}}),bo=(e,o)=>({type:"SET_TODO_STATUS",target:{type:"todo",id:e},payload:{status:o}}),go=(e,o,a)=>({type:"ADD_TODO",target:co,payload:{id:e,title:o,assignee:a}}),ho=e=>({type:"DELETE_TODO",target:{type:"todo",id:e},payload:{}}),ko=(e,o)=>{const a=Ho(m,o);if(a===null)return null;const t=a.target.id;switch(a.type){case"ANSWER_QUESTION":{const r=z(e,t);if(r===void 0)return null;const d=a.payload;return d.kind==="clear"?I(e,t,null):d.kind==="approve"?r.assumption===null?null:I(e,t,{kind:"approve"}):I(e,t,{kind:"answer",text:d.text})}case"DECIDE_PROPOSAL":{if(k(e,t)?.proposed!==!0)return null;const{decision:r}=a.payload;return se(e,t,r==="clear"?null:r)}case"SET_TODO_STATUS":{const r=k(e,t);if(r===void 0||!q(e,r))return null;const{status:d}=a.payload;return ie(e,t,l=>({...l,status:d}))}case"ADD_TODO":{const{payload:r}=a;return k(e,r.id)!==void 0||r.assignee!==null&&O(e,r.assignee)===void 0?null:{...e,todos:[...e.todos,{id:r.id,title:r.title,status:"todo",assignee:r.assignee,note:null,proposed:!1,reason:null,added:!0}]}}case"DELETE_TODO":return k(e,t)?.added!==!0?null:{...e,todos:e.todos.filter(r=>r.id!==t)};default:return Mo(a)}},U=Ko({en:{wholeBoard:"Whole board",statusWorking:"Working",statusWaiting:"Waiting on you",statusBlocked:"Blocked",statusDone:"Done",todoTodo:"To do",todoDoing:"In progress",todoBlocked:"Blocked",todoDone:"Done",kindAgent:"Agent",kindHuman:"Human",updatedAt:e=>`Updated ${e}`,context:"What this task is about",contextWhy:"Why",contextWhat:"What",contextGoals:"Goals",contextNonGoals:"Non-goals",noContext:"The agent has not written down why and what yet.",tabs:"Board sections",tabContext:"Context",tabLog:"Work log",tabQuestions:"Questions",openCount:e=>`${e} open`,noQuestions:"The agent has nothing to ask right now.",questions:"Questions from the agent",questionsProgress:(e,o)=>`${e} of ${o} replied`,blockingGroup:"Blocking \u2014 the agent waits for your decision",provisionalGroup:"Going ahead on an assumption \u2014 the agent adjusts if you answer otherwise",blockingTag:"Blocking",assumption:"Assumption",recommendation:"Agent recommends",approveAssumption:"OK, go with this",approveRecommendation:"OK, go with the recommendation",answerOther:"Answer differently",answerOf:e=>`Your answer to ${e}`,answerPlaceholder:"What you expect instead\u2026",blockingPlaceholder:"Your decision\u2026",approvedTag:"Approved",answeredTag:"Answered",todos:"Todo",progress:(e,o)=>`${e} of ${o} done`,noTodosYet:"No todos yet",assignee:"Assignee",unassigned:"Unassigned",memberOption:(e,o)=>`${e} (${o})`,statusOf:e=>`Status of \u201C${e}\u201D`,filterTodos:"Show todos",filterAll:"All",filterHuman:"People",doneGroup:e=>`Done (${e})`,noHumanTodos:"Nobody but the agent has a todo.",addedTag:"Added by you",changedTag:"Changed",removeAdded:"Remove this todo you added",noTodos:"There are no todos yet.",newTodo:"New todo",newTodoPlaceholder:"Add a todo for the agent\u2026",newTodoAssignee:"Assignee of the new todo",addTodo:"Add",proposedMark:"Proposed by the agent",reason:"Why",accept:"Accept",decline:"Decline",decisionOf:e=>`Decision on \u201C${e}\u201D`,acceptedTag:"Accepted",declinedTag:"Declined",undoDecision:"Undo",outputs:"Outputs",noOutputs:"Nothing has been produced yet.",copy:e=>`Copy ${e}`,copied:"Copied",log:"Conversation with the agent",logLede:"Newest first",noLog:"Nothing has been exchanged yet.",fromAgent:"Agent",latestTag:"Latest",commentOn:e=>`Comment on ${e}`,todoGroup:"Todo",logGroup:"Log",contextGroup:"Context",proposalGroup:"Proposal",questionGroup:"Question",approved:"Approve the assumption",answered:"Answer",answerCleared:"Clear the reply",accepted:"Accept the proposal",declined:"Decline the proposal",decisionCleared:"Clear the decision",statusChanged:"Change the status",todoAdded:"Add a todo",todoRemoved:"Remove the added todo",quoted:e=>`\u2192 \u201C${e}\u201D`,change:(e,o)=>`${e} \u2192 ${o}`},ja:{wholeBoard:"\u30DC\u30FC\u30C9\u5168\u4F53",statusWorking:"\u4F5C\u696D\u4E2D",statusWaiting:"\u3042\u306A\u305F\u306E\u8FD4\u7B54\u5F85\u3061",statusBlocked:"\u30D6\u30ED\u30C3\u30AF\u4E2D",statusDone:"\u5B8C\u4E86",todoTodo:"\u672A\u7740\u624B",todoDoing:"\u9032\u884C\u4E2D",todoBlocked:"\u30D6\u30ED\u30C3\u30AF",todoDone:"\u5B8C\u4E86",kindAgent:"Agent",kindHuman:"\u4EBA\u9593",updatedAt:e=>`\u66F4\u65B0 ${e}`,context:"\u3053\u306E\u30BF\u30B9\u30AF\u306E\u524D\u63D0",contextWhy:"Why \u2014 \u306A\u305C\u3084\u308B\u304B",contextWhat:"What \u2014 \u4F55\u3092\u3084\u308B\u304B",contextGoals:"\u30B4\u30FC\u30EB",contextNonGoals:"\u3084\u3089\u306A\u3044\u3053\u3068",noContext:"Agent \u306F\u307E\u3060 Why / What \u3092\u66F8\u3044\u3066\u3044\u307E\u305B\u3093\u3002",tabs:"\u30DC\u30FC\u30C9\u306E\u533A\u5206",tabContext:"Context",tabLog:"\u4F5C\u696D\u30ED\u30B0",tabQuestions:"\u8CEA\u554F",openCount:e=>`\u672A\u56DE\u7B54 ${e} \u4EF6`,noQuestions:"\u4ECA Agent \u304B\u3089\u805E\u304D\u305F\u3044\u3053\u3068\u306F\u3042\u308A\u307E\u305B\u3093\u3002",questions:"Agent \u304B\u3089\u306E\u8CEA\u554F",questionsProgress:(e,o)=>`\u8FD4\u7B54\u6E08\u307F ${e} / ${o}`,blockingGroup:"\u30D6\u30ED\u30C3\u30AB\u30FC \u2014 \u6C7A\u3081\u3066\u3082\u3089\u3046\u307E\u3067\u5148\u306B\u9032\u3081\u306A\u3044",provisionalGroup:"\u4EEE\u306E\u524D\u63D0\u3067\u9032\u884C\u4E2D \u2014 \u9055\u3048\u3070\u65B9\u91DD\u3092\u76F4\u3059",blockingTag:"\u30D6\u30ED\u30C3\u30AB\u30FC",assumption:"\u4EEE\u56DE\u7B54",recommendation:"Agent \u306E\u63A8\u5968",approveAssumption:"\u3053\u306E\u524D\u63D0\u3067 OK",approveRecommendation:"\u63A8\u5968\u3069\u304A\u308A\u3067 OK",answerOther:"\u5225\u306E\u56DE\u7B54\u3092\u3059\u308B",answerOf:e=>`${e} \u3078\u306E\u56DE\u7B54`,answerPlaceholder:"\u671F\u5F85\u3059\u308B\u56DE\u7B54\u3092\u5165\u529B\u2026",blockingPlaceholder:"\u3069\u3046\u3059\u308B\u304B\u3092\u5165\u529B\u2026",approvedTag:"\u627F\u8A8D\u6E08\u307F",answeredTag:"\u56DE\u7B54\u6E08\u307F",todos:"Todo",progress:(e,o)=>`${o} \u4EF6\u4E2D ${e} \u4EF6\u5B8C\u4E86`,noTodosYet:"Todo \u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093",assignee:"\u62C5\u5F53",unassigned:"\u672A\u5272\u308A\u5F53\u3066",memberOption:(e,o)=>`${e}\uFF08${o}\uFF09`,statusOf:e=>`\u300C${e}\u300D\u306E\u72B6\u614B`,filterTodos:"\u8868\u793A\u3059\u308B Todo",filterAll:"\u3059\u3079\u3066",filterHuman:"\u4EBA\u9593\u306E\u62C5\u5F53",doneGroup:e=>`\u5B8C\u4E86 ${e} \u4EF6`,noHumanTodos:"\u4EBA\u9593\u304C\u62C5\u5F53\u3059\u308B Todo \u306F\u3042\u308A\u307E\u305B\u3093\u3002",addedTag:"\u3042\u306A\u305F\u304C\u8FFD\u52A0",changedTag:"\u5909\u66F4\u3042\u308A",removeAdded:"\u8FFD\u52A0\u3057\u305F Todo \u3092\u53D6\u308A\u6D88\u3059",noTodos:"Todo \u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",newTodo:"\u65B0\u3057\u3044 Todo",newTodoPlaceholder:"Agent \u306B\u983C\u3080 Todo \u3092\u8FFD\u52A0\u2026",newTodoAssignee:"\u65B0\u3057\u3044 Todo \u306E\u62C5\u5F53",addTodo:"\u8FFD\u52A0",proposedMark:"Agent \u304B\u3089\u306E\u63D0\u6848",reason:"\u306A\u305C",accept:"\u627F\u8A8D",decline:"\u898B\u9001\u308A",decisionOf:e=>`\u300C${e}\u300D\u306E\u5224\u65AD`,acceptedTag:"\u627F\u8A8D\u6E08\u307F",declinedTag:"\u898B\u9001\u308A",undoDecision:"\u53D6\u308A\u6D88\u3059",outputs:"\u6210\u679C\u7269",noOutputs:"\u307E\u3060\u6210\u679C\u7269\u306F\u3042\u308A\u307E\u305B\u3093\u3002",copy:e=>`${e} \u3092\u30B3\u30D4\u30FC`,copied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F",log:"Agent \u3068\u306E\u3084\u308A\u3068\u308A",logLede:"\u65B0\u3057\u3044\u9806",noLog:"\u307E\u3060\u3084\u308A\u3068\u308A\u306F\u3042\u308A\u307E\u305B\u3093\u3002",fromAgent:"Agent",latestTag:"\u6700\u65B0",commentOn:e=>`${e} \u306B\u30B3\u30E1\u30F3\u30C8`,todoGroup:"Todo",logGroup:"\u4F5C\u696D\u30ED\u30B0",contextGroup:"Context",proposalGroup:"\u63D0\u6848",questionGroup:"\u8CEA\u554F",approved:"\u524D\u63D0\u3092\u627F\u8A8D",answered:"\u56DE\u7B54",answerCleared:"\u8FD4\u7B54\u3092\u30AF\u30EA\u30A2",accepted:"\u63D0\u6848\u3092\u627F\u8A8D",declined:"\u63D0\u6848\u3092\u898B\u9001\u308A",decisionCleared:"\u63D0\u6848\u306E\u5224\u65AD\u3092\u30AF\u30EA\u30A2",statusChanged:"\u72B6\u614B\u3092\u5909\u66F4",todoAdded:"Todo \u3092\u8FFD\u52A0",todoRemoved:"\u8FFD\u52A0\u3057\u305F Todo \u3092\u53D6\u308A\u6D88\u3057",quoted:e=>`\u2192 \u300C${e}\u300D`,change:(e,o)=>`${e} \u2192 ${o}`}}),xo=(e,o)=>{switch(o){case"working":return e.statusWorking;case"waiting":return e.statusWaiting;case"blocked":return e.statusBlocked;case"done":return e.statusDone}},C=(e,o)=>{switch(o){case"todo":return e.todoTodo;case"doing":return e.todoDoing;case"blocked":return e.todoBlocked;case"done":return e.todoDone}},le=(e,o)=>o==="agent"?e.kindAgent:e.kindHuman,L=(e,o)=>{switch(o){case"why":return e.contextWhy;case"what":return e.contextWhat;case"goals":return e.contextGoals;case"nonGoals":return e.contextNonGoals}},fo=48,H=e=>{const o=e.title??e.body??e.id;return o.length<=fo?o:`${o.slice(0,fo-1)}\u2026`},pe=(e,o,a)=>a===null?e.unassigned:O(o,a)?.name??a,mo=e=>e.title===""?"Task Context Board":e.title,vo=(e,o,a)=>{switch(a.type){case"todo":{const t=k(o,a.id);return`${t?.proposed===!0?e.proposalGroup:e.todoGroup} \xB7 ${t?.title??a.id}`}case"log":{const t=so(o,a.id);return`${e.logGroup} \xB7 ${t===void 0?a.id:H(t)}`}case"context":return`${e.contextGroup} \xB7 ${io(a.id)?L(e,a.id):a.id}`;case"question":{const t=z(o,a.id);return t===void 0?a.id:`${t.ref} \xB7 ${t.title}`}case"page":return e.wholeBoard;default:return a.id}},ce=(e,o)=>{switch(o){case"accept":return{title:e.accepted,tone:"update"};case"decline":return{title:e.declined,tone:"update"};case"clear":return{title:e.decisionCleared,tone:"delete"}}},ue=(e,o,a)=>{switch(a.type){case"ANSWER_QUESTION":{const t=S(m.ANSWER_QUESTION,a);if(t.kind==="clear")return{title:e.answerCleared,tone:"delete"};if(t.kind==="approve"){const r=z(o,a.target.id)?.assumption??null;return{title:e.approved,tone:"update",...r===null?{}:{body:e.quoted(r)}}}return{title:e.answered,tone:"update",body:e.quoted(t.text.slice(0,120))}}case"DECIDE_PROPOSAL":return ce(e,S(m.DECIDE_PROPOSAL,a).decision);case"SET_TODO_STATUS":{const{status:t}=S(m.SET_TODO_STATUS,a),r=k(o,a.target.id)?.status,d=C(e,t);return{title:e.statusChanged,tone:"update",body:r===void 0?d:e.change(C(e,r),d)}}case"ADD_TODO":{const t=S(m.ADD_TODO,a);return{title:e.todoAdded,tone:"create",targetLabel:`${e.todoGroup} \xB7 ${t.title}`,...t.assignee===null?{}:{body:`${e.assignee}: ${pe(e,o,t.assignee)}`}}}case"DELETE_TODO":return{title:e.todoRemoved,tone:"delete"};default:return{title:a.type,tone:"meta"}}},$o=(e,o,a,t)=>{let r;try{r=ue(e,t??a,o)}catch{r={title:o.type,tone:"meta"}}return{title:r.title,targetLabel:r.targetLabel??vo(e,a,o.target),tone:r.tone,...r.body===void 0?{}:{summary:r.body}}},wo=e=>`${e.type} ${jo(e.target)} ${JSON.stringify(e.payload)}`,yo=(e,o)=>[...o.questions.map(a=>({value:`question:${a.id}`,label:`${a.ref} \xB7 ${a.title}`,group:e.questionGroup})),...o.todos.map(a=>({value:`todo:${a.id}`,label:a.title,group:a.proposed?e.proposalGroup:e.todoGroup})),...o.log.map(a=>({value:`log:${a.id}`,label:H(a),group:e.logGroup})),...E.filter(a=>N(o,a)).map(a=>({value:`context:${a}`,label:L(e,a),group:e.contextGroup}))],To=(e,o)=>o,Ao=(e,o,a)=>({parts:E.filter(t=>N(o,t)).map(t=>{const r=o.context[t];return{id:t,title:L(e,t),text:typeof r=="string"?r:null,items:typeof r=="string"||r===null?[]:r,comments:a(`context:${t}`)}})}),be=(e,o,a)=>{const t=e.answers[o.id];return{id:o.id,ref:o.ref,title:o.title,description:o.description,blocking:o.blocking,assumption:o.assumption,reply:t?.kind??"none",resolved:lo(e,o),draft:t?.kind==="answer"?t.text:"",comments:a(`question:${o.id}`)}},Oo=(e,o)=>{const a=e.questions.map(r=>be(e,r,o)),t=a.filter(r=>r.resolved).length;return{blocking:a.filter(r=>r.blocking),provisional:a.filter(r=>!r.blocking),resolved:t,total:a.length,open:a.length-t,blockingOpen:a.filter(r=>r.blocking&&!r.resolved).length}},ge=(e,o,a,t,r)=>{const d=k(a,t.id),l=O(o,t.assignee);return{id:t.id,title:t.title,note:t.note,reason:t.reason,status:t.status,statusLabel:C(e,t.status),assignee:t.assignee,assigneeName:l?.name??null,assigneeKind:l?.kind??null,editable:q(o,t),proposal:t.proposed?o.decisions[t.id]??"pending":null,added:t.added,changed:d!==void 0&&d.status!==t.status,comments:r(`todo:${t.id}`)}},So=(e,o,a,t,r="all")=>{const d=o.todos.filter(p=>R(o,p)),l=d.filter(p=>p.status==="done").length,g=o.members.some(p=>p.kind==="human"),x=g?r:"all",j=p=>p.assigneeKind==="human",G=o.todos.map(p=>ge(e,o,a,p,t)),F=x==="human"?G.filter(j):G,Y=p=>p.status==="done"&&k(a,p.id)?.status==="done";return{todos:F.filter(p=>!Y(p)),done:F.filter(Y),filter:x,canFilter:g,humanCount:G.filter(j).length,progress:{done:l,total:d.length,label:d.length===0?e.noTodosYet:e.progress(l,d.length)},statuses:D.map(p=>({value:p,label:C(e,p)})),members:o.members.map(p=>({id:p.id,label:e.memberOption(p.name,le(e,p.kind))}))}},Do=e=>{if(!/^[a-z][a-z\d+.-]*:\/\//i.test(e))return{kind:"path"};try{return{kind:"url",host:new URL(e).host}}catch{return{kind:"path"}}},Eo=e=>e.outputs.map(o=>({id:o.id,title:o.label??o.href,labelled:o.label!==null,href:o.href,kind:o.kind,description:o.description,place:Do(o.href)})),zo=(e,o,a)=>({entries:o.log.map((t,r)=>{const d=O(o,t.from);return{id:t.id,author:d===void 0?null:{name:d.name,kind:d.kind},at:t.at,title:t.title,body:t.body,points:t.points,label:H(t),latest:r===o.log.length-1,comments:a(`log:${t.id}`)}}).reverse(),status:o.status===null&&o.updatedAt===null?null:{status:o.status,label:o.status===null?null:xo(e,o.status),updatedAt:o.updatedAt}}),Co=(e,o)=>{switch(o.type){case"todo":return k(e,o.id)!==void 0;case"log":return so(e,o.id)!==void 0;case"context":return io(o.id)&&N(e,o.id);case"question":return z(e,o.id)!==void 0;case"page":return!0;default:return!1}},Lo=e=>{const o=U(e);return{name:"task-board",label:"Task Context Board",parseBase:ro,emptyBase:no,actions:m,apply:ko,hasTarget:Co,describe:(a,t,r)=>$o(o,a,t,r),serialize:wo,resolveNavigation:To,commentTargets:a=>yo(o,a),title:mo}},_=(e,o,a,t)=>n`
|
|
2
2
|
<button
|
|
3
3
|
class="dpk-icon-btn board-comment"
|
|
4
4
|
type="button"
|
|
@@ -7,7 +7,7 @@ import{ab as Ro,ac as b,ad as i,ae as f,af as c,ag as w,aw as h,an as X,ah as J,
|
|
|
7
7
|
title=${o}
|
|
8
8
|
@click=${()=>t.comment(e)}
|
|
9
9
|
>
|
|
10
|
-
${
|
|
10
|
+
${Fo()} ${a>0?n`<span class="dpk-icon-badge">${a}</span>`:s}
|
|
11
11
|
</button>
|
|
12
12
|
`,M=(e,o,a,t=null)=>n`
|
|
13
13
|
<header class="board-section-head">
|
|
@@ -101,10 +101,10 @@ import{ab as Ro,ac as b,ad as i,ae as f,af as c,ag as w,aw as h,an as X,ah as J,
|
|
|
101
101
|
<section class="board-section board-rail-section" data-section="outputs" aria-labelledby="board-outputs">
|
|
102
102
|
${M("board-outputs",e.outputs,o.length===0?null:String(o.length))}
|
|
103
103
|
${o.length===0?n`<p class="board-empty">${e.noOutputs}</p>`:n`<ul class="board-outputs">
|
|
104
|
-
${y(o,r=>r.id,r
|
|
104
|
+
${y(o,r=>r.id,r=>$e(e,r,a===r.id,t))}
|
|
105
105
|
</ul>`}
|
|
106
106
|
</section>
|
|
107
|
-
|
|
107
|
+
`,$e=(e,o,a,t)=>{const r=o.place,d=a?e.copied:e.copy(o.href);return n`
|
|
108
108
|
<li class="board-output" data-output=${o.id} data-place=${r.kind}>
|
|
109
109
|
<div class="board-output-body">
|
|
110
110
|
<div class="board-output-head">
|
|
@@ -134,7 +134,7 @@ import{ab as Ro,ac as b,ad as i,ae as f,af as c,ag as w,aw as h,an as X,ah as J,
|
|
|
134
134
|
</span>`}
|
|
135
135
|
${o.updatedAt===null?s:n`<span class="board-updated">${e.updatedAt(o.updatedAt)}</span>`}
|
|
136
136
|
</div>
|
|
137
|
-
|
|
137
|
+
`,we=(e,o,a)=>n`
|
|
138
138
|
<section class="board-section" data-section="log" aria-labelledby="board-log">
|
|
139
139
|
${M("board-log",e.log,o.entries.length===0?null:e.logLede)}
|
|
140
140
|
${o.entries.length===0?n`${o.status===null?s:Go(e,o.status)}
|
|
@@ -209,7 +209,7 @@ import{ab as Ro,ac as b,ad as i,ae as f,af as c,ag as w,aw as h,an as X,ah as J,
|
|
|
209
209
|
>
|
|
210
210
|
<span class="board-progress-fill" style=${`width: ${o.progress.done/o.progress.total*100}%`}></span>
|
|
211
211
|
</div>`}
|
|
212
|
-
${o.canFilter?
|
|
212
|
+
${o.canFilter?ze(e,o,a):s}
|
|
213
213
|
${o.todos.length===0&&o.done.length===0?n`<p class="board-empty">${o.filter==="human"?e.noHumanTodos:e.noTodos}</p>`:s}
|
|
214
214
|
${o.done.length===0?s:n`<details class="board-done">
|
|
215
215
|
<summary class="board-done-summary">
|
|
@@ -223,7 +223,7 @@ import{ab as Ro,ac as b,ad as i,ae as f,af as c,ag as w,aw as h,an as X,ah as J,
|
|
|
223
223
|
<ul class="board-todos">
|
|
224
224
|
${y(a,r=>r.id,r=>_e(e,o,r,t))}
|
|
225
225
|
</ul>
|
|
226
|
-
`,
|
|
226
|
+
`,ze=(e,o,a)=>{const t=(r,d,l)=>n`
|
|
227
227
|
<button
|
|
228
228
|
type="button"
|
|
229
229
|
class="board-filter-option"
|
|
@@ -235,7 +235,7 @@ import{ab as Ro,ac as b,ad as i,ae as f,af as c,ag as w,aw as h,an as X,ah as J,
|
|
|
235
235
|
</button>
|
|
236
236
|
`;return n`<div class="board-filter" role="group" aria-label=${e.filterTodos}>
|
|
237
237
|
${t("all",e.filterAll,null)} ${t("human",e.filterHuman,o.humanCount)}
|
|
238
|
-
</div>`},
|
|
238
|
+
</div>`},Ce=(e,o)=>o.proposal==="pending"||o.proposal==="decline"?n`<span
|
|
239
239
|
class="board-todo-mark board-todo-mark--proposal"
|
|
240
240
|
role="img"
|
|
241
241
|
aria-label=${e.proposedMark}
|
|
@@ -255,7 +255,7 @@ import{ab as Ro,ac as b,ad as i,ae as f,af as c,ag as w,aw as h,an as X,ah as J,
|
|
|
255
255
|
data-added=${String(a.added)}
|
|
256
256
|
data-changed=${String(a.changed)}
|
|
257
257
|
>
|
|
258
|
-
${
|
|
258
|
+
${Ce(e,a)}
|
|
259
259
|
<div class="board-todo-body">
|
|
260
260
|
<div class="board-todo-title"><span class="board-todo-text">${a.title}</span>${Le(e,a)}</div>
|
|
261
261
|
${a.note===null?s:n`<p class="board-todo-note">${a.note}</p>`}
|
|
@@ -280,7 +280,7 @@ import{ab as Ro,ac as b,ad as i,ae as f,af as c,ag as w,aw as h,an as X,ah as J,
|
|
|
280
280
|
title=${e.removeAdded}
|
|
281
281
|
@click=${()=>t.deleteTodo(a.id)}
|
|
282
282
|
>
|
|
283
|
-
${
|
|
283
|
+
${Jo()}
|
|
284
284
|
</button>`:s}
|
|
285
285
|
</div>
|
|
286
286
|
</div>
|
|
@@ -308,7 +308,7 @@ import{ab as Ro,ac as b,ad as i,ae as f,af as c,ag as w,aw as h,an as X,ah as J,
|
|
|
308
308
|
class="dpk-select board-todo-status"
|
|
309
309
|
data-status=${a.status}
|
|
310
310
|
aria-label=${e.statusOf(a.title)}
|
|
311
|
-
@change=${
|
|
311
|
+
@change=${Xo(r=>{De(r,o)&&r!==a.status&&t.setStatus(a.id,r)})}
|
|
312
312
|
>
|
|
313
313
|
${o.statuses.map(r=>n`<option value=${r.value} ?selected=${r.value===a.status}>${r.label}</option>`)}
|
|
314
314
|
</select>`:n`<span class="board-todo-state" data-status=${a.status}>${a.statusLabel}</span>`,Pe=(e,o,a)=>n`
|
|
@@ -1591,7 +1591,7 @@ import{ab as Ro,ac as b,ad as i,ae as f,af as c,ag as w,aw as h,an as X,ah as J,
|
|
|
1591
1591
|
animation: none;
|
|
1592
1592
|
}
|
|
1593
1593
|
}
|
|
1594
|
-
`,Ne=1500;class Wo extends oo{static{this.styles=[oo.styles,We]}static{this.properties={tab:{state:!0},todoFilter:{state:!0}}}#o=null;#e=null;#a;constructor(){super(),this.tab="context",this.todoFilter="all"}get sidebarLayout(){return{side:"right",defaultWidth:360}}definitionFor(o){return Lo(o)}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.#a)}renderRegions(o){const a=
|
|
1594
|
+
`,Ne=1500;class Wo extends oo{static{this.styles=[oo.styles,We]}static{this.properties={tab:{state:!0},todoFilter:{state:!0}}}#o=null;#e=null;#a;constructor(){super(),this.tab="context",this.todoFilter="all"}get sidebarLayout(){return{side:"right",defaultWidth:360}}definitionFor(o){return Lo(o)}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.#a)}renderRegions(o){const a=U(this.locale),t=x=>o.commentCount(x),r=Oo(o.state,t),d=zo(a,o.state,t),l=this.#d(),g=this.tab;return{header:this.#r(a,o.state),sidebar:n`
|
|
1595
1595
|
<div class="board-rail">
|
|
1596
1596
|
${ve(a,Eo(o.state),this.#e,l)}
|
|
1597
1597
|
${Ee(a,So(a,o.state,o.base,t,this.todoFilter),l)}
|
|
@@ -1600,9 +1600,9 @@ import{ab as Ro,ac as b,ad as i,ae as f,af as c,ag as w,aw as h,an as X,ah as J,
|
|
|
1600
1600
|
<div class="board">
|
|
1601
1601
|
${Se(a,g,{log:d.entries.length,questions:r.open,alert:r.blockingOpen>0},x=>{this.tab=x},x=>this.#t(x))}
|
|
1602
1602
|
${K("context",g,he(a,Ao(a,o.state,t),this.#n(),l))}
|
|
1603
|
-
${K("log",g
|
|
1603
|
+
${K("log",g,we(a,d,l))}
|
|
1604
1604
|
${K("questions",g,r.total===0?n`<p class="board-empty">${a.noQuestions}</p>`:xe(a,r,l))}
|
|
1605
1605
|
</div>
|
|
1606
1606
|
`}}updated(){super.updated();const o=this.#o;o!==null&&(this.#o=null,this.renderRoot.querySelector(`[data-answer-text="${o}"]`)?.focus())}#t(o){const a=Te(this.tab,o.key);a!==null&&(o.preventDefault(),this.tab=a,this.updateComplete.then(()=>this.renderRoot.querySelector(`[data-tab="${a}"]`)?.focus()))}#r(o,a){return a.status===null?s:n`<span class="board-status board-status--header" data-status=${a.status}>
|
|
1607
1607
|
<span class="board-status-dot" aria-hidden="true"></span>${xo(o,a.status)}
|
|
1608
|
-
</span>`}#n(){return this.querySelector(':scope > [slot="main"]')!==null}#d(){return{answer:(o,a)=>this.#s(o,a),answerOther:o=>this.#i(o),decide:(o,a)=>this.dispatch(uo(o,a)),setStatus:(o,a)=>this.dispatch(bo(o,a)),filterTodos:o=>{this.todoFilter=o},addTodo:(o,a)=>this.#l(o,a),deleteTodo:o=>this.dispatch(ho(o)),copy:(o,a)=>{this.#p(o,a)},comment:o=>this.requestComment(o)}}#s(o,a){this.dispatch(
|
|
1608
|
+
</span>`}#n(){return this.querySelector(':scope > [slot="main"]')!==null}#d(){return{answer:(o,a)=>this.#s(o,a),answerOther:o=>this.#i(o),decide:(o,a)=>this.dispatch(uo(o,a)),setStatus:(o,a)=>this.dispatch(bo(o,a)),filterTodos:o=>{this.todoFilter=o},addTodo:(o,a)=>this.#l(o,a),deleteTodo:o=>this.dispatch(ho(o)),copy:(o,a)=>{this.#p(o,a)},comment:o=>this.requestComment(o)}}#s(o,a){this.dispatch(Q(o,a))}#i(o){this.dispatch(Q(o,{kind:"answer",text:""})).ok&&(this.#o=o)}#l(o,a){const{base:t,state:r}=this.derivation,d=[...t.todos,...r.todos].map(l=>l.id);this.dispatch(go(Zo(o,d),o,a))}async#p(o,a){await oe(a)&&(clearTimeout(this.#a),this.#e=o,this.requestUpdate(),this.#a=setTimeout(()=>{this.#e=null,this.requestUpdate()},Ne))}}const No=()=>{customElements.get("dpk-template-task-board")||customElements.define("dpk-template-task-board",Wo)},Re=Object.freeze(Object.defineProperty({__proto__:null,CONTEXT_PARTS:E,DpkTemplateTaskBoard:Wo,MEMBER_KINDS:ao,TASK_BOARD_PAGE:co,TASK_STATUSES:eo,TODO_STATUSES:D,addTodo:go,answerQuestion:Q,applyTaskBoardAction:ko,contextPartTitle:L,decideProposal:uo,defineTaskBoardElement:No,deleteTodo:ho,describeTaskBoardAction:$o,emptyTaskBoardBase:no,isAnswered:lo,isHumanTodo:q,isPlanned:R,outputLocation:Do,parseTaskBoardBase:ro,presentContext:Ao,presentLog:zo,presentOutputs:Eo,presentQuestions:Oo,presentTodos:So,resolveTaskBoardNavigation:To,serializeTaskBoardAction:wo,setTodoStatus:bo,taskBoardActions:m,taskBoardBaseSchema:to,taskBoardCommentTargets:yo,taskBoardDefinitionFor:Lo,taskBoardHasTarget:Co,taskBoardMessages:U,taskBoardTargetLabel:vo,taskBoardTitle:mo},Symbol.toStringTag,{value:"Module"}));export{No as d,Re as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const I=Math.min,T=Math.max,J=Math.round,Q=Math.floor,P=t=>({x:t,y:t}),Wt={left:"right",right:"left",bottom:"top",top:"bottom"};function kt(t,e,n){return T(t,I(e,n))}function U(t,e){return typeof t=="function"?t(e):t}function _(t){return t.split("-")[0]}function Y(t){return t.split("-")[1]}function wt(t){return t==="x"?"y":"x"}function xt(t){return t==="y"?"height":"width"}function D(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function yt(t){return wt(D(t))}function Nt(t,e,n){n===void 0&&(n=!1);const o=Y(t),i=yt(t),s=xt(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=Z(r)),[r,Z(r)]}function $t(t){const e=Z(t);return[ct(t),e,ct(e)]}function ct(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const vt=["left","right"],bt=["right","left"],Vt=["top","bottom"],_t=["bottom","top"];function Ht(t,e,n){switch(t){case"top":case"bottom":return n?e?bt:vt:e?vt:bt;case"left":case"right":return e?Vt:_t;default:return[]}}function Bt(t,e,n,o){const i=Y(t);let s=Ht(_(t),n==="start",o);return i&&(s=s.map(r=>r+"-"+i),e&&(s=s.concat(s.map(ct)))),s}function Z(t){const e=_(t);return Wt[e]+t.slice(e.length)}function zt(t){var e,n,o,i;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(o=t.bottom)!=null?o:0,left:(i=t.left)!=null?i:0}}function It(t){return typeof t!="number"?zt(t):{top:t,right:t,bottom:t,left:t}}function tt(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Rt(t,e,n){let{reference:o,floating:i}=t;const s=D(e),r=yt(e),c=xt(r),l=_(e),f=s==="y",a=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,h=o[c]/2-i[c]/2;let d;switch(l){case"top":d={x:a,y:o.y-i.height};break;case"bottom":d={x:a,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:u};break;case"left":d={x:o.x-i.width,y:u};break;default:d={x:o.x,y:o.y}}const m=Y(e);return m&&(d[r]+=h*(m==="end"?1:-1)*(n&&f?-1:1)),d}async function Xt(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:s,rects:r,elements:c,strategy:l}=t,{boundary:f="clippingAncestors",rootBoundary:a="viewport",elementContext:u="floating",altBoundary:h=!1,padding:d=0}=U(e,t),m=It(d),w=c[h?u==="floating"?"reference":"floating":u],g=tt(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:f,rootBoundary:a,strategy:l})),x=u==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),v=await(s.isElement==null?void 0:s.isElement(y))&&await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1},C=tt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:y,strategy:l}):x);return{top:(g.top-C.top+m.top)/v.y,bottom:(C.bottom-g.bottom+m.bottom)/v.y,left:(g.left-C.left+m.left)/v.x,right:(C.right-g.right+m.right)/v.x}}const jt=50,qt=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,c=r.detectOverflow?r:{...r,detectOverflow:Xt},l=await(r.isRTL==null?void 0:r.isRTL(e));let f=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:a,y:u}=Rt(f,o,l),h=o,d=0;const m={};for(let p=0;p<s.length;p++){const w=s[p];if(!w)continue;const{name:g,fn:x}=w,{x:y,y:v,data:C,reset:b}=await x({x:a,y:u,initialPlacement:o,placement:h,strategy:i,middlewareData:m,rects:f,platform:c,elements:{reference:t,floating:e}});a=y??a,u=v??u,m[g]={...m[g],...C},b&&d<jt&&(d++,typeof b=="object"&&(b.placement&&(h=b.placement),b.rects&&(f=b.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):b.rects),{x:a,y:u}=Rt(f,h,l)),p=-1)}return{x:a,y:u,placement:h,strategy:i,middlewareData:m}},Ut=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:s,rects:r,initialPlacement:c,platform:l,elements:f}=e,{mainAxis:a=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...w}=U(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const g=_(i),x=D(c),y=_(c)===c,v=await(l.isRTL==null?void 0:l.isRTL(f.floating)),C=h||(y||!p?[Z(c)]:$t(c)),b=m!=="none";!h&&b&&C.push(...Bt(c,p,m,v));const F=[c,...C],S=await l.detectOverflow(e,w),N=[];let O=((o=s.flip)==null?void 0:o.overflows)||[];if(a&&N.push(S[g]),u){const $=Nt(i,r,v);N.push(S[$[0]],S[$[1]])}if(O=[...O,{placement:i,overflows:N}],!N.every($=>$<=0)){var mt,gt;const $=(((mt=s.flip)==null?void 0:mt.index)||0)+1,rt=F[$];if(rt&&(!(u==="alignment"?x!==D(rt):!1)||O.every(A=>D(A.placement)===x?A.overflows[0]>0:!0)))return{data:{index:$,overflows:O},reset:{placement:rt}};let q=(gt=O.filter(V=>V.overflows[0]<=0).sort((V,A)=>V.overflows[1]-A.overflows[1])[0])==null?void 0:gt.placement;if(!q)switch(d){case"bestFit":{var pt;const V=(pt=O.filter(A=>{if(b){const W=D(A.placement);return W===x||W==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(W=>W>0).reduce((W,Ft)=>W+Ft,0)]).sort((A,W)=>A[1]-W[1])[0])==null?void 0:pt[0];V&&(q=V);break}case"initialPlacement":q=c;break}if(i!==q)return{reset:{placement:q}}}return{}}}},Yt=new Set(["left","top"]);async function Kt(t,e){const{placement:n,platform:o,elements:i}=t,s=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=_(n),c=Y(n),l=D(n)==="y",f=Yt.has(r)?-1:1,a=s&&l?-1:1,u=U(e,t);let{mainAxis:h,crossAxis:d,alignmentAxis:m}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return c&&typeof m=="number"&&(d=c==="end"?m*-1:m),l?{x:d*a,y:h*f}:{x:h*f,y:d*a}}const Gt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:s,placement:r,middlewareData:c}=e,l=await Kt(e,t);return r===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:r}}}}},Jt=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i,platform:s}=e,{mainAxis:r=!0,crossAxis:c=!1,limiter:l={fn:x=>{let{x:y,y:v}=x;return{x:y,y:v}}},...f}=U(t,e),a={x:n,y:o},u=await s.detectOverflow(e,f),h=D(i),d=wt(h);let m=a[d],p=a[h];const w=(x,y)=>kt(y+u[x==="y"?"top":"left"],y,y-u[x==="y"?"bottom":"right"]);r&&(m=w(d,m)),c&&(p=w(h,p));const g=l.fn({...e,[d]:m,[h]:p});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[d]:r,[h]:c}}}}}},Qt=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:o,platform:i,elements:s}=e,{apply:r=()=>{},...c}=U(t,e),l=await i.detectOverflow(e,c),f=_(n),a=Y(n),u=D(n)==="y",{width:h,height:d}=o.floating;let m,p;f==="top"||f==="bottom"?(m=f,p=a===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(p=f,m=a==="end"?"top":"bottom");const w=d-l.top-l.bottom,g=h-l.left-l.right,x=I(d-l[m],w),y=I(h-l[p],g),v=e.middlewareData.shift,C=!v;let b=x,F=y;v!=null&&v.enabled.x&&(F=g),v!=null&&v.enabled.y&&(b=w),C&&!a&&(u?F=h-2*T(l.left,l.right):b=d-2*T(l.top,l.bottom)),await r({...e,availableWidth:F,availableHeight:b});const S=await i.getDimensions(s.floating);return h!==S.width||d!==S.height?{reset:{rects:!0}}:{}}}};function et(){return typeof window<"u"}function X(t){return Ct(t)?(t.nodeName||"").toLowerCase():"#document"}function R(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function M(t){var e;return(e=(Ct(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ct(t){return et()?t instanceof Node||t instanceof R(t).Node:!1}function L(t){return et()?t instanceof Element||t instanceof R(t).Element:!1}function k(t){return et()?t instanceof HTMLElement||t instanceof R(t).HTMLElement:!1}function At(t){return!et()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof R(t).ShadowRoot}function nt(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=E(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&i!=="inline"&&i!=="contents"}function Zt(t){return/^(table|td|th)$/.test(X(t))}function ot(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const te=/transform|translate|scale|rotate|perspective|filter/,ee=/paint|layout|strict|content/,H=t=>!!t&&t!=="none";let lt;function ft(t){const e=L(t)?E(t):t;return H(e.transform)||H(e.translate)||H(e.scale)||H(e.rotate)||H(e.perspective)||!at()&&(H(e.backdropFilter)||H(e.filter))||te.test(e.willChange||"")||ee.test(e.contain||"")}function ne(t){let e=B(t);for(;k(e)&&!K(e);){if(ft(e))return e;if(ot(e))return null;e=B(e)}return null}function at(){return lt==null&&(lt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),lt}function K(t){return/^(html|body|#document)$/.test(X(t))}function E(t){return R(t).getComputedStyle(t)}function it(t){return L(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function B(t){if(X(t)==="html")return t;const e=t.assignedSlot||t.parentNode||At(t)&&t.host||M(t);return At(e)?e.host:e}function Ot(t){const e=B(t);return K(e)?(t.ownerDocument||t).body:k(e)&&nt(e)?e:Ot(e)}function G(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Ot(t),s=i===((o=t.ownerDocument)==null?void 0:o.body),r=R(i);if(s){const c=ut(r);return e.concat(r,r.visualViewport||[],nt(i)?i:[],c&&n?G(c):[])}else return e.concat(i,G(i,[],n))}function ut(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Lt(t){const e=E(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=k(t),s=i?t.offsetWidth:n,r=i?t.offsetHeight:o,c=J(n)!==s||J(o)!==r;return c&&(n=s,o=r),{width:n,height:o,$:c}}function dt(t){return L(t)?t:t.contextElement}function j(t){const e=dt(t);if(!k(e))return P(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:s}=Lt(e);let r=(s?J(n.width):n.width)/o,c=(s?J(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!c||!Number.isFinite(c))&&(c=1),{x:r,y:c}}const oe=P(0);function Et(t){const e=R(t);return!at()||!e.visualViewport?oe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ie(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===R(t)}function z(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=dt(t);let r=P(1);e&&(o?L(o)&&(r=j(o)):r=j(t));const c=ie(s,n,o)?Et(s):P(0);let l=(i.left+c.x)/r.x,f=(i.top+c.y)/r.y,a=i.width/r.x,u=i.height/r.y;if(s&&o){const h=R(s),d=L(o)?R(o):o;let m=h,p=ut(m);for(;p&&d!==m;){const w=j(p),g=p.getBoundingClientRect(),x=E(p),y=g.left+(p.clientLeft+parseFloat(x.paddingLeft))*w.x,v=g.top+(p.clientTop+parseFloat(x.paddingTop))*w.y;l*=w.x,f*=w.y,a*=w.x,u*=w.y,l+=y,f+=v,m=R(p),p=ut(m)}}return tt({width:a,height:u,x:l,y:f})}function st(t,e){const n=it(t).scrollLeft;return e?e.left+n:z(M(t)).left+n}function St(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-st(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function se(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const s=i==="fixed",r=M(o),c=e?ot(e.floating):!1;if(o===r||c&&s)return n;let l={scrollLeft:0,scrollTop:0},f=P(1);const a=P(0),u=k(o);if((u||!s)&&((X(o)!=="body"||nt(r))&&(l=it(o)),u)){const d=z(o);f=j(o),a.x=d.x+o.clientLeft,a.y=d.y+o.clientTop}const h=r&&!u&&!s?St(r,l):P(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-l.scrollLeft*f.x+a.x+h.x,y:n.y*f.y-l.scrollTop*f.y+a.y+h.y}}function re(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function ce(t){const e=it(t),n=t.ownerDocument.body,o=T(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=T(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-e.scrollLeft+st(t);const r=-e.scrollTop;return E(n).direction==="rtl"&&(s+=T(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:r}}const le=25;function fe(t,e,n){n===void 0&&(n="viewport");const o=n==="layoutViewport",i=R(t),s=M(t),r=i.visualViewport;let c=s.clientWidth,l=s.clientHeight,f=0,a=0;if(r){const h=!at()||e==="fixed";o?h||(f=-r.offsetLeft,a=-r.offsetTop):(c=r.width,l=r.height,h&&(f=r.offsetLeft,a=r.offsetTop))}if(st(s)<=0){const h=s.ownerDocument,d=h.body,m=getComputedStyle(d),p=h.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,w=Math.abs(s.clientWidth-d.clientWidth-p),g=getComputedStyle(s).scrollbarGutter==="stable both-edges"?w/2:w;g<=le&&(c-=g)}return{width:c,height:l,x:f,y:a}}function ae(t,e){const n=z(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=j(t),r=t.clientWidth*s.x,c=t.clientHeight*s.y,l=i*s.x,f=o*s.y;return{width:r,height:c,x:l,y:f}}function Tt(t,e,n){let o;if(e==="viewport"||e==="layoutViewport")o=fe(t,n,e);else if(e==="document")o=ce(M(t));else if(L(e))o=ae(e,n);else{const i=Et(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return tt(o)}function ue(t,e){const n=e.get(t);if(n)return n;let o=G(t,[],!1).filter(c=>L(c)&&X(c)!=="body"),i=null;const s=E(t).position==="fixed";let r=s?B(t):t;for(;L(r)&&!K(r);){const c=E(r),l=ft(r),f=i?i.position:s?"fixed":"";!l&&(f==="fixed"||f==="absolute"&&c.position==="static")?o=o.filter(u=>u!==r):i=c,r=B(r)}return e.set(t,o),o}function de(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[...n==="clippingAncestors"?ot(e)?[]:ue(e,this._c):[].concat(n),o],c=Tt(e,r[0],i);let l=c.top,f=c.right,a=c.bottom,u=c.left;for(let h=1;h<r.length;h++){const d=Tt(e,r[h],i);l=T(d.top,l),f=I(d.right,f),a=I(d.bottom,a),u=T(d.left,u)}return{width:f-u,height:a-l,x:u,y:l}}function he(t){const{width:e,height:n}=Lt(t);return{width:e,height:n}}function me(t,e,n){const o=k(e),i=M(e),s=n==="fixed",r=z(t,!0,s,e);let c={scrollLeft:0,scrollTop:0};const l=P(0);if((o||!s)&&((X(e)!=="body"||nt(i))&&(c=it(e)),o)){const h=z(e,!0,s,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}!o&&i&&(l.x=st(i));const f=i&&!o&&!s?St(i,c):P(0),a=r.left+c.scrollLeft-l.x-f.x,u=r.top+c.scrollTop-l.y-f.y;return{x:a,y:u,width:r.width,height:r.height}}function ht(t){return E(t).position==="static"}function Pt(t,e){if(!k(t)||E(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return M(t)===n&&(n=n.ownerDocument.body),n}function Dt(t,e){const n=R(t);if(ot(t))return n;if(!k(t)){let i=B(t);for(;i&&!K(i);){if(L(i)&&!ht(i))return i;i=B(i)}return n}let o=Pt(t,e);for(;o&&Zt(o)&&ht(o);)o=Pt(o,e);return o&&K(o)&&ht(o)&&!ft(o)?n:o||ne(t)||n}const ge=async function(t){const e=this.getOffsetParent||Dt,n=this.getDimensions,o=await n(t.floating);return{reference:me(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function pe(t){return E(t).direction==="rtl"}const we={convertOffsetParentRelativeRectToViewportRelativeRect:se,getDocumentElement:M,getClippingRect:de,getOffsetParent:Dt,getElementRects:ge,getClientRects:re,getDimensions:he,getScale:j,isElement:L,isRTL:pe};function Mt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function xe(t,e,n){let o=null,i;const s=M(t);function r(){var a;clearTimeout(i),(a=o)==null||a.disconnect(),o=null}function c(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),r();const h=t.getBoundingClientRect(),{left:d,top:m,width:p,height:w}=h;if(a||e(),!p||!w)return;const g=Q(m),x=Q(s.clientWidth-(d+p)),y=Q(s.clientHeight-(m+w)),v=Q(d),b={rootMargin:-g+"px "+-x+"px "+-y+"px "+-v+"px",threshold:T(0,I(1,u))||1};let F=!0;function S(N){const O=N[0].intersectionRatio;if(!Mt(h,t.getBoundingClientRect()))return c();if(O!==u){if(!F)return c();O?c(!1,O):i=setTimeout(()=>{c(!1,1e-7)},1e3)}F=!1}try{o=new IntersectionObserver(S,{...b,root:s.ownerDocument})}catch{o=new IntersectionObserver(S,b)}o.observe(t)}const l=R(t),f=()=>c(n);return l.addEventListener("resize",f),c(!0),()=>{l.removeEventListener("resize",f),r()}}function ye(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,f=dt(t),a=i||s?[...f?G(f):[],...e?G(e):[]]:[];a.forEach(g=>{i&&g.addEventListener("scroll",n),s&&g.addEventListener("resize",n)});const u=f&&c?xe(f,n,s):null;let h=-1,d=null;r&&(d=new ResizeObserver(g=>{let[x]=g;x&&x.target===f&&d&&e&&(d.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var y;(y=d)==null||y.observe(e)})),n()}),f&&!l&&d.observe(f),e&&d.observe(e));let m,p=l?z(t):null;l&&w();function w(){const g=z(t);p&&!Mt(p,g)&&n(),p=g,m=requestAnimationFrame(w)}return n(),()=>{var g;a.forEach(x=>{i&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),u?.(),(g=d)==null||g.disconnect(),d=null,l&&cancelAnimationFrame(m)}}const ve=Gt,be=Jt,Re=Ut,Ce=Qt,Ae=(t,e,n)=>{const o=new Map,i=n??{},s={...we,...i.platform,_c:o};return qt(t,e,{...i,platform:s})},Oe=(t,e)=>({top:e,bottom:e,right:t}),Le=(t,e,n,o={})=>{if(typeof t.showPopover!="function")return()=>{};try{t.showPopover()}catch{return()=>{}}let i=!0,s=0;const r=e instanceof Element?e:{getBoundingClientRect:()=>({x:e.right,y:e.top,left:e.right,right:e.right,top:e.top,bottom:e.bottom,width:0,height:e.bottom-e.top})};t.style.width=`${n.width}px`,t.style.maxHeight=`${n.height}px`;const l=ye(r,t,()=>{const f=++s;Ae(r,t,{strategy:"fixed",placement:o.placement??"bottom-end",middleware:[ve(8),Re({padding:8,fallbackAxisSideDirection:"end"}),be({padding:8}),Ce({padding:8,apply:({availableWidth:a,availableHeight:u})=>{!i||f!==s||(t.style.width=`${Math.max(0,Math.min(n.width,a))}px`,t.style.maxHeight=`${Math.max(0,Math.min(n.height,u))}px`)}})]}).then(({x:a,y:u})=>{!i||f!==s||!t.isConnected||(t.style.left=`${a}px`,t.style.top=`${u}px`)}).catch(()=>{})},{animationFrame:o.trackTransform??!1,elementResize:typeof ResizeObserver<"u",layoutShift:typeof IntersectionObserver<"u"});return()=>{i=!1,l()}},Ee=t=>{if(!(!t||typeof t.hidePopover!="function"))try{t.hidePopover()}catch{}};class Se{#e;#t=new Map;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#e.requestUpdate()}hostUpdated(){for(const[e,n]of this.#t)e.isConnected||(n(),this.#t.delete(e))}hostDisconnected(){for(const e of this.#t.values())e();this.#t.clear()}open(e,n,o,i){this.#t.get(e)?.(),this.#t.set(e,Le(e,n,o,i))}}export{Se as P,Ee as c,Oe as p};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ab as ht,ac as q,ad as ne,ae as oe,ay as N,af as v,aw as X,ag as K,ah as L,ai as M,p as T,aq as S,v as ie,av as xe,P as mt,e as ut,a0 as ft,V,R as $,a2 as ve,a7 as gt,j as bt,a1 as ke,a8 as xt,a3 as I,aB as vt,a4 as k,A as kt,K as Et,h as yt,aE as wt,a6 as Y,a5 as Ee,aF as $t,T as ye,l as A}from"./shared-BQFDKhM1.js";import{P as we,c as Tt,r as St,p as It,a as Lt}from"./shared-Bd9pmv5a.js";import{c as $e}from"./shared-ml5h7U5L.js";function Mt(t,e){let n=0;for(let o=0;o<t.length;o++)n+=e(t[o],o);return n}const j=["actor","command","aggregate","event","policy","readmodel","external","hotspot"],Nt=q({id:X,name:L(v(),M(1)),description:N(v())}),_t=q({id:X,type:K(j),name:L(v(),M(1)),description:N(v()),contextId:N(v())}),Ct=q({id:X,from:L(v(),M(1)),to:L(v(),M(1)),label:N(v()),kind:N(K(["member","flow"]))}),Te=q({title:N(v()),contexts:ne(oe(Nt),[]),elements:ne(oe(_t),[]),links:ne(oe(Ct),[])}),Se=t=>{const e=ht(Te,t),n=new Set(e.elements.map(i=>i.id)),o=new Set(e.contexts.map(i=>i.id));for(const i of e.elements)if(i.contextId!==void 0&&!o.has(i.contextId))throw new Error(`unknown context "${i.contextId}" for note "${i.id}"`);for(const i of e.links){if(!n.has(i.from))throw new Error(`unknown note "${i.from}" in link "${i.id}"`);if(!n.has(i.to))throw new Error(`unknown note "${i.to}" in link "${i.id}"`)}return e},Ie=()=>({contexts:[],elements:[],links:[]}),P=(t,e)=>{if(e!==void 0)return t.elements.find(n=>n.id===e)},H=(t,e)=>{if(e!==void 0)return t.contexts.find(n=>n.id===e)},se=(t,e)=>{if(e!==void 0)return t.links.find(n=>n.id===e)},W=t=>t.elements.map(e=>e.id),w={SET_ELEMENT_NAME:T("SET_ELEMENT_NAME","element",S({name:L(v(),M(1))})),SET_ELEMENT_DESCRIPTION:T("SET_ELEMENT_DESCRIPTION","element",S({description:v()})),SET_ELEMENT_TYPE:T("SET_ELEMENT_TYPE","element",S({type:K(j)})),SET_ELEMENT_CONTEXT:T("SET_ELEMENT_CONTEXT","element",S({contextId:xe(v())})),MOVE_ELEMENT:T("MOVE_ELEMENT","element",S({after:xe(v())}),{mode:"sequence"}),ADD_ELEMENT:T("ADD_ELEMENT","page",S({id:X,type:K(j),name:L(v(),M(1)),description:N(v()),contextId:N(v())}),{dedupeKey:ie}),DELETE_ELEMENT:T("DELETE_ELEMENT","element",S({})),LINK_ELEMENTS:T("LINK_ELEMENTS","page",S({id:X,from:L(v(),M(1)),to:L(v(),M(1)),label:N(v()),kind:N(K(["member","flow"]))}),{dedupeKey:ie}),SET_LINK_LABEL:T("SET_LINK_LABEL","link",S({label:v()})),UNLINK_ELEMENTS:T("UNLINK_ELEMENTS","page",S({from:L(v(),M(1)),to:L(v(),M(1))}),{mode:"sequence"}),ADD_CONTEXT:T("ADD_CONTEXT","page",S({id:X,name:L(v(),M(1)),description:N(v())}),{dedupeKey:ie}),SET_CONTEXT_NAME:T("SET_CONTEXT_NAME","context",S({name:L(v(),M(1))})),DELETE_CONTEXT:T("DELETE_CONTEXT","context",S({}))},y={setElementName:(t,e)=>({type:"SET_ELEMENT_NAME",target:{type:"element",id:t},payload:{name:e}}),setElementDescription:(t,e)=>({type:"SET_ELEMENT_DESCRIPTION",target:{type:"element",id:t},payload:{description:e}}),setElementType:(t,e)=>({type:"SET_ELEMENT_TYPE",target:{type:"element",id:t},payload:{type:e}}),setElementContext:(t,e)=>({type:"SET_ELEMENT_CONTEXT",target:{type:"element",id:t},payload:{contextId:e}}),moveElement:(t,e)=>({type:"MOVE_ELEMENT",target:{type:"element",id:t},payload:{after:e}}),addElement:(t,e,n)=>({type:"ADD_ELEMENT",target:{type:"page",id:"event-storming"},payload:{id:t,type:e,name:n}}),deleteElement:t=>({type:"DELETE_ELEMENT",target:{type:"element",id:t},payload:{}}),linkElements:(t,e,n,o)=>({type:"LINK_ELEMENTS",target:{type:"page",id:"event-storming"},payload:{id:t,from:e,to:n,...o?.label===void 0?{}:{label:o.label},...o?.kind===void 0?{}:{kind:o.kind}}}),setLinkLabel:(t,e)=>({type:"SET_LINK_LABEL",target:{type:"link",id:t},payload:{label:e}}),unlinkElements:(t,e)=>({type:"UNLINK_ELEMENTS",target:{type:"page",id:"event-storming"},payload:{from:t,to:e}}),addContext:(t,e)=>({type:"ADD_CONTEXT",target:{type:"page",id:"event-storming"},payload:{id:t,name:e}}),setContextName:(t,e)=>({type:"SET_CONTEXT_NAME",target:{type:"context",id:t},payload:{name:e}}),deleteContext:t=>({type:"DELETE_CONTEXT",target:{type:"context",id:t},payload:{}})},Le=(t,e)=>{const n=mt(w,e);if(n===null)return null;const o=n.target.id;switch(n.type){case"SET_ELEMENT_NAME":return Z(t,o,i=>({...i,name:n.payload.name}));case"SET_ELEMENT_DESCRIPTION":return Z(t,o,i=>({...i,description:n.payload.description}));case"SET_ELEMENT_TYPE":return Z(t,o,i=>({...i,type:n.payload.type}));case"SET_ELEMENT_CONTEXT":{const{contextId:i}=n.payload;return i!==null&&!t.contexts.some(s=>s.id===i)?null:Z(t,o,s=>i===null?Me(s):{...s,contextId:i})}case"MOVE_ELEMENT":{const{after:i}=n.payload,s=Ot(t.elements,o,i);return s===null?null:{...t,elements:s}}case"ADD_ELEMENT":{const i=n.payload;if(t.elements.some(r=>r.id===i.id))return t;if(i.contextId!==void 0&&!t.contexts.some(r=>r.id===i.contextId))return null;const s={id:i.id,type:i.type,name:i.name,...i.description===void 0?{}:{description:i.description},...i.contextId===void 0?{}:{contextId:i.contextId}};return{...t,elements:[...t.elements,s]}}case"DELETE_ELEMENT":return t.elements.some(i=>i.id===o)?{...t,elements:t.elements.filter(i=>i.id!==o),links:t.links.filter(i=>i.from!==o&&i.to!==o)}:null;case"LINK_ELEMENTS":{const i=n.payload;return t.links.some(s=>s.id===i.id)?t:!t.elements.some(s=>s.id===i.from)||!t.elements.some(s=>s.id===i.to)?null:{...t,links:[...t.links,{id:i.id,from:i.from,to:i.to,...i.label===void 0?{}:{label:i.label},...i.kind===void 0?{}:{kind:i.kind}}]}}case"SET_LINK_LABEL":return t.links.some(i=>i.id===o)?{...t,links:t.links.map(i=>i.id===o?{...i,label:n.payload.label}:i)}:null;case"UNLINK_ELEMENTS":{const i=n.payload;return t.links.some(s=>s.from===i.from&&s.to===i.to)?{...t,links:t.links.filter(s=>!(s.from===i.from&&s.to===i.to))}:null}case"ADD_CONTEXT":{const i=n.payload;if(t.contexts.some(r=>r.id===i.id))return t;const s={id:i.id,name:i.name,...i.description===void 0?{}:{description:i.description}};return{...t,contexts:[...t.contexts,s]}}case"SET_CONTEXT_NAME":return t.contexts.some(i=>i.id===o)?{...t,contexts:t.contexts.map(i=>i.id===o?{...i,name:n.payload.name}:i)}:null;case"DELETE_CONTEXT":return t.contexts.some(i=>i.id===o)?{...t,contexts:t.contexts.filter(i=>i.id!==o),elements:t.elements.map(i=>i.contextId===o?Me(i):i)}:null;default:return ut(n)}},Me=t=>{const e={...t};return delete e.contextId,e},Z=(t,e,n)=>t.elements.some(o=>o.id===e)?{...t,elements:t.elements.map(o=>o.id===e?n(o):o)}:null,Ot=(t,e,n)=>{const o=t.findIndex(a=>a.id===e);if(o<0||n!==null&&!t.some(a=>a.id===n))return null;const i=t[o];if(i===void 0)return null;const r=[...t.filter(a=>a.id!==e)];return r.splice(n===null?0:r.findIndex(a=>a.id===n)+1,0,i),r},At=new Set(["actor>command","command>aggregate","aggregate>event","command>event","policy>command","external>event"]),J=(t,e)=>At.has(`${t}>${e}`),zt=(t,e,n)=>t.kind!==void 0?t.kind==="member":J(e,n),Dt=["readmodel","actor","policy","command","aggregate","external","event","hotspot"],Pt=(t,e)=>{const n=new Map;for(const o of t.links){const i=e.get(o.from),s=e.get(o.to);if(i===void 0||s===void 0||i==="hotspot"==(s==="hotspot")||o.kind!==void 0&&o.kind!=="member")continue;const r=i==="hotspot"?o.from:o.to;n.has(r)||n.set(r,i==="hotspot"?o.to:o.from)}return n},Rt=(t,e,n)=>{const o=new Map(t.map(a=>[a.id,a.id])),i=a=>{let d=a;for(;o.get(d)!==d;)d=o.get(d)??d;let l=a;for(;l!==d;){const p=o.get(l)??d;o.set(l,d),l=p}return d};for(const a of e){if(!o.has(a.from)||!o.has(a.to))continue;const d=n.get(a.from),l=n.get(a.to);d===void 0||l===void 0||zt(a,d,l)&&o.set(i(a.from),i(a.to))}const s=new Map,r=new Map;for(const a of t){const d=i(a.id);r.set(a.id,d);const l=s.get(d);l?l.push(a):s.set(d,[a])}return{groups:s,rootOf:r}},R=t=>{const e=new Map(t.elements.map(l=>[l.id,l.type])),n=Pt(t,e),o=t.elements.filter(l=>!n.has(l.id)),{groups:i,rootOf:s}=Rt(o,t.links,e),r=new Map;for(const[l,p]of n){const m=P(t,l),f=s.get(p);if(m===void 0||f===void 0)continue;const g=r.get(f);g?g.push({note:m,targetId:p}):r.set(f,[{note:m,targetId:p}])}const a=new Map(Dt.map((l,p)=>[l,p])),d=new Map(t.elements.map((l,p)=>[l.id,p]));return[...i].map(([l,p])=>{const m=[...p].sort((f,g)=>(a.get(f.type)??0)-(a.get(g.type)??0)||(d.get(f.id)??0)-(d.get(g.id)??0));return{id:p[0]?.id??"",notes:m,pins:r.get(l)??[],contextId:p.find(f=>f.contextId!==void 0)?.contextId}})},Bt=t=>{const e=R(t).flatMap(o=>[...o.notes,...o.pins.map(i=>i.note)]),n=new Set(e.map(o=>o.id));return{...t,elements:[...e,...t.elements.filter(o=>!n.has(o.id))]}},Ne=(t,e)=>{const n=[...t.notes,...t.pins.map(r=>r.note)],o=n.find(r=>J(e,r.type));if(o!==void 0)return{anchorId:o.id,incoming:!0};const i=n.find(r=>J(r.type,e));if(i!==void 0)return{anchorId:i.id,incoming:!1};const s=n[0];return s===void 0?void 0:{anchorId:s.id,incoming:!0}},_e=(t,e)=>{const n=new Map(e.flatMap(o=>o.notes.map(i=>[i.id,o.id])));return t.links.flatMap(o=>{const i=n.get(o.from),s=n.get(o.to);return i===void 0||s===void 0||i===s?[]:[{id:o.id,from:i,to:s,...o.label!==void 0?{label:o.label}:{}}]})},re=(t,e)=>`${t}\0${e}`,Ce=(t,e,n)=>{const{widthOf:o,gapX:i,padX:s,maxWidth:r}=n,a=new Map;for(const c of e)a.set(re(c.from,c.to),c),a.set(re(c.to,c.from),c);const d=(c,h)=>c===void 0||h===void 0?void 0:a.get(re(c,h)),l=c=>Mt(c,h=>o(h))+i*Math.max(0,c.length-1)+s*2<=r,p=[];let m=[],f;const g=()=>{m.length!==0&&(p.push({sliceIds:m,...f===void 0?{}:{cutFrom:f}}),m=[],f=void 0)};for(const c of t.map(h=>h.id)){if(m.length>0&&!l([...m,c])){let h=m.length;for(;d(m[h-1],h===m.length?c:m[h])!==void 0&&(h-=1,h!==0););const b=h===0?[]:m.splice(h),x=h===0?d(m.at(-1),c):d(m.at(-1),b[0]);g(),m=b,f=x}m.push(c)}return g(),p},G=t=>[...t.notes].reverse().find(e=>e.type==="event")??t.notes.at(-1),Oe=(t,e)=>{const n=G(t),o=e.notes[0];if(!(n===void 0||o===void 0))return{from:n.id,to:o.id}},Ae={actor:"Actor",command:"Command",aggregate:"Aggregate",event:"Domain Event",policy:"Policy",readmodel:"Read Model",external:"External System",hotspot:"Hotspot"},ze={actor:"\u30A2\u30AF\u30BF\u30FC",command:"\u30B3\u30DE\u30F3\u30C9",aggregate:"\u96C6\u7D04",event:"\u30A4\u30D9\u30F3\u30C8",policy:"\u30DD\u30EA\u30B7\u30FC",readmodel:"\u30EA\u30FC\u30C9\u30E2\u30C7\u30EB",external:"\u5916\u90E8\u30B7\u30B9\u30C6\u30E0",hotspot:"\u30DB\u30C3\u30C8\u30B9\u30DD\u30C3\u30C8"},O=ft({en:{renameElementTitle:"Rename element",updateDescriptionTitle:"Update element description",changeTypeTitle:"Change element type",changeContextTitle:"Change the element\u2019s context",moveTitle:"Change timeline position",addElementTitle:"Add element",deleteElementTitle:"Delete element",linkTitle:"Link elements",renameLinkTitle:"Change link label",unlinkTitle:"Remove link",addContextTitle:"Add bounded context",renameContextTitle:"Rename bounded context",deleteContextTitle:"Delete bounded context",renamed:(t,e)=>`"${t}" \u2192 "${e}"`,noContext:"No context",moveToFront:"\u2192 To the front",moveAfter:t=>`\u2192 Right after "${t}"`,elementLabel:t=>`Element \xB7 ${t}`,contextLabel:t=>`Bounded context \xB7 ${t}`,linkLabel:(t,e)=>`Link \xB7 ${t}\u2192${e}`,linkGroup:"Link",pageLabel:t=>`Page \xB7 ${t}`,elementGroup:"Element",contextGroup:"Bounded context",noteTypeLabel:t=>Ae[t],addTypeLabel:t=>`+ ${Ae[t]}`,addHotspot:"+ Hotspot",pinHotspotTitle:"Pin a hotspot on this note",deleteNote:"Delete",noteNameLabel:"Note name",newContextTitle:"New bounded context",contextNamePlaceholder:"Context name",cancel:"Cancel",create:"Create",save:"Save",appendMenuNext:"Note to add next",appendMenuAfter:t=>`Continue after \u201C${t}\u201D`,emptyTitle:"No notes yet",emptyBody:"Start Event Storming by placing domain events on the timeline.",addFirstEvent:"+ First event",portAriaLabel:"Add what comes next (pick a type, or drag to connect to another slice)",portTitle:"Click: pick a note to continue / Drag: connect to another slice",renameContextHint:"Click to rename",dissolveContextAria:t=>`Dissolve bounded context "${t}"`,dissolveContextTitle:"Dissolve the bounded context (notes stay)",noteCount:t=>`${t} notes`,sliceCount:t=>`${t} slices`,contextCount:t=>`${t} bounded contexts`,hudHint:"Wheel: pan \xB7 Pinch: zoom \xB7 Drag background: select area",zoomOut:"Zoom out",zoomReset:"Reset to 100%",zoomIn:"Zoom in",zoomFit:"Fit to view",selectedLinks:t=>`${t} links selected`,deleteLinks:"Delete links",deleteHint:"Delete works too",clearSelection:"Clear selection",selectedSlices:t=>`${t} slices selected`,groupIntoContext:"Group into a bounded context",addToExistingAria:"Add to an existing bounded context",addToExistingOption:"Add to existing\u2026",removeFromContext:"Remove from context",deleteButton:"Delete"},ja:{renameElementTitle:"\u8981\u7D20\u540D\u3092\u5909\u66F4",updateDescriptionTitle:"\u8981\u7D20\u306E\u8AAC\u660E\u3092\u66F4\u65B0",changeTypeTitle:"\u8981\u7D20\u306E\u7A2E\u5225\u3092\u5909\u66F4",changeContextTitle:"\u6240\u5C5E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u5909\u66F4",moveTitle:"\u30BF\u30A4\u30E0\u30E9\u30A4\u30F3\u4F4D\u7F6E\u3092\u5909\u66F4",addElementTitle:"\u8981\u7D20\u3092\u8FFD\u52A0",deleteElementTitle:"\u8981\u7D20\u3092\u524A\u9664",linkTitle:"\u8981\u7D20\u3092\u9023\u7D50",renameLinkTitle:"\u30EA\u30F3\u30AF\u540D\u3092\u5909\u66F4",unlinkTitle:"\u30EA\u30F3\u30AF\u3092\u524A\u9664",addContextTitle:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u8FFD\u52A0",renameContextTitle:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u540D\u3092\u5909\u66F4",deleteContextTitle:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u524A\u9664",renamed:(t,e)=>`"${t}" \u2192 "${e}"`,noContext:"\u672A\u6240\u5C5E",moveToFront:"\u2192 \u5148\u982D\u3078",moveAfter:t=>`\u2192 "${t}" \u306E\u76F4\u5F8C\u3078`,elementLabel:t=>`\u8981\u7D20 \xB7 ${t}`,contextLabel:t=>`\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8 \xB7 ${t}`,linkLabel:(t,e)=>`\u30EA\u30F3\u30AF \xB7 ${t}\u2192${e}`,linkGroup:"\u30EA\u30F3\u30AF",pageLabel:t=>`\u30DA\u30FC\u30B8 \xB7 ${t}`,elementGroup:"\u8981\u7D20",contextGroup:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8",noteTypeLabel:t=>ze[t],addTypeLabel:t=>`+ ${ze[t]}`,addHotspot:"+ \u30DB\u30C3\u30C8\u30B9\u30DD\u30C3\u30C8",pinHotspotTitle:"\u3053\u306E\u4ED8\u7B8B\u306B\u30DB\u30C3\u30C8\u30B9\u30DD\u30C3\u30C8\u3092\u7ACB\u3066\u308B",deleteNote:"\u524A\u9664",noteNameLabel:"\u4ED8\u7B8B\u540D",newContextTitle:"\u65B0\u3057\u3044\u5883\u754C\u3065\u3051\u3089\u308C\u305F\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8",contextNamePlaceholder:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u540D",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",create:"\u4F5C\u6210",save:"\u4FDD\u5B58",appendMenuNext:"\u7D9A\u304D\u306B\u8FFD\u52A0\u3059\u308B\u4ED8\u7B8B",appendMenuAfter:t=>`\u300C${t}\u300D\u306E\u7D9A\u304D\u306B\u8FFD\u52A0`,emptyTitle:"\u4ED8\u7B8B\u304C\u307E\u3060\u3042\u308A\u307E\u305B\u3093",emptyBody:"\u30A4\u30D9\u30F3\u30C8\u30B9\u30C8\u30FC\u30DF\u30F3\u30B0\u3092\u958B\u59CB\u3057\u307E\u3057\u3087\u3046\u3002\u30C9\u30E1\u30A4\u30F3\u30A4\u30D9\u30F3\u30C8\u3092\u6642\u7CFB\u5217\u306B\u8CBC\u308B\u3068\u3053\u308D\u304B\u3089\u59CB\u3081\u307E\u3059\u3002",addFirstEvent:"+ \u6700\u521D\u306E\u30A4\u30D9\u30F3\u30C8",portAriaLabel:"\u7D9A\u304D\u3092\u8FFD\u52A0\uFF08\u7A2E\u985E\u3092\u9078\u3093\u3067\u8FFD\u52A0 / \u30C9\u30E9\u30C3\u30B0\u3067\u4ED6\u306E\u30B9\u30E9\u30A4\u30B9\u3078\u63A5\u7D9A\uFF09",portTitle:"\u30AF\u30EA\u30C3\u30AF: \u7D9A\u304D\u306E\u4ED8\u7B8B\u3092\u9078\u3093\u3067\u8FFD\u52A0 / \u30C9\u30E9\u30C3\u30B0: \u4ED6\u306E\u30B9\u30E9\u30A4\u30B9\u3078\u63A5\u7D9A",renameContextHint:"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u540D\u524D\u3092\u5909\u66F4",dissolveContextAria:t=>`\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u300C${t}\u300D\u3092\u89E3\u4F53`,dissolveContextTitle:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u89E3\u4F53\uFF08\u4ED8\u7B8B\u306F\u6B8B\u308A\u307E\u3059\uFF09",noteCount:t=>`${t} \u4ED8\u7B8B`,sliceCount:t=>`${t} \u30B9\u30E9\u30A4\u30B9`,contextCount:t=>`${t} \u30B3\u30F3\u30C6\u30AD\u30B9\u30C8`,hudHint:"\u30DB\u30A4\u30FC\u30EB: \u79FB\u52D5 \xB7 \u30D4\u30F3\u30C1: \u30BA\u30FC\u30E0 \xB7 \u80CC\u666F\u30C9\u30E9\u30C3\u30B0: \u7BC4\u56F2\u9078\u629E",zoomOut:"\u7E2E\u5C0F",zoomReset:"100% \u306B\u623B\u3059",zoomIn:"\u62E1\u5927",zoomFit:"\u5168\u4F53\u3092\u8868\u793A",selectedLinks:t=>`${t} \u672C\u306E\u30EA\u30F3\u30AF\u3092\u9078\u629E\u4E2D`,deleteLinks:"\u30EA\u30F3\u30AF\u3092\u524A\u9664",deleteHint:"Delete \u3067\u3082\u524A\u9664\u3067\u304D\u307E\u3059",clearSelection:"\u9078\u629E\u89E3\u9664",selectedSlices:t=>`${t} \u30B9\u30E9\u30A4\u30B9\u3092\u9078\u629E\u4E2D`,groupIntoContext:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u306B\u307E\u3068\u3081\u308B",addToExistingAria:"\u65E2\u5B58\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3078\u8FFD\u52A0",addToExistingOption:"\u65E2\u5B58\u3078\u8FFD\u52A0\u2026",removeFromContext:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u89E3\u9664",deleteButton:"\u524A\u9664"}}),Xt={SET_ELEMENT_NAME:(t,e,n)=>({title:t.renameElementTitle,tone:"update",body:t.renamed(P(n,e.target.id)?.name??"?",$(w.SET_ELEMENT_NAME,e).name)}),SET_ELEMENT_DESCRIPTION:(t,e)=>({title:t.updateDescriptionTitle,tone:"update",body:`\u2192 "${$(w.SET_ELEMENT_DESCRIPTION,e).description.slice(0,60)}"`}),SET_ELEMENT_TYPE:(t,e)=>({title:t.changeTypeTitle,tone:"update",body:`\u2192 ${$(w.SET_ELEMENT_TYPE,e).type}`}),SET_ELEMENT_CONTEXT:(t,e)=>({title:t.changeContextTitle,tone:"move",body:`\u2192 ${$(w.SET_ELEMENT_CONTEXT,e).contextId??t.noContext}`}),MOVE_ELEMENT:(t,e)=>({title:t.moveTitle,tone:"move",body:$(w.MOVE_ELEMENT,e).after===null?t.moveToFront:t.moveAfter($(w.MOVE_ELEMENT,e).after??"")}),ADD_ELEMENT:(t,e)=>({title:t.addElementTitle,tone:"create",body:`+ "${$(w.ADD_ELEMENT,e).name}"`}),DELETE_ELEMENT:(t,e,n)=>({title:t.deleteElementTitle,tone:"delete",body:`\u2212 "${P(n,e.target.id)?.name??e.target.id}"`}),LINK_ELEMENTS:(t,e)=>({title:t.linkTitle,tone:"create",body:`${$(w.LINK_ELEMENTS,e).from} \u2192 ${$(w.LINK_ELEMENTS,e).to}`}),SET_LINK_LABEL:(t,e)=>({title:t.renameLinkTitle,tone:"update",body:`\u2192 "${$(w.SET_LINK_LABEL,e).label}"`}),UNLINK_ELEMENTS:(t,e)=>({title:t.unlinkTitle,tone:"delete",body:`${$(w.UNLINK_ELEMENTS,e).from} \u2192 ${$(w.UNLINK_ELEMENTS,e).to}`}),ADD_CONTEXT:(t,e)=>({title:t.addContextTitle,tone:"create",body:`+ "${$(w.ADD_CONTEXT,e).name}"`}),SET_CONTEXT_NAME:(t,e)=>({title:t.renameContextTitle,tone:"update",body:`\u2192 "${$(w.SET_CONTEXT_NAME,e).name}"`}),DELETE_CONTEXT:(t,e,n)=>({title:t.deleteContextTitle,tone:"delete",body:`\u2212 "${H(n,e.target.id)?.name??e.target.id}"`})},De=(t,e,n,o)=>{const i=Xt[e.type],r=i?i(t,e,o??n):{title:e.type,tone:"meta"};return{title:r.title,targetLabel:Re(t,n,e.target),tone:r.tone,...r.body===void 0?{}:{summary:r.body}}},Pe=t=>`${t.type} ${V(t.target)} ${JSON.stringify(t.payload)}`,Re=(t,e,n)=>{switch(n.type){case"element":{const o=P(e,n.id);return o?t.elementLabel(o.name):`${t.elementLabel(n.id)} (missing)`}case"context":{const o=H(e,n.id);return o?t.contextLabel(o.name):`${t.contextLabel(n.id)} (missing)`}case"link":{const o=se(e,n.id);return o?t.linkLabel(o.from,o.to):`${t.linkGroup} \xB7 ${n.id} (missing)`}case"page":return t.pageLabel(ae(e));default:return`${n.type} \xB7 ${n.id}`}},Be=(t,e)=>[...e.elements.map(n=>({value:V({type:"element",id:n.id}),label:n.name,group:t.elementGroup})),...e.contexts.map(n=>({value:V({type:"context",id:n.id}),label:n.name,group:t.contextGroup}))],Yt=(t,e,n)=>{const o=e.elements.find(i=>i.id===n.note);return o?{value:V({type:"element",id:o.id}),label:o.name,group:t.elementGroup}:null},ae=t=>t.title??"Event Storming",Xe=(t,e)=>{const n={...e},o=P(t,e.note);e.note!==void 0&&!o&&delete n.note;const i=H(t,e.context);return e.context!==void 0&&!i&&delete n.context,n},Ye=(t,e)=>{switch(e.type){case"element":return P(t,e.id)!==void 0;case"context":return H(t,e.id)!==void 0;case"link":return se(t,e.id)!==void 0;case"page":return!0;default:return!1}},He=t=>{const e=O(t);return{name:"event-storming",label:"Event Storming",parseBase:Se,emptyBase:Ie,actions:w,apply:Le,canonicalState:Bt,hasTarget:Ye,describe:(n,o,i)=>De(e,n,o,i),serialize:Pe,resolveNavigation:Xe,commentTargets:(n,o)=>Be(e,n),currentTarget:(n,o)=>Yt(e,n,o),title:ae}},Ht={width:300,height:260},Ft={event:{bg:"linear-gradient(178deg, #ffbc55, #f8a52e)",ink:"#402703"},command:{bg:"linear-gradient(178deg, #93c9f2, #74b4e8)",ink:"#0e2c4b"},aggregate:{bg:"linear-gradient(178deg, #fff3a6, #fdea7e)",ink:"#4a3a06"},actor:{bg:"linear-gradient(178deg, #ffdf63, #fdd23e)",ink:"#423204"},policy:{bg:"linear-gradient(178deg, #dcc2f7, #c9a6f0)",ink:"#32195c"},readmodel:{bg:"linear-gradient(178deg, #c0e788, #a8dc63)",ink:"#22380a"},external:{bg:"linear-gradient(178deg, #f9bcd3, #f4a0c0)",ink:"#4b1029"},hotspot:{bg:"linear-gradient(178deg, #d63550, #b81c33)",ink:"#ffffff"}},de=t=>{const{bg:e,ink:n}=Ft[t];return`--es-note-bg:${e};--es-note-ink:${n}`},Kt=ve`
|
|
1
|
+
import{ac as ht,ad as q,ae as ne,af as oe,aA as N,ag as v,az as X,ah as F,ai as L,aj as M,p as T,at as S,v as ie,ay as xe,P as mt,e as ut,a0 as ft,V,R as $,a2 as ve,a8 as gt,j as bt,a1 as ke,a9 as xt,a3 as I,aD as vt,a4 as k,A as kt,K as Et,h as yt,aG as wt,a7 as Y,a5 as Ee,aH as $t,T as ye,l as A}from"./shared-BC5MlWBY.js";import{P as we,p as Tt}from"./shared-aDPp8Vry.js";import{c as St,r as It,p as Lt}from"./shared-CcrRNZCH.js";import{c as $e}from"./shared-ml5h7U5L.js";function Mt(t,e){let n=0;for(let o=0;o<t.length;o++)n+=e(t[o],o);return n}const j=["actor","command","aggregate","event","policy","readmodel","external","hotspot"],Nt=q({id:X,name:L(v(),M(1)),description:N(v())}),_t=q({id:X,type:F(j),name:L(v(),M(1)),description:N(v()),contextId:N(v())}),Ct=q({id:X,from:L(v(),M(1)),to:L(v(),M(1)),label:N(v()),kind:N(F(["member","flow"]))}),Te=q({title:N(v()),contexts:ne(oe(Nt),[]),elements:ne(oe(_t),[]),links:ne(oe(Ct),[])}),Se=t=>{const e=ht(Te,t),n=new Set(e.elements.map(i=>i.id)),o=new Set(e.contexts.map(i=>i.id));for(const i of e.elements)if(i.contextId!==void 0&&!o.has(i.contextId))throw new Error(`unknown context "${i.contextId}" for note "${i.id}"`);for(const i of e.links){if(!n.has(i.from))throw new Error(`unknown note "${i.from}" in link "${i.id}"`);if(!n.has(i.to))throw new Error(`unknown note "${i.to}" in link "${i.id}"`)}return e},Ie=()=>({contexts:[],elements:[],links:[]}),P=(t,e)=>{if(e!==void 0)return t.elements.find(n=>n.id===e)},H=(t,e)=>{if(e!==void 0)return t.contexts.find(n=>n.id===e)},se=(t,e)=>{if(e!==void 0)return t.links.find(n=>n.id===e)},W=t=>t.elements.map(e=>e.id),w={SET_ELEMENT_NAME:T("SET_ELEMENT_NAME","element",S({name:L(v(),M(1))})),SET_ELEMENT_DESCRIPTION:T("SET_ELEMENT_DESCRIPTION","element",S({description:v()})),SET_ELEMENT_TYPE:T("SET_ELEMENT_TYPE","element",S({type:F(j)})),SET_ELEMENT_CONTEXT:T("SET_ELEMENT_CONTEXT","element",S({contextId:xe(v())})),MOVE_ELEMENT:T("MOVE_ELEMENT","element",S({after:xe(v())}),{mode:"sequence"}),ADD_ELEMENT:T("ADD_ELEMENT","page",S({id:X,type:F(j),name:L(v(),M(1)),description:N(v()),contextId:N(v())}),{dedupeKey:ie}),DELETE_ELEMENT:T("DELETE_ELEMENT","element",S({})),LINK_ELEMENTS:T("LINK_ELEMENTS","page",S({id:X,from:L(v(),M(1)),to:L(v(),M(1)),label:N(v()),kind:N(F(["member","flow"]))}),{dedupeKey:ie}),SET_LINK_LABEL:T("SET_LINK_LABEL","link",S({label:v()})),UNLINK_ELEMENTS:T("UNLINK_ELEMENTS","page",S({from:L(v(),M(1)),to:L(v(),M(1))}),{mode:"sequence"}),ADD_CONTEXT:T("ADD_CONTEXT","page",S({id:X,name:L(v(),M(1)),description:N(v())}),{dedupeKey:ie}),SET_CONTEXT_NAME:T("SET_CONTEXT_NAME","context",S({name:L(v(),M(1))})),DELETE_CONTEXT:T("DELETE_CONTEXT","context",S({}))},y={setElementName:(t,e)=>({type:"SET_ELEMENT_NAME",target:{type:"element",id:t},payload:{name:e}}),setElementDescription:(t,e)=>({type:"SET_ELEMENT_DESCRIPTION",target:{type:"element",id:t},payload:{description:e}}),setElementType:(t,e)=>({type:"SET_ELEMENT_TYPE",target:{type:"element",id:t},payload:{type:e}}),setElementContext:(t,e)=>({type:"SET_ELEMENT_CONTEXT",target:{type:"element",id:t},payload:{contextId:e}}),moveElement:(t,e)=>({type:"MOVE_ELEMENT",target:{type:"element",id:t},payload:{after:e}}),addElement:(t,e,n)=>({type:"ADD_ELEMENT",target:{type:"page",id:"event-storming"},payload:{id:t,type:e,name:n}}),deleteElement:t=>({type:"DELETE_ELEMENT",target:{type:"element",id:t},payload:{}}),linkElements:(t,e,n,o)=>({type:"LINK_ELEMENTS",target:{type:"page",id:"event-storming"},payload:{id:t,from:e,to:n,...o?.label===void 0?{}:{label:o.label},...o?.kind===void 0?{}:{kind:o.kind}}}),setLinkLabel:(t,e)=>({type:"SET_LINK_LABEL",target:{type:"link",id:t},payload:{label:e}}),unlinkElements:(t,e)=>({type:"UNLINK_ELEMENTS",target:{type:"page",id:"event-storming"},payload:{from:t,to:e}}),addContext:(t,e)=>({type:"ADD_CONTEXT",target:{type:"page",id:"event-storming"},payload:{id:t,name:e}}),setContextName:(t,e)=>({type:"SET_CONTEXT_NAME",target:{type:"context",id:t},payload:{name:e}}),deleteContext:t=>({type:"DELETE_CONTEXT",target:{type:"context",id:t},payload:{}})},Le=(t,e)=>{const n=mt(w,e);if(n===null)return null;const o=n.target.id;switch(n.type){case"SET_ELEMENT_NAME":return Z(t,o,i=>({...i,name:n.payload.name}));case"SET_ELEMENT_DESCRIPTION":return Z(t,o,i=>({...i,description:n.payload.description}));case"SET_ELEMENT_TYPE":return Z(t,o,i=>({...i,type:n.payload.type}));case"SET_ELEMENT_CONTEXT":{const{contextId:i}=n.payload;return i!==null&&!t.contexts.some(s=>s.id===i)?null:Z(t,o,s=>i===null?Me(s):{...s,contextId:i})}case"MOVE_ELEMENT":{const{after:i}=n.payload,s=Ot(t.elements,o,i);return s===null?null:{...t,elements:s}}case"ADD_ELEMENT":{const i=n.payload;if(t.elements.some(r=>r.id===i.id))return t;if(i.contextId!==void 0&&!t.contexts.some(r=>r.id===i.contextId))return null;const s={id:i.id,type:i.type,name:i.name,...i.description===void 0?{}:{description:i.description},...i.contextId===void 0?{}:{contextId:i.contextId}};return{...t,elements:[...t.elements,s]}}case"DELETE_ELEMENT":return t.elements.some(i=>i.id===o)?{...t,elements:t.elements.filter(i=>i.id!==o),links:t.links.filter(i=>i.from!==o&&i.to!==o)}:null;case"LINK_ELEMENTS":{const i=n.payload;return t.links.some(s=>s.id===i.id)?t:!t.elements.some(s=>s.id===i.from)||!t.elements.some(s=>s.id===i.to)?null:{...t,links:[...t.links,{id:i.id,from:i.from,to:i.to,...i.label===void 0?{}:{label:i.label},...i.kind===void 0?{}:{kind:i.kind}}]}}case"SET_LINK_LABEL":return t.links.some(i=>i.id===o)?{...t,links:t.links.map(i=>i.id===o?{...i,label:n.payload.label}:i)}:null;case"UNLINK_ELEMENTS":{const i=n.payload;return t.links.some(s=>s.from===i.from&&s.to===i.to)?{...t,links:t.links.filter(s=>!(s.from===i.from&&s.to===i.to))}:null}case"ADD_CONTEXT":{const i=n.payload;if(t.contexts.some(r=>r.id===i.id))return t;const s={id:i.id,name:i.name,...i.description===void 0?{}:{description:i.description}};return{...t,contexts:[...t.contexts,s]}}case"SET_CONTEXT_NAME":return t.contexts.some(i=>i.id===o)?{...t,contexts:t.contexts.map(i=>i.id===o?{...i,name:n.payload.name}:i)}:null;case"DELETE_CONTEXT":return t.contexts.some(i=>i.id===o)?{...t,contexts:t.contexts.filter(i=>i.id!==o),elements:t.elements.map(i=>i.contextId===o?Me(i):i)}:null;default:return ut(n)}},Me=t=>{const e={...t};return delete e.contextId,e},Z=(t,e,n)=>t.elements.some(o=>o.id===e)?{...t,elements:t.elements.map(o=>o.id===e?n(o):o)}:null,Ot=(t,e,n)=>{const o=t.findIndex(a=>a.id===e);if(o<0||n!==null&&!t.some(a=>a.id===n))return null;const i=t[o];if(i===void 0)return null;const r=[...t.filter(a=>a.id!==e)];return r.splice(n===null?0:r.findIndex(a=>a.id===n)+1,0,i),r},At=new Set(["actor>command","command>aggregate","aggregate>event","command>event","policy>command","external>event"]),J=(t,e)=>At.has(`${t}>${e}`),zt=(t,e,n)=>t.kind!==void 0?t.kind==="member":J(e,n),Dt=["readmodel","actor","policy","command","aggregate","external","event","hotspot"],Pt=(t,e)=>{const n=new Map;for(const o of t.links){const i=e.get(o.from),s=e.get(o.to);if(i===void 0||s===void 0||i==="hotspot"==(s==="hotspot")||o.kind!==void 0&&o.kind!=="member")continue;const r=i==="hotspot"?o.from:o.to;n.has(r)||n.set(r,i==="hotspot"?o.to:o.from)}return n},Rt=(t,e,n)=>{const o=new Map(t.map(a=>[a.id,a.id])),i=a=>{let d=a;for(;o.get(d)!==d;)d=o.get(d)??d;let l=a;for(;l!==d;){const p=o.get(l)??d;o.set(l,d),l=p}return d};for(const a of e){if(!o.has(a.from)||!o.has(a.to))continue;const d=n.get(a.from),l=n.get(a.to);d===void 0||l===void 0||zt(a,d,l)&&o.set(i(a.from),i(a.to))}const s=new Map,r=new Map;for(const a of t){const d=i(a.id);r.set(a.id,d);const l=s.get(d);l?l.push(a):s.set(d,[a])}return{groups:s,rootOf:r}},R=t=>{const e=new Map(t.elements.map(l=>[l.id,l.type])),n=Pt(t,e),o=t.elements.filter(l=>!n.has(l.id)),{groups:i,rootOf:s}=Rt(o,t.links,e),r=new Map;for(const[l,p]of n){const m=P(t,l),f=s.get(p);if(m===void 0||f===void 0)continue;const g=r.get(f);g?g.push({note:m,targetId:p}):r.set(f,[{note:m,targetId:p}])}const a=new Map(Dt.map((l,p)=>[l,p])),d=new Map(t.elements.map((l,p)=>[l.id,p]));return[...i].map(([l,p])=>{const m=[...p].sort((f,g)=>(a.get(f.type)??0)-(a.get(g.type)??0)||(d.get(f.id)??0)-(d.get(g.id)??0));return{id:p[0]?.id??"",notes:m,pins:r.get(l)??[],contextId:p.find(f=>f.contextId!==void 0)?.contextId}})},Bt=t=>{const e=R(t).flatMap(o=>[...o.notes,...o.pins.map(i=>i.note)]),n=new Set(e.map(o=>o.id));return{...t,elements:[...e,...t.elements.filter(o=>!n.has(o.id))]}},Ne=(t,e)=>{const n=[...t.notes,...t.pins.map(r=>r.note)],o=n.find(r=>J(e,r.type));if(o!==void 0)return{anchorId:o.id,incoming:!0};const i=n.find(r=>J(r.type,e));if(i!==void 0)return{anchorId:i.id,incoming:!1};const s=n[0];return s===void 0?void 0:{anchorId:s.id,incoming:!0}},_e=(t,e)=>{const n=new Map(e.flatMap(o=>o.notes.map(i=>[i.id,o.id])));return t.links.flatMap(o=>{const i=n.get(o.from),s=n.get(o.to);return i===void 0||s===void 0||i===s?[]:[{id:o.id,from:i,to:s,...o.label!==void 0?{label:o.label}:{}}]})},re=(t,e)=>`${t}\0${e}`,Ce=(t,e,n)=>{const{widthOf:o,gapX:i,padX:s,maxWidth:r}=n,a=new Map;for(const c of e)a.set(re(c.from,c.to),c),a.set(re(c.to,c.from),c);const d=(c,h)=>c===void 0||h===void 0?void 0:a.get(re(c,h)),l=c=>Mt(c,h=>o(h))+i*Math.max(0,c.length-1)+s*2<=r,p=[];let m=[],f;const g=()=>{m.length!==0&&(p.push({sliceIds:m,...f===void 0?{}:{cutFrom:f}}),m=[],f=void 0)};for(const c of t.map(h=>h.id)){if(m.length>0&&!l([...m,c])){let h=m.length;for(;d(m[h-1],h===m.length?c:m[h])!==void 0&&(h-=1,h!==0););const b=h===0?[]:m.splice(h),x=h===0?d(m.at(-1),c):d(m.at(-1),b[0]);g(),m=b,f=x}m.push(c)}return g(),p},G=t=>[...t.notes].reverse().find(e=>e.type==="event")??t.notes.at(-1),Oe=(t,e)=>{const n=G(t),o=e.notes[0];if(!(n===void 0||o===void 0))return{from:n.id,to:o.id}},Ae={actor:"Actor",command:"Command",aggregate:"Aggregate",event:"Domain Event",policy:"Policy",readmodel:"Read Model",external:"External System",hotspot:"Hotspot"},ze={actor:"\u30A2\u30AF\u30BF\u30FC",command:"\u30B3\u30DE\u30F3\u30C9",aggregate:"\u96C6\u7D04",event:"\u30A4\u30D9\u30F3\u30C8",policy:"\u30DD\u30EA\u30B7\u30FC",readmodel:"\u30EA\u30FC\u30C9\u30E2\u30C7\u30EB",external:"\u5916\u90E8\u30B7\u30B9\u30C6\u30E0",hotspot:"\u30DB\u30C3\u30C8\u30B9\u30DD\u30C3\u30C8"},O=ft({en:{renameElementTitle:"Rename element",updateDescriptionTitle:"Update element description",changeTypeTitle:"Change element type",changeContextTitle:"Change the element\u2019s context",moveTitle:"Change timeline position",addElementTitle:"Add element",deleteElementTitle:"Delete element",linkTitle:"Link elements",renameLinkTitle:"Change link label",unlinkTitle:"Remove link",addContextTitle:"Add bounded context",renameContextTitle:"Rename bounded context",deleteContextTitle:"Delete bounded context",renamed:(t,e)=>`"${t}" \u2192 "${e}"`,noContext:"No context",moveToFront:"\u2192 To the front",moveAfter:t=>`\u2192 Right after "${t}"`,elementLabel:t=>`Element \xB7 ${t}`,contextLabel:t=>`Bounded context \xB7 ${t}`,linkLabel:(t,e)=>`Link \xB7 ${t}\u2192${e}`,linkGroup:"Link",pageLabel:t=>`Page \xB7 ${t}`,elementGroup:"Element",contextGroup:"Bounded context",noteTypeLabel:t=>Ae[t],addTypeLabel:t=>`+ ${Ae[t]}`,addHotspot:"+ Hotspot",pinHotspotTitle:"Pin a hotspot on this note",deleteNote:"Delete",noteNameLabel:"Note name",newContextTitle:"New bounded context",contextNamePlaceholder:"Context name",cancel:"Cancel",create:"Create",save:"Save",appendMenuNext:"Note to add next",appendMenuAfter:t=>`Continue after \u201C${t}\u201D`,emptyTitle:"No notes yet",emptyBody:"Start Event Storming by placing domain events on the timeline.",addFirstEvent:"+ First event",portAriaLabel:"Add what comes next (pick a type, or drag to connect to another slice)",portTitle:"Click: pick a note to continue / Drag: connect to another slice",renameContextHint:"Click to rename",dissolveContextAria:t=>`Dissolve bounded context "${t}"`,dissolveContextTitle:"Dissolve the bounded context (notes stay)",noteCount:t=>`${t} notes`,sliceCount:t=>`${t} slices`,contextCount:t=>`${t} bounded contexts`,hudHint:"Wheel: pan \xB7 Pinch: zoom \xB7 Drag background: select area",zoomOut:"Zoom out",zoomReset:"Reset to 100%",zoomIn:"Zoom in",zoomFit:"Fit to view",selectedLinks:t=>`${t} links selected`,deleteLinks:"Delete links",deleteHint:"Delete works too",clearSelection:"Clear selection",selectedSlices:t=>`${t} slices selected`,groupIntoContext:"Group into a bounded context",addToExistingAria:"Add to an existing bounded context",addToExistingOption:"Add to existing\u2026",removeFromContext:"Remove from context",deleteButton:"Delete"},ja:{renameElementTitle:"\u8981\u7D20\u540D\u3092\u5909\u66F4",updateDescriptionTitle:"\u8981\u7D20\u306E\u8AAC\u660E\u3092\u66F4\u65B0",changeTypeTitle:"\u8981\u7D20\u306E\u7A2E\u5225\u3092\u5909\u66F4",changeContextTitle:"\u6240\u5C5E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u5909\u66F4",moveTitle:"\u30BF\u30A4\u30E0\u30E9\u30A4\u30F3\u4F4D\u7F6E\u3092\u5909\u66F4",addElementTitle:"\u8981\u7D20\u3092\u8FFD\u52A0",deleteElementTitle:"\u8981\u7D20\u3092\u524A\u9664",linkTitle:"\u8981\u7D20\u3092\u9023\u7D50",renameLinkTitle:"\u30EA\u30F3\u30AF\u540D\u3092\u5909\u66F4",unlinkTitle:"\u30EA\u30F3\u30AF\u3092\u524A\u9664",addContextTitle:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u8FFD\u52A0",renameContextTitle:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u540D\u3092\u5909\u66F4",deleteContextTitle:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u524A\u9664",renamed:(t,e)=>`"${t}" \u2192 "${e}"`,noContext:"\u672A\u6240\u5C5E",moveToFront:"\u2192 \u5148\u982D\u3078",moveAfter:t=>`\u2192 "${t}" \u306E\u76F4\u5F8C\u3078`,elementLabel:t=>`\u8981\u7D20 \xB7 ${t}`,contextLabel:t=>`\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8 \xB7 ${t}`,linkLabel:(t,e)=>`\u30EA\u30F3\u30AF \xB7 ${t}\u2192${e}`,linkGroup:"\u30EA\u30F3\u30AF",pageLabel:t=>`\u30DA\u30FC\u30B8 \xB7 ${t}`,elementGroup:"\u8981\u7D20",contextGroup:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8",noteTypeLabel:t=>ze[t],addTypeLabel:t=>`+ ${ze[t]}`,addHotspot:"+ \u30DB\u30C3\u30C8\u30B9\u30DD\u30C3\u30C8",pinHotspotTitle:"\u3053\u306E\u4ED8\u7B8B\u306B\u30DB\u30C3\u30C8\u30B9\u30DD\u30C3\u30C8\u3092\u7ACB\u3066\u308B",deleteNote:"\u524A\u9664",noteNameLabel:"\u4ED8\u7B8B\u540D",newContextTitle:"\u65B0\u3057\u3044\u5883\u754C\u3065\u3051\u3089\u308C\u305F\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8",contextNamePlaceholder:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u540D",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",create:"\u4F5C\u6210",save:"\u4FDD\u5B58",appendMenuNext:"\u7D9A\u304D\u306B\u8FFD\u52A0\u3059\u308B\u4ED8\u7B8B",appendMenuAfter:t=>`\u300C${t}\u300D\u306E\u7D9A\u304D\u306B\u8FFD\u52A0`,emptyTitle:"\u4ED8\u7B8B\u304C\u307E\u3060\u3042\u308A\u307E\u305B\u3093",emptyBody:"\u30A4\u30D9\u30F3\u30C8\u30B9\u30C8\u30FC\u30DF\u30F3\u30B0\u3092\u958B\u59CB\u3057\u307E\u3057\u3087\u3046\u3002\u30C9\u30E1\u30A4\u30F3\u30A4\u30D9\u30F3\u30C8\u3092\u6642\u7CFB\u5217\u306B\u8CBC\u308B\u3068\u3053\u308D\u304B\u3089\u59CB\u3081\u307E\u3059\u3002",addFirstEvent:"+ \u6700\u521D\u306E\u30A4\u30D9\u30F3\u30C8",portAriaLabel:"\u7D9A\u304D\u3092\u8FFD\u52A0\uFF08\u7A2E\u985E\u3092\u9078\u3093\u3067\u8FFD\u52A0 / \u30C9\u30E9\u30C3\u30B0\u3067\u4ED6\u306E\u30B9\u30E9\u30A4\u30B9\u3078\u63A5\u7D9A\uFF09",portTitle:"\u30AF\u30EA\u30C3\u30AF: \u7D9A\u304D\u306E\u4ED8\u7B8B\u3092\u9078\u3093\u3067\u8FFD\u52A0 / \u30C9\u30E9\u30C3\u30B0: \u4ED6\u306E\u30B9\u30E9\u30A4\u30B9\u3078\u63A5\u7D9A",renameContextHint:"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u540D\u524D\u3092\u5909\u66F4",dissolveContextAria:t=>`\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u300C${t}\u300D\u3092\u89E3\u4F53`,dissolveContextTitle:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u89E3\u4F53\uFF08\u4ED8\u7B8B\u306F\u6B8B\u308A\u307E\u3059\uFF09",noteCount:t=>`${t} \u4ED8\u7B8B`,sliceCount:t=>`${t} \u30B9\u30E9\u30A4\u30B9`,contextCount:t=>`${t} \u30B3\u30F3\u30C6\u30AD\u30B9\u30C8`,hudHint:"\u30DB\u30A4\u30FC\u30EB: \u79FB\u52D5 \xB7 \u30D4\u30F3\u30C1: \u30BA\u30FC\u30E0 \xB7 \u80CC\u666F\u30C9\u30E9\u30C3\u30B0: \u7BC4\u56F2\u9078\u629E",zoomOut:"\u7E2E\u5C0F",zoomReset:"100% \u306B\u623B\u3059",zoomIn:"\u62E1\u5927",zoomFit:"\u5168\u4F53\u3092\u8868\u793A",selectedLinks:t=>`${t} \u672C\u306E\u30EA\u30F3\u30AF\u3092\u9078\u629E\u4E2D`,deleteLinks:"\u30EA\u30F3\u30AF\u3092\u524A\u9664",deleteHint:"Delete \u3067\u3082\u524A\u9664\u3067\u304D\u307E\u3059",clearSelection:"\u9078\u629E\u89E3\u9664",selectedSlices:t=>`${t} \u30B9\u30E9\u30A4\u30B9\u3092\u9078\u629E\u4E2D`,groupIntoContext:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u306B\u307E\u3068\u3081\u308B",addToExistingAria:"\u65E2\u5B58\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3078\u8FFD\u52A0",addToExistingOption:"\u65E2\u5B58\u3078\u8FFD\u52A0\u2026",removeFromContext:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u89E3\u9664",deleteButton:"\u524A\u9664"}}),Xt={SET_ELEMENT_NAME:(t,e,n)=>({title:t.renameElementTitle,tone:"update",body:t.renamed(P(n,e.target.id)?.name??"?",$(w.SET_ELEMENT_NAME,e).name)}),SET_ELEMENT_DESCRIPTION:(t,e)=>({title:t.updateDescriptionTitle,tone:"update",body:`\u2192 "${$(w.SET_ELEMENT_DESCRIPTION,e).description.slice(0,60)}"`}),SET_ELEMENT_TYPE:(t,e)=>({title:t.changeTypeTitle,tone:"update",body:`\u2192 ${$(w.SET_ELEMENT_TYPE,e).type}`}),SET_ELEMENT_CONTEXT:(t,e)=>({title:t.changeContextTitle,tone:"move",body:`\u2192 ${$(w.SET_ELEMENT_CONTEXT,e).contextId??t.noContext}`}),MOVE_ELEMENT:(t,e)=>({title:t.moveTitle,tone:"move",body:$(w.MOVE_ELEMENT,e).after===null?t.moveToFront:t.moveAfter($(w.MOVE_ELEMENT,e).after??"")}),ADD_ELEMENT:(t,e)=>({title:t.addElementTitle,tone:"create",body:`+ "${$(w.ADD_ELEMENT,e).name}"`}),DELETE_ELEMENT:(t,e,n)=>({title:t.deleteElementTitle,tone:"delete",body:`\u2212 "${P(n,e.target.id)?.name??e.target.id}"`}),LINK_ELEMENTS:(t,e)=>({title:t.linkTitle,tone:"create",body:`${$(w.LINK_ELEMENTS,e).from} \u2192 ${$(w.LINK_ELEMENTS,e).to}`}),SET_LINK_LABEL:(t,e)=>({title:t.renameLinkTitle,tone:"update",body:`\u2192 "${$(w.SET_LINK_LABEL,e).label}"`}),UNLINK_ELEMENTS:(t,e)=>({title:t.unlinkTitle,tone:"delete",body:`${$(w.UNLINK_ELEMENTS,e).from} \u2192 ${$(w.UNLINK_ELEMENTS,e).to}`}),ADD_CONTEXT:(t,e)=>({title:t.addContextTitle,tone:"create",body:`+ "${$(w.ADD_CONTEXT,e).name}"`}),SET_CONTEXT_NAME:(t,e)=>({title:t.renameContextTitle,tone:"update",body:`\u2192 "${$(w.SET_CONTEXT_NAME,e).name}"`}),DELETE_CONTEXT:(t,e,n)=>({title:t.deleteContextTitle,tone:"delete",body:`\u2212 "${H(n,e.target.id)?.name??e.target.id}"`})},De=(t,e,n,o)=>{const i=Xt[e.type],r=i?i(t,e,o??n):{title:e.type,tone:"meta"};return{title:r.title,targetLabel:Re(t,n,e.target),tone:r.tone,...r.body===void 0?{}:{summary:r.body}}},Pe=t=>`${t.type} ${V(t.target)} ${JSON.stringify(t.payload)}`,Re=(t,e,n)=>{switch(n.type){case"element":{const o=P(e,n.id);return o?t.elementLabel(o.name):`${t.elementLabel(n.id)} (missing)`}case"context":{const o=H(e,n.id);return o?t.contextLabel(o.name):`${t.contextLabel(n.id)} (missing)`}case"link":{const o=se(e,n.id);return o?t.linkLabel(o.from,o.to):`${t.linkGroup} \xB7 ${n.id} (missing)`}case"page":return t.pageLabel(ae(e));default:return`${n.type} \xB7 ${n.id}`}},Be=(t,e)=>[...e.elements.map(n=>({value:V({type:"element",id:n.id}),label:n.name,group:t.elementGroup})),...e.contexts.map(n=>({value:V({type:"context",id:n.id}),label:n.name,group:t.contextGroup}))],Yt=(t,e,n)=>{const o=e.elements.find(i=>i.id===n.note);return o?{value:V({type:"element",id:o.id}),label:o.name,group:t.elementGroup}:null},ae=t=>t.title??"Event Storming",Xe=(t,e)=>{const n={...e},o=P(t,e.note);e.note!==void 0&&!o&&delete n.note;const i=H(t,e.context);return e.context!==void 0&&!i&&delete n.context,n},Ye=(t,e)=>{switch(e.type){case"element":return P(t,e.id)!==void 0;case"context":return H(t,e.id)!==void 0;case"link":return se(t,e.id)!==void 0;case"page":return!0;default:return!1}},He=t=>{const e=O(t);return{name:"event-storming",label:"Event Storming",parseBase:Se,emptyBase:Ie,actions:w,apply:Le,canonicalState:Bt,hasTarget:Ye,describe:(n,o,i)=>De(e,n,o,i),serialize:Pe,resolveNavigation:Xe,commentTargets:(n,o)=>Be(e,n),currentTarget:(n,o)=>Yt(e,n,o),title:ae}},Ht={width:300,height:260},Kt={event:{bg:"linear-gradient(178deg, #ffbc55, #f8a52e)",ink:"#402703"},command:{bg:"linear-gradient(178deg, #93c9f2, #74b4e8)",ink:"#0e2c4b"},aggregate:{bg:"linear-gradient(178deg, #fff3a6, #fdea7e)",ink:"#4a3a06"},actor:{bg:"linear-gradient(178deg, #ffdf63, #fdd23e)",ink:"#423204"},policy:{bg:"linear-gradient(178deg, #dcc2f7, #c9a6f0)",ink:"#32195c"},readmodel:{bg:"linear-gradient(178deg, #c0e788, #a8dc63)",ink:"#22380a"},external:{bg:"linear-gradient(178deg, #f9bcd3, #f4a0c0)",ink:"#4b1029"},hotspot:{bg:"linear-gradient(178deg, #d63550, #b81c33)",ink:"#ffffff"}},de=t=>{const{bg:e,ink:n}=Kt[t];return`--es-note-bg:${e};--es-note-ink:${n}`},Ft=ve`
|
|
2
2
|
:host {
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
@@ -191,7 +191,7 @@ import{ab as ht,ac as q,ad as ne,ae as oe,ay as N,af as v,aw as X,ag as K,ah as
|
|
|
191
191
|
backdrop-filter: blur(4px);
|
|
192
192
|
box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
|
|
193
193
|
}
|
|
194
|
-
`;class Wt extends gt{static{this.styles=[bt,
|
|
194
|
+
`;class Wt extends gt{static{this.styles=[bt,Ft,ke]}static{this.properties={note:{attribute:!1},notes:{attribute:!1},mode:{type:String,reflect:!0,attribute:"data-mode"},focused:{type:Boolean,reflect:!0},compact:{type:Boolean,reflect:!0},onIntent:{attribute:!1}}}#e="";#n=new we(this);#o=new xt(this);constructor(){super(),this.note=null,this.notes=[],this.mode="view",this.focused=!1,this.compact=!1,this.onIntent=null,this.addEventListener("click",()=>this.#r({kind:"select"}))}updated(e){if(e.has("note")&&this.note&&(this.setAttribute("data-type",this.note.type),this.note.description===void 0?this.removeAttribute("title"):this.setAttribute("title",this.note.description)),e.has("mode")&&(this.mode!=="commenting"&&(this.#e=""),this.mode==="editing"&&this.renderRoot.querySelector("dpk-component-inline-edit")?.startEditing()),this.mode!=="commenting")return;const n=this.renderRoot.querySelector(".comment-pop"),o=this.renderRoot.querySelector('[data-role="comment"]');n&&o&&this.#n.open(n,o,Ht)}render(){const e=this.note;if(!e)return I;const n=O(this.#o.locale),o=St(this.#o.locale);return k`
|
|
195
195
|
<div class="note-type">${n.noteTypeLabel(e.type)}</div>
|
|
196
196
|
<dpk-component-inline-edit
|
|
197
197
|
class="note-name"
|
|
@@ -233,7 +233,7 @@ import{ab as ht,ac as q,ad as ne,ae as oe,ay as N,af as v,aw as X,ag as K,ah as
|
|
|
233
233
|
</button>
|
|
234
234
|
</div>
|
|
235
235
|
${this.mode==="commenting"?this.#t(o):I}
|
|
236
|
-
`}#t(e){return
|
|
236
|
+
`}#t(e){return It(e,Lt(this.#e,this.notes.map(yt),this.note?{key:`note:${this.note.id}`}:{}),n=>{n.kind==="input"?(this.#e=n.body,this.requestUpdate()):this.#r(n)})}#s(e){return n=>{n.stopPropagation(),this.#r(e(n))}}#r(e){this.onIntent?.(e)}}const Gt=()=>{customElements.get("dpk-internal-event-storming-note")||customElements.define("dpk-internal-event-storming-note",Wt)},le=.25,Ke=2,Fe=(t,e,n)=>({...t,panX:t.panX+e,panY:t.panY+n}),ce=(t,e,n,o)=>{const i=$e(t.zoom*o,le,Ke),s=(e-t.panX)/t.zoom,r=(n-t.panY)/t.zoom;return{panX:e-s*i,panY:n-r*i,zoom:i}},We=(t,e,n)=>{const o=Math.max(1,e.width-n*2),i=Math.max(1,e.height-n*2),s=Math.max(le,Math.min(1,o/Math.max(1,t.width),i/Math.max(1,t.height)));return{panX:(e.width-t.width*s)/2,panY:(e.height-t.height*s)/2,zoom:s}},Ge=(t,e,n,o)=>{const i=(s,r,a,d)=>{const l=a*t.zoom;return l<=d?(d-l)/2-r*t.zoom:Math.min(-r*t.zoom,Math.max(d-(r+a)*t.zoom,s))};return{zoom:t.zoom,panX:i(t.panX,-o,e.width+o*2,n.width),panY:i(t.panY,-o,e.height+o*2,n.height)}},Ut=(t,e,n)=>e>=t.left&&e<=t.left+t.width&&n>=t.top&&n<=t.top+t.height,pe=(t,e,n)=>{for(let o=t.length-1;o>=0;o-=1){const i=t[o];if(i!==void 0&&Ut(i.rect,e,n))return i.id}},Ue=(t,e)=>e<t.left+t.width/2?"before":"after",qe=(t,e)=>t.filter(({rect:n})=>n.left<e.left+e.width&&e.left<n.left+n.width&&n.top<e.top+e.height&&e.top<n.top+n.height).map(({id:n})=>n),he=(t,e,n,o)=>{const i=new Set(e);if(n.some(p=>i.has(p)))return[];const s=t.filter(p=>!i.has(p)),r=n.map(p=>s.indexOf(p)).filter(p=>p>=0);if(r.length===0)return[];const a=o==="before"?Math.min(...r):Math.max(...r)+1,d=[];let l=s[a-1]??null;for(const p of t)i.has(p)&&(d.push({id:p,after:l}),l=p);return d},Ve=(t,e,n,o)=>{const i=he(t,e,n,o);if(i.length===0)return i;const s=[...t];for(const r of i){const a=s.indexOf(r.id),d=a<0?void 0:s[a];d!==void 0&&(s.splice(a,1),s.splice(r.after===null?0:s.indexOf(r.after)+1,0,d))}return wt(s,t)?[]:i},je=(t,e,n,o=4)=>{if(e.pointerId!==t.pointerId)return t;const{point:i}=e,s={pointerId:t.pointerId,start:t.start,current:i,moved:t.moved||Math.hypot(i.x-t.start.x,i.y-t.start.y)>o},r=pe(n,i.x,i.y);switch(t.kind){case"connect":return{...s,kind:"connect",fromSliceId:t.fromSliceId,...r!==void 0&&r!==t.fromSliceId?{targetSliceId:r}:{}};case"move-slice":{const a=n.find(d=>d.id===r)?.rect;return{...s,kind:"move-slice",sliceId:t.sliceId,...r!==void 0&&r!==t.sliceId&&a!==void 0?{drop:{sliceId:r,side:Ue(a,i.x)}}:{}}}case"select":return{...s,kind:"select"}}},me="data-pin";class qt{#e;#n=new Set;#o;#t=new Map;constructor(e){this.#e=e,e.addController(this)}get heights(){return this.#t}hostConnected(){typeof ResizeObserver>"u"||(this.#o=new ResizeObserver(e=>this.#s(e)))}hostUpdated(){const e=this.#o;if(e===void 0)return;const n=new Set(this.#e.renderRoot.querySelectorAll(`[${me}]`));for(const i of this.#n)n.has(i)||(e.unobserve(i),this.#n.delete(i));for(const i of n)this.#n.has(i)||(e.observe(i),this.#n.add(i));const o=new Set([...n].map(i=>i.getAttribute(me)));[...this.#t.keys()].some(i=>!o.has(i))&&(this.#t=new Map([...this.#t].filter(([i])=>o.has(i))))}hostDisconnected(){this.#o?.disconnect(),this.#o=void 0,this.#n.clear()}#s(e){const n=new Map(this.#t);for(const o of e){const i=o.target.getAttribute(me),s=o.borderBoxSize[0]?.blockSize;i===null||s===void 0||s===0||n.set(i,s)}[...n].every(([o,i])=>this.#t.get(o)===i)||(this.#t=n,this.#e.requestUpdate())}}const _={kind:"idle"},Ze=(t,e)=>t.kind==="editing"&&t.noteId===e?"editing":t.kind==="commenting"&&t.noteId===e?"commenting":"view",Je=(t,e,n)=>{switch(n.kind){case"toggle-comment":return t.kind==="commenting"&&t.noteId===e?_:{kind:"commenting",noteId:e};case"comment":case"delete":case"dismiss":return _;case"select":case"add-hotspot":return t;case"rename":return t.kind==="editing"&&t.noteId===e?_:t}},Qe=92,ue=54,Vt=18,et=4,tt=t=>{const e=[];let n=Vt;for(const o of t)e.push(n),n+=o+et;return{lifts:e,extent:t.length===0?0:n-et}},U=132,nt=96,fe=10,ge=24,Q=12,z=nt+Q*2,ee=46,te=16,ot=44,it=40,be=16,st=13,K=8,jt=6,Zt=t=>Math.max(ot,t-Q),Jt=tt([ue]).extent,Qt=["actor","command","aggregate","event","policy","readmodel","external"],rt=t=>ge*2+t*U+(t-1)*fe,en=(t,e)=>{const n=new Map;let o=0;for(const i of t.notes){const s=t.pins.filter(a=>a.targetId===i.id),r=tt(s.map(a=>e(a.note.id)));s.forEach((a,d)=>n.set(a.note.id,r.lifts[d]??0)),o=Math.max(o,r.extent)}return{liftOf:n,extent:o}},tn=(t,e,n,o)=>{const i=new Map(e.map(h=>[h.id,rt(h.notes.length)])),s=_e(t,e),r=Ce(e,s,{widthOf:h=>i.get(h)??0,gapX:ee,padX:te,maxWidth:Math.max(n,rt(1))}),a=new Map,d=new Map,l=new Map,p=new Map,m=new Map;for(const h of e){const b=en(h,x=>o.get(x)??ue);for(const[x,E]of b.liftOf)p.set(x,E);m.set(h.id,b.extent)}let f=K;const g=r.map((h,b)=>{const x=h.cutFrom===void 0?void 0:d.get(h.cutFrom.from),E=x===void 0?0:Math.max(0,x-te);let u=E+te;const C=Zt(Math.max(Jt,...h.sliceIds.map(B=>m.get(B)??0)));for(const B of h.sliceIds)a.set(B,u-E),d.set(B,u),l.set(B,b),u+=(i.get(B)??0)+ee;const D=C+z+it,pt={sliceIds:h.sliceIds,x:E,width:u-ee+te-E,height:D,y:f,head:C,cutFrom:h.cutFrom};return f+=D+jt,pt}),c=g.at(-1);return{slices:e,bands:g,xOf:a,absXOf:d,bandOf:l,widthOf:i,pinLiftOf:p,arrows:s,width:Math.max(0,...g.map(h=>h.x+h.width))+K*2,height:c===void 0?K*2:c.y+c.height+K}},nn=t=>{const{m:e,context:n,maxRowWidth:o,pinHeights:i,viewport:s,handlers:r}=t,{state:a}=n,d=24*s.zoom,l=`background-size:${d}px ${d}px;background-position:${s.panX}px ${s.panY}px`;if(a.elements.length===0)return k`<div class="board-viewport board-viewport--empty" style=${l}>
|
|
237
237
|
<div class="empty">
|
|
238
238
|
<h2>${e.emptyTitle}</h2>
|
|
239
239
|
<p>${e.emptyBody}</p>
|
|
@@ -277,7 +277,7 @@ import{ab as ht,ac as q,ad as ne,ae as oe,ay as N,af as v,aw as X,ag as K,ah as
|
|
|
277
277
|
data-pin=${b?c.id:I}
|
|
278
278
|
.onIntent=${x=>l.noteIntent(c.id,x)}
|
|
279
279
|
></dpk-internal-event-storming-note>`;return k`
|
|
280
|
-
<section class="band" data-band=${o} style=${`left:${
|
|
280
|
+
<section class="band" data-band=${o} style=${`left:${K+n.x}px;top:${n.y}px`}>
|
|
281
281
|
<div class="band-canvas" style=${`width:${n.width}px;height:${n.height}px`}>
|
|
282
282
|
${rn(t,e,o)}
|
|
283
283
|
${m.map(c=>{const{x:h,y:b,w:x}=f(c);return k`<div
|
|
@@ -396,7 +396,7 @@ import{ab as ht,ac as q,ad as ne,ae as oe,ay as N,af as v,aw as X,ag as K,ah as
|
|
|
396
396
|
</button>
|
|
397
397
|
</div>`},at=(t,e,n,o)=>({d:`M ${t.x} ${t.y} C ${e.x} ${e.y}, ${n.x} ${n.y}, ${o.x} ${o.y}`,mid:{x:(t.x+3*e.x+3*n.x+o.x)/8,y:(t.y+3*e.y+3*n.y+o.y)/8}}),pn=()=>Y`<marker id="es-arrow" viewBox="0 0 8 8" refX="7" refY="4" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
|
398
398
|
<path d="M0,0 L8,4 L0,8 z"></path>
|
|
399
|
-
</marker>`,hn=(t,e)=>{const n="url(#es-arrow)",o=[],i=a=>{const d=e.absXOf.get(a),l=e.bandOf.get(a),p=l===void 0?void 0:e.bands[l];if(!(d===void 0||l===void 0||p===void 0))return{x:
|
|
399
|
+
</marker>`,hn=(t,e)=>{const n="url(#es-arrow)",o=[],i=a=>{const d=e.absXOf.get(a),l=e.bandOf.get(a),p=l===void 0?void 0:e.bands[l];if(!(d===void 0||l===void 0||p===void 0))return{x:K+d,y:p.y+p.head,w:e.widthOf.get(a)??0,band:l}},s=a=>{const d=e.bands[a];return d===void 0?0:d.y+d.height},r=(a,d,l,p)=>{o.push(Y`<path class="link-hit" d=${d} @pointerdown=${g=>g.stopPropagation()} @click=${g=>t.handlers.linkClick(a.id,g.shiftKey||g.metaKey||g.ctrlKey)}></path>`);const m=t.selectedLinkIds.includes(a.id)?" is-selected":"";if(o.push(Y`<path class="link-path${m}" d=${d} marker-end=${n}></path>`),a.label===void 0)return;const f={start:6,end:-6,middle:0}[p];o.push(Y`<text class="link-label" x=${l.x+f} y=${l.y-6} text-anchor=${p}>${a.label}</text>`)};for(const a of e.arrows){const d=i(a.from),l=i(a.to);if(d===void 0||l===void 0)continue;if(d.band===l.band){const b=l.x>=d.x+d.w;if((b?l.x-(d.x+d.w):d.x-(l.x+l.w))<=ee+2){const u=d.y+z/2,C=b?d.x+d.w:d.x,D=b?l.x:l.x+l.w;r(a,`M ${C} ${u} L ${D} ${u}`,{x:(C+D)/2,y:u},"middle");continue}const E=mn(d,l,s(d.band)-it/2);r(a,E.d,E.mid,"middle");continue}const p=d.y<l.y,m=d.x+be,f=$e(m,l.x+be,l.x+l.w-be),g={x:m,y:p?d.y+z:d.y},c={x:f,y:p?l.y:l.y+z},h=p?(s(d.band)+(e.bands[l.band]?.y??0))/2:(s(l.band)+(e.bands[d.band]?.y??0))/2;r(a,un([g,{x:g.x,y:h},{x:c.x,y:h},c]),{x:c.x-6,y:h},"end")}return Y`<svg class="links-layer" width=${e.width} height=${e.height}>
|
|
400
400
|
<defs>${pn()}</defs>
|
|
401
401
|
${o}
|
|
402
402
|
</svg>`},mn=(t,e,n)=>{const o=t.y+z;if(e.x>=t.x+t.w){const r={x:t.x+t.w-18,y:o},a={x:e.x+18,y:o};return at(r,{x:r.x+48,y:n},{x:a.x-48,y:n},a)}const i={x:t.x+18,y:o},s={x:e.x+e.w-18,y:o};return at(i,{x:i.x-48,y:n},{x:s.x+48,y:n},s)},un=(t,e=10)=>{let n=`M ${t[0]?.x??0} ${t[0]?.y??0}`;for(let i=1;i<t.length-1;i+=1){const s=t[i-1],r=t[i],a=t[i+1];if(s===void 0||r===void 0||a===void 0)continue;const d=Math.sign(r.x-s.x),l=Math.sign(r.y-s.y),p=Math.sign(a.x-r.x),m=Math.sign(a.y-r.y),f=Math.hypot(r.x-s.x,r.y-s.y),g=Math.hypot(a.x-r.x,a.y-r.y),c=Math.max(0,Math.min(e,f/2,g/2));n+=` L ${r.x-d*c} ${r.y-l*c} Q ${r.x} ${r.y} ${r.x+p*c} ${r.y+m*c}`}const o=t.at(-1);return o===void 0?n:`${n} L ${o.x} ${o.y}`},fn=t=>{let e=0;for(const n of t)e=(e*31+n.charCodeAt(0))%997;return(e%17-8)*.09},gn=ve`
|
|
@@ -978,11 +978,11 @@ import{ab as ht,ac as q,ad as ne,ae as oe,ay as N,af as v,aw as X,ag as K,ah as
|
|
|
978
978
|
flex: 1 1 auto;
|
|
979
979
|
min-width: 0;
|
|
980
980
|
}
|
|
981
|
-
`,bn={width:260,height:150},xn={width:236,height:210},vn=64,kn=["event","command","aggregate","actor","policy","readmodel","external"],En=1200,dt=5,yn={x:20,top:46,bottom:40};class lt extends ye{static{this.styles=[ye.styles,gn,ke]}definitionFor(e){return He(e)}static{this.properties={mode:{state:!0},boardWidth:{state:!0},viewport:{state:!0},gesture:{state:!0},hoverSliceId:{state:!0},selectedSliceIds:{state:!0},selectedLinkIds:{state:!0},naming:{state:!0}}}#e;#n=new we(this);#o=new qt(this);constructor(){super(),this.mode=_,this.boardWidth=En,this.viewport={panX:24,panY:16,zoom:1},this.gesture=void 0,this.hoverSliceId=void 0,this.selectedSliceIds=[],this.selectedLinkIds=[],this.naming=void 0}disconnectedCallback(){super.disconnectedCallback(),this.#e?.disconnect(),this.#e=void 0}firstUpdated(){typeof ResizeObserver>"u"||(this.#e=new ResizeObserver(e=>{const n=e[0]?.contentRect.width;n!==void 0&&n>0&&(this.boardWidth=n)}),this.#e.observe(this))}updated(){super.updated(),this.#p(this.viewport),this.mode.kind==="append"&&this.#t("#append-menu",this.mode.point,xn),this.naming!==void 0&&this.#t("#context-pop",this.naming.point,bn,"#context-name")}#t(e,n,o,i){const s=this.renderRoot.querySelector(e);if(!s||s.matches(":popover-open")||(this.#n.open(s,
|
|
981
|
+
`,bn={width:260,height:150},xn={width:236,height:210},vn=64,kn=["event","command","aggregate","actor","policy","readmodel","external"],En=1200,dt=5,yn={x:20,top:46,bottom:40};class lt extends ye{static{this.styles=[ye.styles,gn,ke]}definitionFor(e){return He(e)}static{this.properties={mode:{state:!0},boardWidth:{state:!0},viewport:{state:!0},gesture:{state:!0},hoverSliceId:{state:!0},selectedSliceIds:{state:!0},selectedLinkIds:{state:!0},naming:{state:!0}}}#e;#n=new we(this);#o=new qt(this);constructor(){super(),this.mode=_,this.boardWidth=En,this.viewport={panX:24,panY:16,zoom:1},this.gesture=void 0,this.hoverSliceId=void 0,this.selectedSliceIds=[],this.selectedLinkIds=[],this.naming=void 0}disconnectedCallback(){super.disconnectedCallback(),this.#e?.disconnect(),this.#e=void 0}firstUpdated(){typeof ResizeObserver>"u"||(this.#e=new ResizeObserver(e=>{const n=e[0]?.contentRect.width;n!==void 0&&n>0&&(this.boardWidth=n)}),this.#e.observe(this))}updated(){super.updated(),this.#p(this.viewport),this.mode.kind==="append"&&this.#t("#append-menu",this.mode.point,xn),this.naming!==void 0&&this.#t("#context-pop",this.naming.point,bn,"#context-name")}#t(e,n,o,i){const s=this.renderRoot.querySelector(e);if(!s||s.matches(":popover-open")||(this.#n.open(s,Tt(n.x,n.y),o),i===void 0))return;const r=this.renderRoot.querySelector(i);r?.focus(),r instanceof HTMLInputElement&&r.select()}#s(){return Math.max(wn,this.boardWidth-96)}renderRegions(e){return{main:this.#r(e)}}#r(e){const n=O(this.locale);return k`
|
|
982
982
|
${nn({m:n,context:e,mode:this.mode,maxRowWidth:this.#s(),pinHeights:this.#o.heights,viewport:this.viewport,gesture:this.gesture,hoverSliceId:this.hoverSliceId,selectedSliceIds:this.selectedSliceIds,selectedLinkIds:this.selectedLinkIds,handlers:{noteIntent:(o,i)=>this.#S(o,i),addFirst:()=>this.#R(e),attachNote:(o,i)=>this.#C(e,o,i),viewportPointerDown:o=>this.#k(o),viewportPointerMove:o=>this.#E(o),viewportPointerUp:o=>this.#y(e,o),viewportPointerCancel:()=>this.gesture=void 0,viewportPointerLeave:()=>{this.gesture===void 0&&(this.hoverSliceId=void 0)},viewportWheel:o=>this.#w(o),portPointerDown:(o,i)=>this.#x(o,i),slicePointerDown:(o,i)=>this.#v(o,i),zoomStep:o=>this.#$(o),zoomFit:()=>this.#T(),zoomReset:()=>this.#m(1/this.viewport.zoom),groupSelection:o=>{this.selectedSliceIds.length>0&&(this.naming={kind:"create-context",sliceIds:this.selectedSliceIds,point:o})},assignSelection:o=>this.#g(e,o),stripSelectionContext:()=>this.#g(e,null),clearSelection:()=>{this.selectedSliceIds=[],this.selectedLinkIds=[]},linkClick:(o,i)=>this.#A(o,i),deleteSelection:()=>this.#f(e),keyDown:o=>this.#z(e,o),renameContext:(o,i)=>this.naming={kind:"rename-context",contextId:o,point:i},dissolveContext:o=>e.dispatch(y.deleteContext(o))}})}
|
|
983
983
|
${this.mode.kind==="append"?this.#P(e,this.mode.sliceId):I}
|
|
984
984
|
${this.naming!==void 0?this.#D(e,this.naming):I}
|
|
985
|
-
`}#i(){return this.renderRoot.querySelector(".board-viewport")}#a(e){const n=this.#i()?.getBoundingClientRect();return n===void 0?{x:e.clientX,y:e.clientY}:{x:e.clientX-n.left,y:e.clientY-n.top}}#l(e){const n=this.#i();if(n===null)return[];const o=n.getBoundingClientRect();return[...this.renderRoot.querySelectorAll("[data-slice-id]")].map(i=>{const s=i.getBoundingClientRect();return{id:i.dataset.sliceId??"",rect:{left:s.left-o.left-(e?.x??0),top:s.top-o.top-(e?.top??0),width:s.width+(e?.x??0)*2,height:s.height+(e?.top??0)+(e?.bottom??0)}}})}#h(e,n){const o=this.#i();o!==null&&(o.setPointerCapture(e.pointerId),this.gesture=n)}#x(e,n){if(n.button!==0)return;n.stopPropagation(),n.preventDefault();const o=this.#a(n);this.#h(n,{kind:"connect",pointerId:n.pointerId,fromSliceId:e,start:o,current:o,moved:!1})}#v(e,n){if(n.button!==0)return;n.stopPropagation(),n.preventDefault();const o=this.#a(n);this.#h(n,{kind:"move-slice",pointerId:n.pointerId,sliceId:e,start:o,current:o,moved:!1})}#k(e){if(e.button!==0||this.gesture!==void 0)return;for(const o of e.composedPath()){if(o===e.currentTarget)break;if(o instanceof Element&&(o.tagName.toLowerCase()==="dpk-internal-event-storming-note"||o.matches("button, select, textarea, input, a")))return}const n=this.#a(e);(this.mode.kind==="editing"||this.mode.kind==="append")&&(this.mode=_),this.selectedLinkIds=[],this.#h(e,{kind:"select",pointerId:e.pointerId,start:n,current:n,moved:!1})}#E(e){const n=this.gesture,o=this.#a(e);if(n===void 0){const i=pe(this.#l(yn),o.x,o.y);i!==this.hoverSliceId&&(this.hoverSliceId=i);return}this.gesture=je(n,{pointerId:e.pointerId,point:o},this.#l(),dt)}#y(e,n){const o=this.gesture;if(o===void 0||n.pointerId!==o.pointerId)return;const i=je(o,{pointerId:n.pointerId,point:this.#a(n)},this.#l(),dt);if(this.gesture=void 0,i.kind==="connect"){i.moved?i.targetSliceId!==void 0&&this.#I(e,i.fromSliceId,i.targetSliceId):this.#M(i.fromSliceId);return}if(i.kind==="move-slice"){if(!i.moved){this.selectedSliceIds=this.selectedSliceIds.includes(i.sliceId)?this.selectedSliceIds.filter(r=>r!==i.sliceId):[...this.selectedSliceIds,i.sliceId];return}i.drop!==void 0&&this.#O(e,i.sliceId,i.drop.sliceId,i.drop.side);return}if(!i.moved){this.selectedSliceIds=[];return}const s={left:Math.min(i.start.x,i.current.x),top:Math.min(i.start.y,i.current.y),width:Math.abs(i.current.x-i.start.x),height:Math.abs(i.current.y-i.start.y)};this.selectedSliceIds=[...qe(this.#l(),s)]}#w(e){e.preventDefault();const n=this.#a(e);this.#p(e.ctrlKey||e.metaKey?ce(this.viewport,n.x,n.y,Math.exp(-e.deltaY*.01)):
|
|
985
|
+
`}#i(){return this.renderRoot.querySelector(".board-viewport")}#a(e){const n=this.#i()?.getBoundingClientRect();return n===void 0?{x:e.clientX,y:e.clientY}:{x:e.clientX-n.left,y:e.clientY-n.top}}#l(e){const n=this.#i();if(n===null)return[];const o=n.getBoundingClientRect();return[...this.renderRoot.querySelectorAll("[data-slice-id]")].map(i=>{const s=i.getBoundingClientRect();return{id:i.dataset.sliceId??"",rect:{left:s.left-o.left-(e?.x??0),top:s.top-o.top-(e?.top??0),width:s.width+(e?.x??0)*2,height:s.height+(e?.top??0)+(e?.bottom??0)}}})}#h(e,n){const o=this.#i();o!==null&&(o.setPointerCapture(e.pointerId),this.gesture=n)}#x(e,n){if(n.button!==0)return;n.stopPropagation(),n.preventDefault();const o=this.#a(n);this.#h(n,{kind:"connect",pointerId:n.pointerId,fromSliceId:e,start:o,current:o,moved:!1})}#v(e,n){if(n.button!==0)return;n.stopPropagation(),n.preventDefault();const o=this.#a(n);this.#h(n,{kind:"move-slice",pointerId:n.pointerId,sliceId:e,start:o,current:o,moved:!1})}#k(e){if(e.button!==0||this.gesture!==void 0)return;for(const o of e.composedPath()){if(o===e.currentTarget)break;if(o instanceof Element&&(o.tagName.toLowerCase()==="dpk-internal-event-storming-note"||o.matches("button, select, textarea, input, a")))return}const n=this.#a(e);(this.mode.kind==="editing"||this.mode.kind==="append")&&(this.mode=_),this.selectedLinkIds=[],this.#h(e,{kind:"select",pointerId:e.pointerId,start:n,current:n,moved:!1})}#E(e){const n=this.gesture,o=this.#a(e);if(n===void 0){const i=pe(this.#l(yn),o.x,o.y);i!==this.hoverSliceId&&(this.hoverSliceId=i);return}this.gesture=je(n,{pointerId:e.pointerId,point:o},this.#l(),dt)}#y(e,n){const o=this.gesture;if(o===void 0||n.pointerId!==o.pointerId)return;const i=je(o,{pointerId:n.pointerId,point:this.#a(n)},this.#l(),dt);if(this.gesture=void 0,i.kind==="connect"){i.moved?i.targetSliceId!==void 0&&this.#I(e,i.fromSliceId,i.targetSliceId):this.#M(i.fromSliceId);return}if(i.kind==="move-slice"){if(!i.moved){this.selectedSliceIds=this.selectedSliceIds.includes(i.sliceId)?this.selectedSliceIds.filter(r=>r!==i.sliceId):[...this.selectedSliceIds,i.sliceId];return}i.drop!==void 0&&this.#O(e,i.sliceId,i.drop.sliceId,i.drop.side);return}if(!i.moved){this.selectedSliceIds=[];return}const s={left:Math.min(i.start.x,i.current.x),top:Math.min(i.start.y,i.current.y),width:Math.abs(i.current.x-i.start.x),height:Math.abs(i.current.y-i.start.y)};this.selectedSliceIds=[...qe(this.#l(),s)]}#w(e){e.preventDefault();const n=this.#a(e);this.#p(e.ctrlKey||e.metaKey?ce(this.viewport,n.x,n.y,Math.exp(-e.deltaY*.01)):Fe(this.viewport,-e.deltaX,-e.deltaY))}#m(e){const n=this.#i()?.getBoundingClientRect();this.#p(ce(this.viewport,(n?.width??0)/2,(n?.height??0)/2,e))}#$(e){this.#m(e===1?1.2:1/1.2)}#T(){const e=this.#i()?.getBoundingClientRect(),n=this.#u();e===void 0||n===void 0||this.#p(We(n,{width:e.width,height:e.height},48))}#u(){const e=this.renderRoot.querySelector(".wall");return e===null?void 0:{width:e.offsetWidth,height:e.offsetHeight}}#p(e){const n=this.#i()?.getBoundingClientRect(),o=this.#u(),i=n===void 0||o===void 0||o.width===0||n.width===0?e:Ge(e,o,{width:n.width,height:n.height},vn),s=this.viewport;i.panX===s.panX&&i.panY===s.panY&&i.zoom===s.zoom||(this.viewport=i)}#S(e,n){const o=this.context();switch(n.kind){case"select":o.navigate({note:e});break;case"rename":o.dispatch(y.setElementName(e,n.name));break;case"comment":o.dispatch({type:"comment",target:`element:${e}`,payload:{body:n.body}});break;case"delete":o.dispatch(y.deleteElement(e)),o.navigation.note===e&&o.navigate({note:null});break;case"add-hotspot":this.#_(o,e);break}this.mode=Je(this.mode,e,n)}#c(e,n){return R(e).find(o=>o.id===n)}#d(e){return e===void 0?[]:[...e.notes,...e.pins.map(n=>n.note)].map(n=>n.id)}#I(e,n,o){if(n===o)return;const i=R(e.state),s=i.find(f=>f.id===n),r=i.find(f=>f.id===o),a=s&&r?Oe(s,r):void 0;if(s===void 0||r===void 0||a===void 0||e.state.links.some(f=>f.from===a.from&&f.to===a.to))return;const d=e.state.links.map(f=>f.id),l=e.state.elements.map(f=>f.id),p=G(s)?.id,m=p!==void 0&&i.indexOf(r)>i.indexOf(s)?Ve(l,this.#d(r),[p],"after"):[];e.dispatchBatch([y.linkElements(A(`link-${a.from}`,d),a.from,a.to,{kind:"flow"}),...m.map(f=>y.moveElement(f.id,f.after))])}#L(e){const n=this.#i(),o=this.#l().find(s=>s.id===e)?.rect;if(n===null||o===void 0)return;const i=n.getBoundingClientRect();return{x:i.left+o.left+o.width,y:i.top+o.top+o.height/2}}#M(e){const n=this.#L(e);n!==void 0&&(this.mode={kind:"append",sliceId:e,point:n})}#N(e,n,o){const i=this.#c(e.state,n),s=i?G(i):void 0;if(s===void 0){this.mode=_;return}const r=A(`new-${o}`,W(e.state)),a=e.state.links.map(l=>l.id);if(!e.dispatchBatch([y.addElement(r,o,O(this.locale).noteTypeLabel(o)),y.linkElements(A(`link-${s.id}`,a),s.id,r,{kind:"flow"})]).ok){this.mode=_;return}e.navigate({note:r}),this.mode={kind:"editing",noteId:r}}#_(e,n){const o=A("new-hotspot",W(e.state)),i=e.state.links.map(r=>r.id);e.dispatchBatch([y.addElement(o,"hotspot",O(this.locale).noteTypeLabel("hotspot")),y.linkElements(A(`link-${o}`,i),o,n,{kind:"member"})]).ok&&(e.navigate({note:o}),this.mode={kind:"editing",noteId:o})}#C(e,n,o){const i=this.#c(e.state,n),s=i===void 0?void 0:Ne(i,o);if(s===void 0)return;const r=A(`new-${o}`,W(e.state)),[a,d]=s.incoming?[r,s.anchorId]:[s.anchorId,r],l=e.state.links.map(m=>m.id);e.dispatchBatch([y.addElement(r,o,O(this.locale).noteTypeLabel(o)),y.linkElements(A(`link-${a}`,l),a,d,{kind:"member"})]).ok&&(e.navigate({note:r}),this.mode={kind:"editing",noteId:r})}#O(e,n,o,i){const s=e.state,r=he(s.elements.map(a=>a.id),this.#d(this.#c(s,n)),this.#d(this.#c(s,o)),i);e.dispatchBatch(r.map(a=>y.moveElement(a.id,a.after)))}#A(e,n){this.mode.kind==="editing"&&(this.mode=_),this.selectedSliceIds=[],this.selectedLinkIds=n?this.selectedLinkIds.includes(e)?this.selectedLinkIds.filter(o=>o!==e):[...this.selectedLinkIds,e]:[e],this.#i()?.focus()}#f(e){if(this.selectedLinkIds.length>0){const i=e.state.links.filter(s=>this.selectedLinkIds.includes(s.id));e.dispatchBatch(i.map(s=>y.unlinkElements(s.from,s.to))),this.selectedLinkIds=[];return}if(this.selectedSliceIds.length===0)return;const n=R(e.state),o=this.selectedSliceIds.flatMap(i=>this.#d(n.find(s=>s.id===i)));e.dispatchBatch(o.map(i=>y.deleteElement(i))),this.selectedSliceIds=[]}#z(e,n){if(n.target!==n.currentTarget)return;if(n.key==="Escape"){this.selectedSliceIds=[],this.selectedLinkIds=[];return}if(n.key!=="Delete"&&n.key!=="Backspace"||this.mode.kind!=="idle"||this.naming!==void 0)return;if(n.preventDefault(),this.selectedLinkIds.length>0||this.selectedSliceIds.length>0){this.#f(e);return}const o=e.navigation.note;o===void 0||P(e.state,o)===void 0||(e.dispatch(y.deleteElement(o)),e.navigate({note:null}))}#g(e,n){const o=R(e.state),i=this.selectedSliceIds.flatMap(r=>this.#d(o.find(a=>a.id===r)));e.dispatchBatch(i.map(r=>y.setElementContext(r,n))).ok&&(this.selectedSliceIds=[])}#b(e,n){const i=this.renderRoot.querySelector("#context-name")?.value.trim()??"";if(i==="")return;if(n.kind==="rename-context"){e.dispatch(y.setContextName(n.contextId,i)).ok&&(this.naming=void 0);return}const s=A("context",e.state.contexts.map(l=>l.id)),r=R(e.state),a=n.sliceIds.flatMap(l=>this.#d(r.find(p=>p.id===l)));e.dispatchBatch([y.addContext(s,i),...a.map(l=>y.setElementContext(l,s))]).ok&&(this.selectedSliceIds=[],this.naming=void 0)}#D(e,n){const o=O(this.locale),i=n.kind==="rename-context"?H(e.state,n.contextId)?.name??"":"";return k`<div id="context-pop" class="comment-pop context-pop" popover="manual">
|
|
986
986
|
<span class="dpk-label"> ${n.kind==="create-context"?o.newContextTitle:o.renameContextTitle} </span>
|
|
987
987
|
<input
|
|
988
988
|
id="context-name"
|
|
@@ -1014,4 +1014,4 @@ import{ab as ht,ac as q,ad as ne,ae as oe,ay as N,af as v,aw as X,ag as K,ah as
|
|
|
1014
1014
|
<div class="pop-actions">
|
|
1015
1015
|
<button class="dpk-btn" type="button" @click=${()=>this.mode=_}>${o.cancel}</button>
|
|
1016
1016
|
</div>
|
|
1017
|
-
</div>`}#R(e){const n=A("new-event",W(e.state));if(!e.dispatch(y.addElement(n,"event",O(this.locale).noteTypeLabel("event"))).ok){this.mode=_;return}e.navigate({note:n}),this.mode={kind:"editing",noteId:n}}}const wn=264,ct=()=>{Gt(),customElements.get("dpk-template-event-storming")||customElements.define("dpk-template-event-storming",lt)},$n=Object.freeze(Object.defineProperty({__proto__:null,DpkTemplateEventStorming:lt,ES_IDLE:_,NOTE_TYPES:j,ZOOM_MAX:
|
|
1017
|
+
</div>`}#R(e){const n=A("new-event",W(e.state));if(!e.dispatch(y.addElement(n,"event",O(this.locale).noteTypeLabel("event"))).ok){this.mode=_;return}e.navigate({note:n}),this.mode={kind:"editing",noteId:n}}}const wn=264,ct=()=>{Gt(),customElements.get("dpk-template-event-storming")||customElements.define("dpk-template-event-storming",lt)},$n=Object.freeze(Object.defineProperty({__proto__:null,DpkTemplateEventStorming:lt,ES_IDLE:_,NOTE_TYPES:j,ZOOM_MAX:Ke,ZOOM_MIN:le,allNoteIds:W,applyEventStormingAction:Le,attachAnchor:Ne,buildSlices:R,connectionEndpoints:Oe,constrainViewport:Ge,defineEventStormingElement:ct,describeEventStormingAction:De,dropSide:Ue,emptyEventStormingBase:Ie,eventStormingAction:y,eventStormingActions:w,eventStormingBaseSchema:Te,eventStormingCommentTargets:Be,eventStormingDefinitionFor:He,eventStormingHasTarget:Ye,eventStormingMessages:O,eventStormingTargetLabel:Re,eventStormingTitle:ae,findContext:H,findLink:se,findNote:P,fitViewport:We,hitRect:pe,noteCardModeOf:Ze,panBy:Fe,parseEventStormingBase:Se,planSliceBands:Ce,rectsInBand:qe,reduceNoteIntent:Je,resolveEventStormingNavigation:Xe,sameSlice:J,serializeEventStormingAction:Pe,sliceArrows:_e,sliceMovePlan:he,sliceMoveSteps:Ve,sliceVoice:G,zoomAt:ce},Symbol.toStringTag,{value:"Module"}));export{ct as d,$n as i};
|
package/dist/components.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a}from"./chunks/shared-
|
|
1
|
+
import{r as a}from"./chunks/shared-DBJaP5gF.js";import{D as e,a as s,b as n,c as t,d as o,e as r,f as i,g as p,h as m,i as c,j as d,k as D,l as f,m as l,n as g,o as C,p as S,q as A,s as E,t as M,u as k,v as u}from"./chunks/shared-DBJaP5gF.js";import{s as y}from"./chunks/shared-BC5MlWBY.js";import{C as h,a as T,D as I,b as v,c as K,E as N,F as O,M as b,T as R,W as P,d as q,e as F,f as G,g as j,h as w,i as _,j as B,k as H,l as V,m as W,n as x,o as z,p as L,q as U,r as Y,t as J,u as Q,v as X,w as Z,x as $,y as aa,z as ea,A as sa,B as na,G as ta,H as oa,I as ra,J as ia,K as pa,L as ma,N as ca,O as da,P as Da,Q as fa,R as la,S as ga,U as Ca,V as Sa,X as Aa,Y as Ea,Z as Ma}from"./chunks/shared-BC5MlWBY.js";y({entry:"components.js",templates:[],register:()=>{a()}});export{h as COMMENT_ACTION,T as COMMENT_DESCRIPTOR,e as DpkComponentArchitectureMap,I as DpkComponentCommentPanel,s as DpkComponentDependencyGraph,n as DpkComponentErDiagram,t as DpkComponentFormalSpec,v as DpkComponentInlineEdit,o as DpkComponentKanban,r as DpkComponentMindMap,i as DpkComponentSequenceDiagram,p as DpkComponentStateDiagram,K as DraftController,N as EMPTY_NAVIGATION,O as FRAMEWORK_VERSION,b as MemoryDraftStorage,R as TemplateElement,P as WebStorageDraftStorage,q as appendAction,F as assertNever,G as buildAgentBrief,j as commentActionSchema,w as commentBody,_ as commentTargetKey,B as controls,H as createActionId,V as createEntityId,W as dedupeKeyOf,x as defaultStorage,z as defaultStorageKey,L as defineAction,m as defineArchitectureMap,U as defineCommentPanel,c as defineDependencyGraph,d as defineErDiagram,D as defineFormalSpec,Y as defineInlineEdit,f as defineKanban,l as defineMindMap,g as defineSequenceDiagram,C as defineStateDiagram,J as derive,Q as draftActionEnvelopeSchema,X as entityDedupeKey,Z as formatHash,$ as iconArrowDown,aa as iconArrowUp,ea as iconClose,sa as iconComment,na as iconGrip,ta as iconLink,oa as iconMove,ra as iconPencil,ia as iconPlus,pa as iconTrash,ma as liveActions,S as parseFormalSpecData,ca as parseHash,A as parseKanbanData,E as parseMindMapData,M as parseSequenceData,k as parseStateData,da as parseTargetRef,Da as parseTemplateAction,fa as patchNavigation,la as payloadFor,a as registerComponentElements,u as registerDiagramElements,ga as serializeDraft,Ca as slugify,Sa as targetRef,Aa as targetSchema,Ea as toTarget,Ma as tokens};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./chunks/shared-
|
|
1
|
+
import{r as e}from"./chunks/shared-DBJaP5gF.js";import{D as r,a as s,b as i,c as m,d as n,e as p,f as l,g as f,v as d}from"./chunks/shared-DBJaP5gF.js";import{s as g,_ as E,$ as D,F as t}from"./chunks/shared-BC5MlWBY.js";import{C as c,D as k,b as C,c as y,M as S,T as M,W as b,e as u,f as A,h as T,l as h,n as v,o as P,p as R,t as N,v as O,w as x,N as I,O as B,P as F,Q as K,R as W,U as _,V as w}from"./chunks/shared-BC5MlWBY.js";import{d as V}from"./chunks/shared-BvuW5NtY.js";import{i as G}from"./chunks/shared-BvuW5NtY.js";import{d as H}from"./chunks/shared-y3FwoRgh.js";import{i as U}from"./chunks/shared-y3FwoRgh.js";import{d as j}from"./chunks/shared-CoDXb-Yj.js";import{i as q}from"./chunks/shared-CoDXb-Yj.js";import{d as L}from"./chunks/shared-BwaDMwUS.js";import{i as Q}from"./chunks/shared-BwaDMwUS.js";import{d as $}from"./chunks/shared-CLnfjHCQ.js";import{i as z}from"./chunks/shared-CLnfjHCQ.js";import{d as J}from"./chunks/shared-D7CMQLaX.js";import{i as X}from"./chunks/shared-D7CMQLaX.js";import{d as Y}from"./chunks/shared-DYe0OZr-.js";import{i as Z}from"./chunks/shared-DYe0OZr-.js";import{d as ee}from"./chunks/shared-DkkBQzIf.js";import{i as ae}from"./chunks/shared-DkkBQzIf.js";import{d as te}from"./chunks/shared-DUq2-pM9.js";import{i as oe}from"./chunks/shared-DUq2-pM9.js";import{d as re}from"./chunks/shared-DhwK_dh_.js";import{i as se}from"./chunks/shared-DhwK_dh_.js";const a=()=>{J(),te(),H(),j(),L(),$(),Y(),ee(),V(),re()},o=["prototype","usm","event-storming","example-mapping","grill","plain","slides","task-board","delegation-poker","whiteboard"],ie=()=>{e(),a(),E(t,o,D)};g({entry:"index.js",templates:o,register:()=>{e(),a()}});export{c as COMMENT_ACTION,r as DpkComponentArchitectureMap,k as DpkComponentCommentPanel,s as DpkComponentDependencyGraph,i as DpkComponentErDiagram,m as DpkComponentFormalSpec,C as DpkComponentInlineEdit,n as DpkComponentKanban,p as DpkComponentMindMap,l as DpkComponentSequenceDiagram,f as DpkComponentStateDiagram,y as DraftController,t as FRAMEWORK_VERSION,S as MemoryDraftStorage,M as TemplateElement,b as WebStorageDraftStorage,u as assertNever,A as buildAgentBrief,T as commentBody,h as createEntityId,v as defaultStorage,P as defaultStorageKey,R as defineAction,G as delegationPoker,N as derive,O as entityDedupeKey,U as eventStorming,q as exampleMapping,x as formatHash,Q as grill,I as parseHash,B as parseTargetRef,F as parseTemplateAction,K as patchNavigation,W as payloadFor,z as plain,X as prototype,ie as registerAllElements,e as registerComponentElements,d as registerDiagramElements,a as registerTemplateElements,Z as slides,_ as slugify,w as targetRef,ae as taskBoard,oe as usm,se as whiteboard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as a,q as e,r as s}from"../chunks/shared-
|
|
1
|
+
import{s as a,q as e,r as s}from"../chunks/shared-BC5MlWBY.js";import{C as t,a as o,D as n,b as r,c as i,E as m,F as c,M as l,T as p,W as d,d as f,e as g,f as A,g as E,h as y,i as T,j as C,k as D,l as S,m as I,n as k,o as M,p as N,t as O,u as P,v as h,w as u,x as R,y as v,z as K,A as w,B as _,G as b,H as B,I as F,J as G,K as H,L as V,N as W,O as j,P as x,Q as z,R as L,S as U,U as Y,V as q,X as J,Y as Q,Z as X}from"../chunks/shared-BC5MlWBY.js";import{d as Z}from"../chunks/shared-BvuW5NtY.js";import{i as $}from"../chunks/shared-BvuW5NtY.js";a({entry:"templates/delegation-poker.js",templates:["delegation-poker"],register:()=>{e(),s(),Z()}});export{t as COMMENT_ACTION,o as COMMENT_DESCRIPTOR,n as DpkComponentCommentPanel,r as DpkComponentInlineEdit,i as DraftController,m as EMPTY_NAVIGATION,c as FRAMEWORK_VERSION,l as MemoryDraftStorage,p as TemplateElement,d as WebStorageDraftStorage,f as appendAction,g as assertNever,A as buildAgentBrief,E as commentActionSchema,y as commentBody,T as commentTargetKey,C as controls,D as createActionId,S as createEntityId,I as dedupeKeyOf,k as defaultStorage,M as defaultStorageKey,N as defineAction,$ as delegationPoker,O as derive,P as draftActionEnvelopeSchema,h as entityDedupeKey,u as formatHash,R as iconArrowDown,v as iconArrowUp,K as iconClose,w as iconComment,_ as iconGrip,b as iconLink,B as iconMove,F as iconPencil,G as iconPlus,H as iconTrash,V as liveActions,W as parseHash,j as parseTargetRef,x as parseTemplateAction,z as patchNavigation,L as payloadFor,U as serializeDraft,Y as slugify,q as targetRef,J as targetSchema,Q as toTarget,X as tokens};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as a,q as e,r as s}from"../chunks/shared-
|
|
1
|
+
import{s as a,q as e,r as s}from"../chunks/shared-BC5MlWBY.js";import{C as t,a as o,D as n,b as r,c as i,E as m,F as c,M as p,T as l,W as f,d,e as g,f as A,g as E,h as y,i as S,j as T,k as C,l as v,m as D,n as I,o as M,p as N,t as O,u as h,v as u,w as R,x as P,y as K,z as k,A as w,B as _,G as b,H as B,I as F,J as G,K as H,L as V,N as W,O as j,P as x,Q as z,R as L,S as U,U as Y,V as q,X as J,Y as Q,Z as X}from"../chunks/shared-BC5MlWBY.js";import{d as Z}from"../chunks/shared-y3FwoRgh.js";import{i as $}from"../chunks/shared-y3FwoRgh.js";a({entry:"templates/event-storming.js",templates:["event-storming"],register:()=>{e(),s(),Z()}});export{t as COMMENT_ACTION,o as COMMENT_DESCRIPTOR,n as DpkComponentCommentPanel,r as DpkComponentInlineEdit,i as DraftController,m as EMPTY_NAVIGATION,c as FRAMEWORK_VERSION,p as MemoryDraftStorage,l as TemplateElement,f as WebStorageDraftStorage,d as appendAction,g as assertNever,A as buildAgentBrief,E as commentActionSchema,y as commentBody,S as commentTargetKey,T as controls,C as createActionId,v as createEntityId,D as dedupeKeyOf,I as defaultStorage,M as defaultStorageKey,N as defineAction,O as derive,h as draftActionEnvelopeSchema,u as entityDedupeKey,$ as eventStorming,R as formatHash,P as iconArrowDown,K as iconArrowUp,k as iconClose,w as iconComment,_ as iconGrip,b as iconLink,B as iconMove,F as iconPencil,G as iconPlus,H as iconTrash,V as liveActions,W as parseHash,j as parseTargetRef,x as parseTemplateAction,z as patchNavigation,L as payloadFor,U as serializeDraft,Y as slugify,q as targetRef,J as targetSchema,Q as toTarget,X as tokens};
|