dev-process-kit 0.3.0-beta.1 → 0.3.0-beta.2
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/boards.js +1 -1
- package/dist/chunks/{shared-dnY35u9q.js → shared-B-DAJvq3.js} +1 -1
- package/dist/chunks/{shared-qk9TB_UM.js → shared-BT5Ayp_z.js} +1 -1
- package/dist/chunks/shared-BTf38OnF.js +1 -0
- package/dist/chunks/{shared-DdpMqkAH.js → shared-BXejn2ZQ.js} +1 -1
- package/dist/chunks/{shared-Cas88qVh.js → shared-BdIN9A6O.js} +1 -1
- package/dist/chunks/{shared-CnPCm4bJ.js → shared-C7wOrDIL.js} +1 -1
- package/dist/chunks/{shared-e9ia12Uz.js → shared-CE8X9qCv.js} +1 -1
- package/dist/chunks/{shared-Cejw83eH.js → shared-CPNa9lTa.js} +1 -1
- package/dist/chunks/{shared-df9XN7ns.js → shared-CPwjSgu0.js} +1 -1
- package/dist/chunks/{shared-DHVDag3x.js → shared-CpJDPnHA.js} +1 -1
- package/dist/chunks/{shared-a9QCZpxj.js → shared-D2qgtKhc.js} +1 -1
- package/dist/chunks/{shared-C-M2Nfmu.js → shared-DOKOFdYm.js} +1 -1
- package/dist/chunks/{shared-CfVpKPRY.js → shared-DgexE4u1.js} +20 -2
- package/dist/chunks/{shared-BX1EnRfr.js → shared-Dgse8blZ.js} +1 -1
- package/dist/chunks/{shared-D7VtCoY6.js → shared-DnJcdL52.js} +1 -1
- package/dist/chunks/{shared-D1iBuYZV.js → shared-HdOOfyqP.js} +1 -1
- package/dist/components.js +1 -1
- package/dist/index.js +1 -1
- package/dist/views/delegation-poker.js +1 -1
- package/dist/views/plain.js +1 -1
- package/dist/views/prototype.js +1 -1
- package/dist/views/slides.js +1 -1
- package/dist/views/task-board.js +1 -1
- package/dist/views/usm.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/shared-EYOAbLSo.js +0 -1
package/dist/boards.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e,d as s,a as r}from"./chunks/shared-
|
|
1
|
+
import{s as e,d as s,a as r}from"./chunks/shared-BXejn2ZQ.js";import{C as t,b as o,D as n,E as i,v as d,M as m,V as p,W as c,c as f,e as g,f as l,g as D,h as E,i as B,j as y,k as A,l as h,m as M,n as S,o as u,p as k,q as v,r as C,t as T,u as b,w,x as N,y as O,z as I,A as K,B as R,F as P,G as x,H as q,I as G,J as V,K as W,L as j,N as _,O as F,P as H,Q as z,R as L,S as U,T as J,U as Q,X}from"./chunks/shared-BXejn2ZQ.js";import{r as a}from"./chunks/shared-HdOOfyqP.js";import{B as Y,a as Z,b as $,D as aa,c as ea,d as sa,e as ra,f as ta,g as oa,h as na,i as ia,j as da,k as ma,l as pa,m as ca,n as fa,o as ga,p as la,q as Da,s as Ea,t as Ba,u as ya,v as Aa,w as ha,x as Ma,y as Sa}from"./chunks/shared-HdOOfyqP.js";import{r as ua}from"./chunks/shared-B-DAJvq3.js";e({entry:"boards.js",url:import.meta.url,views:[],register:()=>{ua(),a(),s(),r()}});export{Y as BoardCanvasChromeElement,Z as BoardCanvasElement,$ as BoardChromeBase,t as COMMENT_ACTION,o as COMMENT_DESCRIPTOR,aa as DpkBoardArchitectureMap,ea as DpkBoardDependencyGraph,sa as DpkBoardErDiagram,ra as DpkBoardEventStorming,ta as DpkBoardExampleMapping,oa as DpkBoardKanban,na as DpkBoardMindMap,ia as DpkBoardSequenceDiagram,da as DpkBoardStateDiagram,ma as DpkBoardWhiteboard,n as DraftController,i as EMPTY_NAVIGATION,d as FRAMEWORK_VERSION,m as MemoryDraftStorage,p as ViewElement,c as WebStorageDraftStorage,f as appendAction,g as assertNever,l as buildAgentBrief,D as commentActionSchema,E as commentBody,B as commentTargetKey,y as controls,A as createActionId,h as createEntityId,M as dedupeKeyOf,S as defaultStorage,u as defaultStorageKey,k as defineAction,pa as defineArchitectureMap,ca as defineDependencyGraph,fa as defineErDiagram,ga as defineEventStorming,la as defineExampleMapping,Da as defineKanban,Ea as defineMindMap,Ba as defineSequenceDiagram,ya as defineStateDiagram,Aa as defineWhiteboard,v as derive,ha as diagramMessages,Ma as diagramStyles,C as draftActionEnvelopeSchema,T as entityDedupeKey,b as formatHash,w as iconArrowDown,N as iconArrowUp,O as iconClose,I as iconComment,K as iconGrip,R as iconLink,P as iconMove,x as iconPencil,q as iconPlus,G as iconTrash,Sa as isActionPayload,V as liveActions,W as parseHash,j as parseTargetRef,_ as parseViewAction,F as patchNavigation,H as payloadFor,a as registerBoardElements,z as serializeDraft,L as slugify,U as targetRef,J as targetSchema,Q as toTarget,X as tokens};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aE as bt,ai as h,as as r,S as qs,aQ as G,a5 as D,ak as z,X as M,j as K,ah as T,al as R,b2 as Ps,H as Is,b3 as Xt,b4 as Os,b5 as Us,au as B,a9 as kt,aw as u,b6 as Yt,aa as w,aX as vt,a8 as Zt,aD as Jt,ac as b,aL as Fs,ad as dt,aO as Qt,az as st,aH as F,b7 as te,av as y,ax as $,a_ as xt,ay as E,aM as W,aB as at,aj as I,aC as ee,ab as V,aA as se,ag as yt,ar as ae,aY as Hs,aW as ne,b8 as _s,b9 as wt,ba as Bs,bb as ie,bc as ct,z as Ns,bd as re,aG as Ws,aZ as Gs,y as Ks,be as Vs,_ as Xs,$ as Ys}from"./shared-DdpMqkAH.js";import{o as N,r as Zs}from"./shared-TrlnHjrJ.js";import{e as Js}from"./shared-a9QCZpxj.js";import{a as oe,c as Qs}from"./shared-Cas88qVh.js";import{c as ta}from"./shared-qk9TB_UM.js";import{p as ea,i as sa,r as aa,c as na,a as le,b as de,d as ia,e as ra,f as oa,h as ce,g as la,j as $t,s as da,k as ca,l as pa,m as ha,n as ua,t as ma}from"./shared-C-M2Nfmu.js";import{B as ga,t as fa,v as ba,i as ka,k as va,j as xa}from"./shared-df9XN7ns.js";import{d as ya}from"./shared-CnPCm4bJ.js";class pt{#n;#t;#e=null;#s=null;#a=null;#i=null;#r=new Map;#o=null;constructor(t){this.#n=t,this.#t=new bt(t),t.addController(this)}get isOpen(){return this.#e!==null}open(t,e,s){this.#e=t,this.#a=e,this.#i=s??null,this.#o=null,this.#n.requestUpdate()}close(){this.#e=null,this.#a=null,this.#i=null,this.#n.requestUpdate()}hostDisconnected(){this.close()}sync(t){const e=this.#s!==this.#e;this.#s=this.#e,!(t===null||this.#a===null||this.#e===null)&&(this.#t.open(t,this.#a,{width:300,height:280},{placement:"right-start",trackTransform:!0}),e&&t.querySelector("textarea")?.focus({preventScroll:!0}))}render(t){const e=this.#e;if(e===null)return h;const s=ea(this.#r.get(e)??"",[],{...this.#i===null?{}:{label:this.#i},key:e,...this.#o===e&&t.errorMessage!==void 0?{error:t.errorMessage}:{}});return r`${sa(e,aa(na(t.locale),s,n=>this.#l(e,t.submit,n)))}`}#l(t,e,s){if(s.kind==="input"){this.#r=new Map(this.#r).set(t,s.body),this.#o=null,this.#n.requestUpdate();return}if(s.kind==="comment"){if(!e(t,s.body)){this.#o=t,this.#n.requestUpdate();return}const i=new Map(this.#r);i.delete(t),this.#r=i}this.#o=null,this.close()}}const Ct=(a,t,e,s)=>{if(a===null)return null;const n=qs(a),i=t.find(l=>l.value===n);return i===void 0?null:{id:"review-comment",entries:[{kind:"item",id:"review-comment",label:e.reviewComment,run:()=>s(n,i.label)}]}},ht=.08,pe=1.8,he=a=>{if(a.length===0)return{x:0,y:0,width:0,height:0};const t=Math.min(...a.map(i=>i.x)),e=Math.min(...a.map(i=>i.y)),s=Math.max(...a.map(i=>i.x+i.width))-t,n=Math.max(...a.map(i=>i.y+i.height))-e;return{x:t-s*.1,y:e-n*.1,width:s*1.2,height:n*1.2}},ue=(a,t)=>a+t/12,wa=(a,t)=>{if(a.length===0)return null;const e=Math.min(...a.map(n=>n.y)),s=a.filter(n=>n.y<e+t);return{x:Math.min(...s.map(n=>n.x)),y:e}},St=16,$a=.8,ut=(a,t,e,s,n)=>a==="start"?St-ue(t,e)*s:(n-e*s)/2-t*s,me=(a,t,e,s,n="center")=>{if(t.width===0||t.height===0)return{...a,x:0,y:0};const i=(l,d,o,g)=>{const p=o*a.scale,f=g*$a;if(p<=g){const S=ut(n,d,o,a.scale,g);return G(l,S-f,S+f)}return G(l,g-(d+o)*a.scale-f,-d*a.scale+f)};return{...a,x:i(a.x,t.x,t.width,e),y:i(a.y,t.y,t.height,s)}},Ca=(a,t,e,s,n,i,l="center")=>{const d=Math.abs(i)>Math.abs(n);if(d&&t.height*a.scale<=s)return null;const o=me({...a,x:a.x-n,y:a.y-i},t,e,s,l);return d&&o.y===a.y?null:o},Sa=a=>Math.exp(-a*.01),ge='button,[role="button"],a,input,textarea,select',Et=(a,t,e)=>{for(const s of a.composedPath()){if(s===t)return null;if(s instanceof Element&&s.matches(e))return s}return null},Ea=a=>{const{canvas:t,world:e,onClearSelection:s,onView:n,align:i="center",sizeWorld:l=!0}=a;let d={x:0,y:0,width:0,height:0},o={x:0,y:0,scale:1};const g=()=>({width:t.clientWidth||1e3,height:t.clientHeight||560}),p=()=>{const{width:c,height:m}=g();o=me(o,d,c,m,i),e.style.transform=`translate(${o.x}px, ${o.y}px) scale(${o.scale})`,e.style.setProperty("--dpk-zoom-inverse",String(1/o.scale)),e.style.setProperty("--dpk-zoom-scale",String(o.scale)),n?.(o)},f=()=>{const{width:c,height:m}=g(),k=d.width/1.2||1,x=d.height/1.2||1,C=G(Math.min((c-24)/k,(m-40)/x),ht,1);o={scale:C,x:ut(i,d.x,d.width,C,c),y:ut(i,d.y,d.height,C,m)},p()},S=c=>{const{width:m,height:k}=g(),x=he([c]),C=x.width/1.2||1,L=x.height/1.2||1;o={...o,scale:G(Math.min((m-24)/C,(k-40)/L),ht,pe)},o={...o,x:(m-x.width*o.scale)/2-x.x*o.scale,y:(k-x.height*o.scale)/2-x.y*o.scale},p()},O=()=>{const{width:c}=g(),m=d.width/1.2||1,k=G((c-24)/m,ht,1);o={scale:k,x:(c-d.width*k)/2-d.x*k,y:16},p()},lt=c=>{const{width:m,height:k}=g(),x=(C,L,Kt,Vt)=>Vt!==void 0?St-Vt:L<=Kt?ut(i,C,L,1,Kt):St-ue(C,L);o={scale:1,x:x(d.x,d.width,m,c?.x),y:x(d.y,d.height,k,c?.y)},p()},_=(c,m=g().width/2,k=g().height/2)=>{const x=o.scale,C=G(x*c,ht,pe);C!==x&&(o={scale:C,x:m-(m-o.x)*C/x,y:k-(k-o.y)*C/x},p())},Q=c=>{if(Et(c,t,".diagram-zoom")!==null)return;const m=c.deltaMode===1?16:c.deltaMode===2?g().height:1;if(c.ctrlKey||c.metaKey){c.preventDefault();const L=t.getBoundingClientRect();_(Sa(c.deltaY),c.clientX-L.left,c.clientY-L.top);return}const{width:k,height:x}=g(),C=Ca(o,d,k,x,c.deltaX*m,c.deltaY*m,i);C!==null&&(c.preventDefault(),o=C,p())},q=new Map;let A=null,P=!1;const U=()=>{const c=[...q.values()],m=c[0];if(!m)return null;const k=c[1];return k?{x:(m.x+k.x)/2,y:(m.y+k.y)/2,distance:Math.hypot(k.x-m.x,k.y-m.y)}:{...m,distance:0}},tt=c=>{q.size===0&&(P=!1);const m=Et(c,t,ge);c.button!==0||c.pointerType!=="touch"&&m!==null||(q.set(c.pointerId,{x:c.clientX,y:c.clientY}),A=U(),m===null&&t.setPointerCapture(c.pointerId),c.pointerType!=="touch"&&m===null&&(c.preventDefault(),t.focus({preventScroll:!0})))},Ht=c=>{if(!q.has(c.pointerId)||A===null)return;q.set(c.pointerId,{x:c.clientX,y:c.clientY});const m=U();if(m===null)return;const k=m.x-A.x,x=m.y-A.y;if((Math.abs(k)+Math.abs(x)>1||Math.abs(m.distance-A.distance)>1)&&(P=!0),m.distance>0&&A.distance>0){const C=t.getBoundingClientRect();_(Math.pow(m.distance/A.distance,.45),A.x-C.left,A.y-C.top)}o={...o,x:o.x+k,y:o.y+x},p(),A=m,t.classList.toggle("is-panning",P)},et=c=>{q.delete(c.pointerId),A=U(),!(q.size>0)&&(t.classList.remove("is-panning"),c.type==="pointercancel"&&(P=!1))},_t=c=>{P&&(c.preventDefault(),c.stopPropagation()),et(c)},Bt=c=>{if(P){c.preventDefault(),c.stopPropagation(),P=!1;return}!(c.target instanceof Element)||Et(c,t,ge)!==null||s()},Nt=c=>{if(c.target!==t)return;const m=30;if(c.key==="+"||c.key==="=")_(1.1);else if(c.key==="-")_(1/1.1);else if(c.key==="0")f();else if(c.key==="Escape"){if(s()===!1)return}else if(c.key==="ArrowLeft"||c.key==="ArrowRight"||c.key==="ArrowUp"||c.key==="ArrowDown")o={...o,x:o.x+(c.key==="ArrowLeft"?m:c.key==="ArrowRight"?-m:0),y:o.y+(c.key==="ArrowUp"?m:c.key==="ArrowDown"?-m:0)},p();else return;c.preventDefault()},Wt=c=>{const m=c.target instanceof HTMLElement?c.target:null;if(m===null||!c.composedPath().includes(e))return;const k=m.getBoundingClientRect(),x=t.getBoundingClientRect();let C=0,L=0;k.left<x.left+12?C=x.left+12-k.left:k.right>x.right-12&&(C=x.right-12-k.right),k.top<x.top+12?L=x.top+12-k.top:k.bottom>x.bottom-40&&(L=x.bottom-40-k.bottom),!(C===0&&L===0)&&(o={...o,x:o.x+C,y:o.y+L},p())};t.addEventListener("wheel",Q,{passive:!1}),t.addEventListener("pointerdown",tt),t.addEventListener("pointermove",Ht),t.addEventListener("pointerup",_t),t.addEventListener("pointercancel",et),t.addEventListener("lostpointercapture",et),t.addEventListener("click",Bt,!0),t.addEventListener("keydown",Nt),t.addEventListener("focusin",Wt);const Gt=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>p());return Gt?.observe(t),{setContent(c){d=he(c.width===0&&c.height===0?[]:[c]),l&&(e.style.width=`${c.width}px`,e.style.height=`${c.height}px`),p()},apply:p,fit:f,fitTo:S,fitWidth:O,reset:lt,zoom:_,view:()=>({...o}),destroy(){Gt?.disconnect(),t.removeEventListener("wheel",Q),t.removeEventListener("pointerdown",tt),t.removeEventListener("pointermove",Ht),t.removeEventListener("pointerup",_t),t.removeEventListener("pointercancel",et),t.removeEventListener("lostpointercapture",et),t.removeEventListener("click",Bt,!0),t.removeEventListener("keydown",Nt),t.removeEventListener("focusin",Wt)}}},za=["fit","fit-width","actual","none"];class Ta{#n;#t=null;#e=null;#s=!1;constructor(t,e){this.#n=e,t.addController(this)}hostDisconnected(){this.detach()}get attached(){return this.#t!==null}get view(){return this.#t?.view()??{x:0,y:0,scale:1}}attach(){this.detach();const t=this.#n.elements();if(t===null)return;const{canvas:e,world:s}=t;this.#t=Ea({canvas:e,world:s,align:this.#n.align(),sizeWorld:!1,onClearSelection:()=>this.#n.onDismiss(),onView:n=>this.#n.onView(n)}),this.#e=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>this.sync()),this.#e?.observe(s),this.sync()}detach(){this.#t?.destroy(),this.#t=null,this.#e?.disconnect(),this.#e=null}sync(){const t=this.#t,e=this.#n.elements()?.world;if(t===null||e===void 0)return;const s=this.#n.contentSize();e.style.width=s?`${s.width}px`:"",e.style.height=s?`${s.height}px`:"";const n=s?.width??e.offsetWidth,i=s?.height??e.offsetHeight;t.setContent({x:0,y:0,width:n,height:i}),!this.#s&&n>0&&i>0&&this.open()}open(){const t=this.#t;if(t===null)return;this.#s=!0;const e=this.#n.initial(),s=za.includes(e)?e:"fit";s==="fit"?t.fit():s==="fit-width"?t.fitWidth():s==="actual"&&t.reset()}fit(){this.#t?.fit()}fitWidth(){this.#t?.fitWidth()}fitTo(t){this.#t?.fitTo(t)}reset(t){this.#t?.reset(t)}zoom(t){this.#t?.zoom(t)}apply(){this.#t?.apply()}}const Aa=(a,t,e)=>a.some(s=>Math.abs(t)>Math.abs(e)?s.overflowX!=="auto"&&s.overflowX!=="scroll"||s.scrollWidth<=s.clientWidth?!1:t>0?s.scrollLeft+s.clientWidth<s.scrollWidth-1:t<0&&s.scrollLeft>0:s.overflowY!=="auto"&&s.overflowY!=="scroll"||s.scrollHeight<=s.clientHeight?!1:e>0?s.scrollTop+s.clientHeight<s.scrollHeight-1:e<0&&s.scrollTop>0),fe=160,zt=(a,t,e=fe)=>Math.max(e,Math.round(a+t)),Ma=(a,t,e,s=fe)=>{const n=e?96:24;return t==="ArrowDown"?zt(a,n,s):t==="ArrowUp"?zt(a,-n,s):null},be={kind:"idle"};class La{constructor(t,e){this.#e=null,this.#s=be,this.handlers={pointerdown:s=>{if(s.button!==0)return;s.preventDefault();const n=s.currentTarget;n instanceof Element&&n.setPointerCapture(s.pointerId),this.#s={kind:"dragging",pointerId:s.pointerId,startY:s.clientY,startHeight:this.#t()},this.#n.requestUpdate()},pointermove:s=>{const n=this.#s;n.kind!=="dragging"||n.pointerId!==s.pointerId||this.#a(zt(n.startHeight,s.clientY-n.startY))},pointerup:s=>this.#i(s),pointercancel:s=>this.#i(s),keydown:s=>{const n=Ma(this.#e??this.#t(),s.key,s.shiftKey);n!==null&&(s.preventDefault(),this.#a(n))},dblclick:()=>this.#a(null)},this.#n=t,this.#t=e,t.addController(this)}#n;#t;#e;#s;hostConnected(){}get height(){return this.#e}get dragging(){return this.#s.kind==="dragging"}#a(t){t!==this.#e&&(this.#e=t,this.#n.requestUpdate())}#i(t){const e=this.#s;e.kind!=="dragging"||e.pointerId!==t.pointerId||(this.#s=be,this.#n.requestUpdate())}}const Da=D({en:{maximize:"Maximize",restore:"Restore size",controls:"View controls",zoomOut:"Zoom out",fit:"Fit to view",zoomIn:"Zoom in",canvas:"Canvas. Arrow keys pan, plus and minus zoom, 0 fits the view.",resize:"Resize the panel",resizeHint:"Drag or use the up and down arrows to resize. Double-click restores the height."},ja:{maximize:"\u6700\u5927\u5316",restore:"\u5143\u306E\u30B5\u30A4\u30BA\u306B\u623B\u3059",controls:"\u8868\u793A\u306E\u64CD\u4F5C",zoomOut:"\u7E2E\u5C0F",fit:"\u5168\u4F53\u3092\u8868\u793A",zoomIn:"\u62E1\u5927",canvas:"\u30AD\u30E3\u30F3\u30D0\u30B9\u3002\u77E2\u5370\u30AD\u30FC\u3067\u30D1\u30F3\u3001\u30D7\u30E9\u30B9\u30FB\u30DE\u30A4\u30CA\u30B9\u3067\u30BA\u30FC\u30E0\u30010\u3067\u5168\u4F53\u8868\u793A\u3002",resize:"\u30D1\u30CD\u30EB\u306E\u9AD8\u3055\u3092\u5909\u3048\u308B",resizeHint:"\u30C9\u30E9\u30C3\u30B0\u3001\u307E\u305F\u306F\u4E0A\u4E0B\u306E\u77E2\u5370\u30AD\u30FC\u3067\u9AD8\u3055\u3092\u5909\u3048\u308B\u3002\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3067\u5143\u306E\u9AD8\u3055\u306B\u623B\u3059\u3002"}});class ke extends z{static{this.styles=[M,K,T`
|
|
1
|
+
import{aE as bt,ai as h,as as r,S as qs,aQ as G,a5 as D,ak as z,X as M,j as K,ah as T,al as R,b2 as Ps,H as Is,b3 as Xt,b4 as Os,b5 as Us,au as B,a9 as kt,aw as u,b6 as Yt,aa as w,aX as vt,a8 as Zt,aD as Jt,ac as b,aL as Fs,ad as dt,aO as Qt,az as st,aH as F,b7 as te,av as y,ax as $,a_ as xt,ay as E,aM as W,aB as at,aj as I,aC as ee,ab as V,aA as se,ag as yt,ar as ae,aY as Hs,aW as ne,b8 as _s,b9 as wt,ba as Bs,bb as ie,bc as ct,z as Ns,bd as re,aG as Ws,aZ as Gs,y as Ks,be as Vs,_ as Xs,$ as Ys}from"./shared-BXejn2ZQ.js";import{o as N,r as Zs}from"./shared-TrlnHjrJ.js";import{e as Js}from"./shared-D2qgtKhc.js";import{a as oe,c as Qs}from"./shared-BdIN9A6O.js";import{c as ta}from"./shared-BT5Ayp_z.js";import{p as ea,i as sa,r as aa,c as na,a as le,b as de,d as ia,e as ra,f as oa,h as ce,g as la,j as $t,s as da,k as ca,l as pa,m as ha,n as ua,t as ma}from"./shared-DOKOFdYm.js";import{B as ga,t as fa,v as ba,i as ka,k as va,j as xa}from"./shared-CPwjSgu0.js";import{d as ya}from"./shared-C7wOrDIL.js";class pt{#n;#t;#e=null;#s=null;#a=null;#i=null;#r=new Map;#o=null;constructor(t){this.#n=t,this.#t=new bt(t),t.addController(this)}get isOpen(){return this.#e!==null}open(t,e,s){this.#e=t,this.#a=e,this.#i=s??null,this.#o=null,this.#n.requestUpdate()}close(){this.#e=null,this.#a=null,this.#i=null,this.#n.requestUpdate()}hostDisconnected(){this.close()}sync(t){const e=this.#s!==this.#e;this.#s=this.#e,!(t===null||this.#a===null||this.#e===null)&&(this.#t.open(t,this.#a,{width:300,height:280},{placement:"right-start",trackTransform:!0}),e&&t.querySelector("textarea")?.focus({preventScroll:!0}))}render(t){const e=this.#e;if(e===null)return h;const s=ea(this.#r.get(e)??"",[],{...this.#i===null?{}:{label:this.#i},key:e,...this.#o===e&&t.errorMessage!==void 0?{error:t.errorMessage}:{}});return r`${sa(e,aa(na(t.locale),s,n=>this.#l(e,t.submit,n)))}`}#l(t,e,s){if(s.kind==="input"){this.#r=new Map(this.#r).set(t,s.body),this.#o=null,this.#n.requestUpdate();return}if(s.kind==="comment"){if(!e(t,s.body)){this.#o=t,this.#n.requestUpdate();return}const i=new Map(this.#r);i.delete(t),this.#r=i}this.#o=null,this.close()}}const Ct=(a,t,e,s)=>{if(a===null)return null;const n=qs(a),i=t.find(l=>l.value===n);return i===void 0?null:{id:"review-comment",entries:[{kind:"item",id:"review-comment",label:e.reviewComment,run:()=>s(n,i.label)}]}},ht=.08,pe=1.8,he=a=>{if(a.length===0)return{x:0,y:0,width:0,height:0};const t=Math.min(...a.map(i=>i.x)),e=Math.min(...a.map(i=>i.y)),s=Math.max(...a.map(i=>i.x+i.width))-t,n=Math.max(...a.map(i=>i.y+i.height))-e;return{x:t-s*.1,y:e-n*.1,width:s*1.2,height:n*1.2}},ue=(a,t)=>a+t/12,wa=(a,t)=>{if(a.length===0)return null;const e=Math.min(...a.map(n=>n.y)),s=a.filter(n=>n.y<e+t);return{x:Math.min(...s.map(n=>n.x)),y:e}},St=16,$a=.8,ut=(a,t,e,s,n)=>a==="start"?St-ue(t,e)*s:(n-e*s)/2-t*s,me=(a,t,e,s,n="center")=>{if(t.width===0||t.height===0)return{...a,x:0,y:0};const i=(l,d,o,g)=>{const p=o*a.scale,f=g*$a;if(p<=g){const S=ut(n,d,o,a.scale,g);return G(l,S-f,S+f)}return G(l,g-(d+o)*a.scale-f,-d*a.scale+f)};return{...a,x:i(a.x,t.x,t.width,e),y:i(a.y,t.y,t.height,s)}},Ca=(a,t,e,s,n,i,l="center")=>{const d=Math.abs(i)>Math.abs(n);if(d&&t.height*a.scale<=s)return null;const o=me({...a,x:a.x-n,y:a.y-i},t,e,s,l);return d&&o.y===a.y?null:o},Sa=a=>Math.exp(-a*.01),ge='button,[role="button"],a,input,textarea,select',Et=(a,t,e)=>{for(const s of a.composedPath()){if(s===t)return null;if(s instanceof Element&&s.matches(e))return s}return null},Ea=a=>{const{canvas:t,world:e,onClearSelection:s,onView:n,align:i="center",sizeWorld:l=!0}=a;let d={x:0,y:0,width:0,height:0},o={x:0,y:0,scale:1};const g=()=>({width:t.clientWidth||1e3,height:t.clientHeight||560}),p=()=>{const{width:c,height:m}=g();o=me(o,d,c,m,i),e.style.transform=`translate(${o.x}px, ${o.y}px) scale(${o.scale})`,e.style.setProperty("--dpk-zoom-inverse",String(1/o.scale)),e.style.setProperty("--dpk-zoom-scale",String(o.scale)),n?.(o)},f=()=>{const{width:c,height:m}=g(),k=d.width/1.2||1,x=d.height/1.2||1,C=G(Math.min((c-24)/k,(m-40)/x),ht,1);o={scale:C,x:ut(i,d.x,d.width,C,c),y:ut(i,d.y,d.height,C,m)},p()},S=c=>{const{width:m,height:k}=g(),x=he([c]),C=x.width/1.2||1,L=x.height/1.2||1;o={...o,scale:G(Math.min((m-24)/C,(k-40)/L),ht,pe)},o={...o,x:(m-x.width*o.scale)/2-x.x*o.scale,y:(k-x.height*o.scale)/2-x.y*o.scale},p()},O=()=>{const{width:c}=g(),m=d.width/1.2||1,k=G((c-24)/m,ht,1);o={scale:k,x:(c-d.width*k)/2-d.x*k,y:16},p()},lt=c=>{const{width:m,height:k}=g(),x=(C,L,Kt,Vt)=>Vt!==void 0?St-Vt:L<=Kt?ut(i,C,L,1,Kt):St-ue(C,L);o={scale:1,x:x(d.x,d.width,m,c?.x),y:x(d.y,d.height,k,c?.y)},p()},_=(c,m=g().width/2,k=g().height/2)=>{const x=o.scale,C=G(x*c,ht,pe);C!==x&&(o={scale:C,x:m-(m-o.x)*C/x,y:k-(k-o.y)*C/x},p())},Q=c=>{if(Et(c,t,".diagram-zoom")!==null)return;const m=c.deltaMode===1?16:c.deltaMode===2?g().height:1;if(c.ctrlKey||c.metaKey){c.preventDefault();const L=t.getBoundingClientRect();_(Sa(c.deltaY),c.clientX-L.left,c.clientY-L.top);return}const{width:k,height:x}=g(),C=Ca(o,d,k,x,c.deltaX*m,c.deltaY*m,i);C!==null&&(c.preventDefault(),o=C,p())},q=new Map;let A=null,P=!1;const U=()=>{const c=[...q.values()],m=c[0];if(!m)return null;const k=c[1];return k?{x:(m.x+k.x)/2,y:(m.y+k.y)/2,distance:Math.hypot(k.x-m.x,k.y-m.y)}:{...m,distance:0}},tt=c=>{q.size===0&&(P=!1);const m=Et(c,t,ge);c.button!==0||c.pointerType!=="touch"&&m!==null||(q.set(c.pointerId,{x:c.clientX,y:c.clientY}),A=U(),m===null&&t.setPointerCapture(c.pointerId),c.pointerType!=="touch"&&m===null&&(c.preventDefault(),t.focus({preventScroll:!0})))},Ht=c=>{if(!q.has(c.pointerId)||A===null)return;q.set(c.pointerId,{x:c.clientX,y:c.clientY});const m=U();if(m===null)return;const k=m.x-A.x,x=m.y-A.y;if((Math.abs(k)+Math.abs(x)>1||Math.abs(m.distance-A.distance)>1)&&(P=!0),m.distance>0&&A.distance>0){const C=t.getBoundingClientRect();_(Math.pow(m.distance/A.distance,.45),A.x-C.left,A.y-C.top)}o={...o,x:o.x+k,y:o.y+x},p(),A=m,t.classList.toggle("is-panning",P)},et=c=>{q.delete(c.pointerId),A=U(),!(q.size>0)&&(t.classList.remove("is-panning"),c.type==="pointercancel"&&(P=!1))},_t=c=>{P&&(c.preventDefault(),c.stopPropagation()),et(c)},Bt=c=>{if(P){c.preventDefault(),c.stopPropagation(),P=!1;return}!(c.target instanceof Element)||Et(c,t,ge)!==null||s()},Nt=c=>{if(c.target!==t)return;const m=30;if(c.key==="+"||c.key==="=")_(1.1);else if(c.key==="-")_(1/1.1);else if(c.key==="0")f();else if(c.key==="Escape"){if(s()===!1)return}else if(c.key==="ArrowLeft"||c.key==="ArrowRight"||c.key==="ArrowUp"||c.key==="ArrowDown")o={...o,x:o.x+(c.key==="ArrowLeft"?m:c.key==="ArrowRight"?-m:0),y:o.y+(c.key==="ArrowUp"?m:c.key==="ArrowDown"?-m:0)},p();else return;c.preventDefault()},Wt=c=>{const m=c.target instanceof HTMLElement?c.target:null;if(m===null||!c.composedPath().includes(e))return;const k=m.getBoundingClientRect(),x=t.getBoundingClientRect();let C=0,L=0;k.left<x.left+12?C=x.left+12-k.left:k.right>x.right-12&&(C=x.right-12-k.right),k.top<x.top+12?L=x.top+12-k.top:k.bottom>x.bottom-40&&(L=x.bottom-40-k.bottom),!(C===0&&L===0)&&(o={...o,x:o.x+C,y:o.y+L},p())};t.addEventListener("wheel",Q,{passive:!1}),t.addEventListener("pointerdown",tt),t.addEventListener("pointermove",Ht),t.addEventListener("pointerup",_t),t.addEventListener("pointercancel",et),t.addEventListener("lostpointercapture",et),t.addEventListener("click",Bt,!0),t.addEventListener("keydown",Nt),t.addEventListener("focusin",Wt);const Gt=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>p());return Gt?.observe(t),{setContent(c){d=he(c.width===0&&c.height===0?[]:[c]),l&&(e.style.width=`${c.width}px`,e.style.height=`${c.height}px`),p()},apply:p,fit:f,fitTo:S,fitWidth:O,reset:lt,zoom:_,view:()=>({...o}),destroy(){Gt?.disconnect(),t.removeEventListener("wheel",Q),t.removeEventListener("pointerdown",tt),t.removeEventListener("pointermove",Ht),t.removeEventListener("pointerup",_t),t.removeEventListener("pointercancel",et),t.removeEventListener("lostpointercapture",et),t.removeEventListener("click",Bt,!0),t.removeEventListener("keydown",Nt),t.removeEventListener("focusin",Wt)}}},za=["fit","fit-width","actual","none"];class Ta{#n;#t=null;#e=null;#s=!1;constructor(t,e){this.#n=e,t.addController(this)}hostDisconnected(){this.detach()}get attached(){return this.#t!==null}get view(){return this.#t?.view()??{x:0,y:0,scale:1}}attach(){this.detach();const t=this.#n.elements();if(t===null)return;const{canvas:e,world:s}=t;this.#t=Ea({canvas:e,world:s,align:this.#n.align(),sizeWorld:!1,onClearSelection:()=>this.#n.onDismiss(),onView:n=>this.#n.onView(n)}),this.#e=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>this.sync()),this.#e?.observe(s),this.sync()}detach(){this.#t?.destroy(),this.#t=null,this.#e?.disconnect(),this.#e=null}sync(){const t=this.#t,e=this.#n.elements()?.world;if(t===null||e===void 0)return;const s=this.#n.contentSize();e.style.width=s?`${s.width}px`:"",e.style.height=s?`${s.height}px`:"";const n=s?.width??e.offsetWidth,i=s?.height??e.offsetHeight;t.setContent({x:0,y:0,width:n,height:i}),!this.#s&&n>0&&i>0&&this.open()}open(){const t=this.#t;if(t===null)return;this.#s=!0;const e=this.#n.initial(),s=za.includes(e)?e:"fit";s==="fit"?t.fit():s==="fit-width"?t.fitWidth():s==="actual"&&t.reset()}fit(){this.#t?.fit()}fitWidth(){this.#t?.fitWidth()}fitTo(t){this.#t?.fitTo(t)}reset(t){this.#t?.reset(t)}zoom(t){this.#t?.zoom(t)}apply(){this.#t?.apply()}}const Aa=(a,t,e)=>a.some(s=>Math.abs(t)>Math.abs(e)?s.overflowX!=="auto"&&s.overflowX!=="scroll"||s.scrollWidth<=s.clientWidth?!1:t>0?s.scrollLeft+s.clientWidth<s.scrollWidth-1:t<0&&s.scrollLeft>0:s.overflowY!=="auto"&&s.overflowY!=="scroll"||s.scrollHeight<=s.clientHeight?!1:e>0?s.scrollTop+s.clientHeight<s.scrollHeight-1:e<0&&s.scrollTop>0),fe=160,zt=(a,t,e=fe)=>Math.max(e,Math.round(a+t)),Ma=(a,t,e,s=fe)=>{const n=e?96:24;return t==="ArrowDown"?zt(a,n,s):t==="ArrowUp"?zt(a,-n,s):null},be={kind:"idle"};class La{constructor(t,e){this.#e=null,this.#s=be,this.handlers={pointerdown:s=>{if(s.button!==0)return;s.preventDefault();const n=s.currentTarget;n instanceof Element&&n.setPointerCapture(s.pointerId),this.#s={kind:"dragging",pointerId:s.pointerId,startY:s.clientY,startHeight:this.#t()},this.#n.requestUpdate()},pointermove:s=>{const n=this.#s;n.kind!=="dragging"||n.pointerId!==s.pointerId||this.#a(zt(n.startHeight,s.clientY-n.startY))},pointerup:s=>this.#i(s),pointercancel:s=>this.#i(s),keydown:s=>{const n=Ma(this.#e??this.#t(),s.key,s.shiftKey);n!==null&&(s.preventDefault(),this.#a(n))},dblclick:()=>this.#a(null)},this.#n=t,this.#t=e,t.addController(this)}#n;#t;#e;#s;hostConnected(){}get height(){return this.#e}get dragging(){return this.#s.kind==="dragging"}#a(t){t!==this.#e&&(this.#e=t,this.#n.requestUpdate())}#i(t){const e=this.#s;e.kind!=="dragging"||e.pointerId!==t.pointerId||(this.#s=be,this.#n.requestUpdate())}}const Da=D({en:{maximize:"Maximize",restore:"Restore size",controls:"View controls",zoomOut:"Zoom out",fit:"Fit to view",zoomIn:"Zoom in",canvas:"Canvas. Arrow keys pan, plus and minus zoom, 0 fits the view.",resize:"Resize the panel",resizeHint:"Drag or use the up and down arrows to resize. Double-click restores the height."},ja:{maximize:"\u6700\u5927\u5316",restore:"\u5143\u306E\u30B5\u30A4\u30BA\u306B\u623B\u3059",controls:"\u8868\u793A\u306E\u64CD\u4F5C",zoomOut:"\u7E2E\u5C0F",fit:"\u5168\u4F53\u3092\u8868\u793A",zoomIn:"\u62E1\u5927",canvas:"\u30AD\u30E3\u30F3\u30D0\u30B9\u3002\u77E2\u5370\u30AD\u30FC\u3067\u30D1\u30F3\u3001\u30D7\u30E9\u30B9\u30FB\u30DE\u30A4\u30CA\u30B9\u3067\u30BA\u30FC\u30E0\u30010\u3067\u5168\u4F53\u8868\u793A\u3002",resize:"\u30D1\u30CD\u30EB\u306E\u9AD8\u3055\u3092\u5909\u3048\u308B",resizeHint:"\u30C9\u30E9\u30C3\u30B0\u3001\u307E\u305F\u306F\u4E0A\u4E0B\u306E\u77E2\u5370\u30AD\u30FC\u3067\u9AD8\u3055\u3092\u5909\u3048\u308B\u3002\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3067\u5143\u306E\u9AD8\u3055\u306B\u623B\u3059\u3002"}});class ke extends z{static{this.styles=[M,K,T`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
color: var(--dpk-ink);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ah as e}from"./shared-
|
|
1
|
+
import{ah as e}from"./shared-BXejn2ZQ.js";const r=e`
|
|
2
2
|
/* ------------------------------------------------------------ count */
|
|
3
3
|
|
|
4
4
|
/* How many: a small rounded mono figure, beside a tab or a heading. data-size='sm' is quieter. */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ai as r}from"./shared-BXejn2ZQ.js";const t=o=>o??r;export{t as o};
|
|
@@ -1524,7 +1524,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1524
1524
|
</div>
|
|
1525
1525
|
`)}
|
|
1526
1526
|
</div>
|
|
1527
|
-
`}#u(e,n){if(n.disabled)return;if(e.key==="ArrowDown"||e.key==="ArrowUp"){e.preventDefault();const r=e.key==="ArrowDown"?1:-1;if(this.#t)this.#i=hg(this.#i,r,n.options.length);else{this.#t=!0;const o=Kn(n.options,n.value);this.#i=o>=0?o:pi(r>0?0:n.options.length-1,n.options.length)}this.#e.requestUpdate();return}if(e.key==="Enter"||e.key===" "){if(e.preventDefault(),!this.#t){this.#t=!0,this.#i=Kn(n.options,n.value),this.#e.requestUpdate();return}const r=n.options[pi(this.#i,n.options.length)];r&&this.#k(r.value,n);return}if(e.key==="Tab"||e.ctrlKey||e.metaKey||e.altKey||e.key.length!==1)return;e.preventDefault(),this.#r+=e.key,clearTimeout(this.#o),this.#o=setTimeout(()=>{this.#r=""},gg);const s=this.#t?this.#i:Kn(n.options,n.value),i=ug(n.options,this.#r,s);if(i!==null){if(this.#i=i,!this.#t){const r=n.options[i]?.value;r!==void 0&&this.#k(r,n);return}this.#e.requestUpdate()}}#g=()=>{if(this.#a?.disabled)return;if(this.#t){this.#m();return}const e=this.#a;this.#t=!0,this.#i=e?Kn(e.options,e.value):-1,this.#e.requestUpdate()};#k(e,n){this.#m(),e!==n.value&&n.onChange(e)}#m(){this.#t&&(this.#t=!1,this.#i=-1,this.#e.requestUpdate())}#w(){const e=`[data-dpk-select="${this.#s}"]`,n=this.#e.renderRoot.querySelector(`button.dpk-rich-select${e}`),s=this.#e.renderRoot.querySelector(`.dpk-rich-select-listbox${e}`);!n||!s||this.#n.open(s,n,{width:Math.max(n.offsetWidth,160),height:280},{placement:"bottom-start"})}}class mg{#e;#s=new Map;constructor(e){this.#e=e}get(e){const n=this.#s.get(e);if(n)return n;const s=new jt(this.#e);return this.#s.set(e,s),s}}const te="0.3.0-beta.
|
|
1527
|
+
`}#u(e,n){if(n.disabled)return;if(e.key==="ArrowDown"||e.key==="ArrowUp"){e.preventDefault();const r=e.key==="ArrowDown"?1:-1;if(this.#t)this.#i=hg(this.#i,r,n.options.length);else{this.#t=!0;const o=Kn(n.options,n.value);this.#i=o>=0?o:pi(r>0?0:n.options.length-1,n.options.length)}this.#e.requestUpdate();return}if(e.key==="Enter"||e.key===" "){if(e.preventDefault(),!this.#t){this.#t=!0,this.#i=Kn(n.options,n.value),this.#e.requestUpdate();return}const r=n.options[pi(this.#i,n.options.length)];r&&this.#k(r.value,n);return}if(e.key==="Tab"||e.ctrlKey||e.metaKey||e.altKey||e.key.length!==1)return;e.preventDefault(),this.#r+=e.key,clearTimeout(this.#o),this.#o=setTimeout(()=>{this.#r=""},gg);const s=this.#t?this.#i:Kn(n.options,n.value),i=ug(n.options,this.#r,s);if(i!==null){if(this.#i=i,!this.#t){const r=n.options[i]?.value;r!==void 0&&this.#k(r,n);return}this.#e.requestUpdate()}}#g=()=>{if(this.#a?.disabled)return;if(this.#t){this.#m();return}const e=this.#a;this.#t=!0,this.#i=e?Kn(e.options,e.value):-1,this.#e.requestUpdate()};#k(e,n){this.#m(),e!==n.value&&n.onChange(e)}#m(){this.#t&&(this.#t=!1,this.#i=-1,this.#e.requestUpdate())}#w(){const e=`[data-dpk-select="${this.#s}"]`,n=this.#e.renderRoot.querySelector(`button.dpk-rich-select${e}`),s=this.#e.renderRoot.querySelector(`.dpk-rich-select-listbox${e}`);!n||!s||this.#n.open(s,n,{width:Math.max(n.offsetWidth,160),height:280},{placement:"bottom-start"})}}class mg{#e;#s=new Map;constructor(e){this.#e=e}get(e){const n=this.#s.get(e);if(n)return n;const s=new jt(this.#e);return this.#s.set(e,s),s}}const te="0.3.0-beta.2",hi=t=>{const e=t.derivation();return{base:e.base,state:e.state,navigation:t.navigation(),actions:t.controller().actions,comments:e.comments,stale:e.stale,issues:t.issues(),grill:e.grill,answers:e.answers}},kg=t=>{const e=t.derivation();return{state:e.state,base:e.base,navigation:t.navigation(),actions:t.controller().actions,comments:e.comments,stale:e.stale,commentCount:n=>{const s=typeof n=="string"?n:M(n);return e.commentsByTarget.get(s)?.length??0},dispatch:n=>t.dispatch(n),dispatchBatch:n=>t.dispatchBatch(n),navigate:(n,s)=>t.navigate(n,s),hashFor:n=>t.hashFor(n),requestComment:n=>t.requestComment(n)}},Ua=(t,e)=>{const n=()=>hi(t);return{version:te,template:t.definition.name,host:e,ready:t.ready,get base(){return t.controller().base},get state(){return t.derivation().state},get navigation(){return t.navigation()},get actions(){return t.controller().actions},get comments(){return t.derivation().comments},get stale(){return t.derivation().stale},get issues(){return t.issues()},dispatch:s=>t.dispatch(s),dispatchBatch:s=>t.dispatchBatch(s),comment:(s,i)=>t.dispatch({type:H,target:s,payload:{body:i}}),editComment:(s,i)=>t.editComment(s,i),removeAction:s=>t.removeAction(s),clearActions:()=>t.clearActions(),importDraft:s=>t.controller().replaceActions(s),navigate:(s,i)=>t.navigate(s,i),hashFor:s=>t.hashFor(s),snapshot:n,exportDraft:()=>t.controller().exportDraft(te),exportBrief:()=>t.brief?.(n())??zn(n(),t.controller().definition,te),subscribe:s=>t.subscribe(s)}},bg=8e3,vg=t=>t.localName==="script"&&t.getAttribute("type")==="application/json"&&t.hasAttribute(jr);class xg{#e;#s;#n=null;#t=null;#i=null;#r=null;#o="";#a=null;#l=new Map;#p=new Set;constructor(e,n){this.#e=e,this.#s=n,e.addController(this)}get view(){return this.#n&&this.#i?wp(this.#n,this.#i):null}get log(){return this.#n}get error(){return this.#t}hostConnected(){!this.#u()&&!this.#g()&&this.#w(),document.addEventListener("pointerdown",this.#b,!0),document.addEventListener("keydown",this.#x)}hostUpdate(){!this.#u()&&this.#g()&&this.#f()}hostDisconnected(){this.#f(),document.removeEventListener("pointerdown",this.#b,!0),document.removeEventListener("keydown",this.#x);for(const e of this.#l.values())e.handle!==null&&clearTimeout(e.handle);this.#l.clear()}send(e){!this.#n||!this.#i||(this.#i=kp(this.#n,this.#i,e),this.#k(),this.#y(),this.#e.requestUpdate())}toggleList(){this.send({kind:this.#i?.list.open?"close-list":"open-list"})}show(e){const n=this.#n?tt(this.#n).flatMap(s=>s.entries).find(s=>s.key===e):void 0;n&&(this.send({kind:"jump",key:e}),this.#s.show(n))}pause(e){const n=this.#p.size>0;if(this.#p.add(e),n)return;const s=Date.now();for(const i of this.#l.values())i.handle!==null&&clearTimeout(i.handle),i.handle=null,i.remaining=Math.max(0,i.deadline-s)}resume(e){if(!(!this.#p.delete(e)||this.#p.size>0))for(const[n,s]of this.#l)this.#c(n,s)}#d(){return`${this.#s.storageKey()}:seen-changes`}#u(){return this.#n!==null||this.#t!==null}#g(){const e=[...this.#e.children].find(vg);if(!e)return!1;let n;try{n=JSON.parse(e.textContent??"")}catch(i){return this.#m(i instanceof Error?i.message:String(i))}const s=up(n);return s.ok?(this.#n=s.log,this.#r=this.#s.persist()?ye(Fr):ee(Fr),this.#i=mp(s.log,this.#r.read(this.#d())),this.#k(),this.#y(),this.#e.requestUpdate(),!0):this.#m(s.error)}#k(){if(!this.#n||!this.#i)return;const e=vp(this.#n,this.#i),n=JSON.stringify(e);n!==this.#o&&(this.#o=n,this.#r?.write(this.#d(),e))}#m(e){return console.error("[dev-process-kit] invalid change log:",e),this.#t=e,this.#e.requestUpdate(),!0}#w(){this.#a=new MutationObserver(()=>{(this.#u()||this.#g())&&this.#f()}),this.#a.observe(this.#e,{childList:!0})}#f(){this.#a?.disconnect(),this.#a=null}#y(){const e=new Set(this.view?.toasts.map(n=>n.key)??[]);for(const[n,s]of this.#l)e.has(n)||(s.handle!==null&&clearTimeout(s.handle),this.#l.delete(n));for(const n of e){if(this.#l.has(n))continue;const s={handle:null,deadline:0,remaining:bg};this.#l.set(n,s),this.#p.size===0&&this.#c(n,s)}}#c(e,n){n.deadline=Date.now()+n.remaining,n.handle=setTimeout(()=>{n.handle=null,this.send({kind:"close-toast",key:e})},n.remaining)}#b=e=>{!this.#i?.list.open||this.#s.inside(e.composedPath())||this.send({kind:"close-list"})};#x=e=>{e.key!=="Escape"||!this.#i?.list.open||this.send({kind:"close-list"})}}const{I:yg}=Ac,Ha=t=>t,wg=t=>t.strings===void 0,ja=()=>document.createComment(""),Bt=(t,e,n)=>{const s=t._$AA.parentNode,i=e===void 0?t._$AB:e._$AA;if(n===void 0){const r=s.insertBefore(ja(),i),o=s.insertBefore(ja(),i);n=new yg(r,o,t,t.options)}else{const r=n._$AB.nextSibling,o=n._$AM,a=o!==t;if(a){let l;n._$AQ?.(t),n._$AM=t,n._$AP!==void 0&&(l=t._$AU)!==o._$AU&&n._$AP(l)}if(r!==i||a){let l=n._$AA;for(;l!==r;){const c=Ha(l).nextSibling;Ha(s).insertBefore(l,i),l=c}}}return n},Be=(t,e,n=t)=>(t._$AI(e,n),t),$g={},ui=(t,e=$g)=>t._$AH=e,Sg=t=>t._$AH,fi=t=>{t._$AR(),t._$AA.remove()},Ba=(t,e,n)=>{const s=new Map;for(let i=e;i<=n;i++)s.set(t[i],i);return s},Fe=Nt(class extends In{constructor(t){if(super(t),t.type!==xe.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,n){let s;n===void 0?n=e:e!==void 0&&(s=e);const i=[],r=[];let o=0;for(const a of t)i[o]=s?s(a,o):o,r[o]=n(a,o),o++;return{values:r,keys:i}}render(t,e,n){return this.dt(t,e,n).values}update(t,[e,n,s]){const i=Sg(t),{values:r,keys:o}=this.dt(e,n,s);if(!Array.isArray(i))return this.ut=o,r;const a=this.ut??=[],l=[];let c,d,h=0,g=i.length-1,p=0,f=r.length-1;for(;h<=g&&p<=f;)if(i[h]===null)h++;else if(i[g]===null)g--;else if(a[h]===o[p])l[p]=Be(i[h],r[p]),h++,p++;else if(a[g]===o[f])l[f]=Be(i[g],r[f]),g--,f--;else if(a[h]===o[f])l[f]=Be(i[h],r[f]),Bt(t,l[f+1],i[h]),h++,f--;else if(a[g]===o[p])l[p]=Be(i[g],r[p]),Bt(t,i[h],i[g]),g--,p++;else if(c===void 0&&(c=Ba(o,p,f),d=Ba(a,h,g)),c.has(a[h]))if(c.has(a[g])){const u=d.get(o[p]),m=u!==void 0?i[u]:null;if(m===null){const x=Bt(t,i[h]);Be(x,r[p]),l[p]=x}else l[p]=Be(m,r[p]),Bt(t,i[h],m),i[u]=null;p++}else fi(i[g]),g--;else fi(i[h]),h++;for(;p<=f;){const u=Bt(t,l[f+1]);Be(u,r[p]),l[p++]=u}for(;h<=g;){const u=i[h++];u!==null&&fi(u)}return this.ut=o,ui(t,l),Y}}),Vn="dpk-changes",Ag=(t,e,n)=>{const s=t.unread>0?e.changesUnread(t.unread):e.changes;return k`<button
|
|
1528
1528
|
class="dpk-bell"
|
|
1529
1529
|
type="button"
|
|
1530
1530
|
aria-controls=${Vn}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ah as e,bA as t,bB as o,bC as n}from"./shared-
|
|
1
|
+
import{ah as e,bA as t,bB as o,bC as n}from"./shared-BXejn2ZQ.js";import{a as d,c as i}from"./shared-BT5Ayp_z.js";import{m as p}from"./shared-D2qgtKhc.js";const r=e`
|
|
2
2
|
/*
|
|
3
3
|
* A chart: a framed plot with its head above it. CSS only — the author draws
|
|
4
4
|
* the SVG and this styles it, so a line chart reads as the kit's own: rules
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a5 as d,au as p,av as a,aw as f,ac as l,aa as b,ax as o,ay as n,ak as v,X as k,j as m,ah as g,al as y,aF as q,as as r}from"./shared-
|
|
1
|
+
import{a5 as d,au as p,av as a,aw as f,ac as l,aa as b,ax as o,ay as n,ak as v,X as k,j as m,ah as g,al as y,aF as q,as as r}from"./shared-BXejn2ZQ.js";import{o as C}from"./shared-TrlnHjrJ.js";const h=d({en:{fallbackLabel:"Select",required:"Choose one."},ja:{fallbackLabel:"\u9078\u629E",required:"\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}}),S=a({value:o(l(),n(1)),label:o(l(),n(1))}),w=a({options:b(S),value:f(l())}),c=i=>{const e=p(w,i),t=new Set;for(const s of e.options){if(t.has(s.value))throw new Error(`duplicate option value: ${s.value}`);t.add(s.value)}return{options:e.options,value:e.value??null}};class u extends v{static{this.formAssociated=!0}static{this.styles=[k,m,g`
|
|
2
2
|
:host {
|
|
3
3
|
display: inline-block;
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{au as Re,bf as P,av as b,aw as i,aa as x,ac as c,az as $,aM as h,aB as Z,aN as W,ax as ee,ay as ae,p as y,t as Ie,aC as Qe,aO as Ue,aA as He,ab as R,N as Me,e as Ke,a5 as Fe,S as je,P as z,ai as d,as as n,z as Ye,aH as w,bc as te,bd as Ve,I as Xe,bz as I,ah as Je,V as oe,bh as Ze,l as ea,b9 as aa}from"./shared-DdpMqkAH.js";import{a as ta}from"./shared-Cas88qVh.js";import{D as oa,d as ra}from"./shared-CnPCm4bJ.js";import{o as T}from"./shared-EYOAbLSo.js";const re=["working","waiting","blocked","done"],A=["todo","doing","blocked","done"],ne=["agent","human"],q=["why","what","goals","nonGoals"],O=ee(c(),ae(1)),na=b({id:h,name:O,kind:i($(ne),"agent")}),sa=b({id:h,title:O,status:i($(A),"todo"),assignee:i(h),note:i(c()),proposed:i(Z(),!1),reason:i(c()),questions:W}),da=b({id:h,label:i(c()),href:O,kind:i(c()),description:i(c()),questions:W}),ia=b({why:i(c()),what:i(c()),goals:i(x(c()),[]),nonGoals:i(x(c()),[])}),la=b({id:h,from:i(h),at:i(c()),title:i(c()),body:i(c()),points:i(x(c()),[]),questions:W}),pa=b({id:h,ref:i(O),title:O,description:i(c()),blocking:i(Z(),!1),assumption:i(c())}),se=b({title:i(c(),""),status:i($(re)),updatedAt:i(c()),context:i(ia,{}),members:i(x(na),[]),todos:i(x(sa),[]),outputs:i(x(da),[]),log:i(x(la),[]),questions:i(x(pa),[])}),S=(a,e)=>{const t=new Set;for(const o of e){if(t.has(o))throw new Error(`duplicate ${a} id: ${o}`);t.add(o)}},u=a=>a===void 0||a.trim()===""?null:a,Q=a=>a.filter(e=>e.trim()!==""),de=a=>{const e=Re(se,a);S("member",e.members.map(o=>o.id)),S("todo",e.todos.map(o=>o.id)),S("output",e.outputs.map(o=>o.id)),S("log",e.log.map(o=>o.id)),S("question",e.questions.map(o=>o.id));const t=new Set(e.members.map(o=>o.id));for(const o of e.todos)if(o.assignee!==void 0&&!t.has(o.assignee))throw new Error(`todo ${o.id} is assigned to ${o.assignee}, which is not in members`);for(const o of e.log){if(o.from!==void 0&&!t.has(o.from))throw new Error(`log entry ${o.id} is from ${o.from}, which is not in members`);if(u(o.title)===null&&u(o.body)===null)throw new Error(`log entry ${o.id} needs a title or a body`)}for(const o of e.questions)if(!o.blocking&&u(o.assumption)===null)throw new Error(`question ${o.id} does not block, so it needs the assumption the agent works on`);return{title:e.title,status:e.status??null,updatedAt:u(e.updatedAt),context:{why:u(e.context.why),what:u(e.context.what),goals:Q(e.context.goals),nonGoals:Q(e.context.nonGoals)},members:e.members,todos:e.todos.map(o=>({id:o.id,title:o.title,status:o.status,assignee:o.assignee??null,note:u(o.note),proposed:o.proposed,reason:u(o.reason),added:!1,...P(o.questions)})),outputs:e.outputs.map(o=>({id:o.id,label:u(o.label),href:o.href,kind:u(o.kind),description:u(o.description),...P(o.questions)})),log:e.log.map(o=>({id:o.id,from:o.from??null,at:u(o.at),title:u(o.title),body:u(o.body),points:Q(o.points),...P(o.questions)})),questions:e.questions.map((o,r)=>({id:o.id,ref:o.ref??`Q${r+1}`,title:o.title,description:u(o.description),blocking:o.blocking,assumption:u(o.assumption)})),answers:{},decisions:{}}},ie=()=>({title:"",status:null,updatedAt:null,context:{why:null,what:null,goals:[],nonGoals:[]},members:[],todos:[],outputs:[],log:[],questions:[],answers:{},decisions:{}}),D=(a,e)=>e===null?void 0:a.members.find(t=>t.id===e),k=(a,e)=>a.todos.find(t=>t.id===e),le=(a,e)=>a.log.find(t=>t.id===e),pe=a=>q.includes(a),U=(a,e)=>{const t=a.context[e];return typeof t=="string"||t!==null&&t.length>0},L=(a,e)=>a.questions.find(t=>t.id===e),ce=(a,e)=>{const t=a.answers[e.id];return t===void 0?!1:t.kind==="approve"||t.text.trim()!==""},H=(a,e)=>!e.proposed||a.decisions[e.id]==="accept",_=(a,e)=>H(a,e)&&D(a,e.assignee)?.kind==="human",ue=(a,e,t)=>{const o={...a};return t===null?delete o[e]:o[e]=t,o},M=(a,e,t)=>({...a,answers:ue(a.answers,e,t)}),ca=(a,e,t)=>({...a,decisions:ue(a.decisions,e,t)}),ua=(a,e,t)=>({...a,todos:a.todos.map(o=>o.id===e?t(o):o)}),m={ANSWER_QUESTION:y("ANSWER_QUESTION","question",Qe("kind",[b({kind:R("approve")}),b({kind:R("answer"),text:c()}),b({kind:R("clear")})])),DECIDE_PROPOSAL:y("DECIDE_PROPOSAL","todo",b({decision:$(["accept","decline","clear"])})),SET_TODO_STATUS:y("SET_TODO_STATUS","todo",b({status:$(A)})),ADD_TODO:y("ADD_TODO","page",b({id:h,title:ee(c(),He(),ae(1)),assignee:Ue(h)}),{dedupeKey:Ie}),DELETE_TODO:y("DELETE_TODO","todo",b({}))},be={type:"page",id:"task-board"},K=(a,e)=>({type:"ANSWER_QUESTION",target:{type:"question",id:a},payload:e}),ge=(a,e)=>({type:"DECIDE_PROPOSAL",target:{type:"todo",id:a},payload:{decision:e}}),F=(a,e)=>({type:"SET_TODO_STATUS",target:{type:"todo",id:a},payload:{status:e}}),he=(a,e,t)=>({type:"ADD_TODO",target:be,payload:{id:a,title:e,assignee:t}}),ke=a=>({type:"DELETE_TODO",target:{type:"todo",id:a},payload:{}}),fe=(a,e)=>{const t=Me(m,e);if(t===null)return null;const o=t.target.id;switch(t.type){case"ANSWER_QUESTION":{const r=L(a,o);if(r===void 0)return null;const s=t.payload;return s.kind==="clear"?M(a,o,null):s.kind==="approve"?r.assumption===null?null:M(a,o,{kind:"approve"}):M(a,o,{kind:"answer",text:s.text})}case"DECIDE_PROPOSAL":{if(k(a,o)?.proposed!==!0)return null;const{decision:r}=t.payload;return ca(a,o,r==="clear"?null:r)}case"SET_TODO_STATUS":{const r=k(a,o);if(r===void 0||!_(a,r))return null;const{status:s}=t.payload;return ua(a,o,l=>({...l,status:s}))}case"ADD_TODO":{const{payload:r}=t;return k(a,r.id)!==void 0||r.assignee!==null&&D(a,r.assignee)===void 0?null:{...a,todos:[...a.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(a,o)?.added!==!0?null:{...a,todos:a.todos.filter(r=>r.id!==o)};default:return Ke(t)}},j=Fe({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:a=>`Updated ${a}`,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",tabTasks:"Tasks",openCount:a=>`${a} open`,noQuestions:"The agent has nothing to ask right now.",questions:"Questions from the agent",questionsProgress:(a,e)=>`${a} of ${e} 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:a=>`Your answer to ${a}`,answerPlaceholder:"What you expect instead\u2026",blockingPlaceholder:"Your decision\u2026",approvedTag:"Approved",answeredTag:"Answered",progress:(a,e)=>`${a} of ${e} done`,noTodosYet:"No todos yet",tasksBoard:"Tasks by status",laneCount:a=>a===1?"1 task":`${a} tasks`,laneEmpty:"Nothing here",dragHint:"Drop on another column to change the status",assignee:"Assignee",unassigned:"Unassigned",memberOption:(a,e)=>`${a} (${e})`,statusOf:a=>`Status of \u201C${a}\u201D`,filterTodos:"Show todos",filterAll:"All",filterHuman:"People",addedTag:"Added by you",changedTag:"Changed",removeAdded:"Remove this todo you added",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:a=>`Decision on \u201C${a}\u201D`,acceptedTag:"Accepted",declinedTag:"Declined",undoDecision:"Undo",outputs:"Outputs",noOutputs:"Nothing has been produced yet.",copy:a=>`Copy ${a}`,copied:"Copied",log:"Conversation with the agent",logLede:"Newest first",noLog:"Nothing has been exchanged yet.",fromAgent:"Agent",latestTag:"Latest",commentOn:a=>`Comment on ${a}`,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:a=>`\u2192 \u201C${a}\u201D`,change:(a,e)=>`${a} \u2192 ${e}`},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:a=>`\u66F4\u65B0 ${a}`,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",tabTasks:"\u30BF\u30B9\u30AF",openCount:a=>`\u672A\u56DE\u7B54 ${a} \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:(a,e)=>`\u8FD4\u7B54\u6E08\u307F ${a} / ${e}`,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:a=>`${a} \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",progress:(a,e)=>`${e} \u4EF6\u4E2D ${a} \u4EF6\u5B8C\u4E86`,noTodosYet:"Todo \u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093",tasksBoard:"\u72B6\u614B\u3054\u3068\u306E\u30BF\u30B9\u30AF",laneCount:a=>`${a} \u4EF6`,laneEmpty:"\u306A\u3057",dragHint:"\u5225\u306E\u5217\u306B\u30C9\u30ED\u30C3\u30D7\u3059\u308B\u3068\u72B6\u614B\u304C\u5909\u308F\u308A\u307E\u3059",assignee:"\u62C5\u5F53",unassigned:"\u672A\u5272\u308A\u5F53\u3066",memberOption:(a,e)=>`${a}\uFF08${e}\uFF09`,statusOf:a=>`\u300C${a}\u300D\u306E\u72B6\u614B`,filterTodos:"\u8868\u793A\u3059\u308B Todo",filterAll:"\u3059\u3079\u3066",filterHuman:"\u4EBA\u9593\u306E\u62C5\u5F53",addedTag:"\u3042\u306A\u305F\u304C\u8FFD\u52A0",changedTag:"\u5909\u66F4\u3042\u308A",removeAdded:"\u8FFD\u52A0\u3057\u305F Todo \u3092\u53D6\u308A\u6D88\u3059",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:a=>`\u300C${a}\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:a=>`${a} \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:a=>`${a} \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:a=>`\u2192 \u300C${a}\u300D`,change:(a,e)=>`${a} \u2192 ${e}`}}),xe=(a,e)=>{switch(e){case"working":return a.statusWorking;case"waiting":return a.statusWaiting;case"blocked":return a.statusBlocked;case"done":return a.statusDone}},E=(a,e)=>{switch(e){case"todo":return a.todoTodo;case"doing":return a.todoDoing;case"blocked":return a.todoBlocked;case"done":return a.todoDone}},ba=(a,e)=>e==="agent"?a.kindAgent:a.kindHuman,B=(a,e)=>{switch(e){case"why":return a.contextWhy;case"what":return a.contextWhat;case"goals":return a.contextGoals;case"nonGoals":return a.contextNonGoals}},me=48,Y=a=>{const e=a.title??a.body??a.id;return e.length<=me?e:`${e.slice(0,me-1)}\u2026`},ga=(a,e,t)=>t===null?a.unassigned:D(e,t)?.name??t,ve=a=>a.title===""?"Task Context Board":a.title,we=(a,e,t)=>{switch(t.type){case"todo":{const o=k(e,t.id);return`${o?.proposed===!0?a.proposalGroup:a.todoGroup} \xB7 ${o?.title??t.id}`}case"log":{const o=le(e,t.id);return`${a.logGroup} \xB7 ${o===void 0?t.id:Y(o)}`}case"context":return`${a.contextGroup} \xB7 ${pe(t.id)?B(a,t.id):t.id}`;case"question":{const o=L(e,t.id);return o===void 0?t.id:`${o.ref} \xB7 ${o.title}`}case"page":return a.wholeBoard;default:return t.id}},ha=(a,e)=>{switch(e){case"accept":return{title:a.accepted,tone:"update"};case"decline":return{title:a.declined,tone:"update"};case"clear":return{title:a.decisionCleared,tone:"delete"}}},ka=(a,e,t)=>{switch(t.type){case"ANSWER_QUESTION":{const o=z(m.ANSWER_QUESTION,t);if(o.kind==="clear")return{title:a.answerCleared,tone:"delete"};if(o.kind==="approve"){const r=L(e,t.target.id)?.assumption??null;return{title:a.approved,tone:"update",...r===null?{}:{body:a.quoted(r)}}}return{title:a.answered,tone:"update",body:a.quoted(o.text.slice(0,120))}}case"DECIDE_PROPOSAL":return ha(a,z(m.DECIDE_PROPOSAL,t).decision);case"SET_TODO_STATUS":{const{status:o}=z(m.SET_TODO_STATUS,t),r=k(e,t.target.id)?.status,s=E(a,o);return{title:a.statusChanged,tone:"update",body:r===void 0?s:a.change(E(a,r),s)}}case"ADD_TODO":{const o=z(m.ADD_TODO,t);return{title:a.todoAdded,tone:"create",targetLabel:`${a.todoGroup} \xB7 ${o.title}`,...o.assignee===null?{}:{body:`${a.assignee}: ${ga(a,e,o.assignee)}`}}}case"DELETE_TODO":return{title:a.todoRemoved,tone:"delete"};default:return{title:t.type,tone:"meta"}}},$e=(a,e,t,o)=>{let r;try{r=ka(a,o??t,e)}catch{r={title:e.type,tone:"meta"}}return{title:r.title,targetLabel:r.targetLabel??we(a,t,e.target),tone:r.tone,...r.body===void 0?{}:{summary:r.body}}},ye=a=>`${a.type} ${je(a.target)} ${JSON.stringify(a.payload)}`,Te=(a,e)=>[...e.questions.map(t=>({value:`question:${t.id}`,label:`${t.ref} \xB7 ${t.title}`,group:a.questionGroup})),...e.todos.map(t=>({value:`todo:${t.id}`,label:t.title,group:t.proposed?a.proposalGroup:a.todoGroup})),...e.log.map(t=>({value:`log:${t.id}`,label:Y(t),group:a.logGroup})),...q.filter(t=>U(e,t)).map(t=>({value:`context:${t}`,label:B(a,t),group:a.contextGroup}))],Ae=(a,e)=>e,Oe=(a,e,t)=>({parts:q.filter(o=>U(e,o)).map(o=>{const r=e.context[o];return{id:o,title:B(a,o),text:typeof r=="string"?r:null,items:typeof r=="string"||r===null?[]:r,comments:t(`context:${o}`)}})}),fa=(a,e,t)=>{const o=a.answers[e.id];return{id:e.id,ref:e.ref,title:e.title,description:e.description,blocking:e.blocking,assumption:e.assumption,reply:o?.kind??"none",resolved:ce(a,e),draft:o?.kind==="answer"?o.text:"",comments:t(`question:${e.id}`)}},Se=(a,e)=>{const t=a.questions.map(r=>fa(a,r,e)),o=t.filter(r=>r.resolved).length;return{blocking:t.filter(r=>r.blocking),provisional:t.filter(r=>!r.blocking),resolved:o,total:t.length,open:t.length-o,blockingOpen:t.filter(r=>r.blocking&&!r.resolved).length}},xa={todo:"gray",doing:"blue",blocked:"red",done:"green"},ma=(a,e,t,o,r)=>{const s=k(t,o.id),l=D(e,o.assignee);return{id:o.id,title:o.title,note:o.note,reason:o.reason,status:o.status,statusLabel:E(a,o.status),assignee:o.assignee,assigneeName:l?.name??null,assigneeKind:l?.kind??null,editable:_(e,o),proposal:o.proposed?e.decisions[o.id]??"pending":null,added:o.added,changed:s!==void 0&&s.status!==o.status,comments:r(`todo:${o.id}`),...o.questions===void 0?{}:{questions:o.questions}}},De=(a,e,t,o,r="all")=>{const s=e.members.some(p=>p.kind==="human"),l=s?r:"all",g=e.todos.map(p=>ma(a,e,t,p,o)),f=p=>p.assigneeKind==="human",Pe=l==="human"?g.filter(f):g,C=e.todos.filter(p=>H(e,p)),J=C.filter(p=>p.status==="done").length;return{lanes:A.map(p=>({status:p,label:E(a,p),tone:xa[p],cards:Pe.filter(We=>We.status===p)})),filter:l,canFilter:s,humanCount:g.filter(f).length,progress:{done:J,total:C.length,label:C.length===0?a.noTodosYet:a.progress(J,C.length)},statuses:A.map(p=>({value:p,label:E(a,p)})),members:e.members.map(p=>({id:p.id,label:a.memberOption(p.name,ba(a,p.kind))}))}},Ee=a=>{if(!/^[a-z][a-z\d+.-]*:\/\//i.test(a))return{kind:"path"};try{return{kind:"url",host:new URL(a).host}}catch{return{kind:"path"}}},Ce=a=>a.outputs.map(e=>({id:e.id,title:e.label??e.href,labelled:e.label!==null,href:e.href,kind:e.kind,description:e.description,place:Ee(e.href),...e.questions===void 0?{}:{questions:e.questions}})),ze=(a,e,t)=>({entries:e.log.map((o,r)=>{const s=D(e,o.from);return{id:o.id,author:s===void 0?null:{name:s.name,kind:s.kind},at:o.at,title:o.title,body:o.body,points:o.points,label:Y(o),latest:r===e.log.length-1,comments:t(`log:${o.id}`),...o.questions===void 0?{}:{questions:o.questions}}}).reverse(),status:e.status===null&&e.updatedAt===null?null:{status:e.status,label:e.status===null?null:xe(a,e.status),updatedAt:e.updatedAt}}),qe=(a,e)=>{switch(e.type){case"todo":return k(a,e.id)!==void 0;case"log":return le(a,e.id)!==void 0;case"context":return pe(e.id)&&U(a,e.id);case"question":return L(a,e.id)!==void 0;case"page":return!0;default:return!1}},Le=a=>{const e=j(a);return{kind:"view",name:"task-board",label:"Task Context Board",addable:!1,parseBase:de,emptyBase:ie,actions:m,apply:fe,hasTarget:qe,describe:(t,o,r)=>$e(e,t,o,r),serialize:ye,resolveNavigation:Ae,commentTargets:t=>Te(e,t),title:ve}},G=(a,e,t,o)=>n`
|
|
1
|
+
import{au as Re,bf as P,av as b,aw as i,aa as x,ac as c,az as $,aM as h,aB as Z,aN as W,ax as ee,ay as ae,p as y,t as Ie,aC as Qe,aO as Ue,aA as He,ab as R,N as Me,e as Ke,a5 as Fe,S as je,P as z,ai as d,as as n,z as Ye,aH as w,bc as te,bd as Ve,I as Xe,bz as I,ah as Je,V as oe,bh as Ze,l as ea,b9 as aa}from"./shared-BXejn2ZQ.js";import{a as ta}from"./shared-BdIN9A6O.js";import{D as oa,d as ra}from"./shared-C7wOrDIL.js";import{o as T}from"./shared-BTf38OnF.js";const re=["working","waiting","blocked","done"],A=["todo","doing","blocked","done"],ne=["agent","human"],q=["why","what","goals","nonGoals"],O=ee(c(),ae(1)),na=b({id:h,name:O,kind:i($(ne),"agent")}),sa=b({id:h,title:O,status:i($(A),"todo"),assignee:i(h),note:i(c()),proposed:i(Z(),!1),reason:i(c()),questions:W}),da=b({id:h,label:i(c()),href:O,kind:i(c()),description:i(c()),questions:W}),ia=b({why:i(c()),what:i(c()),goals:i(x(c()),[]),nonGoals:i(x(c()),[])}),la=b({id:h,from:i(h),at:i(c()),title:i(c()),body:i(c()),points:i(x(c()),[]),questions:W}),pa=b({id:h,ref:i(O),title:O,description:i(c()),blocking:i(Z(),!1),assumption:i(c())}),se=b({title:i(c(),""),status:i($(re)),updatedAt:i(c()),context:i(ia,{}),members:i(x(na),[]),todos:i(x(sa),[]),outputs:i(x(da),[]),log:i(x(la),[]),questions:i(x(pa),[])}),S=(a,e)=>{const t=new Set;for(const o of e){if(t.has(o))throw new Error(`duplicate ${a} id: ${o}`);t.add(o)}},u=a=>a===void 0||a.trim()===""?null:a,Q=a=>a.filter(e=>e.trim()!==""),de=a=>{const e=Re(se,a);S("member",e.members.map(o=>o.id)),S("todo",e.todos.map(o=>o.id)),S("output",e.outputs.map(o=>o.id)),S("log",e.log.map(o=>o.id)),S("question",e.questions.map(o=>o.id));const t=new Set(e.members.map(o=>o.id));for(const o of e.todos)if(o.assignee!==void 0&&!t.has(o.assignee))throw new Error(`todo ${o.id} is assigned to ${o.assignee}, which is not in members`);for(const o of e.log){if(o.from!==void 0&&!t.has(o.from))throw new Error(`log entry ${o.id} is from ${o.from}, which is not in members`);if(u(o.title)===null&&u(o.body)===null)throw new Error(`log entry ${o.id} needs a title or a body`)}for(const o of e.questions)if(!o.blocking&&u(o.assumption)===null)throw new Error(`question ${o.id} does not block, so it needs the assumption the agent works on`);return{title:e.title,status:e.status??null,updatedAt:u(e.updatedAt),context:{why:u(e.context.why),what:u(e.context.what),goals:Q(e.context.goals),nonGoals:Q(e.context.nonGoals)},members:e.members,todos:e.todos.map(o=>({id:o.id,title:o.title,status:o.status,assignee:o.assignee??null,note:u(o.note),proposed:o.proposed,reason:u(o.reason),added:!1,...P(o.questions)})),outputs:e.outputs.map(o=>({id:o.id,label:u(o.label),href:o.href,kind:u(o.kind),description:u(o.description),...P(o.questions)})),log:e.log.map(o=>({id:o.id,from:o.from??null,at:u(o.at),title:u(o.title),body:u(o.body),points:Q(o.points),...P(o.questions)})),questions:e.questions.map((o,r)=>({id:o.id,ref:o.ref??`Q${r+1}`,title:o.title,description:u(o.description),blocking:o.blocking,assumption:u(o.assumption)})),answers:{},decisions:{}}},ie=()=>({title:"",status:null,updatedAt:null,context:{why:null,what:null,goals:[],nonGoals:[]},members:[],todos:[],outputs:[],log:[],questions:[],answers:{},decisions:{}}),D=(a,e)=>e===null?void 0:a.members.find(t=>t.id===e),k=(a,e)=>a.todos.find(t=>t.id===e),le=(a,e)=>a.log.find(t=>t.id===e),pe=a=>q.includes(a),U=(a,e)=>{const t=a.context[e];return typeof t=="string"||t!==null&&t.length>0},L=(a,e)=>a.questions.find(t=>t.id===e),ce=(a,e)=>{const t=a.answers[e.id];return t===void 0?!1:t.kind==="approve"||t.text.trim()!==""},H=(a,e)=>!e.proposed||a.decisions[e.id]==="accept",_=(a,e)=>H(a,e)&&D(a,e.assignee)?.kind==="human",ue=(a,e,t)=>{const o={...a};return t===null?delete o[e]:o[e]=t,o},M=(a,e,t)=>({...a,answers:ue(a.answers,e,t)}),ca=(a,e,t)=>({...a,decisions:ue(a.decisions,e,t)}),ua=(a,e,t)=>({...a,todos:a.todos.map(o=>o.id===e?t(o):o)}),m={ANSWER_QUESTION:y("ANSWER_QUESTION","question",Qe("kind",[b({kind:R("approve")}),b({kind:R("answer"),text:c()}),b({kind:R("clear")})])),DECIDE_PROPOSAL:y("DECIDE_PROPOSAL","todo",b({decision:$(["accept","decline","clear"])})),SET_TODO_STATUS:y("SET_TODO_STATUS","todo",b({status:$(A)})),ADD_TODO:y("ADD_TODO","page",b({id:h,title:ee(c(),He(),ae(1)),assignee:Ue(h)}),{dedupeKey:Ie}),DELETE_TODO:y("DELETE_TODO","todo",b({}))},be={type:"page",id:"task-board"},K=(a,e)=>({type:"ANSWER_QUESTION",target:{type:"question",id:a},payload:e}),ge=(a,e)=>({type:"DECIDE_PROPOSAL",target:{type:"todo",id:a},payload:{decision:e}}),F=(a,e)=>({type:"SET_TODO_STATUS",target:{type:"todo",id:a},payload:{status:e}}),he=(a,e,t)=>({type:"ADD_TODO",target:be,payload:{id:a,title:e,assignee:t}}),ke=a=>({type:"DELETE_TODO",target:{type:"todo",id:a},payload:{}}),fe=(a,e)=>{const t=Me(m,e);if(t===null)return null;const o=t.target.id;switch(t.type){case"ANSWER_QUESTION":{const r=L(a,o);if(r===void 0)return null;const s=t.payload;return s.kind==="clear"?M(a,o,null):s.kind==="approve"?r.assumption===null?null:M(a,o,{kind:"approve"}):M(a,o,{kind:"answer",text:s.text})}case"DECIDE_PROPOSAL":{if(k(a,o)?.proposed!==!0)return null;const{decision:r}=t.payload;return ca(a,o,r==="clear"?null:r)}case"SET_TODO_STATUS":{const r=k(a,o);if(r===void 0||!_(a,r))return null;const{status:s}=t.payload;return ua(a,o,l=>({...l,status:s}))}case"ADD_TODO":{const{payload:r}=t;return k(a,r.id)!==void 0||r.assignee!==null&&D(a,r.assignee)===void 0?null:{...a,todos:[...a.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(a,o)?.added!==!0?null:{...a,todos:a.todos.filter(r=>r.id!==o)};default:return Ke(t)}},j=Fe({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:a=>`Updated ${a}`,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",tabTasks:"Tasks",openCount:a=>`${a} open`,noQuestions:"The agent has nothing to ask right now.",questions:"Questions from the agent",questionsProgress:(a,e)=>`${a} of ${e} 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:a=>`Your answer to ${a}`,answerPlaceholder:"What you expect instead\u2026",blockingPlaceholder:"Your decision\u2026",approvedTag:"Approved",answeredTag:"Answered",progress:(a,e)=>`${a} of ${e} done`,noTodosYet:"No todos yet",tasksBoard:"Tasks by status",laneCount:a=>a===1?"1 task":`${a} tasks`,laneEmpty:"Nothing here",dragHint:"Drop on another column to change the status",assignee:"Assignee",unassigned:"Unassigned",memberOption:(a,e)=>`${a} (${e})`,statusOf:a=>`Status of \u201C${a}\u201D`,filterTodos:"Show todos",filterAll:"All",filterHuman:"People",addedTag:"Added by you",changedTag:"Changed",removeAdded:"Remove this todo you added",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:a=>`Decision on \u201C${a}\u201D`,acceptedTag:"Accepted",declinedTag:"Declined",undoDecision:"Undo",outputs:"Outputs",noOutputs:"Nothing has been produced yet.",copy:a=>`Copy ${a}`,copied:"Copied",log:"Conversation with the agent",logLede:"Newest first",noLog:"Nothing has been exchanged yet.",fromAgent:"Agent",latestTag:"Latest",commentOn:a=>`Comment on ${a}`,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:a=>`\u2192 \u201C${a}\u201D`,change:(a,e)=>`${a} \u2192 ${e}`},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:a=>`\u66F4\u65B0 ${a}`,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",tabTasks:"\u30BF\u30B9\u30AF",openCount:a=>`\u672A\u56DE\u7B54 ${a} \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:(a,e)=>`\u8FD4\u7B54\u6E08\u307F ${a} / ${e}`,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:a=>`${a} \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",progress:(a,e)=>`${e} \u4EF6\u4E2D ${a} \u4EF6\u5B8C\u4E86`,noTodosYet:"Todo \u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093",tasksBoard:"\u72B6\u614B\u3054\u3068\u306E\u30BF\u30B9\u30AF",laneCount:a=>`${a} \u4EF6`,laneEmpty:"\u306A\u3057",dragHint:"\u5225\u306E\u5217\u306B\u30C9\u30ED\u30C3\u30D7\u3059\u308B\u3068\u72B6\u614B\u304C\u5909\u308F\u308A\u307E\u3059",assignee:"\u62C5\u5F53",unassigned:"\u672A\u5272\u308A\u5F53\u3066",memberOption:(a,e)=>`${a}\uFF08${e}\uFF09`,statusOf:a=>`\u300C${a}\u300D\u306E\u72B6\u614B`,filterTodos:"\u8868\u793A\u3059\u308B Todo",filterAll:"\u3059\u3079\u3066",filterHuman:"\u4EBA\u9593\u306E\u62C5\u5F53",addedTag:"\u3042\u306A\u305F\u304C\u8FFD\u52A0",changedTag:"\u5909\u66F4\u3042\u308A",removeAdded:"\u8FFD\u52A0\u3057\u305F Todo \u3092\u53D6\u308A\u6D88\u3059",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:a=>`\u300C${a}\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:a=>`${a} \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:a=>`${a} \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:a=>`\u2192 \u300C${a}\u300D`,change:(a,e)=>`${a} \u2192 ${e}`}}),xe=(a,e)=>{switch(e){case"working":return a.statusWorking;case"waiting":return a.statusWaiting;case"blocked":return a.statusBlocked;case"done":return a.statusDone}},E=(a,e)=>{switch(e){case"todo":return a.todoTodo;case"doing":return a.todoDoing;case"blocked":return a.todoBlocked;case"done":return a.todoDone}},ba=(a,e)=>e==="agent"?a.kindAgent:a.kindHuman,B=(a,e)=>{switch(e){case"why":return a.contextWhy;case"what":return a.contextWhat;case"goals":return a.contextGoals;case"nonGoals":return a.contextNonGoals}},me=48,Y=a=>{const e=a.title??a.body??a.id;return e.length<=me?e:`${e.slice(0,me-1)}\u2026`},ga=(a,e,t)=>t===null?a.unassigned:D(e,t)?.name??t,ve=a=>a.title===""?"Task Context Board":a.title,we=(a,e,t)=>{switch(t.type){case"todo":{const o=k(e,t.id);return`${o?.proposed===!0?a.proposalGroup:a.todoGroup} \xB7 ${o?.title??t.id}`}case"log":{const o=le(e,t.id);return`${a.logGroup} \xB7 ${o===void 0?t.id:Y(o)}`}case"context":return`${a.contextGroup} \xB7 ${pe(t.id)?B(a,t.id):t.id}`;case"question":{const o=L(e,t.id);return o===void 0?t.id:`${o.ref} \xB7 ${o.title}`}case"page":return a.wholeBoard;default:return t.id}},ha=(a,e)=>{switch(e){case"accept":return{title:a.accepted,tone:"update"};case"decline":return{title:a.declined,tone:"update"};case"clear":return{title:a.decisionCleared,tone:"delete"}}},ka=(a,e,t)=>{switch(t.type){case"ANSWER_QUESTION":{const o=z(m.ANSWER_QUESTION,t);if(o.kind==="clear")return{title:a.answerCleared,tone:"delete"};if(o.kind==="approve"){const r=L(e,t.target.id)?.assumption??null;return{title:a.approved,tone:"update",...r===null?{}:{body:a.quoted(r)}}}return{title:a.answered,tone:"update",body:a.quoted(o.text.slice(0,120))}}case"DECIDE_PROPOSAL":return ha(a,z(m.DECIDE_PROPOSAL,t).decision);case"SET_TODO_STATUS":{const{status:o}=z(m.SET_TODO_STATUS,t),r=k(e,t.target.id)?.status,s=E(a,o);return{title:a.statusChanged,tone:"update",body:r===void 0?s:a.change(E(a,r),s)}}case"ADD_TODO":{const o=z(m.ADD_TODO,t);return{title:a.todoAdded,tone:"create",targetLabel:`${a.todoGroup} \xB7 ${o.title}`,...o.assignee===null?{}:{body:`${a.assignee}: ${ga(a,e,o.assignee)}`}}}case"DELETE_TODO":return{title:a.todoRemoved,tone:"delete"};default:return{title:t.type,tone:"meta"}}},$e=(a,e,t,o)=>{let r;try{r=ka(a,o??t,e)}catch{r={title:e.type,tone:"meta"}}return{title:r.title,targetLabel:r.targetLabel??we(a,t,e.target),tone:r.tone,...r.body===void 0?{}:{summary:r.body}}},ye=a=>`${a.type} ${je(a.target)} ${JSON.stringify(a.payload)}`,Te=(a,e)=>[...e.questions.map(t=>({value:`question:${t.id}`,label:`${t.ref} \xB7 ${t.title}`,group:a.questionGroup})),...e.todos.map(t=>({value:`todo:${t.id}`,label:t.title,group:t.proposed?a.proposalGroup:a.todoGroup})),...e.log.map(t=>({value:`log:${t.id}`,label:Y(t),group:a.logGroup})),...q.filter(t=>U(e,t)).map(t=>({value:`context:${t}`,label:B(a,t),group:a.contextGroup}))],Ae=(a,e)=>e,Oe=(a,e,t)=>({parts:q.filter(o=>U(e,o)).map(o=>{const r=e.context[o];return{id:o,title:B(a,o),text:typeof r=="string"?r:null,items:typeof r=="string"||r===null?[]:r,comments:t(`context:${o}`)}})}),fa=(a,e,t)=>{const o=a.answers[e.id];return{id:e.id,ref:e.ref,title:e.title,description:e.description,blocking:e.blocking,assumption:e.assumption,reply:o?.kind??"none",resolved:ce(a,e),draft:o?.kind==="answer"?o.text:"",comments:t(`question:${e.id}`)}},Se=(a,e)=>{const t=a.questions.map(r=>fa(a,r,e)),o=t.filter(r=>r.resolved).length;return{blocking:t.filter(r=>r.blocking),provisional:t.filter(r=>!r.blocking),resolved:o,total:t.length,open:t.length-o,blockingOpen:t.filter(r=>r.blocking&&!r.resolved).length}},xa={todo:"gray",doing:"blue",blocked:"red",done:"green"},ma=(a,e,t,o,r)=>{const s=k(t,o.id),l=D(e,o.assignee);return{id:o.id,title:o.title,note:o.note,reason:o.reason,status:o.status,statusLabel:E(a,o.status),assignee:o.assignee,assigneeName:l?.name??null,assigneeKind:l?.kind??null,editable:_(e,o),proposal:o.proposed?e.decisions[o.id]??"pending":null,added:o.added,changed:s!==void 0&&s.status!==o.status,comments:r(`todo:${o.id}`),...o.questions===void 0?{}:{questions:o.questions}}},De=(a,e,t,o,r="all")=>{const s=e.members.some(p=>p.kind==="human"),l=s?r:"all",g=e.todos.map(p=>ma(a,e,t,p,o)),f=p=>p.assigneeKind==="human",Pe=l==="human"?g.filter(f):g,C=e.todos.filter(p=>H(e,p)),J=C.filter(p=>p.status==="done").length;return{lanes:A.map(p=>({status:p,label:E(a,p),tone:xa[p],cards:Pe.filter(We=>We.status===p)})),filter:l,canFilter:s,humanCount:g.filter(f).length,progress:{done:J,total:C.length,label:C.length===0?a.noTodosYet:a.progress(J,C.length)},statuses:A.map(p=>({value:p,label:E(a,p)})),members:e.members.map(p=>({id:p.id,label:a.memberOption(p.name,ba(a,p.kind))}))}},Ee=a=>{if(!/^[a-z][a-z\d+.-]*:\/\//i.test(a))return{kind:"path"};try{return{kind:"url",host:new URL(a).host}}catch{return{kind:"path"}}},Ce=a=>a.outputs.map(e=>({id:e.id,title:e.label??e.href,labelled:e.label!==null,href:e.href,kind:e.kind,description:e.description,place:Ee(e.href),...e.questions===void 0?{}:{questions:e.questions}})),ze=(a,e,t)=>({entries:e.log.map((o,r)=>{const s=D(e,o.from);return{id:o.id,author:s===void 0?null:{name:s.name,kind:s.kind},at:o.at,title:o.title,body:o.body,points:o.points,label:Y(o),latest:r===e.log.length-1,comments:t(`log:${o.id}`),...o.questions===void 0?{}:{questions:o.questions}}}).reverse(),status:e.status===null&&e.updatedAt===null?null:{status:e.status,label:e.status===null?null:xe(a,e.status),updatedAt:e.updatedAt}}),qe=(a,e)=>{switch(e.type){case"todo":return k(a,e.id)!==void 0;case"log":return le(a,e.id)!==void 0;case"context":return pe(e.id)&&U(a,e.id);case"question":return L(a,e.id)!==void 0;case"page":return!0;default:return!1}},Le=a=>{const e=j(a);return{kind:"view",name:"task-board",label:"Task Context Board",addable:!1,parseBase:de,emptyBase:ie,actions:m,apply:fe,hasTarget:qe,describe:(t,o,r)=>$e(e,t,o,r),serialize:ye,resolveNavigation:Ae,commentTargets:t=>Te(e,t),title:ve}},G=(a,e,t,o)=>n`
|
|
2
2
|
<button
|
|
3
3
|
class="dpk-icon-btn board-comment"
|
|
4
4
|
type="button"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{az as se,au as le,av as v,aw as E,aa as D,aN as ce,aM as A,aL as l,ac as c,ax as L,ay as S,p as b,a9 as f,t as pe,N as ue,e as B,a5 as ge,S as z,P as $,bf as me,a7 as ve,a6 as be,ai as p,z as he,as as s,aH as ye,aP as ke,I as fe,bg as $e,ah as xe,V as M,bh as we,l as Ee}from"./shared-DdpMqkAH.js";import{o as De}from"./shared-EYOAbLSo.js";const h=[1,2,3,4,5,6,7],y=se(h,"a delegation level is an integer from 1 to 7"),k=L(c(),S(1)),Ae=v({player:k,level:y,reason:l(c())}),q=v({title:l(c()),parties:l(v({delegator:l(k),delegate:l(k)})),players:E(D(v({id:A,name:k})),[]),decisions:E(D(v({id:A,name:k,description:l(c()),cards:E(D(Ae),[]),agreed:l(y),questions:ce})),[])}),V=e=>{const a=le(q,e),r=new Set;for(const t of a.players){if(r.has(t.id))throw new Error(`duplicate id "${t.id}" in players`);r.add(t.id)}const o=new Set;for(const t of a.decisions){if(o.has(t.id))throw new Error(`duplicate id "${t.id}" in decisions`);o.add(t.id);const i=new Set;for(const d of t.cards){if(!r.has(d.player))throw new Error(`decision "${t.id}" has a card from unknown player "${d.player}"`);if(i.has(d.player))throw new Error(`player "${d.player}" played more than one card on decision "${t.id}"`);i.add(d.player)}}return a},K=()=>({players:[],decisions:[]}),u=(e,a)=>{if(a!==void 0)return e.decisions.find(r=>r.id===a)},F=(e,a)=>e.players.find(r=>r.id===a),C=e=>[...e.players.map(a=>a.id),...e.decisions.map(a=>a.id)],x="delegation-poker",g={PLAY_CARD:b("PLAY_CARD","decision",v({level:y})),AGREE_LEVEL:b("AGREE_LEVEL","decision",f({level:y})),ADD_DECISION:b("ADD_DECISION","page",f({id:A,name:L(c(),S(1)),description:l(c())}),{dedupeKey:pe}),SET_DECISION_NAME:b("SET_DECISION_NAME","decision",f({name:L(c(),S(1))})),DELETE_DECISION:b("DELETE_DECISION","decision",f({}))},m={playCard:(e,a)=>({type:"PLAY_CARD",target:{type:"decision",id:e},payload:{level:a}}),agreeLevel:(e,a)=>({type:"AGREE_LEVEL",target:{type:"decision",id:e},payload:{level:a}}),addDecision:(e,a)=>({type:"ADD_DECISION",target:{type:"page",id:x},payload:{id:e,name:a}}),setDecisionName:(e,a)=>({type:"SET_DECISION_NAME",target:{type:"decision",id:e},payload:{name:a}}),deleteDecision:e=>({type:"DELETE_DECISION",target:{type:"decision",id:e},payload:{}})},j=(e,a)=>{const r=ue(g,a);if(r===null)return null;const o=r.target.id;switch(r.type){case"PLAY_CARD":return T(e,o,t=>({...t,yours:r.payload.level}));case"AGREE_LEVEL":return T(e,o,t=>({...t,agreed:r.payload.level}));case"ADD_DECISION":{const t=r.payload;return e.decisions.some(i=>i.id===t.id)?e:C(e).includes(t.id)?null:{...e,decisions:[...e.decisions,{id:t.id,name:t.name,...t.description===void 0?{}:{description:t.description},cards:[]}]}}case"SET_DECISION_NAME":return T(e,o,t=>({...t,name:r.payload.name}));case"DELETE_DECISION":return e.decisions.some(t=>t.id===o)?{...e,decisions:e.decisions.filter(t=>t.id!==o)}:null;default:return B(r)}},T=(e,a,r)=>e.decisions.some(o=>o.id===a)?{...e,decisions:e.decisions.map(o=>o.id===a?r(o):o)}:null,H={1:"Tell",2:"Sell",3:"Consult",4:"Agree",5:"Advise",6:"Inquire",7:"Delegate"},Y={1:"\u547D\u4EE4\u3059\u308B",2:"\u8AAC\u5F97\u3059\u308B",3:"\u76F8\u8AC7\u3059\u308B",4:"\u5408\u610F\u3059\u308B",5:"\u52A9\u8A00\u3059\u308B",6:"\u5C0B\u306D\u308B",7:"\u59D4\u4EFB\u3059\u308B"},Le={1:(e,a)=>`${e} decide and tell ${a}`,2:(e,a)=>`${e} decide and convince ${a}`,3:(e,a)=>`${e} decide after hearing ${a}`,4:(e,a)=>`${e} and ${a} decide together`,5:(e,a)=>`${a} decides after ${e} advise`,6:(e,a)=>`${a} decides, then ${e} ask why`,7:(e,a)=>`${a} decides; ${e} need not know`},Se={1:(e,a)=>`${e}\u304C\u6C7A\u3081\u3066\u3001${a}\u306B\u4F1D\u3048\u308B`,2:(e,a)=>`${e}\u304C\u6C7A\u3081\u3066\u3001${a}\u306B\u7D0D\u5F97\u3057\u3066\u3082\u3089\u3046`,3:(e,a)=>`${e}\u304C${a}\u306E\u610F\u898B\u3092\u805E\u3044\u3066\u304B\u3089\u6C7A\u3081\u308B`,4:(e,a)=>`${e}\u3068${a}\u304C\u4E00\u7DD2\u306B\u6C7A\u3081\u308B`,5:(e,a)=>`${e}\u304C\u52A9\u8A00\u3057\u3001${a}\u304C\u6C7A\u3081\u308B`,6:(e,a)=>`${a}\u304C\u6C7A\u3081\u3001\u3042\u3068\u3067${e}\u304C\u7406\u7531\u3092\u5C0B\u306D\u308B`,7:(e,a)=>`${a}\u304C\u6C7A\u3081\u308B\u3002${e}\u306F\u77E5\u3089\u306A\u304F\u3066\u3088\u3044`},Ce={"to-play":"Your card",discuss:"Discuss",consensus:"Same card",agreed:"Agreed"},Te={"to-play":"\u30AB\u30FC\u30C9\u5F85\u3061",discuss:"\u8981\u8B70\u8AD6",consensus:"\u4E00\u81F4",agreed:"\u5408\u610F\u6E08\u307F"},_=ge({en:{levelName:e=>H[e],levelPhrase:(e,a,r)=>Le[e](a,r),levelLabel:e=>`${e} ${H[e]}`,statusLabel:e=>Ce[e],defaultDelegator:"Leaders",defaultDelegate:"Team",you:"You",progress:(e,a,r)=>`Played ${e}/${r} \xB7 Agreed ${a}/${r}`,partiesLabel:"Who delegates to whom",board:"Delegation board",boardHint:e=>e==="strict"?"Click a cell to play your card for that decision area. The other cards on a row stay face down until you play on it, and your card cannot be changed afterwards.":"Click a cell to play your card for that decision area. The other cards on a row stay face down until you play on it; you can still change your card afterwards.",modeLabel:e=>e==="strict"?"One card only":"Card can be changed",modeTitle:e=>e==="strict"?"Strict mode: a card, once played, is final":"Lax mode: you may change your card after seeing the others",locked:"Final",confirmTitle:"Your card is final",confirmBody:(e,a)=>`You are playing ${e} on \u201C${a}\u201D. On this board a card cannot be changed once played, even after you see the others.`,confirmSkip:"Don\u2019t ask again",confirmPlay:"Play this card",confirmCancel:"Cancel",decisionColumn:"Decision area",agreeColumn:"Agreed",notAgreed:"Not yet",agreeLabel:e=>`Agreed level for \u201C${e}\u201D`,playAt:(e,a)=>`Play ${e} on \u201C${a}\u201D`,hiddenCards:e=>`${e} face down`,addDecision:"+ Decision area",newDecision:"New decision area",noDecisionsTitle:"No decision areas yet",noDecisionsBody:"List the key decisions whose ownership is unclear. For each one, everyone plays one of seven cards, from 1 (the delegator decides alone) to 7 (fully delegated), and then settles on one level.",firstDecision:"+ First decision area",commentCount:e=>`${e} comments`,decisionNameLabel:"Decision area name",commentButton:"Comment",deleteButton:"Delete",cardPlayedTitle:"Played a card",levelAgreedTitle:"Agreed on a level",decisionAddedTitle:"Added a decision area",decisionRenamedTitle:"Renamed the decision area",decisionDeletedTitle:"Deleted the decision area",arrowTo:e=>`\u2192 ${e}`,arrowFrom:(e,a)=>`${e} \u2192 ${a}`,quotedArrowTo:e=>`\u2192 \u201C${e}\u201D`,quotedArrowFrom:(e,a)=>`\u201C${e}\u201D \u2192 \u201C${a}\u201D`,added:e=>`+ \u201C${e}\u201D`,deleted:e=>`\u2212 \u201C${e}\u201D`,decisionKind:"Decision area",boardKind:"Board",wholeBoard:"Whole board"},ja:{levelName:e=>Y[e],levelPhrase:(e,a,r)=>Se[e](a,r),levelLabel:e=>`${e} ${Y[e]}`,statusLabel:e=>Te[e],defaultDelegator:"\u30EA\u30FC\u30C0\u30FC",defaultDelegate:"\u30C1\u30FC\u30E0",you:"\u3042\u306A\u305F",progress:(e,a,r)=>`\u63D0\u51FA ${e}/${r} \xB7 \u5408\u610F ${a}/${r}`,partiesLabel:"\u8AB0\u304C\u8AB0\u306B\u4EFB\u305B\u308B\u304B",board:"\u30C7\u30EA\u30B2\u30FC\u30B7\u30E7\u30F3\u30DC\u30FC\u30C9",boardHint:e=>e==="strict"?"\u30BB\u30EB\u3092\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u3068\u3001\u305D\u306E\u5224\u65AD\u9818\u57DF\u306B\u3042\u306A\u305F\u306E\u30AB\u30FC\u30C9\u3092\u51FA\u3057\u307E\u3059\u3002\u30AB\u30FC\u30C9\u3092\u51FA\u3059\u307E\u3067\u305D\u306E\u884C\u306E\u4ED6\u306E\u30AB\u30FC\u30C9\u306F\u4F0F\u305B\u305F\u307E\u307E\u3067\u3059\u3002\u51FA\u3057\u305F\u30AB\u30FC\u30C9\u306F\u3042\u3068\u304B\u3089\u5909\u66F4\u3067\u304D\u307E\u305B\u3093\u3002":"\u30BB\u30EB\u3092\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u3068\u3001\u305D\u306E\u5224\u65AD\u9818\u57DF\u306B\u3042\u306A\u305F\u306E\u30AB\u30FC\u30C9\u3092\u51FA\u3057\u307E\u3059\u3002\u30AB\u30FC\u30C9\u3092\u51FA\u3059\u307E\u3067\u305D\u306E\u884C\u306E\u4ED6\u306E\u30AB\u30FC\u30C9\u306F\u4F0F\u305B\u305F\u307E\u307E\u3067\u3059\u3002\u51FA\u3057\u305F\u3042\u3068\u3082\u5909\u66F4\u3067\u304D\u307E\u3059\u3002",modeLabel:e=>e==="strict"?"\u51FA\u3057\u76F4\u3057\u4E0D\u53EF":"\u51FA\u3057\u76F4\u3057\u53EF",modeTitle:e=>e==="strict"?"strict \u30E2\u30FC\u30C9: \u4E00\u5EA6\u51FA\u3057\u305F\u30AB\u30FC\u30C9\u306F\u5909\u66F4\u3067\u304D\u307E\u305B\u3093":"lax \u30E2\u30FC\u30C9: \u4ED6\u306E\u4EBA\u306E\u30AB\u30FC\u30C9\u3092\u898B\u305F\u3042\u3068\u3067\u3082\u30AB\u30FC\u30C9\u3092\u5909\u66F4\u3067\u304D\u307E\u3059",locked:"\u78BA\u5B9A",confirmTitle:"\u30AB\u30FC\u30C9\u3092\u51FA\u3059\u3068\u5909\u66F4\u3067\u304D\u307E\u305B\u3093",confirmBody:(e,a)=>`\u300C${a}\u300D\u306B\u300C${e}\u300D\u306E\u30AB\u30FC\u30C9\u3092\u51FA\u3057\u307E\u3059\u3002\u3053\u306E\u30DC\u30FC\u30C9\u3067\u306F\u3001\u4E00\u5EA6\u51FA\u3057\u305F\u30AB\u30FC\u30C9\u306F\u4ED6\u306E\u4EBA\u306E\u30AB\u30FC\u30C9\u3092\u898B\u305F\u3042\u3068\u3067\u3082\u5909\u66F4\u3067\u304D\u307E\u305B\u3093\u3002`,confirmSkip:"\u6B21\u56DE\u304B\u3089\u78BA\u8A8D\u3057\u306A\u3044",confirmPlay:"\u3053\u306E\u30AB\u30FC\u30C9\u3092\u51FA\u3059",confirmCancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",decisionColumn:"\u5224\u65AD\u9818\u57DF",agreeColumn:"\u5408\u610F",notAgreed:"\u672A\u5408\u610F",agreeLabel:e=>`\u300C${e}\u300D\u306E\u5408\u610F\u30EC\u30D9\u30EB`,playAt:(e,a)=>`\u300C${a}\u300D\u306B ${e} \u3092\u51FA\u3059`,hiddenCards:e=>`\u4F0F\u305B\u672D ${e} \u679A`,addDecision:"+ \u5224\u65AD\u9818\u57DF",newDecision:"\u65B0\u3057\u3044\u5224\u65AD\u9818\u57DF",noDecisionsTitle:"\u5224\u65AD\u9818\u57DF\u304C\u307E\u3060\u3042\u308A\u307E\u305B\u3093",noDecisionsBody:"\u8AB0\u304C\u6C7A\u3081\u308B\u306E\u304B\u304C\u66D6\u6627\u306A\u5224\u65AD\u3092\u4E26\u3079\u307E\u3059\u3002\u5224\u65AD\u3054\u3068\u306B\u5168\u54E1\u304C 1\uFF08\u4EFB\u305B\u308B\u5074\u3060\u3051\u3067\u6C7A\u3081\u308B\uFF09\u301C 7\uFF08\u5B8C\u5168\u306B\u4EFB\u305B\u308B\uFF09\u306E\u30AB\u30FC\u30C9\u3092 1 \u679A\u51FA\u3057\u3001\u8A71\u3057\u5408\u3063\u3066 1 \u3064\u306E\u30EC\u30D9\u30EB\u306B\u5408\u610F\u3057\u307E\u3059\u3002",firstDecision:"+ \u6700\u521D\u306E\u5224\u65AD\u9818\u57DF",commentCount:e=>`\u30B3\u30E1\u30F3\u30C8 ${e} \u4EF6`,decisionNameLabel:"\u5224\u65AD\u9818\u57DF\u306E\u540D\u524D",commentButton:"\u30B3\u30E1\u30F3\u30C8",deleteButton:"\u524A\u9664",cardPlayedTitle:"\u30AB\u30FC\u30C9\u3092\u51FA\u3057\u305F",levelAgreedTitle:"\u30EC\u30D9\u30EB\u306B\u5408\u610F",decisionAddedTitle:"\u5224\u65AD\u9818\u57DF\u3092\u8FFD\u52A0",decisionRenamedTitle:"\u5224\u65AD\u9818\u57DF\u306E\u540D\u524D\u3092\u5909\u66F4",decisionDeletedTitle:"\u5224\u65AD\u9818\u57DF\u3092\u524A\u9664",arrowTo:e=>`\u2192 ${e}`,arrowFrom:(e,a)=>`${e} \u2192 ${a}`,quotedArrowTo:e=>`\u2192 \u300C${e}\u300D`,quotedArrowFrom:(e,a)=>`\u300C${e}\u300D\u2192\u300C${a}\u300D`,added:e=>`+ \u300C${e}\u300D`,deleted:e=>`\u2212 \u300C${e}\u300D`,decisionKind:"\u5224\u65AD\u9818\u57DF",boardKind:"\u30DC\u30FC\u30C9",wholeBoard:"\u30DC\u30FC\u30C9\u5168\u4F53"}}),P=e=>e==="strict"?"strict":"lax",N=(e,a)=>e==="strict"&&a.yours!==void 0,G=(e,a,r)=>e==="lax"?{kind:"play"}:N(e,a)?{kind:"locked"}:r?{kind:"play"}:{kind:"confirm"},I=(e,a)=>({delegator:a.parties?.delegator??e.defaultDelegator,delegate:a.parties?.delegate??e.defaultDelegate}),J=e=>e.yours!==void 0||e.agreed!==void 0,_e=(e,a,r)=>[...r.yours===void 0?[]:[{label:e.you,kind:"you",level:r.yours}],...r.cards.map(t=>({label:F(a,t.player)?.name??t.player,kind:"player",level:t.level,...t.reason===void 0?{}:{reason:t.reason}}))],Pe=(e,a)=>e.agreed!==void 0?"agreed":e.yours===void 0?"to-play":a.every(r=>r.level===e.yours)?"consensus":"discuss",Ne=(e,a,r,o)=>{const t=_e(e,a,o),i=J(o)?t:[];return{id:o.id,name:o.name,...o.description===void 0?{}:{description:o.description},status:Pe(o,t),hidden:J(o)?0:o.cards.length,...o.agreed===void 0?{}:{agreed:o.agreed},locked:N(r,o),...me(o.questions),cells:h.map(d=>({level:d,chips:i.filter(n=>n.level===d).map(({level:n,...w})=>w),yours:o.yours===d,agreed:o.agreed===d}))}},O=(e,a,r)=>{const{delegator:o,delegate:t}=I(e,a);return{levels:h.map(i=>({level:i,name:e.levelName(i),label:e.levelLabel(i),phrase:e.levelPhrase(i,o,t)})),rows:a.decisions.map(i=>Ne(e,a,r,i)),progress:{played:a.decisions.filter(i=>i.yours!==void 0).length,agreed:a.decisions.filter(i=>i.agreed!==void 0).length,total:a.decisions.length}}},U=(e,a,r)=>{const o=r===void 0?"":e.levelLabel(r);return a===void 0?e.arrowTo(o):e.arrowFrom(e.levelLabel(a),o)},Ie=(e,a,r)=>a===void 0?e.quotedArrowTo(r):e.quotedArrowFrom(a,r),W={PLAY_CARD:(e,a,r)=>{const o=$(g.PLAY_CARD,a);return{title:e.cardPlayedTitle,tone:"update",body:U(e,u(r,a.target.id)?.yours,o.level)}},AGREE_LEVEL:(e,a,r)=>({title:e.levelAgreedTitle,tone:"update",body:U(e,u(r,a.target.id)?.agreed,$(g.AGREE_LEVEL,a).level)}),ADD_DECISION:(e,a)=>({title:e.decisionAddedTitle,tone:"create",body:e.added(String($(g.ADD_DECISION,a).name??""))}),SET_DECISION_NAME:(e,a,r)=>({title:e.decisionRenamedTitle,tone:"update",body:Ie(e,u(r,a.target.id)?.name,String($(g.SET_DECISION_NAME,a).name??""))}),DELETE_DECISION:(e,a,r)=>({title:e.decisionDeletedTitle,tone:"delete",body:e.deleted(u(r,a.target.id)?.name??a.target.id)})},Q=(e,a,r,o)=>{let t;try{const i=Object.hasOwn(W,a.type)?W[a.type]:void 0;t=i?i(e,a,o??r):{title:a.type,tone:"meta"}}catch{t={title:a.type,tone:"meta"}}return{title:t.title,targetLabel:Z(e,r,a.target),tone:t.tone,...t.body===void 0?{}:{summary:t.body}}},X=e=>`${e.type} ${z(e.target)} ${JSON.stringify(e.payload)}`,Z=(e,a,r)=>{switch(r.type){case"decision":{const o=u(a,r.id);return o?`${e.decisionKind} \xB7 ${o.name}`:`${e.decisionKind} \xB7 ${r.id} (missing)`}case"page":return`${e.boardKind} \xB7 ${R(a)}`;default:return`${r.type} \xB7 ${r.id}`}},ee=(e,a,r)=>[{value:`page:${x}`,label:e.wholeBoard,group:e.boardKind},...a.decisions.map(o=>({value:z({type:"decision",id:o.id}),label:o.name,group:e.decisionKind}))],R=e=>e.title??"Delegation Poker",ae=(e,a)=>a,re=(e,a)=>{switch(a.type){case"decision":return u(e,a.id)!==void 0;case"page":return a.id===x;default:return!1}},oe=e=>{const a=_(e);return{kind:"view",name:"delegation-poker",label:"Delegation Poker",addable:!1,parseBase:V,emptyBase:K,actions:g,apply:j,hasTarget:re,describe:(r,o,t)=>Q(a,r,o,t),serialize:X,resolveNavigation:ae,commentTargets:(r,o)=>ee(a,r),title:R}},te="dev-process-kit:delegation-poker:skip-strict-confirm",ie=e=>e===!0?!0:null,Oe=e=>{const a=e?ve(ie):be(ie);return{read:()=>a.read(te)===!0,remember:()=>a.write(te,!0)}},Re=(e,a,r,o)=>s`
|
|
1
|
+
import{az as se,au as le,av as v,aw as E,aa as D,aN as ce,aM as A,aL as l,ac as c,ax as L,ay as S,p as b,a9 as f,t as pe,N as ue,e as B,a5 as ge,S as z,P as $,bf as me,a7 as ve,a6 as be,ai as p,z as he,as as s,aH as ye,aP as ke,I as fe,bg as $e,ah as xe,V as M,bh as we,l as Ee}from"./shared-BXejn2ZQ.js";import{o as De}from"./shared-BTf38OnF.js";const h=[1,2,3,4,5,6,7],y=se(h,"a delegation level is an integer from 1 to 7"),k=L(c(),S(1)),Ae=v({player:k,level:y,reason:l(c())}),q=v({title:l(c()),parties:l(v({delegator:l(k),delegate:l(k)})),players:E(D(v({id:A,name:k})),[]),decisions:E(D(v({id:A,name:k,description:l(c()),cards:E(D(Ae),[]),agreed:l(y),questions:ce})),[])}),V=e=>{const a=le(q,e),r=new Set;for(const t of a.players){if(r.has(t.id))throw new Error(`duplicate id "${t.id}" in players`);r.add(t.id)}const o=new Set;for(const t of a.decisions){if(o.has(t.id))throw new Error(`duplicate id "${t.id}" in decisions`);o.add(t.id);const i=new Set;for(const d of t.cards){if(!r.has(d.player))throw new Error(`decision "${t.id}" has a card from unknown player "${d.player}"`);if(i.has(d.player))throw new Error(`player "${d.player}" played more than one card on decision "${t.id}"`);i.add(d.player)}}return a},K=()=>({players:[],decisions:[]}),u=(e,a)=>{if(a!==void 0)return e.decisions.find(r=>r.id===a)},F=(e,a)=>e.players.find(r=>r.id===a),C=e=>[...e.players.map(a=>a.id),...e.decisions.map(a=>a.id)],x="delegation-poker",g={PLAY_CARD:b("PLAY_CARD","decision",v({level:y})),AGREE_LEVEL:b("AGREE_LEVEL","decision",f({level:y})),ADD_DECISION:b("ADD_DECISION","page",f({id:A,name:L(c(),S(1)),description:l(c())}),{dedupeKey:pe}),SET_DECISION_NAME:b("SET_DECISION_NAME","decision",f({name:L(c(),S(1))})),DELETE_DECISION:b("DELETE_DECISION","decision",f({}))},m={playCard:(e,a)=>({type:"PLAY_CARD",target:{type:"decision",id:e},payload:{level:a}}),agreeLevel:(e,a)=>({type:"AGREE_LEVEL",target:{type:"decision",id:e},payload:{level:a}}),addDecision:(e,a)=>({type:"ADD_DECISION",target:{type:"page",id:x},payload:{id:e,name:a}}),setDecisionName:(e,a)=>({type:"SET_DECISION_NAME",target:{type:"decision",id:e},payload:{name:a}}),deleteDecision:e=>({type:"DELETE_DECISION",target:{type:"decision",id:e},payload:{}})},j=(e,a)=>{const r=ue(g,a);if(r===null)return null;const o=r.target.id;switch(r.type){case"PLAY_CARD":return T(e,o,t=>({...t,yours:r.payload.level}));case"AGREE_LEVEL":return T(e,o,t=>({...t,agreed:r.payload.level}));case"ADD_DECISION":{const t=r.payload;return e.decisions.some(i=>i.id===t.id)?e:C(e).includes(t.id)?null:{...e,decisions:[...e.decisions,{id:t.id,name:t.name,...t.description===void 0?{}:{description:t.description},cards:[]}]}}case"SET_DECISION_NAME":return T(e,o,t=>({...t,name:r.payload.name}));case"DELETE_DECISION":return e.decisions.some(t=>t.id===o)?{...e,decisions:e.decisions.filter(t=>t.id!==o)}:null;default:return B(r)}},T=(e,a,r)=>e.decisions.some(o=>o.id===a)?{...e,decisions:e.decisions.map(o=>o.id===a?r(o):o)}:null,H={1:"Tell",2:"Sell",3:"Consult",4:"Agree",5:"Advise",6:"Inquire",7:"Delegate"},Y={1:"\u547D\u4EE4\u3059\u308B",2:"\u8AAC\u5F97\u3059\u308B",3:"\u76F8\u8AC7\u3059\u308B",4:"\u5408\u610F\u3059\u308B",5:"\u52A9\u8A00\u3059\u308B",6:"\u5C0B\u306D\u308B",7:"\u59D4\u4EFB\u3059\u308B"},Le={1:(e,a)=>`${e} decide and tell ${a}`,2:(e,a)=>`${e} decide and convince ${a}`,3:(e,a)=>`${e} decide after hearing ${a}`,4:(e,a)=>`${e} and ${a} decide together`,5:(e,a)=>`${a} decides after ${e} advise`,6:(e,a)=>`${a} decides, then ${e} ask why`,7:(e,a)=>`${a} decides; ${e} need not know`},Se={1:(e,a)=>`${e}\u304C\u6C7A\u3081\u3066\u3001${a}\u306B\u4F1D\u3048\u308B`,2:(e,a)=>`${e}\u304C\u6C7A\u3081\u3066\u3001${a}\u306B\u7D0D\u5F97\u3057\u3066\u3082\u3089\u3046`,3:(e,a)=>`${e}\u304C${a}\u306E\u610F\u898B\u3092\u805E\u3044\u3066\u304B\u3089\u6C7A\u3081\u308B`,4:(e,a)=>`${e}\u3068${a}\u304C\u4E00\u7DD2\u306B\u6C7A\u3081\u308B`,5:(e,a)=>`${e}\u304C\u52A9\u8A00\u3057\u3001${a}\u304C\u6C7A\u3081\u308B`,6:(e,a)=>`${a}\u304C\u6C7A\u3081\u3001\u3042\u3068\u3067${e}\u304C\u7406\u7531\u3092\u5C0B\u306D\u308B`,7:(e,a)=>`${a}\u304C\u6C7A\u3081\u308B\u3002${e}\u306F\u77E5\u3089\u306A\u304F\u3066\u3088\u3044`},Ce={"to-play":"Your card",discuss:"Discuss",consensus:"Same card",agreed:"Agreed"},Te={"to-play":"\u30AB\u30FC\u30C9\u5F85\u3061",discuss:"\u8981\u8B70\u8AD6",consensus:"\u4E00\u81F4",agreed:"\u5408\u610F\u6E08\u307F"},_=ge({en:{levelName:e=>H[e],levelPhrase:(e,a,r)=>Le[e](a,r),levelLabel:e=>`${e} ${H[e]}`,statusLabel:e=>Ce[e],defaultDelegator:"Leaders",defaultDelegate:"Team",you:"You",progress:(e,a,r)=>`Played ${e}/${r} \xB7 Agreed ${a}/${r}`,partiesLabel:"Who delegates to whom",board:"Delegation board",boardHint:e=>e==="strict"?"Click a cell to play your card for that decision area. The other cards on a row stay face down until you play on it, and your card cannot be changed afterwards.":"Click a cell to play your card for that decision area. The other cards on a row stay face down until you play on it; you can still change your card afterwards.",modeLabel:e=>e==="strict"?"One card only":"Card can be changed",modeTitle:e=>e==="strict"?"Strict mode: a card, once played, is final":"Lax mode: you may change your card after seeing the others",locked:"Final",confirmTitle:"Your card is final",confirmBody:(e,a)=>`You are playing ${e} on \u201C${a}\u201D. On this board a card cannot be changed once played, even after you see the others.`,confirmSkip:"Don\u2019t ask again",confirmPlay:"Play this card",confirmCancel:"Cancel",decisionColumn:"Decision area",agreeColumn:"Agreed",notAgreed:"Not yet",agreeLabel:e=>`Agreed level for \u201C${e}\u201D`,playAt:(e,a)=>`Play ${e} on \u201C${a}\u201D`,hiddenCards:e=>`${e} face down`,addDecision:"+ Decision area",newDecision:"New decision area",noDecisionsTitle:"No decision areas yet",noDecisionsBody:"List the key decisions whose ownership is unclear. For each one, everyone plays one of seven cards, from 1 (the delegator decides alone) to 7 (fully delegated), and then settles on one level.",firstDecision:"+ First decision area",commentCount:e=>`${e} comments`,decisionNameLabel:"Decision area name",commentButton:"Comment",deleteButton:"Delete",cardPlayedTitle:"Played a card",levelAgreedTitle:"Agreed on a level",decisionAddedTitle:"Added a decision area",decisionRenamedTitle:"Renamed the decision area",decisionDeletedTitle:"Deleted the decision area",arrowTo:e=>`\u2192 ${e}`,arrowFrom:(e,a)=>`${e} \u2192 ${a}`,quotedArrowTo:e=>`\u2192 \u201C${e}\u201D`,quotedArrowFrom:(e,a)=>`\u201C${e}\u201D \u2192 \u201C${a}\u201D`,added:e=>`+ \u201C${e}\u201D`,deleted:e=>`\u2212 \u201C${e}\u201D`,decisionKind:"Decision area",boardKind:"Board",wholeBoard:"Whole board"},ja:{levelName:e=>Y[e],levelPhrase:(e,a,r)=>Se[e](a,r),levelLabel:e=>`${e} ${Y[e]}`,statusLabel:e=>Te[e],defaultDelegator:"\u30EA\u30FC\u30C0\u30FC",defaultDelegate:"\u30C1\u30FC\u30E0",you:"\u3042\u306A\u305F",progress:(e,a,r)=>`\u63D0\u51FA ${e}/${r} \xB7 \u5408\u610F ${a}/${r}`,partiesLabel:"\u8AB0\u304C\u8AB0\u306B\u4EFB\u305B\u308B\u304B",board:"\u30C7\u30EA\u30B2\u30FC\u30B7\u30E7\u30F3\u30DC\u30FC\u30C9",boardHint:e=>e==="strict"?"\u30BB\u30EB\u3092\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u3068\u3001\u305D\u306E\u5224\u65AD\u9818\u57DF\u306B\u3042\u306A\u305F\u306E\u30AB\u30FC\u30C9\u3092\u51FA\u3057\u307E\u3059\u3002\u30AB\u30FC\u30C9\u3092\u51FA\u3059\u307E\u3067\u305D\u306E\u884C\u306E\u4ED6\u306E\u30AB\u30FC\u30C9\u306F\u4F0F\u305B\u305F\u307E\u307E\u3067\u3059\u3002\u51FA\u3057\u305F\u30AB\u30FC\u30C9\u306F\u3042\u3068\u304B\u3089\u5909\u66F4\u3067\u304D\u307E\u305B\u3093\u3002":"\u30BB\u30EB\u3092\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u3068\u3001\u305D\u306E\u5224\u65AD\u9818\u57DF\u306B\u3042\u306A\u305F\u306E\u30AB\u30FC\u30C9\u3092\u51FA\u3057\u307E\u3059\u3002\u30AB\u30FC\u30C9\u3092\u51FA\u3059\u307E\u3067\u305D\u306E\u884C\u306E\u4ED6\u306E\u30AB\u30FC\u30C9\u306F\u4F0F\u305B\u305F\u307E\u307E\u3067\u3059\u3002\u51FA\u3057\u305F\u3042\u3068\u3082\u5909\u66F4\u3067\u304D\u307E\u3059\u3002",modeLabel:e=>e==="strict"?"\u51FA\u3057\u76F4\u3057\u4E0D\u53EF":"\u51FA\u3057\u76F4\u3057\u53EF",modeTitle:e=>e==="strict"?"strict \u30E2\u30FC\u30C9: \u4E00\u5EA6\u51FA\u3057\u305F\u30AB\u30FC\u30C9\u306F\u5909\u66F4\u3067\u304D\u307E\u305B\u3093":"lax \u30E2\u30FC\u30C9: \u4ED6\u306E\u4EBA\u306E\u30AB\u30FC\u30C9\u3092\u898B\u305F\u3042\u3068\u3067\u3082\u30AB\u30FC\u30C9\u3092\u5909\u66F4\u3067\u304D\u307E\u3059",locked:"\u78BA\u5B9A",confirmTitle:"\u30AB\u30FC\u30C9\u3092\u51FA\u3059\u3068\u5909\u66F4\u3067\u304D\u307E\u305B\u3093",confirmBody:(e,a)=>`\u300C${a}\u300D\u306B\u300C${e}\u300D\u306E\u30AB\u30FC\u30C9\u3092\u51FA\u3057\u307E\u3059\u3002\u3053\u306E\u30DC\u30FC\u30C9\u3067\u306F\u3001\u4E00\u5EA6\u51FA\u3057\u305F\u30AB\u30FC\u30C9\u306F\u4ED6\u306E\u4EBA\u306E\u30AB\u30FC\u30C9\u3092\u898B\u305F\u3042\u3068\u3067\u3082\u5909\u66F4\u3067\u304D\u307E\u305B\u3093\u3002`,confirmSkip:"\u6B21\u56DE\u304B\u3089\u78BA\u8A8D\u3057\u306A\u3044",confirmPlay:"\u3053\u306E\u30AB\u30FC\u30C9\u3092\u51FA\u3059",confirmCancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",decisionColumn:"\u5224\u65AD\u9818\u57DF",agreeColumn:"\u5408\u610F",notAgreed:"\u672A\u5408\u610F",agreeLabel:e=>`\u300C${e}\u300D\u306E\u5408\u610F\u30EC\u30D9\u30EB`,playAt:(e,a)=>`\u300C${a}\u300D\u306B ${e} \u3092\u51FA\u3059`,hiddenCards:e=>`\u4F0F\u305B\u672D ${e} \u679A`,addDecision:"+ \u5224\u65AD\u9818\u57DF",newDecision:"\u65B0\u3057\u3044\u5224\u65AD\u9818\u57DF",noDecisionsTitle:"\u5224\u65AD\u9818\u57DF\u304C\u307E\u3060\u3042\u308A\u307E\u305B\u3093",noDecisionsBody:"\u8AB0\u304C\u6C7A\u3081\u308B\u306E\u304B\u304C\u66D6\u6627\u306A\u5224\u65AD\u3092\u4E26\u3079\u307E\u3059\u3002\u5224\u65AD\u3054\u3068\u306B\u5168\u54E1\u304C 1\uFF08\u4EFB\u305B\u308B\u5074\u3060\u3051\u3067\u6C7A\u3081\u308B\uFF09\u301C 7\uFF08\u5B8C\u5168\u306B\u4EFB\u305B\u308B\uFF09\u306E\u30AB\u30FC\u30C9\u3092 1 \u679A\u51FA\u3057\u3001\u8A71\u3057\u5408\u3063\u3066 1 \u3064\u306E\u30EC\u30D9\u30EB\u306B\u5408\u610F\u3057\u307E\u3059\u3002",firstDecision:"+ \u6700\u521D\u306E\u5224\u65AD\u9818\u57DF",commentCount:e=>`\u30B3\u30E1\u30F3\u30C8 ${e} \u4EF6`,decisionNameLabel:"\u5224\u65AD\u9818\u57DF\u306E\u540D\u524D",commentButton:"\u30B3\u30E1\u30F3\u30C8",deleteButton:"\u524A\u9664",cardPlayedTitle:"\u30AB\u30FC\u30C9\u3092\u51FA\u3057\u305F",levelAgreedTitle:"\u30EC\u30D9\u30EB\u306B\u5408\u610F",decisionAddedTitle:"\u5224\u65AD\u9818\u57DF\u3092\u8FFD\u52A0",decisionRenamedTitle:"\u5224\u65AD\u9818\u57DF\u306E\u540D\u524D\u3092\u5909\u66F4",decisionDeletedTitle:"\u5224\u65AD\u9818\u57DF\u3092\u524A\u9664",arrowTo:e=>`\u2192 ${e}`,arrowFrom:(e,a)=>`${e} \u2192 ${a}`,quotedArrowTo:e=>`\u2192 \u300C${e}\u300D`,quotedArrowFrom:(e,a)=>`\u300C${e}\u300D\u2192\u300C${a}\u300D`,added:e=>`+ \u300C${e}\u300D`,deleted:e=>`\u2212 \u300C${e}\u300D`,decisionKind:"\u5224\u65AD\u9818\u57DF",boardKind:"\u30DC\u30FC\u30C9",wholeBoard:"\u30DC\u30FC\u30C9\u5168\u4F53"}}),P=e=>e==="strict"?"strict":"lax",N=(e,a)=>e==="strict"&&a.yours!==void 0,G=(e,a,r)=>e==="lax"?{kind:"play"}:N(e,a)?{kind:"locked"}:r?{kind:"play"}:{kind:"confirm"},I=(e,a)=>({delegator:a.parties?.delegator??e.defaultDelegator,delegate:a.parties?.delegate??e.defaultDelegate}),J=e=>e.yours!==void 0||e.agreed!==void 0,_e=(e,a,r)=>[...r.yours===void 0?[]:[{label:e.you,kind:"you",level:r.yours}],...r.cards.map(t=>({label:F(a,t.player)?.name??t.player,kind:"player",level:t.level,...t.reason===void 0?{}:{reason:t.reason}}))],Pe=(e,a)=>e.agreed!==void 0?"agreed":e.yours===void 0?"to-play":a.every(r=>r.level===e.yours)?"consensus":"discuss",Ne=(e,a,r,o)=>{const t=_e(e,a,o),i=J(o)?t:[];return{id:o.id,name:o.name,...o.description===void 0?{}:{description:o.description},status:Pe(o,t),hidden:J(o)?0:o.cards.length,...o.agreed===void 0?{}:{agreed:o.agreed},locked:N(r,o),...me(o.questions),cells:h.map(d=>({level:d,chips:i.filter(n=>n.level===d).map(({level:n,...w})=>w),yours:o.yours===d,agreed:o.agreed===d}))}},O=(e,a,r)=>{const{delegator:o,delegate:t}=I(e,a);return{levels:h.map(i=>({level:i,name:e.levelName(i),label:e.levelLabel(i),phrase:e.levelPhrase(i,o,t)})),rows:a.decisions.map(i=>Ne(e,a,r,i)),progress:{played:a.decisions.filter(i=>i.yours!==void 0).length,agreed:a.decisions.filter(i=>i.agreed!==void 0).length,total:a.decisions.length}}},U=(e,a,r)=>{const o=r===void 0?"":e.levelLabel(r);return a===void 0?e.arrowTo(o):e.arrowFrom(e.levelLabel(a),o)},Ie=(e,a,r)=>a===void 0?e.quotedArrowTo(r):e.quotedArrowFrom(a,r),W={PLAY_CARD:(e,a,r)=>{const o=$(g.PLAY_CARD,a);return{title:e.cardPlayedTitle,tone:"update",body:U(e,u(r,a.target.id)?.yours,o.level)}},AGREE_LEVEL:(e,a,r)=>({title:e.levelAgreedTitle,tone:"update",body:U(e,u(r,a.target.id)?.agreed,$(g.AGREE_LEVEL,a).level)}),ADD_DECISION:(e,a)=>({title:e.decisionAddedTitle,tone:"create",body:e.added(String($(g.ADD_DECISION,a).name??""))}),SET_DECISION_NAME:(e,a,r)=>({title:e.decisionRenamedTitle,tone:"update",body:Ie(e,u(r,a.target.id)?.name,String($(g.SET_DECISION_NAME,a).name??""))}),DELETE_DECISION:(e,a,r)=>({title:e.decisionDeletedTitle,tone:"delete",body:e.deleted(u(r,a.target.id)?.name??a.target.id)})},Q=(e,a,r,o)=>{let t;try{const i=Object.hasOwn(W,a.type)?W[a.type]:void 0;t=i?i(e,a,o??r):{title:a.type,tone:"meta"}}catch{t={title:a.type,tone:"meta"}}return{title:t.title,targetLabel:Z(e,r,a.target),tone:t.tone,...t.body===void 0?{}:{summary:t.body}}},X=e=>`${e.type} ${z(e.target)} ${JSON.stringify(e.payload)}`,Z=(e,a,r)=>{switch(r.type){case"decision":{const o=u(a,r.id);return o?`${e.decisionKind} \xB7 ${o.name}`:`${e.decisionKind} \xB7 ${r.id} (missing)`}case"page":return`${e.boardKind} \xB7 ${R(a)}`;default:return`${r.type} \xB7 ${r.id}`}},ee=(e,a,r)=>[{value:`page:${x}`,label:e.wholeBoard,group:e.boardKind},...a.decisions.map(o=>({value:z({type:"decision",id:o.id}),label:o.name,group:e.decisionKind}))],R=e=>e.title??"Delegation Poker",ae=(e,a)=>a,re=(e,a)=>{switch(a.type){case"decision":return u(e,a.id)!==void 0;case"page":return a.id===x;default:return!1}},oe=e=>{const a=_(e);return{kind:"view",name:"delegation-poker",label:"Delegation Poker",addable:!1,parseBase:V,emptyBase:K,actions:g,apply:j,hasTarget:re,describe:(r,o,t)=>Q(a,r,o,t),serialize:X,resolveNavigation:ae,commentTargets:(r,o)=>ee(a,r),title:R}},te="dev-process-kit:delegation-poker:skip-strict-confirm",ie=e=>e===!0?!0:null,Oe=e=>{const a=e?ve(ie):be(ie);return{read:()=>a.read(te)===!0,remember:()=>a.write(te,!0)}},Re=(e,a,r,o)=>s`
|
|
2
2
|
<button
|
|
3
3
|
class="dpk-icon-btn"
|
|
4
4
|
type="button"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a5 as G,ah as E,ak as D,X as I,j as X,ag as Et,al as Y,aE as Dt,ai as p,as as l,bp as It,aH as b,I as V,au as At,a8 as A,av as C,a9 as L,aw as w,b8 as J,ax as y,ay as k,ac as g,aD as B,aa as T,ad as Q,bJ as O,aB as Lt,az as Z,aF as Bt,bG as Ot,x as qt,w as Mt,A as tt,z as Ut,l as _t}from"./shared-
|
|
1
|
+
import{a5 as G,ah as E,ak as D,X as I,j as X,ag as Et,al as Y,aE as Dt,ai as p,as as l,bp as It,aH as b,I as V,au as At,a8 as A,av as C,a9 as L,aw as w,b8 as J,ax as y,ay as k,ac as g,aD as B,aa as T,ad as Q,bJ as O,aB as Lt,az as Z,aF as Bt,bG as Ot,x as qt,w as Mt,A as tt,z as Ut,l as _t}from"./shared-BXejn2ZQ.js";import{o as Nt}from"./shared-TrlnHjrJ.js";const zt={active:[],match:"single"},Pt=(s,t)=>t.active.length===0?!0:t.match==="all"?t.active.every(e=>s.includes(e)):t.active.some(e=>s.includes(e)),q=s=>{try{return s.split("/").map(t=>decodeURIComponent(t))}catch{return null}},et="BC:",jt=s=>`${et}${s}`,$={kind:"idle"},M="text/plain",Ht=s=>`${s.type}:${s.id}`,rt=(s,t)=>{const e=(s??"").trim();if(e.length===0)return null;const r=e.indexOf(":");if(r<0)return{type:t,id:e};const a=e.slice(0,r),i=e.slice(r+1);return a.length===0||i.length===0?null:{type:a,id:i}},st=(s,t)=>t<=s.top+s.height/2?"before":"after";class Ft{#e;#r=$;#n;constructor(t){this.#e=t,t.addController(this)}hostDisconnected(){this.reset()}get state(){return this.#r}get item(){return this.#r.kind==="dragging"?this.#r.item:null}isDragging(t,e){const r=this.item;return r!==null&&r.type===t&&r.id===e}isOver(t){return this.#r.kind!=="idle"&&this.#r.over===t}reset(){clearTimeout(this.#n),this.#n=void 0,this.#t($)}source(t){return{dragstart:e=>{e.dataTransfer&&(e.dataTransfer.setData(M,Ht(t)),e.dataTransfer.effectAllowed="move"),clearTimeout(this.#n),this.#n=setTimeout(()=>{this.#n=void 0,this.#t({kind:"dragging",item:t,over:null})},0)},dragend:()=>this.reset()}}target(t){return{dragenter:r=>{this.#i(t.accepts)&&(r.preventDefault(),this.#a(t.key))},dragover:r=>{this.#i(t.accepts)&&(r.preventDefault(),r.dataTransfer&&(r.dataTransfer.dropEffect="move"),this.#a(t.key))},dragleave:()=>{this.isOver(t.key)&&this.#a(null)},drop:r=>{r.preventDefault();const a=rt(r.dataTransfer?.getData(M),t.accepts)??this.item;if(this.#t($),!a||a.type!==t.accepts)return;const i=t.hovered?.(r)??null;t.onDrop({item:{type:t.accepts,id:a.id},hoveredId:i?.id??null,place:i?st(i.element.getBoundingClientRect(),r.clientY):"end",event:r})}}}combine(t,e){const r=()=>{const a=this.item!==null;return e.flatMap(([i,o])=>a||i===t?[o]:[])};return{dragenter:a=>r().forEach(i=>i.dragenter(a)),dragover:a=>r().forEach(i=>i.dragover(a)),dragleave:()=>e.forEach(([,a])=>a.dragleave()),drop:a=>{const i=rt(a.dataTransfer?.getData(M),t)?.type??this.item?.type,o=e.find(([n])=>n===i)?.[1];if(o){o.drop(a);return}a.preventDefault(),this.#t($)}}}#i(t){const e=this.item;return e===null||e.type===t}#a(t){const e=this.#r;if(e.kind==="dragging"){e.over!==t&&this.#t({...e,over:t});return}if(t===null){e.kind==="receiving"&&this.#t($);return}(e.kind==="idle"||e.over!==t)&&this.#t({kind:"receiving",over:t})}#t(t){this.#r!==t&&(this.#r=t,this.#e.requestUpdate())}}const R=(s,t,e,r)=>{const i=s.filter(c=>c!==t).at(-1)??null;if(e===null||r==="end")return i;const o=s.indexOf(t),n=s.indexOf(e);if(n<0)return i;const d=c=>c<=0?null:s.at(c-1)??null;return o>=0?o<n?e:d(n):r==="after"?e:d(n)},at=(s,t)=>new Intl.DateTimeFormat(s,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t)),Kt=G({en:{heading:"Comments",commentsOn:s=>`Comments on \u201C${s}\u201D`,commentCountAria:s=>`${s} comment${s===1?"":"s"}`,empty:"No comments yet.",add:"Add comment",cancel:"Cancel",deleteComment:"Delete comment",sendFailed:"Could not save the comment.",commentDate:s=>at("en-US",s)},ja:{heading:"\u30B3\u30E1\u30F3\u30C8",commentsOn:s=>`\u300C${s}\u300D\u306E\u30B3\u30E1\u30F3\u30C8`,commentCountAria:s=>`\u30B3\u30E1\u30F3\u30C8 ${s} \u4EF6`,empty:"\u30B3\u30E1\u30F3\u30C8\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",add:"\u30B3\u30E1\u30F3\u30C8\u3092\u8FFD\u52A0",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",deleteComment:"\u30B3\u30E1\u30F3\u30C8\u3092\u524A\u9664",sendFailed:"\u30B3\u30E1\u30F3\u30C8\u3092\u4FDD\u5B58\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002",commentDate:s=>at("ja-JP",s)}}),Wt=E`
|
|
2
2
|
:host {
|
|
3
3
|
display: inline-block;
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as _}from"./shared-
|
|
1
|
+
import{a as _}from"./shared-BdIN9A6O.js";import{a5 as N,au as R,av as f,aw as c,aa as v,ac as p,aM as G,ax as Y,ay as I,az as U,S as u,C as k,h as V,aH as x,ai as d,as as l,by as J,aY as W,b4 as Q,y as X,ah as Z,V as w}from"./shared-BXejn2ZQ.js";const m=N({en:{wholeDeck:"Whole deck",slideGroup:"Slide",outline:"Slides",previous:"Previous slide",next:"Next slide",position:(t,e)=>`Slide ${t} of ${e}`,commentOnSlide:"Comment on this slide",commentPlaceholder:"A question, or what should change (passed to the agent)",addComment:"Add comment",deleteComment:"Delete this comment",submitHint:"\u2318 / Ctrl + Enter",fullscreen:"Full screen",fullscreenHint:"\u2190 \u2192 to move \xB7 Esc to leave",noSlidesBefore:"There are no slides yet. Add them to ",noSlidesAfter:" in the base data."},ja:{wholeDeck:"\u30C7\u30C3\u30AD\u5168\u4F53",slideGroup:"\u30B9\u30E9\u30A4\u30C9",outline:"\u30B9\u30E9\u30A4\u30C9",previous:"\u524D\u306E\u30B9\u30E9\u30A4\u30C9",next:"\u6B21\u306E\u30B9\u30E9\u30A4\u30C9",position:(t,e)=>`${e} \u679A\u4E2D ${t} \u679A\u76EE`,commentOnSlide:"\u3053\u306E\u30B9\u30E9\u30A4\u30C9\u306B\u30B3\u30E1\u30F3\u30C8",commentPlaceholder:"\u8CEA\u554F\u3084\u3001\u5909\u3048\u3066\u307B\u3057\u3044\u3053\u3068\uFF08Agent \u306B\u6E21\u308B\uFF09",addComment:"\u30B3\u30E1\u30F3\u30C8\u3092\u8FFD\u52A0",deleteComment:"\u3053\u306E\u30B3\u30E1\u30F3\u30C8\u3092\u524A\u9664",submitHint:"\u2318 / Ctrl + Enter",fullscreen:"\u5168\u753B\u9762\u8868\u793A",fullscreenHint:"\u2190 \u2192 \u3067\u79FB\u52D5 \xB7 Esc \u3067\u623B\u308B",noSlidesBefore:"\u30B9\u30E9\u30A4\u30C9\u304C\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002base data \u306E ",noSlidesAfter:" \u306B\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}}),y=["title","section","content"],ee=f({id:G,layout:c(U(y),"content"),title:Y(p(),I(1)),subtitle:c(p(),""),points:c(v(p()),[])}),$=f({title:c(p(),""),slides:c(v(ee),[])}),S=t=>{const e=R($,t),i=new Set;for(const s of e.slides){if(i.has(s.id))throw new Error(`duplicate slide id: ${s.id}`);i.add(s.id)}return{title:e.title,slides:e.slides}},C=()=>({title:"",slides:[]}),r=(t,e)=>e===void 0?-1:t.slides.findIndex(i=>i.id===e),q=(t,e)=>t.slides[r(t,e)],T=t=>t.title===""?"Slides":t.title,h=(t,e)=>`${e+1}. ${t.title}`,E=(t,e,i)=>{switch(i.type){case"slide":{const s=r(e,i.id),n=e.slides[s];return n===void 0?i.id:h(n,s)}case"page":return t.wholeDeck;default:return i.id}},z=(t,e,i)=>({title:e.type,targetLabel:E(t,i,e.target),tone:"meta"}),A=t=>`${t.type} ${u(t.target)} ${JSON.stringify(t.payload)}`,D=(t,e)=>e.slides.map((i,s)=>({value:u({type:"slide",id:i.id}),label:h(i,s),group:t.slideGroup})),M=(t,e,i)=>{const s=r(e,i.slide),n=e.slides[s];return n===void 0?null:{value:u({type:"slide",id:n.id}),label:h(n,s),group:t.slideGroup}},H=(t,e)=>{const i=t.slides[r(t,e.slide)]??t.slides[0],s={...e};return i?s.slide=i.id:delete s.slide,s},F=(t,e)=>{const i=r(t,e.slide),s=i===-1?0:i,n=t.slides[s];return n===void 0?null:{slide:n,index:s,total:t.slides.length,previous:t.slides[s-1],next:t.slides[s+1]}},te=(t,e)=>t.filter(i=>i.type===k&&i.target.type==="slide"&&i.target.id===e).map(i=>({id:i.id,body:V(i)})).filter(i=>i.body!==""),L=(t,e)=>{switch(e.type){case"slide":return q(t,e.id)!==void 0;case"page":return!0;default:return!1}},O=t=>{const e=m(t);return{kind:"view",name:"slides",label:"Slides",addable:!1,parseBase:S,emptyBase:C,actions:{},apply:()=>null,hasTarget:L,describe:(i,s)=>z(e,i,s),serialize:A,resolveNavigation:H,navigationFor:(i,s)=>s.type==="slide"?{slide:s.id}:null,commentTargets:i=>D(e,i),currentTarget:(i,s)=>M(e,i,s),title:T}},ie={ArrowRight:"next",PageDown:"next",ArrowLeft:"previous",PageUp:"previous",Home:"first",End:"last"},P=t=>t.altKey===!0||t.ctrlKey===!0||t.metaKey===!0||t.shiftKey===!0?null:ie[t.key]??null,j=(t,e,i)=>{const s=t.slides.length-1;if(s<0)return;const n=Math.max(r(t,e),0),o={next:Math.min(n+1,s),previous:Math.max(n-1,0),first:0,last:s}[i];return t.slides[o]?.id},se=(t,e)=>{const{state:i,navigation:s}=t,n=s.slide;return l`
|
|
2
2
|
<nav class="outline" aria-label=${e.outline}>
|
|
3
3
|
<div class="outline-head">
|
|
4
4
|
<span class="dpk-label">${e.outline}</span>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bs as z,bt as C,ai as d,bu as L,a5 as B,as as n,a$ as p,bv as E,bw as M,H as v,bx as O,y as j,ah as R}from"./shared-
|
|
1
|
+
import{bs as z,bt as C,ai as d,bu as L,a5 as B,as as n,a$ as p,bv as E,bw as M,H as v,bx as O,y as j,ah as R}from"./shared-BXejn2ZQ.js";import{L as D}from"./shared-CjW1DhGL.js";const N=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"}],["path",{d:"M2 12h20"}]],H=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"}],["path",{d:"M21 3v5h-5"}]],K=z(class extends C{constructor(){super(...arguments),this.key=d}render(e,r){return this.key=e,r}update(e,[r,t]){return r!==this.key&&(L(e),this.key=r),t}}),P=B({en:{comment:"Comment",commentOn:e=>`Comment on ${e}`,submit:"Send",cancel:"Cancel"},ja:{comment:"\u30B3\u30E1\u30F3\u30C8",commentOn:e=>`${e}\u3078\u306E\u30B3\u30E1\u30F3\u30C8`,submit:"\u9001\u4FE1",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB"}}),S=(e,r,t={})=>({body:e,notes:r,submission:e.trim()||null,label:t.label??null,error:t.error??null,key:t.key??null,choice:t.choice??null,submitLabel:t.submitLabel??null}),F=(e,r,t)=>{const a=()=>{r.submission!==null&&t({kind:"comment",body:r.submission})};return n`<div
|
|
2
2
|
class="comment-pop"
|
|
3
3
|
popover="manual"
|
|
4
4
|
role="dialog"
|