dev-process-kit 0.4.1 → 0.4.3

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.
Files changed (32) hide show
  1. package/dist/boards.js +1 -1
  2. package/dist/chunks/{shared-zDGLGSqj.js → shared-0HXwrPVn.js} +54 -54
  3. package/dist/chunks/{shared-C1y1ymFB.js → shared-B2F5LY6f.js} +13 -13
  4. package/dist/chunks/shared-B7MDu9J_.js +6912 -0
  5. package/dist/chunks/{shared-DFW6nDO8.js → shared-BSEt0fN6.js} +9 -2
  6. package/dist/chunks/{shared-CpI8ATFw.js → shared-BugVP_yn.js} +2 -2
  7. package/dist/chunks/shared-C1sWnXGY.js +1 -0
  8. package/dist/chunks/{shared-DPayIyBW.js → shared-C2_qMOyi.js} +1 -1
  9. package/dist/chunks/{shared-DVAXtJwE.js → shared-CeNV36-9.js} +134 -28
  10. package/dist/chunks/{shared-UIN_s3sw.js → shared-CjWMknuE.js} +1 -1
  11. package/dist/chunks/{shared-tkjGdHLh.js → shared-CxTKp5CX.js} +18 -18
  12. package/dist/chunks/{shared-DKxWTptq.js → shared-CyOyXHQO.js} +1 -1
  13. package/dist/chunks/{shared-DIEHJb_n.js → shared-D3Xm9wF8.js} +3 -3
  14. package/dist/chunks/shared-DCnxYUIB.js +3 -0
  15. package/dist/chunks/{shared-giADQT1w.js → shared-DE09J93T.js} +494 -226
  16. package/dist/chunks/{shared-Dp6JBc2T.js → shared-DJCdfkg-.js} +1 -1
  17. package/dist/chunks/{shared-BOQp0U9U.js → shared-Dxf3BUk6.js} +1055 -224
  18. package/dist/chunks/{shared-DOAi2-QH.js → shared-qLSu7C5m.js} +10 -10
  19. package/dist/chunks/{shared-CVBp1_S_.js → shared-tq8QsPTt.js} +2 -2
  20. package/dist/components.js +1 -1
  21. package/dist/index.js +1 -1
  22. package/dist/sync.js +1 -1
  23. package/dist/views/delegation-poker.js +1 -1
  24. package/dist/views/plain.js +1 -1
  25. package/dist/views/prototype.js +1 -1
  26. package/dist/views/slides.js +1 -1
  27. package/dist/views/task-board.js +1 -1
  28. package/dist/views/usm.js +1 -1
  29. package/package.json +1 -1
  30. package/dist/chunks/shared-BTu8ZSVC.js +0 -1
  31. package/dist/chunks/shared-BjLRqdzA.js +0 -6724
  32. package/dist/chunks/shared-CJZKj_HI.js +0 -3
@@ -1,4 +1,4 @@
1
- import{_ as G,a4 as E,a7 as D,O as I,i as Y,a3 as Et,a8 as V,ai as Dt,a5 as p,ag as l,aQ as It,al as b,B as X,aj as At,b3 as Lt,r as Ot,q as Bt,w as J,u as qt,k as Mt}from"./shared-giADQT1w.js";import{o as Ut}from"./shared-D4PPk0Dk.js";import{m as _t,s as A,q as C,o as L,k as w,J as Q,v as y,w as k,j as g,A as O,h as T,n as Z,R as B,g as Nt,x as tt}from"./shared-CJZKj_HI.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`
1
+ import{_ as G,a4 as E,a7 as D,O as I,i as Y,a3 as Et,a8 as V,ai as Dt,a5 as p,ag as l,aO as It,al as b,B as X,aj as At,be as Lt,r as Ot,q as Bt,w as J,u as qt,k as Mt}from"./shared-DE09J93T.js";import{o as Ut}from"./shared-D4PPk0Dk.js";import{m as _t,s as A,q as C,o as L,k as w,J as Q,v as y,w as k,j as g,A as O,h as T,n as Z,T as B,g as Nt,x as tt}from"./shared-DCnxYUIB.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
  }
@@ -720,11 +720,18 @@ import{_ as G,a4 as E,a7 as D,O as I,i as Y,a3 as Et,a8 as V,ai as Dt,a5 as p,ag
720
720
  host places inside reads as something set down on the board rather than
721
721
  text in a table cell. */
722
722
  .matrix-cell {
723
- padding: var(--dpk-matrix-cell-pad);
723
+ display: grid;
724
724
  background: var(--dpk-dots), var(--dpk-paper-sunken);
725
725
  border-left: 1px solid var(--dpk-rule);
726
726
  border-top: 1px solid var(--dpk-rule);
727
727
  }
728
+ /* The slotted content fills the whole cell, pad included, so a host's
729
+ drop target or click area is the box the reader sees rather than its
730
+ content's own height — a row grows to its tallest cell. */
731
+ .matrix-cell ::slotted(*) {
732
+ box-sizing: border-box;
733
+ padding: var(--dpk-matrix-cell-pad);
734
+ }
728
735
 
729
736
  /* Row drag: the head is the handle (hover/active cursor), the whole row the target. */
730
737
  .matrix-row-head[draggable='true'] {
@@ -1,4 +1,4 @@
1
- import{x as se,m as le,q as v,k as E,h as D,C as A,B as l,j as c,v as L,w as S,d as h,o as f,e as ce,p as pe,b as B,f as $}from"./shared-CJZKj_HI.js";import{ap as ue,_ as ge,L as z,aK as me,a0 as ve,$ as he,a5 as p,u as be,ag as s,al as ke,aq as ye,B as fe,aL as $e,a4 as xe,V as q,aM as we,k as Ee}from"./shared-giADQT1w.js";import{o as De}from"./shared-BTu8ZSVC.js";const b=[1,2,3,4,5,6,7],k=se(b,"a delegation level is an integer from 1 to 7"),y=L(c(),S(1)),Ae=v({player:y,level:k,reason:l(c())}),M=v({title:l(c()),parties:l(v({delegator:l(y),delegate:l(y)})),players:E(D(v({id:A,name:y})),[]),decisions:E(D(v({id:A,name:y,description:l(c()),cards:E(D(Ae),[]),agreed:l(k),questions:ue})),[])}),V=e=>{const a=le(M,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)},j=(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:h("PLAY_CARD","decision",v({level:k})),AGREE_LEVEL:h("AGREE_LEVEL","decision",f({level:k})),ADD_DECISION:h("ADD_DECISION","page",f({id:A,name:L(c(),S(1)),description:l(c())}),{dedupeKey:ce}),SET_DECISION_NAME:h("SET_DECISION_NAME","decision",f({name:L(c(),S(1))})),DELETE_DECISION:h("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:{}})},F=(e,a)=>{const r=pe(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,Y={1:"Tell",2:"Sell",3:"Consult",4:"Agree",5:"Advise",6:"Inquire",7:"Delegate"},G={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=>Y[e],levelPhrase:(e,a,r)=>Le[e](a,r),levelLabel:e=>`${e} ${Y[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=>G[e],levelPhrase:(e,a,r)=>Se[e](a,r),levelLabel:e=>`${e} ${G[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,H=(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:j(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:b.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:b.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:F,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):he(ie);return{read:()=>a.read(te)===!0,remember:()=>a.write(te,!0)}},Re=(e,a,r,o)=>s`
1
+ import{x as se,m as le,q as v,k as E,h as D,C as A,B as l,j as c,v as L,w as S,d as h,o as f,e as ce,p as pe,b as B,f as $}from"./shared-DCnxYUIB.js";import{ap as ue,_ as ge,L as z,aW as me,a0 as ve,$ as he,a5 as p,u as be,ag as s,al as ke,aq as ye,B as fe,aX as $e,a4 as xe,V as q,aY as we,k as Ee}from"./shared-DE09J93T.js";import{o as De}from"./shared-C1sWnXGY.js";const b=[1,2,3,4,5,6,7],k=se(b,"a delegation level is an integer from 1 to 7"),y=L(c(),S(1)),Ae=v({player:y,level:k,reason:l(c())}),M=v({title:l(c()),parties:l(v({delegator:l(y),delegate:l(y)})),players:E(D(v({id:A,name:y})),[]),decisions:E(D(v({id:A,name:y,description:l(c()),cards:E(D(Ae),[]),agreed:l(k),questions:ue})),[])}),V=e=>{const a=le(M,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)},j=(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:h("PLAY_CARD","decision",v({level:k})),AGREE_LEVEL:h("AGREE_LEVEL","decision",f({level:k})),ADD_DECISION:h("ADD_DECISION","page",f({id:A,name:L(c(),S(1)),description:l(c())}),{dedupeKey:ce}),SET_DECISION_NAME:h("SET_DECISION_NAME","decision",f({name:L(c(),S(1))})),DELETE_DECISION:h("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:{}})},F=(e,a)=>{const r=pe(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,Y={1:"Tell",2:"Sell",3:"Consult",4:"Agree",5:"Advise",6:"Inquire",7:"Delegate"},G={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=>Y[e],levelPhrase:(e,a,r)=>Le[e](a,r),levelLabel:e=>`${e} ${Y[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=>G[e],levelPhrase:(e,a,r)=>Se[e](a,r),levelLabel:e=>`${e} ${G[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,H=(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:j(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:b.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:b.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}}},W=(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),U={PLAY_CARD:(e,a,r)=>{const o=$(g.PLAY_CARD,a);return{title:e.cardPlayedTitle,tone:"update",body:W(e,u(r,a.target.id)?.yours,o.level)}},AGREE_LEVEL:(e,a,r)=>({title:e.levelAgreedTitle,tone:"update",body:W(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)})},X=(e,a,r,o)=>{let t;try{const i=Object.hasOwn(U,a.type)?U[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}}},Q=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:F,hasTarget:re,describe:(r,o,t)=>X(a,r,o,t),serialize:Q,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):he(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"
@@ -599,4 +599,4 @@ ${i} \u2192 ${d}`}
599
599
  .empty .dpk-btn {
600
600
  justify-self: start;
601
601
  }
602
- `;class de extends q{static{this.styles=[q.styles,Ge]}static{this.properties={mode:{type:String},pending:{state:!0},skipConfirm:{state:!0}}}#a=null;#e=null;#r=new we(this);constructor(){super(),this.mode=null,this.pending=null,this.skipConfirm=!1}connectedCallback(){super.connectedCallback(),this.#a=Oe(this.storage!=="off"&&this.storage!=="memory"),this.skipConfirm=this.#a.read()}definitionFor(a){return oe(a)}renderRegions(a){const r=_(this.locale),o=this.#o(a,r),t={context:a,handlers:o,m:r,mode:P(this.mode),agreeSelects:this.#r},i=a.state.decisions.length===0?ze(t):qe(t);return{header:Be(t),main:s`${i}${Ye(r,this.pending,this.#t(a))}`}}updated(){super.updated();const a=this.#e;if(a!==null){if(this.#e=null,a==="dialog"){this.renderRoot.querySelector('[data-testid="confirm-play-ok"]')?.focus();return}this.renderRoot.querySelector(`[data-decision="${a.decisionId}"] .cell-play[data-level="${a.level}"]`)?.focus()}}#o(a,r){return{play:(o,t)=>{const i=a.state.decisions.find(n=>n.id===o);if(i===void 0)return;const d=H(P(this.mode),i,this.skipConfirm);switch(d.kind){case"play":a.dispatch(m.playCard(o,t));return;case"confirm":this.pending={decisionId:o,decisionName:i.name,level:t,skip:!1},this.#e="dialog";return;case"locked":return;default:B(d)}},agree:(o,t)=>{a.dispatch(m.agreeLevel(o,t))},addDecision:()=>{const o=Ee("decision",C(a.state));a.dispatch(m.addDecision(o,r.newDecision))},rename:(o,t)=>{a.dispatch(m.setDecisionName(o,t))},deleteDecision:o=>{a.dispatch(m.deleteDecision(o))},comment:o=>this.requestComment(o)}}#t(a){const r=o=>{this.pending=null,this.#e={decisionId:o.decisionId,level:o.level}};return{toggleSkip:o=>{this.pending!==null&&(this.pending={...this.pending,skip:o})},confirm:()=>{const o=this.pending;o!==null&&(o.skip&&(this.#a?.remember(),this.skipConfirm=!0),a.dispatch(m.playCard(o.decisionId,o.level)),r(o))},cancel:()=>{this.pending!==null&&r(this.pending)}}}}const ne=()=>{customElements.get("dpk-view-delegation-poker")||customElements.define("dpk-view-delegation-poker",de)},He=Object.freeze(Object.defineProperty({__proto__:null,DELEGATION_LEVELS:b,DELEGATION_POKER_PAGE:x,DpkViewDelegationPoker:de,allDelegationPokerIds:C,applyDelegationPokerAction:F,defineDelegationPokerElement:ne,delegationLevelSchema:k,delegationParties:I,delegationPokerAction:m,delegationPokerActions:g,delegationPokerBaseSchema:M,delegationPokerCommentTargets:ee,delegationPokerDefinitionFor:oe,delegationPokerHasTarget:re,delegationPokerMessages:_,delegationPokerTargetLabel:Z,delegationPokerTitle:R,describeDelegationPokerAction:Q,emptyDelegationPokerBase:K,findDecision:u,findPlayer:j,isLocked:N,parseDelegationPokerBase:V,parsePlayMode:P,playIntent:H,presentBoard:O,resolveDelegationPokerNavigation:ae,serializeDelegationPokerAction:X},Symbol.toStringTag,{value:"Module"}));export{ne as d,He as i};
602
+ `;class de extends q{static{this.styles=[q.styles,Ge]}static{this.properties={mode:{type:String},pending:{state:!0},skipConfirm:{state:!0}}}#a=null;#e=null;#r=new we(this);constructor(){super(),this.mode=null,this.pending=null,this.skipConfirm=!1}connectedCallback(){super.connectedCallback(),this.#a=Oe(this.storage!=="off"&&this.storage!=="memory"),this.skipConfirm=this.#a.read()}definitionFor(a){return oe(a)}renderRegions(a){const r=_(this.locale),o=this.#o(a,r),t={context:a,handlers:o,m:r,mode:P(this.mode),agreeSelects:this.#r},i=a.state.decisions.length===0?ze(t):qe(t);return{header:Be(t),main:s`${i}${Ye(r,this.pending,this.#t(a))}`}}updated(){super.updated();const a=this.#e;if(a!==null){if(this.#e=null,a==="dialog"){this.renderRoot.querySelector('[data-testid="confirm-play-ok"]')?.focus();return}this.renderRoot.querySelector(`[data-decision="${a.decisionId}"] .cell-play[data-level="${a.level}"]`)?.focus()}}#o(a,r){return{play:(o,t)=>{const i=a.state.decisions.find(n=>n.id===o);if(i===void 0)return;const d=H(P(this.mode),i,this.skipConfirm);switch(d.kind){case"play":a.dispatch(m.playCard(o,t));return;case"confirm":this.pending={decisionId:o,decisionName:i.name,level:t,skip:!1},this.#e="dialog";return;case"locked":return;default:B(d)}},agree:(o,t)=>{a.dispatch(m.agreeLevel(o,t))},addDecision:()=>{const o=Ee("decision",C(a.state));a.dispatch(m.addDecision(o,r.newDecision))},rename:(o,t)=>{a.dispatch(m.setDecisionName(o,t))},deleteDecision:o=>{a.dispatch(m.deleteDecision(o))},comment:o=>this.requestComment(o)}}#t(a){const r=o=>{this.pending=null,this.#e={decisionId:o.decisionId,level:o.level}};return{toggleSkip:o=>{this.pending!==null&&(this.pending={...this.pending,skip:o})},confirm:()=>{const o=this.pending;o!==null&&(o.skip&&(this.#a?.remember(),this.skipConfirm=!0),a.dispatch(m.playCard(o.decisionId,o.level)),r(o))},cancel:()=>{this.pending!==null&&r(this.pending)}}}}const ne=()=>{customElements.get("dpk-view-delegation-poker")||customElements.define("dpk-view-delegation-poker",de)},He=Object.freeze(Object.defineProperty({__proto__:null,DELEGATION_LEVELS:b,DELEGATION_POKER_PAGE:x,DpkViewDelegationPoker:de,allDelegationPokerIds:C,applyDelegationPokerAction:F,defineDelegationPokerElement:ne,delegationLevelSchema:k,delegationParties:I,delegationPokerAction:m,delegationPokerActions:g,delegationPokerBaseSchema:M,delegationPokerCommentTargets:ee,delegationPokerDefinitionFor:oe,delegationPokerHasTarget:re,delegationPokerMessages:_,delegationPokerTargetLabel:Z,delegationPokerTitle:R,describeDelegationPokerAction:X,emptyDelegationPokerBase:K,findDecision:u,findPlayer:j,isLocked:N,parseDelegationPokerBase:V,parsePlayMode:P,playIntent:H,presentBoard:O,resolveDelegationPokerNavigation:ae,serializeDelegationPokerAction:Q},Symbol.toStringTag,{value:"Module"}));export{ne as d,He as i};
@@ -0,0 +1 @@
1
+ import{a5 as r}from"./shared-DE09J93T.js";const t=o=>o??r;export{t as o};
@@ -1 +1 @@
1
- import{_ as S,L as T,V as _}from"./shared-giADQT1w.js";import{m as j,q as a,k as o,h as k,j as l,C as B,v as E,w as $}from"./shared-CJZKj_HI.js";const r=S({en:{wholePage:"Whole page",sectionGroup:"Section"},ja:{wholePage:"\u30DA\u30FC\u30B8\u5168\u4F53",sectionGroup:"\u30BB\u30AF\u30B7\u30E7\u30F3"}}),x=a({id:B,title:E(l(),$(1))}),c=a({title:o(l(),""),sections:o(k(x),[])}),p=t=>{const e=j(c,t),i=new Set;for(const n of e.sections){if(i.has(n.id))throw new Error(`duplicate section id: ${n.id}`);i.add(n.id)}return{title:e.title,sections:e.sections}},d=()=>({title:"",sections:[]}),s=(t,e)=>t.sections.find(i=>i.id===e),m=t=>t.title===""?"Plain":t.title,u=(t,e,i)=>{switch(i.type){case"section":return s(e,i.id)?.title??i.id;case"page":return t.wholePage;default:return i.id}},g=(t,e,i)=>({title:e.type,targetLabel:u(t,i,e.target),tone:"meta"}),f=t=>`${t.type} ${T(t.target)} ${JSON.stringify(t.payload)}`,h=(t,e)=>e.sections.map(i=>({value:`section:${i.id}`,label:i.title,group:t.sectionGroup})),w=(t,e)=>e,y=(t,e)=>{switch(e.type){case"section":return s(t,e.id)!==void 0;case"page":return!0;default:return!1}},P=t=>{const e=r(t);return{kind:"view",name:"plain",label:"Plain",addable:!1,parseBase:p,emptyBase:d,actions:{},apply:()=>null,hasTarget:y,describe:(i,n)=>g(e,i,n),serialize:f,resolveNavigation:w,commentTargets:i=>h(e,i),title:m}};class b extends _{definitionFor(e){return P(e)}renderRegions(e){return{}}}const v=()=>{customElements.get("dpk-view-plain")||customElements.define("dpk-view-plain",b)},L=Object.freeze(Object.defineProperty({__proto__:null,DpkViewPlain:b,definePlainElement:v,describePlainAction:g,emptyPlainBase:d,findSection:s,parsePlainBase:p,plainBaseSchema:c,plainCommentTargets:h,plainDefinitionFor:P,plainHasTarget:y,plainMessages:r,plainTargetLabel:u,plainTitle:m,resolvePlainNavigation:w,serializePlainAction:f},Symbol.toStringTag,{value:"Module"}));export{v as d,L as i};
1
+ import{_ as S,L as T,V as _}from"./shared-DE09J93T.js";import{m as j,q as a,k as o,h as k,j as l,C as B,v as E,w as $}from"./shared-DCnxYUIB.js";const r=S({en:{wholePage:"Whole page",sectionGroup:"Section"},ja:{wholePage:"\u30DA\u30FC\u30B8\u5168\u4F53",sectionGroup:"\u30BB\u30AF\u30B7\u30E7\u30F3"}}),x=a({id:B,title:E(l(),$(1))}),c=a({title:o(l(),""),sections:o(k(x),[])}),p=t=>{const e=j(c,t),i=new Set;for(const n of e.sections){if(i.has(n.id))throw new Error(`duplicate section id: ${n.id}`);i.add(n.id)}return{title:e.title,sections:e.sections}},d=()=>({title:"",sections:[]}),s=(t,e)=>t.sections.find(i=>i.id===e),m=t=>t.title===""?"Plain":t.title,u=(t,e,i)=>{switch(i.type){case"section":return s(e,i.id)?.title??i.id;case"page":return t.wholePage;default:return i.id}},g=(t,e,i)=>({title:e.type,targetLabel:u(t,i,e.target),tone:"meta"}),f=t=>`${t.type} ${T(t.target)} ${JSON.stringify(t.payload)}`,h=(t,e)=>e.sections.map(i=>({value:`section:${i.id}`,label:i.title,group:t.sectionGroup})),w=(t,e)=>e,y=(t,e)=>{switch(e.type){case"section":return s(t,e.id)!==void 0;case"page":return!0;default:return!1}},P=t=>{const e=r(t);return{kind:"view",name:"plain",label:"Plain",addable:!1,parseBase:p,emptyBase:d,actions:{},apply:()=>null,hasTarget:y,describe:(i,n)=>g(e,i,n),serialize:f,resolveNavigation:w,commentTargets:i=>h(e,i),title:m}};class b extends _{definitionFor(e){return P(e)}renderRegions(e){return{}}}const v=()=>{customElements.get("dpk-view-plain")||customElements.define("dpk-view-plain",b)},L=Object.freeze(Object.defineProperty({__proto__:null,DpkViewPlain:b,definePlainElement:v,describePlainAction:g,emptyPlainBase:d,findSection:s,parsePlainBase:p,plainBaseSchema:c,plainCommentTargets:h,plainDefinitionFor:P,plainHasTarget:y,plainMessages:r,plainTargetLabel:u,plainTitle:m,resolvePlainNavigation:w,serializePlainAction:f},Symbol.toStringTag,{value:"Module"}));export{v as d,L as i};
@@ -1,4 +1,4 @@
1
- import{aT as z,aU as C,a5 as d,aV as L,_ as B,ag as n,ay as p,aW as E,aX as M,A as v,aY as O,t as j,a4 as R}from"./shared-giADQT1w.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"}]],K=[["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"}]],P=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}}),U=B({en:{comment:"Comment",commentOn:e=>`Comment on ${e}`,submit:"Add",cancel:"Cancel"},ja:{comment:"\u30B3\u30E1\u30F3\u30C8",commentOn:e=>`${e}\u3078\u306E\u30B3\u30E1\u30F3\u30C8`,submit:"\u8FFD\u52A0",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB"}}),F=(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}),G=(e,r,t)=>{const a=()=>{r.submission!==null&&t({kind:"comment",body:r.submission})};return n`<div
1
+ import{b3 as L,b4 as B,a5 as d,b5 as E,_ as M,a4 as v,ag as n,r as D,ay as c,b6 as O,b7 as j,A as $,b8 as K,t as R}from"./shared-DE09J93T.js";import{L as N}from"./shared-CjW1DhGL.js";const H=[["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"}]],P=[["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"}]],U=L(class extends B{constructor(){super(...arguments),this.key=d}render(e,r){return this.key=e,r}update(e,[r,t]){return r!==this.key&&(E(e),this.key=r),t}}),F=M({en:{comment:"Comment",commentOn:e=>`Comment on ${e}`,submit:"Add",cancel:"Cancel"},ja:{comment:"\u30B3\u30E1\u30F3\u30C8",commentOn:e=>`${e}\u3078\u306E\u30B3\u30E1\u30F3\u30C8`,submit:"\u8FFD\u52A0",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB"}}),G=(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,placeholder:t.placeholder??null}),S=(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"
@@ -8,7 +8,7 @@ import{aT as z,aU as C,a5 as d,aV as L,_ as B,ag as n,ay as p,aW as E,aX as M,A
8
8
  >
9
9
  ${r.label?n`<strong class="comment-target">${r.label}</strong>`:d}
10
10
  ${r.error?n`<p class="comment-error" role="alert">${r.error}</p>`:d}
11
- ${r.choice?H(r.choice,t):d}
11
+ ${r.choice?m(r.choice,t):d}
12
12
  ${r.notes.length?n`<ul class="comment-list">
13
13
  ${r.notes.map(o=>n`<li>${o}</li>`)}
14
14
  </ul>`:d}
@@ -33,7 +33,7 @@ import{aT as z,aU as C,a5 as d,aV as L,_ as B,ag as n,ay as p,aW as E,aX as M,A
33
33
  ${e.cancel}
34
34
  </button>
35
35
  </div>
36
- </div>`},H=(e,r)=>{const t=e.options.find(a=>a.value===e.value)?.hint;return n`<fieldset class="comment-kinds">
36
+ </div>`},m=(e,r)=>{const t=e.options.find(a=>a.value===e.value)?.hint;return n`<fieldset class="comment-kinds">
37
37
  <legend>${e.label}</legend>
38
38
  ${e.options.map(a=>n`<label class="comment-kind">
39
39
  <input
@@ -46,7 +46,113 @@ import{aT as z,aU as C,a5 as d,aV as L,_ as B,ag as n,ay as p,aW as E,aX as M,A
46
46
  <span>${a.label}</span>
47
47
  </label>`)}
48
48
  </fieldset>
49
- ${t===void 0?d:n`<p class="comment-kind-hint">${t}</p>`}`},$=(e,r)=>{const t=e.trim();if(t==="")return null;try{return t.startsWith("/")?new URL(t,r):new URL(/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:`https://${t}`)}catch{return null}},S=e=>`${e.origin}${e.pathname.replace(/\/+$/,"")}`,W=(e,r)=>{const t=e.trim();return t.startsWith("/")?$(t,r)?.href??t:/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:`https://${t}`},X=e=>{try{return new URL(e).host||e}catch{return e}},_=p(E),V=p(M),J=p(K),Y=p(D),g=p(N),q=(e,r,t)=>{const a=r.length-1;if(e==="ArrowRight")return r[t===a?0:t+1];if(e==="ArrowLeft")return r[t===0?a:t-1];if(e==="Home")return r[0];if(e==="End")return r[a]},Q=e=>{const{view:r,send:t,labels:a}=e,o=s=>i=>{const l=r.tabs[s],k=i.key==="Enter"||i.key===" "?l:q(i.key,r.tabs,s);k!==void 0&&(i.preventDefault(),t({kind:"activate",id:k.id,focus:!0}))};return n`<div class="browser-tabs">
49
+ ${t===void 0?d:n`<p class="comment-kind-hint">${t}</p>`}`},_=(e,r,t)=>{const a=()=>{r.submission!==null&&t({kind:"comment",body:r.submission})},o=r.submitLabel??e.submit;return n`<form
50
+ class="inline-composer"
51
+ @submit=${s=>{s.preventDefault(),a()}}
52
+ >
53
+ ${r.choice?n`<div
54
+ class="inline-composer-kinds"
55
+ @keydown=${s=>{s.key==="Enter"&&s.preventDefault()}}
56
+ >
57
+ ${m(r.choice,t)}
58
+ </div>`:d}
59
+ ${r.error?n`<p class="comment-error" role="alert">${r.error}</p>`:d}
60
+ <div class="inline-composer-box">
61
+ <textarea
62
+ rows="1"
63
+ aria-label=${r.label??r.placeholder??e.comment}
64
+ placeholder=${r.placeholder??d}
65
+ data-dpk-text-key=${r.key??d}
66
+ .value=${r.body}
67
+ @input=${s=>{s.currentTarget instanceof HTMLTextAreaElement&&t({kind:"input",body:s.currentTarget.value})}}
68
+ @keydown=${s=>{s.isComposing||s.key==="Enter"&&(s.ctrlKey||s.metaKey)&&(s.preventDefault(),a())}}
69
+ ></textarea>
70
+ <button
71
+ class="dpk-btn dpk-btn--accent inline-composer-send"
72
+ type="submit"
73
+ aria-label=${o}
74
+ title=${o}
75
+ ?disabled=${r.submission===null}
76
+ >
77
+ ${D()}
78
+ </button>
79
+ </div>
80
+ </form>`},W=v`
81
+ .inline-composer {
82
+ display: grid;
83
+ gap: 8px;
84
+ }
85
+
86
+ .inline-composer .comment-kinds {
87
+ font-size: var(--dpk-text-2xs);
88
+ }
89
+
90
+ .inline-composer .comment-error {
91
+ margin: 0;
92
+ color: var(--dpk-danger);
93
+ font-size: var(--dpk-text-2xs);
94
+ }
95
+
96
+ .inline-composer-box {
97
+ display: flex;
98
+ align-items: flex-end;
99
+ gap: 6px;
100
+ padding: 4px 4px 4px 10px;
101
+ border: 1px solid var(--dpk-rule-strong);
102
+ border-radius: var(--dpk-radius-md);
103
+ background: var(--dpk-paper-raised);
104
+ box-shadow: inset 0 1px 2px var(--dpk-shade-1);
105
+ transition:
106
+ border-color var(--dpk-dur) var(--dpk-ease),
107
+ box-shadow var(--dpk-dur) var(--dpk-ease);
108
+ }
109
+
110
+ .inline-composer-box:hover {
111
+ border-color: var(--dpk-rule-hover);
112
+ }
113
+
114
+ .inline-composer-box:focus-within {
115
+ border-color: var(--dpk-blue);
116
+ box-shadow: var(--dpk-focus);
117
+ transition-duration: var(--dpk-dur-fast);
118
+ }
119
+
120
+ .inline-composer-box textarea {
121
+ flex: 1;
122
+ min-width: 0;
123
+ min-height: 26px;
124
+ max-height: calc(1.5em * 8 + 8px);
125
+ padding: 4px 0;
126
+ border: 0;
127
+ outline: none;
128
+ background: transparent;
129
+ color: var(--dpk-ink);
130
+ font: inherit;
131
+ font-size: var(--dpk-text-sm);
132
+ line-height: 1.5;
133
+ resize: none;
134
+ field-sizing: content;
135
+ }
136
+
137
+ .inline-composer-box textarea::placeholder {
138
+ color: var(--dpk-ink-faint);
139
+ }
140
+
141
+ .inline-composer-send {
142
+ flex: none;
143
+ display: inline-grid;
144
+ place-items: center;
145
+ width: 28px;
146
+ height: 28px;
147
+ padding: 0;
148
+ min-height: 0;
149
+ }
150
+
151
+ .inline-composer-send svg {
152
+ width: 16px;
153
+ height: 16px;
154
+ }
155
+ `,y=(e,r)=>{const t=e.trim();if(t==="")return null;try{return t.startsWith("/")?new URL(t,r):new URL(/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:`https://${t}`)}catch{return null}},X=e=>`${e.origin}${e.pathname.replace(/\/+$/,"")}`,q=(e,r)=>{const t=e.trim();return t.startsWith("/")?y(t,r)?.href??t:/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:`https://${t}`},J=e=>{try{return new URL(e).host||e}catch{return e}},V=c(O),Q=c(j),Y=c(P),Z=c(N),f=c(H),ee=(e,r,t)=>{const a=r.length-1;if(e==="ArrowRight")return r[t===a?0:t+1];if(e==="ArrowLeft")return r[t===0?a:t-1];if(e==="Home")return r[0];if(e==="End")return r[a]},re=e=>{const{view:r,send:t,labels:a}=e,o=s=>i=>{const l=r.tabs[s],k=i.key==="Enter"||i.key===" "?l:ee(i.key,r.tabs,s);k!==void 0&&(i.preventDefault(),t({kind:"activate",id:k.id,focus:!0}))};return n`<div class="browser-tabs">
50
156
  <div class="browser-tab-list" role="tablist" aria-label=${a.tabs}>
51
157
  ${r.tabs.map((s,i)=>n`<div
52
158
  class="browser-tab"
@@ -57,9 +163,9 @@ import{aT as z,aU as C,a5 as d,aV as L,_ as B,ag as n,ay as p,aW as E,aX as M,A
57
163
  @click=${()=>t({kind:"activate",id:s.id})}
58
164
  @keydown=${o(i)}
59
165
  >
60
- <span class="browser-favicon">${g()}</span>
166
+ <span class="browser-favicon">${f()}</span>
61
167
  <span class="browser-tab-title">${s.title}</span>
62
- ${y(e,s.id)}
168
+ ${T(e,s.id)}
63
169
  </div>`)}
64
170
  </div>
65
171
  <button
@@ -69,18 +175,18 @@ import{aT as z,aU as C,a5 as d,aV as L,_ as B,ag as n,ay as p,aW as E,aX as M,A
69
175
  title=${a.newTab}
70
176
  @click=${()=>t({kind:"new-tab"})}
71
177
  >
72
- ${v()}
178
+ ${$()}
73
179
  </button>
74
180
  ${e.extra??d}
75
- </div>`},y=(e,r)=>n`<button
181
+ </div>`},T=(e,r)=>n`<button
76
182
  class="browser-tab-close"
77
183
  type="button"
78
184
  aria-label=${e.labels.closeTab}
79
185
  title=${e.labels.closeTab}
80
186
  @click=${t=>{t.stopPropagation(),e.send({kind:"close-tab",id:r})}}
81
187
  >
82
- ${j()}
83
- </button>`,Z={back:_,forward:V,reload:J},c=(e,r)=>{const{view:t,send:a,labels:o}=e,s=o[r],i={back:!t.canBack,forward:!t.canForward,reload:t.entry?.kind!=="page"}[r];return n`<button
188
+ ${R()}
189
+ </button>`,te={back:V,forward:Q,reload:Y},p=(e,r)=>{const{view:t,send:a,labels:o}=e,s=o[r],i={back:!t.canBack,forward:!t.canForward,reload:t.entry?.kind!=="page"}[r];return n`<button
84
190
  class=${`browser-nav browser-${r}`}
85
191
  type="button"
86
192
  aria-label=${s}
@@ -88,11 +194,11 @@ import{aT as z,aU as C,a5 as d,aV as L,_ as B,ag as n,ay as p,aW as E,aX as M,A
88
194
  ?disabled=${i}
89
195
  @click=${()=>a({kind:r})}
90
196
  >
91
- ${Z[r]()}
92
- </button>`},ee=e=>{const{view:r,send:t,labels:a,phone:o}=e,s=r.profile??a.guest;return n`<div class="browser-toolbar">
93
- ${o?d:n`${c(e,"back")} ${c(e,"forward")} ${c(e,"reload")}`}
197
+ ${te[r]()}
198
+ </button>`},ae=e=>{const{view:r,send:t,labels:a,phone:o}=e,s=r.profile??a.guest;return n`<div class="browser-toolbar">
199
+ ${o?d:n`${p(e,"back")} ${p(e,"forward")} ${p(e,"reload")}`}
94
200
  <div class="browser-address-form">
95
- <span class="browser-lock">${r.entry?.kind==="page"?Y():g()}</span>
201
+ <span class="browser-lock">${r.entry?.kind==="page"?Z():f()}</span>
96
202
  <input
97
203
  class="browser-address"
98
204
  type="text"
@@ -100,7 +206,7 @@ import{aT as z,aU as C,a5 as d,aV as L,_ as B,ag as n,ay as p,aW as E,aX as M,A
100
206
  aria-label=${a.address}
101
207
  spellcheck="false"
102
208
  autocomplete="off"
103
- .value=${O(r.url)}
209
+ .value=${K(r.url)}
104
210
  @focus=${i=>{i.currentTarget instanceof HTMLInputElement&&i.currentTarget.select()}}
105
211
  @keydown=${i=>{const l=i.currentTarget;if(!(!(l instanceof HTMLInputElement)||i.isComposing)){if(i.key==="Enter"){if(i.preventDefault(),l.value.trim()==="")return;l.blur(),t({kind:"address",input:l.value});return}i.key==="Escape"&&(i.preventDefault(),l.value=r.url,l.blur())}}}
106
212
  />
@@ -109,9 +215,9 @@ import{aT as z,aU as C,a5 as d,aV as L,_ as B,ag as n,ay as p,aW as E,aX as M,A
109
215
  <span class="browser-avatar" aria-hidden="true">${Array.from(s)[0]??""}</span>
110
216
  ${o?d:n`<span class="browser-profile-name">${s}</span>`}
111
217
  </span>
112
- </div>`},re=e=>n`${e.phone?d:Q(e)} ${ee(e)}
113
- <div class="browser-progress" aria-hidden="true"></div>`,te=e=>{if(!e.phone)return d;const{view:r,send:t,labels:a}=e;return n`<div class="browser-bottom">
114
- ${c(e,"back")} ${c(e,"forward")}
218
+ </div>`},oe=e=>n`${e.phone?d:re(e)} ${ae(e)}
219
+ <div class="browser-progress" aria-hidden="true"></div>`,se=e=>{if(!e.phone)return d;const{view:r,send:t,labels:a}=e;return n`<div class="browser-bottom">
220
+ ${p(e,"back")} ${p(e,"forward")}
115
221
  <button
116
222
  class="browser-nav browser-new-tab"
117
223
  type="button"
@@ -119,7 +225,7 @@ import{aT as z,aU as C,a5 as d,aV as L,_ as B,ag as n,ay as p,aW as E,aX as M,A
119
225
  title=${a.newTab}
120
226
  @click=${()=>t({kind:"new-tab"})}
121
227
  >
122
- ${v()}
228
+ ${$()}
123
229
  </button>
124
230
  <button
125
231
  class="browser-nav browser-tab-count"
@@ -131,17 +237,17 @@ import{aT as z,aU as C,a5 as d,aV as L,_ as B,ag as n,ay as p,aW as E,aX as M,A
131
237
  >
132
238
  <span class="browser-tab-count-box">${r.tabs.length}</span>
133
239
  </button>
134
- ${c(e,"reload")}
135
- </div>`},ae=e=>{const{view:r,send:t,labels:a}=e;return n`<div class="browser-switcher" role="dialog" aria-label=${a.tabs}>
240
+ ${p(e,"reload")}
241
+ </div>`},ne=e=>{const{view:r,send:t,labels:a}=e;return n`<div class="browser-switcher" role="dialog" aria-label=${a.tabs}>
136
242
  ${r.tabs.map(o=>n`<div class="browser-card" aria-current=${o.active?"true":d}>
137
243
  <button class="browser-card-open" type="button" @click=${()=>t({kind:"activate",id:o.id})}>
138
- <span class="browser-favicon">${g()}</span>
244
+ <span class="browser-favicon">${f()}</span>
139
245
  <span class="browser-card-title">${o.title}</span>
140
246
  <span class="browser-card-url">${o.url}</span>
141
247
  </button>
142
- ${y(e,o.id)}
248
+ ${T(e,o.id)}
143
249
  </div>`)}
144
- </div>`},oe=e=>n`<div class="browser-newtab">
250
+ </div>`},ie=e=>n`<div class="browser-newtab">
145
251
  <p class="browser-newtab-label">${e.labels.shortcuts}</p>
146
252
  <div class="browser-shortcuts">
147
253
  ${e.shortcuts.map(r=>n`<a
@@ -154,12 +260,12 @@ import{aT as z,aU as C,a5 as d,aV as L,_ as B,ag as n,ay as p,aW as E,aX as M,A
154
260
  <span class="browser-shortcut-url">${r.url}</span>
155
261
  </a>`)}
156
262
  </div>
157
- </div>`,se=(e,r)=>n`<div class="browser-unreachable" role="alert">
263
+ </div>`,de=(e,r)=>n`<div class="browser-unreachable" role="alert">
158
264
  <h3>${e.unreachableTitle}</h3>
159
265
  <p>${e.unreachableBody}</p>
160
266
  <code>${r}</code>
161
- </div>`,ne=(e,r)=>{const t=e.view.entry;return n`${e.phone&&e.switcher?ae(e):d}
162
- ${t?.kind==="unreachable"?se(e.labels,t.url):r===void 0?oe(e):r}`},b=e=>JSON.stringify(Object.entries(e).filter(([,r])=>r!==void 0).sort(([r],[t])=>r<t?-1:r>t?1:0)),m=(e,r)=>e?.kind==="page"&&b(e.page)===r,w=e=>`tab-${e}`,ie=e=>({tabs:[{id:w(1),history:[{kind:"page",page:e}],index:0}],activeId:w(1),seen:b(e),nextId:2}),de={id:"",history:[],index:0},u=e=>e.tabs.find(r=>r.id===e.activeId)??e.tabs[0]??de,x=e=>{const r=u(e);return r.history[r.index]},le=e=>u(e).index>0,ce=e=>{const r=u(e);return r.index<r.history.length-1},T=(e,r)=>({...e,tabs:e.tabs.map(t=>t.id===e.activeId?r(t):t)}),h=(e,r)=>T(e,t=>({...t,history:[...t.history.slice(0,t.index+1),r],index:t.index+1})),f=e=>{const r=x(e);return r?.kind==="page"?{...e,seen:b(r.page)}:e},I=(e,r)=>{const t=u(e),a=t.index+r;return a<0||a>=t.history.length?e:f(T(e,o=>({...o,index:a})))},A=(e,r,t)=>{const a=w(e.nextId),o=e.tabs.findIndex(s=>s.id===e.activeId)+1;return f({...e,tabs:[...e.tabs.slice(0,o),{id:a,history:[r],index:0},...e.tabs.slice(o)],activeId:t?e.activeId:a,nextId:e.nextId+1})},pe=(e,r)=>{const t=e.tabs.findIndex(s=>s.id===r);if(t<0)return e;if(e.tabs.length===1){const s=w(e.nextId);return{...e,tabs:[{id:s,history:[{kind:"new-tab"}],index:0}],activeId:s,nextId:e.nextId+1}}const a=e.tabs.filter(s=>s.id!==r);if(r!==e.activeId)return{...e,tabs:a};const o=a[t]??a[t-1];return f({...e,tabs:a,activeId:o?.id??e.activeId})},be=(e,r)=>{const t=r===null?null:b(r);if(t===e.seen)return e;const a={...e,seen:t};return r===null||t===null||m(x(e),t)?a:h(a,{kind:"page",page:r})},ue=(e,r)=>{const t=b(r);return m(x(e),t)?e.seen===t?e:{...e,seen:t}:h({...e,seen:t},{kind:"page",page:r})},we=(e,r)=>{switch(r.kind){case"observe":return be(e,r.page);case"visit":return ue(e,r.page);case"back":return I(e,-1);case"forward":return I(e,1);case"open-tab":return A(e,r.entry,r.background);case"new-tab":return A(e,{kind:"new-tab"},!1);case"unreachable":return h(e,{kind:"unreachable",url:r.url});case"activate":return e.tabs.some(t=>t.id===r.id)&&r.id!==e.activeId?f({...e,activeId:r.id}):e;case"close-tab":return pe(e,r.id);default:return e}},xe=R`
267
+ </div>`,le=(e,r)=>{const t=e.view.entry;return n`${e.phone&&e.switcher?ne(e):d}
268
+ ${t?.kind==="unreachable"?de(e.labels,t.url):r===void 0?ie(e):r}`},b=e=>JSON.stringify(Object.entries(e).filter(([,r])=>r!==void 0).sort(([r],[t])=>r<t?-1:r>t?1:0)),I=(e,r)=>e?.kind==="page"&&b(e.page)===r,w=e=>`tab-${e}`,pe=e=>({tabs:[{id:w(1),history:[{kind:"page",page:e}],index:0}],activeId:w(1),seen:b(e),nextId:2}),ce={id:"",history:[],index:0},u=e=>e.tabs.find(r=>r.id===e.activeId)??e.tabs[0]??ce,x=e=>{const r=u(e);return r.history[r.index]},be=e=>u(e).index>0,ue=e=>{const r=u(e);return r.index<r.history.length-1},z=(e,r)=>({...e,tabs:e.tabs.map(t=>t.id===e.activeId?r(t):t)}),g=(e,r)=>z(e,t=>({...t,history:[...t.history.slice(0,t.index+1),r],index:t.index+1})),h=e=>{const r=x(e);return r?.kind==="page"?{...e,seen:b(r.page)}:e},A=(e,r)=>{const t=u(e),a=t.index+r;return a<0||a>=t.history.length?e:h(z(e,o=>({...o,index:a})))},C=(e,r,t)=>{const a=w(e.nextId),o=e.tabs.findIndex(s=>s.id===e.activeId)+1;return h({...e,tabs:[...e.tabs.slice(0,o),{id:a,history:[r],index:0},...e.tabs.slice(o)],activeId:t?e.activeId:a,nextId:e.nextId+1})},we=(e,r)=>{const t=e.tabs.findIndex(s=>s.id===r);if(t<0)return e;if(e.tabs.length===1){const s=w(e.nextId);return{...e,tabs:[{id:s,history:[{kind:"new-tab"}],index:0}],activeId:s,nextId:e.nextId+1}}const a=e.tabs.filter(s=>s.id!==r);if(r!==e.activeId)return{...e,tabs:a};const o=a[t]??a[t-1];return h({...e,tabs:a,activeId:o?.id??e.activeId})},xe=(e,r)=>{const t=r===null?null:b(r);if(t===e.seen)return e;const a={...e,seen:t};return r===null||t===null||I(x(e),t)?a:g(a,{kind:"page",page:r})},he=(e,r)=>{const t=b(r);return I(x(e),t)?e.seen===t?e:{...e,seen:t}:g({...e,seen:t},{kind:"page",page:r})},fe=(e,r)=>{switch(r.kind){case"observe":return xe(e,r.page);case"visit":return he(e,r.page);case"back":return A(e,-1);case"forward":return A(e,1);case"open-tab":return C(e,r.entry,r.background);case"new-tab":return C(e,{kind:"new-tab"},!1);case"unreachable":return g(e,{kind:"unreachable",url:r.url});case"activate":return e.tabs.some(t=>t.id===r.id)&&r.id!==e.activeId?h({...e,activeId:r.id}):e;case"close-tab":return we(e,r.id);default:return e}},ge=v`
163
269
  /*
164
270
  * A tab strip on a darker band, the active tab merged into the toolbar below
165
271
  * it, round navigation buttons, a pill address bar and the profile of the
@@ -683,4 +789,4 @@ import{aT as z,aU as C,a5 as d,aV as L,_ as B,ag as n,ay as p,aW as E,aX as M,A
683
789
  top: 8px;
684
790
  right: 8px;
685
791
  }
686
- `;export{$ as a,S as b,U as c,u as d,ce as e,le as f,xe as g,X as h,P as i,x as j,re as k,ne as l,te as m,we as n,F as p,G as r,ie as s,W as t};
792
+ `;export{W as a,_ as b,F as c,y as d,X as e,u as f,ue as g,be as h,U as i,J as j,ge as k,x as l,oe as m,le as n,se as o,G as p,fe as q,S as r,pe as s,q as t};